[TEP-COMMIT] [CVS admin] code cleanup
hpdl-OfajU3CKLf1/[email protected] 26 Oct 2004 20:16:00 -0000
| Newsgroups | gmane.comp.web.oscommerce.cvs |
|---|---|
| Message-ID | <[email protected]> |
<html>
<head>
<style><!--
body {background-color:#ffffff;}
.file {border:1px solid #eeeeee;margin-top:1em;margin-bottom:1em;}
.pathname {font-family:monospace; float:right;}
.fileheader {margin-bottom:.5em;}
.diff {margin:0;}
.tasklist {padding:4px;border:1px dashed #000000;margin-top:1em;}
.tasklist ul {margin-top:0;margin-bottom:0;}
tr.alt {background-color:#eeeeee}
#added {background-color:#ddffdd;}
#addedchars {background-color:#99ff99;font-weight:bolder;}
tr.alt #added {background-color:#ccf7cc;}
#removed {background-color:#ffdddd;}
#removedchars {background-color:#ff9999;font-weight:bolder;}
tr.alt #removed {background-color:#f7cccc;}
#info {color:#888888;}
#context {background-color:#eeeeee;}
td {padding-left:.3em;padding-right:.3em;}
tr.head {border-bottom-width:1px;border-bottom-style:solid;}
tr.head td {padding:0;padding-top:.2em;}
.task {background-color:#ffff00;}
.comment {padding:4px;border:1px dashed #000000;background-color:#ffffdd}
.error {color:red;}
hr {border-width:0px;height:2px;background:black;}
--></style>
</head>
<body>
<table cellspacing="0" cellpadding="0" border="0" rules="cols">
<tr class="head"><td colspan="4">Commit in <b><tt>admin/admin</tt></b><span id="info"> on MAIN</span></td></tr>
<tr><td><tt><a href="#file1">products.php</a></tt></td><td align="right" id="added">+53</td><td align="right" id="removed">-24</td><td nowrap="nowrap" align="center"><a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/products.php?rev=1.14&content-type=text/vnd.viewcvs-markup">1.14</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/products.php.diff?r1=1.14&r2=1.15">-></a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/products.php?rev=1.15&content-type=text/vnd.viewcvs-markup">1.15</a></td></tr>
<tr class="alt"><td><tt>includes/languages/english/<a href="#file2">products.php</a></tt></td><td align="right" id="added">+3</td><td></td><td nowrap="nowrap" align="center"><a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/includes/languages/english/products.php?rev=1.7&content-type=text/vnd.viewcvs-markup">1.7</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/includes/languages/english/products.php.diff?r1=1.7&r2=1.8">-></a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/includes/languages/english/products.php?rev=1.8&content-type=text/vnd.viewcvs-markup">1.8</a></td></tr>
<tr><td><tt>includes/languages/espanol/<a href="#file3">products.php</a></tt></td><td align="right" id="added">+3</td><td></td><td nowrap="nowrap" align="center"><a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/includes/languages/espanol/products.php?rev=1.2&content-type=text/vnd.viewcvs-markup">1.2</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/includes/languages/espanol/products.php.diff?r1=1.2&r2=1.3">-></a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/includes/languages/espanol/products.php?rev=1.3&content-type=text/vnd.viewcvs-markup">1.3</a></td></tr>
<tr class="alt"><td><tt>includes/languages/german/<a href="#file4">products.php</a></tt></td><td align="right" id="added">+4</td><td align="right" id="removed">-1</td><td nowrap="nowrap" align="center"><a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/includes/languages/german/products.php?rev=1.2&content-type=text/vnd.viewcvs-markup">1.2</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/includes/languages/german/products.php.diff?r1=1.2&r2=1.3">-></a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/includes/languages/german/products.php?rev=1.3&content-type=text/vnd.viewcvs-markup">1.3</a></td></tr>
<tr><td><tt>templates/pages/<a href="#file5">products.php</a></tt></td><td align="right" id="added">+60</td><td align="right" id="removed">-43</td><td nowrap="nowrap" align="center"><a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/templates/pages/products.php?rev=1.2&content-type=text/vnd.viewcvs-markup">1.2</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/templates/pages/products.php.diff?r1=1.2&r2=1.3">-></a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/templates/pages/products.php?rev=1.3&content-type=text/vnd.viewcvs-markup">1.3</a></td></tr>
<tr class="alt"><td><tt> /<a href="#file6">products_edit.php</a></tt></td><td align="right" id="added">+49</td><td align="right" id="removed">-6</td><td nowrap="nowrap" align="center"><a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/templates/pages/products_edit.php?rev=1.2&content-type=text/vnd.viewcvs-markup">1.2</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/templates/pages/products_edit.php.diff?r1=1.2&r2=1.3">-></a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/templates/pages/products_edit.php?rev=1.3&content-type=text/vnd.viewcvs-markup">1.3</a></td></tr>
<tr><td><tt> /<a href="#file7">products_preview.php</a></tt></td><td align="right" id="added">+2</td><td align="right" id="removed">-2</td><td nowrap="nowrap" align="center"><a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/templates/pages/products_preview.php?rev=1.2&content-type=text/vnd.viewcvs-markup">1.2</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/templates/pages/products_preview.php.diff?r1=1.2&r2=1.3">-></a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/templates/pages/products_preview.php?rev=1.3&content-type=text/vnd.viewcvs-markup">1.3</a></td></tr>
<tr><td></td><td align="right" id="added">+174</td><td align="right" id="removed">-76</td><td></td></tr>
</table>
<small id="info">7 modified files</small><br />
<pre class="comment">
code cleanup
replace calls to tep_get_category_tree() with the category tree class
add a categories tab to the product edit page to assign multiple categories
to the product
add the search parameter value to the urls
</pre>
<hr /><a name="file1" /><div class="file">
<span class="pathname"><a href="http://cvs.oscommerce.com/viewcvs.cgi/admin">admin</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin">admin</a><br /></span>
<div class="fileheader"><big><b>products.php</b></big> <small id="info"><a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/products.php?rev=1.14&content-type=text/vnd.viewcvs-markup">1.14</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/products.php.diff?r1=1.14&r2=1.15">-></a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/products.php?rev=1.15&content-type=text/vnd.viewcvs-markup">1.15</a></small></div>
<pre class="diff"><small id="info">diff -u -r1.14 -r1.15
--- products.php 2004/08/29 22:17:19 1.14
+++ products.php 2004/10/26 20:15:19 1.15
@@ -12,25 +12,36 @@
</small></pre><pre class="diff" id="context">
require('includes/application_top.php');
</pre><pre class="diff" id="removed">- $selected_box = 'catalog';
-
</pre><pre class="diff" id="context"> // calculate category path
$cPath = (isset($_GET['cPath']) ? $_GET['cPath'] : '');
</pre><pre class="diff" id="removed">- if (tep_not_null($cPath)) {
</pre><pre class="diff" id="added">+ if (!empty($cPath)) {
</pre><pre class="diff" id="context"> $cPath_array = tep_parse_category_path($cPath);
$cPath = implode('_', $cPath_array);
</pre><pre class="diff" id="removed">- $current_category_id = $cPath_array[(sizeof($cPath_array)-1)];
</pre><pre class="diff" id="added">+ $current_category_id = end($cPath_array);
</pre><pre class="diff" id="context"> } else {
$current_category_id = 0;
}
</pre><pre class="diff" id="added">+ require('../includes/classes/category_tree.php');
+ $osC_CategoryTree = new osC_CategoryTree();
+ $osC_CategoryTree->setSpacerString('&nbsp;', 2);
+
+ $categories_array = array();
+ foreach ($osC_CategoryTree->getTree() as $value) {
+ $categories_array[] = array('id' => $value['id'], 'text' => $value['title']);
+ }
+
</pre><pre class="diff" id="context"> $action = (isset($_GET['action']) ? $_GET['action'] : '');
if (!isset($_GET['page']) || (isset($_GET['page']) && !is_numeric($_GET['page']))) {
$_GET['page'] = 1;
}
</pre><pre class="diff" id="added">+ if (!isset($_GET['search'])) {
+ $_GET['search'] = '';
+ }
+
</pre><pre class="diff" id="context"> if (!empty($action)) {
switch ($action) {
case 'delete_product_confirm':
</pre><pre class="diff"><small id="info">@@ -52,44 +63,46 @@
</small></pre><pre class="diff" id="context"> }
osC_Cache::clear('categories');
</pre><pre class="diff" id="added">+ osC_Cache::clear('category_tree');
</pre><pre class="diff" id="context"> osC_Cache::clear('also_purchased');
$messageStack->add_session(SUCCESS_DB_ROWS_UPDATED, 'success');
}
}
</pre><pre class="diff" id="removed">- tep_redirect(tep_href_link(FILENAME_PRODUCTS, 'page=' . $_GET['page'] . '&cPath=' . $cPath));
</pre><pre class="diff" id="added">+ tep_redirect(tep_href_link(FILENAME_PRODUCTS, 'page=' . $_GET['page'] . '&cPath=' . $cPath<span id="addedchars"> . '&search=' . $_GET['search']</span>));
</pre><pre class="diff" id="context"> 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']);
</pre><pre class="diff" id="removed">- $Qcheck->bindInt(':categories_id', $_POST['move_to_category_id']);
</pre><pre class="diff" id="added">+ $Qcheck->bindInt(':categories_id', end(explode('_', $_POST['move_to_category_id'])));
</pre><pre class="diff" id="context"> $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);
</pre><pre class="diff" id="removed">- $Qupdate->bindInt(':categories_id', $_POST['move_to_category_id']);
</pre><pre class="diff" id="added">+ $Qupdate->bindInt(':categories_id', end(explode('_', $_POST['move_to_category_id'])));
</pre><pre class="diff" id="context"> $Qupdate->bindInt(':products_id', $_GET['pID']);
$Qupdate->bindInt(':current_categories_id', $current_category_id);
$Qupdate->execute();
if ($Qupdate->affectedRows()) {
osC_Cache::clear('categories');
</pre><pre class="diff" id="added">+ osC_Cache::clear('category_tree');
</pre><pre class="diff" id="context"> osC_Cache::clear('also_purchased');
$messageStack->add_session(SUCCESS_DB_ROWS_UPDATED, 'success');
</pre><pre class="diff" id="removed">- tep_redirect(tep_href_link(FILENAME_PRODUCTS, 'page=' . $_GET['page'] . '&cPath=' . $_POST['move_to_category_id'] . '&pID=' . $_GET['pID']));
</pre><pre class="diff" id="added">+ tep_redirect(tep_href_link(FILENAME_PRODUCTS, 'page=' . $_GET['page'] . '&cPath=' . $_POST['move_to_category_id'] . '&<span id="addedchars">search=' . $_GET['search'] . '&</span>pID=' . $_GET['pID']));
</pre><pre class="diff" id="context"> } else {
$messageStack->add_session(WARNING_DB_ROWS_NOT_UPDATED, 'warning');
}
}
}
</pre><pre class="diff" id="removed">- tep_redirect(tep_href_link(FILENAME_PRODUCTS, 'page=' . $_GET['page'] . '&cPath=' . $cPath . '&pID=' . $_GET['pID']));
</pre><pre class="diff" id="added">+ tep_redirect(tep_href_link(FILENAME_PRODUCTS, 'page=' . $_GET['page'] . '&cPath=' . $cPath . '&<span id="addedchars">search=' . $_GET['search'] . '&</span>pID=' . $_GET['pID']));
</pre><pre class="diff" id="context"> break;
case 'save_product':
if (isset($_POST['product_edit'])) {
</pre><pre class="diff"><small id="info">@@ -128,15 +141,29 @@
</small></pre><pre class="diff" id="context"> $products_id = $_GET['pID'];
} else {
$products_id = $osC_Database->nextID();
</pre><pre class="diff" id="added">+ }
</pre><pre class="diff" id="context">
</pre><pre class="diff" id="removed">- $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();
</pre><pre class="diff" id="added">+ $Qcategories = $osC_Database->query('delete from :table_products_to_categories where products_id = :products_id');
+ $Qcategories->bindTable(':table_products_to_categories', TABLE_PRODUCTS_TO_CATEGORIES);
+ $Qcategories->bindInt(':products_id', $products_id);
+ $Qcategories->execute();
</pre><pre class="diff" id="context">
</pre><pre class="diff" id="removed">- if ($osC_Database->isError()) {
- $error = true;
</pre><pre class="diff" id="added">+ if ($osC_Database->isError()) {
+ $error = true;
+ } else {
+ if (isset($_POST['categories']) && !empty($_POST['categories'])) {
+ foreach ($_POST['categories'] as $category_id) {
+ $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', $category_id);
+ $Qp2c->execute();
+
+ if ($osC_Database->isError()) {
+ $error = true;
+ break;
+ }
+ }
</pre><pre class="diff" id="context"> }
}
}
</pre><pre class="diff"><small id="info">@@ -251,6 +278,7 @@
</small></pre><pre class="diff" id="context"> $osC_Database->commitTransaction();
osC_Cache::clear('categories');
</pre><pre class="diff" id="added">+ osC_Cache::clear('category_tree');
</pre><pre class="diff" id="context"> osC_Cache::clear('also_purchased');
$messageStack->add_session(SUCCESS_DB_ROWS_UPDATED, 'success');
</pre><pre class="diff"><small id="info">@@ -260,30 +288,30 @@
</small></pre><pre class="diff" id="context"> $messageStack->add_session(ERROR_DB_ROWS_NOT_UPDATED, 'error');
}
</pre><pre class="diff" id="removed">- tep_redirect(tep_href_link(FILENAME_PRODUCTS, 'page=' . $_GET['page'] . '&cPath=' . $cPath . '&pID=' . $products_id));
</pre><pre class="diff" id="added">+ tep_redirect(tep_href_link(FILENAME_PRODUCTS, 'page=' . $_GET['page'] . '&cPath=' . $cPath . '&<span id="addedchars">search=' . $_GET['search'] . '&</span>pID=' . $products_id));
</pre><pre class="diff" id="context"> }
break;
case 'copy_to_confirm':
if (isset($_GET['pID']) && isset($_POST['categories_id'])) {
if ($_POST['copy_as'] == 'link') {
</pre><pre class="diff" id="removed">- if ($_POST['categories_id'] != $current_category_id) {
</pre><pre class="diff" id="added">+ if (end(explode('_', $_POST['categories_id'])) != $current_category_id) {
</pre><pre class="diff" id="context"> $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']);
</pre><pre class="diff" id="removed">- $Qcheck->bindInt(':categories_id', $_POST['categories_id']);
</pre><pre class="diff" id="added">+ $Qcheck->bindInt(':categories_id', end(explode('_', $_POST['categories_id'])));
</pre><pre class="diff" id="context"> $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']);
</pre><pre class="diff" id="removed">- $Qcat->bindInt(':categories_id', $_POST['categories_id']);
</pre><pre class="diff" id="added">+ $Qcat->bindInt(':categories_id', end(explode('_', $_POST['categories_id'])));
</pre><pre class="diff" id="context"> $Qcat->execute();
if ($Qcat->affectedRows()) {
$messageStack->add_session(SUCCESS_DB_ROWS_UPDATED, 'success');
</pre><pre class="diff" id="removed">- tep_redirect(tep_href_link(FILENAME_PRODUCTS, 'page=' . $_GET['page'] . '&cPath=' . $_POST['categories_id'] . '&pID=' . $_GET['pID']));
</pre><pre class="diff" id="added">+ tep_redirect(tep_href_link(FILENAME_PRODUCTS, 'page=' . $_GET['page'] . '&cPath=' . $_POST['categories_id'] . '&<span id="addedchars">search=' . $_GET['search'] . '&</span>pID=' . $_GET['pID']));
</pre><pre class="diff" id="context"> }
}
} else {
</pre><pre class="diff"><small id="info">@@ -341,7 +369,7 @@
</small></pre><pre class="diff" id="context"> $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);
</pre><pre class="diff" id="removed">- $Qp2c->bindInt(':categories_id', $_POST['categories_id']);
</pre><pre class="diff" id="added">+ $Qp2c->bindInt(':categories_id', end(explode('_', $_POST['categories_id'])));
</pre><pre class="diff" id="context"> $Qp2c->execute();
if ($osC_Database->isError()) {
</pre><pre class="diff"><small id="info">@@ -356,11 +384,12 @@
</small></pre><pre class="diff" id="context"> $osC_Database->commitTransaction();
osC_Cache::clear('categories');
</pre><pre class="diff" id="added">+ osC_Cache::clear('category_tree');
</pre><pre class="diff" id="context"> osC_Cache::clear('also_purchased');
$messageStack->add_session(SUCCESS_DB_ROWS_UPDATED, 'success');
</pre><pre class="diff" id="removed">- tep_redirect(tep_href_link(FILENAME_PRODUCTS, 'page=' . $_GET['page'] . '&cPath=' . $_POST['categories_id'] . '&pID=' . $new_product_id));
</pre><pre class="diff" id="added">+ tep_redirect(tep_href_link(FILENAME_PRODUCTS, 'page=' . $_GET['page'] . '&cPath=' . $_POST['categories_id'] . '&<span id="addedchars">search=' . $_GET['search'] . '&</span>pID=' . $new_product_id));
</pre><pre class="diff" id="context"> } else {
$osC_Database->rollbackTransaction();
</pre><pre class="diff"><small id="info">@@ -370,7 +399,7 @@
</small></pre><pre class="diff" id="context"> }
}
</pre><pre class="diff" id="removed">- tep_redirect(tep_href_link(FILENAME_PRODUCTS, 'page=' . $_GET['page'] . '&cPath=' . $cPath . '&pID=' . $_GET['pID']));
</pre><pre class="diff" id="added">+ tep_redirect(tep_href_link(FILENAME_PRODUCTS, 'page=' . $_GET['page'] . '&cPath=' . $cPath . '&<span id="addedchars">search=' . $_GET['search'] . '&</span>pID=' . $_GET['pID']));
</pre><pre class="diff" id="context"> break;
}
}
</pre></div>
<hr /><a name="file2" /><div class="file">
<span class="pathname"><a href="http://cvs.oscommerce.com/viewcvs.cgi/admin">admin</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin">admin</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/includes">includes</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/includes/languages">languages</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/includes/languages/english">english</a><br /></span>
<div class="fileheader"><big><b>products.php</b></big> <small id="info"><a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/includes/languages/english/products.php?rev=1.7&content-type=text/vnd.viewcvs-markup">1.7</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/includes/languages/english/products.php.diff?r1=1.7&r2=1.8">-></a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/includes/languages/english/products.php?rev=1.8&content-type=text/vnd.viewcvs-markup">1.8</a></small></div>
<pre class="diff"><small id="info">diff -u -r1.7 -r1.8
--- products.php 2004/08/29 22:17:20 1.7
+++ products.php 2004/10/26 20:15:23 1.8
@@ -15,7 +15,10 @@
</small></pre><pre class="diff" id="context"> define('HEADING_TITLE_GOTO', 'Go To:');
define('TAB_GENERAL', 'General');
</pre><pre class="diff" id="added">+ define('TAB_DATA', 'Data');
+ define('TAB_IMAGES', 'Images');
</pre><pre class="diff" id="context"> define('TAB_ATTRIBUTES', 'Attributes');
</pre><pre class="diff" id="added">+ define('TAB_CATEGORIES', 'Categories');
</pre><pre class="diff" id="context">
define('FIELDSET_ASSIGNED_ATTRIBUTES', 'Assigned Attributes');
</pre></div>
<hr /><a name="file3" /><div class="file">
<span class="pathname"><a href="http://cvs.oscommerce.com/viewcvs.cgi/admin">admin</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin">admin</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/includes">includes</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/includes/languages">languages</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/includes/languages/espanol">espanol</a><br /></span>
<div class="fileheader"><big><b>products.php</b></big> <small id="info"><a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/includes/languages/espanol/products.php?rev=1.2&content-type=text/vnd.viewcvs-markup">1.2</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/includes/languages/espanol/products.php.diff?r1=1.2&r2=1.3">-></a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/includes/languages/espanol/products.php?rev=1.3&content-type=text/vnd.viewcvs-markup">1.3</a></small></div>
<pre class="diff"><small id="info">diff -u -r1.2 -r1.3
--- products.php 2004/08/29 22:17:20 1.2
+++ products.php 2004/10/26 20:15:26 1.3
@@ -15,7 +15,10 @@
</small></pre><pre class="diff" id="context"> define('HEADING_TITLE_GOTO', 'Ir A:');
define('TAB_GENERAL', 'General');
</pre><pre class="diff" id="added">+ define('TAB_DATA', 'Data');
+ define('TAB_IMAGES', 'Images');
</pre><pre class="diff" id="context"> define('TAB_ATTRIBUTES', 'Attributes');
</pre><pre class="diff" id="added">+ define('TAB_CATEGORIES', 'Categories');
</pre><pre class="diff" id="context">
define('FIELDSET_ASSIGNED_ATTRIBUTES', 'Assigned Attributes');
</pre></div>
<hr /><a name="file4" /><div class="file">
<span class="pathname"><a href="http://cvs.oscommerce.com/viewcvs.cgi/admin">admin</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin">admin</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/includes">includes</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/includes/languages">languages</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/includes/languages/german">german</a><br /></span>
<div class="fileheader"><big><b>products.php</b></big> <small id="info"><a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/includes/languages/german/products.php?rev=1.2&content-type=text/vnd.viewcvs-markup">1.2</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/includes/languages/german/products.php.diff?r1=1.2&r2=1.3">-></a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/includes/languages/german/products.php?rev=1.3&content-type=text/vnd.viewcvs-markup">1.3</a></small></div>
<pre class="diff"><small id="info">diff -u -r1.2 -r1.3
--- products.php 2004/08/29 22:17:21 1.2
+++ products.php 2004/10/26 20:15:29 1.3
@@ -15,7 +15,10 @@
</small></pre><pre class="diff" id="context"> define('HEADING_TITLE_GOTO', 'Gehe zu:');
define('TAB_GENERAL', 'Allgemein');
</pre><pre class="diff" id="removed">- define('TAB_ATTRIBUTES', 'Produktmerkmale');
</pre><pre class="diff" id="added">+ define('TAB_DATA', 'Data');
+ define('TAB_IMAGES', 'Bilder');
+ define('TAB_ATTRIBUTES', 'Produktmerkmalen');
+ define('TAB_CATEGORIES', 'Kategorien');
</pre><pre class="diff" id="context">
define('FIELDSET_ASSIGNED_ATTRIBUTES', 'Assigned Attributes');
</pre></div>
<hr /><a name="file5" /><div class="file">
<span class="pathname"><a href="http://cvs.oscommerce.com/viewcvs.cgi/admin">admin</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin">admin</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/templates">templates</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/templates/pages">pages</a><br /></span>
<div class="fileheader"><big><b>products.php</b></big> <small id="info"><a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/templates/pages/products.php?rev=1.2&content-type=text/vnd.viewcvs-markup">1.2</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/templates/pages/products.php.diff?r1=1.2&r2=1.3">-></a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/templates/pages/products.php?rev=1.3&content-type=text/vnd.viewcvs-markup">1.3</a></small></div>
<pre class="diff"><small id="info">diff -u -r1.2 -r1.3
--- products.php 2004/08/29 22:17:21 1.2
+++ products.php 2004/10/26 20:15:32 1.3
@@ -18,9 +18,9 @@
</small></pre><pre class="diff" id="context"> <?php
echo tep_draw_form('search', FILENAME_PRODUCTS, '', 'get') .
HEADING_TITLE_SEARCH . ' ' . osc_draw_input_field('search') .
</pre><pre class="diff" id="removed">- '<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();"') .
</pre><pre class="diff" id="added">+ osc_draw_pull_down_menu('cPath', array_merge(array(array('id' => '', 'text' => '-- ' . TEXT_TOP . ' --')), $categories_array)) .
+ '<input type="submit" value="GO" class="operationButton">' .
+ '<input type="button" value="RESET" onClick="document.location.href=\'' . tep_href_link(FILENAME_PRODUCTS) . '\';" class="sectionButton"' . ((!empty($_GET['search']) || ($current_category_id > 0)) ? '' : ' disabled') . '>' .
</pre><pre class="diff" id="context"> '</form>';
?>
</td>
</pre><pre class="diff"><small id="info">@@ -40,55 +40,67 @@
</small></pre><pre class="diff" id="context"> </thead>
<tbody>
<?php
</pre><pre class="diff" id="removed">- if (isset($_GET['search']) && !empty($_GET['search'])) {
- $Qproducts = $osC_Database->query('select p.products_id, pd.products_name, p.products_quantity, 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'] . '%');
</pre><pre class="diff" id="added">+ if ($current_category_id > 0) {
+ $osC_CategoryTree->setBreadcrumbUsage(false);
+
+ $in_categories = array($current_category_id);
+ foreach($osC_CategoryTree->getTree($current_category_id) as $category) {
+ $in_categories[] = $category['id'];
+ }
+
+ $Qproducts = $osC_Database->query('select distinct p.products_id, pd.products_name, p.products_quantity, 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 in (:categories_id)');
+ $Qproducts->bindTable(':table_products_to_categories', TABLE_PRODUCTS_TO_CATEGORIES);
+ $Qproducts->bindRaw(':categories_id', implode(',', $in_categories));
</pre><pre class="diff" id="context"> } else {
</pre><pre class="diff" id="removed">- $Qproducts = $osC_Database->query('select p.products_id, pd.products_name, p.products_quantity, 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<span id="removedchars"> order by pd.products_name</span>');
</pre><pre class="diff" id="added">+ $Qproducts = $osC_Database->query('select p.products_id, pd.products_name, p.products_quantity, 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');
</pre><pre class="diff" id="context"> }
</pre><pre class="diff" id="added">+
+ if (!empty($_GET['search'])) {
+ $Qproducts->appendQuery('and pd.products_name like :products_name');
+ $Qproducts->bindValue(':products_name', '%' . $_GET['search'] . '%');
+ }
+
+ $Qproducts->appendQuery('order by pd.products_name');
+
</pre><pre class="diff" id="context"> $Qproducts->bindTable(':table_products', TABLE_PRODUCTS);
$Qproducts->bindTable(':table_products_description', TABLE_PRODUCTS_DESCRIPTION);
</pre><pre class="diff" id="removed">- $Qproducts->bindTable(':table_products_to_categories', TABLE_PRODUCTS_TO_CATEGORIES);
</pre><pre class="diff" id="context"> $Qproducts->bindInt(':language_id', $osC_Session->value('languages_id'));
</pre><pre class="diff" id="removed">- $Qproducts->setBatchLimit($_GET['page'], MAX_DISPLAY_SEARCH_RESULTS);
</pre><pre class="diff" id="added">+ $Qproducts->setBatchLimit($_GET['page'], MAX_DISPLAY_SEARCH_RESULTS, (!empty($_GET['search']) ? 'distinct p.products_id' : ''));
</pre><pre class="diff" id="context"> $Qproducts->execute();
while ($Qproducts->next()) {
</pre><pre class="diff" id="removed">- if (isset($_GET['search']) && !empty($_GET['search'])) {
- $cPath = $Qproducts->valueInt('categories_id');
- }
-
</pre><pre class="diff" id="context"> if (!isset($pInfo) && !isset($cInfo) && (!isset($_GET['pID']) && !isset($_GET['cID']) || (isset($_GET['pID']) && ($_GET['pID'] == $Qproducts->valueInt('products_id')))) && ($action != 'cNew')) {
</pre><pre class="diff" id="removed">- $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()));
</pre><pre class="diff" id="added">+ $pInfo = new objectInfo($Qproducts->toArray());
</pre><pre class="diff" id="context"> }
if (isset($pInfo) && ($Qproducts->valueInt('products_id') == $pInfo->products_id)) {
echo ' <tr class="selected">' . "\n";
} else {
</pre><pre class="diff" id="removed">- 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";
</pre><pre class="diff" id="added">+ echo ' <tr onMouseOver="rowOverEffect(this);" onMouseOut="rowOutEffect(this);" onClick="document.location.href=\'' . tep_href_link(FILENAME_PRODUCTS, 'page=' . $_GET['page'] . '&cPath=' . $cPath . '&<span id="addedchars">search=' . $_GET['search'] . '&</span>pID=' . $Qproducts->valueInt('products_id')) . '\';">' . "\n";
</pre><pre class="diff" id="context"> }
?>
</pre><pre class="diff" id="removed">- <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) . '&nbsp;' . $Qproducts->value('products_name') . '</a>'; ?></td>
</pre><pre class="diff" id="added">+ <td><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCTS, 'page=' . $_GET['page'] . '&cPath=' . $cPath . '&<span id="addedchars">search=' . $_GET['search'] . '&</span>pID=' . $Qproducts->valueInt('products_id') . '&action=new_product_preview&read=only') . '">' . tep_image(DIR_WS_ICONS . 'preview.gif', ICON_PREVIEW) . '&nbsp;' . $Qproducts->value('products_name') . '</a>'; ?></td>
</pre><pre class="diff" id="context"> <td align="right"><?php echo $osC_Currencies->format($Qproducts->value('products_price')); ?></td>
<td align="right"><?php echo $Qproducts->valueInt('products_quantity'); ?></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
</pre><pre class="diff" id="removed">- 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>&nbsp;';
</pre><pre class="diff" id="added">+ echo '<a href="' . tep_href_link(FILENAME_PRODUCTS, 'page=' . $_GET['page'] . '&cPath=' . $cPath . '&search=' . $_GET['search'] . '&pID=' . $Qproducts->valueInt('products_id') . '&action=new_product') . '">' . tep_image('templates/' . $template . '/images/icons/16x16/edit.png', IMAGE_EDIT, '16', '16') . '</a>&nbsp;';
</pre><pre class="diff" id="context">
if (isset($pInfo) && ($Qproducts->valueInt('products_id') == $pInfo->products_id)) {
</pre><pre class="diff" id="removed">- echo '<a href="#" onClick="toggleInfoBox(\'pMove\');">' . tep_image('templates/' . $template . '/images/icons/16x16/move.png', IMAGE_MOVE, '16', '16') . '</a>&nbsp;' .
- '<a href="#" onClick="toggleInfoBox(\'pCopyTo\');">' . tep_image('templates/' . $template . '/images/icons/16x16/copy.png', IMAGE_COPY_TO, '16', '16') . '</a>&nbsp;' .
</pre><pre class="diff" id="added">+ if ($current_category_id > 0) {
+ echo '<a href="#" onClick="toggleInfoBox(\'pMove\');">' . tep_image('templates/' . $template . '/images/icons/16x16/move.png', IMAGE_MOVE, '16', '16') . '</a>&nbsp;';
+ }
+
+ echo '<a href="#" onClick="toggleInfoBox(\'pCopyTo\');">' . tep_image('templates/' . $template . '/images/icons/16x16/copy.png', IMAGE_COPY_TO, '16', '16') . '</a>&nbsp;' .
</pre><pre class="diff" id="context"> '<a href="#" onClick="toggleInfoBox(\'pDelete\');">' . tep_image('templates/' . $template . '/images/icons/16x16/trash.png', IMAGE_DELETE, '16', '16') . '</a>';
} else {
</pre><pre class="diff" id="removed">- 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>&nbsp;' .
- '<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>&nbsp;' .
- '<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>';
</pre><pre class="diff" id="added">+ if ($current_category_id > 0) {
+ echo '<a href="' . tep_href_link(FILENAME_PRODUCTS, 'page=' . $_GET['page'] . '&cPath=' . $cPath . '&search=' . $_GET['search'] . '&pID=' . $Qproducts->valueInt('products_id') . '&action=pMove') . '">' . tep_image('templates/' . $template . '/images/icons/16x16/move.png', IMAGE_MOVE, '16', '16') . '</a>&nbsp;';
+ }
+
+ echo '<a href="' . tep_href_link(FILENAME_PRODUCTS, 'page=' . $_GET['page'] . '&cPath=' . $cPath . '&search=' . $_GET['search'] . '&pID=' . $Qproducts->valueInt('products_id') . '&action=pCopyTo') . '">' . tep_image('templates/' . $template . '/images/icons/16x16/copy.png', IMAGE_COPY_TO, '16', '16') . '</a>&nbsp;' .
+ '<a href="' . tep_href_link(FILENAME_PRODUCTS, 'page=' . $_GET['page'] . '&cPath=' . $cPath . '&search=' . $_GET['search'] . '&pID=' . $Qproducts->valueInt('products_id') . '&action=pDelete') . '">' . tep_image('templates/' . $template . '/images/icons/16x16/trash.png', IMAGE_DELETE, '16', '16') . '</a>';
</pre><pre class="diff" id="context"> }
?>
</td>
</pre><pre class="diff"><small id="info">@@ -102,43 +114,48 @@
</small></pre><pre class="diff" id="context"> <table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td class="smallText"><?php echo $Qproducts->displayBatchLinksTotal(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td>
</pre><pre class="diff" id="removed">- <td class="smallText" align="right"><?php echo $Qproducts->displayBatchLinksPullDown('page', 'cPath=' . $cPath); ?></td>
</pre><pre class="diff" id="added">+ <td class="smallText" align="right"><?php echo $Qproducts->displayBatchLinksPullDown('page', 'cPath=' . $cPath<span id="addedchars"> . '&search=' . $_GET['search']</span>); ?></td>
</pre><pre class="diff" id="context"> </tr>
</table>
</pre><pre class="diff" id="removed">- <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>
</pre><pre class="diff" id="added">+ <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 . '&<span id="addedchars">search=' . $_GET['search'] . '&</span>action=new_product') . '\';" class="infoBoxButton">'; ?></p>
</pre><pre class="diff" id="context"> </div>
<?php
if (isset($pInfo)) {
</pre><pre class="diff" id="added">+ if ($current_category_id > 0) {
</pre><pre class="diff" id="context"> ?>
</pre><pre class="diff" id="removed">-<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>
</pre><pre class="diff" id="added">+<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>
</pre><pre class="diff" id="context"> <div class="infoBoxContent">
</pre><pre class="diff" id="removed">- <?php echo tep_draw_form('pCopyTo', FILENAME_PRODUCTS, 'page=' . $_GET['page'] . '&cPath=' . $cPath . '&pID=' . $pInfo->products_id . '&action=copy_to_confirm'); ?>
</pre><pre class="diff" id="added">+ <?php echo tep_draw_form('pMove', FILENAME_PRODUCTS, 'page=' . $_GET['page'] . '&cPath=' . $cPath . '&search=' . $_GET['search'] . '&pID=' . $pInfo->products_id . '&action=move_product_confirm'); ?>
</pre><pre class="diff" id="context">
</pre><pre class="diff" id="removed">- <p><?php echo TEXT_INFO_COPY_TO_INTRO; ?></p>
</pre><pre class="diff" id="added">+ <p><?php echo sprintf(TEXT_MOVE_PRODUCTS_INTRO, $pInfo->products_name); ?></p>
</pre><pre class="diff" id="context"> <p><?php echo TEXT_INFO_CURRENT_CATEGORIES . '<br>' . tep_output_generated_category_path($pInfo->products_id, 'product'); ?></p>
</pre><pre class="diff" id="removed">- <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>
</pre><pre class="diff" id="added">+ <p><?php echo sprintf(TEXT_MOVE, $pInfo->products_name) . '<br>' . osc_draw_pull_down_menu('move_to_category_id', $categories_array, $cPath); ?></p>
</pre><pre class="diff" id="context">
</pre><pre class="diff" id="removed">- <p align="center"><?php echo '<input type="submit" value="' . IMAGE_<span id="removedchars">COPY</span> . '" class="operationButton"> <input type="button" value="' . IMAGE_CANCEL . '" onClick="toggleInfoBox(\'cDefault\');" class="operationButton">'; ?></p>
</pre><pre class="diff" id="added">+ <p align="center"><?php echo '<input type="submit" value="' . IMAGE_<span id="addedchars">MOVE</span> . '" class="operationButton"> <input type="button" value="' . IMAGE_CANCEL . '" onClick="toggleInfoBox(\'cDefault\');" class="operationButton">'; ?></p>
</pre><pre class="diff" id="context">
</form>
</div>
</div>
</pre><pre class="diff" id="removed">-<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>
</pre><pre class="diff" id="added">+<?php
+ }
+?>
+
+<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>
</pre><pre class="diff" id="context"> <div class="infoBoxContent">
</pre><pre class="diff" id="removed">- <?php echo tep_draw_form('pMove', FILENAME_PRODUCTS, 'page=' . $_GET['page'] . '&cPath=' . $cPath . '&pID=' . $pInfo->products_id . '&action=move_product_confirm'); ?>
</pre><pre class="diff" id="added">+ <?php echo tep_draw_form('pCopyTo', FILENAME_PRODUCTS, 'page=' . $_GET['page'] . '&cPath=' . $cPath . '&search=' . $_GET['search'] . '&pID=' . $pInfo->products_id . '&action=copy_to_confirm'); ?>
</pre><pre class="diff" id="context">
</pre><pre class="diff" id="removed">- <p><?php echo sprintf(TEXT_MOVE_PRODUCTS_INTRO, $pInfo->products_name); ?></p>
</pre><pre class="diff" id="added">+ <p><?php echo TEXT_INFO_COPY_TO_INTRO; ?></p>
</pre><pre class="diff" id="context"> <p><?php echo TEXT_INFO_CURRENT_CATEGORIES . '<br>' . tep_output_generated_category_path($pInfo->products_id, 'product'); ?></p>
</pre><pre class="diff" id="removed">- <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>
</pre><pre class="diff" id="added">+ <p><?php echo TEXT_CATEGORIES . '<br>' . osc_draw_pull_down_menu('categories_id', $categories_array, $cPath); ?></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>
</pre><pre class="diff" id="context">
</pre><pre class="diff" id="removed">- <p align="center"><?php echo '<input type="submit" value="' . IMAGE_<span id="removedchars">MOVE</span> . '" class="operationButton"> <input type="button" value="' . IMAGE_CANCEL . '" onClick="toggleInfoBox(\'cDefault\');" class="operationButton">'; ?></p>
</pre><pre class="diff" id="added">+ <p align="center"><?php echo '<input type="submit" value="' . IMAGE_<span id="addedchars">COPY</span> . '" class="operationButton"> <input type="button" value="' . IMAGE_CANCEL . '" onClick="toggleInfoBox(\'cDefault\');" class="operationButton">'; ?></p>
</pre><pre class="diff" id="context">
</form>
</div>
</pre><pre class="diff"><small id="info">@@ -147,7 +164,7 @@
</small></pre><pre class="diff" id="context"> <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">
</pre><pre class="diff" id="removed">- <?php echo tep_draw_form('pDelete', FILENAME_PRODUCTS, 'page=' . $_GET['page'] . '&cPath=' . $cPath . '&pID=' . $pInfo->products_id . '&action=delete_product_confirm'); ?>
</pre><pre class="diff" id="added">+ <?php echo tep_draw_form('pDelete', FILENAME_PRODUCTS, 'page=' . $_GET['page'] . '&cPath=' . $cPath . '&<span id="addedchars">search=' . $_GET['search'] . '&</span>pID=' . $pInfo->products_id . '&action=delete_product_confirm'); ?>
</pre><pre class="diff" id="context">
<p><?php echo TEXT_DELETE_PRODUCT_INTRO; ?></p>
<p><?php echo $pInfo->products_name; ?></p>
</pre></div>
<hr /><a name="file6" /><div class="file">
<span class="pathname"><a href="http://cvs.oscommerce.com/viewcvs.cgi/admin">admin</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin">admin</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/templates">templates</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/templates/pages">pages</a><br /></span>
<div class="fileheader"><big><b>products_edit.php</b></big> <small id="info"><a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/templates/pages/products_edit.php?rev=1.2&content-type=text/vnd.viewcvs-markup">1.2</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/templates/pages/products_edit.php.diff?r1=1.2&r2=1.3">-></a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/templates/pages/products_edit.php?rev=1.3&content-type=text/vnd.viewcvs-markup">1.3</a></small></div>
<pre class="diff"><small id="info">diff -u -r1.2 -r1.3
--- products_edit.php 2004/08/29 22:17:21 1.2
+++ products_edit.php 2004/10/26 20:15:32 1.3
@@ -240,7 +240,7 @@
</small></pre><pre class="diff" id="context"> //--></script>
<?php
</pre><pre class="diff" id="removed">- 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"');
</pre><pre class="diff" id="added">+ echo tep_draw_form('new_product', FILENAME_PRODUCTS, 'cPath=' . $cPath . <span id="addedchars">'&search=' . $_GET['search'] . </span>(isset($_GET['pID']) ? '&pID=' . $_GET['pID'] : '') . '&action=new_product_preview', 'post', 'enctype="multipart/form-data"');
</pre><pre class="diff" id="context"> ?>
<div class="tab-page" id="tabDescription">
</pre><pre class="diff"><small id="info">@@ -297,7 +297,7 @@
</small></pre><pre class="diff" id="context"> </div>
<div class="tab-page" id="tabData">
</pre><pre class="diff" id="removed">- <h2 class="tab"><?php echo <span id="removedchars">'Data'</span>; ?></h2>
</pre><pre class="diff" id="added">+ <h2 class="tab"><?php echo <span id="addedchars">TAB_DATA</span>; ?></h2>
</pre><pre class="diff" id="context">
<script type="text/javascript"><!--
mainTabPane.addTabPage( document.getElementById( "tabData" ) );
</pre><pre class="diff"><small id="info">@@ -378,11 +378,11 @@
</small></pre><pre class="diff" id="context"> </table>
</div>
</pre><pre class="diff" id="removed">- <div class="tab-page" id="tabImage">
- <h2 class="tab"><?php echo 'Image'; ?></h2>
</pre><pre class="diff" id="added">+ <div class="tab-page" id="tabImages">
+ <h2 class="tab"><?php echo TAB_IMAGES; ?></h2>
</pre><pre class="diff" id="context">
<script type="text/javascript"><!--
</pre><pre class="diff" id="removed">- mainTabPane.addTabPage( document.getElementById( "tabImage" ) );
</pre><pre class="diff" id="added">+ mainTabPane.addTabPage( document.getElementById( "tabImage<span id="addedchars">s</span>" ) );
</pre><pre class="diff" id="context"> //--></script>
<table border="0" width="100%" cellspacing="0" cellpadding="2">
</pre><pre class="diff"><small id="info">@@ -523,7 +523,50 @@
</small></pre><pre class="diff" id="context"> </table>
</div>
</pre><pre class="diff" id="removed">- <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>
</pre><pre class="diff" id="added">+ <div class="tab-page" id="tabCategories">
+ <h2 class="tab"><?php echo TAB_CATEGORIES; ?></h2>
+
+<script type="text/javascript">mainTabPane.addTabPage( document.getElementById( "tabCategories" ) );</script>
+
+ <table border="0" width="100%" cellspacing="0" cellpadding="2">
+ <tr>
+ <td class="smallText"><table border="0" width="100%" cellspacing="0" cellpadding="2" class="dataTable">
+ <thead>
+ <tr>
+ <th>Categories</th>
+ <th>Selected</th>
+ </tr>
+ </thead>
+ <tbody>
+<?php
+ $product_categories_array = array();
+
+ $Qcategories = $osC_Database->query('select categories_id from :table_products_to_categories where products_id = :products_id');
+ $Qcategories->bindTable(':table_products_to_categories', TABLE_PRODUCTS_TO_CATEGORIES);
+ $Qcategories->bindInt(':products_id', $_GET['pID']);
+ $Qcategories->execute();
+
+ while ($Qcategories->next()) {
+ $product_categories_array[] = $Qcategories->valueInt('categories_id');
+ }
+
+ $assignedCategoryTree = new osC_CategoryTree();
+ $assignedCategoryTree->setBreadcrumbUsage(false);
+ $assignedCategoryTree->setSpacerString('&nbsp;', 5);
+
+ foreach ($assignedCategoryTree->getTree() as $value) {
+ echo ' <tr onMouseOver="rowOverEffect(this);" onMouseOut="rowOutEffect(this);">' . "\n" .
+ ' <td class="smallText"><a href="#" onClick="document.new_product.categories_' . $value['id'] . '.checked=!document.new_product.categories_' . $value['id'] . '.checked;">' . $value['title'] . '</a></td>' . "\n" .
+ ' <td class="smallText" align="right">' . osc_draw_checkbox_field('categories[]', $value['id'], in_array($value['id'], $product_categories_array), 'id="categories_' . $value['id'] . '"') . '</td>' . "\n" .
+ ' </tr>' . "\n";
+ }
+?>
+ </table></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 . '&search=' . $_GET['search'] . (isset($_GET['pID']) ? '&pID=' . $_GET['pID'] : '')) . '\';" class="operationButton">'; ?></p>
</pre><pre class="diff" id="context">
</form>
</div>
</pre></div>
<hr /><a name="file7" /><div class="file">
<span class="pathname"><a href="http://cvs.oscommerce.com/viewcvs.cgi/admin">admin</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin">admin</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/templates">templates</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/templates/pages">pages</a><br /></span>
<div class="fileheader"><big><b>products_preview.php</b></big> <small id="info"><a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/templates/pages/products_preview.php?rev=1.2&content-type=text/vnd.viewcvs-markup">1.2</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/templates/pages/products_preview.php.diff?r1=1.2&r2=1.3">-></a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/templates/pages/products_preview.php?rev=1.3&content-type=text/vnd.viewcvs-markup">1.3</a></small></div>
<pre class="diff"><small id="info">diff -u -r1.2 -r1.3
--- products_preview.php 2004/08/29 22:17:21 1.2
+++ products_preview.php 2004/10/26 20:15:33 1.3
@@ -50,7 +50,7 @@
</small></pre><pre class="diff" id="context">
$languages = tep_get_languages();
</pre><pre class="diff" id="removed">- echo tep_draw_form('save_product', FILENAME_PRODUCTS, 'cPath=' . $cPath . (isset($_GET['pID']) ? '&pID=' . $_GET['pID'] : '') . '&action=save_product', 'post', 'enctype="multipart/form-data"');
</pre><pre class="diff" id="added">+ echo tep_draw_form('save_product', FILENAME_PRODUCTS, 'cPath=' . $cPath . <span id="addedchars">'&search=' . $_GET['search'] . </span>(isset($_GET['pID']) ? '&pID=' . $_GET['pID'] : '') . '&action=save_product', 'post', 'enctype="multipart/form-data"');
</pre><pre class="diff" id="context"> ?>
<table border="0" width="100%" cellspacing="0" cellpadding="2">
</pre><pre class="diff"><small id="info">@@ -109,7 +109,7 @@
</small></pre><pre class="diff" id="context">
echo osc_draw_hidden_field('products_image', $products_image_name);
</pre><pre class="diff" id="removed">- 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">';
</pre><pre class="diff" id="added">+ 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 . <span id="addedchars">'&search=' . $_GET['search'] . </span>(isset($_GET['pID']) ? '&pID=' . $_GET['pID'] : '')) . '\';" class="operationButton">';
</pre><pre class="diff" id="context">
echo '</p>';
}
</pre></div>
<center><small><a href="http://www.badgers-in-foil.co.uk/projects/cvsspam/" title="commit -> email">CVSspam</a> 0.2.9</small></center>
</body></html>
-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click