[TEP-COMMIT] [CVS admin] New weight class administration screen as detailed in workboard 44

anonymous-OfajU3CKLf1/[email protected] 15 Apr 2004 16:06:48 -0000
Newsgroups gmane.comp.web.oscommerce.cvs
Message-ID <[email protected]>
Commit in admin/admin on MAIN

weight_classes.php +296 added 1.1

categories.php +11 -2 1.148 -> 1.149

includes/database_tables.php +2 1.3 -> 1.4

/filenames.php +1 1.2 -> 1.3

includes/boxes/localization.php +2 -1 1.16 -> 1.17

includes/functions/general.php +35 1.161 -> 1.162

includes/languages/english.php +2 1.110 -> 1.111

/espanol.php +2 1.105 -> 1.106

/german.php +2 1.104 -> 1.105

includes/languages/english/weight_classes.php +34 added 1.1

includes/languages/espanol/weight_classes.php +34 added 1.1

includes/languages/german/weight_classes.php +34 added 1.1

+455 -3

4 added + 8 modified, total 12 files

New weight class administration screen as detailed in workboard 44

----------

admin /admin

weight_classes.php added at 1.1

diff -N weight_classes.php
--- /dev/null Thu Apr 15 18:06:39 2004
+++ /tmp/cvsAAA_CaGNb Thu Apr 15 18:06:40 2004
@@ -0,0 +1,296 @@

+<?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');
+
+ $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');
+
+ if (tep_not_null($action)) {
+ switch ($action) {
+ case 'insert':
+ case 'save':
+ if (isset($HTTP_GET_VARS['wcID'])) $weight_class_id = tep_db_prepare_input($HTTP_GET_VARS['wcID']);
+
+ $classes_title_array = $HTTP_POST_VARS['weight_class_title'];
+ $classes_key_array = $HTTP_POST_VARS['weight_class_key'];
+ $languages = tep_get_languages();
+ for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
+ $language_id = $languages[$i]['id'];
+
+ $sql_data_array = array('weight_class_title' => tep_db_prepare_input($classes_title_array[$language_id]),
+ 'weight_class_key' => tep_db_prepare_input($classes_key_array[$language_id]));
+
+ if ($action == 'insert') {
+ if (empty($weight_class_id)) {
+ $next_id_query = tep_db_query("select max(weight_class_id) as weight_class_id from " . TABLE_WEIGHT_CLASS);
+ $next_id = tep_db_fetch_array($next_id_query);
+ $weight_class_id = $next_id['weight_class_id'] + 1;
+ }
+
+ $insert_sql_data = array('weight_class_id' => $weight_class_id,
+ 'language_id' => $language_id);
+
+ $sql_data_array = array_merge($sql_data_array, $insert_sql_data);
+
+ tep_db_perform(TABLE_WEIGHT_CLASS, $sql_data_array);
+ } elseif ($action == 'save') {
+ tep_db_perform(TABLE_WEIGHT_CLASS, $sql_data_array, 'update', "weight_class_id = '" . (int)$weight_class_id . "' and language_id = '" . (int)$language_id . "'");
+
+ $weight_class_rules_array = $HTTP_POST_VARS['weight_class_rules'];
+
+ foreach ($weight_class_rules_array as $weight_class_to_id => $weight_class_rule) {
+ $sql_data_array = array('weight_class_rule' => tep_db_prepare_input($weight_class_rule));
+ tep_db_perform(TABLE_WEIGHT_CLASS_RULES, $sql_data_array, 'update', "weight_class_from_id = '" . (int)$weight_class_id . "' and weight_class_to_id = '" . $weight_class_to_id . "'");
+ }
+
+ }
+ }
+
+ if ($action == 'insert') {
+ $classes_query = tep_db_query("select weight_class_id, language_id from " . TABLE_WEIGHT_CLASS . " where weight_class_id != '" . (int)$weight_class_id . "' and language_id = '" . (int)$languages_id . "'");
+ while ($classes = tep_db_fetch_array($classes_query)) {
+ $sql_data_array = array('weight_class_from_id' => tep_db_prepare_input($weight_class_id),
+ 'weight_class_to_id' => tep_db_prepare_input($classes['weight_class_id']),
+ 'weight_class_rule' => 1);
+ tep_db_perform(TABLE_WEIGHT_CLASS_RULES, $sql_data_array);
+
+ $sql_data_array = array('weight_class_from_id' => tep_db_prepare_input($classes['weight_class_id']),
+ 'weight_class_to_id' => tep_db_prepare_input($weight_class_id),
+ 'weight_class_rule' => 1);
+ tep_db_perform(TABLE_WEIGHT_CLASS_RULES, $sql_data_array);
+ }
+ }
+
+ if (isset($HTTP_POST_VARS['default']) && ($HTTP_POST_VARS['default'] == 'on')) {
+ tep_db_query("update " . TABLE_CONFIGURATION . " set configuration_value = '" . tep_db_input($weight_class_id) . "' where configuration_key = 'SHIPPING_WEIGHT_UNIT'");
+ }
+
+ osC_Cache::clear('weight-classes');
+ osC_Cache::clear('weight-rules');
+
+ tep_redirect(tep_href_link(FILENAME_WEIGHT_CLASSES, 'page=' . $HTTP_GET_VARS['page'] . '&wcID=' . $weight_class_id));
+ break;
+ case 'deleteconfirm':
+ $wcID = tep_db_prepare_input($HTTP_GET_VARS['wcID']);
+
+ tep_db_query("delete from " . TABLE_WEIGHT_CLASS . " where weight_class_id = '" . tep_db_input($wcID) . "'");
+ tep_db_query("delete from " . TABLE_WEIGHT_CLASS_RULES . " where weight_class_from_id = '" . tep_db_input($wcID) . "' or weight_class_to_id = '" . tep_db_input($wcID) . "'");
+
+ osC_Cache::clear('weight-classes');
+ osC_Cache::clear('weight-rules');
+
+ tep_redirect(tep_href_link(FILENAME_WEIGHT_CLASSES, 'page=' . $HTTP_GET_VARS['page']));
+ break;
+ case 'delete':
+ $wcID = tep_db_prepare_input($HTTP_GET_VARS['wcID']);
+
+ $remove_status = true;
+ if ($wcID == SHIPPING_WEIGHT_UNIT) {
+ $remove_status = false;
+ $messageStack->add(ERROR_REMOVE_DEFAULT_WEIGHT_CLASS, 'error');
+ }
+ break;
+ case 'update_rules':
+ $wcID = tep_db_prepare_input($HTTP_GET_VARS['wcID']);
+
+
+ break;
+ }
+ }
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/general.js"></script>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="SetFocus();">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+ <tr>
+ <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+ </table></td>
+<!-- body_text //-->
+ <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+ <tr>
+ <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+ <tr>
+ <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+ <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+ </tr>
+ </table></td>
+ </tr>
+ <tr>
+ <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+ <tr>
+ <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+ <tr class="dataTableHeadingRow">
+ <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_WEIGHT_CLASSES_TITLE; ?></td>
+ <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_WEIGHT_CLASSES_UNIT; ?></td>
+ <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
+ </tr>
+<?php
+ $classes_query_raw = "select weight_class_id, weight_class_key, weight_class_title, language_id from " . TABLE_WEIGHT_CLASS . " where language_id = '" . (int)$languages_id . "' order by weight_class_title";
+ $classes_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $classes_query_raw, $classes_query_numrows);
+ $classes_query = tep_db_query($classes_query_raw);
+ while ($classes = tep_db_fetch_array($classes_query)) {
+ if ((!isset($HTTP_GET_VARS['wcID']) || (isset($HTTP_GET_VARS['wcID']) && ($HTTP_GET_VARS['wcID'] == $classes['weight_class_id']))) && !isset($wcInfo) && (substr($action, 0, 3) != 'new')) {
+ $wcInfo = new objectInfo($classes);
+ }
+
+ if (isset($wcInfo) && is_object($wcInfo) && ($classes['weight_class_id'] == $wcInfo->weight_class_id)) {
+ echo ' <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_WEIGHT_CLASSES, 'page=' . $HTTP_GET_VARS['page'] . '&wcID=' . $wcInfo->weight_class_id . '&action=edit') . '\'">' . "\n";
+ } else {
+ echo ' <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_WEIGHT_CLASSES, 'page=' . $HTTP_GET_VARS['page'] . '&wcID=' . $classes['weight_class_id']) . '\'">' . "\n";
+ }
+
+ if (SHIPPING_WEIGHT_UNIT == $classes['weight_class_id']) {
+ echo ' <td class="dataTableContent"><b>' . $classes['weight_class_title'] . ' (' . TEXT_DEFAULT . ')</b></td>' . "\n";
+ } else {
+ echo ' <td class="dataTableContent">' . $classes['weight_class_title'] . '</td>' . "\n";
+ }
+?>
+ <td class="dataTableContent"><?php echo $classes['weight_class_key']; ?></td>
+ <td class="dataTableContent" align="right"><?php if (isset($wcInfo) && is_object($wcInfo) && ($classes['weight_class_id'] == $wcInfo->weight_class_id)) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link(FILENAME_WEIGHT_CLASSES, 'page=' . $HTTP_GET_VARS['page'] . '&oID=' . $classes['weight_class_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
+ </tr>
+<?php
+ }
+?>
+ <tr>
+ <td colspan="3"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+ <tr>
+ <td class="smallText" valign="top"><?php echo $classes_split->display_count($classes_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_WEIGHT_CLASSES); ?></td>
+ <td class="smallText" align="right"><?php echo $classes_split->display_links($classes_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page']); ?></td>
+ </tr>
+<?php
+ if (empty($action)) {
+?>
+ <tr>
+ <td colspan="3" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_WEIGHT_CLASSES, 'page=' . $HTTP_GET_VARS['page'] . '&action=new') . '">' . tep_image_button('button_insert.gif', IMAGE_INSERT) . '</a>'; ?></td>
+ </tr>
+<?php
+ }
+?>
+ </table></td>
+ </tr>
+ </table></td>
+<?php
+ $heading = array();
+ $contents = array();
+
+ switch ($action) {
+ case 'new':
+ $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_NEW_WEIGHT_CLASS . '</b>');
+
+ $contents = array('form' => tep_draw_form('status', FILENAME_WEIGHT_CLASSES, 'page=' . $HTTP_GET_VARS['page'] . '&action=insert'));
+ $contents[] = array('text' => TEXT_INFO_INSERT_INTRO);
+
+ $classes_inputs_string = '';
+ $languages = tep_get_languages();
+ for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
+ $classes_inputs_string .= '<br>' . tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;' . tep_draw_input_field('weight_class_title[' . $languages[$i]['id'] . ']') . tep_draw_input_field('weight_class_key[' . $languages[$i]['id'] . ']', $wcInfo->weight_class_key, 'size="4"');
+ }
+
+ $contents[] = array('text' => '<br>' . TEXT_INFO_WEIGHT_CLASS_TITLE . $classes_inputs_string);
+ $contents[] = array('text' => '<br>' . tep_draw_checkbox_field('default') . ' ' . TEXT_SET_DEFAULT);
+ $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_insert.gif', IMAGE_INSERT) . ' <a href="' . tep_href_link(FILENAME_WEIGHT_CLASSES, 'page=' . $HTTP_GET_VARS['page']) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+ break;
+ case 'edit':
+ $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_EDIT_WEIGHT_CLASS . '</b>');
+
+ $contents = array('form' => tep_draw_form('edit', FILENAME_WEIGHT_CLASSES, 'page=' . $HTTP_GET_VARS['page'] . '&wcID=' . $wcInfo->weight_class_id . '&action=save'));
+ $contents[] = array('text' => TEXT_INFO_EDIT_INTRO . '</b>');
+
+ $classes_inputs_string = '';
+ $languages = tep_get_languages();
+ for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
+ $classes_inputs_string .= '<br>' . tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;' . tep_draw_input_field('weight_class_title[' . $languages[$i]['id'] . ']', tep_get_weight_class_title($wcInfo->weight_class_id, $languages[$i]['id'])) . tep_draw_input_field('weight_class_key[' . $languages[$i]['id'] . ']', tep_get_weight_class_key($wcInfo->weight_class_id, $languages[$i]['id']), 'size="4"');
+ }
+
+ $contents[] = array('text' => '<br><b>' . TEXT_INFO_WEIGHT_CLASS_TITLE . '</b>' . $classes_inputs_string);
+
+ $contents[] = array('text' => '<br><b>' . TEXT_INFO_HEADING_EDIT_WEIGHT_RULES . '</b>');
+ $contents[] = array('form' => tep_draw_form('edit_rules', FILENAME_WEIGHT_CLASSES, 'page=' . $HTTP_GET_VARS['page'] . '&wcID=' . $wcInfo->weight_class_id . '&action=update_rules'));
+
+ $weight_rules_string = '<table border="0" cellspacing="0" cellpadding="2">';
+ $rules_query = tep_db_query("select r.weight_class_to_id, r.weight_class_rule, c.weight_class_title from " . TABLE_WEIGHT_CLASS_RULES . " r, " . TABLE_WEIGHT_CLASS . " c where r.weight_class_from_id = '" . $wcInfo->weight_class_id . "' and r.weight_class_to_id != '" . $wcInfo->weight_class_id . "' and r.weight_class_to_id = c.weight_class_id and c.language_id = '" . (int)$languages_id . "' order by c.weight_class_title");
+ while ($rules = tep_db_fetch_array($rules_query)) {
+ $weight_rules_string .= '<tr><td class="dataTableContent">' . $rules['weight_class_title'] . ':</td><td class="dataTableContent">' . tep_draw_input_field('weight_class_rules[' . $rules['weight_class_to_id'] . ']', $rules['weight_class_rule'], 'size="10"') . '</td></tr>';
+ }
+
+ $weight_rules_string .= '</table>';
+
+ $contents[] = array('text' => $weight_rules_string);
+
+ if (SHIPPING_WEIGHT_UNIT != $wcInfo->weight_class_id) $contents[] = array('text' => '<br>' . tep_draw_checkbox_field('default') . ' <b>' . TEXT_SET_DEFAULT . '</b>');
+
+ $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_update.gif', IMAGE_UPDATE) . ' <a href="' . tep_href_link(FILENAME_WEIGHT_CLASSES, 'page=' . $HTTP_GET_VARS['page'] . '&wcID=' . $wcInfo->weight_class_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+ break;
+ case 'delete':
+ $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_DELETE_WEIGHT_CLASS . '</b>');
+
+ $contents = array('form' => tep_draw_form('status', FILENAME_WEIGHT_CLASSES, 'page=' . $HTTP_GET_VARS['page'] . '&wcID=' . $wcInfo->weight_class_id . '&action=deleteconfirm'));
+ $contents[] = array('text' => TEXT_INFO_DELETE_INTRO);
+ $contents[] = array('text' => '<br><b>' . $wcInfo->weight_class_title . '</b>');
+ if ($remove_status) $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_delete.gif', IMAGE_DELETE) . ' <a href="' . tep_href_link(FILENAME_WEIGHT_CLASSES, 'page=' . $HTTP_GET_VARS['page'] . '&wcID=' . $wcInfo->weight_class_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+ break;
+ default:
+ if (isset($wcInfo) && is_object($wcInfo)) {
+ $heading[] = array('text' => '<b>' . $wcInfo->weight_class_title . '</b>');
+
+ $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_WEIGHT_CLASSES, 'page=' . $HTTP_GET_VARS['page'] . '&wcID=' . $wcInfo->weight_class_id . '&action=edit') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_WEIGHT_CLASSES, 'page=' . $HTTP_GET_VARS['page'] . '&wcID=' . $wcInfo->weight_class_id . '&action=delete') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a>');
+
+ $classes_inputs_string = '';
+ $languages = tep_get_languages();
+ for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
+ $classes_inputs_string .= '<br>' . tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;' . tep_get_weight_class_title($wcInfo->weight_class_id, $languages[$i]['id']);
+ }
+
+ $contents[] = array('text' => $classes_inputs_string);
+ }
+ break;
+ }
+
+ if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {
+ echo ' <td width="25%" valign="top">' . "\n";
+
+ $box = new box;
+ echo $box->infoBox($heading, $contents);
+
+ echo ' </td>' . "\n";
+ }
+?>
+ </tr>
+ </table></td>
+ </tr>
+ </table></td>
+<!-- body_text_eof //-->
+ </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

----------

admin /admin

categories.php 1.148 -> 1.149

diff -u -r1.148 -r1.149
--- categories.php 2004/04/10 15:13:22 1.148
+++ categories.php 2004/04/15 16:06:39 1.149
@@ -217,6 +217,7 @@

'products_price' => tep_db_prepare_input($HTTP_POST_VARS['products_price']),
'products_date_available' => $products_date_available,
'products_weight' => tep_db_prepare_input($HTTP_POST_VARS['products_weight']),

+ 'products_weight_class' => tep_db_prepare_input($HTTP_POST_VARS['products_weight_class']),

'products_status' => tep_db_prepare_input($HTTP_POST_VARS['products_status']),
'products_tax_class_id' => tep_db_prepare_input($HTTP_POST_VARS['products_tax_class_id']),
'manufacturers_id' => tep_db_prepare_input($HTTP_POST_VARS['manufacturers_id']));

@@ -366,6 +367,7 @@

'products_image' => '',
'products_price' => '',
'products_weight' => '',

+ 'products_weight_class' => SHIPPING_WEIGHT_UNIT,

'products_date_added' => '',
'products_last_modified' => '',
'products_date_available' => '',

@@ -376,7 +378,7 @@

$pInfo = new objectInfo($parameters);

if (isset($HTTP_GET_VARS['pID']) && empty($HTTP_POST_VARS)) {

- $product_query = tep_db_query("select pd.products_name, pd.products_description, pd.products_url, p.products_id, p.products_quantity, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_date_added, p.products_last_modified, date_format(p.products_date_available, '%Y-%m-%d') as products_date_available, p.products_status, p.products_tax_class_id, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int)$HTTP_GET_VARS['pID'] . "' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'");

+ $product_query = tep_db_query("select pd.products_name, pd.products_description, pd.products_url, p.products_id, p.products_quantity, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_weight_class, p.products_date_added, p.products_last_modified, date_format(p.products_date_available, '%Y-%m-%d') as products_date_available, p.products_status, p.products_tax_class_id, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int)$HTTP_GET_VARS['pID'] . "' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'");

$product = tep_db_fetch_array($product_query);

$pInfo->objectInfo($product);

@@ -409,6 +411,13 @@

case '1':
default: $in_status = true; $out_status = false;
}

+
+ $weight_class_array = array();
+ $weight_class_query = tep_db_query("select weight_class_id, weight_class_title from " . TABLE_WEIGHT_CLASS . " where language_id = '" . (int)$languages_id . "' order by weight_class_title");
+ while ($weight_class = tep_db_fetch_array($weight_class_query)) {
+ $weight_class_array[] = array('id' => $weight_class['weight_class_id'],
+ 'text' => $weight_class['weight_class_title']);
+ }

?>
<link rel="stylesheet" type="text/css" href="includes/javascript/spiffyCal/spiffyCal_v2_1.css">
<script language="JavaScript" src="includes/javascript/spiffyCal/spiffyCal_v2_1.js"></script>

@@ -583,7 +592,7 @@

</tr>
<tr>
<td class="main"><?php echo TEXT_PRODUCTS_WEIGHT; ?></td>

- <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . tep_draw_input_field('products_weight', $pInfo->products_weight); ?></td>

+ <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . tep_draw_input_field('products_weight', $pInfo->products_weight). '&nbsp;' . tep_draw_pull_down_menu('products_weight_class', $weight_class_array, $pInfo->products_weight_class); ?></td>

</tr>
</table></td>
</tr>

----------

admin /admin /includes

database_tables.php 1.3 -> 1.4

diff -u -r1.3 -r1.4
--- database_tables.php 2004/04/08 04:47:42 1.3
+++ database_tables.php 2004/04/15 16:06:40 1.4
@@ -55,6 +55,8 @@

define('TABLE_TAX_RATES', DB_TABLE_PREFIX . 'tax_rates');
define('TABLE_GEO_ZONES', DB_TABLE_PREFIX . 'geo_zones');
define('TABLE_ZONES_TO_GEO_ZONES', DB_TABLE_PREFIX . 'zones_to_geo_zones');

+ define('TABLE_WEIGHT_CLASS', DB_TABLE_PREFIX . 'weight_classes');
+ define('TABLE_WEIGHT_CLASS_RULES', DB_TABLE_PREFIX . 'weight_classes_rules');

define('TABLE_WHOS_ONLINE', DB_TABLE_PREFIX . 'whos_online');
define('TABLE_ZONES', DB_TABLE_PREFIX . 'zones');
?>

----------

admin /admin /includes

filenames.php 1.2 -> 1.3

diff -u -r1.2 -r1.3
--- filenames.php 2004/04/13 08:19:17 1.2
+++ filenames.php 2004/04/15 16:06:40 1.3
@@ -47,6 +47,7 @@

define('FILENAME_STATS_PRODUCTS_VIEWED', 'stats_products_viewed.php');
define('FILENAME_TAX_CLASSES', 'tax_classes.php');
define('FILENAME_TAX_RATES', 'tax_rates.php');

+ define('FILENAME_WEIGHT_CLASSES', 'weight_classes.php');

define('FILENAME_WHOS_ONLINE', 'whos_online.php');
define('FILENAME_ZONES', 'zones.php');
?>

----------

admin /admin /includes /boxes

localization.php 1.16 -> 1.17

diff -u -r1.16 -r1.17
--- localization.php 2003/07/09 01:18:53 1.16
+++ localization.php 2004/04/15 16:06:41 1.17
@@ -23,7 +23,8 @@

if ($selected_box == 'localization') {
$contents[] = array('text' => '<a href="' . tep_href_link(FILENAME_CURRENCIES, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_LOCALIZATION_CURRENCIES . '</a><br>' .
'<a href="' . tep_href_link(FILENAME_LANGUAGES, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_LOCALIZATION_LANGUAGES . '</a><br>' .

- '<a href="' . tep_href_link(FILENAME_ORDERS_STATUS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_LOCALIZATION_ORDERS_STATUS . '</a>');

+ '<a href="' . tep_href_link(FILENAME_ORDERS_STATUS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_LOCALIZATION_ORDERS_STATUS . '</a><br>' .
+ '<a href="' . tep_href_link(FILENAME_WEIGHT_CLASSES, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_LOCALIZATION_WEIGHT_CLASSES . '</a>');

}

$box = new box;

----------

admin /admin /includes /functions

general.php 1.161 -> 1.162

diff -u -r1.161 -r1.162
--- general.php 2004/04/10 15:13:23 1.161
+++ general.php 2004/04/15 16:06:42 1.162
@@ -482,6 +482,26 @@

return $orders_status['orders_status_name'];
}

+ function tep_get_weight_class_title($weight_class_id, $language_id = '') {
+ global $languages_id;
+
+ if (!$language_id) $language_id = $languages_id;
+ $weight_class_query = tep_db_query("select weight_class_title from " . TABLE_WEIGHT_CLASS . " where weight_class_id = '" . (int)$weight_class_id . "' and language_id = '" . (int)$language_id . "'");
+ $weight_class = tep_db_fetch_array($weight_class_query);
+
+ return $weight_class['weight_class_title'];
+ }
+
+ function tep_get_weight_class_key($weight_class_id, $language_id = '') {
+ global $languages_id;
+
+ if (!$language_id) $language_id = $languages_id;
+ $weight_class_query = tep_db_query("select weight_class_key from " . TABLE_WEIGHT_CLASS . " where weight_class_id = '" . (int)$weight_class_id . "' and language_id = '" . (int)$language_id . "'");
+ $weight_class = tep_db_fetch_array($weight_class_query);
+
+ return $weight_class['weight_class_key'];
+ }
+

function tep_get_orders_status() {
global $languages_id;

@@ -687,6 +707,21 @@

$zone = tep_db_fetch_array($zone_query);
return $zone['zone_name'];
}

+ }
+
+ function tep_cfg_pull_down_weight_classes($weight_class_id, $key = '') {
+ global $languages_id;
+
+ $name = (($key) ? 'configuration[' . $key . ']' : 'configuration_value');
+
+ $weight_class_array = array();
+ $weight_class_query = tep_db_query("select weight_class_id, weight_class_title from " . TABLE_WEIGHT_CLASS . " where language_id = '" . (int)$languages_id . "' order by weight_class_title");
+ while ($weight_class = tep_db_fetch_array($weight_class_query)) {
+ $weight_class_array[] = array('id' => $weight_class['weight_class_id'],
+ 'text' => $weight_class['weight_class_title']);
+ }
+
+ return tep_draw_pull_down_menu($name, $weight_class_array, $weight_class_id);

}

////

----------

admin /admin /includes /languages

english.php 1.110 -> 1.111

diff -u -r1.110 -r1.111
--- english.php 2004/04/13 08:19:22 1.110
+++ english.php 2004/04/15 16:06:42 1.111
@@ -113,6 +113,7 @@

define('BOX_LOCALIZATION_CURRENCIES', 'Currencies');
define('BOX_LOCALIZATION_LANGUAGES', 'Languages');
define('BOX_LOCALIZATION_ORDERS_STATUS', 'Orders Status');

+define('BOX_LOCALIZATION_WEIGHT_CLASSES', 'Weight Classes');

// javascript messages
define('JS_ERROR', 'Errors have occured during the process of your form!\nPlease make the following corrections:\n\n');

@@ -274,6 +275,7 @@

define('TEXT_DISPLAY_NUMBER_OF_TAX_CLASSES', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> tax classes)');
define('TEXT_DISPLAY_NUMBER_OF_TAX_ZONES', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> tax zones)');
define('TEXT_DISPLAY_NUMBER_OF_TAX_RATES', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> tax rates)');

+define('TEXT_DISPLAY_NUMBER_OF_WEIGHT_CLASSES', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> weight classes)');

define('TEXT_DISPLAY_NUMBER_OF_ZONES', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> zones)');

define('PREVNEXT_BUTTON_PREV', '&lt;&lt;');

----------

admin /admin /includes /languages

espanol.php 1.105 -> 1.106

diff -u -r1.105 -r1.106
--- espanol.php 2004/04/13 08:19:22 1.105
+++ espanol.php 2004/04/15 16:06:42 1.106
@@ -113,6 +113,7 @@

define('BOX_LOCALIZATION_CURRENCIES', 'Monedas');
define('BOX_LOCALIZATION_LANGUAGES', 'Idiomas');
define('BOX_LOCALIZATION_ORDERS_STATUS', 'Estado Pedidos');

+define('BOX_LOCALIZATION_WEIGHT_CLASSES', 'Weight Classes');

// javascript messages
define('JS_ERROR', 'Ha habido errores procesando su formulario!\nPor favor, haga las siguientes modificaciones:\n\n');

@@ -269,6 +270,7 @@

define('TEXT_DISPLAY_NUMBER_OF_TAX_ZONES', 'Viendo del <b>%d</b> al <b>%d</b> (de <b>%d</b> zonas de impuestos)');
define('TEXT_DISPLAY_NUMBER_OF_TAX_RATES', 'Viendo del <b>%d</b> al <b>%d</b> (de <b>%d</b> porcentajes de impuestos)');
define('TEXT_DISPLAY_NUMBER_OF_TAX_CLASSES', 'Viendo del <b>%d</b> al <b>%d</b> (de <b>%d</b> tipos de impuesto)');

+define('TEXT_DISPLAY_NUMBER_OF_WEIGHT_CLASSES', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> weight classes)');

define('TEXT_DISPLAY_NUMBER_OF_ZONES', 'Viendo del <b>%d</b> al <b>%d</b> (de <b>%d</b> zonas)');

define('PREVNEXT_BUTTON_PREV', '&lt;&lt;');

----------

admin /admin /includes /languages

german.php 1.104 -> 1.105

diff -u -r1.104 -r1.105
--- german.php 2004/04/13 08:19:22 1.104
+++ german.php 2004/04/15 16:06:42 1.105
@@ -113,6 +113,7 @@

define('BOX_LOCALIZATION_CURRENCIES', 'W&auml;hrungen');
define('BOX_LOCALIZATION_LANGUAGES', 'Sprachen');
define('BOX_LOCALIZATION_ORDERS_STATUS', 'Bestellstatus');

+define('BOX_LOCALIZATION_WEIGHT_CLASSES', 'Weight Classes');

// javascript messages
define('JS_ERROR', 'Während der Eingabe sind Fehler aufgetreten!\nBitte korrigieren Sie folgendes:\n\n');

@@ -269,6 +270,7 @@

define('TEXT_DISPLAY_NUMBER_OF_TAX_CLASSES', 'Angezeigt werden <b>%d</b> bis <b>%d</b> (von insgesamt <b>%d</b> Steuerklassen)');
define('TEXT_DISPLAY_NUMBER_OF_TAX_ZONES', 'Angezeigt werden <b>%d</b> bis <b>%d</b> (von insgesamt <b>%d</b> Steuerzonen)');
define('TEXT_DISPLAY_NUMBER_OF_TAX_RATES', 'Angezeigt werden <b>%d</b> bis <b>%d</b> (von insgesamt <b>%d</b> Steuers&auml;tzen)');

+define('TEXT_DISPLAY_NUMBER_OF_WEIGHT_CLASSES', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> weight classes)');

define('TEXT_DISPLAY_NUMBER_OF_ZONES', 'Angezeigt werden <b>%d</b> bis <b>%d</b> (von insgesamt <b>%d</b> Bundesl&auml;ndern)');

define('PREVNEXT_BUTTON_PREV', '&lt;&lt;');

----------

admin /admin /includes /languages /english

weight_classes.php added at 1.1

diff -N weight_classes.php
--- /dev/null Thu Apr 15 18:06:43 2004
+++ /tmp/cvsAAAtGa45b Thu Apr 15 18:06:44 2004
@@ -0,0 +1,34 @@

+<?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', 'Weight Classes');
+
+define('TABLE_HEADING_WEIGHT_CLASSES_TITLE', 'Description');
+define('TABLE_HEADING_WEIGHT_CLASSES_LANGUAGE', 'Language');
+define('TABLE_HEADING_WEIGHT_CLASSES_UNIT', 'Unit');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('CATEGORY_WEIGHT_RULES', 'Weight Class Rules For');
+
+define('TEXT_INFO_EDIT_INTRO', 'Please make any necessary changes');
+define('TEXT_INFO_WEIGHT_CLASS_TITLE', 'Weight Class Title / Unit:');
+define('TEXT_INFO_CLASS_DESCRIPTION', 'Title:');
+define('TEXT_INFO_INSERT_INTRO', 'Please enter the new weight class with its related data');
+define('TEXT_INFO_DELETE_INTRO', 'Are you sure you want to delete this weight class?');
+define('TEXT_INFO_HEADING_NEW_WEIGHT_CLASS', 'New Weight Class');
+define('TEXT_INFO_HEADING_EDIT_WEIGHT_CLASS', 'Edit Weight Class');
+define('TEXT_INFO_HEADING_DELETE_WEIGHT_CLASS', 'Delete Weight Class');
+define('TEXT_INFO_HEADING_EDIT_WEIGHT_RULES', 'Conversion Rules');
+
+define('ERROR_REMOVE_DEFAULT_WEIGHT_CLASS', 'Error: The default weight class can not be removed. Please set another weight_class as default, and try again.');
+
+?>

----------

admin /admin /includes /languages /espanol

weight_classes.php added at 1.1

diff -N weight_classes.php
--- /dev/null Thu Apr 15 18:06:44 2004
+++ /tmp/cvsAAAHMaW6b Thu Apr 15 18:06:44 2004
@@ -0,0 +1,34 @@

+<?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', 'Weight Classes');
+
+define('TABLE_HEADING_WEIGHT_CLASSES_TITLE', 'Description');
+define('TABLE_HEADING_WEIGHT_CLASSES_LANGUAGE', 'Language');
+define('TABLE_HEADING_WEIGHT_CLASSES_UNIT', 'Unit');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('CATEGORY_WEIGHT_RULES', 'Weight Class Rules For');
+
+define('TEXT_INFO_EDIT_INTRO', 'Please make any necessary changes');
+define('TEXT_INFO_WEIGHT_CLASS_TITLE', 'Weight Class Title / Unit:');
+define('TEXT_INFO_CLASS_DESCRIPTION', 'Title:');
+define('TEXT_INFO_INSERT_INTRO', 'Please enter the new weight class with its related data');
+define('TEXT_INFO_DELETE_INTRO', 'Are you sure you want to delete this weight class?');
+define('TEXT_INFO_HEADING_NEW_WEIGHT_CLASS', 'New Weight Class');
+define('TEXT_INFO_HEADING_EDIT_WEIGHT_CLASS', 'Edit Weight Class');
+define('TEXT_INFO_HEADING_DELETE_WEIGHT_CLASS', 'Delete Weight Class');
+define('TEXT_INFO_HEADING_EDIT_WEIGHT_RULES', 'Conversion Rules');
+
+define('ERROR_REMOVE_DEFAULT_WEIGHT_CLASS', 'Error: The default weight class can not be removed. Please set another weight_class as default, and try again.');
+
+?>

----------

admin /admin /includes /languages /german

weight_classes.php added at 1.1

diff -N weight_classes.php
--- /dev/null Thu Apr 15 18:06:45 2004
+++ /tmp/cvsAAA3Ua47b Thu Apr 15 18:06:45 2004
@@ -0,0 +1,34 @@

+<?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', 'Weight Classes');
+
+define('TABLE_HEADING_WEIGHT_CLASSES_TITLE', 'Description');
+define('TABLE_HEADING_WEIGHT_CLASSES_LANGUAGE', 'Language');
+define('TABLE_HEADING_WEIGHT_CLASSES_UNIT', 'Unit');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('CATEGORY_WEIGHT_RULES', 'Weight Class Rules For');
+
+define('TEXT_INFO_EDIT_INTRO', 'Please make any necessary changes');
+define('TEXT_INFO_WEIGHT_CLASS_TITLE', 'Weight Class Title / Unit:');
+define('TEXT_INFO_CLASS_DESCRIPTION', 'Title:');
+define('TEXT_INFO_INSERT_INTRO', 'Please enter the new weight class with its related data');
+define('TEXT_INFO_DELETE_INTRO', 'Are you sure you want to delete this weight class?');
+define('TEXT_INFO_HEADING_NEW_WEIGHT_CLASS', 'New Weight Class');
+define('TEXT_INFO_HEADING_EDIT_WEIGHT_CLASS', 'Edit Weight Class');
+define('TEXT_INFO_HEADING_DELETE_WEIGHT_CLASS', 'Delete Weight Class');
+define('TEXT_INFO_HEADING_EDIT_WEIGHT_RULES', 'Conversion Rules');
+
+define('ERROR_REMOVE_DEFAULT_WEIGHT_CLASS', 'Error: The default weight class can not be removed. Please set another weight_class as default, and try again.');
+
+?>

CVSspam 0.2.8

-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click