[TEP-COMMIT] [CVS admin] split the categories and products into two separate pages (more work needs to be done here)
hpdl-OfajU3CKLf1/[email protected] 27 Aug 2004 22:13:25 -0000
| Newsgroups | gmane.comp.web.oscommerce.cvs |
|---|---|
| Message-ID | <[email protected]> |
Commit in admin/admin on MAIN
products.php +387 1.12 -> 1.13
categories.php +1 -287 1.154 -> 1.155
includes/filenames.php +1 1.8 -> 1.9
includes/languages/english.php +2 -1 1.119 -> 1.120
/espanol.php +2 -1 1.114 -> 1.115
/german.php +2 -1 1.113 -> 1.114
includes/languages/english/products.php +67 1.5 -> 1.6
/categories.php +31 -84 1.27 -> 1.28
includes/languages/espanol/products.php +67 added 1.1
/categories.php +31 -84 1.24 -> 1.25
includes/languages/german/products.php +67 added 1.1
/categories.php +31 -84 1.25 -> 1.26
templates/default/header.php +2 -1 1.3 -> 1.4
templates/pages/products.php +176 added 1.1
/products_edit.php +428 added 1.1
/products_preview.php +114 added 1.1
/categories.php +1 -123 1.2 -> 1.3
/categories_new_product.php 1.3 removed
/categories_new_product_preview.php 1.1 removed
+1410 -666
5 added + 2 removed + 12 modified, total 19 files
split the categories and products into two separate pages (more work needs to be done here)
add some magic to quickly and easily allow attributes to be assigned to products (more work is also needed here (ie, pending updates for downloadable files))
when you take a look, don't forget to pick up your jaw when you stand up from your chair ;-)
----------
admin /admin
products.php 1.12 -> 1.13
diff -N products.php
--- /dev/null Sat Aug 28 00:13:12 2004
+++ /tmp/cvsAAA6kaOVP Sat Aug 28 00:13:12 2004
@@ -0,0 +1,387 @@
+<?php
+/*
+ $Id$
+
+ osCommerce, Open Source E-Commerce Solutions
+ http://www.oscommerce.com
+
+ Copyright (c) 2004 osCommerce
+
+ Released under the GNU General Public License
+*/
+
+ require('includes/application_top.php');
+
+ $selected_box = 'catalog';
+
+// calculate category path
+ $cPath = (isset($_GET['cPath']) ? $_GET['cPath'] : '');
+
+ if (tep_not_null($cPath)) {
+ $cPath_array = tep_parse_category_path($cPath);
+ $cPath = implode('_', $cPath_array);
+ $current_category_id = $cPath_array[(sizeof($cPath_array)-1)];
+ } else {
+ $current_category_id = 0;
+ }
+
+ $action = (isset($_GET['action']) ? $_GET['action'] : '');
+
+ if (!isset($_GET['page']) || (isset($_GET['page']) && !is_numeric($_GET['page']))) {
+ $_GET['page'] = 1;
+ }
+
+ if (!empty($action)) {
+ switch ($action) {
+ case 'delete_product_confirm':
+ if (isset($_GET['pID']) && isset($_POST['product_categories']) && is_array($_POST['product_categories']) && !empty($_POST['product_categories'])) {
+ $Qpc = $osC_Database->query('delete from :table_products_to_categories where products_id = :products_id and categories_id in :categories_id');
+ $Qpc->bindTable(':table_products_to_categories', TABLE_PRODUCTS_TO_CATEGORIES);
+ $Qpc->bindInt(':products_id', $_GET['pID']);
+ $Qpc->bindRaw(':categories_id', '("' . implode('", "', $_POST['product_categories']) . '")');
+ $Qpc->execute();
+
+ if ($osC_Database->isError() === false) {
+ $Qcheck = $osC_Database->query('select count(*) as total from :table_products_to_categories where products_id = :products_id');
+ $Qcheck->bindTable(':table_products_to_categories', TABLE_PRODUCTS_TO_CATEGORIES);
+ $Qcheck->bindInt(':products_id', $_GET['pID']);
+ $Qcheck->execute();
+
+ if ($Qcheck->valueInt('total') < 1) {
+ tep_remove_product($_GET['pID']);
+ }
+
+ osC_Cache::clear('categories');
+ osC_Cache::clear('also_purchased');
+
+ $messageStack->add_session(SUCCESS_DB_ROWS_UPDATED, 'success');
+ }
+ }
+
+ tep_redirect(tep_href_link(FILENAME_PRODUCTS, 'page=' . $_GET['page'] . '&cPath=' . $cPath));
+ break;
+ case 'move_product_confirm':
+ if (isset($_GET['pID']) && is_numeric($_GET['pID'])) {
+ $Qcheck = $osC_Database->query('select count(*) as total from :table_products_to_categories where products_id = :products_id and categories_id = :categories_id');
+ $Qcheck->bindTable(':table_products_to_categories', TABLE_PRODUCTS_TO_CATEGORIES);
+ $Qcheck->bindInt(':products_id', $_GET['pID']);
+ $Qcheck->bindInt(':categories_id', $_POST['move_to_category_id']);
+ $Qcheck->execute();
+
+ if ($Qcheck->valueInt('total') < 1) {
+ $Qupdate = $osC_Database->query('update :table_products_to_categories set categories_id = :categories_id where products_id = :products_id and categories_id = :current_categories_id');
+ $Qupdate->bindTable(':table_products_to_categories', TABLE_PRODUCTS_TO_CATEGORIES);
+ $Qupdate->bindInt(':categories_id', $_POST['move_to_category_id']);
+ $Qupdate->bindInt(':products_id', $_GET['pID']);
+ $Qupdate->bindInt(':current_categories_id', $current_category_id);
+ $Qupdate->execute();
+
+ if ($Qupdate->affectedRows()) {
+ osC_Cache::clear('categories');
+ osC_Cache::clear('also_purchased');
+
+ $messageStack->add_session(SUCCESS_DB_ROWS_UPDATED, 'success');
+
+ tep_redirect(tep_href_link(FILENAME_PRODUCTS, 'page=' . $_GET['page'] . '&cPath=' . $_POST['move_to_category_id'] . '&pID=' . $_GET['pID']));
+ } else {
+ $messageStack->add_session(WARNING_DB_ROWS_NOT_UPDATED, 'warning');
+ }
+ }
+ }
+
+ tep_redirect(tep_href_link(FILENAME_PRODUCTS, 'page=' . $_GET['page'] . '&cPath=' . $cPath . '&pID=' . $_GET['pID']));
+ break;
+ case 'save_product':
+ if (isset($_POST['product_edit'])) {
+ $action = 'new_product';
+ } else {
+ $error = false;
+
+ $osC_Database->startTransaction();
+
+ if (isset($_GET['pID']) && is_numeric($_GET['pID'])) {
+ $Qproduct = $osC_Database->query('update :table_products set products_quantity = :products_quantity, products_model = :products_model, products_price = :products_price, products_date_available = :products_date_available, products_weight = :products_weight, products_weight_class = :products_weight_class, products_status = :products_status, products_tax_class_id = :products_tax_class_id, manufacturers_id = :manufacturers_id, products_last_modified = now() where products_id = :products_id');
+ $Qproduct->bindInt(':products_id', $_GET['pID']);
+ } else {
+ $Qproduct = $osC_Database->query('insert into :table_products (products_quantity, products_model, products_price, products_date_available, products_weight, products_weight_class, products_status, products_tax_class_id, manufacturers_id, products_date_added) values (:products_quantity, :products_model, :products_price, :products_date_available, :products_weight, :products_weight_class, :products_status, :products_tax_class_id, :manufacturers_id, now())');
+ }
+ $Qproduct->bindTable(':table_products', TABLE_PRODUCTS);
+ $Qproduct->bindInt(':products_quantity', $_POST['products_quantity']);
+ $Qproduct->bindValue(':products_model', $_POST['products_model']);
+ $Qproduct->bindValue(':products_price', $_POST['products_price']);
+ if (date('Y-m-d') < $_POST['products_date_available']) {
+ $Qproduct->bindValue(':products_date_available', $_POST['products_date_available']);
+ } else {
+ $Qproduct->bindRaw(':products_date_available', 'null');
+ }
+ $Qproduct->bindValue(':products_weight', $_POST['products_weight']);
+ $Qproduct->bindInt(':products_weight_class', $_POST['products_weight_class']);
+ $Qproduct->bindInt(':products_status', $_POST['products_status']);
+ $Qproduct->bindInt(':products_tax_class_id', $_POST['products_tax_class_id']);
+ $Qproduct->bindInt(':manufacturers_id', $_POST['manufacturers_id']);
+ $Qproduct->execute();
+
+ if ($osC_Database->isError()) {
+ $error = true;
+ } else {
+ if (isset($_GET['pID']) && is_numeric($_GET['pID'])) {
+ $products_id = $_GET['pID'];
+ } else {
+ $products_id = $osC_Database->nextID();
+
+ $Qp2c = $osC_Database->query('insert into :table_products_to_categories (products_id, categories_id) values (:products_id, :categories_id)');
+ $Qp2c->bindTable(':table_products_to_categories', TABLE_PRODUCTS_TO_CATEGORIES);
+ $Qp2c->bindInt(':products_id', $products_id);
+ $Qp2c->bindInt(':categories_id', $current_category_id);
+ $Qp2c->execute();
+
+ if ($osC_Database->isError()) {
+ $error = true;
+ }
+ }
+ }
+
+ if ($error === false) {
+ if (isset($_POST['products_image']) && !empty($_POST['products_image']) && ($_POST['products_image'] != 'none')) {
+ $Qimage = $osC_Database->query('update :table_products set products_image = :products_image where products_id = :products_id');
+ $Qimage->bindTable(':table_products', TABLE_PRODUCTS);
+ $Qimage->bindValue(':products_image', $_POST['products_image']);
+ $Qimage->bindInt(':products_id', $products_id);
+ $Qimage->execute();
+
+ if ($osC_Database->isError()) {
+ $error = true;
+ }
+ }
+ }
+
+ if ($error === false) {
+ $languages = tep_get_languages();
+ foreach ($languages as $l_entry) {
+ if (isset($_GET['pID']) && is_numeric($_GET['pID'])) {
+ $Qpd = $osC_Database->query('update :table_products_description set products_name = :products_name, products_description = :products_description, products_url = :products_url where products_id = :products_id and language_id = :language_id');
+ } else {
+ $Qpd = $osC_Database->query('insert into :table_products_description (products_id, language_id, products_name, products_description, products_url) values (:products_id, :language_id, :products_name, :products_description, :products_url)');
+ }
+ $Qpd->bindTable(':table_products_description', TABLE_PRODUCTS_DESCRIPTION);
+ $Qpd->bindInt(':products_id', $products_id);
+ $Qpd->bindInt(':language_id', $l_entry['id']);
+ $Qpd->bindValue(':products_name', $_POST['products_name'][$l_entry['id']]);
+ $Qpd->bindValue(':products_description', $_POST['products_description'][$l_entry['id']]);
+ $Qpd->bindValue(':products_url', $_POST['products_url'][$l_entry['id']]);
+ $Qpd->execute();
+
+ if ($osC_Database->isError()) {
+ $error = true;
+ break;
+ }
+ }
+ }
+
+ if ($error === false) {
+ $attributes_array = array();
+
+ if (isset($_POST['attribute_prefix']) && !empty($_POST['attribute_prefix']) && isset($_POST['attribute_price']) && !empty($_POST['attribute_price'])) {
+ foreach ($_POST['attribute_prefix'] as $groups => $attributes) {
+ foreach ($_POST['attribute_prefix'][$groups] as $key => $value) {
+ if (isset($_POST['attribute_price'][$groups][$key]) && !empty($_POST['attribute_price'][$groups][$key])) {
+ $attributes_array[] = $groups . '-' . $key;
+
+ $Qcheck = $osC_Database->query('select products_attributes_id from :table_products_attributes where products_id = :products_id and options_id = :options_id and options_values_id = :options_values_id');
+ $Qcheck->bindTable(':table_products_attributes', TABLE_PRODUCTS_ATTRIBUTES);
+ $Qcheck->bindInt(':products_id', $products_id);
+ $Qcheck->bindInt(':options_id', $groups);
+ $Qcheck->bindInt(':options_values_id', $key);
+ $Qcheck->execute();
+
+ if ($Qcheck->numberOfRows()) {
+ $Qattribute = $osC_Database->query('update :table_products_attributes set options_values_price = :options_values_price, price_prefix = :price_prefix where products_id = :products_id and options_id = :options_id and options_values_id = :options_values_id');
+ } else {
+ $Qattribute = $osC_Database->query('insert into :table_products_attributes (products_id, options_id, options_values_id, options_values_price, price_prefix) values (:products_id, :options_id, :options_values_id, :options_values_price, :price_prefix)');
+ }
+ $Qattribute->bindTable(':table_products_attributes', TABLE_PRODUCTS_ATTRIBUTES);
+ $Qattribute->bindInt(':products_id', $products_id);
+ $Qattribute->bindInt(':options_id', $groups);
+ $Qattribute->bindInt(':options_values_id', $key);
+ $Qattribute->bindValue(':options_values_price', $_POST['attribute_price'][$groups][$key]);
+ $Qattribute->bindValue(':price_prefix', $value);
+ $Qattribute->execute();
+
+ if ($osC_Database->isError()) {
+ $error = true;
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ $Qcheck = $osC_Database->query('select products_attributes_id from :table_products_attributes where products_id = :products_id and concat(options_id, "-", options_values_id) not in (":attributes") limit 1');
+ $Qcheck->bindTable(':table_products_attributes', TABLE_PRODUCTS_ATTRIBUTES);
+ $Qcheck->bindInt(':products_id', $products_id);
+ $Qcheck->bindRaw(':attributes', implode('", "', $attributes_array));
+ $Qcheck->execute();
+
+ if ($Qcheck->numberOfRows()) {
+ $Qdelete = $osC_Database->query('delete from :table_products_attributes where products_id = :products_id and concat(options_id, "-", options_values_id) not in (":attributes")');
+ $Qdelete->bindTable(':table_products_attributes', TABLE_PRODUCTS_ATTRIBUTES);
+ $Qdelete->bindInt(':products_id', $products_id);
+ $Qdelete->bindRaw(':attributes', implode('", "', $attributes_array));
+ $Qdelete->execute();
+
+ if ($osC_Database->isError()) {
+ $error = true;
+ }
+ }
+ }
+
+ if ($error === false) {
+ $osC_Database->commitTransaction();
+
+ osC_Cache::clear('categories');
+ osC_Cache::clear('also_purchased');
+
+ $messageStack->add_session(SUCCESS_DB_ROWS_UPDATED, 'success');
+ } else {
+ $osC_Database->rollbackTransaction();
+
+ $messageStack->add_session(ERROR_DB_ROWS_NOT_UPDATED, 'error');
+ }
+
+ tep_redirect(tep_href_link(FILENAME_PRODUCTS, 'page=' . $_GET['page'] . '&cPath=' . $cPath . '&pID=' . $products_id));
+ }
+ break;
+ case 'copy_to_confirm':
+ if (isset($_GET['pID']) && isset($_POST['categories_id'])) {
+ if ($_POST['copy_as'] == 'link') {
+ if ($_POST['categories_id'] != $current_category_id) {
+ $Qcheck = $osC_Database->query('select count(*) as total from :table_products_to_categories where products_id = :products_id and categories_id = :categories_id');
+ $Qcheck->bindTable(':table_products_to_categories', TABLE_PRODUCTS_TO_CATEGORIES);
+ $Qcheck->bindInt(':products_id', $_GET['pID']);
+ $Qcheck->bindInt(':categories_id', $_POST['categories_id']);
+ $Qcheck->execute();
+
+ if ($Qcheck->valueInt('total') < 1) {
+ $Qcat = $osC_Database->query('insert into :table_products_to_categories (products_id, categories_id) values (:products_id, :categories_id)');
+ $Qcat->bindTable(':table_products_to_categories', TABLE_PRODUCTS_TO_CATEGORIES);
+ $Qcat->bindInt(':products_id', $_GET['pID']);
+ $Qcat->bindInt(':categories_id', $_POST['categories_id']);
+ $Qcat->execute();
+
+ if ($Qcat->affectedRows()) {
+ $messageStack->add_session(SUCCESS_DB_ROWS_UPDATED, 'success');
+
+ tep_redirect(tep_href_link(FILENAME_PRODUCTS, 'page=' . $_GET['page'] . '&cPath=' . $_POST['categories_id'] . '&pID=' . $_GET['pID']));
+ }
+ }
+ } else {
+ $messageStack->add_session(ERROR_CANNOT_LINK_TO_SAME_CATEGORY, 'error');
+ }
+ } elseif ($_POST['copy_as'] == 'duplicate') {
+ $Qproduct = $osC_Database->query('select products_quantity, products_model, products_image, products_price, products_date_available, products_weight, products_tax_class_id, manufacturers_id from :table_products where products_id = :products_id');
+ $Qproduct->bindTable(':table_products', TABLE_PRODUCTS);
+ $Qproduct->bindInt(':products_id', $_GET['pID']);
+ $Qproduct->execute();
+
+ if ($Qproduct->numberOfRows() === 1) {
+ $error = false;
+
+ $osC_Database->startTransaction();
+
+ $Qnew = $osC_Database->query('insert into :table_products (products_quantity, products_model, products_image, products_price, products_date_added, products_date_available, products_weight, products_status, products_tax_class_id, manufacturers_id) values (:products_quantity, :products_model, :products_image, :products_price, now(), :products_date_available, :products_weight, 0, :products_tax_class_id, :manufacturers_id)');
+ $Qnew->bindTable(':table_products', TABLE_PRODUCTS);
+ $Qnew->bindInt(':products_quantity', $Qproduct->valueInt('products_quantity'));
+ $Qnew->bindValue(':products_model', $Qproduct->value('products_model'));
+ $Qnew->bindValue(':products_image', $Qproduct->value('products_image'));
+ $Qnew->bindValue(':products_price', $Qproduct->value('products_price'));
+ $Qnew->bindValue(':products_date_available', $Qproduct->value('products_date_available'));
+ $Qnew->bindValue(':products_weight', $Qproduct->value('products_weight'));
+ $Qnew->bindInt(':products_tax_class_id', $Qproduct->valueInt('products_tax_class_id'));
+ $Qnew->bindInt(':manufacturers_id', $Qproduct->valueInt('manufacturers_id'));
+ $Qnew->execute();
+
+ if ($Qnew->affectedRows()) {
+ $new_product_id = $osC_Database->nextID();
+
+ $Qdesc = $osC_Database->query('select language_id, products_name, products_description, products_url from :table_products_description where products_id = :products_id');
+ $Qdesc->bindTable(':table_products_description', TABLE_PRODUCTS_DESCRIPTION);
+ $Qdesc->bindInt(':products_id', $_GET['pID']);
+ $Qdesc->execute();
+
+ while ($Qdesc->next()) {
+ $Qnewdesc = $osC_Database->query('insert into :table_products_description (products_id, language_id, products_name, products_description, products_url, products_viewed) values (:products_id, :language_id, :products_name, :products_description, :products_url, 0)');
+ $Qnewdesc->bindTable(':table_products_description', TABLE_PRODUCTS_DESCRIPTION);
+ $Qnewdesc->bindInt(':products_id', $new_product_id);
+ $Qnewdesc->bindInt(':language_id', $Qdesc->valueInt('language_id'));
+ $Qnewdesc->bindValue(':products_name', $Qdesc->value('products_name'));
+ $Qnewdesc->bindValue(':products_description', $Qdesc->value('products_description'));
+ $Qnewdesc->bindValue(':products_url', $Qdesc->value('products_url'));
+ $Qnewdesc->execute();
+
+ if ($osC_Database->isError()) {
+ $error = true;
+
+ break;
+ }
+ }
+
+ if ($error === false) {
+ $Qp2c = $osC_Database->query('insert into :table_products_to_categories (products_id, categories_id) values (:products_id, :categories_id)');
+ $Qp2c->bindTable(':table_products_to_categories', TABLE_PRODUCTS_TO_CATEGORIES);
+ $Qp2c->bindInt(':products_id', $new_product_id);
+ $Qp2c->bindInt(':categories_id', $_POST['categories_id']);
+ $Qp2c->execute();
+
+ if ($osC_Database->isError()) {
+ $error = true;
+ }
+ }
+ } else {
+ $error = true;
+ }
+
+ if ($error === false) {
+ $osC_Database->commitTransaction();
+
+ osC_Cache::clear('categories');
+ osC_Cache::clear('also_purchased');
+
+ $messageStack->add_session(SUCCESS_DB_ROWS_UPDATED, 'success');
+
+ tep_redirect(tep_href_link(FILENAME_PRODUCTS, 'page=' . $_GET['page'] . '&cPath=' . $_POST['categories_id'] . '&pID=' . $new_product_id));
+ } else {
+ $osC_Database->rollbackTransaction();
+
+ $messageStack->add_session(ERROR_DB_ROWS_NOT_UPDATED, 'error');
+ }
+ }
+ }
+ }
+
+ tep_redirect(tep_href_link(FILENAME_PRODUCTS, 'page=' . $_GET['page'] . '&cPath=' . $cPath . '&pID=' . $_GET['pID']));
+ break;
+ }
+ }
+
+ require('../includes/classes/currencies.php');
+ $osC_Currencies = new osC_Currencies();
+
+// check if the catalog image directory exists
+ if (is_dir(DIR_FS_CATALOG_IMAGES)) {
+ if (!is_writeable(DIR_FS_CATALOG_IMAGES)) {
+ $messageStack->add(ERROR_CATALOG_IMAGE_DIRECTORY_NOT_WRITEABLE, 'error');
+ }
+ } else {
+ $messageStack->add(ERROR_CATALOG_IMAGE_DIRECTORY_DOES_NOT_EXIST, 'error');
+ }
+
+ switch ($action) {
+ case 'new_product': $page_contents = 'products_edit.php'; break;
+ case 'new_product_preview': $page_contents = 'products_preview.php'; break;
+ default: $page_contents = 'products.php';
+ }
+
+ require('templates/default.php');
+
+ require('includes/application_bottom.php');
+?>
----------
admin /admin
categories.php 1.154 -> 1.155
diff -u -r1.154 -r1.155
--- categories.php 2004/08/24 14:27:07 1.154
+++ categories.php 2004/08/27 22:13:11 1.155
@@ -146,33 +146,6 @@
tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath));
break;
- case 'delete_product_confirm':
- if (isset($_GET['pID']) && isset($_POST['product_categories']) && is_array($_POST['product_categories']) && !empty($_POST['product_categories'])) {
- $Qpc = $osC_Database->query('delete from :table_products_to_categories where products_id = :products_id and categories_id in :categories_id');
- $Qpc->bindTable(':table_products_to_categories', TABLE_PRODUCTS_TO_CATEGORIES);
- $Qpc->bindInt(':products_id', $_GET['pID']);
- $Qpc->bindRaw(':categories_id', '("' . implode('", "', $_POST['product_categories']) . '")');
- $Qpc->execute();
-
- if ($osC_Database->isError() === false) {
- $Qcheck = $osC_Database->query('select count(*) as total from :table_products_to_categories where products_id = :products_id');
- $Qcheck->bindTable(':table_products_to_categories', TABLE_PRODUCTS_TO_CATEGORIES);
- $Qcheck->bindInt(':products_id', $_GET['pID']);
- $Qcheck->execute();
-
- if ($Qcheck->valueInt('total') < 1) {
- tep_remove_product($_GET['pID']);
- }
-
- osC_Cache::clear('categories');
- osC_Cache::clear('also_purchased');
-
- $messageStack->add_session(SUCCESS_DB_ROWS_UPDATED, 'success');
- }
- }
-
- tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath));
- break;
case 'move_category_confirm':
if (isset($_GET['cID']) && ($_GET['cID'] != $_POST['move_to_category_id'])) {
$path = explode('_', tep_get_generated_category_path_ids($_POST['move_to_category_id']));
@@ -199,269 +172,10 @@
tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $_GET['cID']));
break;
- case 'move_product_confirm':
- if (isset($_GET['pID']) && is_numeric($_GET['pID'])) {
- $Qcheck = $osC_Database->query('select count(*) as total from :table_products_to_categories where products_id = :products_id and categories_id = :categories_id');
- $Qcheck->bindTable(':table_products_to_categories', TABLE_PRODUCTS_TO_CATEGORIES);
- $Qcheck->bindInt(':products_id', $_GET['pID']);
- $Qcheck->bindInt(':categories_id', $_POST['move_to_category_id']);
- $Qcheck->execute();
-
- if ($Qcheck->valueInt('total') < 1) {
- $Qupdate = $osC_Database->query('update :table_products_to_categories set categories_id = :categories_id where products_id = :products_id and categories_id = :current_categories_id');
- $Qupdate->bindTable(':table_products_to_categories', TABLE_PRODUCTS_TO_CATEGORIES);
- $Qupdate->bindInt(':categories_id', $_POST['move_to_category_id']);
- $Qupdate->bindInt(':products_id', $_GET['pID']);
- $Qupdate->bindInt(':current_categories_id', $current_category_id);
- $Qupdate->execute();
-
- if ($Qupdate->affectedRows()) {
- osC_Cache::clear('categories');
- osC_Cache::clear('also_purchased');
-
- $messageStack->add_session(SUCCESS_DB_ROWS_UPDATED, 'success');
-
- tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $_POST['move_to_category_id'] . '&pID=' . $_GET['pID']));
- } else {
- $messageStack->add_session(WARNING_DB_ROWS_NOT_UPDATED, 'warning');
- }
- }
- }
-
- tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $_GET['pID']));
- break;
- case 'save_product':
- if (isset($_POST['product_edit'])) {
- $action = 'new_product';
- } else {
- $error = false;
-
- $osC_Database->startTransaction();
-
- if (isset($_GET['pID']) && is_numeric($_GET['pID'])) {
- $Qproduct = $osC_Database->query('update :table_products set products_quantity = :products_quantity, products_model = :products_model, products_price = :products_price, products_date_available = :products_date_available, products_weight = :products_weight, products_weight_class = :products_weight_class, products_status = :products_status, products_tax_class_id = :products_tax_class_id, manufacturers_id = :manufacturers_id, products_last_modified = now() where products_id = :products_id');
- $Qproduct->bindInt(':products_id', $_GET['pID']);
- } else {
- $Qproduct = $osC_Database->query('insert into :table_products (products_quantity, products_model, products_price, products_date_available, products_weight, products_weight_class, products_status, products_tax_class_id, manufacturers_id, products_date_added) values (:products_quantity, :products_model, :products_price, :products_date_available, :products_weight, :products_weight_class, :products_status, :products_tax_class_id, :manufacturers_id, now())');
- }
- $Qproduct->bindTable(':table_products', TABLE_PRODUCTS);
- $Qproduct->bindInt(':products_quantity', $_POST['products_quantity']);
- $Qproduct->bindValue(':products_model', $_POST['products_model']);
- $Qproduct->bindValue(':products_price', $_POST['products_price']);
- if (date('Y-m-d') < $_POST['products_date_available']) {
- $Qproduct->bindValue(':products_date_available', $_POST['products_date_available']);
- } else {
- $Qproduct->bindRaw(':products_date_available', 'null');
- }
- $Qproduct->bindValue(':products_weight', $_POST['products_weight']);
- $Qproduct->bindInt(':products_weight_class', $_POST['products_weight_class']);
- $Qproduct->bindInt(':products_status', $_POST['products_status']);
- $Qproduct->bindInt(':products_tax_class_id', $_POST['products_tax_class_id']);
- $Qproduct->bindInt(':manufacturers_id', $_POST['manufacturers_id']);
- $Qproduct->execute();
-
- if ($osC_Database->isError()) {
- $error = true;
- } else {
- if (isset($_GET['pID']) && is_numeric($_GET['pID'])) {
- $products_id = $_GET['pID'];
- } else {
- $products_id = $osC_Database->nextID();
-
- $Qp2c = $osC_Database->query('insert into :table_products_to_categories (products_id, categories_id) values (:products_id, :categories_id)');
- $Qp2c->bindTable(':table_products_to_categories', TABLE_PRODUCTS_TO_CATEGORIES);
- $Qp2c->bindInt(':products_id', $products_id);
- $Qp2c->bindInt(':categories_id', $current_category_id);
- $Qp2c->execute();
-
- if ($osC_Database->isError()) {
- $error = true;
- }
- }
- }
-
- if ($error === false) {
- if (isset($_POST['products_image']) && !empty($_POST['products_image']) && ($_POST['products_image'] != 'none')) {
- $Qimage = $osC_Database->query('update :table_products set products_image = :products_image where products_id = :products_id');
- $Qimage->bindTable(':table_products', TABLE_PRODUCTS);
- $Qimage->bindValue(':products_image', $_POST['products_image']);
- $Qimage->bindInt(':products_id', $products_id);
- $Qimage->execute();
-
- if ($osC_Database->isError()) {
- $error = true;
- }
- }
- }
-
- if ($error === false) {
- $languages = tep_get_languages();
- foreach ($languages as $l_entry) {
- if (isset($_GET['pID']) && is_numeric($_GET['pID'])) {
- $Qpd = $osC_Database->query('update :table_products_description set products_name = :products_name, products_description = :products_description, products_url = :products_url where products_id = :products_id and language_id = :language_id');
- } else {
- $Qpd = $osC_Database->query('insert into :table_products_description (products_id, language_id, products_name, products_description, products_url) values (:products_id, :language_id, :products_name, :products_description, :products_url)');
- }
- $Qpd->bindTable(':table_products_description', TABLE_PRODUCTS_DESCRIPTION);
- $Qpd->bindInt(':products_id', $products_id);
- $Qpd->bindInt(':language_id', $l_entry['id']);
- $Qpd->bindValue(':products_name', $_POST['products_name'][$l_entry['id']]);
- $Qpd->bindValue(':products_description', $_POST['products_description'][$l_entry['id']]);
- $Qpd->bindValue(':products_url', $_POST['products_url'][$l_entry['id']]);
- $Qpd->execute();
-
- if ($osC_Database->isError()) {
- $error = true;
- break;
- }
- }
- }
-
- if ($error === false) {
- $osC_Database->commitTransaction();
-
- osC_Cache::clear('categories');
- osC_Cache::clear('also_purchased');
-
- $messageStack->add_session(SUCCESS_DB_ROWS_UPDATED, 'success');
- } else {
- $osC_Database->rollbackTransaction();
-
- $messageStack->add_session(ERROR_DB_ROWS_NOT_UPDATED, 'error');
- }
-
- tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $products_id));
- }
- break;
- case 'copy_to_confirm':
- if (isset($_GET['pID']) && isset($_POST['categories_id'])) {
- if ($_POST['copy_as'] == 'link') {
- if ($_POST['categories_id'] != $current_category_id) {
- $Qcheck = $osC_Database->query('select count(*) as total from :table_products_to_categories where products_id = :products_id and categories_id = :categories_id');
- $Qcheck->bindTable(':table_products_to_categories', TABLE_PRODUCTS_TO_CATEGORIES);
- $Qcheck->bindInt(':products_id', $_GET['pID']);
- $Qcheck->bindInt(':categories_id', $_POST['categories_id']);
- $Qcheck->execute();
-
- if ($Qcheck->valueInt('total') < 1) {
- $Qcat = $osC_Database->query('insert into :table_products_to_categories (products_id, categories_id) values (:products_id, :categories_id)');
- $Qcat->bindTable(':table_products_to_categories', TABLE_PRODUCTS_TO_CATEGORIES);
- $Qcat->bindInt(':products_id', $_GET['pID']);
- $Qcat->bindInt(':categories_id', $_POST['categories_id']);
- $Qcat->execute();
-
- if ($Qcat->affectedRows()) {
- $messageStack->add_session(SUCCESS_DB_ROWS_UPDATED, 'success');
-
- tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $_POST['categories_id'] . '&pID=' . $_GET['pID']));
- }
- }
- } else {
- $messageStack->add_session(ERROR_CANNOT_LINK_TO_SAME_CATEGORY, 'error');
- }
- } elseif ($_POST['copy_as'] == 'duplicate') {
- $Qproduct = $osC_Database->query('select products_quantity, products_model, products_image, products_price, products_date_available, products_weight, products_tax_class_id, manufacturers_id from :table_products where products_id = :products_id');
- $Qproduct->bindTable(':table_products', TABLE_PRODUCTS);
- $Qproduct->bindInt(':products_id', $_GET['pID']);
- $Qproduct->execute();
-
- if ($Qproduct->numberOfRows() === 1) {
- $error = false;
-
- $osC_Database->startTransaction();
-
- $Qnew = $osC_Database->query('insert into :table_products (products_quantity, products_model, products_image, products_price, products_date_added, products_date_available, products_weight, products_status, products_tax_class_id, manufacturers_id) values (:products_quantity, :products_model, :products_image, :products_price, now(), :products_date_available, :products_weight, 0, :products_tax_class_id, :manufacturers_id)');
- $Qnew->bindTable(':table_products', TABLE_PRODUCTS);
- $Qnew->bindInt(':products_quantity', $Qproduct->valueInt('products_quantity'));
- $Qnew->bindValue(':products_model', $Qproduct->value('products_model'));
- $Qnew->bindValue(':products_image', $Qproduct->value('products_image'));
- $Qnew->bindValue(':products_price', $Qproduct->value('products_price'));
- $Qnew->bindValue(':products_date_available', $Qproduct->value('products_date_available'));
- $Qnew->bindValue(':products_weight', $Qproduct->value('products_weight'));
- $Qnew->bindInt(':products_tax_class_id', $Qproduct->valueInt('products_tax_class_id'));
- $Qnew->bindInt(':manufacturers_id', $Qproduct->valueInt('manufacturers_id'));
- $Qnew->execute();
-
- if ($Qnew->affectedRows()) {
- $new_product_id = $osC_Database->nextID();
-
- $Qdesc = $osC_Database->query('select language_id, products_name, products_description, products_url from :table_products_description where products_id = :products_id');
- $Qdesc->bindTable(':table_products_description', TABLE_PRODUCTS_DESCRIPTION);
- $Qdesc->bindInt(':products_id', $_GET['pID']);
- $Qdesc->execute();
-
- while ($Qdesc->next()) {
- $Qnewdesc = $osC_Database->query('insert into :table_products_description (products_id, language_id, products_name, products_description, products_url, products_viewed) values (:products_id, :language_id, :products_name, :products_description, :products_url, 0)');
- $Qnewdesc->bindTable(':table_products_description', TABLE_PRODUCTS_DESCRIPTION);
- $Qnewdesc->bindInt(':products_id', $new_product_id);
- $Qnewdesc->bindInt(':language_id', $Qdesc->valueInt('language_id'));
- $Qnewdesc->bindValue(':products_name', $Qdesc->value('products_name'));
- $Qnewdesc->bindValue(':products_description', $Qdesc->value('products_description'));
- $Qnewdesc->bindValue(':products_url', $Qdesc->value('products_url'));
- $Qnewdesc->execute();
-
- if ($osC_Database->isError()) {
- $error = true;
-
- break;
- }
- }
-
- if ($error === false) {
- $Qp2c = $osC_Database->query('insert into :table_products_to_categories (products_id, categories_id) values (:products_id, :categories_id)');
- $Qp2c->bindTable(':table_products_to_categories', TABLE_PRODUCTS_TO_CATEGORIES);
- $Qp2c->bindInt(':products_id', $new_product_id);
- $Qp2c->bindInt(':categories_id', $_POST['categories_id']);
- $Qp2c->execute();
-
- if ($osC_Database->isError()) {
- $error = true;
- }
- }
- } else {
- $error = true;
- }
-
- if ($error === false) {
- $osC_Database->commitTransaction();
-
- osC_Cache::clear('categories');
- osC_Cache::clear('also_purchased');
-
- $messageStack->add_session(SUCCESS_DB_ROWS_UPDATED, 'success');
-
- tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $_POST['categories_id'] . '&pID=' . $new_product_id));
- } else {
- $osC_Database->rollbackTransaction();
-
- $messageStack->add_session(ERROR_DB_ROWS_NOT_UPDATED, 'error');
- }
- }
- }
- }
-
- tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $_GET['pID']));
- break;
}
}
- require('../includes/classes/currencies.php');
- $osC_Currencies = new osC_Currencies();
-
-// check if the catalog image directory exists
- if (is_dir(DIR_FS_CATALOG_IMAGES)) {
- if (!is_writeable(DIR_FS_CATALOG_IMAGES)) {
- $messageStack->add(ERROR_CATALOG_IMAGE_DIRECTORY_NOT_WRITEABLE, 'error');
- }
- } else {
- $messageStack->add(ERROR_CATALOG_IMAGE_DIRECTORY_DOES_NOT_EXIST, 'error');
- }
-
- switch ($action) {
- case 'new_product': $page_contents = 'categories_new_product.php'; break;
- case 'new_product_preview': $page_contents = 'categories_new_product_preview.php'; break;
- default: $page_contents = 'categories.php';
- }
+ $page_contents = 'categories.php';
require('templates/default.php');
----------
admin /admin /includes
filenames.php 1.8 -> 1.9
diff -u -r1.8 -r1.9
--- filenames.php 2004/08/25 20:00:30 1.8
+++ filenames.php 2004/08/27 22:13:12 1.9
@@ -33,6 +33,7 @@
define('FILENAME_ORDERS_INVOICE', 'invoice.php');
define('FILENAME_ORDERS_PACKINGSLIP', 'packingslip.php');
define('FILENAME_ORDERS_STATUS', 'orders_status.php');
+ define('FILENAME_PRODUCTS', 'products.php');
define('FILENAME_PRODUCTS_ATTRIBUTES', 'products_attributes.php');
define('FILENAME_PRODUCTS_EXPECTED', 'products_expected.php');
define('FILENAME_REVIEWS', 'reviews.php');
----------
admin /admin /includes /languages
english.php 1.119 -> 1.120
diff -u -r1.119 -r1.120
--- english.php 2004/08/24 11:05:51 1.119
+++ english.php 2004/08/27 22:13:12 1.120
@@ -81,7 +81,8 @@
// categories box text in includes/boxes/catalog.php
define('BOX_HEADING_CATALOG', 'Catalog');
-define('BOX_CATALOG_CATEGORIES_PRODUCTS', 'Categories/Products');
+define('BOX_CATALOG_CATEGORIES', 'Categories');
+define('BOX_CATALOG_PRODUCTS', 'Products');
define('BOX_CATALOG_CATEGORIES_PRODUCTS_ATTRIBUTES', 'Products Attributes');
define('BOX_CATALOG_MANUFACTURERS', 'Manufacturers');
define('BOX_CATALOG_REVIEWS', 'Reviews');
----------
admin /admin /includes /languages
espanol.php 1.114 -> 1.115
diff -u -r1.114 -r1.115
--- espanol.php 2004/08/24 11:05:51 1.114
+++ espanol.php 2004/08/27 22:13:12 1.115
@@ -81,7 +81,8 @@
// categories box text in includes/boxes/catalog.php
define('BOX_HEADING_CATALOG', 'Catálogo');
-define('BOX_CATALOG_CATEGORIES_PRODUCTS', 'Categorias/Productos');
+define('BOX_CATALOG_CATEGORIES', 'Categorias');
+define('BOX_CATALOG_PRODUCTS', 'Productos');
define('BOX_CATALOG_CATEGORIES_PRODUCTS_ATTRIBUTES', 'Atributos');
define('BOX_CATALOG_MANUFACTURERS', 'Fabricantes');
define('BOX_CATALOG_REVIEWS', 'Comentarios');
----------
admin /admin /includes /languages
german.php 1.113 -> 1.114
diff -u -r1.113 -r1.114
--- german.php 2004/08/24 11:05:51 1.113
+++ german.php 2004/08/27 22:13:13 1.114
@@ -81,7 +81,8 @@
// categories box text in includes/boxes/catalog.php
define('BOX_HEADING_CATALOG', 'Katalog');
-define('BOX_CATALOG_CATEGORIES_PRODUCTS', 'Kategorien / Artikel');
+define('BOX_CATALOG_CATEGORIES', 'Kategorien');
+define('BOX_CATALOG_PRODUCTS', 'Produkte');
define('BOX_CATALOG_CATEGORIES_PRODUCTS_ATTRIBUTES', 'Produktmerkmale');
define('BOX_CATALOG_MANUFACTURERS', 'Hersteller');
define('BOX_CATALOG_REVIEWS', 'Produktbewertungen');
----------
admin /admin /includes /languages /english
products.php 1.5 -> 1.6
diff -N products.php
--- /dev/null Sat Aug 28 00:13:12 2004
+++ /tmp/cvsAAA.Ga4XP Sat Aug 28 00:13:13 2004
@@ -0,0 +1,67 @@
+<?php
+/*
+ $Id$
+
+ osCommerce, Open Source E-Commerce Solutions
+ http://www.oscommerce.com
+
+ Copyright (c) 2004 osCommerce
+
+ Released under the GNU General Public License
+*/
+
+ define('HEADING_TITLE', 'Products');
+ define('HEADING_TITLE_SEARCH', 'Search:');
+ define('HEADING_TITLE_GOTO', 'Go To:');
+
+ define('TAB_GENERAL', 'General');
+ define('TAB_ATTRIBUTES', 'Attributes');
+
+ define('FIELDSET_ASSIGNED_ATTRIBUTES', 'Assigned Attributes');
+
+ define('TABLE_HEADING_PRODUCTS', 'Products');
+ define('TABLE_HEADING_ACTION', 'Action');
+ define('TABLE_HEADING_STATUS', 'Status');
+
+ define('TEXT_NEW_PRODUCT', 'New Product in "%s"');
+ define('TEXT_CATEGORIES', 'Categories:');
+
+ define('TEXT_EDIT_INTRO', 'Please make any necessary changes');
+
+ define('TEXT_INFO_COPY_TO_INTRO', 'Please choose a new category you wish to copy this product to');
+ define('TEXT_INFO_CURRENT_CATEGORIES', 'Current Categories:');
+
+ define('TEXT_DELETE_PRODUCT_INTRO', 'Are you sure you want to permanently delete this product?');
+
+ define('TEXT_MOVE_PRODUCTS_INTRO', 'Please select which category you wish <b>%s</b> to reside in');
+ define('TEXT_MOVE', 'Move <b>%s</b> to:');
+
+ define('TEXT_PRODUCTS_STATUS', 'Products Status:');
+ define('TEXT_PRODUCTS_DATE_AVAILABLE', 'Date Available:');
+ define('TEXT_PRODUCT_AVAILABLE', 'In Stock');
+ define('TEXT_PRODUCT_NOT_AVAILABLE', 'Out of Stock');
+ define('TEXT_PRODUCTS_MANUFACTURER', 'Products Manufacturer:');
+ define('TEXT_PRODUCTS_NAME', 'Products Name:');
+ define('TEXT_PRODUCTS_DESCRIPTION', 'Products Description:');
+ define('TEXT_PRODUCTS_QUANTITY', 'Products Quantity:');
+ define('TEXT_PRODUCTS_MODEL', 'Products Model:');
+ define('TEXT_PRODUCTS_IMAGE', 'Products Image:');
+ define('TEXT_PRODUCTS_URL', 'Products URL:');
+ define('TEXT_PRODUCTS_URL_WITHOUT_HTTP', '<small>(without http://)</small>');
+ define('TEXT_PRODUCTS_TAX_CLASS', 'Tax Class:');
+ define('TEXT_PRODUCTS_PRICE_NET', 'Products Price (Net):');
+ define('TEXT_PRODUCTS_PRICE_GROSS', 'Products Price (Gross):');
+ define('TEXT_PRODUCTS_WEIGHT', 'Products Weight:');
+
+ define('TEXT_PRODUCT_DATE_ADDED', 'This product was added to our catalog on %s.');
+ define('TEXT_PRODUCT_DATE_AVAILABLE', 'This product will be in stock on %s.');
+ define('TEXT_PRODUCT_MORE_INFORMATION', 'For more information, please visit this products <a href="http://%s" target="blank"><u>webpage</u></a>.');
+
+ define('TEXT_HOW_TO_COPY', 'Copy Method:');
+ define('TEXT_COPY_AS_LINK', 'Link product');
+ define('TEXT_COPY_AS_DUPLICATE', 'Duplicate product');
+
+ define('ERROR_CANNOT_LINK_TO_SAME_CATEGORY', 'Error: Can not link products in the same category.');
+ define('ERROR_CATALOG_IMAGE_DIRECTORY_NOT_WRITEABLE', 'Error: Catalog images directory is not writeable: ' . DIR_FS_CATALOG_IMAGES);
+ define('ERROR_CATALOG_IMAGE_DIRECTORY_DOES_NOT_EXIST', 'Error: Catalog images directory does not exist: ' . DIR_FS_CATALOG_IMAGES);
+?>
----------
admin /admin /includes /languages /english
categories.php 1.27 -> 1.28
diff -u -r1.27 -r1.28
--- categories.php 2003/09/13 10:46:02 1.27
+++ categories.php 2004/08/27 22:13:13 1.28
@@ -5,92 +5,39 @@
osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
- Copyright (c) 2002 osCommerce
+ Copyright (c) 2004 osCommerce
Released under the GNU General Public License
*/
-define('HEADING_TITLE', 'Categories / Products');
-define('HEADING_TITLE_SEARCH', 'Search:');
-define('HEADING_TITLE_GOTO', 'Go To:');
-
-define('TABLE_HEADING_ID', 'ID');
-define('TABLE_HEADING_CATEGORIES_PRODUCTS', 'Categories / Products');
-define('TABLE_HEADING_ACTION', 'Action');
-define('TABLE_HEADING_STATUS', 'Status');
-
-define('TEXT_NEW_PRODUCT', 'New Product in "%s"');
-define('TEXT_CATEGORIES', 'Categories:');
-define('TEXT_SUBCATEGORIES', 'Subcategories:');
-define('TEXT_PRODUCTS', 'Products:');
-define('TEXT_PRODUCTS_PRICE_INFO', 'Price:');
-define('TEXT_PRODUCTS_TAX_CLASS', 'Tax Class:');
-define('TEXT_PRODUCTS_AVERAGE_RATING', 'Average Rating:');
-define('TEXT_PRODUCTS_QUANTITY_INFO', 'Quantity:');
-define('TEXT_DATE_ADDED', 'Date Added:');
-define('TEXT_DATE_AVAILABLE', 'Date Available:');
-define('TEXT_LAST_MODIFIED', 'Last Modified:');
-define('TEXT_NO_CHILD_CATEGORIES_OR_PRODUCTS', 'Please insert a new category or product in this level.');
-define('TEXT_PRODUCT_MORE_INFORMATION', 'For more information, please visit this products <a href="http://%s" target="blank"><u>webpage</u></a>.');
-define('TEXT_PRODUCT_DATE_ADDED', 'This product was added to our catalog on %s.');
-define('TEXT_PRODUCT_DATE_AVAILABLE', 'This product will be in stock on %s.');
-
-define('TEXT_EDIT_INTRO', 'Please make any necessary changes');
-define('TEXT_EDIT_CATEGORIES_ID', 'Category ID:');
-define('TEXT_EDIT_CATEGORIES_NAME', 'Category Name:');
-define('TEXT_EDIT_CATEGORIES_IMAGE', 'Category Image:');
-define('TEXT_EDIT_SORT_ORDER', 'Sort Order:');
-
-define('TEXT_INFO_COPY_TO_INTRO', 'Please choose a new category you wish to copy this product to');
-define('TEXT_INFO_CURRENT_CATEGORIES', 'Current Categories:');
-
-define('TEXT_INFO_HEADING_NEW_CATEGORY', 'New Category');
-define('TEXT_INFO_HEADING_EDIT_CATEGORY', 'Edit Category');
-define('TEXT_INFO_HEADING_DELETE_CATEGORY', 'Delete Category');
-define('TEXT_INFO_HEADING_MOVE_CATEGORY', 'Move Category');
-define('TEXT_INFO_HEADING_DELETE_PRODUCT', 'Delete Product');
-define('TEXT_INFO_HEADING_MOVE_PRODUCT', 'Move Product');
-define('TEXT_INFO_HEADING_COPY_TO', 'Copy To');
-
-define('TEXT_DELETE_CATEGORY_INTRO', 'Are you sure you want to delete this category?');
-define('TEXT_DELETE_PRODUCT_INTRO', 'Are you sure you want to permanently delete this product?');
-
-define('TEXT_DELETE_WARNING_CHILDS', '<b>WARNING:</b> There are %s (child-)categories still linked to this category!');
-define('TEXT_DELETE_WARNING_PRODUCTS', '<b>WARNING:</b> There are %s products still linked to this category!');
-
-define('TEXT_MOVE_PRODUCTS_INTRO', 'Please select which category you wish <b>%s</b> to reside in');
-define('TEXT_MOVE_CATEGORIES_INTRO', 'Please select which category you wish <b>%s</b> to reside in');
-define('TEXT_MOVE', 'Move <b>%s</b> to:');
-
-define('TEXT_NEW_CATEGORY_INTRO', 'Please fill out the following information for the new category');
-define('TEXT_CATEGORIES_NAME', 'Category Name:');
-define('TEXT_CATEGORIES_IMAGE', 'Category Image:');
-define('TEXT_SORT_ORDER', 'Sort Order:');
-
-define('TEXT_PRODUCTS_STATUS', 'Products Status:');
-define('TEXT_PRODUCTS_DATE_AVAILABLE', 'Date Available:');
-define('TEXT_PRODUCT_AVAILABLE', 'In Stock');
-define('TEXT_PRODUCT_NOT_AVAILABLE', 'Out of Stock');
-define('TEXT_PRODUCTS_MANUFACTURER', 'Products Manufacturer:');
-define('TEXT_PRODUCTS_NAME', 'Products Name:');
-define('TEXT_PRODUCTS_DESCRIPTION', 'Products Description:');
-define('TEXT_PRODUCTS_QUANTITY', 'Products Quantity:');
-define('TEXT_PRODUCTS_MODEL', 'Products Model:');
-define('TEXT_PRODUCTS_IMAGE', 'Products Image:');
-define('TEXT_PRODUCTS_URL', 'Products URL:');
-define('TEXT_PRODUCTS_URL_WITHOUT_HTTP', '<small>(without http://)</small>');
-define('TEXT_PRODUCTS_PRICE_NET', 'Products Price (Net):');
-define('TEXT_PRODUCTS_PRICE_GROSS', 'Products Price (Gross):');
-define('TEXT_PRODUCTS_WEIGHT', 'Products Weight:');
-
-define('EMPTY_CATEGORY', 'Empty Category');
-
-define('TEXT_HOW_TO_COPY', 'Copy Method:');
-define('TEXT_COPY_AS_LINK', 'Link product');
-define('TEXT_COPY_AS_DUPLICATE', 'Duplicate product');
-
-define('ERROR_CANNOT_LINK_TO_SAME_CATEGORY', 'Error: Can not link products in the same category.');
-define('ERROR_CATALOG_IMAGE_DIRECTORY_NOT_WRITEABLE', 'Error: Catalog images directory is not writeable: ' . DIR_FS_CATALOG_IMAGES);
-define('ERROR_CATALOG_IMAGE_DIRECTORY_DOES_NOT_EXIST', 'Error: Catalog images directory does not exist: ' . DIR_FS_CATALOG_IMAGES);
-define('ERROR_CANNOT_MOVE_CATEGORY_TO_PARENT', 'Error: Category cannot be moved into child category.');
+ define('HEADING_TITLE', 'Categories');
+ define('HEADING_TITLE_SEARCH', 'Search:');
+ define('HEADING_TITLE_GOTO', 'Go To:');
+
+ define('TABLE_HEADING_CATEGORIES', 'Categories');
+ define('TABLE_HEADING_ACTION', 'Action');
+ define('TABLE_HEADING_STATUS', 'Status');
+
+ define('TEXT_EDIT_INTRO', 'Please make any necessary changes');
+ define('TEXT_EDIT_CATEGORIES_NAME', 'Category Name:');
+ define('TEXT_EDIT_CATEGORIES_IMAGE', 'Category Image:');
+ define('TEXT_EDIT_SORT_ORDER', 'Sort Order:');
+
+ define('TEXT_INFO_HEADING_NEW_CATEGORY', 'New Category');
+
+ define('TEXT_DELETE_CATEGORY_INTRO', 'Are you sure you want to delete this category?');
+ define('TEXT_DELETE_WARNING_CHILDS', '<b>WARNING:</b> There are %s (child-)categories still linked to this category!');
+ define('TEXT_DELETE_WARNING_PRODUCTS', '<b>WARNING:</b> There are %s products still linked to this category!');
+
+ define('TEXT_MOVE_CATEGORIES_INTRO', 'Please select which category you wish <b>%s</b> to reside in');
+ define('TEXT_MOVE', 'Move <b>%s</b> to:');
+
+ define('TEXT_NEW_CATEGORY_INTRO', 'Please fill out the following information for the new category');
+ define('TEXT_CATEGORIES_NAME', 'Category Name:');
+ define('TEXT_CATEGORIES_IMAGE', 'Category Image:');
+ define('TEXT_SORT_ORDER', 'Sort Order:');
+
+ define('EMPTY_CATEGORY', 'Empty Category');
+
+ define('ERROR_CANNOT_MOVE_CATEGORY_TO_PARENT', 'Error: Category cannot be moved into child category.');
?>
----------
admin /admin /includes /languages /espanol
products.php added at 1.1
diff -N products.php
--- /dev/null Sat Aug 28 00:13:14 2004
+++ /tmp/cvsAAAYSaWYP Sat Aug 28 00:13:14 2004
@@ -0,0 +1,67 @@
+<?php
+/*
+ $Id$
+
+ osCommerce, Open Source E-Commerce Solutions
+ http://www.oscommerce.com
+
+ Copyright (c) 2004 osCommerce
+
+ Released under the GNU General Public License
+*/
+
+ define('HEADING_TITLE', 'Productos');
+ define('HEADING_TITLE_SEARCH', 'Buscar:');
+ define('HEADING_TITLE_GOTO', 'Ir A:');
+
+ define('TAB_GENERAL', 'General');
+ define('TAB_ATTRIBUTES', 'Attributes');
+
+ define('FIELDSET_ASSIGNED_ATTRIBUTES', 'Assigned Attributes');
+
+ define('TABLE_HEADING_PRODUCTS', 'Productos');
+ define('TABLE_HEADING_ACTION', 'Acción');
+ define('TABLE_HEADING_STATUS', 'Estado');
+
+ define('TEXT_NEW_PRODUCT', 'Nuevo Producto en "%s"');
+ define('TEXT_CATEGORIES', 'Categorias:');
+
+ define('TEXT_EDIT_INTRO', 'Haga los cambios necesarios');
+
+ define('TEXT_INFO_COPY_TO_INTRO', 'Elija la categoria hacia donde quiera copiar este producto');
+ define('TEXT_INFO_CURRENT_CATEGORIES', 'Categorias:');
+
+ define('TEXT_DELETE_PRODUCT_INTRO', 'Es usted seguro usted desea suprimir permanentemente este producto?');
+
+ define('TEXT_MOVE_PRODUCTS_INTRO', 'Elija la categoria hacia donde quiera mover <b>%s</b>');
+ define('TEXT_MOVE', 'Mover <b>%s</b> a:');
+
+ define('TEXT_PRODUCTS_STATUS', 'Estado de los Productos:');
+ define('TEXT_PRODUCTS_DATE_AVAILABLE', 'Fecha Disponibilidad:');
+ define('TEXT_PRODUCT_AVAILABLE', 'Disponible');
+ define('TEXT_PRODUCT_NOT_AVAILABLE', 'Agotado');
+ define('TEXT_PRODUCTS_MANUFACTURER', 'Fabricante del producto:');
+ define('TEXT_PRODUCTS_NAME', 'Nombre del Producto:');
+ define('TEXT_PRODUCTS_DESCRIPTION', 'Descripción del producto:');
+ define('TEXT_PRODUCTS_QUANTITY', 'Cantidad:');
+ define('TEXT_PRODUCTS_MODEL', 'Módelo:');
+ define('TEXT_PRODUCTS_IMAGE', 'Imagen:');
+ define('TEXT_PRODUCTS_URL', 'URL del Producto:');
+ define('TEXT_PRODUCTS_URL_WITHOUT_HTTP', '<small>(sin http://)</small>');
+ define('TEXT_PRODUCTS_TAX_CLASS', 'Tipo Impuesto:');
+ define('TEXT_PRODUCTS_PRICE_NET', 'Precio de los Productos (Net):');
+ define('TEXT_PRODUCTS_PRICE_GROSS', 'Precio de los Productos (Gross):');
+ define('TEXT_PRODUCTS_WEIGHT', 'Peso:');
+
+ define('TEXT_PRODUCT_DATE_ADDED', 'Este producto fue añadido el %s.');
+ define('TEXT_PRODUCT_DATE_AVAILABLE', 'Este producto estará disponible el %s.');
+ define('TEXT_PRODUCT_MORE_INFORMATION', 'Si quiere mas información, visite la <a href="http://%s" target="blank"><u>página</u></a> de este producto.');
+
+ define('TEXT_HOW_TO_COPY', 'Metodo de Copia:');
+ define('TEXT_COPY_AS_LINK', 'Enlazar el producto');
+ define('TEXT_COPY_AS_DUPLICATE', 'Duplicar el producto');
+
+ define('ERROR_CANNOT_LINK_TO_SAME_CATEGORY', 'Error: No se pueden enlazar productos en la misma categoria.');
+ define('ERROR_CATALOG_IMAGE_DIRECTORY_NOT_WRITEABLE', 'Error: No se puede escribir en el directorio de imagenes del catálogo: ' . DIR_FS_CATALOG_IMAGES);
+ define('ERROR_CATALOG_IMAGE_DIRECTORY_DOES_NOT_EXIST', 'Error: No existe el directorio de imagenes del catálogo: ' . DIR_FS_CATALOG_IMAGES);
+?>
----------
admin /admin /includes /languages /espanol
categories.php 1.24 -> 1.25
diff -u -r1.24 -r1.25
--- categories.php 2003/09/13 10:46:02 1.24
+++ categories.php 2004/08/27 22:13:14 1.25
@@ -5,92 +5,39 @@
osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
- Copyright (c) 2003 osCommerce
+ Copyright (c) 2004 osCommerce
Released under the GNU General Public License
*/
-define('HEADING_TITLE', 'Categorias / Productos');
-define('HEADING_TITLE_SEARCH', 'Buscar:');
-define('HEADING_TITLE_GOTO', 'Ir A:');
-
-define('TABLE_HEADING_ID', 'ID');
-define('TABLE_HEADING_CATEGORIES_PRODUCTS', 'Categorias / Productos');
-define('TABLE_HEADING_ACTION', 'Acción');
-define('TABLE_HEADING_STATUS', 'Estado');
-
-define('TEXT_NEW_PRODUCT', 'Nuevo Producto en "%s"');
-define('TEXT_CATEGORIES', 'Categorias:');
-define('TEXT_SUBCATEGORIES', 'Subcategorias:');
-define('TEXT_PRODUCTS', 'Productos:');
-define('TEXT_PRODUCTS_PRICE_INFO', 'Precio:');
-define('TEXT_PRODUCTS_TAX_CLASS', 'Tipo Impuesto:');
-define('TEXT_PRODUCTS_AVERAGE_RATING', 'Evaluación Media:');
-define('TEXT_PRODUCTS_QUANTITY_INFO', 'Cantidad:');
-define('TEXT_DATE_ADDED', 'Añadido el:');
-define('TEXT_DATE_AVAILABLE', 'Fecha Disponibilidad:');
-define('TEXT_LAST_MODIFIED', 'Modificado el:');
-define('TEXT_NO_CHILD_CATEGORIES_OR_PRODUCTS', 'Inserte una nueva categoria o producto.');
-define('TEXT_PRODUCT_MORE_INFORMATION', 'Si quiere mas información, visite la <a href="http://%s" target="blank"><u>página</u></a> de este producto.');
-define('TEXT_PRODUCT_DATE_ADDED', 'Este producto fue añadido el %s.');
-define('TEXT_PRODUCT_DATE_AVAILABLE', 'Este producto estará disponible el %s.');
-
-define('TEXT_EDIT_INTRO', 'Haga los cambios necesarios');
-define('TEXT_EDIT_CATEGORIES_ID', 'ID Categoria:');
-define('TEXT_EDIT_CATEGORIES_NAME', 'Nombre Categoria:');
-define('TEXT_EDIT_CATEGORIES_IMAGE', 'Imagen Categoria:');
-define('TEXT_EDIT_SORT_ORDER', 'Orden:');
-
-define('TEXT_INFO_COPY_TO_INTRO', 'Elija la categoria hacia donde quiera copiar este producto');
-define('TEXT_INFO_CURRENT_CATEGORIES', 'Categorias:');
-
-define('TEXT_INFO_HEADING_NEW_CATEGORY', 'Nueva Categoria');
-define('TEXT_INFO_HEADING_EDIT_CATEGORY', 'Editar Categoria');
-define('TEXT_INFO_HEADING_DELETE_CATEGORY', 'Eliminar Categoria');
-define('TEXT_INFO_HEADING_MOVE_CATEGORY', 'Mover Categoria');
-define('TEXT_INFO_HEADING_DELETE_PRODUCT', 'Eliminar Producto');
-define('TEXT_INFO_HEADING_MOVE_PRODUCT', 'Mover Producto');
-define('TEXT_INFO_HEADING_COPY_TO', 'Copiar A');
-
-define('TEXT_DELETE_CATEGORY_INTRO', 'Seguro que desea eliminar esta categoria?');
-define('TEXT_DELETE_PRODUCT_INTRO', 'Es usted seguro usted desea suprimir permanentemente este producto?');
-
-define('TEXT_DELETE_WARNING_CHILDS', '<b>ADVERTENCIA:</b> Hay %s categorias que pertenecen a esta categoria!');
-define('TEXT_DELETE_WARNING_PRODUCTS', '<b>ADVERTENCIA:</b> Hay %s productos en esta categoria!');
-
-define('TEXT_MOVE_PRODUCTS_INTRO', 'Elija la categoria hacia donde quiera mover <b>%s</b>');
-define('TEXT_MOVE_CATEGORIES_INTRO', 'Elija la categoria hacia donde quiera mover <b>%s</b>');
-define('TEXT_MOVE', 'Mover <b>%s</b> a:');
-
-define('TEXT_NEW_CATEGORY_INTRO', 'Rellene los siguientes datos de la nueva categoria');
-define('TEXT_CATEGORIES_NAME', 'Nombre Categoria:');
-define('TEXT_CATEGORIES_IMAGE', 'Imagen Categoria:');
-define('TEXT_SORT_ORDER', 'Orden:');
-
-define('TEXT_PRODUCTS_STATUS', 'Estado de los Productos:');
-define('TEXT_PRODUCTS_DATE_AVAILABLE', 'Fecha Disponibilidad:');
-define('TEXT_PRODUCT_AVAILABLE', 'Disponible');
-define('TEXT_PRODUCT_NOT_AVAILABLE', 'Agotado');
-define('TEXT_PRODUCTS_MANUFACTURER', 'Fabricante del producto:');
-define('TEXT_PRODUCTS_NAME', 'Nombre del Producto:');
-define('TEXT_PRODUCTS_DESCRIPTION', 'Descripción del producto:');
-define('TEXT_PRODUCTS_QUANTITY', 'Cantidad:');
-define('TEXT_PRODUCTS_MODEL', 'Módelo:');
-define('TEXT_PRODUCTS_IMAGE', 'Imagen:');
-define('TEXT_PRODUCTS_URL', 'URL del Producto:');
-define('TEXT_PRODUCTS_URL_WITHOUT_HTTP', '<small>(sin http://)</small>');
-define('TEXT_PRODUCTS_PRICE_NET', 'Precio de los Productos (Net):');
-define('TEXT_PRODUCTS_PRICE_GROSS', 'Precio de los Productos (Gross):');
-define('TEXT_PRODUCTS_WEIGHT', 'Peso:');
-
-define('EMPTY_CATEGORY', 'Categoria Vacia');
-
-define('TEXT_HOW_TO_COPY', 'Metodo de Copia:');
-define('TEXT_COPY_AS_LINK', 'Enlazar el producto');
-define('TEXT_COPY_AS_DUPLICATE', 'Duplicar el producto');
-
-define('ERROR_CANNOT_LINK_TO_SAME_CATEGORY', 'Error: No se pueden enlazar productos en la misma categoria.');
-define('ERROR_CATALOG_IMAGE_DIRECTORY_NOT_WRITEABLE', 'Error: No se puede escribir en el directorio de imagenes del catálogo: ' . DIR_FS_CATALOG_IMAGES);
-define('ERROR_CATALOG_IMAGE_DIRECTORY_DOES_NOT_EXIST', 'Error: No existe el directorio de imagenes del catálogo: ' . DIR_FS_CATALOG_IMAGES);
-define('ERROR_CANNOT_MOVE_CATEGORY_TO_PARENT', 'Error: No se puede mover una categoria dentro de si misma.');
+ define('HEADING_TITLE', 'Categorias');
+ define('HEADING_TITLE_SEARCH', 'Buscar:');
+ define('HEADING_TITLE_GOTO', 'Ir A:');
+
+ define('TABLE_HEADING_CATEGORIES', 'Categorias');
+ define('TABLE_HEADING_ACTION', 'Acción');
+ define('TABLE_HEADING_STATUS', 'Estado');
+
+ define('TEXT_EDIT_INTRO', 'Haga los cambios necesarios');
+ define('TEXT_EDIT_CATEGORIES_NAME', 'Nombre Categoria:');
+ define('TEXT_EDIT_CATEGORIES_IMAGE', 'Imagen Categoria:');
+ define('TEXT_EDIT_SORT_ORDER', 'Orden:');
+
+ define('TEXT_INFO_HEADING_NEW_CATEGORY', 'Nueva Categoria');
+
+ define('TEXT_DELETE_CATEGORY_INTRO', 'Seguro que desea eliminar esta categoria?');
+ define('TEXT_DELETE_WARNING_CHILDS', '<b>ADVERTENCIA:</b> Hay %s categorias que pertenecen a esta categoria!');
+ define('TEXT_DELETE_WARNING_PRODUCTS', '<b>ADVERTENCIA:</b> Hay %s productos en esta categoria!');
+
+ define('TEXT_MOVE_CATEGORIES_INTRO', 'Elija la categoria hacia donde quiera mover <b>%s</b>');
+ define('TEXT_MOVE', 'Mover <b>%s</b> a:');
+
+ define('TEXT_NEW_CATEGORY_INTRO', 'Rellene los siguientes datos de la nueva categoria');
+ define('TEXT_CATEGORIES_NAME', 'Nombre Categoria:');
+ define('TEXT_CATEGORIES_IMAGE', 'Imagen Categoria:');
+ define('TEXT_SORT_ORDER', 'Orden:');
+
+ define('EMPTY_CATEGORY', 'Categoria Vacia');
+
+ define('ERROR_CANNOT_MOVE_CATEGORY_TO_PARENT', 'Error: No se puede mover una categoria dentro de si misma.');
?>
----------
admin /admin /includes /languages /german
products.php added at 1.1
diff -N products.php
--- /dev/null Sat Aug 28 00:13:14 2004
+++ /tmp/cvsAAAvZaGZP Sat Aug 28 00:13:15 2004
@@ -0,0 +1,67 @@
+<?php
+/*
+ $Id$
+
+ osCommerce, Open Source E-Commerce Solutions
+ http://www.oscommerce.com
+
+ Copyright (c) 2004 osCommerce
+
+ Released under the GNU General Public License
+*/
+
+ define('HEADING_TITLE', 'Produkte');
+ define('HEADING_TITLE_SEARCH', 'Suche: ');
+ define('HEADING_TITLE_GOTO', 'Gehe zu:');
+
+ define('TAB_GENERAL', 'Allgemein');
+ define('TAB_ATTRIBUTES', 'Produktmerkmale');
+
+ define('FIELDSET_ASSIGNED_ATTRIBUTES', 'Assigned Attributes');
+
+ define('TABLE_HEADING_PRODUCTS', 'Produkte');
+ define('TABLE_HEADING_ACTION', 'Aktion');
+ define('TABLE_HEADING_STATUS', 'Status');
+
+ define('TEXT_NEW_PRODUCT', 'Neuer Produkt in "%s"');
+ define('TEXT_CATEGORIES', 'Kategorien:');
+
+ define('TEXT_EDIT_INTRO', 'Bitte führen Sie alle notwendigen Änderungen durch.');
+
+ define('TEXT_INFO_COPY_TO_INTRO', 'Bitte wählen Sie eine neue Kategorie aus, in die Sie den Artikel kopieren möchten:');
+ define('TEXT_INFO_CURRENT_CATEGORIES', 'aktuelle Kategorien:');
+
+ define('TEXT_DELETE_PRODUCT_INTRO', 'Sind Sie sicher, dass Sie diesen Artikel löschen möchten?');
+
+ define('TEXT_MOVE_PRODUCTS_INTRO', 'Bitte wählen Sie die übergordnete Kategorie, in die Sie <b>%s</b> verschieben möchten');
+ define('TEXT_MOVE', 'Verschiebe <b>%s</b> nach:');
+
+ define('TEXT_PRODUCTS_STATUS', 'Produktstatus:');
+ define('TEXT_PRODUCTS_DATE_AVAILABLE', 'Erscheinungsdatum:');
+ define('TEXT_PRODUCT_AVAILABLE', 'auf Lager');
+ define('TEXT_PRODUCT_NOT_AVAILABLE', 'nicht vorrätig');
+ define('TEXT_PRODUCTS_MANUFACTURER', 'Artikel-Hersteller:');
+ define('TEXT_PRODUCTS_NAME', 'Artikelname:');
+ define('TEXT_PRODUCTS_DESCRIPTION', 'Artikelbeschreibung:');
+ define('TEXT_PRODUCTS_QUANTITY', 'Artikelanzahl:');
+ define('TEXT_PRODUCTS_MODEL', 'Artikel-Nr.:');
+ define('TEXT_PRODUCTS_IMAGE', 'Artikelbild:');
+ define('TEXT_PRODUCTS_URL', 'Herstellerlink:');
+ define('TEXT_PRODUCTS_URL_WITHOUT_HTTP', '<small>(ohne führendes http://)</small>');
+ define('TEXT_PRODUCTS_TAX_CLASS', 'Steuerklasse:');
+ define('TEXT_PRODUCTS_PRICE_NET', 'Artikelpreis (Netto):');
+ define('TEXT_PRODUCTS_PRICE_GROSS', 'Artikelpreis (Brutto):');
+ define('TEXT_PRODUCTS_WEIGHT', 'Artikelgewicht:');
+
+ define('TEXT_PRODUCT_DATE_ADDED', 'Diesen Artikel haben wir am %s in unseren Katalog aufgenommen.');
+ define('TEXT_PRODUCT_DATE_AVAILABLE', 'Dieser Artikel ist erhältlich ab %s.');
+ define('TEXT_PRODUCT_MORE_INFORMATION', 'Für weitere Informationen, besuchen Sie bitte die <a href="http://%s" target="blank"><u>Homepage</u></a> des Herstellers.');
+
+ define('TEXT_HOW_TO_COPY', 'Kopiermethode:');
+ define('TEXT_COPY_AS_LINK', 'Produkt verlinken');
+ define('TEXT_COPY_AS_DUPLICATE', 'Produkt duplizieren');
+
+ define('ERROR_CANNOT_LINK_TO_SAME_CATEGORY', 'Fehler: Produkte können nicht in der gleichen Kategorie verlinkt werden.');
+ define('ERROR_CATALOG_IMAGE_DIRECTORY_NOT_WRITEABLE', 'Fehler: Das Verzeichnis \'images\' im Katalogverzeichnis ist schreibgeschützt: ' . DIR_FS_CATALOG_IMAGES);
+ define('ERROR_CATALOG_IMAGE_DIRECTORY_DOES_NOT_EXIST', 'Fehler: Das Verzeichnis \'images\' im Katalogverzeichnis ist nicht vorhanden: ' . DIR_FS_CATALOG_IMAGES);
+?>
----------
admin /admin /includes /languages /german
categories.php 1.25 -> 1.26
diff -u -r1.25 -r1.26
--- categories.php 2003/09/13 10:46:02 1.25
+++ categories.php 2004/08/27 22:13:14 1.26
@@ -5,92 +5,39 @@
osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
- Copyright (c) 2002 osCommerce
+ Copyright (c) 2004 osCommerce
Released under the GNU General Public License
*/
-define('HEADING_TITLE', 'Kategorien / Artikel');
-define('HEADING_TITLE_SEARCH', 'Suche: ');
-define('HEADING_TITLE_GOTO', 'Gehe zu:');
-
-define('TABLE_HEADING_ID', 'ID');
-define('TABLE_HEADING_CATEGORIES_PRODUCTS', 'Kategorien / Artikel');
-define('TABLE_HEADING_ACTION', 'Aktion');
-define('TABLE_HEADING_STATUS', 'Status');
-
-define('TEXT_NEW_PRODUCT', 'Neuer Artikel in "%s"');
-define('TEXT_CATEGORIES', 'Kategorien:');
-define('TEXT_SUBCATEGORIES', 'Unterkategorien:');
-define('TEXT_PRODUCTS', 'Artikel:');
-define('TEXT_PRODUCTS_PRICE_INFO', 'Preis:');
-define('TEXT_PRODUCTS_TAX_CLASS', 'Steuerklasse:');
-define('TEXT_PRODUCTS_AVERAGE_RATING', 'durchschnittl. Bewertung:');
-define('TEXT_PRODUCTS_QUANTITY_INFO', 'Anzahl:');
-define('TEXT_DATE_ADDED', 'hinzugefügt am:');
-define('TEXT_DATE_AVAILABLE', 'Erscheinungsdatum:');
-define('TEXT_LAST_MODIFIED', 'letzte Änderung:');
-define('TEXT_NO_CHILD_CATEGORIES_OR_PRODUCTS', 'Bitte fügen Sie eine neue Kategorie oder einen Artikel ein.');
-define('TEXT_PRODUCT_MORE_INFORMATION', 'Für weitere Informationen, besuchen Sie bitte die <a href="http://%s" target="blank"><u>Homepage</u></a> des Herstellers.');
-define('TEXT_PRODUCT_DATE_ADDED', 'Diesen Artikel haben wir am %s in unseren Katalog aufgenommen.');
-define('TEXT_PRODUCT_DATE_AVAILABLE', 'Dieser Artikel ist erhältlich ab %s.');
-
-define('TEXT_EDIT_INTRO', 'Bitte führen Sie alle notwendigen Änderungen durch.');
-define('TEXT_EDIT_CATEGORIES_ID', 'Kategorie ID:');
-define('TEXT_EDIT_CATEGORIES_NAME', 'Kategorie Name:');
-define('TEXT_EDIT_CATEGORIES_IMAGE', 'Kategorie Bild:');
-define('TEXT_EDIT_SORT_ORDER', 'Sortierreihenfolge:');
-
-define('TEXT_INFO_COPY_TO_INTRO', 'Bitte wählen Sie eine neue Kategorie aus, in die Sie den Artikel kopieren möchten:');
-define('TEXT_INFO_CURRENT_CATEGORIES', 'aktuelle Kategorien:');
-
-define('TEXT_INFO_HEADING_NEW_CATEGORY', 'Neue Kategorie');
-define('TEXT_INFO_HEADING_EDIT_CATEGORY', 'Kategorie bearbeiten');
-define('TEXT_INFO_HEADING_DELETE_CATEGORY', 'Kategorie löschen');
-define('TEXT_INFO_HEADING_MOVE_CATEGORY', 'Kategorie verschieben');
-define('TEXT_INFO_HEADING_DELETE_PRODUCT', 'Artikel löschen');
-define('TEXT_INFO_HEADING_MOVE_PRODUCT', 'Artikel verschieben');
-define('TEXT_INFO_HEADING_COPY_TO', 'Kopieren nach');
-
-define('TEXT_DELETE_CATEGORY_INTRO', 'Sind Sie sicher, dass Sie diese Kategorie löschen möchten?');
-define('TEXT_DELETE_PRODUCT_INTRO', 'Sind Sie sicher, dass Sie diesen Artikel löschen möchten?');
-
-define('TEXT_DELETE_WARNING_CHILDS', '<b>WARNUNG:</b> Es existieren noch %s (Unter-)Kategorien, die mit dieser Kategorie verbunden sind!');
-define('TEXT_DELETE_WARNING_PRODUCTS', '<b>WARNING:</b> Es existieren noch %s Artikel, die mit dieser Kategorie verbunden sind!');
-
-define('TEXT_MOVE_PRODUCTS_INTRO', 'Bitte wählen Sie die übergordnete Kategorie, in die Sie <b>%s</b> verschieben möchten');
-define('TEXT_MOVE_CATEGORIES_INTRO', 'Bitte wählen Sie die übergordnete Kategorie, in die Sie <b>%s</b> verschieben möchten');
-define('TEXT_MOVE', 'Verschiebe <b>%s</b> nach:');
-
-define('TEXT_NEW_CATEGORY_INTRO', 'Bitte geben Sie die neue Kategorie mit allen relevanten Daten ein.');
-define('TEXT_CATEGORIES_NAME', 'Kategorie Name:');
-define('TEXT_CATEGORIES_IMAGE', 'Kategorie Bild:');
-define('TEXT_SORT_ORDER', 'Sortierreihenfolge:');
-
-define('TEXT_PRODUCTS_STATUS', 'Produktstatus:');
-define('TEXT_PRODUCTS_DATE_AVAILABLE', 'Erscheinungsdatum:');
-define('TEXT_PRODUCT_AVAILABLE', 'auf Lager');
-define('TEXT_PRODUCT_NOT_AVAILABLE', 'nicht vorrätig');
-define('TEXT_PRODUCTS_MANUFACTURER', 'Artikel-Hersteller:');
-define('TEXT_PRODUCTS_NAME', 'Artikelname:');
-define('TEXT_PRODUCTS_DESCRIPTION', 'Artikelbeschreibung:');
-define('TEXT_PRODUCTS_QUANTITY', 'Artikelanzahl:');
-define('TEXT_PRODUCTS_MODEL', 'Artikel-Nr.:');
-define('TEXT_PRODUCTS_IMAGE', 'Artikelbild:');
-define('TEXT_PRODUCTS_URL', 'Herstellerlink:');
-define('TEXT_PRODUCTS_URL_WITHOUT_HTTP', '<small>(ohne führendes http://)</small>');
-define('TEXT_PRODUCTS_PRICE_NET', 'Artikelpreis (Netto):');
-define('TEXT_PRODUCTS_PRICE_GROSS', 'Artikelpreis (Brutto):');
-define('TEXT_PRODUCTS_WEIGHT', 'Artikelgewicht:');
-
-define('EMPTY_CATEGORY', 'Leere Kategorie');
-
-define('TEXT_HOW_TO_COPY', 'Kopiermethode:');
-define('TEXT_COPY_AS_LINK', 'Produkt verlinken');
-define('TEXT_COPY_AS_DUPLICATE', 'Produkt duplizieren');
-
-define('ERROR_CANNOT_LINK_TO_SAME_CATEGORY', 'Fehler: Produkte können nicht in der gleichen Kategorie verlinkt werden.');
-define('ERROR_CATALOG_IMAGE_DIRECTORY_NOT_WRITEABLE', 'Fehler: Das Verzeichnis \'images\' im Katalogverzeichnis ist schreibgeschützt: ' . DIR_FS_CATALOG_IMAGES);
-define('ERROR_CATALOG_IMAGE_DIRECTORY_DOES_NOT_EXIST', 'Fehler: Das Verzeichnis \'images\' im Katalogverzeichnis ist nicht vorhanden: ' . DIR_FS_CATALOG_IMAGES);
-define('ERROR_CANNOT_MOVE_CATEGORY_TO_PARENT', 'Error: Category cannot be moved into child category.');
+ define('HEADING_TITLE', 'Kategorien');
+ define('HEADING_TITLE_SEARCH', 'Suche: ');
+ define('HEADING_TITLE_GOTO', 'Gehe zu:');
+
+ define('TABLE_HEADING_CATEGORIES', 'Kategorien');
+ define('TABLE_HEADING_ACTION', 'Aktion');
+ define('TABLE_HEADING_STATUS', 'Status');
+
+ define('TEXT_EDIT_INTRO', 'Bitte führen Sie alle notwendigen Änderungen durch.');
+ define('TEXT_EDIT_CATEGORIES_NAME', 'Kategorie Name:');
+ define('TEXT_EDIT_CATEGORIES_IMAGE', 'Kategorie Bild:');
+ define('TEXT_EDIT_SORT_ORDER', 'Sortierreihenfolge:');
+
+ define('TEXT_INFO_HEADING_NEW_CATEGORY', 'Neue Kategorie');
+
+ define('TEXT_DELETE_CATEGORY_INTRO', 'Sind Sie sicher, dass Sie diese Kategorie löschen möchten?');
+ define('TEXT_DELETE_WARNING_CHILDS', '<b>WARNUNG:</b> Es existieren noch %s (Unter-)Kategorien, die mit dieser Kategorie verbunden sind!');
+ define('TEXT_DELETE_WARNING_PRODUCTS', '<b>WARNING:</b> Es existieren noch %s Artikel, die mit dieser Kategorie verbunden sind!');
+
+ define('TEXT_MOVE_CATEGORIES_INTRO', 'Bitte wählen Sie die übergordnete Kategorie, in die Sie <b>%s</b> verschieben möchten');
+ define('TEXT_MOVE', 'Verschiebe <b>%s</b> nach:');
+
+ define('TEXT_NEW_CATEGORY_INTRO', 'Bitte geben Sie die neue Kategorie mit allen relevanten Daten ein.');
+ define('TEXT_CATEGORIES_NAME', 'Kategorie Name:');
+ define('TEXT_CATEGORIES_IMAGE', 'Kategorie Bild:');
+ define('TEXT_SORT_ORDER', 'Sortierreihenfolge:');
+
+ define('EMPTY_CATEGORY', 'Leere Kategorie');
+
+ define('ERROR_CANNOT_MOVE_CATEGORY_TO_PARENT', 'Error: Category cannot be moved into child category.');
?>
----------
admin /admin /templates /default
header.php 1.3 -> 1.4
diff -u -r1.3 -r1.4
--- header.php 2004/08/25 20:05:16 1.3
+++ header.php 2004/08/27 22:13:15 1.4
@@ -50,7 +50,8 @@
' ],' . "\n" .
' _cmSplit,' . "\n" .
' [null, \'' . addslashes(BOX_HEADING_CATALOG) . '\', null, null, null,' . "\n" .
- ' [\'' . tep_image('templates/' . $template . '/images/icons/16x16/configure.png') . '\', \'' . addslashes(BOX_CATALOG_CATEGORIES_PRODUCTS) . '\', \'' . tep_href_link(FILENAME_CATEGORIES) . '\', null, null],' . "\n" .
+ ' [\'' . tep_image('templates/' . $template . '/images/icons/16x16/folder_red.png') . '\', \'' . addslashes(BOX_CATALOG_CATEGORIES) . '\', \'' . tep_href_link(FILENAME_CATEGORIES) . '\', null, null],' . "\n" .
+ ' [\'' . tep_image('templates/' . $template . '/images/icons/16x16/products.png') . '\', \'' . addslashes(BOX_CATALOG_PRODUCTS) . '\', \'' . tep_href_link(FILENAME_PRODUCTS) . '\', null, null],' . "\n" .
' [\'' . tep_image('templates/' . $template . '/images/icons/16x16/attributes.png') . '\', \'' . addslashes(BOX_CATALOG_CATEGORIES_PRODUCTS_ATTRIBUTES) . '\', \'' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES) . '\', \'\', null],' . "\n" .
' [\'' . tep_image('templates/' . $template . '/images/icons/16x16/run.png') . '\', \'' . addslashes(BOX_CATALOG_MANUFACTURERS) . '\', \'' . tep_href_link(FILENAME_MANUFACTURERS) . '\', null, null],' . "\n" .
' [\'' . tep_image('templates/' . $template . '/images/icons/16x16/write.png') . '\', \'' . addslashes(BOX_CATALOG_REVIEWS) . '\', \'' . tep_href_link(FILENAME_REVIEWS) . '\', null, null],' . "\n" .
----------
admin /admin /templates /pages
products.php added at 1.1
diff -N products.php
--- /dev/null Sat Aug 28 00:13:14 2004
+++ /tmp/cvsAAAdbaW0P Sat Aug 28 00:13:15 2004
@@ -0,0 +1,176 @@
+<?php
+/*
+ $Id$
+
+ osCommerce, Open Source E-Commerce Solutions
+ http://www.oscommerce.com
+
+ Copyright (c) 2004 osCommerce
+
+ Released under the GNU General Public License
+*/
+?>
+
+<table border="0" width="100%" cellspacing="0" cellpadding="2">
+ <tr>
+ <td><h1><?php echo HEADING_TITLE; ?></h1></td>
+ <td class="smallText" align="right">
+<?php
+ echo tep_draw_form('search', FILENAME_PRODUCTS, '', 'get') .
+ HEADING_TITLE_SEARCH . ' ' . osc_draw_input_field('search') .
+ '<input type="submit" value="GO" class="operationButton"></form><br>' .
+ tep_draw_form('goto', FILENAME_PRODUCTS, '', 'get') .
+ HEADING_TITLE_GOTO . ' ' . osc_draw_pull_down_menu('cPath', tep_get_category_tree(), $current_category_id, 'onChange="this.form.submit();"') .
+ '</form>';
+?>
+ </td>
+ </tr>
+</table>
+
+<div id="infoBox_cDefault" <?php if (!empty($action)) { echo 'style="display: none;"'; } ?>>
+ <table border="0" width="100%" cellspacing="0" cellpadding="2" class="dataTable">
+ <thead>
+ <tr>
+ <th><?php echo TABLE_HEADING_PRODUCTS; ?></th>
+ <th><?php echo TABLE_HEADING_STATUS; ?></th>
+ <th><?php echo TABLE_HEADING_ACTION; ?></th>
+ </tr>
+ </thead>
+ <tbody>
+<?php
+ if (isset($_GET['search']) && !empty($_GET['search'])) {
+ $Qproducts = $osC_Database->query('select p.products_id, pd.products_name, p.products_quantity, p.products_image, p.products_price, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, p2c.categories_id from :table_products p, :table_products_description pd, :table_products_to_categories p2c where p.products_id = pd.products_id and pd.language_id = :language_id and p.products_id = p2c.products_id and pd.products_name like :products_name order by pd.products_name');
+ $Qproducts->bindValue(':products_name', '%' . $_GET['search'] . '%');
+ } else {
+ $Qproducts = $osC_Database->query('select p.products_id, pd.products_name, p.products_quantity, p.products_image, p.products_price, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status from :table_products p, :table_products_description pd where p.products_id = pd.products_id and pd.language_id = :language_id order by pd.products_name');
+ }
+ $Qproducts->bindTable(':table_products', TABLE_PRODUCTS);
+ $Qproducts->bindTable(':table_products_description', TABLE_PRODUCTS_DESCRIPTION);
+ $Qproducts->bindTable(':table_products_to_categories', TABLE_PRODUCTS_TO_CATEGORIES);
+ $Qproducts->bindInt(':language_id', $osC_Session->value('languages_id'));
+ $Qproducts->setBatchLimit($_GET['page'], MAX_DISPLAY_SEARCH_RESULTS);
+ $Qproducts->execute();
+
+ while ($Qproducts->next()) {
+ if (isset($_GET['search']) && !empty($_GET['search'])) {
+ $cPath = $Qproducts->valueInt('categories_id');
+ }
+
+ if (!isset($pInfo) && !isset($cInfo) && (!isset($_GET['pID']) && !isset($_GET['cID']) || (isset($_GET['pID']) && ($_GET['pID'] == $Qproducts->valueInt('products_id')))) && ($action != 'cNew')) {
+ $Qreviews = $osC_Database->query('select (avg(reviews_rating) / 5 * 100) as average_rating from :table_reviews where products_id = :products_id');
+ $Qreviews->bindTable(':table_reviews', TABLE_REVIEWS);
+ $Qreviews->bindInt(':products_id', $Qproducts->valueInt('products_id'));
+ $Qreviews->execute();
+
+ $pInfo = new objectInfo(array_merge($Qproducts->toArray(), $Qreviews->toArray()));
+ }
+
+ if (isset($pInfo) && ($Qproducts->valueInt('products_id') == $pInfo->products_id)) {
+ echo ' <tr class="selected">' . "\n";
+ } else {
+ echo ' <tr onMouseOver="rowOverEffect(this);" onMouseOut="rowOutEffect(this);" onClick="document.location.href=\'' . tep_href_link(FILENAME_PRODUCTS, 'page=' . $_GET['page'] . '&cPath=' . $cPath . '&pID=' . $Qproducts->valueInt('products_id')) . '\';">' . "\n";
+ }
+?>
+ <td><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCTS, 'page=' . $_GET['page'] . '&cPath=' . $cPath . '&pID=' . $Qproducts->valueInt('products_id') . '&action=new_product_preview&read=only') . '">' . tep_image(DIR_WS_ICONS . 'preview.gif', ICON_PREVIEW) . ' ' . $Qproducts->value('products_name') . '</a>'; ?></td>
+ <td align="center"><?php echo tep_image('templates/' . $template . '/images/icons/' . (($Qproducts->valueInt('products_status') === 1) ? 'checkbox_ticked.gif' : 'checkbox_crossed.gif')); ?></td>
+ <td align="right">
+<?php
+ echo '<a href="' . tep_href_link(FILENAME_PRODUCTS, 'page=' . $_GET['page'] . '&cPath=' . $cPath . '&pID=' . $Qproducts->valueInt('products_id') . '&action=new_product') . '">' . tep_image('templates/' . $template . '/images/icons/16x16/configure.png', IMAGE_EDIT, '16', '16') . '</a> ';
+
+ if (isset($pInfo) && ($Qproducts->valueInt('products_id') == $pInfo->products_id)) {
+ echo '<a href="#" onClick="toggleInfoBox(\'pMove\');">' . tep_image('templates/' . $template . '/images/icons/16x16/move.png', IMAGE_MOVE, '16', '16') . '</a> ' .
+ '<a href="#" onClick="toggleInfoBox(\'pCopyTo\');">' . tep_image('templates/' . $template . '/images/icons/16x16/copy.png', IMAGE_COPY_TO, '16', '16') . '</a> ' .
+ '<a href="#" onClick="toggleInfoBox(\'pDelete\');">' . tep_image('templates/' . $template . '/images/icons/16x16/trash.png', IMAGE_DELETE, '16', '16') . '</a>';
+ } else {
+ echo '<a href="' . tep_href_link(FILENAME_PRODUCTS, 'page=' . $_GET['page'] . '&cPath=' . $cPath . '&pID=' . $Qproducts->valueInt('products_id') . '&action=pMove') . '">' . tep_image('templates/' . $template . '/images/icons/16x16/move.png', IMAGE_MOVE, '16', '16') . '</a> ' .
+ '<a href="' . tep_href_link(FILENAME_PRODUCTS, 'page=' . $_GET['page'] . '&cPath=' . $cPath . '&pID=' . $Qproducts->valueInt('products_id') . '&action=pCopyTo') . '">' . tep_image('templates/' . $template . '/images/icons/16x16/copy.png', IMAGE_COPY_TO, '16', '16') . '</a> ' .
+ '<a href="' . tep_href_link(FILENAME_PRODUCTS, 'page=' . $_GET['page'] . '&cPath=' . $cPath . '&pID=' . $Qproducts->valueInt('products_id') . '&action=pDelete') . '">' . tep_image('templates/' . $template . '/images/icons/16x16/trash.png', IMAGE_DELETE, '16', '16') . '</a>';
+ }
+?>
+ </td>
+ </tr>
+<?php
+ }
+?>
+ </tbody>
+ </table>
+
+ <table border="0" width="100%" cellspacing="0" cellpadding="2">
+ <tr>
+ <td class="smallText"><?php echo $Qproducts->displayBatchLinksTotal(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td>
+ <td class="smallText" align="right"><?php echo $Qproducts->displayBatchLinksPullDown('page', 'cPath=' . $cPath); ?></td>
+ </tr>
+ </table>
+
+ <p align="right"><?php echo '<input type="button" value="' . IMAGE_NEW_PRODUCT . '" onClick="document.location.href=\'' . tep_href_link(FILENAME_PRODUCTS, 'page=' . $_GET['page'] . '&cPath=' . $cPath . '&action=new_product') . '\';" class="infoBoxButton">'; ?></p>
+</div>
+
+<?php
+ if (isset($pInfo)) {
+?>
+
+<div id="infoBox_pCopyTo" <?php if ($action != 'pCopyTo') { echo 'style="display: none;"'; } ?>>
+ <div class="infoBoxHeading"><?php echo tep_image('templates/' . $template . '/images/icons/16x16/copy.png', IMAGE_COPY_TO, '16', '16') . ' ' . $pInfo->products_name; ?></div>
+ <div class="infoBoxContent">
+ <?php echo tep_draw_form('pCopyTo', FILENAME_PRODUCTS, 'page=' . $_GET['page'] . '&cPath=' . $cPath . '&pID=' . $pInfo->products_id . '&action=copy_to_confirm'); ?>
+
+ <p><?php echo TEXT_INFO_COPY_TO_INTRO; ?></p>
+ <p><?php echo TEXT_INFO_CURRENT_CATEGORIES . '<br>' . tep_output_generated_category_path($pInfo->products_id, 'product'); ?></p>
+ <p><?php echo TEXT_CATEGORIES . '<br>' . osc_draw_pull_down_menu('categories_id', tep_get_category_tree(), $current_category_id); ?></p>
+ <p><?php echo TEXT_HOW_TO_COPY . '<br>' . osc_draw_radio_field('copy_as', array(array('id' => 'link', 'text' => TEXT_COPY_AS_LINK), array('id' => 'duplicate', 'text' => TEXT_COPY_AS_DUPLICATE)), 'link', '', false, '<br>'); ?></p>
+
+ <p align="center"><?php echo '<input type="submit" value="' . IMAGE_COPY . '" class="operationButton"> <input type="button" value="' . IMAGE_CANCEL . '" onClick="toggleInfoBox(\'cDefault\');" class="operationButton">'; ?></p>
+
+ </form>
+ </div>
+</div>
+
+<div id="infoBox_pMove" <?php if ($action != 'pMove') { echo 'style="display: none;"'; } ?>>
+ <div class="infoBoxHeading"><?php echo tep_image('templates/' . $template . '/images/icons/16x16/move.png', IMAGE_MOVE, '16', '16') . ' ' . $pInfo->products_name; ?></div>
+ <div class="infoBoxContent">
+ <?php echo tep_draw_form('pMove', FILENAME_PRODUCTS, 'page=' . $_GET['page'] . '&cPath=' . $cPath . '&pID=' . $pInfo->products_id . '&action=move_product_confirm'); ?>
+
+ <p><?php echo sprintf(TEXT_MOVE_PRODUCTS_INTRO, $pInfo->products_name); ?></p>
+ <p><?php echo TEXT_INFO_CURRENT_CATEGORIES . '<br>' . tep_output_generated_category_path($pInfo->products_id, 'product'); ?></p>
+ <p><?php echo sprintf(TEXT_MOVE, $pInfo->products_name) . '<br>' . osc_draw_pull_down_menu('move_to_category_id', tep_get_category_tree(), $current_category_id); ?></p>
+
+ <p align="center"><?php echo '<input type="submit" value="' . IMAGE_MOVE . '" class="operationButton"> <input type="button" value="' . IMAGE_CANCEL . '" onClick="toggleInfoBox(\'cDefault\');" class="operationButton">'; ?></p>
+
+ </form>
+ </div>
+</div>
+
+<div id="infoBox_pDelete" <?php if ($action != 'pDelete') { echo 'style="display: none;"'; } ?>>
+ <div class="infoBoxHeading"><?php echo tep_image('templates/' . $template . '/images/icons/16x16/trash.png', IMAGE_DELETE, '16', '16') . ' ' . $pInfo->products_name; ?></div>
+ <div class="infoBoxContent">
+ <?php echo tep_draw_form('pDelete', FILENAME_PRODUCTS, 'page=' . $_GET['page'] . '&cPath=' . $cPath . '&pID=' . $pInfo->products_id . '&action=delete_product_confirm'); ?>
+
+ <p><?php echo TEXT_DELETE_PRODUCT_INTRO; ?></p>
+ <p><?php echo $pInfo->products_name; ?></p>
+ <p>
+<?php
+ $product_categories_array = array();
+ $product_categories = tep_generate_category_path($pInfo->products_id, 'product');
+ for ($i=0, $n=sizeof($product_categories); $i<$n; $i++) {
+ $category_path = '';
+ for ($j=0, $k=sizeof($product_categories[$i]); $j<$k; $j++) {
+ $category_path .= $product_categories[$i][$j]['text'] . ' > ';
+ }
+ $category_path = substr($category_path, 0, -16);
+
+ $product_categories_array[] = array('id' => $product_categories[$i][sizeof($product_categories[$i])-1]['id'], 'text' => $category_path);
+ }
+
+ echo osc_draw_checkbox_field('product_categories[]', $product_categories_array, true, '', false, '<br>');
+?>
+ </p>
+
+ <p align="center"><?php echo '<input type="submit" value="' . IMAGE_DELETE . '" class="operationButton"> <input type="button" value="' . IMAGE_CANCEL . '" onClick="toggleInfoBox(\'cDefault\');" class="operationButton">'; ?></p>
+
+ </form>
+ </div>
+</div>
+
+<?php
+ }
+?>
----------
admin /admin /templates /pages
products_edit.php added at 1.1
diff -N products_edit.php
--- /dev/null Sat Aug 28 00:13:14 2004
+++ /tmp/cvsAAAwcaa1P Sat Aug 28 00:13:16 2004
@@ -0,0 +1,428 @@
+<?php
+/*
+ $Id$
+
+ osCommerce, Open Source E-Commerce Solutions
+ http://www.oscommerce.com
+
+ Copyright (c) 2004 osCommerce
+
+ Released under the GNU General Public License
+*/
+
+ if (isset($_GET['pID']) && empty($_POST)) {
+ $Qp = $osC_Database->query('select products_id, products_quantity, products_model, products_image, products_price, products_weight, products_weight_class, products_date_added, products_last_modified, date_format(products_date_available, "%Y-%m-%d") as products_date_available, products_status, products_tax_class_id, manufacturers_id from :table_products where products_id = :products_id');
+ $Qp->bindTable(':table_products', TABLE_PRODUCTS);
+ $Qp->bindInt(':products_id', $_GET['pID']);
+ $Qp->execute();
+
+ $Qpd = $osC_Database->query('select products_name, products_description, products_url, language_id from :table_products_description where products_id = :products_id');
+ $Qpd->bindTable(':table_products_description', TABLE_PRODUCTS_DESCRIPTION);
+ $Qpd->bindInt(':products_id', $_GET['pID']);
+ $Qpd->execute();
+
+ $pd_extra = array();
+ while ($Qpd->next()) {
+ $pd_extra['products_name'][$Qpd->valueInt('language_id')] = $Qpd->value('products_name');
+ $pd_extra['products_description'][$Qpd->valueInt('language_id')] = $Qpd->value('products_description');
+ $pd_extra['products_url'][$Qpd->valueInt('language_id')] = $Qpd->value('products_url');
+ }
+
+ $pInfo = new objectInfo(array_merge($Qp->toArray(), $pd_extra));
+ } elseif (!empty($_POST)) {
+ $pInfo = new objectInfo($_POST);
+ }
+
+ $Qmanufacturers = $osC_Database->query('select manufacturers_id, manufacturers_name from :table_manufacturers order by manufacturers_name');
+ $Qmanufacturers->bindTable(':table_manufacturers', TABLE_MANUFACTURERS);
+ $Qmanufacturers->execute();
+
+ $manufacturers_array = array(array('id' => '', 'text' => TEXT_NONE));
+ while ($Qmanufacturers->next()) {
+ $manufacturers_array[] = array('id' => $Qmanufacturers->valueInt('manufacturers_id'),
+ 'text' => $Qmanufacturers->value('manufacturers_name'));
+ }
+
+ $Qtc = $osC_Database->query('select tax_class_id, tax_class_title from :table_tax_class order by tax_class_title');
+ $Qtc->bindTable(':table_tax_class', TABLE_TAX_CLASS);
+ $Qtc->execute();
+
+ $tax_class_array = array(array('id' => '0', 'text' => TEXT_NONE));
+ while ($Qtc->next()) {
+ $tax_class_array[] = array('id' => $Qtc->valueInt('tax_class_id'),
+ 'text' => $Qtc->value('tax_class_title'));
+ }
+
+ $Qwc = $osC_Database->query('select weight_class_id, weight_class_title from :table_weight_class where language_id = :language_id order by weight_class_title');
+ $Qwc->bindTable(':table_weight_class', TABLE_WEIGHT_CLASS);
+ $Qwc->bindInt(':language_id', $osC_Session->value('languages_id'));
+ $Qwc->execute();
+
+ $weight_class_array = array();
+ while ($Qwc->next()) {
+ $weight_class_array[] = array('id' => $Qwc->valueInt('weight_class_id'),
+ 'text' => $Qwc->value('weight_class_title'));
+ }
+
+ $languages = tep_get_languages();
+?>
+
+<script type="text/javascript" src="external/FCKeditor/2.0b1/fckeditor.js"></script>
+<style type="text/css">@import url('external/jscalendar/calendar-win2k-1.css');</style>
+<script type="text/javascript" src="external/jscalendar/calendar.js"></script>
+<script type="text/javascript" src="external/jscalendar/lang/calendar-en.js"></script>
+<script type="text/javascript" src="external/jscalendar/calendar-setup.js"></script>
+
+<style type="text/css">
+.attributeRemove {
+ background-color: #FFC6C6;
+}
+
+.attributeAdd {
+ background-color: #E8FFC6;
+}
+</style>
+
+<script language="javascript"><!--
+ var tax_rates = new Array();
+<?php
+ foreach ($tax_class_array as $tc_entry) {
+ if ($tc_entry['id'] > 0) {
+ echo ' tax_rates["' . $tc_entry['id'] . '"] = ' . tep_get_tax_rate_value($tc_entry['id']) . ';' . "\n";
+ }
+ }
+?>
+
+ function doRound(x, places) {
+ return Math.round(x * Math.pow(10, places)) / Math.pow(10, places);
+ }
+
+ function getTaxRate() {
+ var selected_value = document.forms["new_product"].products_tax_class_id.selectedIndex;
+ var parameterVal = document.forms["new_product"].products_tax_class_id[selected_value].value;
+
+ if ( (parameterVal > 0) && (tax_rates[parameterVal] > 0) ) {
+ return tax_rates[parameterVal];
+ } else {
+ return 0;
+ }
+ }
+
+ function updateGross() {
+ var taxRate = getTaxRate();
+ var grossValue = document.forms["new_product"].products_price.value;
+
+ if (taxRate > 0) {
+ grossValue = grossValue * ((taxRate / 100) + 1);
+ }
+
+ document.forms["new_product"].products_price_gross.value = doRound(grossValue, 4);
+ }
+
+ function updateNet() {
+ var taxRate = getTaxRate();
+ var netValue = document.forms["new_product"].products_price_gross.value;
+
+ if (taxRate > 0) {
+ netValue = netValue / ((taxRate / 100) + 1);
+ }
+
+ document.forms["new_product"].products_price.value = doRound(netValue, 4);
+ }
+
+ var counter = 0;
+
+ function moreFields() {
+ var existingFields = document.new_product.getElementsByTagName('input');
+ var attributeExists = false;
+
+ for (i=0; i<existingFields.length; i++) {
+ if (existingFields[i].name == 'attribute_prefix[' + document.new_product.attributes.options[document.new_product.attributes.options.selectedIndex].parentNode.id + '][' + document.new_product.attributes.options[document.new_product.attributes.options.selectedIndex].value + ']') {
+ attributeExists = true;
+ break;
+ }
+ }
+
+ if (attributeExists == false) {
+ counter++;
+ var newFields = document.getElementById('readroot').cloneNode(true);
+ newFields.id = '';
+ newFields.style.display = 'block';
+
+ var spanFields = newFields.getElementsByTagName('span');
+ var inputFields = newFields.getElementsByTagName('input');
+
+ spanFields[0].innerHTML = document.new_product.attributes.options[document.new_product.attributes.options.selectedIndex].parentNode.label;
+ spanFields[1].innerHTML = document.new_product.attributes.options[document.new_product.attributes.options.selectedIndex].text;
+
+ for (y=0; y<inputFields.length; y++) {
+ inputFields[y].name = inputFields[y].name.substr(4) + '[' + document.new_product.attributes.options[document.new_product.attributes.options.selectedIndex].parentNode.id + '][' + document.new_product.attributes.options[document.new_product.attributes.options.selectedIndex].value + ']';
+ inputFields[y].disabled = false;
+ }
+
+ var insertHere = document.getElementById('writeroot');
+ insertHere.parentNode.insertBefore(newFields,insertHere);
+ }
+ }
+
+ function toggleAttributeStatus(attributeID) {
+ var row = document.getElementById(attributeID);
+ var rowButton = document.getElementById(attributeID + '-button');
+ var rowFields = row.getElementsByTagName('input');
+
+ if (rowButton.value == '-') {
+ for (rF=0; rF<rowFields.length; rF++) {
+ if (rowFields[rF].type != 'button') {
+ rowFields[rF].disabled = true;
+ }
+ }
+
+ row.className = 'attributeRemove';
+ rowButton.value = '+';
+ } else {
+ for (rF=0; rF<rowFields.length; rF++) {
+ if (rowFields[rF].type != 'button') {
+ rowFields[rF].disabled = false;
+ }
+ }
+
+ row.className = '';
+ rowButton.value = '-';
+ }
+ }
+
+//--></script>
+
+<link type="text/css" rel="stylesheet" href="external/tabpane/css/luna/tab.css" />
+<script type="text/javascript" src="external/tabpane/js/tabpane.js"></script>
+
+<h1><?php echo sprintf(TEXT_NEW_PRODUCT, tep_output_generated_category_path($current_category_id)); ?></h1>
+
+<div class="tab-pane" id="tabPane1">
+ <script type="text/javascript">
+ tp1 = new WebFXTabPane( document.getElementById( "tabPane1" ) );
+ </script>
+
+<?php
+ echo tep_draw_form('new_product', FILENAME_PRODUCTS, 'cPath=' . $cPath . (isset($_GET['pID']) ? '&pID=' . $_GET['pID'] : '') . '&action=new_product_preview', 'post', 'enctype="multipart/form-data"');
+?>
+
+ <div class="tab-page" id="tabPage1">
+ <h2 class="tab"><?php echo TAB_GENERAL; ?></h2>
+
+ <script type="text/javascript">tp1.addTabPage( document.getElementById( "tabPage1" ) );</script>
+
+ <table border="0" width="100%" cellspacing="0" cellpadding="2">
+ <tr>
+ <td class="main"><?php echo TEXT_PRODUCTS_STATUS; ?></td>
+ <td class="main"><?php echo osc_draw_radio_field('products_status', array(array('id' => '1', 'text' => TEXT_PRODUCT_AVAILABLE), array('id' => '0', 'text' => TEXT_PRODUCT_NOT_AVAILABLE)), (isset($pInfo) ? $pInfo->products_status : '0')); ?></td>
+ </tr>
+ <tr>
+ <td class="smallText" colspan="2"> </td>
+ </tr>
+ <tr>
+ <td class="main"><?php echo TEXT_PRODUCTS_DATE_AVAILABLE; ?><br><small>(YYYY-MM-DD)</small></td>
+ <td class="main"><?php echo osc_draw_input_field('products_date_available', (isset($pInfo) ? $pInfo->products_date_available : ''), 'id="calendarValue"'); ?><input type="button" value="..." id="calendarTrigger" class="operationButton"><script type="text/javascript">Calendar.setup( { inputField: "calendarValue", ifFormat: "%Y-%m-%d", button: "calendarTrigger" } );</script></td>
+ </tr>
+ <tr>
+ <td class="smallText" colspan="2"> </td>
+ </tr>
+ <tr>
+ <td class="main"><?php echo TEXT_PRODUCTS_MANUFACTURER; ?></td>
+ <td class="main"><?php echo osc_draw_pull_down_menu('manufacturers_id', $manufacturers_array, (isset($pInfo) ? $pInfo->manufacturers_id : '')); ?></td>
+ </tr>
+ <tr>
+ <td class="smallText" colspan="2"> </td>
+ </tr>
+ <tr bgcolor="#fff3e7">
+ <td class="main"> </td>
+ <td>
+<?php
+ foreach ($languages as $l_entry) {
+ echo ' <span id="lang_' . $l_entry['code'] . '"' . (($l_entry['directory'] == $osC_Session->value('language')) ? ' class="highlight"' : '') . '><a href="javascript:toggleDivBlocks(\'pName_\', \'pName_' . $l_entry['code'] . '\'); toggleDivBlocks(\'pDesc_\', \'pDesc_' . $l_entry['code'] . '\'); toggleDivBlocks(\'pURL_\', \'pURL_' . $l_entry['code'] . '\'); toggleClass(\'lang_\', \'lang_' . $l_entry['code'] . '\', \'highlight\', \'span\');">' . tep_image(DIR_WS_CATALOG_LANGUAGES . $l_entry['directory'] . '/images/' . $l_entry['image'], $l_entry['name']) . '</a></span> ';
+ }
+?>
+ </td>
+ </tr>
+ <tr bgcolor="#fff3e7">
+ <td class="main"><?php echo TEXT_PRODUCTS_NAME; ?></td>
+ <td>
+<?php
+ foreach ($languages as $l_entry) {
+ echo ' <div id="pName_' . $l_entry['code'] . '"' . (($l_entry['directory'] != $osC_Session->value('language')) ? ' style="display: none;"' : '') . '>' . osc_draw_input_field('products_name[' . $l_entry['id'] . ']', (isset($pInfo) && is_array($pInfo->products_name) && isset($pInfo->products_name[$l_entry['id']]) ? $pInfo->products_name[$l_entry['id']] : '')) . '</div>';
+ }
+?>
+ </td>
+ </tr>
+ <tr bgcolor="#fff3e7">
+ <td class="main" valign="top"><?php echo TEXT_PRODUCTS_DESCRIPTION; ?></td>
+ <td>
+<?php
+ foreach ($languages as $l_entry) {
+ echo ' <div id="pDesc_' . $l_entry['code'] . '"' . (($l_entry['directory'] != $osC_Session->value('language')) ? ' style="display: none;"' : '') . '>' . tep_draw_textarea_field('products_description[' . $l_entry['id'] . ']', 'soft', '70', '15', (isset($pInfo) && is_array($pInfo->products_description) && isset($pInfo->products_description[$l_entry['id']]) ? $pInfo->products_description[$l_entry['id']] : ''), 'id="fckpd_' . $l_entry['code'] . '" style="width: 100%;"') . '</div>';
+
+ echo '<script type="text/javascript"><!--' . "\n" .
+ ' var fckpd_' . $l_entry['code'] . ' = new FCKeditor(\'fckpd_' . $l_entry['code'] . '\');' . "\n" .
+ ' fckpd_' . $l_entry['code'] . '.BasePath = "' . DIR_WS_ADMIN . 'external/FCKeditor/2.0b1/";' . "\n" .
+ ' fckpd_' . $l_entry['code'] . '.Height = "400";' . "\n" .
+ ' fckpd_' . $l_entry['code'] . '.ReplaceTextarea();' . "\n" .
+ '//--></script>';
+ }
+?>
+ </td>
+ </tr>
+ <tr bgcolor="#fff3e7">
+ <td class="main"><?php echo TEXT_PRODUCTS_URL . '<br><small>' . TEXT_PRODUCTS_URL_WITHOUT_HTTP . '</small>'; ?></td>
+ <td>
+<?php
+ foreach ($languages as $l_entry) {
+ echo ' <div id="pURL_' . $l_entry['code'] . '"' . (($l_entry['directory'] != $osC_Session->value('language')) ? ' style="display: none;"' : '') . '>' . osc_draw_input_field('products_url[' . $l_entry['id'] . ']', (isset($pInfo) && is_array($pInfo->products_url) && isset($pInfo->products_url[$l_entry['id']]) ? $pInfo->products_url[$l_entry['id']] : '')) . '</div>';
+ }
+?>
+ </td>
+ </tr>
+ <tr>
+ <td class="smallText" colspan="2"> </td>
+ </tr>
+ <tr bgcolor="#ebebff">
+ <td class="main"><?php echo TEXT_PRODUCTS_TAX_CLASS; ?></td>
+ <td class="main"><?php echo osc_draw_pull_down_menu('products_tax_class_id', $tax_class_array, (isset($pInfo) ? $pInfo->products_tax_class_id : ''), 'onchange="updateGross()"'); ?></td>
+ </tr>
+ <tr bgcolor="#ebebff">
+ <td class="main"><?php echo TEXT_PRODUCTS_PRICE_NET; ?></td>
+ <td class="main"><?php echo osc_draw_input_field('products_price', (isset($pInfo) ? $pInfo->products_price : ''), 'onKeyUp="updateGross()"'); ?></td>
+ </tr>
+ <tr bgcolor="#ebebff">
+ <td class="main"><?php echo TEXT_PRODUCTS_PRICE_GROSS; ?></td>
+ <td class="main"><?php echo osc_draw_input_field('products_price_gross', (isset($pInfo) ? $pInfo->products_price : ''), 'OnKeyUp="updateNet()"'); ?></td>
+ </tr>
+ <tr>
+ <td class="smallText" colspan="2"> </td>
+ </tr>
+ <tr>
+ <td class="main"><?php echo TEXT_PRODUCTS_QUANTITY; ?></td>
+ <td class="main"><?php echo osc_draw_input_field('products_quantity', (isset($pInfo) ? $pInfo->products_quantity : '')); ?></td>
+ </tr>
+ <tr>
+ <td class="smallText" colspan="2"> </td>
+ </tr>
+ <tr>
+ <td class="main"><?php echo TEXT_PRODUCTS_MODEL; ?></td>
+ <td class="main"><?php echo osc_draw_input_field('products_model', (isset($pInfo) ? $pInfo->products_model : '')); ?></td>
+ </tr>
+ <tr>
+ <td class="smallText" colspan="2"> </td>
+ </tr>
+ <tr>
+ <td class="main"><?php echo TEXT_PRODUCTS_IMAGE; ?></td>
+ <td class="main"><?php echo osc_draw_file_field('products_image') . '<br>' . (isset($pInfo) ? $pInfo->products_image . osc_draw_hidden_field('products_previous_image', $pInfo->products_image) : ''); ?></td>
+ </tr>
+ <tr>
+ <td class="smallText" colspan="2"> </td>
+ </tr>
+ <tr>
+ <td class="main"><?php echo TEXT_PRODUCTS_WEIGHT; ?></td>
+ <td class="main"><?php echo osc_draw_input_field('products_weight', (isset($pInfo) ? $pInfo->products_weight : '')). ' ' . osc_draw_pull_down_menu('products_weight_class', $weight_class_array, (isset($pInfo) ? $pInfo->products_weight_class : SHIPPING_WEIGHT_UNIT)); ?></td>
+ </tr>
+ </table>
+
+<script language="javascript"><!--
+ updateGross();
+//--></script>
+
+ </div>
+
+ <div class="tab-page" id="tabPage2">
+ <h2 class="tab"><?php echo TAB_ATTRIBUTES; ?></h2>
+
+<script type="text/javascript">tp1.addTabPage( document.getElementById( "tabPage2" ) );</script>
+
+ <table border="0" width="100%" cellspacing="0" cellpadding="2">
+ <tr>
+ <td width="30%" valign="top"><select name="attributes" size="20" style="width: 100%;">
+<?php
+ $Qoptions = $osC_Database->query('select products_options_id, products_options_name from :table_products_options where language_id = :language_id order by products_options_name');
+ $Qoptions->bindTable(':table_products_options', TABLE_PRODUCTS_OPTIONS);
+ $Qoptions->bindInt(':language_id', $osC_Session->value('languages_id'));
+ $Qoptions->execute();
+
+ while ($Qoptions->next()) {
+ echo ' <optgroup label="' . $Qoptions->value('products_options_name') . '" id="' . $Qoptions->value('products_options_id') . '">' . "\n";
+
+ $Qvalues = $osC_Database->query('select pov.products_options_values_id, pov.products_options_values_name from :table_products_options_values pov, :table_products_options_values_to_products_options pov2po where pov2po.products_options_id = :products_options_id and pov2po.products_options_values_id = pov.products_options_values_id and pov.language_id = :language_id order by pov.products_options_values_name');
+ $Qvalues->bindTable(':table_products_options_values', TABLE_PRODUCTS_OPTIONS_VALUES);
+ $Qvalues->bindTable(':table_products_options_values_to_products_options', TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS);
+ $Qvalues->bindInt(':products_options_id', $Qoptions->valueInt('products_options_id'));
+ $Qvalues->bindInt(':language_id', $osC_Session->value('languages_id'));
+ $Qvalues->execute();
+
+ while ($Qvalues->next()) {
+ echo ' <option value="' . $Qvalues->valueInt('products_options_values_id') . '">' . $Qvalues->value('products_options_values_name') . '</option>' . "\n";
+ }
+
+ echo ' </optgroup>' . "\n";
+ }
+?>
+ </select></td>
+ <td align="center" width="10%" class="smallText">
+ <input type="button" value=">>" onClick="moreFields()">
+ </td>
+ <td width="60%" valign="top" class="smallText">
+ <fieldset>
+ <legend><?php echo FIELDSET_ASSIGNED_ATTRIBUTES; ?></legend>
+
+ <table border="0" width="100%" cellspacing="0" cellpadding="2">
+<?php
+ $Qattributes = $osC_Database->query('select po.products_options_id, po.products_options_name, pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from :table_products_attributes pa, :table_products_options po, :table_products_options_values pov where pa.products_id = :products_id and pa.options_id = po.products_options_id and po.language_id = :language_id and pa.options_values_id = pov.products_options_values_id and pov.language_id = :language_id order by po.products_options_name, pov.products_options_values_name');
+ $Qattributes->bindTable(':table_products_attributes', TABLE_PRODUCTS_ATTRIBUTES);
+ $Qattributes->bindTable(':table_products_options', TABLE_PRODUCTS_OPTIONS);
+ $Qattributes->bindTable(':table_products_options_values', TABLE_PRODUCTS_OPTIONS_VALUES);
+ $Qattributes->bindInt(':products_id', $_GET['pID']);
+ $Qattributes->bindInt(':language_id', $osC_Session->value('languages_id'));
+ $Qattributes->bindInt(':language_id', $osC_Session->value('languages_id'));
+ $Qattributes->execute();
+
+ $current_attribute_group = '';
+
+ while ($Qattributes->next()) {
+ if ($Qattributes->value('products_options_name') != $current_attribute_group) {
+ echo ' <tr>' . "\n" .
+ ' <td class="smallText" colspan="3"><b>' . $Qattributes->value('products_options_name') . '</b></td>' . "\n" .
+ ' </tr>' . "\n";
+
+ $current_attribute_group = $Qattributes->value('products_options_name');
+ }
+
+ echo ' <tr id="attribute-' . $Qattributes->valueInt('products_options_id') . '_' . $Qattributes->valueInt('products_options_values_id') . '">' . "\n" .
+ ' <td class="smallText" width="50%">' . $Qattributes->value('products_options_values_name') . '</td>' . "\n" .
+ ' <td class="smallText">' . osc_draw_input_field('attribute_prefix[' . $Qattributes->valueInt('products_options_id') . '][' . $Qattributes->valueInt('products_options_values_id') . ']', $Qattributes->value('price_prefix'), 'size="1" maxlength="1"') . ' ' . osc_draw_input_field('attribute_price[' . $Qattributes->valueInt('products_options_id') . '][' . $Qattributes->valueInt('products_options_values_id') . ']', $Qattributes->value('options_values_price')) . '</td>' . "\n" .
+ ' <td class="smallText" align="right"><input type="button" value="-" id="attribute-' . $Qattributes->valueInt('products_options_id') . '_' . $Qattributes->valueInt('products_options_values_id') . '-button" onClick="toggleAttributeStatus(\'attribute-' . $Qattributes->valueInt('products_options_id') . '_' . $Qattributes->valueInt('products_options_values_id') . '\');"></td>' . "\n" .
+ ' </tr>' . "\n";
+ }
+?>
+ </table>
+
+ <span id="writeroot"></span>
+
+ <div id="readroot" style="display: none">
+ <table border="0" width="100%" cellspacing="0" cellpadding="2">
+ <tr>
+ <td class="smallText" colspan="3"><b><span id="attribteGroupName"> </span></b></td>
+ </tr>
+ <tr class="attributeAdd">
+ <td class="smallText" width="50%"><span id="attributeKey"> </span></td>
+ <td class="smallText"><?php echo osc_draw_input_field('new_attribute_prefix', '+', 'disabled size="1" maxlength="1"') . ' ' . osc_draw_input_field('new_attribute_price', '', 'disabled'); ?></td>
+ <td class="smallText" align="right"><input type="button" value="-" onClick="this.parentNode.parentNode.parentNode.parentNode.removeChild(this.parentNode.parentNode.parentNode);"></td>
+ </tr>
+ </table>
+ </div>
+ </fieldset>
+ </td>
+ </tr>
+ </table>
+ </div>
+
+ <p align="right"><?php echo osc_draw_hidden_field('products_date_added', (isset($pInfo) && isset($pInfo->products_date_added) ? $pInfo->products_date_added : date('Y-m-d'))) . '<input type="submit" value="' . IMAGE_PREVIEW . '" class="operationButton"> <input type="button" value="' . IMAGE_CANCEL . '" onClick="document.location.href=\'' . tep_href_link(FILENAME_PRODUCTS, 'cPath=' . $cPath . (isset($_GET['pID']) ? '&pID=' . $_GET['pID'] : '')) . '\';" class="operationButton">'; ?></p>
+
+ </form>
+</div>
----------
admin /admin /templates /pages
products_preview.php added at 1.1
diff -N products_preview.php
--- /dev/null Sat Aug 28 00:13:14 2004
+++ /tmp/cvsAAAfeaq1P Sat Aug 28 00:13:16 2004
@@ -0,0 +1,114 @@
+<?php
+/*
+ $Id$
+
+ osCommerce, Open Source E-Commerce Solutions
+ http://www.oscommerce.com
+
+ Copyright (c) 2004 osCommerce
+
+ Released under the GNU General Public License
+*/
+
+ if (isset($_GET['pID']) && empty($_POST)) {
+ $Qp = $osC_Database->query('select products_id, products_quantity, products_model, products_image, products_price, products_weight, products_weight_class, products_date_added, products_last_modified, date_format(products_date_available, "%Y-%m-%d") as products_date_available, products_status, products_tax_class_id, manufacturers_id from :table_products where products_id = :products_id');
+ $Qp->bindTable(':table_products', TABLE_PRODUCTS);
+ $Qp->bindInt(':products_id', $_GET['pID']);
+ $Qp->execute();
+
+ $Qpd = $osC_Database->query('select products_name, products_description, products_url, language_id from :table_products_description where products_id = :products_id');
+ $Qpd->bindTable(':table_products_description', TABLE_PRODUCTS_DESCRIPTION);
+ $Qpd->bindInt(':products_id', $_GET['pID']);
+ $Qpd->execute();
+
+ $pd_extra = array();
+ while ($Qpd->next()) {
+ $pd_extra['products_name'][$Qpd->valueInt('language_id')] = $Qpd->value('products_name');
+ $pd_extra['products_description'][$Qpd->valueInt('language_id')] = $Qpd->value('products_description');
+ $pd_extra['products_url'][$Qpd->valueInt('language_id')] = $Qpd->value('products_url');
+ }
+
+ $pInfo = new objectInfo(array_merge($Qp->toArray(), $pd_extra));
+
+ $products_image_name = $pInfo->products_image;
+ } else {
+ $pInfo = new objectInfo($_POST);
+
+ if (!isset($_GET['read'])) {
+// copy image only if modified
+ if ($products_image = new upload('products_image', DIR_FS_CATALOG_IMAGES)) {
+ $products_image_name = $products_image->filename;
+ } else {
+ $products_image_name = (isset($_POST['products_previous_image']) ? $_POST['products_previous_image'] : '');
+ }
+ }
+ }
+
+ $languages = tep_get_languages();
+
+ echo tep_draw_form('save_product', FILENAME_PRODUCTS, 'cPath=' . $cPath . (isset($_GET['pID']) ? '&pID=' . $_GET['pID'] : '') . '&action=save_product', 'post', 'enctype="multipart/form-data"');
+?>
+
+<table border="0" width="100%" cellspacing="0" cellpadding="2">
+ <tr bgcolor="#fff3e7">
+ <td>
+<?php
+ foreach ($languages as $l_entry) {
+ echo '<span id="lang_' . $l_entry['code'] . '"' . (($l_entry['directory'] == $osC_Session->value('language')) ? ' class="highlight"' : '') . '><a href="javascript:toggleDivBlocks(\'pName_\', \'pName_' . $l_entry['code'] . '\'); toggleClass(\'lang_\', \'lang_' . $l_entry['code'] . '\', \'highlight\', \'span\');">' . tep_image(DIR_WS_CATALOG_LANGUAGES . $l_entry['directory'] . '/images/' . $l_entry['image'], $l_entry['name']) . '</a></span> ';
+ }
+?>
+ </td>
+ </tr>
+</table>
+
+<?php
+ foreach ($languages as $l_entry) {
+?>
+
+<div id="pName_<?php echo $l_entry['code']; ?>" <?php echo (($l_entry['directory'] != $osC_Session->value('language')) ? ' style="display: none;"' : ''); ?>>
+ <table border="0" width="100%" cellspacing="0" cellpadding="2">
+ <tr>
+ <td><h1><?php echo $pInfo->products_name[$l_entry['id']]; ?></h1></td>
+ <td align="right"><h1><?php echo $osC_Currencies->format($pInfo->products_price); ?></h1></td>
+ </tr>
+ </table>
+
+ <p class="main"><?php echo tep_image(DIR_WS_CATALOG_IMAGES . $products_image_name, $pInfo->products_name[$l_entry['id']], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align="right" hspace="5" vspace="5"') . $pInfo->products_description[$l_entry['id']]; ?></p>
+
+<?php
+ if (!empty($pInfo->products_url[$l_entry['id']])) {
+ echo '<p class="main">' . sprintf(TEXT_PRODUCT_MORE_INFORMATION, $pInfo->products_url[$l_entry['id']]) . '</p>';
+ }
+?>
+
+<?php
+ if ($pInfo->products_date_available > date('Y-m-d')) {
+ echo '<p class="smallText" align="center">' . sprintf(TEXT_PRODUCT_DATE_AVAILABLE, tep_date_long($pInfo->products_date_available)) . '</p>';
+ } else {
+ echo '<p class="smallText" align="center">' . sprintf(TEXT_PRODUCT_DATE_ADDED, tep_date_long($pInfo->products_date_added)) . '</p>';
+ }
+?>
+
+</div>
+
+<?php
+ }
+
+ if (isset($_GET['read']) && ($_GET['read'] == 'only')) {
+ echo '<p align="right"><input type="button" value="' . IMAGE_BACK . '" onClick="document.location.href=\'' . tep_href_link(FILENAME_PRODUCTS, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id) . '\';" class="operationButton"></p>';
+ } else {
+ echo '<p align="right">';
+
+ foreach (osc_sanitize_multidimensional_array($_POST) as $key => $value) {
+ echo osc_draw_hidden_field($key, $value);
+ }
+
+ echo osc_draw_hidden_field('products_image', $products_image_name);
+
+ echo '<input type="submit" value="' . IMAGE_BACK . '" name="product_edit" class="operationButton"> <input type="submit" value="' . (isset($_GET['pID']) ? IMAGE_UPDATE : IMAGE_INSERT) . '" class="operationButton"> <input type="button" value="' . IMAGE_CANCEL . '" onClick="document.location.href=\'' . tep_href_link(FILENAME_PRODUCTS, 'cPath=' . $cPath . (isset($_GET['pID']) ? '&pID=' . $_GET['pID'] : '')) . '\';" class="operationButton">';
+
+ echo '</p>';
+ }
+?>
+
+</form>
----------
admin /admin /templates /pages
categories.php 1.2 -> 1.3
diff -u -r1.2 -r1.3
--- categories.php 2004/08/04 16:53:50 1.2
+++ categories.php 2004/08/27 22:13:15 1.3
@@ -31,7 +31,7 @@
<table border="0" width="100%" cellspacing="0" cellpadding="2" class="dataTable">
<thead>
<tr>
- <th><?php echo TABLE_HEADING_CATEGORIES_PRODUCTS; ?></th>
+ <th><?php echo TABLE_HEADING_CATEGORIES; ?></th>
<th><?php echo TABLE_HEADING_STATUS; ?></th>
<th><?php echo TABLE_HEADING_ACTION; ?></th>
</tr>
@@ -86,60 +86,6 @@
</tr>
<?php
}
-
- if (isset($_GET['search']) && !empty($_GET['search'])) {
- $Qproducts = $osC_Database->query('select p.products_id, pd.products_name, p.products_quantity, p.products_image, p.products_price, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, p2c.categories_id from :table_products p, :table_products_description pd, :table_products_to_categories p2c where p.products_id = pd.products_id and pd.language_id = :language_id and p.products_id = p2c.products_id and pd.products_name like :products_name order by pd.products_name');
- $Qproducts->bindValue(':products_name', '%' . $_GET['search'] . '%');
- } else {
- $Qproducts = $osC_Database->query('select p.products_id, pd.products_name, p.products_quantity, p.products_image, p.products_price, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status from :table_products p, :table_products_description pd, :table_products_to_categories p2c where p.products_id = pd.products_id and pd.language_id = :language_id and p.products_id = p2c.products_id and p2c.categories_id = :categories_id order by pd.products_name');
- $Qproducts->bindInt(':categories_id', $current_category_id);
- }
- $Qproducts->bindTable(':table_products', TABLE_PRODUCTS);
- $Qproducts->bindTable(':table_products_description', TABLE_PRODUCTS_DESCRIPTION);
- $Qproducts->bindTable(':table_products_to_categories', TABLE_PRODUCTS_TO_CATEGORIES);
- $Qproducts->bindInt(':language_id', $osC_Session->value('languages_id'));
- $Qproducts->execute();
-
- while ($Qproducts->next()) {
- if (isset($_GET['search']) && !empty($_GET['search'])) {
- $cPath = $Qproducts->valueInt('categories_id');
- }
-
- if (!isset($pInfo) && !isset($cInfo) && (!isset($_GET['pID']) && !isset($_GET['cID']) || (isset($_GET['pID']) && ($_GET['pID'] == $Qproducts->valueInt('products_id')))) && ($action != 'cNew')) {
- $Qreviews = $osC_Database->query('select (avg(reviews_rating) / 5 * 100) as average_rating from :table_reviews where products_id = :products_id');
- $Qreviews->bindTable(':table_reviews', TABLE_REVIEWS);
- $Qreviews->bindInt(':products_id', $Qproducts->valueInt('products_id'));
- $Qreviews->execute();
-
- $pInfo = new objectInfo(array_merge($Qproducts->toArray(), $Qreviews->toArray()));
- }
-
- if (isset($pInfo) && ($Qproducts->valueInt('products_id') == $pInfo->products_id)) {
- echo ' <tr class="selected">' . "\n";
- } else {
- echo ' <tr onMouseOver="rowOverEffect(this);" onMouseOut="rowOutEffect(this);" onClick="document.location.href=\'' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $Qproducts->valueInt('products_id')) . '\';">' . "\n";
- }
-?>
- <td><?php echo '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $Qproducts->valueInt('products_id') . '&action=new_product_preview&read=only') . '">' . tep_image(DIR_WS_ICONS . 'preview.gif', ICON_PREVIEW) . ' ' . $Qproducts->value('products_name') . '</a>'; ?></td>
- <td align="center"><?php echo tep_image('templates/' . $template . '/images/icons/' . (($Qproducts->valueInt('products_status') === 1) ? 'checkbox_ticked.gif' : 'checkbox_crossed.gif')); ?></td>
- <td align="right">
-<?php
- echo '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $Qproducts->valueInt('products_id') . '&action=new_product') . '">' . tep_image('templates/' . $template . '/images/icons/16x16/configure.png', IMAGE_EDIT, '16', '16') . '</a>';
-
- if (isset($pInfo) && ($Qproducts->valueInt('products_id') == $pInfo->products_id)) {
- echo '<a href="#" onClick="toggleInfoBox(\'pMove\');">' . tep_image('templates/' . $template . '/images/icons/16x16/move.png', IMAGE_MOVE, '16', '16') . '</a> ' .
- '<a href="#" onClick="toggleInfoBox(\'pCopyTo\');">' . tep_image('templates/' . $template . '/images/icons/16x16/copy.png', IMAGE_COPY_TO, '16', '16') . '</a> ' .
- '<a href="#" onClick="toggleInfoBox(\'pDelete\');">' . tep_image('templates/' . $template . '/images/icons/16x16/trash.png', IMAGE_DELETE, '16', '16') . '</a>';
- } else {
- echo '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $Qproducts->valueInt('products_id') . '&action=pMove') . '">' . tep_image('templates/' . $template . '/images/icons/16x16/move.png', IMAGE_MOVE, '16', '16') . '</a> ' .
- '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $Qproducts->valueInt('products_id') . '&action=pCopyTo') . '">' . tep_image('templates/' . $template . '/images/icons/16x16/copy.png', IMAGE_COPY_TO, '16', '16') . '</a> ' .
- '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $Qproducts->valueInt('products_id') . '&action=pDelete') . '">' . tep_image('templates/' . $template . '/images/icons/16x16/trash.png', IMAGE_DELETE, '16', '16') . '</a>';
- }
-?>
- </td>
- </tr>
-<?php
- }
?>
</tbody>
</table>
@@ -154,8 +100,6 @@
if ($action != 'cNew') {
echo '<input type="button" value="' . IMAGE_NEW_CATEGORY . '" onClick="toggleInfoBox(\'cNew\');" class="infoBoxButton"> ';
}
-
- echo '<input type="button" value="' . IMAGE_NEW_PRODUCT . '" onClick="document.location.href=\'' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&action=new_product') . '\';" class="infoBoxButton">';
}
?>
</p>
@@ -252,72 +196,6 @@
<p><?php echo TEXT_EDIT_SORT_ORDER . '<br>' . osc_draw_input_field('sort_order', $cInfo->sort_order); ?></p>
<p align="center"><?php echo '<input type="submit" value="' . IMAGE_UPDATE . '" class="operationButton"> <input type="button" value="' . IMAGE_CANCEL . '" onClick="toggleInfoBox(\'cDefault\');" class="operationButton">'; ?></p>
-
- </form>
- </div>
-</div>
-
-<?php
- } elseif (isset($pInfo)) {
-?>
-
-<div id="infoBox_pCopyTo" <?php if ($action != 'pCopyTo') { echo 'style="display: none;"'; } ?>>
- <div class="infoBoxHeading"><?php echo tep_image('templates/' . $template . '/images/icons/16x16/copy.png', IMAGE_COPY_TO, '16', '16') . ' ' . $pInfo->products_name; ?></div>
- <div class="infoBoxContent">
- <?php echo tep_draw_form('pCopyTo', FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . '&action=copy_to_confirm'); ?>
-
- <p><?php echo TEXT_INFO_COPY_TO_INTRO; ?></p>
- <p><?php echo TEXT_INFO_CURRENT_CATEGORIES . '<br>' . tep_output_generated_category_path($pInfo->products_id, 'product'); ?></p>
- <p><?php echo TEXT_CATEGORIES . '<br>' . osc_draw_pull_down_menu('categories_id', tep_get_category_tree(), $current_category_id); ?></p>
- <p><?php echo TEXT_HOW_TO_COPY . '<br>' . osc_draw_radio_field('copy_as', array(array('id' => 'link', 'text' => TEXT_COPY_AS_LINK), array('id' => 'duplicate', 'text' => TEXT_COPY_AS_DUPLICATE)), 'link', '', false, '<br>'); ?></p>
-
- <p align="center"><?php echo '<input type="submit" value="' . IMAGE_COPY . '" class="operationButton"> <input type="button" value="' . IMAGE_CANCEL . '" onClick="toggleInfoBox(\'cDefault\');" class="operationButton">'; ?></p>
-
- </form>
- </div>
-</div>
-
-<div id="infoBox_pMove" <?php if ($action != 'pMove') { echo 'style="display: none;"'; } ?>>
- <div class="infoBoxHeading"><?php echo tep_image('templates/' . $template . '/images/icons/16x16/move.png', IMAGE_MOVE, '16', '16') . ' ' . $pInfo->products_name; ?></div>
- <div class="infoBoxContent">
- <?php echo tep_draw_form('pMove', FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . '&action=move_product_confirm'); ?>
-
- <p><?php echo sprintf(TEXT_MOVE_PRODUCTS_INTRO, $pInfo->products_name); ?></p>
- <p><?php echo TEXT_INFO_CURRENT_CATEGORIES . '<br>' . tep_output_generated_category_path($pInfo->products_id, 'product'); ?></p>
- <p><?php echo sprintf(TEXT_MOVE, $pInfo->products_name) . '<br>' . osc_draw_pull_down_menu('move_to_category_id', tep_get_category_tree(), $current_category_id); ?></p>
-
- <p align="center"><?php echo '<input type="submit" value="' . IMAGE_MOVE . '" class="operationButton"> <input type="button" value="' . IMAGE_CANCEL . '" onClick="toggleInfoBox(\'cDefault\');" class="operationButton">'; ?></p>
-
- </form>
- </div>
-</div>
-
-<div id="infoBox_pDelete" <?php if ($action != 'pDelete') { echo 'style="display: none;"'; } ?>>
- <div class="infoBoxHeading"><?php echo tep_image('templates/' . $template . '/images/icons/16x16/trash.png', IMAGE_DELETE, '16', '16') . ' ' . $pInfo->products_name; ?></div>
- <div class="infoBoxContent">
- <?php echo tep_draw_form('pDelete', FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . '&action=delete_product_confirm'); ?>
-
- <p><?php echo TEXT_DELETE_PRODUCT_INTRO; ?></p>
- <p><?php echo $pInfo->products_name; ?></p>
- <p>
-<?php
- $product_categories_array = array();
- $product_categories = tep_generate_category_path($pInfo->products_id, 'product');
- for ($i=0, $n=sizeof($product_categories); $i<$n; $i++) {
- $category_path = '';
- for ($j=0, $k=sizeof($product_categories[$i]); $j<$k; $j++) {
- $category_path .= $product_categories[$i][$j]['text'] . ' > ';
- }
- $category_path = substr($category_path, 0, -16);
-
- $product_categories_array[] = array('id' => $product_categories[$i][sizeof($product_categories[$i])-1]['id'], 'text' => $category_path);
- }
-
- echo osc_draw_checkbox_field('product_categories[]', $product_categories_array, true, '', false, '<br>');
-?>
- </p>
-
- <p align="center"><?php echo '<input type="submit" value="' . IMAGE_DELETE . '" class="operationButton"> <input type="button" value="' . IMAGE_CANCEL . '" onClick="toggleInfoBox(\'cDefault\');" class="operationButton">'; ?></p>
</form>
</div>
----------
admin /admin /templates /pages
categories_new_product.php removed after 1.3
diff -N categories_new_product.php
--- /tmp/cvsAAANhaO1P Sat Aug 28 00:13:16 2004
+++ /dev/null Sat Aug 28 00:13:16 2004
@@ -1,251 +0,0 @@
-<?php
-/*
- $Id$
-
- osCommerce, Open Source E-Commerce Solutions
- http://www.oscommerce.com
-
- Copyright (c) 2004 osCommerce
-
- Released under the GNU General Public License
-*/
-
- if (isset($_GET['pID']) && empty($_POST)) {
- $Qp = $osC_Database->query('select products_id, products_quantity, products_model, products_image, products_price, products_weight, products_weight_class, products_date_added, products_last_modified, date_format(products_date_available, "%Y-%m-%d") as products_date_available, products_status, products_tax_class_id, manufacturers_id from :table_products where products_id = :products_id');
- $Qp->bindTable(':table_products', TABLE_PRODUCTS);
- $Qp->bindInt(':products_id', $_GET['pID']);
- $Qp->execute();
-
- $Qpd = $osC_Database->query('select products_name, products_description, products_url, language_id from :table_products_description where products_id = :products_id');
- $Qpd->bindTable(':table_products_description', TABLE_PRODUCTS_DESCRIPTION);
- $Qpd->bindInt(':products_id', $_GET['pID']);
- $Qpd->execute();
-
- $pd_extra = array();
- while ($Qpd->next()) {
- $pd_extra['products_name'][$Qpd->valueInt('language_id')] = $Qpd->value('products_name');
- $pd_extra['products_description'][$Qpd->valueInt('language_id')] = $Qpd->value('products_description');
- $pd_extra['products_url'][$Qpd->valueInt('language_id')] = $Qpd->value('products_url');
- }
-
- $pInfo = new objectInfo(array_merge($Qp->toArray(), $pd_extra));
- } elseif (!empty($_POST)) {
- $pInfo = new objectInfo($_POST);
- }
-
- $Qmanufacturers = $osC_Database->query('select manufacturers_id, manufacturers_name from :table_manufacturers order by manufacturers_name');
- $Qmanufacturers->bindTable(':table_manufacturers', TABLE_MANUFACTURERS);
- $Qmanufacturers->execute();
-
- $manufacturers_array = array(array('id' => '', 'text' => TEXT_NONE));
- while ($Qmanufacturers->next()) {
- $manufacturers_array[] = array('id' => $Qmanufacturers->valueInt('manufacturers_id'),
- 'text' => $Qmanufacturers->value('manufacturers_name'));
- }
-
- $Qtc = $osC_Database->query('select tax_class_id, tax_class_title from :table_tax_class order by tax_class_title');
- $Qtc->bindTable(':table_tax_class', TABLE_TAX_CLASS);
- $Qtc->execute();
-
- $tax_class_array = array(array('id' => '0', 'text' => TEXT_NONE));
- while ($Qtc->next()) {
- $tax_class_array[] = array('id' => $Qtc->valueInt('tax_class_id'),
- 'text' => $Qtc->value('tax_class_title'));
- }
-
- $Qwc = $osC_Database->query('select weight_class_id, weight_class_title from :table_weight_class where language_id = :language_id order by weight_class_title');
- $Qwc->bindTable(':table_weight_class', TABLE_WEIGHT_CLASS);
- $Qwc->bindInt(':language_id', $osC_Session->value('languages_id'));
- $Qwc->execute();
-
- $weight_class_array = array();
- while ($Qwc->next()) {
- $weight_class_array[] = array('id' => $Qwc->valueInt('weight_class_id'),
- 'text' => $Qwc->value('weight_class_title'));
- }
-
- $languages = tep_get_languages();
-?>
-<script type="text/javascript" src="external/FCKeditor/2.0b1/fckeditor.js"></script>
-<style type="text/css">@import url('external/jscalendar/calendar-win2k-1.css');</style>
-<script type="text/javascript" src="external/jscalendar/calendar.js"></script>
-<script type="text/javascript" src="external/jscalendar/lang/calendar-en.js"></script>
-<script type="text/javascript" src="external/jscalendar/calendar-setup.js"></script>
-<script language="javascript"><!--
-var tax_rates = new Array();
-<?php
- foreach ($tax_class_array as $tc_entry) {
- if ($tc_entry['id'] > 0) {
- echo 'tax_rates["' . $tc_entry['id'] . '"] = ' . tep_get_tax_rate_value($tc_entry['id']) . ';' . "\n";
- }
- }
-?>
-
-function doRound(x, places) {
- return Math.round(x * Math.pow(10, places)) / Math.pow(10, places);
-}
-
-function getTaxRate() {
- var selected_value = document.forms["new_product"].products_tax_class_id.selectedIndex;
- var parameterVal = document.forms["new_product"].products_tax_class_id[selected_value].value;
-
- if ( (parameterVal > 0) && (tax_rates[parameterVal] > 0) ) {
- return tax_rates[parameterVal];
- } else {
- return 0;
- }
-}
-
-function updateGross() {
- var taxRate = getTaxRate();
- var grossValue = document.forms["new_product"].products_price.value;
-
- if (taxRate > 0) {
- grossValue = grossValue * ((taxRate / 100) + 1);
- }
-
- document.forms["new_product"].products_price_gross.value = doRound(grossValue, 4);
-}
-
-function updateNet() {
- var taxRate = getTaxRate();
- var netValue = document.forms["new_product"].products_price_gross.value;
-
- if (taxRate > 0) {
- netValue = netValue / ((taxRate / 100) + 1);
- }
-
- document.forms["new_product"].products_price.value = doRound(netValue, 4);
-}
-//--></script>
-
-<h1><?php echo sprintf(TEXT_NEW_PRODUCT, tep_output_generated_category_path($current_category_id)); ?></h1>
-
-<?php
- echo tep_draw_form('new_product', FILENAME_CATEGORIES, 'cPath=' . $cPath . (isset($_GET['pID']) ? '&pID=' . $_GET['pID'] : '') . '&action=new_product_preview', 'post', 'enctype="multipart/form-data"');
-?>
-
-<table border="0" width="100%" cellspacing="0" cellpadding="2">
- <tr>
- <td class="main"><?php echo TEXT_PRODUCTS_STATUS; ?></td>
- <td class="main"><?php echo osc_draw_radio_field('products_status', array(array('id' => '1', 'text' => TEXT_PRODUCT_AVAILABLE), array('id' => '0', 'text' => TEXT_PRODUCT_NOT_AVAILABLE)), (isset($pInfo) ? $pInfo->products_status : '0')); ?></td>
- </tr>
- <tr>
- <td class="smallText" colspan="2"> </td>
- </tr>
- <tr>
- <td class="main"><?php echo TEXT_PRODUCTS_DATE_AVAILABLE; ?><br><small>(YYYY-MM-DD)</small></td>
- <td class="main"><?php echo osc_draw_input_field('products_date_available', (isset($pInfo) ? $pInfo->products_date_available : ''), 'id="calendarValue"'); ?><input type="button" value="..." id="calendarTrigger" class="operationButton"><script type="text/javascript">Calendar.setup( { inputField: "calendarValue", ifFormat: "%Y-%m-%d", button: "calendarTrigger" } );</script></td>
- </tr>
- <tr>
- <td class="smallText" colspan="2"> </td>
- </tr>
- <tr>
- <td class="main"><?php echo TEXT_PRODUCTS_MANUFACTURER; ?></td>
- <td class="main"><?php echo osc_draw_pull_down_menu('manufacturers_id', $manufacturers_array, (isset($pInfo) ? $pInfo->manufacturers_id : '')); ?></td>
- </tr>
- <tr>
- <td class="smallText" colspan="2"> </td>
- </tr>
- <tr bgcolor="#fff3e7">
- <td class="main"> </td>
- <td>
-<?php
- foreach ($languages as $l_entry) {
- echo '<span id="lang_' . $l_entry['code'] . '"' . (($l_entry['directory'] == $osC_Session->value('language')) ? ' class="highlight"' : '') . '><a href="javascript:toggleDivBlocks(\'pName_\', \'pName_' . $l_entry['code'] . '\'); toggleDivBlocks(\'pDesc_\', \'pDesc_' . $l_entry['code'] . '\'); toggleDivBlocks(\'pURL_\', \'pURL_' . $l_entry['code'] . '\'); toggleClass(\'lang_\', \'lang_' . $l_entry['code'] . '\', \'highlight\', \'span\');">' . tep_image(DIR_WS_CATALOG_LANGUAGES . $l_entry['directory'] . '/images/' . $l_entry['image'], $l_entry['name']) . '</a></span> ';
- }
-?>
- </td>
- </tr>
- <tr bgcolor="#fff3e7">
- <td class="main"><?php echo TEXT_PRODUCTS_NAME; ?></td>
- <td>
-<?php
- foreach ($languages as $l_entry) {
- echo '<div id="pName_' . $l_entry['code'] . '"' . (($l_entry['directory'] != $osC_Session->value('language')) ? ' style="display: none;"' : '') . '>' . osc_draw_input_field('products_name[' . $l_entry['id'] . ']', (isset($pInfo) && is_array($pInfo->products_name) && isset($pInfo->products_name[$l_entry['id']]) ? $pInfo->products_name[$l_entry['id']] : '')) . '</div>';
- }
-?>
- </td>
- </tr>
- <tr bgcolor="#fff3e7">
- <td class="main" valign="top"><?php echo TEXT_PRODUCTS_DESCRIPTION; ?></td>
- <td>
-<?php
- foreach ($languages as $l_entry) {
- echo '<div id="pDesc_' . $l_entry['code'] . '"' . (($l_entry['directory'] != $osC_Session->value('language')) ? ' style="display: none;"' : '') . '>' . tep_draw_textarea_field('products_description[' . $l_entry['id'] . ']', 'soft', '70', '15', (isset($pInfo) && is_array($pInfo->products_description) && isset($pInfo->products_description[$l_entry['id']]) ? $pInfo->products_description[$l_entry['id']] : ''), 'id="fckpd_' . $l_entry['code'] . '" style="width: 100%;"') . '</div>';
-
- echo '<script type="text/javascript">' . "\n" .
- ' var fckpd_' . $l_entry['code'] . ' = new FCKeditor(\'fckpd_' . $l_entry['code'] . '\');' . "\n" .
- ' fckpd_' . $l_entry['code'] . '.BasePath = "' . DIR_WS_ADMIN . 'external/FCKeditor/2.0b1/";' . "\n" .
- ' fckpd_' . $l_entry['code'] . '.Height = "400";' . "\n" .
- ' fckpd_' . $l_entry['code'] . '.ReplaceTextarea();' . "\n" .
- '</script>';
- }
-?>
- </td>
- </tr>
- <tr bgcolor="#fff3e7">
- <td class="main"><?php echo TEXT_PRODUCTS_URL . '<br><small>' . TEXT_PRODUCTS_URL_WITHOUT_HTTP . '</small>'; ?></td>
- <td>
-<?php
- foreach ($languages as $l_entry) {
- echo '<div id="pURL_' . $l_entry['code'] . '"' . (($l_entry['directory'] != $osC_Session->value('language')) ? ' style="display: none;"' : '') . '>' . osc_draw_input_field('products_url[' . $l_entry['id'] . ']', (isset($pInfo) && is_array($pInfo->products_url) && isset($pInfo->products_url[$l_entry['id']]) ? $pInfo->products_url[$l_entry['id']] : '')) . '</div>';
- }
-?>
- </td>
- </tr>
- <tr>
- <td class="smallText" colspan="2"> </td>
- </tr>
- <tr bgcolor="#ebebff">
- <td class="main"><?php echo TEXT_PRODUCTS_TAX_CLASS; ?></td>
- <td class="main"><?php echo osc_draw_pull_down_menu('products_tax_class_id', $tax_class_array, (isset($pInfo) ? $pInfo->products_tax_class_id : ''), 'onchange="updateGross()"'); ?></td>
- </tr>
- <tr bgcolor="#ebebff">
- <td class="main"><?php echo TEXT_PRODUCTS_PRICE_NET; ?></td>
- <td class="main"><?php echo osc_draw_input_field('products_price', (isset($pInfo) ? $pInfo->products_price : ''), 'onKeyUp="updateGross()"'); ?></td>
- </tr>
- <tr bgcolor="#ebebff">
- <td class="main"><?php echo TEXT_PRODUCTS_PRICE_GROSS; ?></td>
- <td class="main"><?php echo osc_draw_input_field('products_price_gross', (isset($pInfo) ? $pInfo->products_price : ''), 'OnKeyUp="updateNet()"'); ?></td>
- </tr>
-<script language="javascript"><!--
-updateGross();
-//--></script>
- <tr>
- <td class="smallText" colspan="2"> </td>
- </tr>
- <tr>
- <td class="main"><?php echo TEXT_PRODUCTS_QUANTITY; ?></td>
- <td class="main"><?php echo osc_draw_input_field('products_quantity', (isset($pInfo) ? $pInfo->products_quantity : '')); ?></td>
- </tr>
- <tr>
- <td class="smallText" colspan="2"> </td>
- </tr>
- <tr>
- <td class="main"><?php echo TEXT_PRODUCTS_MODEL; ?></td>
- <td class="main"><?php echo osc_draw_input_field('products_model', (isset($pInfo) ? $pInfo->products_model : '')); ?></td>
- </tr>
- <tr>
- <td class="smallText" colspan="2"> </td>
- </tr>
- <tr>
- <td class="main"><?php echo TEXT_PRODUCTS_IMAGE; ?></td>
- <td class="main"><?php echo osc_draw_file_field('products_image') . '<br>' . (isset($pInfo) ? $pInfo->products_image . tep_draw_hidden_field('products_previous_image', $pInfo->products_image) : ''); ?></td>
- </tr>
- <tr>
- <td class="smallText" colspan="2"> </td>
- </tr>
- <tr>
- <td class="main"><?php echo TEXT_PRODUCTS_WEIGHT; ?></td>
- <td class="main"><?php echo osc_draw_input_field('products_weight', (isset($pInfo) ? $pInfo->products_weight : '')). ' ' . osc_draw_pull_down_menu('products_weight_class', $weight_class_array, (isset($pInfo) ? $pInfo->products_weight_class : SHIPPING_WEIGHT_UNIT)); ?></td>
- </tr>
- <tr>
- <td class="smallText" colspan="2"> </td>
- </tr>
- <tr>
- <td class="main" colspan="2" align="right"><?php echo osc_draw_hidden_field('products_date_added', (isset($pInfo) && isset($pInfo->products_date_added) ? $pInfo->products_date_added : date('Y-m-d'))) . '<input type="submit" value="' . IMAGE_PREVIEW . '" class="operationButton"> <input type="button" value="' . IMAGE_CANCEL . '" onClick="document.location.href=\'' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . (isset($_GET['pID']) ? '&pID=' . $_GET['pID'] : '')) . '\';" class="operationButton">'; ?></td>
- </tr>
-</table>
-
-</form>
----------
admin /admin /templates /pages
categories_new_product_preview.php removed after 1.1
diff -N categories_new_product_preview.php
--- /tmp/cvsAAALiaW1P Sat Aug 28 00:13:16 2004
+++ /dev/null Sat Aug 28 00:13:16 2004
@@ -1,122 +0,0 @@
-<?php
-/*
- $Id$
-
- osCommerce, Open Source E-Commerce Solutions
- http://www.oscommerce.com
-
- Copyright (c) 2004 osCommerce
-
- Released under the GNU General Public License
-*/
-
- if (isset($_GET['pID']) && empty($_POST)) {
- $Qp = $osC_Database->query('select products_id, products_quantity, products_model, products_image, products_price, products_weight, products_weight_class, products_date_added, products_last_modified, date_format(products_date_available, "%Y-%m-%d") as products_date_available, products_status, products_tax_class_id, manufacturers_id from :table_products where products_id = :products_id');
- $Qp->bindTable(':table_products', TABLE_PRODUCTS);
- $Qp->bindInt(':products_id', $_GET['pID']);
- $Qp->execute();
-
- $Qpd = $osC_Database->query('select products_name, products_description, products_url, language_id from :table_products_description where products_id = :products_id');
- $Qpd->bindTable(':table_products_description', TABLE_PRODUCTS_DESCRIPTION);
- $Qpd->bindInt(':products_id', $_GET['pID']);
- $Qpd->execute();
-
- $pd_extra = array();
- while ($Qpd->next()) {
- $pd_extra['products_name'][$Qpd->valueInt('language_id')] = $Qpd->value('products_name');
- $pd_extra['products_description'][$Qpd->valueInt('language_id')] = $Qpd->value('products_description');
- $pd_extra['products_url'][$Qpd->valueInt('language_id')] = $Qpd->value('products_url');
- }
-
- $pInfo = new objectInfo(array_merge($Qp->toArray(), $pd_extra));
-
- $products_image_name = $pInfo->products_image;
- } else {
- $pInfo = new objectInfo($_POST);
-
- if (!isset($_GET['read'])) {
-// copy image only if modified
- if ($products_image = new upload('products_image', DIR_FS_CATALOG_IMAGES)) {
- $products_image_name = $products_image->filename;
- } else {
- $products_image_name = (isset($_POST['products_previous_image']) ? $_POST['products_previous_image'] : '');
- }
- }
- }
-
- $languages = tep_get_languages();
-
- echo tep_draw_form('save_product', FILENAME_CATEGORIES, 'cPath=' . $cPath . (isset($_GET['pID']) ? '&pID=' . $_GET['pID'] : '') . '&action=save_product', 'post', 'enctype="multipart/form-data"');
-?>
-
-<table border="0" width="100%" cellspacing="0" cellpadding="2">
- <tr bgcolor="#fff3e7">
- <td>
-<?php
- foreach ($languages as $l_entry) {
- echo '<span id="lang_' . $l_entry['code'] . '"' . (($l_entry['directory'] == $osC_Session->value('language')) ? ' class="highlight"' : '') . '><a href="javascript:toggleDivBlocks(\'pName_\', \'pName_' . $l_entry['code'] . '\'); toggleClass(\'lang_\', \'lang_' . $l_entry['code'] . '\', \'highlight\', \'span\');">' . tep_image(DIR_WS_CATALOG_LANGUAGES . $l_entry['directory'] . '/images/' . $l_entry['image'], $l_entry['name']) . '</a></span> ';
- }
-?>
- </td>
- </tr>
-</table>
-
-<?php
- foreach ($languages as $l_entry) {
-?>
-
-<div id="pName_<?php echo $l_entry['code']; ?>" <?php echo (($l_entry['directory'] != $osC_Session->value('language')) ? ' style="display: none;"' : ''); ?>>
- <table border="0" width="100%" cellspacing="0" cellpadding="2">
- <tr>
- <td><h1><?php echo $pInfo->products_name[$l_entry['id']]; ?></h1></td>
- <td align="right"><h1><?php echo $osC_Currencies->format($pInfo->products_price); ?></h1></td>
- </tr>
- </table>
-
- <p class="main"><?php echo tep_image(DIR_WS_CATALOG_IMAGES . $products_image_name, $pInfo->products_name[$l_entry['id']], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align="right" hspace="5" vspace="5"') . $pInfo->products_description[$l_entry['id']]; ?></p>
-
-<?php
- if (!empty($pInfo->products_url[$l_entry['id']])) {
- echo '<p class="main">' . sprintf(TEXT_PRODUCT_MORE_INFORMATION, $pInfo->products_url[$l_entry['id']]) . '</p>';
- }
-?>
-
-<?php
- if ($pInfo->products_date_available > date('Y-m-d')) {
- echo '<p class="smallText" align="center">' . sprintf(TEXT_PRODUCT_DATE_AVAILABLE, tep_date_long($pInfo->products_date_available)) . '</p>';
- } else {
- echo '<p class="smallText" align="center">' . sprintf(TEXT_PRODUCT_DATE_ADDED, tep_date_long($pInfo->products_date_added)) . '</p>';
- }
-?>
-
-</div>
-
-<?php
- }
-
- if (isset($_GET['read']) && ($_GET['read'] == 'only')) {
- echo '<p align="right"><input type="button" value="' . IMAGE_BACK . '" onClick="document.location.href=\'' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id) . '\';" class="operationButton"></p>';
- } else {
- echo '<p align="right">';
-
- foreach ($_POST as $key => $value) {
- if (!is_array($_POST[$key])) {
- echo osc_draw_hidden_field($key, $value);
- }
- }
-
- foreach ($languages as $l_entry) {
- echo osc_draw_hidden_field('products_name[' . $l_entry['id'] . ']', $pInfo->products_name[$l_entry['id']]) .
- osc_draw_hidden_field('products_description[' . $l_entry['id'] . ']', $pInfo->products_description[$l_entry['id']]) .
- osc_draw_hidden_field('products_url[' . $l_entry['id'] . ']', $pInfo->products_url[$l_entry['id']]);
- }
-
- echo osc_draw_hidden_field('products_image', $products_image_name);
-
- echo '<input type="submit" value="' . IMAGE_BACK . '" name="product_edit" class="operationButton"> <input type="submit" value="' . (isset($_GET['pID']) ? IMAGE_UPDATE : IMAGE_INSERT) . '" class="operationButton"> <input type="button" value="' . IMAGE_CANCEL . '" onClick="document.location.href=\'' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . (isset($_GET['pID']) ? '&pID=' . $_GET['pID'] : '')) . '\';" class="operationButton">';
-
- echo '</p>';
- }
-?>
-
-</form>
CVSspam 0.2.9
-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click