You can subscribe to this list here.
| 2011 |
Jan
|
Feb
|
Mar
(4) |
Apr
(57) |
May
(31) |
Jun
(21) |
Jul
(11) |
Aug
(23) |
Sep
(22) |
Oct
(36) |
Nov
(62) |
Dec
(85) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2012 |
Jan
(24) |
Feb
(24) |
Mar
(65) |
Apr
(232) |
May
(118) |
Jun
(22) |
Jul
(54) |
Aug
(57) |
Sep
(14) |
Oct
(27) |
Nov
(16) |
Dec
(19) |
| 2013 |
Jan
(16) |
Feb
(12) |
Mar
(3) |
Apr
(17) |
May
(2) |
Jun
(30) |
Jul
(33) |
Aug
(19) |
Sep
(35) |
Oct
(58) |
Nov
(27) |
Dec
(64) |
| 2014 |
Jan
(102) |
Feb
(80) |
Mar
(15) |
Apr
(4) |
May
(3) |
Jun
(3) |
Jul
(5) |
Aug
(11) |
Sep
(15) |
Oct
|
Nov
(3) |
Dec
(5) |
| 2015 |
Jan
(5) |
Feb
(4) |
Mar
(2) |
Apr
(11) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(9) |
Nov
(10) |
Dec
|
| 2016 |
Jan
(3) |
Feb
(2) |
Mar
(18) |
Apr
(13) |
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
(4) |
Oct
|
Nov
|
Dec
|
|
From: <os...@us...> - 2013-10-10 15:52:19
|
Revision: 4879
http://sourceforge.net/p/oscss/svn/4879
Author: oscim
Date: 2013-10-10 15:52:16 +0000 (Thu, 10 Oct 2013)
Log Message:
-----------
Upgrade all file for manage classes and class rates; sqlxx , display and fr
Modified Paths:
--------------
trunk/catalog/admin/includes/classes/drivers/sqltax_class.php
trunk/catalog/admin/includes/classes/drivers/sqltax_rates.php
Added Paths:
-----------
trunk/catalog/admin/includes/gabarit/tax_classes/
trunk/catalog/admin/includes/gabarit/tax_classes/display_view.delete.gab
trunk/catalog/admin/includes/gabarit/tax_classes/display_view.delete.sub.gab
trunk/catalog/admin/includes/gabarit/tax_classes/display_view.edit.gab
trunk/catalog/admin/includes/gabarit/tax_classes/display_view.edit.sub.gab
trunk/catalog/admin/includes/languages/fr_FR/modules/pages/tax_classes.txt
trunk/catalog/admin/includes/modules/pages/tax_classes.php
Removed Paths:
-------------
trunk/catalog/admin/includes/content/tax_classes.central.inc
trunk/catalog/admin/includes/content/tax_classes.top.inc
trunk/catalog/admin/includes/languages/fr_FR/tax_classes.php
Modified: trunk/catalog/admin/includes/classes/drivers/sqltax_class.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqltax_class.php 2013-10-10 12:06:21 UTC (rev 4878)
+++ trunk/catalog/admin/includes/classes/drivers/sqltax_class.php 2013-10-10 15:52:16 UTC (rev 4879)
@@ -12,9 +12,9 @@
@brief manage insert/update/delete in zone tables
*/
+error_reporting(E_ALL);
-
class sqltax_class
implements ModSqlDataDriver{
@@ -38,26 +38,25 @@
public static function create($option){
self::getInstance();
- if(!isset($option['name']))
- return 'name';
$DB=Database::getInstance();
$error = 0 ;
+ $DB->beginTransaction();
$sql_data_array['tax_class_title'] = tep_db_prepare_input($option['title']);
$sql_data_array['tax_class_description'] = (isset($option['description'])) ? tep_db_prepare_input($option['description']) :'NULL';
- if( ! tep_db_perform(TABLE_TAX_CLASS, $sql_data_array) )
+ if( ($res = tep_db_perform(TABLE_TAX_CLASS, $sql_data_array) ) && ! $res )
$error++;
-
if( $error > 0){
$DB->rollbackTransaction();
return false;
}
else{
+ $id = $res->__get('insertId');
$DB->commitTransaction();
- return $res->__get('insertId');
+ return $id;
}
}
@@ -80,8 +79,8 @@
if( strlen(substr($where,3)) < 2)
return false;
- if(isset($option['post']))
- $post = $option['post'];
+ if(isset($option['sqlarray']))
+ $post = $option['sqlarray'];
$DB->beginTransaction();
Modified: trunk/catalog/admin/includes/classes/drivers/sqltax_rates.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqltax_rates.php 2013-10-10 12:06:21 UTC (rev 4878)
+++ trunk/catalog/admin/includes/classes/drivers/sqltax_rates.php 2013-10-10 15:52:16 UTC (rev 4879)
@@ -38,8 +38,8 @@
public static function create($option){
self::getInstance();
- if(!isset($option['name']))
- return 'name';
+ if(!isset($option['class_id']))
+ return false;
$DB=Database::getInstance();
$error = 0 ;
@@ -52,15 +52,18 @@
$sql_data_array['tax_description'] = (isset($option['description'])) ? tep_db_prepare_input($option['description']) :'';
$sql_data_array['date_added'] = 'NOW()';
- $res=tep_db_perform(TABLE_RATES, $sql_data_array);
+ if( ($res = tep_db_perform(TABLE_TAX_RATES, $sql_data_array) ) && ! $res )
+ $error++;
+
if( $error > 0){
$DB->rollbackTransaction();
return false;
}
else{
+ $id = $res->__get('insertId');
$DB->commitTransaction();
- return $res->__get('insertId');;
+ return $id;
}
}
@@ -79,14 +82,14 @@
$where ='';
if(isset($option['id'])) $where .="AND tax_rates_id = '".(int)$option['id']."' ";
- if(isset($option['class_id'])) $sql .="AND tax_class_id = '".(string)tep_db_input($option['class_id'])."' ";
- if(isset($option['zone_id'])) $sql .="AND tax_zone_id = '".(string)tep_db_input($option['zone_id'])."' ";
+ if(isset($option['class_id'])) $where .="AND tax_class_id = '".(string)tep_db_input($option['class_id'])."' ";
+ if(isset($option['zone_id'])) $where .="AND tax_zone_id = '".(string)tep_db_input($option['zone_id'])."' ";
if( strlen(substr($where,3)) < 2)
return false;
- if(isset($option['post']))
- $post = $option['post'];
+ if(isset($option['sqlarray']))
+ $post = $option['sqlarray'];
$DB->beginTransaction();
@@ -94,11 +97,11 @@
if(isset($post['zone_id'])) $sql_data_array['tax_zone_id'] = tep_db_prepare_input($post['zone_id']);
if(isset($post['priority'])) $sql_data_array['tax_priority'] = strtoupper(tep_db_prepare_input($post['priority'])) ;
if(isset($post['rate'])) $sql_data_array['tax_rate'] = strtoupper(tep_db_prepare_input($post['rate']));
- if(isset($post['description'])) $sql_data_array['tax_description'] =(int) tep_db_prepare_input($post['description']);
+ if(isset($post['description'])) $sql_data_array['tax_description'] =(string) tep_db_prepare_input($post['description']);
- if(count($sql_data_array)>=1){
+ if(count($sql_data_array)>0){
$sql_data_array['last_modified'] = 'NOW()';
- if( ! tep_db_perform(TABLE_RATES, $sql_data_array, 'update' , substr($where,3) ) )
+ if( ! tep_db_perform(TABLE_TAX_RATES, $sql_data_array, 'update' , substr($where,3) ) )
$error++;
}
@@ -138,7 +141,7 @@
$DB=Database::getInstance();
$sql ="";
- if(isset($option['id'])) $where .="AND tax_rates_id = '".(int)$option['id']."' ";
+ if(isset($option['id'])) $sql .="AND tax_rates_id = '".(int)$option['id']."' ";
if(isset($option['class_id'])) $sql .="AND tax_class_id = '".(string)tep_db_input($option['class_id'])."' ";
if(isset($option['zone_id'])) $sql .="AND tax_zone_id = '".(string)tep_db_input($option['zone_id'])."' ";
@@ -147,7 +150,7 @@
return false;
- $sql="SELECT * FROM " . TABLE_RATES . " a ".
+ $sql="SELECT * FROM " . TABLE_TAX_RATES . " a ".
// " LEFT JOIN " . TABLE_IMAGES_USED . " g ON (a.rowid=g.rowid) ".
" WHERE ".substr($sql,3);
@@ -178,20 +181,19 @@
self::getInstance();
$DB=Database::getInstance();
- if(isset($option['id'])) $where .="AND tax_rates_id = '".(int)$option['id']."' ";
+ if(isset($option['id'])) $sql .="AND tax_rates_id = '".(int)$option['id']."' ";
elseif(isset($option['class_id'])) $sql .="AND tax_class_id = '".(string)tep_db_input($option['class_id'])."' ";
elseif(isset($option['zone_id'])) $sql .="AND tax_zone_id = '".(string)tep_db_input($option['zone_id'])."' ";
else
return false;
- $r = $DB->query("SELECT tax_rates_id as id FROM " . TABLE_RATES ." WHERE ". substr($where, 3 ) );
- $ref = $r->fetchAssoc();
+ $DB->query($sql="DELETE FROM " . TABLE_TAX_RATES ." WHERE ". substr($sql, 3 ) );
+ echo $sql ;
+ exit;
- $DB->query("DELETE FROM " . TABLE_RATES ." WHERE ". substr($where, 3 ) );
-
return true;
}
Deleted: trunk/catalog/admin/includes/content/tax_classes.central.inc
===================================================================
--- trunk/catalog/admin/includes/content/tax_classes.central.inc 2013-10-10 12:06:21 UTC (rev 4878)
+++ trunk/catalog/admin/includes/content/tax_classes.central.inc 2013-10-10 15:52:16 UTC (rev 4879)
@@ -1,203 +0,0 @@
-<?php
-/**
- @licence GPL 2005-2010 The osCSS developers - osCSS Open Source E-commerce
- @portion code Copyright (c) 2002 osCommerce
- @package osCSS-2 <www http://www.oscss.org>
- @version 2.1.0
- @date 18/12/10, 11:21
- @author oscim <mail aur...@os...> <www http://www.oscim.fr>
- @encode UTF-8
-*/
-?>
-<h3><?php echo HEADING_TITLE; ?></h3>
-<!-- body //-->
-
-<!-- body_text //-->
-
-<?php if ($action == 'list') { /** LISTE ENFANT ZONE */ ?>
-<h4><?php echo HEADING_TITLE_T; ?></h4>
-<div class="button_nav">
- <?php echo '<a class="button" href="' . tep_href_link(FILENAME_TAX_CLASSES, tep_get_all_get_params(array('saction')) . 'saction=new') . '">' . IMAGE_NEW_TAX_RATE . '</a>'; ?>
- <?php echo '<a class="button" href="' . tep_href_link(FILENAME_TAX_CLASSES, tep_get_all_get_params(array('action','saction')) ) . '">' . IMAGE_BACK . '</a>'; ?>
-</div>
-<div class="box_left">
- <table width="100%" class="dataTable">
- <thead>
- <tr>
- <th><?php echo TABLE_HEADING_TAX_RATE_PRIORITY; ?></th>
- <th><?php echo TABLE_HEADING_TAX_CLASS_TITLE; ?></th>
- <th><?php echo TABLE_HEADING_ZONE; ?></th>
- <th><?php echo TABLE_HEADING_TAX_RATE; ?></th>
- <th><?php echo TABLE_HEADING_ACTION; ?></th>
- </tr>
- </thead>
- <tfoot>
- <tr>
- <td colspan="2"><?php echo $rates_split->display_count($rates_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $_GET['page'], TEXT_DISPLAY_NUMBER_OF_TAX_RATES); ?></td>
- <td><?php ?></td>
- <td colspan="2" class="tright"><?php echo $rates_split->display_links($rates_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $_GET['page']); ?></td>
- </tr>
- </tfoot>
- <?php foreach($list_c as $rates) { ?>
- <tr class="view parent dataTableRow <?php if($rates['tax_rates_id'] ==$trID) echo "Selected"; ?>">
- <td><?php echo $rates['tax_priority']; ?></td>
- <td><?php echo $rates['tax_class_title']; ?></td>
- <td><?php echo $rates['geo_zone_name']; ?></td>
- <td><?php echo tep_display_tax_value($rates['tax_rate']); ?>%</td>
- <td>
- <span class="view fils fleft">
- <?php
- echo '<a class="buttonimg" href="' . tep_href_link(FILENAME_TAX_CLASSES, tep_get_all_get_params(array('saction','trID')). 'trID=' . $rates['tax_rates_id'] . '&saction=edit').'">' . tep_image(DIR_WS_ICONS . 'icon_edit.png',IMAGE_EDIT). '</a>'
- .'<a class="buttonimg" href="' . tep_href_link(FILENAME_TAX_CLASSES, tep_get_all_get_params(array('saction','trID')). 'trID=' . $rates['tax_rates_id'] . '&saction=delete') . '">' . tep_image(DIR_WS_ICONS . 'icon_delete.png',IMAGE_DELETE).'</a>';
- ?></span>
- <span class="fright"><?php
- if (isset($trInfo) && is_object($trInfo) && ($rates['tax_rates_id'] == $trInfo->tax_rates_id)) { echo tep_image(DIR_WS_ICONS . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link(FILENAME_TAX_CLASSES, tep_get_all_get_params(array('saction','trID')). 'trID=' . $rates['tax_rates_id']) . '">' . tep_image(DIR_WS_ICONS . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>
- </span>
- </td>
- </tr>
- <?php } ?>
- </table>
-</div>
-
-
-<?php } else { /** LISTE ZONE */?>
-<h4><?php echo HEADING_TITLE_C; ?></h4>
- <div class="button_nav"><?php echo '<a class="button" href="' . tep_href_link(FILENAME_TAX_CLASSES, 'page=' . $page . '&action=new') . '">' . IMAGE_NEW_TAX_CLASS . '</a>'; ?></div>
- <div class="box_left">
- <table width="100%" class="dataTable">
- <thead>
- <tr>
- <th><?php echo TABLE_HEADING_TAX_CLASSES; ?></th>
- <th><?php echo TABLE_HEADING_ACTION; ?></th>
- </tr>
- </thead>
- <tfoot>
- <tr>
- <td><?php echo $classes_split->display_count($classes_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $page, TEXT_DISPLAY_NUMBER_OF_TAX_CLASSES); ?></td>
- <td><?php echo $classes_split->display_links($classes_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $page); ?></td>
- </tr>
- </tfoot>
- <tbody>
- <?php foreach($list_c as $classes) { ?>
- <tr class=" view parent dataTableRow <?php if($tID == $classes['tax_class_id']) echo "Selected"; ?>" >
- <td><?php echo $classes['tax_class_title']; ?></td>
- <td style="width:100px">
- <span class="view fils fleft">
- <?php
- echo '<a href="' . tep_href_link(FILENAME_TAX_CLASSES, tep_get_all_get_params(array('action','tID')). 'tID=' . $classes['tax_class_id'] . '&action=list') . '">' . tep_image(DIR_WS_ICONS . 'icon_plus.gif', ICON_FOLDER) . '</a> ';
- echo '<a class="buttonimg" href="' . tep_href_link(FILENAME_TAX_CLASSES, tep_get_all_get_params(array('action','tID')). 'tID=' . $classes['tax_class_id'] . '&action=edit') . '">' . tep_image(DIR_WS_ICONS . 'icon_edit.png',IMAGE_EDIT ). '</a>'
- .'<a class="buttonimg" href="' . tep_href_link(FILENAME_TAX_CLASSES, tep_get_all_get_params(array('action','tID')). 'tID=' . $classes['tax_class_id']. '&action=delete') . '">' . tep_image(DIR_WS_ICONS . 'icon_delete.png',IMAGE_DELETE).'</a>'; ?>
- </span>
- <span class="fright">
- <?php
- if (isset($tcInfo) && is_object($tcInfo) && ($classes['tax_class_id'] == $tcInfo->tax_class_id)) { echo tep_image(DIR_WS_ICONS . 'icon_arrow_right.gif', ''); }
- else { echo '<a href="' . tep_href_link(FILENAME_TAX_CLASSES, tep_get_all_get_params(array('action','tID')). 'tID=' . $classes['tax_class_id']) . '">' . tep_image(DIR_WS_ICONS . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>
- </span>
- </td>
- </tr>
- <?php } ?>
- </tbody>
- </table>
-</div>
-
-<?php } ?>
-
-<?php
- $heading = array();
- $contents = array();
-if($action=='list') {
- switch ($saction) {
- case 'new':
- $heading[] = array('text' => TEXT_INFO_HEADING_NEW_TAX_RATE );
-
- $contents = array('form' => tep_draw_form('rates', FILENAME_TAX_CLASSES, tep_get_all_get_params(array('saction')). '&saction=insert'));
- $contents[] = array('text' => TEXT_INFO_INSERT_INTRO);
- $contents[] = array('class' => 'block_input','text' => TEXT_INFO_CLASS_TITLE . tep_tax_classes_pull_down('name="tax_class_id" style="font-size:10px"'));
- $contents[] = array('class' => 'block_input','text' => TEXT_INFO_ZONE_NAME . tep_geo_zones_pull_down('name="tax_zone_id" style="font-size:10px"',1));
- $contents[] = array('class' => 'block_input','text' => TEXT_INFO_TAX_RATE . tep_draw_input_field('tax_rate'));
- $contents[] = array('class' => 'block_input','text' => TEXT_INFO_RATE_DESCRIPTION . tep_draw_input_field('tax_description'));
- $contents[] = array('class' => 'block_input','text' => TEXT_INFO_TAX_RATE_PRIORITY . tep_draw_input_field('tax_priority'));
- $contents[] = array('class' => 'button_nav', 'text' => tep_image_submit('button_insert.gif', IMAGE_INSERT) . ' <a class="button" href="' . tep_href_link(FILENAME_TAX_CLASSES, tep_get_all_get_params(array('saction'))) . '">' . IMAGE_CANCEL . '</a>');
- break;
- case 'edit':
- $heading[] = array('text' => TEXT_INFO_HEADING_EDIT_TAX_RATE );
-
- $contents = array('form' => tep_draw_form('rates', FILENAME_TAX_CLASSES, tep_get_all_get_params(array('saction','trID')). 'trID=' . $trInfo->tax_rates_id . '&saction=save'));
- $contents[] = array('text' => TEXT_INFO_EDIT_INTRO);
- $contents[] = array('class' => 'block_input','text' => TEXT_INFO_CLASS_TITLE . tep_tax_classes_pull_down('name="tax_class_id" style="font-size:10px"', $trInfo->tax_class_id));
- $contents[] = array('class' => 'block_input','text' => TEXT_INFO_ZONE_NAME . tep_geo_zones_pull_down('name="tax_zone_id" style="font-size:10px"', $trInfo->geo_zone_id,1));
- $contents[] = array('class' => 'block_input','text' => TEXT_INFO_TAX_RATE . tep_draw_input_field('tax_rate','', $trInfo->tax_rate));
- $contents[] = array('class' => 'block_input','text' => TEXT_INFO_RATE_DESCRIPTION . tep_draw_input_field('tax_description','', $trInfo->tax_description));
- $contents[] = array('class' => 'block_input','text' => TEXT_INFO_TAX_RATE_PRIORITY . tep_draw_input_field('tax_priority','', $trInfo->tax_priority).tep_draw_hidden_field('tax_rates_id','', $trInfo->tax_rates_id));
- $contents[] = array('class' => 'button_nav', 'text' => tep_image_submit('button_update.gif', IMAGE_UPDATE) . ' <a class="button" href="' . tep_href_link(FILENAME_TAX_CLASSES, tep_get_all_get_params(array('saction','trID')).'trID=' . $trInfo->tax_rates_id) . '">' . IMAGE_CANCEL . '</a>');
- break;
- case 'delete':
- $heading[] = array('text' => TEXT_INFO_HEADING_DELETE_TAX_RATE );
-
- $contents = array('form' => tep_draw_form('rates', FILENAME_TAX_CLASSES, tep_get_all_get_params(array('saction','tID')). 'tID=' . $trInfo->tax_rates_id . '&saction=deleteconfirm'));
- $contents[] = array('text' => TEXT_INFO_DELETE_INTRO);
- $contents[] = array('text' => '<strong>' . $trInfo->tax_class_title . number_format($trInfo->tax_rate, TAX_DECIMAL_PLACES) . '%</strong>');
- $contents[] = array('class' => 'button_nav', 'text' => tep_image_submit('button_delete.gif', IMAGE_DELETE) . ' <a class="button" href="' . tep_href_link(FILENAME_TAX_CLASSES, tep_get_all_get_params(array('saction','trID=')). 'trID=' . $trInfo->tax_rates_id) . '">' . IMAGE_CANCEL . '</a>');
- break;
- default:
- if (isset($trInfo) && is_object($trInfo)) {
- $heading[] = array('text' => $trInfo->tax_class_title );
- $contents[] = array('class' => 'button_nav', 'text' => '<a class="button" href="' . tep_href_link(FILENAME_TAX_CLASSES, tep_get_all_get_params(array('saction','trID')). 'trID=' . $trInfo->tax_rates_id . '&saction=edit') . '">' . IMAGE_EDIT . '</a> <a class="button" href="' . tep_href_link(FILENAME_TAX_CLASSES, tep_get_all_get_params(array('saction','trID')). 'trID=' . $trInfo->tax_rates_id . '&saction=delete') . '">' . IMAGE_DELETE . '</a>');
- $contents[] = array('text' => TEXT_INFO_DATE_ADDED . tep_date_short($trInfo->date_added));
- $contents[] = array('text' => TEXT_INFO_LAST_MODIFIED . tep_date_short($trInfo->last_modified));
- $contents[] = array('text' => TEXT_INFO_RATE_DESCRIPTION . $trInfo->tax_description);
- }
- break;
- }
-} else {
- switch ($action) {
- case 'new':
- $heading[] = array('text' => TEXT_INFO_HEADING_NEW_TAX_CLASS );
-
- $contents = array('form' => tep_draw_form('classes', FILENAME_TAX_CLASSES, 'page=' . $page . '&action=insert'));
- $contents[] = array('text' => TEXT_INFO_INSERT_INTRO);
- $contents[] = array('class' => 'block_input','text' => TEXT_INFO_CLASS_TITLE . tep_draw_input_field('tax_class_title'));
- $contents[] = array('class' => 'block_input','text' => TEXT_INFO_CLASS_DESCRIPTION . tep_draw_input_field('tax_class_description'));
- $contents[] = array('class' => 'button_nav', 'text' => tep_image_submit('button_insert.gif', IMAGE_INSERT) . ' <a class="button" href="' . tep_href_link(FILENAME_TAX_CLASSES, 'page=' . $page) . '">' . IMAGE_CANCEL . '</a>');
- break;
- case 'edit':
- $heading[] = array('text' => TEXT_INFO_HEADING_EDIT_TAX_CLASS );
-
- $contents = array('form' => tep_draw_form('classes', FILENAME_TAX_CLASSES, 'page=' . $page . '&tID=' . $tcInfo->tax_class_id . '&action=save'));
- $contents[] = array('text' => TEXT_INFO_EDIT_INTRO);
- $contents[] = array('class' => 'block_input','text' => TEXT_INFO_CLASS_TITLE . tep_draw_input_field('tax_class_title', '', $tcInfo->tax_class_title));
- $contents[] = array('class' => 'block_input','text' => TEXT_INFO_CLASS_DESCRIPTION . tep_draw_input_field('tax_class_description', '', $tcInfo->tax_class_description));
- $contents[] = array('class' => 'button_nav', 'text' => tep_image_submit('button_update.gif', IMAGE_UPDATE) . ' <a class="button" href="' . tep_href_link(FILENAME_TAX_CLASSES, 'page=' . $page . '&tID=' . $tcInfo->tax_class_id) . '">' . IMAGE_CANCEL . '</a>');
- break;
- case 'delete':
- $heading[] = array('text' => TEXT_INFO_HEADING_DELETE_TAX_CLASS );
-
- $contents = array('form' => tep_draw_form('classes', FILENAME_TAX_CLASSES, 'page=' . $page . '&tID=' . $tcInfo->tax_class_id . '&action=deleteconfirm'));
- $contents[] = array('text' => TEXT_INFO_DELETE_INTRO);
- $contents[] = array('text' => '<strong>' . $tcInfo->tax_class_title . '</strong>');
- $contents[] = array('class' => 'button_nav', 'text' => tep_image_submit('button_delete.gif', IMAGE_DELETE) . ' <a class="button" href="' . tep_href_link(FILENAME_TAX_CLASSES, 'page=' . $page . '&tID=' . $tcInfo->tax_class_id) . '">' . IMAGE_CANCEL . '</a>');
- break;
- default:
- if (isset($tcInfo) && is_object($tcInfo)) {
- $heading[] = array('text' => $tcInfo->tax_class_title );
-
- $contents[] = array('class' => 'button_nav', 'text' => '<a class="button" href="' . tep_href_link(FILENAME_TAX_CLASSES, 'page=' . $page . '&tID=' . $tcInfo->tax_class_id . '&action=edit') . '">' . IMAGE_EDIT . '</a> <a class="button" href="' . tep_href_link(FILENAME_TAX_CLASSES, 'page=' . $page . '&tID=' . $tcInfo->tax_class_id . '&action=delete') . '">' . IMAGE_DELETE . '</a>');
- $contents[] = array('text' => TEXT_INFO_DATE_ADDED . tep_date_short($tcInfo->date_added));
- $contents[] = array('text' => TEXT_INFO_LAST_MODIFIED . tep_date_short($tcInfo->last_modified));
- $contents[] = array('text' => TEXT_INFO_CLASS_DESCRIPTION . $tcInfo->tax_class_description);
- }
- break;
- }
-}
-?>
-<div class="box_right">
-<?php
- if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {
- $box = new box;
- echo $box->infoBox($heading, $contents);
- }
-?>
-</div>
-
-<!-- body_text_eof //-->
-<!-- body_eof //-->
\ No newline at end of file
Deleted: trunk/catalog/admin/includes/content/tax_classes.top.inc
===================================================================
--- trunk/catalog/admin/includes/content/tax_classes.top.inc 2013-10-10 12:06:21 UTC (rev 4878)
+++ trunk/catalog/admin/includes/content/tax_classes.top.inc 2013-10-10 15:52:16 UTC (rev 4879)
@@ -1,101 +0,0 @@
-<?php
-/**
- @licence GPL 2005-2010 The osCSS developers - osCSS Open Source E-commerce
- @portion code Copyright (c) 2002 osCommerce
- @package osCSS-2 <www http://www.oscss.org>
- @version 2.1.0
- @date 18/12/10, 11:21
- @author oscim <mail aur...@os...> <www http://www.oscim.fr>
- @encode UTF-8
-*/
- $saction = (isset($_GET['saction']) ? $_GET['saction'] : '');
- $tID = (isset($_GET['tID']) ? $_GET['tID'] : '');
- $trID = (isset($_GET['trID']) ? $_GET['trID'] : '');
- $page = (isset($page) ? $page : '1');
- $zpage = (isset($_GET['zpage']) ? $_GET['zpage'] : '1');
-
-
- switch ($saction) {
- case 'insert':
- $tax_zone_id = tep_db_prepare_input($_POST['tax_zone_id']);
- $tax_class_id = tep_db_prepare_input($_POST['tax_class_id']);
- $tax_rate = tep_db_prepare_input($_POST['tax_rate']);
- $tax_description = tep_db_prepare_input($_POST['tax_description']);
- $tax_priority = tep_db_prepare_input($_POST['tax_priority']);
- tep_db_query($sql="insert into " . TABLE_TAX_RATES . " (tax_zone_id, tax_class_id, tax_rate, tax_description, tax_priority, date_added) values ('" . (int)$tax_zone_id . "', '" . (int)$tax_class_id . "', '" . tep_db_input($tax_rate) . "', '" . tep_db_input($tax_description) . "', '" . tep_db_input($tax_priority) . "', now())");
- tep_redirect(tep_href_link(FILENAME_TAX_CLASSES, tep_get_all_get_params(array('saction'),false)));
- break;
- case 'save':
- $tax_rates_id = tep_db_prepare_input($_POST['tax_rates_id']);
- $tax_zone_id = tep_db_prepare_input($_POST['tax_zone_id']);
- $tax_class_id = tep_db_prepare_input($_POST['tax_class_id']);
- $tax_rate = tep_db_prepare_input($_POST['tax_rate']);
- $tax_description = tep_db_prepare_input($_POST['tax_description']);
- $tax_priority = tep_db_prepare_input($_POST['tax_priority']);
-
- tep_db_query($sql="update " . TABLE_TAX_RATES . " set tax_rates_id = '" . (int)$tax_rates_id . "', tax_zone_id = '" . (int)$tax_zone_id . "', tax_class_id = '" . (int)$tax_class_id . "', tax_rate = '" . tep_db_input($tax_rate) . "', tax_description = '" . tep_db_input($tax_description) . "', tax_priority = '" . tep_db_input($tax_priority) . "', last_modified = now() where tax_rates_id = '" . (int)$tax_rates_id . "'");
-
- tep_redirect(tep_href_link(FILENAME_TAX_CLASSES, tep_get_all_get_params(array('saction'),false). 'tax_class_id='.$tax_class_id));
- break;
- case 'deleteconfirm':
- $tax_rates_id = tep_db_prepare_input($trID);
-
- tep_db_query("delete from " . TABLE_TAX_RATES . " where tax_rates_id = '" . (int)$tax_rates_id . "'");
-
- tep_redirect(tep_href_link(FILENAME_TAX_CLASSES, tep_get_all_get_params(array('saction','trID'),false)));
- break;
- default:
- $wh=(!empty($tID)? " and tc.tax_class_id = '".$tID."' " :"" );
- $rates_query_raw = "select r.tax_rates_id, z.geo_zone_id, z.geo_zone_name, tc.tax_class_title, tc.tax_class_id, r.tax_priority, r.tax_rate, r.tax_description, r.date_added, r.last_modified from " . TABLE_TAX_CLASS . " tc, " . TABLE_TAX_RATES . " r left join " . TABLE_GEO_ZONES . " z on r.tax_zone_id = z.geo_zone_id where r.tax_class_id = tc.tax_class_id ".$wh." ";
- $rates_split = new splitPageResults($page, MAX_DISPLAY_SEARCH_RESULTS, $rates_query_raw, $rates_query_numrows);
- $rates_query = tep_db_query($rates_query_raw);
- $list_c=array();
- while ($rates = tep_db_fetch_array($rates_query)) {
- if ( (isset($trID) && ($trID == $rates['tax_rates_id']))) {
- $trInfo = new objectInfo($rates);
- }
- $list_c[]=$rates;
- }
- }
-
-
-
- switch ($action) {
- case 'insert':
- $tax_class_title = tep_db_prepare_input($_POST['tax_class_title']);
- $tax_class_description = tep_db_prepare_input($_POST['tax_class_description']);
-
- tep_db_query("insert into " . TABLE_TAX_CLASS . " (tax_class_title, tax_class_description, date_added) values ('" . tep_db_input($tax_class_title) . "', '" . tep_db_input($tax_class_description) . "', now())");
-
- tep_redirect(tep_href_link(FILENAME_TAX_CLASSES));
- break;
- case 'save':
- $tax_class_id = tep_db_prepare_input($_GET['tID']);
- $tax_class_title = tep_db_prepare_input($_POST['tax_class_title']);
- $tax_class_description = tep_db_prepare_input($_POST['tax_class_description']);
-
- tep_db_query("update " . TABLE_TAX_CLASS . " set tax_class_id = '" . (int)$tax_class_id . "', tax_class_title = '" . tep_db_input($tax_class_title) . "', tax_class_description = '" . tep_db_input($tax_class_description) . "', last_modified = now() where tax_class_id = '" . (int)$tax_class_id . "'");
-
- tep_redirect(tep_href_link(FILENAME_TAX_CLASSES, 'page=' . $_GET['page'] . '&tID=' . $tax_class_id));
- break;
- case 'deleteconfirm':
- $tax_class_id = tep_db_prepare_input($tID);
-
- tep_db_query("delete from " . TABLE_TAX_CLASS . " where tax_class_id = '" . (int)$tax_class_id . "'");
-
- tep_redirect(tep_href_link(FILENAME_TAX_CLASSES, 'page=' . $_GET['page']));
- break;
- case 'list':
- break;
- default:
- $classes_query_raw = "select tax_class_id, tax_class_title, tax_class_description, last_modified, date_added from " . TABLE_TAX_CLASS . " order by tax_class_title";
- $classes_split = new splitPageResults($_GET['page'], MAX_DISPLAY_SEARCH_RESULTS, $classes_query_raw, $classes_query_numrows);
- $classes_query = tep_db_query($classes_query_raw);
- $list_c=array();
- while ($classes = tep_db_fetch_array($classes_query)) {
- if ($tID == $classes['tax_class_id']) $tcInfo = new objectInfo($classes);
- $list_c[]=$classes;
- }
- }
-
-?>
\ No newline at end of file
Added: trunk/catalog/admin/includes/gabarit/tax_classes/display_view.delete.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/tax_classes/display_view.delete.gab (rev 0)
+++ trunk/catalog/admin/includes/gabarit/tax_classes/display_view.delete.gab 2013-10-10 15:52:16 UTC (rev 4879)
@@ -0,0 +1,33 @@
+<?php
+/**
+ @licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
+ @portion code Copyright (c) 2002 osCommerce
+ @package osCSS-2 <www http://www.oscss.org>
+ @version 2.1.2
+ @date 10/10/2013, 10:30
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+*/
+?>
+<h3><?php echo __('@tax_classes sub heading title delete classes'); ?></h3>
+
+
+<div class="box_uniq block_form">
+
+
+ <?php echo tep_draw_form('zone', tax_classes::FILENAME, 'action=delete_confirm', 'post') ?>
+
+ <p class="block_input button_nav">
+ <?php
+ echo tep_draw_hidden_field('cID', '', tax_classes::$Id);
+
+ echo tep_image_submit('', IMAGE_DELETE) ;
+ echo tep_js_back(tep_href_link(tax_classes::FILENAME), IMAGE_CANCEL) ;
+ ?>
+ </p>
+ </form>
+ </div>
+
+ <br class="clear" />
+
+</div>
Added: trunk/catalog/admin/includes/gabarit/tax_classes/display_view.delete.sub.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/tax_classes/display_view.delete.sub.gab (rev 0)
+++ trunk/catalog/admin/includes/gabarit/tax_classes/display_view.delete.sub.gab 2013-10-10 15:52:16 UTC (rev 4879)
@@ -0,0 +1,34 @@
+<?php
+/**
+ @licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
+ @portion code Copyright (c) 2002 osCommerce
+ @package osCSS-2 <www http://www.oscss.org>
+ @version 2.1.2
+ @date 10/10/2013, 10:30
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+*/
+?>
+<h3><?php echo __('@tax_classes sub heading title delete tax rate'); ?></h3>
+
+
+<div class="box_uniq block_form">
+
+
+ <?php echo tep_draw_form('zone', tax_classes::FILENAME, 'action=sub_delete_confirm', 'post') ?>
+
+ <p class="block_input button_nav">
+ <?php
+ echo tep_draw_hidden_field('cID', '', tax_classes::$Id);
+ echo tep_draw_hidden_field('sID', '', tax_classes::$sId);
+
+ echo tep_image_submit('', IMAGE_DELETE) ;
+ echo tep_js_back(tep_href_link(tax_classes::FILENAME, tep_get_all_get_params(array('action', 'sID')).'&action=edit'), IMAGE_CANCEL) ;
+ ?>
+ </p>
+ </form>
+ </div>
+
+ <br class="clear" />
+
+</div>
Added: trunk/catalog/admin/includes/gabarit/tax_classes/display_view.edit.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/tax_classes/display_view.edit.gab (rev 0)
+++ trunk/catalog/admin/includes/gabarit/tax_classes/display_view.edit.gab 2013-10-10 15:52:16 UTC (rev 4879)
@@ -0,0 +1,100 @@
+<?php
+/**
+ @licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
+ @portion code Copyright (c) 2002 osCommerce
+ @package osCSS-2 <www http://www.oscss.org>
+ @version 2.1.2
+ @date 10/10/2013, 10:30
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+*/
+?>
+<h3><?php echo __('text info heading edit zone'); ?></h3>
+
+
+
+<div id="tabs">
+
+
+ <ul>
+ <li><a href="#tabs-1"><?php echo __('tax_classes tab classes') ?></a></li>
+ <?php if(tax_classes::$Info->id > 0): ?>
+ <li><a href="#tabs-2"><?php echo __('tax_classes tab rates') ?></a></li>
+ <?php endif; ?>
+ </ul>
+
+
+ <div id="tabs-1" class="tabPage">
+ <p><?php echo __('text info edit zone intro'); ?></p>
+
+
+ <?php echo tep_draw_form('zones', tax_classes::FILENAME, ((tax_classes::$Info->id > 0)?'cID=' . tax_classes::$Info->id . '&action=update' : 'action=insert' ) ) ?>
+
+ <div class="box_form">
+
+ <?php echo tax_classes::DisplayField('title'); ?>
+
+ <?php echo tax_classes::DisplayField('description'); ?>
+
+
+ <fieldset class="block_input">
+ <div class="block_input button_nav" style="width:95%;">
+ <?php
+ echo tep_image_submit('', IMAGE_UPDATE) . tep_image_submit('', IMAGE_UPDATE_AND_CLOSE,' name="up_and_close"' );
+ echo tep_js_back(tep_href_link(tax_classes::FILENAME, '&cID=' . tax_classes::$Info->id ), IMAGE_CANCEL) ;
+ ?>
+ </div>
+ </fieldset>
+
+
+ </div>
+ </form>
+ </div>
+ <?php if(tax_classes::$Info->id > 0): ?>
+ <div id="tabs-2" class="tabPage">
+ <div class="button_nav">
+ <?php echo '<a class="button" href="' . tep_href_link(tax_classes::FILENAME, 'cID=' . tax_classes::$Info->id . '&action=sub_new' ) . '">'.tep_image(DIR_WS_ICONS . 'icon_add_new.png', IMAGE_ICON_INFO).' '. __('image insert new rate') . '</a>'; ?>
+ </div>
+
+ <table class="dataTable">
+ <thead>
+ <tr>
+ <th><?php echo __('tax_classes table heading childs description'); ?></th>
+ <th><?php echo __('tax_classes table heading childs priority'); ?></th>
+ <th><?php echo __('tax_classes table heading childs class'); ?></th>
+ <th><?php echo __('tax_classes table heading childs zone'); ?></th>
+ <th><?php echo __('tax_classes table heading childs taux'); ?></th>
+ <th class="tright"><?php echo __('table heading action'); ?></th>
+ </tr>
+ </thead>
+ <tbody>
+ <?php foreach(tax_classes::$Info->childs as $row): /*print_r($row);*/?>
+ <tr class="view parent dataTableRow">
+ <td><?php echo $row->description; ?></td>
+ <td><?php echo $row->priority; ?></td>
+ <td><?php echo $row->class_id; ?></td>
+ <td><?php echo $row->zone_id; ?></td>
+
+ <td><?php echo tep_display_tax_value($row->rate); ?>%</td>
+ <td>
+ <span class="view fils fleft">
+ <?php
+ echo '<a class="buttonimg" href="' . tep_href_link(FILENAME_TAX_CLASSES, tep_get_all_get_params(array('action','sID')). 'sID=' . $row->rates_id . '&action=sub_edit').'">' . tep_image(DIR_WS_ICONS . 'icon_edit.png',IMAGE_EDIT). '</a>'
+ .'<a class="buttonimg" href="' . tep_href_link(FILENAME_TAX_CLASSES, tep_get_all_get_params(array('action','sID')). 'sID=' . $row->rates_id . '&action=sub_delete') . '">' . tep_image(DIR_WS_ICONS . 'icon_delete.png',IMAGE_DELETE).'</a>';
+ ?></span>
+ </td>
+ </tr>
+ <?php endforeach; ?>
+ </tbody>
+ </table>
+
+
+ <?php endif; ?>
+
+ </div>
+
+
+ <br class="clear" />
+
+
+</div>
\ No newline at end of file
Added: trunk/catalog/admin/includes/gabarit/tax_classes/display_view.edit.sub.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/tax_classes/display_view.edit.sub.gab (rev 0)
+++ trunk/catalog/admin/includes/gabarit/tax_classes/display_view.edit.sub.gab 2013-10-10 15:52:16 UTC (rev 4879)
@@ -0,0 +1,55 @@
+<?php
+/**
+ @licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
+ @portion code Copyright (c) 2002 osCommerce
+ @package osCSS-2 <www http://www.oscss.org>
+ @version 2.1.2
+ @date 10/10/2013, 10:30
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+*/
+?>
+<h3><?php echo __('@tax_classes sub heading title edit tax rate'); ?></h3>
+
+
+<div class="box_uniq block_form">
+
+
+ <?php echo tep_draw_form('zone', tax_classes::FILENAME, 'action='.((tax_classes::$action == 'sub_new')? 'sub_insert' : 'sub_update'), 'post') ?>
+
+
+ <p class="block_input">
+ <Label><?php echo __('@tax_classes sub text info zone name') ?></label>
+ <?php echo tep_geo_zones_pull_down('name="tax_zone_id" style="font-size:10px"', tax_classes::$Info->zone_id,1) ?>
+ </p>
+
+ <p class="block_input">
+ <Label><?php echo __('@tax_classes sub text info zone tax rate') ?></label>
+ <?php echo tep_draw_input_field('tax_rate','', tax_classes::$Info->rate) ?>
+ </p>
+
+ <p class="block_input">
+ <Label><?php echo __('@tax_classes sub text info zone tax decsription') ?></label>
+ <?php echo tep_draw_input_field('tax_description','', tax_classes::$Info->description) ?>
+ </p>
+
+ <p class="block_input">
+ <Label><?php echo __('@tax_classes sub text info tax priority') ?></label>
+ <?php echo tep_draw_input_field('tax_priority','', tax_classes::$Info->priority) ?>
+ </p>
+
+ <p class="block_input button_nav">
+ <?php
+ echo tep_draw_hidden_field('cID', '', tax_classes::$Id);
+ echo tep_draw_hidden_field('sID', '', tax_classes::$sId);
+
+ echo tep_image_submit('', IMAGE_UPDATE) ;
+ echo tep_js_back(tep_href_link(tax_classes::FILENAME, tep_get_all_get_params(array('action', 'sID')).'&action=edit'), IMAGE_CANCEL) ;
+ ?>
+ </p>
+ </form>
+ </div>
+
+ <br class="clear" />
+
+</div>
Added: trunk/catalog/admin/includes/languages/fr_FR/modules/pages/tax_classes.txt
===================================================================
--- trunk/catalog/admin/includes/languages/fr_FR/modules/pages/tax_classes.txt (rev 0)
+++ trunk/catalog/admin/includes/languages/fr_FR/modules/pages/tax_classes.txt 2013-10-10 15:52:16 UTC (rev 4879)
@@ -0,0 +1,76 @@
+<?php
+/**
+ @licence GPL 2005-2010 The osCSS developers - osCSS Open Source E-commerce
+ @portion code Copyright (c) 2002 osCommerce
+ @package osCSS-2 <www http://www.oscss.org>
+ @version 2.1.0
+ @date 18/09/10, 19:19
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+*/
+$lang['heading title tax_classes']="Manager des plugins de template" ;
+
+/* listing */
+ $lang['tax_classes table heading id']="Id" ;
+ $lang['tax_classes table heading address format']="Format adresse" ;
+ $lang['tax_classes table heading title']="Titre" ;
+ $lang['tax_classes table heading description']="Description" ;
+ $lang['tax_classes table heading added']="Ajouté" ;
+ $lang['tax_classes table heading modified']="Modifié" ;
+ $lang['tax_classes table heading status']="Statut" ;
+ $lang['@tax_classes table heading action']="Action" ;
+
+ $lang['image add tax_classes']="Ajouter une classe" ;
+
+/* edit / new */
+ $lang['image insert new rate']="Ajout d'un taux" ;
+
+ $lang['text info heading edit zone']="Edition" ;
+ $lang['tax_classes tab classes']="Classes" ;
+ $lang['tax_classes tab rates']="Taux" ;
+ /* tax_classes */
+ /* tab speci */
+ $lang['tax_classes table heading childs priority']="Priorité" ;
+ $lang['tax_classes table heading childs class']="Classes" ;
+ $lang['tax_classes table heading childs zone']="Zone" ;
+ $lang['tax_classes table heading childs taux']="Taux" ;
+ $lang['table heading action']="Action" ;
+ $lang['tax_classes table heading childs description']="Description" ;
+
+ /* tab listing sub zone */
+
+ /* zone */
+ $lang['@tax_classes sub heading title edit tax rate']="Edition d'un taux" ;
+ $lang['@tax_classes sub text info zone name']="Zone" ;
+ $lang['@tax_classes sub text info zone tax rate']="Taux fiscal (%) " ;
+ $lang['@tax_classes sub text info zone tax decsription']="Description" ;
+ $lang['@tax_classes sub text info tax priority']="Priorité (Des taux fiscaux ayant la même priorité sont ajoutés, d'autres sont combinés.)" ;
+
+/* delete */
+ /* tax_classes */
+ $lang['@tax_classes sub heading title delete classes']="Suppresion d'une classes" ;
+// $lang['text info delete tax_classes']="vous souhaitez supprimer ce payset toutes les zones (dept/regions) qui y sont liées " ;
+
+ $lang['@tax_classes sub heading title delete tax rate']="Suppresion d'un taux" ;
+
+ /* zone */
+ $lang['heading title delete zone']="Suppresion d'une zone" ;
+
+
+ $lang['@tax_classes error in insert process']="Erreur lors insertion de la classe" ;
+ $lang['@tax_classes success in insert process']="Insertion de la classe" ;
+ $lang['@tax_classes error in update process']="Erreur lors de la mise à jour" ;
+ $lang['@tax_classes success in update process']="Mise à jour" ;
+ $lang['@tax_classes error in delete process']="Erreur lors de la supression de la classes" ;
+ $lang['@tax_classes success in delete process']="Suppression effectué" ;
+
+ $lang['@tax_classes sub error in insert process']="Erreur lors insertion de la classe" ;
+ $lang['@tax_classes sub success in insert process']="Insertion de la classe" ;
+ $lang['@tax_classes sub error in update process']="Erreur lors de la mise à jour" ;
+ $lang['@tax_classes sub success in update process']="Mise à jour" ;
+ $lang['@tax_classes sub error in delete process']="Erreur lors de la supression de la classes" ;
+ $lang['@tax_classes sub success in delete process']="Suppression effectué" ;
+
+
+
+?>
\ No newline at end of file
Deleted: trunk/catalog/admin/includes/languages/fr_FR/tax_classes.php
===================================================================
--- trunk/catalog/admin/includes/languages/fr_FR/tax_classes.php 2013-10-10 12:06:21 UTC (rev 4878)
+++ trunk/catalog/admin/includes/languages/fr_FR/tax_classes.php 2013-10-10 15:52:16 UTC (rev 4879)
@@ -1,49 +0,0 @@
-<?php
-/**
- @licence GPL 2005-2010 The osCSS developers - osCSS Open Source E-commerce
- @portion code Copyright (c) 2002 osCommerce
- @package osCSS-2 <www http://www.oscss.org>
- @version 2.1.0
- @date 18/12/10, 11:09
- @author oscim <mail aur...@os...> <www http://www.oscim.fr>
- @encode UTF-8
-*/
-define('HEADING_TITLE',"Classes et taux fiscaux" );
-
-define('HEADING_TITLE_C',"Classes fiscales" );
-define('TABLE_HEADING_TAX_CLASSES',"Classes fiscales" );
-define('TABLE_HEADING_ACTION',"Action" );
-define('TEXT_INFO_EDIT_INTRO',"Merci de faire les changements nécessaires" );
-define('TEXT_INFO_CLASS_TITLE',"Titre de la classe fiscale :" );
-define('TEXT_INFO_CLASS_DESCRIPTION',"Description :" );
-define('TEXT_INFO_DATE_ADDED',"Date d'ajout :" );
-define('TEXT_INFO_LAST_MODIFIED',"Dernière modification :" );
-define('TEXT_INFO_INSERT_INTRO',"Merci d'entrer la nouvelle classe fiscale avec ses données liées" );
-define('TEXT_INFO_DELETE_INTRO',"Etes vous sur de vouloir supprimer cette classe fiscale ?" );
-define('TEXT_INFO_HEADING_NEW_TAX_CLASS',"Nouvelle classe fiscale" );
-define('TEXT_INFO_HEADING_EDIT_TAX_CLASS',"Editer classe fiscale" );
-define('TEXT_INFO_HEADING_DELETE_TAX_CLASS',"Supprimer classe fiscale" );
-
-define('HEADING_TITLE_T',"Taux fiscaux" );
-define('TABLE_HEADING_TAX_RATE_PRIORITY',"Priorité" );
-define('TABLE_HEADING_TAX_CLASS_TITLE',"Classe fiscale" );
-define('TABLE_HEADING_COUNTRIES_NAME',"Pays" );
-define('TABLE_HEADING_ZONE',"Zone" );
-define('TABLE_HEADING_TAX_RATE',"Taux fiscaux" );
-define('TEXT_INFO_EDIT_INTRO_T',"Merci de faire les changements nécessaires" );
-define('TEXT_INFO_DATE_ADDED_T',"Date d'ajout :" );
-define('TEXT_INFO_LAST_MODIFIED_T',"Dernière modification :" );
-define('TEXT_INFO_CLASS_TITLE_T',"Titre du taux fiscal :" );
-define('TEXT_INFO_COUNTRY_NAME',"Pays :" );
-define('TEXT_INFO_ZONE_NAME',"Zone :" );
-define('TEXT_INFO_TAX_RATE',"Taux fiscal (%) :" );
-define('TEXT_INFO_TAX_RATE_PRIORITY',"Des taux fiscaux ayant la même priorité sont ajoutés, d'autres sont combinés.<br /><br />Priorité :" );
-define('TEXT_INFO_RATE_DESCRIPTION',"Description :" );
-define('TEXT_INFO_INSERT_INTRO_T',"Merci d'entrer le nouveau taux fiscal avec ses données liées" );
-define('TEXT_INFO_DELETE_INTRO_T',"Etes vous sur de vouloir supprimer ce taux fiscal ?" );
-define('TEXT_INFO_HEADING_NEW_TAX_RATE',"Nouveau taux fiscal" );
-define('TEXT_INFO_HEADING_EDIT_TAX_RATE',"Editer taux fiscal" );
-define('TEXT_INFO_HEADING_DELETE_TAX_RATE',"Supprimer taux fiscal" );
-define('TEXT_DISPLAY_NUMBER_OF_TAX_CLASSES',"Affichage <strong>%d</strong> de <strong>%d</strong> (sur <strong>%d</strong> classes)" );
-define('TEXT_DISPLAY_NUMBER_OF_TAX_RATES',"Affichage <strong>%d</strong> de <strong>%d</strong> (sur <strong>%d</strong> taux)" );
-?>
\ No newline at end of file
Added: trunk/catalog/admin/includes/modules/pages/tax_classes.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/tax_classes.php (rev 0)
+++ trunk/catalog/admin/includes/modules/pages/tax_classes.php 2013-10-10 15:52:16 UTC (rev 4879)
@@ -0,0 +1,684 @@
+<?php if (!defined('HTTP_SERVER')) die('You can not access this file directly!');
+/**
+ @licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
+ @portion code Copyright (c) 2002 osCommerce
+ @package osCSS-2 <www http://www.oscss.org>
+ @version 2.1.2
+ @date 10/10/2013, 10:30
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+ @class tax_classes
+*/
+
+class tax_classes
+ extends ModTwo /// new abstract class for nextgen module
+ implements
+ InterfaceModule,
+ /*IntModTwo, */ /// new interface module for nextgen module
+ ExtModConfig {
+
+ const FILENAME = FILENAME_TAX_CLASSES;
+
+ /**
+ @var int id current classe
+ */
+ public static $Id;
+ /**
+ @var int current rates
+ */
+ public static $sId;
+ /**
+ @var array list code action module
+ */
+ public static $list=array();
+ /**
+ @var bool $dir_ok
+ */
+ public static $dir_ok;
+
+
+ /**
+ class constructor
+ */
+ public function __construct() {
+ self::GetConf();
+ }
+
+
+ /**
+ @brief Load , adjust and define var environement exe for module
+ Is use in module and class abstract for init value config this module
+ */
+ public static function GetConf(){
+ global $languages_id;
+
+ self::$code=__CLASS__;
+
+ self::$action=(isset($_REQUEST['action'])? (string)$_REQUEST['action'] : 'listing' );
+ self::$Id=(isset($_REQUEST['cID'])? (int)$_REQUEST['cID'] : 0 );
+ self::$sId=(isset($_REQUEST['sID'])? (int)$_REQUEST['sID'] : 0 );
+
+
+ /**
+ @remarks not load if not first init
+ */
+ if(!defined('JSONSTATMENT')){
+
+ if(self::$action =='' || self::$action =='listing')
+ //! active datatable in ajax, precise les GET necessaire
+ define('JSONSTATMENT', 'ModTwo=true&mod=page&type='.self::$code.
+ (isset(parent::$action)?'&action='.parent::$action : '' ).
+ (isset(self::$Id)?'&file='.self::$Id : '' )
+ );
+ }
+
+ MGabCont::SetCurrentName(__CLASS__);
+
+
+
+ /**
+ @remarks define var execution sql in GetDBValue()
+ */
+ self::$InitInfo['adjust']=array(
+ 'languages_id'=>$languages_id,
+ 'page'=>1,
+ 'rowbyp'=>10,
+ 'sOrder'=>'',
+ 'sWhere'=>'',
+ );
+
+
+ /**
+ @remarks this define col theader title, and ajust html code
+ Just for Edit listing
+ */
+ self::$allfields = array();
+
+ self::$allfields['c.tax_class_id'] = array(
+ 'sort'=>true,
+ 'search'=>true,
+ 'alias'=>'id',
+ 'text'=>__('tax_classes table heading id'),
+ 'width'=>'2%',
+ 'class'=>'tcenter',
+ 'default'=>true,
+ );
+ self::$allfields['c.tax_class_title'] = array(
+ 'sort'=>true,
+ 'search'=>true,
+ 'alias'=>'title',
+ 'text'=>__('tax_classes table heading title'),
+ 'width'=>'15%',
+ 'class'=>'tleft',
+ 'default'=>true,
+ 'edit'=>array(
+ 'input_name'=>'title',
+ 'input_size'=>'64',
+ 'required_status'=>true,
+// 'active_value_language'=>true,
+ ),
+ );
+ self::$allfields['c.tax_class_description'] = array(
+ 'sort'=>true,
+ 'search'=>true,
+ 'alias'=>'description',
+ 'text'=>__('tax_classes table heading description'),
+ 'width'=>'30%',
+ 'class'=>'tleft',
+ 'default'=>true,
+ 'edit'=>array(
+ 'input_name'=>'description',
+ 'input_size'=>'64',
+ 'required_status'=>true,
+// 'active_value_language'=>true,
+ ),
+ );
+
+ self::$allfields['c.date_added'] = array(
+ 'sort'=>true,
+ 'search'=>true,
+ 'alias'=>'added',
+ 'text'=>__('tax_classes table heading added'),
+ 'width'=>'10%',
+ 'class'=>'tcenter',
+ 'default'=>true,
+ );
+ self::$allfields['c.last_modified'] = array(
+ 'sort'=>true,
+ 'search'=>true,
+ 'alias'=>'modified',
+ 'text'=>__('tax_classes table heading modified'),
+ 'width'=>'10%',
+ 'class'=>'tcenter',
+ 'default'=>true,
+ );
+
+
+
+ /// @remarks min fields and not view directly colonne fields
+ $listfield = ' c.tax_class_id as id, ';
+
+ /// @remarks Active forms filter
+ $mutli=array();
+
+ /**
+ @remarks Active forms filter
+ @note
+ array[
+ // For normalised filter define on method ConvertInitVar
+ generic =>
+ array (
+ 'string'
+ // , ....
+ );
+ mod =>
+ array(
+ 'title'=>__('@products filter tab manufacturer'),
+ 'content'=>tep_get_include_contents('manufacturers/filter.manufacturer'),
+ )
+ ]
+ */
+ $tab = array();
+
+ /**
+ @remarks this define menu master module in page
+ @note use $boutons[action][] = array(params)
+
+ params :
+ 'type'=>'getLink',
+ 'format'=>'button_nav',
+ 'image'=>'',
+ 'cssclass'=>'button',
+ 'title'=>__('image create new content'),
+ 'url'=>tep_href_link(self::FILENAME, 'action=new'),
+ */
+ $boutons = array();
+ $boutons['listing'][]=array(
+ 'type'=>'getLink',
+ 'format'=>'button_nav',
+ 'image'=>'',
+ 'cssclass'=>'',
+ 'title'=>__('image add tax_classes'),
+ 'url'=>tep_href_link(self::FILENAME, 'action=new'),
+ );
+
+ /**
+ Call Base Init and construct $InitInfo for process Filter
+ $listfield string list row in db
+ $mutli array action multiple
+ $filter array put list off activate tab filter
+ $boutons array
+ */
+ self::ConvertInitVar( $listfield, $mutli, $tab, $boutons);
+
+ }
+
+
+
+ public function check_action($actions){
+ global $messageStack;
+
+ self::$action=$actions;
+
+ switch (self::$action) {
+ /**
+ @remarks specific save in session value filters
+ */
+ case 'filters':
+ /*
+ Call Prev Process
+ */
+ self::actionFilter();
+
+ tep_redirect(tep_href_link(self::FILENAME));
+ break;
+ case 'update_cell':
+ try {
+
+ $modele = array();
+ foreach(sqltax_class::Specimen(true) as $k=>$row)
+ $modele[] = $k;
+ $params = array();
+ $params['id'] = $_REQUEST['id'];
+
+ if( in_array($_REQUEST['columnName'], $modele) )
+ $params['sqlarray'] = array(
+ $_REQUEST['columnName'] => (isset($_REQUEST['value']) ? tep_db_prepare_input($_REQUEST['value']) : 0)
+ );
+ else{
+ $tab = explode('[', $_REQUEST['columnName']);
+ $final = $tabs2 = array();
+ foreach($tab as $row)
+ $tabs2[] = ( (substr($row,-1)==']')?substr($row,0,-1) : $row );
+
+ $tabs3 = array_reverse($tabs2);
+ $max = count($tabs2);
+ $i=0;
+ foreach($tabs3 as $row){
+ $i++;
+ if($i==1) $final[$row] = (isset($_REQUEST['value']) ? tep_db_prepare_input($_REQUEST['value']) : 0);
+ else
+ $final[$row] = $final;
+ }
+
+ $params['post'] = $final;
+ }
+
+ $params['action']=self::$action;
+
+ $params['language_id']= $languages_id;
+
+ if( sqltax_class::update( $params ) != 1 )
+ throw new Exception(__('@tax_classes error in update process')) ;
+
+ $messageStack->add_session(__('@tax_classes success in update process'), 'success');
+
+ // display value for return
+ echo $_REQUEST['value'];
+ }
+ catch (Exception $e) {
+
+ $messageStack->add_session($e->getMessage() , 'error');
+ }
+ break;
+ case 'setflag':
+ if ( ($_GET['flag'] == '0') || ($_GET['flag'] == '1') ) {
+ $c_id =(int) tep_db_prepare_input($_GET['cID']);
+
+ if ($c_id > 0){
+ $myarray = array('id'=>$c_id, 'post'=>array('visible'=>$_GET['flag']) );
+ if( ! sqltax_class::update($myarray) )
+ $messageStack->add_session(__('@tax_classes error in update process'), 'error');
+ else
+ $messageStack->add_session(__('@tax_classes success in update process'), 'success');
+
+ }
+ }
+
+ if(!isset($_GET['forceajax']))
+ tep_redirect(tep_href_link(self::FILENAME, 'cID=' . $_GET['cID']));
+ break;
+
+
+
+
+ /**
+ Normal page
+ */
+ case 'sub_insert':
+ if (self::$Id > 0){
+ $myarray = array(
+ 'class_id'=>self::$Id,
+ 'zone_id'=>tep_db_prepare_input($_POST['tax_zone_id']),
+ 'rate'=>tep_db_prepare_input($_POST['tax_rate']),
+ 'description'=>tep_db_prepare_input($_POST['tax_description']),
+ 'priority'=>tep_db_prepare_input($_POST['tax_priority']),
+ );
+
+ if( ($c_id = sqltax_rates::create($myarray) ) && $c_id <= 0)
+ $messageStack->add_session(__('@tax_classes sub error in insert process'), 'error');
+ else
+ $messageStack->add_session(__('@tax_classes sub success in insert process'), 'success');
+
+ }
+
+ tep_redirect(tep_href_link(self::FILENAME, 'action=edit&cID=' . self::$Id .'&sID='.$c_id ));
+ break;
+
+ case 'sub_update':
+
+ if (self::$sId > 0){
+ $myarray = array(
+ 'zone_id'=>tep_db_prepare_input($_POST['tax_zone_id']),
+ 'rate'=>tep_db_prepare_input($_POST['tax_rate']),
+ 'description'=>tep_db_prepare_input($_POST['tax_description']),
+ 'priority'=>tep_db_prepare_input($_POST['tax_priority']),
+ );
+
+ if( ! sqltax_rates::update(array('id'=>self::$sId, 'sqlarray'=>$myarray) ))
+ $messageStack->add_session(__('@tax_classes sub error in update process'), 'error');
+ else
+ $messageStack->add_session(__('@tax_classes sub success in update process'), 'success');
+ }
+
+ tep_redirect(tep_href_link(self::FILENAME, 'action=sub_edit&cID=' . self::$Id .'&sID='. self::$sId ));
+ break;
+
+ case 'sub_delete_confirm':
+ if (self::$sId > 0){
+
+ if( ! sqltax_rates::delete(array('id'=>self::$sId )) )
+ $messageStack->add_session(__('@tax_classes sub error in delete process'), 'error');
+ else
+ $messageStack->add_session(__('@tax_classes sub success in delete process'), 'success');
+ }
+
+ tep_redirect(tep_href_link(self::FILENAME, 'action=edit&cID=' . self::$Id ));
+ break;
+
+
+
+ case 'insert':
+
+ $myarray = array(
+ 'title'=>tep_db_prepare_input($_POST['title']),
+ 'description'=>tep_db_prepare_input($_POST['description']),
+ );
+
+ if( ($c_id = sqltax_class::create($myarray) ) && $c_id <= 0)
+ $messageStack->add_session(__('@tax_classes error in insert process'), 'error');
+ else
+ $messageStack->add_session(__('@tax_classes success in insert process'), 'success');
+
+ tep_redirect(tep_href_link(self::FILENAME , 'action=edit&cID=' . (int)$c_id));
+ break;
+
+ case 'update':
+ if (self::$Id > 0){
+ $myarray = array(
+ 'id'=>self::$Id,
+ 'sqlarray'=>array(
+ 'title'=>tep_db_prepare_input($_POST['title']),
+ 'description'=>tep_db_prepare_input($_POST['description']),
+ ),
+ );
+
+ if( !sqltax_class::update($myarray) )
+ $messageStack->add_session(__('@tax_classes error in update process'), 'error');
+ else
+ $messageStack->add_session(__('@tax_classes success in update process'), 'success');
+ }
+
+ tep_redirect(tep_href_link(self::FILENAME, 'action=edit&cID=' . self::$Id ));
+ break;
+
+ case 'delete_confirm':
+
+ if (self::$Id > 0){
+
+ if( ! sqltax_class::delete(array('id'=>self::$Id) ) )
+ $messageStack->add_session(__('@tax_classes error in delete process'), 'error');
+ else
+ $messageStack->add_session(__('@tax_classes success in delete process'), 'success');
+ }
+
+ tep_redirect(tep_href_link(self::FILENAME));
+ break;
+ }
+
+ return self::$action;
+ }
+
+ public function get_header(){
+ }
+
+
+ /**
+ @fn tax_classes::GetDBValue();
+ @brief return DB value adapted for current action
+ Use self::action for determine switch
+ @return
+ */
+ public static function GetDBValue(){
+
+ $DB= Database::getInstance();
+
+ switch (self::$action) {
+
+
+ case 'sub_new':
+ return sqltax_rates::Specimen( true);
+ break;
+
+ case 'sub_delete':
+ case 'sub_edit':
+ $res = sqltax_rates::fetch(array('id'=>(int)self::$sId ), true);
+
+ return $res;
+ break;
+
+ case 'delete':
+ case 'edit':
+ case 'new':
+ if( (int)self::$Id > 0) {
+ $res = sqltax_class::fetch(array('id'=>self::$Id ), true);
+ $tp =sqltax_rates::fetch(array('class_id'=>self::$Id ), true);
+
+ if(is_object($tp))
+ $res->childs = array($tp);
+ else
+ $res->childs = $tp;
+ }
+ else{
+ $res = sqltax_class::Specimen(true);
+ $res->childs = array( sqltax_rates::Specimen( true) );
+ }
+
+ return self::FormatDBValue($res);
+ break;
+
+
+ case 'listing':
+ /**
+ @remarks retrun object load one inventaire
+ */
+ global $query_numrows;
+ $adjust=new objectInfo(self::$InitInfo['adjust']);
+
+
+ /**
+ @remarks replace id by name col
+ */
+ if(!empty($adjust->sWhere)) {
+
+ foreach(self::$allfields as $key=>$row){
+ if(is_array($row) && isset($row['alias']) ){
+ $k[] = '#[(]'.$row['alias'].'[)]#i';
+ $k[] = '# '.$row['alias'].' #i';
+ $k[] = '# \.'.$row['alias'].'#i';
+
+ $v[] = '('.$key.')';
+ $v[] = ' '.$key.' ';
+ $v[] = '.'.$key.' ';
+ }
+ }
+
+ if(isset($k))
+ $adjust->sWhere = preg_replace($k,$v, $adjust->sWhere);
+ }
+
+
+ $query_raw = "SELECT ".$adjust->listfields;
+ $query_raw .= " FROM " . TABLE_TAX_CLASS . " c ".
+ ((!empty($adjust->sWhere)) ? " WHERE ".substr($adjust->sWhere, 3) : '').
+ " ORDER BY ".((!empty($adjust->sOrder)) ? $adjust->sOrder : ' tax_class_name ASC ');
+
+ $_split = new splitPageResults($adjust->page, $adjust->rowbyp, $query_raw, $query_numrows);
+ $_query = $DB->query($query_raw);
+
+ $res=self::FormatDBValue($_query);
+
+ return $res;
+ break;
+ }
+ }
+
+
+
+ public function display_view(){
+
+ switch (self::$action) {
+ /**
+ @remarks Ajax View result
+ */
+ case 'update_cell':
+ break;
+ case 'setflag':
+ return self::RowStatus(array('country_visible'=>(int)$_GET['flag'], 'tax_class_id'=>(int)$_GET['cID']));
+ break;
+
+
+ /**
+ @remarks Normal View Page
+ */
+ case 'sub_new':
+ return MGabCont::CallGab('edit.sub',__FUNCTION__,__CLASS__);
+ break;
+ case 'sub_delete':
+ case 'sub_edit':
+ self::$Info= self::GetDBValue();
+ return MGabCont::CallGab(str_replace('sub_','',self::$action).'.sub',__FUNCTION__,__CLASS__);
+ break;
+
+
+ case 'new':
+ $action = 'edit';
+ case 'delete':
+ case 'edit':
+ if(!isset($action))
+ $action = self::$action;
+
+ self::$Info= self::GetDBValue();
+
+ return MGabCont::CallGab($action,__FUNCTION__,__CLASS__);
+ break;
+
+ case 'listing':
+ default:
+ self::$list=self::GetDBValue();
+ /// use master gabarit
+ MGabCont::SetCurrentName(__CLASS__);
+ return MGabCont::CallGab('listing',__FUNCTION__,self::MASTER);
+ }
+ }
+
+
+
+
+ public static function tep_get_list($page=1,$rowbyp=10,$sOrder='',$sWhere='',$options=''){
+ global $query_numrows;
+
+ /// @remarks force load conf
+ self::GetConf();
+
+ $res=array();
+
+ /**
+ @remarks adjust param for sql requete
+ */
+ self::$InitInfo['adjust']['page']=$page;
+ self::$InitInfo['adjust']['rowbyp']=$rowbyp;
+ self::$InitInfo['adjust']['sOrder'].=$sOrder;
+ self::$InitInfo['adjust']['sWhere'].=$sWhere;
+ self::$InitInfo['adjust']['options']=$options;
+
+ $res = self::GetDBValue();
+
+ self::$list= $query_numrows ;
+
+ return $res;
+ }
+
+
+ /** public static InterfacedTJsonS */
+
+ /**
+ @brief format db value for display page
+ @param $_query ressource db sql
+ @return array
+ */
+ private static function FormatDBValue($_query){
+ $DB=Database::getInstance();
+ $res=array();
+
+ switch (parent::$action) {
+
+ case 'listing':
+ global $query_numrows,$languages_id;
+
+ while ($item = $_query->fetchAssoc()) {
+
+ foreach(self::$InitInfo['modele']['listing'] as $k=>$row)
+ if($k == 'action') $ord[$k]=self::ButtonRowsActions($item);
+ elseif($k == 'visible') $ord[$k]=self::RowStatus($item);
+ else $ord[$k]=$item[...
[truncated message content] |
|
From: <os...@us...> - 2013-10-10 12:06:24
|
Revision: 4878
http://sourceforge.net/p/oscss/svn/4878
Author: oscim
Date: 2013-10-10 12:06:21 +0000 (Thu, 10 Oct 2013)
Log Message:
-----------
Add class sqlxxx for tax_class and rates
Added Paths:
-----------
trunk/catalog/admin/includes/classes/drivers/sqltax_class.php
trunk/catalog/admin/includes/classes/drivers/sqltax_rates.php
Added: trunk/catalog/admin/includes/classes/drivers/sqltax_class.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqltax_class.php (rev 0)
+++ trunk/catalog/admin/includes/classes/drivers/sqltax_class.php 2013-10-10 12:06:21 UTC (rev 4878)
@@ -0,0 +1,230 @@
+<?php if (!defined('HTTP_SERVER')) die('You can not access this file directly!');
+/**
+ @licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
+ @portion code Copyright (c) 2002 osCommerce
+ @package osCSS-2 <www http://www.oscss.org>
+ @version 2.1.2
+ @date 10/10/2013, 10:30
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+ @class sqltax_class
+ @file sqltax_class.php
+ @brief manage insert/update/delete in zone tables
+*/
+
+
+
+
+class sqltax_class
+ implements ModSqlDataDriver{
+
+ public static $modules;
+
+ protected static $_instance;
+
+ protected function __construct(){
+ }
+
+
+ public static function getInstance() {
+ if(self::$_instance == null) self::$_instance = new self();
+ return self::$_instance;
+ }
+
+
+ /**
+ @brief create new ligne in table configuration
+ */
+ public static function create($option){
+ self::getInstance();
+
+ if(!isset($option['name']))
+ return 'name';
+
+ $DB=Database::getInstance();
+ $error = 0 ;
+
+ $sql_data_array['tax_class_title'] = tep_db_prepare_input($option['title']);
+ $sql_data_array['tax_class_description'] = (isset($option['description'])) ? tep_db_prepare_input($option['description']) :'NULL';
+
+ if( ! tep_db_perform(TABLE_TAX_CLASS, $sql_data_array) )
+ $error++;
+
+
+ if( $error > 0){
+ $DB->rollbackTransaction();
+ return false;
+ }
+ else{
+ $DB->commitTransaction();
+ return $res->__get('insertId');
+ }
+ }
+
+ /**
+ @brief update ligne in table configuration
+ */
+ public static function update($option){
+ self::getInstance();
+
+ if(!isset($option['id']))
+ return 'id';
+
+ $DB=Database::getInstance();
+ $error = 0 ;
+ $sql_data_array =array();
+
+ $where ='';
+ if(isset($option['id'])) $where .="AND tax_class_id = '".(int)$option['id']."' ";
+
+ if( strlen(substr($where,3)) < 2)
+ return false;
+
+ if(isset($option['post']))
+ $post = $option['post'];
+
+ $DB->beginTransaction();
+
+ if(isset($post['title']))$sql_data_array['tax_class_title'] = tep_db_prepare_input($post['title']);
+ if(isset($post['description'])) $sql_data_array['tax_class_description'] = tep_db_prepare_input($post['description']);
+
+
+ if(count($sql_data_array)>=1){
+ $sql_data_array['last_modified'] = 'NOW()';
+
+ if( ! tep_db_perform(TABLE_TAX_CLASS, $sql_data_array, 'update' , substr($where,3) ) )
+ $error++;
+ }
+
+ if( $error > 0){
+ $DB->rollbackTransaction();
+ return false;
+ }
+ else{
+ $DB->commitTransaction();
+ return 1;
+ }
+ }
+
+ /**
+ @brief load ligne in table configuration
+ @param option array
+ id => row id int (configuration_id)
+ key => string key (configuration_key)
+ group_id => group_id int (configuration_group_id)
+ @param $shortkey use cleankey for return short key
+ @return
+
+ object(stdClass)[13]
+ public 'id' => string '1' (length=1)
+
+ OR
+ array(
+ object(stdClass)[13]
+ ...
+ object(stdClass)[13]
+ ..
+ )
+
+ */
+ public static function fetch($option,$shortkey=false){
+ self::getInstance();
+ $DB=Database::getInstance();
+
+ $sql ="";
+ if(isset($option['id'])) $sql .="AND tax_class_id = '".(int)$option['id']."' ";
+
+
+ if($sql=='')
+ return false;
+
+
+ $sql="SELECT * FROM " . TABLE_TAX_CLASS . " a ".
+ " WHERE ".substr($sql,3);
+
+ $res=$DB->query($sql);
+
+ $num = $res->__get('numRows');
+
+ if($num == 1){
+ $result=$res->fetchAssoc();
+ return ((!$shortkey)? $result : self::CleanKey($result));
+ }
+ elseif($num > 1){
+ $array=array();
+
+ foreach($res->fetchAllAssoc() as $result)
+ $array[]= ((!$shortkey)? $result : self::CleanKey($result));
+
+ return $array;
+ }
+
+ return false;
+ }
+
+ /**
+ @brief delete row
+ */
+ public static function delete($option){
+ self::getInstance();
+ $DB=Database::getInstance();
+
+ if(isset($option['id'])) $where .="AND tax_class_id = '".(int)$option['id']."' ";
+
+ else
+ return false;
+
+
+ $r = $DB->query("SELECT tax_class_id as id FROM " . TABLE_TAX_CLASS ." WHERE ". substr($where, 3 ) );
+ $ref = $r->fetchAssoc();
+
+ /// delete depend
+ sqltax_rates::delete(array('tax_class_id'=>(int)$ref['id']));
+
+
+ $DB->query("DELETE FROM " . TABLE_TAX_CLASS ." WHERE ". substr($where, 3 ) );
+
+
+ return true;
+ }
+
+
+ /**
+ @brief
+ @return array product empty
+ */
+ public static function Specimen($shortkey=false){
+ $par = array(
+ 'tax_class_id' => '',
+ 'tax_class_title' => '',
+ 'tax_class_description' => '',
+ );
+
+ return ((!$shortkey)? $par : self::CleanKey($par));
+ }
+
+
+
+ /**
+ @fn CleanKey()
+ @brief Clean string name key
+ */
+ private static function CleanKey($array){
+ self::getInstance();
+ $object= new stdclass();
+
+ foreach($array as $key=>$value){
+ if( strpos($key,'tax_class_') ===0)
+ $key=substr($key,strlen('tax_class_'));
+
+
+ $object->$key = $value;
+ }
+
+ return $object;
+ }
+
+}
+
+
+?>
\ No newline at end of file
Added: trunk/catalog/admin/includes/classes/drivers/sqltax_rates.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqltax_rates.php (rev 0)
+++ trunk/catalog/admin/includes/classes/drivers/sqltax_rates.php 2013-10-10 12:06:21 UTC (rev 4878)
@@ -0,0 +1,242 @@
+<?php if (!defined('HTTP_SERVER')) die('You can not access this file directly!');
+/**
+ @licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
+ @portion code Copyright (c) 2002 osCommerce
+ @package osCSS-2 <www http://www.oscss.org>
+ @version 2.1.2
+ @date 10/10/2013, 10:30
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+ @class sqltax_rates
+ @file sqltax_rates.php
+ @brief manage insert/update/delete in zone tables
+*/
+
+
+
+
+class sqltax_rates
+ implements ModSqlDataDriver{
+
+ public static $modules;
+
+ protected static $_instance;
+
+ protected function __construct(){
+ }
+
+
+ public static function getInstance() {
+ if(self::$_instance == null) self::$_instance = new self();
+ return self::$_instance;
+ }
+
+
+ /**
+ @brief create new ligne in table configuration
+ */
+ public static function create($option){
+ self::getInstance();
+
+ if(!isset($option['name']))
+ return 'name';
+
+ $DB=Database::getInstance();
+ $error = 0 ;
+ $DB->beginTransaction();
+
+ $sql_data_array['tax_class_id'] = (isset($option['class_id'])) ? tep_db_prepare_input($option['class_id']) :'1';
+ $sql_data_array['tax_zone_id'] = (isset($option['zone_id'])) ?strtoupper( tep_db_prepare_input($option['zone_id'])) :'1';
+ $sql_data_array['tax_priority'] = (isset($option['priority'])) ?strtoupper( tep_db_prepare_input($option['priority'])) :'0';
+ $sql_data_array['tax_rate'] = (int) (isset($option['rate'])) ? tep_db_prepare_input($option['rate']) :'0.0000';
+ $sql_data_array['tax_description'] = (isset($option['description'])) ? tep_db_prepare_input($option['description']) :'';
+
+ $sql_data_array['date_added'] = 'NOW()';
+ $res=tep_db_perform(TABLE_RATES, $sql_data_array);
+
+ if( $error > 0){
+ $DB->rollbackTransaction();
+ return false;
+ }
+ else{
+ $DB->commitTransaction();
+ return $res->__get('insertId');;
+ }
+ }
+
+ /**
+ @brief update ligne in table configuration
+ */
+ public static function update($option){
+ self::getInstance();
+
+ if(!isset($option['id']))
+ return 'id';
+
+ $DB=Database::getInstance();
+ $error = 0 ;
+ $sql_data_array =array();
+
+ $where ='';
+ if(isset($option['id'])) $where .="AND tax_rates_id = '".(int)$option['id']."' ";
+ if(isset($option['class_id'])) $sql .="AND tax_class_id = '".(string)tep_db_input($option['class_id'])."' ";
+ if(isset($option['zone_id'])) $sql .="AND tax_zone_id = '".(string)tep_db_input($option['zone_id'])."' ";
+
+ if( strlen(substr($where,3)) < 2)
+ return false;
+
+ if(isset($option['post']))
+ $post = $option['post'];
+
+ $DB->beginTransaction();
+
+ if(isset($post['class_id']))$sql_data_array['tax_class_id'] = tep_db_prepare_input($post['class_id']);
+ if(isset($post['zone_id'])) $sql_data_array['tax_zone_id'] = tep_db_prepare_input($post['zone_id']);
+ if(isset($post['priority'])) $sql_data_array['tax_priority'] = strtoupper(tep_db_prepare_input($post['priority'])) ;
+ if(isset($post['rate'])) $sql_data_array['tax_rate'] = strtoupper(tep_db_prepare_input($post['rate']));
+ if(isset($post['description'])) $sql_data_array['tax_description'] =(int) tep_db_prepare_input($post['description']);
+
+ if(count($sql_data_array)>=1){
+ $sql_data_array['last_modified'] = 'NOW()';
+ if( ! tep_db_perform(TABLE_RATES, $sql_data_array, 'update' , substr($where,3) ) )
+ $error++;
+ }
+
+ if( $error > 0){
+ $DB->rollbackTransaction();
+ return false;
+ }
+ else{
+ $DB->commitTransaction();
+ return 1;
+ }
+ }
+
+ /**
+ @brief load ligne in table configuration
+ @param option array
+ id => row id int (configuration_id)
+ key => string key (configuration_key)
+ group_id => group_id int (configuration_group_id)
+ @param $shortkey use cleankey for return short key
+ @return
+
+ object(stdClass)[13]
+ public 'id' => string '1' (length=1)
+
+ OR
+ array(
+ object(stdClass)[13]
+ ...
+ object(stdClass)[13]
+ ..
+ )
+
+ */
+ public static function fetch($option,$shortkey=false){
+ self::getInstance();
+ $DB=Database::getInstance();
+
+ $sql ="";
+ if(isset($option['id'])) $where .="AND tax_rates_id = '".(int)$option['id']."' ";
+ if(isset($option['class_id'])) $sql .="AND tax_class_id = '".(string)tep_db_input($option['class_id'])."' ";
+ if(isset($option['zone_id'])) $sql .="AND tax_zone_id = '".(string)tep_db_input($option['zone_id'])."' ";
+
+
+ if($sql=='')
+ return false;
+
+
+ $sql="SELECT * FROM " . TABLE_RATES . " a ".
+// " LEFT JOIN " . TABLE_IMAGES_USED . " g ON (a.rowid=g.rowid) ".
+ " WHERE ".substr($sql,3);
+
+ $res=$DB->query($sql);
+
+ $num = $res->__get('numRows');
+
+ if($num == 1){
+ $result=$res->fetchAssoc();
+ return ((!$shortkey)? $result : self::CleanKey($result));
+ }
+ elseif($num > 1){
+ $array=array();
+
+ foreach($res->fetchAllAssoc() as $result)
+ $array[]= ((!$shortkey)? $result : self::CleanKey($result));
+
+ return $array;
+ }
+
+ return false;
+ }
+
+ /**
+ @brief delete row
+ */
+ public static function delete($option){
+ self::getInstance();
+ $DB=Database::getInstance();
+
+ if(isset($option['id'])) $where .="AND tax_rates_id = '".(int)$option['id']."' ";
+ elseif(isset($option['class_id'])) $sql .="AND tax_class_id = '".(string)tep_db_input($option['class_id'])."' ";
+ elseif(isset($option['zone_id'])) $sql .="AND tax_zone_id = '".(string)tep_db_input($option['zone_id'])."' ";
+ else
+ return false;
+
+
+ $r = $DB->query("SELECT tax_rates_id as id FROM " . TABLE_RATES ." WHERE ". substr($where, 3 ) );
+ $ref = $r->fetchAssoc();
+
+
+ $DB->query("DELETE FROM " . TABLE_RATES ." WHERE ". substr($where, 3 ) );
+
+
+ return true;
+ }
+
+
+ /**
+ @brief
+ @return array product empty
+ */
+ public static function Specimen($shortkey=false){
+ $par = array(
+ 'tax_rates_id' => '',
+ 'tax_zone_id' => '',
+ 'tax_class_id' => '',
+ 'tax_priority' => '',
+ 'tax_rate' => '',
+ 'tax_description' => '',
+ 'last_modified' => '',
+ 'date_added' => '',
+ );
+
+ return ((!$shortkey)? $par : self::CleanKey($par));
+ }
+
+
+
+ /**
+ @fn CleanKey()
+ @brief Clean string name key
+ */
+ private static function CleanKey($array){
+ self::getInstance();
+ $object= new stdclass();
+
+ foreach($array as $key=>$value){
+ if( strpos($key,'tax_') ===0)
+ $key=substr($key,strlen('tax_') );
+
+
+ $object->$key = $value;
+ }
+
+ return $object;
+ }
+
+}
+
+
+?>
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2013-10-10 11:32:21
|
Revision: 4877
http://sourceforge.net/p/oscss/svn/4877
Author: oscim
Date: 2013-10-10 11:32:17 +0000 (Thu, 10 Oct 2013)
Log Message:
-----------
Upgrade code nav_links page
Modified Paths:
--------------
trunk/catalog/admin/includes/classes/drivers/sqlnavigation_links.php
trunk/catalog/admin/includes/gabarit/navigation_links/display_view.edit.gab
trunk/catalog/admin/includes/modules/pages/navigation_links.php
Modified: trunk/catalog/admin/includes/classes/drivers/sqlnavigation_links.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlnavigation_links.php 2013-10-10 09:54:26 UTC (rev 4876)
+++ trunk/catalog/admin/includes/classes/drivers/sqlnavigation_links.php 2013-10-10 11:32:17 UTC (rev 4877)
@@ -78,45 +78,60 @@
*/
public static function update($option){
self::getInstance();
+ $DB=Database::getInstance();
+ $error= 0;
if(!isset($option['id']))
return 'id';
+ $DB->beginTransaction();
+
$where ='';
if(isset($option['id'])) $where .="AND nav_link_id = '".(int)$option['id']."' ";
if(isset($option['type'])) $where .="AND nav_link_type = '".(int)$option['type']."' ";
if(isset($option['status'])) $where .="AND nav_link_status = '".(int)$option['status']."' ";
+ if(isset($option['post'])){
+ $post=$option['post'];
+ }
+ if(isset($post['type']))$sql_data_array['nav_link_type'] = tep_db_prepare_input($post['type']);
+ if(isset($post['status']))$sql_data_array['nav_link_status'] = tep_db_prepare_input($post['status']);
- if(isset($option['new_type']))$sql_data_array['nav_link_type'] = tep_db_prepare_input($option['new_type']);
- if(isset($option['new_status']))$sql_data_array['nav_link_status'] = tep_db_prepare_input($option['new_status']);
+ if(isset($post['parent_id'])) $sql_data_array['parent_id'] = (int)tep_db_prepare_input($post['parent_id']);
+ if(isset($post['css_id'])) $sql_data_array['nav_css_id'] = (int)tep_db_prepare_input($post['css_id']);
+ if(isset($post['customers_status'])) $sql_data_array['customers_status'] = (int)tep_db_prepare_input($post['customers_status']);
+ if(isset($post['sort_order'])) $sql_data_array['nav_sort_order'] = (int)tep_db_prepare_input($post['sort_order']);
- if(isset($option['parent_id'])) $sql_data_array['parent_id'] = (int)tep_db_prepare_input($option['parent_id']);
- if(isset($option['css_id'])) $sql_data_array['nav_css_id'] = (int)tep_db_prepare_input($option['css_id']);
- if(isset($option['restrict'])) $sql_data_array['customers_status'] = (int)tep_db_prepare_input($option['restrict']);
+ if(count((array)$sql_data_array)> 0)
+ if( ! tep_db_perform(TABLE_NAVIGATION_LINKS, $sql_data_array, 'update' , substr($where,3) ) )
+ $error++;
- if(count((array)$sql_data_array)<= 0)
- return false;
- $res=tep_db_perform(TABLE_NAVIGATION_LINKS, $sql_data_array, 'update' , substr($where,3) );
-
-
foreach(tep_get_languages() as $lg) {
$row = $option['langue'];
$where_lg .= $where. "AND language_id = '".(int)$lg['id']."' ";
+ $sql_data_array = array();
+ if(isset($row['title'][$lg['id']]))
+ $sql_data_array['nav_name'] = tep_db_prepare_input($row['title'][$lg['id']]) ;
- $sql_data_array_lg = array(
- 'nav_name'=> ((isset($row['title'][$lg['id']])) ? tep_db_prepare_input($row['title'][$lg['id']]) : '' ),
- );
+ if(count((array)$sql_data_array)> 0)
+ if( !tep_db_perform(TABLE_NAVIGATION_LINKS_DESCRIPTION, $sql_data_array, 'update' , substr($where_lg,3)) )
+ $error++;
- $res=tep_db_perform(TABLE_NAVIGATION_LINKS_DESCRIPTION, $sql_data_array_lg, 'update' , substr($where_lg,3));
}
- return $res;
+ if( $error > 0){
+ $DB->rollbackTransaction();
+ return false;
+ }
+ else{
+ $DB->commitTransaction();
+ return 1;
+ }
}
/**
Modified: trunk/catalog/admin/includes/gabarit/navigation_links/display_view.edit.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/navigation_links/display_view.edit.gab 2013-10-10 09:54:26 UTC (rev 4876)
+++ trunk/catalog/admin/includes/gabarit/navigation_links/display_view.edit.gab 2013-10-10 11:32:17 UTC (rev 4877)
@@ -48,7 +48,9 @@
<p class="block_input">
<label for="products_virtual_type_id"><?php echo __('@navigation_links text type'); ?></label>
- <?php echo tep_draw_pull_down_menu('type', tep_get_status_array('navigation_links',0,'status_name'), navigation_links::$Info->type); ?>
+ <?php //echo tep_draw_pull_down_menu('type', tep_get_status_array('navigation_links',0,'status_name'), navigation_links::$Info->type); ?>
+
+<?php echo navigation_links::DisplayField('type', '%s'); ?>
</p>
<p class="block_input">
Modified: trunk/catalog/admin/includes/modules/pages/navigation_links.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/navigation_links.php 2013-10-10 09:54:26 UTC (rev 4876)
+++ trunk/catalog/admin/includes/modules/pages/navigation_links.php 2013-10-10 11:32:17 UTC (rev 4877)
@@ -30,15 +30,15 @@
/**
@var bool $dir_ok
*/
- public static $dir_ok;
+// public static $dir_ok;
/**
@var current object
*/
- public static $Info;
+// public static $Info;
/**
@var array info all tabs for filter listings
*/
- public static $allfields = array();
+// public static $allfields = array();
/**
@@ -88,12 +88,34 @@
}
+ /**
+ @remarks define var execution sql in GetDBValue()
+ */
+ self::$InitInfo['adjust']=array(
+ 'languages_id'=>$languages_id,
+ 'page'=>1,
+ 'rowbyp'=>10,
+ 'sOrder'=>'',
+ 'sWhere'=>'',
+ );
+ MGabCont::SetCurrentName(__CLASS__);
+
+ self::$allfields = array();
+
/**
@remarks this define col theader title, and ajust html code
Just for Edit listing
*/
+ self::$allfields['c.nav_link_id'] = array(
+ 'sort'=>true,
+ 'alias'=>'id',
+ 'text'=>__('@tasks table heading id'),
+ 'width'=>'6%',
+ 'default'=>true,
+ 'class'=>'tcenter',
+ );
self::$allfields['cd.nav_name'] = array(
'sort'=>true,
'alias'=>'title',
@@ -108,6 +130,11 @@
'alias'=>'type',
'text'=>__('@tasks table heading type'),
'width'=>'6%',
+ 'edit'=>array(
+ 'input_name'=>'nav_link_type',
+ 'input_type'=>'select',
+ 'select_values'=>tep_get_status_array('navigation_links',0,'status_name'),
+ ),
);
self::$allfields['s.status_name'] = array(
'sort'=>true,
@@ -115,6 +142,11 @@
'text'=>__('@tasks table heading type name'),
'default'=>true,
'width'=>'8%',
+ 'edit'=>array(
+ 'input_name'=>'nav_link_type',
+ 'input_type'=>'select',
+ 'select_values'=>tep_get_status_array('navigation_links',0,'status_name'),
+ ),
);
/* Db Type */
@@ -123,16 +155,24 @@
'alias'=>'customers_status',
'text'=>__('@tasks table heading customers_status'),
'default'=>true,
+ 'edit'=>array(
+ 'input_name'=>'customers_status',
+ 'input_type'=>'select',
+ 'select_values'=>tep_get_status_array('customers_restrict_access',0,'status_name'),
+ ),
);
-// self::$allfields['c.customers_status'] = array(
-// 'sort'=>true,
-// 'alias'=>'customers_status',
-// 'text'=>__('@tasks table heading customers_status'),
-// 'default'=>true,
-//
-// );
+ self::$allfields['c.nav_sort_order'] = array(
+ 'sort'=>true,
+ 'alias'=>'sort_order',
+ 'text'=>__('@tasks table heading sort order'),
+ 'default'=>true,
+ 'edit'=>array(
+ 'input_name'=>'sort_order',
+ 'input_size'=>'2',
+ ),
+ );
/* Db parent */
self::$allfields['c.parent_id'] = array(
@@ -161,104 +201,166 @@
/**
@remarks Construct all list , fields , th/td
*/
- self::$InitInfo['theader']['listing']=array(
-// array('width'=>'2%', 'class'=>'tcenter', 'txt'=>' ' ),
-// array('width'=>'2%', 'class'=>'tcenter', 'txt'=>' ' ),
- );
- self::$InitInfo['tfooter']['listing']=self::$InitInfo['theader']['listing'];
+// self::$InitInfo['theader']['listing']=array(
+// // array('width'=>'2%', 'class'=>'tcenter', 'txt'=>' ' ),
+// // array('width'=>'2%', 'class'=>'tcenter', 'txt'=>' ' ),
+// );
+// self::$InitInfo['tfooter']['listing']=self::$InitInfo['theader']['listing'];
+//
+// self::$InitInfo['modele']['listing']=array(
+// // 0=>false,
+// // 1=>false,
+// );
- self::$InitInfo['modele']['listing']=array(
-// 0=>false,
-// 1=>false,
- );
- // min fields and not view directly colonne fields
- $listfield = " c.nav_link_id as id, ";
- $_SESSION['filters']['allfields'] = array();
- // put in
- if(isset($_SESSION['filters'][__CLASS__]['allfields']))
- $_SESSION['filters']['allfields'] = $_SESSION['filters'][__CLASS__]['allfields'];
- else
- $_SESSION['filters']['allfields'] = array();
+ /// @remarks min fields and not view directly colonne fields
+ $listfield = ' c.nav_link_id as id,';
- $in_session = $_SESSION['filters']['allfields'];
- // check and appli
- foreach(self::$allfields as $key=>$row){
- $clean = substr($key, (strpos($key, '.')+1));
+ /// @remarks Active forms filter
+ $mutli=array();
+// $mutli[] = sprintf(CsrtAction::getButton('button_action', IMAGE_DELETE, 'delete'), '', ' name="multi_action" ' ) ;
- if(is_array($row)){
- $txt = $row['text'];
- $alias = (isset($row['alias'])? $row['alias'] : $clean);
- $css = (isset($row['class'])? $row['class'] : 'tcenter');
- $width = (isset($row['width'])? $row['width'] : '5%');
- }
- else{
- $txt = $row;
- $alias = $clean;
- $css = 'tcenter';
- $width = '5%';
- }
- if(
- ( isset($in_session[$clean]) && (string)$in_session[$clean] == 'on' )
- || ( count($in_session) <=1 && ( is_array($row) && isset($row['default']) && $row['default'] == true) )
- ) {
- $_SESSION['filters']['allfields'][$clean] = 'on';
- /**
- @remarks this define col theader title, and ajust html code
- */
- self::$InitInfo['theader']['listing'][]= array( 'width'=>$width, 'class'=>$css, 'txt'=>$txt);
- self::$InitInfo['tfooter']['listing'][]= array( 'width'=>$width, 'class'=>$css, 'txt'=>$txt );
- /**
- @remarks this define col in table, and if is possible sort
- */
- self::$InitInfo['modele']['listing'][$alias]=true;
+ /**
+ @remarks Active forms filter
+ @note
+ array[
+ // For normalised filter define on method ConvertInitVar
+ generic =>
+ array (
+ 'string'
+ // , ....
+ );
+ mod =>
+ array(
+ 'title'=>__('@products filter tab manufacturer'),
+ 'content'=>tep_get_include_contents('manufacturers/filter.manufacturer'),
+ )
+ ]
+ */
+ $tab = array();
- if($clean !=$alias)
- $listfield .=$key.' as '.$alias.',';
- else
- $listfield .=$key.',';
- }
- }
+ // min fields and not view directly colonne fields
+// $listfield = " c.nav_link_id as id, ";
+// $_SESSION['filters']['allfields'] = array();
+// // put in
+// if(isset($_SESSION['filters'][__CLASS__]['allfields']))
+// $_SESSION['filters']['allfields'] = $_SESSION['filters'][__CLASS__]['allfields'];
+// else
+// $_SESSION['filters']['allfields'] = array();
+//
+// $in_session = $_SESSION['filters']['allfields'];
+// // check and appli
+// foreach(self::$allfields as $key=>$row){
+// $clean = substr($key, (strpos($key, '.')+1));
+//
+// if(is_array($row)){
+// $txt = $row['text'];
+// $alias = (isset($row['alias'])? $row['alias'] : $clean);
+// $css = (isset($row['class'])? $row['class'] : 'tcenter');
+// $width = (isset($row['width'])? $row['width'] : '5%');
+// }
+// else{
+// $txt = $row;
+// $alias = $clean;
+// $css = 'tcenter';
+// $width = '5%';
+// }
+//
+// if(
+// ( isset($in_session[$clean]) && (string)$in_session[$clean] == 'on' )
+// || ( count($in_session) <=1 && ( is_array($row) && isset($row['default']) && $row['default'] == true) )
+// ) {
+// $_SESSION['filters']['allfields'][$clean] = 'on';
+// /**
+// @remarks this define col theader title, and ajust html code
+// */
+// self::$InitInfo['theader']['listing'][]= array( 'width'=>$width, 'class'=>$css, 'txt'=>$txt);
+// self::$InitInfo['tfooter']['listing'][]= array( 'width'=>$width, 'class'=>$css, 'txt'=>$txt );
+// /**
+// @remarks this define col in table, and if is possible sort
+// */
+// self::$InitInfo['modele']['listing'][$alias]=true;
+//
+//
+// if($clean !=$alias)
+// $listfield .=$key.' as '.$alias.',';
+// else
+// $listfield .=$key.',';
+// }
+// }
+//
+//
+// self::$InitInfo['modele']['listing']['action']=false;
+// self::$InitInfo['theader']['listing']['action']= array( 'class'=>'row_action', 'txt'=>__('table heading action') );
+// self::$InitInfo['tfooter']['listing']['action']= array( 'class'=>'row_action', 'txt'=>__('table heading action') );
+//
+// self::$InitInfo['allfields']['listing'] = self::$allfields ;
- self::$InitInfo['modele']['listing']['action']=false;
- self::$InitInfo['theader']['listing']['action']= array( 'class'=>'row_action', 'txt'=>__('table heading action') );
- self::$InitInfo['tfooter']['listing']['action']= array( 'class'=>'row_action', 'txt'=>__('table heading action') );
-
- self::$InitInfo['allfields']['listing'] = self::$allfields ;
-
/**
@remarks Active forms filter
*/
- self::$InitInfo['tfilter']['listing']=array(
- array(
- 'type'=>'listfield'
- ),
- );
+// self::$InitInfo['tfilter']['listing']=array(
+// array(
+// 'type'=>'listfield'
+// ),
+// );
/**
@remarks Put detail for listing methode
*/
- self::$InitInfo['adjust']['listfields'] = substr($listfield, 0,-1);
+// self::$InitInfo['adjust']['listfields'] = substr($listfield, 0,-1);
/**
@remarks this define menu master module in page
*/
- if(self::$action =='listing'){
- $i = 0;
- self::$InitInfo['MenuModule'][$i]=array(
+// if(self::$action =='listing'){
+// $i = 0;
+// self::$InitInfo['MenuModule'][$i]=array(
+// 'type'=>'getLink',
+// 'format'=>'button_nav',
+// 'image'=>'',
+// 'cssclass'=>'',
+// 'title'=>__('@navigation_links image add'),
+// 'url'=>tep_href_link(self::FILENAME, 'action=new'),
+// );
+//
+// }
+
+
+ /**
+ @remarks this define menu master module in page
+ @note use $boutons[action][] = array(params)
+
+ params :
+ 'type'=>'getLink',
+ 'format'=>'button_nav',
+ 'image'=>'',
+ 'cssclass'=>'button',
+ 'title'=>__('image create new content'),
+ 'url'=>tep_href_link(self::FILENAME, 'action=new'),
+ */
+ $boutons = array();
+ $boutons['listing'][]=array(
'type'=>'getLink',
'format'=>'button_nav',
'image'=>'',
'cssclass'=>'',
'title'=>__('@navigation_links image add'),
'url'=>tep_href_link(self::FILENAME, 'action=new'),
- );
+ );
- }
+ /**
+ Call Base Init and construct $InitInfo for process Filter
+ $listfield string list row in db
+ $mutli array action multiple
+ $filter array put list off activate tab filter
+ $boutons array
+ */
+ self::ConvertInitVar( $listfield, $mutli, $tab, $boutons);
return true;
}
@@ -281,13 +383,16 @@
@remarks specific save in session value filters
*/
case 'filters':
- $_SESSION['filters'] =array();
-
- foreach($_POST['filters']['listfield'] as $key=>$row){
- if( $row =='on' )
- $_SESSION['filters'][__CLASS__]['allfields'][$key] = 'on';
- }
-
+// $_SESSION['filters'] =array();
+//
+// foreach($_POST['filters']['listfield'] as $key=>$row){
+// if( $row =='on' )
+// $_SESSION['filters'][__CLASS__]['allfields'][$key] = 'on';
+// }
+ /*
+ Call Prev Process
+ */
+ self::actionFilter();
tep_redirect(tep_href_link(self::FILENAME));
break;
@@ -295,6 +400,57 @@
/**
@remarks specific ajax action
*/
+ /**
+ @remarks specific Ajax call
+ */
+ case 'update_cell':
+ try {
+
+ $modele = array_keys(sqlnavigation_links::Specimen());
+ $params = array();
+ $params['id'] = $_REQUEST['id'];
+
+ if( in_array($_REQUEST['columnName'], $modele) )
+ $params['sqlarray'] = array(
+ $_REQUEST['columnName'] => (isset($_REQUEST['value']) ? tep_db_prepare_input($_REQUEST['value']) : 0)
+ );
+ else{
+ $tab = explode('[', $_REQUEST['columnName']);
+ $final = $tabs2 = array();
+ foreach($tab as $row)
+ $tabs2[] = ( (substr($row,-1)==']')?substr($row,0,-1) : $row );
+
+ $tabs3 = array_reverse($tabs2);
+ $max = count($tabs2);
+ $i=0;
+ foreach($tabs3 as $row){
+ $i++;
+ if($i==1) $final[$row] = (isset($_REQUEST['value']) ? tep_db_prepare_input($_REQUEST['value']) : 0);
+ else
+ $final[$row] = $final;
+ }
+
+ $params['post'] = $final;
+ }
+
+ $params['action']=self::$action;
+
+ $params['language_id']= $languages_id;
+
+ if( sqlnavigation_links::update( $params ) != 1 )
+ throw new Exception(__('@sqlnavigation_links error in update process')) ;
+
+ $messageStack->add_session(__('@sqlnavigation_links success in update process'), 'success');
+
+ // display value for return
+ echo $_REQUEST['value'];
+ }
+ catch (Exception $e) {
+
+ $messageStack->add_session($e->getMessage() , 'error');
+ }
+
+ break;
case 'setflag':
if ( ($_GET['flag'] == '0') || ($_GET['flag'] == '1') ) {
$c_id =(int) tep_db_prepare_input($_GET['cID']);
@@ -401,9 +557,30 @@
/**
@remarks retrun object load one inventaire
*/
- global $query_numrows;
+ global $query_numrows, $languages_id;
$adjust=new objectInfo(self::$InitInfo['adjust']);
+ /**
+ @remarks replace id by name col
+ */
+ if(!empty($adjust->sWhere)) {
+
+ foreach(self::$allfields as $key=>$row){
+ if(is_array($row) && isset($row['alias']) ){
+ $k[] = '#[(]'.$row['alias'].'[)]#i';
+ $k[] = '# '.$row['alias'].' #i';
+ $k[] = '# \.'.$row['alias'].'#i';
+
+ $v[] = '('.$key.')';
+ $v[] = ' '.$key.' ';
+ $v[] = '.'.$key.' ';
+ }
+ }
+
+ if(isset($k))
+ $adjust->sWhere = preg_replace($k,$v, $adjust->sWhere);
+ }
+
$query_raw = "select ".$adjust->listfields." from " . TABLE_NAVIGATION_LINKS . " c ".
" LEFT JOIN ".TABLE_NAVIGATION_LINKS_DESCRIPTION." cd ON( cd.nav_link_id = c.nav_link_id AND cd.language_id ='".$adjust->languages_id."' ) ".
" LEFT JOIN ".TABLE_NAVIGATION_LINKS_DESCRIPTION." cd2 ON( cd2.nav_link_id = c.parent_id AND cd.language_id ='".$adjust->languages_id."' ) ".
@@ -432,6 +609,8 @@
/**
@remarks Ajax View result
*/
+ case 'update_cell':
+ break;
case 'setflag':
return self::RowStatus(array('country_visible'=>(int)$_GET['flag'], 'nav_link_id'=>(int)$_GET['cID']));
break;
@@ -510,10 +689,7 @@
$res=array();
switch (parent::$action) {
- case 'edit';
- global $query_numrows,$languages_id;
- break;
case 'listing':
global $query_numrows,$languages_id;
@@ -534,10 +710,50 @@
$ord[$k]= (( $result !=false) ? $result->name : '' );
}
else $ord[$k]=$item[$k];
-
+ $ord[0]=$item['id'];
$res[]=$ord;
}
break;
+ case 'new':
+ case 'edit';
+ default:
+ global $languages_id;
+
+ $ord =array();
+
+ if(is_object($_query)){
+ $res = new stdClass;
+ foreach($_query as $key=>$row) {
+ switch($key){
+ case 'lg':
+ foreach($row as $ke=>$ro){
+ foreach($ro as $k=>$r){
+
+ if( ($new_r = self::GetEditFieldsDefine($k) ) && $new_r !=false ){
+ $new_r['input_value'][$ke] = $r;
+ $edit = 'edit_'.$k;
+ $res->$edit = new objectInfo($new_r);
+ }
+
+ $res->$k = $r;
+ }
+ }
+ break;
+
+// case 'barcode_type':
+
+ default:
+
+ if( ($new_r = self::GetEditFieldsDefine($key) ) && $new_r !=false ){
+ $new_r['input_value'] = $row;
+ $edit = 'edit_'.$key;
+ $res->$edit = new objectInfo($new_r);
+ }
+
+ $res->$key = $row;
+ }
+ }
+ }
}
return $res;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2013-10-10 09:54:30
|
Revision: 4876
http://sourceforge.net/p/oscss/svn/4876
Author: oscim
Date: 2013-10-10 09:54:26 +0000 (Thu, 10 Oct 2013)
Log Message:
-----------
Upgrade Code for countries page
Fix config option
Fix customers
Modified Paths:
--------------
trunk/catalog/admin/includes/classes/drivers/sqlcountries.php
trunk/catalog/admin/includes/classes/drivers/sqlnewsletters_modeles.php
trunk/catalog/admin/includes/gabarit/countries/display_view.edit.gab
trunk/catalog/admin/includes/languages/fr_FR/modules/pages/countries.txt
trunk/catalog/admin/includes/modules/pages/countries.php
trunk/catalog/admin/includes/modules/pages/customers.php
trunk/catalog/admin/includes/modules/pages/newslettersModeles.php
trunk/catalog/install/includes/sql/mysql/data/91_osc_configuration.sql
Modified: trunk/catalog/admin/includes/classes/drivers/sqlcountries.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlcountries.php 2013-10-10 08:14:26 UTC (rev 4875)
+++ trunk/catalog/admin/includes/classes/drivers/sqlcountries.php 2013-10-10 09:54:26 UTC (rev 4876)
@@ -3,8 +3,8 @@
@licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
@portion code Copyright (c) 2002 osCommerce
@package osCSS-2 <www http://www.oscss.org>
- @version 2.1.1
- @date 23/10/11, 16:51
+ @version 2.1.2
+ @date 10/10/2013, 10:30
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
@class sqlcountries
@@ -41,6 +41,9 @@
if(!isset($option['name']))
return 'name';
+ $DB=Database::getInstance();
+ $error = 0 ;
+
$sql_data_array['countries_name'] = tep_db_prepare_input($option['name']);
$sql_data_array['countries_localname'] = (isset($option['localname'])) ? tep_db_prepare_input($option['localname']) :'NULL';
$sql_data_array['countries_iso_code_2'] = (isset($option['iso_code_2'])) ?strtoupper( tep_db_prepare_input($option['iso_code_2'])) :'NULL';
@@ -65,20 +68,40 @@
if(!isset($option['id']))
return 'id';
+ $DB=Database::getInstance();
+ $error = 0 ;
+ $sql_data_array =array();
+
$where ='';
if(isset($option['id'])) $where .="AND countries_id = '".(int)$option['id']."' ";
+ if( strlen(substr($where,3)) < 2)
+ return false;
- if(isset($option['name']))$sql_data_array['countries_name'] = tep_db_prepare_input($option['name']);
- if(isset($option['localname'])) $sql_data_array['countries_localname'] = tep_db_prepare_input($option['localname']);
- if(isset($option['iso_code_2'])) $sql_data_array['countries_iso_code_2'] = strtoupper(tep_db_prepare_input($option['iso_code_2'])) ;
- if(isset($option['iso_code_3'])) $sql_data_array['countries_iso_code_3'] = strtoupper(tep_db_prepare_input($option['iso_code_3']));
- if(isset($option['address_format_id'])) $sql_data_array['address_format_id'] =(int) tep_db_prepare_input($option['address_format_id']);
- if(isset($option['visible'])) $sql_data_array['country_visible'] = (int)tep_db_prepare_input($option['visible']);
+ if(isset($option['post']))
+ $post = $option['post'];
- $res=tep_db_perform(TABLE_COUNTRIES, $sql_data_array, 'update' , substr($where,3) );
+ $DB->beginTransaction();
- return $res;
+ if(isset($post['name']))$sql_data_array['countries_name'] = tep_db_prepare_input($post['name']);
+ if(isset($post['localname'])) $sql_data_array['countries_localname'] = tep_db_prepare_input($post['localname']);
+ if(isset($post['iso_code_2'])) $sql_data_array['countries_iso_code_2'] = strtoupper(tep_db_prepare_input($post['iso_code_2'])) ;
+ if(isset($post['iso_code_3'])) $sql_data_array['countries_iso_code_3'] = strtoupper(tep_db_prepare_input($post['iso_code_3']));
+ if(isset($post['address_format'])) $sql_data_array['address_format_id'] =(int) tep_db_prepare_input($post['address_format']);
+ if(isset($post['visible'])) $sql_data_array['country_visible'] = (int)tep_db_prepare_input($post['visible']);
+
+ if(count($sql_data_array)>=1)
+ if( ! tep_db_perform(TABLE_COUNTRIES, $sql_data_array, 'update' , substr($where,3) ) )
+ $error++;
+
+ if( $error > 0){
+ $DB->rollbackTransaction();
+ return false;
+ }
+ else{
+ $DB->commitTransaction();
+ return 1;
+ }
}
/**
@@ -180,7 +203,8 @@
@return array product empty
*/
public static function Specimen($shortkey=false){
- $par = array('countries_id' => '',
+ $par = array(
+ 'countries_id' => '',
'countries_name' => '',
'countries_localname' => '',
'countries_iso_code_2' => '',
@@ -207,6 +231,8 @@
$key=substr($key,10);
elseif( strpos($key,'country_') ===0)
$key=substr($key,8);
+ elseif( $key ==='address_format_id')
+ $key = 'address_format';
$object->$key = $value;
}
Modified: trunk/catalog/admin/includes/classes/drivers/sqlnewsletters_modeles.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlnewsletters_modeles.php 2013-10-10 08:14:26 UTC (rev 4875)
+++ trunk/catalog/admin/includes/classes/drivers/sqlnewsletters_modeles.php 2013-10-10 09:54:26 UTC (rev 4876)
@@ -7,8 +7,8 @@
@date 10/10/2013, 20:48
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
- @class sqlnavigation_links
- @file sqlnavigation_links.php
+ @class sqlnewsletters_modeles
+ @file sqlnewsletters_modeles.php
@brief manage db update/insert/delete for navigation_links
*/
@@ -37,6 +37,8 @@
*/
public static function create($option){
self::getInstance();
+ $DB=Database::getInstance();
+ $error = 0 ;
$DB->beginTransaction();
@@ -92,7 +94,8 @@
$sql_data_array['last_update'] = 'NOW()';
- $res=tep_db_perform(TABLE_NEWSLETTERS_MODELES, $sql_data_array, 'update' , substr($where,3) );
+ if( !ep_db_perform(TABLE_NEWSLETTERS_MODELES, $sql_data_array, 'update' , substr($where,3) ) )
+ $error++;
if( $error > 0){
Modified: trunk/catalog/admin/includes/gabarit/countries/display_view.edit.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/countries/display_view.edit.gab 2013-10-10 08:14:26 UTC (rev 4875)
+++ trunk/catalog/admin/includes/gabarit/countries/display_view.edit.gab 2013-10-10 09:54:26 UTC (rev 4876)
@@ -3,8 +3,8 @@
@licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
@portion code Copyright (c) 2002 osCommerce
@package osCSS-2 <www http://www.oscss.org>
- @version 2.1.1
- @date 20/05/2012, 10:30
+ @version 2.1.2
+ @date 10/10/2013, 10:30
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
*/
@@ -17,7 +17,7 @@
<div id="tabs">
<ul>
<li><a href="#tabs-1"><?php echo __('countries tab specification'); ?></a></li>
- <?php if(_cst_bool('STOCK_CHECK')) : ?>
+ <?php if(_cst_bool('ACCOUNT_STATE')) : ?>
<li><a href="#tabs-2"><?php echo __('countries tab state'); ?></a></li>
<?php endif; ?>
</ul>
@@ -27,49 +27,32 @@
<?php echo tep_draw_form('categories', countries::FILENAME, 'action='.((countries::$action == 'new')?'insert' : 'update&cID='.$_GET['cID']), 'post') ?>
+ <fieldset class="block_fieldset">
- <p class="block_input">
- <Label><?php echo __('text info country name') ?></label>
- <?php echo tep_draw_input_field('countries_name', '', countries::$Info->name) ?>
- </p>
+ <?php echo countries::DisplayField('name'); ?>
- <p class="block_input">
- <Label><?php echo __('text info country localname') ?></label>
- <?php echo tep_draw_input_field('countries_localname', '', countries::$Info->localname) ?>
- </p>
+ <?php echo countries::DisplayField('localname'); ?>
- <p class="block_input">
- <Label><?php echo __('text info country code 2') ?></label>
- <?php echo tep_draw_input_field('countries_iso_code_2', '', countries::$Info->iso_code_2) ?>
- </p>
+ <?php echo countries::DisplayField('iso_code_2'); ?>
- <p class="block_input">
- <Label><?php echo __('text info country code 3') ?></label>
- <?php echo tep_draw_input_field('countries_iso_code_3', '', countries::$Info->iso_code_3) ?>
- </p>
+ <?php echo countries::DisplayField('iso_code_3'); ?>
- <p class="block_input">
- <Label><?php echo __('text info address format') ?></label>
- <?php echo tep_draw_pull_down_menu('address_format_id', tep_get_address_formats(), countries::$Info->address_format_id) ?>
- </p>
+ <?php echo countries::DisplayField('address_format'); ?>
-<!-- <p class="block_input">
- <Label><?php //echo __('text info country visible') ?></label>
- <?php //echo tep_draw_radio_field('country_visible', 'country_visible_1', '1', $country_visible_Y) . ' ' . VISIBLE_YES . ' ' . tep_draw_radio_field('country_visible', 'country_visible_0', '0', $country_visible_N) . ' ' . VISIBLE_NO ?>
- </p>-->
-
<p class="block_input button_nav">
<?php
echo tep_image_submit('', IMAGE_UPDATE) /*. tep_image_submit('', IMAGE_UPDATE_AND_CLOSE,' name="up_and_close"' )*/;
echo tep_js_back(tep_href_link(countries::FILENAME), IMAGE_CANCEL) ;
?>
</p>
+
+ </fieldset>
</form>
</div>
- <?php if(_cst_bool('STOCK_CHECK')) : ?>
+ <?php if(_cst_bool('ACCOUNT_STATE')) : ?>
<div id="tabs-2" class="tabPage">
<div class="button_nav">
<?php echo '<a class="button fancy" href="' . tep_href_link(countries::FILENAME,'action=new_zone&cID='.countries::$Id) . '">' .tep_image(DIR_WS_ICONS.'icon_add_new.png',IMAGE_INSERT ) . __('image insert zone') . '</a>'; ?>
@@ -84,7 +67,7 @@
</tr>
</thead>
<tbody>
- <?php if(countries::$Info->childs !=false)
+ <?php if(countries::$Info->childs !=false)
foreach(countries::$Info->childs as $zones) : ?>
<tr class="view parent " >
<td><?php echo $zones->name; ?></td>
Modified: trunk/catalog/admin/includes/languages/fr_FR/modules/pages/countries.txt
===================================================================
--- trunk/catalog/admin/includes/languages/fr_FR/modules/pages/countries.txt 2013-10-10 08:14:26 UTC (rev 4875)
+++ trunk/catalog/admin/includes/languages/fr_FR/modules/pages/countries.txt 2013-10-10 09:54:26 UTC (rev 4876)
@@ -3,8 +3,8 @@
@licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
@portion code Copyright (c) 2002 osCommerce
@package osCSS-2 <www http://www.oscss.org>
- @version 2.1.1
- @date 16/11/11, 22:00
+ @version 2.1.2
+ @date 10/10/2013, 10:30
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
*/
@@ -13,12 +13,14 @@
/* listing */
- $lang['table heading name']="Pays" ;
- $lang['table heading localname']="Nom local" ;
- $lang['table heading iso 2']="Iso-2" ;
- $lang['table heading iso 3']="Iso-3" ;
- $lang['table heading status']="Statut" ;
- $lang['table heading action']="Action" ;
+ $lang['countries table heading id']="Id" ;
+ $lang['countries table heading address format']="Format adresse" ;
+ $lang['countries table heading name']="Pays" ;
+ $lang['countries table heading localname']="Nom local" ;
+ $lang['countries table heading iso 2']="Iso-2" ;
+ $lang['countries table heading iso 3']="Iso-3" ;
+ $lang['countries table heading status']="Statut" ;
+ $lang['@countries table heading action']="Action" ;
$lang['image add countries']="Ajouter un pays" ;
Modified: trunk/catalog/admin/includes/modules/pages/countries.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/countries.php 2013-10-10 08:14:26 UTC (rev 4875)
+++ trunk/catalog/admin/includes/modules/pages/countries.php 2013-10-10 09:54:26 UTC (rev 4876)
@@ -3,8 +3,8 @@
@licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
@portion code Copyright (c) 2002 osCommerce
@package osCSS-2 <www http://www.oscss.org>
- @version 2.1.1
- @date 26/11/11, 21:49
+ @version 2.1.2
+ @date 10/10/2013, 10:30
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
@class countries
@@ -12,7 +12,7 @@
class countries
extends ModTwo /// new abstract class for nextgen module
- implements
+ implements
InterfaceModule,
/*IntModTwo, */ /// new interface module for nextgen module
ExtModConfig {
@@ -31,11 +31,8 @@
@var bool $dir_ok
*/
public static $dir_ok;
- /**
- @var current object
- */
- public static $Info;
+
/**
class constructor
*/
@@ -56,7 +53,25 @@
self::$action=(isset($_REQUEST['action'])? (string)$_REQUEST['action'] : 'listing' );
self::$Id=(isset($_REQUEST['cID'])? (int)$_REQUEST['cID'] : 0 );
+
/**
+ @remarks not load if not first init
+ */
+ if(!defined('JSONSTATMENT')){
+
+ if(self::$action =='' || self::$action =='listing')
+ //! active datatable in ajax, precise les GET necessaire
+ define('JSONSTATMENT', 'ModTwo=true&mod=page&type='.self::$code.
+ (isset(parent::$action)?'&action='.parent::$action : '' ).
+ (isset(self::$Id)?'&file='.self::$Id : '' )
+ );
+ }
+
+ MGabCont::SetCurrentName(__CLASS__);
+
+
+
+ /**
@remarks define var execution sql in GetDBValue()
*/
self::$InitInfo['adjust']=array(
@@ -68,68 +83,167 @@
);
+ /**
+ @remarks this define col theader title, and ajust html code
+ Just for Edit listing
+ */
+ self::$allfields = array();
- /**
- @remarks not load if not first init
- */
- if(defined('JSONSTATMENT')) return;
+ self::$allfields['c.countries_id'] = array(
+ 'sort'=>true,
+ 'search'=>true,
+ 'alias'=>'id',
+ 'text'=>__('countries table heading id'),
+ 'width'=>'2%',
+ 'class'=>'tcenter',
+ 'default'=>true,
+ );
+ self::$allfields['c.countries_name'] = array(
+ 'sort'=>true,
+ 'search'=>true,
+ 'alias'=>'name',
+ 'text'=>__('countries table heading name'),
+ 'width'=>'15%',
+ 'class'=>'tleft',
+ 'default'=>true,
+ 'edit'=>array(
+ 'input_name'=>'title',
+ 'input_size'=>'name',
+ 'required_status'=>true,
+// 'active_value_language'=>true,
+ ),
+ );
+ self::$allfields['c.countries_localname'] = array(
+ 'sort'=>true,
+ 'search'=>true,
+ 'alias'=>'localname',
+ 'text'=>__('countries table heading localname'),
+ 'width'=>'15%',
+ 'class'=>'tleft',
+ 'default'=>true,
+ 'edit'=>array(
+ 'input_name'=>'localname',
+ 'input_size'=>'64',
+ 'required_status'=>true,
+// 'active_value_language'=>true,
+ ),
+ );
+ self::$allfields['c.countries_iso_code_2'] = array(
+ 'sort'=>true,
+ 'search'=>true,
+ 'alias'=>'iso_code_2',
+ 'text'=>__('countries table heading iso 2'),
+ 'width'=>'2%',
+ 'class'=>'tcenter',
+ 'edit'=>array(
+ 'input_name'=>'iso_code_2',
+ 'input_size'=>'5',
+ 'required_status'=>true,
+ 'class'=>'tleft',
+ ),
+// 'default'=>true,
+ );
+ self::$allfields['c.countries_iso_code_3'] = array(
+ 'sort'=>true,
+ 'search'=>true,
+ 'alias'=>'iso_code_3',
+ 'text'=>__('countries table heading iso 3'),
+ 'width'=>'2%',
+ 'class'=>'tcenter',
+// 'default'=>true,
+ 'edit'=>array(
+ 'input_name'=>'iso_code_3',
+ 'input_size'=>'5',
+ 'required_status'=>true,
+ 'class'=>'tleft',
+ ),
+ );
+ self::$allfields['c.address_format_id'] = array(
+ 'sort'=>true,
+ 'search'=>true,
+ 'alias'=>'address_format',
+ 'text'=>__('countries table heading address format'),
+ 'width'=>'6%',
+ 'class'=>'tcenter',
+// 'default'=>true,
+ 'edit'=>array(
+ 'input_type'=>'select',
+ 'input_size'=>'1',
+ 'input_name'=>'address_format',
+ 'select_values'=>tep_get_address_formats(),
+ 'class'=>'tleft',
+ ),
- if(self::$action =='' || self::$action =='listing')
- //! active datatable in ajax, precise les GET necessaire
- define('JSONSTATMENT', 'ModTwo=true&mod=page&type='.self::$code.
- (isset(parent::$action)?'&action='.parent::$action : '' ).
- (isset(self::$Id)?'&file='.self::$Id : '' )
- );
- /**
- @remarks this define col theader title, and ajust html code
- Just for Edit listing
- */
- self::$InitInfo['theader']['listing']=array(
- 0 =>array('width'=>'15%','class'=>'tcenter', 'txt'=>__('table heading name') ) ,
- 1 => array('class'=>'tcenter', 'txt'=>__('table heading localname') ),
- 2 =>array('width'=>'2%','class'=>'tcenter', 'txt'=>__('table heading iso 2') ),
- 3 =>array('width'=>'2%','class'=>'tcenter', 'txt'=>__('table heading iso 3') ),
- 4 =>array('width'=>'8%','class'=>'tcenter', 'txt'=>__('table heading status') ),
- 5 =>array('width'=>'8%','class'=>'tcenter', 'txt'=>__('table heading action') ),
- );
+ );
+ self::$allfields['c.country_visible'] = array(
+ 'sort'=>true,
+ 'search'=>true,
+ 'alias'=>'visible',
+ 'text'=>__('countries table heading status'),
+ 'width'=>'2%',
+ 'class'=>'tcenter',
+ 'default'=>true,
+ );
- /**
- @remarks this define col in table, and if is possible sort
- Just for Edit listing
- */
- self::$InitInfo['modele']['listing']=array(
-// 0 =>false,
- 'countries_name' =>true,
- 'countries_localname' =>true,
- 'countries_iso_code_2'=>true,
- 'countries_iso_code_3'=>true,
- 'country_visible'=>true,
- 'action'=>false,
- );
+ /// @remarks min fields and not view directly colonne fields
+ $listfield = ' c.countries_id as id, ';
- /**
- @remarks this define menu master module in page
- */
- if(self::$action =='' || self::$action =='listing'){
- self::$InitInfo['MenuModule'][]=array(
+ /// @remarks Active forms filter
+ $mutli=array();
+
+ /**
+ @remarks Active forms filter
+ @note
+ array[
+ // For normalised filter define on method ConvertInitVar
+ generic =>
+ array (
+ 'string'
+ // , ....
+ );
+ mod =>
+ array(
+ 'title'=>__('@products filter tab manufacturer'),
+ 'content'=>tep_get_include_contents('manufacturers/filter.manufacturer'),
+ )
+ ]
+ */
+ $tab = array();
+
+ /**
+ @remarks this define menu master module in page
+ @note use $boutons[action][] = array(params)
+
+ params :
+ 'type'=>'getLink',
+ 'format'=>'button_nav',
+ 'image'=>'',
+ 'cssclass'=>'button',
+ 'title'=>__('image create new content'),
+ 'url'=>tep_href_link(self::FILENAME, 'action=new'),
+ */
+ $boutons = array();
+ $boutons['listing'][]=array(
'type'=>'getLink',
'format'=>'button_nav',
'image'=>'',
'cssclass'=>'',
'title'=>__('image add countries'),
'url'=>tep_href_link(self::FILENAME, 'action=new'),
- );
+ );
- }
+ /**
+ Call Base Init and construct $InitInfo for process Filter
+ $listfield string list row in db
+ $mutli array action multiple
+ $filter array put list off activate tab filter
+ $boutons array
+ */
+ self::ConvertInitVar( $listfield, $mutli, $tab, $boutons);
-
-
-
-
- return true;
}
@@ -140,7 +254,88 @@
self::$action=$actions;
switch (self::$action) {
+ /**
+ @remarks specific save in session value filters
+ */
+ case 'filters':
+ /*
+ Call Prev Process
+ */
+ self::actionFilter();
+ tep_redirect(tep_href_link(self::FILENAME));
+ break;
+ case 'update_cell':
+ try {
+
+ $modele = array_keys(sqlcountries::Specimen());
+ $params = array();
+ $params['id'] = $_REQUEST['id'];
+
+ if( in_array($_REQUEST['columnName'], $modele) )
+ $params['sqlarray'] = array(
+ $_REQUEST['columnName'] => (isset($_REQUEST['value']) ? tep_db_prepare_input($_REQUEST['value']) : 0)
+ );
+ else{
+ $tab = explode('[', $_REQUEST['columnName']);
+ $final = $tabs2 = array();
+ foreach($tab as $row)
+ $tabs2[] = ( (substr($row,-1)==']')?substr($row,0,-1) : $row );
+
+ $tabs3 = array_reverse($tabs2);
+ $max = count($tabs2);
+ $i=0;
+ foreach($tabs3 as $row){
+ $i++;
+ if($i==1) $final[$row] = (isset($_REQUEST['value']) ? tep_db_prepare_input($_REQUEST['value']) : 0);
+ else
+ $final[$row] = $final;
+ }
+
+ $params['post'] = $final;
+ }
+
+ $params['action']=self::$action;
+
+ $params['language_id']= $languages_id;
+
+ if( sqlcountries::update( $params ) != 1 )
+ throw new Exception(__('@countries error in update process')) ;
+
+ $messageStack->add_session(__('@countries success in update process'), 'success');
+
+ // display value for return
+ echo $_REQUEST['value'];
+ }
+ catch (Exception $e) {
+
+ $messageStack->add_session($e->getMessage() , 'error');
+ }
+ break;
+ case 'setflag':
+ if ( ($_GET['flag'] == '0') || ($_GET['flag'] == '1') ) {
+ $c_id =(int) tep_db_prepare_input($_GET['cID']);
+
+ if ($c_id > 0){
+ $myarray = array('id'=>$c_id, 'post'=>array('visible'=>$_GET['flag']) );
+ if( ! sqlcountries::update($myarray) )
+ $messageStack->add_session(__('@countries error in update process'), 'error');
+ else
+ $messageStack->add_session(__('@countries success in update process'), 'success');
+
+ }
+ }
+
+ if(!isset($_GET['forceajax']))
+ tep_redirect(tep_href_link(self::FILENAME, 'cID=' . $_GET['cID']));
+ break;
+
+
+
+
+ /**
+ Normal page
+ */
case 'insert_zone':
$c_id =(int) tep_db_prepare_input($_POST['cID']);
@@ -187,20 +382,8 @@
tep_redirect(tep_href_link(self::FILENAME, 'action=edit&cID=' . $c_id ));
break;
- case 'setflag':
- if ( ($_GET['flag'] == '0') || ($_GET['flag'] == '1') ) {
- $c_id =(int) tep_db_prepare_input($_GET['cID']);
- if ($c_id > 0){
- $myarray = array('id'=>$c_id, 'visible'=>$_GET['flag'] );
- sqlcountries::update($myarray);
- }
- }
- if(!isset($_GET['forceajax']))
- tep_redirect(tep_href_link(self::FILENAME, 'cID=' . $_GET['cID']));
- break;
-
case 'insert':
$myarray = array(
@@ -284,26 +467,52 @@
case 'edit':
case 'new':
if( (int)self::$Id > 0) {
- self::$Info = sqlcountries::fetch(array('id'=>self::$Id ), true);
- self::$Info->childs = sqlzones::fetch(array('country_id'=>self::$Id ), true);
+ $res = sqlcountries::fetch(array('id'=>self::$Id ), true);
+ if(_cst_bool('ACCOUNT_STATE'))
+ $res->childs = sqlzones::fetch(array('country_id'=>self::$Id ), true);
}
else{
- self::$Info = sqlcountries::Specimen(true);
- self::$Info->childs = sqlzones::Specimen( true);
+ $res = sqlcountries::Specimen(true);
+ if(_cst_bool('ACCOUNT_STATE'))
+ $res->childs = sqlzones::Specimen( true);
}
+
+ return self::FormatDBValue($res);
break;
case 'listing':
- default:
/**
@remarks retrun object load one inventaire
*/
global $query_numrows;
$adjust=new objectInfo(self::$InitInfo['adjust']);
- $query_raw = "select countries_id , countries_name , countries_localname, countries_iso_code_2, countries_iso_code_3, address_format_id, country_visible from " . TABLE_COUNTRIES . " c ".
-// "LEFT JOIN " . TABLE_ZONES . " z ON(z.zone_country_id = c.countries_id ) ".
+
+ /**
+ @remarks replace id by name col
+ */
+ if(!empty($adjust->sWhere)) {
+
+ foreach(self::$allfields as $key=>$row){
+ if(is_array($row) && isset($row['alias']) ){
+ $k[] = '#[(]'.$row['alias'].'[)]#i';
+ $k[] = '# '.$row['alias'].' #i';
+ $k[] = '# \.'.$row['alias'].'#i';
+
+ $v[] = '('.$key.')';
+ $v[] = ' '.$key.' ';
+ $v[] = '.'.$key.' ';
+ }
+ }
+
+ if(isset($k))
+ $adjust->sWhere = preg_replace($k,$v, $adjust->sWhere);
+ }
+
+
+ $query_raw = "SELECT ".$adjust->listfields;
+ $query_raw .= " FROM " . TABLE_COUNTRIES . " c ".
((!empty($adjust->sWhere)) ? " WHERE ".substr($adjust->sWhere, 3) : '').
" ORDER BY ".((!empty($adjust->sOrder)) ? $adjust->sOrder : ' countries_name ASC ');
@@ -313,16 +522,20 @@
$res=self::FormatDBValue($_query);
return $res;
+ break;
}
}
public function display_view(){
- switch (parent::$action) {
+
+ switch (self::$action) {
/**
@remarks Ajax View result
*/
+ case 'update_cell':
+ break;
case 'setflag':
return self::RowStatus(array('country_visible'=>(int)$_GET['flag'], 'countries_id'=>(int)$_GET['cID']));
break;
@@ -336,25 +549,25 @@
break;
case 'delete_zone':
case 'edit_zone':
- self::load_db_values(0);
+ self::GetDBValue(0);
return MGabCont::CallGab(parent::$action,__FUNCTION__,__CLASS__);
break;
- case 'new':
- self::load_db_values(0);
- return MGabCont::CallGab('edit',__FUNCTION__,__CLASS__);
- break;
+
+ case 'new':
+ $action = 'edit';
+ case 'delete':
case 'edit':
- self::load_db_values(self::$Id);
- return MGabCont::CallGab(parent::$action,__FUNCTION__,__CLASS__);
+ if(!isset($action))
+ $action = self::$action;
+ self::$Info= self::GetDBValue();
+
+ return MGabCont::CallGab($action,__FUNCTION__,__CLASS__);
break;
- case 'delete':
- self::load_db_values(self::$Id);
- return MGabCont::CallGab(parent::$action,__FUNCTION__,__CLASS__);
- break;
+
case 'listing':
default:
- self::$list=self::tep_get_list();
+ self::$list=self::GetDBValue();
/// use master gabarit
MGabCont::SetCurrentName(__CLASS__);
return MGabCont::CallGab('listing',__FUNCTION__,self::MASTER);
@@ -377,13 +590,13 @@
*/
self::$InitInfo['adjust']['page']=$page;
self::$InitInfo['adjust']['rowbyp']=$rowbyp;
- self::$InitInfo['adjust']['sOrder']=$sOrder;
- self::$InitInfo['adjust']['sWhere']=$sWhere;
+ self::$InitInfo['adjust']['sOrder'].=$sOrder;
+ self::$InitInfo['adjust']['sWhere'].=$sWhere;
self::$InitInfo['adjust']['options']=$options;
$res = self::GetDBValue();
- self::$list= $query_numrows ; //= count($res);
+ self::$list= $query_numrows ;
return $res;
}
@@ -401,10 +614,7 @@
$res=array();
switch (parent::$action) {
- case 'edit';
- global $query_numrows,$languages_id;
- break;
case 'listing':
global $query_numrows,$languages_id;
@@ -412,12 +622,34 @@
foreach(self::$InitInfo['modele']['listing'] as $k=>$row)
if($k == 'action') $ord[$k]=self::ButtonRowsActions($item);
- elseif($k == 'country_visible') $ord[$k]=self::RowStatus($item);
+ elseif($k == 'visible') $ord[$k]=self::RowStatus($item);
else $ord[$k]=$item[$k];
$res[]=$ord;
}
break;
+ default:
+ global $languages_id;
+
+ $ord =array();
+
+ if(is_object($_query)){
+ $res = new stdClass;
+ foreach($_query as $key=>$row) {
+ switch($key){
+ default:
+
+ if( ($new_r = self::GetEditFieldsDefine($key) ) && $new_r !=false ){
+ $new_r['input_value'] = $row;
+ $edit = 'edit_'.$key;
+ $res->$edit = new objectInfo($new_r);
+ }
+
+ $res->$key = $row;
+ }
+ }
+ }
+
}
return $res;
@@ -433,8 +665,8 @@
// sprintf(CsrtAction::getLink('row_action_right', ICON_FILE_DOWNLOAD, 'plus'), '', tep_href_link(self::FILENAME, 'cID=' . $item['countries_id'] . '&action=download') ,'' )
''
,
- sprintf(CsrtAction::getLink('row_action_right', IMAGE_DELETE, 'edit'), '', tep_href_link(self::FILENAME, 'cID=' . $item['countries_id'] . '&action=edit') ,'' ).
- sprintf(CsrtAction::getLink('row_action_right', IMAGE_DELETE, 'delete'), 'fancy', tep_href_link(self::FILENAME, 'cID=' . $item['countries_id'] . '&action=delete') ,'' )
+ sprintf(CsrtAction::getLink('row_action_right', IMAGE_DELETE, 'edit'), '', tep_href_link(self::FILENAME, 'cID=' . $item['id'] . '&action=edit') ,'' ).
+ sprintf(CsrtAction::getLink('row_action_right', IMAGE_DELETE, 'delete'), 'fancy', tep_href_link(self::FILENAME, 'cID=' . $item['id'] . '&action=delete') ,'' )
);
}
@@ -445,13 +677,13 @@
*/
private static function RowStatus($item){
$exclude=array('action','pID','forceajax','type','class','function','funct', 'mod');
- $query_s='action=setflag&cID=' . $item['countries_id'].'&flag=';
+ $query_s='action=setflag&cID=' . $item['id'].'&flag=';
- return '<a class="ajaxinline" href="' . tep_href_link(self::FILENAME, tep_get_all_get_params($exclude).$query_s.(($item['country_visible'] == '1')? '0' : '1') ) . '">'.
+ return '<a class="ajaxinline" href="' . tep_href_link(self::FILENAME, tep_get_all_get_params($exclude).$query_s.(($item['visible'] == '1')? '0' : '1') ) . '">'.
sprintf(
CsrtAction::getFormat('row_flag'),
- (int)$item['country_visible'],
- ( ($item['country_visible'] == '1')? IMAGE_ICON_STATUS_GREEN : IMAGE_ICON_STATUS_RED)
+ (int)$item['visible'],
+ ( ($item['visible'] == '1')? IMAGE_ICON_STATUS_GREEN : IMAGE_ICON_STATUS_RED)
).
'</a>';
}
Modified: trunk/catalog/admin/includes/modules/pages/customers.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/customers.php 2013-10-10 08:14:26 UTC (rev 4875)
+++ trunk/catalog/admin/includes/modules/pages/customers.php 2013-10-10 09:54:26 UTC (rev 4876)
@@ -37,7 +37,7 @@
/**
@var objet $Info
*/
- public static $Info;
+// public static $Info;
/**
@var array $newsletter_array
*/
@@ -99,6 +99,7 @@
self::$modules=new AcaFactory('account'/*,'MODULE_ACCOUNT_INSTALLED_BO'*/);
// self::$modules->set_image_handler();
+ MGabCont::SetCurrentName(__CLASS__);
global $languages_id;
/**
@@ -616,8 +617,7 @@
}
$messageStack->add(__('customers save success'), 'success');
-// print_r($_SESSION);
-// exit;
+
if(isset($_POST['up_and_close']) ) tep_redirect(tep_href_link(self::FILENAME));
else tep_redirect(tep_href_link(self::FILENAME, 'cID=' .$_id.'&action=edit'));
}
Modified: trunk/catalog/admin/includes/modules/pages/newslettersModeles.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/newslettersModeles.php 2013-10-10 08:14:26 UTC (rev 4875)
+++ trunk/catalog/admin/includes/modules/pages/newslettersModeles.php 2013-10-10 09:54:26 UTC (rev 4876)
@@ -249,8 +249,53 @@
tep_redirect(tep_href_link(self::FILENAME));
break;
+ case 'update_cell':
+ try {
+ $modele = array_keys(sqlnewsletters_modeles::Specimen());
+ $params = array();
+ $params['id'] = $_REQUEST['id'];
+ if( in_array($_REQUEST['columnName'], $modele) )
+ $params['sqlarray'] = array(
+ $_REQUEST['columnName'] => (isset($_REQUEST['value']) ? tep_db_prepare_input($_REQUEST['value']) : 0)
+ );
+ else{
+ $tab = explode('[', $_REQUEST['columnName']);
+ $final = $tabs2 = array();
+ foreach($tab as $row)
+ $tabs2[] = ( (substr($row,-1)==']')?substr($row,0,-1) : $row );
+
+ $tabs3 = array_reverse($tabs2);
+ $max = count($tabs2);
+ $i=0;
+ foreach($tabs3 as $row){
+ $i++;
+ if($i==1) $final[$row] = (isset($_REQUEST['value']) ? tep_db_prepare_input($_REQUEST['value']) : 0);
+ else
+ $final[$row] = $final;
+ }
+
+ $params['post'] = $final;
+ }
+
+ $params['action']=self::$action;
+
+ $params['language_id']= $languages_id;
+
+ if( sqlnewsletters_modeles::update( $params ) != 1 )
+ throw new Exception(__('@newslettersmodeles error in update process')) ;
+
+ $messageStack->add_session(__('@newslettersmodeles success in update process'), 'success');
+
+ // display value for return
+ echo $_REQUEST['value'];
+ }
+ catch (Exception $e) {
+
+ $messageStack->add_session($e->getMessage() , 'error');
+ }
+ break;
case 'setflag':
if ( ($_GET['flag'] == '0') || ($_GET['flag'] == '1') ) {
$newsletter_id = tep_db_prepare_input($_GET['cID']);
@@ -265,6 +310,9 @@
tep_redirect(tep_href_link(self::FILENAME, 'cID=' . $_GET['cID']));
break;
+ /**
+ @remarks Normal page
+ */
case 'insert':
case 'update':
if (isset($_POST['newsletter_id'])) $newsletter_id = tep_db_prepare_input($_POST['newsletter_id']);
Modified: trunk/catalog/install/includes/sql/mysql/data/91_osc_configuration.sql
===================================================================
--- trunk/catalog/install/includes/sql/mysql/data/91_osc_configuration.sql 2013-10-10 08:14:26 UTC (rev 4875)
+++ trunk/catalog/install/includes/sql/mysql/data/91_osc_configuration.sql 2013-10-10 09:54:26 UTC (rev 4876)
@@ -165,7 +165,7 @@
-- 11 catalog options
-insert into osc_configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function, configuration_type) values ('COUNTRY_LOCALNAME_S', 'COUNTRY_LOCALNAME', 'false', 'COUNTRY_LOCALNAME_L', '11', '30', NOW(), NOW(), 'tep_value_for_humain', 'tep_cfg_select_option(array(\'true\', \'false\'),',3);
+insert into osc_configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function, configuration_type) values ('COUNTRY_LOCALNAME_S', 'COUNTRY_LOCALNAME', 'true', 'COUNTRY_LOCALNAME_L', '11', '30', NOW(), NOW(), 'tep_value_for_humain', 'tep_cfg_select_option(array(\'true\', \'false\'),',3);
insert into osc_configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function, configuration_type) values ('AJAX_CART_MODE_S', 'AJAX_CART_MODE', 'true', 'AJAX_CART_MODE_L', '11', '31', NOW(), NOW(), 'tep_value_for_humain', 'tep_cfg_select_option(array(\'true\', \'false\'),',3);
insert into osc_configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function,configuration_type) values ('ADVANCED_SEARCH_DEFAULT_OPERATOR_S', 'ADVANCED_SEARCH_DEFAULT_OPERATOR', 'and', 'ADVANCED_SEARCH_DEFAULT_OPERATOR_L', '11', '17', NULL, NOW(), NULL, 'tep_cfg_select_option(array(\'and\', \'or\'),', 3);
insert into osc_configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function, configuration_type) values ('USE_DEFAULT_LANGUAGE_CURRENCY_S', 'USE_DEFAULT_LANGUAGE_CURRENCY', 'false', 'USE_DEFAULT_LANGUAGE_CURRENCY_L', '11', '8', NULL, NOW(), 'tep_value_for_humain', 'tep_cfg_select_option(array(\'true\', \'false\'),',3);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2013-10-10 08:14:31
|
Revision: 4875
http://sourceforge.net/p/oscss/svn/4875
Author: oscim
Date: 2013-10-10 08:14:26 +0000 (Thu, 10 Oct 2013)
Log Message:
-----------
Fix hader_tag and datatype tags
Upgrade code newsletter modele, add class sqlxx, adjust html
Modified Paths:
--------------
trunk/catalog/admin/includes/gabarit/newslettersModeles/display_view.delete.gab
trunk/catalog/admin/includes/gabarit/newslettersModeles/display_view.edit.gab
trunk/catalog/admin/includes/gabarit/newslettersModeles/display_view.preview.gab
trunk/catalog/admin/includes/languages/fr_FR/modules/pages/newslettersModeles.txt
trunk/catalog/admin/includes/modules/content/header_tags.php
trunk/catalog/admin/includes/modules/pages/newslettersModeles.php
trunk/catalog/admin/includes/modules/pages/products.php
trunk/catalog/admin/includes/modules/products/header_tags.php
Added Paths:
-----------
trunk/catalog/admin/includes/classes/drivers/sqlnewsletters_modeles.php
Removed Paths:
-------------
trunk/catalog/admin/includes/gabarit/newslettersModeles/display_view.listing.gab
Added: trunk/catalog/admin/includes/classes/drivers/sqlnewsletters_modeles.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlnewsletters_modeles.php (rev 0)
+++ trunk/catalog/admin/includes/classes/drivers/sqlnewsletters_modeles.php 2013-10-10 08:14:26 UTC (rev 4875)
@@ -0,0 +1,238 @@
+<?php if (!defined('HTTP_SERVER')) die('You can not access this file directly!');
+/**
+ @licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
+ @portion code Copyright (c) 2002 osCommerce
+ @package osCSS-2 <www http://www.oscss.org>
+ @version 2.1.2
+ @date 10/10/2013, 20:48
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+ @class sqlnavigation_links
+ @file sqlnavigation_links.php
+ @brief manage db update/insert/delete for navigation_links
+*/
+
+
+
+
+class sqlnewsletters_modeles
+ implements ModSqlDataDriver{
+
+ public static $modules;
+
+ protected static $_instance;
+
+ protected function __construct(){
+ }
+
+
+ public static function getInstance() {
+ if(self::$_instance == null) self::$_instance = new self();
+ return self::$_instance;
+ }
+
+
+ /**
+ @brief create new ligne in table configuration
+ */
+ public static function create($option){
+ self::getInstance();
+
+ $DB->beginTransaction();
+
+ if(isset($post['languages_id']))$sql_data_array['languages_id'] = tep_db_prepare_input($post['languages_id']);
+ if(isset($post['status']))$sql_data_array['status'] = tep_db_prepare_input($post['status']);
+ if(isset($post['title']))$sql_data_array['title'] = tep_db_prepare_input($post['title']);
+ if(isset($post['content']))$sql_data_array['nmodele_content'] = tep_db_prepare_input($post['content']);
+
+
+ $res=tep_db_perform(TABLE_NEWSLETTERS_MODELES, $sql_data_array);
+
+ $id = $res->__get('insertId');
+
+
+ if( $error > 0){
+ $DB->rollbackTransaction();
+ return false;
+ }
+ else{
+ $DB->commitTransaction();
+ return $res->$id;
+ }
+ }
+
+ /**
+ @brief update ligne in table configuration
+ */
+ public static function update($option){
+ self::getInstance();
+
+ if(!isset($option['id']))
+ return 'id';
+
+ $DB=Database::getInstance();
+ $error = 0 ;
+ $where ='';
+
+ if(isset($option['id'])) $where .="AND nmodele_id = '".(int)$option['id']."' ";
+ if(isset($option['languages_id'])) $where .="AND languages_id = '".(int)$option['languages_id']."' ";
+ if(isset($option['status'])) $where .="AND status = '".(int)$option['status']."' ";
+
+ if(isset($option['post']))
+ $post = $option['post'];
+
+ $DB->beginTransaction();
+
+ if(isset($post['status']))$sql_data_array['status'] = tep_db_prepare_input($post['status']);
+ if(isset($post['title']))$sql_data_array['title'] = tep_db_prepare_input($post['title']);
+ if(isset($post['content']))$sql_data_array['nmodele_content'] = tep_db_prepare_input($post['content']);
+
+ if(count((array)$sql_data_array)<= 0)
+ return false;
+
+ $sql_data_array['last_update'] = 'NOW()';
+
+ $res=tep_db_perform(TABLE_NEWSLETTERS_MODELES, $sql_data_array, 'update' , substr($where,3) );
+
+
+ if( $error > 0){
+ $DB->rollbackTransaction();
+ return false;
+ }
+ else{
+ $DB->commitTransaction();
+ return 1;
+ }
+ }
+
+ /**
+ @brief load ligne in table configuration
+ @param option array
+ id => row id int (configuration_id)
+ key => string key (configuration_key)
+ group_id => group_id int (configuration_group_id)
+ @param $shortkey use cleankey for return short key
+ @return
+
+ object(stdClass)[13]
+ public 'id' => string '1' (length=1)
+
+ OR
+ array(
+ object(stdClass)[13]
+ ...
+ object(stdClass)[13]
+ ..
+ )
+
+ */
+ public static function fetch($option,$shortkey=false){
+ self::getInstance();
+ $DB=Database::getInstance();
+
+ $where ="";
+ if(isset($option['id'])) $where .="AND nmodele_id = '".(int)$option['id']."' ";
+ if(isset($option['languages_id'])) $where .="AND languages_id = '".(int)$option['languages_id']."' ";
+ if(isset($option['status'])) $where .="AND status = '".(int)$option['status']."' ";
+
+
+ if($where=='')
+ return false;
+
+
+ $sql="SELECT * FROM " . TABLE_NEWSLETTERS_MODELES . " a ".
+ " WHERE ".substr($where,3);
+
+ $res=$DB->query($sql);
+
+ $num = $res->__get('numRows');
+
+ if($num == 1){
+ $result=$res->fetchAssoc();
+
+
+
+
+ return ((!$shortkey)? $result : self::CleanKey($result));
+ }
+ elseif($num > 1){
+ $array=array();
+
+ foreach($res->fetchAllAssoc() as $result)
+ $array[]= ((!$shortkey)? $result : self::CleanKey($result));
+
+ return $array;
+ }
+
+ return false;
+ }
+
+ /**
+ @brief delete row
+ */
+ public static function delete($option){
+ self::getInstance();
+ $DB=Database::getInstance();
+
+ $where ="";
+ if(isset($option['id'])) $where .="AND nmodele_id = '".(int)$option['id']."' ";
+ if(isset($option['languages_id'])) $where .="AND languages_id = '".(int)$option['languages_id']."' ";
+ if(isset($option['status'])) $where .="AND status = '".(int)$option['status']."' ";
+
+
+ if($where=='')
+ return false;
+
+ $res = $DB->query("SELECT nav_link_id as id FROM " . TABLE_NEWSLETTERS_MODELES ." WHERE ". substr($where, 3 ).' LIMIT 1' );
+ $result = $res->fetchAssoc();
+
+
+ $DB->query("delete from " . TABLE_NAVIGATION_LINKS . " where nav_link_id = '" . (int)$result['id'] . "'");
+
+
+ return true;
+ }
+
+
+ /**
+ @brief
+ @return array product empty
+ */
+ public static function Specimen($shortkey=false){
+ $par = array(
+ 'nmodele_id' => '',
+ 'languages_id' => '',
+ 'status' => '',
+ 'date_added' => '',
+ 'last_update' => '',
+ 'title' => '',
+ 'nmodele_content' => '',
+ );
+
+ return ((!$shortkey)? $par : self::CleanKey($par));
+ }
+
+
+
+ /**
+ @fn CleanKey()
+ @brief Clean string name key
+ */
+ private static function CleanKey($array){
+ self::getInstance();
+ $object= new stdclass();
+
+ foreach($array as $key=>$value){
+ if( strpos($key,'nmodele_') ===0)
+ $key=substr($key,strlen('nmodele_'));
+
+ $object->$key = $value;
+ }
+
+ return $object;
+ }
+
+}
+
+
+?>
\ No newline at end of file
Modified: trunk/catalog/admin/includes/gabarit/newslettersModeles/display_view.delete.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/newslettersModeles/display_view.delete.gab 2013-10-09 20:05:24 UTC (rev 4874)
+++ trunk/catalog/admin/includes/gabarit/newslettersModeles/display_view.delete.gab 2013-10-10 08:14:26 UTC (rev 4875)
@@ -3,8 +3,8 @@
@licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
@portion code Copyright (c) 2002 osCommerce
@package osCSS-2 <www http://www.oscss.org>
- @version 2.1.0
- @date 22/03/11, 21:42
+ @version 2.1.2
+ @date 10/10/2013, 20:48
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
@@ -14,7 +14,7 @@
?>
<h3><?php echo __('heading title delete') ?></h3>
-<?php echo tep_draw_form('delete', newslettersModeles::FILENAME, '&nID='.$_GET['nID'].'&action=deleteconfirm', 'post') ?>
+<?php echo tep_draw_form('delete', newslettersModeles::FILENAME, '&cID='.$_GET['cID'].'&action=deleteconfirm', 'post') ?>
<p><?php echo __('txt delete') ?></p>
<?php echo tep_image_submit('', IMAGE_DELETE). tep_js_back(tep_href_link(newslettersModeles::FILENAME), IMAGE_CANCEL) ; ?>
Modified: trunk/catalog/admin/includes/gabarit/newslettersModeles/display_view.edit.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/newslettersModeles/display_view.edit.gab 2013-10-09 20:05:24 UTC (rev 4874)
+++ trunk/catalog/admin/includes/gabarit/newslettersModeles/display_view.edit.gab 2013-10-10 08:14:26 UTC (rev 4875)
@@ -3,8 +3,8 @@
@licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
@portion code Copyright (c) 2002 osCommerce
@package osCSS-2 <www http://www.oscss.org>
- @version 2.1.0
- @date 20/03/11, 20:48
+ @version 2.1.2
+ @date 10/10/2013, 20:48
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
*/
@@ -15,21 +15,18 @@
<?php echo tep_draw_form('newsletter', newslettersModeles::FILENAME, 'action='.((newslettersModeles::$action == 'edit')?'update' : 'insert') , 'post' ); ?>
<div class="edit">
<div class="box_left">
- <p><?php if (newslettersModeles::$action == 'edit') echo tep_draw_hidden_field('newsletter_id', '', newslettersModeles::$nID); ?></p>
+ <p><?php if (newslettersModeles::$action == 'edit') echo tep_draw_hidden_field('newsletter_id', '', newslettersModeles::$Id); ?></p>
<fieldset class="block_field">
<p class="block_input">
- <label for="title" title="<?php echo __('text newsletter title help') ; ?>"> <?php echo __('text newsletter title') . tep_image(DIR_WS_ICONS.'icon_help.gif'); ?></label>
- <?php echo tep_draw_input_field('title', '', newslettersModeles::$nInfo->title, '', true); ?>
+ <?php echo newslettersModeles::DisplayField('languages_id'); ?>
</p>
+ <p class="block_input">
+ <?php echo newslettersModeles::DisplayField('title'); ?>
+ </p>
-<!-- <p class="block_input">
- <label for="p_format"><?php echo __('text newsletter format'); ?></label>
- <?php echo tep_draw_pull_down_menu('p_format', array(array('id'=>'HTML', 'text'=>'html'),array('id'=>'TEXT', 'text'=>'text')), (isset($_POST['customer']) ? $_POST['customer'] : ''));?><br />
- </p>-->
<div class="block_input">
- <label for="content" title="<?php echo __('text newsletter content help') ; ?>" ><?php echo tep_image(DIR_WS_ICONS.'icon_help.gif');?></label>
- <?php echo $oscss->_call(BO_WISIWYG_SELECTED,'_draw','content','600','400',newslettersModeles::$nInfo->nmodele_content ); ?>
+ <?php echo newslettersModeles::DisplayField('content'); ?>
<div>
</fieldset>
</div>
@@ -38,10 +35,6 @@
<fieldset class="block_field">
<legend><?php echo __('heading newsletterModeles info'); ?></legend>
<p><?php echo __('txt newsletterModeles info'); ?></p>
-<!-- <p class="block_input">
- <label for="module" title="<?php echo __('text newsletter module help') ; ?>" ><?php echo tep_image(DIR_WS_ICONS.'icon_help.gif'); ?> </label>
- <?php //echo tep_draw_pull_down_menu('module', newslettersModeles::list_module_newslettersModeles(), newslettersModeles::$nInfo->module); ?>
- </p>-->
</fieldset>
<div class="button_nav">
Deleted: trunk/catalog/admin/includes/gabarit/newslettersModeles/display_view.listing.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/newslettersModeles/display_view.listing.gab 2013-10-09 20:05:24 UTC (rev 4874)
+++ trunk/catalog/admin/includes/gabarit/newslettersModeles/display_view.listing.gab 2013-10-10 08:14:26 UTC (rev 4875)
@@ -1,41 +0,0 @@
-<?php
-/**
- @licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
- @portion code Copyright (c) 2002 osCommerce
- @package osCSS-2 <www http://www.oscss.org>
- @version 2.1.0
- @date 20/03/11, 13:49
- @author oscim <mail aur...@os...> <www http://www.oscim.fr>
- @encode UTF-8
-*/
-?>
-<h3><?php echo __('heading title') ?></h3>
-
-<div class="button_nav">
- <?php echo '<a class="button" href="' . tep_href_link(newslettersModeles::FILENAME, 'action=new') . '">' . tep_image(DIR_WS_ICONS.'icon_add_new.png',IMAGE_NEW_NEWSLETTER).__('image new newsletter') . '</a>'; ?>
-</div>
-<div class="box_uniq">
- <table class="dataTable">
- <thead>
- <tr>
- <th> </th>
- <th><?php echo __('table heading newslettersModeles ID'); ?></th>
- <th class="tright"><?php echo __('table heading title'); ?></th>
- <th class="tcenter"><?php echo __('table heading status'); ?></th>
- <th class="tright"><?php echo __('table heading action'); ?></th>
- </tr>
- </thead>
- <tfoot>
- <tr>
- <th class="tcenter" width="2%"> </th>
- <th class="tcenter" width="2%"><?php echo __('table heading newslettersModeles ID'); ?></th>
- <th class="tright" width="30%"><?php echo __('table heading title'); ?></th>
- <th class="tcenter" width="2%"><?php echo __('table heading status'); ?></th>
- <th class="row_action" width="5%"><?php echo __('table heading action'); ?></th>
- </tr>
- </tfoot>
- <tbody>
- <!-- AJAX BLOCK -->
- </tbody>
- </table>
-</div>
\ No newline at end of file
Modified: trunk/catalog/admin/includes/gabarit/newslettersModeles/display_view.preview.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/newslettersModeles/display_view.preview.gab 2013-10-09 20:05:24 UTC (rev 4874)
+++ trunk/catalog/admin/includes/gabarit/newslettersModeles/display_view.preview.gab 2013-10-10 08:14:26 UTC (rev 4875)
@@ -3,25 +3,26 @@
@licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
@portion code Copyright (c) 2002 osCommerce
@package osCSS-2 <www http://www.oscss.org>
- @version 2.1.0
- @date 22/03/11, 21:43
+ @version 2.1.2
+ @date 10/10/2013, 20:48
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
*/
+
?>
<h3><?php echo __('text info preview newsletters') ?></h3>
<div class="button_nav">
- <?php echo tep_js_back(tep_href_link(newslettersModeles::FILENAME, 'nID=' . newslettersModeles::$nID), IMAGE_CANCEL) ; ?>
+ <?php echo tep_js_back(tep_href_link(newslettersModeles::FILENAME, 'cID=' . newslettersModeles::$Id), IMAGE_CANCEL) ; ?>
</div>
<table border="0" width="100%" cellspacing="2" cellpadding="2">
<tr>
- <td><tt><?php echo stripslashes(newslettersModeles::$nInfo->nmodele_content); ?></tt></td>
+ <td><tt><?php echo stripslashes(newslettersModeles::$Info->content); ?></tt></td>
</tr>
</table>
<div class="button_nav">
- <?php echo tep_js_back(tep_href_link(newslettersModeles::FILENAME, 'nID=' . newslettersModeles::$nID), IMAGE_CANCEL) ; ?>
+ <?php echo tep_js_back(tep_href_link(newslettersModeles::FILENAME, 'cID=' . newslettersModeles::$Id), IMAGE_CANCEL) ; ?>
</div>
\ No newline at end of file
Modified: trunk/catalog/admin/includes/languages/fr_FR/modules/pages/newslettersModeles.txt
===================================================================
--- trunk/catalog/admin/includes/languages/fr_FR/modules/pages/newslettersModeles.txt 2013-10-09 20:05:24 UTC (rev 4874)
+++ trunk/catalog/admin/includes/languages/fr_FR/modules/pages/newslettersModeles.txt 2013-10-10 08:14:26 UTC (rev 4875)
@@ -3,20 +3,24 @@
@licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
@portion code Copyright (c) 2002 osCommerce
@package osCSS-2 <www http://www.oscss.org>
- @version 2.1.1
- @date 02/03/2012, 20:02
+ @version 2.1.2
+ @date 10/10/2013, 20:48
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
*/
$lang['heading title']="Modèle pour les bulletins d'informations" ;
$lang['text info heading delete newsletters']="Suppression du bulletin d'informations" ;
-$lang['table heading newslettersModeles ID']="ID" ;
-$lang['table heading title']="Titre" ;
-$lang['table heading module']="Module" ;
-$lang['table heading sent']="Envoyer" ;
-$lang['table heading status']="Statut" ;
-$lang['table heading action']="Action" ;
+$lang['newslettersmodeles table heading id']="ID" ;
+$lang['newslettersmodeles table heading title']="Titre" ;
+$lang['newslettersmodeles table heading module']="Module" ;
+$lang['newslettersmodeles table heading languages id']="Langue" ;
+$lang['newslettersmodeles table heading sent']="Envoyer" ;
+$lang['newslettersmodeles table heading status']="Statut" ;
+$lang['newslettersmodeles table heading nmodele_content']="Contenu" ;
+$lang['newslettersmodeles table heading date added']="Ajouté" ;
+$lang['newslettersmodeles table heading last update']="Maj." ;
+$lang['@newslettersModeles table heading action']="Action" ;
$lang['table heading nbr send']="Envoi" ;
$lang['text newsletter format']="Format de l'Email" ;
$lang['text newsletter module titre']="Type d'envoi" ;
Modified: trunk/catalog/admin/includes/modules/content/header_tags.php
===================================================================
--- trunk/catalog/admin/includes/modules/content/header_tags.php 2013-10-09 20:05:24 UTC (rev 4874)
+++ trunk/catalog/admin/includes/modules/content/header_tags.php 2013-10-10 08:14:26 UTC (rev 4875)
@@ -114,14 +114,15 @@
'text'=>__('@header_tags table heading tags'),
'width'=>'10%',
'class'=>'tleft',
-// 'default'=>true,
- 'edit'=>array(
+ );
+
+ if(! DataTypes::is_active('tags'))
+ $array['fhtd.head_keywords_tag']['edit']=array(
'input_name'=>__CLASS__.'[head_keywords_tag]',
'input_type'=>'textarea',
// 'input_size'=>'64',
// 'required_status'=>true,
'active_value_language'=>true,
- ),
);
break;
@@ -190,6 +191,9 @@
elseif(isset(self::$pArray->head_keywords_tag) && is_string(self::$pArray->head_keywords_tag))
$pInfo->head_keywords_tag = array($language_id=> self::$pArray->head_keywords_tag);
+ if( DataTypes::is_active('tags'))
+ unset($pInfo->head_keywords_tag);
+
parent::insert_db_values(self::$pInfo->tag_id,$action,$pInfo,$language_id);
}
Modified: trunk/catalog/admin/includes/modules/pages/newslettersModeles.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/newslettersModeles.php 2013-10-09 20:05:24 UTC (rev 4874)
+++ trunk/catalog/admin/includes/modules/pages/newslettersModeles.php 2013-10-10 08:14:26 UTC (rev 4875)
@@ -3,34 +3,34 @@
@licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
@portion code Copyright (c) 2002 osCommerce
@package osCSS-2 <www http://www.oscss.org>
- @version 2.1.1
- @date 02/03/2012, 20:48
+ @version 2.1.2
+ @date 10/10/2013, 20:48
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
@class newslettersModeles
*/
+error_reporting(E_ALL);
-
class newslettersModeles
- implements ExtModPage, InterfacedTJsonS, InterfaceModule {
+ extends ModTwo /// new abstract class for nextgen module
+ implements
+ ExtModPage,
+ InterfacedTJsonS,
+ InterfaceModule {
const FILENAME ='newslettersModeles.php';
- public static $code;
- public static $action;
- public static $list=array();
-
/**
- @p int ID newsletter
+ @var array $modules
*/
- public static $nID;
+ public static $list=array();
/**
- @p obj
+ @var int current id
*/
- public static $nInfo;
+ public static $Id;
/**
- @p obj module newsletter
+ @var obj module newsletter
*/
public static $module;
@@ -53,18 +53,180 @@
self::$code=__CLASS__;
+
self::$action=(isset($_REQUEST['action'])? $_REQUEST['action'] : 'listing' );
+ self::$Id=(isset($_REQUEST['cID'])? (int)$_REQUEST['cID'] : 0 );
-
/**
@remarks not load if not first init
*/
- if(defined('JSONSTATMENT')) return;
+ if(!defined('JSONSTATMENT')) {
- //! active datatable in ajax, precise les GET necessaire
- define('JSONSTATMENT', 'mod=page&type='.self::$code);
- //! detail item in ajax
- define('AJAXSTATMENTDETAIL', 'mod=page&type='.self::$code);
+ //! active datatable in ajax, precise les GET necessaire
+ define('JSONSTATMENT', 'ModTwo=true&mod=page&type='.self::$code);
+ //! detail item in ajax
+ define('AJAXSTATMENTDETAIL', 'mod=page&type='.self::$code);
+
+
+ }
+
+ $list_lg = array();
+ foreach(tep_get_languages() as $row)
+ $list_lg[] = array('id'=>$row['id'], 'text'=>$row['name']);
+
+ MGabCont::SetCurrentName(__CLASS__);
+
+ /**
+ @remarks define var execution sql in GetDBValue()
+ */
+ self::$InitInfo['adjust']=array(
+ 'languages_id'=>$languages_id,
+ 'page'=>1,
+ 'rowbyp'=>10,
+ 'sOrder'=>'',
+ 'sWhere'=>'',
+ );
+
+
+ /**
+ @remarks this define col theader title, and ajust html code
+ Just for Edit listing
+ */
+ self::$allfields = array();
+
+ self::$allfields['nm.nmodele_id'] = array(
+ 'sort'=>true,
+ 'search'=>true,
+ 'alias'=>'id',
+ 'text'=>__('newslettersmodeles table heading id'),
+ 'width'=>'2%',
+ 'class'=>'tcenter',
+ 'default'=>true,
+ );
+ self::$allfields['nm.languages_id'] = array(
+ 'sort'=>true,
+ 'search'=>true,
+ 'alias'=>'languages_id',
+ 'text'=>__('newslettersmodeles table heading languages id'),
+ 'width'=>'2%',
+ 'class'=>'tcenter',
+ 'default'=>true,
+ 'edit'=>array(
+ 'input_type'=>'select',
+ 'input_size'=>'1',
+ 'input_name'=>'languages_id',
+ 'select_values'=>$list_lg,
+ ),
+ );
+ self::$allfields['nm.status'] = array(
+ 'sort'=>true,
+ 'search'=>true,
+ 'alias'=>'status',
+ 'text'=>__('newslettersmodeles table heading status'),
+ 'width'=>'2%',
+ 'class'=>'tcenter',
+ 'default'=>true,
+ );
+ self::$allfields['nm.title'] = array(
+ 'sort'=>true,
+ 'search'=>true,
+ 'alias'=>'title',
+ 'text'=>__('newslettersmodeles table heading title'),
+ 'width'=>'20%',
+ 'class'=>'tcenter',
+ 'default'=>true,
+ 'edit'=>array(
+ 'input_name'=>'title',
+ 'input_size'=>'64',
+ 'required_status'=>true,
+// 'active_value_language'=>true,
+ ),
+ );
+ self::$allfields['nm.nmodele_content'] = array(
+ 'sort'=>true,
+ 'search'=>true,
+ 'alias'=>'content',
+ 'text'=>__('newslettersmodeles table heading nmodele_content'),
+ 'width'=>'30%',
+ 'class'=>'tcenter',
+ 'default'=>true,
+ 'edit'=>array(
+ 'input_type'=>'textarea@advanced',
+ 'input_name'=>'content',
+ 'input_size'=>'1',
+ 'required_status'=>true,
+// 'active_value_language'=>true,
+ ),
+ );
+ self::$allfields['nm.date_added'] = array(
+ 'sort'=>true,
+ 'search'=>true,
+ 'alias'=>'added',
+ 'text'=>__('newslettersmodeles table heading date added'),
+ 'width'=>'5%',
+ 'class'=>'tcenter',
+ 'default'=>true,
+ );
+ self::$allfields['nm.last_update'] = array(
+ 'sort'=>true,
+ 'search'=>true,
+ 'alias'=>'modified',
+ 'text'=>__('newslettersmodeles table heading last update'),
+ 'width'=>'5%',
+ 'class'=>'tcenter',
+ 'default'=>true,
+ );
+
+
+ /// @remarks min fields and not view directly colonne fields
+ $listfield = ' nm.nmodele_id as id, ';
+
+ /// @remarks Active forms filter
+ $mutli=array();
+
+ /**
+ @remarks Active forms filter
+ @note
+ array[
+ // For normalised filter define on method ConvertInitVar
+ generic =>
+ array (
+ 'string'
+ // , ....
+ );
+ mod =>
+ array(
+ 'title'=>__('@products filter tab manufacturer'),
+ 'content'=>tep_get_include_contents('manufacturers/filter.manufacturer'),
+ )
+ ]
+ */
+ $tab = array();
+
+ /**
+ @remarks this define menu master module in page
+ @note use $boutons[action][] = array(params)
+
+ params :
+ 'type'=>'getLink',
+ 'format'=>'button_nav',
+ 'image'=>'',
+ 'cssclass'=>'button',
+ 'title'=>__('image create new content'),
+ 'url'=>tep_href_link(self::FILENAME, 'action=new'),
+ */
+ $boutons = array();
+
+
+ /**
+ Call Base Init and construct $InitInfo for process Filter
+ $listfield string list row in db
+ $mutli array action multiple
+ $filter array put list off activate tab filter
+ $boutons array
+ */
+ self::ConvertInitVar( $listfield, $mutli, $tab, $boutons);
+
}
@@ -76,18 +238,31 @@
$DB=Database::getInstance();
switch (self::$action) {
+ /**
+ @remarks specific save in session value filters
+ */
+ case 'filters':
+ /*
+ Call Prev Process
+ */
+ self::actionFilter();
+
+ tep_redirect(tep_href_link(self::FILENAME));
+ break;
+
+
case 'setflag':
if ( ($_GET['flag'] == '0') || ($_GET['flag'] == '1') ) {
- $newsletter_id = tep_db_prepare_input($_GET['nID']);
+ $newsletter_id = tep_db_prepare_input($_GET['cID']);
if (!empty($newsletter_id))
- $DB->query("update " . TABLE_NEWSLETTERS_MODELES . " set status = '" .(int) $_GET['flag'] . "' where nmodele_id = '" . (int)$newsletter_id . "'");
+ sqlnewsletters_modeles::update(array('id'=> (int)$newsletter_id , 'post'=>array('status'=>(int) $_GET['flag'] )));
}
- $messageStack->add(__('@newslettersModeles update status'), 'success');
+ $messageStack->add(__('@newslettersModeles update status'), 'success');
- if(!isset($_GET['forceajax']))
- tep_redirect(tep_href_link(self::FILENAME, 'nID=' . $_GET['nID']));
+ if(!isset($_GET['forceajax']))
+ tep_redirect(tep_href_link(self::FILENAME, 'cID=' . $_GET['cID']));
break;
case 'insert':
@@ -119,7 +294,7 @@
tep_db_perform(TABLE_NEWSLETTERS_MODELES, $sql_data_array, 'update', "nmodele_id = '" . (int)$newsletter_id . "'");
}
- tep_redirect(tep_href_link(self::FILENAME, 'nID=' . $newsletter_id));
+ tep_redirect(tep_href_link(self::FILENAME, 'cID=' . $newsletter_id));
} else {
//! init wisywyg
$oscss->_add_ext(BO_WISIWYG_SELECTED,'editeur/');
@@ -128,9 +303,12 @@
break;
case 'deleteconfirm':
- $newsletter_id = tep_db_prepare_input($_GET['nID']);
+ $newsletter_id = tep_db_prepare_input($_GET['cID']);
- $DB->query("delete from " . TABLE_NEWSLETTERS_MODELES . " where nmodele_id = '" . (int)$newsletter_id . "'");
+ if( ! sqlnewsletters_modeles::delete(array('id'=>$newsletter_id)) )
+ $messageStack->add(__('@newslettersModeles error in process delete'), 'error');
+ else
+ $messageStack->add(__('@newslettersModeles update status'), 'success');
tep_redirect(tep_href_link(self::FILENAME));
break;
@@ -138,16 +316,6 @@
case 'edit':
case 'new':
-
- $parameters = array('title' => '',
- 'content' => '',
- 'module' => '');
-
- self::$nInfo = new objectInfo($parameters);
-
-
- // $nInfo->objectInfo($_POST);
-
//! init wisywyg
$oscss->_add_ext(BO_WISIWYG_SELECTED,'editeur/');
echo $oscss->_call(BO_WISIWYG_SELECTED,'_top','content','600','400');
@@ -163,12 +331,86 @@
}
- public static function load_db_values($ID){
+ /**
+ @fn featured::GetDBValue();
+ @brief return DB value adapted for current action
+ Use self::action for determine switch
+ @return
+ */
+ public static function GetDBValue(){
+
$DB=Database::getInstance();
- $query_raw ="select nmodele_id, languages_id,status, title, nmodele_content from " . TABLE_NEWSLETTERS_MODELES . " where nmodele_id = '" . $ID . "'";
- $_query = $DB->query($query_raw);
- return new objectInfo($_query->fetchAssoc() );
+
+ $action=self::$action;
+
+ switch ($action) {
+ case 'preview':
+ case 'new':
+ case 'delete':
+ case 'noedit':
+ case 'edit':
+ case 'copy_to':
+ global $languages_id;
+
+ if(self::$Id > 0)
+ $res=sqlnewsletters_modeles::fetch(array('id'=> (int)self::$Id, 'language_id'=>$languages_id ), true);
+ else
+ $res=sqlnewsletters_modeles::Specimen(true);
+
+ $res=self::FormatDBValue($res);
+
+ return $res;
+ break;
+
+ case 'listing':
+ default:
+
+
+ /**
+ @remarks retrun object load one inventaire
+ */
+ global $query_numrows, $conf;
+ $adjust=new objectInfo(self::$InitInfo['adjust']);
+
+
+ /**
+ @remarks replace id by name col
+ */
+ if(!empty($adjust->sWhere)) {
+
+ foreach(self::$allfields as $key=>$row){
+ if(is_array($row) && isset($row['alias']) ){
+ $k[] = '#[(]'.$row['alias'].'[)]#i';
+ $k[] = '# '.$row['alias'].' #i';
+ $k[] = '# \.'.$row['alias'].'#i';
+
+ $v[] = '('.$key.')';
+ $v[] = ' '.$key.' ';
+ $v[] = '.'.$key.' ';
+ }
+ }
+
+ if(isset($k))
+ $adjust->sWhere = preg_replace($k,$v, $adjust->sWhere);
+ }
+
+
+ $query_raw = "select ".$adjust->listfields;
+ $query_raw .=" FROM " . TABLE_NEWSLETTERS_MODELES . " nm ";
+
+ $query_raw .=" ORDER BY ".((!empty($adjust->sOrder)) ? $adjust->sOrder : ' nm.nmodele_id DESC ');
+
+ $_query = $DB->query($query_raw);
+ $query_numrows = $_query->__get('numRows');
+
+ $_split = new splitPageResults($adjust->page, $adjust->rowbyp, $query_raw, $query_numrows);
+ $_query = $DB->query($query_raw);
+
+ $res=self::FormatDBValue($_query);
+
+ return $res;
+ }
}
@@ -182,36 +424,36 @@
@remarks Ajax View result
*/
case 'setflag':
- return self::get_item_status(array('status'=>(int)$_GET['flag'], 'nmodele_id'=>(int)$_GET['nID']));
+ return self::RowStatus(array('status'=>(int)$_GET['flag'], 'nmodele_id'=>(int)self::$Id));
break;
/**
@remarks Normal View Page
*/
case 'delete':
- self::$nID=(int)$_GET['nID'];
+ self::$Id=(int)$_GET['cID'];
break;
case 'insert':
case 'update':
- self::$nID=(int)$_GET['nID'];
- self::$nInfo=new objectInfo($_POST);
$action='edit';
break;
case 'new':
case 'edit':
- if(isset($_GET['nID'])){
- self::$nID=(int)$_GET['nID'];
- self::$nInfo=self::load_db_values(self::$nID);
+ if(self::$Id > 0){
+ self::$Info=self::GetDBValue(self::$Id);
}
$action='edit';
break;
case 'preview':
- self::$nID=(int)$_GET['nID'];
- self::$nInfo=self::load_db_values(self::$nID);
+ self::$Info=self::GetDBValue(self::$Id);
break;
default:
self::tep_get_list();
$action='listing';
+
+ /// use master gabarit
+ MGabCont::SetCurrentName(__CLASS__);
+ return MGabCont::CallGab('listing',__FUNCTION__,self::MASTER);
}
/// use master gabarit
return MGabCont::CallGab($action,__FUNCTION__,__CLASS__);
@@ -220,20 +462,20 @@
/** public static InterfacedTJsonS */
- private static function get_item_action($array){
+ public static function ButtonRowsActions($array){
return sprintf(
CsrtAction::getFormat('row_action'),
'',
- sprintf(CsrtAction::getLink('row_action_right', ICON_PREVIEW, 'preview'), '', tep_href_link(self::FILENAME, 'nID=' . $array['nmodele_id']. '&action=preview') ,'' ).
- sprintf(CsrtAction::getLink('row_action_right', IMAGE_EDIT, 'edit'), '', tep_href_link(self::FILENAME, 'nID=' . $array['nmodele_id']. '&action=edit') ,'' ).
- sprintf(CsrtAction::getLink('row_action_right', IMAGE_DELETE, 'delete'), 'fancy', tep_href_link(self::FILENAME, 'nID=' . $array['nmodele_id'] . '&action=delete') ,'' )
+ sprintf(CsrtAction::getLink('row_action_right', ICON_PREVIEW, 'preview'), '', tep_href_link(self::FILENAME, 'cID=' . $array['id']. '&action=preview') ,'' ).
+ sprintf(CsrtAction::getLink('row_action_right', IMAGE_EDIT, 'edit'), '', tep_href_link(self::FILENAME, 'cID=' . $array['id']. '&action=edit') ,'' ).
+ sprintf(CsrtAction::getLink('row_action_right', IMAGE_DELETE, 'delete'), 'fancy', tep_href_link(self::FILENAME, 'cID=' . $array['id'] . '&action=delete') ,'' )
);
}
- private static function get_item_status($newslettersModeles){
- $exclude=array('action','nID','forceajax','type','class','function','funct', 'mod');
- $query_s='action=setflag&nID=' . $newslettersModeles['nmodele_id'].'&flag=';
+ public static function RowStatus($newslettersModeles){
+ $exclude=array('action','cID','forceajax','type','class','function','funct', 'mod');
+ $query_s='action=setflag&cID=' . $newslettersModeles['id'].'&flag=';
return '<a class="ajaxinline" href="' . tep_href_link(self::FILENAME, tep_get_all_get_params($exclude).$query_s.(($newslettersModeles['status'] == '1')? '0' : '1') ) . '">'.
sprintf(
@@ -246,46 +488,28 @@
- private static function emptyResult(){
- $li=array();
- foreach(self::tep_get_modele() as $k=>$v) $li[$k]=' ';
- return $li;
- }
+ public static function tep_get_list($page=1,$rowbyp=10,$sOrder='',$sWhere='',$options=''){
- public static function tep_get_modele(){
- return array( 0 =>false,
- 'nmodele_id' =>true,
- 'title'=>true,
- 'status'=>true,
- 'action'=>false,
- );
- }
+ global $query_numrows;
- public static function tep_get_list($page=1,$rowbyp=10,$sOrder='',$sWhere='',$options=''){
- global $query_numrows, $languages_id;
+ /// @remarks force load conf
+ self::GetConf();
- $DB=Database::getInstance();
+ $res=array();
- $query_raw ="select nmodele_id, languages_id,status,title, nmodele_content from " . TABLE_NEWSLETTERS_MODELES . " ".$sWhere." ORDER BY ".((!empty($sOrder)) ? $sOrder : " date_added DESC ");
- $split = new splitPageResults($page, $rowbyp, $query_raw, $query_numrows);
+ /**
+ @remarks adjust param for sql requete
+ */
+ self::$InitInfo['adjust']['page']=$page;
+ self::$InitInfo['adjust']['rowbyp']=$rowbyp;
+ self::$InitInfo['adjust']['sOrder'].=$sOrder;
+ self::$InitInfo['adjust']['sWhere'].=$sWhere;
+ self::$InitInfo['adjust']['options']=$options;
- $query = $DB->query($query_raw);
+ $res = self::GetDBValue();
- while ($item = $query->fetchAssoc() ) {
- $item[0]=$item['nmodele_id'];
- $item['action']=self::get_item_action($item);
- $item['status']=self::get_item_status($item);
-// $item['locked']=self::get_item_locked($item);
- $item['nmodele_content']=$item['nmodele_content'];
- self::$list[]=$item;
- }
+ self::$list= $query_numrows ;
- $li=$res=array();
- foreach(self::$list as $item){
- foreach(self::tep_get_modele() as $k=>$v) $li[$k]=(tep_not_null($item[$k]))?$item[$k]:' ';
- $res[]=$li;
- }
- if(count($res)==0) $res[]=self::emptyResult();
return $res;
}
@@ -295,13 +519,92 @@
public static function detail_row_page($id){
global $language;
- self::$nID=(int)$id;
- self::$nInfo=self::load_db_values((int)$id);
- self::load_module();
+ self::$Id=(int)$id;
+// self::$Info=self::GetDBValue((int)$id);
+// self::load_module();
return MGabCont::CallGab('inline','display_view',__CLASS__);
}
+ /**
+ @brief format db value for display page
+ @param $_query ressource db sql
+ @param $force_action string for precise current action
+ @return array
+ */
+ public static function FormatDBValue($_query, $force_action=false){
+ $DB=Database::getInstance();
+ $res=array();
+
+ $action =( ($force_action !=false) ? $force_action : self::$action);
+
+ switch ($action) {
+
+ case 'listing':
+ global $query_numrows,$languages_id, $price,$conf;
+ $lg = tep_get_languages();
+
+ while ($item = $_query->fetchAssoc()) {
+ $ord =array();
+
+
+// $item[1]=tep_draw_checkbox_field('action_multi['.$item['id'].']','action_mutli_'.$item['id'],$item['id'],false, '','class="multi"');
+
+
+ foreach(self::$InitInfo['modele']['listing'] as $k=>$row){
+
+
+ if($k == 'action') $ord[$k]=self::ButtonRowsActions($item);
+ elseif($k == 'status') $ord[$k]=self::RowStatus($item);
+ elseif(in_array($k , array('added', 'modified' ,'available')) ) $ord[$k]=( (strlen($item[$k])==19 && !in_array($item[$k] ,array('1000-01-01 00:00:00', '0000-00-00 00:00:00' )) )? tep_date_short($item[$k]) : '' );
+ elseif($k == 'languages_id'){
+ foreach ($lg as $row_lg) {
+ if($item[$k] == $row_lg['id']) $ord[$k]= tep_language_image( $row_lg['directory'] . '/images/' . $row_lg['image'], $row_lg['name']) /*. ' '.$row_lg['name']*/;
+ }
+ }
+ else $ord[$k]=$item[$k];
+ }
+ $ord[0]=$item['id'];
+
+
+
+ $res[]=$ord;
+ }
+ break;
+
+ case 'detail':
+ case 'new':
+ case 'delete':
+ case 'noedit':
+ case 'edit':
+ case 'copy_to':
+ default:
+ global $languages_id;
+
+ $ord =array();
+
+ if(is_object($_query)){
+ $res = new stdClass;
+ foreach($_query as $key=>$row) {
+ switch($key){
+ default:
+
+ if( ($new_r = self::GetEditFieldsDefine($key) ) && $new_r !=false ){
+ $new_r['input_value'] = $row;
+ $edit = 'edit_'.$key;
+ $res->$edit = new objectInfo($new_r);
+ }
+
+ $res->$key = $row;
+ }
+ }
+ }
+
+ }
+
+ return $res;
+ }
+
/** Interface module */
public function check() { return false; }
@@ -342,10 +645,10 @@
*/
private static function load_module(){
global $language;
- include(DIR_WS_LANGUAGES . $language . '/modules/newslettersModeles/' . self::$nInfo->module . '.txt');
- if(!class_exists(self::$nInfo->module))include(DIR_WS_MODULES . 'newslettersModeles/' . self::$nInfo->module . '.php');
- $module_name = self::$nInfo->module;
- self::$module = new $module_name(self::$nID,self::$nInfo->title, self::$nInfo->content);
+ include(DIR_WS_LANGUAGES . $language . '/modules/newslettersModeles/' . self::$Info->module . '.txt');
+ if(!class_exists(self::$Info->module))include(DIR_WS_MODULES . 'newslettersModeles/' . self::$Info->module . '.php');
+ $module_name = self::$Info->module;
+ self::$module = new $module_name(self::$Id,self::$Info->title, self::$Info->content);
self::$uhtml_received_count = self::$module->count_sended;
self::$uhtml_want_count = self::$module->count;
Modified: trunk/catalog/admin/includes/modules/pages/products.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/products.php 2013-10-09 20:05:24 UTC (rev 4874)
+++ trunk/catalog/admin/includes/modules/pages/products.php 2013-10-10 08:14:26 UTC (rev 4875)
@@ -833,7 +833,7 @@
// }
tep_redirect(tep_href_link(self::FILENAME));
-// break;
+ break;
/**
Modified: trunk/catalog/admin/includes/modules/products/header_tags.php
===================================================================
--- trunk/catalog/admin/includes/modules/products/header_tags.php 2013-10-09 20:05:24 UTC (rev 4874)
+++ trunk/catalog/admin/includes/modules/products/header_tags.php 2013-10-10 08:14:26 UTC (rev 4875)
@@ -123,14 +123,15 @@
'text'=>__('@header_tags table heading tags'),
'width'=>'10%',
'class'=>'tleft',
-// 'default'=>true,
- 'edit'=>array(
+ );
+
+ if(! DataTypes::is_active('tags'))
+ $array['fhtd.head_keywords_tag']['edit']=array(
'input_name'=>__CLASS__.'[head_keywords_tag]',
'input_type'=>'textarea',
// 'input_size'=>'64',
// 'required_status'=>true,
'active_value_language'=>true,
- ),
);
break;
@@ -202,6 +203,9 @@
elseif(isset(self::$pArray->head_keywords_tag) && is_string(self::$pArray->head_keywords_tag))
$pInfo->head_keywords_tag = array($language_id=> self::$pArray->head_keywords_tag);
+ if( DataTypes::is_active('tags'))
+ unset($pInfo->head_keywords_tag);
+
parent::insert_db_values(self::$pInfo->tag_id,$action,$pInfo,$language_id);
}
@@ -247,7 +251,10 @@
Draw
*/
public function display_edit(&$contents, $product_id) {
- $contents[]=array('title'=> __('tab meta'),'text'=>tep_get_include_contents('products/'.__CLASS__.'/'.__FUNCTION__.'.edit'));
+ $contents[]=array(
+ 'title'=> __('tab meta'),
+ 'text'=>tep_get_include_contents('products/'.__CLASS__.'/'.__FUNCTION__.'.edit')
+ );
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2013-10-09 20:05:29
|
Revision: 4874
http://sourceforge.net/p/oscss/svn/4874
Author: oscim
Date: 2013-10-09 20:05:24 +0000 (Wed, 09 Oct 2013)
Log Message:
-----------
Fix
Modified Paths:
--------------
trunk/catalog/admin/includes/modules/pages/categories.php
Modified: trunk/catalog/admin/includes/modules/pages/categories.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/categories.php 2013-10-09 15:44:57 UTC (rev 4873)
+++ trunk/catalog/admin/includes/modules/pages/categories.php 2013-10-09 20:05:24 UTC (rev 4874)
@@ -381,10 +381,6 @@
*/
case 'update_cell':
try {
- if($_REQUEST['columnName'] == 'products_ref'){
- if( sqlcontent::fetch(array('ref'=>$_REQUEST['value'])) != false)
- throw new Exception(__('@cms_content ref is already used') ) ;
- }
$modele = array_keys(sqlcategorie::Specimen());
$params = array();
@@ -836,6 +832,8 @@
/**
@remarks Ajax View result
*/
+ case 'update_cell':
+ break;
case 'setflag':
return self::RowStatus(array('status'=>(int)$_GET['flag'], 'id'=>(int)self::$Id));
break;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2013-10-09 15:44:59
|
Revision: 4873
http://sourceforge.net/p/oscss/svn/4873
Author: oscim
Date: 2013-10-09 15:44:57 +0000 (Wed, 09 Oct 2013)
Log Message:
-----------
Fix parent config menu
Modified Paths:
--------------
trunk/catalog/install/includes/sql/mysql/data/91_osc_configuration_group.sql
Modified: trunk/catalog/install/includes/sql/mysql/data/91_osc_configuration_group.sql
===================================================================
--- trunk/catalog/install/includes/sql/mysql/data/91_osc_configuration_group.sql 2013-10-09 15:42:38 UTC (rev 4872)
+++ trunk/catalog/install/includes/sql/mysql/data/91_osc_configuration_group.sql 2013-10-09 15:44:57 UTC (rev 4873)
@@ -75,7 +75,7 @@
insert into osc_configuration_group values (41, 'PAYMENT', NULL, 0, 1, 40, '0', 'MODPAYMENT');
insert into osc_configuration_group values (43 , 'OPTION_CONTENT', NULL, 0 , 1, 127, '1', 'OPTION_CONTENT');
- insert into osc_configuration_group values (44, 'CONFIG_CONTENT', NULL , 0, 1, 44, '0', 'DATATYPECONTENT');
+ insert into osc_configuration_group values (44, 'CONFIG_CONTENT', NULL , 0, 1, 43, '0', 'DATATYPECONTENT');
-- hidden in menu configuration
insert into osc_configuration_group values (37 , 'VIEW_SYSINFO', NULL, 0 , 0, 120, '1', 'MODSYSINFO');
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2013-10-09 15:42:43
|
Revision: 4872
http://sourceforge.net/p/oscss/svn/4872
Author: oscim
Date: 2013-10-09 15:42:38 +0000 (Wed, 09 Oct 2013)
Log Message:
-----------
Following development, finalization of the class MLinkTo, delaying the use of standardized and LeftTo RightTo calls SQLxxx functions in drivers
Modified Paths:
--------------
trunk/catalog/admin/includes/classes/MLinkTo.php
trunk/catalog/admin/includes/classes/drivers/sqlcategorie.php
trunk/catalog/admin/includes/classes/drivers/sqlcontent.php
trunk/catalog/admin/includes/classes/drivers/sqlfeatured.php
trunk/catalog/admin/includes/classes/drivers/sqlproduct.php
trunk/catalog/admin/includes/gabarit/categories/rightto.edit.gab
trunk/catalog/admin/includes/gabarit/cms_content/display_view.edit.gab
trunk/catalog/admin/includes/gabarit/featureds/rightto.edit.gab
trunk/catalog/admin/includes/gabarit/products/display_view.edit.gab
trunk/catalog/includes/modules/listing.php
Modified: trunk/catalog/admin/includes/classes/MLinkTo.php
===================================================================
--- trunk/catalog/admin/includes/classes/MLinkTo.php 2013-10-09 09:41:02 UTC (rev 4871)
+++ trunk/catalog/admin/includes/classes/MLinkTo.php 2013-10-09 15:42:38 UTC (rev 4872)
@@ -76,12 +76,12 @@
base is childs, and left to parent
*/
public static function SqlLeftTo($child, $child_id, $array){
-
+ $r = array();
foreach(self::$RL as $rows){
if(DataTypes::is_active($rows)) {
$child = self::RetroDatatype($child);
if(count($array[$rows]) > 0)
- $r = call_user_func(array('sql'.$rows , 'AddLinkTo'),
+ $r[] = call_user_func(array('sql'.$rows , 'AddLinkTo'),
array(
'datatype'=> $child,
'id'=> $child_id,
@@ -89,7 +89,7 @@
)
);
else
- $r = call_user_func(array('sql'.$rows , 'AddLinkTo'),
+ $r[] = call_user_func(array('sql'.$rows , 'AddLinkTo'),
array(
'datatype'=> $child,
'id'=> $child_id,
@@ -109,7 +109,28 @@
@brief load block for manipulate data in sqlxxx
base in parent and right to childs
*/
- public static function SqlRightTo($classname, $action ){
+ public static function SqlRightTo($child, $child_id, $array=array()){
+ $r = array();
+
+ foreach(self::$RL as $rows){
+ if(DataTypes::is_active($rows)) {
+ $child = self::RetroDatatype($child);
+ $r[$rows] = call_user_func(array('sql'.$rows , 'ListLinkTo'),
+ array(
+ 'datatype'=> $child,
+ 'id'=> $child_id,
+ )
+ );
+
+ }
+ }
+
+ foreach($r as $row)
+ if(!is_array($row))
+ return false;
+
+
+ return $r;
}
/**
Modified: trunk/catalog/admin/includes/classes/drivers/sqlcategorie.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlcategorie.php 2013-10-09 09:41:02 UTC (rev 4871)
+++ trunk/catalog/admin/includes/classes/drivers/sqlcategorie.php 2013-10-09 15:42:38 UTC (rev 4872)
@@ -408,13 +408,58 @@
*/
public static function DataInCat($datatype, $data_id, $data_array_link=array()){
return self::AddLinkTo(array(
- 'datatype'=>$datatype,
- 'id'=>$data_id,
+ 'datatype'=>$datatype,
+ 'id'=>$data_id,
'_array'=>$data_array_link
));
}
+ /**
+ @brief Function link to for contruct link featured vs datatype
+ @note normlised methode used in childs datatype
+ */
+ public static function ListLinkTo($opt){
+ if(!isset($opt['id']))
+ return false;
+ else
+ $id = (int)$opt['id'];
+
+ if(isset($opt['datatype']))
+ $datatype = $opt['datatype'] ;
+ else
+ $datatype = DATATYPES_DEFAULT_NOSELECTED;
+
+ switch($datatype){
+ case 'product': // retro compatible
+ $datatype = $datatype.'s';
+ break;
+ default:
+ $datatype = $datatype;
+ }
+
+ $DB=Database::getInstance();
+
+ $table = tep_cst_define('TABLE_'.strtoupper($datatype).'_TO_CATEGORIES');
+
+ if($table =='false')
+ return false;
+
+ $res = $DB->query($sql="SELECT * FROM " . $table . " WHERE ".$datatype."_id = " . (int)$id . " ");
+
+
+ foreach($res->fetchAllAssoc() as $row)
+ $list[] = new objectInfo( $row );
+
+
+ if(is_object($list))
+ $liste[]=$list;
+ else
+ $liste=$list;
+
+ return $liste;
+ }
+
/**
@brief Function link to for contruct link featued vs datatype
@note normlised methode used in childs datatype
Modified: trunk/catalog/admin/includes/classes/drivers/sqlcontent.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlcontent.php 2013-10-09 09:41:02 UTC (rev 4871)
+++ trunk/catalog/admin/includes/classes/drivers/sqlcontent.php 2013-10-09 15:42:38 UTC (rev 4872)
@@ -267,32 +267,17 @@
tep_db_free_result($content_query);
}
- /**
- TODO Couplage avec MLinkto + datatype actif
- */
- if(DataTypes::is_active('categorie')) {
- $cat_query = $DB->query("select categories_id from " . TABLE_CONTENT_TO_CATEGORIES . " where content_id='" . (int)$row['content_id'] . "' ");
- while($cat_l = tep_db_fetch_array($cat_query)){ $cat_list[$cat_l['categories_id']]=$cat_l; }
- $row['categories']=$cat_list;
- tep_db_free_result($cat_query);
- }
- if( DataTypes::is_active('featured')) {
- $res= sqlfeatured::ListLinkTo(
- array(
- 'datatype'=> 'content',
- 'id'=> $ID,
- ), true
- );
- if($res !=false)
- foreach($res as $row2)
- $row['featureds'][$row2->featured_id]=$row2;
- }
+ /*
+ Use transversal Datatype Rootlisting and update in data
+ */
+ $r = MLinkTo::SqlRightTo('content', $row['content_id']) ;
+ if($r == false)
+ $error++;
+ else
+ $row = array_merge($row,$r);
-
-// self::$modules->load_db_values((int)$row['content_id']);
-
$row['mod'] = self::$modules->fetch(array('content_id'=>$row['content_id'], 'shortkey'=>$shortkey));
// put all val origin module in current result
Modified: trunk/catalog/admin/includes/classes/drivers/sqlfeatured.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlfeatured.php 2013-10-09 09:41:02 UTC (rev 4871)
+++ trunk/catalog/admin/includes/classes/drivers/sqlfeatured.php 2013-10-09 15:42:38 UTC (rev 4872)
@@ -334,7 +334,9 @@
true
);
- if(is_object($list))
+ if(!$list)
+ return array();
+ elseif(is_object($list))
$liste[]=$list;
else
$liste=$list;
Modified: trunk/catalog/admin/includes/classes/drivers/sqlproduct.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlproduct.php 2013-10-09 09:41:02 UTC (rev 4871)
+++ trunk/catalog/admin/includes/classes/drivers/sqlproduct.php 2013-10-09 15:42:38 UTC (rev 4872)
@@ -253,6 +253,7 @@
// $price=price::getInstance();
$cat_list =array();
+ $error = 0;
$sql ="AND ";
if(isset($option['id'])){
@@ -300,15 +301,13 @@
, p.products_ordered
FROM " . TABLE_PRODUCTS . " p ".
" WHERE 1 ". $sql;
-// echo($sql_query);
+
$product_query = $DB->query( $sql_query );
if( ! $product_query->__get('numRows') )
return false;
$product = $product_query->fetchAssoc();
-// var_dump($product);
-// exit;
tep_db_free_result($product_query);
@@ -329,29 +328,16 @@
//
-/**
- TODO Couplage avec MLinkto + datatype actif
-*/
- if(DataTypes::is_active('categorie')) {
- $cat_query = $DB->query("select categories_id from " . TABLE_PRODUCTS_TO_CATEGORIES . " where products_id='" . (int)tep_db_input($ID) . "' ");
- while($cat_l = tep_db_fetch_array($cat_query)){
- $cat_list[$cat_l['categories_id']]=$cat_l;
- }
- $product['categories']=$cat_list;
- tep_db_free_result($cat_query);
- }
- if( DataTypes::is_active('featured')) {
- $res= sqlfeatured::ListLinkTo(
- array(
- 'datatype'=> 'product',
- 'id'=> $ID,
- ), true
- );
- if(is_array($res) && count($res)>0)
- foreach($res as $row)
- $product['featureds'][$row->featured_id]=$row;
- }
+ /*
+ Use transversal Datatype Rootlisting and update in data
+ */
+ $r = MLinkTo::SqlRightTo('product', $ID) ;
+ if($r == false)
+ $error++;
+ else
+ $product = array_merge($product,$r);
+
$product['products_date_available']=(isset($product['products_date_available'])? $product['products_date_available'] : '');
// <!-- BOF Separate Pricing Per Customer -->
@@ -376,20 +362,7 @@
return ((!$shortkey)? $product : self::CleanKey($product) );
-// if($num == 1){
-// $result=$res->fetchAssoc();
-// return self::CleanKey($result);
-// }
-// elseif($num > 1){
-// $array=array();
-//
-// foreach($res->fetchAllAssoc() as $lg)
-// $array[]= self::CleanKey($lg);
-//
-// return $array;
-// }
-// return false;
}
/**
Modified: trunk/catalog/admin/includes/gabarit/categories/rightto.edit.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/categories/rightto.edit.gab 2013-10-09 09:41:02 UTC (rev 4871)
+++ trunk/catalog/admin/includes/gabarit/categories/rightto.edit.gab 2013-10-09 15:42:38 UTC (rev 4872)
@@ -11,6 +11,8 @@
global $oscss;
$curr = MLinkTo::$currclass;
+
+
?>
<div class="LinkToView CategoryView">
<label>
@@ -29,7 +31,7 @@
<ul class="LinkToView">
- <?php foreach($curr::$Info->categories as $v): $k=$v['categories_id']; ?>
+ <?php foreach($curr::$Info->categorie as $v): $k=$v->categories_id; ?>
<li class="selected">
<?php echo tep_draw_checkbox_field('linkto[categorie]['.$k.']','cat_'.$k, tep_get_generated_category_path_ids($k), true ).' '.tep_get_category_name($k) ?>
Modified: trunk/catalog/admin/includes/gabarit/cms_content/display_view.edit.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/cms_content/display_view.edit.gab 2013-10-09 09:41:02 UTC (rev 4871)
+++ trunk/catalog/admin/includes/gabarit/cms_content/display_view.edit.gab 2013-10-09 15:42:38 UTC (rev 4872)
@@ -69,13 +69,20 @@
<?php echo cms_content::DisplayField('status', '%s'); ?>
</dt>
-
<!-- All LinkTo -->
- <?php foreach(MLinkTo::LoadRightTo( 'content', 'edit' , 'action='.cms_content::$action.'&cID='.@$_GET['cID'] ) as $row): ?>
- <dt class="block_input">
+ <dt class="tabs block_input w_90">
+ <?php $linkto =MLinkTo::LoadRightTo( 'content', 'edit' , 'action='.cms_content::$action.'&cID='.@$_GET['cID'] ); ?>
+ <ul>
+ <?php $j=0;foreach($linkto as $row): $j++; ?>
+ <li><a href="#tabslinkto-<?php echo $j ?>"><?php echo $row['title'] ;?></a></li>
+ <?php endforeach;?>
+ </ul>
+ <?php $j=0;foreach($linkto as $row): $j++; ?>
+ <div id="tabslinkto-<?php echo $j ?>">
<?php echo $row['text'] ;?>
- </dt>
+ </div>
<?php endforeach;?>
+ </dt>
<dt class="block_input button_nav" >
Modified: trunk/catalog/admin/includes/gabarit/featureds/rightto.edit.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/featureds/rightto.edit.gab 2013-10-09 09:41:02 UTC (rev 4871)
+++ trunk/catalog/admin/includes/gabarit/featureds/rightto.edit.gab 2013-10-09 15:42:38 UTC (rev 4872)
@@ -9,7 +9,7 @@
@encode UTF-8
*/
global $languages_id;
-
+$selected = array();
$curr = MLinkTo::$currclass;
$res = sqlfeatured::fetch(array('status'=>'1'), true);
@@ -17,18 +17,22 @@
$list[] = $res;
elseif($res !=false)
$list = $res;
-else
+else
$list = array();
+
+foreach($curr::$Info->featured as $v)
+ $selected[$v->featured_id] = $v->featured_id;
+
?>
<div class="LinkToView CategoryView">
<label>
<span class="text"><?php echo __('@featureds txt link to'); ?></span>
<span class="button_nav">
-<!-- <a
- class="buttonimg fancy"
- href="<?php //echo tep_href_link(FILENAME_CATEGORIES, '&datatype='.MLinkTo::$current.'&action=new_light&origin='. urlencode($curr::FILENAME.'?'.MLinkTo::$origin) ) ?>"
+<!-- <a
+ class="buttonimg fancy"
+ href="<?php //echo tep_href_link(FILENAME_CATEGORIES, '&datatype='.MLinkTo::$current.'&action=new_light&origin='. urlencode($curr::FILENAME.'?'.MLinkTo::$origin) ) ?>"
title="<?php //echo sprintf(__('add category datatype %s'), MLinkTo::$current )?>"
>-->
<?php //echo tep_image(DIR_WS_ICONS.'icon_add_new.png' ) ?>
@@ -37,9 +41,8 @@
</label>
<ul class="LinkToView">
<?php foreach($list as $v): ?>
-
- <li class="<?php echo (isset($curr::$Info->featureds[$v->id])? 'selected' : 'noselected') ?>">
- <?php echo tep_draw_checkbox_field('linkto[featured]['.$v->id.']','linkto_featured_'.$v->id, $v->id, (isset($curr::$Info->featureds[$v->id])?true : false) ).' ['.status_name('featured', $v->type ,$languages_id).'] - '. $v->lg[$languages_id]->title ; ?>
+ <li class="<?php echo (isset($selected[$v->id])? 'selected' : 'noselected') ?>">
+ <?php echo tep_draw_checkbox_field('linkto[featured]['.$v->id.']','linkto_featured_'.$v->id, $v->id, (isset($selected[$v->id])?true : false) ).' ['.status_name('featured', $v->type ,$languages_id).'] - '. $v->lg[$languages_id]->title ; ?>
</li>
<?php endforeach; ?>
</ul>
Modified: trunk/catalog/admin/includes/gabarit/products/display_view.edit.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/products/display_view.edit.gab 2013-10-09 09:41:02 UTC (rev 4871)
+++ trunk/catalog/admin/includes/gabarit/products/display_view.edit.gab 2013-10-09 15:42:38 UTC (rev 4872)
@@ -202,17 +202,11 @@
<?php endif; ?>
<?php else: // virtual product ?>
- <fieldset class="block_field">
+<!-- <fieldset class="block_field">
<legend><?php echo __('@products text legend shipping'); ?></legend>
<ul>
- <?php /*
- <li class="block_input">
- <label class="inline" for="products_weight" title="<?php echo __('@products text weight help'); ?><"><?php echo __('@products text weight'); ?></label>
- <?php echo tep_draw_input_field('products_weight','', products::$Info->products_weight).' '.UNIT_WEIGHT_NAME; ?>
- </li>
- */ ?>
</ul>
- </fieldset>
+ </fieldset>-->
<?php endif; ?>
</div>
@@ -310,8 +304,6 @@
<?php endif; ?>
</dd>
- <div id="tabs">
-
<!-- All LinkTo -->
<dt class="tabs block_input w_90">
<?php $linkto =MLinkTo::LoadRightTo(products::$datatype, 'edit' , 'action='.products::$action.'&pID='.@$_GET['pID'] ); ?>
@@ -335,8 +327,8 @@
</dd>
</dl>
</fieldset>
- </div>
+
<div class="separator"></div>
</div>
</form>
\ No newline at end of file
Modified: trunk/catalog/includes/modules/listing.php
===================================================================
--- trunk/catalog/includes/modules/listing.php 2013-10-09 09:41:02 UTC (rev 4871)
+++ trunk/catalog/includes/modules/listing.php 2013-10-09 15:42:38 UTC (rev 4872)
@@ -7,18 +7,21 @@
@date 05/03/2012, 17:29
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
- @brief this generic module for call all datatype listing
+ @brief this generic module for call all datatype listing
This query sql calculate other class/pages
This loop format result for display generic call
*/
+
+
+
function in_obj_listing($type){
global $page;
$mod=$page->oscss_modules->_return('listing');
- // type data for process , extract in DataTypes class
+ // type data for process , extract in DataTypes class
$subtype = DataTypes::GetTypePage('sub');
- // result page.listing query sql
+ // result page.listing query sql
$listing_split=$mod['listing_split'];
$listing_query=$mod['listing_query'];
@@ -29,9 +32,15 @@
$p=array();
// init aca module
$aca_listing=$page->new_class('listing');
- if(is_string($listing_query))$listing_query=tep_db_query($listing_query);
+ if(is_string($listing_query))
+ $listing_query=tep_db_query($listing_query);
+ elseif( ($res=$page->oscss_modules->_resultsql('listing')) !=false )
+ $listing_query=$res;
+ else
+ $listing_query=tep_db_query($listing_split->sql_query);
- // loop for extract
+ // loop for extract
+ if($listing_query !=false)
while ($listing = tep_db_fetch_array($listing_query)){
// retro-compatibilite
@@ -40,12 +49,12 @@
else
$key = $subtype. '_id';
- if(!isset($listing[$key]) )
+ if(!isset($listing[$key]) )
continue;
- // result
+ // result
$pd=$subtype::get_item($listing[$key]);
- if(!$pd )
+ if(!$pd )
continue;
// call loop for Aca modules
$pd->aca=$aca_listing->return_db_min($listing[$key]);
@@ -56,10 +65,10 @@
return new objectInfo(array(
- 'title'=>'',
- 'content'=>$p, // all array result
+ 'title'=>'',
+ 'content'=>$p, // all array result
'split'=> $listing_split , // object for link split page
- 'type'=>$subtype // type result
+ 'type'=>$subtype // type result
));
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2013-10-09 09:41:06
|
Revision: 4871
http://sourceforge.net/p/oscss/svn/4871
Author: oscim
Date: 2013-10-09 09:41:02 +0000 (Wed, 09 Oct 2013)
Log Message:
-----------
delete obsolete call
Modified Paths:
--------------
trunk/catalog/install/data/templates/appareil_photo/2cShopHtml5Oscim/includes/boxes/categories.php
Modified: trunk/catalog/install/data/templates/appareil_photo/2cShopHtml5Oscim/includes/boxes/categories.php
===================================================================
--- trunk/catalog/install/data/templates/appareil_photo/2cShopHtml5Oscim/includes/boxes/categories.php 2013-10-09 09:40:04 UTC (rev 4870)
+++ trunk/catalog/install/data/templates/appareil_photo/2cShopHtml5Oscim/includes/boxes/categories.php 2013-10-09 09:41:02 UTC (rev 4871)
@@ -31,7 +31,6 @@
// if (($osCSS_Cache->read('categoriesBox-' . $language .'-cpath-'.$cPath.'-type', 720) === false) ) {
$CategoryTree->setSpacerString('', 2);
- $CategoryTree->setCategoryProductCountString('(',')');
$CategoryTree->setMaximumLevel(1);
$tableau = $CategoryTree->getTree(0) ;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2013-10-09 09:40:07
|
Revision: 4870
http://sourceforge.net/p/oscss/svn/4870
Author: oscim
Date: 2013-10-09 09:40:04 +0000 (Wed, 09 Oct 2013)
Log Message:
-----------
Fix bug in load tags
Modified Paths:
--------------
trunk/catalog/common/classes/seo_url.php
Modified: trunk/catalog/common/classes/seo_url.php
===================================================================
--- trunk/catalog/common/classes/seo_url.php 2013-10-08 21:21:27 UTC (rev 4869)
+++ trunk/catalog/common/classes/seo_url.php 2013-10-09 09:40:04 UTC (rev 4870)
@@ -647,7 +647,6 @@
$type = DataTypes::GetTypeForAnchor($anchor);
$TYPE = strtoupper($type);
-
switch(true){
case (_test_bool(self::$USE_SEO_CACHE_GLOBAL) && isset(self::$cache[$TYPE][$id])):
$this->performance['CACHE_QUERY_SAVINGS']++;
@@ -701,11 +700,12 @@
$result = DataTypes::Getseocache($this->languages_id);
- foreach($result as $row){
- if(is_array($row) && is_int(@$row[0]) && is_string(@$row[2])){
- self::GetCacheId($row[0],$row[1],$row[2]);
- }
- }
+ foreach($result as $res)
+ foreach($res as $row){
+ if(is_array($row) && (int)$row[0] > 0 /*&& is_string(@$row[2])*/ ){
+ self::GetCacheId((int)$row[0],$row[1],$row[2]);
+ }
+ }
/**
*\brief Base tag defaut
@@ -730,14 +730,14 @@
* @return array
*/
private static function GetCacheId($id,$result,$type){
-// if(is_array())
if(!isset(self::$cache[$type][$id]))
- return self::$cache[$type][$id]= $result;
+ self::$cache[$type][$id]= $result;
elseif(is_array($result))
- return self::$cache[$type][$id]= array_merge(self::$cache[$type][$id], $result);
- else
- return self::$cache[$type][$id];
+ self::$cache[$type][$id]= array_merge(self::$cache[$type][$id], $result);
+
+
+ return self::$cache[$type][$id];
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2013-10-08 21:21:31
|
Revision: 4869
http://sourceforge.net/p/oscss/svn/4869
Author: oscim
Date: 2013-10-08 21:21:27 +0000 (Tue, 08 Oct 2013)
Log Message:
-----------
Fix
Modified Paths:
--------------
trunk/catalog/admin/includes/classes/drivers/sqlcategorie.php
trunk/catalog/admin/includes/classes/drivers/sqlcontent.php
trunk/catalog/admin/includes/classes/drivers/sqlproduct.php
Modified: trunk/catalog/admin/includes/classes/drivers/sqlcategorie.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlcategorie.php 2013-10-08 20:49:56 UTC (rev 4868)
+++ trunk/catalog/admin/includes/classes/drivers/sqlcategorie.php 2013-10-08 21:21:27 UTC (rev 4869)
@@ -413,26 +413,8 @@
'_array'=>$data_array_link
));
}
-// public static function DataInCat($datatype, $data_id, $data_array_link=array()){
-// self::getInstance();
-// $DB=Database::getInstance();
-//
-// $table = tep_cst_define('TABLE_'.strtoupper($datatype).'_TO_CATEGORIES');
-//
-// if($table =='false')
-// return false;
-//
-// $DB->query("delete from " . $table . " where ".$datatype."_id='" . (int)$data_id . "' ");
-//
-// if(!is_array($data_array_link) || count($data_array_link) == 0)
-// $DB->query($sql="INSERT INTO " . $table . " (".$datatype."_id, categories_id) VALUES ('" . (int)$data_id . "', '".ORPHELIN_COLLECTOR."')");
-// else
-// foreach($data_array_link as $value)
-// $DB->query($sql="INSERT INTO " . $table . " (".$datatype."_id, categories_id) VALUES ('" . (int)$data_id . "', '" . (int)preg_replace('#.*_#i','',$value). "')");
-//
-// return true;
-// }
+
/**
@brief Function link to for contruct link featued vs datatype
@note normlised methode used in childs datatype
@@ -454,9 +436,6 @@
switch($datatype){
- case 'content': // retro compatible
- $datatype = 'cms_'.$datatype;
- break;
case 'product': // retro compatible
$datatype = $datatype.'s';
break;
Modified: trunk/catalog/admin/includes/classes/drivers/sqlcontent.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlcontent.php 2013-10-08 20:49:56 UTC (rev 4868)
+++ trunk/catalog/admin/includes/classes/drivers/sqlcontent.php 2013-10-08 21:21:27 UTC (rev 4869)
@@ -130,40 +130,12 @@
// no touch if just update one rows
// if(count($sql_data_array) >= 3 ) {
-// /**
-// TODO Couplage avec MLinkto + datatype actif
-// */
-// if(DataTypes::is_active('categorie')) {
-// /// Clean link posts to categorie and save new link
-// if(isset($option['cPath']) && count($post['categories']) == 0)
-// $post['categories'][] = $option['cPath'];
-//
-// sqlcategorie::DataInCat('content', $content_id, $post['categories']);
-// }
-// if( DataTypes::is_active('featured')) {
-// if(count($post['linkto']['featured']) > 0)
-// $r=sqlfeatured::AddLinkTo(
-// array(
-// 'datatype'=> 'content',
-// 'id'=> $content_id,
-// 'featured_array'=> $post['linkto']['featured']
-// )
-// );
-// else
-// $r=sqlfeatured::AddLinkTo(
-// array(
-// 'datatype'=> 'content',
-// 'id'=> $content_id,
-// 'featured_array'=> array(),
-// )
-// );
-//
-// }
-// }
$r = MLinkTo::SqlLeftTo('content', $content_id, $post['linkto']) ;
if($r == false)
$error++;
+// }
+
for ($i=0, $n=sizeof($list_languages); $i<$n; $i++) {
$sql_data_array = array();
$language_id = $list_languages[$i]['id'];
Modified: trunk/catalog/admin/includes/classes/drivers/sqlproduct.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlproduct.php 2013-10-08 20:49:56 UTC (rev 4868)
+++ trunk/catalog/admin/includes/classes/drivers/sqlproduct.php 2013-10-08 21:21:27 UTC (rev 4869)
@@ -146,43 +146,16 @@
}
-/**
- TODO Couplage avec MLinkto + datatype actif
-*/
- if(DataTypes::is_active('categorie')) {
- /// Clean link product to categorie and save new link
- if(isset($option['cPath']) && count($post['categories']) == 0){
- $post['categories'][] = $option['cPath'];
- sqlcategorie::DataInCat('products', $products_id, $post['categories']);
- }
- elseif(isset($post['categories']) && count($post['categories']) > 0)
- sqlcategorie::DataInCat('products', $products_id, $post['categories']);
- }
- if( DataTypes::is_active('featured')) {
- if(isset($post['linkto']['featured']) && count($post['linkto']['featured']) > 0)
- $r = sqlfeatured::AddLinkTo(
- array(
- 'datatype'=> 'product',
- 'id'=> $products_id,
- 'featured_array'=> $post['linkto']['featured']
- )
- );
- else
- $r = sqlfeatured::AddLinkTo(
- array(
- 'datatype'=> 'product',
- 'id'=> $products_id,
- 'featured_array'=> array(),
- )
- );
+ /*
+ Use transversal Datatype Rootlisting and update in data
+ */
+ $r = MLinkTo::SqlLeftTo('product', $products_id, $post['linkto']) ;
+ if($r == false)
+ $error++;
-// if($r == false)
-// $error++;
- }
-
/// Separate Pricing Per Customer
$customers_group_query = $DB->query("select customers_group_id, customers_group_name from " . TABLE_CUSTOMERS_GROUPS . " where customers_group_id != '0' order by customers_group_id");
// Gets all of the customers groups
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2013-10-08 20:50:02
|
Revision: 4868
http://sourceforge.net/p/oscss/svn/4868
Author: oscim
Date: 2013-10-08 20:49:56 +0000 (Tue, 08 Oct 2013)
Log Message:
-----------
Fix
upgrade process by update meydjo in sqlxxx for dynamical loop normlized and report usage in products and content
Modified Paths:
--------------
trunk/catalog/admin/includes/classes/MLinkTo.php
trunk/catalog/admin/includes/classes/ModTwo.php
trunk/catalog/admin/includes/classes/drivers/sqlcategorie.php
trunk/catalog/admin/includes/classes/drivers/sqlcontent.php
trunk/catalog/admin/includes/classes/drivers/sqlfeatured.php
trunk/catalog/admin/includes/content/aca.central.inc
trunk/catalog/admin/includes/content/page.central.inc
trunk/catalog/admin/includes/gabarit/categories/rightto.edit.gab
Modified: trunk/catalog/admin/includes/classes/MLinkTo.php
===================================================================
--- trunk/catalog/admin/includes/classes/MLinkTo.php 2013-10-08 13:52:46 UTC (rev 4867)
+++ trunk/catalog/admin/includes/classes/MLinkTo.php 2013-10-08 20:49:56 UTC (rev 4868)
@@ -3,27 +3,27 @@
@licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
@portion code Copyright (c) 2002 osCommerce
@package osCSS-2 <www http://www.oscss.org>
- @version 2.1.1
- @date 21/02/2012, 23:13
+ @version 2.1.2
+ @date 12/07/2013, 23:13
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
@class MLinkTo
- @brief Cette classe assure les liaison entre les datyape enfants les les datyape RootListing.
- Elle fournit les gabarit htmls de liaison destiné à être inséré dans les form d'edition
+ @brief Cette classe assure les liaison entre les datyape enfants les les datyape RootListing.
+ Elle fournit les gabarit htmls de liaison destiné à être inséré dans les form d'edition
@note elle n'est compatible qu'avaec les module de type ModTwo
*/
class MLinkTo {
/**
- @var string le nom du datatype enfant courant
+ @var string le nom du datatype enfant courant
*/
public static $current = '';
/**
- @var string le nom du datatype enfant courant
+ @var string le nom du datatype enfant courant
*/
public static $currclass = '';
/**
- @var string params GET for redirect after action .
+ @var string params GET for redirect after action .
*/
public static $origin = '';
/**
@@ -31,7 +31,7 @@
*/
public static $RL = array();
/**
- @var
+ @var
*/
public static $_instance;
@@ -54,7 +54,7 @@
if( DataTypes::is_active($key) ){
// search current in type for rootlisting
if(in_array(self::$current, explode(',',$row->value))) {
- //! @remarks Force load language centralised
+ //! @remarks Force load language centralised
$oscss->pile_file_lang(DIR_FS_ADMIN.DIR_WS_LANGUAGES.$language.'/pages/'.$key.'s.txt');
self::$RL[$key] = $key;
}
@@ -71,14 +71,53 @@
}
+ /**
+ @brief load block for manipulate data in sqlxxx
+ base is childs, and left to parent
+ */
+ public static function SqlLeftTo($child, $child_id, $array){
+ foreach(self::$RL as $rows){
+ if(DataTypes::is_active($rows)) {
+ $child = self::RetroDatatype($child);
+ if(count($array[$rows]) > 0)
+ $r = call_user_func(array('sql'.$rows , 'AddLinkTo'),
+ array(
+ 'datatype'=> $child,
+ 'id'=> $child_id,
+ '_array'=> $array[$rows]
+ )
+ );
+ else
+ $r = call_user_func(array('sql'.$rows , 'AddLinkTo'),
+ array(
+ 'datatype'=> $child,
+ 'id'=> $child_id,
+ '_array'=> array(),
+ )
+ );
+ }
+ }
+ if(in_array(false, $r ))
+ return false;
+ else
+ return true;
+ }
+
/**
+ @brief load block for manipulate data in sqlxxx
+ base in parent and right to childs
+ */
+ public static function SqlRightTo($classname, $action ){
+ }
+
+ /**
@brief load in html gabarit for construct link to Datatype rootListing
- les elements de langue sont recherché dans les fichier des classes maitres
- @param $classname string name support class
+ les elements de langue sont recherché dans les fichier des classes maitres
+ @param $classname string name support class
@param $action string current action
- @param string section param get for redirect after action
+ @param string section param get for redirect after action
*/
public static function LoadRightTo( $classname, $action, $origin){
@@ -94,7 +133,7 @@
global $language,$lang;
$oscss = oscss_cstr::getInstance();
- //! @remarks Force load language centralised
+ //! @remarks Force load language centralised
$oscss->pile_file_lang(DIR_FS_ADMIN.DIR_WS_LANGUAGES.$language.'/modules/pages/'.$mkey.'s.txt');
/**
@@ -113,7 +152,7 @@
/**
@brief define current class name and adjust retor-compatibilite
- @param $classname string name of current class
+ @param $classname string name of current class
*/
private static function RetroClassName($classname){
@@ -132,7 +171,7 @@
/**
@brief define current class name and adjust retor-compatibilite
- @param $classname string name of current class
+ @param $classname string name of current class
*/
private static function RetroDatatype($classname){
Modified: trunk/catalog/admin/includes/classes/ModTwo.php
===================================================================
--- trunk/catalog/admin/includes/classes/ModTwo.php 2013-10-08 13:52:46 UTC (rev 4867)
+++ trunk/catalog/admin/includes/classes/ModTwo.php 2013-10-08 20:49:56 UTC (rev 4868)
@@ -278,8 +278,9 @@
@return array
*/
public static function tep_get_modele(){
- $params = @func_get_args();
-
+ $params = func_get_args();
+// print_r(self::$InitInfo);
+// exit;
$action=(empty(self::$action)? 'listing' :self::$action);
$param=(!isset($params[0][0])? 'modele' :$params[0][0]);
@@ -291,6 +292,7 @@
*/
// public static function tep_get_list($page=1,$rowbyp=10,$sOrder='',$sWhere='',$options=''){
+// // var_dump(__FUNCTION__,$rowbyp);
// return self::ListingArray( $page,$rowbyp,$sOrder,$sWhere,$options); // call_user_func(array(self::$code, 'ListingArray'), $page,$rowbyp,$sOrder,$sWhere,$options);
// // var_dump(call_user_func_array(array(self::$code, 'ListingArray'),array( $page,$rowbyp,$sOrder,$sWhere,$options) ));
// }
@@ -362,20 +364,21 @@
$_SESSION['filters'][self::$code]['featured'][$key] = 'on';
}
-// if(in_array('language' , self::$generictfilter))
+ if(in_array('language' , self::$generictfilter))
foreach($_POST['filters']['language'] as $key=>$row){
if( $row =='on' )
$_SESSION['filters'][self::$code]['language'][$key] = 'on';
}
- if(true/*in_array('subtype' , self::$generictfilter)*/)
+ if(in_array('subtype' , self::$generictfilter))
foreach($_POST['filters']['subtype'] as $key=>$row){
if( $row =='on' )
$_SESSION['filters'][self::$code]['subtype'][$key] = 'on';
}
-
- self::$modules->__call('check_action', array('action'=>'ModTwofilters'));
+ // if class containt submodule
+ if(isset(self::$modules) )
+ self::$modules->__call('check_action', array('action'=>'ModTwofilters'));
}
/**
@brief Construct base transversal data object
@@ -531,7 +534,7 @@
}
// filter based on subtype products
- if(true/*in_array('subtype' , self::$generictfilter)*/){
+ if(in_array('subtype' , self::$generictfilter)){
if(isset($_SESSION['filters'][self::$code]['subtype']))
$_SESSION['filters']['subtype'] = $_SESSION['filters'] [self::$code]['subtype'];
else
@@ -558,6 +561,7 @@
}
+
$i=0;
// check and appli
foreach(self::$allfields as $key=>$row){
@@ -567,7 +571,7 @@
$txt = (isset($row['text_short'])? $row['text_short'] : $row['text']) ;
$alias = (isset($row['alias'])? $row['alias'] : $clean);
$css = (isset($row['class'])? $row['class'] : 'tleft')
- // add css class for jseditable
+ // add css class for jseditable
.(isset($row['edit'])? ' edit_dbclick': '' );
$width = (isset($row['width'])? $row['width'] : '5%');
@@ -664,6 +668,9 @@
self::$InitInfo['adjust']['listfields'] = substr($listfield, 0,-1);
+
+
+
/**
@note use $boutons[action][] = array(params)
@@ -685,6 +692,7 @@
}
+
return $listfield;
}
@@ -732,9 +740,6 @@
if(is_array($obj))
$obj = new arrayInfo($obj);
-
-// print_r($obj);
-
$edit = ((substr($key,0,5) !='edit_' ) ? 'edit_'.$key : $key);
if(isset($obj->$edit))
Modified: trunk/catalog/admin/includes/classes/drivers/sqlcategorie.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlcategorie.php 2013-10-08 13:52:46 UTC (rev 4867)
+++ trunk/catalog/admin/includes/classes/drivers/sqlcategorie.php 2013-10-08 20:49:56 UTC (rev 4868)
@@ -3,8 +3,8 @@
@licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
@portion code Copyright (c) 2002 osCommerce
@package osCSS-2 <www http://www.oscss.org>
- @version 2.1.2
- @date 01/10/2013, 09:32
+ @version 2.1.1
+ @date 30/03/2012, 09:32
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
@class sqlcategorie
@@ -120,14 +120,9 @@
$res=tep_db_perform(TABLE_CATEGORIES_DESCRIPTION, $sql_data_array);
}
-// var_dump($res);
/// Child module, Call After Update process
self::$modules->after_update($categories_id);
-/*
- if(!$res)
- return $res;
- else*/
return $categories_id;
}
@@ -315,17 +310,8 @@
$result['cPath'] = categorieUtility::get_generated_category_path_ids( (int) $result['categories_id'] );
/// Childs module load
-// self::$modules->load_db_values((int) $result['categories_id']);
+ self::$modules->load_db_values((int) $result['categories_id']);
- $result['mod'] = self::$modules->fetch(array('categories_id'=>$result['categories_id'], 'shortkey'=>$shortkey));
-
- // put all val origin module in current result
- foreach($result['mod'] as $submod=>$array)
- if(is_array($array))
- foreach($array as $key=>$val)
- $result[$key] = $val;
-
-
return ((!$shortkey)? $result : self::CleanKey($result));
}
elseif($num > 1){
@@ -357,15 +343,7 @@
/// Childs module load
self::$modules->load_db_values( (int) $result['categories_id'] );
-// $result['mod'] = self::$modules->fetch(array('categories_id'=>$result['categories_id'], 'shortkey'=>$shortkey));
-//
-// // put all val origin module in current result
-// foreach($result['mod'] as $submod=>$array)
-// if(is_array($array))
-// foreach($array as $key=>$val)
-// $result[$key] = $val;
-
$array[]= ((!$shortkey)? $result : self::CleanKey($result));
}
@@ -428,8 +406,67 @@
@param $data_id int rowid data
@param $data_array_link array value rowid link cat
*/
- public static function DataInCat($datatype, $data_id, $data_array_link=array()){
+ public static function DataInCat($datatype, $data_id, $data_array_link=array()){
+ return self::AddLinkTo(array(
+ 'datatype'=>$datatype,
+ 'id'=>$data_id,
+ '_array'=>$data_array_link
+ ));
+ }
+// public static function DataInCat($datatype, $data_id, $data_array_link=array()){
+// self::getInstance();
+// $DB=Database::getInstance();
+//
+// $table = tep_cst_define('TABLE_'.strtoupper($datatype).'_TO_CATEGORIES');
+//
+// if($table =='false')
+// return false;
+//
+// $DB->query("delete from " . $table . " where ".$datatype."_id='" . (int)$data_id . "' ");
+//
+// if(!is_array($data_array_link) || count($data_array_link) == 0)
+// $DB->query($sql="INSERT INTO " . $table . " (".$datatype."_id, categories_id) VALUES ('" . (int)$data_id . "', '".ORPHELIN_COLLECTOR."')");
+// else
+// foreach($data_array_link as $value)
+// $DB->query($sql="INSERT INTO " . $table . " (".$datatype."_id, categories_id) VALUES ('" . (int)$data_id . "', '" . (int)preg_replace('#.*_#i','',$value). "')");
+//
+// return true;
+// }
+
+ /**
+ @brief Function link to for contruct link featued vs datatype
+ @note normlised methode used in childs datatype
+ */
+ public static function AddLinkTo($opt){
+
self::getInstance();
+
+ if(!isset($opt['id']))
+ return false;
+ else
+ $data_id = (int)$opt['id'];
+
+
+ if(isset($opt['datatype']))
+ $datatype = $opt['datatype'] ;
+ else
+ $datatype = DATATYPES_DEFAULT_NOSELECTED;
+
+
+ switch($datatype){
+ case 'content': // retro compatible
+ $datatype = 'cms_'.$datatype;
+ break;
+ case 'product': // retro compatible
+ $datatype = $datatype.'s';
+ break;
+ default:
+ $datatype = $datatype;
+ }
+
+ $data_array_link = $opt['_array'];
+
+ self::getInstance();
$DB=Database::getInstance();
$table = tep_cst_define('TABLE_'.strtoupper($datatype).'_TO_CATEGORIES');
@@ -437,7 +474,7 @@
if($table =='false')
return false;
- $DB->query("delete from " . $table . " where ".$datatype."_id='" . (int)$data_id . "' ");
+ $DB->query($sql="delete from " . $table . " where ".$datatype."_id='" . (int)$data_id . "' ");
if(!is_array($data_array_link) || count($data_array_link) == 0)
$DB->query($sql="INSERT INTO " . $table . " (".$datatype."_id, categories_id) VALUES ('" . (int)$data_id . "', '".ORPHELIN_COLLECTOR."')");
@@ -446,10 +483,8 @@
$DB->query($sql="INSERT INTO " . $table . " (".$datatype."_id, categories_id) VALUES ('" . (int)$data_id . "', '" . (int)preg_replace('#.*_#i','',$value). "')");
return true;
- }
+ }
-
-
/**
@brief Speciemen
@return array or object
@@ -494,7 +529,7 @@
$cat_image = tep_db_prepare_input($cat_image);
}
- $cat_image =(empty($cat_image) || ($no_img=='on') ) ? '' : tep_db_prepare_input($cat_image) ;
+ $cat_image =(empty($cat_image) || (/*$no_img=='' &&*/ $no_img=='on') ) ? '' : tep_db_prepare_input($cat_image) ;
return $cat_image;
}
@@ -508,24 +543,11 @@
self::UpdateCheckLoop();
self::UpdateCheckLoopByPair();
-
- self::UpdateCpath();
}
- /**
- @fn UpdateCpath()
- @brief Calculate cpath if no found
- */
- private static function UpdateCpath(){
- $DB=Database::getInstance();
- $_query = $DB->query($s="SELECT categories_id as id FROM " . TABLE_CATEGORIES . " WHERE categories_cpath ='' AND parent_id <> 0 ");
- foreach($_query->fetchAllAssoc() as $loop)
- $DB->query($sql= "UPDATE " . TABLE_CATEGORIES . " SET categories_cpath = '".categorieUtility::get_generated_category_path_ids( (int) $loop['id'] )."' WHERE categories_id = '" . (int)$loop['id'] . "' ");
- }
-
/**
@fn UpdateCheckLoop()
@brief Check parent_id / rowid and block loop context
Modified: trunk/catalog/admin/includes/classes/drivers/sqlcontent.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlcontent.php 2013-10-08 13:52:46 UTC (rev 4867)
+++ trunk/catalog/admin/includes/classes/drivers/sqlcontent.php 2013-10-08 20:49:56 UTC (rev 4868)
@@ -129,38 +129,41 @@
// no touch if just update one rows
- if(count($sql_data_array) >= 3 ) {
- /**
- TODO Couplage avec MLinkto + datatype actif
- */
- if(DataTypes::is_active('categorie')) {
- /// Clean link posts to categorie and save new link
- if(isset($option['cPath']) && count($post['categories']) == 0)
- $post['categories'][] = $option['cPath'];
+// if(count($sql_data_array) >= 3 ) {
+// /**
+// TODO Couplage avec MLinkto + datatype actif
+// */
+// if(DataTypes::is_active('categorie')) {
+// /// Clean link posts to categorie and save new link
+// if(isset($option['cPath']) && count($post['categories']) == 0)
+// $post['categories'][] = $option['cPath'];
+//
+// sqlcategorie::DataInCat('content', $content_id, $post['categories']);
+// }
+// if( DataTypes::is_active('featured')) {
+// if(count($post['linkto']['featured']) > 0)
+// $r=sqlfeatured::AddLinkTo(
+// array(
+// 'datatype'=> 'content',
+// 'id'=> $content_id,
+// 'featured_array'=> $post['linkto']['featured']
+// )
+// );
+// else
+// $r=sqlfeatured::AddLinkTo(
+// array(
+// 'datatype'=> 'content',
+// 'id'=> $content_id,
+// 'featured_array'=> array(),
+// )
+// );
+//
+// }
+// }
+ $r = MLinkTo::SqlLeftTo('content', $content_id, $post['linkto']) ;
+ if($r == false)
+ $error++;
- sqlcategorie::DataInCat('content', $content_id, $post['categories']);
- }
- if( DataTypes::is_active('featured')) {
- if(count($post['linkto']['featured']) > 0)
- $r=sqlfeatured::AddLinkTo(
- array(
- 'datatype'=> 'content',
- 'id'=> $content_id,
- 'featured_array'=> $post['linkto']['featured']
- )
- );
- else
- $r=sqlfeatured::AddLinkTo(
- array(
- 'datatype'=> 'content',
- 'id'=> $content_id,
- 'featured_array'=> array(),
- )
- );
-
- }
- }
-
for ($i=0, $n=sizeof($list_languages); $i<$n; $i++) {
$sql_data_array = array();
$language_id = $list_languages[$i]['id'];
Modified: trunk/catalog/admin/includes/classes/drivers/sqlfeatured.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlfeatured.php 2013-10-08 13:52:46 UTC (rev 4867)
+++ trunk/catalog/admin/includes/classes/drivers/sqlfeatured.php 2013-10-08 20:49:56 UTC (rev 4868)
@@ -360,13 +360,14 @@
else
$datatype = DATATYPES_DEFAULT_NOSELECTED;
- $res = false;
- $data_array_link = $opt['featured_array'];
+ $data_array_link = $opt['_array'];
sqlfeatureddata::delete(array('datatype'=> $datatype , 'datatype_id'=>$id ));
- foreach($data_array_link as $value)
+ $res = true;
+
+ foreach($data_array_link as $value)
if(sqlfeatureddata::fetch(
array(
'featured_id'=> $value,
Modified: trunk/catalog/admin/includes/content/aca.central.inc
===================================================================
--- trunk/catalog/admin/includes/content/aca.central.inc 2013-10-08 13:52:46 UTC (rev 4867)
+++ trunk/catalog/admin/includes/content/aca.central.inc 2013-10-08 20:49:56 UTC (rev 4868)
@@ -9,8 +9,6 @@
@encode UTF-8
*/
?>
-<!-- body //-->
-<!-- body_text //-->
<?php
if ($actions['display_file'] !='')
/** ACA incluion specifique */ include DIR_WS_INCLUDES.$actions['display_file'];
@@ -42,6 +40,4 @@
echo $box;
}
-?>
-<!-- body_text_eof //-->
-<!-- body_eof //-->
\ No newline at end of file
+?>
\ No newline at end of file
Modified: trunk/catalog/admin/includes/content/page.central.inc
===================================================================
--- trunk/catalog/admin/includes/content/page.central.inc 2013-10-08 13:52:46 UTC (rev 4867)
+++ trunk/catalog/admin/includes/content/page.central.inc 2013-10-08 20:49:56 UTC (rev 4868)
@@ -8,8 +8,4 @@
@encode UTF-8
*/
?>
-<!-- body //-->
-<!-- body_text //-->
-<?php echo $module_page->display_view(); ?>
-<!-- body_text_eof //-->
-<!-- body_eof //-->
\ No newline at end of file
+<?php echo $module_page->display_view(); ?>
\ No newline at end of file
Modified: trunk/catalog/admin/includes/gabarit/categories/rightto.edit.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/categories/rightto.edit.gab 2013-10-08 13:52:46 UTC (rev 4867)
+++ trunk/catalog/admin/includes/gabarit/categories/rightto.edit.gab 2013-10-08 20:49:56 UTC (rev 4868)
@@ -3,8 +3,8 @@
@licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
@portion code Copyright (c) 2002 osCommerce
@package osCSS-2 <www http://www.oscss.org>
- @version 2.1.1
- @date 01/05/2012, 09:32
+ @version 2.1.2
+ @date 108/10/2013, 09:32
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
*/
@@ -17,9 +17,9 @@
<span class="text"><?php echo __('@categories txt link to'); ?></span>
<span class="button_nav">
- <a
- class="buttonimg fancy"
- href="<?php echo tep_href_link(FILENAME_CATEGORIES, '&datatype='.MLinkTo::$current.'&action=new_light&origin='. urlencode($curr::FILENAME.'?'.MLinkTo::$origin) ) ?>"
+ <a
+ class="buttonimg fancy"
+ href="<?php echo tep_href_link(FILENAME_CATEGORIES, '&datatype='.MLinkTo::$current.'&action=new_light&origin='. urlencode($curr::FILENAME.'?'.MLinkTo::$origin) ) ?>"
title="<?php echo sprintf(__('add category datatype %s'), MLinkTo::$current )?>"
>
<?php echo tep_image(DIR_WS_ICONS.'icon_add_new.png' ) ?>
@@ -32,7 +32,7 @@
<?php foreach($curr::$Info->categories as $v): $k=$v['categories_id']; ?>
<li class="selected">
- <?php echo tep_draw_checkbox_field('categories['.$k.']','cat_'.$k, tep_get_generated_category_path_ids($k), true ).' '.tep_get_category_name($k) ?>
+ <?php echo tep_draw_checkbox_field('linkto[categorie]['.$k.']','cat_'.$k, tep_get_generated_category_path_ids($k), true ).' '.tep_get_category_name($k) ?>
</li>
<?php endforeach; ?>
@@ -42,7 +42,7 @@
<?php if(!isset($curr::$Info->categories[$v['categories_id']])): ?>
<li class="<?php echo (isset($curr::$Info->categories[$v['categories_id']])? 'selected' : 'noselected') ?>">
- <?php echo tep_decal($v['niveau']).' '. tep_draw_checkbox_field('categories['.$v['categories_id'].']','cat_'.$v['categories_id'], tep_get_generated_category_path_ids($v['categories_id']), (isset($curr::$Info->categories[$v['categories_id']])?true : false) ).' '.$v['categories_name'] ?>
+ <?php echo tep_decal($v['niveau']).' '. tep_draw_checkbox_field('linkto[categorie]['.$v['categories_id'].']','cat_'.$v['categories_id'], tep_get_generated_category_path_ids($v['categories_id']), (isset($curr::$Info->categories[$v['categories_id']])?true : false) ).' '.$v['categories_name'] ?>
</li>
<?php else: ?>
<li class="<?php echo (isset($curr::$Info->categories[$v['categories_id']])? 'selected' : 'noselected') ?>">
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2013-10-08 13:52:49
|
Revision: 4867
http://sourceforge.net/p/oscss/svn/4867
Author: oscim
Date: 2013-10-08 13:52:46 +0000 (Tue, 08 Oct 2013)
Log Message:
-----------
fix
Modified Paths:
--------------
trunk/catalog/admin/includes/gabarit/featureds/rightto.edit.gab
Modified: trunk/catalog/admin/includes/gabarit/featureds/rightto.edit.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/featureds/rightto.edit.gab 2013-10-08 07:12:15 UTC (rev 4866)
+++ trunk/catalog/admin/includes/gabarit/featureds/rightto.edit.gab 2013-10-08 13:52:46 UTC (rev 4867)
@@ -3,8 +3,8 @@
@licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
@portion code Copyright (c) 2002 osCommerce
@package osCSS-2 <www http://www.oscss.org>
- @version 2.1.1
- @date 01/05/2012, 09:32
+ @version 2.1.2
+ @date 08/10/2013, 09:32
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
*/
@@ -38,7 +38,7 @@
<ul class="LinkToView">
<?php foreach($list as $v): ?>
- <li class="<?php echo (isset($curr::$Info->categories[$v->id])? 'selected' : 'noselected') ?>">
+ <li class="<?php echo (isset($curr::$Info->featureds[$v->id])? 'selected' : 'noselected') ?>">
<?php echo tep_draw_checkbox_field('linkto[featured]['.$v->id.']','linkto_featured_'.$v->id, $v->id, (isset($curr::$Info->featureds[$v->id])?true : false) ).' ['.status_name('featured', $v->type ,$languages_id).'] - '. $v->lg[$languages_id]->title ; ?>
</li>
<?php endforeach; ?>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2013-10-08 07:12:20
|
Revision: 4866
http://sourceforge.net/p/oscss/svn/4866
Author: oscim
Date: 2013-10-08 07:12:15 +0000 (Tue, 08 Oct 2013)
Log Message:
-----------
Fix
Modified Paths:
--------------
trunk/catalog/admin/includes/classes/aca.php
trunk/catalog/admin/includes/exts/package/CIP.php
Modified: trunk/catalog/admin/includes/classes/aca.php
===================================================================
--- trunk/catalog/admin/includes/classes/aca.php 2013-10-07 07:17:45 UTC (rev 4865)
+++ trunk/catalog/admin/includes/classes/aca.php 2013-10-08 07:12:15 UTC (rev 4866)
@@ -3,8 +3,8 @@
@licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
@portion code Copyright (c) 2002 osCommerce
@package osCSS-2 <www http://www.oscss.org>
- @version 2.1.1
- @date 01/01/2012, 18:17
+ @version 2.1.2
+ @date 07/10/2013, 18:17
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
@brief base class for aca extension
@@ -106,11 +106,13 @@
$post = $this->check_post_array ($post);
$this->generic_id = @$_GET['pID']; // Save the product ID
foreach ($this->modules as $key=>$module) {
- if (($module->enabled) and (method_exists($module, 'load_post_values' )) and (isset($post[$module->code])))
- $this->modules[$key]->load_post_values($post[$module->code]);
- /// retro-compatibilite
- else
- $this->modules[$key]->load_post_values($post);
+ if (($module->enabled) and (method_exists($module, 'load_post_values' )) ){
+ if(isset($post[$module->code]) )
+ $this->modules[$key]->load_post_values($post[$module->code]);
+ /// retro-compatibilite
+ else
+ $this->modules[$key]->load_post_values($post);
+ }
}
}
Modified: trunk/catalog/admin/includes/exts/package/CIP.php
===================================================================
--- trunk/catalog/admin/includes/exts/package/CIP.php 2013-10-07 07:17:45 UTC (rev 4865)
+++ trunk/catalog/admin/includes/exts/package/CIP.php 2013-10-08 07:12:15 UTC (rev 4866)
@@ -3,8 +3,8 @@
@licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
@portion code Copyright (c) 2002 osCommerce
@package osCSS-2 <www http://www.oscss.org>
- @version 2.1.1
- @date 03/01/12, 08:07
+ @version 2.1.2
+ @date 07/10/2013, 08:07
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
Original:
@@ -210,7 +210,7 @@
*/
function pack_cip($ext='zip') {
if (!$this->is_unpacked() || $this->is_zipped()) return false;
- if(file_exists(DIR_FS_CIP.escapeshellcmd(self::$cip_name)))
+ if(file_exists(DIR_FS_CIP.escapeshellcmd(self::$cip_name)))
unlink(DIR_FS_CIP.escapeshellcmd(self::$cip_name));
switch ($ext) {
case 'gzip':
@@ -235,17 +235,22 @@
@brief upack zip
*/
function unpack_cip($ext='zip') {
- error_reporting(E_ALL);
-
global $messageStack;
switch ($ext) {
case 'zip':
$zipfile = new PclZip( $this->full_path_to_zip() );
+ $list = $zipfile->listContent();
+
+ if($list[0]['filename'] =='catalog/')
+ $dir = DIR_FS_CIP . self::$cip_name;
+ else
+ $dir = DIR_FS_CIP;
+
if($this->is_Windows() ) { if(!defined('OS_WINDOWS'))define('OS_WINDOWS',1); }
else { if(!defined('OS_WINDOWS'))define('OS_WINDOWS',0); }
- $ret = $zipfile->extract( PCLZIP_OPT_PATH, DIR_FS_CIP );
+ $ret = $zipfile->extract( PCLZIP_OPT_PATH, $dir );
if($ret == 0) {
$messageStack->add(__('Unrecoverable error'). ' "'.$zipfile->errorName(true).'"' );
return false;
@@ -261,6 +266,7 @@
if(CI_ARCHIVER_GUNZIP) @ exec(CI_ARCHIVER_GUNZIP.' '.$this->full_path_to_zip() .' -c > '. DIR_FS_CIP.self::$cip_name, $output);
break;
}
+
}
@@ -355,7 +361,7 @@
/**
- @fn set_installed($status='1')
+ @fn set_installed($status='1')
@param $status
*/
private function set_installed($status='1') {
@@ -374,7 +380,7 @@
if (is_array($this->contrib_data) && count($this->contrib_data)>0)
self::InProcess(__("[data] contrib_data erreurs "), __CLASS__.'->'.__FUNCTION__.'::'.__LINE__,'error');
- if ($this->is_cip_in_zip && !$this->is_unpacked()) {
+ if ($this->is_cip_in_zip && ! $this->is_unpacked()) {
//We unzip only if we get a zip-filename as a and do not have a unpacked version of CIP.
$this->unpack_cip();
self::$was_unpacked=true;
@@ -382,7 +388,7 @@
if ($this->is_unpacked()) {
- if(!$this->read_from_xml())
+ if(!$this->read_from_xml())
self::InProcess(__("havn't contained well formed XML-file: ").(($this->is_cip_in_zip) ? $this->get_zip_name() : $this->get_cip_name()), __CLASS__.'->'.__FUNCTION__.'::'.__LINE__,'block');
//! Erreur fatal before process, delete and exit
@@ -482,10 +488,10 @@
///================================================================== //Action //==================================================================
/**
- @brief Installateur / testeur
+ @brief Installateur / testeur
Cette fonction assure les tests avant installation et l'installation proprement dite
Dans le contexte d'instalaltion, les test preallable ne sont pas appliqué
-
+
@param $ForTest boolenan if false reel install
*/
function install($ForTest = true) {
@@ -520,7 +526,7 @@
}
}
- // if no test process
+ // if no test process
else{
//! We passed by all checks. So if an error appears
@@ -531,7 +537,7 @@
}
//! up db etat install cip name if not error
- /// error and fatal block install
+ /// error and fatal block install
if (self::check_bylevel(1) !=false)
$this->set_installed();
}
@@ -541,7 +547,7 @@
/**
@fn remove($cleaning=false)
- @param $cleaning boolean if true, delete all files
+ @param $cleaning boolean if true, delete all files
*/
function remove($cleaning=false) {
@@ -760,7 +766,7 @@
break;
}
- if(!self::check_bylevel(0))
+ if(!self::check_bylevel(0))
return false;
return true;
@@ -888,7 +894,7 @@
}
//! check error level
- if(!self::check_bylevel(0))
+ if(!self::check_bylevel(0))
return false;
return true;
@@ -923,7 +929,7 @@
/**
@class ErrorAndBlockProcess
- @brief Manage and process collector error
+ @brief Manage and process collector error
*/
class ErrorAndBlockProcess{
@@ -951,15 +957,13 @@
@brief Control niveau d'erreur pour suite ou block script
@param int level error control
@return boolean suite script
- true > ok, false > not ok
+ true > ok, false > not ok
*/
public static function CtrlForContinue($level=3){
-// print_r(self::$level_error);
-// var_dump($level);
+
for($i=0; $i<$level; $i++){
if(isset(self::$level_error[$i]) /*&& in_array('1',self::$level_error[$i])*/) {
-print_r(self::$level_error[$i]);
return false;
}
}
@@ -969,10 +973,10 @@
/**
- @param $msg string
+ @param $msg string
@param $origin string $origin Function/class
- @param $type
- @param $level
+ @param $type
+ @param $level
*/
public static function ChooseAction($msg,$origin='',$type='',$level=E_USER_NOTICE){
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2013-10-07 07:17:49
|
Revision: 4865
http://sourceforge.net/p/oscss/svn/4865
Author: oscim
Date: 2013-10-07 07:17:45 +0000 (Mon, 07 Oct 2013)
Log Message:
-----------
Fix
Modified Paths:
--------------
trunk/catalog/create_account.php
trunk/catalog/login.php
Modified: trunk/catalog/create_account.php
===================================================================
--- trunk/catalog/create_account.php 2013-10-07 07:16:39 UTC (rev 4864)
+++ trunk/catalog/create_account.php 2013-10-07 07:17:45 UTC (rev 4865)
@@ -1,10 +1,10 @@
<?php
/**
- @ licence GPL *2005-2013 The osCSS developers - osCSS Open Source E-commerce
+ @licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
@portion code Copyright (c) 2002 osCommerce
@package osCSS-2 <www http://www.oscss.org>
- @version 2.1.1
- @date 03/007/2013, 21:44
+ @version 2.1.2
+ @date 007/10/2013, 21:44
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
*\file
@@ -16,7 +16,26 @@
$process = false;
- if(isset($_POST['action']) && ($_POST['action'] == 'process')) {
+ /**
+ @remarks Check if email exist in db customers
+ */
+ if(isset($_REQUEST['action']) && ($_REQUEST['action'] == 'checkmail')) {
+ $page->init(basename(__FILE__),$language);
+
+ $email_address=tep_db_prepare_input($_POST['email_address']);
+ $customers_id=customer::search('customers_email_address', $email_address);
+
+ // user no found ok
+ if( $customers_id===false ){
+ $page->add_var_page('new_customer_email',$email_address);
+ }
+ else{
+ $page->messageStack->add_session('', TEXT_ERROR_EMAIL_NO_FOUND, 'error');
+ tep_redirect( tep_href_link(FILENAME_LOGIN) );
+ }
+
+ }
+ elseif(isset($_POST['action']) && ($_POST['action'] == 'process')) {
$page->init(basename(__FILE__),$language);
/**
@@ -48,15 +67,15 @@
);
if(_cst_bool('ACCOUNT_FORCE_ACTIV_MAIL')){
- $cust->the_customer($user->id);
- $myarray['_oLinks']= tep_href_link(FILENAME_CREATE_ACCOUNT, 'action=confirm&hash='.$cust->creatValidHash().'&email='.$user->email_address, 'SSL');
- $message_final=tep_post_prepare_email('create_account_confirm.tpl',$language,$myarray);
+ $cust->the_customer($user->id);
+ $myarray['_oLinks']= tep_href_link(FILENAME_CREATE_ACCOUNT, 'action=confirm&hash='.$cust->creatValidHash().'&email='.$user->email_address, 'SSL');
+ $message_final=tep_post_prepare_email('create_account_confirm.tpl',$language,$myarray);
}
else {
- //! init session
- customer::initSession($user);
+ //! init session
+ customer::initSession($user);
- $message_final=tep_post_prepare_email('create_account.tpl',$language,$myarray);
+ $message_final=tep_post_prepare_email('create_account.tpl',$language,$myarray);
}
tep_mail($user->firstname . ' ' . $user->lastname, $user->email_address, sprintf(EMAIL_SUBJECT, STORE_NAME) , $message_final, STORE_OWNER, EMAIL_FROM);
@@ -106,8 +125,8 @@
/// user no found redirect
if($customers_id==false ){
- $page->messageStack->add_session('create_account', TEXT_ERROR_EMAIL_NO_FOUND);
- tep_redirect(tep_href_link(FILENAME_CREATE_ACCOUNT, 'action=newconfirm', 'SSL'));
+ $page->messageStack->add_session('create_account', TEXT_ERROR_EMAIL_NO_FOUND);
+ tep_redirect(tep_href_link(FILENAME_CREATE_ACCOUNT, 'action=newconfirm', 'SSL'));
}
$u=$cust->the_customer($customers_id);
Modified: trunk/catalog/login.php
===================================================================
--- trunk/catalog/login.php 2013-10-07 07:16:39 UTC (rev 4864)
+++ trunk/catalog/login.php 2013-10-07 07:17:45 UTC (rev 4865)
@@ -3,11 +3,11 @@
@licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
@portion code Copyright (c) 2002 osCommerce
@package osCSS-2 <www http://www.oscss.org>
- @version 2.1.1
- @date 23/03/2012, 21:44
+ @version 2.1.2
+ @date 007/10/2013, 21:44
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
- @brief Page for login account member
+ @brief Page for login account member
*/
require('includes/application_top.php');
@@ -39,20 +39,20 @@
try{
- if(!isset($_POST['email_address'])) throw new Exception(TEXT_LOGIN_ERROR );
- if(!isset($_POST['password'])) throw new Exception(TEXT_LOGIN_ERROR );
+ if(!isset($_POST['email_address'])) throw new Exception(__('TEXT_LOGIN_ERROR') );
+ if(!isset($_POST['password'])) throw new Exception(__('TEXT_LOGIN_ERROR') );
$cust=customer::getInstance();
- if (!$cust->userTestNotExist($email_address)) throw new Exception(TEXT_LOGIN_ERROR_USER_NOT_EXITS );
+ if (!$cust->userTestNotExist($email_address)) throw new Exception(__('TEXT_LOGIN_ERROR_USER_NOT_EXITS') );
$customers_id=$cust->CheckMailAndPass( $password, $email_address);
- if( $customers_id ===false) throw new Exception(TEXT_LOGIN_ERROR );
+ if( $customers_id ===false) throw new Exception(__('TEXT_LOGIN_ERROR') );
$user=$cust->the_customer($customers_id);
if($user['customers_status'] ==2)
- throw new Exception( sprintf(TEXT_LOGIN_ERROR_ACCOUNT_NOT_CONFIRMED, '<br /><a href="'.tep_href_link(FILENAME_CREATE_ACCOUNT,'action=newconfirm').'">'.TEXT_NEW_SENT_CONFIRM.'</a>') );
+ throw new Exception( sprintf(__('TEXT_LOGIN_ERROR_ACCOUNT_NOT_CONFIRMED'), '<br /><a href="'.tep_href_link(FILENAME_CREATE_ACCOUNT,'action=newconfirm').'">'.__('TEXT_NEW_SENT_CONFIRM').'</a>') );
else
customer::initSession($user);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2013-10-07 07:16:51
|
Revision: 4864
http://sourceforge.net/p/oscss/svn/4864
Author: oscim
Date: 2013-10-07 07:16:39 +0000 (Mon, 07 Oct 2013)
Log Message:
-----------
Removed Paths:
-------------
trunk/catalog/includes/languages/fr_FR/login.php
Deleted: trunk/catalog/includes/languages/fr_FR/login.php
===================================================================
--- trunk/catalog/includes/languages/fr_FR/login.php 2013-10-07 07:16:23 UTC (rev 4863)
+++ trunk/catalog/includes/languages/fr_FR/login.php 2013-10-07 07:16:39 UTC (rev 4864)
@@ -1,40 +0,0 @@
-<?php
-/**
- @licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
- @portion code Copyright (c) 2002 osCommerce
- @package osCSS-2 <www http://www.oscss.org>
- @version 2.1.2
- @date 07/10/2013, 22:38
- @author oscim <mail aur...@os...> <www http://www.oscim.fr>
- @encode UTF-8
-*/
-$lang['NAVBAR_TITLE'] = "Identification";
-$lang['@login heading title'] = "Identification";
-
-/* Login */
-$lang['@login heading title login'] = "Déjà un compte";
-$lang['@login text returning customer'] = "Créer un compte";
-$lang['@login password forgotten %s'] = "Si vous avez oublié votre mot de passe; %s ";
-$lang['@login password forgotten text'] = "Cliquez ici.";
-$lang['@login image button login'] = "Continuer";
-
-$lang['@login entry email address'] = "Email";
-$lang['@login entry password'] = "Mot de passe";
-
-/* create */
-$lang['@login heading new customer'] = "Créer un compte";
-$lang['@login text new customer introduction'] = "En créant votre compte sur " . STORE_NAME . " vous pourrez faire vos achats plus rapidement, garder votre panier d'une visite à l'autre et suivre vos commandes.";
-$lang['@login text new customer'] = "Nouveau client";
-$lang['@login LegendCreatAccount'] = "Créer un compte";
-$lang['@login heading title new customers'] = "Créer un compte";
-$lang['@login heading title new customers'] = "Créer un compte";
-
-
-$lang['TEXT_VISITORS_CART'] = "<strong class=\"errorText\">REMARQUE :</strong> Le contenu de votre "panier visiteurs" sera ajouté à celui de votre "panier membres" dès que vous aurez ouvert une session. <a href=\"javascript:session_win();\">[Plus d'info]</a>";
-$lang['CATEGORY_EXTRA_FIELDS'] = "Champs complémentaires";
-
-$lang['TEXT_LOGIN_ERROR'] = "Erreur : aucun résultat à cette adresse e-mail et/ou mot de passe.";
-$lang['TEXT_LOGIN_ERROR_ACCOUNT_NOT_CONFIRMED'] = "Erreur : Ce compte existe, mais n'est pas confirmé, Utiliser le liens comptenu dans l'email que vous avez reçu, penser à verifier dans les emails classés comme spam. %s";
-$lang['TEXT_NEW_SENT_CONFIRM'] = "Envoyer un nouvel email de confirmation";
-$lang['TEXT_LOGIN_ERROR_USER_NOT_EXITS'] = "Erreur : aucun résultat à cette adresse e-mail et/ou mot de passe.";
-?>
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2013-10-07 07:16:27
|
Revision: 4863
http://sourceforge.net/p/oscss/svn/4863
Author: oscim
Date: 2013-10-07 07:16:23 +0000 (Mon, 07 Oct 2013)
Log Message:
-----------
Modified Paths:
--------------
trunk/catalog/includes/languages/fr_FR/login.php
trunk/catalog/templates/defaut/includes/content/login.php
Added Paths:
-----------
trunk/catalog/includes/languages/fr_FR/login.txt
Modified: trunk/catalog/includes/languages/fr_FR/login.php
===================================================================
--- trunk/catalog/includes/languages/fr_FR/login.php 2013-10-05 08:29:09 UTC (rev 4862)
+++ trunk/catalog/includes/languages/fr_FR/login.php 2013-10-07 07:16:23 UTC (rev 4863)
@@ -3,27 +3,38 @@
@licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
@portion code Copyright (c) 2002 osCommerce
@package osCSS-2 <www http://www.oscss.org>
- @version 2.1.0
- @date 24/01/11, 09:52
+ @version 2.1.2
+ @date 07/10/2013, 22:38
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
*/
-define('NAVBAR_TITLE',"Ouverture de session" );
-define('HEADING_TITLE',"Bienvenue, veuillez ouvrir une session" );
-define('HEADING_NEW_CUSTOMER',"Nouveau client" );
-define('TEXT_NEW_CUSTOMER',"Je suis un nouveau client." );
-define('TEXT_NEW_CUSTOMER_INTRODUCTION',"En créant votre compte sur " . STORE_NAME . " vous pourrez faire vos achats plus rapidement, garder votre panier d'une visite à l'autre et suivre vos commandes." );
-define('HEADING_RETURNING_CUSTOMER',"Client enregistré" );
-define('TEXT_RETURNING_CUSTOMER',"J'ai déjà un compte." );
-define('TEXT_PASSWORD_FORGOTTEN',"Vous avez oublié votre mot de passe ? Cliquez ici." );
+$lang['NAVBAR_TITLE'] = "Identification";
+$lang['@login heading title'] = "Identification";
-define('TEXT_VISITORS_CART',"<strong class=\"errorText\">REMARQUE :</strong> Le contenu de votre "panier visiteurs" sera ajouté à celui de votre "panier membres" dès que vous aurez ouvert une session. <a href=\"javascript:session_win();\">[Plus d'info]</a>" );
-define('CATEGORY_EXTRA_FIELDS',"Champs complémentaires" );
+/* Login */
+$lang['@login heading title login'] = "Déjà un compte";
+$lang['@login text returning customer'] = "Créer un compte";
+$lang['@login password forgotten %s'] = "Si vous avez oublié votre mot de passe; %s ";
+$lang['@login password forgotten text'] = "Cliquez ici.";
+$lang['@login image button login'] = "Continuer";
-define('TEXT_LOGIN_ERROR',"Erreur : aucun résultat à cette adresse e-mail et/ou mot de passe." );
-define('TEXT_LOGIN_ERROR_ACCOUNT_NOT_CONFIRMED',"Erreur : Ce compte existe, mais n'est pas confirmé, Utiliser le liens comptenu dans l'email que vous avez reçu, penser à verifier dans les emails classés comme spam. %s" );
-define('TEXT_NEW_SENT_CONFIRM',"Envoyer un nouvel email de confirmation" );
-define('TEXT_LOGIN_ERROR_USER_NOT_EXITS',"Erreur : aucun résultat à cette adresse e-mail et/ou mot de passe." );
+$lang['@login entry email address'] = "Email";
+$lang['@login entry password'] = "Mot de passe";
+/* create */
+$lang['@login heading new customer'] = "Créer un compte";
+$lang['@login text new customer introduction'] = "En créant votre compte sur " . STORE_NAME . " vous pourrez faire vos achats plus rapidement, garder votre panier d'une visite à l'autre et suivre vos commandes.";
+$lang['@login text new customer'] = "Nouveau client";
+$lang['@login LegendCreatAccount'] = "Créer un compte";
+$lang['@login heading title new customers'] = "Créer un compte";
+$lang['@login heading title new customers'] = "Créer un compte";
+
+$lang['TEXT_VISITORS_CART'] = "<strong class=\"errorText\">REMARQUE :</strong> Le contenu de votre "panier visiteurs" sera ajouté à celui de votre "panier membres" dès que vous aurez ouvert une session. <a href=\"javascript:session_win();\">[Plus d'info]</a>";
+$lang['CATEGORY_EXTRA_FIELDS'] = "Champs complémentaires";
+
+$lang['TEXT_LOGIN_ERROR'] = "Erreur : aucun résultat à cette adresse e-mail et/ou mot de passe.";
+$lang['TEXT_LOGIN_ERROR_ACCOUNT_NOT_CONFIRMED'] = "Erreur : Ce compte existe, mais n'est pas confirmé, Utiliser le liens comptenu dans l'email que vous avez reçu, penser à verifier dans les emails classés comme spam. %s";
+$lang['TEXT_NEW_SENT_CONFIRM'] = "Envoyer un nouvel email de confirmation";
+$lang['TEXT_LOGIN_ERROR_USER_NOT_EXITS'] = "Erreur : aucun résultat à cette adresse e-mail et/ou mot de passe.";
?>
\ No newline at end of file
Added: trunk/catalog/includes/languages/fr_FR/login.txt
===================================================================
--- trunk/catalog/includes/languages/fr_FR/login.txt (rev 0)
+++ trunk/catalog/includes/languages/fr_FR/login.txt 2013-10-07 07:16:23 UTC (rev 4863)
@@ -0,0 +1,40 @@
+<?php
+/**
+ @licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
+ @portion code Copyright (c) 2002 osCommerce
+ @package osCSS-2 <www http://www.oscss.org>
+ @version 2.1.2
+ @date 07/10/2013, 22:38
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+*/
+$lang['NAVBAR_TITLE'] = "Identification";
+$lang['@login heading title'] = "Identification";
+
+/* Login */
+$lang['@login heading title login'] = "Déjà un compte";
+$lang['@login text returning customer'] = "Créer un compte";
+$lang['@login password forgotten %s'] = "Si vous avez oublié votre mot de passe; %s ";
+$lang['@login password forgotten text'] = "Cliquez ici.";
+$lang['@login image button login'] = "Continuer";
+
+$lang['@login entry email address'] = "Email";
+$lang['@login entry password'] = "Mot de passe";
+
+/* create */
+$lang['@login heading new customer'] = "Créer un compte";
+$lang['@login text new customer introduction'] = "En créant votre compte sur " . STORE_NAME . " vous pourrez faire vos achats plus rapidement, garder votre panier d'une visite à l'autre et suivre vos commandes.";
+$lang['@login text new customer'] = "Nouveau client";
+$lang['@login LegendCreatAccount'] = "Créer un compte";
+$lang['@login heading title new customers'] = "Créer un compte";
+$lang['@login heading title new customers'] = "Créer un compte";
+
+
+$lang['TEXT_VISITORS_CART'] = "<strong class=\"errorText\">REMARQUE :</strong> Le contenu de votre "panier visiteurs" sera ajouté à celui de votre "panier membres" dès que vous aurez ouvert une session. <a href=\"javascript:session_win();\">[Plus d'info]</a>";
+$lang['CATEGORY_EXTRA_FIELDS'] = "Champs complémentaires";
+
+$lang['TEXT_LOGIN_ERROR'] = "Erreur : aucun résultat à cette adresse e-mail et/ou mot de passe.";
+$lang['TEXT_LOGIN_ERROR_ACCOUNT_NOT_CONFIRMED'] = "Erreur : Ce compte existe, mais n'est pas confirmé, Utiliser le liens comptenu dans l'email que vous avez reçu, penser à verifier dans les emails classés comme spam. %s";
+$lang['TEXT_NEW_SENT_CONFIRM'] = "Envoyer un nouvel email de confirmation";
+$lang['TEXT_LOGIN_ERROR_USER_NOT_EXITS'] = "Erreur : aucun résultat à cette adresse e-mail et/ou mot de passe.";
+?>
\ No newline at end of file
Modified: trunk/catalog/templates/defaut/includes/content/login.php
===================================================================
--- trunk/catalog/templates/defaut/includes/content/login.php 2013-10-05 08:29:09 UTC (rev 4862)
+++ trunk/catalog/templates/defaut/includes/content/login.php 2013-10-07 07:16:23 UTC (rev 4863)
@@ -1,64 +1,94 @@
<?php
/**
- *\licence GPL 2005-2010 The osCSS developers - osCSS Open Source E-commerce
- *\portion code Copyright (c) 2002 osCommerce
- *\package osCSS-2 <www http://www.oscss.org>
- *\version 2.1.0
- *\date 16/09/10, 21:55
- *\author oscim <mail aur...@os...> <www http://www.oscim.fr>
- *\encode UTF-8
+ @licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
+ @subpackage 2cShopHtml5Oscim
+ @package osCSS-2 <www http://www.oscss.org>
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @date 07/10/2013, 21:54
+ @encode UTF-8
*\group content
*\file
*\dir includes/content/
*\brief Page display for login
*/
?>
-<div id="login">
+
+<header>
+ <h1 class="content title <?php echo $language ;?>"><?php echo HEADING_TITLE; ?></h1>
+</header>
+
+<!-- <div id="login"> -->
+<section id="login" class="colum left">
+
+ <header>
+ <h2 class="content title <?php echo $language ;?>"><?php echo __('@login heading title login'); ?></h2>
+ </header>
<?php $page->messageStack->_draw('login');?>
- <h2 class="content title <?php echo $language ;?>"><?php echo HEADING_TITLE; ?></h2>
+
<?php if($cart->count_contents() > 0)
if ( ($replace=$page->prop_ctrl('text_visitor_cart', 'text_visitor_cart')) !=false) $replace();
else { echo '<p id="text_visitor_cart" class="infoText">'. TEXT_VISITORS_CART .'</p>'; }
?>
- <h3><?php echo HEADING_NEW_CUSTOMER; ?></h3>
-
- <div class="contentBox newCustomer">
- <h4><?php echo TEXT_NEW_CUSTOMER ; ?></h4>
- <div class="infoText"><?php echo TEXT_NEW_CUSTOMER_INTRODUCTION; ?></div>
-
- <div class="navBt">
- <?php echo '<a class="navBt" href="' . tep_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL') . '">' . IMAGE_BUTTON_CONTINUE . '</a>'; ?>
- </div>
- </div>
-
-
- <h3><?php echo HEADING_RETURNING_CUSTOMER; ?></h3>
-
<?php echo tep_draw_form('login_form', tep_href_link(FILENAME_LOGIN, 'action=process', 'SSL')); ?>
<fieldset class="returningCustomer">
- <legend><?php echo TEXT_RETURNING_CUSTOMER; ?></legend>
+ <legend><?php echo __('@login text returning customer'); ?></legend>
- <p>
- <label for="email_address"><?php echo ENTRY_EMAIL_ADDRESS; ?></label>
+ <p class="inputBlock">
+ <label for="email_address"><?php echo __('@login entry email address'); ?></label>
<?php echo tep_draw_input_field('email_address','email_address'); ?>
</p>
- <p>
- <label for="password"><?php echo ENTRY_PASSWORD; ?></label>
+ <p class="inputBlock">
+ <label for="password"><?php echo __('@login entry password'); ?></label>
<?php echo tep_draw_password_field('password'); ?>
</p>
<p class="infoText">
- <?php echo '<a href="' . tep_href_link(FILENAME_PASSWORD_FORGOTTEN, '', 'SSL') . '">' . TEXT_PASSWORD_FORGOTTEN . '</a>'; ?>
+ <?php printf(__('@login password forgotten %s'), '<a href="' . tep_href_link(FILENAME_PASSWORD_FORGOTTEN, '', 'SSL') . '">' . __('@login password forgotten text') . '</a>' ); ?>
</p>
<p class="formBt">
+ <input type="submit" class="submitBt" value="<?php echo __('@login image button login'); ?>" />
+ </p>
+ </fieldset>
+ </form>
+
+</section>
+
+
+<section class="colum right">
+<header>
+ <h2 class="content title <?php echo $language ;?>"><?php echo __('@login heading new customer'); ?></h2>
+</header>
+
+ <div class="contentBox newCustomer">
+ <h4><?php echo __('@login text new customer') ; ?></h4>
+ <div class="infoText"><?php echo __('@login text new customer introduction'); ?></div>
+
+ <?php echo tep_draw_form('login_form', tep_href_link(FILENAME_CREATE_ACCOUNT, 'action=checkmail', 'SSL')); ?>
+
+ <fieldset class="returningCustomer">
+ <legend><?php echo __('@login LegendCreatAccount'); ?></legend>
+
+ <p class="inputBlock">
+ <label for="email_address"><?php echo __('@login entry email address'); ?></label>
+ <?php echo tep_draw_input_field('email_address','email_address'); ?>
+ </p>
+
+
+ <p class="formBt">
<input type="submit" class="submitBt" value="<?php echo IMAGE_BUTTON_LOGIN; ?>" />
</p>
</fieldset>
</form>
-</div>
\ No newline at end of file
+ <div class="navBt">
+ <?php echo '<a class="navBt" href="' . tep_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL') . '">' . IMAGE_BUTTON_CONTINUE . '</a>'; ?>
+ </div>
+ </div>
+</div>
+
+</section>
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2013-10-05 08:29:12
|
Revision: 4862
http://sourceforge.net/p/oscss/svn/4862
Author: oscim
Date: 2013-10-05 08:29:09 +0000 (Sat, 05 Oct 2013)
Log Message:
-----------
Fix create cats
Modified Paths:
--------------
trunk/catalog/admin/includes/modules/pages/categories.php
Modified: trunk/catalog/admin/includes/modules/pages/categories.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/categories.php 2013-10-05 08:19:08 UTC (rev 4861)
+++ trunk/catalog/admin/includes/modules/pages/categories.php 2013-10-05 08:29:09 UTC (rev 4862)
@@ -680,37 +680,14 @@
/**
@remarks Popup Ajax QuickNew
*/
- case 'new_light':
- $GLOBALS['cPath']=null;
+// case 'new_light':
+// $GLOBALS['cPath']=null;
+// break;
- self::$Info = new objectInfo( sqlcategorie::Specimen() );
-//
-// if(isset($_GET['datatype']))
-// self::$cInfo->categories_datatype = tep_db_prepare_input( $_GET['datatype']);
-
-// $oscss->_add_ext(BO_WISIWYG_SELECTED,'editeur/');
-// for ($i=0, $n=sizeof(self::$languages); $i<$n; $i++) {
-// echo $oscss->_call(BO_WISIWYG_SELECTED,'_top','categories_description[' . self::$languages[$i]['id'] . ']','600','400');
-// }
-
- break;
-
/**
@remarks Normal Form news
*/
case 'new':
- /// reliquat oscom Reset Global For use tep_input_radio
- $GLOBALS['cPath']=null;
-
- self::$Info = new objectInfo( sqlcategorie::Specimen() );
-
-// $oscss->_add_ext(BO_WISIWYG_SELECTED,'editeur/');
-// for ($i=0, $n=sizeof(self::$languages); $i<$n; $i++) {
-// echo $oscss->_call(BO_WISIWYG_SELECTED,'_top','categories_description[' . self::$languages[$i]['id'] . ']','600','400');
-// }
-
- break;
-
case 'edit':
/// Editeur Load
@@ -752,6 +729,16 @@
$action=self::$action;
switch ($action) {
+ case 'new';
+ case 'new_light':
+ $GLOBALS['cPath']=null;
+
+ $res = sqlcategorie::Specimen(true) ;
+ $res= self::FormatDBValue($res) ;
+
+ return $res;
+ break;
+
case 'delete';
case 'edit';
@@ -863,17 +850,17 @@
/**
@remarks Normal View Page
*/
- case 'new_light':
- $action='new_light';
- self::$Info=self::GetDBValue(self::$Id);
+ case 'new':
+ $action='edit';
+ self::$Info=self::GetDBValue(0);
/// use master gabarit
- return MGabCont::CallGab(self::$action,__FUNCTION__,__CLASS__);
+ return MGabCont::CallGab($action,__FUNCTION__,__CLASS__);
break;
+
case 'edit':
- case 'new':
+ case 'new_light':
case 'delete':
case 'copy_to':
- $action='edit';
self::$Info=self::GetDBValue(self::$Id);
/// use master gabarit
return MGabCont::CallGab(self::$action,__FUNCTION__,__CLASS__);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2013-10-05 08:19:12
|
Revision: 4861
http://sourceforge.net/p/oscss/svn/4861
Author: oscim
Date: 2013-10-05 08:19:08 +0000 (Sat, 05 Oct 2013)
Log Message:
-----------
Fix categories
box normalise display and code process
Modified Paths:
--------------
trunk/catalog/admin/includes/gabarit/categories/display_view.delete.gab
trunk/catalog/admin/includes/modules/pages/categories.php
trunk/catalog/includes/classes/category_tree.php
trunk/catalog/templates/defaut/includes/boxes/very_viewed.php
trunk/catalog/templates/defaut/includes/boxes/whats_new.php
Added Paths:
-----------
trunk/catalog/templates/defaut/includes/gabarit/box.generic.gab
Removed Paths:
-------------
trunk/catalog/templates/defaut/includes/gabarit/box.whats_new.gab
Modified: trunk/catalog/admin/includes/gabarit/categories/display_view.delete.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/categories/display_view.delete.gab 2013-10-04 13:12:43 UTC (rev 4860)
+++ trunk/catalog/admin/includes/gabarit/categories/display_view.delete.gab 2013-10-05 08:19:08 UTC (rev 4861)
@@ -3,33 +3,32 @@
@licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
@portion code Copyright (c) 2002 osCommerce
@package osCSS-2 <www http://www.oscss.org>
- @version 2.1.1
- @date 22/04/2012, 15:42
+ @version 2.1.2
+ @date 06/10/2013, 15:42
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
*/
global $languages_id;
-
?>
<h3><?php echo __('text info heading delete category'); ?></h3>
<div class="box_uniq block_form">
- <?php echo tep_draw_form('categories', categories::FILENAME, 'action=delete_confirm') . tep_draw_hidden_field('categories_id', '', categories::$cInfo->categories_id) ?>
+ <?php echo tep_draw_form('categories', categories::FILENAME, 'action=delete_confirm') . tep_draw_hidden_field('categories_id', '', categories::$Info->id) ?>
<p><?php echo __('text delete category intro') ?></p>
- <p><strong><?php echo categories::$cInfo->categories_name[$languages_id] ?></strong></p>
+ <p><strong><?php echo categories::$Info->categories_name[$languages_id] ?></strong></p>
- <?php if (categories::$cInfo->listcount> 0): ?>
+ <?php if (categories::$Info->listcount> 0): ?>
- <?php if (categories::$cInfo->listcount['childs']> 0): ?>
- <h4><?php echo sprintf(__('text delete warning childs'), categories::$cInfo->listcount['childs']) ?></h4>
+ <?php if (categories::$Info->listcount['childs']> 0): ?>
+ <h4><?php echo sprintf(__('text delete warning childs'), categories::$Info->listcount['childs']) ?></h4>
<p><?php echo tep_draw_checkbox_field('delete_childs_in_cat',"delete_childs_in_cat", '', false).' '.__('text delete exe childs') ?></p>
<?php endif; ?>
- <?php foreach(array_map('trim',explode(',',categories::$cInfo->categories_datatype)) as $row) : ?>
+ <?php foreach(array_map('trim',explode(',',categories::$Info->categories_datatype)) as $row) : ?>
- <?php if ( isset(categories::$cInfo->listcount[$row]) && categories::$cInfo->listcount[$row] > 0) : ?>
- <h4><?php echo sprintf(__('text delete warning datatypes %1$s number %2$s'), $row, categories::$cInfo->listcount[$row] ) ?></h4>
+ <?php if ( isset(categories::$Info->listcount[$row]) && categories::$Info->listcount[$row] > 0) : ?>
+ <h4><?php echo sprintf(__('text delete warning datatypes %1$s number %2$s'), $row, categories::$Info->listcount[$row] ) ?></h4>
<p><?php echo tep_draw_checkbox_field('delete_in_cat['.$row.']',"delete_in_cat_".$row, '', false).' '.sprintf(__('text delete datatype %s exe'), $row ) ?></p>
<?php endif; ?>
@@ -39,7 +38,7 @@
<div class="button_nav">
- <?php echo tep_image_submit('button_delete.gif', IMAGE_DELETE) . tep_js_back(tep_href_link(categories::FILENAME, 'cID=' . categories::$cInfo->categories_id), IMAGE_CANCEL) ?>
+ <?php echo tep_image_submit('button_delete.gif', IMAGE_DELETE) . tep_js_back(tep_href_link(categories::FILENAME, 'cID=' . categories::$Info->id), IMAGE_CANCEL) ?>
</div>
</form>
</div>
\ No newline at end of file
Modified: trunk/catalog/admin/includes/modules/pages/categories.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/categories.php 2013-10-04 13:12:43 UTC (rev 4860)
+++ trunk/catalog/admin/includes/modules/pages/categories.php 2013-10-05 08:19:08 UTC (rev 4861)
@@ -721,6 +721,7 @@
break;
default:
+
sqlcategorie::Maintenance();
}
@@ -751,6 +752,7 @@
$action=self::$action;
switch ($action) {
+ case 'delete';
case 'edit';
$res = sqlcategorie::fetch(array('id'=> (int) self::$Id, 'language_id'=>(int)$languages_id), true);
@@ -1002,8 +1004,32 @@
$res=array();
switch (self::$action) {
+ case 'listing':
+ global $query_numrows,$languages_id;
+
+ while ($item = $_query->fetchAssoc()) {
+ $ord =array();
+
+ foreach(self::$InitInfo['modele']['listing'] as $k=>$row){
+ if($k == 'action') $ord[$k]=self::ButtonRowsActions($item);
+ elseif($k == 'status') $ord[$k]=self::RowStatus($item);
+ elseif($k == 'hidden') $ord[$k]=self::RowHidden($item);
+ elseif($k == 'image') $ord[$k]=(!empty($item['image'])) ? tep_info_image($item['image'], $item['name'], TEMP_BO_SMALL_IMAGE_WIDTH, TEMP_BO_SMALL_IMAGE_HEIGHT) : ' N/A';
+ elseif($k == 'cPath') $ord[$k]=categorieUtility::get_generated_category_path_ids( $item['id']);
+ elseif(in_array($k,array('added', 'modified') ) )$ord[$k]=((isset($item[$k]) && $item[$k] !='1000-01-01 00:00:00' )? tep_date_short($item[$k]) : '' );
+ else $ord[$k]=$item[$k];
+ }
+
+ $item[1]=tep_draw_checkbox_field('action_multi['.$item['id'].']','action_mutli_'.$item['id'],$item['id']);
+ $ord[0]=$item['id'];
+
+ $res[]=$ord;
+ }
+ break;
+
case 'new':
case 'edit';
+ default:
global $languages_id;
$ord =array();
@@ -1041,31 +1067,6 @@
}
}
}
-
-
- break;
- case 'listing':
- global $query_numrows,$languages_id;
-
- while ($item = $_query->fetchAssoc()) {
- $ord =array();
-
- foreach(self::$InitInfo['modele']['listing'] as $k=>$row){
- if($k == 'action') $ord[$k]=self::ButtonRowsActions($item);
- elseif($k == 'status') $ord[$k]=self::RowStatus($item);
- elseif($k == 'hidden') $ord[$k]=self::RowHidden($item);
- elseif($k == 'image') $ord[$k]=(!empty($item['image'])) ? tep_info_image($item['image'], $item['name'], TEMP_BO_SMALL_IMAGE_WIDTH, TEMP_BO_SMALL_IMAGE_HEIGHT) : ' N/A';
- elseif($k == 'cPath') $ord[$k]=categorieUtility::get_generated_category_path_ids( $item['id']);
- elseif(in_array($k,array('added', 'modified') ) )$ord[$k]=((isset($item[$k]) && $item[$k] !='1000-01-01 00:00:00' )? tep_date_short($item[$k]) : '' );
- else $ord[$k]=$item[$k];
- }
-
- $item[1]=tep_draw_checkbox_field('action_multi['.$item['id'].']','action_mutli_'.$item['id'],$item['id']);
- $ord[0]=$item['id'];
-
- $res[]=$ord;
- }
- break;
}
return $res;
Modified: trunk/catalog/includes/classes/category_tree.php
===================================================================
--- trunk/catalog/includes/classes/category_tree.php 2013-10-04 13:12:43 UTC (rev 4860)
+++ trunk/catalog/includes/classes/category_tree.php 2013-10-05 08:19:08 UTC (rev 4861)
@@ -73,9 +73,9 @@
foreach($list as $categories)
if( (bool)$categories->status)
-
$this->data[$categories->parent_id][$categories->categories_id] = array(
'href' => $categories->href,
+ 'cpath' => $categories->cpath,
'name' => $categories->categories_name,
'childs' => $categories->childs
);
@@ -172,6 +172,7 @@
$result[] = array(
'id' => $category_link,
'href' => $category['href'],
+ 'cpath' => $category['cpath'],
'title' => str_repeat($this->spacer_string, $this->spacer_multiplier * $level) . $category['name'],
'level'=> $level,
'childs'=> $category['childs'],
Modified: trunk/catalog/templates/defaut/includes/boxes/very_viewed.php
===================================================================
--- trunk/catalog/templates/defaut/includes/boxes/very_viewed.php 2013-10-04 13:12:43 UTC (rev 4860)
+++ trunk/catalog/templates/defaut/includes/boxes/very_viewed.php 2013-10-05 08:19:08 UTC (rev 4861)
@@ -13,6 +13,12 @@
* Produits les plues vues, en valeurs absolue
*/
+
+global $list, $type,$price, $page;
+ $type = 'product';
+ $max =10;
+
+
/**
@remarks Check display this box
depend Data_product active
@@ -22,28 +28,70 @@
/**
- @remarks Process Specific Boxes
+ @remarks Process Specific Boxes
*/
- $DB=Database::getInstance();
- $languages_id=$page->the_var('languages_id');
- $sql="select distinct p.products_id, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd," . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and c.categories_status='1' order by pd.products_viewed desc, pd.products_name limit 11" . '';
+ $page = page::getInstance();
+ $DB=Database::getInstance();
+ $languages_id=$page->GetVar('languages_id');
- $best_sellers_query = $DB->query($sql);
+ if( DataTypes::is_active('categories')){
+ $cPath=$page->GetVar('cPath');
+ $c = explode('_', $cPath);
+ }
+ $sql = "select distinct p.products_id as id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd," . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and c.categories_status='1' ";
- if ($best_sellers_query->__get('numRows') >= (int)MIN_DISPLAY_BESTSELLERS) {
- $s = '<ol>'."\n";
- while ($best_sellers = $best_sellers_query->fetchAssoc()) {
- $s .= '<li><a href="'.tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $best_sellers['products_id']).'">'.$best_sellers['products_name'].'</a></li>'."\n";
- }
- $s .= '</ol>'."\n";
+// if(isset($c) && is_array($c) && count($c) > 0)
+// $sql .=" AND categories_id IN (".implode($c,',').") ";
+ $sql .= " GROUP BY p.products_id ";
+ $sql .= " order by pd.products_viewed desc, pd.products_name limit 11 "; //;. $page->_conf_value('MAX_RANDOM_SELECT_NEW');
-/**
- @remarks Transmit var array for master construtor boxes
-*/
- $array= array('title'=>__('box heading very view'),'content'=>tep_output_string_protected($s,false,true));
+ if($max > 2) {
+
+ $query = $DB->query($sql);
+
+ if ($query->__get('numRows') >= (int)MIN_DISPLAY_BESTSELLERS)
+ $res_q = $query->fetchAllAssoc();
+ else
+ $res_q = false;
+
+ }
+ else{
+ $res_q = array( 'id'=> tep_random_select($sql) );
+ }
+
+
+ if ($res_q != false) {
+ $li = array();
+ $list = array();
+ foreach($res_q as $row){
+
+ if($row['id'] > 0 && !in_array($row['id'],$li)) {
+
+ $li[]=(int)$row['id'];
+ $obj = product::get_item((int)$row['id']);
+
+ $tmp = new stdClass;
+ $tmp->name = $obj->products_name;
+ $tmp->title = $obj->products_name;
+ $tmp->href = $obj->href;
+ $tmp->image = $obj->products_image;
+ $tmp->price = ( ($obj->products_price > 0) ?$price->print_products_price($obj->products_id,'html') : false );
+
+ $list[] = $tmp;
+ }
+ }
+
+
+ /**
+ @remarks Transmit var array for master construtor boxes
+ */
+ $array= array(
+ 'title'=>__('box heading very view'),
+ 'content'=>tep_output_string_protected(tep_get_include_contents('box.generic'),false,true),
+ );
}
else
return false;
Modified: trunk/catalog/templates/defaut/includes/boxes/whats_new.php
===================================================================
--- trunk/catalog/templates/defaut/includes/boxes/whats_new.php 2013-10-04 13:12:43 UTC (rev 4860)
+++ trunk/catalog/templates/defaut/includes/boxes/whats_new.php 2013-10-05 08:19:08 UTC (rev 4861)
@@ -3,8 +3,8 @@
@licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
@portion code Copyright (c) 2002 osCommerce
@package osCSS-2 <www http://www.oscss.org>
- *\version 2.1.2
- *\date 04/10/2013, 08:18
+ @version 2.1.1
+ @date 28/11/12, 08:18
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
@group boxes
@@ -15,35 +15,80 @@
* Affichage de la boite des nouveautés, qui assure l'affichage d'une seul produit.
*/
+
+
+global $list, $type,$price, $page;
+ $type = 'product';
+ $max = 2;
+
/**
- @remarks Check display this box
- depend Data_product active
+ @remarks depend Data_product active
*/
- if( ! DataTypes::is_active('product'))
+ if( ! DataTypes::is_active($type))
return false;
+
+
/**
- @remarks Process Specific Boxes
+ @remarks Process Specific Boxes
*/
- global $random_product, $price;
- $sql = "select p.products_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c where p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and p.products_status = '1' and c.categories_status = '1' and p.products_date_added > SUBDATE(now(), INTERVAL ".(int)MAX_DATEADDED_FOR_NEWX_PRODUCT." MONTH) order by p.products_date_added desc limit " . $page->_conf_value('MAX_RANDOM_SELECT_NEW');
- if ($random_product = tep_random_select($sql)) {
- $product_obj=product::get_item($random_product['products_id']);
- $s='';
- $random_product['products_name'] = $product_obj->products_name;
- $random_product['products_image'] =$product_obj->products_image;
- $random_product['specials_new_products_price'] = $price->print_products_price($random_product['products_id']);
+ $page = page::getInstance();
+ $DB=Database::getInstance();
+ if( DataTypes::is_active('categories')){
+ $cPath=$page->GetVar('cPath');
+ $c = explode('_', $cPath);
+ }
+
+ $sql = "select p.products_id as id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c where p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and p.products_status = '1' and c.categories_status = '1' and p.products_date_added > SUBDATE(now(), INTERVAL ".(int)MAX_DATEADDED_FOR_NEWX_PRODUCT." MONTH) ";
+
+// if(isset($c) && is_array($c) && count($c) > 0)
+// $sql .=" AND categories_id IN (".implode($c,',').") ";
+
+ $sql .= " GROUP BY p.products_id ";
+ $sql .= " ORDER BY p.products_date_added desc limit " . $page->_conf_value('MAX_RANDOM_SELECT_NEW');
+
+ if($max > 2) {
+
+ $query = $DB->query($sql);
+ $res_q = $query->fetchAllAssoc();
+ }
+ else{
+ $res_q = array( 'id'=> tep_random_select($sql) );
+ }
+
+ $li = array();
+ $list = array();
+ foreach($res_q as $row){
+
+ if($row['id'] > 0 && !in_array($row['id'],$li)) {
+
+ $li[]=(int)$row['id'];
+ $obj = product::get_item((int)$row['id']);
+
+ $tmp = new stdClass;
+ $tmp->name = $obj->products_name;
+ $tmp->title = $obj->products_name;
+ $tmp->href = $obj->href;
+ $tmp->image = $obj->products_image;
+ $tmp->price = ( ($obj->products_price > 0) ?$price->print_products_price($obj->products_id,'html') : false );
+
+ $list[] = $tmp;
+ }
+ }
+
/**
- @remarks Transmit var array for master construtor boxes
+ @remarks Transmit var array for master construtor boxes
*/
- $array= array('title'=>__('box heading whats new'),'content'=>tep_output_string_protected(tep_get_include_contents('box.whats_new'),false,true));
- }
- else
- return false;
+ $array=array(
+ 'title'=>__('@boxgeneric heading whats_new '.$type),
+ 'content'=>tep_output_string_protected(tep_get_include_contents('box.generic'),false,true),
+ 'class'=> $type,
+ );
+
?>
\ No newline at end of file
Added: trunk/catalog/templates/defaut/includes/gabarit/box.generic.gab
===================================================================
--- trunk/catalog/templates/defaut/includes/gabarit/box.generic.gab (rev 0)
+++ trunk/catalog/templates/defaut/includes/gabarit/box.generic.gab 2013-10-05 08:19:08 UTC (rev 4861)
@@ -0,0 +1,33 @@
+<?php
+/**
+ @licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
+ @portion code Copyright (c) 2002 osCommerce
+ @package osCSS-2 <www http://www.oscss.org>
+ @version 2.1.2
+ @date 05/10/2013, 14:32
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+*/
+global $list, $type;
+?>
+<ul class="inner-boxe <?php if(count($list)<=1) echo 'list unique' ?>">
+ <?php foreach($list as $row) : ?>
+ <li class="item">
+ <span class="title <?php echo $type ?>">
+ <a href="<?php echo $row->href ?>"><?php echo $row->title ?></a>
+ </span>
+ <?php if(count($list) <=2) : ?>
+ <span class="img <?php echo $type ?>">
+ <a href="<?php echo $row->href ?>">
+ <?php echo tep_image(DIR_WS_IMAGES . $row->image, '', $page->_conf_value('SIDEBAR_IMG_WIDTH'), $page->_conf_value('SIDEBAR_IMG_HEIGHT')) ?>
+ </a>
+ </span>
+ <?php endif; ?>
+ <?php if( $row->price !=false && count($list)<=1) : ?>
+ <span class="price <?php echo $type ?>">
+ <?php echo $row->price ?>
+ </span>
+ <?php endif; ?>
+ </li>
+ <?php endforeach; ?>
+</ul>
\ No newline at end of file
Deleted: trunk/catalog/templates/defaut/includes/gabarit/box.whats_new.gab
===================================================================
--- trunk/catalog/templates/defaut/includes/gabarit/box.whats_new.gab 2013-10-04 13:12:43 UTC (rev 4860)
+++ trunk/catalog/templates/defaut/includes/gabarit/box.whats_new.gab 2013-10-05 08:19:08 UTC (rev 4861)
@@ -1,25 +0,0 @@
-<?php
-/**
- @licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
- @portion code Copyright (c) 2002 osCommerce
- @package osCSS-2 <www http://www.oscss.org>
- @version 2.1.1
- @date 26/04/2013, 15:13
- @author oscim <mail aur...@os...> <www http://www.oscim.fr>
- @encode UTF-8
-*/
-global $random_product,$page;
-?>
-<div class="inner-boxe">
- <p class="title product">
- <a href="<?php echo tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id']) ?>"><?php echo $random_product['products_name'] ?></a>
- </p>
- <p class="img product">
- <a href="<?php echo tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id']) ?>">
- <?php echo tep_image(DIR_WS_IMAGES . $random_product['products_image'], '', $page->_conf_value('SIDEBAR_IMG_WIDTH'), $page->_conf_value('SIDEBAR_IMG_HEIGHT')) ?>
- </a>
- </p>
- <p class="price product">
- <?php echo print_products_price_rv($random_product) ?>
- </p>
-</div>
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2013-10-04 13:12:48
|
Revision: 4860
http://sourceforge.net/p/oscss/svn/4860
Author: oscim
Date: 2013-10-04 13:12:43 +0000 (Fri, 04 Oct 2013)
Log Message:
-----------
Add comment in code
Modified Paths:
--------------
trunk/catalog/templates/defaut/includes/boxes/best_sellers.php
trunk/catalog/templates/defaut/includes/boxes/categories.php
trunk/catalog/templates/defaut/includes/boxes/checkout_progressbar.php
trunk/catalog/templates/defaut/includes/boxes/cms_last_post.php
trunk/catalog/templates/defaut/includes/boxes/currencies.php
trunk/catalog/templates/defaut/includes/boxes/information.php
trunk/catalog/templates/defaut/includes/boxes/languages.php
trunk/catalog/templates/defaut/includes/boxes/login_box.php
trunk/catalog/templates/defaut/includes/boxes/menu.php
trunk/catalog/templates/defaut/includes/boxes/myaccount.php
trunk/catalog/templates/defaut/includes/boxes/order_history.php
trunk/catalog/templates/defaut/includes/boxes/recently_viewed.php
trunk/catalog/templates/defaut/includes/boxes/recently_viewed_content.php
trunk/catalog/templates/defaut/includes/boxes/search.php
trunk/catalog/templates/defaut/includes/boxes/search_suggest.php
trunk/catalog/templates/defaut/includes/boxes/selections.php
trunk/catalog/templates/defaut/includes/boxes/shopping_cart.php
trunk/catalog/templates/defaut/includes/boxes/shopping_cart_short.php
trunk/catalog/templates/defaut/includes/boxes/shopping_cart_short_ajax.php
trunk/catalog/templates/defaut/includes/boxes/specials.php
trunk/catalog/templates/defaut/includes/boxes/tags.php
trunk/catalog/templates/defaut/includes/boxes/tell_a_friend.php
trunk/catalog/templates/defaut/includes/boxes/very_viewed.php
trunk/catalog/templates/defaut/includes/boxes/view_min_cart.php
trunk/catalog/templates/defaut/includes/boxes/whats_new.php
Modified: trunk/catalog/templates/defaut/includes/boxes/best_sellers.php
===================================================================
--- trunk/catalog/templates/defaut/includes/boxes/best_sellers.php 2013-10-04 06:03:52 UTC (rev 4859)
+++ trunk/catalog/templates/defaut/includes/boxes/best_sellers.php 2013-10-04 13:12:43 UTC (rev 4860)
@@ -3,8 +3,8 @@
*\licence GPL 2005-2010 The osCSS developers - osCSS Open Source E-commerce
*\portion code Copyright (c) 2002 osCommerce
*\package osCSS-2 <www http://www.oscss.org>
- *\version 2.1.0
- *\date 28/11/10, 08:18
+ *\version 2.1.2
+ *\date 04/10/2013, 08:18
*\author oscim <mail aur...@os...> <www http://www.oscim.fr>
*\encode UTF-8
*\group boxes
@@ -12,10 +12,18 @@
*\brief Affiche Une nouveaute dans les produits, N'en affiche qu'une seule, de maniere aleatoire
*/
- //! @remarks depend Data_product active
+/**
+ @remarks Check display this box
+ depend Data_product active
+*/
if( ! DataTypes::is_active('product'))
return false;
+
+/**
+ @remarks Process Specific Boxes
+*/
+
$DB=Database::getInstance();
$languages_id=$page->the_var('languages_id');
if (isset($current_category_id) && ($current_category_id > 0)) {
@@ -30,7 +38,13 @@
$s .= '<li><a href="'. tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $best_sellers['products_id']) .'">'. $best_sellers['products_name'].'</a></li>'."\n";
}
$s .= '</ol>'."\n";
- $array= array('title'=>__('box heading bestsellers'),'content'=>tep_output_string_protected($s,false,true));
+ $tmp_array= array('title'=>__('box heading bestsellers'),'content'=>tep_output_string_protected($s,false,true));
}
- else $array= array('title'=>'','content'=>'');
+ else $tmp_array= array('title'=>'','content'=>'');
+
+
+/**
+ @remarks Transmit var array for master construtor boxes
+*/
+ $array= $tmp_array;
?>
\ No newline at end of file
Modified: trunk/catalog/templates/defaut/includes/boxes/categories.php
===================================================================
--- trunk/catalog/templates/defaut/includes/boxes/categories.php 2013-10-04 06:03:52 UTC (rev 4859)
+++ trunk/catalog/templates/defaut/includes/boxes/categories.php 2013-10-04 13:12:43 UTC (rev 4860)
@@ -3,8 +3,8 @@
@licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
@portion code Copyright (c) 2002 osCommerce
@package osCSS-2 <www http://www.oscss.org>
- @version 2.1.1
- @date 28/11/12, 08:18
+ *\version 2.1.2
+ *\date 04/10/2013, 08:18
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
@group boxes
@@ -17,6 +17,9 @@
if( ! DataTypes::is_active('categorie'))
return false;
+/**
+ @remarks Process Specific Boxes
+*/
// require_once(DIR_WS_CLASSES . 'category_tree.php'); // autoload
$CategoryTree = new category_tree;
$osCSS_Cache=new osCSS_Cache;
@@ -45,5 +48,10 @@
}
else $s= $osCSS_Cache->getCache();
+
+
+/**
+ @remarks Transmit var array for master construtor boxes
+*/
$array=array('title'=>__('categories menu'),'content'=>tep_output_string_protected($s,false,true));
?>
\ No newline at end of file
Modified: trunk/catalog/templates/defaut/includes/boxes/checkout_progressbar.php
===================================================================
--- trunk/catalog/templates/defaut/includes/boxes/checkout_progressbar.php 2013-10-04 06:03:52 UTC (rev 4859)
+++ trunk/catalog/templates/defaut/includes/boxes/checkout_progressbar.php 2013-10-04 13:12:43 UTC (rev 4860)
@@ -3,16 +3,22 @@
*\licence GPL 2005-2010 The osCSS developers - osCSS Open Source E-commerce
*\portion code Copyright (c) 2002 osCommerce
*\package osCSS-2 <www http://www.oscss.org>
- *\version 2.1.0
- *\date 28/11/10, 08:18
+ *\version 2.1.2
+ *\date 04/10/2013, 08:18
*\author oscim <mail aur...@os...> <www http://www.oscim.fr>
*\encode UTF-8
*\group boxes
*\file includes/boxes/checkout_progressbar.php
*\brief Display progressbar for checkout process
*/
+
+
+/**
+ @remarks Process Specific Boxes
+*/
global $full, $current;
+
$full=array();
if($page->is_page_type('cart') ){
@@ -37,6 +43,10 @@
$full=array(0,1,2,3,4);
}
}
+
+/**
+ @remarks Transmit var array for master construtor boxes
+*/
$array=array('title'=>__(''),'content'=>tep_output_string_protected(tep_get_include_contents('box.checkout_progressbar'),false,true));
?>
\ No newline at end of file
Modified: trunk/catalog/templates/defaut/includes/boxes/cms_last_post.php
===================================================================
--- trunk/catalog/templates/defaut/includes/boxes/cms_last_post.php 2013-10-04 06:03:52 UTC (rev 4859)
+++ trunk/catalog/templates/defaut/includes/boxes/cms_last_post.php 2013-10-04 13:12:43 UTC (rev 4860)
@@ -3,8 +3,8 @@
@licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
@portion code Copyright (c) 2002 osCommerce
@package osCSS-2 <www http://www.oscss.org>
- @version 2.1.1
- @date 28/11/12, 08:18
+ *\version 2.1.2
+ *\date 04/10/2013, 08:18
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
@group boxes
@@ -15,6 +15,10 @@
if( ! DataTypes::is_active('content'))
return false;
+
+/**
+ @remarks Process Specific Boxes
+*/
$tab = tep_return_cms_liste_byDate(10,array(@$_GET['content']));
if(is_array($tab) &&count($tab >0 )){
$t='<ol>';
Modified: trunk/catalog/templates/defaut/includes/boxes/currencies.php
===================================================================
--- trunk/catalog/templates/defaut/includes/boxes/currencies.php 2013-10-04 06:03:52 UTC (rev 4859)
+++ trunk/catalog/templates/defaut/includes/boxes/currencies.php 2013-10-04 13:12:43 UTC (rev 4860)
@@ -3,13 +3,18 @@
*\licence GPL 2005-2010 The osCSS developers - osCSS Open Source E-commerce
*\portion code Copyright (c) 2002 osCommerce
*\package osCSS-2 <www http://www.oscss.org>
- *\version 2.1.0
- *\date 28/11/10, 08:18
+ *\version 2.1.2
+ *\date 04/10/2013, 08:18
*\author oscim <mail aur...@os...> <www http://www.oscim.fr>
*\encode UTF-8
*\group boxes
*\file includes/boxes/currencies.php
*/
+
+
+/**
+ @remarks Process Specific Boxes
+*/
global $page,$PHP_SELF,$request_type,$hidden_get_variables,$currencies_array;
$currency=$page->the_var('currency');
@@ -25,6 +30,11 @@
while (list($key, $value) = each($_GET)) if ( ($key != 'currency') && ($key != tep_session_name()) ) $hidden_get_variables .= tep_draw_hidden_field($key, $value);
+
+/**
+ @remarks Transmit var array for master construtor boxes
+*/
+
$array['title']=__('box heading currencies');
$array['content']=tep_output_string_protected(tep_get_include_contents('box.currencies'), false, true) ;
Modified: trunk/catalog/templates/defaut/includes/boxes/information.php
===================================================================
--- trunk/catalog/templates/defaut/includes/boxes/information.php 2013-10-04 06:03:52 UTC (rev 4859)
+++ trunk/catalog/templates/defaut/includes/boxes/information.php 2013-10-04 13:12:43 UTC (rev 4860)
@@ -3,8 +3,8 @@
@licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
@portion code Copyright (c) 2002 osCommerce
@package osCSS-2 <www http://www.oscss.org>
- @version 2.1.1
- @date 28/11/12, 08:18
+ *\version 2.1.2
+ *\date 04/10/2013, 08:18
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
@group boxes
@@ -15,6 +15,10 @@
if( ! DataTypes::is_active('content'))
return false;
+
+/**
+ @remarks Process Specific Boxes
+*/
global $template,$page;
$s='';
$language=$page->the_var('language');
@@ -24,5 +28,10 @@
if(is_array($in))
foreach($in as $v){ $s.= ' <li><a href="'.$v['href'].'">'.$v['title'].'</a></li>'."\n"; }
$s .='</ul>';
+
+
+/**
+ @remarks Transmit var array for master construtor boxes
+*/
$array=array('title'=>BOX_HEADING_INFORMATION,'content'=>tep_output_string_protected($s,false,true));
?>
Modified: trunk/catalog/templates/defaut/includes/boxes/languages.php
===================================================================
--- trunk/catalog/templates/defaut/includes/boxes/languages.php 2013-10-04 06:03:52 UTC (rev 4859)
+++ trunk/catalog/templates/defaut/includes/boxes/languages.php 2013-10-04 13:12:43 UTC (rev 4860)
@@ -3,14 +3,18 @@
*\licence GPL 2005-2010 The osCSS developers - osCSS Open Source E-commerce
*\portion code Copyright (c) 2002 osCommerce
*\package osCSS-2 <www http://www.oscss.org>
- *\version 2.1.0
- *\date 28/11/10, 08:18
+ *\version 2.1.2
+ *\date 04/10/2013, 08:18
*\author oscim <mail aur...@os...> <www http://www.oscim.fr>
*\encode UTF-8
*\group boxes
*\file includes/boxes/languages.php
*/
+
+/**
+ @remarks Process Specific Boxes
+*/
global $page,$PHP_SELF,$request_type,$lng, $language;
if (!isset($lng) || (isset($lng) && !is_object($lng))) {
$lng = new language;
@@ -18,6 +22,10 @@
$languages_string = '';
reset($lng->catalog_languages);
+
+/**
+ @remarks Transmit var array for master construtor boxes
+*/
$array['title']=__('box heading languages');
$array['content']=tep_output_string_protected(tep_get_include_contents('box.languages'), false, true) ;
Modified: trunk/catalog/templates/defaut/includes/boxes/login_box.php
===================================================================
--- trunk/catalog/templates/defaut/includes/boxes/login_box.php 2013-10-04 06:03:52 UTC (rev 4859)
+++ trunk/catalog/templates/defaut/includes/boxes/login_box.php 2013-10-04 13:12:43 UTC (rev 4860)
@@ -3,14 +3,19 @@
*\licence GPL 2005-2010 The osCSS developers - osCSS Open Source E-commerce
*\portion code Copyright (c) 2002 osCommerce
*\package osCSS-2 <www http://www.oscss.org>
- *\version 2.1.0
- *\date 28/11/10, 08:18
+ *\version 2.1.2
+ *\date 04/10/2013, 08:18
*\author oscim <mail aur...@os...> <www http://www.oscim.fr>
*\encode UTF-8
*\group boxes
*\file includes/boxes/login_box.php
*/
+
+/**
+ @remarks Process Specific Boxes
+*/
+
$s='';
if (tep_session_is_registered('customer_first_name') && tep_session_is_registered('customer_id')) {
$s.='<div class="back_login" ><p>'. __('Bienvenue ').'</p><br />'."\n";
@@ -38,5 +43,10 @@
$s.='</p>'."\n";
$s.='</form>'."\n";
}
+
+
+/**
+ @remarks Transmit var array for master construtor boxes
+*/
$array= array('title'=>'','content'=>tep_output_string_protected($s,false,true));
?>
Modified: trunk/catalog/templates/defaut/includes/boxes/menu.php
===================================================================
--- trunk/catalog/templates/defaut/includes/boxes/menu.php 2013-10-04 06:03:52 UTC (rev 4859)
+++ trunk/catalog/templates/defaut/includes/boxes/menu.php 2013-10-04 13:12:43 UTC (rev 4860)
@@ -3,17 +3,26 @@
*\licence GPL 2005-2010 The osCSS developers - osCSS Open Source E-commerce
*\portion code Copyright (c) 2002 osCommerce
*\package osCSS-2 <www http://www.oscss.org>
- *\version 2.1.0
- *\date 28/11/10, 08:18
+ *\version 2.1.2
+ *\date 04/10/2013, 08:18
*\author oscim <mail aur...@os...> <www http://www.oscim.fr>
*\encode UTF-8
*\group boxes
*\file includes/boxes/menu.php
*/
+
+/**
+ @remarks Process Specific Boxes
+*/
global $menu;
$menu=oscss_navlinks(0);
+
+
+/**
+ @remarks Transmit var array for master construtor boxes
+*/
$array['title']=__('box heading languages');
$array['content']=tep_output_string_protected(tep_get_include_contents('box.menu'), false, true) ;
Modified: trunk/catalog/templates/defaut/includes/boxes/myaccount.php
===================================================================
--- trunk/catalog/templates/defaut/includes/boxes/myaccount.php 2013-10-04 06:03:52 UTC (rev 4859)
+++ trunk/catalog/templates/defaut/includes/boxes/myaccount.php 2013-10-04 13:12:43 UTC (rev 4860)
@@ -3,16 +3,23 @@
*\licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
*\portion code Copyright (c) 2002 osCommerce
*\package osCSS-2 <www http://www.oscss.org>
- *\version 2.1.1
- *\date 15/04/2012, 22:44
+ *\version 2.1.2
+ *\date 04/10/2013, 08:18
*\author oscim <mail aur...@os...> <www http://www.oscim.fr>
*\encode UTF-8
*\group boxes
*/
+/**
+ @remarks Process Specific Boxes
+*/
+
+/**
+ @remarks Transmit var array for master construtor boxes
+*/
$array= array('title'=>__('box heading my account'),'content'=>tep_output_string_protected(tep_get_include_contents('box.myaccount'),false,true));
?>
\ No newline at end of file
Modified: trunk/catalog/templates/defaut/includes/boxes/order_history.php
===================================================================
--- trunk/catalog/templates/defaut/includes/boxes/order_history.php 2013-10-04 06:03:52 UTC (rev 4859)
+++ trunk/catalog/templates/defaut/includes/boxes/order_history.php 2013-10-04 13:12:43 UTC (rev 4860)
@@ -3,14 +3,19 @@
*\licence GPL 2005-2010 The osCSS developers - osCSS Open Source E-commerce
*\portion code Copyright (c) 2002 osCommerce
*\package osCSS-2 <www http://www.oscss.org>
- *\version 2.1.0
- *\date 28/11/10, 08:18
+ *\version 2.1.2
+ *\date 04/10/2013, 08:18
*\author oscim <mail aur...@os...> <www http://www.oscim.fr>
*\encode UTF-8
*\brief Display list order for user id
*
* Cette boite affiche les commande du client en cours
*/
+
+
+/**
+ @remarks Process Specific Boxes
+*/
$DB=Database::getInstance();
if (tep_session_is_registered('customer_id')) {
// retreive the last x products purchased
Modified: trunk/catalog/templates/defaut/includes/boxes/recently_viewed.php
===================================================================
--- trunk/catalog/templates/defaut/includes/boxes/recently_viewed.php 2013-10-04 06:03:52 UTC (rev 4859)
+++ trunk/catalog/templates/defaut/includes/boxes/recently_viewed.php 2013-10-04 13:12:43 UTC (rev 4860)
@@ -3,8 +3,8 @@
@licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
@portion code Copyright (c) 2002 osCommerce
@package osCSS-2 <www http://www.oscss.org>
- @version 2.1.1
- @date 29/04/2013, 15:13
+ *\version 2.1.2
+ *\date 04/10/2013, 08:18
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
*\group boxes
@@ -12,15 +12,27 @@
*\dir includes/boxes/
*\brief display list product recently viewed
*/
-global $page,$recent_products;
- //! @remarks depend Data_product active
+
+/**
+ @remarks Check display this box
+ depend Data_product active
+*/
if( ! DataTypes::is_active('product'))
return false;
+
//! @remarks cf config
if( ! $page->_conf_value('OSCSS__B_RECENTLY_VIEWED'))
return false;
+
+
+/**
+ @remarks Process Specific Boxes
+*/
+
+global $page,$recent_products;
+
$count=0;
if(tep_session_is_registered('recently_viewed') )
@@ -46,6 +58,10 @@
}
$s .= '</ul>'."\n".'</div>'."\n";
+
+/**
+ @remarks Transmit var array for master construtor boxes
+*/
$array= array(
'type'=>'product',
'title'=>__('box heading viewed products'),
Modified: trunk/catalog/templates/defaut/includes/boxes/recently_viewed_content.php
===================================================================
--- trunk/catalog/templates/defaut/includes/boxes/recently_viewed_content.php 2013-10-04 06:03:52 UTC (rev 4859)
+++ trunk/catalog/templates/defaut/includes/boxes/recently_viewed_content.php 2013-10-04 13:12:43 UTC (rev 4860)
@@ -3,8 +3,8 @@
@licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
@portion code Copyright (c) 2002 osCommerce
@package osCSS-2 <www http://www.oscss.org>
- @version 2.1.1
- @date 29/04/2013, 15:13
+ *\version 2.1.2
+ *\date 04/10/2013, 08:18
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
*\group boxes
@@ -12,15 +12,28 @@
*\dir includes/boxes/
*\brief display list product recently viewed
*/
-global $page,$recent_content;
- //! @remarks depend Data_product active
- if( ! DataTypes::is_active('content'))
+
+
+/**
+ @remarks Check display this box
+ depend Data_product active
+*/
+ if( ! DataTypes::is_active('product'))
return false;
//! @remarks cf config
if( ! $page->_conf_value('OSCSS__B_RECENTLY_VIEWED'))
return false;
+
+
+/**
+ @remarks Process Specific Boxes
+*/
+global $page,$recent_content;
+
+
+
$count=0;
@@ -45,6 +58,10 @@
}
$s .= '</ul>'."\n".'</div>'."\n";
+
+/**
+ @remarks Transmit var array for master construtor boxes
+*/
$array= array(
'type'=>'content',
'title'=>__('box heading viewed content'),
Modified: trunk/catalog/templates/defaut/includes/boxes/search.php
===================================================================
--- trunk/catalog/templates/defaut/includes/boxes/search.php 2013-10-04 06:03:52 UTC (rev 4859)
+++ trunk/catalog/templates/defaut/includes/boxes/search.php 2013-10-04 13:12:43 UTC (rev 4860)
@@ -3,8 +3,8 @@
*\licence GPL 2005-2010 The osCSS developers - osCSS Open Source E-commerce
*\portion code Copyright (c) 2002 osCommerce
*\package osCSS-2 <www http://www.oscss.org>
- *\version 2.1.0
- *\date 28/11/10, 08:18
+ *\version 2.1.2
+ *\date 04/10/2013, 08:18
*\author oscim <mail aur...@os...> <www http://www.oscim.fr>
*\encode UTF-8
*\group boxes
@@ -14,8 +14,20 @@
*
* Formulaire de recherche
*/
+
+
+
+/**
+ @remarks Process Specific Boxes
+*/
$s = tep_draw_form('quick_find', tep_href_link(FILENAME_ADVANCED_SEARCH, '', 'NONSSL', false), 'get')."\n";
$s .= '<p>'.tep_draw_input_field('keywords','keywords', __('box search input'),'onfocus="this.value=\'\'"') .'</p>'."\n";
$s .= '<p><input class="submitBt" type="submit" value="'.__('search valid').'" /></p>'."\n".'</form>'."\n";
+
+
+
+/**
+ @remarks Transmit var array for master construtor boxes
+*/
$array= array('title'=>__('box heading search'),'content'=>tep_output_string_protected($s,false,true));
?>
Modified: trunk/catalog/templates/defaut/includes/boxes/search_suggest.php
===================================================================
--- trunk/catalog/templates/defaut/includes/boxes/search_suggest.php 2013-10-04 06:03:52 UTC (rev 4859)
+++ trunk/catalog/templates/defaut/includes/boxes/search_suggest.php 2013-10-04 13:12:43 UTC (rev 4860)
@@ -3,8 +3,8 @@
@licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
@portion code Copyright (c) 2002 osCommerce
@package osCSS-2 <www http://www.oscss.org>
- @version 2.1.0
- @date 27/01/11, 15:00
+ *\version 2.1.2
+ *\date 04/10/2013, 08:18
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
*\file search_suggest.php
@@ -13,6 +13,11 @@
* Cette boite affiche un champs de recherche et affiche une liste de resutat via ajax
* Le javascript est contenu dans la boite , et chargé a travers le constructeur page_javascript
*/
+
+
+/**
+ @remarks Process Specific Boxes
+*/
global $page;
$s='';
@@ -56,5 +61,10 @@
$page->javascript->add_script_src(array('file'=>'search_suggest','script'=>tep_output_string_protected($s,false,true)) );
+
+
+/**
+ @remarks Transmit var array for master construtor boxes
+*/
$array= array('title'=>__('box heading search'),'content'=>tep_output_string_protected(tep_get_include_contents('box.search_suggest'),false,true));
?>
\ No newline at end of file
Modified: trunk/catalog/templates/defaut/includes/boxes/selections.php
===================================================================
--- trunk/catalog/templates/defaut/includes/boxes/selections.php 2013-10-04 06:03:52 UTC (rev 4859)
+++ trunk/catalog/templates/defaut/includes/boxes/selections.php 2013-10-04 13:12:43 UTC (rev 4860)
@@ -3,8 +3,8 @@
@licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
@portion code Copyright (c) 2002 osCommerce
@package osCSS-2 <www http://www.oscss.org>
- @version 2.1.1
- @date 28/11/12, 08:18
+ *\version 2.1.2
+ *\date 04/10/2013, 08:18
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
@group boxes
@@ -12,10 +12,16 @@
@brief The list fixed seleted page listing special/product new/small price/best sellers
*/
- //! @remarks depend Data_product active
+/**
+ @remarks Check display this box
+ depend Data_product active
+*/
if( ! DataTypes::is_active('product'))
return false;
+/**
+ @remarks Process Specific Boxes
+*/
$s ='<ul>'."\n";
$s .=' <li><a href="'.tep_href_link(FILENAME_PRODUCTS_NEW).'">'.__('box selections products new').'</a></li>'."\n";
$s .='<li><a href="'.tep_href_link(FILENAME_SPECIALS).'">'.__('box selections specials').'</a></li>'."\n";
@@ -24,5 +30,10 @@
$s .='</ul>'."\n";
+
+
+/**
+ @remarks Transmit var array for master construtor boxes
+*/
$array= array('title'=>__('box heading selections'),'content'=>tep_output_string_protected($s,false,true));
?>
Modified: trunk/catalog/templates/defaut/includes/boxes/shopping_cart.php
===================================================================
--- trunk/catalog/templates/defaut/includes/boxes/shopping_cart.php 2013-10-04 06:03:52 UTC (rev 4859)
+++ trunk/catalog/templates/defaut/includes/boxes/shopping_cart.php 2013-10-04 13:12:43 UTC (rev 4860)
@@ -4,8 +4,8 @@
*\licence GPL 2005-2010 The osCSS developers - osCSS Open Source E-commerce
*\portion code Copyright (c) 2002 osCommerce
*\package osCSS-2 <www http://www.oscss.org>
- *\version 2.1.0
- *\date 28/11/10, 08:18
+ *\version 2.1.2
+ *\date 04/10/2013, 08:18
*\author oscim <mail aur...@os...> <www http://www.oscim.fr>
*\encode UTF-8
*\group boxes
@@ -13,6 +13,11 @@
*\dir includes/boxes/
*\brief cart custommers
*/
+
+
+/**
+ @remarks Process Specific Boxes
+*/
global $detail_tot, $detail;
$currencies=$page->return_object('currencies');
@@ -57,5 +62,11 @@
$title='<a href="'.tep_href_link(FILENAME_SHOPPING_CART).'">'.__('box heading shopping cart').'</a>';
+
+
+
+/**
+ @remarks Transmit var array for master construtor boxes
+*/
$array=array('title'=>tep_output_string_protected($title,false,true),'content'=>tep_output_string_protected(tep_get_include_contents('box.cart'),false,true));
?>
\ No newline at end of file
Modified: trunk/catalog/templates/defaut/includes/boxes/shopping_cart_short.php
===================================================================
--- trunk/catalog/templates/defaut/includes/boxes/shopping_cart_short.php 2013-10-04 06:03:52 UTC (rev 4859)
+++ trunk/catalog/templates/defaut/includes/boxes/shopping_cart_short.php 2013-10-04 13:12:43 UTC (rev 4860)
@@ -4,13 +4,19 @@
*\licence GPL 2005-2010 The osCSS developers - osCSS Open Source E-commerce
*\portion code Copyright (c) 2002 osCommerce
*\package osCSS-2 <www http://www.oscss.org>
- *\version 2.1.0
- *\date 28/11/10, 08:18
+ *\version 2.1.2
+ *\date 04/10/2013, 08:18
*\author oscim <mail aur...@os...> <www http://www.oscim.fr>
*\encode UTF-8
*\group boxes
*\file shopping_cart_short.php
*/
+
+
+
+/**
+ @remarks Process Specific Boxes
+*/
global $total_nb_products_with_qty;
$currencies=$page->return_object('currencies');
$cart=$page->return_object('cart');
@@ -21,6 +27,12 @@
$total_nb_products_with_qty += $products[$i]['quantity'];
}
$title='<a href="'.tep_href_link(FILENAME_SHOPPING_CART).'">'.__('box heading shopping cart').'</a>';
+
+
+
+/**
+ @remarks Transmit var array for master construtor boxes
+*/
$array=array(
'type'=>'shoppingcart',
'title'=>tep_output_string_protected($title,false,true),
Modified: trunk/catalog/templates/defaut/includes/boxes/shopping_cart_short_ajax.php
===================================================================
--- trunk/catalog/templates/defaut/includes/boxes/shopping_cart_short_ajax.php 2013-10-04 06:03:52 UTC (rev 4859)
+++ trunk/catalog/templates/defaut/includes/boxes/shopping_cart_short_ajax.php 2013-10-04 13:12:43 UTC (rev 4860)
@@ -3,13 +3,18 @@
*\licence GPL 2005-2010 The osCSS developers - osCSS Open Source E-commerce
*\portion code Copyright (c) 2002 osCommerce
*\package osCSS-2 <www http://www.oscss.org>
- *\version 2.1.0
- *\date 28/11/10, 08:18
+ *\version 2.1.2
+ *\date 04/10/2013, 08:18
*\author oscim <mail aur...@os...> <www http://www.oscim.fr>
*\encode UTF-8
*\file shopping_cart_short_ajax.php
*\brief the box shopping_cart
*/
+
+
+/**
+ @remarks Process Specific Boxes
+*/
global $total_nb_products_with_qty;
$currencies=$page->return_object('currencies');
$cart=$page->return_object('cart');
@@ -21,5 +26,11 @@
}
$title='<a href="'.tep_href_link(FILENAME_SHOPPING_CART).'">'.__('box heading shopping cart').'</a>';
+
+
+
+/**
+ @remarks Transmit var array for master construtor boxes
+*/
$array=array('title'=>tep_output_string_protected($title,false,true),'content'=>tep_get_include_contents('box.cart.short'));
?>
Modified: trunk/catalog/templates/defaut/includes/boxes/specials.php
===================================================================
--- trunk/catalog/templates/defaut/includes/boxes/specials.php 2013-10-04 06:03:52 UTC (rev 4859)
+++ trunk/catalog/templates/defaut/includes/boxes/specials.php 2013-10-04 13:12:43 UTC (rev 4860)
@@ -3,24 +3,36 @@
@licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
@portion code Copyright (c) 2002 osCommerce
@package osCSS-2 <www http://www.oscss.org>
- @version 2.1.1
- @date 28/11/12, 08:18
+ *\version 2.1.2
+ *\date 04/10/2013, 08:18
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
@group boxes
@dir includes/boxes/
*/
- //! @remarks depend Data_product active
+/**
+ @remarks Check display this box
+ depend Data_product active
+*/
if( ! DataTypes::is_active('product'))
return false;
+
+/**
+ @remarks Process Specific Boxes
+*/
global $random_product;
$languages_id=$page->the_var('languages_id');
$sql = "select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_new_products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s , " . TABLE_CATEGORIES . " c, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.products_id = s.products_id and p.products_id = pd.products_id and p.products_id = p2c.products_id and categories_status = 1 and pd.language_id = '" . (int)$languages_id . "' and s.status = '1' order by s.specials_date_added desc limit " . $page->_conf_value('MAX_RANDOM_SELECT_SPECIALS');
if ($random_product = tep_random_select($sql)) {
+
+
+/**
+ @remarks Transmit var array for master construtor boxes
+*/
$array= array('title'=>__('box heading specials'),'content'=>tep_output_string_protected(tep_get_include_contents('box.specials'),false,true));
}
else
Modified: trunk/catalog/templates/defaut/includes/boxes/tags.php
===================================================================
--- trunk/catalog/templates/defaut/includes/boxes/tags.php 2013-10-04 06:03:52 UTC (rev 4859)
+++ trunk/catalog/templates/defaut/includes/boxes/tags.php 2013-10-04 13:12:43 UTC (rev 4860)
@@ -3,16 +3,27 @@
@licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
@portion code Copyright (c) 2002 osCommerce
@package osCSS-2 <www http://www.oscss.org>
- @version 2.1.1
- @date 07/09/11, 09:03
+ *\version 2.1.2
+ *\date 04/10/2013, 08:18
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
*/
+
+
+/**
+ @remarks Process Specific Boxes
+*/
+
if(isset($_GET['products_id']) || isset($_GET['content']) || isset($_GET['cPath'])):
// include cloud generator
include_once(DIR_WS_FUNCTIONS.'generate.php');
+
+
+/**
+ @remarks Transmit var array for master construtor boxes
+*/
$array=array('title'=>__('text tags'),'content'=>tep_output_string_protected(tep_get_include_contents('box.tags'),false,true));
endif;
Modified: trunk/catalog/templates/defaut/includes/boxes/tell_a_friend.php
===================================================================
--- trunk/catalog/templates/defaut/includes/boxes/tell_a_friend.php 2013-10-04 06:03:52 UTC (rev 4859)
+++ trunk/catalog/templates/defaut/includes/boxes/tell_a_friend.php 2013-10-04 13:12:43 UTC (rev 4860)
@@ -4,14 +4,26 @@
*\licence GPL 2005-2010 The osCSS developers - osCSS Open Source E-commerce
*\portion code Copyright (c) 2002 osCommerce
*\package osCSS-2 <www http://www.oscss.org>
- *\version 2.1.0
- *\date 28/11/10, 08:18
+ *\version 2.1.2
+ *\date 04/10/2013, 08:18
*\author oscim <mail aur...@os...> <www http://www.oscim.fr>
*\encode UTF-8
*\group boxes
*\file
*\dir includes/boxes/
*/
+
+/**
+ @remarks Check display this box
+ depend Data_product active
+*/
+ if( ! DataTypes::is_active('product'))
+ return false;
+
+
+/**
+ @remarks Process Specific Boxes
+*/
if(isset($_GET['products_id'])) {
$s =tep_draw_form('tell_a_friend', tep_href_link(FILENAME_TELL_A_FRIEND, '', 'NONSSL', false), 'get')."\n";
$s.='<div>'."\n";
Modified: trunk/catalog/templates/defaut/includes/boxes/very_viewed.php
===================================================================
--- trunk/catalog/templates/defaut/includes/boxes/very_viewed.php 2013-10-04 06:03:52 UTC (rev 4859)
+++ trunk/catalog/templates/defaut/includes/boxes/very_viewed.php 2013-10-04 13:12:43 UTC (rev 4860)
@@ -3,8 +3,8 @@
@licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
@portion code Copyright (c) 2002 osCommerce
@package osCSS-2 <www http://www.oscss.org>
- @version 2.1.1
- @date 28/11/12, 08:18
+ *\version 2.1.2
+ *\date 04/10/2013, 08:18
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
@group boxes
@@ -13,10 +13,17 @@
* Produits les plues vues, en valeurs absolue
*/
- //! @remarks depend Data_product active
+/**
+ @remarks Check display this box
+ depend Data_product active
+*/
if( ! DataTypes::is_active('product'))
return false;
+
+/**
+ @remarks Process Specific Boxes
+*/
$DB=Database::getInstance();
$languages_id=$page->the_var('languages_id');
@@ -31,6 +38,11 @@
$s .= '<li><a href="'.tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $best_sellers['products_id']).'">'.$best_sellers['products_name'].'</a></li>'."\n";
}
$s .= '</ol>'."\n";
+
+
+/**
+ @remarks Transmit var array for master construtor boxes
+*/
$array= array('title'=>__('box heading very view'),'content'=>tep_output_string_protected($s,false,true));
}
else
Modified: trunk/catalog/templates/defaut/includes/boxes/view_min_cart.php
===================================================================
--- trunk/catalog/templates/defaut/includes/boxes/view_min_cart.php 2013-10-04 06:03:52 UTC (rev 4859)
+++ trunk/catalog/templates/defaut/includes/boxes/view_min_cart.php 2013-10-04 13:12:43 UTC (rev 4860)
@@ -4,8 +4,8 @@
*\licence GPL 2005-2010 The osCSS developers - osCSS Open Source E-commerce
*\portion code Copyright (c) 2002 osCommerce
*\package osCSS-2 <www http://www.oscss.org>
- *\version 2.1.0
- *\date 28/11/10, 08:18
+ *\version 2.1.2
+ *\date 04/10/2013, 08:18
*\author oscim <mail aur...@os...> <www http://www.oscim.fr>
*\encode UTF-8
*\group boxes
@@ -14,6 +14,11 @@
*
* Affichage minimum des informations du panier
*/
+
+
+/**
+ @remarks Process Specific Boxes
+*/
global $page, $template;
$currencies=$page->return_object('currencies');
$cart=$page->return_object('cart');
@@ -31,6 +36,11 @@
*/
$cart_contents_string.=' <a href="'.tep_href_link(FILENAME_SHOPPING_CART).'"><span class="nbproducts">'.__('article x ').''.$item.'</span><img id="img_cart" src="'.HTTP_SERVER.DIR_WS_HTTP_CATALOG.DIR_WS_TEMPLATES.$template.'/img/'.'panier.jpg" alt="panier"/></a> ';
+
+
+/**
+ @remarks Transmit var array for master construtor boxes
+*/
$array=array('title'=>__('Votre Panier'),'content'=>tep_output_string_protected($cart_contents_string,false,true));
?>
\ No newline at end of file
Modified: trunk/catalog/templates/defaut/includes/boxes/whats_new.php
===================================================================
--- trunk/catalog/templates/defaut/includes/boxes/whats_new.php 2013-10-04 06:03:52 UTC (rev 4859)
+++ trunk/catalog/templates/defaut/includes/boxes/whats_new.php 2013-10-04 13:12:43 UTC (rev 4860)
@@ -3,8 +3,8 @@
@licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
@portion code Copyright (c) 2002 osCommerce
@package osCSS-2 <www http://www.oscss.org>
- @version 2.1.1
- @date 28/11/12, 08:18
+ *\version 2.1.2
+ *\date 04/10/2013, 08:18
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
@group boxes
@@ -15,10 +15,17 @@
* Affichage de la boite des nouveautés, qui assure l'affichage d'une seul produit.
*/
- //! @remarks depend Data_product active
+/**
+ @remarks Check display this box
+ depend Data_product active
+*/
if( ! DataTypes::is_active('product'))
return false;
+
+/**
+ @remarks Process Specific Boxes
+*/
global $random_product, $price;
$sql = "select p.products_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c where p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and p.products_status = '1' and c.categories_status = '1' and p.products_date_added > SUBDATE(now(), INTERVAL ".(int)MAX_DATEADDED_FOR_NEWX_PRODUCT." MONTH) order by p.products_date_added desc limit " . $page->_conf_value('MAX_RANDOM_SELECT_NEW');
@@ -30,6 +37,11 @@
$random_product['products_image'] =$product_obj->products_image;
$random_product['specials_new_products_price'] = $price->print_products_price($random_product['products_id']);
+
+
+/**
+ @remarks Transmit var array for master construtor boxes
+*/
$array= array('title'=>__('box heading whats new'),'content'=>tep_output_string_protected(tep_get_include_contents('box.whats_new'),false,true));
}
else
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2013-10-04 06:03:59
|
Revision: 4859
http://sourceforge.net/p/oscss/svn/4859
Author: oscim
Date: 2013-10-04 06:03:52 +0000 (Fri, 04 Oct 2013)
Log Message:
-----------
Fix
Modified Paths:
--------------
trunk/catalog/admin/includes/classes/drivers/sqlcategorie.php
Modified: trunk/catalog/admin/includes/classes/drivers/sqlcategorie.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlcategorie.php 2013-10-03 07:37:45 UTC (rev 4858)
+++ trunk/catalog/admin/includes/classes/drivers/sqlcategorie.php 2013-10-04 06:03:52 UTC (rev 4859)
@@ -494,7 +494,7 @@
$cat_image = tep_db_prepare_input($cat_image);
}
- $cat_image =(empty($cat_image) || (/*$no_img=='' &&*/ $no_img=='on') ) ? '' : tep_db_prepare_input($cat_image) ;
+ $cat_image =(empty($cat_image) || ($no_img=='on') ) ? '' : tep_db_prepare_input($cat_image) ;
return $cat_image;
}
@@ -508,11 +508,24 @@
self::UpdateCheckLoop();
self::UpdateCheckLoopByPair();
+
+ self::UpdateCpath();
}
+ /**
+ @fn UpdateCpath()
+ @brief Calculate cpath if no found
+ */
+ private static function UpdateCpath(){
+ $DB=Database::getInstance();
+ $_query = $DB->query($s="SELECT categories_id as id FROM " . TABLE_CATEGORIES . " WHERE categories_cpath ='' AND parent_id <> 0 ");
+ foreach($_query->fetchAllAssoc() as $loop)
+ $DB->query($sql= "UPDATE " . TABLE_CATEGORIES . " SET categories_cpath = '".categorieUtility::get_generated_category_path_ids( (int) $loop['id'] )."' WHERE categories_id = '" . (int)$loop['id'] . "' ");
+ }
+
/**
@fn UpdateCheckLoop()
@brief Check parent_id / rowid and block loop context
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2013-10-03 07:37:49
|
Revision: 4858
http://sourceforge.net/p/oscss/svn/4858
Author: oscim
Date: 2013-10-03 07:37:45 +0000 (Thu, 03 Oct 2013)
Log Message:
-----------
Fix
Modified Paths:
--------------
trunk/catalog/admin/includes/modules/categories/header_tags.php
trunk/catalog/admin/includes/modules/pages/categories.php
trunk/catalog/admin/includes/modules/pages/products.php
trunk/catalog/includes/classes/category_tree.php
trunk/catalog/includes/classes/drivers/data/categorie.php
Modified: trunk/catalog/admin/includes/modules/categories/header_tags.php
===================================================================
--- trunk/catalog/admin/includes/modules/categories/header_tags.php 2013-10-01 11:49:08 UTC (rev 4857)
+++ trunk/catalog/admin/includes/modules/categories/header_tags.php 2013-10-03 07:37:45 UTC (rev 4858)
@@ -189,7 +189,7 @@
elseif(isset(self::$pArray->head_keywords_tag) && is_string(self::$pArray->head_keywords_tag))
$pInfo->head_keywords_tag = array($language_id=> self::$pArray->head_keywords_tag);
- parent::insert_db_values(self::$pInfo->tag_id,$action,$pInfo,$language_id);
+ parent::insert_db_values(self::$pInfo->tag_id,$action,self::$pInfo,$language_id);
}
/**
Modified: trunk/catalog/admin/includes/modules/pages/categories.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/categories.php 2013-10-01 11:49:08 UTC (rev 4857)
+++ trunk/catalog/admin/includes/modules/pages/categories.php 2013-10-03 07:37:45 UTC (rev 4858)
@@ -77,13 +77,13 @@
/**
@remarks not load if not first init
*/
- if(defined('JSONSTATMENT')) return;
+ if(!defined('JSONSTATMENT')){
+ //! active datatable in ajax, precise les GET necessaire
+ define('JSONSTATMENT', 'ModTwo=true&mod=page&type='.self::$code.(isset($_GET['cPath'])?'&cPath='.$_GET['cPath']:''));
+ //! detail item in ajax
+ define('AJAXSTATMENTDETAIL', 'mod=page&type='.self::$code);
+ }
- //! active datatable in ajax, precise les GET necessaire
- define('JSONSTATMENT', 'mod=page&type='.self::$code.(isset($_GET['cPath'])?'&cPath='.$_GET['cPath']:''));
- //! detail item in ajax
- define('AJAXSTATMENTDETAIL', 'mod=page&type='.self::$code);
-
/**
TODO : remplacer le nom de constante par un MODULE_CATEGORIES_INSTALLED_BO
*/
@@ -770,7 +770,6 @@
global $query_numrows, $languages_id;
$adjust=new objectInfo(self::$InitInfo['adjust']);
-
/**
@remarks replace id by name col
*/
@@ -859,8 +858,6 @@
@remarks Ajax popup
*/
-// break;
-
/**
@remarks Normal View Page
*/
@@ -951,76 +948,8 @@
'</a>';
}
-// public static function tep_get_modele(){
-// return array( 0 =>false,
-// 'c.categories_id'=>true,
-// 'categories_image'=>true,
-// 'categories_name'=>true,
-// 'categories_datatype'=>true,
-// 'categories_status'=>true,
-// 'categories_hidden'=>true,
-// 'action'=>false
-// );
-// }
-// private static function emptyResult(){
-// return array( 'null'=>'',
-// 'c.categories_id'=>'',
-// 'categories_name'=>'',
-// 'categories_image'=>'',
-// // 'parent_id',
-// 'categories_datatype',
-// 'categories_status'=>'',
-// 'categories_hidden'=>'',
-// // 'p.categories_status',
-// 'action'=>''
-// );
-// }
-
public static function tep_get_list($page=1,$rowbyp=10,$sOrder='',$sWhere='',$options=''){
- global $languages_id,$query_numrows;
-
-// self::$cPath=$cID=(isset($_GET['cPath'])? (int)$_GET['cPath'] : 0);
-//
-// $DB=Database::getInstance();
-//
-// $categories_query = "SELECT DISTINCT c.categories_id, cd.categories_name, c.categories_image, c.parent_id, c.sort_order,categories_datatype, c.date_added, c.last_modified,c.categories_status,c.categories_hidden, cd.categories_description, cd.categories_head_keywords_tag ".
-// " FROM " . TABLE_CATEGORIES . " c ".
-// " JOIN " . TABLE_CATEGORIES_DESCRIPTION . " cd ON (cd.categories_id = c.categories_id AND cd.language_id = '" . (int)$languages_id . "') ".
-// "WHERE c.parent_id = '" . (int)$cID . "' ".$sWhere.
-// " ORDER BY ".(
-// (!empty($sOrder))
-// ? $sOrder
-// : (($cID !=0)?" c.parent_id ASC , ": "" ) . " c.sort_order ASC, cd.categories_name ASC").
-// "";
-//
-// $categories_split = new splitPageResults($page, $rowbyp, $categories_query,$query_numrows);
-//
-// $pq=$DB->query($categories_query);
-//
-// foreach($pq->fetchAllAssoc() as $categories){
-//
-// $categories['c.categories_id']=$categories['categories_id'];
-// $categories['categories_image']=(!empty($categories['categories_image'])) ? tep_info_image($categories['categories_image'], $categories['categories_name'], TEMP_BO_SMALL_IMAGE_WIDTH, TEMP_BO_SMALL_IMAGE_HEIGHT) : ' N/A';
-// $categories['categories_status']=self::get_status_categories($categories);
-// $categories['categories_hidden']=self::get_status_menu($categories);
-// $categories['cPath']=categorieUtility::get_generated_category_path_ids( $categories['categories_id']);
-// self::$list[]=$categories;
-// }
-//
-//
-// $li=$res=array();
-// foreach(self::$list as $item){
-// foreach(self::tep_get_modele() as $k=>$v) $li[$k]=(isset($item[$k]) && !empty($item[$k]))? $item[$k] : ' ';
-// $li[0]=$item['categories_id'];
-// $li['action']=self::get_item_action($item);
-// $res[]=$li;
-// }
-//
-//
-// if(count($res)==0) $res[]= self::emptyResult();
-// return $res;
-
global $query_numrows;
/// @remarks force load conf
Modified: trunk/catalog/admin/includes/modules/pages/products.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/products.php 2013-10-01 11:49:08 UTC (rev 4857)
+++ trunk/catalog/admin/includes/modules/pages/products.php 2013-10-03 07:37:45 UTC (rev 4858)
@@ -54,14 +54,6 @@
*/
public static $track_stock;
/**
- @var bool $in_status
- */
- public static $in_status;
- /**
- @var bool $in_status
- */
- public static $out_status;
- /**
@var array $product_investigation cf Qtpro
*/
public static $product_investigation;
@@ -85,15 +77,9 @@
@var int type product
*/
public static $Vtype;
+
+
/**
- @var array info all tabs for filter listings
- */
-// public static $allfields = array();
- /**
- @var array info all tabs for filter listings , specifical owner sub module
- */
-// protected static $allfieldsexternal = array();
- /**
@brief constructor
*/
public function __construct(){
@@ -205,20 +191,7 @@
'alias'=>'image',
'text'=>__('products table heading image'),
),
-// 'pd.products_name' => array(
-// 'sort'=>true,
-// 'alias'=>'name',
-// 'text'=>__('products table heading name'),
-// 'default'=>true,
-// 'width'=>'18%',
-// 'edit'=>array(
-// 'input_name'=>'products_name',
-// 'input_type'=>'input',
-// 'input_size'=>'64',
-// 'required_status'=>true,
-// 'active_value_language'=>true,
-// ),
-// ),
+
'p.products_model' => array(
'sort'=>true,
'alias'=>'model',
@@ -630,7 +603,7 @@
// if( count( tep_get_status_array(__CLASS__) ) > 1)
$tab['generic'][] ='subtype' ;
- if($conf->extends->CUSTOMERS_GROUPS->enabled)
+ if(isset($conf->extends->CUSTOMERS_GROUPS) && $conf->extends->CUSTOMERS_GROUPS->enabled)
$tab['mod'][]=array(
'title'=>__('@products filter tab customers_groups'),
'content'=>tep_get_include_contents('customers_groups/filter.customers_groups'),
@@ -692,13 +665,6 @@
-
-// print_r( $_SESSION['filters'][__CLASS__]);
-//
-// exit;
-
-
-
if(isset($_SESSION['filters'][__CLASS__]['bystock']))
$_SESSION['filters']['bystock'] = (int)$_SESSION['filters'][__CLASS__]['bystock'];
else
@@ -709,7 +675,7 @@
else
$_SESSION['filters']['byattribute'] = array();
-// var_dump($_SESSION['filters']['bystock']);
+
/**
@remarks filter based on manufacturers
*/
@@ -787,8 +753,6 @@
*/
self::ConvertInitVar( $listfield, $mutli, $tab, $boutons);
-// var_dump($_SESSION['filters']['bystock']);
-// exit;
}
@@ -934,19 +898,19 @@
/* self::$Info =*/ $obj=$obj1->list;
// $array[] = self::DisplayField($_REQUEST['key'], '%s');
- $edit = ((substr($key,0,5) !='edit_' ) ? 'edit_'.$key : $key);
- $tmp = $obj->$edit;
+ $edit = ((substr($key,0,5) !='edit_' ) ? 'edit_'.$key : $key);
+ $tmp = $obj->$edit;
- if(isset($tmp->select_values)) {
- foreach($tmp->select_values as $row)
- $array[$row['id']] = $row['text'];
+ if(isset($tmp->select_values)) {
+ foreach($tmp->select_values as $row)
+ $array[$row['id']] = $row['text'];
- echo json_encode($array);
- }
- else{
- $array[] = $tmp->input_value;
- echo json_encode($array);
- }
+ echo json_encode($array);
+ }
+ else{
+ $array[] = $tmp->input_value;
+ echo json_encode($array);
+ }
// return FieldsDisplay::DisplayRow(/*$obj->$edit*/, (( self::$action!='noedit')? false : true ), $format) ;
// /*if( (*/$col=call_user_func(array(tep_extrac_querystring(JSONSTATMENT,'type'), 'tep_get_modele') ));// && is_array($col)
/* $col2=call_user_func(array(tep_extrac_querystring(JSONSTATMENT,'type'), 'tep_get_modele'), array('modele2') );*/ /*print_r($col); */
@@ -1023,6 +987,9 @@
}
break;
case 'delete':
+ foreach($all_pid as $pid){
+ sqlproduct::delete(array('id'=>$pid));
+ }
break;
}
osCSS_Cache::clear('product');
@@ -1278,10 +1245,8 @@
else
$res=sqlproduct::Specimen(true);
+ $res=self::FormatDBValue($res);
- $res= /*new objectInfo(*/self::FormatDBValue($res) /*)*/;
-// self::$Info= new objectInfo($res);
-
//! descative gestion de stock, si stock composé avec attributes
$attributes_stock_query = $DB->query("SELECT products_stock_quantity FROM " . TABLE_PRODUCTS_STOCK . " WHERE products_id = '" . (int)self::$Id . "'");
if($attributes_stock_query->__get('numRows')>0 && !defined('CLASS_STOCK')) define('CLASS_STOCK',true);
@@ -1555,24 +1520,9 @@
$res = self::GetDBValue();
- self::$list= $query_numrows ; //= count($res);
+ self::$list= $query_numrows ;
return $res;
-
-
-
- global $languages_id,$query_numrows;
- new self();
- if(self::$cPath>0) self::$DiversInfo['current_category_id']=self::$cPath;
- else self::$DiversInfo['current_category_id']=(isset($options['current_category_id'])?$options['current_category_id'] :'');
-
- $sta=(!empty(self::$Vtype)? " AND p.products_type ='".(int)self::$Vtype."' " : '' );
-
- $DB=Database::getInstance();
- $listing_products=array();
- $add_tbl='';
- $cat= (tep_not_null(self::$DiversInfo['current_category_id']))?" and p2c.categories_id = '" . (int)self::$DiversInfo['current_category_id'] . "' " : "" ;
- $avenir=(isset($_GET['expected']) && tep_not_null($_GET['expected'])) ? " and p.products_date_available IS NOT NULL " : " and p.products_date_available IS NULL ";
}
@@ -1679,8 +1629,12 @@
$action =( ($force_action !=false) ? $force_action : self::$action);
switch ($action) {
- case 'new':
- case 'edit';
+ case 'detail':
+ case 'new':
+ case 'delete':
+ case 'noedit':
+ case 'edit':
+ case 'copy_to':
global $languages_id;
$ord =array();
Modified: trunk/catalog/includes/classes/category_tree.php
===================================================================
--- trunk/catalog/includes/classes/category_tree.php 2013-10-01 11:49:08 UTC (rev 4857)
+++ trunk/catalog/includes/classes/category_tree.php 2013-10-03 07:37:45 UTC (rev 4858)
@@ -3,8 +3,8 @@
*\licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
*\portion code Copyright (c) 2002 osCommerce
*\package osCSS-2 <www http://www.oscss.org>
- *\version 2.1.1
- *\date 16/06/2013, 08:18
+ *\version 2.1.2
+ *\date 02/10/2013, 08:18
*\author oscim <mail aur...@os...> <www http://www.oscim.fr>
*\encode UTF-8
*\group boxes
@@ -19,33 +19,31 @@
*/
class category_tree {
- public $root_category_id = 0,
- $max_level = 0,
- $data = array(),
+ public $root_category_id = 0,
+ $max_level = 0,
+ $data = array(),
- $root_start_string = '',
- $root_end_string = '',
+ $root_start_string = '',
+ $root_end_string = '',
- $parent_group_start_string = '',
- $parent_group_end_string = '',
+ $parent_group_start_string = '',
+ $parent_group_end_string = '',
- $parent_start_string = '',
- $parent_end_string = '',
+ $parent_start_string = '',
+ $parent_end_string = '',
- $child_start_string = '',
- $child_end_string = '',
+ $child_start_string = '',
+ $child_end_string = '',
- $breadcrumb_separator = '_',
- $breadcrumb_usage = true,
- $spacer_string = '',
- $spacer_multiplier = 1,
- $follow_cpath = false,
- $cpath_array = array(),
- $cpath_start_string = '',
- $cpath_end_string = '',
- $show_category_product_count = false,
- $category_product_count_start_string = ' (',
- $category_product_count_end_string = ')';
+ $breadcrumb_separator = '_',
+
+ $spacer_string = '',
+ $spacer_multiplier = 1,
+ $follow_cpath = false,
+ $cpath_array = array(),
+ $cpath_start_string = '',
+ $cpath_end_string = '';
+
/**
@var name datatype for current list categorie or default datatype
*/
@@ -59,7 +57,6 @@
$this->SetDatatype($datatype);
-// if (_cst_bool('SHOW_COUNTS')) $this->show_category_product_count = true;
if ($osCSS_Cache->read('categorie-tree-' . $language.'-type-'.$this->datatype, 720)) {
$this->data = $osCSS_Cache->getCache();
@@ -74,10 +71,14 @@
$list = categorie::get_query('','','',array('limit'=>0));
foreach($list as $categories)
- if( (bool)$categories->status) $this->data[$categories->parent_id][$categories->categories_id] = array('href' => $categories->href, 'name' => $categories->categories_name, 'count' => 0);
+ if( (bool)$categories->status)
-// if ($this->show_category_product_count === true) $this->calculateCategoryProductCount();
+ $this->data[$categories->parent_id][$categories->categories_id] = array(
+ 'href' => $categories->href,
+ 'name' => $categories->categories_name,
+ 'childs' => $categories->childs
+ );
$osCSS_Cache->writeBuffer($this->data);
}
@@ -125,9 +126,6 @@
} else
$result .= (!_cst_bool('NOT_RECUP_CASSE_IN_TXT_CATEGORIES'))? strtolower($category['name']) : $category['name'];
-// if ($this->show_category_product_count === true)
-// $result .= $this->category_product_count_start_string . $category['count'] . $this->category_product_count_end_string;
-
$result .= '</a>';
@@ -148,7 +146,7 @@
$nbr++;
}
}
-/* if ($nbr != 0)*/ $result .= $this->parent_group_end_string;
+ $result .= $this->parent_group_end_string;
return $result;
}
@@ -168,11 +166,17 @@
if (isset($this->data[$parent_id])) {
foreach ($this->data[$parent_id] as $category_id => $category) {
- if ($this->breadcrumb_usage == true) $category_link = $this->buildBreadcrumb($category_id);
- else $category_link = $category_id;
- $result[] = array('id' => $category_link, 'title' => str_repeat($this->spacer_string, $this->spacer_multiplier * $level) . $category['name']);
+ $category_link = $category_id;
+ $result[] = array(
+ 'id' => $category_link,
+ 'href' => $category['href'],
+ 'title' => str_repeat($this->spacer_string, $this->spacer_multiplier * $level) . $category['name'],
+ 'level'=> $level,
+ 'childs'=> $category['childs'],
+ );
+
if (isset($this->data[$category_id]) && (($this->max_level == '0') || ($this->max_level > $level+1))) {
if ($this->follow_cpath === true) {
if (in_array($category_id, $this->cpath_array)) $result = $this->buildBranchArray($category_id, $level+1, $result);
@@ -231,29 +235,6 @@
return $this->buildBranchArray((empty($parent_id) ? $this->root_category_id : $parent_id));
}
-// function calculateCategoryProductCount() {
-// foreach ($this->data as $parent => $categories) {
-// foreach ($categories as $id => $info) {
-// $this->data[$parent][$id]['count'] = 1; // categorie::get_count_products_in_category($id);
-// $cp=0;
-// $parent_category = $parent;
-// while ($parent_category != $this->root_category_id) {
-// foreach ($this->data as $parent_parent => $parent_categories) {
-// foreach ($parent_categories as $parent_category_id => $parent_category_info) {
-// if ($parent_category_id == $parent_category) {
-// $this->data[$parent_parent][$parent_category_id]['count'] += $this->data[$parent][$id]['count'];
-//
-// $parent_category = $parent_parent;
-// break 2;
-// }
-// if($cp>100)break;
-// $cp++;
-// }
-// }
-// }
-// }
-// }
-// }
/**
* \fn SetDatatype($datatype)
@@ -339,10 +320,10 @@
* \fn setBreadcrumbUsage($breadcrumb_usage)
* @param $breadcrumb_usage
*/
- public function setBreadcrumbUsage($breadcrumb_usage) {
- if ($breadcrumb_usage === true) $this->breadcrumb_usage = true;
- else $this->breadcrumb_usage = false;
- }
+// public function setBreadcrumbUsage($breadcrumb_usage) {
+// if ($breadcrumb_usage === true) $this->breadcrumb_usage = true;
+// else $this->breadcrumb_usage = false;
+// }
/**
*/
@@ -374,19 +355,9 @@
$this->cpath_end_string = $cpath_end_string;
}
- /**
- */
- public function setShowCategoryProductCount($show_category_product_count) {
- $this->show_category_product_count = ($show_category_product_count === true)? true : false ;
- }
- /**
- encapusalation du nombre d'element enfants
- */
- public function setCategoryProductCountString($category_product_count_start_string, $category_product_count_end_string) {
- $this->category_product_count_start_string = $category_product_count_start_string;
- $this->category_product_count_end_string = $category_product_count_end_string;
- }
+
+
}
/**
Modified: trunk/catalog/includes/classes/drivers/data/categorie.php
===================================================================
--- trunk/catalog/includes/classes/drivers/data/categorie.php 2013-10-01 11:49:08 UTC (rev 4857)
+++ trunk/catalog/includes/classes/drivers/data/categorie.php 2013-10-03 07:37:45 UTC (rev 4858)
@@ -125,6 +125,8 @@
$res['title']=$content['categories_name'];
$res['name']=$content['categories_name'];
$res['status']=self::countChidlsAll($content['categories_id'], $content['categories_datatype'], $content['categories_status']);
+ $res['childs']=self::get_has_category_subcategories($content['categories_id']);
+
$res=categorie::get_option_data($res);
self::$object_data[$content['categories_id']]=$tabl[$content['categories_id']]=new objectInfo($res);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2013-10-01 11:49:15
|
Revision: 4857
http://sourceforge.net/p/oscss/svn/4857
Author: oscim
Date: 2013-10-01 11:49:08 +0000 (Tue, 01 Oct 2013)
Log Message:
-----------
fix
Modified Paths:
--------------
trunk/catalog/common/classes/AbstractHeader_tags.php
Modified: trunk/catalog/common/classes/AbstractHeader_tags.php
===================================================================
--- trunk/catalog/common/classes/AbstractHeader_tags.php 2013-10-01 08:38:54 UTC (rev 4856)
+++ trunk/catalog/common/classes/AbstractHeader_tags.php 2013-10-01 11:49:08 UTC (rev 4857)
@@ -230,9 +230,9 @@
$myarray['head_keywords_tag'] = $pInfo->head_keywords_tag[$language_id];
- if($action=='update')
- tep_db_perform(TABLE_FULL_TAG_DESCRIPTION, $myarray, 'update', " tag_id='".(int)$tag_id."' and language_id='".$language_id."' " );
- else{
+ if( count($myarray)>0 /*&& $this->load_db_descr_check($tag_id, $language_id)*/ && $action =='update')
+ tep_db_perform(TABLE_FULL_TAG_DESCRIPTION, $myarray, 'update', " tag_id='".(int)$tag_id."' and language_id='".$language_id."' " );
+ elseif( count($myarray)>0 ){
$myarray['tag_id']=(int)$tag_id;
$myarray['language_id']=$language_id;
tep_db_perform(TABLE_FULL_TAG_DESCRIPTION, $myarray);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2013-10-01 08:38:57
|
Revision: 4856
http://sourceforge.net/p/oscss/svn/4856
Author: oscim
Date: 2013-10-01 08:38:54 +0000 (Tue, 01 Oct 2013)
Log Message:
-----------
Clean
Modified Paths:
--------------
trunk/catalog/includes/application_top.php
Modified: trunk/catalog/includes/application_top.php
===================================================================
--- trunk/catalog/includes/application_top.php 2013-10-01 07:51:11 UTC (rev 4855)
+++ trunk/catalog/includes/application_top.php 2013-10-01 08:38:54 UTC (rev 4856)
@@ -20,7 +20,6 @@
/// start the timer for the page parse time log
define('PAGE_PARSE_START_TIME', microtime());
-// define('MODULE_ORDER_TOTAL_DISCOUNT_COUPON_DEBUG', true);
/// Set the local configuration parameters - mainly for developers
if (file_exists('includes/local/configure.php')) include('includes/local/configure.php');
@@ -380,7 +379,6 @@
$account=$page->new_class('customer',$customer_id);
}
else $account=$page->new_class('customer','');
-// $account=$page->_call('customer','the_customer');
/// include the who's online functions
@@ -393,9 +391,7 @@
}
}
-/* MARK FOR CIP -- DOES NOT TOUCH */
-
/// calculate category path
if (isset($_GET['cPath'])) $cPath = $_GET['cPath'];
elseif ( ($dyntype = DataTypes::is_type('cpath')) && $dyntype != false )
@@ -425,8 +421,4 @@
$messageStack = $page->new_class('messageStack');
/// set the template
$template = $page->ret_template();
-
-// $breadcrumb=$page->ret_o
-
-
?>
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2013-10-01 07:51:14
|
Revision: 4855
http://sourceforge.net/p/oscss/svn/4855
Author: oscim
Date: 2013-10-01 07:51:11 +0000 (Tue, 01 Oct 2013)
Log Message:
-----------
Add file next gen for manipulate datatype content in configuration page and menu
Modified Paths:
--------------
trunk/catalog/admin/includes/languages/fr_FR/boxes/01_configuration.php
trunk/catalog/install/includes/sql/mysql/data/91_osc_configuration_group.sql
trunk/catalog/install/includes/sql/mysql/upgrade/2.1.0_2.1.1/data/91_osc_configuration_group.sql
Added Paths:
-----------
trunk/catalog/admin/includes/gabarit/configuration/datatypecontent.listing.gab
trunk/catalog/admin/includes/languages/fr_FR/modules/configuration/datatypecontent.txt
trunk/catalog/admin/includes/modules/configuration/datatypecontent.php
trunk/catalog/install/includes/sql/mysql/upgrade/2.1.1rc_2.1.2/data/
Added: trunk/catalog/admin/includes/gabarit/configuration/datatypecontent.listing.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/configuration/datatypecontent.listing.gab (rev 0)
+++ trunk/catalog/admin/includes/gabarit/configuration/datatypecontent.listing.gab 2013-10-01 07:51:11 UTC (rev 4855)
@@ -0,0 +1,149 @@
+<?php
+/**
+ @licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
+ @portion code Copyright (c) 2002 osCommerce
+ @package osCSS-2 <www http://www.oscss.org>
+ @version 2.1.2
+ @date 01/10/2013, 20:05
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+ @brief mise en forme de la gestion du stock
+*/
+?>
+
+<div id="ssmenu">
+ <?php echo tep_ssmenu_configuration($_GET['gparentID']) ?>
+</div>
+
+
+
+<h3 class="main-title"><?php echo __('heading datatypecontent configuration') ?></h3>
+
+
+
+
+<!-- <div class="block_form"> -->
+
+
+ <div id="tabs">
+ <ul>
+ <li><a href="#tabs-1"><?php echo __('datatypecontent tab configuration'); ?></a></li>
+ <li><a href="#tabs-2"><?php echo __('datatypecontent tab module'); ?></a></li>
+ </ul>
+
+
+ <div id="tabs-1" class="tabPage">
+<div class="edit">
+ <div class="tabs">
+ <ul>
+ <li><a href="#subtabs-1"><?php echo __('datatypecontent tab configuration'); ?></a></li>
+ </ul>
+
+ <div id="subtabs-1" class="tabPage">
+ <h4 class="main-title"><?php echo __('heading datatypecontent manage type products') ?></h4>
+
+ <?php echo tep_draw_form('configuration', FILENAME_CONFIGURATION, 'gparentID=' . $_GET['gparentID'].'&gID=' . $_GET['gID'] . '&action=save_mutli') ?>
+
+
+ <fieldset class="block_field">
+ <legend><?php echo __('datatypecontent legend manage type') ?></legend>
+ <div class="block_input">
+
+ <p class="main-intro"><?php echo __('datatypecontent type txt intro') ?></p>
+ <table>
+ <thead>
+ <tr>
+ <th><?php echo __('datatypecontent tableheading id') ?></th>
+ <th><?php echo __('datatypecontent tableheading active') ?></th>
+ <th><?php echo __('datatypecontent tableheading name') ?></th>
+ </tr>
+ </thead>
+ <tbody>
+ <?php foreach(datatypecontent::$list->types as $row): ?>
+ <tr>
+ <td><?php echo $row->id; ?></td>
+ <td class="tcenter"><?php echo tep_draw_checkbox_field('types[active]['.$row->id.']', 'active_'.$row->id , $row->status, (bool)$row->status); ?></td>
+ <td><?php echo $row->name /*tep_draw_input_field('types[name]['.$row->id.']', 'name_'.$row->id, $row->name)*/; ?></td>
+ </tr>
+ <?php endforeach; ?>
+ </tbody>
+ </table>
+
+
+ </div>
+ </fieldset>
+
+ <div class="button_nav">
+ <?php print tep_image_submit('button_copy.gif', IMAGE_UPDATE) .tep_js_back(tep_href_link(FILENAME_CONFIGURATION, 'gparentID=' . $_GET['gparentID'].'&gID=' . $_GET['gID'] )) ; ?>
+ </div>
+</form>
+ </div>
+
+
+ </div>
+<br class="clear" />
+</div>
+ </div>
+
+
+ <div id="tabs-2" class="tabPage">
+
+ <div id="datatypecontent-module" class="block_form">
+ <h4 class="main-title"><?php echo __('datatypecontent heading modules'); ?></h4>
+
+
+ <table class="dataTable">
+ <thead>
+ <tr>
+ <th><?php echo __('table heading module code'); ?></th>
+ <th><?php echo __('table heading module title'); ?></th>
+ <th><?php echo __('table heading module desc'); ?></th>
+ <th><?php echo __('table heading module sort'); ?></th>
+ <th><?php echo __('table heading module status'); ?></th>
+ <th><?php echo __('table heading action'); ?></th>
+ </tr>
+ </thead>
+ <tbody>
+ <?php foreach(datatypecontent::$module as $row): /*print_r($row)*/ ?>
+ <tr>
+ <td><?php echo $row->content->code; ?></td>
+ <td><?php echo $row->content->title; ?></td>
+ <td><?php echo $row->content->description; ?></td>
+ <td class="tcenter"><?php echo $row->content->sort_order; ?></td>
+ <td class="tcenter">
+ <?php echo datatypecontent::GetStatusMod($row); ?>
+ </td>
+ <td class="tright">
+ <?php echo datatypecontent::get_item_action($row); ?>
+ </td>
+ </tr>
+ <?php endforeach; ?>
+ </tbody>
+ </table>
+
+
+
+
+
+ <?php if(isset(datatypecontent::$moduleEdit)): ?>
+
+ <?php echo tep_draw_form('configuration', FILENAME_CONFIGURATION, FILENAME_CFG_36.'gID=' . $_GET['gID'] . '&mod='.$_GET['mod'].'&action=modules-save') ?>
+ <fieldset class="block_field">
+ <legend><?php echo __('datatypecontent heading Configuration du modules') ?></legend>
+ <?php echo datatypecontent::$moduleEdit; ?>
+
+ <div class="button_nav">
+ <?php print tep_image_submit('button_copy.gif', IMAGE_UPDATE) .tep_js_back(tep_href_link(FILENAME_CONFIGURATION, FILENAME_CFG_36.'gID=' . $_GET['gID'] )) ; ?>
+ </div>
+ </fieldset>
+ </form>
+
+ <?php endif; ?>
+
+
+ </div>
+
+ </div>
+ <div id="tabs-3" class="tabPage">
+ </div>
+ </div>
Modified: trunk/catalog/admin/includes/languages/fr_FR/boxes/01_configuration.php
===================================================================
--- trunk/catalog/admin/includes/languages/fr_FR/boxes/01_configuration.php 2013-10-01 07:17:32 UTC (rev 4854)
+++ trunk/catalog/admin/includes/languages/fr_FR/boxes/01_configuration.php 2013-10-01 07:51:11 UTC (rev 4855)
@@ -3,29 +3,13 @@
@licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
@portion code Copyright (c) 2002 osCommerce
@package osCSS-2 <www http://www.oscss.org>
- @version 2.1.1
- @date 02/03/2012, 17:06
+ @version 2.1.2
+ @date 01/10/2013, 17:06
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
*/
-
-// define('BOX_HEADING_LOCALIZATION',"Localisation" );
-// define('BOX_HEADING_CONF_BOX_SITEMONITOR_SETUP',"Sitemonitor" );
-// define('BOX_HEADING_CONF_BOX_SITEMONITOR',"Sitemonitor" );
-// define('BOX_HEADING_CONF_ATTRIBUTE_PRODUCT',"Options de produits" );
-// define('BOX_CONFIGURATION_MYSTORE',"Mon magasin" );
-// define('BOX_HEADING_CONF_DETAIL_CLIENTS',"Détails clients" );
-// define('BOX_HEADING_CONF_OPTION_MODULES',"Option des Modules" );
-// define('BOX_HEADING_CONF_OPTION_MODULES_PAY',"Vue modes paiements" );
-// define('BOX_HEADING_CONF_OPTION_MODULES_SHIP',"Vue modes livraisons " );
-// define('BOX_HEADING_CONF_OPTION_MODULES_TOT',"Vue modes paiements total" );
-// define('BOX_HEADING_CONF_CONFIGURATION COMMERCIALE',"Configuration catalogue" );
-// define('BOX_HEADING_CONF_BOX_CONFIGURATION_ABONNEMENT',"Option des Abonnements" );
-// define('BOX_HEADING_CONF_PARAMETERS',"Paramètres" );
-// define('BOX_HEADING_LOCATION_AND_TAXES', 'Lieux / Taxes');
-
define('BOX_ZONE_AND_TAXE', 'Taxe / Zone');
define('BOX_TAXES_COUNTRIES',"Régions et Pays" );
define('BOX_TAXES_GEO_ZONES',"Zones fiscales/livraisons" );
@@ -76,6 +60,8 @@
define('BOX_HEADING_CONF_CONFIGURATION_ORDERS',"Configuration commandes" );
define('BOX_HEADING_CONF_EXPEDITION_EMBALLAGE',"Expédition/Emballage" );
define('BOX_HEADING_CONF_PAYMENT',"Gestion des paiments" );
+ define('BOX_HEADING_CONF_OPTION_CONTENT',"Option des Pages Cms" );
+ define('BOX_HEADING_CONF_CONFIG_CONTENT',"Configuration" );
define('BOX_HEADING_CONF_VIEW_SYSINFO',"info. systeme" );
Added: trunk/catalog/admin/includes/languages/fr_FR/modules/configuration/datatypecontent.txt
===================================================================
--- trunk/catalog/admin/includes/languages/fr_FR/modules/configuration/datatypecontent.txt (rev 0)
+++ trunk/catalog/admin/includes/languages/fr_FR/modules/configuration/datatypecontent.txt 2013-10-01 07:51:11 UTC (rev 4855)
@@ -0,0 +1,45 @@
+<?php
+/**
+ @licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
+ @portion code Copyright (c) 2002 osCommerce
+ @package osCSS-2 <www http://www.oscss.org>
+ @version 2.1.2
+ @date 01/10/20103, 11:18
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+*/
+
+$lang['heading datatypecontent configuration']="Configuration des pages de contenu cms" ;
+
+
+ $lang['datatypecontent tab configuration']="Configuration" ;
+ $lang['datatypecontent tab module']="Modules" ;
+
+/* tab configuration */
+ $lang['heading datatypecontent manage type products']="Gestion des types de contenu cms" ;
+ $lang['datatypecontent legend manage type']="Types de contenu" ;
+ $lang['datatypecontent type txt intro']="Les types de contenu modifie le fonctionnement des contenu, et permettent de construire des extensions ciblées avec des caractéristiques particulières. L'ensemble des ces modifications peuvent impacter profondement le fonctionnement de vos page contenu. \n Ne manipuler ces options que si vous savez ce que vous faites !!! \n\n Pour manipuler les types de contenu disponible, utiliser la section 'Gestion status' " ;
+
+ $lang['datatypecontent tableheading id']="Id" ;
+ $lang['datatypecontent tableheading active']="Actif" ;
+ $lang['datatypecontent tableheading name']="Nom" ;
+ $lang['datatypecontent tableheading section edit active']="Section inactive" ;
+
+
+/* tab modules */
+ $lang['datatypecontent heading modules']="Activer / desactiver l'ensemble des modules specifique aux contenu" ;
+
+ $lang['table heading module code']="Nom" ;
+ $lang['table heading module title']="Description" ;
+ $lang['table heading module desc']="crée/modifié" ;
+ $lang['table heading module sort']="Ordre" ;
+ $lang['table heading module status']="Etat" ;
+ $lang['table heading action']="Action" ;
+
+
+ /* Edit */
+ $lang['datatypecontent heading Configuration du modules']="Options de ce module" ;
+
+
+
+?>
\ No newline at end of file
Added: trunk/catalog/admin/includes/modules/configuration/datatypecontent.php
===================================================================
--- trunk/catalog/admin/includes/modules/configuration/datatypecontent.php (rev 0)
+++ trunk/catalog/admin/includes/modules/configuration/datatypecontent.php 2013-10-01 07:51:11 UTC (rev 4855)
@@ -0,0 +1,404 @@
+<?php
+/**
+ @licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
+ @portion code Copyright (c) 2002 osCommerce
+ @package osCSS-2 <www http://www.oscss.org>
+ @version 2.1.2
+ @date 01/10/2013, 19:49
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+ @class datatypecontent
+*/
+
+define('FILENAME_CFG_43',"gparentID=43&gID=44&");
+
+
+Class datatypecontent
+ implements ext_configuration
+ {
+
+ /**
+ @var object all config
+ */
+ public static $list;
+ /**
+ @var int Current Get gID
+ */
+ public static $gID;
+ /**
+ @var
+ */
+ public static $cfg;
+ /**
+ @var
+ */
+ public static $module;
+
+ /**
+ @var
+ */
+ public static $moduleEdit;
+
+ /**
+ @fn __construct()
+ @brief constructor
+ */
+ function __construct(){
+ global $oscss;
+ $this->code=__CLASS__;
+ global $messageStack, $language,$lang;
+
+ $oscss->pile_file_lang(DIR_FS_ADMIN.DIR_WS_LANGUAGES.$language.'/modules/configuration/'.$this->code.'.txt');
+
+// self::$cfg =new sqlconfiguration();
+ self::$gID = (int)$_GET['gID'];
+ }
+
+
+ /**
+ @fn draw_action()
+ @brief Action Prise en charge par le modules
+ */
+ public function draw_action(){
+ global $action,$messageStack;
+
+ $DB=Database::getInstance();
+ $gparentID = tep_db_prepare_input($_GET['gparentID']);
+ $gID= tep_db_prepare_input($_GET['gID']);
+
+ switch($action){
+ /**
+ @brief save page groupe
+ */
+ case 'save_mutli':
+
+ /// option de configuration classique
+ if(tep_not_null($gID) ){
+
+ $list=sqlconfiguration::fetch(array('group_id'=> (int)$gID), true);
+ if(is_object($list))
+ $list = array($list);
+
+ foreach($list as $row) {
+
+ if(isset($_POST['configuration'][$row->key])) {
+ $configuration_value = tep_db_prepare_input($_POST['configuration'][$row->key]);
+
+ if( ($res=sqlconfiguration::update(array('key'=>$row->key , 'value'=>tep_db_input($configuration_value) ))) == false)$erreur[]=false;
+ else $erreur[]=true;
+
+ }
+
+ }
+
+
+
+ if(!in_array(false,$erreur)) $messageStack->add_session(SAVE_CONFIG_OK, 'success');
+ else $messageStack->add_session(SAVE_CONFIG_NOT_OK, 'error');
+
+ }
+
+
+
+
+
+ /// configuration transversale
+ // prise en charge de la gestion des type de produits
+
+ // mise a jour
+ if(isset($_POST['types']) && is_array($_POST['types']) ){
+ $new_flag_virtual = '';
+ $status = sqlstatus::fetch(array('type'=>'content'), true);
+
+ foreach($status as $key=>$rows ) {
+
+ $data_array = array(
+ 'type'=>'content',
+ 'id'=>$rows->id,
+ 'status'=>(isset($_POST['types']['active'][$rows->id])? 1 : 0 ),
+ );
+
+ sqlstatus::update($data_array);
+
+
+// if( isset($_POST['types']['virtual'][$rows->id]) && (int)$_POST['types']['virtual'][$rows->id] == 2 )
+// $new_flag_virtual .= $rows->id.',';
+//
+// // Ajustement configuration CFG_CLASS_VIRTUAL_TYPE_xx
+// sqlconfiguration::update(array(
+// 'key'=>'CFG_CLASS_VIRTUAL_TYPE_'.$rows->id,
+// 'value'=>tep_db_prepare_input($_POST['types']['conf'][$rows->id]),
+// ));
+ }
+
+ // Ajustement configuration TYPE_VIRTUAL_PRODUCTS
+// sqlconfiguration::update(array(
+// 'key'=>'TYPE_VIRTUAL_PRODUCTS',
+// 'value'=>$new_flag_virtual
+// ));
+
+ }
+
+ // ajout d'un type de produits
+// if(isset($_POST['name_0']) && tep_not_null($_POST['name_0']) ){
+// $sql_data = array(
+// 'type'=>'content',
+// 'name'=>(string)tep_db_prepare_input($_POST['name_0']),
+// 'status'=>0,
+// );
+//
+// sqlstatus::create($sql_data);
+
+ // Ajustement configuration TYPE_VIRTUAL_PRODUCTS
+
+// }
+
+ tep_redirect(tep_href_link(FILENAME_CONFIGURATION, 'gparentID=' . $gparentID.'&gID=' . $_GET['gID'] . '&cID=' . $cID));
+ break;
+
+ /**
+ @brief Manage modules
+ */
+ case 'modules':
+
+
+ if(isset($_GET['flag'])){
+
+ $mod=tep_db_prepare_input($_GET['mod']);
+ $flag=(int)tep_db_prepare_input($_GET['flag']);
+
+ // call type module
+ $typeOri=modulesUtility::GetModttype('content');
+
+ // get current value
+ $current = sqlconfiguration::fetch(array('key'=>$typeOri->key), true);
+ $current_bo = sqlconfiguration::fetch(array('key'=>$typeOri->key_BO), true);
+
+
+ // call
+ $type=modulesUtility::LoadModule('content',$mod.'.php');
+ // force install
+ if( $flag ==1 && !$type->content->check()){
+ $type->content->remove();
+ $type->content->install();
+ }
+ // force remove
+ elseif( $flag == 0 && $type->content->check())
+ $type->content->remove();
+
+ // up module
+ $r=explode(';',$typeOri->value);
+ $result[]=( ($flag ==1 ) ? $mod.'.php;' : '' );
+
+ foreach($r as $v)
+ if(trim($v) !='')
+ if( (
+ $flag ==1
+ || ($flag == 0 && $v != trim($mod).'.php' )
+ )
+ && !in_array($v,$result)
+ ){
+ $result[]=$v;
+ }
+
+ sqlconfiguration::update(array('id'=>$current->id, 'value'=>implode(';',$result)) );
+
+ if($current_bo !=false)
+ sqlconfiguration::update(array('id'=>$current_bo->id, 'value'=>implode(';',$result)) );
+
+ if(!isset($_GET['forceajax']))
+ tep_redirect(tep_href_link(FILENAME_CONFIGURATION, 'gparentID=' . $gparentID.'&gID=' . $_GET['gID'] . '#modorder-module' ));
+ }
+
+ break;
+ case 'modules-edit':
+
+ $mod=tep_db_prepare_input($_GET['mod']);
+ // call
+ $Mod=modulesUtility::LoadModule('content',$mod.'.php');
+ $ModCurr = $Mod->content;
+ $i=0;
+ foreach($ModCurr->keys() as $value){
+ $i++;
+ $current = sqlconfiguration::fetch(array('key'=>$value));
+
+ $keys_extra[$value]['title'] = $current['configuration_title'];
+ $keys_extra[$value]['value'] = $current['configuration_value'];
+ $keys_extra[$value]['description'] = $current['configuration_description'];
+ $keys_extra[$value]['use_function'] = $current['use_function'];
+ $keys_extra[$value]['set_function'] = $current['set_function'];
+ }
+
+ self::$moduleEdit = configUtility::FormatEditAuto(array('array'=>$keys_extra));
+ break;
+ /**
+ @brief save Config base page
+ */
+ case 'modules-save':
+ foreach($_POST['configuration'] as $key=>$value) {
+
+ $configuration_value = tep_db_prepare_input($value);
+
+ if( ($res=sqlconfiguration::update(array('key'=>$key , 'value'=>tep_db_input($value) ))) == false)$erreur[]=false;
+ else $erreur[]=true;
+
+ }
+
+ if(!in_array(false,$erreur)) $messageStack->add_session(SAVE_CONFIG_OK, 'success');
+ else $messageStack->add_session(SAVE_CONFIG_NOT_OK, 'error');
+
+ tep_redirect(tep_href_link(FILENAME_CONFIGURATION, 'gparentID=' . $gparentID.'&gID=' . $_GET['gID'] . '&action=modules-edit&mod='. $_GET['mod'] ));
+ break;
+
+ }
+ }
+
+ /**
+ @fn load_db_values($Id)
+ @return object
+ */
+ public function load_db_values($Id){
+ global $languages_id;
+
+ $DB = Database::getInstance();
+ $list=new stdClass();
+
+ $li=sqlconfiguration::fetch(array('group_id'=> (int)self::$gID), true);
+
+ if(is_object($li))
+ $li = array($li);
+
+ if(is_array($li))
+ foreach($li as $row) {
+
+ $cfgValue =configUtility::CallExecConfigLine($row->use, $row->key, $row->value);
+
+ if (!empty($row->set)){
+ if(strpos($row->set,'(') === false) $row->set.='(';
+ eval('$value_field = ' . $row->set . '"' . htmlspecialchars($row->value) . '","'.$row->key.'");');
+ }
+ else $value_field = tep_draw_input_field('configuration['.$row->key.']', '',$row->value);
+
+ $conf = $row;
+ $row->cfgValue=$cfgValue;
+ $row->value_field=$value_field;
+
+ $list->config[$row->key]=$conf;
+ }
+
+
+
+ $li = sqlstatus::fetch(array('type'=>'content', 'language_id'=>$languages_id), true);
+ if(is_object($li))
+ $li = array($li);
+
+ $list->types = $li;
+
+ return $list;
+ }
+
+ /**
+ @brief Appelé dans le header de page
+ */
+ public static function draw_header(){
+ ?>
+ <style type="text/css">
+ #central form label {
+ display: inline-block;
+ font-weight: normal;
+ margin: 5px 10px;
+ text-align: left;
+ white-space: pre-wrap;
+ width: 90%;
+ }
+ </style>
+ <?php
+ }
+
+ /**
+ @brief Contenu central
+ */
+ public function draw(){
+
+ global $action,$gparentID;
+
+
+
+ switch($action){
+ case 'modules';
+ return self::GetStatusMod( new objectInfo( array('status'=>(int)$_GET['flag'], 'content'=> new objectInfo(array('mod'=>(int)$_GET['mod'])) )) );
+ break;
+
+ default:
+ self::$list = $this->load_db_values('');
+ $dbl = array();
+
+ foreach(scan(DIR_FS_ADMIN. DIR_WS_MODULES.'content/') as $row){
+ if( substr($row,-3) =='php'){
+
+ $class = substr($row,0, -4);
+
+ $tmp = modulesUtility::LoadModule('content', $row);
+ $dbl[]=$tmp->classe;
+ self::$module[]= $tmp;
+
+ }
+ }
+
+ foreach(scan(DIR_FS_CATALOG_MODULES.'content/') as $row){
+ if( substr($row,-3) =='php'){
+
+ $class = substr($row,0, -4);
+
+ $tmp = modulesUtility::LoadModule('content', $row);
+ if( !in_array($tmp->classe, $dbl) )
+ self::$module[]= $tmp;
+ }
+ }
+
+ return tep_get_include_contents('configuration/'.__CLASS__.'.listing');
+ }
+
+ }
+
+
+
+ /**
+ @fn get_item_action($orders)
+ @brief fonction qui construit l'affichage de la colonne action
+ La mise en forme est contenu dans les ressource xml du template en cours
+ @param $orders array
+ @return string
+ */
+ public static function get_item_action($row){
+ global $SecuKey;
+ return sprintf(
+ CsrtAction::getFormat('row_action'),
+ '',
+ (($row->status)
+ ? sprintf(CsrtAction::getLink('row_action_right', __('image config'), 'config'), '', tep_href_link(FILENAME_CONFIGURATION, FILENAME_CFG_43.'action=modules-edit&mod='.$row->content->code ),'' )
+ : ''
+ )
+ );
+ }
+
+ /**
+ @brief return format html for row status
+ @param $content array restuts row
+ @return string html
+ */
+ public static function GetStatusMod($row){
+ $exclude=array('action','mod','forceajax','type','class','function','funct', 'mod');
+ $query_s=FILENAME_CFG_43.'action=modules&mod=' . $row->content->code.'&flag=';
+
+ return '<a class="ajaxinline" href="' . tep_href_link(FILENAME_CONFIGURATION, tep_get_all_get_params($exclude).$query_s.(($row->status == '1')? '0' : '1') ) . '">'.
+ sprintf(
+ CsrtAction::getFormat('row_flag'),
+ (int)$row->status,
+ ( ($row->status == '1')? IMAGE_ICON_STATUS_GREEN : IMAGE_ICON_STATUS_RED)
+ ).
+ '</a>';
+ }
+}
+
+?>
\ No newline at end of file
Modified: trunk/catalog/install/includes/sql/mysql/data/91_osc_configuration_group.sql
===================================================================
--- trunk/catalog/install/includes/sql/mysql/data/91_osc_configuration_group.sql 2013-10-01 07:17:32 UTC (rev 4854)
+++ trunk/catalog/install/includes/sql/mysql/data/91_osc_configuration_group.sql 2013-10-01 07:51:11 UTC (rev 4855)
@@ -74,7 +74,10 @@
insert into osc_configuration_group values (7, 'EXPEDITION_EMBALLAGE', NULL, 0, 1, 40, '0', 'MODEXPEDITION');
insert into osc_configuration_group values (41, 'PAYMENT', NULL, 0, 1, 40, '0', 'MODPAYMENT');
--- hidden in menu configuration
+ insert into osc_configuration_group values (43 , 'OPTION_CONTENT', NULL, 0 , 1, 127, '1', 'OPTION_CONTENT');
+ insert into osc_configuration_group values (44, 'CONFIG_CONTENT', NULL , 0, 1, 44, '0', 'DATATYPECONTENT');
+
+-- hidden in menu configuration
insert into osc_configuration_group values (37 , 'VIEW_SYSINFO', NULL, 0 , 0, 120, '1', 'MODSYSINFO');
insert into osc_configuration_group values (38 , 'VIEW_SYSINFO', NULL, 0 , 0, 120, '1', 'MODCORECACHE');
Modified: trunk/catalog/install/includes/sql/mysql/upgrade/2.1.0_2.1.1/data/91_osc_configuration_group.sql
===================================================================
--- trunk/catalog/install/includes/sql/mysql/upgrade/2.1.0_2.1.1/data/91_osc_configuration_group.sql 2013-10-01 07:17:32 UTC (rev 4854)
+++ trunk/catalog/install/includes/sql/mysql/upgrade/2.1.0_2.1.1/data/91_osc_configuration_group.sql 2013-10-01 07:51:11 UTC (rev 4855)
@@ -12,69 +12,6 @@
--+######################################################################--+
-TRUNCATE osc_configuration_group;
-
-insert into osc_configuration_group values (100,'APPARENCE', NULL, 2, 1, 0, '1', 'CG_APPARENCE');
- insert into osc_configuration_group values (19, 'PAGE_PRODUCT_DETAIL', NULL, 0, 1, 100, '0', 'CG_PAGE_PRODUCT_DETAIL');
- insert into osc_configuration_group values (4, 'IMAGES', NULL, 0, 1, 100, '0', 'MODIMAGES');
- insert into osc_configuration_group values (8, 'LIST_PRODUTCS', NULL, 0, 1, 100, '0', 'CG_LIST_PRODUTCS');
- insert into osc_configuration_group values (21, 'OPEN_BOX', NULL, 0, 1, 100, '0', 'CG_OPEN_BOX');
- insert into osc_configuration_group values (27 , 'APPARENCE_GENERAL', NULL, 0 , 1, 100, '0', 'CG_APPARENCE_GENERAL');
- insert into osc_configuration_group values (29 , 'BOX_CONFIGURATION_TEMPLATE', NULL, 0 , 1, 100, '0', 'MODTEMPLATE');
-
-insert into osc_configuration_group values (110,'CONFIGURATION', NULL, 1, 1, 0, '1', 'CG_CONFIGURATION');
--- insert into osc_configuration_group values (3, 'VALUE_MAXI', NULL, 0, 1, 110, '0', 'CG_VALUE_MAXI');
- insert into osc_configuration_group values (2, 'VALUE_MINI', NULL, 0, 1, 110, '0', 'CG_VALUE_MINI');
- insert into osc_configuration_group values (1, 'MY_BOUTIQUE', NULL, 0, 1, 110, '0', 'CG_MY_BOUTIQUE');
-
- insert into osc_configuration_group values (30 , 'BOX_LOCALIZATION_ORDERS_STATUS', NULL, 0 , 1, 110, '0', 'MODSTATUS');
-
-
-insert into osc_configuration_group values (120,'CONFIG_AVANCE', NULL, 4, 1, 0, '1', 'CG_CONFIG_AVANCE');
- insert into osc_configuration_group values (24 , 'CG_CIP_MANAGER', NULL, 0 , 1, 120, '0', 'CG_CIP_MANAGER');
-
- insert into osc_configuration_group values (10, 'LOGGING', NULL, 0, 1, 120, '1', 'CG_LOGGING');
- insert into osc_configuration_group values (12, 'OPTION_MAIL', NULL, 0, 1, 120, '0', 'MODMAIL');
- insert into osc_configuration_group values (14, 'COMPRESSION', NULL, 0, 1, 120, '0', 'CG_COMPRESSION');
- insert into osc_configuration_group values (15, 'SESSION', NULL, 0, 1, 120, '0', 'CG_SESSION');
- insert into osc_configuration_group values (16, 'SEO_URL', NULL, 0, 1, 120, '0', 'MODSEOURL');
- insert into osc_configuration_group values (31 , 'BOX_LOCALIZATION_LANGUAGES', NULL, 0 , 1, 120, '0', 'MODLANGUE');
-
--- insert into osc_configuration_group values (26, 'ATTRIBUTE_PRODUCT', NULL,0 , 1, 120, '0', 'CG_ATTRIBUTE_PRODUCT');
- insert into osc_configuration_group values (128,'BOX_CONFIGURATION_ENVIRONEMENT', NULL, 0, 1, 120, '0', 'CFG_ENVIRONEMENT');
-
-insert into osc_configuration_group values (126,'ESPACE_ADMIN', NULL, 5, 1, 0, '1', 'CG_ESPACE_ADMIN');
- insert into osc_configuration_group values (17, 'QUICK_UPDATE', NULL, 0, 1, 126, '0', 'MODADMINCONFIG');
- insert into osc_configuration_group values (20, 'PRODUCT_ATTENTE', NULL, 0, 1, 126, '0', 'CG_PRODUCT_ATTENTE');
- insert into osc_configuration_group values (22, 'RECOVER_CART_SALES', NULL, 0, 1, 126, '0', 'CG_RECOVER_CART_SALES');
-
-insert into osc_configuration_group values (127,'CONFIG_COMM', NULL, 3, 1, 0, '1', 'CG_CONFIG_COMM');
-
- insert into osc_configuration_group values (9, 'STOCK', NULL, 0, 1, 127, '0', 'MODSTOCK');
- insert into osc_configuration_group values (11, 'OPTION_CATALOG', NULL, 0, 1, 127, '0', 'CG_OPTION_CATALOG');
-
-
--- insert into osc_configuration_group values (6, 'OPTION_MODULES', NULL, 0, 1, 120, '0', 'CG_OPTION_MODULES');
-
--- insert into osc_configuration_group values (130,'CONFIGURATION_DATATYPES', NULL, 0, 1, 127, '0', 'MODDATATYPE');
-
- insert into osc_configuration_group values (35 , 'OPTION_PRODUCTS', NULL, 0 , 1, 127, '1', 'OPTION_PRODUCTS');
- insert into osc_configuration_group values (36, 'CONFIG_PRODUCTS', NULL , 0, 1, 35, '0', 'DATATYPEPRODUCT');
- insert into osc_configuration_group values (13, 'DOWNLOADS', NULL, 0, 1, 35, '0', 'MODDOWNLOADS');
- insert into osc_configuration_group values (34 , 'BOX_CONFIGURATION_PRODUCTS_EXTRA_FIELDS', NULL, 0 , 1, 35, '0', 'MODPRODEXTRA');
- insert into osc_configuration_group values (25 , 'NEW_PRODUCTS', NULL, 0 , 1, 35, '0', 'CG_NEW_PRODUCTS');
-
- insert into osc_configuration_group values (39 , 'OPTION_CUSTOMERS', NULL, 0 , 1, 127, '1', 'OPTION_CUSTOMERS');
- insert into osc_configuration_group values (28 , 'MEMBRES_DETAIL', NULL, 0 , 1, 39, '0', 'MODMEMBRES');
- insert into osc_configuration_group values (33 , 'BOX_CONFIGURATION_EXTRA_FIELDS', NULL, 0 , 1, 39, '0', 'MODCUSTEXTRA');
- insert into osc_configuration_group values (42 , 'CONFIG_CUSTOMERS', NULL, 0 , 1, 39, '0', 'DATATYPEACCOUNT');
-
- insert into osc_configuration_group values (40 , 'OPTION_ORDERS', NULL, 0 , 1, 127, '1', 'OPTION_ORDERS');
- insert into osc_configuration_group values (129,'CONFIGURATION_ORDERS', NULL, 0, 1, 40, '0', 'MODORDER');
- insert into osc_configuration_group values (7, 'EXPEDITION_EMBALLAGE', NULL, 0, 1, 40, '0', 'MODEXPEDITION');
- insert into osc_configuration_group values (41, 'PAYMENT', NULL, 0, 1, 40, '0', 'MODPAYMENT');
-
--- hidden in menu configuration
-insert into osc_configuration_group values (37 , 'VIEW_SYSINFO', NULL, 0 , 0, 120, '1', 'MODSYSINFO');
-insert into osc_configuration_group values (38 , 'VIEW_SYSINFO', NULL, 0 , 0, 120, '1', 'MODCORECACHE');
\ No newline at end of file
+insert into osc_configuration_group values (43 , 'OPTION_CONTENT', NULL, 0 , 1, 127, '1', 'OPTION_CONTENT');
+ insert into osc_configuration_group values (44, 'CONFIG_CONTENT', NULL , 0, 1, 44, '0', 'DATATYPECONTENT');
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|