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...> - 2012-02-26 11:55:44
|
Revision: 4044
http://oscss.svn.sourceforge.net/oscss/?rev=4044&view=rev
Author: oscim
Date: 2012-02-26 11:55:35 +0000 (Sun, 26 Feb 2012)
Log Message:
-----------
suite evolution et amelioration des customers extra
modification des tables pour normilser les nom de table des extra
Ajout d'une classe de centralisation pour le traitement des extra
report BO et FO
ajustement des datatable , ajout des define de table d'unites
Modified Paths:
--------------
trunk/catalog/admin/includes/classes/drivers/sqlcustomer.php
trunk/catalog/admin/includes/content/configuration.central.inc
trunk/catalog/admin/includes/database_tables.php
trunk/catalog/admin/includes/gabarit/configuration/modcustextra/draw.edit.gab
trunk/catalog/admin/includes/gabarit/configuration/modcustextra/draw.listing.gab
trunk/catalog/admin/includes/languages/fr_FR/modules/configuration/modcustextra.txt
trunk/catalog/admin/includes/modules/account/account_extra.php
trunk/catalog/admin/includes/modules/configuration/modcustextra.php
trunk/catalog/includes/database_tables.php
trunk/catalog/includes/functions/general.php
trunk/catalog/install/data/templates/appareil_photo/2cShopHtml5Oscim/includes/content/account_edit.php
trunk/catalog/install/includes/sql/mysql/tables/osc_extra_field_labels.sql
Added Paths:
-----------
trunk/catalog/admin/includes/classes/drivers/sqlcustomersextrafileds.php
trunk/catalog/common/classes/ExtraUtility.php
Removed Paths:
-------------
trunk/catalog/install/includes/sql/mysql/tables/osc_extra_fields_info.sql
Modified: trunk/catalog/admin/includes/classes/drivers/sqlcustomer.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlcustomer.php 2012-02-25 14:01:13 UTC (rev 4043)
+++ trunk/catalog/admin/includes/classes/drivers/sqlcustomer.php 2012-02-26 11:55:35 UTC (rev 4044)
@@ -116,52 +116,52 @@
$sqlarray = $option['sqlarray'];
- $sql_data_array = array();
- if(isset($sqlarray['customers_firstname']))$sql_data_array['customers_firstname'] = $sqlarray['customers_firstname'];
- if(isset($sqlarray['customers_lastname']))$sql_data_array['customers_lastname'] = $sqlarray['customers_lastname'];
- if(isset($sqlarray['customers_email_address']))$sql_data_array['customers_email_address'] = $sqlarray['customers_email_address'];
- if(isset($sqlarray['customers_telephone']))$sql_data_array['customers_telephone'] = $sqlarray['customers_telephone'];
- if(isset($sqlarray['customers_fax']))$sql_data_array['customers_fax'] = $sqlarray['customers_fax'];
- if(isset($sqlarray['password']))$sql_data_array['customers_password'] = $sqlarray['password'];
- if(isset($sqlarray['customers_newsletter']))$sql_data_array['customers_newsletter'] = $sqlarray['customers_newsletter'];
- if(isset($sqlarray['customers_group_ra']))$sql_data_array['customers_group_ra'] = $sqlarray['customers_group_ra'];
- if(isset($sqlarray['customers_group_id']))$sql_data_array['customers_group_id'] = $sqlarray['customers_group_id'];
- if(isset($sqlarray['customers_shopping_points']))$sql_data_array['customers_shopping_points'] = $sqlarray['customers_shopping_points'];
+ $sql_data_array = array();
+ if(isset($sqlarray['customers_firstname']))$sql_data_array['customers_firstname'] = $sqlarray['customers_firstname'];
+ if(isset($sqlarray['customers_lastname']))$sql_data_array['customers_lastname'] = $sqlarray['customers_lastname'];
+ if(isset($sqlarray['customers_email_address']))$sql_data_array['customers_email_address'] = $sqlarray['customers_email_address'];
+ if(isset($sqlarray['customers_telephone']))$sql_data_array['customers_telephone'] = $sqlarray['customers_telephone'];
+ if(isset($sqlarray['customers_fax']))$sql_data_array['customers_fax'] = $sqlarray['customers_fax'];
+ if(isset($sqlarray['password']))$sql_data_array['customers_password'] = $sqlarray['password'];
+ if(isset($sqlarray['customers_newsletter']))$sql_data_array['customers_newsletter'] = $sqlarray['customers_newsletter'];
+ if(isset($sqlarray['customers_group_ra']))$sql_data_array['customers_group_ra'] = $sqlarray['customers_group_ra'];
+ if(isset($sqlarray['customers_group_id']))$sql_data_array['customers_group_id'] = $sqlarray['customers_group_id'];
+ if(isset($sqlarray['customers_shopping_points']))$sql_data_array['customers_shopping_points'] = $sqlarray['customers_shopping_points'];
- if (_cst_bool('ACCOUNT_GENDER'))
- $sql_data_array['customers_gender'] = $sqlarray['customers_gender'];
+ if (_cst_bool('ACCOUNT_GENDER'))
+ $sql_data_array['customers_gender'] = $sqlarray['customers_gender'];
- if (_cst_bool('ACCOUNT_DOB'))
- $sql_data_array['customers_dob'] = tep_date_raw($sqlarray['customers_dob']);
+ if (_cst_bool('ACCOUNT_DOB'))
+ $sql_data_array['customers_dob'] = tep_date_raw($sqlarray['customers_dob']);
- self::$modules->load_post_values($_post);
+ self::$modules->load_post_values($_post);
- $sql_data_array = array_merge($sql_data_array, self::$modules->update_table_prim());
+ $sql_data_array = array_merge($sql_data_array, self::$modules->update_table_prim());
- $_return= $sql_data_array;
+ $_return= $sql_data_array;
- $resobj=tep_db_perform(TABLE_CUSTOMERS, $sql_data_array, 'update' , substr($where,3));
+ $resobj=tep_db_perform(TABLE_CUSTOMERS, $sql_data_array, 'update' , substr($where,3));
- $sql_data_array = array(
- 'global_product_notifications' => $sqlarray['global_product_notifications']
- );
+ $sql_data_array = array(
+ 'global_product_notifications' => $sqlarray['global_product_notifications']
+ );
- $res=tep_db_perform(TABLE_CUSTOMERS_INFO, $sql_data_array, 'update' , " customers_info_id = '".(int)$option['id']."' " );
+ $res=tep_db_perform(TABLE_CUSTOMERS_INFO, $sql_data_array, 'update' , " customers_info_id = '".(int)$option['id']."' " );
- self::$modules->load_post_values($_post);
- $sql_data_array = array_merge($sql_data_array, self::$modules->update_table_second());
+ self::$modules->load_post_values($_post);
+ $sql_data_array = array_merge($sql_data_array, self::$modules->update_table_second());
- self::$modules->after_update((int)$customers_id);
+ self::$modules->after_update((int)$option['id']);
- return $res;
-
+ return $res;
}
+
/**
@brief load ligne in table configuration
@param option array
Added: trunk/catalog/admin/includes/classes/drivers/sqlcustomersextrafileds.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlcustomersextrafileds.php (rev 0)
+++ trunk/catalog/admin/includes/classes/drivers/sqlcustomersextrafileds.php 2012-02-26 11:55:35 UTC (rev 4044)
@@ -0,0 +1,359 @@
+<?php if (!defined('HTTP_SERVER')) die('You can not access this file directly!');
+/**
+ @licence GPL 2005-2011 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/09/11, 20:11
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+
+*/
+
+
+
+
+class sqlcustomersextrafileds
+ implements ModSqlDataDriver{
+
+
+ /**
+ @brief create new ligne in table configuration
+ */
+ public static function create($option){
+
+// if(!isset($option['key'])) return 'key';
+
+ if(isset($option['id'])) $sql_data_array['fields_id'] = $option['id'];
+ if(isset($option['size'])) $sql_data_array['fields_size'] = $option['size'];
+ if(isset($option['input_type'])) $sql_data_array['fields_input_type'] = $option['input_type'];
+ if(isset($option['input_value'])) $sql_data_array['fields_input_value'] = $option['input_value'];
+ if(isset($option['required_status'])) $sql_data_array['fields_required_status'] = $option['required_status'];
+ if(isset($option['name'])) $sql_data_array['fields_name'] = $option['name'];
+ if(isset($option['status'])) $sql_data_array['fields_status'] = $option['status'];
+ if(isset($option['required_email'])) $sql_data_array['fields_required_email'] = $option['required_email'];
+ if(isset($option['key'])) $sql_data_array['fields_key'] = $option['key'];
+ if(isset($option['admin'])) $sql_data_array['fields_admin'] = $option['admin'];
+ if(isset($option['special_mod'])) $sql_data_array['fields_special_mod'] = $option['special_mod'];
+ if(isset($option['group_class'])) $sql_data_array['fields_group_class'] = $option['group_class'];
+
+ $res=tep_db_perform(TABLE_EXTRA_FIELDS, $sql_data_array);
+
+ if(!$res)
+ return $res;
+ else
+ return $res->__get('insertId');
+ }
+
+
+
+ /**
+ @brief update ligne in table configuration
+ */
+ public static function update($option){
+
+ if(!isset($option['key']) && !isset($option['id'])) return 'key or id';
+
+ $where ='';
+ if(isset($option['id'])) $where .="AND fields_id = '".(int)$option['id']."' ";
+ if(isset($option['key'])) $where .="AND fields_key = '".(string)tep_db_input($option['key'])."' ";
+
+// if(isset($option['id'])) $sql_data_array['fields_id'] = $option['id'];
+ if(isset($option['size'])) $sql_data_array['fields_size'] = $option['size'];
+ if(isset($option['input_type'])) $sql_data_array['fields_input_type'] = $option['input_type'];
+ if(isset($option['input_value'])) $sql_data_array['fields_input_value'] = $option['input_value'];
+ if(isset($option['required_status'])) $sql_data_array['fields_required_status'] = $option['required_status'];
+ if(isset($option['name'])) $sql_data_array['fields_name'] = $option['name'];
+ if(isset($option['status'])) $sql_data_array['fields_status'] = $option['status'];
+ if(isset($option['required_email'])) $sql_data_array['fields_required_email'] = $option['required_email'];
+// if(isset($option['key'])) $sql_data_array['fields_key'] = $option['key'];
+ if(isset($option['admin'])) $sql_data_array['fields_admin'] = $option['admin'];
+ if(isset($option['special_mod'])) $sql_data_array['fields_special_mod'] = $option['special_mod'];
+ if(isset($option['group_class'])) $sql_data_array['fields_group_class'] = $option['group_class'];
+
+
+
+
+
+ $res=tep_db_perform(TABLE_EXTRA_FIELDS, $sql_data_array, 'update' , substr($where,3) );
+
+ return $res;
+ }
+
+ /**
+ @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)
+
+ @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){
+ $DB=Database::getInstance();
+
+ $sql ="";
+ if(isset($option['id'])) $sql .="AND fields_id = '".(int)$option['id']."' ";
+ if(isset($option['key'])) $sql .="AND fields_key = '".(string)tep_db_input($option['key'])."' ";
+
+ $sql ="SELECT * FROM ".TABLE_EXTRA_FIELDS." 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){
+ $DB=Database::getInstance();
+
+ $sql ="";
+ if(isset($option['id'])) $sql .="AND fields_id = '".(int)$option['id']."' ";
+ if(isset($option['key'])) $sql .="AND fields_key = '".(string)tep_db_input($option['key'])."' ";
+
+ if(strlen($sql)==0)
+ return false;
+
+ $sql ="DELETE FROM ".TABLE_EXTRA_FIELDS." WHERE ".substr($sql,3);
+
+ $res=$DB->query($sql);
+
+ return $res;
+ }
+
+ /**
+ @fn CleanKey()
+ @brief Clean string name key
+ */
+ private static function CleanKey($array){
+
+ $object= new stdclass();
+
+ foreach($array as $key=>$value){
+ if( strpos($key,'fields_') ===0)
+ $key=substr($key,7);
+
+ $object->$key = $value;
+ }
+
+ return $object;
+ }
+
+ /**
+ @brief
+ @return array empty
+ */
+ public static function Specimen($shortkey=false){
+
+ $par = array(
+ 'fields_id' =>-1,
+ 'fields_size' =>'',
+ 'fields_input_type' =>'',
+ 'fields_input_value' =>'',
+ 'fields_required_status'=>0,
+ 'fields_name' =>'',
+ 'fields_status' =>0,
+ 'fields_required_email' =>0,
+ 'fields_key' =>'',
+ 'fields_admin' =>0,
+ 'fields_special_mod' =>'',
+ 'fields_group_class' =>''
+ );
+
+ return ((!$shortkey)? $par : self::CleanKey($par));
+ }
+
+}
+
+
+
+
+class sqlcustomersextrafiledslabels
+ implements ModSqlDataDriver{
+
+
+ /**
+ @brief create new ligne in table configuration
+ */
+ public static function create($option){
+
+ if(!isset($option['languages_id'])) return 'languages_id';
+
+ if(isset($option['id'])) $sql_data_array['fields_id'] = $option['id'];
+ if(isset($option['languages_id'])) $sql_data_array['languages_id'] = $option['languages_id'];
+ if(isset($option['name'])) $sql_data_array['fields_name'] = $option['name'];
+ if(isset($option['format'])) $sql_data_array['fields_format'] = $option['format'];
+ if(isset($option['format'])) $sql_data_array['fields_format'] = $option['format'];
+ if(isset($option['unity_type'])) $sql_data_array['fields_unity_type_id'] = $option['unity_type'];
+ if(isset($option['unity'])) $sql_data_array['fields_unity_id'] = $option['unity'];
+
+ $res=tep_db_perform(TABLE_EXTRA_FIELDS_LABELS, $sql_data_array);
+
+ if(!$res)
+ return $res;
+ else
+ return $res->__get('insertId');
+ }
+
+
+
+ /**
+ @brief update ligne in table configuration
+ */
+ public static function update($option){
+
+ if(!isset($option['languages_id']) && !isset($option['id'])) return 'languages_id or id';
+
+ $where ='';
+ if(isset($option['id'])) $where .="AND fields_id = '".(int)$option['id']."' ";
+ if(isset($option['languages_id'])) $where .="AND languages_id = '".(string)tep_db_input($option['languages_id'])."' ";
+
+// if(isset($option['id'])) $sql_data_array['fields_id'] = $option['id'];
+// if(isset($option['languages_id'])) $sql_data_array['languages_id'] = $option['languages_id'];
+ if(isset($option['name'])) $sql_data_array['fields_name'] = $option['name'];
+ if(isset($option['format'])) $sql_data_array['fields_format'] = $option['format'];
+ if(isset($option['unity_type'])) $sql_data_array['fields_unity_type_id'] = $option['unity_type'];
+ if(isset($option['unity'])) $sql_data_array['fields_unity_id'] = $option['unity'];
+
+ $res=tep_db_perform(TABLE_EXTRA_FIELDS_LABELS, $sql_data_array, 'update' , substr($where,3) );
+
+ return $res;
+ }
+
+ /**
+ @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)
+
+ @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){
+ $DB=Database::getInstance();
+
+ $sql ="";
+ if(isset($option['id'])) $sql .="AND fields_id = '".(int)$option['id']."' ";
+ if(isset($option['languages_id'])) $sql .="AND languages_id = '".(string)tep_db_input($option['languages_id'])."' ";
+
+ $sql ="SELECT * FROM ".TABLE_EXTRA_FIELDS_LABELS." 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){
+ $DB=Database::getInstance();
+
+ $sql ="";
+ if(isset($option['id'])) $sql .="AND fields_id = '".(int)$option['id']."' ";
+ if(isset($option['languages_id'])) $sql .="AND languages_id = '".(string)tep_db_input($option['languages_id'])."' ";
+
+ if(strlen($sql)==0)
+ return false;
+
+ $sql ="DELETE FROM ".TABLE_EXTRA_FIELDS_LABELS." WHERE ".substr($sql,3);
+
+ $res=$DB->query($sql);
+
+ return $res;
+ }
+
+ /**
+ @fn CleanKey()
+ @brief Clean string name key
+ */
+ private static function CleanKey($array){
+
+ $object= new stdclass();
+
+ foreach($array as $key=>$value){
+ if( strpos($key,'fields_') ===0)
+ $key=substr($key,7);
+
+ $object->$key = $value;
+ }
+
+ return $object;
+ }
+
+ /**
+ @brief
+ @return array empty
+ */
+ public static function Specimen($shortkey=false){
+
+ $par = array(
+ 'fields_id' =>-1,
+ 'languages_id' =>0,
+ 'fields_name' =>'',
+ 'fields_format' =>'%label% %input% %unit%',
+ 'fields_unity_type_id' =>0,
+ 'fields_unity_id' =>0,
+ );
+
+ return ((!$shortkey)? $par : self::CleanKey($par));
+ }
+
+}
+?>
\ No newline at end of file
Modified: trunk/catalog/admin/includes/content/configuration.central.inc
===================================================================
--- trunk/catalog/admin/includes/content/configuration.central.inc 2012-02-25 14:01:13 UTC (rev 4043)
+++ trunk/catalog/admin/includes/content/configuration.central.inc 2012-02-26 11:55:35 UTC (rev 4044)
@@ -1,19 +1,16 @@
<?php
/**
- @licence GPL 2005-2011 The osCSS developers - osCSS Open Source E-commerce
+ @licence GPL 2005-2012 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/09/11, 22:00
+ @date 22/02/2012, 22:00
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
@brief content for pages configuration
*/
?>
<!-- body //-->
-
-
-<br style="clear:both" />
<!-- body_text //-->
<?php if( isset($mID) ): ?>
Modified: trunk/catalog/admin/includes/database_tables.php
===================================================================
--- trunk/catalog/admin/includes/database_tables.php 2012-02-25 14:01:13 UTC (rev 4043)
+++ trunk/catalog/admin/includes/database_tables.php 2012-02-26 11:55:35 UTC (rev 4044)
@@ -36,6 +36,10 @@
define('TABLE_TAX_RATES', DB_TABLE_PREFIX . 'tax_rates');
define('TABLE_ZONES_TO_GEO_ZONES', DB_TABLE_PREFIX . 'zones_to_geo_zones');
define('TABLE_ZONES', DB_TABLE_PREFIX . 'zones');
+
+ // for dev
+ define('TABLE_UNITY', DB_TABLE_PREFIX . 'f_unity');
+ define('TABLE_UNITY_DET', DB_TABLE_PREFIX . 'f_unity_det');
## Dictionnaires end
@@ -94,7 +98,7 @@
define('TABLE_CUSTOMERS_BASKET_ATTRIBUTES', DB_TABLE_PREFIX . 'customers_basket_attributes');
# extra
define('TABLE_EXTRA_FIELDS',DB_TABLE_PREFIX . 'extra_fields');
- define('TABLE_EXTRA_FIELDS_INFO',DB_TABLE_PREFIX . 'extra_fields_info');
+ define('TABLE_EXTRA_FIELDS_LABELS',DB_TABLE_PREFIX . 'extra_fields_labels');
define('TABLE_CUSTOMERS_TO_EXTRA_FIELDS',DB_TABLE_PREFIX . 'customers_to_extra_fields');
@@ -179,6 +183,9 @@
define('TABLE_IMAGES_USED', DB_TABLE_PREFIX . 'images_used');
+
+
+
/// TOP Not Used for dev
define('TABLE_TEMPLATE', DB_TABLE_PREFIX . 'template_config');
Modified: trunk/catalog/admin/includes/gabarit/configuration/modcustextra/draw.edit.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/configuration/modcustextra/draw.edit.gab 2012-02-25 14:01:13 UTC (rev 4043)
+++ trunk/catalog/admin/includes/gabarit/configuration/modcustextra/draw.edit.gab 2012-02-26 11:55:35 UTC (rev 4044)
@@ -1,82 +1,147 @@
<?php
/**
- @licence GPL 2005-2011 The osCSS developers - osCSS Open Source E-commerce
+ @licence GPL 2005-2012 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 24/10/11, 15:46
+ @date 22/02/2012, 15:46
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
+ @brief form for add and manage extra field for customers
*/
global $languages;
?>
<h3><?php echo __('text heading edit field') ?></h3>
- <?php echo tep_draw_form('update', modcustextra::FILENAME, FILENAME_CFG_33.((!empty(modcustextra::$fInfo->fields_id )?'&cID=' . modcustextra::$fInfo->fields_id . '&action=update' :'&action=insert') ), 'post') ?>
+<?php echo tep_draw_form('update', modcustextra::FILENAME, FILENAME_CFG_33.((!empty(modcustextra::$fInfo->fields_id )?'&cID=' . modcustextra::$fInfo->fields_id . '&action=update' :'&action=insert') ), 'post') ?>
+<div class="block_form">
<p>
<?php echo __('text edit intro') ?>
</p>
+ <div id="tabs">
+ <ul>
+ <li><a href="#tabs-1"><?php echo __('tab base extra field'); ?></a></li>
+ <li><a href="#tabs-2"><?php echo __('tab advanced extra field'); ?></a></li>
+ </ul>
- <p class="block_input">
- <?php echo __('text field name') ?>
- <?php for ($i=0, $n=sizeof($languages); $i<$n; $i++) : ?>
- <?php echo tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . ' ' . tep_draw_input_field('fields_name[' . $languages[$i]['id'] . ']','fields_name_' . $languages[$i]['id'],modcustextra::get_customers_extra_fields_name(modcustextra::$fInfo->fields_id, $languages[$i]['id'])); ?>
- <?php endfor; ?>
- </p>
- <ul class="block_input">
- <li><?php echo tep_draw_radio_field('fields_input_type','fields_input_type', 0, (modcustextra::$fInfo->fields_input_type==0) ? true : false) . __('text input field') ?></li>
- <li><?php echo tep_draw_radio_field('fields_input_type','fields_input_type', 1, (modcustextra::$fInfo->fields_input_type==1) ? true : false) . __('text textarea field') ?></li>
- <li><?php echo tep_draw_radio_field('fields_input_type','fields_input_type', 2, (modcustextra::$fInfo->fields_input_type==2) ? true : false) . __('text radio field') ?></li>
- <li><?php echo tep_draw_radio_field('fields_input_type','fields_input_type', 3, (modcustextra::$fInfo->fields_input_type==3) ? true : false) . __('text check field') ?></li>
- <li><?php echo tep_draw_radio_field('fields_input_type','fields_input_type', 4, (modcustextra::$fInfo->fields_input_type==4) ? true : false) . __('text down field') ?></li>
- </ul>
- <p class="block_input">
- <label for="fields_input_value" title="<?php echo __('text field input value help') ?>"><?php echo __('text field input value').tep_image(DIR_WS_ICONS . 'icon_help.gif') ?></label>
- <?php echo tep_draw_textarea_field('fields_input_value', 'fields_input_value', 30, 8, modcustextra::$fInfo->fields_input_value) ?>
- </p>
+ <div id="tabs-1" class="tabPage">
- <p class="block_input">
- <label ><?php echo __('text field required status') ?></label>
- <?php echo tep_draw_radio_field('fields_required_status','fields_required_status', 0, (modcustextra::$fInfo->fields_required_status==0) ? true : false) . 'false' . tep_draw_radio_field('fields_required_status','fields_required_status', 1, (modcustextra::$fInfo->fields_required_status==1) ? true : false) . 'true' ?>
- </p>
+ <fieldset class="tabs_lang block_field">
+ <ul>
+ <?php for ($i=0, $n=sizeof($languages); $i<$n; $i++) { ?>
+ <li><?php echo '<a href="#products_name-' . ($i+1).'" title="'.$languages[$i]['name'].'">' . tep_language_image( $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']). '</a>' ?></li>
+ <?php } ?>
+ </ul>
+ <?php for ($i=0, $n=sizeof($languages); $i<$n; $i++) {?>
+ <ul>
+ <li class="block_input">
+ <label for="<?php echo 'fields_name_' . $languages[$i]['id']; ?>"><?php echo __('text field name'); ?></label>
+ <?php echo tep_draw_input_field('fields_name[' . $languages[$i]['id'] . ']','fields_name_' . $languages[$i]['id'],modcustextra::$fInfo->lg[$languages[$i]['id']]->fields_name).'<span class="required">*</span>'; ?>
+ </li>
+ </ul>
+ <?php } ?>
+ </fieldset>
+ <fieldset class="block_field">
+ <div class="block_input">
+ <label for="fields_input_value" title="<?php echo __('text field input type help') ?>"><?php echo __('text field input type').tep_image(DIR_WS_ICONS . 'icon_help.gif') ?></label>
+ <ul>
+ <li><?php echo tep_draw_radio_field('fields_input_type','fields_input_type', 0, (modcustextra::$fInfo->fields_input_type==0) ? true : false) . __('entry list type input') ?></li>
+ <li><?php echo tep_draw_radio_field('fields_input_type','fields_input_type', 1, (modcustextra::$fInfo->fields_input_type==1) ? true : false) . __('entry list type textarea') ?></li>
+ <li><?php echo tep_draw_radio_field('fields_input_type','fields_input_type', 2, (modcustextra::$fInfo->fields_input_type==2) ? true : false) . __('entry list type radio') ?></li>
+ <li><?php echo tep_draw_radio_field('fields_input_type','fields_input_type', 3, (modcustextra::$fInfo->fields_input_type==3) ? true : false) . __('entry list type checkbox') ?></li>
+ <li><?php echo tep_draw_radio_field('fields_input_type','fields_input_type', 3, (modcustextra::$fInfo->fields_input_type==6) ? true : false) . __('entry list type checkbox multi') ?></li>
+ <li><?php echo tep_draw_radio_field('fields_input_type','fields_input_type', 4, (modcustextra::$fInfo->fields_input_type==4) ? true : false) . __('entry list type select') ?></li>
+ <li><?php echo tep_draw_radio_field('fields_input_type','fields_input_type', 4, (modcustextra::$fInfo->fields_input_type==7) ? true : false) . __('entry list type select mutli') ?></li>
+ <li><?php echo tep_draw_radio_field('fields_input_type','fields_input_type', 4, (modcustextra::$fInfo->fields_input_type==5) ? true : false) . __('entry list type hidden') ?></li>
+ </ul>
+ </div>
- <p class="block_input">
- <label><?php echo __('text field size') ?></label>
- <?php echo tep_draw_input_field('fields_size','fields_size', modcustextra::$fInfo->fields_size) ?>
- </p>
+ <p class="block_input">
+ <?php if(in_array(modcustextra::$fInfo->fields_input_type, array(3,6,4,7))): ?>
+ <label for="fields_input_value" title="<?php echo __('text field input value multi help') ?>"><?php echo __('text field input value multi') ?></label>
+ <?php echo tep_draw_textarea_field('fields_input_value', 'fields_input_value', 30, 8, modcustextra::$fInfo->fields_input_value) ?>
+ <?php else: ?>
+ <label for="fields_input_value" title="<?php echo __('text field input value help') ?>"><?php echo __('text field input value') ?></label>
+ <?php echo tep_draw_input_field('fields_input_value', 'fields_input_value', modcustextra::$fInfo->fields_input_value) ?>
+ <?php endif; ?>
+ </p>
+ </fieldset>
- <p class="block_input">
- <label><?php echo __('text field status email') ?></label>
- <?php echo tep_draw_radio_field('fields_required_email','fields_required_email',0,(modcustextra::$fInfo->fields_required_email==0)?true:false) . 'false' . tep_draw_radio_field('fields_required_email','fields_required_email',1,(modcustextra::$fInfo->fields_required_email==1)?true:false) . 'true' ?>
- </p>
+ <fieldset class="block_field">
+ <legend><?php echo __('legend check field') ?></legend>
+ <p class="block_input">
+ <label><?php echo __('text field required status') ?></label>
+ <?php echo tep_draw_radio_field('fields_required_status','fields_required_status', 0, (modcustextra::$fInfo->fields_required_status==0) ? true : false) . 'false' . tep_draw_radio_field('fields_required_status','fields_required_status', 1, (modcustextra::$fInfo->fields_required_status==1) ? true : false) . 'true' ?>
+ </p>
- <p class="block_input">
- <label for="fields_key" title="<?php echo __('text field input key') ?>"><?php echo __('text field key').tep_image(DIR_WS_ICONS . 'icon_help.gif') ?></label>
- <?php echo tep_draw_input_field('fields_key','fields_key', modcustextra::$fInfo->fields_key) ?>
- </p>
- <p class="block_input">
- <label for="fields_admin" title="<?php echo __('text field input fields_admin') ?>"><?php echo __('text field fields_admin').tep_image(DIR_WS_ICONS . 'icon_help.gif') ?></label>
- <?php echo tep_draw_pull_down_menu('fields_admin',array(array('id'=>0,'text'=>__('visible BO and FO')) ,array('id'=>1,'text'=>__('uniquement admin')) ,array('id'=>2,'text'=>__('hidden')) ), modcustextra::$fInfo->fields_admin) ?>
- </p>
+ <p class="block_input">
+ <label for="fields_size" title="<?php echo __('text field size help') ?>"><?php echo __('text field size').tep_image(DIR_WS_ICONS . 'icon_help.gif') ?></label>
+ <?php echo tep_draw_input_field('fields_size','fields_size', modcustextra::$fInfo->fields_size) ?>
+ </p>
+ </fieldset>
+ <br />
+ </div>
- <p class="block_input">
- <label for="fields_special_mod" title="<?php echo __('text field input fields_special_mod') ?>"><?php echo __('text field fields_special_mod').tep_image(DIR_WS_ICONS . 'icon_help.gif') ?></label>
- <?php echo tep_draw_input_field('fields_special_mod','fields_special_mod', modcustextra::$fInfo->fields_special_mod) ?>
- </p>
+ <div id="tabs-2" class="tabPage">
- <p class="block_input">
- <label for="fields_group_class" title="<?php echo __('text field input fields_group_class') ?>"><?php echo __('text field fields_group_class').tep_image(DIR_WS_ICONS . 'icon_help.gif') ?></label>
- <?php echo tep_draw_input_field('fields_group_class','fields_group_class', modcustextra::$fInfo->fields_group_class) ?>
- </p>
+ <fieldset class="tabs_lang block_field">
+ <ul>
+ <?php for ($i=0, $n=sizeof($languages); $i<$n; $i++) { ?>
+ <li><?php echo '<a href="#products_name-' . ($i+1).'" title="'.$languages[$i]['name'].'">' . tep_language_image( $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']). '</a>' ?></li>
+ <?php } ?>
+ </ul>
+ <?php for ($i=0, $n=sizeof($languages); $i<$n; $i++) {?>
+ <ul>
+ <li class="block_input">
+ <label for="<?php echo 'fields_name_' . $languages[$i]['id']; ?>"><?php echo __('text field format'); ?></label>
+ <?php echo tep_draw_input_field('fields_format[' . $languages[$i]['id'] . ']','fields_format_' . $languages[$i]['id'],modcustextra::$fInfo->lg[$languages[$i]['id']]->fields_format ).'<span class="required">*</span>'; ?>
+ </li>
+ </ul>
+ <?php } ?>
+ </fieldset>
- <div class="button_nav">
+
+ <fieldset class="block_field">
+ <p class="block_input">
+ <label><?php echo __('text field status email') ?></label>
+ <?php echo tep_draw_radio_field('fields_required_email','fields_required_email',0,(modcustextra::$fInfo->fields_required_email==0)?true:false) . 'false' . tep_draw_radio_field('fields_required_email','fields_required_email',1,(modcustextra::$fInfo->fields_required_email==1)?true:false) . 'true' ?>
+ </p>
+
+ <p class="block_input">
+ <label for="fields_key" title="<?php echo __('text field input key') ?>"><?php echo __('text field key').tep_image(DIR_WS_ICONS . 'icon_help.gif') ?></label>
+ <?php echo tep_draw_input_field('fields_key','fields_key', modcustextra::$fInfo->fields_key) ?>
+ </p>
+
+ <p class="block_input">
+ <label for="fields_admin" title="<?php echo __('text field input fields_admin') ?>"><?php echo __('text field fields_admin').tep_image(DIR_WS_ICONS . 'icon_help.gif') ?></label>
+ <?php echo tep_draw_pull_down_menu('fields_admin',array(array('id'=>0,'text'=>__('visible BO and FO')) ,array('id'=>1,'text'=>__('uniquement admin')) ,array('id'=>2,'text'=>__('hidden')) ,array('id'=>3,'text'=>__('public')) ), modcustextra::$fInfo->fields_admin) ?>
+ </p>
+
+ <p class="block_input">
+ <label for="fields_special_mod" title="<?php echo __('text field input fields_special_mod') ?>"><?php echo __('text field fields_special_mod').tep_image(DIR_WS_ICONS . 'icon_help.gif') ?></label>
+ <?php echo tep_draw_input_field('fields_special_mod','fields_special_mod', modcustextra::$fInfo->fields_special_mod) ?>
+ </p>
+
+ <p class="block_input">
+ <label for="fields_group_class" title="<?php echo __('text field input fields_group_class') ?>"><?php echo __('text field fields_group_class').tep_image(DIR_WS_ICONS . 'icon_help.gif') ?></label>
+ <?php echo tep_draw_input_field('fields_group_class','fields_group_class', modcustextra::$fInfo->fields_group_class) ?>
+ </p>
+ </fieldset>
+
+ </div>
+
+ <br class="clear"/>
+ </div>
+
+ <fieldset class=" block_field button_nav">
<?php echo tep_image_submit('',((!empty(modcustextra::$fInfo->fields_id )?IMAGE_UPDATE :IMAGE_SAVE)) ). tep_js_back(tep_href_link(modcustextra::FILENAME, tep_get_all_get_params(array('action','cID'))), IMAGE_CANCEL) ; ?>
- </div>
- </form>
\ No newline at end of file
+ </fieldset>
+</form>
+</div>
\ No newline at end of file
Modified: trunk/catalog/admin/includes/gabarit/configuration/modcustextra/draw.listing.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/configuration/modcustextra/draw.listing.gab 2012-02-25 14:01:13 UTC (rev 4043)
+++ trunk/catalog/admin/includes/gabarit/configuration/modcustextra/draw.listing.gab 2012-02-26 11:55:35 UTC (rev 4044)
@@ -1,10 +1,10 @@
<?php
/**
- @licence GPL 2005-2011 The osCSS developers - osCSS Open Source E-commerce
+ @licence GPL 2005-2012 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 24/10/11, 15:46
+ @date 22/02/2012, 15:46
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
*/
@@ -14,49 +14,48 @@
<?php echo tep_ssmenu_configuration($gparentID) ?>
</div>
- <h3><?php echo __("heading title"); ?></h3>
- <div class="button_nav">
- <p><?php echo '<a class="button" href="' . tep_href_link(FILENAME_CONFIGURATION, tep_get_all_get_params(array('action','cID')) . 'action=new') . '">' . tep_image(DIR_WS_ICONS . 'icon_add_new.png', IMAGE_INSERT). IMAGE_INSERT . '</a>'; ?></p>
- </div>
+<h3><?php echo __("heading title"); ?></h3>
- <div class="">
+<div class="button_nav">
+ <p><?php echo '<a class="button" href="' . tep_href_link(FILENAME_CONFIGURATION, tep_get_all_get_params(array('action','cID')) . 'action=new') . '">' . tep_image(DIR_WS_ICONS . 'icon_add_new.png', IMAGE_INSERT). IMAGE_INSERT . '</a>'; ?></p>
+</div>
- <table class="dataTable">
- <thead>
- <tr>
- <th><?php echo __('table heading fields'); ?></th>
- <th class="tcenter"><?php echo __('table heading visibility'); ?></th>
- <th class="tcenter"><?php echo __('table heading group class'); ?></th>
- <th class="tcenter"><?php echo __('table heading status'); ?></th>
- <th class="row_action"><?php echo __('table heading action'); ?></th>
- </tr>
- </thead>
- <tfoot>
- <tr>
- <td><?php echo modcustextra::$split->display_count(modcustextra::$fields_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, 1, __('text display number of fields')); ?></td>
- <td colspan="2"><?php echo modcustextra::$split->display_links(modcustextra::$fields_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, 1);; ?></td>
- </tr>
- </tfoot>
- <?php foreach(modcustextra::$list as $fields) { ?>
- <tr class="dataTableRow <?php if(isset( modcustextra::$fInfo) && is_object( modcustextra::$fInfo) && modcustextra::$fInfo->fields_id == modcustextra::$cID) echo "Selected" ?>" >
- <td><?php echo $fields->fields_name; ?></td>
- <td><?php echo $fields->fields_admin; ?></td>
- <td><?php echo $fields->fields_group_class; ?></td>
- <td class="tcenter">
- <?php
- if ($fields->fields_status == '1') {
- echo tep_image(DIR_WS_ICONS . 'icon_status_green.gif', IMAGE_ICON_STATUS_GREEN) . ' <a href="' . tep_href_link(FILENAME_CONFIGURATION, tep_get_all_get_params(array('action','flag','fID')) . 'action=setflag&flag=0&fID=' . $fields->fields_id) . '">' . tep_image(DIR_WS_ICONS . 'icon_status_red_light.gif', IMAGE_ICON_STATUS_RED_LIGHT) . '</a>';
- } else {
- echo '<a href="' . tep_href_link(FILENAME_CONFIGURATION, tep_get_all_get_params(array('action','flag','fID')) . 'action=setflag&flag=1&fID=' . $fields->fields_id ) . '">' . tep_image(DIR_WS_ICONS . 'icon_status_green_light.gif', IMAGE_ICON_STATUS_GREEN_LIGHT) . '</a> ' . tep_image(DIR_WS_ICONS . 'icon_status_red.gif', IMAGE_ICON_STATUS_RED);
- }
- ?>
- </td>
- <td class="row_action">
- <?php echo modcustextra::get_item_action($fields); ?>
- </td>
- </tr>
- <?php } ?>
- </table>
- </div>
+<div class="">
+
+ <p><?php echo __("text listing intro"); ?></p>
+
+ <table class="dataTable">
+ <thead>
+ <tr>
+ <th><?php echo __('table heading fields'); ?></th>
+ <th class="tcenter"><?php echo __('table heading type'); ?></th>
+ <th class="tcenter"><?php echo __('table heading visibility'); ?></th>
+ <th class="tcenter"><?php echo __('table heading group class'); ?></th>
+ <th class="tcenter"><?php echo __('table heading status'); ?></th>
+ <th class="row_action"><?php echo __('table heading action'); ?></th>
+ </tr>
+ </thead>
+ <tfoot>
+ <tr>
+ <td><?php echo modcustextra::$split->display_count(modcustextra::$fields_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, 1, __('text display number of fields')); ?></td>
+ <td colspan="2"><?php echo modcustextra::$split->display_links(modcustextra::$fields_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, 1);; ?></td>
+ </tr>
+ </tfoot>
+ <?php foreach(modcustextra::$list as $fields): ?>
+ <tr class="dataTableRow <?php if(isset( modcustextra::$fInfo) && is_object( modcustextra::$fInfo) && modcustextra::$fInfo->fields_id == modcustextra::$cID) echo "Selected" ?>" >
+ <td><?php echo $fields->fields_name; ?></td>
+ <td><?php echo modcustextra::get_item_type($fields->fields_input_type, true); ?></td>
+ <td><?php echo modcustextra::get_item_visibility($fields->fields_admin, true); ?></td>
+ <td><?php echo $fields->fields_group_class; ?></td>
+ <td class="tcenter">
+ <?php echo modcustextra::get_item_status($fields); ?>
+ </td>
+ <td class="row_action">
+ <?php echo modcustextra::get_item_action($fields); ?>
+ </td>
+ </tr>
+ <?php endforeach; ?>
+ </table>
+</div>
\ No newline at end of file
Modified: trunk/catalog/admin/includes/languages/fr_FR/modules/configuration/modcustextra.txt
===================================================================
--- trunk/catalog/admin/includes/languages/fr_FR/modules/configuration/modcustextra.txt 2012-02-25 14:01:13 UTC (rev 4043)
+++ trunk/catalog/admin/includes/languages/fr_FR/modules/configuration/modcustextra.txt 2012-02-26 11:55:35 UTC (rev 4044)
@@ -13,37 +13,65 @@
$lang['text heading new field']="Nouveau champ" ;
$lang['text heading edit field']="Éditer le champ" ;
$lang['text heading delete field']="Supprimer le champ" ;
-$lang['table heading status']="Status" ;
-$lang['table heading action']="Action" ;
-$lang['table heading visibility']="Visible" ;
-$lang['table heading group class']="Class" ;
-$lang['text field']="Champ : " ;
-$lang['text field input type']="Type de champ : " ;
-$lang['text field required status']="Status 'requis' : " ;
-$lang['text field required email']="Affichage dans l'Email : " ;
-$lang['text field status email']="Envoyer ce champ dans l'Email : " ;
-$lang['text input field']=" champs standard" ;
-$lang['text field key']="Clef : " ;
-$lang['text field input key']="la clef de ce champ, pour plus de facilité d'usage " ;
-$lang['text field fields_admin']="Visibilité : " ;
-$lang['text field input fields_admin']="le mode de visibilité de ce champ " ;
-$lang['text field fields_special_mod']="Propriété du module: " ;
-$lang['text field input fields_special_mod']="Le module propriétaire de ce champ" ;
-$lang['text field fields_group_class']="Class du champ: " ;
-$lang['text field input fields_group_class']="La class du champ, les champs seront affichés , groupés par class " ;
-$lang['text textarea field']=" zone de texte" ;
-$lang['text radio field']=" bouton radio" ;
-$lang['text check field']=" case à cocher" ;
-$lang['text down field']=" Liste de selection" ;
-$lang['text hidden field']=" caché" ;
-$lang['text field input value']="Les valeurs du champ" ;
-$lang['text field input value help']="Les différentes valeurs du champ doivent être separés par un saut de ligne" ;
-$lang['text field size']="Valeur minimum : " ;
-$lang['text new intro']="Remplissez les informations suivantes pour le nouveau champ" ;
-$lang['text edit intro']="Merci de faire les changements nécessaires" ;
-$lang['text field name']="Nom du champ : " ;
-$lang['heading title option delete']="Vous souhaitez supprimer ce champ !" ;
-$lang['text delete intro']="Êtes-vous sûr de vouloir supprimer ce champ ?" ;
-$lang['text display number of fields']="Afficher %s sur %s" ;
+/* listing */
+ $lang['text listing intro']="Vous pouvez gerer dans cette section les champs supplementaire des clients/membres. Il vous est possible de modifier les caratéristiques de ces champs. vous pouvez aussi voir les champs creer est gerer par des modules qui exploitent ces champs." ;
+ $lang['table heading status']="Status" ;
+ $lang['table heading action']="Action" ;
+ $lang['table heading visibility']="Visible" ;
+ $lang['table heading group class']="Class" ;
+ $lang['table heading type']="Type" ;
+
+/* Edit */
+ $lang['tab advanced extra field']="Réglages avancés" ;
+ $lang['tab base extra field']="Caractéristiques" ;
+
+ $lang['legend check field']="Contrôle du formulaire" ;
+
+ $lang['text edit intro']="" ;
+ $lang['text field name']="Champ : " ;
+ $lang['text field format']="Format : " ;
+ $lang['text field input type']="Type de champ : " ;
+ $lang['text field required status']="Champs obligatoire (requis) : " ;
+ $lang['text field required email']="Affichage dans l'Email : " ;
+ $lang['text field status email']="Envoyer ce champ dans l'Email : " ;
+ $lang['text input field']=" champs standard" ;
+ $lang['text field key']="Clef : " ;
+ $lang['text field input key']="la clef de ce champ, pour plus de facilité d'usage " ;
+ $lang['text field fields_admin']="Visibilité : " ;
+ $lang['text field input fields_admin']="le mode de visibilité de ce champ " ;
+ $lang['text field fields_special_mod']="Propriétaire du module: " ;
+ $lang['text field fields_special_mod help']="Le module propriétaire de ce champ; ce champs si il appartient a un module precis ne sera plus affiché dans l'affichage par defaut. " ;
+ $lang['text field input fields_special_mod']=
+ $lang['text field fields_group_class']="Class du champ: " ;
+ $lang['text field input fields_group_class']="La class du champ, les champs seront affichés , groupés par class " ;
+ $lang['text textarea field']=" zone de texte" ;
+ $lang['text radio field']=" bouton radio" ;
+ $lang['text check field']=" case à cocher" ;
+ $lang['text hidden field']=" caché" ;
+
+ $lang['text field input value']="La valeur par defaut du champ " ;
+ $lang['text field input value help']="Cette valeur sera affiché dans le champs si celui ci est vide" ;
+ $lang['text field input value multi']="La liste des valeurs de champs par choix (radio, case a cocher, liste de selection)" ;
+ $lang['text field input value help']="Les différentes valeurs du champ doivent être separés par un saut de ligne" ;
+
+ $lang['text field size']="nombre de caratères mininum : " ;
+ $lang['text field size help']="nombre de caratères mininum imposé lors des controle de formulaire " ;
+ $lang['text new intro']="Remplissez les informations suivantes pour le nouveau champ" ;
+
+ $lang['text field name']="Nom du champ : " ;
+ $lang['heading title option delete']="Vous souhaitez supprimer ce champ !" ;
+ $lang['text delete intro']="Êtes-vous sûr de vouloir supprimer ce champ ?" ;
+ $lang['text display number of fields']="Afficher %s sur %s" ;
+
+/* entry list */
+ $lang['entry list type input']="Champ classique" ;
+ $lang['entry list type textarea']="Champ texte" ;
+ $lang['entry list type radio']="Bouton radio" ;
+ $lang['entry list type hidden']="Champ caché" ;
+ $lang['entry list type checkbox']="Case à cocher" ;
+ $lang['entry list type checkbox multi']="Case à cocher (choix multiple)" ;
+ $lang['entry list type select']="Liste de selection" ;
+ $lang['entry list type select mutli']="Liste de selection (choix multiple)" ;
+
?>
\ No newline at end of file
Modified: trunk/catalog/admin/includes/modules/account/account_extra.php
===================================================================
--- trunk/catalog/admin/includes/modules/account/account_extra.php 2012-02-25 14:01:13 UTC (rev 4043)
+++ trunk/catalog/admin/includes/modules/account/account_extra.php 2012-02-26 11:55:35 UTC (rev 4044)
@@ -1,15 +1,14 @@
<?php
/**
- @licence GPL 2005-2011 The osCSS developers - osCSS Open Source E-commerce
+ @licence GPL 2005-2012 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 04/03/11, 09:10
+ @version 2.1.1
+ @date 22/02/2012, 09:10
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
@class account_extra
-
- Champs supplementaire pour les client et membre
+ @brief This module is use generic fields, not use for fields content one owner (for fields_special_mod is null )
*/
class account_extra
@@ -24,6 +23,7 @@
public static $cID;
/**
+ @brief constructor
*/
function __construct(){
$this->code = __CLASS__;
@@ -33,10 +33,11 @@
$this->enabled = true;
self::$cInfo = new objectInfo(array());
-
-// require_once(DIR_WS_FUNCTIONS.'lib.extra_fields.php');
}
+ /**
+ @brief action methode
+ */
public function check_action($actions){
global $languages_id;
$action=$actions['action'];
@@ -45,51 +46,75 @@
switch($action){
case 'insert':
case 'update':
- try{
- // BOF Customers extra fields
- $extra_fields_query = tep_db_query("select ce.fields_id, ce.fields_input_type, ce.fields_required_status, cei.fields_name, ce.fields_status, ce.fields_input_type, ce.fields_size from " . TABLE_EXTRA_FIELDS . " ce, " . TABLE_EXTRA_FIELDS_INFO . " cei where ce.fields_status=1 and ce.fields_required_status=1 and cei.fields_id=ce.fields_id and cei.languages_id =" . $languages_id);
- while($extra_fields = tep_db_fetch_array($extra_fields_query)){
- if(strlen($_POST['fields_' . $extra_fields['fields_id']])<$extra_fields['fields_size'])throw new Exception(sprintf(ENTRY_EXTRA_FIELDS_ERROR,$extra_fields['fields_name'],$extra_fields['fields_size']) );
- }
+ try{
+ // BOF Customers extra fields
+ $extra_fields_query = tep_db_query("select ce.fields_id, ce.fields_input_type, ce.fields_required_status, cei.fields_name, ce.fields_status, ce.fields_input_type, ce.fields_size from " . TABLE_EXTRA_FIELDS . " ce, " . TABLE_EXTRA_FIELDS_LABELS . " cei WHERE ce.fields_status=1 and ce.fields_required_status=1 and cei.fields_id=ce.fields_id and cei.languages_id ='". $languages_id ."' AND fields_special_mod='' ");
+ while($extra_fields = tep_db_fetch_array($extra_fields_query)){
- }catch(Exception $e){
- $messageStack->add($e->getMessage(), 'error');
- self::$error=true;
- }
+/**
+TODO Prendre en charge le type de champs pour le control
+*/
+ if(strlen($_POST['fields_' . $extra_fields['fields_id']])<$extra_fields['fields_size'])
+ throw new Exception(sprintf('entry extra fields (%s) error length %s',$extra_fields['fields_name'],$extra_fields['fields_size']) );
+ }
+
+ }catch(Exception $e){
+ $messageStack->add_session($e->getMessage(), 'error');
+// self::$error=true;
+ }
break;
}
return $actions;
}
+ /**
+ @brief methode call by sqlcustomer, and process after update master table customers
+ */
public function after_update($customers_id) {
// global $customers_id;
//! This function returns an array with variables to update into TABLE_ADDRESS_BOOK
tep_db_query("delete from " . TABLE_CUSTOMERS_TO_EXTRA_FIELDS . " where customers_id=" . (int)$customers_id);
- $extra_fields_query = tep_db_query("select ce.fields_id from " . TABLE_EXTRA_FIELDS . " ce where ce.fields_status=1 ");
+
+ $extra_fields_query = tep_db_query("select ce.fields_id , fields_input_type as type from " . TABLE_EXTRA_FIELDS . " ce where ce.fields_status=1 AND fields_special_mod='' ");
+// print_r(($_POST));
+
+ $val='';
while($extra_fields = tep_db_fetch_array($extra_fields_query)) {
- if(isset($_POST['fields_' . $extra_fields['fields_id']])){
- $sql_data_array = array('customers_id' => (int)$customers_id,
- 'fields_id' => $extra_fields['fields_id'],
- 'value' => $_POST['fields_' . $extra_fields['fields_id']]);
- }
- else {
- $sql_data_array = array('customers_id' => (int)$customers_id,
- 'fields_id' => $extra_fields['fields_id'],
- 'value' => '');
- $is_add = false;
- for($i = 1; $i <= $_POST['fields_' . $extra_fields['fields_id'] . '_total']; $i++) {
- if(isset($_POST['fields_' . $extra_fields['fields_id'] . '_' . $i])) {
- if($is_add) $sql_data_array['value'] .= "\n";
- else $is_add = true;
- $sql_data_array['value'] .= $_POST['fields_' . $extra_fields['fields_id'] . '_' . $i];
- }
- }
- }
- tep_db_perform(TABLE_CUSTOMERS_TO_EXTRA_FIELDS, $sql_data_array);
+ switch((int)$extra_fields['type']) {
+
+ case 6: // select mutli
+ case 7: // checkbox mutli
+ case 3: // checkbox
+ $cnt = 1;
+ foreach($_POST['fields_' . $extra_fields['fields_id']] as $k=>$item) {
+ if($item =='on' ) $val .= $k.',';
+ }
+ break;
+
+
+
+ case 0: // classic
+ case 1: // textarea
+ case 2: // radio
+ case 4: // select
+ case 5: // hidden
+ default:
+ $val = ( (isset($_POST['fields_' . $extra_fields['fields_id']])) ? tep_db_prepare_input($_POST['fields_' . $extra_fields['fields_id']]) : '') ;
+ }
+
+
+ $sql_data_array = array(
+ 'customers_id' => (int)$customers_id,
+ 'fields_id' => $extra_fields['fields_id'],
+ 'value' => $val
+ );
+
+ tep_db_perform(TABLE_CUSTOMERS_TO_EXTRA_FIELDS, $sql_data_array);
}
+// exit;
return array();
}
@@ -120,69 +145,58 @@
public static function get_extra_fields($customer_id,$languages_id){
- $extra_fields_query = tep_db_query("select ce.fields_id, ce.fields_input_type, ce.fields_input_value, ce.fields_required_status, cei.fields_name, ce.fields_status, ce.fields_input_type from " . TABLE_EXTRA_FIELDS . " ce, " . TABLE_EXTRA_FIELDS_INFO . " cei where ce.fields_status=1 and cei.fields_id=ce.fields_id and cei.languages_id =" . $languages_id." and fields_special_mod='' order by ce.fields_group_class");
- $extra_fields_string ='';
+ // ne liste que les champs qui n'appartiennent pas a un modules precis
+ $extra_fields_query = tep_db_query("select ce.fields_id, ce.fields_input_type, ce.fields_input_value, ce.fields_required_status, cei.fields_name,cei.fields_format as format, ce.fields_status, ce.fields_input_type from " . TABLE_EXTRA_FIELDS . " ce, " . TABLE_EXTRA_FIELDS_LABELS . " cei where ce.fields_status=1 and cei.fields_id=ce.fields_id and cei.languages_id =" . $languages_id." and fields_special_mod='' order by ce.fields_group_class");
+ $extra_fields_string = '';
+
if(tep_db_num_rows($extra_fields_query)>0){
- while($extra_fields = tep_db_fetch_array($extra_fields_query)){
- $extra_fields_string .= '<p class="block_input">';
- $value='';
- if(isset($customer_id)){
- $value_query = tep_db_query("select value from " . TABLE_CUSTOMERS_TO_EXTRA_FIELDS . " where customers_id=" . $customer_id . " and fields_id=" . $extra_fields['fields_id']);
- $value_info = tep_db_fetch_array($value_query);
- $value_list = explode("\n", $value_info['value']);
- for($i = 0, $n = sizeof($value_list); $i < $n; $i++) {
- $value_list[$i] = trim($value_list[$i]);
- }
- $value = $value_list[0];
- }
- $extra_fields_string .='<label for="fields_' . $extra_fields['fields_id'].'">' . $extra_fields['fields_name'] . ': </label>';
+ while($extra_fields = tep_db_fetch_array($extra_fields_query)){
+ $value='';
+ $input ='';
- $select_values_list = explode("\n", $extra_fields['fields_input_value']);
- $select_values = array();
- foreach($select_values_list as $item) {
- $item = trim($item);
- $select_values[] = array('id' => $item, 'text' => $item);
- }
- switch((int)$extra_fields['fields_input_type']) {
- case 0: $extra_fields_string .= tep_draw_input_field('fields_' . $extra_fields['fields_id'],'fields_' . $extra_fields['fields_id'],$value). (($extra_fields['fields_required_status']==1) ? '<span class="inputRequirement">*</span>': ''); break;
- case 1: $extra_fields_string .= tep_draw_textarea_field('fields_' . $extra_fields['fields_id'], 'soft', 50, 6,$value,'style="width:400px;"'). (($extra_fields['fields_required_status']==1) ? '<span class="inputRequirement">*</span>': ''); break;
- case 2:
- foreach($select_values_list as $item) {
- $item = trim($item);
- $extra_fields_string .= tep_draw_radio_field('fields_' . $extra_fields['fields_id'], 'radio', $item, (($value == $item)?(true):(false))).$item. (($extra_fields['fields_required_status']==1) ? '<span class="inputRequirement">*</span>': '').'<br />';
- $extra_fields['fields_required_status'] = 0;
- }
- break;
- case 3:
- $cnt = 1;
- foreach($select_values_list as $item) {
- $item = trim($item);
- $extra_fields_string .= tep_draw_checkbox_field('fields_' . $extra_fields['fields_id'] . '_' . ($cnt++), 'checkbox', $item, ((@in_array($item, $value_list))?(true):(false))).$item. (($extra_fields['fields_required_status']==1) ? '<span class="inputRequirement">*</span>': '').'<br />';
- $extra_fields['fields_required_status'] = 0;
- }
- $extra_fields_string .= tep_draw_hidden_field('fields_' . $extra_fields['fields_id'] . '_total' , $cnt);
- break;
- case 4: $extra_fields_string .= tep_draw_pull_down_menu('fields_' . $extra_fields['fields_id'], $select_values, $value).(($extra_fields['fields_required_status']==1) ? '<span class="inputRequirement">*</span>': '');
- break;
- case 5:
- $extra_fields_string .= tep_draw_hidden_field('fields_' . $extra_fields['fields_id'] , $value);
- break;
- default: $extra_fields_string .= tep_draw_input_field('fields_' . $extra_fields['fields_id'],$value). (($extra_fields['fields_required_status']==1) ? '<span class="inputRequirement">*</span>': '');
- }
+ if(isset($customer_id)){
+ $value_query = tep_db_query("select value from " . TABLE_CUSTOMERS_TO_EXTRA_FIELDS . " where customers_id=" . $customer_id . " and fields_id=" . $extra_fields['fields_id']);
+ $value_info = tep_db_fetch_array($value_query);
+ $value_list = explode("\n", $value_info['value']);
+ for($i = 0, $n = sizeof($value_list); $i < $n; $i++) {
+ $value_list[$i] = trim($value_list[$i]);
+ }
+ $value = $value_list[0];
+ }
- $extra_fields_string .='</p>';
- }
+ $robj = new stdClass();
+ $robj->id = (int) $extra_fields['fields_id'];
+ $robj->name = (string) $extra_fields['fields_name'];
+ $robj->input_type = (int) $extra_fields['fields_input_type'];
+ $robj->input_value = $value;
+ $robj->input_format = $extra_fields['format'];
+ $robj->required_status = $extra_fields['fields_required_status'];
+
+ $robj->values_list = explode("\n", $extra_fields['fields_input_value']);
+ $robj->select_values = array();
+ foreach($robj->values_list as $item)
+ {
+ $item = trim($item);
+ $robj->select_values[] = array('id' => $item, 'text' => $item);
+ }
+
+ $label = ExtraUtility::FormatLabels($robj, customers::$processed);
+ $input = ExtraUtility::FormatFields($robj, customers::$processed);
+
+ $extra_fields_string .= str_replace( array('%label%', '%input%'), array($label, $input) , '<p class="block_input input-one">'.$extra_fields['format'].'</p>' ) ;
+ }
+
}
return $extra_fields_string;
}
public static function get_customers_extra_fields_name($fields_id, $language_id) {
- $fields_query = tep_db_query("select fields_name from " . TABLE_EXTRA_FIELDS_INFO . " where fields_id = '" . (int)$fields_id . "' and languages_id = '" . (int)$language_id . "'");
+ $fields_query = tep_db_query("select fields_name from " . TABLE_EXTRA_FIELDS_LABELS . " where fields_id = '" . (int)$fields_id . "' and languages_id = '" . (int)$language_id . "'");
$fields = tep_db_fetch_array($fields_query);
return $fields['fields_name'];
Modified: trunk/catalog/admin/includes/modules/configuration/modcustextra.php
===================================================================
--- trunk/catalog/admin/includes/modules/configuration/modcustextra.php 2012-02-25 14:01:13 UTC (rev 4043)
+++ trunk/catalog/admin/includes/modules/configuration/modcustextra.php 2012-02-26 11:55:35 UTC (rev 4044)
@@ -1,10 +1,10 @@
<?php
/**
- @licence GPL 2005-2011 The osCSS developers - osCSS Open Source E-commerce
+ @licence GPL 2005-2012 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 24/10/11, 15:46
+ @date 26/02/2012, 15:46
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
@class modcustextra
@@ -51,118 +51,137 @@
/**
- Action en remplacement des action par defaut
+ @fn draw_action()
+ @brief Action en remplacement des action par defaut
*/
public function draw_action(){
global $action,$messageStack;
- if (tep_not_null($action)) {
- switch ($action) {
+
+ switch ($action) {
case 'insert':
case 'update':
- if (isset(self::$cID)) $fields_id = tep_db_prepare_input(self::$cID);
- $fields_input_type = tep_db_prepare_input($_POST['fields_input_type']);
- $fields_input_value = tep_db_prepare_input($_POST['fields_input_value']);
- $fields_required_status = tep_db_prepare_input($_POST['fields_required_status']);
- $fields_size = tep_db_prepare_input($_POST['fields_size']);
- $fields_required_email = tep_db_prepare_input($_POST['fields_required_email']);
- $fields_key = tep_db_prepare_input($_POST['fields_key']);
- $fields_admin = tep_db_prepare_input($_POST['fields_admin']);
- $fields_special_mod = tep_db_prepare_input($_POST['fields_special_mod']);
- $fields_group_class = tep_db_prepare_input($_POST['fields_group_class']);
- $sql_data_array = array('fields_status' => 1,
- 'fields_input_type' => $fields_input_type,
- 'fields_input_value' => $fields_input_value,
- 'fields_required_status' => $fields_required_status,
- 'fields_size' => $fields_size,
- 'fields_required_email' => $fields_required_email,
- 'fields_key' => $fields_key,
- 'fields_admin' => $fields_admin,
- 'fields_special_mod' => $fields_special_mod,
- 'fields_group_class' => $fields_group_class);
+ $sql_data_array = array(
+ 'status' => 1,
+ 'input...
[truncated message content] |
|
From: <ay...@us...> - 2012-02-25 14:01:20
|
Revision: 4043
http://oscss.svn.sourceforge.net/oscss/?rev=4043&view=rev
Author: ayatus
Date: 2012-02-25 14:01:13 +0000 (Sat, 25 Feb 2012)
Log Message:
-----------
FS#967
Suppression de PIE.htc
Modified Paths:
--------------
trunk/catalog/install/templates/main_page/stylesheet.css
Removed Paths:
-------------
trunk/catalog/install/templates/main_page/PIE.htc
Deleted: trunk/catalog/install/templates/main_page/PIE.htc
===================================================================
--- trunk/catalog/install/templates/main_page/PIE.htc 2012-02-25 10:20:08 UTC (rev 4042)
+++ trunk/catalog/install/templates/main_page/PIE.htc 2012-02-25 14:01:13 UTC (rev 4043)
@@ -1,81 +0,0 @@
-<!--
-PIE: CSS3 rendering for IE
-Version 1.0beta4
-http://css3pie.com
-Dual-licensed for use under the Apache License Version 2.0 or the General Public License (GPL) Version 2.
--->
-<PUBLIC:COMPONENT lightWeight="true">
-<PUBLIC:ATTACH EVENT="oncontentready" FOR="element" ONEVENT="init()" />
-<PUBLIC:ATTACH EVENT="ondocumentready" FOR="element" ONEVENT="init()" />
-<PUBLIC:ATTACH EVENT="ondetach" FOR="element" ONEVENT="cleanup()" />
-
-<script type="text/javascript">
-var doc = element.document;var g=window.PIE;
-if(!g){g=window.PIE={F:"-pie-",Sa:"Pie",Pa:"pie_",Jb:{TD:1,TH:1}};try{doc.execCommand("BackgroundImageCache",false,true)}catch(L){}g.J=function(){for(var a=4,b=doc.createElement("div"),c=b.getElementsByTagName("i");b.innerHTML="<!--[if gt IE "+ ++a+"]><i></i><![endif]--\>",c[0];);return a}();if(g.J===6)g.F=g.F.replace(/^-/,"");g.Ab=doc.documentMode||g.J;(function(){var a,b=0,c={};g.p={Ga:function(e){if(!a){a=doc.createDocumentFragment();a.namespaces.add("css3vml","urn:schemas-microsoft-com:vml")}return a.createElement("css3vml:"+e)},
-ta:function(e){return e&&e._pieId||(e._pieId=++b)},fb:function(e){var f,h,j,d,i=arguments;f=1;for(h=i.length;f<h;f++){d=i[f];for(j in d)if(d.hasOwnProperty(j))e[j]=d[j]}return e},Pb:function(e,f,h){var j=c[e],d,i;if(j)Object.prototype.toString.call(j)==="[object Array]"?j.push([f,h]):f.call(h,j);else{i=c[e]=[[f,h]];d=new Image;d.onload=function(){j=c[e]={i:d.width,f:d.height};for(var k=0,m=i.length;k<m;k++)i[k][0].call(i[k][1],j);d.onload=null};d.src=e}}}})();g.ia=function(){this.hb=[];this.Db={}};
-g.ia.prototype={aa:function(a){var b=g.p.ta(a),c=this.Db,e=this.hb;if(!(b in c)){c[b]=e.length;e.push(a)}},Ma:function(a){a=g.p.ta(a);var b=this.Db;if(a&&a in b){delete this.hb[b[a]];delete b[a]}},Ia:function(){for(var a=this.hb,b=a.length;b--;)a[b]&&a[b]()}};g.ya=new g.ia;g.ya.Tc=function(){var a=this;if(!a.Uc){setInterval(function(){a.Ia()},250);a.Uc=1}};g.G=new g.ia;window.attachEvent("onbeforeunload",function(){g.G.Ia()});g.G.Ea=function(a,b,c){a.attachEvent(b,c);this.aa(function(){a.detachEvent(b,
-c)})};(function(){function a(){g.za.Ia()}g.za=new g.ia;g.G.Ea(window,"onresize",a)})();(function(){function a(){g.Ra.Ia()}g.Ra=new g.ia;g.G.Ea(window,"onscroll",a);g.za.aa(a)})();(function(){function a(){c=g.Qa.wc()}function b(){if(c){for(var e=0,f=c.length;e<f;e++)g.attach(c[e]);c=0}}var c;g.G.Ea(window,"onbeforeprint",a);g.G.Ea(window,"onafterprint",b)})();g.hd=function(){function a(i){this.V=i}var b=doc.createElement("length-calc"),c=doc.documentElement,e=b.style,f={},h=["mm","cm","in","pt","pc"],
-j=h.length,d={};e.position="absolute";e.top=e.left="-9999px";for(c.appendChild(b);j--;){b.style.width="100"+h[j];f[h[j]]=b.offsetWidth/100}c.removeChild(b);a.prototype={ib:/(px|em|ex|mm|cm|in|pt|pc|%)$/,vb:function(){var i=this.Lc;if(i===void 0)i=this.Lc=parseFloat(this.V);return i},ab:function(){var i=this.ad;if(!i)i=this.ad=(i=this.V.match(this.ib))&&i[0]||"px";return i},a:function(i,k){var m=this.vb(),l=this.ab();switch(l){case "px":return m;case "%":return m*(typeof k==="function"?k():k)/100;
-case "em":return m*this.tb(i);case "ex":return m*this.tb(i)/2;default:return m*f[l]}},tb:function(i){var k=i.currentStyle.fontSize;if(k.indexOf("px")>0)return parseFloat(k);else{b.style.width="1em";i.appendChild(b);k=b.offsetWidth;b.parentNode===i&&i.removeChild(b);return k}}};g.k=function(i){return d[i]||(d[i]=new a(i))};return a}();g.Na=function(){function a(f){this.U=f}var b=g.k("50%"),c={top:1,center:1,bottom:1},e={left:1,center:1,right:1};a.prototype={Dc:function(){if(!this.sb){var f=this.U,
-h=f.length,j=g.u,d=j.ja,i=g.k("0");d=d.fa;i=["left",i,"top",i];if(h===1){f.push(new j.Ta(d,"center"));h++}if(h===2){d&(f[0].h|f[1].h)&&f[0].d in c&&f[1].d in e&&f.push(f.shift());if(f[0].h&d)if(f[0].d==="center")i[1]=b;else i[0]=f[0].d;else if(f[0].Y())i[1]=g.k(f[0].d);if(f[1].h&d)if(f[1].d==="center")i[3]=b;else i[2]=f[1].d;else if(f[1].Y())i[3]=g.k(f[1].d)}this.sb=i}return this.sb},coords:function(f,h,j){var d=this.Dc(),i=d[1].a(f,h);f=d[3].a(f,j);return{x:d[0]==="right"?h-i:i,y:d[2]==="bottom"?
-j-f:f}}};return a}();g.Rb=function(){function a(b){this.V=b}a.prototype={ib:/[a-z]+$/i,ab:function(){return this.lc||(this.lc=this.V.match(this.ib)[0].toLowerCase())},vc:function(){var b=this.fc,c;if(b===undefined){b=this.ab();c=parseFloat(this.V,10);b=this.fc=b==="deg"?c:b==="rad"?c/Math.PI*180:b==="grad"?c/400*360:b==="turn"?c*360:0}return b}};return a}();g.$b=function(){function a(c){this.V=c}var b={};a.Sc=/\s*rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d+|\d*\.\d+)\s*\)\s*/;a.gb=
-{aliceblue:"F0F8FF",antiquewhite:"FAEBD7",aqua:"0FF",aquamarine:"7FFFD4",azure:"F0FFFF",beige:"F5F5DC",bisque:"FFE4C4",black:"000",blanchedalmond:"FFEBCD",blue:"00F",blueviolet:"8A2BE2",brown:"A52A2A",burlywood:"DEB887",cadetblue:"5F9EA0",chartreuse:"7FFF00",chocolate:"D2691E",coral:"FF7F50",cornflowerblue:"6495ED",cornsilk:"FFF8DC",crimson:"DC143C",cyan:"0FF",darkblue:"00008B",darkcyan:"008B8B",darkgoldenrod:"B8860B",darkgray:"A9A9A9",darkgreen:"006400",darkkhaki:"BDB76B",darkmagenta:"8B008B",darkolivegreen:"556B2F",
-darkorange:"FF8C00",darkorchid:"9932CC",darkred:"8B0000",darksalmon:"E9967A",darkseagreen:"8FBC8F",darkslateblue:"483D8B",darkslategray:"2F4F4F",darkturquoise:"00CED1",darkviolet:"9400D3",deeppink:"FF1493",deepskyblue:"00BFFF",dimgray:"696969",dodgerblue:"1E90FF",firebrick:"B22222",floralwhite:"FFFAF0",forestgreen:"228B22",fuchsia:"F0F",gainsboro:"DCDCDC",ghostwhite:"F8F8FF",gold:"FFD700",goldenrod:"DAA520",gray:"808080",green:"008000",greenyellow:"ADFF2F",honeydew:"F0FFF0",hotpink:"FF69B4",indianred:"CD5C5C",
-indigo:"4B0082",ivory:"FFFFF0",khaki:"F0E68C",lavender:"E6E6FA",lavenderblush:"FFF0F5",lawngreen:"7CFC00",lemonchiffon:"FFFACD",lightblue:"ADD8E6",lightcoral:"F08080",lightcyan:"E0FFFF",lightgoldenrodyellow:"FAFAD2",lightgreen:"90EE90",lightgrey:"D3D3D3",lightpink:"FFB6C1",lightsalmon:"FFA07A",lightseagreen:"20B2AA",lightskyblue:"87CEFA",lightslategray:"789",lightsteelblue:"B0C4DE",lightyellow:"FFFFE0",lime:"0F0",limegreen:"32CD32",linen:"FAF0E6",magenta:"F0F",maroon:"800000",mediumauqamarine:"66CDAA",
-mediumblue:"0000CD",mediumorchid:"BA55D3",mediumpurple:"9370D8",mediumseagreen:"3CB371",mediumslateblue:"7B68EE",mediumspringgreen:"00FA9A",mediumturquoise:"48D1CC",mediumvioletred:"C71585",midnightblue:"191970",mintcream:"F5FFFA",mistyrose:"FFE4E1",moccasin:"FFE4B5",navajowhite:"FFDEAD",navy:"000080",oldlace:"FDF5E6",olive:"808000",olivedrab:"688E23",orange:"FFA500",orangered:"FF4500",orchid:"DA70D6",palegoldenrod:"EEE8AA",palegreen:"98FB98",paleturquoise:"AFEEEE",palevioletred:"D87093",papayawhip:"FFEFD5",
-peachpuff:"FFDAB9",peru:"CD853F",pink:"FFC0CB",plum:"DDA0DD",powderblue:"B0E0E6",purple:"800080",red:"F00",rosybrown:"BC8F8F",royalblue:"4169E1",saddlebrown:"8B4513",salmon:"FA8072",sandybrown:"F4A460",seagreen:"2E8B57",seashell:"FFF5EE",sienna:"A0522D",silver:"C0C0C0",skyblue:"87CEEB",slateblue:"6A5ACD",slategray:"708090",snow:"FFFAFA",springgreen:"00FF7F",steelblue:"4682B4",tan:"D2B48C",teal:"008080",thistle:"D8BFD8",tomato:"FF6347",turquoise:"40E0D0",violet:"EE82EE",wheat:"F5DEB3",white:"FFF",
-whitesmoke:"F5F5F5",yellow:"FF0",yellowgreen:"9ACD32"};a.prototype={parse:function(){if(!this.Ca){var c=this.V,e;if(e=c.match(a.Sc)){this.Ca="rgb("+e[1]+","+e[2]+","+e[3]+")";this.qb=parseFloat(e[4])}else{if((e=c.toLowerCase())in a.gb)c="#"+a.gb[e];this.Ca=c;this.qb=c==="transparent"?0:1}}},O:function(c){this.parse();return this.Ca==="currentColor"?c.currentStyle.color:this.Ca},la:function(){this.parse();return this.qb}};g.pa=function(c){return b[c]||(b[c]=new a(c))};return a}();g.u=function(){function a(c){this.Ha=
-c;this.ch=0;this.U=[];this.wa=0}var b=a.ja={xa:1,ob:2,ea:4,ac:8,pb:16,fa:32,A:64,ga:128,ha:256,Aa:512,dc:1024,URL:2048};a.Ta=function(c,e){this.h=c;this.d=e};a.Ta.prototype={db:function(){return this.h&b.A||this.h&b.ga&&this.d==="0"},Y:function(){return this.db()||this.h&b.Aa}};a.prototype={dd:/\s/,Mc:/^[\+\-]?(\d*\.)?\d+/,url:/^url\(\s*("([^"]*)"|'([^']*)'|([!#$%&*-~]*))\s*\)/i,zb:/^\-?[_a-z][\w-]*/i,Yc:/^("([^"]*)"|'([^']*)')/,Fc:/^#([\da-f]{6}|[\da-f]{3})/i,bd:{px:b.A,em:b.A,ex:b.A,mm:b.A,cm:b.A,
-"in":b.A,pt:b.A,pc:b.A,deg:b.xa,rad:b.xa,grad:b.xa},sc:{rgb:1,rgba:1,hsl:1,hsla:1},next:function(c){function e(t,n){t=new a.Ta(t,n);if(!c){k.U.push(t);k.wa++}return t}function f(){k.wa++;return null}var h,j,d,i,k=this;if(this.wa<this.U.length)return this.U[this.wa++];for(;this.dd.test(this.Ha.charAt(this.ch));)this.ch++;if(this.ch>=this.Ha.length)return f();j=this.ch;h=this.Ha.substring(this.ch);d=h.charAt(0);switch(d){case "#":if(i=h.match(this.Fc)){this.ch+=i[0].length;return e(b.ea,i[0])}break;
-case '"':case "'":if(i=h.match(this.Yc)){this.ch+=i[0].length;return e(b.dc,i[2]||i[3]||"")}break;case "/":case ",":this.ch++;return e(b.ha,d);case "u":if(i=h.match(this.url)){this.ch+=i[0].length;return e(b.URL,i[2]||i[3]||i[4]||"")}}if(i=h.match(this.Mc)){d=i[0];this.ch+=d.length;if(h.charAt(d.length)==="%"){this.ch++;return e(b.Aa,d+"%")}if(i=h.substring(d.length).match(this.zb)){d+=i[0];this.ch+=i[0].length;return e(this.bd[i[0].toLowerCase()]||b.ac,d)}return e(b.ga,d)}if(i=h.match(this.zb)){d=
-i[0];this.ch+=d.length;if(d.toLowerCase()in g.$b.gb||d==="currentColor")return e(b.ea,d);if(h.charAt(d.length)==="("){this.ch++;if(d.toLowerCase()in this.sc){h=function(t){return t&&t.h&b.ga};i=function(t){return t&&t.h&(b.ga|b.Aa)};var m=function(t,n){return t&&t.d===n},l=function(){return k.next(1)};if((d.charAt(0)==="r"?i(l()):h(l()))&&m(l(),",")&&i(l())&&m(l(),",")&&i(l())&&(d==="rgb"||d==="hsa"||m(l(),",")&&h(l()))&&m(l(),")"))return e(b.ea,this.Ha.substring(j,this.ch));return f()}return e(b.pb,
-d)}return e(b.fa,d)}this.ch++;return e(b.ob,d)},z:function(){return this.U[this.wa-- -2]},all:function(){for(;this.next(););return this.U},da:function(c,e){for(var f=[],h,j;h=this.next();){if(c(h)){j=true;this.z();break}f.push(h)}return e&&!j?null:f}};return a}();var M=function(a){this.e=a};M.prototype={K:0,Qc:function(){var a=this.Ua,b;return!a||(b=this.o())&&(a.x!==b.x||a.y!==b.y)},Vc:function(){var a=this.Ua,b;return!a||(b=this.o())&&(a.i!==b.i||a.f!==b.f)},ub:function(){var a=this.e.getBoundingClientRect();
-return{x:a.left,y:a.top,i:a.right-a.left,f:a.bottom-a.top}},o:function(){return this.K?this.Da||(this.Da=this.ub()):this.ub()},Ec:function(){return!!this.Ua},Ja:function(){++this.K},La:function(){if(!--this.K){if(this.Da)this.Ua=this.Da;this.Da=null}}};(function(){function a(b){var c=g.p.ta(b);return function(){if(this.K){var e=this.rb||(this.rb={});return c in e?e[c]:(e[c]=b.call(this))}else return b.call(this)}}g.s={K:0,$:function(b){function c(e){this.e=e}g.p.fb(c.prototype,g.s,b);c.kc={};return c},
-m:function(){var b=this.qa(),c=this.constructor.kc;return b?b in c?c[b]:(c[b]=this.ba(b)):null},qa:a(function(){var b=this.e,c=this.constructor,e=b.style;b=b.currentStyle;var f=this.na,h=this.va,j=c.ic||(c.ic=g.F+f);c=c.jc||(c.jc=g.Sa+h.charAt(0).toUpperCase()+h.substring(1));return e[c]||b.getAttribute(j)||e[h]||b.getAttribute(f)}),g:a(function(){return!!this.m()}),D:a(function(){var b=this.qa(),c=b!==this.gc;this.gc=b;return c}),ma:a,Ja:function(){++this.K},La:function(){--this.K||delete this.rb}}})();
-g.Tb=g.s.$({na:g.F+"background",va:g.Sa+"Background",nc:{scroll:1,fixed:1,local:1},Ka:{"repeat-x":1,"repeat-y":1,repeat:1,"no-repeat":1},Nc:{"padding-box":1,"border-box":1,"content-box":1},rc:{"padding-box":1,"border-box":1},Rc:{top:1,right:1,bottom:1,left:1,center:1},Wc:{contain:1,cover:1},ba:function(a){function b(u){return u.Y()||u.h&i&&u.d in t}function c(u){return u.Y()&&g.k(u.d)||u.d==="auto"&&"auto"}var e=this.e.currentStyle,f,h,j=g.u.ja,d=j.ha,i=j.fa,k=j.ea,m,l,t=this.Rc,n,p,s=null;if(this.$a()){a=
-new g.u(a);s={M:[]};for(h={};f=a.next();){m=f.h;l=f.d;if(!h.P&&m&j.pb&&l==="linear-gradient"){n={ca:[],P:l};for(p={};f=a.next();){m=f.h;l=f.d;if(m&j.ob&&l===")"){p.color&&n.ca.push(p);n.ca.length>1&&g.p.fb(h,n);break}if(m&k){if(n.Xa||n.bb){f=a.z();if(f.h!==d)break;a.next()}p={color:g.pa(l)};f=a.next();if(f.Y())p.Fb=g.k(f.d);else a.z()}else if(m&j.xa&&!n.Xa&&!p.color&&!n.ca.length)n.Xa=new g.Rb(f.d);else if(b(f)&&!n.bb&&!p.color&&!n.ca.length){a.z();n.bb=new g.Na(a.da(function(u){return!b(u)},false))}else if(m&
-d&&l===","){if(p.color){n.ca.push(p);p={}}}else break}}else if(!h.P&&m&j.URL){h.Cb=l;h.P="image"}else if(b(f)&&!h.size){a.z();h.Ya=new g.Na(a.da(function(u){return!b(u)},false))}else if(m&i)if(l in this.Ka)h.Bb=l;else if(l in this.Nc){h.kd=l;if(l in this.rc)h.clip=l}else{if(l in this.nc)h.jd=l}else if(m&k&&!s.color)s.color=g.pa(l);else if(m&d)if(l==="/"){f=a.next();m=f.h;l=f.d;if(m&i&&l in this.Wc)h.size=l;else if(l=c(f))h.size={i:l,f:c(a.next())||a.z()&&l}}else{if(l===","&&h.P){s.M.push(h);h={}}}else return null}h.P&&
-s.M.push(h)}else this.Nb(function(){var u=e.backgroundPositionX,w=e.backgroundPositionY,r=e.backgroundImage,o=e.backgroundColor;s={};if(o!=="transparent")s.color=g.pa(o);if(r!=="none")s.M=[{P:"image",Cb:(new g.u(r)).next().d,Bb:e.backgroundRepeat,Ya:new g.Na((new g.u(u+" "+w)).all())}]});return s&&(s.color||s.M&&s.M[0])?s:null},Nb:function(a){var b=this.e.runtimeStyle,c=b.backgroundImage,e=b.backgroundColor;if(c)b.backgroundImage="";if(e)b.backgroundColor="";a=a.call(this);if(c)b.backgroundImage=
-c;if(e)b.backgroundColor=e;return a},qa:g.s.ma(function(){return this.$a()||this.Nb(function(){var a=this.e.currentStyle;return a.backgroundColor+" "+a.backgroundImage+" "+a.backgroundRepeat+" "+a.backgroundPositionX+" "+a.backgroundPositionY})}),$a:g.s.ma(function(){var a=this.e;return a.style[this.va]||a.currentStyle.getAttribute(this.na)}),Eb:function(){var a=0;if(g.J<7){a=this.e;a=""+(a.style[g.Sa+"PngFix"]||a.currentStyle.getAttribute(g.F+"png-fix"))==="true"}return a},g:g.s.ma(function(){return(this.$a()||
-this.Eb())&&!!this.m()})});g.Xb=g.s.$({Ib:["Top","Right","Bottom","Left"],Kc:{thin:"1px",medium:"3px",thick:"5px"},ba:function(){var a={},b={},c={},e=false,f=true,h=true,j=true;this.Ob(function(){for(var d=this.e.currentStyle,i=0,k,m,l,t,n,p,s;i<4;i++){l=this.Ib[i];s=l.charAt(0).toLowerCase();k=b[s]=d["border"+l+"Style"];m=d["border"+l+"Color"];l=d["border"+l+"Width"];if(i>0){if(k!==t)h=false;if(m!==n)f=false;if(l!==p)j=false}t=k;n=m;p=l;c[s]=g.pa(m);l=a[s]=g.k(b[s]==="none"?"0":this.Kc[l]||l);if(l.a(this.e)>
-0)e=true}});return e?{nb:a,Zc:b,tc:c,ed:j,uc:f,$c:h}:null},qa:g.s.ma(function(){var a=this.e,b=a.currentStyle,c;a.tagName in g.Jb&&a.offsetParent.currentStyle.borderCollapse==="collapse"||this.Ob(function(){c=b.borderWidth+"|"+b.borderStyle+"|"+b.borderColor});return c}),Ob:function(a){var b=this.e.runtimeStyle,c=b.borderWidth,e=b.borderColor;if(c)b.borderWidth="";if(e)b.borderColor="";a=a.call(this);if(c)b.borderWidth=c;if(e)b.borderColor=e;return a}});(function(){g.Oa=g.s.$({na:"border-radius",
-va:"borderRadius",ba:function(b){var c=null,e,f,h,j,d=false;if(b){f=new g.u(b);var i=function(){for(var k=[],m;(h=f.next())&&h.Y();){j=g.k(h.d);m=j.vb();if(m<0)return null;if(m>0)d=true;k.push(j)}return k.length>0&&k.length<5?{tl:k[0],tr:k[1]||k[0],br:k[2]||k[0],bl:k[3]||k[1]||k[0]}:null};if(b=i()){if(h){if(h.h&g.u.ja.ha&&h.d==="/")e=i()}else e=b;if(d&&b&&e)c={x:b,y:e}}}return c}});var a=g.k("0");a={tl:a,tr:a,br:a,bl:a};g.Oa.Qb={x:a,y:a}})();g.Vb=g.s.$({na:"border-image",va:"borderImage",Ka:{stretch:1,
-round:1,repeat:1,space:1},ba:function(a){var b=null,c,e,f,h,j,d,i=0,k,m=g.u.ja,l=m.fa,t=m.ga,n=m.A,p=m.Aa;if(a){c=new g.u(a);b={};for(var s=function(r){return r&&r.h&m.ha&&r.d==="/"},u=function(r){return r&&r.h&l&&r.d==="fill"},w=function(){h=c.da(function(r){return!(r.h&(t|p))});if(u(c.next())&&!b.fill)b.fill=true;else c.z();if(s(c.next())){i++;j=c.da(function(){return!(e.h&(t|p|n))&&!(e.h&l&&e.d==="auto")});if(s(c.next())){i++;d=c.da(function(){return!(e.h&(t|n))})}}else c.z()};e=c.next();){a=e.h;
-f=e.d;if(a&(t|p)&&!h){c.z();w()}else if(u(e)&&!b.fill){b.fill=true;w()}else if(a&l&&this.Ka[f]&&!b.repeat){b.repeat={f:f};if(e=c.next())if(e.h&l&&this.Ka[e.d])b.repeat.kb=e.d;else c.z()}else if(a&m.URL&&!b.src)b.src=f;else return null}if(!b.src||!h||h.length<1||h.length>4||j&&j.length>4||i===1&&j.length<1||d&&d.length>4||i===2&&d.length<1)return null;if(!b.repeat)b.repeat={f:"stretch"};if(!b.repeat.kb)b.repeat.kb=b.repeat.f;a=function(r,o){return{T:o(r[0]),S:o(r[1]||r[0]),L:o(r[2]||r[0]),Q:o(r[3]||
-r[1]||r[0])}};b.slice=a(h,function(r){return g.k(r.h&t?r.d+"px":r.d)});b.width=j&&j.length>0?a(j,function(r){return r.h&(n|p)?g.k(r.d):r.d}):(k=this.e.currentStyle)&&{T:g.k(k.borderTopWidth),S:g.k(k.borderRightWidth),L:g.k(k.borderBottomWidth),Q:g.k(k.borderLeftWidth)};b.ua=a(d||[0],function(r){return r.h&n?g.k(r.d):r.d})}return b}});g.Zb=g.s.$({na:"box-shadow",va:"boxShadow",ba:function(a){var b,c=g.k,e=g.u.ja,f;if(a){f=new g.u(a);b={ua:[],cb:[]};for(a=function(){for(var h,j,d,i,k,m;h=f.next();){d=
-h.d;j=h.h;if(j&e.ha&&d===",")break;else if(h.db()&&!k){f.z();k=f.da(function(l){return!l.db()})}else if(j&e.ea&&!i)i=d;else if(j&e.fa&&d==="inset"&&!m)m=true;else return false}h=k&&k.length;if(h>1&&h<5){(m?b.cb:b.ua).push({fd:c(k[0].d),gd:c(k[1].d),blur:c(k[2]?k[2].d:"0"),Xc:c(k[3]?k[3].d:"0"),color:g.pa(i||"currentColor")});return true}return false};a(););}return b&&(b.cb.length||b.ua.length)?b:null}});g.ec=g.s.$({qa:g.s.ma(function(){var a=this.e.currentStyle;return a.visibility+"|"+a.display}),
-ba:function(){var a=this.e,b=a.runtimeStyle;a=a.currentStyle;var c=b.visibility,e;b.visibility="";e=a.visibility;b.visibility=c;return{cd:e!=="hidden",xc:a.display!=="none"}},g:function(){return false}});g.B={Z:function(a){function b(c,e,f,h){this.e=c;this.q=e;this.j=f;this.parent=h}g.p.fb(b.prototype,g.B,a);return b},eb:false,R:function(){return false},Kb:function(){this.n();this.g()&&this.X()},jb:function(){this.eb=true},Lb:function(){this.g()?this.X():this.n()},Wa:function(a,b){this.Hb(a);for(var c=
-this.ka||(this.ka=[]),e=a+1,f=c.length,h;e<f;e++)if(h=c[e])break;c[a]=b;this.w().insertBefore(b,h||null)},ra:function(a){var b=this.ka;return b&&b[a]||null},Hb:function(a){var b=this.ra(a),c=this.Ba;if(b&&c){c.removeChild(b);this.ka[a]=null}},sa:function(a,b,c,e){var f=this.Va||(this.Va={}),h=f[a];if(!h){h=f[a]=g.p.Ga("shape");if(b)h.appendChild(h[b]=g.p.Ga(b));if(e){c=this.ra(e);if(!c){this.Wa(e,doc.createElement("group"+e));c=this.ra(e)}}c.appendChild(h);a=h.style;a.position="absolute";a.left=a.top=
-0;a.behavior="url(#default#VML)"}return h},Za:function(a){var b=this.Va,c=b&&b[a];if(c){c.parentNode.removeChild(c);delete b[a]}return!!c},xb:function(a){var b=this.e,c=this.q.o(),e=c.i,f=c.f,h,j,d,i,k,m;c=a.x.tl.a(b,e);h=a.y.tl.a(b,f);j=a.x.tr.a(b,e);d=a.y.tr.a(b,f);i=a.x.br.a(b,e);k=a.y.br.a(b,f);m=a.x.bl.a(b,e);a=a.y.bl.a(b,f);e=Math.min(e/(c+j),f/(d+k),e/(m+i),f/(h+a));if(e<1){c*=e;h*=e;j*=e;d*=e;i*=e;k*=e;m*=e;a*=e}return{x:{tl:c,tr:j,br:i,bl:m},y:{tl:h,tr:d,br:k,bl:a}}},oa:function(a,b,c){b=
-b||1;var e,f,h=this.q.o();f=h.i*b;h=h.f*b;var j=this.j.v,d=Math.floor,i=Math.ceil,k=a?a.T*b:0,m=a?a.S*b:0,l=a?a.L*b:0;a=a?a.Q*b:0;var t,n,p,s,u;if(c||j.g()){e=this.xb(c||j.m());c=e.x.tl*b;j=e.y.tl*b;t=e.x.tr*b;n=e.y.tr*b;p=e.x.br*b;s=e.y.br*b;u=e.x.bl*b;b=e.y.bl*b;f="m"+d(a)+","+d(j)+"qy"+d(c)+","+d(k)+"l"+i(f-t)+","+d(k)+"qx"+i(f-m)+","+d(n)+"l"+i(f-m)+","+i(h-s)+"qy"+i(f-p)+","+i(h-l)+"l"+d(u)+","+i(h-l)+"qx"+d(a)+","+i(h-b)+" x e"}else f="m"+d(a)+","+d(k)+"l"+i(f-m)+","+d(k)+"l"+i(f-m)+","+i(h-
-l)+"l"+d(a)+","+i(h-l)+"xe";return f},w:function(){var a=this.parent.ra(this.C),b;if(!a){a=doc.createElement(this.Fa);b=a.style;b.position="absolute";b.top=b.left=0;this.parent.Wa(this.C,a)}return a},n:function(){this.parent.Hb(this.C);delete this.Va;delete this.ka}};g.cc=g.B.Z({g:function(){var a=this.oc;for(var b in a)if(a.hasOwnProperty(b)&&a[b].g())return true;return false},R:function(){return this.j.lb.D()},jb:function(){if(this.g()){var a=this.wb(),b=a,c;a=a.currentStyle;var e=a.position,f=
-this.w().style,h=0,j=0;j=this.q.o();if(e==="fixed"&&g.J>6){h=j.x;j=j.y;b=e}else{do b=b.offsetParent;while(b&&b.currentStyle.position==="static");if(b){c=b.getBoundingClientRect();b=b.currentStyle;h=j.x-c.left-(parseFloat(b.borderLeftWidth)||0);j=j.y-c.top-(parseFloat(b.borderTopWidth)||0)}else{b=doc.documentElement;h=j.x+b.scrollLeft-b.clientLeft;j=j.y+b.scrollTop-b.clientTop}b="absolute"}f.position=b;f.left=h;f.top=j;f.zIndex=e==="static"?-1:a.zIndex;this.eb=true}},Lb:function(){},Mb:function(){var a=
-this.j.lb.m();this.w().style.display=a.cd&&a.xc?"":"none"},Kb:function(){this.g()?this.Mb():this.n()},wb:function(){var a=this.e;return a.tagName in g.Jb?a.offsetParent:a},w:function(){var a=this.Ba,b;if(!a){b=this.wb();a=this.Ba=doc.createElement("css3-container");a.style.direction="ltr";this.Mb();b.parentNode.insertBefore(a,b)}return a},n:function(){var a=this.Ba,b;if(a&&(b=a.parentNode))b.removeChild(a);delete this.Ba;delete this.ka}});g.Sb=g.B.Z({C:2,Fa:"background",R:function(){var a=this.j;
-return a.H.D()||a.v.D()},g:function(){var a=this.j;return a.N.g()||a.v.g()||a.H.g()||a.W.g()&&a.W.m().cb},X:function(){var a=this.q.o();if(a.i&&a.f){this.yc();this.zc()}},yc:function(){var a=this.j.H.m(),b=this.q.o(),c=this.e,e=a&&a.color,f,h;if(e&&e.la()>0){this.yb();a=this.sa("bgColor","fill",this.w(),1);f=b.i;b=b.f;a.stroked=false;a.coordsize=f*2+","+b*2;a.coordorigin="1,1";a.path=this.oa(null,2);h=a.style;h.width=f;h.height=b;a.fill.color=e.O(c);c=e.la();if(c<1)a.fill.opacity=c}else this.Za("bgColor")},
-zc:function(){var a=this.j.H.m(),b=this.q.o();a=a&&a.M;var c,e,f,h,j;if(a){this.yb();e=b.i;f=b.f;for(j=a.length;j--;){b=a[j];c=this.sa("bgImage"+j,"fill",this.w(),2);c.stroked=false;c.fill.type="tile";c.fillcolor="none";c.coordsize=e*2+","+f*2;c.coordorigin="1,1";c.path=this.oa(0,2);h=c.style;h.width=e;h.height=f;if(b.P==="linear-gradient")this.mc(c,b);else{c.fill.src=b.Cb;this.Pc(c,j)}}}for(j=a?a.length:0;this.Za("bgImage"+j++););},Pc:function(a,b){g.p.Pb(a.fill.src,function(c){var e=a.fill,f=this.e,
-h=this.q.o(),j=h.i;h=h.f;var d=this.j,i=d.I.m(),k=i&&i.nb;i=k?k.t.a(f):0;var m=k?k.r.a(f):0,l=k?k.b.a(f):0;k=k?k.l.a(f):0;d=d.H.m().M[b];f=d.Ya?d.Ya.coords(f,j-c.i-k-m,h-c.f-i-l):{x:0,y:0};d=d.Bb;l=m=0;var t=j+1,n=h+1,p=g.J===8?0:1;k=Math.round(f.x)+k+0.5;i=Math.round(f.y)+i+0.5;e.position=k/j+","+i/h;if(d&&d!=="repeat"){if(d==="repeat-x"||d==="no-repeat"){m=i+1;n=i+c.f+p}if(d==="repeat-y"||d==="no-repeat"){l=k+1;t=k+c.i+p}a.style.clip="rect("+m+"px,"+t+"px,"+n+"px,"+l+"px)"}},this)},mc:function(a,
-b){function c(B,C,z,F,H){if(z===0||z===180)return[F,C];else if(z===90||z===270)return[B,H];else{z=Math.tan(-z*t/180);B=z*B-C;C=-1/z;F=C*F-H;H=C-z;return[(F-B)/H,(z*F-C*B)/H]}}function e(){w=m>=90&&m<270?i:0;r=m<180?k:0;o=i-w;x=k-r}function f(){for(;m<0;)m+=360;m%=360}function h(B,C){var z=C[0]-B[0];B=C[1]-B[1];return Math.abs(z===0?B:B===0?z:Math.sqrt(z*z+B*B))}var j=this.e,d=this.q.o(),i=d.i,k=d.f;a=a.fill;var m=b.Xa,l=b.bb;b=b.ca;d=b.length;var t=Math.PI,n,p,s,u,w,r,o,x,q,y,A,D;if(l){l=l.coords(j,
-i,k);n=l.x;p=l.y}if(m){m=m.vc();f();e();if(!l){n=w;p=r}l=c(n,p,m,o,x);s=l[0];u=l[1]}else if(l){s=i-n;u=k-p}else{n=p=s=0;u=k}l=s-n;q=u-p;if(m===void 0){m=!l?q<0?90:270:!q?l<0?180:0:-Math.atan2(q,l)/t*180;f();e()}l=m%90?Math.atan2(l*i/k,q)/t*180:m+90;l+=180;l%=360;y=h([n,p],[s,u]);s=h([w,r],c(w,r,m,o,x));u=[];p=h([n,p],c(n,p,m,w,r))/s*100;n=[];for(q=0;q<d;q++)n.push(b[q].Fb?b[q].Fb.a(j,y):q===0?0:q===d-1?y:null);for(q=1;q<d;q++){if(n[q]===null){A=n[q-1];y=q;do D=n[++y];while(D===null);n[q]=A+(D-A)/
-(y-q+1)}n[q]=Math.max(n[q],n[q-1])}for(q=0;q<d;q++)u.push(p+n[q]/s*100+"% "+b[q].color.O(j));a.angle=l;a.type="gradient";a.method="sigma";a.color=b[0].color.O(j);a.color2=b[d-1].color.O(j);a.colors.value=u.join(",")},yb:function(){var a=this.e.runtimeStyle;a.backgroundImage="url(about:blank)";a.backgroundColor="transparent"},n:function(){g.B.n.call(this);var a=this.e.runtimeStyle;a.backgroundImage=a.backgroundColor=""}});g.Wb=g.B.Z({C:4,Fa:"border",qc:{TABLE:1,INPUT:1,TEXTAREA:1,SELECT:1,OPTION:1,
-IMG:1,HR:1,FIELDSET:1},Jc:{submit:1,button:1,reset:1},R:function(){var a=this.j;return a.I.D()||a.v.D()},g:function(){var a=this.j;return(a.N.g()||a.v.g()||a.H.g())&&a.I.g()},X:function(){var a=this.e,b=this.j.I.m(),c=this.q.o(),e=c.i;c=c.f;var f,h,j,d,i;if(b){this.Hc();b=this.Bc(2);d=0;for(i=b.length;d<i;d++){j=b[d];f=this.sa("borderPiece"+d,j.stroke?"stroke":"fill",this.w());f.coordsize=e*2+","+c*2;f.coordorigin="1,1";f.path=j.path;h=f.style;h.width=e;h.height=c;f.filled=!!j.fill;f.stroked=!!j.stroke;
-if(j.stroke){f=f.stroke;f.weight=j.mb+"px";f.color=j.color.O(a);f.dashstyle=j.stroke==="dashed"?"2 2":j.stroke==="dotted"?"1 1":"solid";f.linestyle=j.stroke==="double"&&j.mb>2?"ThinThin":"Single"}else f.fill.color=j.fill.O(a)}for(;this.Za("borderPiece"+d++););}},Hc:function(){var a=this.e,b=a.currentStyle,c=a.runtimeStyle,e=a.tagName,f=g.J===6,h;if(f&&e in this.qc||e==="BUTTON"||e==="INPUT"&&a.type in this.Jc){c.borderWidth="";e=this.j.I.Ib;for(h=e.length;h--;){f=e[h];c["padding"+f]="";c["padding"+
-f]=g.k(b["padding"+f]).a(a)+g.k(b["border"+f+"Width"]).a(a)+(!g.J===8&&h%2?1:0)}c.borderWidth=0}else if(f){if(a.childNodes.length!==1||a.firstChild.tagName!=="ie6-mask"){b=doc.createElement("ie6-mask");e=b.style;e.visibility="visible";for(e.zoom=1;e=a.firstChild;)b.appendChild(e);a.appendChild(b);c.visibility="hidden"}}else c.borderColor="transparent"},Bc:function(a){var b=this.e,c,e,f,h=this.j.I,j=[],d,i,k,m,l=Math.round,t,n,p;if(h.g()){c=h.m();h=c.nb;n=c.Zc;p=c.tc;if(c.ed&&c.$c&&c.uc){if(p.t.la()>
-0){c=h.t.a(b);k=c/2;j.push({path:this.oa({T:k,S:k,L:k,Q:k},a),stroke:n.t,color:p.t,mb:c})}}else{a=a||1;c=this.q.o();e=c.i;f=c.f;c=l(h.t.a(b));k=l(h.r.a(b));m=l(h.b.a(b));b=l(h.l.a(b));var s={t:c,r:k,b:m,l:b};b=this.j.v;if(b.g())t=this.xb(b.m());d=Math.floor;i=Math.ceil;var u=function(o,x){return t?t[o][x]:0},w=function(o,x,q,y,A,D){var B=u("x",o),C=u("y",o),z=o.charAt(1)==="r";o=o.charAt(0)==="b";return B>0&&C>0?(D?"al":"ae")+(z?i(e-B):d(B))*a+","+(o?i(f-C):d(C))*a+","+(d(B)-x)*a+","+(d(C)-q)*a+","+
-y*65535+","+2949075*(A?1:-1):(D?"m":"l")+(z?e-x:x)*a+","+(o?f-q:q)*a},r=function(o,x,q,y){var A=o==="t"?d(u("x","tl"))*a+","+i(x)*a:o==="r"?i(e-x)*a+","+d(u("y","tr"))*a:o==="b"?i(e-u("x","br"))*a+","+d(f-x)*a:d(x)*a+","+i(f-u("y","bl"))*a;o=o==="t"?i(e-u("x","tr"))*a+","+i(x)*a:o==="r"?i(e-x)*a+","+i(f-u("y","br"))*a:o==="b"?d(u("x","bl"))*a+","+d(f-x)*a:d(x)*a+","+d(u("y","tl"))*a;return q?(y?"m"+o:"")+"l"+A:(y?"m"+A:"")+"l"+o};b=function(o,x,q,y,A,D){var B=o==="l"||o==="r",C=s[o],z,F;if(C>0&&n[o]!==
-"none"&&p[o].la()>0){z=s[B?o:x];x=s[B?x:o];F=s[B?o:q];q=s[B?q:o];if(n[o]==="dashed"||n[o]==="dotted"){j.push({path:w(y,z,x,D+45,0,1)+w(y,0,0,D,1,0),fill:p[o]});j.push({path:r(o,C/2,0,1),stroke:n[o],mb:C,color:p[o]});j.push({path:w(A,F,q,D,0,1)+w(A,0,0,D-45,1,0),fill:p[o]})}else j.push({path:w(y,z,x,D+45,0,1)+r(o,C,0,0)+w(A,F,q,D,0,0)+(n[o]==="double"&&C>2?w(A,F-d(F/3),q-d(q/3),D-45,1,0)+r(o,i(C/3*2),1,0)+w(y,z-d(z/3),x-d(x/3),D,1,0)+"x "+w(y,d(z/3),d(x/3),D+45,0,1)+r(o,d(C/3),1,0)+w(A,d(F/3),d(q/
-3),D,0,0):"")+w(A,0,0,D-45,1,0)+r(o,0,1,0)+w(y,0,0,D,1,0),fill:p[o]})}};b("t","l","r","tl","tr",90);b("r","t","b","tr","br",0);b("b","r","l","br","bl",-90);b("l","b","t","bl","tl",-180)}}return j},n:function(){g.B.n.call(this);this.e.runtimeStyle.borderColor=""}});g.Ub=g.B.Z({C:5,Oc:["t","tr","r","br","b","bl","l","tl","c"],R:function(){return this.j.N.D()},g:function(){return this.j.N.g()},X:function(){this.w();var a=this.j.N.m(),b=this.q.o(),c=this.e,e=this.Gb;g.p.Pb(a.src,function(f){function h(w,
-r,o,x,q){w=e[w].style;var y=Math.max;w.width=y(r,0);w.height=y(o,0);w.left=x;w.top=q}function j(w,r,o){for(var x=0,q=w.length;x<q;x++)e[w[x]].imagedata[r]=o}var d=b.i,i=b.f,k=a.width,m=k.T.a(c),l=k.S.a(c),t=k.L.a(c);k=k.Q.a(c);var n=a.slice,p=n.T.a(c),s=n.S.a(c),u=n.L.a(c);n=n.Q.a(c);h("tl",k,m,0,0);h("t",d-k-l,m,k,0);h("tr",l,m,d-l,0);h("r",l,i-m-t,d-l,m);h("br",l,t,d-l,i-t);h("b",d-k-l,t,k,i-t);h("bl",k,t,0,i-t);h("l",k,i-m-t,0,m);h("c",d-k-l,i-m-t,k,m);j(["tl","t","tr"],"cropBottom",(f.f-p)/f.f);
-j(["tl","l","bl"],"cropRight",(f.i-n)/f.i);j(["bl","b","br"],"cropTop",(f.f-u)/f.f);j(["tr","r","br"],"cropLeft",(f.i-s)/f.i);if(a.repeat.kb==="stretch"){j(["l","r","c"],"cropTop",p/f.f);j(["l","r","c"],"cropBottom",u/f.f)}if(a.repeat.f==="stretch"){j(["t","b","c"],"cropLeft",n/f.i);j(["t","b","c"],"cropRight",s/f.i)}e.c.style.display=a.fill?"":"none"},this)},w:function(){var a=this.parent.ra(this.C),b,c,e,f=this.Oc,h=f.length;if(!a){a=doc.createElement("border-image");b=a.style;b.position="absolute";
-this.Gb={};for(e=0;e<h;e++){c=this.Gb[f[e]]=g.p.Ga("rect");c.appendChild(g.p.Ga("imagedata"));b=c.style;b.behavior="url(#default#VML)";b.position="absolute";b.top=b.left=0;c.imagedata.src=this.j.N.m().src;c.stroked=false;c.filled=false;a.appendChild(c)}this.parent.Wa(this.C,a)}return a}});g.Yb=g.B.Z({C:1,Fa:"outset-box-shadow",R:function(){var a=this.j;return a.W.D()||a.v.D()},g:function(){var a=this.j.W;return a.g()&&a.m().ua[0]},X:function(){function a(z,F,H,K,J,v,E){z=b.sa("shadow"+z+F,"fill",
-e,j-z);F=z.fill;z.coordsize=m*2+","+l*2;z.coordorigin="1,1";z.stroked=false;z.filled=true;F.color=J.O(c);if(v){F.type="gradienttitle";F.color2=F.color;F.opacity=0}z.path=E;u=z.style;u.left=H;u.top=K;u.width=m;u.height=l;return z}var b=this,c=this.e,e=this.w(),f=this.j,h=f.W.m().ua;f=f.v.m();var j=h.length,d=j,i,k=this.q.o(),m=k.i,l=k.f;k=g.J===8?1:0;for(var t=["tl","tr","br","bl"],n,p,s,u,w,r,o,x,q,y,A,D,B,C;d--;){p=h[d];w=p.fd.a(c);r=p.gd.a(c);i=p.Xc.a(c);o=p.blur.a(c);p=p.color;x=-i-o;if(!f&&o)f=
-g.Oa.Qb;x=this.oa({T:x,S:x,L:x,Q:x},2,f);if(o){q=(i+o)*2+m;y=(i+o)*2+l;A=o*2/q;D=o*2/y;if(o-i>m/2||o-i>l/2)for(i=4;i--;){n=t[i];B=n.charAt(0)==="b";C=n.charAt(1)==="r";n=a(d,n,w,r,p,o,x);s=n.fill;s.focusposition=(C?1-A:A)+","+(B?1-D:D);s.focussize="0,0";n.style.clip="rect("+((B?y/2:0)+k)+"px,"+(C?q:q/2)+"px,"+(B?y:y/2)+"px,"+((C?q/2:0)+k)+"px)"}else{n=a(d,"",w,r,p,o,x);s=n.fill;s.focusposition=A+","+D;s.focussize=1-A*2+","+(1-D*2)}}else{n=a(d,"",w,r,p,o,x);w=p.la();if(w<1)n.fill.opacity=w}}}});g.bc=
-g.B.Z({C:6,Fa:"imgEl",R:function(){var a=this.j;return this.e.src!==this.hc||a.v.D()},g:function(){var a=this.j;return a.v.g()||a.H.Eb()},X:function(){this.hc=j;this.Gc();var a=this.sa("img","fill",this.w()),b=a.fill,c=this.q.o(),e=c.i;c=c.f;var f=this.j.I.m();f=f&&f.nb;var h=this.e,j=h.src,d=Math.round;a.stroked=false;b.type="frame";b.src=j;b.position=(e?0.5/e:0)+","+(c?0.5/c:0);a.coordsize=e*2+","+c*2;a.coordorigin="1,1";a.path=this.oa(f?{T:d(f.t.a(h)),S:d(f.r.a(h)),L:d(f.b.a(h)),Q:d(f.l.a(h))}:
-0,2);a=a.style;a.width=e;a.height=c},Gc:function(){this.e.runtimeStyle.filter="alpha(opacity=0)"},n:function(){g.B.n.call(this);this.e.runtimeStyle.filter=""}});g.Qa=function(){function a(d){function i(){if(!z){var v,E,G=d.currentStyle,I=G.getAttribute(c)==="true";J=G.getAttribute(e);J=g.Ab===8?J!=="false":J==="true";if(!C){C=1;d.runtimeStyle.zoom=1;G=d;for(var O=1;G=G.previousSibling;)if(G.nodeType===1){O=0;break}if(O)d.className+=" "+g.Pa+"first-child"}y.Ja();if(I&&(E=y.o())&&(v=doc.documentElement||
-doc.body)&&(E.y>v.clientHeight||E.x>v.clientWidth||E.y+E.f<0||E.x+E.i<0)){if(!H){H=1;g.Ra.aa(i)}}else{z=1;H=C=0;g.Ra.Ma(i);A={H:new g.Tb(d),I:new g.Xb(d),N:new g.Vb(d),v:new g.Oa(d),W:new g.Zb(d),lb:new g.ec(d)};D=[A.H,A.I,A.N,A.v,A.W,A.lb];v=new g.cc(d,y,A);E=[new g.Yb(d,y,A,v),new g.Sb(d,y,A,v),new g.Wb(d,y,A,v),new g.Ub(d,y,A,v)];d.tagName==="IMG"&&E.push(new g.bc(d,y,A,v));v.oc=E;q=[v].concat(E);if(v=d.currentStyle.getAttribute(g.F+"watch-ancestors")){B=[];v=parseInt(v,10);E=0;for(I=d.parentNode;I&&
-(v==="NaN"||E++<v);){B.push(I);I.attachEvent("onpropertychange",u);I.attachEvent("onmouseenter",p);I.attachEvent("onmouseleave",s);I=I.parentNode}}if(J){g.ya.aa(m);g.ya.Tc()}m(1)}if(!F){F=1;d.attachEvent("onmove",k);d.attachEvent("onresize",k);d.attachEvent("onpropertychange",l);d.attachEvent("onmouseenter",p);d.attachEvent("onmouseleave",s);g.za.aa(k);g.G.aa(o)}y.La()}}function k(){y&&y.Ec()&&m()}function m(v){if(!K)if(z){var E,G;w();if(v||y.Qc()){E=0;for(G=q.length;E<G;E++)q[E].jb()}if(v||y.Vc()){E=
-0;for(G=q.length;E<G;E++)q[E].Lb()}r()}else C||i()}function l(){var v,E,G;v=event;if(!K&&!(v&&v.propertyName in j))if(z){w();v=0;for(E=q.length;v<E;v++){G=q[v];G.eb||G.jb();G.R()&&G.Kb()}r()}else C||i()}function t(){if(d)d.className+=f}function n(){if(d)d.className=d.className.replace(h,"")}function p(){setTimeout(t,0)}function s(){setTimeout(n,0)}function u(){var v=event.propertyName;if(v==="className"||v==="id")l()}function w(){y.Ja();for(var v=D.length;v--;)D[v].Ja()}function r(){for(var v=D.length;v--;)D[v].La();
-y.La()}function o(){if(F){if(B)for(var v=0,E=B.length,G;v<E;v++){G=B[v];G.detachEvent("onpropertychange",u);G.detachEvent("onmouseenter",p);G.detachEvent("onmouseleave",s)}d.detachEvent("onmove",m);d.detachEvent("onresize",m);d.detachEvent("onpropertychange",l);d.detachEvent("onmouseenter",p);d.detachEvent("onmouseleave",s);g.G.Ma(o);F=0}}function x(){if(!K){var v,E;o();K=1;if(q){v=0;for(E=q.length;v<E;v++)q[v].n()}J&&g.ya.Ma(m);g.za.Ma(m);q=y=A=D=B=d=null}}var q,y=new M(d),A,D,B,C,z,F,H,K,J;this.Ic=
-i;this.update=m;this.n=x;this.Ac=d}var b={},c=g.F+"lazy-init",e=g.F+"poll",f=" "+g.Pa+"hover",h=new RegExp("\\b"+g.Pa+"hover\\b","g"),j={background:1,bgColor:1,display:1};a.Cc=function(d){var i=g.p.ta(d);return b[i]||(b[i]=new a(d))};a.n=function(d){d=g.p.ta(d);var i=b[d];if(i){i.n();delete b[d]}};a.wc=function(){var d=[],i;if(b){for(var k in b)if(b.hasOwnProperty(k)){i=b[k];d.push(i.Ac);i.n()}b={}}return d};return a}();g.attach=function(a){g.Ab<9&&g.Qa.Cc(a).Ic()};g.detach=function(a){g.Qa.n(a)}};
-var N=window.PIE,P=element;function init(){N&&doc.media!=="print"&&N.attach(P)}function cleanup(){if(N){N.detach(P);N=P=0}}P.readyState==="complete"&&init();
-</script>
-</PUBLIC:COMPONENT>
Modified: trunk/catalog/install/templates/main_page/stylesheet.css
===================================================================
--- trunk/catalog/install/templates/main_page/stylesheet.css 2012-02-25 10:20:08 UTC (rev 4042)
+++ trunk/catalog/install/templates/main_page/stylesheet.css 2012-02-25 14:01:13 UTC (rev 4043)
@@ -49,7 +49,6 @@
-moz-box-shadow: 0 0 1em #ccc;
-webkit-box-shadow: 0 0 1em #ccc;
box-shadow: 0px 0px 1em #ccc;
- behavior: url(templates/main_page/PIE.htc);
}
#title {text-align:center; margin-bottom:.5em;}
@@ -66,7 +65,6 @@
-webkit-border-radius:0.5em 0.5em 0 0;
-khtml-border-radius:0.5em 0.5em 0 0;
border-radius:0.5em 0.5em 0 0;
- behavior: url(templates/main_page/PIE.htc);
}
.finished {background-color:#eee; color:#999;}
.selected {background-color:#ccc; color:white;}
@@ -80,7 +78,6 @@
-webkit-border-radius:1em;
-khtml-border-radius:1em;
border-radius:1em;
- behavior: url(templates/main_page/PIE.htc);
}
.smallDesc {padding:0 0 .5em .5em; line-height:2em;}
#team_info p {padding:1em;}
@@ -88,7 +85,6 @@
.clear {clear:both;}
/* Aide contextuellle */
-/* .help {position:relative;} */
.help .longDescription {display:none;}
.help:hover {background:none; z-index:500;}
.help:hover .longDescription {
@@ -102,7 +98,6 @@
-webkit-border-radius:1em;
-khtml-border-radius:1em;
border-radius:1em;
- behavior: url(templates/main_page/PIE.htc);
}
.help img {padding:0 .5em; display:inline; vertical-align:sub;}
@@ -118,7 +113,6 @@
-webkit-border-radius:0.5em;
-khtml-border-radius:0.5em;
border-radius:0.5em;
- behavior: url(templates/main_page/PIE.htc);
}
/* Sample */
#ChooseSample li p {width:250px;}
@@ -138,7 +132,6 @@
-webkit-border-radius:15px;
-khtml-border-radius:15px;
border-radius:15px;
- behavior: url(templates/main_page/PIE.htc);
}
#shop_link a:hover {background-color:#82c46c; color:white;}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2012-02-25 10:20:15
|
Revision: 4042
http://oscss.svn.sourceforge.net/oscss/?rev=4042&view=rev
Author: oscim
Date: 2012-02-25 10:20:08 +0000 (Sat, 25 Feb 2012)
Log Message:
-----------
suite des corrections et developpement des extra fields des produits
Modified Paths:
--------------
trunk/catalog/admin/includes/gabarit/configuration/modprodextra/draw.label.edit.gab
trunk/catalog/admin/includes/gabarit/configuration/modprodextra/draw.value.edit.gab
trunk/catalog/admin/includes/gabarit/configuration/modprodextra/draw.value.listing.gab
trunk/catalog/admin/includes/languages/fr_FR/modules/configuration/modprodextra.txt
trunk/catalog/admin/includes/modules/configuration/modprodextra.php
Added Paths:
-----------
trunk/catalog/admin/includes/gabarit/configuration/modprodextra/draw.value.delete.gab
Modified: trunk/catalog/admin/includes/gabarit/configuration/modprodextra/draw.label.edit.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/configuration/modprodextra/draw.label.edit.gab 2012-02-24 08:05:34 UTC (rev 4041)
+++ trunk/catalog/admin/includes/gabarit/configuration/modprodextra/draw.label.edit.gab 2012-02-25 10:20:08 UTC (rev 4042)
@@ -14,18 +14,13 @@
global $action, $languages;
?>
<div class="box_unique">
- <h4><?php echo (($action == 'edit')? __('HEADING_NEW') : __('HEADING_EDIT') . modprodextra::$eid ) ?></h4>
+ <h4><?php echo (($action != 'edit')? __('heading new') : __('heading edit') ) ?></h4>
<?php echo tep_draw_form('field_entry',FILENAME_CONFIGURATION, tep_get_all_get_params(array('action','eid','confirm')). 'action=' . (($action == 'new') ? 'insert' : 'update') . '&confirm=yes&eid=' . modprodextra::$eid , 'post'); ?>
- <p class="block_input">
- <label><?php echo __('ENTRY_ACTIVATE_NOW') ?></label>
- <?php echo tep_draw_radio_field('status','status', '1', (((int)modprodextra::$cInfo['epf_status']==1)? true : false) ). ' ' .__('TEXT_YES'). ' ' . tep_draw_radio_field('status','status', '0', (((int)modprodextra::$cInfo['epf_status']==0)? true : false) ). ' ' .__('TEXT_NO'); ?>
-
-
+ <p>
<?php echo tep_draw_hidden_field('value_list','value_list', (((int)modprodextra::$cInfo['epf_uses_value_list']==1)? '1' : '0')) ?>
<?php echo tep_draw_hidden_field('epf_active_for_language','epf_active_for_language', (((int)modprodextra::$cInfo['epf_active_for_language']==1)? '1' : '0')) ?>
-
</p>
@@ -38,63 +33,81 @@
<?php for ($i=0, $n=sizeof($languages); $i<$n; $i++) { ?>
<ul id="<?php echo 'products_name-'.($i+1) ?>">
- <li class="block_input">
- <?php echo __('ENTRY_LABEL') . tep_draw_input_field('label_' . $languages[$i]['id'],'label_' . $languages[$i]['id'], modprodextra::$pInfo[$languages[$i]['id']]['epf_label'], "size=64 maxlength=64") ?>
+ <li>
+ <p class="block_input">
+ <label for="<?php echo 'label_' . $languages[$i]['id'] ?>" title="<?php echo __('entry label help') ?>"><?php echo __('entry label') . tep_image(DIR_WS_ICONS . 'icon_help.gif'); ?></label>
+ <?php echo tep_draw_input_field('label_' . $languages[$i]['id'],'label_' . $languages[$i]['id'], modprodextra::$pInfo[$languages[$i]['id']]['epf_label'], "size=64 maxlength=64") ?>
+ </p>
</li>
- <li class="block_input">
- <?php echo __('entry label format') . tep_draw_input_field('format_' . $languages[$i]['id'],'format_' . $languages[$i]['id'], modprodextra::$pInfo[$languages[$i]['id']]['epf_format'], "size=64 maxlength=64") ?>
+ <li>
+ <p class="block_input">
+ <label for="<?php echo 'format_' . $languages[$i]['id'] ?>" title="<?php echo __('entry label help') ?>"><?php echo __('entry label format') . tep_image(DIR_WS_ICONS . 'icon_help.gif'); ?></label>
+ <?php echo tep_draw_input_field('format_' . $languages[$i]['id'],'format_' . $languages[$i]['id'], modprodextra::$pInfo[$languages[$i]['id']]['epf_format'], "size=64 maxlength=64") ?>
+ </p>
</li>
</ul>
<?php } ?>
</fieldset>
- <p class="block_input">
- <label for="epf_key" title="<?php echo __('ENTRY_UNIQ_KEY_HELP') ?>"><?php echo __('ENTRY_UNIQ_KEY'). tep_image(DIR_WS_ICONS . 'icon_help.gif'); ?></label>
- <?php echo tep_draw_input_field('epf_key','epf_key', modprodextra::$cInfo['epf_key']); ?>
- </p>
+ <fieldset class="block_field">
+ <p class="block_input">
+ <label for="search" title="<?php echo __('entry search help') ?>"><?php echo __('entry search'); ?></label>
+ <?php echo tep_draw_radio_field('search','search', '1', (((int)modprodextra::$cInfo['epf_advanced_search']==1)? true : false) ). ' ' .__('text yes'). ' ' . tep_draw_radio_field('search','search', '0', (((int)modprodextra::$cInfo['epf_advanced_search']==0)? true : false) ) . ' ' .__('text no'); ?>
+ </p>
+ <p class="block_input">
+ <label><?php echo __('ENTRY_LISTING') ?></label>
+ <?php echo tep_draw_radio_field('listing','listing', '1', (((int)modprodextra::$cInfo['epf_show_in_listing']==1)? true : false) ) . ' ' .__('text yes'). ' ' . tep_draw_radio_field('listing','listing', '0', (((int)modprodextra::$cInfo['epf_show_in_listing']==0)? true : false) ) . ' ' .__('text no'); ?>
+ </p>
+ <p class="block_input">
+ <label><?php echo __('ENTRY_META') ?></label>
+ <?php echo tep_draw_radio_field('meta','meta', '1',(((int)modprodextra::$cInfo['epf_use_as_meta_keyword']==1)? true : false) ) . ' ' .__('text yes'). ' ' . tep_draw_radio_field('meta','meta', '0', (((int)modprodextra::$cInfo['epf_use_as_meta_keyword']==0)? true : false) ) . ' ' .__('text no'); ?>
+ </p>
+ </fieldset>
- <p class="block_input">
- <label><?php echo __('ENTRY_ORDER') ?></label>
- <?php echo tep_draw_input_field('sort_order','sort_order', (!empty(modprodextra::$cInfo['epf_order'])? modprodextra::$cInfo['epf_order'] : '0' ) ); ?>
- </p>
- <p class="block_input">
- <label for="search" title="<?php echo __('ENTRY_SEARCH_HELP') ?>"><?php echo __('ENTRY_SEARCH'). tep_image(DIR_WS_ICONS . 'icon_help.gif'); ?></label>
- <?php echo tep_draw_radio_field('search','search', '1', (((int)modprodextra::$cInfo['epf_advanced_search']==1)? true : false) ). ' ' .__('TEXT_YES'). ' ' . tep_draw_radio_field('search','search', '0', (((int)modprodextra::$cInfo['epf_advanced_search']==0)? true : false) ) . ' ' .__('TEXT_NO'); ?>
- </p>
- <p class="block_input">
- <label><?php echo __('ENTRY_LISTING') ?></label>
- <?php echo tep_draw_radio_field('listing','listing', '1', (((int)modprodextra::$cInfo['epf_show_in_listing']==1)? true : false) ) . ' ' .__('TEXT_YES'). ' ' . tep_draw_radio_field('listing','listing', '0', (((int)modprodextra::$cInfo['epf_show_in_listing']==0)? true : false) ) . ' ' .__('TEXT_NO'); ?>
- </p>
- <p class="block_input">
- <label><?php echo __('ENTRY_META') ?></label>
- <?php echo tep_draw_radio_field('meta','meta', '1',(((int)modprodextra::$cInfo['epf_use_as_meta_keyword']==1)? true : false) ) . ' ' .__('TEXT_YES'). ' ' . tep_draw_radio_field('meta','meta', '0', (((int)modprodextra::$cInfo['epf_use_as_meta_keyword']==0)? true : false) ) . ' ' .__('TEXT_NO'); ?>
- </p>
- <p class="block_input">
- <label><?php echo __('ENTRY_USE_ADMIN') ?></label>
- <?php echo tep_draw_radio_field('epf_admin','epf_admin', '1', (((int)modprodextra::$cInfo['epf_admin']==1)? true : false) ) . ' ' .__('TEXT_YES'). ' ' . tep_draw_radio_field('epf_admin','epf_admin', '0', (((int)modprodextra::$cInfo['epf_admin']==0)? true : false) ) . ' ' .__('TEXT_NO'); ?>
- </p>
- <p class="block_input">
- <label for="epf_special_mod" title="<?php echo __('ENTRY_SPECIFIQUE_MODULE_HELP') ?>"><?php echo __('ENTRY_SPECIFIQUE_MODULE'). tep_image(DIR_WS_ICONS . 'icon_help.gif'); ?></label>
- <?php echo tep_draw_input_field('epf_special_mod','epf_special_mod', modprodextra::$cInfo['epf_special_mod']); ?>
- </p>
- <p class="block_input">
- <label><?php echo __('ENTRY_CHAIN') ?></label>
- <?php echo tep_draw_radio_field('chain','chain', '1', (((int)modprodextra::$cInfo['epf_show_parent_chain']==1)? true : false) ) . ' ' .__('TEXT_YES'). ' ' . tep_draw_radio_field('chain','chain', '0', (((int)modprodextra::$cInfo['epf_show_parent_chain']==0)? true : false)) . ' ' .__('TEXT_NO'); ?>
- </p>
+ <fieldset class="block_field">
+ <p class="block_input">
+ <label><?php echo __('ENTRY_ORDER') ?></label>
+ <?php echo tep_draw_input_field('sort_order','sort_order', (!empty(modprodextra::$cInfo['epf_order'])? modprodextra::$cInfo['epf_order'] : '0' ) ); ?>
+ </p>
+
+
+ <p class="block_input">
+ <label for="epf_key" title="<?php echo __('ENTRY_UNIQ_KEY_HELP') ?>"><?php echo __('ENTRY_UNIQ_KEY'). tep_image(DIR_WS_ICONS . 'icon_help.gif'); ?></label>
+ <?php echo tep_draw_input_field('epf_key','epf_key', modprodextra::$cInfo['epf_key']); ?>
+ </p>
+
+ <p class="block_input">
+ <label><?php echo __('ENTRY_USE_ADMIN') ?></label>
+ <?php echo tep_draw_radio_field('epf_admin','epf_admin', '1', (((int)modprodextra::$cInfo['epf_admin']==1)? true : false) ) . ' ' .__('text yes'). ' ' . tep_draw_radio_field('epf_admin','epf_admin', '0', (((int)modprodextra::$cInfo['epf_admin']==0)? true : false) ) . ' ' .__('text no'); ?>
+ </p>
+ <p class="block_input">
+ <label for="epf_special_mod" title="<?php echo __('ENTRY_SPECIFIQUE_MODULE_HELP') ?>"><?php echo __('ENTRY_SPECIFIQUE_MODULE'). tep_image(DIR_WS_ICONS . 'icon_help.gif'); ?></label>
+ <?php echo tep_draw_input_field('epf_special_mod','epf_special_mod', modprodextra::$cInfo['epf_special_mod']); ?>
+ </p>
+ <p class="block_input">
+ <label><?php echo __('ENTRY_CHAIN') ?></label>
+ <?php echo tep_draw_radio_field('chain','chain', '1', (((int)modprodextra::$cInfo['epf_show_parent_chain']==1)? true : false) ) . ' ' .__('text yes'). ' ' . tep_draw_radio_field('chain','chain', '0', (((int)modprodextra::$cInfo['epf_show_parent_chain']==0)? true : false)) . ' ' .__('text no'); ?>
+ </p>
+
+ </fieldset>
+
+
<?php if ($action == 'new' || (!modprodextra::$cInfo['epf_uses_value_list']) ) : ?>
- <p class="block_input">
- <label for="restrict" title="<?php echo __('ENTRY_RESTRICT_HELP') ?>"><?php echo __('ENTRY_RESTRICT'). tep_image(DIR_WS_ICONS . 'icon_help.gif'); ?></label>
- <?php echo tep_draw_radio_field('restrict','restrict', '1',(((int)modprodextra::$cInfo['epf_use_to_restrict_listings']==1)? true : false)) . ' ' .__('TEXT_YES'). ' ' . tep_draw_radio_field('restrict','restrict', '0',(((int)modprodextra::$cInfo['epf_use_to_restrict_listings']==0)? true : false) ) . ' ' .__('TEXT_NO'); ?>
- </p>
+ <fieldset class="block_field">
+ <p class="block_input">
+ <label for="restrict" title="<?php echo __('ENTRY_RESTRICT_HELP') ?>"><?php echo __('ENTRY_RESTRICT'). tep_image(DIR_WS_ICONS . 'icon_help.gif'); ?></label>
+ <?php echo tep_draw_radio_field('restrict','restrict', '1',(((int)modprodextra::$cInfo['epf_use_to_restrict_listings']==1)? true : false)) . ' ' .__('text yes'). ' ' . tep_draw_radio_field('restrict','restrict', '0',(((int)modprodextra::$cInfo['epf_use_to_restrict_listings']==0)? true : false) ) . ' ' .__('text no'); ?>
+ </p>
- <p class="block_input">
- <label for="size" title="<?php echo __('ENTRY_SIZE_HELP') ?>"><?php echo __('ENTRY_SIZE'). tep_image(DIR_WS_ICONS . 'icon_help.gif') ?></label>
- <?php echo tep_draw_input_field('size','size', modprodextra::$cInfo['epf_size'],'',true); ?>
- </p>
+ <p class="block_input">
+ <label for="size" title="<?php echo __('ENTRY_SIZE_HELP') ?>"><?php echo __('ENTRY_SIZE'). tep_image(DIR_WS_ICONS . 'icon_help.gif') ?></label>
+ <?php echo tep_draw_input_field('size','size', modprodextra::$cInfo['epf_size'],'',true); ?>
+ </p>
+ </fieldset>
<?php else: ?>
- <?php echo tep_draw_hidden_field('size','size', modprodextra::$cInfo['epf_size'] ) .tep_draw_hidden_field('restrict','restrict', modprodextra::$cInfo['restrict'],(((int)modprodextra::$cInfo['restrict']==1)? '1' : '0')) ?>
+ <p><?php echo tep_draw_hidden_field('size','size', modprodextra::$cInfo['epf_size'] ) .tep_draw_hidden_field('restrict','restrict', modprodextra::$cInfo['restrict'],(((int)modprodextra::$cInfo['restrict']==1)? '1' : '0')) ?></p>
<?php endif; ?>
Added: trunk/catalog/admin/includes/gabarit/configuration/modprodextra/draw.value.delete.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/configuration/modprodextra/draw.value.delete.gab (rev 0)
+++ trunk/catalog/admin/includes/gabarit/configuration/modprodextra/draw.value.delete.gab 2012-02-25 10:20:08 UTC (rev 4042)
@@ -0,0 +1,24 @@
+<?php
+/**
+ @licence GPL 2005-2012 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 08/02/2012, 15:38
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+ @brief gabarit for listing extra fields products
+*/
+?>
+
+<h3><?php echo __('heading delete value') ?></h3>
+
+
+<?php echo tep_draw_form('yes', modprodextra::FILENAME, tep_get_all_get_params(array('action','eid','confirm')). 'action=delete_value_confirm&eid=' . modprodextra::$eid.'&vid='.$_GET['vid']) ?>
+
+<p><?php echo __('text delete value') ?>
+ <fieldset class="block_input button_nav">
+ <?php print tep_image_submit('button_delete.gif', IMAGE_DELETE) . tep_js_back(tep_href_link(modprodextra::FILENAME, 'eid=' . modprodextra::$eid ), IMAGE_CANCEL) ; ?>
+ </fieldset>
+
+</form>
\ No newline at end of file
Modified: trunk/catalog/admin/includes/gabarit/configuration/modprodextra/draw.value.edit.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/configuration/modprodextra/draw.value.edit.gab 2012-02-24 08:05:34 UTC (rev 4041)
+++ trunk/catalog/admin/includes/gabarit/configuration/modprodextra/draw.value.edit.gab 2012-02-25 10:20:08 UTC (rev 4042)
@@ -12,7 +12,7 @@
*/
global $action, $languages;
?>
-<h4><?php echo __('HT_ADD_VALUE_LIST_LANG') ?></h4>
+<h4><?php echo __('heading extra fields list add value') ?></h4>
@@ -21,7 +21,7 @@
<div class="tabs_lang">
<ul>
<?php for ($i=0, $n=sizeof($languages); $i<$n; $i++) { ?>
- <li><?php echo '<a href="#lang-' . ($i+1).'" >' . tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . ' ' . $languages[$i]['name'] . '</a>' ?></li>
+ <li><?php echo '<a href="#lang-' . ($i+1).'" >' . tep_language_image( $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . ' ' . $languages[$i]['name'] . '</a>' ?></li>
<?php } ?>
</ul>
@@ -29,10 +29,12 @@
<fieldset id="<?php echo 'lang-'.($i+1) ?>">
<p class="block_input">
- <?php echo __('ENTRY_ORDER') . tep_draw_input_field('sort_order['.$languages[$i]['id'].']','sort_order_'.$languages[$i]['id'],modprodextra::$cInfo[$languages[$i]['id']]['sort_order']) ; ?>
+ <label for="<?php echo 'sort_order[' . $languages[$i]['id'].']' ?>" title="<?php echo __('entry value sort help') ?>"><?php echo __('entry value sort'); ?></label>
+ <?php echo tep_draw_input_field('sort_order['.$languages[$i]['id'].']','sort_order_'.$languages[$i]['id'],modprodextra::$cInfo[$languages[$i]['id']]['sort_order']) ; ?>
</p>
<p class="block_input">
- <?php echo __('ENTRY_VALUE') . tep_draw_input_field('value['.$languages[$i]['id'].']','value_'.$languages[$i]['id'], modprodextra::$cInfo[$languages[$i]['id']]['epf_value'], 'size=64 maxlength=64'); ?>
+ <label for="<?php echo 'value[' . $languages[$i]['id'].']' ?>" title="<?php echo __('entry value value help') ?>"><?php echo __('entry value value') ; ?></label>
+ <?php echo tep_draw_input_field('value['.$languages[$i]['id'].']','value_'.$languages[$i]['id'], modprodextra::$cInfo[$languages[$i]['id']]['epf_value'], 'size=64 maxlength=64'); ?>
</p>
</fieldset>
Modified: trunk/catalog/admin/includes/gabarit/configuration/modprodextra/draw.value.listing.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/configuration/modprodextra/draw.value.listing.gab 2012-02-24 08:05:34 UTC (rev 4041)
+++ trunk/catalog/admin/includes/gabarit/configuration/modprodextra/draw.value.listing.gab 2012-02-25 10:20:08 UTC (rev 4042)
@@ -13,12 +13,12 @@
global $action, $languages;
?>
- <div class="button_nav">
- <?php printf(CsrtAction::getLink('button_nav', __('listing fields') ), '', tep_href_link(modprodextra::FILENAME, FILENAME_CFG_34. 'eid='.modprodextra::$eid.'&list_id=&vid=&parent=') ,'' );?>
- <?php printf(CsrtAction::getLink('button_nav', __('BUTTON_VALUE_ADD_LIST') ), '', tep_href_link(modprodextra::FILENAME, FILENAME_CFG_34. 'eid='.modprodextra::$eid.'&list_id=&vid=&parent=&action=value_new') ,'' );?>
+ <div class="button_nav">
+ <?php printf(CsrtAction::getLink('button_nav', __('listing fields') ), '', tep_href_link(modprodextra::FILENAME, FILENAME_CFG_34. 'eid='.modprodextra::$eid.'&list_id=&vid=&parent=') ,'' );?>
+ <?php printf(CsrtAction::getLink('button_nav', __('BUTTON_VALUE_ADD_LIST') ), '', tep_href_link(modprodextra::FILENAME, FILENAME_CFG_34. 'eid='.modprodextra::$eid.'&list_id=&vid=&parent=&action=value_new') ,'' );?>
+ </div>
- </div>
- <table class="dataTable" border="0" width="100%" cellspacing="0" cellpadding="2">
+<table class="dataTable" >
<thead>
<tr>
<th class="tcenter"><?php echo __('TABLE_HEADING_ID'); ?></th>
@@ -29,16 +29,16 @@
</tr>
</thead>
<tbody>
- <?php foreach (modprodextra::$list[0] as $k=>$value): ?>
- <tr class="dataTableRow <?php if($value['value_id'] == $vid) echo "Selected" ?>">
- <td class="tcenter"><?php echo $value['value_id']; ?></td>
- <td><?php echo $value['epf_value']; ?></td>
- <td class="tcenter"><?php echo $value['parent_id']; ?></td>
- <td class="tcenter"><?php echo $value['sort_order']; ?></td>
- <td class="row_action">
- <?php echo modprodextra::get_item_value_action($value); ?>
- </tr>
- <?php endforeach; ?>
-<!-- <tr><td colspan=5><?php //echo TEXT_PREVIEW . tep_draw_pull_down_menu('preview', tep_build_epf_pulldown($eid, $lid)); ?></td></tr> -->
- </tbody>
- </table>
+ <?php foreach (modprodextra::$list[0] as $k=>$value): ?>
+ <tr class="dataTableRow">
+ <td class="tcenter"><?php echo $value['value_id']; ?></td>
+ <td><?php echo $value['epf_value']; ?></td>
+ <td class="tcenter"><?php echo $value['parent_id']; ?></td>
+ <td class="tcenter"><?php echo $value['sort_order']; ?></td>
+ <td class="row_action">
+ <?php echo modprodextra::get_item_value_action($value); ?>
+ </tr>
+ <?php endforeach; ?>
+
+ </tbody>
+ </table>
Modified: trunk/catalog/admin/includes/languages/fr_FR/modules/configuration/modprodextra.txt
===================================================================
--- trunk/catalog/admin/includes/languages/fr_FR/modules/configuration/modprodextra.txt 2012-02-24 08:05:34 UTC (rev 4041)
+++ trunk/catalog/admin/includes/languages/fr_FR/modules/configuration/modprodextra.txt 2012-02-25 10:20:08 UTC (rev 4042)
@@ -1,52 +1,80 @@
<?php
/**
- @licence GPL 2005-2010 The osCSS developers - osCSS Open Source E-commerce
+ @licence GPL 2005-2012 The osCSS developers - osCSS Open Source E-commerce
@package oscss-2 <www http://www.oscss.org>
@version 2.1.1
- @date 24/10/11, 15:38
+ @date 24/02/2012, 15:38
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
*/
$lang['HEADING_TITLE']="Champs supplementaires pour les produits" ;
+/* Listing labels */
+ $lang['TABLE_HEADING_ID']="ID #" ;
+ $lang['TABLE_HEADING_LABEL']="Langage/Label" ;
+ $lang['TABLE_HEADING_ORDER']="Tri" ;
+ $lang['TABLE_HEADING_STATUS']="Statut" ;
+ $lang['TABLE_HEADING_USE_ADMIN']="Spe admin" ;
+ $lang['TABLE_HEADING_SPE_MODULE']="Spe Module" ;
+ $lang['TABLE_HEADING_VALUE']="Valeur" ;
+ $lang['TABLE_HEADING_PARENT']="Parent" ;
+ $lang['table heading action']="Action" ;
-$lang['HT_ADD_VALUE_LIST_LANG']="Ajout valeur de liste pour cette langue" ;
-$lang['TABLE_HEADING_ID']="ID #" ;
-$lang['TABLE_HEADING_LABEL']="Langage/Label" ;
-$lang['TABLE_HEADING_ORDER']="Tri" ;
-$lang['TABLE_HEADING_STATUS']="Statut" ;
-$lang['TABLE_HEADING_USE_ADMIN']="Spe admin" ;
-$lang['TABLE_HEADING_SPE_MODULE']="Spe Module" ;
-$lang['TABLE_HEADING_VALUE']="Valeur" ;
-$lang['TABLE_HEADING_PARENT']="Parent" ;
-$lang['table heading action']="Action" ;
-$lang['TEXT_YES']="Actif" ;
-$lang['TEXT_NO']="Inactif" ;
+
+/* labels Edit / new */
+ $lang['heading new']="Creer un nouveau champ" ;
+ $lang['heading edit']="Edite un champ existant" ;
+
+ $lang['entry label']="Label: " ;
+ $lang['entry label help']="Label: " ;
+ $lang['entry label format']="Format : " ;
+ $lang['entry label format help']="Le format vous permet de definir l'ordonancement du label et du champs lors de l'affichage de ce champs " ;
+ $lang['entry search']="Actif dans la recherche: " ;
+ $lang['entry search help']="Rend actif ce champ dans la recherche avancée " ;
+
+ $lang['ENTRY_ACTIVE']="Mode language : " ;
+ $lang['ENTRY_ACTIVE_HELP']="Ce champs contient une valeur internationalisable , une par langue. Aussi vous pourrez insérer une valeur personnalisée par langue" ;
+ $lang['ENTRY_ACTIVATE_NOW']="Statut: " ;
+ $lang['ENTRY_ORDER']="Tri: " ;
+ $lang['ENTRY_VALUE']="Valeur : " ;
+ $lang['ENTRY_UNIQ_KEY']="Clef : " ;
+ $lang['ENTRY_UNIQ_KEY_HELP']="Valeur de clef (unique), pour exploiter plus simplement ce label, et obtenir une identfication simple " ;
+ $lang['ENTRY_USE_ADMIN']="Special pour admin uniquement: " ;
+ $lang['ENTRY_SPECIFIQUE_MODULE']="Propriétaire: " ;
+ $lang['ENTRY_SPECIFIQUE_MODULE_HELP']="Nom du module qui est propriétaire de ce champ. Valeur non listée " ;
+ $lang['ENTRY_VALUE_LIST']="Uses A List Of Values: " ;
+
+ $lang['ENTRY_LISTING']="Voir dans les listings: " ;
+ $lang['ENTRY_SIZE']="Max caratères " ;
+ $lang['ENTRY_SIZE_HELP']="Le nombre maximun autorisé dans le champ (ignored if field uses value list): " ;
+ $lang['ENTRY_META']="Use Value Of Field As A META Keyword For Search Engines: " ;
+ $lang['ENTRY_RESTRICT']="Allow Field To Be Used To Restrict Product Listings (requires value list): " ;
+ $lang['ENTRY_RESTRICT_HELP']="Allow Field To Be Used To Restrict Product Listings (requires value list): " ;
+ $lang['ENTRY_CHAIN']="Show Chain Of Parent Values For Field (requires value list): " ;
+
+
+/* labels Delete */
+
+/* value edit */
+ $lang['heading extra fields list add value']="Edition d'une valeur de liste de ce champs" ;
+ $lang['entry value sort']="Tri :" ;
+ $lang['entry value sort help']="" ;
+ $lang['entry value value']="Valeur : " ;
+ $lang['entry value value help']="" ;
+
+/* value delete */
+ $lang['heading delete value']="Supprimer cette valeur du champs" ;
+ $lang['text delete value']="Vous êtes sûr de vouloir supprimer cette valeur de la liste des valeur de ce champ" ;
+
+
+$lang['text yes']="Actif" ;
+$lang['text no']="Inactif" ;
+
$lang['BUTTON_NEW']="Créer un nouveau champ" ;
$lang['BUTTON_EDIT_VALUES']="Éditer la liste des valeurs" ;
$lang['BUTTON_VALUE_ADD_LIST']="Ajouter une valeur à la liste " ;
-$lang['ENTRY_LABEL']="Label: " ;
-$lang['ENTRY_ACTIVE']="Mode language : " ;
-$lang['ENTRY_ACTIVE_HELP']="Ce champs contient une valeur internationalisable , une par langue. Aussi vous pourrez insérer une valeur personnalisée par langue" ;
-$lang['ENTRY_ACTIVATE_NOW']="Statut: " ;
-$lang['ENTRY_ORDER']="Tri: " ;
-$lang['ENTRY_VALUE']="Valeur : " ;
-$lang['ENTRY_UNIQ_KEY']="Clef : " ;
-$lang['ENTRY_UNIQ_KEY_HELP']="Valeur de clef (unique), pour exploiter plus simplement ce label, et obtenir une identfication simple " ;
-$lang['ENTRY_USE_ADMIN']="Special pour admin uniquement: " ;
-$lang['ENTRY_SPECIFIQUE_MODULE']="Propriétaire: " ;
-$lang['ENTRY_SPECIFIQUE_MODULE_HELP']="Nom du module qui est propriétaire de ce champ. Valeur non listée " ;
-$lang['ENTRY_VALUE_LIST']="Uses A List Of Values: " ;
-$lang['ENTRY_SEARCH']="Actif dans la recherche: " ;
-$lang['ENTRY_SEARCH_HELP']="Rend actif ce champ dans la recherche avancée " ;
-$lang['ENTRY_LISTING']="Voir dans les listings: " ;
-$lang['ENTRY_SIZE']="Max caratères " ;
-$lang['ENTRY_SIZE_HELP']="Le nombre maximun autorisé dans le champ (ignored if field uses value list): " ;
-$lang['ENTRY_META']="Use Value Of Field As A META Keyword For Search Engines: " ;
-$lang['ENTRY_RESTRICT']="Allow Field To Be Used To Restrict Product Listings (requires value list): " ;
-$lang['ENTRY_RESTRICT_HELP']="Allow Field To Be Used To Restrict Product Listings (requires value list): " ;
-$lang['ENTRY_CHAIN']="Show Chain Of Parent Values For Field (requires value list): " ;
+
$lang['ERROR_OUTOFRANGE']="Maximum size must be a number between 1 and 255!" ;
$lang['ERROR_ENTRY_REQUIRED']="Entry is missing! " ;
$lang['TEXT_ENABLED']="Enabled" ;
@@ -57,8 +85,7 @@
$lang['TEXT_NOT_APPLY']="Non appliqué " ;
$lang['TEXT_RESTRICTS']="Restricts Product Listings: " ;
$lang['TEXT_SHOW_PARENTS']="Show Parent Values: " ;
-$lang['HEADING_NEW']="Creating New Field" ;
-$lang['HEADING_EDIT']="Editing Existing Field #" ;
+
$lang['ERROR_ACTIVE']="Field must be active for at least one language!" ;
$lang['ERROR_LABEL']="Field label for active language %s must not be blank!" ;
$lang['WARNING_TRUNCATE']="WARNING: Data will be lost if you reduce the field length to this size! Currently %d product descriptions contain values that are longer than this size! To avoid data loss this field would need to be at least %d characters long. If you really want to reduce the size of this field and cause data to be truncated then click the Save button to confirm the change." ;
Modified: trunk/catalog/admin/includes/modules/configuration/modprodextra.php
===================================================================
--- trunk/catalog/admin/includes/modules/configuration/modprodextra.php 2012-02-24 08:05:34 UTC (rev 4041)
+++ trunk/catalog/admin/includes/modules/configuration/modprodextra.php 2012-02-25 10:20:08 UTC (rev 4042)
@@ -315,7 +315,9 @@
tep_redirect(tep_href_link(FILENAME_CONFIGURATION, FILENAME_CFG_34 . 'eid=' . self::$eid.'&action=value_listing'));
break;
- case 'value_delete':
+
+
+ case 'value_delete_confirm':
if ($confirm == 'yes') {
if (isset($_GET['used']) && ($_GET['used'] > 0)) {
$double_check = 'yes';
@@ -331,6 +333,7 @@
}
break;
+ case 'value_delete':
case 'value_edit':
$list_id = (isset($_GET['list_id']) ? $_GET['list_id'] : '_');
@@ -393,6 +396,7 @@
/**
@remarks value edit
*/
+ case 'value_delete':
case 'value_edit':
$sql = tep_db_query($sql_="select * from " . TABLE_PRODUCTS_EXTRA_FIELDS_VALUES . " where epf_id = " . self::$eid. " and value_id = " . (int)$_GET['vid'] . " order by sort_order, epf_value");
while ($v = tep_db_fetch_array($sql)) {
@@ -528,13 +532,18 @@
self::$list= $this->load_db_values();
$gab = 'value.listing';
break;
+
case 'value_new':
case 'value_edit':
-
self::$cInfo=$this->load_db_values();
$gab = 'value.edit';
break;
+ case 'value_delete':
+ self::$cInfo=$this->load_db_values();
+ $gab = 'value.delete';
+ break;
+
case 'new':
case 'edit':
@@ -634,51 +643,7 @@
}
- /**
- Colonne droite list labels
- */
- public static function draw_right_colum($selected=''){
- if(empty($selected)) return;
- $heading = array();
- $contents = array();
- $admin_language = '1';
- if (!empty(self::$eid)) {
- $heading[] = array('text' => TABLE_HEADING_ID . ' ' . self::$eid);
- foreach (self::$selected_labels as $label) {
- $heading[] = array('text' => self::$lang[$label['languages_id']]['name'] . ': ' . $label['epf_label']);
- if ($label['languages_id'] == $languages_id) $admin_language = $languages_id;
- }
- $contents[] = array('align' => 'center', 'text' => '<a class="button" href="' . tep_href_link(FILENAME_CONFIGURATION, tep_get_all_get_params(array('action','flag','eid')) . 'eid=' . self::$eid . '&action=edit') . '">' . IMAGE_EDIT . '</a> <a class="button" href="' . tep_href_link(FILENAME_CONFIGURATION, tep_get_all_get_params(array('action','flag','eid')) .'eid=' . self::$eid . '&action=delete') . '">' . IMAGE_DELETE . '</a>');
- if ($selected->epf_uses_value_list) {
- $contents[] = array('align' => 'center', 'text' => tep_draw_form('edit_values', FILENAME_CONFIGURATION, tep_get_all_get_params(array('action','flag','list_id')) . 'action=value_listing&list_id=' . $selected->epf_id . '_' . $admin_language) . tep_draw_input_field('edit_values','edit_values', BUTTON_EDIT_VALUES, 'alt="' . BUTTON_EDIT_VALUES . '"', false, 'submit',' class="button"') . '</form>');
- }
- $contents[] = array('text' => TABLE_HEADING_STATUS . ': ' . ($selected->epf_status ? TEXT_ENABLED : TEXT_DISABLED));
- $contents[] = array('text' => ENTRY_UNIQ_KEY . $selected->epf_key);
- $contents[] = array('text' => ENTRY_USE_ADMIN . $selected->epf_admin);
- $contents[] = array('text' => ENTRY_SPECIFIQUE_MODULE . $selected->epf_special_mod);
- $contents[] = array('text' => ENTRY_ORDER . $selected->epf_order);
- $contents[] = array('text' => TEXT_SIZE . $selected->epf_size);
- $contents[] = array('text' => TEXT_SEARCHABLE . ($selected->epf_advanced_search ? TEXT_YES : TEXT_NO));
- $contents[] = array('text' => ENTRY_LISTING . ($selected->epf_show_in_listing ? TEXT_YES : TEXT_NO));
- $contents[] = array('text' => TEXT_META . ($selected->epf_use_as_meta_keyword ? TEXT_YES : TEXT_NO));
- $contents[] = array('text' => ENTRY_VALUE_LIST . ($selected->epf_uses_value_list ? TEXT_YES : TEXT_NO));
- $contents[] = array('text' => TEXT_RESTRICTS . ($selected->epf_uses_value_list ? ($selected->epf_use_to_restrict_listings ? TEXT_YES : TEXT_NO) : TEXT_NOT_APPLY));
- $contents[] = array('text' => TEXT_SHOW_PARENTS . ($selected->epf_uses_value_list ? ($selected->epf_show_parent_chain ? TEXT_YES : TEXT_NO) : TEXT_NOT_APPLY));
- }
- ?>
- <div class="box_right">
- <?php
- if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {
- $box = new box;
- echo $box->infoBox($heading, $contents);
- }
- ?>
- </div>
- <?php
- }
-
-
/** SPECIFIQUE */
/**
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2012-02-24 08:05:42
|
Revision: 4041
http://oscss.svn.sourceforge.net/oscss/?rev=4041&view=rev
Author: oscim
Date: 2012-02-24 08:05:34 +0000 (Fri, 24 Feb 2012)
Log Message:
-----------
correction et amelioration gestion des extra fields product
Modified Paths:
--------------
trunk/catalog/admin/includes/gabarit/configuration/modprodextra/draw.label.edit.gab
trunk/catalog/admin/includes/modules/configuration/modprodextra.php
Added Paths:
-----------
trunk/catalog/admin/includes/classes/drivers/sqlproductsextrafields.php
trunk/catalog/admin/includes/gabarit/configuration/modprodextra/draw.label.listing.gab
trunk/catalog/admin/includes/gabarit/configuration/modprodextra/draw.label.new.gab
Removed Paths:
-------------
trunk/catalog/admin/includes/gabarit/configuration/modprodextra/draw.listing.gab
Added: trunk/catalog/admin/includes/classes/drivers/sqlproductsextrafields.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlproductsextrafields.php (rev 0)
+++ trunk/catalog/admin/includes/classes/drivers/sqlproductsextrafields.php 2012-02-24 08:05:34 UTC (rev 4041)
@@ -0,0 +1,419 @@
+<?php if (!defined('HTTP_SERVER')) die('You can not access this file directly!');
+/**
+ @licence GPL 2005-2012 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/02/12, 08:07
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+ @class sqlproductsextrafields
+ @file sqlproductsextrafields.php
+
+*/
+
+
+class sqlproductsextrafields
+ 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();
+
+
+ $sql_data_array['epf_order'] =(isset($option['order']))? tep_db_prepare_input($option['order']) : 0 ;
+ $sql_data_array['epf_status'] =(isset($option['status']))? tep_db_prepare_input($option['status']) : 0;
+ $sql_data_array['epf_uses_value_list'] =(isset($option['uses_value_list'])) ? tep_db_prepare_input($option['uses_value_list']) : 0;
+ $sql_data_array['epf_advanced_search'] =(isset($option['advanced_search']))? tep_db_prepare_input($option['advanced_search']): 0;
+ $sql_data_array['epf_show_in_listing'] = (isset($option['show_in_listing'])) ? tep_db_prepare_input($option['show_in_listing']): 0;
+ $sql_data_array['epf_use_as_meta_keyword'] =(isset($option['use_as_meta_keyword']))? tep_db_prepare_input($option['use_as_meta_keyword']): 0;
+ $sql_data_array['epf_use_to_restrict_listings'] = (isset($option['use_to_restrict_listings'])) ? tep_db_prepare_input($option['use_to_restrict_listings']): 0;
+ $sql_data_array['epf_admin'] =(isset($option['admin']))? tep_db_prepare_input($option['admin']) : 0;
+
+ if(isset($option['size'])) $sql_data_array['epf_size'] = tep_db_prepare_input($option['size']);
+ if(isset($option['show_parent_chain'])) $sql_data_array['epf_show_parent_chain'] = tep_db_prepare_input($option['show_parent_chain']);
+ if(isset($option['key'])) $sql_data_array['epf_key'] = tep_db_prepare_input($option['key']);
+ if(isset($option['special_mod'])) $sql_data_array['epf_special_mod'] = tep_db_prepare_input($option['special_mod']);
+
+
+
+ $res=tep_db_perform(TABLE_PRODUCTS_EXTRA_FIELDS, $sql_data_array);
+
+ if(!$res)
+ return $res;
+ else
+ return $res->__get('insertId');
+ }
+
+ /**
+ @brief update ligne in table configuration
+ */
+ public static function update($option){
+ self::getInstance();
+
+ if(!isset($option['id']))
+ return false;
+
+ $where ='';
+ if(isset($option['id'])) $where .="AND epf_id = '".(int)$option['id']."' ";
+ if(isset($option['key'])) $where .="AND epf_key = '".(int)$option['key']."' ";
+
+ if($where=='')
+ return false;
+
+ if(isset($option['order']))$sql_data_array['epf_order'] = tep_db_prepare_input($option['order']);
+ if(isset($option['status'])) $sql_data_array['epf_status'] = tep_db_prepare_input($option['status']);
+ if(isset($option['uses_value_list'])) $sql_data_array['epf_uses_value_list'] = tep_db_prepare_input($option['uses_value_list']);
+ if(isset($option['advanced_search'])) $sql_data_array['epf_advanced_search'] = tep_db_prepare_input($option['advanced_search']);
+ if(isset($option['show_in_listing']))$sql_data_array['epf_show_in_listing'] = tep_db_prepare_input($option['show_in_listing']);
+ if(isset($option['size'])) $sql_data_array['epf_size'] = tep_db_prepare_input($option['size']);
+ if(isset($option['use_as_meta_keyword'])) $sql_data_array['epf_use_as_meta_keyword'] = tep_db_prepare_input($option['use_as_meta_keyword']);
+ if(isset($option['use_to_restrict_listings'])) $sql_data_array['epf_use_to_restrict_listings'] = tep_db_prepare_input($option['use_to_restrict_listings']);
+ if(isset($option['show_parent_chain']))$sql_data_array['epf_show_parent_chain'] = tep_db_prepare_input($option['show_parent_chain']);
+ if(isset($option['key'])) $sql_data_array['epf_key'] = tep_db_prepare_input($option['key']);
+ if(isset($option['admin'])) $sql_data_array['epf_admin'] = tep_db_prepare_input($option['admin']);
+ if(isset($option['special_mod'])) $sql_data_array['epf_special_mod'] = tep_db_prepare_input($option['special_mod']);
+
+ $res=tep_db_perform(TABLE_PRODUCTS_EXTRA_FIELDS, $sql_data_array, 'update' , substr($where,3) );
+
+ return $res;
+ }
+
+ /**
+ @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 epf_id = '".(int)$option['id']."' ";
+ if(isset($option['key'])) $sql .="AND epf_key = '".(int)$option['key']."' ";
+
+
+ if($sql=='')
+ return false;
+
+
+ $sql="SELECT * FROM " . TABLE_PRODUCTS_EXTRA_FIELDS . " 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();
+
+ $sql ="";
+
+ if(isset($option['id'])) $sql .="AND epf_id = '".(int)$option['id']."' ";
+ if(isset($option['key'])) $sql .="AND epf_key = '".(int)$option['key']."' ";
+
+
+ if(strlen($sql) < 5)
+ return false;
+
+ $res = $DB->query($s="SELECT epf_id FROM " . TABLE_PRODUCTS_EXTRA_FIELDS ." WHERE ". substr($sql,3) );
+
+ $row=$res->fetchAssoc();
+
+ // depend tables
+ sqlproductsextrafieldslabels::delete(array('id'=>$row['epf_id']));
+
+
+ $DB->query($s="DELETE FROM " . TABLE_PRODUCTS_EXTRA_FIELDS ." WHERE ". substr($sql,3) );
+
+ return true;
+ }
+
+ /**
+ @brief
+ @return array product empty
+ */
+ public static function Specimen($shortkey=false){
+ $par = array('epf_id' => '',
+ 'epf_order' => '',
+ 'epf_status' => '',
+ 'epf_uses_value_list' => '',
+ 'epf_advanced_search' => '',
+ 'epf_show_in_listing' => '',
+ 'epf_size' => '',
+ 'epf_use_as_meta_keyword' => '',
+ 'epf_use_to_restrict_listings' => '',
+ 'epf_show_parent_chain' => '',
+ 'epf_key' => '',
+ 'epf_admin' => '',
+ 'epf_special_mod' => '',
+ );
+
+ 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,'epf_') ===0)
+ $key=substr($key,4);
+
+ $object->$key = $value;
+ }
+
+ return $object;
+ }
+
+}
+
+
+class sqlproductsextrafieldslabels
+ 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['id']))
+ return 'id';
+
+ $sql_data_array['epf_id'] = tep_db_prepare_input($option['id']);
+ $sql_data_array['languages_id'] =(isset($option['languages_id']))? tep_db_prepare_input($option['languages_id']) : 0;
+ $sql_data_array['epf_active_for_language'] =(isset($option['active_for_language']))? tep_db_prepare_input($option['active_for_language']): 0;
+
+ $sql_data_array['epf_label'] =(isset($option['label'])) ? tep_db_prepare_input($option['label']) : '';
+ $sql_data_array['epf_format'] =(isset($option['format']))? tep_db_prepare_input($option['format']): '%label% %input%';
+
+
+ if(isset($option['label_help'])) $sql_data_array['epf_label_help'] = tep_db_prepare_input($option['label_help']);
+
+
+ $res=tep_db_perform(TABLE_PRODUCTS_EXTRA_FIELDS_LABELS, $sql_data_array);
+
+ if(!$res)
+ return $res;
+ else
+ return $res->__get('insertId');
+ }
+
+ /**
+ @brief update ligne in table configuration
+ */
+ public static function update($option){
+ self::getInstance();
+
+ if(!isset($option['id']))
+ return false;
+
+ $where ='';
+ if(isset($option['id'])) $where .="AND epf_id = '".(int)$option['id']."' ";
+ if(isset($option['languages_id'])) $where .="AND languages_id = '".(int)$option['languages_id']."' ";
+
+ if($where=='')
+ return false;
+
+ if(isset($option['active_for_language'])) $sql_data_array['epf_active_for_language'] = tep_db_prepare_input($option['active_for_language']);
+ if(isset($option['label'])) $sql_data_array['epf_label'] = tep_db_prepare_input($option['label']);
+ if(isset($option['format'])) $sql_data_array['epf_format'] = tep_db_prepare_input($option['format']);
+ if(isset($option['label_help'])) $sql_data_array['epf_label_help'] = tep_db_prepare_input($option['label_help']);
+
+ $res=tep_db_perform(TABLE_PRODUCTS_EXTRA_FIELDS_LABELS, $sql_data_array, 'update' , substr($where,3) );
+
+ return $res;
+ }
+
+ /**
+ @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 epf_id = '".(int)$option['id']."' ";
+ if(isset($option['languages_id'])) $sql .="AND languages_id = '".(int)$option['languages_id']."' ";
+
+
+ if($sql=='')
+ return false;
+
+
+ $sql="SELECT * FROM " . TABLE_PRODUCTS_EXTRA_FIELDS_LABELS . " 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();
+
+ $sql ="";
+
+ if(isset($option['id'])) $sql .="AND epf_id = '".(int)$option['id']."' ";
+ if(isset($option['languages_id'])) $sql .="AND languages_id = '".(int)$option['languages_id']."' ";
+
+
+ if(strlen($sql) < 5)
+ return false;
+
+ $DB->query($s="DELETE FROM " . TABLE_PRODUCTS_EXTRA_FIELDS_LABELS ." WHERE ". substr($sql,3) );
+
+ return true;
+ }
+
+ /**
+ @brief
+ @return array product empty
+ */
+ public static function Specimen($shortkey=false){
+ $par = array(
+ 'epf_id' => '',
+ 'languages_id' => '',
+ 'epf_label' => '',
+ 'epf_active_for_language' => '',
+ 'epf_label_help' => '',
+ 'epf_format' => '',
+ );
+
+ 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,'epf_') ===0)
+ $key=substr($key,4);
+
+ $object->$key = $value;
+ }
+
+ return $object;
+ }
+
+}
+?>
\ No newline at end of file
Modified: trunk/catalog/admin/includes/gabarit/configuration/modprodextra/draw.label.edit.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/configuration/modprodextra/draw.label.edit.gab 2012-02-22 21:04:01 UTC (rev 4040)
+++ trunk/catalog/admin/includes/gabarit/configuration/modprodextra/draw.label.edit.gab 2012-02-24 08:05:34 UTC (rev 4041)
@@ -23,25 +23,30 @@
<?php echo tep_draw_radio_field('status','status', '1', (((int)modprodextra::$cInfo['epf_status']==1)? true : false) ). ' ' .__('TEXT_YES'). ' ' . tep_draw_radio_field('status','status', '0', (((int)modprodextra::$cInfo['epf_status']==0)? true : false) ). ' ' .__('TEXT_NO'); ?>
- <?php echo tep_draw_hidden_field('value_list','value_list', (((int)modprodextra::$cInfo['epf_uses_value_list']==1)? '1' : '0')) ?>
- <?php echo tep_draw_hidden_field('epf_active_for_language','epf_active_for_language', (((int)modprodextra::$cInfo['epf_active_for_language']==1)? '1' : '0')) ?>
+ <?php echo tep_draw_hidden_field('value_list','value_list', (((int)modprodextra::$cInfo['epf_uses_value_list']==1)? '1' : '0')) ?>
+ <?php echo tep_draw_hidden_field('epf_active_for_language','epf_active_for_language', (((int)modprodextra::$cInfo['epf_active_for_language']==1)? '1' : '0')) ?>
</p>
<fieldset class="tabs_lang block_field">
<ul>
- <?php for ($i=0, $n=sizeof($languages); $i<$n; $i++) { ?>
- <li><?php echo '<a href="#products_name-' . ($i+1).'" >' . tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . ' ' . $languages[$i]['name'] . '</a>' ?></li>
- <?php } ?>
+ <?php for ($i=0, $n=sizeof($languages); $i<$n; $i++) { ?>
+ <li><?php echo '<a href="#products_name-' . ($i+1).'" >' . tep_language_image ( $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . ' ' . $languages[$i]['name'] . '</a>' ?></li>
+ <?php } ?>
</ul>
- <?php for ($i=0, $n=sizeof($languages); $i<$n; $i++) { ?>
- <ul id="<?php echo 'products_name-'.($i+1) ?>">
- <li class="block_input">
- <?php echo __('ENTRY_LABEL') . tep_draw_input_field('label_' . $languages[$i]['id'],'label_' . $languages[$i]['id'], modprodextra::$pInfo[$languages[$i]['id']]['epf_label'], "size=64 maxlength=64") ?>
- </li>
- </ul>
- <?php } ?>
+
+ <?php for ($i=0, $n=sizeof($languages); $i<$n; $i++) { ?>
+ <ul id="<?php echo 'products_name-'.($i+1) ?>">
+ <li class="block_input">
+ <?php echo __('ENTRY_LABEL') . tep_draw_input_field('label_' . $languages[$i]['id'],'label_' . $languages[$i]['id'], modprodextra::$pInfo[$languages[$i]['id']]['epf_label'], "size=64 maxlength=64") ?>
+ </li>
+ <li class="block_input">
+ <?php echo __('entry label format') . tep_draw_input_field('format_' . $languages[$i]['id'],'format_' . $languages[$i]['id'], modprodextra::$pInfo[$languages[$i]['id']]['epf_format'], "size=64 maxlength=64") ?>
+ </li>
+ </ul>
+ <?php } ?>
+
</fieldset>
<p class="block_input">
Added: trunk/catalog/admin/includes/gabarit/configuration/modprodextra/draw.label.listing.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/configuration/modprodextra/draw.label.listing.gab (rev 0)
+++ trunk/catalog/admin/includes/gabarit/configuration/modprodextra/draw.label.listing.gab 2012-02-24 08:05:34 UTC (rev 4041)
@@ -0,0 +1,67 @@
+<?php
+/**
+ @licence GPL 2005-2011 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 24/10/11, 15:38
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+ @brief gabarit for listing extra fields products
+*/
+?>
+
+<div id="ssmenu">
+ <?php echo tep_ssmenu_configuration($_GET['gparentID']) ?>
+</div>
+
+
+<h3><?php echo __('HEADING_TITLE') ?></h3>
+
+ <div class="button_nav">
+ <?php printf(CsrtAction::getLink('button_nav', __('BUTTON_NEW') ), '', tep_href_link(modprodextra::FILENAME, FILENAME_CFG_34. '&list_id=&vid=&action=new') ,'' );?>
+ </div>
+<div class="box_uniq">
+
+ <table class="dataTable">
+ <thead>
+ <tr>
+ <th><?php echo __('TABLE_HEADING_ID'); ?></th>
+ <th><?php echo __('TABLE_HEADING_LABEL'); ?></th>
+ <th class="tright"><?php echo __('TABLE_HEADING_ORDER'); ?></th>
+ <th class="tcenter"><?php echo __('TABLE_HEADING_STATUS'); ?></th>
+ <th class="tcenter"><?php echo __('TABLE_HEADING_USE_ADMIN'); ?></th>
+ <th class="tcenter"><?php echo __('TABLE_HEADING_SPE_MODULE'); ?></th>
+ <th class="row_action"><?php echo __('table heading action'); ?></th>
+ </tr>
+ </thead>
+ <tbody>
+ <?php foreach(modprodextra::$list as $epf) {
+ if ($epf->epf_id == modprodextra::$eid) $selected = $epf; ?>
+ <tr class="dataTableRow <?php if ($epf->epf_id == modprodextra::$eid) echo "Selected" ; ?>">
+ <td class="dataTableContent"><?php echo $epf->epf_id; ?></td>
+ <td class="dataTableContent">
+ <?php $label_query = tep_db_query("select languages_id, epf_label from " . TABLE_PRODUCTS_EXTRA_FIELDS_LABELS . " where (epf_id = " . (int)$epf->epf_id . ") ");
+ while ($label = tep_db_fetch_array($label_query)) {
+ echo tep_image(DIR_WS_CATALOG_LANGUAGES . modprodextra::$lang[$label['languages_id']]['directory'] . '/images/' . modprodextra::$lang[$label['languages_id']]['image'], modprodextra::$lang[$label['languages_id']]['name']) . ' ' . $label['epf_label'] . '<br>';
+ }
+ ?>
+ </td>
+ <td class="tcenter"><?php echo $epf->epf_order; ?></td>
+ <td class="tcenter">
+ <?php echo modprodextra::get_item_status($epf); ?>
+ </td>
+ <td class="tcenter">
+ <?php echo modprodextra::get_item_admin($epf); ?>
+ </td>
+ <td class="tcenter">
+ <?php echo $epf->epf_special_mod ?>
+ </td>
+ <td class="row_action">
+ <?php echo modprodextra::get_item_action($epf); ?>
+ </td>
+ </tr>
+ <?php } ?>
+ </tbody>
+ </table>
+</div>
Added: trunk/catalog/admin/includes/gabarit/configuration/modprodextra/draw.label.new.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/configuration/modprodextra/draw.label.new.gab (rev 0)
+++ trunk/catalog/admin/includes/gabarit/configuration/modprodextra/draw.label.new.gab 2012-02-24 08:05:34 UTC (rev 4041)
@@ -0,0 +1,48 @@
+<?php
+/**
+ @licence GPL 2005-2012 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 08/02/2012, 15:38
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+ @brief gabarit for listing extra fields products, create new entry
+*/
+
+global $action, $languages;
+?>
+ <div class="box_unique">
+ <h4><?php echo (($action == 'edit')? __('HEADING_NEW') : __('HEADING_EDIT') . modprodextra::$eid ) ?></h4>
+
+ <?php echo tep_draw_form('field_entry',FILENAME_CONFIGURATION, tep_get_all_get_params(array('action','eid','confirm')). 'action=insert', 'post'); ?>
+
+
+
+
+
+ <p class="block_input">
+ <label><?php echo __('ENTRY_VALUE_LIST') ?></label>
+ <?php echo tep_draw_radio_field('value_list','value_list', '1',(((int)modprodextra::$cInfo['epf_uses_value_list']==1)? true : false)) . ' ' .__('TEXT_YES'). ' ' . tep_draw_radio_field('value_list','value_list', '0',(((int)modprodextra::$cInfo['epf_uses_value_list']==0)? true : false)) . ' ' .__('TEXT_NO'); ?>
+ </p>
+
+
+ <p class="block_input">
+ <label for="epf_active_for_language" title="<?php echo __('ENTRY_ACTIVE_HELP') ?>"><?php echo __('ENTRY_ACTIVE'). tep_image(DIR_WS_ICONS . 'icon_help.gif'); ?></label>
+ <?php echo tep_draw_radio_field('epf_active_for_language' ,'epf_active_for_language' , '1', (((int)modprodextra::$cInfo['epf_active_for_language']==1)? true : false) ) . ' ' . __('TEXT_YES') .
+ ' ' . tep_draw_radio_field('epf_active_for_language' ,'epf_active_for_language', '0', (((int)modprodextra::$cInfo['epf_active_for_language']==0)? true : false) ) . ' ' . __('TEXT_NO'); ?>
+ </p>
+
+
+
+
+
+ <div class="button_nav">
+ <?php echo tep_image_submit('button_save.gif', __('modprodextra extra label add')) .
+ tep_js_back(tep_href_link(modprodextra::FILENAME, tep_get_all_get_params(array('action','flag','eid')) ), IMAGE_CANCEL) ;
+
+// ' <a class="button" href="' . tep_href_link(FILENAME_CONFIGURATION, tep_get_all_get_params(array('action','flag','eid')) . 'eid=' . modprodextra::$eid) . '">' . IMAGE_CANCEL . "</a>\n" ?>
+ </div>
+ </form>
+
+ </div>
Deleted: trunk/catalog/admin/includes/gabarit/configuration/modprodextra/draw.listing.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/configuration/modprodextra/draw.listing.gab 2012-02-22 21:04:01 UTC (rev 4040)
+++ trunk/catalog/admin/includes/gabarit/configuration/modprodextra/draw.listing.gab 2012-02-24 08:05:34 UTC (rev 4041)
@@ -1,78 +0,0 @@
-<?php
-/**
- @licence GPL 2005-2011 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 24/10/11, 15:38
- @author oscim <mail aur...@os...> <www http://www.oscim.fr>
- @encode UTF-8
- @brief gabarit for listing extra fields products
-*/
-?>
-
-<div id="ssmenu">
- <?php echo tep_ssmenu_configuration($_GET['gparentID']) ?>
-</div>
-
-
-<h3><?php echo __('HEADING_TITLE') ?></h3>
-
- <div class="button_nav">
- <?php printf(CsrtAction::getLink('button_nav', __('BUTTON_NEW') ), '', tep_href_link(modprodextra::FILENAME, FILENAME_CFG_34. '&list_id=&vid=&action=new') ,'' );?>
- </div>
-<div class="box_uniq">
-
- <table class="dataTable">
- <thead>
- <tr>
- <th><?php echo __('TABLE_HEADING_ID'); ?></th>
- <th><?php echo __('TABLE_HEADING_LABEL'); ?></th>
- <th class="tright"><?php echo __('TABLE_HEADING_ORDER'); ?></th>
- <th class="tcenter"><?php echo __('TABLE_HEADING_STATUS'); ?></th>
- <th class="tcenter"><?php echo __('TABLE_HEADING_USE_ADMIN'); ?></th>
- <th class="tcenter"><?php echo __('TABLE_HEADING_SPE_MODULE'); ?></th>
- <th class="row_action"><?php echo __('table heading action'); ?></th>
- </tr>
- </thead>
- <tbody>
- <?php foreach(modprodextra::$list as $epf) {
- if ($epf->epf_id == modprodextra::$eid) $selected = $epf; ?>
- <tr class="dataTableRow <?php if ($epf->epf_id == modprodextra::$eid) echo "Selected" ; ?>">
- <td class="dataTableContent"><?php echo $epf->epf_id; ?></td>
- <td class="dataTableContent">
- <?php $label_query = tep_db_query("select languages_id, epf_label from " . TABLE_PRODUCTS_EXTRA_FIELDS_LABELS . " where (epf_id = " . (int)$epf->epf_id . ") ");
- while ($label = tep_db_fetch_array($label_query)) {
- echo tep_image(DIR_WS_CATALOG_LANGUAGES . modprodextra::$lang[$label['languages_id']]['directory'] . '/images/' . modprodextra::$lang[$label['languages_id']]['image'], modprodextra::$lang[$label['languages_id']]['name']) . ' ' . $label['epf_label'] . '<br>';
- }
- ?>
- </td>
- <td class="tcenter"><?php echo $epf->epf_order; ?></td>
- <td class="tcenter">
- <?php
- if ($epf->epf_status == '1') {
- echo tep_image(DIR_WS_ICONS . 'icon_status_green.gif', IMAGE_ICON_STATUS_GREEN) . ' <a href="' . tep_href_link(FILENAME_CONFIGURATION, tep_get_all_get_params(array('action','flag','eid')) . 'action=setflag&flag=0&eid=' . $epf->epf_id) . '">' . tep_image(DIR_WS_ICONS . 'icon_status_red_light.gif', IMAGE_ICON_STATUS_RED_LIGHT) . '</a>';
- } else {
- echo '<a href="' . tep_href_link(FILENAME_CONFIGURATION, tep_get_all_get_params(array('action','flag','eid')) . 'action=setflag&flag=1&eid=' . $epf->epf_id) . '">' . tep_image(DIR_WS_ICONS . 'icon_status_green_light.gif', IMAGE_ICON_STATUS_GREEN_LIGHT) . '</a> ' . tep_image(DIR_WS_ICONS . 'icon_status_red.gif', IMAGE_ICON_STATUS_RED);
- }
- ?>
- </td>
- <td class="tcenter">
- <?php
- if ($epf->epf_admin == '1') {
- echo tep_image(DIR_WS_ICONS . 'icon_status_green.gif', IMAGE_ICON_STATUS_GREEN) . ' <a href="' . tep_href_link(FILENAME_CONFIGURATION, tep_get_all_get_params(array('action','flag_admin','eid')) . 'action=setflag&flag_admin=0&eid=' . $epf->epf_id) . '">' . tep_image(DIR_WS_ICONS . 'icon_status_red_light.gif', IMAGE_ICON_STATUS_RED_LIGHT) . '</a>';
- } else {
- echo '<a href="' . tep_href_link(FILENAME_CONFIGURATION, tep_get_all_get_params(array('action','flag_admin','eid')) . 'action=setflag&flag_admin=1&eid=' . $epf->epf_id) . '">' . tep_image(DIR_WS_ICONS . 'icon_status_green_light.gif', IMAGE_ICON_STATUS_GREEN_LIGHT) . '</a> ' . tep_image(DIR_WS_ICONS . 'icon_status_red.gif', IMAGE_ICON_STATUS_RED);
- }
- ?>
- </td>
- <td class="tcenter">
- <?php echo $epf->epf_special_mod ?>
- </td>
- <td class="row_action">
- <?php echo modprodextra::get_item_action($epf); ?> </td>
- </tr>
- <?php } ?>
- </tbody>
- </table>
-</div>
Modified: trunk/catalog/admin/includes/modules/configuration/modprodextra.php
===================================================================
--- trunk/catalog/admin/includes/modules/configuration/modprodextra.php 2012-02-22 21:04:01 UTC (rev 4040)
+++ trunk/catalog/admin/includes/modules/configuration/modprodextra.php 2012-02-24 08:05:34 UTC (rev 4041)
@@ -91,25 +91,9 @@
}
- $data_array = array(
- 'epf_order' =>0,
- 'epf_status' => 0,
- 'epf_uses_value_list' => $value_list,
- 'epf_advanced_search' => 0,
- 'epf_show_in_listing' => 0,
- 'epf_size' => 64,
- 'epf_use_as_meta_keyword' => 0,
- 'epf_use_to_restrict_listings' => 0,
- 'epf_show_parent_chain' => 0,
- 'epf_key' => '',
- 'epf_admin' => 0,
- 'epf_special_mod' => '');
+ self::$eid = sqlproductsextrafields::create(array('uses_value_list' => $value_list));
- $resobj=tep_db_perform(TABLE_PRODUCTS_EXTRA_FIELDS, $data_array);
-
- self::$eid = tep_db_insert_id($resobj);
-
tep_redirect(tep_href_link(self::FILENAME,FILENAME_CFG_34.'&action=edit&eid=' . self::$eid));
break;
@@ -160,11 +144,12 @@
$labels = array();
$active = false;
for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
- $lbl = (isset($_POST['label_' . $languages[$i]['id']])) ? tep_db_prepare_input($_POST['label_' . $languages[$i]['id']]) : '';
-// if ($lactive && !tep_not_null($lbl)) throw new Exception(ERROR_LABEL, $languages[$i]['name'] );
-// if ($lactive) $active = true;
- $labels[$languages[$i]['id']] = array('active' => $lactive, 'label' => $lbl);
+ $labels[$languages[$i]['id']] = array(
+ 'active' => $lactive,
+ 'label' => ((isset($_POST['label_' . $languages[$i]['id']])) ? tep_db_prepare_input($_POST['label_' . $languages[$i]['id']]) : '' ),
+ 'format'=>((isset($_POST['format_' . $languages[$i]['id']])) ? tep_db_prepare_input($_POST['format_' . $languages[$i]['id']]) : '' )
+ );
}
// if no active languages
$epf_key= (isset($_POST['epf_key'])) ? tep_db_prepare_input($_POST['epf_key']) : md5($_POST['label_'.$language_id]);
@@ -175,94 +160,124 @@
}
if ($error)
- tep_redirect(tep_href_link(self::FILENAME,FILENAME_CFG_34.'&erreor=&action=edit&eid=' . self::$eid));
+ tep_redirect(tep_href_link(self::FILENAME,FILENAME_CFG_34.'&error=&action=edit&eid=' . self::$eid));
-// if ($error) { // if error return to entry form
-// $action = 'edit';
-// } else { // otherwise update field
- $field = 'extra_value' . ($uses_list ? '_id' : '') . (int)self::$eid;
- if (($size < $field_info['epf_size'])) {
- $check_query = tep_db_query("select count(products_id) as total, max(length(" . $field . ")) as maxlen from " . TABLE_PRODUCTS_DESCRIPTION . " where length(" . $field . ") > " . (int)$size);
- $check = tep_db_fetch_array($check_query);
- if ($check['total'] > 1) { // check to see if reducing size will truncate data
- $confirmation_needed = true;
- $messageStack->add(WARNING_TRUNCATE, $check['total'].$check['maxlen'],'error');
- }
- }
+
$label_query = tep_db_query("select * from " . TABLE_PRODUCTS_EXTRA_FIELDS_LABELS . " where epf_id=" . (int)self::$eid);
- $data_array = array('epf_order' => (int)$order,
- 'epf_status' => $status,
- 'epf_advanced_search' => $search,
- 'epf_show_in_listing' => $listing,
- 'epf_size' => $size,
- 'epf_use_as_meta_keyword' => $meta,
- 'epf_use_to_restrict_listings' => $restrict,
- 'epf_show_parent_chain' => $chain,
- 'epf_key' => $epf_key,
- 'epf_admin' => $epf_admin,
- 'epf_special_mod' => $epf_special_mod);
- tep_db_perform(TABLE_PRODUCTS_EXTRA_FIELDS, $data_array, 'update', 'epf_id = ' . (int)self::$eid);
- if (($uses_list == 0) && ($field_info['epf_size'] != $size)) { // if text field size has changed
- tep_db_query('alter table ' . TABLE_PRODUCTS_DESCRIPTION . ' change ' . $field . ' ' . $field . ' varchar(' . (int)$size . ') default null');
- }
+ $data_array = array(
+ 'id'=>(int)self::$eid,
+ 'order' => (int)$order,
+ 'status' => $status,
+ 'advanced_search' => $search,
+ 'show_in_listing' => $listing,
+ 'size' => $size,
+ 'use_as_meta_keyword' => $meta,
+ 'use_to_restrict_listings' => $restrict,
+ 'show_parent_chain' => $chain,
+ 'key' => $epf_key,
+ 'admin' => $epf_admin,
+ 'special_mod' => $epf_special_mod
+ );
+ sqlproductsextrafields::update($data_array);
+
$DB = Database::getInstance();
foreach ($labels as $lid => $value) {
- $label_array = array('epf_label' => $value['label'], 'epf_active_for_language' => $value['active']);
+ $label_array = array(
+ 'id' => (int)self::$eid,
+ 'languages_id' =>(int)$lid,
+ 'label' => $value['label'],
+ 'format' => $value['format'],
+ 'active_for_language' => $value['active']
+ );
- $res =$DB->query("SELECT * FROM ".TABLE_PRODUCTS_EXTRA_FIELDS_LABELS." WHERE epf_id = ' ". (int)self::$eid ." ' and languages_id = '" . (int)$lid ." ' ");
+ if(! sqlproductsextrafieldslabels::fetch(array('id'=>(int)self::$eid , 'languages_id'=> (int)$lid)) ){
- if(! $res->__get('NumRows') ){
- $label_array['languages_id']=(int)$lid;
- $label_array['epf_id']=(int)self::$eid;
- tep_db_perform(TABLE_PRODUCTS_EXTRA_FIELDS_LABELS, $label_array);
+ if( ! sqlproductsextrafieldslabels::create($label_array) )
+ $messageStack->add_session(
+ __('error for create extra fileds label'),
+ 'error'
+ );
}
- else
- tep_db_perform(TABLE_PRODUCTS_EXTRA_FIELDS_LABELS, $label_array, 'update', 'epf_id = ' . (int)self::$eid . ' and languages_id = ' . (int)$lid . ' ');
+ else{
+ if(! sqlproductsextrafieldslabels::update($label_array) )
+ $messageStack->add_session(
+ __('error for update extra fileds label'),
+ 'error'
+ );
+ }
+
}
tep_redirect(tep_href_link(self::FILENAME,FILENAME_CFG_34.'&action=edit&eid=' . self::$eid));
break;
+
+
+
case 'delete':
if ($confirm == 'yes') {
if (isset($_GET['used']) && ($_GET['used'] > 0)) {
self::$double_check = 'yes';
} else {
-// $query = tep_db_query("select epf_uses_value_list from " . TABLE_PRODUCTS_EXTRA_FIELDS . " where epf_id = " . (int)self::$eid);
-// $field_info = tep_db_fetch_array($query); // retrieve field type
-// if(tep_db_num_rows($query) >0) {
-// $field = 'extra_value' . ($field_info['epf_uses_value_list'] ? '_id' : '') . (int)self::$eid;
-// tep_db_query('alter table ' . TABLE_PRODUCTS_DESCRIPTION . ' drop ' . $field);
-// }
- tep_db_query('delete from ' . TABLE_PRODUCTS_EXTRA_FIELDS_LABELS . ' where epf_id = ' . (int)self::$eid);
tep_db_query('delete from ' . TABLE_PRODUCTS_EXTRA_FIELDS_VALUES . ' where epf_id = ' . (int)self::$eid);
tep_db_query('delete from ' . TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS . ' where products_extra_fields_id = ' . (int)self::$eid);
- tep_db_query('delete from ' . TABLE_PRODUCTS_EXTRA_FIELDS . ' where epf_id = ' . (int)self::$eid);
+ sqlproductsextrafields::delete(array('id'=> (int)self::$eid));
tep_redirect(tep_href_link(FILENAME_CONFIGURATION, tep_get_all_get_params(array('action','confirm','eid'),false)));
}
} else {
self::$double_check = 'no';
}
- break;
+ break;
+
+
+ /**
+ @remarks quickaction
+ */
case 'setflag':
if(isset($_GET['flag']) ){
if (!is_numeric($_GET['flag']) || (($_GET['flag'] != 0) && ($_GET['flag'] != 1))) break; // skip if flag not properly set
- tep_db_query('update ' . TABLE_PRODUCTS_EXTRA_FIELDS . ' set epf_status = ' . (int)$_GET['flag'] . ' where epf_id = ' . (int)self::$eid);
+
+ if( sqlproductsextrafields::update(array('id'=> (int)self::$eid , 'status'=>(int)$_GET['flag'] )) )
+ $messageStack->add_session(
+ sprintf(
+ __('success for update extra fileds; this fileds is %s'),
+ ( ($_GET['flag']==1)
+ ? 'active'
+ : 'inactive'
+ )
+ )
+ , 'success');
+ else
+ $messageStack->add_session(__('error for update extra fileds'), 'error');
}
elseif(isset($_GET['flag_admin']) ){
if (!is_numeric($_GET['flag_admin']) || (($_GET['flag_admin'] != 0) && ($_GET['flag_admin'] != 1))) break; // skip if flag not properly set
- tep_db_query('update ' . TABLE_PRODUCTS_EXTRA_FIELDS . ' set epf_admin = ' . (int)$_GET['flag_admin'] . ' where epf_id = ' . (int)self::$eid);
+
+ if(sqlproductsextrafields::update(array('id'=> (int)self::$eid , 'admin'=>(int)$_GET['flag_admin'] )) )
+ $messageStack->add_session(
+ sprintf(
+ __('success for update extra fileds; this fileds is %s'),
+ ( ($_GET['flag_admin']==1)
+ ? 'specific admin'
+ : 'global front and backend'
+ )
+ )
+ , 'success');
+ else
+ $messageStack->add_session(__('error for update extra fileds'), 'error');
}
- tep_redirect(tep_href_link(FILENAME_CONFIGURATION, tep_get_all_get_params(array('action','flag_spe','flag_admin','flag'),false)));
+
+ if(!isset($_GET['forceajax']))
+ tep_redirect(tep_href_link(FILENAME_CONFIGURATION, tep_get_all_get_params(array('action','flag_spe','flag_admin','flag'),false)));
break;
@@ -322,10 +337,6 @@
list($eid, $lid) = explode('_', $list_id);
$vid = (isset($_GET['vid']) ? $_GET['vid'] : '');
$confirm = (isset($_GET['confirm']) ? $_GET['confirm'] : '');
-
- // $check_query = tep_db_query("select count(products_id) as total from " . TABLE_PRODUCTS_DESCRIPTION . " where extra_value_id" . (int)$eid . " = " . (int)$vid);
- // $check = tep_db_fetch_array($check_query);
- // if ($check['total'] > 0) $messageStack->add(WARNING_VALUE_USED. $check['total'],'error');
break;
default:
@@ -341,105 +352,112 @@
switch($action){
-
+ /**
+ @remarks value listing
+ */
case 'value_listing':
global $list, $languages,$action ;
$eid=self::$eid;
$lid=$languages;
- $query = tep_db_fetch_array(tep_db_query($sql="select epf_label from " . TABLE_PRODUCTS_EXTRA_FIELDS_LABELS . " where epf_id = " . (int)$eid . " and languages_id = " . (int)$lid));
+ $query = tep_db_fetch_array(tep_db_query($sql="select epf_label from " . TABLE_PRODUCTS_EXTRA_FIELDS_LABELS . " where epf_id = " . (int)$eid . " and languages_id = " . (int)$lid));
- $current_label = $query['epf_label'];
- if ($current_label == '') { // if invalid label get first matching label and use that information
- $query = tep_db_fetch_array(tep_db_query("select l.epf_label, l.languages_id, l.epf_id from " . TABLE_PRODUCTS_EXTRA_FIELDS_LABELS . " l join " . TABLE_PRODUCTS_EXTRA_FIELDS . " e where e.epf_id = l.epf_id and l.epf_active_for_language and e.epf_uses_value_list order by e.epf_order"));
- $current_label = $query['epf_label'];
- $eid = $query['epf_id'];
- $lid = $query['languages_id'];
- $list_id = $eid . '_' . $lid;
- $_GET['list_id'] = $list_id; // set so dropdown list of fields will match value list chosen
- }
+ $current_label = $query['epf_label'];
+ if ($current_label == '') { // if invalid label get first matching label and use that information
+ $query = tep_db_fetch_array(tep_db_query("select l.epf_label, l.epf_format, l.languages_id, l.epf_id from " . TABLE_PRODUCTS_EXTRA_FIELDS_LABELS . " l join " . TABLE_PRODUCTS_EXTRA_FIELDS . " e where e.epf_id = l.epf_id and l.epf_active_for_language and e.epf_uses_value_list order by e.epf_order"));
+ $current_label = $query['epf_label'];
+ $eid = $query['epf_id'];
+ $lid = $query['languages_id'];
+ $list_id = $eid . '_' . $lid;
+ $_GET['list_id'] = $list_id; // set so dropdown list of fields will match value list chosen
+ }
+ $list[] = $this->build_value_list($eid, $lid);
+ $selected = array();
- $list[] = $this->build_value_list($eid, $lid);
- $selected = array();
+ return $list;
+ break;
- return $list;
- break;
+ /**
+ @remarks value new
+ */
case 'value_new':
- $list_id = (isset($_GET['list_id']) ? $_GET['list_id'] : '_');
- list($eid, $lid) = explode('_', $list_id);
- $vid = (isset($_GET['vid']) ? $_GET['vid'] : '');
- $confirm = (isset($_GET['confirm']) ? $_GET['confirm'] : '');
- $parent_id = (isset($_GET['parent']) ? $_GET['parent'] : 0);
+ $list_id = (isset($_GET['list_id']) ? $_GET['list_id'] : '_');
+ list($eid, $lid) = explode('_', $list_id);
+ $vid = (isset($_GET['vid']) ? $_GET['vid'] : '');
+ $confirm = (isset($_GET['confirm']) ? $_GET['confirm'] : '');
+ $parent_id = (isset($_GET['parent']) ? $_GET['parent'] : 0);
break;
+ /**
+ @remarks value edit
+ */
case 'value_edit':
+ $sql = tep_db_query($sql_="select * from " . TABLE_PRODUCTS_EXTRA_FIELDS_VALUES . " where epf_id = " . self::$eid. " and value_id = " . (int)$_GET['vid'] . " order by sort_order, epf_value");
+ while ($v = tep_db_fetch_array($sql)) {
+ $res[$v['languages_id']] =$v;
+ }
- $sql = tep_db_query($sql_="select * from " . TABLE_PRODUCTS_EXTRA_FIELDS_VALUES . " where epf_id = " . self::$eid. " and value_id = " . (int)$_GET['vid'] . " order by sort_order, epf_value");
+ $languages = tep_get_languages();
+ for ($i=0, $n=sizeof($languages); $i<$n; $i++){
+ $list[$languages[$i]['id']] = $res[$languages[$i]['id']] ;
+ }
- while ($v = tep_db_fetch_array($sql)) {
- $res[$v['languages_id']] =$v;
- }
-
- $languages = tep_get_languages();
- for ($i=0, $n=sizeof($languages); $i<$n; $i++){
- $list[$languages[$i]['id']] = $res[$languages[$i]['id']] ;
- }
- return $list;
+ return $list;
break;
+ /**
+ @remarks label edit
+ */
case 'edit':
$query = tep_db_query("select * from " . TABLE_PRODUCTS_EXTRA_FIELDS . " where epf_id = " . (int)self::$eid);
$this->field = tep_db_fetch_array($query);
$label_query = tep_db_query("select * from " . TABLE_PRODUCTS_EXTRA_FIELDS_LABELS . " where epf_id = " . (int)self::$eid);
- $this->field['epf_active_for_language']=0;
+ $this->field['epf_active_for_language']=0;
$epf_label = array();
while ($label = tep_db_fetch_array($label_query)) {
$this->epf_label[$label['languages_id']] = $label;
- $this->field['epf_active_for_language'] =$label['epf_active_for_language'];
+ $this->field['epf_active_for_language'] =$label['epf_active_for_language'];
}
+
+ $languages = tep_get_languages();
+ for ($i=0, $n=sizeof($languages); $i<$n; $i++){
+ if(!isset($this->epf_label[$languages[$i]['id']])) {
+ $this->epf_label[$languages[$i]['id']]['epf_label'] ='';
+ $this->field['epf_active_for_language']=false;
+ }
+ }
+
break;
+
+ /**
+ @remarks label new
+ */
case 'new':
- $this->field=array('epf_status'=>''
- ,'epf_order'=>''
- ,'epf_advanced_search'=>''
- ,'epf_show_in_listing'=>''
- ,'epf_use_as_meta_keyword'=>''
- ,'epf_show_parent_chain'=>''
- ,'epf_use_to_restrict_listings'=>''
- ,'epf_size'=>''
- ,'epf_key'=>''
- ,'epf_admin'=>''
- ,'epf_special_mod'=>''
- ,'epf_uses_value_list'=>'0'
- );
- $languages = tep_get_languages();
- for ($i=0, $n=sizeof($languages); $i<$n; $i++){
- $this->epf_label[$languages[$i]['id']]['epf_label'] ='';
- $this->field['epf_active_for_language']=false;
- }
- break;
+ $this->field=sqlproductsextrafields::Specimen();
+ break;
+
default:
- $languages = tep_get_languages();
- self::$lang = array();
- for ($i=0, $n=sizeof($languages); $i<$n; $i++) { // build array accessed directly by language id
- self::$lang[$languages[$i]['id']] = array ('name' => $languages[$i]['name'],
- 'code' => $languages[$i]['code'],
- 'image' => $languages[$i]['image'],
- 'directory' => $languages[$i]['directory']);
- }
+ $languages = tep_get_languages();
+ self::$lang = array();
+ for ($i=0, $n=sizeof($languages); $i<$n; $i++) { // build array accessed directly by language id
+ self::$lang[$languages[$i]['id']] = array ('name' => $languages[$i]['name'],
+ 'code' => $languages[$i]['code'],
+ 'image' => $languages[$i]['image'],
+ 'directory' => $languages[$i]['directory']);
+ }
- $field_query = tep_db_query("select * from " . TABLE_PRODUCTS_EXTRA_FIELDS . " order by epf_order,epf_admin, epf_special_mod ");
- $selected_labels = array();
- $list=array();
- while ($epf = tep_db_fetch_array($field_query)) {
- $class= ($epf['epf_id'] == self::$eid)? "Selected" : '';
- if ($epf['epf_id'] == self::$eid)$selected=$epf;
- $list[]=new objectInfo($epf);
- }
- return $list;
+ $field_query = tep_db_query("select * from " . TABLE_PRODUCTS_EXTRA_FIELDS . " order by epf_order,epf_admin, epf_special_mod ");
+ $selected_labels = array();
+ $list=array();
+ while ($epf = tep_db_fetch_array($field_query)) {
+ $class= ($epf['epf_id'] == self::$eid)? "Selected" : '';
+ if ($epf['epf_id'] == self::$eid)$selected=$epf;
+ $list[]=new objectInfo($epf);
+ }
+ return $list;
}
}
@@ -489,6 +507,23 @@
global $action,$gparentID,$current_theme, $languages_id;
switch($action){
+
+ /**
+ @remarks Ajax View result
+ */
+ case 'setflag':
+ if(isset($_GET['flag']) )
+ echo self::get_item_status(new objectInfo(array('epf_status'=>(int)$_GET['flag'], 'epf_id'=>(int)$_GET['eID'])) );
+ elseif(isset($_GET['flag_admin']) )
+ echo self::get_item_admin(new objectInfo(array('epf_admin'=>(int)$_GET['flag_admin'], 'epf_id'=>(int)$_GET['eID'])) );
+ break;
+
+
+ /**
+ @remarks Normal View Page
+ */
+
+
case 'value_listing':
self::$list= $this->load_db_values();
$gab = 'value.listing';
@@ -520,7 +555,7 @@
self::$list=$this->load_db_values();
self::$selected_labels=array();
$languages = tep_get_languages();
- $gab = 'listing';
+ $gab ='label.'.'listing';
}
/// use master gabarit
@@ -553,7 +588,7 @@
@param $item arrau , detail ligne
*/
public static function get_item_value_action($item){
-global $action;
+ global $action;
return sprintf(
CsrtAction::getFormat('row_action'),
'' ,
@@ -562,9 +597,43 @@
);
}
+ /**
+ @brief get_item_action($item)
+ @brief content col action
+ @param $item arrau , detail ligne
+ */
+ public static function get_item_status($item){
+ $exclude=array('action','pID','forceajax','type','class','function','funct', 'mod','flag');
+ $query_s='action=setflag&eID=' . $item->epf_id.'&flag=';
+ return '<a class="ajaxinline" href="' . tep_href_link(self::FILENAME, tep_get_all_get_params($exclude).$query_s.(($item->epf_status == '1')? '0' : '1') ) . '">'.
+ sprintf(
+ CsrtAction::getFormat('row_flag'),
+ (int)$item->epf_status,
+ ( ($item->epf_status == '1')? IMAGE_ICON_STATUS_GREEN : IMAGE_ICON_STATUS_RED)
+ ).
+ '</a>';
+ }
+ /**
+ @brief get_item_action($item)
+ @brief content col action
+ @param $item arrau , detail ligne
+ */
+ public static function get_item_admin($item){
+ $exclude=array('action','pID','forceajax','type','class','function','funct', 'mod','flag_admin');
+ $query_s='action=setflag&eID=' . $item->epf_id.'&flag_admin=';
+ return '<a class="ajaxinline" href="' . tep_href_link(self::FILENAME, tep_get_all_get_params($exclude).$query_s.(($item->epf_admin == '1')? '0' : '1') ) . '">'.
+ sprintf(
+ CsrtAction::getFormat('row_flag'),
+ (int)$item->epf_admin,
+ ( ($item->epf_admin == '1')? IMAGE_ICON_STATUS_GREEN : IMAGE_ICON_STATUS_RED)
+ ).
+ '</a>';
+ }
+
+
/**
Colonne droite list labels
*/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2012-02-22 21:04:09
|
Revision: 4040
http://oscss.svn.sourceforge.net/oscss/?rev=4040&view=rev
Author: oscim
Date: 2012-02-22 21:04:01 +0000 (Wed, 22 Feb 2012)
Log Message:
-----------
correction diverse
suppression des image ds les listing produit
Modified Paths:
--------------
trunk/catalog/admin/includes/classes/drivers/sqlcustomer.php
trunk/catalog/admin/includes/classes/drivers/sqlproduct.php
trunk/catalog/admin/includes/classes/drivers/sqlproductattribute.php
trunk/catalog/admin/includes/classes/productUtility.php
trunk/catalog/admin/includes/database_tables.php
trunk/catalog/admin/includes/gabarit/products/display_view.copy_to.gab
trunk/catalog/admin/includes/gabarit/products/display_view.edit.gab
trunk/catalog/admin/includes/gabarit/products/display_view.inline.gab
trunk/catalog/admin/includes/gabarit/products/display_view.listing.gab
trunk/catalog/admin/includes/gabarit/products/display_view.new.gab
trunk/catalog/admin/includes/languages/fr_FR/modules/pages/products.txt
trunk/catalog/admin/includes/languages/fr_FR/modules/products/desc_base.txt
trunk/catalog/admin/includes/modules/pages/orders.php
trunk/catalog/admin/includes/modules/pages/products.php
Modified: trunk/catalog/admin/includes/classes/drivers/sqlcustomer.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlcustomer.php 2012-02-22 09:42:35 UTC (rev 4039)
+++ trunk/catalog/admin/includes/classes/drivers/sqlcustomer.php 2012-02-22 21:04:01 UTC (rev 4040)
@@ -256,7 +256,6 @@
-
$DB->query("delete from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . (int)$_id . "'");
$DB->query("delete from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . (int)$_id . "'");
$DB->query("delete from " . TABLE_WHOS_ONLINE . " where customer_id = '" . (int)$_id . "'");
Modified: trunk/catalog/admin/includes/classes/drivers/sqlproduct.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlproduct.php 2012-02-22 09:42:35 UTC (rev 4039)
+++ trunk/catalog/admin/includes/classes/drivers/sqlproduct.php 2012-02-22 21:04:01 UTC (rev 4040)
@@ -1,10 +1,10 @@
<?php if (!defined('HTTP_SERVER')) die('You can not access this file directly!');
/**
- @licence GPL 2005-2011 The osCSS developers - osCSS Open Source E-commerce
+ @licence GPL 2005-2012 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/09/11, 20:11
+ @date 21/02/2012, 23:13
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
@class manage link table products
@@ -293,11 +293,10 @@
if(isset($option['catarray'])){
foreach($option['catarray'] as $k=>$v)
- $product_categories[$k]=(int)tep_db_input($v) ;
+ $product_categories[$k]=(int)tep_db_input($v) ;
for ($i=0, $n=sizeof($product_categories); $i<$n; $i++) {
- $DB->query($s="DELETE FROM " . TABLE_PRODUCTS_TO_CATEGORIES . " WHERE products_id = '" . (int)$product_id . "' AND categories_id = '" . (int)$product_categories[$i] . "' LIMIT 1 ");
-
+ $DB->query($s="DELETE FROM " . TABLE_PRODUCTS_TO_CATEGORIES . " WHERE products_id = '" . (int)$product_id . "' AND categories_id = '" . (int)$product_categories[$i] . "' LIMIT 1 ");
}
}
else
@@ -352,7 +351,7 @@
@brief copy in duplicate or link
@param $option array
type => string duplicate/link
- @return
+ @return int pid new product
*/
public static function copyto($option){
@@ -368,65 +367,44 @@
return false;
- $type=(isset($option['type']))? $option['type'] : 'duplicate' ; // type duplicate | link
-// $pid = (isset($option['id'])) ? : ;
-
self::getInstance();
$DB=Database::getInstance();
- switch($type){
- case 'link':
- $check_query = $DB->query("select count(*) as total from " . TABLE_PRODUCTS_TO_CATEGORIES . " where products_id = '" . $pid . "' and categories_id = '" . $catid . "'");
- $check = $check_query->fetchAssoc();
- if ($check['total'] < '1') {
- $DB->query("insert into " . TABLE_PRODUCTS_TO_CATEGORIES . " (products_id, categories_id) values ('" . $pid . "', '" . $catid . "')");
- }
+ $product_query = $DB->query("select products_type, products_quantity, products_model, products_image, products_price, products_date_available, products_weight, products_tax_class_id, manufacturers_id from " . TABLE_PRODUCTS . " where products_id = '" . $pid . "'");
+ $product = $product_query->fetchAssoc();
- $products_id = $pid;
- break;
+ $resobj=$DB->query("insert into " . TABLE_PRODUCTS . " (products_type, products_quantity, products_model,products_image, products_price, products_date_added, products_date_available, products_weight, products_status, products_tax_class_id, manufacturers_id) values ('" . tep_db_input($product['products_type']) . "','" . tep_db_input($product['products_quantity']) . "', '" . tep_db_input($product['products_model']) . "', '" . tep_db_input($product['products_image']) . "', '" . tep_db_input($product['products_price']) . "', now(), " . (empty($product['products_date_available']) ? "null" : "'" . tep_db_input($product['products_date_available']) . "'") . ", '" . tep_db_input($product['products_weight']) . "', '0', '" . (int)$product['products_tax_class_id'] . "', '" . (int)$product['manufacturers_id'] . "')");
- case 'duplicate':
- default:
+ $dup_products_id = $resobj->__get('insertId');
- $product_query = $DB->query("select products_type, products_quantity, products_model, products_image, products_price, products_date_available, products_weight, products_tax_class_id, manufacturers_id from " . TABLE_PRODUCTS . " where products_id = '" . $pid . "'");
- $product = $product_query->fetchAssoc();
+ $description_query = $DB->query("select language_id, products_name, products_description, products_url from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . $pid . "'");
+ while ($description =$description_query->fetchAssoc()) {
+ $DB->query("insert into " . TABLE_PRODUCTS_DESCRIPTION . " (products_id, language_id, products_name, products_description, products_url, products_viewed) values ('" . (int)$dup_products_id . "', '" . (int)$description['language_id'] . "', '" . tep_db_input($description['products_name']) . "', '" . tep_db_input($description['products_description']) . "', '" . tep_db_input($description['products_url']) . "', '0')");
+ }
- $resobj=$DB->query("insert into " . TABLE_PRODUCTS . " (products_type, products_quantity, products_model,products_image, products_price, products_date_added, products_date_available, products_weight, products_status, products_tax_class_id, manufacturers_id) values ('" . tep_db_input($product['products_type']) . "','" . tep_db_input($product['products_quantity']) . "', '" . tep_db_input($product['products_model']) . "', '" . tep_db_input($product['products_image']) . "', '" . tep_db_input($product['products_price']) . "', now(), " . (empty($product['products_date_available']) ? "null" : "'" . tep_db_input($product['products_date_available']) . "'") . ", '" . tep_db_input($product['products_weight']) . "', '0', '" . (int)$product['products_tax_class_id'] . "', '" . (int)$product['manufacturers_id'] . "')");
+ $DB->query("insert into " . TABLE_PRODUCTS_TO_CATEGORIES . " (products_id, categories_id) values ('" . (int)$dup_products_id . "', '" . $catid . "')");
- $dup_products_id = tep_db_insert_id($resobj);
+ // BOF Separate Pricing Per Customer
+ $cg_price_query = $DB->query("select customers_group_id, customers_group_price from " . TABLE_PRODUCTS_GROUPS . " where products_id = '" . $pid . "' order by customers_group_id");
+ // insert customer group prices in table products_groups when there are any for the copied product
+ if ($cg_price_query->__get('numRows') > 0) {
+ while ( $cg_prices = $cg_price_query->fetchAssoc()) {
+ $DB->query("insert into " . TABLE_PRODUCTS_GROUPS . " (customers_group_id, customers_group_price, products_id) values ('" . (int)$cg_prices['customers_group_id'] . "', '" . tep_db_input($cg_prices['customers_group_price']) . "', '" . (int)$dup_products_id . "')");
+ }
+ }
- $description_query = $DB->query("select language_id, products_name, products_description, products_url from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . $pid . "'");
- while ($description =$description_query->fetchAssoc()) {
- $DB->query("insert into " . TABLE_PRODUCTS_DESCRIPTION . " (products_id, language_id, products_name, products_description, products_url, products_viewed) values ('" . (int)$dup_products_id . "', '" . (int)$description['language_id'] . "', '" . tep_db_input($description['products_name']) . "', '" . tep_db_input($description['products_description']) . "', '" . tep_db_input($description['products_url']) . "', '0')");
- }
- $DB->query("insert into " . TABLE_PRODUCTS_TO_CATEGORIES . " (products_id, categories_id) values ('" . (int)$dup_products_id . "', '" . $catid . "')");
+ sqlproductattribute::copyto($pid_src, $pid_new);
- // BOF Separate Pricing Per Customer
- $cg_price_query = $DB->query("select customers_group_id, customers_group_price from " . TABLE_PRODUCTS_GROUPS . " where products_id = '" . $pid . "' order by customers_group_id");
+ // ACA START DUPLICATE PRODUCT
+ self::$modules->duplicate_product($pid,$dup_products_id);
- // insert customer group prices in table products_groups when there are any for the copied product
- if ($cg_price_query->__get('numRows') > 0) {
- while ( $cg_prices = $cg_price_query->fetchAssoc()) {
- $DB->query("insert into " . TABLE_PRODUCTS_GROUPS . " (customers_group_id, customers_group_price, products_id) values ('" . (int)$cg_prices['customers_group_id'] . "', '" . tep_db_input($cg_prices['customers_group_price']) . "', '" . (int)$dup_products_id . "')");
- }
- }
- // ACA START DUPLICATE PRODUCT
- self::$modules->duplicate_product($products_id,$dup_products_id);
+ return $dup_products_id;
-
- $products_id = $dup_products_id;
-
-
- }
-
-
- return $products_id;
-
}
Modified: trunk/catalog/admin/includes/classes/drivers/sqlproductattribute.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlproductattribute.php 2012-02-22 09:42:35 UTC (rev 4039)
+++ trunk/catalog/admin/includes/classes/drivers/sqlproductattribute.php 2012-02-22 21:04:01 UTC (rev 4040)
@@ -137,10 +137,21 @@
$sql ="";
if(isset($option['id'])) $sql .="AND products_attributes_id = '".(int)tep_db_input($option['id'])."' ";
+ if(isset($option['products_id'])) $sql .="AND products_id = '".(int)tep_db_input($option['products_id'])."' ";
if(strlen($sql)==0)
return false;
+ // base attribute and options
+ $pa_query = $DB->query("SELECT * FROM " . TABLE_PRODUCTS_ATTRIBUTES . " where ".substr($sql,3) );
+
+ foreach($pa_query->fetchAllAssoc() as $row){
+ tep_db_query("delete from " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " where products_attributes_id = '" . (int)$row['products_attributes_id'] . "'");
+
+ tep_db_query("delete from " . TABLE_PRODUCTS_ATTRIBUTES_GROUPS . " where products_attributes_id = '" . (int)$row['products_attributes_id'] . "'");
+ }
+
+
$sql ="DELETE FROM ".TABLE_PRODUCTS_ATTRIBUTES." WHERE ".substr($sql,3);
$res=$DB->query($sql);
@@ -149,6 +160,39 @@
}
/**
+ @brief copy in duplicate or link
+ @return int pid new product
+
+TODO Traiter les arguement par un array pour respecter nomenclature
+ */
+ public static function copyto($pid_src, $pid_new){
+ $DB=Database::getInstance();
+
+ // base attribute and options
+ $product_query = $DB->query("SELECT * FROM " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . $pid_src . "'");
+
+ foreach($product_query->fetchAllAssoc() as $row){
+ $rid=$DB->query("INSERT INTO " . TABLE_PRODUCTS_ATTRIBUTES . " (products_attributes_id, products_id, options_id, options_values_id, options_values_price, price_prefix, products_options_sort_order, products_options_values_url, options_values_weight) VALUE ( '', '" . (int)$pid_new . "' , '" . (int)$row['options_id'] . "', '" . (int)$row['options_values_id'] . "' , '" . $row['options_values_price'] . "', '" . $row['price_prefix'] . "' , '" . $row['products_options_sort_order'] . "' , '" . $row['products_options_values_url'] . "', '" . $row['options_values_weight'] . "' ); ");
+
+ $napid=$rid->__get('insertId');
+
+ // loop for TABLE_PRODUCTS_ATTRIBUTES_DOWNLOADS
+ $pad_query = $DB->query("SELECT * FROM " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " where products_attributes_id = '" . $row['products_attributes_id'] . "'");
+ foreach($pad_query->fetchAllAssoc() as $row_pad)
+ $DB->query("INSERT INTO " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " (products_attributes_id, products_attributes_filename, products_attributes_maxdays, products_attributes_maxcount) VALUE ( '" . (int)$napid . "', '" . $row['products_attributes_filename'] . "' , '" . $row['products_attributes_maxdays'] . "', '" . $row['products_attributes_maxcount'] . "' ); ");
+
+ // loop for TABLE_PRODUCTS_ATTRIBUTES_GROUPS
+ $pad_query = $DB->query("SELECT * FROM " . TABLE_PRODUCTS_ATTRIBUTES_GROUPS . " where products_attributes_id = '" . $row['products_attributes_id'] . "'");
+ foreach($pad_query->fetchAllAssoc() as $row_pad)
+ $DB->query("INSERT INTO " . TABLE_PRODUCTS_ATTRIBUTES_GROUPS . " (products_attributes_id, customers_group_id, options_values_price, price_prefix, products_id) VALUE ( '" . (int)$napid . "', '" . $row['customers_group_id'] . "' , '" . $row['options_values_price'] . "', '" . $row['price_prefix'] . "', '" . $row['products_id'] . "' ); ");
+
+ }
+
+ }
+
+
+
+ /**
@fn CleanKey()
@brief Clean string name key
*/
Modified: trunk/catalog/admin/includes/classes/productUtility.php
===================================================================
--- trunk/catalog/admin/includes/classes/productUtility.php 2012-02-22 09:42:35 UTC (rev 4039)
+++ trunk/catalog/admin/includes/classes/productUtility.php 2012-02-22 21:04:01 UTC (rev 4040)
@@ -292,33 +292,27 @@
Prend en charge Qtpro + ACA
@param $product_id int
@page products.php|manufactureds.php
+TODO A deporter dans la class sqlproducts
*/
public static function remove_product($product_id) {
global $products_modules;
+ // delete image si correspond a un seul produit
$product_image_query = tep_db_query("select products_image from " . TABLE_PRODUCTS . " where products_id = '" . (int)$product_id . "'");
$product_image = tep_db_fetch_array($product_image_query);
$duplicate_image_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS . " where products_image = '" . tep_db_input($product_image['products_image']) . "'");
$duplicate_image = tep_db_fetch_array($duplicate_image_query);
- if ($duplicate_image['total'] < 2) {
+ if ($duplicate_image['total'] == 1) {
if (file_exists(DIR_FS_CATALOG_IMAGES . $product_image['products_image'])) @unlink(DIR_FS_CATALOG_IMAGES . $product_image['products_image']);
}
- tep_db_query("delete from " . TABLE_SPECIALS . " where products_id = '" . (int)$product_id . "'");
- tep_db_query("delete from " . TABLE_PRODUCTS_GROUPS . " where products_id = '" . (int)$product_id . "'");
- tep_db_query("delete from " . TABLE_PRODUCTS_TO_CATEGORIES . " where products_id = '" . (int)$product_id . "'");
- tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET . " where products_id = '" . (int)$product_id . "'");
- tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where products_id = '" . (int)$product_id . "'");
-
/**
TODO REvoir comportement vis a vis des commandes
Suppression de l'id dans les commandes, pour autoriser la reatribution de l'id du produits
*/
-
-
/* Element modulaire aca */
if (!is_object($products_modules)) {
require_once (DIR_WS_MODULES.'pages/products.php');
@@ -327,7 +321,19 @@
// ACA START DELETE PRODUCT
$products_modules->delete_product($product_id);
- tep_db_query("delete from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . (int)$product_id . "'");
+
+ tep_db_query("delete from " . TABLE_SPECIALS . " where products_id = '" . (int)$product_id . "'");
+ tep_db_query("delete from " . TABLE_PRODUCTS_GROUPS . " where products_id = '" . (int)$product_id . "'");
+
+
+ // force delete ref products in cart
+ tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET . " where products_id = '" . (int)$product_id . "'");
+ tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where products_id = '" . (int)$product_id . "'");
+
+
+ sqlproductattribute::delete(array('products_id'=>$product_id));
+
+
tep_db_query("delete from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$product_id . "'");
tep_db_query("delete from " . TABLE_PRODUCTS . " where products_id = '" . (int)$product_id . "'");
Modified: trunk/catalog/admin/includes/database_tables.php
===================================================================
--- trunk/catalog/admin/includes/database_tables.php 2012-02-22 09:42:35 UTC (rev 4039)
+++ trunk/catalog/admin/includes/database_tables.php 2012-02-22 21:04:01 UTC (rev 4040)
@@ -1,10 +1,10 @@
<?php
/**
- @licence GPL 2005-2012 The osCSS developers - osCSS Open Source E-commerce
+ @licence GPL 2005-2011 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 19/02/2012, 09:50
+ @date 01/11/11, 09:50
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
*/
@@ -80,14 +80,6 @@
define('TABLE_ORDERS_STATUS_HISTORY', DB_TABLE_PREFIX . 'orders_status_history');
define('TABLE_ORDERS_TOTAL', DB_TABLE_PREFIX . 'orders_total');
- ## SERVICE
- define('TABLE_SERVICES', DB_TABLE_PREFIX.'services');
-
- ## SHIPPING
- define('TABLE_SHIPPING', DB_TABLE_PREFIX.'shipping');
- define('TABLE_SHIPPING_PRODUCTS', DB_TABLE_PREFIX.'shipping_products');
-
-
## Customers tables
# Master tables
define('TABLE_CUSTOMERS', DB_TABLE_PREFIX . 'customers');
@@ -128,11 +120,14 @@
## Products Tables
# Master tables
define('TABLE_PRODUCTS', DB_TABLE_PREFIX . 'products');
+
define('TABLE_PRODUCTS_GROUPS', DB_TABLE_PREFIX . 'products_groups');
define('TABLE_PRODUCTS_GROUP_PRICES', DB_TABLE_PREFIX . 'products_group_prices_cg_');
- define('TABLE_PRODUCTS_ATTRIBUTES_GROUPS', DB_TABLE_PREFIX . 'products_attributes_groups');
+
define('TABLE_PRODUCTS_ATTRIBUTES', DB_TABLE_PREFIX . 'products_attributes');
+ define('TABLE_PRODUCTS_ATTRIBUTES_GROUPS', DB_TABLE_PREFIX . 'products_attributes_groups');
define('TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD', DB_TABLE_PREFIX . 'products_attributes_download');
+
define('TABLE_PRODUCTS_DESCRIPTION', DB_TABLE_PREFIX . 'products_description');
define('TABLE_PRODUCTS_STOCK', DB_TABLE_PREFIX .'products_stock');
# link to value option
@@ -178,17 +173,14 @@
define('TABLE_NAVIGATION_LINKS_TO_CATEGORIES', DB_TABLE_PREFIX . 'navigation_links_to_categories');
-/// TOP Not Used for dev
+## Image index
define('TABLE_IMAGES', DB_TABLE_PREFIX . 'images');
+ /// TOP Not Used for dev
define('TABLE_IMAGES_USED', DB_TABLE_PREFIX . 'images_used');
-
+ /// TOP Not Used for dev
define('TABLE_TEMPLATE', DB_TABLE_PREFIX . 'template_config');
-/// END Not Used for dev
-/* Begin CIP-osCSS-RvBO-banner_manager - installed by Contrib_Installer */
-// define('TABLE_BANNERS', DB_TABLE_PREFIX . 'banners');
-// define('TABLE_BANNERS_HISTORY', DB_TABLE_PREFIX . 'banners_history');
-/* End CIP-osCSS-RvBO-banner_manager - installed by Contrib_Installer */
+
?>
\ No newline at end of file
Modified: trunk/catalog/admin/includes/gabarit/products/display_view.copy_to.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/products/display_view.copy_to.gab 2012-02-22 09:42:35 UTC (rev 4039)
+++ trunk/catalog/admin/includes/gabarit/products/display_view.copy_to.gab 2012-02-22 21:04:01 UTC (rev 4040)
@@ -1,25 +1,26 @@
<?php
/**
- @licence GPL 2005-2010 The osCSS developers - osCSS Open Source E-commerce
+ @licence GPL 2005-2012 The osCSS developers - osCSS Open Source E-commerce
+ @portion code Copyright (c) 2002 osCommerce
@package osCSS-2 <www http://www.oscss.org>
- @version 2.0.9
- @date 30/08/10, 16:35
+ @version 2.1.1
+ @date 21/02/2012, 16:35
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
*/
?>
<h3><?php printf(__('text info heading copy to'),''); ?></h3>
+
<?php print tep_draw_form('copy_to', FILENAME_PRODUCTS, tep_get_all_get_params(array('action','cPath')).'action=copy_to_confirm')?>
<p><?php print __('text info copy to intro') . tep_draw_hidden_field('products_id', '', products::$pInfo->products_id)?></p>
<p><?php print __('text info current categories'); ?></p>
<p><?php print '<strong>' . tep_output_generated_category_path(products::$pInfo->products_id, 'product') . '</strong>'; ?></p>
<p><?php print __('text categories') ; ?></p>
<p><?php print tep_draw_pull_down_menu('categories_id', tep_get_category_tree(0,'','0'), 0); ?></p>
- <p><?php print __('text how to copy'); ?></p>
- <p><?php print tep_draw_radio_field('copy_as', 'link', 'link', true) . ' ' . __('text copy as link') ; ?></p>
- <p><?php print tep_draw_radio_field('copy_as', 'duplicate', 'duplicate') . ' ' . __('text copy as duplicate'); ?></p>
<div class="button_nav">
- <?php print tep_image_submit('button_copy.gif', IMAGE_COPY) .tep_js_back(tep_href_link(products::FILENAME, 'pID=' . products::$pInfo->products_id), IMAGE_CANCEL) ; ?>
+ <?php print tep_image_submit('button_copy.gif', IMAGE_COPY) .
+ tep_js_back(tep_href_link(products::FILENAME, 'pID=' . products::$pInfo->products_id), IMAGE_CANCEL) ; ?>
</div>
+
</form>
\ No newline at end of file
Modified: trunk/catalog/admin/includes/gabarit/products/display_view.edit.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/products/display_view.edit.gab 2012-02-22 09:42:35 UTC (rev 4039)
+++ trunk/catalog/admin/includes/gabarit/products/display_view.edit.gab 2012-02-22 21:04:01 UTC (rev 4040)
@@ -4,7 +4,7 @@
@portion code Copyright (c) 2002 osCommerce
@package osCSS-2 <www http://www.oscss.org>
@version 2.1.1
- @date 01/01/12, 23:13
+ @date 21/02/2012, 23:13
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
*/
@@ -40,7 +40,7 @@
<?php for ($i=0, $n=sizeof(products::$languages); $i<$n; $i++) {?>
<ul id="<?php echo 'products_name-'.($i+1) ?>">
<li class="block_input">
- <label for="<?php echo 'products_name_' . products::$languages[$i]['id']; ?>"><?php echo __('product text products name'); ?></label>
+ <label for="<?php echo 'products_name_' . products::$languages[$i]['id']; ?>"><?php echo __('text products name'); ?></label>
<?php echo tep_draw_input_field('products_name[' . products::$languages[$i]['id'] . ']', 'products_name_' . products::$languages[$i]['id'], (isset($products_name[products::$languages[$i]['id']]) ? stripslashes($products_name[products::$languages[$i]['id']]) : tep_get_products_name(products::$pInfo->products_id, products::$languages[$i]['id']))).'<span class="required">*</span>'; ?>
</li>
</ul>
Modified: trunk/catalog/admin/includes/gabarit/products/display_view.inline.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/products/display_view.inline.gab 2012-02-22 09:42:35 UTC (rev 4039)
+++ trunk/catalog/admin/includes/gabarit/products/display_view.inline.gab 2012-02-22 21:04:01 UTC (rev 4040)
@@ -11,10 +11,29 @@
<tr>
<td>
+<table style="width:100%">
+ <tr>
+ <td style="width:70%">
<div>
<ul>
- <li><?php echo __('product type: ').products::NameVirtualID(products::$pInfo->products_virtual_typeID) ?></li>
+ <li><?php echo __('product type :').products::NameVirtualID(products::$pInfo->products_virtual_typeID) ?></li>
</ul>
</div>
+</td>
+ <td style="width:30%; text-align:center;">
+ <?php
+ echo (!empty(products::$pInfo->products_image))
+ ? tep_info_image(products::$pInfo->products_image, products::$pInfo->products_name, TEMP_BO_SMALL_IMAGE_WIDTH, TEMP_BO_SMALL_IMAGE_HEIGHT)
+ : tep_info_image(IMAGE_NONEXISTENT, products::$pInfo->products_name, TEMP_BO_SMALL_IMAGE_WIDTH, TEMP_BO_SMALL_IMAGE_HEIGHT) ;
+ ?>
+ </td>
+ </tr>
+
+</table>
+ <div>
+ <ul>
+ <li><?php //echo __('product type :').products::NameVirtualID(products::$pInfo->products_virtual_typeID) ?></li>
+ </ul>
+ </div>
</td>
</tr>
Modified: trunk/catalog/admin/includes/gabarit/products/display_view.listing.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/products/display_view.listing.gab 2012-02-22 09:42:35 UTC (rev 4039)
+++ trunk/catalog/admin/includes/gabarit/products/display_view.listing.gab 2012-02-22 21:04:01 UTC (rev 4040)
@@ -44,7 +44,7 @@
<tr>
<th style="width:2%;"> </th>
<th style="width:3%" class="tcenter"><?php echo __('table heading id'); ?></th>
- <th style="width:3%"><?php echo __('table heading image'); ?></th>
+<!-- <th style="width:3%"><?php echo __('table heading image'); ?></th> -->
<th style="width:10%" class="tcenter"><?php echo __('table heading type'); ?></th>
<th style="width:10%" class="tcenter"><?php echo __('table heading model'); ?></th>
<th style="width:25%" class="tleft"><?php echo __('table heading products'); ?></th>
@@ -61,7 +61,7 @@
<tr class="dataTableRow">
<td style="width:2%;"><?php echo tep_draw_hidden_field('xx','xxx','','class="search_init" '); ?></td>
<td style="width:3%"><?php echo tep_draw_input_field('product_id','product_id',__('table heading id'),'style="width:100%" class="search_init"'); ?></td>
- <td style="width:3%"><?php echo tep_draw_input_field('products_image','products_image',__('table heading image'),'style="width:100%" class="search_init"'); ?></td>
+<!-- <td style="width:3%"><?php echo tep_draw_input_field('products_image','products_image',__('table heading image'),'style="width:100%" class="search_init"'); ?></td> -->
<td style="width:3%" class="tcenter"><?php echo tep_draw_input_field('pv.typeID','pv.typeID',__('table heading type'),'style="width:100%" class="search_init"'); ?></td>
<td style="width:10%" class="tcenter"><?php echo tep_draw_input_field('model','model',__('table heading model'),'style="width:100%" class="search_init"'); ?></td>
<td style="width:25%" class="tleft"><?php echo tep_draw_input_field('p.product_id','pproduct_id',__('table heading products'),'style="width:100%" class="search_init"'); ?></td>
Modified: trunk/catalog/admin/includes/gabarit/products/display_view.new.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/products/display_view.new.gab 2012-02-22 09:42:35 UTC (rev 4039)
+++ trunk/catalog/admin/includes/gabarit/products/display_view.new.gab 2012-02-22 21:04:01 UTC (rev 4040)
@@ -1,9 +1,10 @@
<?php
/**
@licence GPL 2005-2012 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 19/02/2012, 16:35
+ @date 21/02/2012, 23:13
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
*/
Modified: trunk/catalog/admin/includes/languages/fr_FR/modules/pages/products.txt
===================================================================
--- trunk/catalog/admin/includes/languages/fr_FR/modules/pages/products.txt 2012-02-22 09:42:35 UTC (rev 4039)
+++ trunk/catalog/admin/includes/languages/fr_FR/modules/pages/products.txt 2012-02-22 21:04:01 UTC (rev 4040)
@@ -1,103 +1,28 @@
<?php
/**
- @licence GPL 2005-2011 The osCSS developers - osCSS Open Source E-commerce
+ @licence GPL 2005-2012 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 13/09/11, 17:30
+ @date 21/02/2012, 23:13
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
*/
$lang['heading title']="Produits" ;
$lang['heading title search']="Rechercher :" ;
$lang['heading title goto']="Aller à :" ;
-$lang['heading title type']="Type :" ;
-$lang['table heading id']="ID" ;
-$lang['table heading products']="Produits" ;
-$lang['table heading categorie']="Catégories" ;
-$lang['table heading action']="Action" ;
-$lang['table heading model']="Modèle" ;
-$lang['table heading image']="Image" ;
-$lang['table heading status']="Statut" ;
-$lang['table heading stock']="Stock" ;
-$lang['table heading price']="Prix" ;
-$lang['table heading type']="Type" ;
-$lang['text legend stock']="Stock" ;
-$lang['text legend price']="Prix" ;
-$lang['text legend image']="Image" ;
-
$lang['txt view image']="Voir" ;
-
-$lang['text product in stock']="En Stock" ;
-$lang['text product not in stock']="Hors stock" ;
-
$lang['text new product']="Nouveau Produit " ;
-$lang['text edit product']="Édition Produit " ;
-$lang['text categories']="Catégories :" ;
-$lang['text products']="Produits :" ;
-$lang['text products price info']="Prix :" ;
-$lang['text products tax class']="Classe fiscale :" ;
-$lang['text products price net']=" HT :" ;
-$lang['text products price gross']=" TTC :" ;
-$lang['text products final price']="Prix final : " ;
-$lang['text products quantity info']="Quantité :" ;
-$lang['text date added']="Date d'ajout :" ;
-$lang['text date available']="Date de disponibilité :" ;
-$lang['text products type']="Type de produit :" ;
-$lang['text products ordered']="Ordre tri:" ;
-
$lang['text last modified']="Dernière modification :" ;
-$lang['text no child categories or products']="Merci de créer un produit dans ce niveau." ;
-$lang['text product more information']="Pour plus d'information, merci de visiter cette <a href=\"http://%s\">page web</a> de produits." ;
-$lang['text product date added']="Ce produit a été ajouté à notre catalogue le %s." ;
-$lang['text product date available']="Ce produit sera en stock le %s." ;
-
$lang['not dispo prev save']="Enregistrer votre produits pour accéder à ces options" ;
-
$lang['text edit intro']="Merci de faire les changements nécessaires" ;
-$lang['text edit sort order']="Ordre de tri :" ;
-$lang['text info copy to intro']="Veuillez choisir une nouvelle catégorie dans laquelle vous souhaitez copier ce produit" ;
$lang['text info current categories']="Catégories courantes :" ;
-$lang['text info heading delete product']="Supprimer le produit" ;
-$lang['text info heading move product']="Déplacer le produit" ;
-$lang['text info heading copy to']="Copier vers" ;
-$lang['text delete product intro']="Êtes-vous sûr de vouloir supprimer définitivement ce produit ?" ;
-$lang['text delete warning childs']="<strong>ATTENTION :</strong> Il y a %s (sous-)catégories liées à cette catégorie !" ;
-$lang['text delete warning products']="<strong>ATTENTION :</strong> Il y a %s produits liés à cette catégorie !" ;
-$lang['text move products intro']="Merci de sélectionner la catégorie ou vous souhaiteriez que <strong>%s</strong> soit placé" ;
-$lang['text move']="Déplacer <strong>%s</strong> vers :" ;
-$lang['text sort order']="Ordre de tri :" ;
-$lang['text products status']="Statut :" ;
-$lang['text products date available']="Date de disponibilité :" ;
-$lang['text products date format']="<small>(jj/mm/aaaa)</small>" ;
-$lang['text product available']="Actif " ;
-$lang['text product not available']="Désactivé" ;
-$lang['text products name']="" ;
-$lang['text products description']="Description :" ;
-$lang['text products quantity']="Quantité :" ;
-$lang['text products model']="Modèle :" ;
-$lang['text products image']="Image :" ;
-$lang['text products url']="URL :" ;
-$lang['text products url desc']="précisez un lien plus detaillé vers un site, un fabricants, un blog ... pour la langue %s" ;
-$lang['text products weight']="Poids :" ;
-$lang['text products weight help']="le poids du produit est nécessaire pour calculer les frais de livraison" ;
-
-$lang['tab products data']="Caractéristiques" ;
-$lang['tab products desc']="Descriptions " ;
-$lang['tab products option']="Options" ;
-$lang['tab products cross']="Produits complémentaires" ;
$lang['empty category']="Catégorie vide" ;
-$lang['text how to copy']="Méthode de copie :" ;
-$lang['text copy as link']="Lien du produit" ;
-$lang['text copy as duplicate']="Dupliquer le produit" ;
-$lang['error cannot link to same category']="Erreur : Impossible de lier des produits dans la même catégorie." ;
-$lang['error catalog image directory not writeable %s']="Erreur : Impossible d'écrire dans le répertoire d'images : %s " ;
-$lang['error catalog image directory does not exist %s']="Erreur : Le répertoire d'images n'existe pas : %s " ;
-$lang['error cannot move category to parent']="Erreur : La catégorie ne peut être déplacé dans la sous-catégorie." ;
+
$lang['image preview public']="Prévisualiser la page public" ;
$lang['image view public']="Voir la page public" ;
$lang['image special']="Promotion" ;
@@ -110,9 +35,99 @@
$lang['txt all']=" Tout(s)" ;
$lang['txt categories']="Catégories" ;
$lang['txt cat all']=" Toute(s) catégorie(s)" ;
-$lang['text customers groups']="Groupe : " ;
-$lang['text customers groups note']="Tarif Groupe" ;
-$lang['text customers groups note detail']="Notez que si un champ est laissé vide, aucun prix pour ce groupe de clients sera inséré dans la base de données. Si un champ est rempli, mais la case n'est pas cochée, aucun prix ne sera inséré. Si un prix est déjà inséré dans la base de données, mais la case n'est pas cochée, celui-ci sera supprimé de la base de données." ;
-$lang['text info intro choose product type']="Vous devez définir le type du produit, ce type déterminera les fonctionnalités associées. Pour tous les produits qui ne sont pas virtuels, ou ayant des caractéristiques spéciales, le type de 'produit physique'. Pour les produits de type virtuel (logiciel, abonnement, etc, préciser alors son type. ) " ;
+
+
+
+/* Listing */
+ $lang['table heading id']="ID" ;
+ $lang['table heading products']="Produits" ;
+ $lang['table heading categorie']="Catégories" ;
+ $lang['table heading action']="Action" ;
+ $lang['table heading model']="Modèle" ;
+ $lang['table heading image']="Image" ;
+ $lang['table heading status']="Statut" ;
+ $lang['table heading stock']="Stock" ;
+ $lang['table heading price']="Prix" ;
+ $lang['table heading type']="Type" ;
+
+
+/* new products */
+ $lang['heading title type']="Type :" ;
+ $lang['text info intro choose product type']="Vous devez définir le type du produit, ce type déterminera les fonctionnalités associées. Pour tous les produits qui ne sont pas virtuels, ou ayant des caractéristiques spéciales, le type de 'produit physique'. Pour les produits de type virtuel (logiciel, abonnement, etc, préciser alors son type. ) " ;
+
+/* inline */
+ $lang['product type :']="Type :" ;
+
+/* Fiche One products */
+
+ $lang['tab products data']="Caractéristiques" ;
+ $lang['tab products desc']="Descriptions " ;
+ $lang['tab products option']="Options" ;
+ $lang['tab products cross']="Produits complémentaires" ;
+
+ /* Edition products */
+ $lang['text edit sort order']="Ordre de tri :" ;
+ $lang['text edit product']="Édition Produit " ;
+ $lang['text categories']="Catégories :" ;
+ $lang['text products']="Produits :" ;
+ $lang['text products price info']="Prix :" ;
+ $lang['text products tax class']="Classe fiscale :" ;
+ $lang['text products price net']=" HT :" ;
+ $lang['text products price gross']=" TTC :" ;
+ $lang['text products final price']="Prix final : " ;
+ $lang['text products quantity info']="Quantité :" ;
+ $lang['text date added']="Date d'ajout :" ;
+ $lang['text date available']="Date de disponibilité :" ;
+ $lang['text products type']="Type de produit :" ;
+ $lang['text products ordered']="Ordre tri:" ;
+ $lang['text sort order']="Ordre de tri :" ;
+ $lang['text products status']="Statut :" ;
+ $lang['text products date available']="Date de disponibilité :" ;
+ $lang['text products date format']="<small>(jj/mm/aaaa)</small>" ;
+ $lang['text product available']="Actif " ;
+ $lang['text product not available']="Désactivé" ;
+ $lang['text products name']="Nom :" ;
+ $lang['text products description']="Description :" ;
+ $lang['text products quantity']="Quantité :" ;
+ $lang['text products model']="Modèle :" ;
+ $lang['text products image']="Image :" ;
+ $lang['text products weight']="Poids :" ;
+ $lang['text products weight help']="le poids du produit est nécessaire pour calculer les frais de livraison" ;
+ $lang['text product more information']="Pour plus d'information, merci de visiter cette <a href=\"http://%s\">page web</a> de produits." ;
+ $lang['text product date added']="Ce produit a été ajouté à notre catalogue le %s." ;
+ $lang['text product date available']="Ce produit sera en stock le %s." ;
+ $lang['text customers groups']="Groupe : " ;
+ $lang['text customers groups note']="Tarif Groupe" ;
+ $lang['text customers groups note detail']="Notez que si un champ est laissé vide, aucun prix pour ce groupe de clients sera inséré dans la base de données. Si un champ est rempli, mais la case n'est pas cochée, aucun prix ne sera inséré. Si un prix est déjà inséré dans la base de données, mais la case n'est pas cochée, celui-ci sera supprimé de la base de données." ;
+
+ $lang['text legend stock']="Stock" ;
+ $lang['text legend price']="Prix" ;
+ $lang['text legend image']="Image" ;
+
+/* delete products */
+ $lang['text info heading delete product']="Supprimer le produit" ;
+ $lang['text delete product intro']="Êtes-vous sûr de vouloir supprimer définitivement ce produit ?" ;
+
+/* duplicate products */
+ $lang['text info copy to intro']="Veuillez choisir une nouvelle catégorie dans laquelle vous souhaitez copier ce produit" ;
+ $lang['text info heading copy to']="Copier vers" ;
+
+ $lang['create products in new link categorie for %s']="Copie reussie du produit" ;
+ $lang['error for create products in new link categorie for %s']="Erreur lors de la copie du porduit" ;
+
+
+
+/* mutliple choose */
+
+ /* select stock mode */
+ $lang['text product in stock']="En Stock" ;
+ $lang['text product not in stock']="Hors stock" ;
+
+
+
+
+/* general error */
+$lang['error catalog image directory not writeable %s']="Erreur : Impossible d'écrire dans le répertoire d'images : %s " ;
+$lang['error catalog image directory does not exist %s']="Erreur : Le répertoire d'images n'existe pas : %s " ;
?>
\ No newline at end of file
Modified: trunk/catalog/admin/includes/languages/fr_FR/modules/products/desc_base.txt
===================================================================
--- trunk/catalog/admin/includes/languages/fr_FR/modules/products/desc_base.txt 2012-02-22 09:42:35 UTC (rev 4039)
+++ trunk/catalog/admin/includes/languages/fr_FR/modules/products/desc_base.txt 2012-02-22 21:04:01 UTC (rev 4040)
@@ -1,11 +1,13 @@
<?php
/**
- @licence GPL 2005-2011 The osCSS developers - osCSS Open Source E-commerce
+ @licence GPL 2005-2012 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 23/03/11, 16:13
+ @version 2.1.1
+ @date 21/02/2012, 23:13
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
+ @sub-package desc_base
*/
$lang['Description produits ']="Description des produits " ;
$lang['Description simple des produits avec chapeau']="Description simple des produits avec chapeau" ;
@@ -15,4 +17,6 @@
$lang['Description longue affiché uniquement sur la page produit']="Description longue affichée uniquement sur la page produit" ;
$lang['enregistrer votre produit pour acceder à ces options ']="enregistrer votre produit pour accéder à ces options " ;
$lang['Description principale ']="Description principale " ;
+$lang['text products url']="URL :" ;
+$lang['text products url desc']="précisez un lien plus detaillé vers un site, un fabricants, un blog ... pour la langue %s" ;
?>
\ No newline at end of file
Modified: trunk/catalog/admin/includes/modules/pages/orders.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/orders.php 2012-02-22 09:42:35 UTC (rev 4039)
+++ trunk/catalog/admin/includes/modules/pages/orders.php 2012-02-22 21:04:01 UTC (rev 4040)
@@ -373,7 +373,12 @@
switch((string)$_GET['method']){
case 'add':
+
+// print_r($array);
+// exit;
$res = sqlshipping::create($array);
+// var_dump($res);
+// exit;
break;
}
@@ -394,7 +399,7 @@
if($res !=false){
$myarray = array(
- 'id'=>(int)$_GET['sID'],
+ 'id'=>(int)$_GET['sID'],
'status'=>(int)$_GET['flag'] ,
);
@@ -426,7 +431,7 @@
if($res !=false){
$myarray = array(
- 'id'=>(int)$_GET['sID'],
+ 'id'=>(int)$_GET['sID'],
'auto_retry'=>(int)$_GET['auto_retry'] ,
);
@@ -565,11 +570,10 @@
if(is_array($result4))
$res->allshipping = $result4;
- elseif(is_object($result4))
+ else
$res->allshipping[] = $result4;
- else
- $res->allshipping = false;
-
+// }
+
$res->display_service = (count($res->service) <= 0 )? false : true;
$res->display_shipping = (count($res->pshipping) <= 0 )? false : true;
$res->display_shipping_add = (!in_array(true, $activ_add))? false : true;
@@ -933,9 +937,9 @@
/**
@brief falg for activate / desactivate and indicate current status for service(virtual product)
- @param $row array current rows
+ @param $row array current rows
@param $justlink boolean for mode return
- @return string
+ @return string
link for action ($justlink=true)
or full html entite "a" normlised by current template
*/
@@ -983,9 +987,9 @@
/**
- @brief test if exist order id
+ @brief test if exist order id
@param $oID int order id
- @return false | true
+ @return false | true
*/
private static function test_oID($oID){
global $messageStack;
Modified: trunk/catalog/admin/includes/modules/pages/products.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/products.php 2012-02-22 09:42:35 UTC (rev 4039)
+++ trunk/catalog/admin/includes/modules/pages/products.php 2012-02-22 21:04:01 UTC (rev 4040)
@@ -4,7 +4,7 @@
@portion code Copyright (c) 2002 osCommerce
@package osCSS-2 <www http://www.oscss.org>
@version 2.1.1
- @date 04/02/12, 09:44
+ @date 01/01/12, 09:44
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
*/
@@ -281,15 +281,11 @@
$products_id = tep_db_prepare_input($_POST['products_id']);
$categories_id = tep_db_prepare_input($_POST['categories_id']);
- $type = tep_db_prepare_input($_POST['copy_as']);
+ $type = 'duplicate';
- if ($categories_id === self::$DiversInfo['current_category_id'] && $type =='link')
- $messageStack->add_session(ERROR_CANNOT_LINK_TO_SAME_CATEGORY, 'error');
-
-
if( ($pid = sqlproduct::copyto(array('id'=>$products_id ,'catid'=>$categories_id ,'type'=>$type))) && $pid > 0 ){
$products_id = $pid;
- $messageStack->add_session(sprintf(__('create products in new link categorie for %s'), $type ), 'error');
+ $messageStack->add_session(sprintf(__('create products in new link categorie for %s'), $type ), 'success');
}
else
$messageStack->add_session(sprintf(__('error for create products in new link categorie for %s'), $type ), 'error');
@@ -298,7 +294,7 @@
}
- tep_redirect(tep_href_link(self::FILENAME, 'cPath=' . $categories_id . '&pID=' . $products_id));
+ tep_redirect(tep_href_link(self::FILENAME, 'cPath=' . $categories_id . '&pID=' . $products_id.'&action=edit'));
break;
case 'new':
self::$DiversInfo['products_virtual_typeID'] = 1; // default, "Physical"
@@ -482,12 +478,12 @@
private static function emptyResult(){
$mod[] = 'null';
- $mod[] = 'null';
- $mod[] = 'null';
- $mod[] = 'null';
- $mod[] = 'null';
- $mod[] = 'null';
- $mod[] = 'null';
+ $mod[] = '';
+ $mod[] = '';
+ $mod[] = '';
+ $mod[] = '';
+ $mod[] = '';
+ $mod[] = '';
if(_cst_bool('STOCK_CHECK')) $mod[] = '0';
$mod[] = '0';
$mod[] = '0';
@@ -498,7 +494,7 @@
public static function tep_get_modele(){
$mod[0] = false;
$mod['products_id'] = true;
- $mod['products_image'] = true;
+// $mod['products_image'] = true;
$mod['typeID'] = true;
$mod['products_model'] = true;
$mod['products_name'] = true;
@@ -527,14 +523,9 @@
if(tep_not_null($sWhere)){
$sWhere=str_replace(array('products_id'),array('p.products_id'), $sWhere);
-
- if(strpos($sWhere, 'categories_name') >0 ) {
- $add_tbl=" , " . TABLE_CATEGORIES_DESCRIPTION . " cd ";
- $sWhere .=" AND cd.categories_id=p2c.categories_id ";
- }
}
- $products_query = "select distinct p.products_id, p.products_image, p.products_type as typeID , p.products_model,pd.products_name, p.products_quantity, p.products_price, p.products_status from " . TABLE_PRODUCTS . " p LEFT JOIN ".TABLE_STATUS." s on(p.products_type = s.status_id and s.status_type='products_virtual_types' and s.language_id='" . (int)$languages_id . "') , " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c LEFT JOIN " . TABLE_CATEGORIES_DESCRIPTION . " cd ON(cd.categories_id = p2c.categories_id AND cd.language_id = '" . (int)$languages_id . "') ".$add_tbl." where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id ".$cat." ".$avenir." ".$sta." ".$sWhere." order by ".((!empty($sOrder)) ? $sOrder : 'pd.products_name ASC');
+ $products_query = "select distinct p.products_id, p.products_image, p.products_type as typeID , p.products_model,pd.products_name, p.products_quantity, p.products_price, p.products_status from " . TABLE_PRODUCTS . " p LEFT JOIN ".TABLE_STATUS." s on(p.products_type = s.status_id and s.status_type='products_virtual_types' and s.language_id='" . (int)$languages_id . "') , " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c LEFT JOIN " . TABLE_CATEGORIES_DESCRIPTION . " cd ON (p2c.categories_id = cd.categories_id AND cd.language_id = '" . (int)$languages_id . "') ".$add_tbl." where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id ".$cat." ".$avenir." ".$sta." ".$sWhere." order by ".((!empty($sOrder)) ? $sOrder : 'pd.products_name ASC');
$query_numrows= tep_db_num_rows($DB->query($products_query));
@@ -544,9 +535,10 @@
while ($products = tep_db_fetch_array($pq)) {
- $products['products_image']=(!empty($products['products_image']))
- ? tep_info_image($products['products_image'], $products['products_name'], TEMP_BO_SMALL_IMAGE_WIDTH, TEMP_BO_SMALL_IMAGE_HEIGHT)
- : tep_info_image(IMAGE_NONEXISTENT, $products['products_name'], TEMP_BO_SMALL_IMAGE_WIDTH, TEMP_BO_SMALL_IMAGE_HEIGHT) ;
+ $products['products_name']='<a rel="'.tep_href_link('document.php', 'mod=img&typ=product&w=200&h=200&id='.$products['products_id']) .'" class="screenshot" href="#" title="">'.$products['products_name'].'</a>';
+// (!empty($products['products_image']))
+// ? tep_info_image($products['products_image'], $products['products_name'], TEMP_BO_SMALL_IMAGE_WIDTH, TEMP_BO_SMALL_IMAGE_HEIGHT)
+// : tep_info_image(IMAGE_NONEXISTENT, $products['products_name'], TEMP_BO_SMALL_IMAGE_WIDTH, TEMP_BO_SMALL_IMAGE_HEIGHT) ;
$products['products_status']=self::get_status_product($products);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2012-02-22 09:42:46
|
Revision: 4039
http://oscss.svn.sourceforge.net/oscss/?rev=4039&view=rev
Author: oscim
Date: 2012-02-22 09:42:35 +0000 (Wed, 22 Feb 2012)
Log Message:
-----------
coquille et oublie lors commit precedent
Modified Paths:
--------------
trunk/catalog/admin/includes/gabarit/orders/display_view.edit.gab
trunk/catalog/admin/includes/modules/pages/orders.php
trunk/catalog/common/classes/order.php
Modified: trunk/catalog/admin/includes/gabarit/orders/display_view.edit.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/orders/display_view.edit.gab 2012-02-20 20:53:11 UTC (rev 4038)
+++ trunk/catalog/admin/includes/gabarit/orders/display_view.edit.gab 2012-02-22 09:42:35 UTC (rev 4039)
@@ -241,24 +241,24 @@
<table class="main-orders history padd_w">
<thead>
- <tr>
- <th width="15%"><?php echo __('table heading date added'); ?></th>
- <th class="tcenter" width="10%"><?php echo __('table heading customer notified'); ?></th>
- <th class="tcenter" width="10%"><?php echo __('table heading status'); ?></th>
- <th><?php echo __('table heading comments'); ?></th>
- </tr>
+ <tr>
+ <th width="15%"><?php echo __('table heading date added'); ?></th>
+ <th class="tcenter" width="10%"><?php echo __('table heading customer notified'); ?></th>
+ <th class="tcenter" width="10%"><?php echo __('table heading status'); ?></th>
+ <th><?php echo __('table heading comments'); ?></th>
+ </tr>
</thead>
<tbody>
- <?php
- if( !is_array(orders::$order->lasthistory)): echo '<tr>' . "\n" . '<td colspan="5">' . __('text no order history') . '</td>' . "\n" . '</tr>' . "\n";
- else : ?>
- <tr>
- <td class="tcenter"><?php echo orders::$order->lasthistory['date_added']; ?></td>
- <td class="tcenter"><?php echo orders::$order->lasthistory['customer_notified']; ?></td>
- <td class="tcenter" style="width:40px; background:<?php echo orders::$order->lasthistory['color'] ?> url('includes/template/<?php echo $current_theme ?>/img/<?php echo $_SESSION['login_groups_id'] ?>/bg_graph.png') bottom left repeat-y;"><?php echo orders::$order->lasthistory['orders_status']; ?></td>
- <td><?php echo unhtmlentities(orders::$order->lasthistory['comments']); ?></td>
- </tr>
- <?php endif; ?>
+ <?php
+ if( !is_array(orders::$order->lasthistory)): echo '<tr>' . "\n" . '<td colspan="5">' . __('text no order history') . '</td>' . "\n" . '</tr>' . "\n";
+ else : ?>
+ <tr>
+ <td class="tcenter"><?php echo orders::$order->lasthistory['date_added']; ?></td>
+ <td class="tcenter"><?php echo orders::$order->lasthistory['customer_notified']; ?></td>
+ <td class="tcenter" style="width:40px; background:<?php echo orders::$order->lasthistory['color'] ?> url('includes/template/<?php echo $current_theme ?>/img/<?php echo $_SESSION['login_groups_id'] ?>/bg_graph.png') bottom left repeat-y;"><?php echo orders::$order->lasthistory['orders_status']; ?></td>
+ <td><?php echo unhtmlentities(orders::$order->lasthistory['comments']); ?></td>
+ </tr>
+ <?php endif; ?>
</tbody>
</table>
@@ -430,52 +430,56 @@
<?php if(orders::$order->display_shipping): ?>
<div id="tabs-4" class="tabPage">
- <ul>
- <?php $i = 0; foreach (orders::$order->allshipping as $ashipping): $i++; /*print_r($ashipping);*/?>
- <li>
- <h5>
- <span class="text date dateexpedition">
- <?php echo sprintf(__('text shipping expedie le %s'), tep_datetime_short($ashipping->date_expedition) ); ?>
- </span>
- <span class="text tracking">
- <?php echo sprintf(__('text shipping tracking n %s'),'<a href="'.$ashipping->tracking_url.'" >'.$ashipping->tracking.'</a>'); ?>
- </span>
+ <?php if(orders::$order->allshipping !=false): ?>
+ <ul>
+ <?php $i = 0; foreach (orders::$order->allshipping as $ashipping): $i++; /*print_r($ashipping);*/?>
+ <li>
+ <h5>
+ <span class="text date dateexpedition">
+ <?php echo sprintf(__('text shipping expedie le %s'), tep_datetime_short($ashipping->date_expedition) ); ?>
+ </span>
- <span class="text date method">
- <?php echo $ashipping->method; ?>
- </span>
- </h5>
+ <span class="text tracking">
+ <?php echo sprintf(__('text shipping tracking n %s'),'<a href="'.$ashipping->tracking_url.'" >'.$ashipping->tracking.'</a>'); ?>
+ </span>
- <table class="dataTableBase orders shipping allshipping">
- <thead>
- <tr>
- <th><?php echo __('table heading id'); ?></th>
- <th><?php echo __('table heading products'); ?></th>
- <th><?php echo __('table heading quantity deja expedie'); ?></th>
- </tr>
- </thead>
- <tbody>
- <?php $i = 0; foreach ($ashipping->products as $pshipping): $i++; /*print_r($pshipping);*/?>
- <td class="tcenter"><?php echo $pshipping->products_id ?></td>
- <td class="tleft">
- <span class="fleft">
- <a href="#" class="screenshot" rel="<?php echo tep_href_link('document.php', 'mod=img&typ=product&w=200&h=200&id='.$pshipping->products_id) ?>">
- <?php echo $pshipping->products_name ?>
- </a>
- </td>
- <td class="tcenter">
- <?php echo $pshipping->qt_expedie ?>
- </td>
- <?php endforeach; ?>
- </tbody>
- </table>
+ <span class="text date method">
+ <?php echo $ashipping->method; ?>
+ </span>
+ </h5>
- </li>
- <?php endforeach; ?>
- </ul>
+ <table class="dataTableBase orders shipping allshipping">
+ <thead>
+ <tr>
+ <th><?php echo __('table heading id'); ?></th>
+ <th><?php echo __('table heading products'); ?></th>
+ <th><?php echo __('table heading quantity deja expedie'); ?></th>
+ </tr>
+ </thead>
+ <tbody>
+ <?php $i = 0; foreach ($ashipping->products as $pshipping): $i++; /*print_r($pshipping);*/?>
+ <td class="tcenter"><?php echo $pshipping->products_id ?></td>
+ <td class="tleft">
+ <span class="fleft">
+ <a href="#" class="screenshot" rel="<?php echo tep_href_link('document.php', 'mod=img&typ=product&w=200&h=200&id='.$pshipping->products_id) ?>">
+ <?php echo $pshipping->products_name ?>
+ </a>
+ </td>
+ <td class="tcenter">
+ <?php echo $pshipping->qt_expedie ?>
+ </td>
+ <?php endforeach; ?>
+ </tbody>
+ </table>
+ </li>
+ <?php endforeach; ?>
+ </ul>
+ <?php endif; ?>
+
<br />
+
<!-- DEB Form add expedition -->
<?php echo tep_draw_form('add_deliv', orders::FILENAME,'oID='.orders::$oID.'&action=shipping&method=add', 'post', ' class="block_form"'); ?>
<table class="dataTableBase orders">
@@ -522,7 +526,7 @@
</table>
- <?php if( orders::$order->display_shipping_add ) : ?>
+ <?php if( orders::$order->display_shipping_add ) : ?>
<fieldset class="block_field fleft w_50" >
<legend><?php echo __('entry shipping new expedition details'); ?></legend>
Modified: trunk/catalog/admin/includes/modules/pages/orders.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/orders.php 2012-02-20 20:53:11 UTC (rev 4038)
+++ trunk/catalog/admin/includes/modules/pages/orders.php 2012-02-22 09:42:35 UTC (rev 4039)
@@ -373,12 +373,7 @@
switch((string)$_GET['method']){
case 'add':
-
-// print_r($array);
-// exit;
$res = sqlshipping::create($array);
-// var_dump($res);
-// exit;
break;
}
@@ -399,7 +394,7 @@
if($res !=false){
$myarray = array(
- 'id'=>(int)$_GET['sID'],
+ 'id'=>(int)$_GET['sID'],
'status'=>(int)$_GET['flag'] ,
);
@@ -431,7 +426,7 @@
if($res !=false){
$myarray = array(
- 'id'=>(int)$_GET['sID'],
+ 'id'=>(int)$_GET['sID'],
'auto_retry'=>(int)$_GET['auto_retry'] ,
);
@@ -570,10 +565,11 @@
if(is_array($result4))
$res->allshipping = $result4;
- else
+ elseif(is_object($result4))
$res->allshipping[] = $result4;
-// }
-
+ else
+ $res->allshipping = false;
+
$res->display_service = (count($res->service) <= 0 )? false : true;
$res->display_shipping = (count($res->pshipping) <= 0 )? false : true;
$res->display_shipping_add = (!in_array(true, $activ_add))? false : true;
@@ -937,9 +933,9 @@
/**
@brief falg for activate / desactivate and indicate current status for service(virtual product)
- @param $row array current rows
+ @param $row array current rows
@param $justlink boolean for mode return
- @return string
+ @return string
link for action ($justlink=true)
or full html entite "a" normlised by current template
*/
@@ -987,9 +983,9 @@
/**
- @brief test if exist order id
+ @brief test if exist order id
@param $oID int order id
- @return false | true
+ @return false | true
*/
private static function test_oID($oID){
global $messageStack;
Modified: trunk/catalog/common/classes/order.php
===================================================================
--- trunk/catalog/common/classes/order.php 2012-02-20 20:53:11 UTC (rev 4038)
+++ trunk/catalog/common/classes/order.php 2012-02-22 09:42:35 UTC (rev 4039)
@@ -211,7 +211,9 @@
$orders_products_query = tep_db_query("select orders_products_id, products_id,products_type, products_name, products_model, products_price, products_tax, products_quantity, final_price, products_returned,products_exchanged,products_exchanged_id from " .self::$tables['PRODUCTS'] . " where orders_id = '" . (int)$order_id . "'");
while ($orders_products = tep_db_fetch_array($orders_products_query)) {
- $this->products[$index] = array('qty' => $orders_products['products_quantity'],
+ $this->products[$index] = array(
+ 'rowid' => $orders_products['orders_products_id'],
+ 'qty' => $orders_products['products_quantity'],
'id' => $orders_products['products_id'],
'type' => $orders_products['products_type'],
'name' => $orders_products['products_name'],
@@ -227,14 +229,14 @@
$subindex = 0;
$attributes_query = tep_db_query("select products_options, products_options_values, options_values_price, price_prefix from " .self::$tables['ATTRIBUTES'] . " where orders_id = '" . (int)$order_id . "' and orders_products_id = '" . (int)$orders_products['orders_products_id'] . "'");
if (tep_db_num_rows($attributes_query)) {
- while ($attributes = tep_db_fetch_array($attributes_query)) {
- $this->products[$index]['attributes'][$subindex] = array('option' => $attributes['products_options'],
- 'value' => $attributes['products_options_values'],
- 'prefix' => $attributes['price_prefix'],
- 'price' => $attributes['options_values_price']);
+ while ($attributes = tep_db_fetch_array($attributes_query)) {
+ $this->products[$index]['attributes'][$subindex] = array('option' => $attributes['products_options'],
+ 'value' => $attributes['products_options_values'],
+ 'prefix' => $attributes['price_prefix'],
+ 'price' => $attributes['options_values_price']);
- $subindex++;
- }
+ $subindex++;
+ }
}
$shown_price= ($this->products[$index]['final_price'] * $this->products[$index]['qty']);
@@ -375,26 +377,26 @@
);
if ($prdct['attributes']) {
- $subindex = 0;
- reset($prdct['attributes']);
- while (list($option, $value) = each($prdct['attributes'])) {
- $attributes_query = tep_db_query("select popt.products_options_name, popt.products_options_track_stock, poval.products_options_values_name, pa.options_values_price, pa.price_prefix,pa.options_values_weight from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa where pa.products_id = '" . (int)$prdct['id'] . "' and pa.options_id = '" . (int)$option . "' and pa.options_id = popt.products_options_id and pa.options_values_id = '" . (int)$value . "' and pa.options_values_id = poval.products_options_values_id and popt.language_id = '" . (int)$languages_id . "' and poval.language_id = '" . (int)$languages_id . "'");
+ $subindex = 0;
+ reset($prdct['attributes']);
+ while (list($option, $value) = each($prdct['attributes'])) {
+ $attributes_query = tep_db_query("select popt.products_options_name, popt.products_options_track_stock, poval.products_options_values_name, pa.options_values_price, pa.price_prefix,pa.options_values_weight from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa where pa.products_id = '" . (int)$prdct['id'] . "' and pa.options_id = '" . (int)$option . "' and pa.options_id = popt.products_options_id and pa.options_values_id = '" . (int)$value . "' and pa.options_values_id = poval.products_options_values_id and popt.language_id = '" . (int)$languages_id . "' and poval.language_id = '" . (int)$languages_id . "'");
- $attributes = tep_db_fetch_array($attributes_query);
- if(isset($prdct['attributes_values'][$option]) ) {
- /* Specifique option type texte / file champ personnalisé par le client */
- $attributes['products_options_values_name'] .= '('.$prdct['attributes_values'][$option].')';
- }
- $this->products[$index]['attributes'][$subindex] = array('option' => $attributes['products_options_name'],
- 'value' => $attributes['products_options_values_name'],
- 'option_id' => $option,
- 'value_id' => $value,
- 'prefix' => $attributes['price_prefix'],
- 'price' => $attributes['options_values_price'],
- 'track_stock' => $attributes['products_options_track_stock']);
+ $attributes = tep_db_fetch_array($attributes_query);
+ if(isset($prdct['attributes_values'][$option]) ) {
+ /* Specifique option type texte / file champ personnalisé par le client */
+ $attributes['products_options_values_name'] .= '('.$prdct['attributes_values'][$option].')';
+ }
+ $this->products[$index]['attributes'][$subindex] = array('option' => $attributes['products_options_name'],
+ 'value' => $attributes['products_options_values_name'],
+ 'option_id' => $option,
+ 'value_id' => $value,
+ 'prefix' => $attributes['price_prefix'],
+ 'price' => $attributes['options_values_price'],
+ 'track_stock' => $attributes['products_options_track_stock']);
- $subindex++;
- }
+ $subindex++;
+ }
}
/*
@@ -402,14 +404,14 @@
Seul les "$this->products" doivent être utilsié pour le calcul
*/
if( is_object( $this->coupon ) ) {
- $applied_discount = 0;
- $discount = $this->coupon->calculate_discount( $this->products[$index], $valid_products_count );
- if( $discount['applied_discount'] > 0 ) $valid_products_count++;
- $shown_price = $this->coupon->calculate_shown_price( $discount, $this->products[$index] );
- $shown_taxe = tep_calculate_tax($shown_price['shown_price'], $this->products[$index]['tax']);
- $this->products[$index]['total_line'] = $shown_price['shown_price'];
- $this->products[$index]['total_line_taxe'] = $shown_taxe;
- $this->products[$index]['total_line_ttc'] = tep_add_tax($shown_price['shown_price'], $this->products[$index]['tax']);
+ $applied_discount = 0;
+ $discount = $this->coupon->calculate_discount( $this->products[$index], $valid_products_count );
+ if( $discount['applied_discount'] > 0 ) $valid_products_count++;
+ $shown_price = $this->coupon->calculate_shown_price( $discount, $this->products[$index] );
+ $shown_taxe = tep_calculate_tax($shown_price['shown_price'], $this->products[$index]['tax']);
+ $this->products[$index]['total_line'] = $shown_price['shown_price'];
+ $this->products[$index]['total_line_taxe'] = $shown_taxe;
+ $this->products[$index]['total_line_ttc'] = tep_add_tax($shown_price['shown_price'], $this->products[$index]['tax']);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2012-02-20 20:53:20
|
Revision: 4038
http://oscss.svn.sourceforge.net/oscss/?rev=4038&view=rev
Author: oscim
Date: 2012-02-20 20:53:11 +0000 (Mon, 20 Feb 2012)
Log Message:
-----------
developpement de la gestion des commandes, integration d'une gestion de livraison (fragment?\195?\169)
ajout d'une gestion de service
ajout des tables et drivers admin correspondants
Modified Paths:
--------------
trunk/catalog/admin/includes/classes/productUtility.php
trunk/catalog/admin/includes/database_tables.php
trunk/catalog/admin/includes/gabarit/orders/display_view.edit.gab
trunk/catalog/admin/includes/gabarit/products/display_view.new.gab
trunk/catalog/admin/includes/languages/fr_FR/modules/pages/orders.txt
trunk/catalog/admin/includes/modules/pages/orders.php
Added Paths:
-----------
trunk/catalog/admin/includes/classes/drivers/sqlservices.php
trunk/catalog/admin/includes/classes/drivers/sqlshipping.php
trunk/catalog/admin/includes/javascript/modules/pages/orders.js.php
trunk/catalog/install/includes/sql/mysql/tables/osc_services.sql
trunk/catalog/install/includes/sql/mysql/tables/osc_shipping.sql
trunk/catalog/install/includes/sql/mysql/tables/osc_shipping_products.sql
Added: trunk/catalog/admin/includes/classes/drivers/sqlservices.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlservices.php (rev 0)
+++ trunk/catalog/admin/includes/classes/drivers/sqlservices.php 2012-02-20 20:53:11 UTC (rev 4038)
@@ -0,0 +1,203 @@
+<?php if (!defined('HTTP_SERVER')) die('You can not access this file directly!');
+/**
+ @licence GPL 2005-2011 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/09/11, 20:11
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+ @class manage link table configuration
+*/
+
+
+
+
+class sqlservices
+ implements ModSqlDataDriver{
+
+
+ /**
+ @brief create new ligne in table configuration
+ */
+ public static function create($option){
+
+ if(!isset($option['customers_id'])) return 'customers_id';
+ if(!isset($option['orders_id'])) return 'orders_id';
+ if(!isset($option['orders_products_id'])) return 'orders_products_id';
+
+ if(isset($option['customers_id'])) $sql_data_array['customers_id'] = $option['customers_id'];
+ if(isset($option['orders_id'])) $sql_data_array['orders_id'] = $option['orders_id'];
+ if(isset($option['orders_products_id'])) $sql_data_array['orders_products_id'] = $option['orders_products_id'];
+
+ if(isset($option['status'])) $sql_data_array['status'] = $option['status'];
+ if(isset($option['date_added'])) $sql_data_array['date_added'] = $option['date_added'];
+ if(isset($option['date_start'])) $sql_data_array['date_start'] = $option['date_start'];
+ if(isset($option['duration'])) $sql_data_array['duration'] = $option['duration'];
+ if(isset($option['duration_unit'])) $sql_data_array['duration_unit'] = $option['duration_unit'];
+ if(isset($option['date_revival'])) $sql_data_array['date_revival'] = $option['date_revival'];
+ if(isset($option['auto_retry'])) $sql_data_array['auto_retry'] = $option['auto_retry'];
+
+ $res=tep_db_perform(TABLE_SERVICES, $sql_data_array);
+
+ if(!$res)
+ return $res;
+ else
+ return $res->__get('insertId');
+ }
+
+
+
+ /**
+ @brief update ligne in table configuration
+ */
+ public static function update($option){
+
+ if(!isset($option['id'])) return 'id';
+// if(!isset($option['customers_id'])) return 'customers_id';
+// if(!isset($option['orders_id'])) return 'orders_id';
+// if(!isset($option['orders_products_id'])) return 'orders_products_id';
+
+
+ $where ='';
+ if(isset($option['id'])) $where .="AND row_id = '".(int)$option['id']."' ";
+ if(isset($option['customers_id'])) $where .="AND customers_id = '".$option['customers_id']."' ";
+ if(isset($option['orders_id'])) $where .="AND orders_id = '".$option['orders_id']."' ";
+ if(isset($option['orders_products_id'])) $where .="AND orders_products_id = '".$option['orders_products_id']."' ";
+
+ if(isset($option['status'])) $sql_data_array['status'] = $option['status'];
+ if(isset($option['date_added'])) $sql_data_array['date_added'] = $option['date_added'];
+ if(isset($option['date_start'])) $sql_data_array['date_start'] = $option['date_start'];
+ if(isset($option['duration'])) $sql_data_array['duration'] = $option['duration'];
+ if(isset($option['duration_unit'])) $sql_data_array['duration_unit'] = $option['duration_unit'];
+ if(isset($option['date_revival'])) $sql_data_array['date_revival'] = $option['date_revival'];
+ if(isset($option['auto_retry'])) $sql_data_array['auto_retry'] = $option['auto_retry'];
+
+
+ $res=tep_db_perform(TABLE_SERVICES, $sql_data_array, 'update' , substr($where,3) );
+// var_dump($res);
+ return $res;
+ }
+
+ /**
+ @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)
+
+ @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){
+ $DB=Database::getInstance();
+
+ $sql ="";
+
+ if(isset($option['id'])) $sql .="AND row_id = '".(int)$option['id']."' ";
+ if(isset($option['customers_id'])) $sql .="AND customers_id = '".(int)$option['customers_id']."' ";
+ if(isset($option['orders_id'])) $sql .="AND orders_id = '".(int)$option['orders_id']."' ";
+ if(isset($option['orders_products_id'])) $sql .="AND orders_products_id = '".(int)$option['orders_products_id']."' ";
+
+
+ $sql ="SELECT * FROM ".TABLE_SERVICES." 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){
+ $DB=Database::getInstance();
+
+ $sql ="";
+ if(isset($option['id'])) $sql .="AND row_id = '".(int)$option['id']."' ";
+ if(isset($option['customers_id'])) $sql .="AND customers_id = '".(int)$option['customers_id']."' ";
+ if(isset($option['orders_id'])) $sql .="AND orders_id = '".(int)$option['orders_id']."' ";
+ if(isset($option['orders_products_id'])) $sql .="AND orders_products_id = '".(int)$option['orders_products_id']."' ";
+
+ if(strlen($sql)==0)
+ return false;
+
+ $sql ="DELETE FROM ".TABLE_SERVICES." WHERE ".substr($sql,3);
+
+ $res=$DB->query($sql);
+
+ return $res;
+ }
+
+ /**
+ @fn CleanKey()
+ @brief Clean string name key
+ */
+ private static function CleanKey($array){
+
+ $object= new stdclass();
+
+ foreach($array as $key=>$value){
+ if( $key == "rowid")
+ $key='id';
+
+ $object->$key = $value;
+ }
+
+ return $object;
+ }
+
+ /**
+ @brief
+ @return array empty
+ */
+ public static function Specimen(){
+
+ $par = array(
+ 'row_id',
+ 'customers_id',
+ 'orders_id',
+ 'orders_products_id',
+ 'status',
+ 'date_added',
+ 'date_start',
+ 'duration',
+ 'duration_unit',
+ 'date_revival',
+ 'auto_retry',
+
+ );
+
+ return self::CleanKey($par);
+ }
+
+}
+
+
+?>
\ No newline at end of file
Added: trunk/catalog/admin/includes/classes/drivers/sqlshipping.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlshipping.php (rev 0)
+++ trunk/catalog/admin/includes/classes/drivers/sqlshipping.php 2012-02-20 20:53:11 UTC (rev 4038)
@@ -0,0 +1,247 @@
+<?php if (!defined('HTTP_SERVER')) die('You can not access this file directly!');
+/**
+ @licence GPL 2005-2011 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/09/11, 20:11
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+ @class manage link table configuration
+*/
+
+
+
+
+class sqlshipping
+ implements ModSqlDataDriver{
+
+
+ /**
+ @brief create new ligne in table configuration
+ */
+ public static function create($option){
+
+// if(!isset($option['customers_id'])) return 'customers_id';
+ if(!isset($option['orders_id'])) return 'orders_id';
+// if(!isset($option['orders_products_id'])) return 'orders_products_id';
+
+// if(isset($option['customers_id'])) $sql_data_array['customers_id'] = $option['customers_id'];
+ if(isset($option['orders_id'])) $sql_data_array['orders_id'] = $option['orders_id'];
+// if(isset($option['orders_products_id'])) $sql_data_array['orders_products_id'] = $option['orders_products_id'];
+
+ if(isset($option['method'])) $sql_data_array['method'] = $option['method'];
+ if(isset($option['tracking'])) $sql_data_array['tracking'] = $option['tracking'];
+ if(isset($option['tracking_url'])) $sql_data_array['tracking_url'] = $option['tracking_url'];
+ if(isset($option['date_expedition'])) $sql_data_array['date_expedition'] = $option['date_expedition'];
+
+
+ $res=tep_db_perform(TABLE_SHIPPING, $sql_data_array);
+
+ if(!$res)
+ return $res;
+ /*else
+ return*/
+ else
+ $id = $res->__get('insertId');
+
+
+ if(is_array($option['products']))
+ foreach($option['products'] as $rows){
+ $sql_data_array = array();
+ $sql_data_array['shipping_id'] = $id;
+ $sql_data_array['orders_products_id'] = $rows['products_id'];
+ $sql_data_array['qt_expedie'] = $rows['qt'];
+ $res=tep_db_perform(TABLE_SHIPPING_PRODUCTS, $sql_data_array);
+ }
+
+
+ return $id;
+ }
+
+
+
+ /**
+ @brief update ligne in table configuration
+ */
+ public static function update($option){
+
+ if(!isset($option['id'])) return 'id';
+// if(!isset($option['customers_id'])) return 'customers_id';
+// if(!isset($option['orders_id'])) return 'orders_id';
+// if(!isset($option['orders_products_id'])) return 'orders_products_id';
+
+
+ $where ='';
+ if(isset($option['id'])) $where .="AND row_id = '".(int)$option['id']."' ";
+// if(isset($option['customers_id'])) $where .="AND customers_id = '".$option['customers_id']."' ";
+ if(isset($option['orders_id'])) $where .="AND orders_id = '".$option['orders_id']."' ";
+// if(isset($option['orders_products_id'])) $where .="AND orders_products_id = '".$option['orders_products_id']."' ";
+
+ if(isset($option['method'])) $sql_data_array['method'] = $option['method'];
+ if(isset($option['tracking'])) $sql_data_array['tracking'] = $option['tracking'];
+ if(isset($option['tracking_url'])) $sql_data_array['tracking_url'] = $option['tracking_url'];
+ if(isset($option['date_expedition'])) $sql_data_array['date_expedition'] = $option['date_expedition'];
+
+
+ $res=tep_db_perform(TABLE_SHIPPING, $sql_data_array, 'update' , substr($where,3) );
+// var_dump($res);
+ return $res;
+ }
+
+ /**
+ @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)
+
+ @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){
+ $DB=Database::getInstance();
+
+ $sql ="";
+
+ if(isset($option['id'])) $sql .="AND row_id = '".(int)$option['id']."' ";
+// if(isset($option['customers_id'])) $sql .="AND customers_id = '".(int)$option['customers_id']."' ";
+ if(isset($option['orders_id'])) $sql .="AND orders_id = '".(int)$option['orders_id']."' ";
+// if(isset($option['orders_products_id'])) $sql .="AND orders_products_id = '".(int)$option['orders_products_id']."' ";
+
+
+ $sql ="SELECT * FROM ".TABLE_SHIPPING." WHERE ".substr($sql,3);
+
+ $res=$DB->query($sql);
+
+ $num = $res->__get('numRows');
+
+ if($num == 1){
+ $result=$res->fetchAssoc();
+
+
+ $sql = "SELECT sp.* , op.*
+ FROM ".TABLE_SHIPPING_PRODUCTS." sp
+ LEFT JOIN " . TABLE_ORDERS_PRODUCTS . " op ON(op.orders_products_id = sp.orders_products_id )
+ WHERE shipping_id = '".(int)$result['row_id']."' ";
+
+ $res2 = $DB->query($sql);
+
+ foreach($res2->fetchAllAssoc() as $result2){
+ $r2 = new stdClass();
+ $r2->shipping_id = $result2['shipping_id'];
+ $r2->orders_products_id = $result2['orders_products_id'];
+ $r2->products_id = $result2['products_id'];
+ $r2->products_name = $result2['products_name'];
+ $r2->qt_expedie = $result2['qt_expedie'];
+
+ $result['products'][] = $r2;
+ }
+// print_r($result);
+ return ((!$shortkey)? $result : self::CleanKey($result));
+
+
+ }
+ elseif($num > 1){
+ $array=array();
+
+ foreach($res->fetchAllAssoc() as $result){
+
+ $sql = "SELECT * FROM ".TABLE_SHIPPING_PRODUCTS." WHERE shipping_id = '".(int)$result['row_id']."' ";
+
+ $res2 = $DB->query($sql);
+
+ foreach($res2->fetchAllAssoc() as $result2){
+ $r2 = new stdClass();
+ $r2->shipping_id = $result2['shipping_id'];
+ $r2->orders_products_id = $result2['orders_products_id'];
+ $r2->qt_expedie = $result2['qt_expedie'];
+
+ $result['products'][] = $r2;
+ }
+
+ $array[]= ((!$shortkey)? $result : self::CleanKey($result));
+ }
+
+ return $array;
+ }
+
+ return false;
+ }
+
+ /**
+ @brief delete row
+ */
+ public static function delete($option){
+ $DB=Database::getInstance();
+
+ $sql ="";
+ if(isset($option['id'])) $sql .="AND row_id = '".(int)$option['id']."' ";
+// if(isset($option['customers_id'])) $sql .="AND customers_id = '".(int)$option['customers_id']."' ";
+ if(isset($option['orders_id'])) $sql .="AND orders_id = '".(int)$option['orders_id']."' ";
+// if(isset($option['orders_products_id'])) $sql .="AND orders_products_id = '".(int)$option['orders_products_id']."' ";
+
+ if(strlen($sql)==0)
+ return false;
+
+ $sql ="DELETE FROM ".TABLE_SHIPPING." WHERE ".substr($sql,3);
+
+ $res=$DB->query($sql);
+
+ return $res;
+ }
+
+ /**
+ @fn CleanKey()
+ @brief Clean string name key
+ */
+ private static function CleanKey($array){
+
+ $object= new stdclass();
+
+ foreach($array as $key=>$value){
+ if( $key == "rowid")
+ $key='id';
+
+ $object->$key = $value;
+ }
+
+ return $object;
+ }
+
+ /**
+ @brief
+ @return array empty
+ */
+ public static function Specimen(){
+
+ $par = array(
+ 'row_id',
+// 'customers_id',
+ 'orders_id',
+// 'orders_products_id',
+ 'method',
+ 'tracking',
+ 'tracking_url',
+ 'date_expedition',
+
+ );
+
+ return self::CleanKey($par);
+ }
+
+}
+
+
+?>
\ No newline at end of file
Modified: trunk/catalog/admin/includes/classes/productUtility.php
===================================================================
--- trunk/catalog/admin/includes/classes/productUtility.php 2012-02-20 09:16:08 UTC (rev 4037)
+++ trunk/catalog/admin/includes/classes/productUtility.php 2012-02-20 20:53:11 UTC (rev 4038)
@@ -1,10 +1,10 @@
<?php if (!defined('HTTP_SERVER')) die('You can not access this file directly!');
/**
- @licence GPL 2005-2011 The osCSS developers - osCSS Open Source E-commerce
+ @licence GPL 2005-2012 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 12/11/11, 10:49
+ @date 19/02/2012, 10:49
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
@class productUtility
@@ -12,9 +12,10 @@
class productUtility {
/**
- @package oscss
- @author OscssTeam
- Calcul des id de product, avec option
+ @fn get_uprid($prid, $params)
+ @brief Calcul des id de product, avec option
+ @param $prid
+ @param $params
*/
public static function get_uprid($prid, $params) {
$uprid = $prid;
@@ -28,9 +29,9 @@
}
/**
- @package oscss
- @author OscssTeam
- Calcul des id de product, avec option
+ @fn get_prid($uprid)
+ @brief Calcul des id de product, avec option
+ @param $uprid
*/
public static function get_prid($uprid) {
$pieces = explode('{', $uprid);
@@ -39,15 +40,11 @@
}
/**
- Function de construction du tableau des produits online
+ @fn get_product_list($exclude = '')
+ @brief Function de construction du tableau des produits online
Fournis tous les produits , sauf inactif ou categorie inactif
-
- @package oscss-Rv
- @author oscim <mail a...@os... /><web http://www.oscim.fr />
- @param
- @a array liste des id produits exlus
+ @param $exclude array liste des id produits exlus
@return array
-
*/
public static function get_product_list($exclude = ''){
global $currencies, $languages_id;
@@ -56,9 +53,9 @@
$products_query = tep_db_query("select p.products_id, pd.products_name, p.products_price 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 p2c.products_id=p.products_id and c.categories_id=p2c.categories_id and c.categories_status='1' order by products_name");
while ($products = tep_db_fetch_array($products_query)){
if (!in_array($products['products_id'], $exclude)){
- $products_tax_query = tep_db_query("select t.tax_class_id, t.tax_class_title from " . TABLE_PRODUCTS . " p, " . TABLE_TAX_CLASS . " t where p.products_id ='".$products['products_id']."' and p.products_tax_class_id=t.tax_class_id ");
- $products_tax = tep_db_fetch_array($products_tax_query);
- $prod[$products['products_id']]=array_merge((array)$products, (array)$products_tax);
+ $products_tax_query = tep_db_query("select t.tax_class_id, t.tax_class_title from " . TABLE_PRODUCTS . " p, " . TABLE_TAX_CLASS . " t where p.products_id ='".$products['products_id']."' and p.products_tax_class_id=t.tax_class_id ");
+ $products_tax = tep_db_fetch_array($products_tax_query);
+ $prod[$products['products_id']]=array_merge((array)$products, (array)$products_tax);
}
}
return $prod;
@@ -66,10 +63,11 @@
/**
- Return a product's special price (returns nothing if there is no offer)
+ @fn get_products_special_price($product_id)
+ @brief
+ @param $product_id int
+ @return a product's special price (returns nothing if there is no offer)
TABLES: products
- @package oscss
- @author OscssTeam
*/
public static function get_products_special_price($product_id) {
$product_query = tep_db_query("select specials_new_products_price from " . TABLE_SPECIALS . " where products_id = '" . (int)$product_id . "' and status");
@@ -78,8 +76,11 @@
}
/**
- @package oscss
- @author OscssTeam
+ @fn get_products_name($product_id, $language_id = 0)
+ @brief product name
+ @param $product_id int
+ @param $language_id int
+ @return string name products
*/
public static function get_products_name($product_id, $language_id = 0) {
global $languages_id;
@@ -92,7 +93,11 @@
}
/**
+ @fn options_name($options_id)
+ @brief name option products
+ @param $options_id int
@page qtpro_function.php
+ @return string name of option
*/
public static function options_name($options_id) {
global $languages_id;
@@ -102,9 +107,11 @@
}
/**
- @page attributeManager.php
- @page stock.central.php
- @page stats_low_attrib.php
+ @fn values_name($values_id)
+ @brief name of option value
+ @param $values_id int
+ @page attributeManager.php|stock.central.php|stats_low_attrib.php
+ @return string name of option value
*/
public static function values_name($values_id) {
global $languages_id;
@@ -116,6 +123,7 @@
}
/**
+ @fn get_product_attribut_price($products_id, $attributes=array(), $price=0)
@brief Recuperation price pour attribute
*/
public static function get_product_attribut_price($products_id, $attributes=array(), $price=0){
@@ -124,13 +132,13 @@
if (is_array($attributes) && count($attributes)>0) {
reset($attributes);
while (list($option, $value) = each($attributes)) {
- $attribute_price_query = tep_db_query("select options_values_price, price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . (int)$products_id . "' and options_id = '" . (int)$option . "' and options_values_id = '" . (int)$value . "'");
- $attribute_price = tep_db_fetch_array($attribute_price_query);
- if ($attribute_price['price_prefix'] == '+') {
- $price += $attribute_price['options_values_price'];
- } else {
- $price -= $attribute_price['options_values_price'];
- }
+ $attribute_price_query = tep_db_query("select options_values_price, price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . (int)$products_id . "' and options_id = '" . (int)$option . "' and options_values_id = '" . (int)$value . "'");
+ $attribute_price = tep_db_fetch_array($attribute_price_query);
+ if ($attribute_price['price_prefix'] == '+') {
+ $price += $attribute_price['options_values_price'];
+ } else {
+ $price -= $attribute_price['options_values_price'];
+ }
}
}
@@ -138,12 +146,13 @@
}
/**
- Generation des value de product extra value
+ @fn get_product_extra_value($epf_id, $product_id, $language_id)
+ @brief Generation des value de product extra value
Si langue , table TABLE_PRODUCTS_DESCRIPTION sinon table TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS
@package extra_fields_products
- @author oscim <mail os...@os...> <www http://www.oscim.fr>
- @param
- @a int/string id epf ou key epf
+ @param $epf_id int/string id epf ou key epf
+ @param $product_id
+ @param $language_id
*/
public static function get_product_extra_value($epf_id, $product_id, $language_id) {
@@ -166,7 +175,8 @@
}
/**
- Generation des proudct extra value
+ @fn get_extra_field_list_value($value_id, $show_chain = false)
+ @brief Generation des products extra value
@package extra_fields_products
*/
public static function get_extra_field_list_value($value_id, $show_chain = false) {
@@ -180,7 +190,8 @@
}
/**
- Generation des proudct extra value
+ @fn list_epf_children($parent_id)
+ @brief Generation des products extra value
@package extra_fields_products
*/
public static function list_epf_children($parent_id) {
@@ -193,7 +204,8 @@
}
/**
- Generation des proudct extra value
+ @fn build_epf_pulldown($epf_id, $languages_id, $value_array = '', $parent_id = 0, $indent = '')
+ @brief Generation des products extra value
@package extra_fields_products
*/
public static function build_epf_pulldown($epf_id, $languages_id, $value_array = '', $parent_id = 0, $indent = '') {
@@ -219,13 +231,12 @@
$language_id=$languages_id;
$products_attributes_query = tep_db_query("select * from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$pID . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int) $language_id. "'");
-// $products_attributes = tep_db_fetch_array($products_attributes_query);
-// $products_attributes= ($products_attributes['total'] > 0)? $products_attributes['total'] : 0 ;
return $products_attributes_query->fetchAllAssoc();
}
/**
+ @fn get_products_attribute_stock($products_id, $attributes=array())
* \brief Calcul des stock avec attribut , pour un jeu d'attribut
* @param [in] $products_id int
* @param [in] $attributes tableau attribute id array
@@ -265,23 +276,22 @@
@package oscss
@author OscssTeam
*/
- public static function set_product_status($products_id, $status) {
- if ($status == '1') {
- return tep_db_query("update " . TABLE_PRODUCTS . " set products_status = '1', products_last_modified = now() where products_id = '" . (int)$products_id . "'");
- } elseif ($status == '0') {
- return tep_db_query("update " . TABLE_PRODUCTS . " set products_status = '0', products_last_modified = now() where products_id = '" . (int)$products_id . "'");
- } else {
- return -1;
- }
- }
+// public static function set_product_status($products_id, $status) {
+// if ($status == '1') {
+// return tep_db_query("update " . TABLE_PRODUCTS . " set products_status = '1', products_last_modified = now() where products_id = '" . (int)$products_id . "'");
+// } elseif ($status == '0') {
+// return tep_db_query("update " . TABLE_PRODUCTS . " set products_status = '0', products_last_modified = now() where products_id = '" . (int)$products_id . "'");
+// } else {
+// return -1;
+// }
+// }
/**
- @package oscss-codev
- @author oscim - OscssTeam
- @version 5.1
- @note suppression de produits
+ @fn remove_product($product_id)
+ @brief suppression de produits
Prend en charge Qtpro + ACA
- @p products.php,manufactureds.php
+ @param $product_id int
+ @page products.php|manufactureds.php
*/
public static function remove_product($product_id) {
global $products_modules;
@@ -333,41 +343,41 @@
}
/**
- Restock des produits lors suppression commande et/ou suppression du montant ht de product_to_customer (oscss-major)
+ @fn products_restock($order_id, $customers_id='')
+ @brief Restock des produits lors suppression commande et/ou suppression du montant ht de product_to_customer (oscss-major)
Prend en charge ACA
- @package oscss-major
- @author oscim- OscssTeam
- @version 6.1
- @page held_orders.php,orders.php,return.php
+ @param $order_id int
+ @param $customers_id int
+ @page held_orders.php|orders.php|return.php
*/
public static function products_restock($order_id, $customers_id=''){
- error_reporting(E_ALL);
+
global $products_modules;
$order_query = tep_db_query("select products_id, products_quantity, products_stock_attributes, final_price from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . (int)$order_id . "'");
while ($order = tep_db_fetch_array($order_query)) {
$product_stock_adjust = 0;
if (tep_not_null($order['products_stock_attributes'])) {
- if ($order['products_stock_attributes'] != '$$DOWNLOAD$$') {
- $attributes_stock_query = tep_db_query("SELECT products_stock_quantity
- FROM " . TABLE_PRODUCTS_STOCK . "
- WHERE products_stock_attributes = '" . $order['products_stock_attributes'] . "'
- AND products_id = '" . (int)$order['products_id'] . "'");
- if (tep_db_num_rows($attributes_stock_query) > 0) {
- $attributes_stock_values = tep_db_fetch_array($attributes_stock_query);
- tep_db_query("UPDATE " . TABLE_PRODUCTS_STOCK . "
- SET products_stock_quantity = products_stock_quantity + '" . (int)$order['products_quantity'] . "'
- WHERE products_stock_attributes = '" . $order['products_stock_attributes'] . "'
- AND products_id = '" . (int)$order['products_id'] . "'");
- $product_stock_adjust = min($order['products_quantity'], $order['products_quantity']+$attributes_stock_values['products_stock_quantity']);
- } else {
- tep_db_query("INSERT into " . TABLE_PRODUCTS_STOCK . "
- (products_id, products_stock_attributes, products_stock_quantity)
- VALUES ('" . (int)$order['products_id'] . "', '" . $order['products_stock_attributes'] . "', '" . (int)$order['products_quantity'] . "')");
- $product_stock_adjust = $order['products_quantity'];
- }
- }
+ if ($order['products_stock_attributes'] != '$$DOWNLOAD$$') {
+ $attributes_stock_query = tep_db_query("SELECT products_stock_quantity
+ FROM " . TABLE_PRODUCTS_STOCK . "
+ WHERE products_stock_attributes = '" . $order['products_stock_attributes'] . "'
+ AND products_id = '" . (int)$order['products_id'] . "'");
+ if (tep_db_num_rows($attributes_stock_query) > 0) {
+ $attributes_stock_values = tep_db_fetch_array($attributes_stock_query);
+ tep_db_query("UPDATE " . TABLE_PRODUCTS_STOCK . "
+ SET products_stock_quantity = products_stock_quantity + '" . (int)$order['products_quantity'] . "'
+ WHERE products_stock_attributes = '" . $order['products_stock_attributes'] . "'
+ AND products_id = '" . (int)$order['products_id'] . "'");
+ $product_stock_adjust = min($order['products_quantity'], $order['products_quantity']+$attributes_stock_values['products_stock_quantity']);
+ } else {
+ tep_db_query("INSERT into " . TABLE_PRODUCTS_STOCK . "
+ (products_id, products_stock_attributes, products_stock_quantity)
+ VALUES ('" . (int)$order['products_id'] . "', '" . $order['products_stock_attributes'] . "', '" . (int)$order['products_quantity'] . "')");
+ $product_stock_adjust = $order['products_quantity'];
+ }
+ }
} else {
- $product_stock_adjust = $order['products_quantity'];
+ $product_stock_adjust = $order['products_quantity'];
}
tep_db_query("UPDATE " . TABLE_PRODUCTS . "
@@ -376,15 +386,15 @@
//! Supp table specifique oscss-major
if (!empty($customers_id)){
- /* Element modulaire aca */
- if (!is_object($products_modules)) {
- require_once (DIR_WS_MODULES.'pages/products.php');
- $products_modules = new productsACA();
- }
- $products_modules->products_restock($order['products_id'],$customers_id,$order['products_quantity'],($order['products_quantity'] *$order['final_price'] ) );
+ /* Element modulaire aca */
+ if (!is_object($products_modules)) {
+ require_once (DIR_WS_MODULES.'pages/products.php');
+ $products_modules = new productsACA();
+ }
+ $products_modules->products_restock($order['products_id'],$customers_id,$order['products_quantity'],($order['products_quantity'] *$order['final_price'] ) );
}
}
}
}
-?>
+?>
\ No newline at end of file
Modified: trunk/catalog/admin/includes/database_tables.php
===================================================================
--- trunk/catalog/admin/includes/database_tables.php 2012-02-20 09:16:08 UTC (rev 4037)
+++ trunk/catalog/admin/includes/database_tables.php 2012-02-20 20:53:11 UTC (rev 4038)
@@ -1,10 +1,10 @@
<?php
/**
- @licence GPL 2005-2011 The osCSS developers - osCSS Open Source E-commerce
+ @licence GPL 2005-2012 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/11/11, 09:50
+ @date 19/02/2012, 09:50
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
*/
@@ -80,6 +80,14 @@
define('TABLE_ORDERS_STATUS_HISTORY', DB_TABLE_PREFIX . 'orders_status_history');
define('TABLE_ORDERS_TOTAL', DB_TABLE_PREFIX . 'orders_total');
+ ## SERVICE
+ define('TABLE_SERVICES', DB_TABLE_PREFIX.'services');
+
+ ## SHIPPING
+ define('TABLE_SHIPPING', DB_TABLE_PREFIX.'shipping');
+ define('TABLE_SHIPPING_PRODUCTS', DB_TABLE_PREFIX.'shipping_products');
+
+
## Customers tables
# Master tables
define('TABLE_CUSTOMERS', DB_TABLE_PREFIX . 'customers');
Modified: trunk/catalog/admin/includes/gabarit/orders/display_view.edit.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/orders/display_view.edit.gab 2012-02-20 09:16:08 UTC (rev 4037)
+++ trunk/catalog/admin/includes/gabarit/orders/display_view.edit.gab 2012-02-20 20:53:11 UTC (rev 4038)
@@ -17,7 +17,12 @@
<li><a href="#tabs-1"><?php echo __('tab orders briefs'); ?></a></li>
<li><a href="#tabs-2"><?php echo __('tab orders details'); ?></a></li>
<li><a href="#tabs-3"><?php echo __('tab orders history'); ?></a></li>
-<!-- <li><a href="#tabs-4"><?php echo __('tab orders shipping'); ?></a></li> -->
+ <?php if(orders::$order->display_shipping ): ?>
+ <li><a href="#tabs-4"><?php echo __('tab orders shipping'); ?></a></li>
+ <?php endif; ?>
+ <?php if(orders::$order->display_service): ?>
+ <li><a href="#tabs-5"><?php echo __('tab orders service'); ?></a></li>
+ <?php endif; ?>
</ul>
<div id="tabs-1" class="tabPage">
@@ -295,102 +300,105 @@
</div>
<div id="tabs-2" class="tabPage">
-<!-- <div class="separator"></div> -->
<?php echo tep_draw_form('status_form', orders::FILENAME,'oID='.orders::$oID.'&action=update_order', 'post', ' class="block_form"'); ?>
-<!-- <div class="box_uniq"> -->
- <table class="dataTableBase orders">
- <thead>
- <tr>
- <?php if(_cst_bool('MODULE_ACCOUNT_RETURN_PRODUCTS_STATUS')): ?>
- <th><?php echo __('table heading return'); ?></th>
- <?php endif; ?>
- <th><?php echo __('table heading id'); ?></th>
- <th><?php echo __('table heading products'); ?></th>
- <th><?php echo __('table heading products model'); ?></th>
+ <table class="dataTableBase orders">
+ <thead>
+ <tr>
+ <?php if(_cst_bool('MODULE_ACCOUNT_RETURN_PRODUCTS_STATUS')): ?>
+ <th><?php echo __('table heading return'); ?></th>
+ <?php endif; ?>
+ <th><?php echo __('table heading id'); ?></th>
+ <th><?php echo __('table heading products'); ?></th>
+ <th><?php echo __('table heading products model'); ?></th>
- <th><?php echo __('table heading price excluding tax'); ?></th>
- <th><?php echo __('table heading price including tax'); ?></th>
- <th><?php echo __('table heading tax'); ?></th>
- <th><?php echo __('table heading quantity'); ?></th>
- <th><?php echo __('table heading total excluding tax'); ?></th>
- <th><?php echo __('table heading total including tax'); ?></th>
- </tr>
- </thead>
- <tbody>
+
+ <th><?php echo __('table heading price excluding tax'); ?></th>
+ <th><?php echo __('table heading price including tax'); ?></th>
+ <th><?php echo __('table heading tax'); ?></th>
+ <th><?php echo __('table heading quantity'); ?></th>
+ <th><?php echo __('table heading total excluding tax'); ?></th>
+ <th><?php echo __('table heading total including tax'); ?></th>
+ </tr>
+ </thead>
+ <tbody>
+
<?php for ($i=0, $n=sizeof(orders::$order->products); $i<$n; $i++): ?>
<tr>
- <?php if(_cst_bool('MODULE_ACCOUNT_RETURN_PRODUCTS_STATUS')): ?>
- <td><?php
- //BEGIN RMA MODULE
- $returns_check_query = tep_db_query("SELECT r.rma_value, rp.products_id FROM " . TABLE_RETURNS . " r, " . TABLE_RETURNS_PRODUCTS_DATA . " rp where r.returns_id = rp.returns_id and r.order_id = '" . orders::$oID . "' and rp.products_id = '" . orders::$order->products[$i]['id'] . "' ");
- if (!tep_db_num_rows($returns_check_query)){
+ <?php if(_cst_bool('MODULE_ACCOUNT_RETURN_PRODUCTS_STATUS')): ?>
+ <td><?php
+ //BEGIN RMA MODULE
+ $returns_check_query = tep_db_query("SELECT r.rma_value, rp.products_id FROM " . TABLE_RETURNS . " r, " . TABLE_RETURNS_PRODUCTS_DATA . " rp where r.returns_id = rp.returns_id and r.order_id = '" . orders::$oID . "' and rp.products_id = '" . orders::$order->products[$i]['id'] . "' ");
+ if (!tep_db_num_rows($returns_check_query)){
- if (orders::$order->products[$i]['return'] != '1') {
- $return_link = '<a href="' . tep_href_link(FILENAME_RETURN_PRODUCT, 'order_id=' . orders::$oID . '&products_id=' . (orders::$order->products[$i]['id']), 'NONSSL') . '">' . tep_image(DIR_WS_ICONS .'icon_rma_return.png', TEXT_SHEDULE_RETURN ).'</a>';
- }
-// if (orders::$orders_status !=DEFAULT_ORDERS_STATUS_COMPLETED ) $return_link = '';
- } else {
- $returns = tep_db_fetch_array($returns_check_query);
- $return_link = '<a href=' . tep_href_link(FILENAME_RETURNS, 'cID=' . $returns['rma_value']) . '><font color=red><b><i>Returns</b></i></font></a>';
- }
- echo $return_link; ?>
- </td>
- <?php endif; ?>
- <td class="tcenter"><?php echo orders::$order->products[$i]['id'] ?></td>
- <td class="tleft">
- <span class="fleft">
- <a href="#" class="screenshot" rel="<?php echo tep_href_link('document.php', 'mod=img&typ=product&w=200&h=200&id='.orders::$order->products[$i]['id']) ?>">
- <?php echo orders::$order->products[$i]['name'] ?>
- </a>
- </span>
- <span><?php echo tep_draw_attribute_products(orders::$order,$i).' ' ?></span>
- </td>
- <td class="tcenter"><?php echo orders::$order->products[$i]['model'] ?></td>
- <td class="tcenter"><?php echo $price->format(orders::$order->products[$i]['final_price'], true, orders::$order->info['currency'], orders::$order->info['currency_value']) ?></td>
- <td class="tcenter"><?php echo $price->format(tep_add_tax(orders::$order->products[$i]['final_price'], orders::$order->products[$i]['tax']), true, orders::$order->info['currency'], orders::$order->info['currency_value']) ?></td>
- <td class="tcenter"><?php echo tep_display_tax_value(orders::$order->products[$i]['tax']) . '%' ?></td>
- <td class="tcenter">
- <?php /** TODO Integrer update
- Integrer Etat des stocks courant si stock actif */ ?>
- <?php echo orders::$order->products[$i]['qty'] ?>
- </td>
- <td class="tright"><?php echo $price->format(orders::$order->products[$i]['final_price'] * orders::$order->products[$i]['qty'], true, orders::$order->info['currency'], orders::$order->info['currency_value']) ?></td>
- <td class="tright"><?php echo $price->format(tep_add_tax(orders::$order->products[$i]['final_price'], orders::$order->products[$i]['tax']) * orders::$order->products[$i]['qty'], true, orders::$order->info['currency'], orders::$order->info['currency_value']) ?></td>
- </tr>
- <?php endfor; ?>
+ if (orders::$order->products[$i]['return'] != '1') {
+ $return_link = '<a href="' . tep_href_link(FILENAME_RETURN_PRODUCT, 'order_id=' . orders::$oID . '&products_id=' . (orders::$order->products[$i]['id']), 'NONSSL') . '">' . tep_image(DIR_WS_ICONS .'icon_rma_return.png', TEXT_SHEDULE_RETURN ).'</a>';
+ }
+ // if (orders::$orders_status !=DEFAULT_ORDERS_STATUS_COMPLETED ) $return_link = '';
+ } else {
+ $returns = tep_db_fetch_array($returns_check_query);
+ $return_link = '<a href=' . tep_href_link(FILENAME_RETURNS, 'cID=' . $returns['rma_value']) . '><font color=red><b><i>Returns</b></i></font></a>';
+ }
+ echo $return_link; ?>
+ </td>
+ <?php endif; ?>
+ <td class="tcenter"><?php echo orders::$order->products[$i]['id'] ?></td>
+ <td class="tleft">
+ <span class="fleft">
+ <a href="#" class="screenshot" rel="<?php echo tep_href_link('document.php', 'mod=img&typ=product&w=200&h=200&id='.orders::$order->products[$i]['id']) ?>">
+ <?php echo orders::$order->products[$i]['name'] ?>
+ </a>
+ </span>
+ <span><?php echo tep_draw_attribute_products(orders::$order,$i).' ' ?></span>
+ </td>
+ <td class="tcenter"><?php echo orders::$order->products[$i]['model'] ?></td>
+ <td class="tcenter"><?php echo $price->format(orders::$order->products[$i]['final_price'], true, orders::$order->info['currency'], orders::$order->info['currency_value']) ?></td>
+ <td class="tcenter"><?php echo $price->format(tep_add_tax(orders::$order->products[$i]['final_price'], orders::$order->products[$i]['tax']), true, orders::$order->info['currency'], orders::$order->info['currency_value']) ?></td>
+ <td class="tcenter"><?php echo tep_display_tax_value(orders::$order->products[$i]['tax']) . '%' ?></td>
+ <td class="tcenter">
+ <?php
+ /** TODO Integrer update
+ Integrer Etat des stocks courant si stock actif */
+ ?>
+ <?php echo orders::$order->products[$i]['qty'] ?>
+ </td>
+ <td class="tright"><?php echo $price->format(orders::$order->products[$i]['final_price'] * orders::$order->products[$i]['qty'], true, orders::$order->info['currency'], orders::$order->info['currency_value']) ?></td>
+ <td class="tright"><?php echo $price->format(tep_add_tax(orders::$order->products[$i]['final_price'], orders::$order->products[$i]['tax']) * orders::$order->products[$i]['qty'], true, orders::$order->info['currency'], orders::$order->info['currency_value']) ?></td>
+ </tr>
+ <?php endfor; ?>
- <!-- Block Total -->
- <?php for ($i = 0, $n = sizeof(orders::$order->totals); $i < $n; $i++) { ?>
- <tr>
- <?php if(_cst_bool('MODULE_ACCOUNT_RETURN_PRODUCTS_STATUS')): ?>
- <td> </td>
- <?php endif; ?>
- <td colspan="8" class="tright"><?php echo orders::$order->totals[$i]['title'] ?></td>
- <td class="tright"><?php echo orders::$order->totals[$i]['text'] ?></td>
- </tr>
- <?php } ?>
- <!-- Block Total eof-->
- </tbody>
- </table>
+ <!-- Block Total -->
+ <?php for ($i = 0, $n = sizeof(orders::$order->totals); $i < $n; $i++) { ?>
+ <tr>
+ <?php if(_cst_bool('MODULE_ACCOUNT_RETURN_PRODUCTS_STATUS')): ?>
+ <td> </td>
+ <?php endif; ?>
+ <td colspan="8" class="tright"><?php echo orders::$order->totals[$i]['title'] ?></td>
+ <td class="tright"><?php echo orders::$order->totals[$i]['text'] ?></td>
+ </tr>
+ <?php } ?>
+ <!-- Block Total eof-->
- <div class="button_nav">
- <?php echo tep_image_submit('button_update.gif', IMAGE_UPDATE); ?>
- </div>
+ </tbody>
+ </table>
+ <div class="button_nav">
+ <?php echo tep_image_submit('button_update.gif', IMAGE_UPDATE); ?>
+ </div>
</fieldset>
- </form>
-
-<!-- </div> -->
-
+ </form>
</div>
+ <?php
+ /**
+ History Orders
+ */
+ ?>
+ <div id="tabs-3" class="tabPage">
- <div id="tabs-3" class="tabPage">
-
<table class="main-orders history">
<thead>
<tr>
@@ -419,29 +427,194 @@
+ <?php if(orders::$order->display_shipping): ?>
+ <div id="tabs-4" class="tabPage">
- <div id="tabs-4" class="tabPage">
- </div>
+ <ul>
+ <?php $i = 0; foreach (orders::$order->allshipping as $ashipping): $i++; /*print_r($ashipping);*/?>
+ <li>
+ <h5>
+ <span class="text date dateexpedition">
+ <?php echo sprintf(__('text shipping expedie le %s'), tep_datetime_short($ashipping->date_expedition) ); ?>
+ </span>
+ <span class="text tracking">
+ <?php echo sprintf(__('text shipping tracking n %s'),'<a href="'.$ashipping->tracking_url.'" >'.$ashipping->tracking.'</a>'); ?>
+ </span>
+ <span class="text date method">
+ <?php echo $ashipping->method; ?>
+ </span>
+ </h5>
+ <table class="dataTableBase orders shipping allshipping">
+ <thead>
+ <tr>
+ <th><?php echo __('table heading id'); ?></th>
+ <th><?php echo __('table heading products'); ?></th>
+ <th><?php echo __('table heading quantity deja expedie'); ?></th>
+ </tr>
+ </thead>
+ <tbody>
+ <?php $i = 0; foreach ($ashipping->products as $pshipping): $i++; /*print_r($pshipping);*/?>
+ <td class="tcenter"><?php echo $pshipping->products_id ?></td>
+ <td class="tleft">
+ <span class="fleft">
+ <a href="#" class="screenshot" rel="<?php echo tep_href_link('document.php', 'mod=img&typ=product&w=200&h=200&id='.$pshipping->products_id) ?>">
+ <?php echo $pshipping->products_name ?>
+ </a>
+ </td>
+ <td class="tcenter">
+ <?php echo $pshipping->qt_expedie ?>
+ </td>
+ <?php endforeach; ?>
+ </tbody>
+ </table>
+ </li>
+ <?php endforeach; ?>
+ </ul>
+ <br />
+ <!-- DEB Form add expedition -->
+ <?php echo tep_draw_form('add_deliv', orders::FILENAME,'oID='.orders::$oID.'&action=shipping&method=add', 'post', ' class="block_form"'); ?>
+ <table class="dataTableBase orders">
+ <thead>
+ <tr>
+ <th><?php echo __('table heading id'); ?></th>
+ <th><?php echo __('table heading products'); ?></th>
+ <th><?php echo __('table heading quantity in order'); ?></th>
+ <th><?php echo __('table heading quantity deja expedie'); ?></th>
+ <th><?php echo __('table heading quantity a expedie'); ?></th>
+ </tr>
+ </thead>
+ <tbody>
+ <?php $i = 0; foreach (orders::$order->pshipping as $pshipping): $i++; /*print_r($pshipping);*/?>
+ <tr>
+ <td class="tcenter"><?php echo $pshipping->id ?></td>
+ <td class="tleft">
+ <span class="fleft">
+ <a href="#" class="screenshot" rel="<?php echo tep_href_link('document.php', 'mod=img&typ=product&w=200&h=200&id='.$pshipping->id) ?>">
+ <?php echo $pshipping->name ?>
+ </a>
+ </span>
+ <span><?php echo tep_draw_attribute_products(orders::$order,$i).' ' ?></span>
+ </td>
+ <td class="tcenter">
+ <?php echo $pshipping->qty ?>
+ </td>
+ <td class="tcenter">
+ <?php echo $pshipping->qt_expedie ?>
+ </td>
+ <td class="tcenter">
+ <?php if( ($pshipping->qty - $pshipping->qt_expedie) > 0 ): ?>
+ <?php echo tep_draw_input_field('shipping_qt['.$pshipping->rowid.']','', ($pshipping->qty - $pshipping->qt_expedie) ); ?>
+ <?php else: ?>
+ <?php echo ($pshipping->qty - $pshipping->qt_expedie); ?>
+ <?php endif; ?>
+ </td>
+ </tr>
+ <?php endforeach; ?>
+ </tbody>
+ </table>
+ <?php if( orders::$order->display_shipping_add ) : ?>
+ <fieldset class="block_field fleft w_50" >
+ <legend><?php echo __('entry shipping new expedition details'); ?></legend>
+ <p class="block_input">
+ <label><?php echo __('label shipping tracking number'); ?></label>
+ <?php echo tep_draw_input_field('shipping_tracing_number','', '' ); ?>
+ </p>
+ <p class="block_input">
+ <label><?php echo __('label shipping tracking url'); ?></label>
+ <?php echo tep_draw_input_field('shipping_tracing_url','', '' ); ?>
+ </p>
+ </fieldset>
+ <div class="button_nav">
+ <?php echo tep_image_submit('button_update.gif', IMAGE_UPDATE); ?>
+ </div>
+ <?php endif; ?>
+ <!-- END Form add expedition -->
+ </form>
+ </div>
+ <?php endif; ?>
+ <?php
+ /**
+ Liste and manage active service and contract
+ */
+ ?>
+ <?php if(orders::$order->display_service): ?>
+ <div id="tabs-5" class="tabPage">
+ <table class="dataTableBase orders">
+ <thead>
+ <tr>
+ <th><?php echo __('table heading id'); ?></th>
+ <th><?php echo __('table heading quantity'); ?></th>
+ <th><?php echo __('table heading products'); ?></th>
+ <th><?php echo __('table heading total excluding tax'); ?></th>
+ <th><?php echo __('table heading active initial'); ?></th>
+ <th><?php echo __('table heading revival'); ?></th>
+ <th><?php echo __('table heading auto_retry'); ?></th>
+
+ <th><?php echo __('table heading current status'); ?></th>
+ </tr>
+ </thead>
+ <tbody>
+ <?php $i = 0; foreach (orders::$order->service as $service): $i++; /*print_r($service);*/?>
+ <tr>
+ <td class="tcenter"><?php echo $service->id ?></td>
+ <td class="tcenter">
+ <?php echo $service->qty ?>
+ </td>
+ <td class="tleft">
+ <span class="fleft">
+ <a href="#" class="screenshot" rel="<?php echo tep_href_link('document.php', 'mod=img&typ=product&w=200&h=200&id='.$service->id) ?>">
+ <?php echo $service->name ?>
+ </a>
+ </span>
+ <span><?php echo tep_draw_attribute_products(orders::$order,$i).' ' ?></span>
+ </td>
+
+
+ <td class="tright"><?php echo $price->format($service->final_price * $service->qty, true, orders::$order->info['currency'], orders::$order->info['currency_value']) ?></td>
+
+ <td class="tcenter"><?php echo tep_datetime_short($service->date_start) ?></td>
+ <td class="tcenter"><?php echo tep_datetime_short($service->date_revival) ?></td>
+ <td class="tcenter"> <?php echo $service->auto_retry_html ?> </td>
+ <td class="tleft"> <?php echo $service->status_html ?> </td>
+ </tr>
+ <?php endforeach; ?>
+
+ </tbody>
+ </table>
+ </div>
+ <?php endif; ?>
+
+
+
+
+
+
+
+
+
+
+
+
<?php
/**
DRAW BLOCK DOCS EXISTS OR LINK PDF CREATE
Modified: trunk/catalog/admin/includes/gabarit/products/display_view.new.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/products/display_view.new.gab 2012-02-20 09:16:08 UTC (rev 4037)
+++ trunk/catalog/admin/includes/gabarit/products/display_view.new.gab 2012-02-20 20:53:11 UTC (rev 4038)
@@ -1,9 +1,9 @@
<?php
/**
- @licence GPL 2005-2010 The osCSS developers - osCSS Open Source E-commerce
+ @licence GPL 2005-2012 The osCSS developers - osCSS Open Source E-commerce
@package osCSS-2 <www http://www.oscss.org>
- @version 2.0.9
- @date 17/07/10, 16:35
+ @version 2.1.1
+ @date 19/02/2012, 16:35
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
*/
@@ -15,7 +15,7 @@
<dl>
<dt class="block_input">
<label for="products_virtual_type_id"><?php echo __('text products type'); ?></label>
- <?php echo tep_draw_pull_down_menu('products_virtual_type_id', tep_get_status_array('products_virtual_types'), products::$DiversInfo['products_virtual_typeID']); ?>
+ <?php echo tep_draw_pull_down_menu('products_virtual_type_id', tep_get_status_array('products_virtual_types',0,'status_name'), products::$DiversInfo['products_virtual_typeID']); ?>
</dt>
</dl>
</div>
Added: trunk/catalog/admin/includes/javascript/modules/pages/orders.js.php
===================================================================
--- trunk/catalog/admin/includes/javascript/modules/pages/orders.js.php (rev 0)
+++ trunk/catalog/admin/includes/javascript/modules/pages/orders.js.php 2012-02-20 20:53:11 UTC (rev 4038)
@@ -0,0 +1,89 @@
+<?php if (!defined('HTTP_SERVER')) die('You can not access this file directly!');
+/**
+ @licence GPL 2005-2011 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/12/11, 17:30
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+*/
+error_reporting(E_ALL);
+?>
+<?php if (orders::$action == 'edit'): ?>
+ <script type="text/javascript"><!--
+ function disabled(inputs){$(inputs).css.display='none';}
+ function activ(inputs){$(inputs).css.display='inline';}
+
+
+ /// ScreenShot product in hover link products
+ this.screenshotPreview = function(){
+ /* CONFIG */
+
+ xOffset = 10;
+ yOffset = 30;
+
+ // these 2 variable determine popup's distance from the cursor
+ // you might want to adjust to get the right result
+
+ /* END CONFIG */
+ $("a.screenshot").hover(function(e){
+ this.t = this.title;
+ this.title = "";
+ var c = (this.t != "") ? "<br/>" + this.t : "";
+ $("body").append("<p id='screenshot'><img src='"+ this.rel +"' alt='url preview' />"+ c +"</p>");
+ $("#screenshot")
+ .css("top",(e.pageY - xOffset) + "px")
+ .css("left",(e.pageX + yOffset) + "px")
+ .fadeIn("fast");
+ },
+ function(){
+ this.title = this.t;
+ $("#screenshot").remove();
+ });
+ $("a.screenshot").mousemove(function(e){
+ $("#screenshot")
+ .css("top",(e.pageY - xOffset) + "px")
+ .css("left",(e.pageX + yOffset) + "px");
+ });
+ };
+
+
+ // starting the script on page load
+ $(document).ready(function(){
+ screenshotPreview();
+ disabled('#cont_comments');
+
+ /// Edit and info payment
+ $("#modpayment").change( function () {
+ $.get("./aca.php", { 'action':"editmod",'action_type' : "pages", 'action_class' : "orders", 'action_method' : "display_view" , 'modtype' : "payment", 'oID': "<?php echo (int)orders::$oID ?>", 'mod': this.value },
+ function success(data) {
+ $("#modPay").html(data);
+ });
+ });
+
+ /// Edit and change info block shipping
+ $("#modshipping").change( function () {
+ $.get("./aca.php", { 'action':"editmod",'action_type' : "pages", 'action_class' : "orders", 'action_method' : "display_view" , 'modtype' : "shipping", 'oID': "<?php echo (int)orders::$oID ?>", 'mod': this.value },
+ function success(data) {
+ $("#modShip").html(data);
+ });
+ });
+ });
+
+ //--></script>
+
+ <style type="text/css">
+ /* */
+
+ #screenshot{
+ position:absolute;
+ border:1px solid #ccc;
+ background:#333;
+ padding:5px;
+ display:none;
+ color:#fff;
+ }
+
+ </style>
+<?php endif; ?>
\ No newline at end of file
Modified: trunk/catalog/admin/includes/languages/fr_FR/modules/pages/orders.txt
===================================================================
--- trunk/catalog/admin/includes/languages/fr_FR/modules/pages/orders.txt 2012-02-20 09:16:08 UTC (rev 4037)
+++ trunk/catalog/admin/includes/languages/fr_FR/modules/pages/orders.txt 2012-02-20 20:53:11 UTC (rev 4038)
@@ -1,10 +1,10 @@
<?php
/**
- @licence GPL 2005-2011 The osCSS developers - osCSS Open Source E-commerce
+ @licence GPL 2005-2012 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/12/11, 16:07
+ @date 19/02/2012, 16:07
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
*/
@@ -17,6 +17,8 @@
$lang['tab orders briefs']="Details" ;
$lang['tab orders details']="Commande" ;
$lang['tab orders history']="Suivi" ;
+$lang['tab orders shipping']="Livraisons" ;
+$lang['tab orders service']="Services" ;
$lang['table heading order id']="n°" ;
@@ -40,6 +42,13 @@
$lang['table heading date added']="Date d'ajout" ;
$lang['table heading return']="Retour" ;
+$lang['table heading active initial']="Depuis" ;
+$lang['table heading revival']="Alerte" ;
+$lang['table heading current status']="Statut" ;
+$lang['table heading auto_retry']="Auto-renouvellement" ;
+$lang['table heading quantity a expedie']="Reste à expedié" ;
+$lang['table heading quantity deja expedie']="Déjà expedié" ;
+$lang['table heading quantity in order']="Commande" ;
$lang['entry customer']="Client" ;
$lang['entry sold to']="VENDU À :" ;
@@ -67,8 +76,18 @@
$lang['entry telephone number']="Tél. : " ;
$lang['entry email address']="Email : " ;
$lang['entry shipping address actived']="Utilisation d'une adresse de livraison" ;
+
+$lang['text shipping expedie le %s']="Expedié le : %s" ;
+$lang['text shipping tracking n %s']="N° suivi : %s" ;
+
+
$lang['heading title search name']="Nom : " ;
$lang['heading title search montant']="Montant : " ;
+
+$lang['entry shipping new expedition details']="Detail de l'expedition " ;
+$lang['label shipping tracking number']="Numéro d'expedition : " ;
+$lang['label shipping tracking url']="Url de suivi : " ;
+
$lang['not this status']="Sauf " ;
$lang['txt all']="Choix " ;
$lang['action multiple']="Actions multiples : " ;
@@ -102,8 +121,14 @@
$lang['error order not update address']="Erreur : adresse de la commande non mise à jour" ;
$lang['success order update address']="Succes, mise à jour de l'adresse de la commande" ;
+
$lang['error order not update mod']="Erreur : methode de la commande non mise à jour" ;
$lang['success order update mod']="Succes, mise à jour de la méthode" ;
+$lang['error order not update status']="Erreur : statut de ce service non mis à jour" ;
+$lang['success order update status']="Succes, mise à jour du statut de ce service" ;
+$lang['error order not update auto_retry']="Erreur : auto-renouvellement du service non mis à jour" ;
+$lang['success order update auto_retry']="Succes, mise à jour de l'auto-renouvellement du service" ;
+
$lang['error order does not exist']="Erreur : La commande n'existe pas." ;
$lang['success order updated']="Succès : La commande est mise à jour avec succès." ;
$lang['warning order not updated']="Attention : Aucune modification n'a été effectuée. La commande n'a pas été mise à jour." ;
Modified: trunk/catalog/admin/includes/modules/pages/orders.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/orders.php 2012-02-20 09:16:08 UTC (rev 4037)
+++ trunk/catalog/admin/includes/modules/pages/orders.php 2012-02-20 20:53:11 UTC (rev 4038)
@@ -65,8 +65,11 @@
@var string $view for select filter view
*/
public static $view;
+ /**
+ @var object internal trans objet method check_action vs display_view
+ */
+ private static $internal;
-
/**
@brief class constructor
*/
@@ -149,19 +152,19 @@
/**
@remarks this define col in table, and if is possible sort
- Just for Edit listing
+ Just for Edit listing
*/
self::$InitInfo['modele']['listing']=array(
- 0 =>false,
- 1 =>false,
- 'orders_id'=>true,
- 'customers_id'=>true,
- 'order_total'=>true,
- 'date_purchased'=>true,
- 'payment_method'=>true,
- 'orders_status_name'=>true,
- 'action' =>false
- );
+ 0 =>false,
+ 1 =>false,
+ 'orders_id'=>true,
+ 'customers_id'=>true,
+ 'order_total'=>true,
+ 'date_purchased'=>true,
+ 'payment_method'=>true,
+ 'orders_status_name'=>true,
+ 'action' =>false
+ );
$DB=Database::getInstance();
@@ -188,11 +191,13 @@
self::$action=$actions;
+ self::$internal = new stdClass;
+
switch (self::$action) {
- /**
- @remarks Action mutliple
- */
+ /**
+ @remarks Action mutliple
+ */
case 'multiconfirm':
$res=array();
@@ -344,98 +349,134 @@
*/
tep_redirect(tep_href_link(self::FILENAME, 'oID='.$oID.'&action=edit'));
break;
- }
- return self::$action;
- }
+ /**
+ @remarks Adjust Virtual product Service
+ */
+ case 'shipping':
+ $oID=(int)$_GET['oID'];
- public function get_header(){
- if (self::$action == 'edit'):
+ $track=(string)tep_db_prepare_input($_POST['shipping_tracing_number']);
+ $trackurl=(string)tep_db_prepare_input($_POST['shipping_tracing_url']);
+ $array=array(
+ 'orders_id'=>$oID,
+ 'method'=>'',
+ 'tracking'=>$track,
+ 'tracking_url'=>$trackurl,
+ 'date_expedition'=>date('Y-m-d H:i:s'),
+ 'products'=>array()
+ );
+ foreach($_POST['shipping_qt'] as $k=>$row)
+ if($row > 0) $array['products'][] = array('products_id'=>$k , 'qt'=>$row) ;
+ switch((string)$_GET['method']){
+ case 'add':
- ?>
- <script type="text/javascript"><!--
- function disabled(inputs){$(inputs).css.display='none';}
- function activ(inputs){$(inputs).css.display='inline';}
+// print_r($array);
+// exit;
+ $res = sqlshipping::create($array);
+// var_dump($res);
+// exit;
+ break;
+ }
+ tep_redirect(tep_href_link(self::FILENAME, 'oID='.$oID.'&action=edit'));
+ break;
- /// ScreenShot product in hover link products
- this.screenshotPreview = function(){
- /* CONFIG */
+ /**
+ @remarks Adjust Virtual product Service
+ */
+ case 'setflag':
+ $redirect = false;
+ if (isset($_GET['sID'])){
- xOffset = 10;
- yOffset = 30;
+ /// Activate / Desactivate
+ if (isset($_GET['flag']) && ( ($_GET['flag'] == '0') || ($_GET['flag'] == '1') ) ) {
+ $res = sqlservices::fetch(array('id'=>(int)$_GET['sID']), true);
- // these 2 variable determine popup's distance from the cursor
- // you might want to adjust to get the right result
+ if($res !=false){
...
[truncated message content] |
|
From: <os...@us...> - 2012-02-20 09:16:14
|
Revision: 4037
http://oscss.svn.sourceforge.net/oscss/?rev=4037&view=rev
Author: oscim
Date: 2012-02-20 09:16:08 +0000 (Mon, 20 Feb 2012)
Log Message:
-----------
correction coquille
Modified Paths:
--------------
trunk/catalog/admin/includes/classes/drivers/sqlconfiguration.php
Modified: trunk/catalog/admin/includes/classes/drivers/sqlconfiguration.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlconfiguration.php 2012-02-13 18:39:30 UTC (rev 4036)
+++ trunk/catalog/admin/includes/classes/drivers/sqlconfiguration.php 2012-02-20 09:16:08 UTC (rev 4037)
@@ -104,7 +104,7 @@
$sql ="";
if(isset($option['id'])) $sql .="AND configuration_id = '".(int)tep_db_input($option['id'])."' ";
if(isset($option['key'])) $sql .="AND configuration_key = '".(string)tep_db_input($option['key'])."' ";
- if(isset($option['group_id'])) $sql .="AND configuration_group_id = '".(int)(string)tep_db_input($option['group_id'])."' ";
+ if(isset($option['group_id'])) $sql .="AND configuration_group_id = '".(int)tep_db_input($option['group_id'])."' ";
$sql ="SELECT * FROM ".TABLE_CONFIGURATION." WHERE ".substr($sql,3);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2012-02-13 18:39:37
|
Revision: 4036
http://oscss.svn.sourceforge.net/oscss/?rev=4036&view=rev
Author: oscim
Date: 2012-02-13 18:39:30 +0000 (Mon, 13 Feb 2012)
Log Message:
-----------
correction date licence pied de page admin
Ajsutement des toolbar de tinymce pour autoriser ecranplus petit
ajustement function pour plus de souplesse
Amelioration page orders
correction css
Modified Paths:
--------------
trunk/catalog/admin/editeur/tiny_mce/oscss_init.php
trunk/catalog/admin/includes/footer.php
trunk/catalog/admin/includes/functions/general.php
trunk/catalog/admin/includes/modules/pages/orders.php
trunk/catalog/admin/includes/template/oscss/stylesheet-1.css
Modified: trunk/catalog/admin/editeur/tiny_mce/oscss_init.php
===================================================================
--- trunk/catalog/admin/editeur/tiny_mce/oscss_init.php 2012-02-07 21:13:55 UTC (rev 4035)
+++ trunk/catalog/admin/editeur/tiny_mce/oscss_init.php 2012-02-13 18:39:30 UTC (rev 4036)
@@ -1,10 +1,10 @@
<?php
/**
- @licence GPL 2005-2010 The osCSS developers - osCSS Open Source E-commerce
+ @licence GPL 2005-2012 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/11/11, 21:18
+ @date 10/02/2012, 21:18
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
@brief Chargeur pour oscss
@@ -79,9 +79,9 @@
.'extended_valid_elements : "iframe[src|width|height|name|align|style|frameborder]",'."\n"
// Theme options
- .'theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect, template",'."\n"
- .'theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,|,image,media,|,iframe,|,forecolor,backcolor,|,code",'."\n"
- .'theme_advanced_buttons3 : "tablecontrols,|,pagebreak,|,sub,sup,fullscreen",'."\n"
+ .'theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect",'."\n"
+ .'theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,|,image,media,|,iframe,|,forecolor,backcolor",'."\n"
+ .'theme_advanced_buttons3 : "tablecontrols,|,pagebreak,|,sub,sup,fullscreen,|,code ,|, template",'."\n"
.'theme_advanced_toolbar_location : "top",'."\n"
.'theme_advanced_toolbar_align : "left",'."\n"
.'theme_advanced_statusbar_location : "bottom",'."\n"
Modified: trunk/catalog/admin/includes/footer.php
===================================================================
--- trunk/catalog/admin/includes/footer.php 2012-02-07 21:13:55 UTC (rev 4035)
+++ trunk/catalog/admin/includes/footer.php 2012-02-13 18:39:30 UTC (rev 4036)
@@ -1,16 +1,16 @@
<?php
/**
- @licence GPL 2005-2009 The osCSS developers - osCSS Open Source E-commerce
+ @licence GPL 2005-2012 The osCSS developers - osCSS Open Source E-commerce
@package oscss-2 <www http://www.oscss.org>
- @version 2.1.0
- @date 03/01/11, 17:05
+ @version 2.1.1
+ @date 10/02/2012, 17:05
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
*/
?>
<p>
-E-Commerce Engine Copyright © 2005-2011 <a href="http://www.oscss.org/">osCSS</a>
+E-Commerce Engine Copyright © 2005-<?php echo date('Y'); ?> <a href="http://www.oscss.org/">osCSS</a>
<br />osCSS is a derived from Copyright © 2003 <a href="http://www.oscommerce.com">osCommerce</a>.<a href="http://www.fsf.org/licenses/gpl.txt"><br />GNU General Public License</a>
</p>
<p>Powered by <a href="http://www.oscss.org/">osCSS-2</a></p>
Modified: trunk/catalog/admin/includes/functions/general.php
===================================================================
--- trunk/catalog/admin/includes/functions/general.php 2012-02-07 21:13:55 UTC (rev 4035)
+++ trunk/catalog/admin/includes/functions/general.php 2012-02-13 18:39:30 UTC (rev 4036)
@@ -584,19 +584,27 @@
}
/**
- @package oscss-2 <www http://www.oscss.org>
- @author oscim <mail os...@os...> <www http://www.oscim.fr>
- @return array for tep_tab_menu
- @param
- @a string type status
+ @brief array map for tep_menu or detail status if id
+ @param $type string key col status
+ @param $id int if is > 0 return array specific this id
+ @param $orderby string name col for order by
+ @param $sort string ASC/DESC sort result
+ @return array for tep_tab_menu if $id=0
+ Or array specific id if key + id exists
*/
-function tep_get_status_array($type='orders'){
+function tep_get_status_array($type='orders', $id=0, $orderby='status_id', $sort='ASC'){
global $languages_id;
$list=array();
$DB=Database::getInstance();
- $list_query = $DB->query($sql="select status_id, status_name from " . TABLE_STATUS . " where status_type='".$type."' and language_id='".(int)$languages_id."' order by status_id ASC");
- while ($status=$list_query->fetchAssoc()) $list[] = array('id' => $status['status_id'], 'text' => $status['status_name']);
+ $list_query = $DB->query($sql="select status_id, status_name from " . TABLE_STATUS . " where status_type='".$type."' and language_id='".(int)$languages_id."' order by ".$orderby." ".$sort." ; ");
+ while ($status=$list_query->fetchAssoc())
+ if($id > 0 && (int)$id == $status['status_id'])
+ return array('id' => $status['status_id'], 'text' => $status['status_name']);
+ else $list[] = array('id' => $status['status_id'], 'text' => $status['status_name']);
+ if($id > 0)
+ return false;
+ else
return $list;
}
Modified: trunk/catalog/admin/includes/modules/pages/orders.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/orders.php 2012-02-07 21:13:55 UTC (rev 4035)
+++ trunk/catalog/admin/includes/modules/pages/orders.php 2012-02-13 18:39:30 UTC (rev 4036)
@@ -1,10 +1,10 @@
<?php if (!defined('HTTP_SERVER')) die('You can not access this file directly!');
/**
- @licence GPL 2005-2011 The osCSS developers - osCSS Open Source E-commerce
+ @licence GPL 2005-2012 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/10/11, 22:42
+ @date 18/02/2012, 22:42
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
@class orders
@@ -187,7 +187,7 @@
global $messageStack,$page_module;
self::$action=$actions;
-// var_dump(self::$action);
+
switch (self::$action) {
/**
@@ -205,8 +205,8 @@
if(isset($_POST['status_multi'])){
foreach($_POST['action_multi'] as $oID )
- if (up_status_order($oID, array('status'=>$status,'comments'=>'', 'notify'=>$notify, 'notify_comments'=>$notify_comments , 'comments'=> $comments) ) ) $res[]=true;
- else $res[]=false;
+ if (up_status_order($oID, array('status'=>$status,'comments'=>'', 'notify'=>$notify, 'notify_comments'=>$notify_comments , 'comments'=> $comments) ) ) $res[]=true;
+ else $res[]=false;
}
@@ -221,27 +221,27 @@
foreach($_POST['action_multi'] as $oID ){
- $order = new order((int)$oID);
- $qer=tep_db_query("SELECT countries_iso_code_2 FROM " . TABLE_COUNTRIES . " WHERE countries_name='".$order->customer['country']."' ");
- $c=tep_db_fetch_array($qer);
+ $order = new order((int)$oID);
+ $qer=tep_db_query("SELECT countries_iso_code_2 FROM " . TABLE_COUNTRIES . " WHERE countries_name='".$order->customer['country']."' ");
+ $c=tep_db_fetch_array($qer);
- $od[]=array('IDExpedition'=>$oID,
- 'IDCustomer'=>$order->customer['id'],
- 'Namecustomer'=>self::$export->decodage($order->customer['name']),
- 'Compagnycustomer'=>self::$export->decodage($order->customer['company']),
- 'Streetadress'=>self::$export->decodage($order->delivery['street_address']),
- 'Streetadress2'=>self::$export->decodage($order->delivery['suburb']) ,
- 'Cityshipping'=>self::$export->decodage($order->delivery['city']),
- 'Stateshipping'=>self::$export->decodage($order->customer['state']) ,
- 'telephone'=>self::$export->decodage($order->customer['telephone']),
- 'postcode'=>self::$export->decodage($order->delivery['postcode']),
- 'codecountryiso'=>$c['countries_iso_code_2'],
- 'weight'=>round($order->info['total_weight'],3),
- 'Contreremb'=>'');
- }
+ $od[]=array('IDExpedition'=>$oID,
+ 'IDCustomer'=>$order->customer['id'],
+ 'Namecustomer'=>self::$export->decodage($order->customer['name']),
+ 'Compagnycustomer'=>self::$export->decodage($order->customer['company']),
+ 'Streetadress'=>self::$export->decodage($order->delivery['street_address']),
+ 'Streetadress2'=>self::$export->decodage($order->delivery['suburb']) ,
+ 'Cityshipping'=>self::$export->decodage($order->delivery['city']),
+ 'Stateshipping'=>self::$export->decodage($order->customer['state']) ,
+ 'telephone'=>self::$export->decodage($order->customer['telephone']),
+ 'postcode'=>self::$export->decodage($order->delivery['postcode']),
+ 'codecountryiso'=>$c['countries_iso_code_2'],
+ 'weight'=>round($order->info['total_weight'],3),
+ 'Contreremb'=>'');
+ }
- print self::$export->op_export($od);
- }
+ print self::$export->op_export($od);
+ }
}
if (in_array(false,$res)) $messageStack->add_session(__('success order updated'), 'success');
@@ -284,33 +284,33 @@
*/
case 'address':
- if(!isset($_POST['address']) || !is_array($_POST['address']))
- return false;
+ if(!isset($_POST['address']) || !is_array($_POST['address']))
+ return false;
- $oID=(int)$_GET['oID'];
- $type=(string)tep_db_input($_GET['address']);
+ $oID=(int)$_GET['oID'];
+ $type=(string)tep_db_input($_GET['address']);
- if(!self::test_oID((int)self::$oID))
- return false;
+ if(!self::test_oID((int)self::$oID))
+ return false;
- $order= sqlorder::fetch(array('id'=>self::$oID), true);
+ $order= sqlorder::fetch(array('id'=>self::$oID), true);
- $opt['id'] = $oID;
- $opt['post'] = $_POST;
- $opt['status'] = $order->info['orders_status_id'];
- $opt[$type] = $_POST['address'] ;
+ $opt['id'] = $oID;
+ $opt['post'] = $_POST;
+ $opt['status'] = $order->info['orders_status_id'];
+ $opt[$type] = $_POST['address'] ;
- if(!sqlorder::update($opt))
- $messageStack->add_session(__('error order not update address'), 'warning');
- else
- $messageStack->add_session(__('success order update address'), 'success');
+ if(!sqlorder::update($opt))
+ $messageStack->add_session(__('error order not update address'), 'warning');
+ else
+ $messageStack->add_session(__('success order update address'), 'success');
-/**
- TODO Force refresh pdf
-*/
+ /**
+ TODO Force refresh pdf
+ */
- tep_redirect(tep_href_link(self::FILENAME, 'oID='.$oID.'&action=edit'));
+ tep_redirect(tep_href_link(self::FILENAME, 'oID='.$oID.'&action=edit'));
break;
/**
@@ -318,34 +318,31 @@
*/
case 'mod':
- if(!isset($_POST['mod']) || !is_array($_POST['mod']))
- return false;
+ if(!isset($_POST['mod']) || !is_array($_POST['mod']))
+ return false;
- $oID=(int)$_GET['oID'];
- $type=(string)tep_db_input($_GET['mod']);
+ $oID=(int)$_GET['oID'];
+ $type=(string)tep_db_input($_GET['mod']);
- if(!self::test_oID((int)self::$oID))
- return false;
+ if(!self::test_oID((int)self::$oID))
+ return false;
- $order= sqlorder::fetch(array('id'=>self::$oID), true);
+ $order= sqlorder::fetch(array('id'=>self::$oID), true);
- $opt['id'] = $oID;
- $opt['status'] = $order->info['orders_status_id'];
- $opt['post'] = $_POST;
- $opt['mod'][$type] = $_POST['mod'][$type] ;
-// print_r($opt);
-// exit;
+ $opt['id'] = $oID;
+ $opt['status'] = $order->info['orders_status_id'];
+ $opt['post'] = $_POST;
+ $opt['mod'][$type] = $_POST['mod'][$type] ;
- if(!sqlorder::update($opt))
- $messageStack->add_session(__('error order not update mod'), 'warning');
- else
- $messageStack->add_session(__('success order update mod'), 'success');
+ if(!sqlorder::update($opt))
+ $messageStack->add_session(__('error order not update mod'), 'warning');
+ else
+ $messageStack->add_session(__('success order update mod'), 'success');
-/**
- TODO Force refresh pdf
-*/
-// exit;
- tep_redirect(tep_href_link(self::FILENAME, 'oID='.$oID.'&action=edit'));
+ /**
+ TODO Force refresh pdf
+ */
+ tep_redirect(tep_href_link(self::FILENAME, 'oID='.$oID.'&action=edit'));
break;
}
@@ -457,102 +454,113 @@
case 'export';
break;
+ case 'edit':
+ if(self::test_oID((int)self::$oID)) {
+ $res= sqlorder::fetch(array('id'=>self::$oID));
+ $res->history=self::load_status_history((int)self::$oID);
+ $res->lasthistory=self::$order->history[(count(self::$order->history)-1)];
+ }
+
+ return $res;
+ break;
+
+
case 'new':
- $select_adress = array();
+ $select_adress = array();
- $cID = (int)tep_db_prepare_input($_REQUEST['cID']);
- $res=sqlcustomer::fetch(array('id'=>$cID), true);
+ $cID = (int)tep_db_prepare_input($_REQUEST['cID']);
+ $res=sqlcustomer::fetch(array('id'=>$cID), true);
- /**
- @remarks hoose address book if active module adress book
- */
- if(isset($res->mod['address_book'])) {
- foreach($res->mod['address_book'] as $row)
- $select_adress[] = array('id'=>$row->book_id , 'text'=> tep_address_format($row->format_id, $row, false, '', " - ") );
- }
- else{
- $adrr = new stdClass();
- $adrr->book_id = $res->default_address_id;
- $adrr->gender = $res->gender;
- $adrr->company = $res->company;
- $adrr->company_tax_id = $res->company_tax_id;
- $adrr->firstname = $res->firstname;
- $adrr->lastname = $res->lastname;
- $adrr->street_address = $res->street_address;
- $adrr->suburb = $res->suburb;
- $adrr->postcode = $res->postcode;
- $adrr->city = $res->city;
- $adrr->state = $res->state;
- $adrr->country_id = $res->country_id;
- $adrr->zone_id = $res->zone_id;
- $adrr->zone_name = $res->zone_name;
- $adrr->countries_id = $res->countries_id;
- $adrr->countries_name = $res->countries_name;
- $adrr->countries_iso_code_2 = $res->countries_iso_code_2;
- $adrr->format_id = $res->address_format_id;
+ /**
+ @remarks hoose address book if active module adress book
+ */
+ if(isset($res->mod['address_book'])) {
+ foreach($res->mod['address_book'] as $row)
+ $select_adress[] = array('id'=>$row->book_id , 'text'=> tep_address_format($row->format_id, $row, false, '', " - ") );
+ }
+ else{
+ $adrr = new stdClass();
+ $adrr->book_id = $res->default_address_id;
+ $adrr->gender = $res->gender;
+ $adrr->company = $res->company;
+ $adrr->company_tax_id = $res->company_tax_id;
+ $adrr->firstname = $res->firstname;
+ $adrr->lastname = $res->lastname;
+ $adrr->street_address = $res->street_address;
+ $adrr->suburb = $res->suburb;
+ $adrr->postcode = $res->postcode;
+ $adrr->city = $res->city;
+ $adrr->state = $res->state;
+ $adrr->country_id = $res->country_id;
+ $adrr->zone_id = $res->zone_id;
+ $adrr->zone_name = $res->zone_name;
+ $adrr->countries_id = $res->countries_id;
+ $adrr->countries_name = $res->countries_name;
+ $adrr->countries_iso_code_2 = $res->countries_iso_code_2;
+ $adrr->format_id = $res->address_format_id;
- $select_adress[] = array('id'=>$adrr->book_id , 'text'=> tep_address_format($adrr->format_id, $adrr, false, '', "\n") );
- }
+ $select_adress[] = array('id'=>$adrr->book_id , 'text'=> tep_address_format($adrr->format_id, $adrr, false, '', "\n") );
+ }
- $res->select_adress = $select_adress;
+ $res->select_adress = $select_adress;
- return $res;
+ return $res;
break;
case 'listing';
- /**
- @remarks retrun object load one inventaire
- */
- global $query_numrows;
- $adjust=new objectInfo(self::$InitInfo['adjust']);
+ /**
+ @remarks retrun object load one inventaire
+ */
+ global $query_numrows;
+ $adjust=new objectInfo(self::$InitInfo['adjust']);
- if(tep_not_null($adjust->sWhere)){
- $adjust->sWhere=str_replace(array('orders_id',
- 'order_total',
- 'customers_id',
- 'orders_status_name'),
- array('o.orders_id',
- ' ot.text',
- 'o.customers_name',
- 's.status_name'),
- $adjust->sWhere);
- }
+ if(tep_not_null($adjust->sWhere)){
+ $adjust->sWhere=str_replace(array('orders_id',
+ 'order_total',
+ 'customers_id',
+ 'orders_status_name'),
+ array('o.orders_id',
+ ' ot.text',
+ 'o.customers_name',
+ 's.status_name'),
+ $adjust->sWhere);
+ }
- $wh='';
- if(self::$view =='opened')
- $wh .=" AND SUBSTRING(o.orders_status,1,2) >= '".DEFAULT_ORDERS_STATUS_ID."' AND SUBSTRING(o.orders_status,1,2) < '".DEFAULT_ORDERS_STATUS_COMPLETED."' ";
- elseif(self::$view =='nopayed')
- $wh .=" AND o.orders_status >=0 AND SUBSTRING(o.orders_status,1,2) >= '".DEFAULT_ORDERS_STATUS_ID."' AND SUBSTRING(o.orders_status,1,2) < '".DEFAULT_ORDERS_STATUS_PAYED."' ";
- elseif(self::$view =='allnoclosed')
- $wh .=" AND o.orders_status >=0 ";
- elseif(self::$view =='all')
- $wh .='';
- elseif(self::$view =='thisday')
- $wh .=' AND SUBSTRING(o.date_purchased,1,10) =\''.date('Y-m-d').'\' ';
+ $wh='';
+ if(self::$view =='opened')
+ $wh .=" AND SUBSTRING(o.orders_status,1,2) >= '".DEFAULT_ORDERS_STATUS_ID."' AND SUBSTRING(o.orders_status,1,2) < '".DEFAULT_ORDERS_STATUS_COMPLETED."' ";
+ elseif(self::$view =='nopayed')
+ $wh .=" AND o.orders_status >=0 AND SUBSTRING(o.orders_status,1,2) >= '".DEFAULT_ORDERS_STATUS_ID."' AND SUBSTRING(o.orders_status,1,2) < '".DEFAULT_ORDERS_STATUS_PAYED."' ";
+ elseif(self::$view =='allnoclosed')
+ $wh .=" AND o.orders_status >=0 ";
+ elseif(self::$view =='all')
+ $wh .='';
+ elseif(self::$view =='thisday')
+ $wh .=' AND SUBSTRING(o.date_purchased,1,10) =\''.date('Y-m-d').'\' ';
- $query_raw = "select distinct o.orders_id,o.orders_prefix, o.customers_id, o.customers_name, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.status_name as orders_status_name, s.status_color as orders_status_color, ot.text as order_total from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id), " . TABLE_STATUS . " s where o.orders_status = s.status_id and s.status_type='orders' ".$wh." and s.language_id = '" . (int)$adjust->languages_id . "' and ot.class = 'ot_total' ".$adjust->sWhere." order by ".((!empty($adjust->sOrder)) ? $adjust->sOrder : 'o.orders_id DESC');
+ $query_raw = "select distinct o.orders_id,o.orders_prefix, o.customers_id, o.customers_name, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.status_name as orders_status_name, s.status_color as orders_status_color, ot.text as order_total from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id), " . TABLE_STATUS . " s where o.orders_status = s.status_id and s.status_type='orders' ".$wh." and s.language_id = '" . (int)$adjust->languages_id . "' and ot.class = 'ot_total' ".$adjust->sWhere." order by ".((!empty($adjust->sOrder)) ? $adjust->sOrder : 'o.orders_id DESC');
- $_split = new splitPageResults($adjust->page, $adjust->rowbyp, $query_raw, $query_numrows);
- $_query = $DB->query($query_raw);
+ $_split = new splitPageResults($adjust->page, $adjust->rowbyp, $query_raw, $query_numrows);
+ $_query = $DB->query($query_raw);
- $res=self::FormatDBValue($_query);
+ $res=self::FormatDBValue($_query);
- return $res;
+ return $res;
break;
case 'delete';
default:
- $orders_query_raw = "select distinct o.orders_id,o.orders_prefix, o.customers_id,o.customers_name, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.status_name as orders_status_name, s.status_color as orders_status_color,ot.text as order_total from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id), " . TABLE_STATUS . " s where o.orders_status = s.status_id and s.status_type='orders' and s.language_id = '" . (int)$languages_id . "' and ot.class = 'ot_total' and o.orders_id='".self::$oID."' ";
+ $orders_query_raw = "select distinct o.orders_id,o.orders_prefix, o.customers_id,o.customers_name, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.status_name as orders_status_name, s.status_color as orders_status_color,ot.text as order_total from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id), " . TABLE_STATUS . " s where o.orders_status = s.status_id and s.status_type='orders' and s.language_id = '" . (int)$languages_id . "' and ot.class = 'ot_total' and o.orders_id='".self::$oID."' ";
- $currency_query = $DB->query($orders_query_raw);
+ $currency_query = $DB->query($orders_query_raw);
- return new objectInfo($currency_query->fetchAssoc() );
+ return new objectInfo($currency_query->fetchAssoc() );
}
}
@@ -564,43 +572,39 @@
switch (self::$action) {
case 'delete':
- if(self::test_oID((int)self::$oID)) {
- self::$oInfo=self::GetDBValue();
- return MGabCont::CallGab(parent::$action,__FUNCTION__,__CLASS__);
- }
+ if(self::test_oID((int)self::$oID)) {
+ self::$oInfo=self::GetDBValue();
+ return MGabCont::CallGab(parent::$action,__FUNCTION__,__CLASS__);
+ }
break;
case 'multi':
- return MGabCont::CallGab(parent::$action,__FUNCTION__,__CLASS__);
+ return MGabCont::CallGab(parent::$action,__FUNCTION__,__CLASS__);
break;
case 'editmod':
- if(self::test_oID((int)self::$oID)) {
- self::$order= sqlorder::fetch(array('id'=>self::$oID));
+ if(self::test_oID((int)self::$oID)) {
+ self::$order= sqlorder::fetch(array('id'=>self::$oID));
- return self::EditMod($_GET['modtype'], $_GET['mod']);
- }
+ return self::EditMod($_GET['modtype'], $_GET['mod']);
+ }
break;
case 'new':
- self::$cInfo=self::GetDBValue();
+ self::$cInfo=self::GetDBValue();
- return MGabCont::CallGab(parent::$action,__FUNCTION__,__CLASS__);
+ return MGabCont::CallGab(parent::$action,__FUNCTION__,__CLASS__);
break;
case 'edit':
- if(self::test_oID((int)self::$oID)) {
- self::$order= sqlorder::fetch(array('id'=>self::$oID));
- self::$order->history=self::load_status_history((int)self::$oID);
- self::$order->lasthistory=self::$order->history[(count(self::$order->history)-1)];
+ self::$order= self::GetDBValue();
- return MGabCont::CallGab(parent::$action,__FUNCTION__,__CLASS__);
- }
+ return MGabCont::CallGab(parent::$action,__FUNCTION__,__CLASS__);
break;
default:
- self::load_db_values();
- /// use master gabarit
- MGabCont::SetCurrentName(__CLASS__);
- return MGabCont::CallGab('listing',__FUNCTION__,self::MASTER);
+ self::load_db_values();
+ /// use master gabarit
+ MGabCont::SetCurrentName(__CLASS__);
+ return MGabCont::CallGab('listing',__FUNCTION__,self::MASTER);
}
}
@@ -618,7 +622,7 @@
$r = array();
foreach(sqlorder::$modules_type->$type->modules as $key => $row){
- $r[] = array('id'=>$key,'text'=>$row->title);
+ $r[] = array('id'=>$key,'text'=>$row->title);
}
}
@@ -677,14 +681,14 @@
$orders_history_query = $DB->query("select orders_status_id, date_added, customer_notified, comments, status_color from " . TABLE_ORDERS_STATUS_HISTORY . " oh, ".TABLE_STATUS." WHERE orders_id = '" . tep_db_input($oID) . "' and status_type='orders' AND orders_status_id=status_id ORDER BY date_added DESC");
if ($orders_history_query->__get('numRows')) {
while ($orders_history = $orders_history_query->fetchAssoc()) {
- self::$update=(DEFAULT_ORDERS_STATUS_COMPLETED== $orders_history['orders_status_id'])? false : true;
+ self::$update=(DEFAULT_ORDERS_STATUS_COMPLETED== $orders_history['orders_status_id'])? false : true;
- $li['color']=$orders_history['status_color'];
- $li['date_added']=tep_datetime_short($orders_history['date_added']);
- $li['customer_notified']=(($orders_history['customer_notified'] == '1')? tep_image(DIR_WS_ICONS . 'tick.gif', ICON_TICK) :tep_image(DIR_WS_ICONS . 'cross.gif', ICON_CROSS) ) ;
- $li['orders_status']=self::$orders_status_array[$orders_history['orders_status_id']];
- $li['comments']=nl2br(tep_db_output($orders_history['comments'])) ;
- $list[]=$li;
+ $li['color']=$orders_history['status_color'];
+ $li['date_added']=tep_datetime_short($orders_history['date_added']);
+ $li['customer_notified']=(($orders_history['customer_notified'] == '1')? tep_image(DIR_WS_ICONS . 'tick.gif', ICON_TICK) :tep_image(DIR_WS_ICONS . 'cross.gif', ICON_CROSS) ) ;
+ $li['orders_status']=self::$orders_status_array[$orders_history['orders_status_id']];
+ $li['comments']=nl2br(tep_db_output($orders_history['comments'])) ;
+ $list[]=$li;
}
return $list;
@@ -769,19 +773,19 @@
switch (parent::$action) {
case 'listing':
- while ($orders = $_query->fetchAssoc()) {
- $ord['oID']=$orders['orders_id'];
- $ord['orders_id']=$orders['orders_prefix'].$orders['orders_id'];
- $ord['customers_id']=tep_customers_row_action($orders['customers_id'], array('origin'=>self::FILENAME));
- $ord['order_total']=strip_tags($orders['order_total']);
- $ord['date_purchased']=tep_datetime_short($orders['date_purchased']);
- $ord['payment_method']=$orders['payment_method'];
- $ord['orders_status_name']='<span style="display:inline-block; width:100%;padding:3px 0;background:'.$orders['orders_status_color'].'" >'.$orders['orders_status_name'].'</span>';
- $ord[0]=$orders['orders_id'];
- $ord[1]=tep_draw_checkbox_field('action_multi['.$orders['orders_id'].']','action_mutli_'.$orders['orders_id'],$orders['orders_id']);
- $ord['action']=self::get_item_action($ord);
- $res[]=$ord;
- }
+ while ($orders = $_query->fetchAssoc()) {
+ $ord['oID']=$orders['orders_id'];
+ $ord['orders_id']=$orders['orders_prefix'].$orders['orders_id'];
+ $ord['customers_id']=tep_customers_row_action($orders['customers_id'], array('origin'=>self::FILENAME));
+ $ord['order_total']=strip_tags($orders['order_total']);
+ $ord['date_purchased']=tep_datetime_short($orders['date_purchased']);
+ $ord['payment_method']=$orders['payment_method'];
+ $ord['orders_status_name']='<span style="display:inline-block; width:100%;padding:3px 0;background:'.$orders['orders_status_color'].'" >'.$orders['orders_status_name'].'</span>';
+ $ord[0]=$orders['orders_id'];
+ $ord[1]=tep_draw_checkbox_field('action_multi['.$orders['orders_id'].']','action_mutli_'.$orders['orders_id'],$orders['orders_id']);
+ $ord['action']=self::get_item_action($ord);
+ $res[]=$ord;
+ }
break;
}
Modified: trunk/catalog/admin/includes/template/oscss/stylesheet-1.css
===================================================================
--- trunk/catalog/admin/includes/template/oscss/stylesheet-1.css 2012-02-07 21:13:55 UTC (rev 4035)
+++ trunk/catalog/admin/includes/template/oscss/stylesheet-1.css 2012-02-13 18:39:30 UTC (rev 4036)
@@ -29,7 +29,7 @@
/* form defintion generale */
#form_bt { width: 80%; margin: 1em 2em;}
input.radioInput {width:30px;}
-fieldset { margin: 1em 2em; padding:1em; border:none; }
+fieldset { margin: 1em ; padding:1em; border:none; }
fieldset p { margin: 1em 0 0 0; }
fieldset select,
fieldset input[type="text"] { min-width:65%; display:inline-block;}
@@ -209,7 +209,8 @@
/* Structure */
#glob {background:transparent url(img/1/black.jpg) repeat-x ; width:100%; background-attachment:fixed; z-index:10; height:100%;}
-#center { margin: 0 auto; position: relative; min-width:900px;width:90%;max-width:1200px; }
+#center,
+#bas { margin: 0 auto; position: relative; min-width:900px;width:90%;max-width:1200px; }
#header {background:black; min-width:900px;width:90%;max-width:1200px; margin:0 0; position:fixed; z-index:10;}
#central { position:relative; padding:10px 5px; top:73px;border-left: 1px solid black;
@@ -284,7 +285,7 @@
#central h3{ font-size:15px; font-weight:bold; margin:0 0 10px; padding:0 5px 10px 3px; clear:both; }
#central h4{font-weight:bold; padding:15px 5px 8px; clear:both; }
/* Block formulaire central */
-#central .block_form { -moz-border-radius:6px; -webkit-border-radius:6px; margin:0;padding:5px 0.2em 10px 0.2em; display:inline-block; text-align: left; background:#C9C9C9;}
+#central .block_form { -moz-border-radius:6px; -webkit-border-radius:6px; margin:0;padding:5px 0.2em 10px 0.2em; width:100%;display:inline-block; text-align: left; background:#C9C9C9;}
#central .block_form .tabs_lang{/*width:98%;*/ float:left;}
#central .block_form div.tabPage {padding-left:0; padding-right:0;}
#central .block_form .block_input,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2012-02-07 21:14:02
|
Revision: 4035
http://oscss.svn.sourceforge.net/oscss/?rev=4035&view=rev
Author: oscim
Date: 2012-02-07 21:13:55 +0000 (Tue, 07 Feb 2012)
Log Message:
-----------
[BO] Ajout code js base jquery dans header.php pour selection de toutes les lignes d un tableau dans les listing
ajustement de adminNotif , report des gabarits ds un dossier independant, ajout checkbox pour la selection de toutes les lignes
Modified Paths:
--------------
trunk/catalog/admin/includes/header.php
trunk/catalog/admin/includes/modules/pages/adminNotif.php
Added Paths:
-----------
trunk/catalog/admin/includes/gabarit/adminNotif/
trunk/catalog/admin/includes/gabarit/adminNotif/display_view.config.gab
trunk/catalog/admin/includes/gabarit/adminNotif/display_view.listing.gab
trunk/catalog/admin/includes/gabarit/adminNotif/display_view.view.gab
Removed Paths:
-------------
trunk/catalog/admin/includes/gabarit/adminNotif.config.gab
trunk/catalog/admin/includes/gabarit/adminNotif.listing.gab
trunk/catalog/admin/includes/gabarit/adminNotif.view.gab
Copied: trunk/catalog/admin/includes/gabarit/adminNotif/display_view.config.gab (from rev 4034, trunk/catalog/admin/includes/gabarit/adminNotif.config.gab)
===================================================================
--- trunk/catalog/admin/includes/gabarit/adminNotif/display_view.config.gab (rev 0)
+++ trunk/catalog/admin/includes/gabarit/adminNotif/display_view.config.gab 2012-02-07 21:13:55 UTC (rev 4035)
@@ -0,0 +1,69 @@
+<?php
+/**
+ @licence GPL 2005-2011 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 11/02/11, 09:43
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+*/
+?>
+<h3><?php echo __('heading title'); ?></h3>
+
+<h4><?php echo __('heading title configuration'); ?></h4>
+
+
+ <div class="button_nav">
+ <?php printf(CsrtAction::getLink('button_nav', __('image new notification') ), '', tep_href_link(adminNotif::FILENAME, 'action=confignew') ,'' );
+ printf(CsrtAction::getLink('button_nav', __('image notification list') ), '', tep_href_link(adminNotif::FILENAME ) ,'' ); ?>
+ </div>
+
+<div class="box_uniq">
+ <div class="box_left">
+
+ <table class="dataTable">
+ <thead>
+ <tr>
+ <th><?php echo __('table heading chknotif id'); ?></th>
+ <th><?php echo __('table heading type'); ?></th>
+ <th class="tcenter"><?php echo __('table heading chknotif_key'); ?></th>
+ <th class="tcenter"><?php echo __('table heading chknotif_method'); ?></th>
+ <th class="tcenter"><?php echo __('table heading chknotif_status'); ?></th>
+ <th class="row_action"><?php echo __('table heading action'); ?></th>
+ </tr>
+ </thead>
+<?php /* <tfoot>
+ <tr>
+ <td colspan="2"><?php echo $db_admin_split->display_count($db_admin_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $page, TEXT_DISPLAY_NUMBER_OF_MEMBERS); ?></td>
+ <td colspan="2"><?php echo $db_admin_split->display_links($db_admin_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $page); ?></td>
+ </tr>
+ </tfoot> */ ?>
+ <tbody>
+ <?php foreach(adminNotif::$listConfig as $notif): ?>
+ <tr class="view parent dataTableRow <?php if ((!isset($_GET['mID'])) || ($_GET['mID'] == $notif['admin_id']) ) echo "Selected"; ?>" >
+ <td><?php echo $notif['chknotif_id']; ?></td>
+ <td><?php echo ($notif['chknotif_uniq']==0)? __('type user') : __('type group') ;; ?></td>
+ <td class="tcenter"><?php echo $notif['chknotif_key']; ?></td>
+ <td class="tcenter"><?php echo $notif['chknotif_method']; ?></td>
+ <td class="tcenter"><?php echo $notif['chknotif_status']; ?></td>
+ <td class="row_action">
+ <?php
+ printf(
+ CsrtAction::getFormat('row_action'),
+ '' ,
+ sprintf(CsrtAction::getLink('row_action_right', IMAGE_EDIT, 'edit'), '', tep_href_link(adminNotif::FILENAME, 'cID=' . $notif['chknotif_id'] . '&action=configedit') ,'' ).
+ sprintf(CsrtAction::getLink('row_action_right', IMAGE_DELETE, 'delete'), '', tep_href_link(adminNotif::FILENAME, 'cID=' . $notif['chknotif_id'] . '&action=configdelete') ,'' )
+ );
+ ?>
+ </td>
+ </tr>
+ <?php endforeach; ?>
+ </tbody>
+ </table>
+ </div>
+
+ <div class="box_right">
+ <?php echo adminNotif::get_right_bar(); ?>
+ </div>
+</div>
\ No newline at end of file
Copied: trunk/catalog/admin/includes/gabarit/adminNotif/display_view.listing.gab (from rev 4034, trunk/catalog/admin/includes/gabarit/adminNotif.listing.gab)
===================================================================
--- trunk/catalog/admin/includes/gabarit/adminNotif/display_view.listing.gab (rev 0)
+++ trunk/catalog/admin/includes/gabarit/adminNotif/display_view.listing.gab 2012-02-07 21:13:55 UTC (rev 4035)
@@ -0,0 +1,66 @@
+<?php
+/**
+ @licence GPL 2005-2012 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 09/12/2012, 10:34
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+*/
+?>
+<h3><?php echo __('heading title'); ?></h3>
+
+ <div class="button_nav">
+ <?php printf(CsrtAction::getLink('button_nav', __('image notification config list') ), '', tep_href_link(adminNotif::FILENAME, 'action=config') ,'' ); ?>
+ </div>
+
+<div class="box_uniq">
+ <?php echo tep_draw_form('multi', adminNotif::FILENAME, 'action=multi', 'post') ?>
+ <table class="dataTable">
+ <thead>
+ <tr>
+ <th colspan="2"><?php echo __('table heading notif id'); ?></th>
+ <th><?php echo __('table heading type'); ?></th>
+ <th class="tcenter"><?php echo __('table heading keys'); ?></th>
+ <th class="tcenter"><?php echo __('table heading date'); ?></th>
+ <th class="row_action"><?php echo __('table heading action'); ?></th>
+ </tr>
+ </thead>
+ <tfoot>
+ <tr>
+ <td colspan="2"><?php echo tep_draw_checkbox_field('select_all', 'select_all' ); ?></td>
+ <td colspan="4"><?php printf(CsrtAction::getButton('button_action', IMAGE_DELETE, 'delete'), '', ' name="delete" ' ); ?></td>
+ </tr>
+ </tfoot>
+ <tbody>
+ <?php foreach(adminNotif::$list as $notif): ?>
+ <tr class="view parent dataTableRow <?php if ((!isset($_GET['mID'])) || ($_GET['mID'] == $notif['admin_id']) ) echo "Selected"; ?>" >
+ <td><?php echo tep_draw_checkbox_field('multi['.$notif['notif_id'].']', 'multi_'.$notif['notif_id'] ,'','','','class="multi"' ); ?></td>
+ <td><?php echo $notif['notif_id']; ?></td>
+ <td><?php echo ($notif['notif_type']==0)? __('type user') : __('type group') ; ?></td>
+ <td class="tcenter"><?php echo $notif['notif_key']; ?></td>
+ <td class="tcenter"><?php echo tep_datetime_short($notif['notif_date']); ?></td>
+ <td class="w_20">
+ <?php
+ printf(
+ CsrtAction::getFormat('row_action'),
+ ((isset($notif['customers_id']) && !empty($notif['customers_id']) )
+ ?tep_customers_row_action($notif['customers_id'], array('origin'=>adminNotif::FILENAME))
+ : (!empty($notif['user_email'])? ' <a href="mailto:'.$notif['user_email'].'" >'.$notif['user'].'</a>' : '')
+ ),
+ sprintf(CsrtAction::getLink('row_action_right', IMAGE_VIEW, 'view'), 'fancyView', tep_href_link(adminNotif::FILENAME, 'nID=' . $notif['notif_id'] . '&action=view') ,'' ).
+ sprintf(CsrtAction::getLink('row_action_right', IMAGE_DELETE, 'delete'), '', tep_href_link(adminNotif::FILENAME, 'nID=' . $notif['notif_id'] . '&action=delete') ,'' ) .
+ ((isset($_GET['nID']) && $notif['notif_id'] == $_GET['nID'])
+ ? CsrtAction::getImage('row_action_right', IMAGE_ICON_INFO, 'arrow_right')
+ : sprintf(CsrtAction::getLink('row_action_right', IMAGE_ICON_INFO, 'info'), 'fancyView', tep_href_link(adminNotif::FILENAME, 'nID=' . $notif['notif_id'] . '&action=view') ,'' )
+ )
+ );
+ ?>
+ </td>
+ </tr>
+ <?php endforeach; ?>
+ </tbody>
+ </table>
+ </form>
+</div>
\ No newline at end of file
Copied: trunk/catalog/admin/includes/gabarit/adminNotif/display_view.view.gab (from rev 4034, trunk/catalog/admin/includes/gabarit/adminNotif.view.gab)
===================================================================
--- trunk/catalog/admin/includes/gabarit/adminNotif/display_view.view.gab (rev 0)
+++ trunk/catalog/admin/includes/gabarit/adminNotif/display_view.view.gab 2012-02-07 21:13:55 UTC (rev 4035)
@@ -0,0 +1,15 @@
+<?php
+/**
+ @licence GPL 2005-2011 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 11/02/11, 09:43
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+*/
+
+?>
+<div class="box_uniq">
+ <?php echo adminNotif::get_right_bar(); ?>
+</div>
\ No newline at end of file
Deleted: trunk/catalog/admin/includes/gabarit/adminNotif.config.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/adminNotif.config.gab 2012-02-07 13:16:12 UTC (rev 4034)
+++ trunk/catalog/admin/includes/gabarit/adminNotif.config.gab 2012-02-07 21:13:55 UTC (rev 4035)
@@ -1,69 +0,0 @@
-<?php
-/**
- @licence GPL 2005-2011 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 11/02/11, 09:43
- @author oscim <mail aur...@os...> <www http://www.oscim.fr>
- @encode UTF-8
-*/
-?>
-<h3><?php echo __('heading title'); ?></h3>
-
-<h4><?php echo __('heading title configuration'); ?></h4>
-
-
- <div class="button_nav">
- <?php printf(CsrtAction::getLink('button_nav', __('image new notification') ), '', tep_href_link(adminNotif::FILENAME, 'action=confignew') ,'' );
- printf(CsrtAction::getLink('button_nav', __('image notification list') ), '', tep_href_link(adminNotif::FILENAME ) ,'' ); ?>
- </div>
-
-<div class="box_uniq">
- <div class="box_left">
-
- <table class="dataTable">
- <thead>
- <tr>
- <th><?php echo __('table heading chknotif id'); ?></th>
- <th><?php echo __('table heading type'); ?></th>
- <th class="tcenter"><?php echo __('table heading chknotif_key'); ?></th>
- <th class="tcenter"><?php echo __('table heading chknotif_method'); ?></th>
- <th class="tcenter"><?php echo __('table heading chknotif_status'); ?></th>
- <th class="row_action"><?php echo __('table heading action'); ?></th>
- </tr>
- </thead>
-<?php /* <tfoot>
- <tr>
- <td colspan="2"><?php echo $db_admin_split->display_count($db_admin_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $page, TEXT_DISPLAY_NUMBER_OF_MEMBERS); ?></td>
- <td colspan="2"><?php echo $db_admin_split->display_links($db_admin_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $page); ?></td>
- </tr>
- </tfoot> */ ?>
- <tbody>
- <?php foreach(adminNotif::$listConfig as $notif): ?>
- <tr class="view parent dataTableRow <?php if ((!isset($_GET['mID'])) || ($_GET['mID'] == $notif['admin_id']) ) echo "Selected"; ?>" >
- <td><?php echo $notif['chknotif_id']; ?></td>
- <td><?php echo ($notif['chknotif_uniq']==0)? __('type user') : __('type group') ;; ?></td>
- <td class="tcenter"><?php echo $notif['chknotif_key']; ?></td>
- <td class="tcenter"><?php echo $notif['chknotif_method']; ?></td>
- <td class="tcenter"><?php echo $notif['chknotif_status']; ?></td>
- <td class="row_action">
- <?php
- printf(
- CsrtAction::getFormat('row_action'),
- '' ,
- sprintf(CsrtAction::getLink('row_action_right', IMAGE_EDIT, 'edit'), '', tep_href_link(adminNotif::FILENAME, 'cID=' . $notif['chknotif_id'] . '&action=configedit') ,'' ).
- sprintf(CsrtAction::getLink('row_action_right', IMAGE_DELETE, 'delete'), '', tep_href_link(adminNotif::FILENAME, 'cID=' . $notif['chknotif_id'] . '&action=configdelete') ,'' )
- );
- ?>
- </td>
- </tr>
- <?php endforeach; ?>
- </tbody>
- </table>
- </div>
-
- <div class="box_right">
- <?php echo adminNotif::get_right_bar(); ?>
- </div>
-</div>
\ No newline at end of file
Deleted: trunk/catalog/admin/includes/gabarit/adminNotif.listing.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/adminNotif.listing.gab 2012-02-07 13:16:12 UTC (rev 4034)
+++ trunk/catalog/admin/includes/gabarit/adminNotif.listing.gab 2012-02-07 21:13:55 UTC (rev 4035)
@@ -1,66 +0,0 @@
-<?php
-/**
- @licence GPL 2005-2011 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 11/04/11, 10:34
- @author oscim <mail aur...@os...> <www http://www.oscim.fr>
- @encode UTF-8
-*/
-?>
-<h3><?php echo __('heading title'); ?></h3>
-
- <div class="button_nav">
- <?php printf(CsrtAction::getLink('button_nav', __('image notification config list') ), '', tep_href_link(adminNotif::FILENAME, 'action=config') ,'' ); ?>
- </div>
-
-<div class="box_uniq">
- <?php echo tep_draw_form('multi', adminNotif::FILENAME, 'action=multi', 'post') ?>
- <table class="dataTable">
- <thead>
- <tr>
- <th colspan="2"><?php echo __('table heading notif id'); ?></th>
- <th><?php echo __('table heading type'); ?></th>
- <th class="tcenter"><?php echo __('table heading keys'); ?></th>
- <th class="tcenter"><?php echo __('table heading date'); ?></th>
- <th class="row_action"><?php echo __('table heading action'); ?></th>
- </tr>
- </thead>
- <tfoot>
- <tr>
- <td colspan="2"> </td>
- <td colspan="4"><?php printf(CsrtAction::getButton('button_action', IMAGE_DELETE, 'delete'), '', ' name="delete" ' ); ?></td>
- </tr>
- </tfoot>
- <tbody>
- <?php foreach(adminNotif::$list as $notif): ?>
- <tr class="view parent dataTableRow <?php if ((!isset($_GET['mID'])) || ($_GET['mID'] == $notif['admin_id']) ) echo "Selected"; ?>" >
- <td><?php echo tep_draw_checkbox_field('multi['.$notif['notif_id'].']', 'multi_'.$notif['notif_id'] ); ?></td>
- <td><?php echo $notif['notif_id']; ?></td>
- <td><?php echo ($notif['notif_type']==0)? __('type user') : __('type group') ; ?></td>
- <td class="tcenter"><?php echo $notif['notif_key']; ?></td>
- <td class="tcenter"><?php echo tep_datetime_short($notif['notif_date']); ?></td>
- <td class="w_20">
- <?php
- printf(
- CsrtAction::getFormat('row_action'),
- ((isset($notif['customers_id']) && !empty($notif['customers_id']) )
- ?tep_customers_row_action($notif['customers_id'], array('origin'=>adminNotif::FILENAME))
- : (!empty($notif['user_email'])? ' <a href="mailto:'.$notif['user_email'].'" >'.$notif['user'].'</a>' : '')
- ),
- sprintf(CsrtAction::getLink('row_action_right', IMAGE_VIEW, 'view'), 'fancyView', tep_href_link(adminNotif::FILENAME, 'nID=' . $notif['notif_id'] . '&action=view') ,'' ).
- sprintf(CsrtAction::getLink('row_action_right', IMAGE_DELETE, 'delete'), '', tep_href_link(adminNotif::FILENAME, 'nID=' . $notif['notif_id'] . '&action=delete') ,'' ) .
- ((isset($_GET['nID']) && $notif['notif_id'] == $_GET['nID'])
- ? CsrtAction::getImage('row_action_right', IMAGE_ICON_INFO, 'arrow_right')
- : sprintf(CsrtAction::getLink('row_action_right', IMAGE_ICON_INFO, 'info'), 'fancyView', tep_href_link(adminNotif::FILENAME, 'nID=' . $notif['notif_id'] . '&action=view') ,'' )
- )
- );
- ?>
- </td>
- </tr>
- <?php endforeach; ?>
- </tbody>
- </table>
- </form>
-</div>
\ No newline at end of file
Deleted: trunk/catalog/admin/includes/gabarit/adminNotif.view.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/adminNotif.view.gab 2012-02-07 13:16:12 UTC (rev 4034)
+++ trunk/catalog/admin/includes/gabarit/adminNotif.view.gab 2012-02-07 21:13:55 UTC (rev 4035)
@@ -1,15 +0,0 @@
-<?php
-/**
- @licence GPL 2005-2011 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 11/02/11, 09:43
- @author oscim <mail aur...@os...> <www http://www.oscim.fr>
- @encode UTF-8
-*/
-
-?>
-<div class="box_uniq">
- <?php echo adminNotif::get_right_bar(); ?>
-</div>
\ No newline at end of file
Modified: trunk/catalog/admin/includes/header.php
===================================================================
--- trunk/catalog/admin/includes/header.php 2012-02-07 13:16:12 UTC (rev 4034)
+++ trunk/catalog/admin/includes/header.php 2012-02-07 21:13:55 UTC (rev 4035)
@@ -4,7 +4,7 @@
@portion code Copyright (c) 2002 osCommerce
@package osCSS-2 <www http://www.oscss.org>
@version 2.1.1
- @date 01/01/2012, 18:17
+ @date 09/12/2012, 18:17
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
@brief block in balise html head.
@@ -88,6 +88,17 @@
// simple_tooltip("input","tooltip");
+
+// Multi in datatable, for select all rows
+ $("#select_all").click(function(){
+ var checked_status = $("#select_all").is(':checked');
+ $("input[type='checkbox'].multi").each(function(){
+ if(checked_status == true)
+ this.checked = true;
+ else
+ this.checked = false;
+ });
+ });
}
Modified: trunk/catalog/admin/includes/modules/pages/adminNotif.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/adminNotif.php 2012-02-07 13:16:12 UTC (rev 4034)
+++ trunk/catalog/admin/includes/modules/pages/adminNotif.php 2012-02-07 21:13:55 UTC (rev 4035)
@@ -1,10 +1,10 @@
<?php if (!defined('HTTP_SERVER')) die('You can not access this file directly!');
/**
- @licence GPL 2005-2011 The osCSS developers - osCSS Open Source E-commerce
+ @licence GPL 2005-2012 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 14/12/11, 14:49
+ @date 09/12/2012, 10:34
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
@class adminNotif
@@ -112,7 +112,7 @@
return self::$action;
}
- public function get_header(){ return false; }
+ public function get_header(){ return false;}
public static function load_db_values($ID){
$DB=Database::getInstance();
@@ -134,16 +134,16 @@
case 'configedit':
case 'configdelete':
case 'config':
- self::loadConfigUser();
- return tep_get_include_contents(self::$code.'.config');
+ self::loadConfigUser();
+ return tep_get_include_contents(self::$code.'/display_view.config');
break;
case 'view':
- return tep_get_include_contents(self::$code.'.view');
+ return tep_get_include_contents(self::$code.'/display_view.view');
break;
default:
- self::loadNotifUser();
- return tep_get_include_contents(self::$code.'.listing');
+ self::loadNotifUser();
+ return tep_get_include_contents(self::$code.'/display_view.listing');
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2012-02-07 13:16:24
|
Revision: 4034
http://oscss.svn.sourceforge.net/oscss/?rev=4034&view=rev
Author: oscim
Date: 2012-02-07 13:16:12 +0000 (Tue, 07 Feb 2012)
Log Message:
-----------
correction bug et coquille sur la page de recherche public
Modified Paths:
--------------
trunk/catalog/advanced_search.php
trunk/catalog/includes/content/advanced_search.php
trunk/catalog/install/data/templates/appareil_photo/2cShopHtml5Oscim/includes/content/advanced_search.php
trunk/catalog/install/data/templates/appareil_photo/electronix/includes/content/advanced_search.php
Modified: trunk/catalog/advanced_search.php
===================================================================
--- trunk/catalog/advanced_search.php 2012-02-07 10:28:55 UTC (rev 4033)
+++ trunk/catalog/advanced_search.php 2012-02-07 13:16:12 UTC (rev 4034)
@@ -1,13 +1,13 @@
<?php
/**
-* \licence GPL 2005-2010 The osCSS developers - osCSS Open Source E-commerce
+* \licence GPL 2005-2012 The osCSS developers - osCSS Open Source E-commerce
* \package osCSS-2 <www http://www.oscss.org>
-* \version 2.1.0
-* \date 01/06/10, 22:16
+* \version 2.1.1
+* \date 09/02/2012, 22:16
* \author oscim <mail aur...@os...> <www http://www.oscim.fr>
* \encode UTF-8
*
-* \file
+* \file
* \brief Page de Recherche avancé
*
*/
@@ -134,20 +134,20 @@
}
}
-// $select_str = "select distinct " . $select_column_list . " m.manufacturers_id, p.products_id, pd.products_name, p.products_price,p.products_quantity, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price ";
- $select_str = "SELECT DISTINCT " . $select_column_list . " m.manufacturers_id, p.products_id, pd.products_name, p.products_price,p.products_quantity, p.products_tax_class_id, p.specials_new_products_price , p.final_price ,p.products_tax_class_id ";
+ $select_str = "SELECT DISTINCT " . $select_column_list . " m.manufacturers_id, p.products_id, pd.products_name, p.products_price,p.products_quantity, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price , IF(s.status, s.specials_new_products_price, p.products_price) ,p.products_tax_class_id ";
+
if ( (_cst_bool('DISPLAY_PRICE_WITH_TAX')) && (tep_not_null($pfrom) || tep_not_null($pto)) ) {
$select_str .= ", SUM(tr.tax_rate) as tax_rate ";
}
-// $from_str = "from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m using(manufacturers_id) left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id";
- $from_str = "from " . TABLE_V_PRODUCTS . " p ";
- $from_str .=" left join " . TABLE_MANUFACTURERS . " m using(manufacturers_id) ";
- $from_str .=" left join " . TABLE_PRODUCTS_DESCRIPTION . " pd using(products_id) ";
-// $from_str .=" left join " . TABLE_CATEGORIES . " c using(manufacturers_id) ";
- $from_str .=" left join " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c using(products_id) ";
- $from_str .=" left join " . TABLE_PRODUCTS_ATTRIBUTES . " pa using(products_id) ";
+ $from_str = "from " . TABLE_PRODUCTS . " p ";
+ $from_str .=" left join " . TABLE_SPECIALS . " s USING(products_id) ";
+ $from_str .=" left join " . TABLE_MANUFACTURERS . " m USING(manufacturers_id) ";
+ $from_str .=" left join " . TABLE_PRODUCTS_DESCRIPTION . " pd using(products_id) ";
+ // $from_str .=" left join " . TABLE_CATEGORIES . " c using(manufacturers_id) ";
+ $from_str .=" left join " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c using(products_id) ";
+ $from_str .=" left join " . TABLE_PRODUCTS_ATTRIBUTES . " pa using(products_id) ";
// $from_str .= ", " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_CATEGORIES . " c, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c ," . TABLE_PRODUCTS_ATTRIBUTES . ' pa ';
@@ -197,7 +197,7 @@
break;
default:
$keyword = tep_db_prepare_input($search_keywords[$i]);
- $where_str .= "(pd.products_name like '%" . tep_db_input($keyword) . "%' or p.products_model like '%" . tep_db_input($keyword) . "%' or p.manufacturers_name like '%" . tep_db_input($keyword) . "%'";
+ $where_str .= "(pd.products_name like '%" . tep_db_input($keyword) . "%' or p.products_model like '%" . tep_db_input($keyword) . "%' or m.manufacturers_name like '%" . tep_db_input($keyword) . "%'";
if (isset($_GET['search_in_description']) && ($_GET['search_in_description'] == '1')) $where_str .= " or pd.products_description like '%" . tep_db_input($keyword) . "%'";
$where_str .= ')';
break;
Modified: trunk/catalog/includes/content/advanced_search.php
===================================================================
--- trunk/catalog/includes/content/advanced_search.php 2012-02-07 10:28:55 UTC (rev 4033)
+++ trunk/catalog/includes/content/advanced_search.php 2012-02-07 13:16:12 UTC (rev 4034)
@@ -66,10 +66,6 @@
<?php echo tep_draw_input_field('dto','dto', DOB_FORMAT_STRING, 'onfocus="this.value=\'\'"'); ?>
</li>
- <li>
- <label for="dto"><?php echo ENTRY_DATE_TO; ?></label>
- <?php echo tep_list_option_value_dipso(); ?>
- </li>
<li class="formBt"><input type="submit" class="submitBt" value="<?php echo IMAGE_BUTTON_SEARCH; ?>" /></li>
</ul>
</fieldset>
Modified: trunk/catalog/install/data/templates/appareil_photo/2cShopHtml5Oscim/includes/content/advanced_search.php
===================================================================
--- trunk/catalog/install/data/templates/appareil_photo/2cShopHtml5Oscim/includes/content/advanced_search.php 2012-02-07 10:28:55 UTC (rev 4033)
+++ trunk/catalog/install/data/templates/appareil_photo/2cShopHtml5Oscim/includes/content/advanced_search.php 2012-02-07 13:16:12 UTC (rev 4034)
@@ -116,11 +116,6 @@
</span>
</li>
-<!-- <li class="BlockRows">
- <label for="dto"><?php echo ENTRY_OPTION; ?></label>
- <?php echo tep_list_option_value_dipso(); ?>
- </li>-->
-
<li class="BlockRows Button">
<input type="submit" class="submitBt" value="<?php echo IMAGE_BUTTON_SEARCH; ?>" />
</li>
Modified: trunk/catalog/install/data/templates/appareil_photo/electronix/includes/content/advanced_search.php
===================================================================
--- trunk/catalog/install/data/templates/appareil_photo/electronix/includes/content/advanced_search.php 2012-02-07 10:28:55 UTC (rev 4033)
+++ trunk/catalog/install/data/templates/appareil_photo/electronix/includes/content/advanced_search.php 2012-02-07 13:16:12 UTC (rev 4034)
@@ -68,10 +68,7 @@
<?php echo tep_draw_input_field('dto','dto', DOB_FORMAT_STRING, 'onfocus="this.value=\'\'"'); ?>
</li>
- <li class="form_row">
- <label class="contact" for="dto"><?php echo ENTRY_DATE_TO; ?></label>
- <?php echo tep_list_option_value_dipso(); ?>
- </li>
+
<li class="formBt"><input type="submit" class="submitBt" value="<?php echo IMAGE_BUTTON_SEARCH; ?>" /></li>
</ul>
</fieldset>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2012-02-07 10:29:06
|
Revision: 4033
http://oscss.svn.sourceforge.net/oscss/?rev=4033&view=rev
Author: oscim
Date: 2012-02-07 10:28:55 +0000 (Tue, 07 Feb 2012)
Log Message:
-----------
Suite des correction sur les produxt extra
Modified Paths:
--------------
trunk/catalog/admin/includes/gabarit/configuration/modprodextra/draw.delete.gab
trunk/catalog/admin/includes/gabarit/configuration/modprodextra/draw.label.edit.gab
trunk/catalog/admin/includes/gabarit/configuration/modprodextra/draw.value.edit.gab
trunk/catalog/admin/includes/modules/configuration/modprodextra.php
Added Paths:
-----------
trunk/catalog/admin/includes/gabarit/configuration/modprodextra/draw.value.new.gab
Modified: trunk/catalog/admin/includes/gabarit/configuration/modprodextra/draw.delete.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/configuration/modprodextra/draw.delete.gab 2012-02-07 09:31:02 UTC (rev 4032)
+++ trunk/catalog/admin/includes/gabarit/configuration/modprodextra/draw.delete.gab 2012-02-07 10:28:55 UTC (rev 4033)
@@ -1,10 +1,10 @@
<?php
/**
- @licence GPL 2005-2011 The osCSS developers - osCSS Open Source E-commerce
+ @licence GPL 2005-2012 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 24/10/11, 15:38
+ @date 08/02/2012, 15:38
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
@brief gabarit for listing extra fields products
Modified: trunk/catalog/admin/includes/gabarit/configuration/modprodextra/draw.label.edit.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/configuration/modprodextra/draw.label.edit.gab 2012-02-07 09:31:02 UTC (rev 4032)
+++ trunk/catalog/admin/includes/gabarit/configuration/modprodextra/draw.label.edit.gab 2012-02-07 10:28:55 UTC (rev 4033)
@@ -1,51 +1,34 @@
<?php
/**
- @licence GPL 2005-2011 The osCSS developers - osCSS Open Source E-commerce
+ @licence GPL 2005-2012 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 24/10/11, 15:38
+ @date 08/02/2012, 15:38
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
@brief gabarit for listing extra fields products
*/
+
global $action, $languages;
?>
<div class="box_unique">
<h4><?php echo (($action == 'edit')? __('HEADING_NEW') : __('HEADING_EDIT') . modprodextra::$eid ) ?></h4>
- <?php
- if (!empty($messages)) {
- echo '<ul ' . ($error ? 'class="error"' : 'class="warning"') . '>' . "\n";
- foreach ($messages as $message) {
- echo '<li>' . $message . "</li>\n";
- }
- echo "</ul>\n";
- }
+ <?php echo tep_draw_form('field_entry',FILENAME_CONFIGURATION, tep_get_all_get_params(array('action','eid','confirm')). 'action=' . (($action == 'new') ? 'insert' : 'update') . '&confirm=yes&eid=' . modprodextra::$eid , 'post'); ?>
- echo tep_draw_form('field_entry',FILENAME_CONFIGURATION, tep_get_all_get_params(array('action','eid','confirm')). 'action=' . (($action == 'new') ? 'insert' : 'update') . '&confirm=yes&eid=' . modprodextra::$eid /*. ($confirmation_needed ? '&confirm=yes' : '')*/, 'post'); ?>
-
<p class="block_input">
- <label><?php echo __('ENTRY_ACTIVATE_NOW') ?></label>
- <?php echo tep_draw_radio_field('status','status', '1', (((int)modprodextra::$cInfo['epf_status']==1)? true : false) ). ' ' .__('TEXT_YES'). ' ' . tep_draw_radio_field('status','status', '0', (((int)modprodextra::$cInfo['epf_status']==0)? true : false) ). ' ' .__('TEXT_NO'); ?>
- </p>
+ <label><?php echo __('ENTRY_ACTIVATE_NOW') ?></label>
+ <?php echo tep_draw_radio_field('status','status', '1', (((int)modprodextra::$cInfo['epf_status']==1)? true : false) ). ' ' .__('TEXT_YES'). ' ' . tep_draw_radio_field('status','status', '0', (((int)modprodextra::$cInfo['epf_status']==0)? true : false) ). ' ' .__('TEXT_NO'); ?>
- <?php if ($action == 'new') : ?>
- <p class="block_input">
- <label><?php echo __('ENTRY_VALUE_LIST') ?></label>
- <?php echo tep_draw_radio_field('value_list','value_list', '1',(((int)modprodextra::$cInfo['epf_uses_value_list']==1)? true : false)) . ' ' .__('TEXT_YES'). ' ' . tep_draw_radio_field('value_list','value_list', '0',(((int)modprodextra::$cInfo['epf_uses_value_list']==0)? true : false)) . ' ' .__('TEXT_NO'); ?>
- </p>
- <?php elseif ((int)modprodextra::$cInfo['epf_uses_value_list']==1) : ?>
+
<?php echo tep_draw_hidden_field('value_list','value_list', (((int)modprodextra::$cInfo['epf_uses_value_list']==1)? '1' : '0')) ?>
- <?php endif; ?>
+ <?php echo tep_draw_hidden_field('epf_active_for_language','epf_active_for_language', (((int)modprodextra::$cInfo['epf_active_for_language']==1)? '1' : '0')) ?>
- <p class="block_input">
- <label for="epf_active_for_language" title="<?php echo __('ENTRY_ACTIVE_HELP') ?>"><?php echo __('ENTRY_ACTIVE'). tep_image(DIR_WS_ICONS . 'icon_help.gif'); ?></label>
- <?php echo tep_draw_radio_field('epf_active_for_language' ,'epf_active_for_language' , '1', (((int)modprodextra::$cInfo['epf_active_for_language']==1)? true : false) ) . ' ' . __('TEXT_YES') .
- ' ' . tep_draw_radio_field('epf_active_for_language' ,'epf_active_for_language', '0', (((int)modprodextra::$cInfo['epf_active_for_language']==0)? true : false) ) . ' ' . __('TEXT_NO'); ?>
</p>
+
<fieldset class="tabs_lang block_field">
<ul>
<?php for ($i=0, $n=sizeof($languages); $i<$n; $i++) { ?>
Modified: trunk/catalog/admin/includes/gabarit/configuration/modprodextra/draw.value.edit.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/configuration/modprodextra/draw.value.edit.gab 2012-02-07 09:31:02 UTC (rev 4032)
+++ trunk/catalog/admin/includes/gabarit/configuration/modprodextra/draw.value.edit.gab 2012-02-07 10:28:55 UTC (rev 4033)
@@ -1,10 +1,10 @@
<?php
/**
- @licence GPL 2005-2011 The osCSS developers - osCSS Open Source E-commerce
+ @licence GPL 2005-2012 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 24/10/11, 15:38
+ @date 08/02/2012, 15:38
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
@brief gabarit for listing extra fields products
@@ -16,7 +16,7 @@
-<?php echo tep_draw_form('value_entry', FILENAME_CONFIGURATION,FILENAME_CFG_34.'action=' . (($action == 'value_new') ? 'value_insert' : 'value_update') . '&eid=' . modprodextra::$eid . '&vid=' . $_GET['vid']/*. '&parent=' . $parent_id*/ /*. ($confirmation_needed ? '&confirm=yes' : '')*/, 'post'); ?>
+<?php echo tep_draw_form('value_entry', FILENAME_CONFIGURATION,FILENAME_CFG_34.'action=' . (($action == 'value_new') ? 'value_insert' : 'value_update') . '&eid=' . modprodextra::$eid . '&vid=' . $_GET['vid'], 'post'); ?>
<div class="tabs_lang">
<ul>
@@ -28,12 +28,12 @@
<?php for ($i=0, $n=sizeof($languages); $i<$n; $i++): ?>
<fieldset id="<?php echo 'lang-'.($i+1) ?>">
- <p class="block_input">
- <?php echo __('ENTRY_ORDER') . tep_draw_input_field('sort_order['.$languages[$i]['id'].']','sort_order_'.$languages[$i]['id'],modprodextra::$cInfo[$languages[$i]['id']]['sort_order']) ; ?>
- </p>
- <p class="block_input">
- <?php echo __('ENTRY_VALUE') . tep_draw_input_field('value['.$languages[$i]['id'].']','value_'.$languages[$i]['id'], modprodextra::$cInfo[$languages[$i]['id']]['epf_value'], 'size=64 maxlength=64'); ?>
- </p>
+ <p class="block_input">
+ <?php echo __('ENTRY_ORDER') . tep_draw_input_field('sort_order['.$languages[$i]['id'].']','sort_order_'.$languages[$i]['id'],modprodextra::$cInfo[$languages[$i]['id']]['sort_order']) ; ?>
+ </p>
+ <p class="block_input">
+ <?php echo __('ENTRY_VALUE') . tep_draw_input_field('value['.$languages[$i]['id'].']','value_'.$languages[$i]['id'], modprodextra::$cInfo[$languages[$i]['id']]['epf_value'], 'size=64 maxlength=64'); ?>
+ </p>
</fieldset>
<?php endfor; ?>
Added: trunk/catalog/admin/includes/gabarit/configuration/modprodextra/draw.value.new.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/configuration/modprodextra/draw.value.new.gab (rev 0)
+++ trunk/catalog/admin/includes/gabarit/configuration/modprodextra/draw.value.new.gab 2012-02-07 10:28:55 UTC (rev 4033)
@@ -0,0 +1,48 @@
+<?php
+/**
+ @licence GPL 2005-2012 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 08/02/2012, 15:38
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+ @brief gabarit for listing extra fields products, create new entry
+*/
+
+global $action, $languages;
+?>
+ <div class="box_unique">
+ <h4><?php echo (($action == 'edit')? __('HEADING_NEW') : __('HEADING_EDIT') . modprodextra::$eid ) ?></h4>
+
+ <?php echo tep_draw_form('field_entry',FILENAME_CONFIGURATION, tep_get_all_get_params(array('action','eid','confirm')). 'action=insert', 'post'); ?>
+
+
+
+
+
+ <p class="block_input">
+ <label><?php echo __('ENTRY_VALUE_LIST') ?></label>
+ <?php echo tep_draw_radio_field('value_list','value_list', '1',(((int)modprodextra::$cInfo['epf_uses_value_list']==1)? true : false)) . ' ' .__('TEXT_YES'). ' ' . tep_draw_radio_field('value_list','value_list', '0',(((int)modprodextra::$cInfo['epf_uses_value_list']==0)? true : false)) . ' ' .__('TEXT_NO'); ?>
+ </p>
+
+
+ <p class="block_input">
+ <label for="epf_active_for_language" title="<?php echo __('ENTRY_ACTIVE_HELP') ?>"><?php echo __('ENTRY_ACTIVE'). tep_image(DIR_WS_ICONS . 'icon_help.gif'); ?></label>
+ <?php echo tep_draw_radio_field('epf_active_for_language' ,'epf_active_for_language' , '1', (((int)modprodextra::$cInfo['epf_active_for_language']==1)? true : false) ) . ' ' . __('TEXT_YES') .
+ ' ' . tep_draw_radio_field('epf_active_for_language' ,'epf_active_for_language', '0', (((int)modprodextra::$cInfo['epf_active_for_language']==0)? true : false) ) . ' ' . __('TEXT_NO'); ?>
+ </p>
+
+
+
+
+
+ <div class="button_nav">
+ <?php echo tep_image_submit('button_save.gif', __('modprodextra extra label add')) .
+ tep_js_back(tep_href_link(modprodextra::FILENAME, tep_get_all_get_params(array('action','flag','eid')) ), IMAGE_CANCEL) ;
+
+// ' <a class="button" href="' . tep_href_link(FILENAME_CONFIGURATION, tep_get_all_get_params(array('action','flag','eid')) . 'eid=' . modprodextra::$eid) . '">' . IMAGE_CANCEL . "</a>\n" ?>
+ </div>
+ </form>
+
+ </div>
Modified: trunk/catalog/admin/includes/modules/configuration/modprodextra.php
===================================================================
--- trunk/catalog/admin/includes/modules/configuration/modprodextra.php 2012-02-07 09:31:02 UTC (rev 4032)
+++ trunk/catalog/admin/includes/modules/configuration/modprodextra.php 2012-02-07 10:28:55 UTC (rev 4033)
@@ -1,10 +1,10 @@
<?php
/**
- @licence GPL 2005-2011 The osCSS developers - osCSS Open Source E-commerce
+ @licence GPL 2005-2012 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 24/10/11, 15:38
+ @date 08/02/2012, 15:38
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
@class modprodextra
@@ -76,213 +76,158 @@
$messages = array();
$error = false;
switch ($action) {
- case 'insert': // validate form
+ case 'insert':
- try{
- if (!isset($_POST['status'])) throw new Exception(ERROR_ENTRY_REQUIRED . ENTRY_ACTIVATE_NOW);
- $status = ($_POST['status'] == '0') ? 0 : 1;
- $order = (isset($_POST['sort_order'])) ? tep_db_prepare_input($_POST['sort_order']) : 0;
- $epf_admin = (isset($_POST['epf_admin'])) ? tep_db_prepare_input($_POST['epf_admin']) : 0;
- $epf_special_mod = (isset($_POST['epf_special_mod'])) ? tep_db_prepare_input($_POST['epf_special_mod']) : '';
+ try{
+ if (!isset($_POST['value_list']))
+ throw new Exception(ERROR_ENTRY_REQUIRED . ENTRY_VALUE_LIST);
+ $value_list = ($_POST['value_list'] == '0') ? 0 : 1;
- if (!isset($_POST['search'])) throw new Exception(ERROR_ENTRY_REQUIRED . ENTRY_SEARCH);
- $search = ($_POST['search'] == '0') ? 0 : 1;
+ $lactive = ($_POST['epf_active_for_language'] == '0') ? 0 : 1;
+ }
+ catch(Exception $e){
+ $messageStack->add($e->getMessage(), 'error');
+ $error=true;
+ }
- if (!isset($_POST['listing'])) throw new Exception(ERROR_ENTRY_REQUIRED . ENTRY_LISTING);
- $listing = ($_POST['listing'] == '0') ? 0 : 1;
- if (!isset($_POST['meta'])) throw new Exception(ERROR_ENTRY_REQUIRED . ENTRY_META);
- $meta = ($_POST['meta'] == '0') ? 0 : 1;
+ $data_array = array(
+ 'epf_order' =>0,
+ 'epf_status' => 0,
+ 'epf_uses_value_list' => $value_list,
+ 'epf_advanced_search' => 0,
+ 'epf_show_in_listing' => 0,
+ 'epf_size' => 64,
+ 'epf_use_as_meta_keyword' => 0,
+ 'epf_use_to_restrict_listings' => 0,
+ 'epf_show_parent_chain' => 0,
+ 'epf_key' => '',
+ 'epf_admin' => 0,
+ 'epf_special_mod' => '');
- if (!isset($_POST['value_list'])) throw new Exception(ERROR_ENTRY_REQUIRED . ENTRY_VALUE_LIST);
- $value_list = ($_POST['value_list'] == '0') ? 0 : 1;
- if (!isset($_POST['size'])) throw new Exception(ERROR_ENTRY_REQUIRED . TEXT_SIZE);
- $size = ($_POST['size'] == '0') ? 0 : (int)$_POST['size'];
+ $resobj=tep_db_perform(TABLE_PRODUCTS_EXTRA_FIELDS, $data_array);
- if ($value_list === 0) { // size required only if not using value list
- if (!isset($_POST['size'])) throw new Exception(ERROR_ENTRY_REQUIRED . TEXT_SIZE);
- $size = tep_db_prepare_input($_POST['size']);
- if (!is_numeric($size) || ($size < 1) || ($size > 255)) throw new Exception(ERROR_ENTRY_REQUIRED . ERROR_OUTOFRANGE);
- }
- if ($value_list == 1) {
- $size = 64;
- if (!isset($_POST['chain']))throw new Exception(ERROR_ENTRY_REQUIRED . TEXT_SHOW_PARENTS);
- $chain = ($_POST['chain'] == '0') ? 0 : 1;
- if (!isset($_POST['restrict'])) throw new Exception(ERROR_ENTRY_REQUIRED . TEXT_RESTRICTS);
- $restrict = ($_POST['restrict'] == '0') ? 0 : 1;
- } else { // parent chain and restrict listing are never active if not using value list
- $chain = 0;
- $restrict = 0;
- }
+ self::$eid = tep_db_insert_id($resobj);
- $labels = array();
- $active = false;
- if (!isset($_POST['epf_active_for_language'])) throw new Exception(ERROR_ENTRY_REQUIRED . ENTRY_ACTIVE );
- $lactive = ($_POST['epf_active_for_language'] == '0') ? 0 : 1;
+ tep_redirect(tep_href_link(self::FILENAME,FILENAME_CFG_34.'&action=edit&eid=' . self::$eid));
- for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
- $lbl = (isset($_POST['label_' . $languages[$i]['id']])) ? tep_db_prepare_input($_POST['label_' . $languages[$i]['id']]) : '';
- if ($lactive && !tep_not_null($lbl)) throw new Exception(ERROR_LABEL, $languages[$i]['name'] );
- if ($lactive) $active = true;
- $labels[$languages[$i]['id']] = array('active' => $lactive, 'label' => $lbl);
- }
- if (!$active) throw new Exception(ERROR_ACTIVE);
+ break;
- $epf_key= (isset($_POST['epf_key'])) ? tep_db_prepare_input($_POST['epf_key']) : md5($_POST['label_'.$language_id]);
- }
- catch(Exception $e){
- $messageStack->add($e->getMessage(), 'error');
- $error=true;
- }
+ case 'update': // validate form
+ $query = tep_db_query("select epf_size, epf_uses_value_list from " . TABLE_PRODUCTS_EXTRA_FIELDS . " where epf_id = " . (int)self::$eid);
+ $field_info = tep_db_fetch_array($query); // retrieve original field information
- $this->field=$data_array = array('epf_order' => (int)$order,
- 'epf_status' => $status,
- 'epf_uses_value_list' => $value_list,
- 'epf_advanced_search' => $search,
- 'epf_show_in_listing' => $listing,
- 'epf_size' => $size,
- 'epf_use_as_meta_keyword' => $meta,
- 'epf_use_to_restrict_listings' => $restrict,
- 'epf_show_parent_chain' => $chain,
- 'epf_key' => $epf_key,
- 'epf_admin' => $epf_admin,
- 'epf_special_mod' => $epf_special_mod);
+ try{
+ if (!isset($_POST['status'])) throw new Exception(ERROR_ENTRY_REQUIRED . ENTRY_ACTIVATE_NOW);
+ $status = ($_POST['status'] == '0') ? 0 : 1;
+ $order = (isset($_POST['sort_order'])) ? tep_db_prepare_input($_POST['sort_order']) : 0;
+ $epf_admin = (isset($_POST['epf_admin'])) ? tep_db_prepare_input($_POST['epf_admin']) : 0;
+ $epf_special_mod = (isset($_POST['epf_special_mod'])) ? tep_db_prepare_input($_POST['epf_special_mod']) : '';
- if ($error) { // if error return to entry form
- $action = 'new';
- for ($i=0, $n=sizeof($languages); $i<$n; $i++){
- $this->epf_label=$labels;
- }
- } else { // otherwise create field
+ if (!isset($_POST['search'])) throw new Exception(ERROR_ENTRY_REQUIRED . ENTRY_SEARCH);
+ $search = ($_POST['search'] == '0') ? 0 : 1;
- $resobj=tep_db_perform(TABLE_PRODUCTS_EXTRA_FIELDS, $data_array);
- self::$eid = tep_db_insert_id($resobj);
- $field = 'extra_value' . ($value_list ? '_id' : '') . self::$eid;
- tep_db_query('alter table ' . TABLE_PRODUCTS_DESCRIPTION . ' add ' . $field . ($value_list ? ' int unsigned not null default 0' : ' varchar(' . (int)$size . ') default null'));
- foreach ($labels as $lid => $value) {
- $label_array = array('epf_id' => self::$eid,
- 'languages_id' => $lid,
- 'epf_label' => ($value['active'] ? $value['label'] : ''),
- 'epf_active_for_language' => $value['active']);
- tep_db_perform(TABLE_PRODUCTS_EXTRA_FIELDS_LABELS, $label_array);
- }
- tep_redirect(tep_href_link(FILENAME_CONFIGURATION, tep_get_all_get_params(array('action','eid','confirm'),false).'eid=' . self::$eid));
- }
- break;
+ if (!isset($_POST['listing'])) throw new Exception(ERROR_ENTRY_REQUIRED . ENTRY_LISTING);
+ $listing = ($_POST['listing'] == '0') ? 0 : 1;
- case 'update': // validate form
- $query = tep_db_query("select epf_size, epf_uses_value_list from " . TABLE_PRODUCTS_EXTRA_FIELDS . " where epf_id = " . (int)self::$eid);
- $field_info = tep_db_fetch_array($query); // retrieve original field information
+ if (!isset($_POST['meta'])) throw new Exception(ERROR_ENTRY_REQUIRED . ENTRY_META);
+ $meta = ($_POST['meta'] == '0') ? 0 : 1;
- try{
- if (!isset($_POST['status'])) throw new Exception(ERROR_ENTRY_REQUIRED . ENTRY_ACTIVATE_NOW);
- $status = ($_POST['status'] == '0') ? 0 : 1;
- $order = (isset($_POST['sort_order'])) ? tep_db_prepare_input($_POST['sort_order']) : 0;
- $epf_admin = (isset($_POST['epf_admin'])) ? tep_db_prepare_input($_POST['epf_admin']) : 0;
- $epf_special_mod = (isset($_POST['epf_special_mod'])) ? tep_db_prepare_input($_POST['epf_special_mod']) : '';
+ if (!isset($_POST['size'])) throw new Exception(ERROR_ENTRY_REQUIRED . TEXT_SIZE);
+ $size = ($_POST['size'] == '0') ? 0 : (int)$_POST['size'];
- if (!isset($_POST['search'])) throw new Exception(ERROR_ENTRY_REQUIRED . ENTRY_SEARCH);
- $search = ($_POST['search'] == '0') ? 0 : 1;
+ $uses_list = $field_info['epf_uses_value_list'];
+ if ($uses_list === 0) { // size required only if not using value list
+ if (!isset($_POST['size'])) throw new Exception(ERROR_ENTRY_REQUIRED . TEXT_SIZE);
+ $size = tep_db_prepare_input($_POST['size']);
+ if (!is_numeric($size) || ($size < 1) || ($size > 255)) throw new Exception(ERROR_ENTRY_REQUIRED . ERROR_OUTOFRANGE);
+ }
+ if ($uses_list == 1) {
+ $size = 64;
+ if (!isset($_POST['chain']))throw new Exception(ERROR_ENTRY_REQUIRED . TEXT_SHOW_PARENTS);
+ $chain = ($_POST['chain'] == '0') ? 0 : 1;
+ if (!isset($_POST['restrict'])) throw new Exception(ERROR_ENTRY_REQUIRED . TEXT_RESTRICTS);
+ $restrict = ($_POST['restrict'] == '0') ? 0 : 1;
+ } else { // parent chain and restrict listing are never active if not using value list
+ $chain = 0;
+ $restrict = 0;
+ }
- if (!isset($_POST['listing'])) throw new Exception(ERROR_ENTRY_REQUIRED . ENTRY_LISTING);
- $listing = ($_POST['listing'] == '0') ? 0 : 1;
+// if (!isset($_POST['epf_active_for_language'])) throw new Exception(ERROR_ENTRY_REQUIRED . ENTRY_ACTIVE );
+ $lactive = (!isset($_POST['epf_active_for_language'])) ? 0 : 1;
- if (!isset($_POST['meta'])) throw new Exception(ERROR_ENTRY_REQUIRED . ENTRY_META);
- $meta = ($_POST['meta'] == '0') ? 0 : 1;
+ $labels = array();
+ $active = false;
+ for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
+ $lbl = (isset($_POST['label_' . $languages[$i]['id']])) ? tep_db_prepare_input($_POST['label_' . $languages[$i]['id']]) : '';
+// if ($lactive && !tep_not_null($lbl)) throw new Exception(ERROR_LABEL, $languages[$i]['name'] );
- if (!isset($_POST['size'])) throw new Exception(ERROR_ENTRY_REQUIRED . TEXT_SIZE);
- $size = ($_POST['size'] == '0') ? 0 : (int)$_POST['size'];
+// if ($lactive) $active = true;
+ $labels[$languages[$i]['id']] = array('active' => $lactive, 'label' => $lbl);
+ }
+ // if no active languages
+ $epf_key= (isset($_POST['epf_key'])) ? tep_db_prepare_input($_POST['epf_key']) : md5($_POST['label_'.$language_id]);
+ }
+ catch(Exception $e){
+ $messageStack->add_session($e->getMessage(), 'error');
+ $error=true;
+ }
- $uses_list = $field_info['epf_uses_value_list'];
- if ($uses_list === 0) { // size required only if not using value list
- if (!isset($_POST['size'])) throw new Exception(ERROR_ENTRY_REQUIRED . TEXT_SIZE);
- $size = tep_db_prepare_input($_POST['size']);
- if (!is_numeric($size) || ($size < 1) || ($size > 255)) throw new Exception(ERROR_ENTRY_REQUIRED . ERROR_OUTOFRANGE);
- }
- if ($uses_list == 1) {
- $size = 64;
- if (!isset($_POST['chain']))throw new Exception(ERROR_ENTRY_REQUIRED . TEXT_SHOW_PARENTS);
- $chain = ($_POST['chain'] == '0') ? 0 : 1;
- if (!isset($_POST['restrict'])) throw new Exception(ERROR_ENTRY_REQUIRED . TEXT_RESTRICTS);
- $restrict = ($_POST['restrict'] == '0') ? 0 : 1;
- } else { // parent chain and restrict listing are never active if not using value list
- $chain = 0;
- $restrict = 0;
- }
+ if ($error)
+ tep_redirect(tep_href_link(self::FILENAME,FILENAME_CFG_34.'&erreor=&action=edit&eid=' . self::$eid));
- if (!isset($_POST['epf_active_for_language'])) throw new Exception(ERROR_ENTRY_REQUIRED . ENTRY_ACTIVE );
- $lactive = ($_POST['epf_active_for_language'] == '0') ? 0 : 1;
+// if ($error) { // if error return to entry form
+// $action = 'edit';
+// } else { // otherwise update field
+ $field = 'extra_value' . ($uses_list ? '_id' : '') . (int)self::$eid;
+ if (($size < $field_info['epf_size'])) {
+ $check_query = tep_db_query("select count(products_id) as total, max(length(" . $field . ")) as maxlen from " . TABLE_PRODUCTS_DESCRIPTION . " where length(" . $field . ") > " . (int)$size);
+ $check = tep_db_fetch_array($check_query);
+ if ($check['total'] > 1) { // check to see if reducing size will truncate data
+ $confirmation_needed = true;
+ $messageStack->add(WARNING_TRUNCATE, $check['total'].$check['maxlen'],'error');
+ }
+ }
+ $label_query = tep_db_query("select * from " . TABLE_PRODUCTS_EXTRA_FIELDS_LABELS . " where epf_id=" . (int)self::$eid);
- $labels = array();
- $active = false;
- for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
- $lbl = (isset($_POST['label_' . $languages[$i]['id']])) ? tep_db_prepare_input($_POST['label_' . $languages[$i]['id']]) : '';
- if ($lactive && !tep_not_null($lbl)) throw new Exception(ERROR_LABEL, $languages[$i]['name'] );
- if ($lactive) $active = true;
- $labels[$languages[$i]['id']] = array('active' => $lactive, 'label' => $lbl);
- }
- // if no active languages
- $epf_key= (isset($_POST['epf_key'])) ? tep_db_prepare_input($_POST['epf_key']) : md5($_POST['label_'.$language_id]);
- }
- catch(Exception $e){
- $messageStack->add($e->getMessage(), 'error');
- $error=true;
- }
- if ($error) { // if error return to entry form
- $action = 'edit';
- } else { // otherwise update field
- $field = 'extra_value' . ($uses_list ? '_id' : '') . (int)self::$eid;
- if (($size < $field_info['epf_size'])) {
- $check_query = tep_db_query("select count(products_id) as total, max(length(" . $field . ")) as maxlen from " . TABLE_PRODUCTS_DESCRIPTION . " where length(" . $field . ") > " . (int)$size);
- $check = tep_db_fetch_array($check_query);
- if ($check['total'] > 1) { // check to see if reducing size will truncate data
- $confirmation_needed = true;
- $messageStack->add(WARNING_TRUNCATE, $check['total'].$check['maxlen'],'error');
- }
- }
- $label_query = tep_db_query("select * from " . TABLE_PRODUCTS_EXTRA_FIELDS_LABELS . " where epf_id=" . (int)self::$eid);
- while ($label_info = tep_db_fetch_array($label_query)) {
-// print_r($label_info);
- if ($label_info['epf_active_for_language'] > $labels[$label_info['languages_id']]['active']) { // if language being deactivated
- $check_query = tep_db_query("select count(products_id) as total from " . TABLE_PRODUCTS_DESCRIPTION . " where language_id = " . (int)$label_info['languages_id'] . " and " . ($uses_list ? $field . " > 0" : "length(" . $field . ") > 0"));
- $check = tep_db_fetch_array($check_query);
- if ($check['total'] > 0) { // check to see if language is used
- $confirmation_needed = true;
- $messageStack->add(WARNING_LANGUAGE_IN_USE, $check['total']. $lang[$label_info['languages_id']]['name'],'error');
- }
- }
- }
+ $data_array = array('epf_order' => (int)$order,
+ 'epf_status' => $status,
+ 'epf_advanced_search' => $search,
+ 'epf_show_in_listing' => $listing,
+ 'epf_size' => $size,
+ 'epf_use_as_meta_keyword' => $meta,
+ 'epf_use_to_restrict_listings' => $restrict,
+ 'epf_show_parent_chain' => $chain,
+ 'epf_key' => $epf_key,
+ 'epf_admin' => $epf_admin,
+ 'epf_special_mod' => $epf_special_mod);
+ tep_db_perform(TABLE_PRODUCTS_EXTRA_FIELDS, $data_array, 'update', 'epf_id = ' . (int)self::$eid);
+ if (($uses_list == 0) && ($field_info['epf_size'] != $size)) { // if text field size has changed
+ tep_db_query('alter table ' . TABLE_PRODUCTS_DESCRIPTION . ' change ' . $field . ' ' . $field . ' varchar(' . (int)$size . ') default null');
+ }
- if ((!$confirmation_needed) || ($confirm == 'yes')) { // if confirmation not needed or changes have been confirmed
- $data_array = array('epf_order' => (int)$order,
- 'epf_status' => $status,
- 'epf_advanced_search' => $search,
- 'epf_show_in_listing' => $listing,
- 'epf_size' => $size,
- 'epf_use_as_meta_keyword' => $meta,
- 'epf_use_to_restrict_listings' => $restrict,
- 'epf_show_parent_chain' => $chain,
- 'epf_key' => $epf_key,
- 'epf_admin' => $epf_admin,
- 'epf_special_mod' => $epf_special_mod);
- tep_db_perform(TABLE_PRODUCTS_EXTRA_FIELDS, $data_array, 'update', 'epf_id = ' . (int)self::$eid);
- if (($uses_list == 0) && ($field_info['epf_size'] != $size)) { // if text field size has changed
- tep_db_query('alter table ' . TABLE_PRODUCTS_DESCRIPTION . ' change ' . $field . ' ' . $field . ' varchar(' . (int)$size . ') default null');
- }
- foreach ($labels as $lid => $value) {
- $label_array = array('epf_label' => $value['label'], 'epf_active_for_language' => $value['active']);
- tep_db_perform(TABLE_PRODUCTS_EXTRA_FIELDS_LABELS, $label_array, 'update', '(epf_id = ' . (int)self::$eid . ') and (languages_id = ' . (int)$lid . ')');
- }
- tep_redirect(tep_href_link(FILENAME_CONFIGURATION, tep_get_all_get_params(array('action','eid','confirm'),false). 'eid=' . self::$eid));
+ $DB = Database::getInstance();
- } else { // request confirmation
- $action = 'edit';
- }
- }
+ foreach ($labels as $lid => $value) {
+ $label_array = array('epf_label' => $value['label'], 'epf_active_for_language' => $value['active']);
+
+ $res =$DB->query("SELECT * FROM ".TABLE_PRODUCTS_EXTRA_FIELDS_LABELS." WHERE epf_id = ' ". (int)self::$eid ." ' and languages_id = '" . (int)$lid ." ' ");
+
+ if(! $res->__get('NumRows') ){
+ $label_array['languages_id']=(int)$lid;
+ $label_array['epf_id']=(int)self::$eid;
+ tep_db_perform(TABLE_PRODUCTS_EXTRA_FIELDS_LABELS, $label_array);
+ }
+ else
+ tep_db_perform(TABLE_PRODUCTS_EXTRA_FIELDS_LABELS, $label_array, 'update', 'epf_id = ' . (int)self::$eid . ' and languages_id = ' . (int)$lid . ' ');
+ }
+
+ tep_redirect(tep_href_link(self::FILENAME,FILENAME_CFG_34.'&action=edit&eid=' . self::$eid));
+
break;
case 'delete':
if ($confirm == 'yes') {
@@ -295,56 +240,65 @@
// $field = 'extra_value' . ($field_info['epf_uses_value_list'] ? '_id' : '') . (int)self::$eid;
// tep_db_query('alter table ' . TABLE_PRODUCTS_DESCRIPTION . ' drop ' . $field);
// }
- tep_db_query('delete from ' . TABLE_PRODUCTS_EXTRA_FIELDS . ' where epf_id = ' . (int)self::$eid);
- tep_db_query('delete from ' . TABLE_PRODUCTS_EXTRA_FIELDS_LABELS . ' where epf_id = ' . (int)self::$eid);
- tep_db_query('delete from ' . TABLE_PRODUCTS_EXTRA_FIELDS_VALUES . ' where epf_id = ' . (int)self::$eid);
- tep_db_query('delete from ' . TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS . ' where products_extra_fields_id = ' . (int)self::$eid);
- tep_redirect(tep_href_link(FILENAME_CONFIGURATION, tep_get_all_get_params(array('action','confirm','eid'),false)));
+
+ tep_db_query('delete from ' . TABLE_PRODUCTS_EXTRA_FIELDS_LABELS . ' where epf_id = ' . (int)self::$eid);
+ tep_db_query('delete from ' . TABLE_PRODUCTS_EXTRA_FIELDS_VALUES . ' where epf_id = ' . (int)self::$eid);
+ tep_db_query('delete from ' . TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS . ' where products_extra_fields_id = ' . (int)self::$eid);
+
+ tep_db_query('delete from ' . TABLE_PRODUCTS_EXTRA_FIELDS . ' where epf_id = ' . (int)self::$eid);
+
+ tep_redirect(tep_href_link(FILENAME_CONFIGURATION, tep_get_all_get_params(array('action','confirm','eid'),false)));
}
} else {
self::$double_check = 'no';
}
break;
case 'setflag':
- if(isset($_GET['flag']) ){
- if (!is_numeric($_GET['flag']) || (($_GET['flag'] != 0) && ($_GET['flag'] != 1))) break; // skip if flag not properly set
- tep_db_query('update ' . TABLE_PRODUCTS_EXTRA_FIELDS . ' set epf_status = ' . (int)$_GET['flag'] . ' where epf_id = ' . (int)self::$eid);
- }elseif(isset($_GET['flag_admin']) ){
- if (!is_numeric($_GET['flag_admin']) || (($_GET['flag_admin'] != 0) && ($_GET['flag_admin'] != 1))) break; // skip if flag not properly set
- tep_db_query('update ' . TABLE_PRODUCTS_EXTRA_FIELDS . ' set epf_admin = ' . (int)$_GET['flag_admin'] . ' where epf_id = ' . (int)self::$eid);
- }
- tep_redirect(tep_href_link(FILENAME_CONFIGURATION, tep_get_all_get_params(array('action','flag_spe','flag_admin','flag'),false)));
+ if(isset($_GET['flag']) ){
+ if (!is_numeric($_GET['flag']) || (($_GET['flag'] != 0) && ($_GET['flag'] != 1))) break; // skip if flag not properly set
+ tep_db_query('update ' . TABLE_PRODUCTS_EXTRA_FIELDS . ' set epf_status = ' . (int)$_GET['flag'] . ' where epf_id = ' . (int)self::$eid);
+ }
+ elseif(isset($_GET['flag_admin']) ){
+ if (!is_numeric($_GET['flag_admin']) || (($_GET['flag_admin'] != 0) && ($_GET['flag_admin'] != 1))) break; // skip if flag not properly set
+ tep_db_query('update ' . TABLE_PRODUCTS_EXTRA_FIELDS . ' set epf_admin = ' . (int)$_GET['flag_admin'] . ' where epf_id = ' . (int)self::$eid);
+ }
+ tep_redirect(tep_href_link(FILENAME_CONFIGURATION, tep_get_all_get_params(array('action','flag_spe','flag_admin','flag'),false)));
break;
case 'value_update':
- $languages = tep_get_languages();
- for ($i=0, $n=sizeof($languages); $i<$n; $i++){
- $data_array = array('sort_order' => (int)(isset($_POST['sort_order'][$languages[$i]['id']]) ? tep_db_prepare_input($_POST['sort_order'][$languages[$i]['id']]) : 0),
- 'epf_value' => (isset($_POST['value'][$languages[$i]['id']]) ? tep_db_prepare_input($_POST['value'][$languages[$i]['id']]) : 0),
- 'languages_id'=> $languages[$i]['id']);
- }
+ $languages = tep_get_languages();
+ for ($i=0, $n=sizeof($languages); $i<$n; $i++){
+ $data_array = array('sort_order' => (int)(isset($_POST['sort_order'][$languages[$i]['id']]) ? tep_db_prepare_input($_POST['sort_order'][$languages[$i]['id']]) : 0),
+ 'epf_value' => (isset($_POST['value'][$languages[$i]['id']]) ? tep_db_prepare_input($_POST['value'][$languages[$i]['id']]) : 0),
+ 'languages_id'=> $languages[$i]['id']);
+ }
- tep_db_perform(TABLE_PRODUCTS_EXTRA_FIELDS_VALUES, $data_array, 'update',"value_id = '" . (int)$_GET['vid']."' and epf_id='".self::$eid."' ");
- tep_redirect(tep_href_link(FILENAME_CONFIGURATION, FILENAME_CFG_34 . 'eid=' . self::$eid.'&action=value_listing'));
- break;
- case 'value_insert':
+ tep_db_perform(TABLE_PRODUCTS_EXTRA_FIELDS_VALUES, $data_array, 'update',"value_id = '" . (int)$_GET['vid']."' and epf_id='".self::$eid."' ");
+ tep_redirect(tep_href_link(FILENAME_CONFIGURATION, FILENAME_CFG_34 . 'eid=' . self::$eid.'&action=value_listing'));
+ break;
- $languages = tep_get_languages();
- for ($i=0, $n=sizeof($languages); $i<$n; $i++){
- $data_array = array('sort_order' => (int)(isset($_POST['sort_order'][$languages[$i]['id']]) ? tep_db_prepare_input($_POST['sort_order'][$languages[$i]['id']]) : 0),
- 'epf_value' => (isset($_POST['value'][$languages[$i]['id']]) ? tep_db_prepare_input($_POST['value'][$languages[$i]['id']]) : 0),
- 'languages_id'=> $languages[$i]['id'],
- 'epf_id' => (int)self::$eid,
- 'parent_id' => (int)0,
- );
- }
- tep_db_perform(TABLE_PRODUCTS_EXTRA_FIELDS_VALUES, $data_array);
+ /**
+ @brief insertion d'une valeur dans la liste des valeur disponible (champs fermé)
+ */
+ case 'value_insert':
- tep_redirect(tep_href_link(FILENAME_CONFIGURATION, FILENAME_CFG_34 . 'eid=' . self::$eid.'&action=value_listing'));
+ $languages = tep_get_languages();
+ for ($i=0, $n=sizeof($languages); $i<$n; $i++){
+ $data_array = array(
+ 'sort_order' => (int)(isset($_POST['sort_order'][$languages[$i]['id']]) ? tep_db_prepare_input($_POST['sort_order'][$languages[$i]['id']]) : 0),
+ 'epf_value' => (isset($_POST['value'][$languages[$i]['id']]) ? tep_db_prepare_input($_POST['value'][$languages[$i]['id']]) : 0),
+ 'languages_id'=> $languages[$i]['id'],
+ 'epf_id' => (int)self::$eid,
+ 'parent_id' => (int)0,
+ );
+ $r=tep_db_perform(TABLE_PRODUCTS_EXTRA_FIELDS_VALUES, $data_array);
+ }
+
+ tep_redirect(tep_href_link(FILENAME_CONFIGURATION, FILENAME_CFG_34 . 'eid=' . self::$eid.'&action=value_listing'));
break;
case 'value_delete':
if ($confirm == 'yes') {
@@ -364,14 +318,14 @@
case 'value_edit':
- $list_id = (isset($_GET['list_id']) ? $_GET['list_id'] : '_');
- list($eid, $lid) = explode('_', $list_id);
- $vid = (isset($_GET['vid']) ? $_GET['vid'] : '');
- $confirm = (isset($_GET['confirm']) ? $_GET['confirm'] : '');
+ $list_id = (isset($_GET['list_id']) ? $_GET['list_id'] : '_');
+ list($eid, $lid) = explode('_', $list_id);
+ $vid = (isset($_GET['vid']) ? $_GET['vid'] : '');
+ $confirm = (isset($_GET['confirm']) ? $_GET['confirm'] : '');
-// $check_query = tep_db_query("select count(products_id) as total from " . TABLE_PRODUCTS_DESCRIPTION . " where extra_value_id" . (int)$eid . " = " . (int)$vid);
-// $check = tep_db_fetch_array($check_query);
-// if ($check['total'] > 0) $messageStack->add(WARNING_VALUE_USED. $check['total'],'error');
+ // $check_query = tep_db_query("select count(products_id) as total from " . TABLE_PRODUCTS_DESCRIPTION . " where extra_value_id" . (int)$eid . " = " . (int)$vid);
+ // $check = tep_db_fetch_array($check_query);
+ // if ($check['total'] > 0) $messageStack->add(WARNING_VALUE_USED. $check['total'],'error');
break;
default:
@@ -384,21 +338,18 @@
public function load_db_values(){
global $action,$languages_id,$messageStack;
+
switch($action){
case 'value_listing':
- /**
- Delete d'un label
- @author oscim <mail os...@os...> <www http://www.oscim.fr>
- */
global $list, $languages,$action ;
- $eid=self::$eid;
- $lid=$languages;
+ $eid=self::$eid;
+ $lid=$languages;
$query = tep_db_fetch_array(tep_db_query($sql="select epf_label from " . TABLE_PRODUCTS_EXTRA_FIELDS_LABELS . " where epf_id = " . (int)$eid . " and languages_id = " . (int)$lid));
- // var_dump($query) ;
+
$current_label = $query['epf_label'];
if ($current_label == '') { // if invalid label get first matching label and use that information
$query = tep_db_fetch_array(tep_db_query("select l.epf_label, l.languages_id, l.epf_id from " . TABLE_PRODUCTS_EXTRA_FIELDS_LABELS . " l join " . TABLE_PRODUCTS_EXTRA_FIELDS . " e where e.epf_id = l.epf_id and l.epf_active_for_language and e.epf_uses_value_list order by e.epf_order"));
@@ -412,8 +363,7 @@
$list[] = $this->build_value_list($eid, $lid);
$selected = array();
- // var_dump($list) ;
- // }
+
return $list;
break;
case 'value_new':
@@ -540,37 +490,37 @@
switch($action){
case 'value_listing':
- self::$list= $this->load_db_values();
- $gab = 'value.listing';
+ self::$list= $this->load_db_values();
+ $gab = 'value.listing';
break;
case 'value_new':
case 'value_edit':
- self::$cInfo=$this->load_db_values();
- $gab = 'value.edit';
+ self::$cInfo=$this->load_db_values();
+ $gab = 'value.edit';
break;
case 'new':
case 'edit':
- global $list, $languages,$action;
- $this->load_db_values();
+ global $list, $languages,$action;
+ $this->load_db_values();
- self::$cInfo=$this->field;
- self::$pInfo = $this->epf_label;
- $gab = 'label.edit';
+ self::$cInfo=$this->field;
+ self::$pInfo = $this->epf_label;
+ $gab = 'label.'.$action;
break;
case 'delete':
- self::load_for_delete();
- $gab = 'delete';
+ self::load_for_delete();
+ $gab = 'delete';
break;
default:
- self::$list=$this->load_db_values();
- self::$selected_labels=array();
- $languages = tep_get_languages();
- $gab = 'listing';
+ self::$list=$this->load_db_values();
+ self::$selected_labels=array();
+ $languages = tep_get_languages();
+ $gab = 'listing';
}
/// use master gabarit
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2012-02-07 09:31:12
|
Revision: 4032
http://oscss.svn.sourceforge.net/oscss/?rev=4032&view=rev
Author: oscim
Date: 2012-02-07 09:31:02 +0000 (Tue, 07 Feb 2012)
Log Message:
-----------
coquille
Modified Paths:
--------------
trunk/catalog/includes/modules/account/history.php
Modified: trunk/catalog/includes/modules/account/history.php
===================================================================
--- trunk/catalog/includes/modules/account/history.php 2012-02-04 14:28:19 UTC (rev 4031)
+++ trunk/catalog/includes/modules/account/history.php 2012-02-07 09:31:02 UTC (rev 4032)
@@ -109,6 +109,7 @@
@remarks Adjust link pdf if Exist. Use config process
Link exist if file pdf exists.
*/
+ $datadocs=new DatasFiles;
if(( $filepath=$datadocs->GetDoc('packingslip',(int)$row['orders_id'])) && file_exists($filepath))
$n->linkPdf = tep_href_link(FILENAME_ACCOUNT, 'action=pdf&order_id=' . (int)$row['orders_id'], 'SSL');
else
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2012-02-04 14:28:25
|
Revision: 4031
http://oscss.svn.sourceforge.net/oscss/?rev=4031&view=rev
Author: oscim
Date: 2012-02-04 14:28:19 +0000 (Sat, 04 Feb 2012)
Log Message:
-----------
mise a jour core.xml
Modified Paths:
--------------
trunk/catalog/Documents/oscss.version.xml
Modified: trunk/catalog/Documents/oscss.version.xml
===================================================================
--- trunk/catalog/Documents/oscss.version.xml 2012-02-04 14:27:17 UTC (rev 4030)
+++ trunk/catalog/Documents/oscss.version.xml 2012-02-04 14:28:19 UTC (rev 4031)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<core>
<version>2.1.1 (beta)</version>
- <svn>4020</svn>
+ <svn>4031</svn>
<level>unstable</level>
<template_admin>oscss</template_admin>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2012-02-04 14:27:23
|
Revision: 4030
http://oscss.svn.sourceforge.net/oscss/?rev=4030&view=rev
Author: oscim
Date: 2012-02-04 14:27:17 +0000 (Sat, 04 Feb 2012)
Log Message:
-----------
correction coquille
Modified Paths:
--------------
trunk/catalog/admin/includes/modules/pages/products.php
trunk/catalog/install/includes/sql/mysql/tables/osc_configuration_group.sql
Modified: trunk/catalog/admin/includes/modules/pages/products.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/products.php 2012-02-03 20:24:11 UTC (rev 4029)
+++ trunk/catalog/admin/includes/modules/pages/products.php 2012-02-04 14:27:17 UTC (rev 4030)
@@ -4,7 +4,7 @@
@portion code Copyright (c) 2002 osCommerce
@package osCSS-2 <www http://www.oscss.org>
@version 2.1.1
- @date 01/01/12, 09:44
+ @date 04/02/12, 09:44
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
*/
@@ -529,12 +529,12 @@
$sWhere=str_replace(array('products_id'),array('p.products_id'), $sWhere);
if(strpos($sWhere, 'categories_name') >0 ) {
- $add_tbl=" , " . TABLE_CATEGORIES_DESCRIPTION . " cd ";
- $sWhere .=" AND cd.categories_id=p2c.categories_id ";
+ $add_tbl=" , " . TABLE_CATEGORIES_DESCRIPTION . " cd ";
+ $sWhere .=" AND cd.categories_id=p2c.categories_id ";
}
}
- $products_query = "select distinct p.products_id, p.products_image, p.products_type as typeID , p.products_model,pd.products_name, p.products_quantity, p.products_price, p.products_status from " . TABLE_PRODUCTS . " p LEFT JOIN ".TABLE_STATUS." s on(p.products_type = s.status_id and s.status_type='products_virtual_types' and s.language_id='" . (int)$languages_id . "') , " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c ".$add_tbl." where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id ".$cat." ".$avenir." ".$sta." ".$sWhere." order by ".((!empty($sOrder)) ? $sOrder : 'pd.products_name ASC');
+ $products_query = "select distinct p.products_id, p.products_image, p.products_type as typeID , p.products_model,pd.products_name, p.products_quantity, p.products_price, p.products_status from " . TABLE_PRODUCTS . " p LEFT JOIN ".TABLE_STATUS." s on(p.products_type = s.status_id and s.status_type='products_virtual_types' and s.language_id='" . (int)$languages_id . "') , " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c LEFT JOIN " . TABLE_CATEGORIES_DESCRIPTION . " cd ON(cd.categories_id = p2c.categories_id AND cd.language_id = '" . (int)$languages_id . "') ".$add_tbl." where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id ".$cat." ".$avenir." ".$sta." ".$sWhere." order by ".((!empty($sOrder)) ? $sOrder : 'pd.products_name ASC');
$query_numrows= tep_db_num_rows($DB->query($products_query));
@@ -555,7 +555,7 @@
$products['categories_name']='';
foreach($res as $cat)
- $products['categories_name'] .=$cat['categories_name'].',';
+ $products['categories_name'] .=$cat['categories_name'].',';
if(strlen($products['categories_name'])>25)$products['categories_name']= substr($products['categories_name'],0 ,20).'...';
Modified: trunk/catalog/install/includes/sql/mysql/tables/osc_configuration_group.sql
===================================================================
--- trunk/catalog/install/includes/sql/mysql/tables/osc_configuration_group.sql 2012-02-03 20:24:11 UTC (rev 4029)
+++ trunk/catalog/install/includes/sql/mysql/tables/osc_configuration_group.sql 2012-02-04 14:27:17 UTC (rev 4030)
@@ -22,7 +22,7 @@
configuration_group_parentid tinyint(1) NOT NULL,
configuration_group_group_id varchar(64) NOT NULL,
configuration_group_key varchar(64) not null ,
- PRIMARY KEY (configuration_group_id)
+ PRIMARY KEY (configuration_group_id),
UNIQUE KEY configuration_group_key (configuration_group_key)
) DEFAULT CHARSET=utf8;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2012-02-03 20:24:17
|
Revision: 4029
http://oscss.svn.sourceforge.net/oscss/?rev=4029&view=rev
Author: oscim
Date: 2012-02-03 20:24:11 +0000 (Fri, 03 Feb 2012)
Log Message:
-----------
correction coquille lors de l'insertion d'un nouvel article
correction driver poru le renvoi de l'id lors de l'appel au function create/update
Modified Paths:
--------------
trunk/catalog/admin/includes/classes/drivers/sqlcontent.php
trunk/catalog/admin/includes/modules/pages/cms_content.php
Modified: trunk/catalog/admin/includes/classes/drivers/sqlcontent.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlcontent.php 2012-02-01 16:33:30 UTC (rev 4028)
+++ trunk/catalog/admin/includes/classes/drivers/sqlcontent.php 2012-02-03 20:24:11 UTC (rev 4029)
@@ -1,10 +1,10 @@
<?php if (!defined('HTTP_SERVER')) die('You can not access this file directly!');
/**
- @licence GPL 2005-2011 The osCSS developers - osCSS Open Source E-commerce
+ @licence GPL 2005-2012 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 17/12/11, 20:11
+ @date 02/02/2012, 20:11
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
@class sqlcontent
@@ -29,7 +29,7 @@
}
- /**
+ /**
@brief create new ligne in table configuration
@param $option array
language_id = > int $languages_id
@@ -50,7 +50,7 @@
self::getInstance();
$DB=Database::getInstance();
- if( !isset($option['id'])) return 'id';
+// if( !isset($option['id'])) return 'id';
$list_languages=tep_get_languages();
$where ='';
@@ -63,7 +63,7 @@
// if(isset($option['action'])) $action=$option['action'];
- if(! self::fetch($option))
+ if(!self::fetch($option))
$action = 'insert';
else
$action = 'update';
@@ -77,8 +77,6 @@
$sql_data_array = $option['sqlarray'];
-
-
if ($action == 'insert') {
$insert_sql_data = array('date_added' => 'now()');
$sql_data_array = array_merge($sql_data_array, $insert_sql_data);
@@ -104,6 +102,8 @@
}
+// var_dump($content_id);
+
/// Clean link posts to categorie and save new link
if(isset($option['cPath']) && count($post['categories']) == 0)
$post['categories'][] = $option['cPath'];
@@ -120,30 +120,31 @@
if ($action == 'insert') {
- $insert_sql_data = array(
- 'content_id' => $content_id,
- 'language_id' => $language_id
- );
+ $insert_sql_data = array(
+ 'content_id' => $content_id,
+ 'language_id' => $language_id
+ );
- $sql_data_array = array_merge($sql_data_array, $insert_sql_data);
+ $sql_data_array = array_merge($sql_data_array, $insert_sql_data);
- $sql_data_array = array_merge($sql_data_array, self::$modules->get_insert_table_content_description ($language_id));
+ $sql_data_array = array_merge($sql_data_array, self::$modules->get_insert_table_content_description ($language_id));
- tep_db_perform(TABLE_CONTENT_DESCRIPTION, $sql_data_array);
+ tep_db_perform(TABLE_CONTENT_DESCRIPTION, $sql_data_array);
} elseif ($action == 'update') {
- $sql_data_array = array_merge($sql_data_array, self::$modules->get_update_table_content_description ($language_id));
+ $sql_data_array = array_merge($sql_data_array, self::$modules->get_update_table_content_description ($language_id));
- tep_db_perform(TABLE_CONTENT_DESCRIPTION, $sql_data_array, 'update', "content_id = '" . (int)$content_id . "' and language_id = '" . (int)$language_id . "'");
+ tep_db_perform(TABLE_CONTENT_DESCRIPTION, $sql_data_array, 'update', "content_id = '" . (int)$content_id . "' and language_id = '" . (int)$language_id . "'");
}
}
self::$modules->after_update ($content_id);
-
- return 1;
+// var_dump($content_id);
+ return $content_id;
}
+
/**
@brief load ligne in table configuration
@param option array
@@ -186,18 +187,19 @@
// $sql .="AND pd.language_id = '".(int)tep_db_input($option['language_id'])."' ";
// }
-// if(isset($option['catid'])){
-// $languages_id = (int)$option['catid'];
-// $sql .="AND c2c.categories_id = '".(int)tep_db_input($option['catid'])."' ";
-// }
+ if(isset($option['catid'])){
+ $languages_id = (int)$option['catid'];
+ $sql .="AND c2c.categories_id = '".(int)tep_db_input($option['catid'])."' ";
+ }
$sql =substr($sql,3);
+ if(strlen($sql)<4)
+ return false;
+ $res = $DB->query($sql="select c.content_id, content_name, date_added, last_modified, content_status from " . TABLE_CONTENT . " c LEFT JOIN " . TABLE_CONTENT_TO_CATEGORIES . " c2c on(c.content_id=c2c.content_id) WHERE ".$sql);
- $res = $DB->query($sql="select c.content_id, content_name, date_added, last_modified, content_status from " . TABLE_CONTENT . " c WHERE ".$sql);
-
$num = $res->__get('numRows');
if($num == 1)
Modified: trunk/catalog/admin/includes/modules/pages/cms_content.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/cms_content.php 2012-02-01 16:33:30 UTC (rev 4028)
+++ trunk/catalog/admin/includes/modules/pages/cms_content.php 2012-02-03 20:24:11 UTC (rev 4029)
@@ -1,10 +1,10 @@
<?php if (!defined('HTTP_SERVER')) die('You can not access this file directly!');
/**
- @licence GPL 2005-2011 The osCSS developers - osCSS Open Source E-commerce
+ @licence GPL 2005-2012 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/12/11, 09:40
+ @date 02/02/2012, 09:40
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
@brief multiple class for content
@@ -113,7 +113,7 @@
$actions = self::$modules->check_action($actions);
$action = $actions['action'];
- if(((self::$action == 'update')||(self::$action == 'insert'))&&(isset($_POST['edit_x'])||isset($_POST['edit_y']))) self::$action = 'edit';
+// if(((self::$action == 'update')||(self::$action == 'insert'))) self::$action = 'edit';
switch (self::$action) {
/**
@@ -142,20 +142,25 @@
case 'insert':
case 'update':
- if (isset($_GET['cID'])) $content_id = tep_db_prepare_input($_GET['cID']);
+ if (isset($_GET['cID']) && (int)$_GET['cID']>0)
+ $content_id = tep_db_prepare_input($_GET['cID']);
$params['sqlarray'] = array('content_name' => tep_db_prepare_input($_POST['content_name']),
'content_status' => tep_db_prepare_input($_POST['content_status']),
);
+ if (isset($content_id))
+ $params['id']=$content_id;
- $params['id']=$content_id;
$params['action']=self::$action;
$params['post']=$_POST;
$params['language_id']= $languages_id;
$params['cPath']=(isset($_POST['cPath'])) ? tep_db_prepare_input($_POST['cPath']) : 0;
- sqlcontent::update($params);
+ if (isset($content_id))
+ sqlcontent::update($params);
+ else
+ $content_id=sqlcontent::create($params);
if(isset($_POST['up_and_close']) ) tep_redirect(tep_href_link(self::FILENAME, tep_get_all_get_params(array( 'cID','flag','action'),false)) );
else tep_redirect(tep_href_link(self::FILENAME, 'page=' . $_GET['page'] . '&cID=' . $content_id.'&action=edit'));
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2012-02-01 16:33:41
|
Revision: 4028
http://oscss.svn.sourceforge.net/oscss/?rev=4028&view=rev
Author: oscim
Date: 2012-02-01 16:33:30 +0000 (Wed, 01 Feb 2012)
Log Message:
-----------
coquille
Modified Paths:
--------------
trunk/catalog/includes/classes/shopping_cart_action.php
Modified: trunk/catalog/includes/classes/shopping_cart_action.php
===================================================================
--- trunk/catalog/includes/classes/shopping_cart_action.php 2012-02-01 14:57:36 UTC (rev 4027)
+++ trunk/catalog/includes/classes/shopping_cart_action.php 2012-02-01 16:33:30 UTC (rev 4028)
@@ -145,7 +145,7 @@
if (!_cst_bool('NO_SHOPPING_CART_FOR_GUEST') && !tep_session_is_registered('customer_id') ) {
$navigation=navigation_history::getInstance();
$navigation->set_snapshot();
- tep_redirect(FILENAME_LOGIN);
+ tep_redirect(tep_href_link(FILENAME_LOGIN));
}
//! chargement des order total , pour calcul cout , reduction.etc
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2012-02-01 14:57:48
|
Revision: 4027
http://oscss.svn.sourceforge.net/oscss/?rev=4027&view=rev
Author: oscim
Date: 2012-02-01 14:57:36 +0000 (Wed, 01 Feb 2012)
Log Message:
-----------
correction coquille
correction db colonne uniqe
correction gestion des documents pdf
Modified Paths:
--------------
trunk/catalog/admin/includes/functions/general.php
trunk/catalog/common/classes/osCSS_pdf.php
trunk/catalog/common/functions/pdf_output.php
trunk/catalog/install/includes/sql/mysql/tables/osc_configuration_group.sql
Modified: trunk/catalog/admin/includes/functions/general.php
===================================================================
--- trunk/catalog/admin/includes/functions/general.php 2012-01-31 08:18:33 UTC (rev 4026)
+++ trunk/catalog/admin/includes/functions/general.php 2012-02-01 14:57:36 UTC (rev 4027)
@@ -176,6 +176,16 @@
}
/**
+ *\fn tep_sanitize_request($string)
+ *\brief suppression et nettoyage request value (sécu)
+ \param string la chaîne à nettoyer
+*/
+function tep_sanitize_request($string) {
+ $string = htmlspecialchars(strip_tags($string));
+ return preg_replace("#(\./|\.\./|(\<|%3C)|(\>|%3E)|(\<|%3C).*script.*(\>|%3E))*#i",'',$string);
+}
+
+/**
Convetion de langue Generation 2
@package oscss-2
@author oscim <mail os...@os...> <www http://www.oscim.fr>
Modified: trunk/catalog/common/classes/osCSS_pdf.php
===================================================================
--- trunk/catalog/common/classes/osCSS_pdf.php 2012-01-31 08:18:33 UTC (rev 4026)
+++ trunk/catalog/common/classes/osCSS_pdf.php 2012-02-01 14:57:36 UTC (rev 4027)
@@ -1,10 +1,10 @@
<?php if (!defined('HTTP_SERVER')) die('You can not access this file directly!');
/**
- @licence GPL 2005-2011 The osCSS developers - osCSS Open Source E-commerce
+ @licence GPL 2005-2012 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 19/09/11, 20:11
+ @date 31/12/2012, 20:11
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
@class osCSS_pdf
@@ -34,14 +34,14 @@
private function __construct(){
define('BATCH_PRINT_INC', DIR_WS_MODULES . 'template_pdf/');
- define('BATCH_PDF_DIR', DIR_WS_INCLUDES . 'tmp/');
+ define('BATCH_PDF_DIR', DIR_FS_ROOT_DOCS . 'tmp/');
define('FPDF_FONTPATH',DIR_FS_CATALOG.DIR_WS_COMMON_FONTS);
require_once(DIR_FS_CATALOG.DIR_WS_COMMON_CLASSES.'fpdf.php');
require_once(DIR_FS_CATALOG.DIR_WS_COMMON_FUNCTIONS.'pdf_output.php');
- define('LOGO_SHOP_FOR_PRINT',HTTP_SERVER.str_replace('//','/',STORE_LOGO_PRINT));
+ define('LOGO_SHOP_FOR_PRINT',HTTP_SERVER. 'document.php?mod=img&i='. str_replace('//','/',STORE_LOGO_PRINT) );
}
Modified: trunk/catalog/common/functions/pdf_output.php
===================================================================
--- trunk/catalog/common/functions/pdf_output.php 2012-01-31 08:18:33 UTC (rev 4026)
+++ trunk/catalog/common/functions/pdf_output.php 2012-02-01 14:57:36 UTC (rev 4027)
@@ -1,9 +1,9 @@
<?php
/**
- @licence GPL 2005-2010 The osCSS developers - osCSS Open Source E-commerce
+ @licence GPL 2005-2012 The osCSS developers - osCSS Open Source E-commerce
@package osCSS-2 <www http://www.oscss.org>
- @version 2.0.9
- @date 30/05/10, 19:28
+ @version 2.1.1
+ @date 31/01/2012, 19:28
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
*/
@@ -58,7 +58,7 @@
global $oID;
$date = strftime('%A, %d %B %Y');
//Logo + link shop
- $this->Image(HTTP_SERVER.STORE_LOGO_PRINT,5,10,50,0,'',HTTP_SERVER.DIR_WS_CATALOG);
+ $this->Image(LOGO_SHOP_FOR_PRINT,5,10,50,0,'',HTTP_SERVER.DIR_WS_CATALOG);
// Company Address
$this->SetX(0);
@@ -216,7 +216,7 @@
function Header()
{
// //Logo
- $this->Image(HTTP_SERVER.STORE_LOGO_PRINT,5,10,50,0,'',HTTP_SERVER.DIR_WS_CATALOG);
+ $this->Image(LOGO_SHOP_FOR_PRINT,5,10,50,0,'',HTTP_SERVER.DIR_WS_CATALOG);
}
function Footer() {
Modified: trunk/catalog/install/includes/sql/mysql/tables/osc_configuration_group.sql
===================================================================
--- trunk/catalog/install/includes/sql/mysql/tables/osc_configuration_group.sql 2012-01-31 08:18:33 UTC (rev 4026)
+++ trunk/catalog/install/includes/sql/mysql/tables/osc_configuration_group.sql 2012-02-01 14:57:36 UTC (rev 4027)
@@ -23,5 +23,6 @@
configuration_group_group_id varchar(64) NOT NULL,
configuration_group_key varchar(64) not null ,
PRIMARY KEY (configuration_group_id)
+ UNIQUE KEY configuration_group_key (configuration_group_key)
) DEFAULT CHARSET=utf8;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2012-01-31 08:18:39
|
Revision: 4026
http://oscss.svn.sourceforge.net/oscss/?rev=4026&view=rev
Author: oscim
Date: 2012-01-31 08:18:33 +0000 (Tue, 31 Jan 2012)
Log Message:
-----------
correction coquille
Modified Paths:
--------------
trunk/catalog/admin/includes/exts/package/ci_tag.class.php
trunk/catalog/admin/includes/exts/package/packageInstaller.php
trunk/catalog/includes/application_top.php
trunk/catalog/includes/functions/general.php
Modified: trunk/catalog/admin/includes/exts/package/ci_tag.class.php
===================================================================
--- trunk/catalog/admin/includes/exts/package/ci_tag.class.php 2012-01-30 16:22:32 UTC (rev 4025)
+++ trunk/catalog/admin/includes/exts/package/ci_tag.class.php 2012-01-31 08:18:33 UTC (rev 4026)
@@ -140,10 +140,6 @@
}
public static function get_fs_filename($fname) {
-// if($this->isJoscom()){
- $fname = str_replace(DIR_WS_CATALOG,"",$fname);
- $fname = str_replace(DIR_WS_ADMIN,"admin/",$fname);
-//
if (strpos($fname, "admin/") === false) {
$filepath = DIR_FS_CATALOG;
} else {
@@ -152,9 +148,6 @@
}
return $filepath.$fname;
-// }else{
-// if ($fname)return DIR_FS_CATALOG.$fname;
-// }
}
Modified: trunk/catalog/admin/includes/exts/package/packageInstaller.php
===================================================================
--- trunk/catalog/admin/includes/exts/package/packageInstaller.php 2012-01-30 16:22:32 UTC (rev 4025)
+++ trunk/catalog/admin/includes/exts/package/packageInstaller.php 2012-01-31 08:18:33 UTC (rev 4026)
@@ -4,7 +4,7 @@
@portion code Copyright (c) 2002 osCommerce
@package osCSS-2 <www http://www.oscss.org>
@version 2.1.1
- @date 03/01/12, 08:07
+ @date 30/01/12, 08:07
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
@class packageInstaller
@@ -32,9 +32,10 @@
$obj=parent::load_db_values($pkgID);
$obj=$obj[0];
- if((string)$obj->item->sourceTitle =='local'){
+
+ if((string)$obj->item->sourceKey =='local'){
$cip= new CIP( (string)$obj->item->ident.'_'.(string)$obj->item->level.'.zip');
- tep_redirect(tep_href_link(self::FILENAME, 'action=view&pkgID='.(int)$obj->item->internalID ));
+ tep_redirect(tep_href_link(self::FILENAME, 'action=view&pkgID='.$pkgID ));
}
else {
Modified: trunk/catalog/includes/application_top.php
===================================================================
--- trunk/catalog/includes/application_top.php 2012-01-30 16:22:32 UTC (rev 4025)
+++ trunk/catalog/includes/application_top.php 2012-01-31 08:18:33 UTC (rev 4026)
@@ -118,11 +118,11 @@
@note if vou want to allow specific fields, added an exclusion in the loop in question
*/
if(isset($_GET))
- foreach($_GET as $k=>$v) $_GET[$k]=tep_sanitize_request($v);
+ $_GET = PutCleanVars($_GET);
if(isset($_POST))
- foreach($_POST as $k=>$v) $_POST[$k]=tep_sanitize_request($v);
+ $_POST = PutCleanVars($_POST);
if(isset($_REQUEST))
- foreach($_REQUEST as $k=>$v) $_REQUEST[$k]=tep_sanitize_request($v);
+ $_REQUEST = PutCleanVars($_REQUEST);
/// Constructeur de page
Modified: trunk/catalog/includes/functions/general.php
===================================================================
--- trunk/catalog/includes/functions/general.php 2012-01-30 16:22:32 UTC (rev 4025)
+++ trunk/catalog/includes/functions/general.php 2012-01-31 08:18:33 UTC (rev 4026)
@@ -92,6 +92,18 @@
}
/**
+ *\fn PutCleanVars($get)
+ *\brief Recursive methode for clean vars
+ \param array/string la chaîne à nettoyer
+*/
+function PutCleanVars($get){
+ foreach($get as $k=>$v)
+ if(is_array($v)) $get[$k]=PutCleanVars($v);
+ else $get[$k]=tep_sanitize_request($v);
+ return $get;
+}
+
+/**
*\fn tep_random_select($query)
*\brief Return a random row from a database query
\return one result
@@ -1085,7 +1097,7 @@
@brief this function force status on datatype Required for admin view off data
@note use in sql Requete, next clause where and prev other clause
@param $clause string clause normal control status ( c.status='1' AND )
- @return normal clause status or empty string
+ @return normal clause status or empty string
*/
function DataForceStatus($clause){
global $SecuKey;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2012-01-30 16:22:43
|
Revision: 4025
http://oscss.svn.sourceforge.net/oscss/?rev=4025&view=rev
Author: oscim
Date: 2012-01-30 16:22:32 +0000 (Mon, 30 Jan 2012)
Log Message:
-----------
Coquille lors d'un ecorrection precedente
Modified Paths:
--------------
trunk/extensions/ATTRIBUTEMANAGER_stable/attributeManager/classes/attributeManager.class.php
Modified: trunk/extensions/ATTRIBUTEMANAGER_stable/attributeManager/classes/attributeManager.class.php
===================================================================
--- trunk/extensions/ATTRIBUTEMANAGER_stable/attributeManager/classes/attributeManager.class.php 2012-01-30 12:52:28 UTC (rev 4024)
+++ trunk/extensions/ATTRIBUTEMANAGER_stable/attributeManager/classes/attributeManager.class.php 2012-01-30 16:22:32 UTC (rev 4025)
@@ -1,533 +1,821 @@
<?php
/**
- @licence GPL 2005-2010 The osCSS developers - osCSS Open Source E-commerce
- @portion code Copyright (c) 2002 osCommerce
+ @licence GPL 2005-2012 The osCSS developers - osCSS Open Source E-commerce
+ Copyright @ 2006 Kangaroo Partners http://kangaroopartners.com os...@ka...
@package osCSS-2 <www http://www.oscss.org>
- @version 2.1.0
- @date 31/10/10, 09:01
+ @version 2.1.1
+ @date 30/01/2012, 20:36
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
+ @class attributeManager
+*/
- NOTE: Debut d'intégration complete avec osCSS
- TODO: centralsier les fonctions
-*/
-// change the directory upone for application top includes
-chdir('../');
-// OSC application top needed for sessions, defines and functions
-require_once('includes/application_top.php');
-/// Appel lib attributes osCSS
-require_once(DIR_WS_FUNCTIONS.'/lib.attributes.php');
-require_once(DIR_WS_MODULES.'/pages/products.php');
-// db wrapper
-require_once('attributeManager/classes/amDB.class.php');
+// interface attributeManagerInterface {
+// function getAllProductOptionsAndValues();
+// function removeOptionFromProduct();
+// function addAttributeToProduct();
+// }
-// session functions
-require_once('attributeManager/includes/attributeManagerSessionFunctions.inc.php');
-// config
-require_once('attributeManager/classes/attributeManagerConfig.class.php');
+/*abstract*/ class attributeManager /*implements attributeManagerInterface*/ {
-// misc functions
-require_once('attributeManager/includes/attributeManagerGeneralFunctions.inc.php');
+ /**
+ * Holds all of the options in the database
+ * @access private
+ */
+ var $arrAllOptions = array();
-// parent class
-require_once('attributeManager/classes/attributeManager.class.php');
+ /**
+ * Holds all of the option values in the database
+ * @access private
+ */
+ var $arrAllOptionValues = array();
-// instant class
-require_once('attributeManager/classes/attributeManagerInstant.class.php');
+ /**
+ * Holds all of the options and their values where they are releated to each other
+ * @access private
+ */
+ var $arrAllOptionsAndValues = array();
-// atomic class
-// require_once('attributeManager/classes/attributeManagerAtomic.class.php');
+ /**
+ * Holds all of the current products options and option values
+ * @access protected
+ */
+ var $arrAllProductOptionsAndValues = array();
-// security class
-require_once('attributeManager/classes/stopDirectAccess.class.php');
+ /**
+ * Currently selected language id
+ * @todo make multilingual
+ * @access private
+ */
+ var $intLanguageId;
-// check that the file is allowed to be accessed
-// stopDirectAccess::checkAuthorisation(AM_SESSION_VALID_INCLUDE);
-stopDirectAccess::authorise(AM_SESSION_VALID_INCLUDE);
+ /**
+ * Page actions
+ * @var $arrPageActions Array
+ * @access private
+ */
+ var $arrPageActions = array();
+ /**
+ * All templates
+ * @var $arrAllTemplatesAndAttributes Array
+ */
+ var $arrAllTemplatesAndAttributes = array();
-// get an instance of one of the attribute manager classes
-$attributeManager = amGetAttributeManagerInstance($_GET);
+ /**
+ * Type product
+ * @var $TypeProduct int
+ */
+ var $TypeProduct ;
+ /**
+ * __construct()-
+ * Sets up page actions and sets the interface language
+ * @access protected
+ * @author Sam West aka Nimmit - os...@ka...
+ * @return void
+ */
+ function attributeManager() {
-// do any actions that should be done
-$globalVars = $attributeManager->executePageAction($_GET);
+ $this->setInterfaceLanguage();
+ $this->setTemplateOrder();
-// set any global variables from the page action execution
-if(0 !== count($globalVars) && is_array($globalVars))
- foreach($globalVars as $varName => $varValue)
- $$varName = $varValue;
+ $this->registerPageAction('addOption','addOption');
+ $this->registerPageAction('addOptionValue','addOptionValue');
+ $this->registerPageAction('updateNewOptionValue','updateNewOptionValue');
-// get the current products options and values
-$allProductOptionsAndValues = $attributeManager->getAllProductOptionsAndValues(true);
-//$SortedProductAttributes = $attributeManager->sortArrSessionVar();
+ $this->registerPageAction('setTemplateOrder','setTemplateOrder');
-// Type product
-$TypeProduct=$attributeManager->setTypeProduct($_GET['products_id']);
+// $this->registerPageAction('deleteTemplate','deleteTemplate');
+ $this->registerPageAction('saveTemplate','saveTemplate');
+// $this->registerPageAction('renameTemplate','renameTemplate');
+ $this->registerPageAction('loadTemplate','loadTemplate');
+ $this->registerPageAction('setInterfaceLanguage','setInterfaceLanguage');
+ }
-// count the options
-$numOptions = count($allProductOptionsAndValues);
-// output a response header
-// header('Content-type: text/html; charset='.CHARSET);
-//$attributeManager->debugOutput($allProductOptionsAndValues);
-//$attributeManager->debugOutput($SortedProductAttributes);
-//$attributeManager->debugOutput($attributeManager);
-if (!isset($selectedOption)) $selectedOption='';
-if (!isset($selectedOptionValue))$selectedOptionValue='';
-if (!isset($selectedTemplate))$selectedTemplate='';
-if (!isset($price))$price='';
-// include any prompts
-require_once('attributeManager/includes/attributeManagerPrompts.inc.php');
+ //---------------------------------------------------------------------------------------------- core
-if(!isset($_GET['target']) || 'topBar' == $_GET['target'] ) {
- if(!isset($_GET['target']))
- echo '<div id="topBar">';
-?>
+ /**
+ @package oscss-2 <www http://www.oscss.org>
+ @author oscim <mail os...@os...> <www http://www.oscim.fr>
+ Recupere le Type de produit cf table virtual porduct
+ @param int $pID: product Id
+ */
+ public function setTypeProduct($pID){
+ $queryString = "select * from ".TABLE_PRODUCTS." where products_id=".(int)$pID;
+ $query = amDB::query($queryString);
-<table width="100%" cellpadding="0" cellspacing="0">
- <tr>
- <td>
- <?php
- $languages = tep_get_languages();
- if(count($languages) > 1) {
- foreach ($languages as $amLanguage) {
- ?>
- <input type="image" <?php echo ($attributeManager->getSelectedLanaguage() == $amLanguage['id']) ? 'style="padding:1px;border:1px solid black" onclick="return false" ' :'onclick="return amSetInterfaceLanguage(\''.$amLanguage['id'].'\');" '?> src="<?php echo DIR_WS_CATALOG_LANGUAGES . $amLanguage['directory'] . '/images/' . $amLanguage['image']; ?>" border="0" title="<?php echo AM_AJAX_CHANGES; ?>" />
- <?php
+ $res = amDB::fetchArray($query);
+
+ return ((isset($res['products_type']) && !empty($res['products_type']))? (int)$res['products_type']:1) ;
}
- }
- ?>
- </td>
- <td align="right">
- <?php if(false !== AM_USE_TEMPLATES) { ?>
- <div style="padding:5px 3px 5px 0px">
- <input type="image" <?php if($attributeManager->getTemplateOrder()=='123'){echo 'style="border:1px solid #DDDDDD;"';} ?> src="<?php echo DIR_WS_ICONS ?>icon_123.png" onclick="return amTemplateOrder('123');" border="0" title="" />
- <input type="image" <?php if($attributeManager->getTemplateOrder()=='abc'){echo 'style="border:1px solid #DDDDDD;"';} ?> src="<?php echo DIR_WS_ICONS ?>icon_abc.png" onclick="return amTemplateOrder('abc');" border="0" title="" />
-
- <?php echo tep_draw_pull_down_menu('template_drop',$attributeManager->buildAllTemplatesDropDown($attributeManager->getTemplateOrder()),(0 == $selectedTemplate) ? '0' : $selectedTemplate,'id="template_drop" style="margin-bottom:3px"'); ?>
-
- <input type="image" src="<?php echo DIR_WS_ICONS ?>icon_load.png" onclick="return customTemplatePrompt('loadTemplate');" border="0" title="<?php echo AM_AJAX_LOADS_SELECTED_TEMPLATE; ?>" />
-
- <input type="image" src="<?php echo DIR_WS_ICONS ?>icon_save.png" onclick="return customPrompt('saveTemplate');" border="0" title="<?php echo AM_AJAX_SAVES_ATTRIBUTES_AS_A_NEW_TEMPLATE; ?>" />
-
-<!-- <input type="image" src="<?php echo DIR_WS_ICONS ?>icon_rename.png" onclick="return customTemplatePrompt('renameTemplate');" border="0" title="<?php echo AM_AJAX_RENAMES_THE_SELECTED_TEMPLATE; ?>" />
- -->
-<!-- <input type="image" src="<?php echo DIR_WS_ICONS ?>icon_disable.png" onclick="return customTemplatePrompt('deleteTemplate');" border="0" title="<?php echo AM_AJAX_DELETES_THE_SELECTED_TEMPLATE; ?>" />
- -->
- </div>
- <?php } ?>
- </td>
- </tr>
-</table>
-<?php
- if(!isset($_GET['target']))
- echo '</div>';
-} // end target = topBar
-if(!isset($_GET['target']))
- echo '<div id="attributeManagerAll">';
-?>
-<?php
-if(!isset($_GET['target']) || 'currentAttributes' == $_GET['target']) {
- if(!isset($_GET['target']))
- echo '<div id="currentAttributes">';
-?>
-<table width="100%" border="0" cellspacing="0" cellpadding="3">
- <tr class="header">
- <td width="50" align="center">
- <input type="image" src="<?php echo DIR_WS_ICONS ?>icon_plus.gif" onclick="return amShowHideAllOptionValues([<?php echo implode(',',array_keys($allProductOptionsAndValues));?>],true);" border="0" />
-
- <input type="image" src="<?php echo DIR_WS_ICONS ?>icon_minus.gif" onclick="return amShowHideAllOptionValues([<?php echo implode(',',array_keys($allProductOptionsAndValues));?>],false);" border="0" />
- </td>
- <td>
- <?php echo AM_AJAX_NAME; ?>
- </td>
- <td align="right">
- <span style="margin-right:40px"><?php echo AM_AJAX_ACTION; ?></span>
- </td>
- </tr>
-<?php /**
+ /**
+ * Sets the interface language
+ * @param $get $_GET (optional)
+ * @access public
+ * @author Sam West aka Nimmit - os...@ka...
+ * @return void
+ */
+ function setInterfaceLanguage($get=array()) {
+ // setting new interface language
+ if(count($get) > 0) {
+ if(is_numeric($get['language_id'])) {
+ amSessionRegister(AM_SESSION_CURRENT_LANG_VAR_NAME);
+ amSetSessionVariable(AM_SESSION_CURRENT_LANG_VAR_NAME,$get['language_id']);
+ $this->intLanguageId = $get['language_id'];
+ }
+ }
+ // not called from the page. ie costruct
+ else {
+ $langId = amGetSesssionVariable(AM_SESSION_CURRENT_LANG_VAR_NAME);
+ if(false !== $langId)
+ $this->intLanguageId = $langId;
+ else
+ $this->intLanguageId = AM_DEFAULT_LANGUAGE_ID;
+ }
+ }
- Boucle options
+ /**
+ * Returns the currently selected language id
+ * @access public
+ * @author Sam West aka Nimmit - os...@ka...
+ * @return int language id
+ */
+ function getSelectedLanaguage() {
+ return $this->intLanguageId;
+ }
-*/?>
-<?php
-if(0 < $numOptions) {
-foreach($allProductOptionsAndValues as $optionId => $optionInfo){
- $numValues = count($optionInfo['values']); ?>
- <tr class="option">
- <td align="center">
- <input type="image" border="0" id="show_hide_<?php echo $optionId; ?>" src="<?php echo DIR_WS_ICONS ?>icon_plus.gif" onclick="return amShowHideOptionsValues(<?php echo $optionId; ?>);" />
- </td>
- <td>
- <?php echo "{$optionInfo['name']} ($numValues) type:".translate_type_to_name($optionInfo['type']);?>
- </td>
+ /**
+ * Sets Template order
+ * @param $get $_GET (optional)
+ * @access public
+ * @author Tomasz Iwanow aka TomaszBG - mic...@gm...
+ * @return void
+ */
+ function setTemplateOrder($get=array()){
+ if(count($get) > 0) {
+ if(isset($get['templateOrder'])) {
+ amSessionRegister(AM_SESSION_CURRENT_TEMPLATE_ORDER);
+ amSetSessionVariable(AM_SESSION_CURRENT_TEMPLATE_ORDER,$get['templateOrder']);
+ $this->strTemplateOrder = $get['templateOrder'];
+ }
+ }else{
+ $templateOrder = amGetSesssionVariable(AM_SESSION_CURRENT_TEMPLATE_ORDER);
+ if(false !== $templateOrder)
+ $this->strTemplateOrder = $templateOrder;
+ else
+ $this->strTemplateOrder = AM_DEFAULT_TEMPLATE_ORDER;
+ }
+ }
- <td align="right">
- <?php echo tep_draw_pull_down_menu("new_option_value_$optionId",$attributeManager->buildOptionValueDropDown($optionId),$selectedOptionValue,'style="margin:3px 0px 3px 0px;" id="new_option_value_'.$optionId.'"')?>
- <input type="image" src="<?php echo DIR_WS_ICONS ?>icon_add.png" value="Add" border="0" onclick="return amAddOptionValueToProduct('<?php echo $optionId?>');" title="<?php echo htmlspecialchars(sprintf(AM_AJAX_ADDS_ATTRIBUTE_TO_OPTION, $optionInfo['name'])); ?>" />
+ /**
+ * Returns the currently selected Template order
+ * @access public
+ * @author Tomasz Iwanow aka TomaszBG - mic...@gm...
+ * @return str Template order
+ */
+ function getTemplateOrder() {
+ return $this->strTemplateOrder;
+ }
- <input type="image" title="<?php echo htmlspecialchars(sprintf(AM_AJAX_ADDS_NEW_VALUE_TO_OPTION,$optionInfo['name'])) ?>" border="0" src="<?php echo DIR_WS_ICONS ?>icon_add_new.png" onclick="return customPrompt('amAddNewOptionValueToProduct','<?php echo addslashes("option_id:$optionId|option_name:".str_replace('"','"',$optionInfo['name']))?>');" />
-<?php if(false){ ?>
-<!-- <input type="image" src="<?php echo DIR_WS_ICONS ?>icon_rename.png" onclick="return customTemplatePrompt('renameTemplate');" border="0" title="Renames the selected template" />-->
-<?php } ?>
- <input type="image" border="0" onclick="return customPrompt('amRemoveOptionFromProduct','<?php echo addslashes("option_id:$optionId|option_name:".str_replace('"','"',$optionInfo['name']))?>');" src="<?php echo DIR_WS_ICONS ?>icon_disable.png" title="<?php echo htmlspecialchars(addslashes(sprintf(AM_AJAX_PRODUCT_REMOVES_OPTION_AND_ITS_VALUES,$optionInfo['name'],$numValues))) ?>" />
+ /**
+ * Gets all of the options in the database
+ * @access protected
+ * @author Sam West aka Nimmit - os...@ka...
+ * @return array all options
+ */
+ static function getAllOptions($arrAllOptions,$intLanguageId) {
+ if(0 === count($arrAllOptions)) {
+ $queryString = "select * from ".TABLE_PRODUCTS_OPTIONS." where language_id='".amDB::input($intLanguageId)."' order by ";
+ $queryString .= !AM_USE_SORT_ORDER ? "products_options_name" : AM_FIELD_OPTION_SORT_ORDER;
+ $query = amDB::query($queryString);
+ while($res = amDB::fetchArray($query))
+ $arrAllOptions[$res['products_options_id']] = $res['products_options_name'];
+ }
+ return $arrAllOptions;
+ }
- <?php if(AM_USE_SORT_ORDER) { ?>
- <input type="image" onclick="return amMoveOption('<?php echo 'option_id:'.$optionId ; ?>', 'up');" src="<?php echo DIR_WS_ICONS ?>icon_up.png" title="Moves option up" />
- <input type="image" onclick="return amMoveOption('<?php echo 'option_id:'.$optionId ; ?>', 'down');" src="<?php echo DIR_WS_ICONS ?>icon_down.png" title="Moves option down" />
- <?php } ?>
- </td>
- </tr>
-<?php /**
+ /**
+ * Gets all of the option values in the database
+ * @access protected
+ * @author Sam West aka Nimmit - os...@ka...
+ * @return array all option values
+ */
+ function getAllOptionValues() {
+ if(0 === count($this->arrAllOptionValues)) {
+ $query = amDB::query("select * from ".TABLE_PRODUCTS_OPTIONS_VALUES." where language_id='".amDB::input($this->intLanguageId)."'");
+ while($res = amDB::fetchArray($query))
+ $this->arrAllOptionValues[$res['products_options_values_id']] = $res['products_options_values_name'];
+ }
+ return $this->arrAllOptionValues;
+ }
- Info type options
+ /**
+ * Returns an array of options with their related option values
+ * @access protected
+ * @author Sam West aka Nimmit - os...@ka...
+ * @return array All options and option values
+ */
+ function getAllOptionsAndValues() {
+ if(0 === count($this->arrAllOptionsAndValues)){
-*/?>
- <tr class="optionValue">
- <td align="center">
-
- </td>
- <td>
- <?php echo "Suivi stock: ".(($optionInfo['stock']==1)?tep_image(DIR_WS_ICONS . 'icon_status_green.gif', IMAGE_ICON_STATUS_GREEN) : tep_image(DIR_WS_ICONS . 'icon_status_red.gif', IMAGE_ICON_STATUS_RED)).
- " - Champs de type:".translate_type_to_name($optionInfo['type']).
- (($optionInfo['type']==4)? ' - longueur max:'.$optionInfo['length']: '') ;?>
- </td>
+ $allOptions = $this->getAllOptions($this->arrAllOptions,$this->intLanguageId);
+ $allOptionValues = $this->getAllOptionValues();
- <td align="right">
- <?php if($TypeProduct==1) { ?>
- <span style="margin-right:71px;">
- Poids
- </span>
- <?php } ?>
- <span style="margin-right:141px;">
- Price
- </span>
- </td>
- </tr>
-<?php /**
+ $query = amDB::query("select * from ".TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS);
- Show Option Values
+ $optionsId = null;
+ while($res = amDB::fetchArray($query)) {
+ if($res['products_options_id'] != $optionsId) {
+ $optionsId = $res['products_options_id'];
+ $this->arrAllOptionsAndValues[$optionsId]['name'] = $allOptions[$optionsId];
+ }
+ $this->arrAllOptionsAndValues[$optionsId]['values'][$res['products_options_values_id']] = $allOptionValues[$res['products_options_values_id']];
+ }
-*/?>
- <?php if(0 < $numValues):
- foreach($optionInfo['values'] as $optionValueId => $optionValueInfo): ?>
- <tr class="optionValue" id="trOptionsValues_<?php echo $optionId; ?>" style="display:none" >
- <td align="center">
- <img src="<?php echo DIR_WS_ICONS ?>icon_arrow.gif" />
- </td>
- <td>
-<?php /** URL IMAGES Pour remplacement texte option */ ?>
- <?php if(AM_USE_COLOR && $optionInfo['img_supp'] ) { ?>
- <?php if($optionValueInfo['thumb'] !=''){ ?>
- <input type="image" border="0" onclick="return customPrompt('amEditthumbForProduct','<?php echo addslashes('option_id:' . $optionId . '|products_attributes_thumb:' . $optionValueInfo['thumb'] . '|option_value_name:'.str_replace('"','"',$optionValueInfo['name'] .'|option_value_id:'.$optionValueId))?>');" src="<?php echo DIR_WS_ICONS ?>icon_down_edit.png" title="<?php echo htmlspecialchars(sprintf(AM_AJAX_COLOR_EDIT,$optionValueInfo['name'],$optionInfo['name'])) ?>" />
- <input type="image" border="0" onclick="return customPrompt('amDeletethumbForProduct','<?php echo addslashes('option_id:' . $optionId . '|option_value_name:'.str_replace('"','"',$optionValueInfo['name']) .'|option_value_id:'.$optionValueId)?>');" src="<?php echo DIR_WS_ICONS ?>icon_down_delete.png" title="<?php echo htmlspecialchars(sprintf(AM_AJAX_COLOR_DELETE,$optionValueInfo['name'],$optionInfo['name'])) ?>" style="margin-right: 30px;" />
- <?php } else { ?>
- <input type="image" border="0" onclick="return customPrompt('amAddNewthumbForProduct','<?php echo addslashes('option_id:' . $optionId .'|option_value_id:'.$optionValueId . '|option_value_name:'.str_replace('"','"',$optionValueInfo['name']).'|option_value_id:'.$optionValueId)?>');" src="<?php echo DIR_WS_ICONS ?>icon_download.png" title="<?php echo htmlspecialchars(sprintf(AM_AJAX_COLOR_ADD_NEW,$optionValueInfo['name'],$optionInfo['name'])) ?>" style="margin-right: 30px;" />
- <?php } ?>
- <?php } ?>
- <?php echo $optionValueInfo['name']; ?>
- </td>
- <td align="right">
-<?php /** URL IMAGES */ ?>
- <?php if(AM_USE_URLIMG && $optionInfo['img_supp']) { ?>
- <?php if($optionValueInfo['urlimg'] !=''){ /** URL IMAGES */ ?>
- <input type="image" border="0" onclick="return customPrompt('amEditurlimgForProduct','<?php echo addslashes('option_id:' . $optionId . '|products_attributes_urlimg:' . $optionValueInfo['urlimg'] . '|option_value_name:'.str_replace('"','"',$optionValueInfo['name'] .'|products_attributes_id:'.$optionValueInfo['products_attributes_id']))?>');" src="<?php echo DIR_WS_ICONS ?>icon_down_edit.png" title="<?php echo htmlspecialchars(sprintf(AM_AJAX_URLIMG_EDIT,$optionValueInfo['name'],$optionInfo['name'])) ?>" />
- <input type="image" border="0" onclick="return customPrompt('amDeleteurlimgForProduct','<?php echo addslashes('option_id:' . $optionId . '|option_value_name:'.str_replace('"','"',$optionValueInfo['name']) .'|products_attributes_id:'.$optionValueInfo['products_attributes_id'])?>');" src="<?php echo DIR_WS_ICONS ?>icon_down_delete.png" title="<?php echo htmlspecialchars(sprintf(AM_AJAX_URLIMG_DELETE,$optionValueInfo['name'],$optionInfo['name'])) ?>" style="margin-right: 30px;" />
- <?php } else { ?>
- <input type="image" border="0" onclick="return customPrompt('amAddNewurlimgForProduct','<?php echo addslashes('option_id:' . $optionId .'|option_value_id:'.$optionValueId . '|option_value_name:'.str_replace('"','"',$optionValueInfo['name']).'|products_attributes_id:'.$optionValueInfo['products_attributes_id'])?>');" src="<?php echo DIR_WS_ICONS ?>icon_download.png" title="<?php echo htmlspecialchars(sprintf(AM_AJAX_URLIMG_ADD_NEW,$optionValueInfo['name'],$optionInfo['name'])) ?>" style="margin-right: 30px;" />
- <?php } ?>
- <?php } ?>
-<?php /** DOWNLOAD */ ?>
- <?php if(AM_USE_DOWNLOAD) { ?>
- <?php if($optionValueInfo['products_attributes_filename']){ /** DOWNLOAD*/ ?>
- <input type="image" border="0" onclick="return customPrompt('amEditDownloadForProduct','<?php echo addslashes('option_id:' . $optionId . '|products_attributes_filename:' . $optionValueInfo['products_attributes_filename'] . '|products_attributes_maxdays:'.$optionValueInfo['products_attributes_maxdays'] . '|products_attributes_maxcount:'.$optionValueInfo['products_attributes_maxcount'] .'|option_value_name:'.str_replace('"','"',$optionValueInfo['name'] .'|products_attributes_id:'.$optionValueInfo['products_attributes_id']))?>');" src="<?php echo DIR_WS_ICONS ?>icon_down_edit.png" title="<?php echo htmlspecialchars(sprintf(AM_AJAX_DOWLNOAD_EDIT,$optionValueInfo['name'],$optionInfo['name'])) ?>" />
- <input type="image" border="0" onclick="return customPrompt('amDeleteDownloadForProduct','<?php echo addslashes('option_id:' . $optionId . '|option_value_name:'.str_replace('"','"',$optionValueInfo['name']) .'|products_attributes_id:'.$optionValueInfo['products_attributes_id'])?>');" src="<?php echo DIR_WS_ICONS ?>icon_down_delete.png" title="<?php echo htmlspecialchars(sprintf(AM_AJAX_DOWLNOAD_DELETE,$optionValueInfo['name'],$optionInfo['name'])) ?>" style="margin-right: 30px;" />
- <?php } else { ?>
- <input type="image" border="0" onclick="return customPrompt('amAddNewDownloadForProduct','<?php echo addslashes('option_id:' . $optionId .'|option_value_id:'.$optionValueId . '|option_value_name:'.str_replace('"','"',$optionValueInfo['name']).'|products_attributes_id:'.$optionValueInfo['products_attributes_id'])?>');" src="<?php echo DIR_WS_ICONS ?>icon_download.png" title="<?php echo htmlspecialchars(sprintf(AM_AJAX_DOWLNOAD_ADD_NEW,$optionValueInfo['name'],$optionInfo['name'])) ?>" style="margin-right: 30px;" />
- <?php } ?>
- <?php } ?>
-<?php /** Weight */ ?>
- <?php if($TypeProduct==1) { ?>
- <span style="margin-right:41px;">
- <?php echo tep_draw_input_field("weight_$optionValueId",'',$optionValueInfo['weight'],' style="margin:3px 0px 3px 0px;" size="7" onfocus="amF(this)" onblur="amB(this)" onchange="return amUpdateWeight(\''.$optionId.'\',\''.$optionValueId.'\',\'weight\');"'); ?>
- </span>
- <?php } ?>
-<?php /** Price */ ?>
- <span style="margin-right:41px;">
- <?php echo drawDropDownPrefix('id="prefix_'.$optionValueId.'" style="margin:3px 0px 3px 0px;" onchange="return amUpdate(\''.$optionId.'\',\''.$optionValueId.'\',\'prefix\');"',$optionValueInfo['prefix']);?><?php echo tep_draw_input_field("price_$optionValueId",'',$optionValueInfo['price'],' style="margin:3px 0px 3px 0px;" size="7" onfocus="amF(this)" onblur="amB(this)" onchange="return amUpdate(\''.$optionId.'\',\''.$optionValueId.'\',\'price\');"'); ?>
- </span>
-<?php /** Remove */ ?>
- <input type="image" border="0" onclick="return customPrompt('amRemoveOptionValueFromProduct','<?php echo addslashes("option_id:$optionId|option_value_id:$optionValueId|option_value_name:".str_replace('"','"',$optionValueInfo['name']))?>');" src="<?php echo DIR_WS_ICONS ?>icon_disable.png" title="<?php echo htmlspecialchars(sprintf(AM_AJAX_PRODUCT_REMOVES_VALUE_FROM_OPTION,$optionValueInfo['name'],$optionInfo['name'])) ?>" />
-<?php /** Sort */ ?>
- <?php if(AM_USE_SORT_ORDER) { ?>
- <input type="image" onclick="return amMoveOptionValue('<?php echo 'option_id:'.$optionId.'|option_value_id:'.$optionValueId.'|products_attributes_id:'.$optionValueInfo['products_attributes_id']; ?>', 'up');" src="<?php echo DIR_WS_ICONS ?>icon_up.png" title="<?php echo AM_AJAX_MOVES_VALUE_UP; ?>" />
- <input type="image" onclick="return amMoveOptionValue('<?php echo 'option_id:'.$optionId.'|option_value_id:'.$optionValueId.'|products_attributes_id:'.$optionValueInfo['products_attributes_id']; ?>', 'down');" src="<?php echo DIR_WS_ICONS ?>icon_down.png" title="<?php echo AM_AJAX_MOVES_VALUE_DOWN; ?>" />
- <?php } ?>
- </td>
- </tr>
-<?php endforeach; endif;
- }
-}
-?>
-</table>
- <?php
- if(!isset($_GET['target']))
- echo '</div>';
-} // end target = currentAttributes
+ // add any options that are not yet assigned to the tpovtpo table
+ foreach($allOptions as $optionId => $option)
+ if(!array_key_exists($optionId, $this->arrAllOptionsAndValues))
+ $this->arrAllOptionsAndValues[$optionId]['name'] = $allOptions[$optionId];
-if(!isset($_GET['target']) || 'newAttribute' == $_GET['target'] ) {
- if(!isset($_GET['target']))
- echo '<div id="newAttribute">';
+ }
- // check to see if the selected option isset if it isn't pick the first otion in the dropdown
- $optionDrop = $attributeManager->buildOptionDropDown();
+ return $this->arrAllOptionsAndValues;
+ }
- if(!is_numeric($selectedOption)) {
- foreach($optionDrop as $key => $value) {
- if(tep_not_null($value['id'])){
- $selectedOption = $value['id'];
- break;
+ //---------------------------------------------------------------------------------------------- page actions
+
+ /**
+ * Adds a new option to the database
+ * @access public
+ * @author Sam West aka Nimmit - os...@ka...
+ * @param $get $_GET
+ * @return array global variables to be set
+ */
+ function addOption($get) {
+
+ $this->getAndPrepare('options', $get, $options);
+ if (AM_USE_SORT_ORDER) {
+ $this->getAndPrepare('optionSort', $get, $optionSort);
+ }
+ if (AM_USE_QT_PRO) {
+ $this->getAndPrepare('optionTrack', $get, $optionTrack);
+ }
+
+ if(strpos($options,'|'))
+ $arrOptions = explode('|', $options);
+ else
+ $arrOptions[] = $options;
+
+ $id = amDB::getNextAutoValue(TABLE_PRODUCTS_OPTIONS,'products_options_id');
+
+ foreach($arrOptions as $option) {
+
+ list($langId,$name) = explode(':',$option);
+
+ if ($id == 0){
+ $id = 1;
}
+
+ $arrData = array (
+ 'products_options_id' => $id,
+ 'language_id' => amDB::input($langId),
+ 'products_options_name' => amDB::input($name)
+ );
+ if (AM_USE_SORT_ORDER) {
+ $arrData[AM_FIELD_OPTION_SORT_ORDER] = amDB::input($optionSort);
+ }
+ if (AM_USE_QT_PRO) {
+ $arrData['products_options_track_stock'] = amDB::input($optionTrack);
+ }
+
+ amDB::perform(TABLE_PRODUCTS_OPTIONS,$arrData);
}
+
+ return array('selectedOption' => $id);
}
- $optionValueDrop = $attributeManager->buildOptionValueDropDown($selectedOption);
+ /**
+ * Adds a new option values to the database
+ * @access public
+ * @author Sam West aka Nimmit - os...@ka... - os...@ka...
+ * @param $get $_GET
+ * @return array global variables to be set
+ */
+ function addOptionValue($get) {
+ $this->getAndPrepare('option_id', $get, $optionId);
+ $this->getAndPrepare('option_values', $get, $optionValues);
-?>
-<!-- ----- -->
-<!-- SHOW NEW OPTION PANEL on Bottom -->
-<!-- ----- -->
- <div class="newOptionPanel-header">
- <?php echo AM_AJAX_OPTION_NEW_PANEL; ?>
- </div>
- <table border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td align="right" valign="middle" class="newOptionPanel-label">
- <?php echo AM_AJAX_OPTION; ?> <?php echo tep_draw_pull_down_menu('optionDropDown',$optionDrop,$selectedOption,'id="optionDropDown" onchange="return amUpdateNewOptionValue(this.value);" class="optionDropDown"')?>
- </td>
- <td align="right" valign="middle" class="newOptionPanel-button">
- <input border="0" type="image" src="<?php echo DIR_WS_ICONS ?>icon_add_new.png" onclick="return customPrompt('amAddOption');" title="<?php echo AM_AJAX_ADDS_NEW_OPTION; ?>" />
- </td>
- <td align="right" valign="middle" class="newOptionPanel-label">
- <?php echo AM_AJAX_VALUE; ?> <?php echo tep_draw_pull_down_menu('optionValueDropDown',$optionValueDrop,(is_numeric($selectedOptionValue) ? $selectedOptionValue : ''),'id="optionValueDropDown" class="optionValueDropDown"')?>
- </td>
- <td align="right" valign="middle" class="newOptionPanel-button">
- <input border="0" type="image" src="<?php echo DIR_WS_ICONS ?>icon_add_new.png" onclick="return customPrompt('amAddOptionValue');" title="<?php echo AM_AJAX_ADDS_NEW_OPTION_VALUE; ?>" />
- </td>
- <td valign="top" class="newOptionPanel-label">
- <?php echo AM_AJAX_PREFIX; ?> <?php echo drawDropDownPrefix('id="prefix_0"')?>
- </td>
- <td valign="top" class="newOptionPanel-label">
- <?php echo AM_AJAX_PRICE; ?> <?php echo tep_draw_input_field('newPrice','','','size="4"'); ?>
- </td>
- <?php if(AM_USE_SORT_ORDER) { ?>
- <td valign="top" class="newOptionPanel-label">
- <?php echo AM_AJAX_SORT; ?> <?php echo tep_draw_input_field('newSort','','','size="4"'); ?>
- </td>
- <?php } else { ?>
- <td valign="top">
- <?php echo tep_draw_hidden_field('newSort', '','','size="4"'); ?>
- </td>
- <?php } ?>
+ if(strpos($optionValues,'|'))
+ $arrOptionValues = explode('|', $optionValues);
+ else
+ $arrOptionValues[] = $optionValues;
- <td align="right" valign="middle" class="newOptionPanel-button">
- <input type="image" src="<?php echo DIR_WS_ICONS ?>icon_add.png" value="Add" onclick="return amAddAttributeToProduct();" title="<?php echo AM_AJAX_ADDS_ATTRIBUTE_TO_PRODUCT; ?>" border="0" />
- </td>
- </tr>
- </table>
-<?php
- if(!isset($_GET['target']))
- echo '</div>';
-} // end target = newAttribute
-if(!isset($_GET['target']))
- echo '</div>';
-?>
+ $newId = amDB::getNextAutoValue(TABLE_PRODUCTS_OPTIONS_VALUES,'products_options_values_id');
-<?php
+ foreach($arrOptionValues as $optionValue) {
-if (AM_USE_QT_PRO && products::CheckClassProduct('CLASS_STOCK', $TypeProduct)) {
- if(!isset($_GET['target']) || 'currentProductStockValues' == $_GET['target']) {
- if(!isset($_GET['target']))
- echo '<div id="currentProductStockValues">';
+ list($langId,$name) = explode(':',$optionValue);
-$q=tep_db_query($sql="select products_name, products_options_name as _option, pa.options_id as _option_id, products_options_values_name as _value, pa.options_values_id as _value_id from ".
- " ".TABLE_PRODUCTS_DESCRIPTION.", ".TABLE_PRODUCTS_ATTRIBUTES." pa, ".TABLE_PRODUCTS_OPTIONS.", ".TABLE_PRODUCTS_OPTIONS_VALUES." pov where ".
- "pa.products_id = ".TABLE_PRODUCTS_DESCRIPTION.".products_id and ".
- "pa.products_id = '" . $_GET['products_id'] . "' and ".
- "pa.options_id = ".TABLE_PRODUCTS_OPTIONS.".products_options_id and ".
- "pa.options_values_id = pov.products_options_values_id and ".
- "".TABLE_PRODUCTS_DESCRIPTION.".language_id = " . (int)$languages_id . " and ".
- "pov.language_id = " . (int)$languages_id . " and ".TABLE_PRODUCTS_OPTIONS.".products_options_track_stock = 1 and ".
- "".TABLE_PRODUCTS_OPTIONS.".language_id = " . (int)$languages_id . " order by pa.options_id, pa.options_values_id");
- if (tep_db_num_rows($q)>0) {
- $flag=1;
- while($list=tep_db_fetch_array($q)) {
- $options[$list['_option_id']][]=array($list['_value'],$list['_value_id']);
- $option_names[$list['_option_id']]=$list['_option'];
- $product_name=$list['products_name'];
+ if ($newId == 0) {
+ $newId = 1;
+ }
+
+ $ovData = array (
+ 'products_options_values_id' => $newId,
+ 'language_id' => amDB::input($langId),
+ 'products_options_values_name' => amDB::input($name)
+ );
+
+ amDB::perform(TABLE_PRODUCTS_OPTIONS_VALUES,$ovData);
+ }
+
+ $ov2oData = array(
+ 'products_options_id' => $optionId,
+ 'products_options_values_id' => $newId
+ );
+
+ amDB::perform(TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS,$ov2oData);
+
+ return array('selectedOption' => $optionId, 'selectedOptionValue' => $newId);
+ }
+
+ /**
+ * Sets the selected box id
+ * @param $get $_GET
+ * @return array global variables to be set
+ */
+ function updateNewOptionValue($get) {
+ $this->getAndPrepare('option_id', $get, $selectedOption);
+ return array('selectedOption' => $selectedOption);
+ }
+
+ //---------------------------------------------------------------------------------------------- Template page actions
+
+ /**
+ * Takes a variable and prepares it for db
+ * @access protected
+ * @author Sam West aka Nimmit - os...@ka...
+ * @param $strIndex string array index
+ * @param $array array array
+ * @param Variable to set PASSED BY REF
+ * @return void
+ */
+ function getAndPrepare($strIndex,$array, &$variable) {
+ $variable = amDB::input(@$array[$strIndex]);
+ }
+
+ /**
+ * get all templates and their options and option values
+ * @access protected
+ * @author Sam West aka Nimmit - os...@ka...
+ * @return array
+ */
+ function getAllTemplatesAndAttributes() {
+ if(0 === count($this->arrAllTemplatesAndAttributes)) {
+
+ $query = "select * from ".AM_TABLE_TEMPLATES." at left join ".AM_TABLE_ATTRIBUTES_TO_TEMPLATES." aa2t using(template_id) order by at.template_id";
+ if (AM_USE_SORT_ORDER) {
+ $query .= ", aa2t.". AM_FIELD_OPTION_VALUE_SORT_ORDER ;
+ }
+
+ $ref = amDB::getAll($query);
+
+ $templateID = null;
+ foreach($ref as $res) {
+ if($templateID != $res['template_id']) {
+ $templateID = $res['template_id'];
+ $this->arrAllTemplatesAndAttributes[$templateID]['name'] = $res['template_name'];
+ }
+ $this->arrAllTemplatesAndAttributes[$templateID][$res['options_id']][] = $res['option_values_id'];
+
+ if (AM_USE_SORT_ORDER) {
+ $this->arrAllTemplatesAndAttributes[$templateID]['sortOrder'][$res['option_values_id']] = $res[AM_FIELD_OPTION_VALUE_SORT_ORDER];
+ }
+ // Added by Red Earth Design, Inc. to populate price and prefix
+ $this->arrAllTemplatesAndAttributes[$templateID]['price_prefix'][$res['option_values_id']] = $res['price_prefix'];
+ $this->arrAllTemplatesAndAttributes[$templateID]['options_values_price'][$res['option_values_id']] = $res['options_values_price'];
+ }
}
-}
-?>
- <table width="100%" border="0" cellspacing="0" cellpadding="3">
- <tr class="header">
- <td width="50" align="center">
-
- </td>
- <td>
- QT Pro
- </td>
+ return $this->arrAllTemplatesAndAttributes;
+ }
- <td align="right" colspan="<?php echo (sizeof($options)+2); ?>">
- <span style="margin-right:40px"><?php echo AM_AJAX_ACTION; ?></span>
- </td>
- </tr>
- <tr class="option">
- <td align="center">
- <input type="image" border="0" id="show_hide_9999" src="<?php echo DIR_WS_ICONS ?>icon_plus.gif" onclick="return amShowHideOptionsValues(9999);" />
- </td>
-<?php
- if (tep_db_num_rows($q)>0) {
-$title_num=0;
- while(list($k,$v)=each($options)) {
-?>
- <td>
- <?php echo $option_names[$k]; ?>
- </td>
-<?php
- $title[$title_num]=$k;
-$title_num++;
+ /**
+ * Build the templates drop down box
+ * @access public
+ * @author Sam West aka Nimmit - os...@ka...
+ * @return array
+ */
+ function buildAllTemplatesDropDown($order_by='id') {
+ $allTemplates = $this->getAllTemplatesAndAttributes();
+ $returnArray = array(array('id' => '0', 'text' => AM_AJAX_TEMPLATES));
+
+ foreach ($allTemplates as $templateID => $values) {
+ $returnArray[] = array('id' => $templateID, 'text' => $values['name']);
}
-?>
- <td align="right">
- <span style="margin-right:41px;">
- <?php echo AM_AJAX_QUANTITY; ?>
- </span>
- </td>
- </tr>
-<?php
- $q1=tep_db_query("select * from " . TABLE_PRODUCTS_STOCK . " where products_id='" . $_GET['products_id'] . "' order by products_stock_attributes");
- while($rec=tep_db_fetch_array($q1)) {
- $val_array=explode(",",$rec['products_stock_attributes']);
-?>
- <tr class="optionValue" id="trOptionsValues_9999" style="display:none" >
- <td align="center">
- <?php echo $rec['products_stock_id']; ?>
- <img src="<?php echo DIR_WS_ICONS ?>icon_arrow.gif" />
- </td>
-<?php
- foreach($val_array as $val) {
- if (preg_match("/^(\d+)-(\d+)$/",$val,$m1)) {
-?>
- <td>
- <?php echo tep_values_name($m1[2]); ?>
- </td>
-<?php
- } else {
-?>
- <td>
-
- </td>
-<?php
- }
+ // Sort ABC if required
+ if($order_by=='abc'){
+ for($z1=0;$z1<count($returnArray);$z1++){
+ $last_z2=-1;
+ foreach($returnArray as $z2 => $values) {
+ if(($last_z2>0)){
+ if(strcmp($returnArray[$last_z2]['text'],$returnArray[$z2]['text'])>0){
+ $tempArr=$returnArray[$last_z2];
+ $returnArray[$last_z2]=$returnArray[$z2];
+ $returnArray[$z2]=$tempArr;
+ $fch=true;
+ }
+ }
+ $last_z2=$z2;
+ }
}
- for($i=0;$i<sizeof($options)-sizeof($val_array);$i++) {
-?>
- <td>
-
- </td>
-<?php
- }
-?>
- <td align="right">
- <span style="margin-right:41px;">
- <?php echo tep_draw_input_field("productStockQuantity_$rec[products_stock_id]",'', $rec['products_stock_quantity'], ' style="margin:3px 0px 3px 0px;" size="4" onchange="return amUpdateProductStockQuantity(\''.$rec['products_stock_id'].'\');"'); ?>
- </span>
- <input type="image" border="0" onclick="return customPrompt('amRemoveStockOptionValueFromProduct','<?php echo addslashes("option_id:$rec[products_stock_id]")?>');" src="<?php echo DIR_WS_ICONS ?>icon_disable.png" title="<?php echo AM_AJAX_ADDS_ATTRIBUTE_TO_PRODUCT; ?>" />
- </td>
- </tr>
-<?php
}
-?>
-<?php
+
+ return $returnArray;
}
-?>
- </table>
-<?php
- if(!isset($_GET['target']))
- echo '</div>';
- } // end target = currentStockValues
-if(!isset($_GET['target']) || 'newProductStockValue' == $_GET['target'] ) {
- if(!isset($_GET['target']))
- echo '<div id="newProductStockValue">';
-?>
- <table border="0" cellpadding="3">
- <tr>
- <td align="right" valign="top">
- <?php
-// $q=tep_db_query("select * from " . TABLE_PRODUCTS_STOCK . " where products_id='" . $_GET['products_id'] . "' order by products_stock_attributes");
- if (tep_db_num_rows($q)>0) {
- $flag=1;
- while($list=tep_db_fetch_array($q)) {
- $options[$list['_option_id']][]=array($list['_value'],$list['_value_id']);
- $option_names[$list['_option_id']]=$list['_option'];
- $product_name=$list['products_name'];
+ /**
+ * Deletes a given template
+ * @param get $_GET
+ * @author Sam West aka Nimmit - os...@ka...
+ * @return void
+ */
+// function deleteTemplate($get) {
+// $this->getAndPrepare('template_id',$get,$templateId);
+// amDB::query("delete from ".AM_TABLE_TEMPLATES." where template_id = '$templateId'");
+// amDB::query("delete from ".AM_TABLE_ATTRIBUTES_TO_TEMPLATES." where template_id = '$templateId'");
+// }
+
+ /**
+ * Saves the current products attributes as a template
+ * @param $get $_GET
+ * @author Sam West aka Nimmit - os...@ka...
+ * @return array selected template
+ */
+ function saveTemplate($get) {
+
+ $this->getAndPrepare('template_name', $get, $templateName);
+ $this->getAndPrepare('new_template_id', $get, $newTemplateId);
+
+ $db=Database::getInstance();
+
+ $allProdOptionsAndValues = $this->getAllProductOptionsAndValues();
+
+ if(strpos($templateName,':')) {
+ $templateNameBits = explode(':',$templateName);
+ $templateName = $templateNameBits[1];
}
- } else {
- $flag=0;
- $q=tep_db_query("select products_quantity, products_name from " . TABLE_PRODUCTS . " p,".TABLE_PRODUCTS_DESCRIPTION." pd where pd.products_id= p.products_id and p.products_id='" . $_GET['products_id'] ."'");
- $list=tep_db_fetch_array($q);
- $db_quantity=$list['products_quantity'];
- $product_name=stripslashes($list['products_name']);
+
+ if(0 !== count($allProdOptionsAndValues)) {
+ if(0 != $newTemplateId) {
+ $db->query("delete from ".AM_TABLE_ATTRIBUTES_TO_TEMPLATES." where template_id='$newTemplateId'");
+ }
+ else {
+ $data = array(
+ 'template_name' => $templateName
+ );
+ $res=amDB::perform(AM_TABLE_TEMPLATES,$data);
+
+ $newTemplateId = $res->__get('insertId');
+ }
+
+ foreach($allProdOptionsAndValues as $optionId => $values) {
+ if(is_array($values['values'])) {
+ foreach ($values['values'] as $optionValuesId => $allOptionValues){
+ if (!AM_USE_SORT_ORDER) {
+ $data = array(
+ 'template_id' => $newTemplateId,
+ 'options_id' => $optionId,
+ 'option_values_id' => $optionValuesId,
+ 'price_prefix' => $values['values'][$optionValuesId]['prefix'],
+ 'options_values_price' => $values['values'][$optionValuesId]['price']
+ );
+ } else {
+ $data = array(
+ 'template_id' => $newTemplateId,
+ 'options_id' => $optionId,
+ 'option_values_id' => $optionValuesId,
+ 'price_prefix' => $values['values'][$optionValuesId]['prefix'],
+ 'options_values_price' => $values['values'][$optionValuesId]['price'],
+ 'products_options_sort_order' => $values['values'][$optionValuesId]['sortOrder']
+ );
+ }
+ amDB::perform(AM_TABLE_ATTRIBUTES_TO_TEMPLATES,$data);
+ }
+ }
+ }
+ }
+ return array('selectedTemplate' => $newTemplateId);
}
- $title_num=1;
- if ($flag) {
- reset($options);
-// print_r($options);
- $i=0;
- while(list($k,$v)=each($options)) {
- echo '<td><select name="option'.$k.'" id="option'.$k.'">';
- $dropDownOptions[$i] = ''.$k;
-// $dropDownOptions[] = ''.$k;
- foreach($v as $v1) {
- echo '<option value="'.$v1[1].'">'.$v1[0].'</option>';
-// $dropDownOptions[$i] .= '-'.$v1[1];
+
+ /**
+ * renames the specified template
+ * @param $get $_GET
+ * @author Sam West aka Nimmit - os...@ka...
+ * @return array renamed template
+ */
+// function renameTemplate($get) {
+//
+// $this->getAndPrepare('template_name', $get, $templateName);
+// $this->getAndPrepare('template_id', $get, $templateId);
+//
+// if(strpos($templateName,':')) {
+// $templateNameBits = explode(':',$templateName);
+// $templateName = $templateNameBits[1];
+// }
+// $data = array(
+// 'template_name' => $templateName
+// );
+//
+// amDB::perform(AM_TABLE_TEMPLATES,$data,'update',"template_id = '$templateId'");
+//
+// return array('selectedTemplate' => $templateId);
+// }
+
+ /**
+ * Loads the selected template
+ * @param $get $_GET
+ * @author Sam West aka Nimmit - os...@ka...
+ * @return array selected template
+ */
+ function loadTemplate($get) {
+
+ $this->getAndPrepare('template_id', $get, $templateId);
+
+ $db=Database::getInstance();
+
+ $allProductsOptionsAndValues = $this->getAllProductOptionsAndValues();
+
+ // used for checking the option still actualy exists in the database
+ $allOptions = array_keys($this->getAllOptions($this->arrAllOptions,$this->intLanguageId));
+ $allOptionValues = array_keys($this->getAllOptionValues());
+
+ // first delete all the products existing options
+ foreach($allProductsOptionsAndValues as $optionId => $dontNeed)
+ $this->removeOptionFromProduct(array('option_id' => $optionId));
+
+ // now add the ones in the template
+ $allTemplatesAttributes = $this->getAllTemplatesAndAttributes();
+ //echo '<br /><br />Array ALLTEMPANDATTRIBS:: <br /><br />';
+ //print_r($allTemplatesAttributes);
+
+ $actionTaken = false;
+
+ if(is_array($allTemplatesAttributes[$templateId])) {
+ foreach ($allTemplatesAttributes[$templateId] as $optionsId => $values) {
+ // check that the option id in the template is still in the database
+ if(in_array($optionsId,$allOptions)) {
+ if(is_array($values)) {
+ foreach($values as $optionValuesId) {
+
+ // check that the option values id still exists in the database
+ if(in_array($optionValuesId,$allOptionValues)) {
+ $tmp=array('option_id' => $optionsId,
+ 'option_value_id' => $optionValuesId,
+ 'price' => @$allTemplatesAttributes[$templateId]['options_values_price'][$optionValuesId],
+ 'prefix' => @$allTemplatesAttributes[$templateId]['price_prefix'][$optionValuesId]
+ );
+
+ if (AM_USE_SORT_ORDER ) {
+ $tmp['sortOrder']=@$allTemplatesAttributes[$templateId]['sortOrder'][$optionValuesId];
+ }
+ if (AM_USE_QT_PRO ) {
+ $tmp['stockTracking']=@$allTemplatesAttributes[$templateId]['stockTracking'][$optionValuesId];
+ }
+
+ $this->addAttributeToProduct($tmp);
+ $actionTaken = true;
+ }
+ else {
+ // the option value no longer exists in the databse, delete if from all templates
+ $db->query("delete from ".AM_TABLE_ATTRIBUTES_TO_TEMPLATES." where option_values_id = '$optionValuesId'");
+ }
+ }
+ }
+ }
+ else {
+ // the option no longer exists in the databse, delete it from all templates
+ $db->query("delete from ".AM_TABLE_ATTRIBUTES_TO_TEMPLATES." where options_id = '$optionsId'");
+ }
}
- echo "</select></td>";
-// $dropDownOptions[$i]=substr($dropDownOptions[$i],1);
- $i++;
+ }
+ // if something has been loaded reset the options and values
+ if($actionTaken)
+ $this->getAllProductOptionsAndValues(true);
+ // otherwise nothing in the template exists anymore so just restore the original values, no harm done
+ else
+ $this->arrAllProductOptionsAndValues = $allProductsOptionsAndValues;
+ return array('selectedTemplate' => $templateId);
+ }
+
+ //---------------------------------------------------------------------------------------------- Drop downs
+
+ /**
+ * takes an array of key => value and formats them for the tep_draw_pull_down function
+ * @access private
+ * @author Sam West aka Nimmit - os...@ka...
+ * @param $array Array key value pair to be formated
+ * @return array global variables to be set
+ */
+ function formatArrayForDropDown($array) {
+ $arrReturn = array();
+ foreach($array as $key => $value)
+ $arrReturn[] = array('id' => $key, 'text' => $value);
+ if(0 === count($arrReturn))
+ return array(array('id' => '0', 'text' => '----'));
+
+ return $arrReturn;
+ }
+
+ /**
+ * Builds an array for a drop down of available options
+ * @access public
+ * @author Sam West aka Nimmit - os...@ka...
+ * @param $subtract bol - if true it will subtract the options that are already assigned to the product
+ * @return array formated for the osc dropdown box function array(array('id'=>$key,'text'=>$value))
+ */
+ function buildOptionDropDown($subtract = true) {
+
+ $allOptionsAndValues = $this->getAllOptionsAndValues();
+ $allProductsOptionsAndValues = $this->getAllProductOptionsAndValues();
+
+ $returnArray = array();
+
+ foreach($allOptionsAndValues as $optionId => $optionValues)
+ $returnArray[$optionId] = $optionValues['name'];
+
+ // remove any already assigned
+ if(true === $subtract) {
+
+ if(0 !== count($allProductsOptionsAndValues)){
+ // get all of the option ids from the return array that arn't already assigned to the product
+ $nonAssignedIds = array_diff(array_keys($returnArray), array_keys($this->getAllProductOptionsAndValues()));
+
+ $tRetrurnArray = $returnArray;
+
+ $returnArray = array();
+
+ // rebuild the array
+ if(is_array($nonAssignedIds))
+ foreach($nonAssignedIds as $id)
+ $returnArray[$id] = $tRetrurnArray[$id];
+ }
}
- } else {
- $i=1;
- echo '<td>'.AM_AJAX_QUANTITY.'</td>';
+
+ /**
+ * Sort the keys of the array alpha
+ * @todo make it case insensitive
+ */
+ if(1 == AM_DEFAULT_SORT_ORDER) asort($returnArray);
+
+ return $this->formatArrayForDropDown($returnArray);
}
-?>
- <td>
- <?php echo tep_draw_input_field("stockQuantity", '', @$db_quantity, ' style="margin:3px 0px 3px 0px;" size="4"'); ?>
- </td>
- <td valign="top">
- <input type="image" src="<?php echo DIR_WS_ICONS ?>icon_add.png" value="Add" onclick="return amAddStockToProduct('<?php echo implode(",", $dropDownOptions); ?>');" title="<?php echo AM_AJAX_UPDATE_OR_INSERT_ATTRIBUTE_COMBINATIONBY_QUANTITY; ?>" border="0" /><br/>
- </td>
- </tr>
- </table>
-<?php
- if(!isset($_GET['target']))
- echo '</div>';
-} // end target = newProductStockValue
-if(!isset($_GET['target']))
- echo '</div>';
-?>
-<?php
-} // End QT Pro Plugin
+
+ /**
+ * Builds an array for a drop down of available option values
+ * @access public
+ * @author Sam West aka Nimmit - os...@ka...
+ * @param $optionId int - if defined, will limit the option values to only ones that are below an option. Otherwise it will return all
+ * @param $subtract bol - if true it will subtract option values that are already assigned to this product with this option
+ * @return array formated for the osc dropdown box function array(array('id'=>$key,'text'=>$value))
+ */
+ function buildOptionValueDropDown($optionId = null, $subtract = true) {
+
+ $allOptionsAndValues = $this->getAllOptionsAndValues();
+
+ $returnArray = array();
+
+ // get all the values
+ if(null === $optionId) {
+ foreach($allOptionsAndValues as $option)
+ if(is_array($option['values']))
+ foreach($option['values'] as $optionValueId => $optionValueText)
+ $returnArray[$optionValueId] = $optionValueText;
+ }
+ // just get the values for the specified option id
+ else {
+ if(array_key_exists($optionId,$allOptionsAndValues))
+ if(isset($allOptionsAndValues[$optionId]['values']) && is_array($allOptionsAndValues[$optionId]['values']))
+ foreach($allOptionsAndValues[$optionId]['values'] as $optionValueId => $optionValueText)
+ $returnArray[$optionValueId] = $optionValueText;
+ }
+
+ // get rid of any already specified
+ if(true === $subtract) {
+
+ $allProductsOptionsAndValues = $this->getAllProductOptionsAndValues();
+
+ // get all of the values
+ if(null === $optionId) {
+ $tAll = array();
+
+ foreach($allProductsOptionsAndValues as $optionId => $details)
+ if(is_array($details['values']))
+ foreach($details['values'] as $optionValueId => $optionValueText)
+ if(!array_key_exists($optionValueId,$tAll)) // stop duplicates - there shouldn't be any, but you never know
+ $tAll[$optionValueId] = $optionValueText;
+
+ $allProductsOptionsAndValues = $tAll;
+ }
+ // if an option id is specified only return the values for that option id to compare
+ elseif (isset($allProductsOptionsAndValues[$optionId])) {
+ $allProductsOptionsAndValues = $allProductsOptionsAndValues[$optionId]['values'];
+ }
+
+ // make sure that the product actually has one of the values for the current option to subtract, if not do
+ if(0 !== count($allProductsOptionsAndValues)){
+
+ // get all of the option value ids from the return array that arn't already assigned to the product
+ $nonAssignedIds = array_diff(array_keys($returnArray),array_keys($allProductsOptionsAndValues));
+
+ $tRetrurnArray = $returnArray;
+
+ $returnArray = array();
+
+ // rebuild the array
+ if(is_array($nonAssignedIds))
+ foreach($nonAssignedIds as $id)
+ $returnArray[$id] = $tRetrurnArray[$id];
+ }
+ }
+
+ /**
+ * Sort the keys of the array alpha
+ * @todo make it case insensitive
+ */
+ if(1 == AM_DEFAULT_SORT_ORDER)
+ asort($returnArray);
+
+ return $this->formatArrayForDropDown($returnArray);
+ }
+
+ //---------------------------------------------------------------------------------------------- page action execution
+
+ /**
+ * Registers a page action
+ * @author Sam West aka Nimmit - os...@ka...
+ * @param $strAction string action
+ * @param $strFunction string function name
+ * @return void
+ */
+ function registerPageAction($strAction,$strFunction) {
+ $this->arrPageActions[$strAction] = $strFunction;
+ }
+
+ /**
+ * Unregisters a page action
+ * @author Sam West aka Nimmit - os...@ka...
+ * @param $strAction string page action to be unregistered
+ * @return void
+ */
+ function unregisterPageAction($strAction) {
+ unset($this->arrPageActions[$strAction]);
+ }
+
+ /**
+ * Executes a page action
+ * @access public
+ * @author Sam West aka Nimmit - os...@ka...
+ * @param $get $_GET
+ * @return array global variables to be set
+ */
+ function executePageAction($get) {
+ $results = array();
+ if(array_key_exists(AM_ACTION_GET_VARIABLE,$get)) {
+ $actionKey = $get[AM_ACTION_GET_VARIABLE];
+ if(array_key_exists($actionKey,$this->arrPageActions)){
+ $functionName = $this->arrPageActions[$actionKey];
+ if(method_exists($this,$functionName)) {
+ $results = $this->$functionName($get);
+ }
+ }
+ }
+ return $results;
+ }
+
+ //---------------------------------------------------------------------------------------------- misc
+
+ /**
+ * Nothing todo with the script just outputs stuff to browser used for debelopment
+ * @access public
+ * @author Sam West aka Nimmit - os...@ka...
+ * @return void
+ */
+ function debugOutput($ent) {
+ echo (is_array($ent) || is_object($ent)) ? '<pre style="text-align:left">'.print_r($ent, true).'</pre>' : $ent;
+ }
+
+}
+
?>
\ 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...> - 2012-01-30 12:52:39
|
Revision: 4024
http://oscss.svn.sourceforge.net/oscss/?rev=4024&view=rev
Author: oscim
Date: 2012-01-30 12:52:28 +0000 (Mon, 30 Jan 2012)
Log Message:
-----------
coquille
Modified Paths:
--------------
trunk/catalog/admin/editeur/tiny_mce/plugins/tinybrowser/upload_process.php
Modified: trunk/catalog/admin/editeur/tiny_mce/plugins/tinybrowser/upload_process.php
===================================================================
--- trunk/catalog/admin/editeur/tiny_mce/plugins/tinybrowser/upload_process.php 2012-01-28 14:09:02 UTC (rev 4023)
+++ trunk/catalog/admin/editeur/tiny_mce/plugins/tinybrowser/upload_process.php 2012-01-30 12:52:28 UTC (rev 4024)
@@ -1,10 +1,10 @@
<?php
/**
- @licence GPL 2005-2011 The osCSS developers - osCSS Open Source E-commerce
+ @licence GPL 2005-2012 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/03/11, 16:51
+ @version 2.1.1
+ @date 28/01/12, 16:51
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
*/
@@ -35,8 +35,8 @@
{
//-- File Naming
$tmp_filename = DIR_FS_WORK.$file;
- $dest_filename = DIR_FS_CATALOG.DIR_WS_IMAGES.$folder.rtrim($file,'_');
-;
+ $dest_filename = DIR_FS_ROOT_DOCS.DIR_WS_IMAGES.$folder.rtrim($file,'_');
+
//-- Duplicate Files
if(file_exists($dest_filename)) { unlink($tmp_filename.'_'); $dup++; continue; }
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ay...@us...> - 2012-01-28 14:09:09
|
Revision: 4023
http://oscss.svn.sourceforge.net/oscss/?rev=4023&view=rev
Author: ayatus
Date: 2012-01-28 14:09:02 +0000 (Sat, 28 Jan 2012)
Log Message:
-----------
Coquille
Modified Paths:
--------------
trunk/catalog/install/includes/sql/mysql/data/91_osc_configuration.sql
Modified: trunk/catalog/install/includes/sql/mysql/data/91_osc_configuration.sql
===================================================================
--- trunk/catalog/install/includes/sql/mysql/data/91_osc_configuration.sql 2012-01-23 14:16:55 UTC (rev 4022)
+++ trunk/catalog/install/includes/sql/mysql/data/91_osc_configuration.sql 2012-01-28 14:09:02 UTC (rev 4023)
@@ -210,7 +210,7 @@
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) values ('GZIP_LEVEL_S', 'GZIP_LEVEL', '2', 'GZIP_LEVEL_L', '14', '2', NOW(), NOW(), NULL, NULL);
-- 15 sessions
-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 ('SESSION_LIFE_ADMIN_S', 'SESSION_LIFE_ADMIN', '25', 'SESSION_LIFE_ADMIN_L.', '15', '1', NOW(), NOW(), NULL, 'tep_cfg_pull_down_num_list(15,60,5,',1);
+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 ('SESSION_LIFE_ADMIN_S', 'SESSION_LIFE_ADMIN', '25', 'SESSION_LIFE_ADMIN_L', '15', '1', NOW(), NOW(), NULL, 'tep_cfg_pull_down_num_list(15,60,5,',1);
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 ('SESSION_LIFE_PUBLIC_S', 'SESSION_LIFE_PUBLIC', '25', 'SESSION_LIFE_PUBLIC_L', '15', '2', NOW(), NOW(), NULL, 'tep_cfg_pull_down_num_list(15,60,5,',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) values ('SESSION_FORCE_COOKIE_USE_S', 'SESSION_FORCE_COOKIE_USE', 'true', 'SESSION_FORCE_COOKIE_USE_L', '15', '3', NOW(), NOW(), 'tep_value_for_humain', 'tep_cfg_select_option(array(\'true\', \'false\'),');
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) values ('SESSION_CHECK_SSL_SESSION_ID_S', 'SESSION_CHECK_SSL_SESSION_ID', 'false', 'SESSION_CHECK_SSL_SESSION_ID_L', '15', '4', NOW(), NOW(), 'tep_value_for_humain', 'tep_cfg_select_option(array(\'true\', \'false\'),');
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2012-01-23 14:17:07
|
Revision: 4022
http://oscss.svn.sourceforge.net/oscss/?rev=4022&view=rev
Author: oscim
Date: 2012-01-23 14:16:55 +0000 (Mon, 23 Jan 2012)
Log Message:
-----------
report et ajustement module payement paypal
Added Paths:
-----------
trunk/extensions/PAYPAL_IPN_stable/
trunk/extensions/PAYPAL_IPN_stable/catalog/
trunk/extensions/PAYPAL_IPN_stable/catalog/includes/
trunk/extensions/PAYPAL_IPN_stable/catalog/includes/languages/
trunk/extensions/PAYPAL_IPN_stable/catalog/includes/languages/fr_FR/
trunk/extensions/PAYPAL_IPN_stable/catalog/includes/languages/fr_FR/modules/
trunk/extensions/PAYPAL_IPN_stable/catalog/includes/languages/fr_FR/modules/payment/
trunk/extensions/PAYPAL_IPN_stable/catalog/includes/languages/fr_FR/modules/payment/paypal_ipn/
trunk/extensions/PAYPAL_IPN_stable/catalog/includes/languages/fr_FR/modules/payment/paypal_ipn/paypal_ipn.txt
trunk/extensions/PAYPAL_IPN_stable/catalog/includes/modules/
trunk/extensions/PAYPAL_IPN_stable/catalog/includes/modules/payment/
trunk/extensions/PAYPAL_IPN_stable/catalog/includes/modules/payment/paypal_ipn/
trunk/extensions/PAYPAL_IPN_stable/catalog/includes/modules/payment/paypal_ipn/.htaccess
trunk/extensions/PAYPAL_IPN_stable/catalog/includes/modules/payment/paypal_ipn/cert_key_pem.txt
trunk/extensions/PAYPAL_IPN_stable/catalog/includes/modules/payment/paypal_ipn/paypal_ipn.php
trunk/extensions/PAYPAL_IPN_stable/catalog/includes/modules/payment/paypal_ipn/response.php
trunk/extensions/PAYPAL_IPN_stable/install.xml
Added: trunk/extensions/PAYPAL_IPN_stable/catalog/includes/languages/fr_FR/modules/payment/paypal_ipn/paypal_ipn.txt
===================================================================
--- trunk/extensions/PAYPAL_IPN_stable/catalog/includes/languages/fr_FR/modules/payment/paypal_ipn/paypal_ipn.txt (rev 0)
+++ trunk/extensions/PAYPAL_IPN_stable/catalog/includes/languages/fr_FR/modules/payment/paypal_ipn/paypal_ipn.txt 2012-01-23 14:16:55 UTC (rev 4022)
@@ -0,0 +1,21 @@
+<?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.0.9
+ @date 14/06/10, 09:40
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+*/
+
+/* FO */
+$lang['module payment paypal ipn text title']="Paiement via Paypal" ;
+$lang['module payment paypal ipn text description']="Paiement via Paypal" ;
+
+/* Etape succes, rappel des info pour paiement */
+$lang['module payment paypal ipn text selection']="Carte bancaire ou compte paypal" ;
+$lang['module payment paypal ipn text last confirm']="Paiment par carte bancaire ou compte paypal" ;
+
+
+?>
\ No newline at end of file
Added: trunk/extensions/PAYPAL_IPN_stable/catalog/includes/modules/payment/paypal_ipn/.htaccess
===================================================================
--- trunk/extensions/PAYPAL_IPN_stable/catalog/includes/modules/payment/paypal_ipn/.htaccess (rev 0)
+++ trunk/extensions/PAYPAL_IPN_stable/catalog/includes/modules/payment/paypal_ipn/.htaccess 2012-01-23 14:16:55 UTC (rev 4022)
@@ -0,0 +1,13 @@
+# order allow,deny
+# allow from all
+
+order deny,allow
+deny from all
+<Files .htaccess>
+order deny,allow
+deny from all
+</Files>
+<Files response.php>
+order allow,deny
+allow from all
+</Files>
\ No newline at end of file
Property changes on: trunk/extensions/PAYPAL_IPN_stable/catalog/includes/modules/payment/paypal_ipn/.htaccess
___________________________________________________________________
Added: svn:executable
+ *
Added: trunk/extensions/PAYPAL_IPN_stable/catalog/includes/modules/payment/paypal_ipn/cert_key_pem.txt
===================================================================
--- trunk/extensions/PAYPAL_IPN_stable/catalog/includes/modules/payment/paypal_ipn/cert_key_pem.txt (rev 0)
+++ trunk/extensions/PAYPAL_IPN_stable/catalog/includes/modules/payment/paypal_ipn/cert_key_pem.txt 2012-01-23 14:16:55 UTC (rev 4022)
@@ -0,0 +1 @@
+
Property changes on: trunk/extensions/PAYPAL_IPN_stable/catalog/includes/modules/payment/paypal_ipn/cert_key_pem.txt
___________________________________________________________________
Added: svn:executable
+ *
Added: trunk/extensions/PAYPAL_IPN_stable/catalog/includes/modules/payment/paypal_ipn/paypal_ipn.php
===================================================================
--- trunk/extensions/PAYPAL_IPN_stable/catalog/includes/modules/payment/paypal_ipn/paypal_ipn.php (rev 0)
+++ trunk/extensions/PAYPAL_IPN_stable/catalog/includes/modules/payment/paypal_ipn/paypal_ipn.php 2012-01-23 14:16:55 UTC (rev 4022)
@@ -0,0 +1,563 @@
+<?php
+/**
+ @licence GPL 2005-2011 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 06/07/11, 09:27
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+
+ @subpackage paypal_ipn <www http://plugins.oscss.org>
+ @file paypal_ipn.php
+ @class paypal_ipn
+*/
+class paypal_ipn {
+ public $code;
+ public $title;
+ public $description;
+ public $enabled;
+ public $identifier;
+
+// class constructor
+ function __construct() {
+ global $order;
+
+ $this->code = 'paypal_ipn';
+ $this->title = __('module payment paypal ipn text title');
+ $this->description = __('module payment paypal ipn text description');
+ $this->sort_order = (defined('MODULE_PAYMENT_PAYPAL_IPN_SORT_ORDER') ? MODULE_PAYMENT_PAYPAL_IPN_SORT_ORDER : 0 );
+ $this->enabled = true;
+
+ $this->identifier = 'osCss PayPal IPN v2.5.2';
+ $this->show = __('module payment paypal ipn text selection');
+ $this->last_confirm = __('module payment paypal ipn text last confirm');
+ $this->icon =(defined('MODULE_PAYMENT_PAYPAL_IPN_ICON') && tep_not_null('MODULE_PAYMENT_PAYPAL_IPN_ICON')? MODULE_PAYMENT_PAYPAL_IPN_ICON : '<img src="https://www.paypal.com/en_US/i/logo/PayPal_mark_37x23.gif" align="left" style="margin-right:7px;">' );
+
+ if ((int)MODULE_PAYMENT_PAYPAL_IPN_PREPARE_ORDER_STATUS_ID > 0) {
+ $this->order_status = MODULE_PAYMENT_PAYPAL_IPN_PREPARE_ORDER_STATUS_ID;
+ }
+
+ if (is_object($order)) $this->update_status();
+
+ $this->form_action_url = ((MODULE_PAYMENT_PAYPAL_IPN_GATEWAY_SERVER == 'Live') ?'https://www.paypal.com/cgi-bin/webscr' : 'https://www.sandbox.paypal.com/cgi-bin/webscr' );
+ }
+
+ /**
+ @page chechout_confirmation
+ @a 1
+ */
+ function update_status() {
+ global $order;
+
+ if ( ($this->enabled == true) && ((int)MODULE_PAYMENT_PAYPAL_IPN_ZONE > 0) ) {
+ $check_flag = false;
+ $check_query = tep_db_query($sql="select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_PAYPAL_IPN_ZONE . "' and (zone_country_id = '" . $order->delivery['country']['id'] . "' OR zone_country_id ='0') order by zone_id");
+ while ($check = tep_db_fetch_array($check_query)) {
+ if ($check['zone_id'] < 1) { $check_flag = true; break; }
+ elseif ($check['zone_id'] == $order->billing['zone_id']) { $check_flag = true; break; }
+ }
+
+ if ($check_flag == false) { $this->enabled = false; }
+ }
+
+// $insert_order = false;
+// $update_order = false;
+ if (!isset($_SESSION['cart_PayPal_IPN_ID'])){
+ $insert_order = true;
+ }else {
+// if (isset($_SESSION['cart_PayPal_IPN_ID'])/*tep_session_is_registered('cart_PayPal_IPN_ID')*/) {
+ $cart_PayPal_IPN_ID=$_SESSION['cart_PayPal_IPN_ID'];
+ $order_id = substr($cart_PayPal_IPN_ID, strpos($cart_PayPal_IPN_ID, '-')+1);
+ $curr_check = tep_db_query("select currency from " . TABLE_ORDERS . " where orders_id = '" . (int)$order_id . "'");
+ $curr = tep_db_fetch_array($curr_check);
+
+ $check_query = tep_db_query('select orders_id from ' . TABLE_ORDERS_STATUS_HISTORY . ' where orders_id = "' . (int)$order_id . '" order by orders_id DESC limit 2');
+
+ $this->order_id=$order_id;
+ $insert_order = true;
+ }
+// $this->insert_order=$insert_order;
+// $this->update_order=$update_order;
+
+ return true;
+
+ }
+
+ function javascript_validation() {
+ return false;
+ }
+
+ function selection() {
+ tep_session_unregister('cart_PayPal_IPN_ID');
+ return array( 'id' => $this->code,
+ 'module' => $this->show,
+ 'icon'=>$this->icon
+ );
+ }
+
+
+ /**
+ @page chechout_confirmation
+ @a 2
+
+ Apres control erreur des modules
+ */
+ function pre_confirmation_check() {
+ return false;
+ }
+
+ /**
+ @page chechout_confirmation
+ @a 3
+ */
+ function confirmation() {
+ global $cartID, $cart_PayPal_IPN_ID, $customer_id, $languages_id, $order, $order_total_modules, $coupon;
+
+ $confirmation = array('title' => __('module payment paypal ipn text last confirm'), 'fields' => array());
+ return $confirmation;
+ }
+
+
+ function process_button() {
+ global $customer_id, $order, $languages_id, $currencies, $currency, $cart_PayPal_IPN_ID, $shipping, $order_total_modules, $coupon;
+
+ $process_button_string ='';
+
+ if (MODULE_PAYMENT_PAYPAL_IPN_CURRENCY == 'Selected Currency') $my_currency = $currency;
+ else $my_currency = substr(MODULE_PAYMENT_PAYPAL_IPN_CURRENCY, 5);
+
+ if (!in_array($my_currency, array('AUD', 'CAD', 'CHF', 'CZK', 'DKK', 'EUR', 'GBP', 'HKD', 'HUF', 'JPY', 'NOK', 'NZD', 'PLN', 'SEK', 'SGD', 'USD'))) $my_currency = 'USD';
+
+ $order_totals = array();
+ if (is_array($order_total_modules->modules)) {
+ reset($order_total_modules->modules);
+ while (list($class, $value) = each($order_total_modules->modules)) {
+ if ($GLOBALS[$class]->enabled) {
+ for ($i=0, $n=sizeof($GLOBALS[$class]->output); $i<$n; $i++) {
+ if (tep_not_null($GLOBALS[$class]->output[$i]['title']) && tep_not_null($GLOBALS[$class]->output[$i]['text'])) {
+ $order_totals[] = array('code' => $GLOBALS[$class]->code,
+ 'title' => $GLOBALS[$class]->output[$i]['title'],
+ 'text' => $GLOBALS[$class]->output[$i]['text'],
+ 'value' => $GLOBALS[$class]->output[$i]['value'],
+ 'sort_order' => $GLOBALS[$class]->sort_order);
+ }
+ }
+ }
+ }
+ }
+ foreach ($order_totals as $ot) {
+ $order_total[$ot['code']] = $ot['value'];
+ }
+ $subtotal = $order_total['ot_subtotal'];
+// if (_cst_bool('DISPLAY_PRICE_WITH_TAX')) $subtotal -= $order->info['tax'];
+
+ $parameters = array();
+
+ if ( (MODULE_PAYMENT_PAYPAL_IPN_TRANSACTION_TYPE == 'Per Item')/* && (MODULE_PAYMENT_PAYPAL_IPN_EWP_STATUS == 'False') // removed by AlexStudio*/) {
+ $parameters['cmd'] = '_cart';
+ $parameters['upload'] = '1';
+
+ // Decide how many items are virtual (no shipping)
+ $shipping_count = 0;
+ $shipping_added = 0;
+ $handling_added = 0;
+ $item_tax = 0;
+ $virtual_items = 0;
+ for ($y=0; $y<sizeof($order->products); $y++) {
+ if (isset($order->products[$y]['attributes']) && is_array($order->products[$y]['attributes'])) {
+ while (list($key, $value) = each($order->products[$y]['attributes'])) {
+ $z = $key;
+ $attributes_query = "select pad.products_attributes_filename
+ from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval,
+ " . TABLE_PRODUCTS_ATTRIBUTES . " pa left join " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad
+ on pa.products_attributes_id=pad.products_attributes_id
+ where pa.products_id = '" . $order->products[$y]['id'] . "'
+ and pa.options_id = '" . $order->products[$y]['attributes'][$z]['option_id'] . "'
+ and pa.options_id = popt.products_options_id
+ and pa.options_values_id = '" . $order->products[$y]['attributes'][$z]['value_id'] . "'
+ and pa.options_values_id = poval.products_options_values_id";
+ $attributes = tep_db_query($attributes_query);
+ $attributes_values = tep_db_fetch_array($attributes);
+ if (tep_not_null($attributes_values['products_attributes_filename'])) $virtual_items++;
+ }
+ }
+ }
+
+ for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {
+ $item = $i+1;
+
+ $tax_value = ($order->products[$i]['tax'] / 100) * $order->products[$i]['final_price'];
+
+ $parameters['item_name_' . $item] = $order->products[$i]['name'];
+ $parameters['item_number_' . $item] = $order->products[$i]['model'];
+ // BOF Tax pre item fix by AlexStudio
+ if(_cst_bool('MODULE_PAYMENT_PAYPAL_IPN_MOVE_TAX_TO_TOTAL_AMOUNT')) $parameters['amount_' . $item] = number_format(($order->products[$i]['final_price'] + $tax_value) * $currencies->get_value($my_currency), $currencies->get_decimal_places($my_currency));
+ else {
+ $parameters['amount_' . $item] = number_format($order->products[$i]['final_price'] * $currencies->get_value($my_currency), $currencies->get_decimal_places($my_currency));
+ $parameters['tax_' . $item] = number_format($tax_value * $currencies->get_value($my_currency), $currencies->get_decimal_places($my_currency));
+ }
+ $item_tax += number_format($tax_value * $currencies->get_value($my_currency), $currencies->get_decimal_places($my_currency));
+ // EOF Tax pre item fix by AlexStudio
+ $parameters['quantity_' . $item] = $order->products[$i]['qty'];
+
+ // BOF shipping & handling fix by AlexStudio
+ $item_has_shipping = true;
+ if (isset($order->products[$i]['attributes'])) {
+ for ($j=0, $n2=sizeof($order->products[$i]['attributes']); $j<$n2; $j++) {
+ if (_cst_bool('DOWNLOAD_ENABLED')) {
+ $attributes_query = "select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix, pad.products_attributes_maxdays, pad.products_attributes_maxcount , pad.products_attributes_filename
+ from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa
+ left join " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad
+ on pa.products_attributes_id=pad.products_attributes_id
+ where pa.products_id = '" . $order->products[$i]['id'] . "'
+ and pa.options_id = '" . $order->products[$i]['attributes'][$j]['option_id'] . "'
+ and pa.options_id = popt.products_options_id
+ and pa.options_values_id = '" . $order->products[$i]['attributes'][$j]['value_id'] . "'
+ and pa.options_values_id = poval.products_options_values_id
+ and popt.language_id = '" . $languages_id . "'
+ and poval.language_id = '" . $languages_id . "'";
+ $attributes = tep_db_query($attributes_query);
+ } else {
+ $attributes = tep_db_query("select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa where pa.products_id = '" . $order->products[$i]['id'] . "' and pa.options_id = '" . $order->products[$i]['attributes'][$j]['option_id'] . "' and pa.options_id = popt.products_options_id and pa.options_values_id = '" . $order->products[$i]['attributes'][$j]['value_id'] . "' and pa.options_values_id = poval.products_options_values_id and popt.language_id = '" . $languages_id . "' and poval.language_id = '" . $languages_id . "'");
+ }
+ $attributes_values = tep_db_fetch_array($attributes);
+ // BOF shipping & handling fix by AlexStudio
+ if (tep_not_null($attributes_values['products_attributes_filename'])) $item_has_shipping = false;
+ // EOF shipping & handling fix by AlexStudio
+
+// Unfortunately PayPal only accepts two attributes per product, so the
+// third attribute onwards will not be shown at PayPal
+ $parameters['on' . $j . '_' . $item] = $attributes_values['products_options_name'];
+ $parameters['os' . $j . '_' . $item] = $attributes_values['products_options_values_name'];
+ }
+ }
+
+ /**
+ @package oscss-major
+ Ajout du report de reduction avce coupon lors construction.
+ Les coupon sont ajouté comme un item
+ */
+ if( tep_session_is_registered( 'coupon' ) && is_object( $order->coupon ) ) {
+ $nu=count($order->products)+1;
+// print_r($order->coupon->coupon);
+ $parameters['item_name_' . $nu] = $order->coupon->coupon['coupons_description'];
+ $parameters['item_number_' . $nu] = $order->coupon->coupon['coupons_id'];
+ $parameters['amount_' . $nu] = number_format(-$order->coupon->coupon['coupons_discount_amount'], $currencies->get_decimal_places($my_currency));
+ $parameters['tax_' . $nu] = number_format(0, $currencies->get_decimal_places($my_currency));
+ $parameters['quantity_' . $nu] = 1;
+ }
+
+
+ // BOF shipping & handling fix by AlexStudio
+ $handling = (isset($order_total['ot_loworderfee'])) ? $order_total['ot_loworderfee'] : '';
+ if ($n == 1 || $item < $n) {
+ $parameters['handling_' . $item] = number_format($handling/$n * $currencies->get_value($my_currency), $currencies->get_decimal_places($my_currency));
+ $handling_added += $parameters['handling_' . $item];
+ } else {
+ $parameters['handling_' . $item] = number_format($handling * $currencies->get_value($my_currency), $currencies->get_decimal_places($my_currency)) - $handling_added;
+ }
+ if ($item_has_shipping) {
+ $shipping_count++;
+ $shipping_items = $n - $virtual_items;
+ $order_total_ot_shipping=(isset($order_total['ot_shipping'])) ? $order_total['ot_shipping'] : 0;
+ if ($shipping_items == 1 || $shipping_count < $shipping_items) {
+ $parameters['shipping_' . $item] = number_format(($order_total_ot_shipping/$shipping_items) * $currencies->get_value($my_currency), $currencies->get_decimal_places($my_currency));
+ $shipping_added += $parameters['shipping_' . $item];
+ } else {
+ $parameters['shipping_' . $item] = number_format($order_total_ot_shipping * $currencies->get_value($my_currency), $currencies->get_decimal_places($my_currency)) - $shipping_added;
+ }
+ }
+ }
+
+
+ $tax_total = number_format($order->info['tax'] * $currencies->get_value($my_currency), $currencies->get_decimal_places($my_currency));
+ if ($tax_total > $item_tax) {
+ $item++;
+ $parameters['item_name_' . $item] = 'Shipping Tax';
+ $parameters['amount_' . $item] = $tax_total - $item_tax;
+ $parameters['quantity_' . $item] = 1;
+ }
+
+ if(_cst_bool('MODULE_PAYMENT_PAYPAL_IPN_MOVE_TAX_TO_TOTAL_AMOUNT')) {
+ $parameters['amount'] = number_format(($subtotal + $order->info['tax']) * $currencies->get_value($my_currency), $currencies->get_decimal_places($my_currency));
+ } else {
+ // default
+ $parameters['amount'] = number_format($subtotal * $currencies->get_value($my_currency), $currencies->get_decimal_places($my_currency));
+ }
+
+ } else {
+ $parameters['cmd'] = '_ext-enter';
+ $parameters['redirect_cmd'] = '_xclick';
+ $parameters['item_name'] = STORE_NAME;
+
+
+ if(_cst_bool('MODULE_PAYMENT_PAYPAL_IPN_MOVE_TAX_TO_TOTAL_AMOUNT')) {
+ $parameters['amount'] = number_format(($subtotal) * $currencies->get_value($my_currency), $currencies->get_decimal_places($my_currency));
+ } else {
+ // default
+ $parameters['amount'] = number_format($subtotal * $currencies->get_value($my_currency), $currencies->get_decimal_places($my_currency));
+ $parameters['tax'] = number_format($order->info['tax'] * $currencies->get_value($my_currency), $currencies->get_decimal_places($my_currency));
+ }
+
+
+ if ($order->content_type != 'virtual') {
+ if (isset($order_total['ot_shipping']))
+ $parameters['shipping'] = number_format($order_total['ot_shipping'] * $currencies->get_value($my_currency), $currencies->get_decimal_places($my_currency));
+ else $parameters['shipping']='0';
+ }
+
+ if (isset($order_total['ot_loworderfee']))
+ $parameters['handling'] = number_format($order_total['ot_loworderfee'] * $currencies->get_value($my_currency), $currencies->get_decimal_places($my_currency));
+ else $parameters['handling']=0;
+
+ }
+
+ // BOF billing address
+ if ($order->content_type != 'virtual') $state_abbr = tep_get_zone_code($order->delivery['country']['id'], $order->delivery['zone_id'], $order->delivery['state']);
+ else $state_abbr = tep_get_zone_code($order->billing['country']['id'], $order->billing['zone_id'], $order->billing['state']);
+
+
+ $parameters['business'] = MODULE_PAYMENT_PAYPAL_IPN_ID;
+
+ // let's check what has been defined in the shop admin for the shipping address
+ if ($order->content_type != 'virtual') $parameters['no_shipping'] = '1';
+ else $parameters['no_shipping'] = '1';
+
+ $parameters['night_phone_b'] = $order->customer['telephone'];
+ $parameters['first_name'] = $order->billing['firstname'];
+ $parameters['last_name'] = $order->billing['lastname'];
+ $parameters['address1'] = $order->billing['street_address'];
+ $parameters['address2'] = $order->billing['suburb'];
+ $parameters['city'] = $order->billing['city'];
+ $parameters['zip'] = $order->billing['postcode'];
+ $parameters['state'] = $state_abbr;
+ $parameters['country'] = $order->billing['country']['iso_code_2'];
+
+ $parameters['email'] = $order->customer['email_address'];
+ $parameters['charset'] = "utf-8"; // Modify this line if you have problems with the character set.
+
+ $parameters['currency_code'] = $my_currency;
+ $parameters['invoice'] = checkout_process::generat_uniq_id(); //date('Y-m').'-'.substr($cart_PayPal_IPN_ID, strpos($cart_PayPal_IPN_ID, '-')+1);
+ $parameters['custom'] = checkout_process::generat_string(); // $customer_id;
+ $parameters['no_note'] = '1';
+ $parameters['notify_url'] = tep_href_link('includes/modules/payment/paypal_ipn/response.php',''/* 'language=' . $_SESSION['language']*/, 'SSL');
+ $parameters['cbt'] = __('confirmation button text');
+ $parameters['return'] = tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL');
+ $parameters['cancel_return'] = tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL');
+ $parameters['bn'] = $this->identifier;
+ $parameters['lc'] = $order->customer['country']['iso_code_2'];
+
+ if (tep_not_null(MODULE_PAYMENT_PAYPAL_IPN_PAGE_STYLE)) {
+ $parameters['page_style'] = MODULE_PAYMENT_PAYPAL_IPN_PAGE_STYLE;
+ }
+
+ if (_cst_bool('MODULE_PAYMENT_PAYPAL_IPN_EWP_STATUS')) $process_button_string=$this->crypt_string($process_button_string);
+ else {
+ reset($parameters);
+ while (list($key, $value) = each($parameters))
+ $process_button_string .= tep_draw_hidden_field($key, $value);
+
+ }
+ return $process_button_string;
+ }
+
+
+ /**
+ Execution page checkout_process
+ s'execute avant enreg classique process.
+ */
+ function before_process() {
+
+ global $cart,$customer_id, $order, $order_totals, $sendto, $billto, $languages_id, $payment, $currencies, $cart, $cart_PayPal_Standard_ID,$insert_id;
+ global $$payment;
+
+
+ $insert_id=$order_id = substr($cart_PayPal_Standard_ID, strpos($cart_PayPal_Standard_ID, '-')+1);
+ $order_total_r=@$order_totals_recup;
+ $cart->reset(true);
+
+ // unregister session variables used during checkout
+ tep_session_unregister('sendto');
+ tep_session_unregister('billto');
+ tep_session_unregister('shipping');
+ tep_session_unregister('payment');
+ tep_session_unregister('comments');
+ tep_session_unregister('order_totals_recup');
+ tep_session_unregister('cart_PayPal_IPN_ID');
+
+ /**
+ return data for send email user, by checkout_process page
+ */
+ return array('insert_id'=>$insert_id,
+ 'order_total'=>$order_total_r,
+ 'customer_notification'=>false
+ );
+ }
+
+
+ /**
+ Execution page checkout_process
+ s'execute apres enreg classique process.
+ */
+ function after_process() {
+ tep_session_unregister('cart_PayPal_IPN_ID');
+ return false;
+ }
+
+ function output_error(){
+ return false;
+ }
+
+
+
+
+ /**
+ Crypt string Data
+ */
+ private function crypt_string($parameters){
+ global $customer_id;
+
+ $parameters['cert_id'] = MODULE_PAYMENT_PAYPAL_IPN_EWP_CERT_ID;
+
+ $random_string = rand(100000, 999999) . '-' . $customer_id . '-';
+
+ $data = '';
+ reset($parameters);
+ while (list($key, $value) = each($parameters)) {
+ $data .= $key . '=' . $value . "\n";
+ }
+
+ $fp = fopen(MODULE_PAYMENT_PAYPAL_IPN_EWP_WORKING_DIRECTORY . '/' . $random_string . 'data.txt', 'w');
+ fwrite($fp, $data);
+ fclose($fp);
+
+ unset($data);
+
+ if (function_exists('openssl_pkcs7_sign') && function_exists('openssl_pkcs7_encrypt')) {
+ openssl_pkcs7_sign(MODULE_PAYMENT_PAYPAL_IPN_EWP_WORKING_DIRECTORY . '/' . $random_string . 'data.txt', MODULE_PAYMENT_PAYPAL_IPN_EWP_WORKING_DIRECTORY . '/' . $random_string . 'signed.txt', file_get_contents(MODULE_PAYMENT_PAYPAL_IPN_EWP_PUBLIC_KEY), file_get_contents(MODULE_PAYMENT_PAYPAL_IPN_EWP_PRIVATE_KEY), array('From' => MODULE_PAYMENT_PAYPAL_IPN_ID), PKCS7_BINARY);
+
+ unlink(MODULE_PAYMENT_PAYPAL_IPN_EWP_WORKING_DIRECTORY . '/' . $random_string . 'data.txt');
+
+// remove headers from the signature
+ $signed = file_get_contents(MODULE_PAYMENT_PAYPAL_IPN_EWP_WORKING_DIRECTORY . '/' . $random_string . 'signed.txt');
+ $signed = explode("\n\n", $signed);
+ $signed = base64_decode($signed[1]);
+
+ $fp = fopen(MODULE_PAYMENT_PAYPAL_IPN_EWP_WORKING_DIRECTORY . '/' . $random_string . 'signed.txt', 'w');
+ fwrite($fp, $signed);
+ fclose($fp);
+ unset($signed);
+ openssl_pkcs7_encrypt(MODULE_PAYMENT_PAYPAL_IPN_EWP_WORKING_DIRECTORY . '/' . $random_string . 'signed.txt', MODULE_PAYMENT_PAYPAL_IPN_EWP_WORKING_DIRECTORY . '/' . $random_string . 'encrypted.txt', file_get_contents(MODULE_PAYMENT_PAYPAL_IPN_EWP_PAYPAL_KEY), array('From' => MODULE_PAYMENT_PAYPAL_IPN_ID), PKCS7_BINARY);
+ unlink(MODULE_PAYMENT_PAYPAL_IPN_EWP_WORKING_DIRECTORY . '/' . $random_string . 'signed.txt');
+// remove headers from the encrypted result
+ $data = file_get_contents(MODULE_PAYMENT_PAYPAL_IPN_EWP_WORKING_DIRECTORY . '/' . $random_string . 'encrypted.txt');
+ $data = explode("\n\n", $data);
+ $data = '-----BEGIN PKCS7-----' . "\n" . $data[1] . "\n" . '-----END PKCS7-----';
+
+ unlink(MODULE_PAYMENT_PAYPAL_IPN_EWP_WORKING_DIRECTORY . '/' . $random_string . 'encrypted.txt');
+ } else {
+ exec(MODULE_PAYMENT_PAYPAL_IPN_EWP_OPENSSL . ' smime -sign -in ' . MODULE_PAYMENT_PAYPAL_IPN_EWP_WORKING_DIRECTORY . '/' . $random_string . 'data.txt -signer ' . MODULE_PAYMENT_PAYPAL_IPN_EWP_PUBLIC_KEY . ' -inkey ' . MODULE_PAYMENT_PAYPAL_IPN_EWP_PRIVATE_KEY . ' -outform der -nodetach -binary > ' . MODULE_PAYMENT_PAYPAL_IPN_EWP_WORKING_DIRECTORY . '/' . $random_string . 'signed.txt');
+ unlink(MODULE_PAYMENT_PAYPAL_IPN_EWP_WORKING_DIRECTORY . '/' . $random_string . 'data.txt');
+ exec(MODULE_PAYMENT_PAYPAL_IPN_EWP_OPENSSL . ' smime -encrypt -des3 -binary -outform pem ' . MODULE_PAYMENT_PAYPAL_IPN_EWP_PAYPAL_KEY . ' < ' . MODULE_PAYMENT_PAYPAL_IPN_EWP_WORKING_DIRECTORY . '/' . $random_string . 'signed.txt > ' . MODULE_PAYMENT_PAYPAL_IPN_EWP_WORKING_DIRECTORY . '/' . $random_string . 'encrypted.txt');
+ unlink(MODULE_PAYMENT_PAYPAL_IPN_EWP_WORKING_DIRECTORY . '/' . $random_string . 'signed.txt');
+
+ $fh = fopen(MODULE_PAYMENT_PAYPAL_IPN_EWP_WORKING_DIRECTORY . '/' . $random_string . 'encrypted.txt', 'rb');
+ $data = fread($fh, filesize(MODULE_PAYMENT_PAYPAL_IPN_EWP_WORKING_DIRECTORY . '/' . $random_string . 'encrypted.txt'));
+ fclose($fh);
+
+ unlink(MODULE_PAYMENT_PAYPAL_IPN_EWP_WORKING_DIRECTORY . '/' . $random_string . 'encrypted.txt');
+ }
+
+ $process_button_string = tep_draw_hidden_field('cmd', '_s-xclick') .
+ tep_draw_hidden_field('encrypted', $data);
+
+ unset($data);
+
+ return $process_button_string;
+ }
+
+
+
+
+
+
+
+
+
+
+ function check() {/* return false;*/
+ if (!isset($this->_check)) {
+ $check_query = tep_db_query("select configuration_key from " . TABLE_CONFIGURATION . " where configuration_key LIKE 'MODULE_PAYMENT_PAYPAL_IPN_%' ");
+ if( tep_db_num_rows($check_query) == count($this->keys()) ) $this->_check=true;
+ else {
+ $this->remove();
+ $this->_check=false;
+ }
+ }
+ return $this->_check;
+ }
+
+ function install() {
+ $DB=Database::getInstance();
+ $check_query = $DB->query("select status_id as orders_status_id from " . TABLE_STATUS . " where status_type='orders' and status_name = 'Preparing [PayPal IPN]' limit 1");
+
+ if (tep_db_num_rows($check_query) < 1) {
+ $status_query = $DB->query("select max(status_id) as status_id from " . TABLE_STATUS);
+ $status = tep_db_fetch_array($status_query);
+
+ $status_id = $status['status_id']+1;
+
+ $languages = tep_get_languages();
+
+ foreach ($languages as $lang) {
+ $DB->query("insert into " . TABLE_STATUS . " (status_id,status_type, language_id, status_name) values ('" . $status_id . "', 'orders','" . $lang['id'] . "', 'Preparing [PayPal IPN]')");
+ }
+ } else {
+ $check = tep_db_fetch_array($check_query);
+
+ $status_id = $check['orders_status_id'];
+ }
+
+
+ $DB->query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Gateway Server', 'MODULE_PAYMENT_PAYPAL_IPN_GATEWAY_SERVER', 'Testing', 'Use the testing (sandbox) or live gateway server for transactions?', '6', '2', 'tep_cfg_select_pull_down(array(\'Testing\'=>\'Testing\',\'Live\'=>\'Live\'), ', now())");
+ $DB->query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort order of display.', 'MODULE_PAYMENT_PAYPAL_IPN_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '3', now())");
+ $DB->query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('E-Mail Address', 'MODULE_PAYMENT_PAYPAL_IPN_ID', '', 'The e-mail address to use for the PayPal IPN service', '6', '5', now())");
+// $DB->query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Transaction Currency', 'MODULE_PAYMENT_PAYPAL_IPN_CURRENCY', 'Selected Currency', 'The currency to use for transactions', '6', '10', ' tep_cfg_select_pull_down(array(\'Only USD\'=>\'Only USD\', \'Only GBP\'=>\'Only GBP\', \'Only AUD\'=>\'Only AUD\', \'Only CAD\'=>\'Only CAD\', \'Only CHF\'=>\'Only CHF\', \'Only CZK\'=>\'Only CZK\', \'Only DKK\'=>\'Only DKK\', \'Only EUR\'=>\'Only EUR\', \'Only HKD\'=>\'Only HKD\', \'Only HUF\'=>\'Only HUF\', \'Only JPY\'=>\'Only JPY\', \'Only NOK\'=>\'Only NOK\', \'Only NZD\'=>\'Only NZD\', \'Only PLN\'=>\'Only PLN\', \'Only SEK\'=>\'Only SEK\', \'Only SGD\'=>\'Only SGD\'), ', now())");
+
+ $DB->query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Transaction Currency', 'MODULE_PAYMENT_PAYPAL_IPN_CURRENCY', 'Selected Currency', 'The currency to use for transactions', '6', '10', ' tep_cfg_select_pull_down(array(\'Only USD\'=>\'Only USD\', \'Only GBP\'=>\'Only GBP\', \'Only AUD\'=>\'Only AUD\', \'Only CAD\'=>\'Only CAD\', \'Only CHF\'=>\'Only CHF\', \'Only CZK\'=>\'Only CZK\', \'Only DKK\'=>\'Only DKK\', \'Only EUR\'=>\'Only EUR\', \'Only HKD\'=>\'Only HKD\' ), ', now())");
+
+ $DB->query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Payment Zone', 'MODULE_PAYMENT_PAYPAL_IPN_ZONE', '0', 'If a zone is selected, only enable this payment method for that zone.', '6', '11', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())");
+
+ $DB->query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Set Preparing Order Status', 'MODULE_PAYMENT_PAYPAL_IPN_PREPARE_ORDER_STATUS_ID', '" . $status_id . "', 'Set the status of prepared orders made with this payment module to this value', '6', '12', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())");
+ $DB->query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Set PayPal Acknowledged Order Status', 'MODULE_PAYMENT_PAYPAL_IPN_ORDER_STATUS_ID', '0', 'Set the status of orders made with this payment module to this value', '6', '13', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())");
+ $DB->query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Set PayPal Completed Order Status', 'MODULE_PAYMENT_PAYPAL_IPN_COMP_ORDER_STATUS_ID', '0', 'Set the status of orders which are confirmed as paid (completed) to this value', '6', '13', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())");
+
+ $DB->query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Transaction Type', 'MODULE_PAYMENT_PAYPAL_IPN_TRANSACTION_TYPE', 'Aggregate', 'Send individual items to PayPal or aggregate all as one total item?', '6', '14', 'tep_cfg_select_pull_down(array(\'Per Item\'=>\'Per Item\',\'Aggregate\'=>\'Aggregate\'), ', now())");
+
+ $DB->query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Move tax to total amount', 'MODULE_PAYMENT_PAYPAL_IPN_MOVE_TAX_TO_TOTAL_AMOUNT', 'True', 'Do you want to move the tax to the total amount? If true PayPal will allways show the total amount including tax. (needs Aggregate instead of Per Item to function)', '6', '15', ' tep_cfg_select_pull_down(array(\'True\'=>\'True\', \'False\'=>\'False\'), ', now() )");
+
+ $DB->query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Page Style', 'MODULE_PAYMENT_PAYPAL_IPN_PAGE_STYLE', '', 'The page style to use for the transaction procedure (defined at your PayPal Profile page)', '6', '20', now())");
+ $DB->query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Debug E-Mail Address', 'MODULE_PAYMENT_PAYPAL_IPN_DEBUG_EMAIL', '', 'All parameters of an Invalid IPN notification will be sent to this email address if one is entered.', '6', '21', now())");
+ $DB->query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('cURL Proxy server', 'MODULE_PAYMENT_PAYPAL_IPN_PROXY_SERVER', '', 'If curl transactions need to go through a proxy, type the address here starting with http://. Otherwise, leave it blank. The current GoDaddy proxy address is http://proxy.shr.secureserver.net:3128', '6', '22', now())");
+ $DB->query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Encrypted Web Payments', 'MODULE_PAYMENT_PAYPAL_IPN_EWP_STATUS', 'False', 'Do you want to enable Encrypted Web Payments?', '6', '30', 'tep_cfg_select_pull_down(array(\'True\'=>\'True\', \'False\'=>\'False\'), ', now())");
+ $DB->query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Your Private Key', 'MODULE_PAYMENT_PAYPAL_IPN_EWP_PRIVATE_KEY', '', 'The location of your Private Key to use for signing the data. (*.pem)', '6', '31', now())");
+ $DB->query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Your Public Certificate', 'MODULE_PAYMENT_PAYPAL_IPN_EWP_PUBLIC_KEY', '', 'The location of your Public Certificate to use for signing the data. (*.pem)', '6', '32', now())");
+ $DB->query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('PayPals Public Certificate', 'MODULE_PAYMENT_PAYPAL_IPN_EWP_PAYPAL_KEY', '', 'The location of the PayPal Public Certificate for encrypting the data.', '6', '33', now())");
+ $DB->query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Your PayPal Public Certificate ID', 'MODULE_PAYMENT_PAYPAL_IPN_EWP_CERT_ID', '', 'The Certificate ID to use from your PayPal Encrypted Payment Settings Profile.', '6', '34', now())");
+ $DB->query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Working Directory', 'MODULE_PAYMENT_PAYPAL_IPN_EWP_WORKING_DIRECTORY', '', 'The working directory to use for temporary files. (trailing slash needed)', '6', '35', now())");
+ $DB->query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('OpenSSL Location', 'MODULE_PAYMENT_PAYPAL_IPN_EWP_OPENSSL', '/usr/bin/openssl', 'The location of the openssl binary file.', '6', '36', now())");
+
+ $DB->query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('".__('Icone pour ce mode paiement')."', 'MODULE_PAYMENT_PAYPAL_IPN_ICON', '', '".addslashes(__("Choix d'un icone"))."', '6', '5', 'tep_cfg_choose_img(', NULL, now())");
+
+ }
+
+ function remove() {
+ tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
+ }
+
+ function keys() {
+ return array( 'MODULE_PAYMENT_PAYPAL_IPN_GATEWAY_SERVER', 'MODULE_PAYMENT_PAYPAL_IPN_ID', 'MODULE_PAYMENT_PAYPAL_IPN_SORT_ORDER', 'MODULE_PAYMENT_PAYPAL_IPN_CURRENCY', 'MODULE_PAYMENT_PAYPAL_IPN_ZONE', 'MODULE_PAYMENT_PAYPAL_IPN_PREPARE_ORDER_STATUS_ID', 'MODULE_PAYMENT_PAYPAL_IPN_ORDER_STATUS_ID', 'MODULE_PAYMENT_PAYPAL_IPN_COMP_ORDER_STATUS_ID', 'MODULE_PAYMENT_PAYPAL_IPN_TRANSACTION_TYPE', 'MODULE_PAYMENT_PAYPAL_IPN_MOVE_TAX_TO_TOTAL_AMOUNT', 'MODULE_PAYMENT_PAYPAL_IPN_PAGE_STYLE', 'MODULE_PAYMENT_PAYPAL_IPN_DEBUG_EMAIL', 'MODULE_PAYMENT_PAYPAL_IPN_PROXY_SERVER', 'MODULE_PAYMENT_PAYPAL_IPN_EWP_STATUS', 'MODULE_PAYMENT_PAYPAL_IPN_EWP_PRIVATE_KEY', 'MODULE_PAYMENT_PAYPAL_IPN_EWP_PUBLIC_KEY', 'MODULE_PAYMENT_PAYPAL_IPN_EWP_PAYPAL_KEY', 'MODULE_PAYMENT_PAYPAL_IPN_EWP_CERT_ID', 'MODULE_PAYMENT_PAYPAL_IPN_EWP_WORKING_DIRECTORY', 'MODULE_PAYMENT_PAYPAL_IPN_EWP_OPENSSL','MODULE_PAYMENT_PAYPAL_IPN_ICON');
+ }
+}
+?>
Property changes on: trunk/extensions/PAYPAL_IPN_stable/catalog/includes/modules/payment/paypal_ipn/paypal_ipn.php
___________________________________________________________________
Added: svn:executable
+ *
Added: trunk/extensions/PAYPAL_IPN_stable/catalog/includes/modules/payment/paypal_ipn/response.php
===================================================================
--- trunk/extensions/PAYPAL_IPN_stable/catalog/includes/modules/payment/paypal_ipn/response.php (rev 0)
+++ trunk/extensions/PAYPAL_IPN_stable/catalog/includes/modules/payment/paypal_ipn/response.php 2012-01-23 14:16:55 UTC (rev 4022)
@@ -0,0 +1,232 @@
+<?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 01/11/10, 09:31
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+
+ @subpackage paypal_ipn <www http://plugins.oscss.org>
+ @file response.php
+*/
+ chdir('../../../../');
+ require('includes/application_top.php');
+
+
+ $payment_modules = new payment('paypal_ipn');
+
+ $parameters = 'cmd=_notify-validate';
+
+ foreach ($_POST as $key => $value) {
+ $parameters .= '&' . $key . '=' . urlencode(stripslashes($value));
+ }
+
+ if (MODULE_PAYMENT_PAYPAL_IPN_GATEWAY_SERVER == 'Live') $server = 'www.paypal.com';
+ else $server = 'www.sandbox.paypal.com';
+
+ $fsocket = false;
+ $curl = false;
+ $result = false;
+
+ if ( (PHP_VERSION >= 4.3) && ($fp = @fsockopen('ssl://' . $server, 443, $errno, $errstr, 30)) ) $fsocket = true;
+ elseif (function_exists('curl_exec')) $curl = true;
+ elseif ($fp = @fsockopen($server, 80, $errno, $errstr, 30)) $fsocket = true;
+
+ if ($fsocket == true) {
+ $header = 'POST /cgi-bin/webscr HTTP/1.0' . "\r\n" .
+ 'Host: ' . $server . "\r\n" .
+ 'Content-Type: application/x-www-form-urlencoded' . "\r\n" .
+ 'Content-Length: ' . strlen($parameters) . "\r\n" .
+ 'Connection: close' . "\r\n\r\n";
+
+ @fputs($fp, $header . $parameters);
+
+ $string = '';
+ while (!@feof($fp)) {
+ $res = @fgets($fp, 1024);
+ $string .= $res;
+
+ if ( ($res == 'VERIFIED') || ($res == 'INVALID') ) {
+ $result = $res;
+ break;
+ }
+ }
+
+ @fclose($fp);
+ } elseif ($curl == true) {
+ $ch = curl_init();
+
+ // For the poor souls on GoDaddy and the like, set the connection to go through their proxy
+ if (trim(MODULE_PAYMENT_PAYPAL_IPN_PROXY_SERVER) != '') {
+ curl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);
+ curl_setopt($ch, CURLOPT_PROXY, MODULE_PAYMENT_PAYPAL_IPN_PROXY_SERVER);
+ }
+
+ curl_setopt($ch, CURLOPT_URL, 'https://' . $server . '/cgi-bin/webscr');
+ curl_setopt($ch, CURLOPT_POST, true);
+ curl_setopt($ch, CURLOPT_POSTFIELDS, $parameters);
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
+ curl_setopt($ch, CURLOPT_HEADER, false);
+ curl_setopt($ch, CURLOPT_TIMEOUT, 30);
+ curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
+
+ $result = curl_exec($ch);
+
+ curl_close($ch);
+ }
+
+
+
+
+ if (strtoupper($result) == 'VERIFIED') {
+
+ //! check and extract id process pre-order
+ $pre_order_id=(isset($_POST['custom'])) ? checkout_process::check_string_return($_POST['custom']) : false ;
+
+ if((int)$pre_order_id>0) {
+
+ $aca_modules = new checkout_process();
+
+ /// enregsitrement commande
+ $res=$aca_modules->preventDuplicate(array('pre_order_id'=>$pre_order_id));
+
+ $order_id_invoice=$res['the_order_id'];
+
+ $order = new order($order_id_invoice);
+
+ // let's update the order status
+ $total_query = tep_db_query("select value from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . $order_id_invoice . "' and class = 'ot_total' limit 1");
+ $total = tep_db_fetch_array($total_query);
+
+ $comment_status = 'payment status: ' . $_POST['payment_status'] . ' (' . ucfirst($_POST['payer_status']) . '; ' . $currencies->format($_POST['mc_gross'], false, $_POST['mc_currency']) . ')';
+
+ if ($_POST['payment_status'] == 'Pending')
+ $comment_status .= '; ' . $_POST['pending_reason'];
+ elseif ( ($_POST['payment_status'] == 'Reversed') || ($_POST['payment_status'] == 'Refunded') )
+ $comment_status .= '; ' . $_POST['reason_code'];
+ elseif ( ($_POST['payment_status'] == 'Completed') && (tep_not_null($_POST['address_street'])) )
+ $comment_status .= ", \n" . PAYPAL_ADDRESS . ": " . $_POST['address_name'] . ", " . $_POST['address_street'] . ", " . $_POST['address_city'] . ", " . $_POST['address_zip'] . ", " . $_POST['address_state'] . ", " . $_POST['address_country'] . ", " . $_POST['address_country_code'] . ", " . $_POST['address_status'];
+
+
+ $order_status_id = DEFAULT_ORDERS_STATUS_ID;
+
+ // variances of up to 0.05 on either side (plus / minus) are ignored
+ if ((((number_format($total['value'] * $order_db['currency_value'], $currencies->get_decimal_places($order_db['currency']))) - $_POST['mc_gross']) <= 0.05)
+ &&
+ (((number_format($total['value'] * $order_db['currency_value'], $currencies->get_decimal_places($order_db['currency']))) - $_POST['mc_gross']) >= -0.05)) {
+
+ // Terra -> modified update. If payment status is "completed" than a completed order status is chosen based on the admin settings
+ if ( (MODULE_PAYMENT_PAYPAL_IPN_COMP_ORDER_STATUS_ID > 0) && ($_POST['payment_status'] == 'Completed') ) $order_status_id = MODULE_PAYMENT_PAYPAL_IPN_COMP_ORDER_STATUS_ID;
+ elseif (MODULE_PAYMENT_PAYPAL_IPN_ORDER_STATUS_ID > 0) $order_status_id = MODULE_PAYMENT_PAYPAL_IPN_ORDER_STATUS_ID;
+ }
+
+ // Let's see what the PayPal payment status is and set the notification accordingly
+ // more info: https://www.paypal.com/IntegrationCenter/ic_ipn-pdt-variable-reference.html
+ if ( ($_POST['payment_status'] == 'Pending') || ($_POST['payment_status'] == 'Completed')) $customer_notified = '1';
+ else $customer_notified = '0';
+
+
+ /**
+ Process class
+ */
+
+ $aca_modules->update_status_order($order_status_id);
+
+ /**
+ Process class
+ */
+
+ $sql_data_array = array('orders_status_id' => $order_status_id,
+ 'customer_notified' => $customer_notified,
+ 'comments' => 'PayPal IPN Verified [' . $comment_status . ']');
+
+ $aca_modules->insert_status_history($sql_data_array);
+
+
+
+ //! START STATUS == COMPLETED LOOP
+ // If the order is completed, then we want to send the order email and update the stock
+ if (strtoupper($_POST['payment_status']) == 'COMPLETED') {
+
+ $products_ordered = '';
+ $total_tax = 0;
+
+ $myarray = array(
+ 'from'=>STORE_OWNER,
+ 'subject'=>'',
+ '_oID'=>$order_id_invoice,
+ 'date_purchased'=>tep_strftime(DATE_FORMAT_LONG),
+ '_oLinks'=>tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $order_id_invoice, 'SSL', false),
+ 'date_purchased'=>tep_strftime(DATE_FORMAT_LONG),
+ 'email_use_html'=>_cst_bool('EMAIL_USE_HTML'),
+ 'notify_comments'=>$comment_status,
+ '_ostatus'=>$order->info['orders_status'],
+ 'message'=>'',
+ );
+ $message_final=tep_post_prepare_email('checkout_process.tpl',$language,$myarray);
+// $message_final=tep_post_prepare_email('orders.tpl',$language,$myarray);
+
+ tep_mail($order->customer['name'], $order->customer['email_address'], __('email text subject for ipn'), $message_final, STORE_OWNER, EMAIL_FROM);
+
+
+ if (SEND_EXTRA_ORDER_EMAILS_TO != '')
+ tep_mail('', SEND_EXTRA_ORDER_EMAILS_TO, __('email text subject for ipn'), $email_order, STORE_OWNER, EMAIL_FROM);
+
+ }
+
+ if (strtoupper($_POST['payment_status']) == 'PENDING') {
+ $myarray = array(
+ 'from'=>STORE_OWNER,
+ 'subject'=>'',
+ '_oID'=>$order_id_invoice,
+ 'date_purchased'=>tep_strftime(DATE_FORMAT_LONG),
+ '_oLinks'=>tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $order_id_invoice, 'SSL', false),
+ 'date_purchased'=>tep_strftime(DATE_FORMAT_LONG),
+ 'email_use_html'=>_cst_bool('EMAIL_USE_HTML'),
+ 'notify_comments'=>__('email text paypal pending notice'),
+ '_ostatus'=>$order->info['orders_status'],
+ 'message'=>'',
+ );
+ $message_final=tep_post_prepare_email('checkout_process.tpl',$language,$myarray);
+
+ tep_mail($order->customer['name'], $order->customer['email_address'], __('email text subject for ipn pending notice'), $message_final, STORE_OWNER, EMAIL_FROM);
+
+
+ if (SEND_EXTRA_ORDER_EMAILS_TO != '')
+ tep_mail('', SEND_EXTRA_ORDER_EMAILS_TO, __('email text subject for ipn'), $message_final, STORE_OWNER, EMAIL_FROM);
+
+ }
+
+ }
+ //! error retunr information by paypal
+ else
+ tep_mail('', MODULE_PAYMENT_PAYPAL_IPN_DEBUG_EMAIL, 'PayPal IPN Invalid check string', $_POST['custom'], STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
+
+ }
+
+
+ /** REPONSE INVALID */
+ else {
+
+ /**
+ Email debuggage
+ */
+ if (tep_not_null(MODULE_PAYMENT_PAYPAL_IPN_DEBUG_EMAIL)) {
+ $email_body =$result;
+ $email_body .= '$_POST:' . "\n\n";
+ foreach ($_POST as $key => $value) {
+ $email_body .= $key . '=' . $value . "\n";
+ }
+ $email_body .= "\n" . '$_GET:' . "\n\n";
+ foreach ($_GET as $key => $value) {
+ $email_body .= $key . '=' . $value . "\n";
+ }
+ tep_mail('', MODULE_PAYMENT_PAYPAL_IPN_DEBUG_EMAIL, 'PayPal IPN Invalid Process', $email_body.$string, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
+ }
+
+ }
+
+ require('includes/application_bottom.php');
+?>
Property changes on: trunk/extensions/PAYPAL_IPN_stable/catalog/includes/modules/payment/paypal_ipn/response.php
___________________________________________________________________
Added: svn:executable
+ *
Added: trunk/extensions/PAYPAL_IPN_stable/install.xml
===================================================================
--- trunk/extensions/PAYPAL_IPN_stable/install.xml (rev 0)
+++ trunk/extensions/PAYPAL_IPN_stable/install.xml 2012-01-23 14:16:55 UTC (rev 4022)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<contrib>
+ <description>
+ <details contrib_ref="" forum_ref="" contrib_type="module, payment" status="0" last_update="2010-01-11" />
+ <author_pkg>www.oscss.org</author_pkg>
+ <comments><![CDATA[ ]]>
+ </comments>
+ <credits>oscim</credits>
+ <version>1.0</version>
+ <post_install_notes><![CDATA[ ]]></post_install_notes>
+ </description>
+
+ <addfile>
+ <file name="includes/modules/payment/paypal_ipn/paypal_ipn.php" />
+ <file name="includes/modules/payment/paypal_ipn/response.php" />
+ <file name="includes/modules/payment/paypal_ipn/cert_key_pem.txt" />
+ <file name="includes/modules/payment/paypal_ipn/.htaccess" />
+ </addfile>
+
+ <addfilelg>
+ <file name="includes/languages/%LANGUAGE%/modules/payment/paypal_ipn/paypal_ipn.txt" lgref="fr_FR"/>
+ </addfilelg>
+</contrib>
\ 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...> - 2012-01-23 13:02:16
|
Revision: 4021
http://oscss.svn.sourceforge.net/oscss/?rev=4021&view=rev
Author: oscim
Date: 2012-01-23 13:02:10 +0000 (Mon, 23 Jan 2012)
Log Message:
-----------
correction coquille
Modified Paths:
--------------
trunk/catalog/Documents/admin/data/repository_sources.xml
trunk/catalog/Documents/oscss.version.xml
trunk/catalog/admin/includes/exts/package/packageRepository.php
trunk/catalog/admin/includes/modules/pages/package.php
Modified: trunk/catalog/Documents/admin/data/repository_sources.xml
===================================================================
--- trunk/catalog/Documents/admin/data/repository_sources.xml 2012-01-18 22:02:29 UTC (rev 4020)
+++ trunk/catalog/Documents/admin/data/repository_sources.xml 2012-01-23 13:02:10 UTC (rev 4021)
@@ -5,7 +5,7 @@
<title>Official</title>
<key>official</key>
<description>official repository</description>
- <repository>http://localhost/plugins.oscss.org/services.php</repository>
+ <repository>http://plugins.oscss.org/services.php</repository>
<ident>
<user></user>
<token></token>
Modified: trunk/catalog/Documents/oscss.version.xml
===================================================================
--- trunk/catalog/Documents/oscss.version.xml 2012-01-18 22:02:29 UTC (rev 4020)
+++ trunk/catalog/Documents/oscss.version.xml 2012-01-23 13:02:10 UTC (rev 4021)
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<core>
- <version>2.1.1 (dev)</version>
- <svn>3885</svn>
- <level>stable</level>
+ <version>2.1.1 (beta)</version>
+ <svn>4020</svn>
+ <level>unstable</level>
<template_admin>oscss</template_admin>
<urloscssorgtrac>http://sourceforge.net/apps/trac/oscss/changeset/?format=zip&new=SVN_REV_MAX&old=SVN_REV&new_path=trunk%2Fcatalog&old_path=trunk%2Fcatalog</urloscssorgtrac>
Modified: trunk/catalog/admin/includes/exts/package/packageRepository.php
===================================================================
--- trunk/catalog/admin/includes/exts/package/packageRepository.php 2012-01-18 22:02:29 UTC (rev 4020)
+++ trunk/catalog/admin/includes/exts/package/packageRepository.php 2012-01-23 13:02:10 UTC (rev 4021)
@@ -12,6 +12,7 @@
if(!class_exists('package')) include_once(DIR_WS_MODULES .'pages/package.php');
+error_reporting(E_ALL);
class packageRepository
extends package {
@@ -95,7 +96,12 @@
/**
- @brief Test connextion and content
+ @brief Test connection and content
+ This function initialise connection in repository url, and ceck retrun content result or error
+ This service in depot is normalise
+ @param $repo string url source depot
+ @param $action [value saction string] name action
+ @return result or false
*/
public static function InitConnexion($repo, $action = ''){
global $messageStack;
@@ -112,8 +118,7 @@
}
if(isset($Repos->error)){
- $messageStack->add_session(sprintf(__('package packageRepository error in process for repository %s :>> %s') , $repo->repository , addslashes(self::FomatError($Repos->error )) ),'error' );
- break;
+ $messageStack->add_session(sprintf(__('package packageRepository error in process for repository %s :>> %s') , $repo->repository , self::FomatError($Repos->error ) ),'error' );
}
return $Repos;
@@ -215,14 +220,6 @@
}
else{
-
-// if(!$re= fileUtility::url_fopen( self::HrefSrc($repo, 'listing') ) )
-// $messageStack->add_session('recuperation repository impossible :'.$repo->repository,'error' );
-// else {
-//
-// if(!$Repos = simplexml_load_string($re))
-// $messageStack->add_session('Impossible lire le contenu :'.$repo->title,'error' );
-// else
if($Repos = self::InitConnexion($repo, 'listing') ){
//! compteur entree / repository
@@ -234,8 +231,7 @@
$objres=$Repos->channel->item;
foreach($objres as $item){
-// print_r($item);
-// exit;
+
if(!isset($temparray[md5((string)$item->ident.'_'.(string)$item->level)]) ) {
$item->sourceTitle=(string)$repo->title;
$item->sourceKey=(string)$repo->key;
@@ -265,9 +261,6 @@
}
-// }
-
-
}
//! mise en cache global
$var_file['global']['last_update']= date("Y-m-d H:n:s");
@@ -279,8 +272,6 @@
// if(count($var_file)==0) throw new Exception('Erreur recuperation');
-
-
fileUtility::_unlink(DIR_FS_ROOT_DOCS.'admin/data/'.parent::REPOSITORY_DATA);
if($dom->save(DIR_FS_ROOT_DOCS.'admin/data/'.parent::REPOSITORY_DATA) !=true)
@@ -291,7 +282,6 @@
}
catch(Exception $e){
$messageStack->add_session($e->getMessage(),'error' );
-// $messageStack->add($e->getMessage(),'error' );
}
return true;
}
Modified: trunk/catalog/admin/includes/modules/pages/package.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/package.php 2012-01-18 22:02:29 UTC (rev 4020)
+++ trunk/catalog/admin/includes/modules/pages/package.php 2012-01-23 13:02:10 UTC (rev 4021)
@@ -98,8 +98,8 @@
public function __construct() {
self::GetConf();
- include_once(DIR_WS_FUNCTIONS.'lib.cip_manager.php');
- include_once(DIR_WS_FUNCTIONS.'lib.configuration.php');
+ include_once(DIR_WS_FUNCTIONS.'lib.cip_manager.php');
+ include_once(DIR_WS_FUNCTIONS.'lib.configuration.php');
}
@@ -116,8 +116,8 @@
self::$type_data=(isset($_GET['type_data'])?$_GET['type_data']: 'package');
$mode=(isset($_GET['mode'])?$_GET['mode']:'');
-// var_dump( self::$type_data);
+
/**
@remarks not load if not first init
*/
@@ -178,9 +178,10 @@
break;
case 'source_update':
-// // self::$objChild->SourceUpdate();
if(self::$objChild->SourceUpdate()==true)
tep_redirect(tep_href_link(self::FILENAME));
+
+ tep_redirect(tep_href_link(self::FILENAME));
break;
case 'download':
$class=self::$code.'Installer';
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2012-01-18 22:02:37
|
Revision: 4020
http://oscss.svn.sourceforge.net/oscss/?rev=4020&view=rev
Author: oscim
Date: 2012-01-18 22:02:29 +0000 (Wed, 18 Jan 2012)
Log Message:
-----------
BO: Correction d'une coquille sur le la function de traitement des liens vers le catalog public
Amelioration des liens du backend direct vers une ressource de type datatype dans le frontend
Report d'une nouvelle fonction au sein des requetes sql des datadriver public
Ajustement du liens des liens dans la gestions des categorie, et ajout d'un liens de ce type dans les produits
Modified Paths:
--------------
trunk/catalog/admin/includes/functions/html_output.php
trunk/catalog/admin/includes/modules/pages/categories.php
trunk/catalog/admin/includes/modules/pages/products.php
trunk/catalog/includes/classes/drivers/data/categorie.php
trunk/catalog/includes/classes/drivers/data/content.php
trunk/catalog/includes/classes/drivers/data/product.php
trunk/catalog/includes/functions/general.php
Modified: trunk/catalog/admin/includes/functions/html_output.php
===================================================================
--- trunk/catalog/admin/includes/functions/html_output.php 2012-01-18 17:13:31 UTC (rev 4019)
+++ trunk/catalog/admin/includes/functions/html_output.php 2012-01-18 22:02:29 UTC (rev 4020)
@@ -1,10 +1,10 @@
<?php
/**
- @licence GPL 2005-2011 The osCSS developers - osCSS Open Source E-commerce
+ @licence GPL 2005-2012 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/11/11, 22:53
+ @version 2.1.2
+ @date 18/01/2012, 22:53
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
*/
@@ -30,25 +30,27 @@
}
/**
- @version 2.0
- @brief Ultimate SEO URLs v2.1 The HTML href link wrapper function Or href classic
+ @fn tep_catalog_href_link($page = '', $parameters = '', $connection = 'NONSSL', $linkadmin= true, $linkvaradmin = 'admin')
+ @brief Link in Public Catalog. Use for direct link un frontend.
@param $page string name page destination
@param $parameters Get value
@param $linkadmin bool add link for connectin front for admin user
+ @param $linkvaradmin string name var put in get params
+ @return href link for specified public pages
*/
if (_cst_bool('SEO_ENABLED')) {
- function tep_catalog_href_link($page = '', $parameters = '', $connection = 'NONSSL', $linkadmin= true) {
+ function tep_catalog_href_link($page = '', $parameters = '', $connection = 'NONSSL', $linkadmin= true, $linkvaradmin = 'admin') {
global $languages_id,$SecuKey;
$add_session_id = true;
$search_engine_safe = true;
/// force offline mode
- if($linkadmin)$parameters =(empty($parameters)? '' : '&' ).'admin='.md5($SecuKey);
+ if($linkadmin)$parameters .=(empty($parameters)? '' : '&' ).$linkvaradmin.'='.md5($SecuKey);
$seo_urls = seo_url::getInstance($languages_id);
return preg_replace('/&/','&',$seo_urls->href_link($page, $parameters, $connection, $add_session_id));
}
} else {
- function tep_catalog_href_link($page = '', $parameters = '', $connection = 'NONSSL', $linkadmin= true) {
+ function tep_catalog_href_link($page = '', $parameters = '', $connection = 'NONSSL', $linkadmin= true, $linkvaradmin = 'admin') {
global $SecuKey;
if ($connection == 'NONSSL') $link = HTTP_SERVER . DIR_WS_HTTP_CATALOG;
@@ -56,7 +58,7 @@
else die('<br /><br /><span class="error"><strong>Error!</strong><br /><br /><strong>Unable to determine connection method on a link!<br /><br />Known methods: NONSSL SSL<br /><br />Function used:<br /><br />tep_href_link(\'' . $page . '\', \'' . $parameters . '\', \'' . $connection . '\')</strong></span>');
/// force offline mode
- if($linkadmin)$parameters =(empty($parameters)? '' : '&' ).'admin='.md5($SecuKey);
+ if($linkadmin)$parameters .=(empty($parameters)? '' : '&' ).$linkvaradmin.'='.md5($SecuKey);
if ($parameters == '')$link .= $page;
else $link .= $page . '?' . $parameters;
Modified: trunk/catalog/admin/includes/modules/pages/categories.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/categories.php 2012-01-18 17:13:31 UTC (rev 4019)
+++ trunk/catalog/admin/includes/modules/pages/categories.php 2012-01-18 22:02:29 UTC (rev 4020)
@@ -442,7 +442,7 @@
private static function get_item_action($categories){
return sprintf(
CsrtAction::getFormat('row_action'),
- sprintf(CsrtAction::getLink('row_action_right', __('image view public') , 'publiclink'), '', tep_catalog_href_link('index.php', 'cPath=' . $categories['cPath']) ,' target="blank" ' ).
+ sprintf(CsrtAction::getLink('row_action_right', __('image view public') , 'publiclink'), '', tep_catalog_href_link('index.php', 'cPath=' . $categories['cPath'],'SSL', true, 'forceview') ,' target="blank" ' ).
sprintf(CsrtAction::getLink('row_action_right', IMAGE_EDIT, 'edit'), '', tep_href_link(self::FILENAME, 'cPath=' . self::$cPath . '&cID=' . $categories['categories_id'] . '&action=edit' ),'' ).
sprintf(CsrtAction::getLink('row_action_right', IMAGE_DELETE, 'delete'), 'fancy', tep_href_link(self::FILENAME, 'cPath=' . self::$cPath . '&cID=' . $categories['categories_id'] . '&action=delete') ,'' ),
sprintf(CsrtAction::getLink('row_action_right', ICON_FOLDER, 'dir'), '', tep_href_link(self::FILENAME, 'cPath=' . $categories['cPath'] ),'' )
Modified: trunk/catalog/admin/includes/modules/pages/products.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/products.php 2012-01-18 17:13:31 UTC (rev 4019)
+++ trunk/catalog/admin/includes/modules/pages/products.php 2012-01-18 22:02:29 UTC (rev 4020)
@@ -450,6 +450,7 @@
return sprintf(
CsrtAction::getFormat('row_action'),
self::$modules->display_ColumnRowAction($products['products_id']) ,
+ sprintf(CsrtAction::getLink('row_action_right', __('image view public') , 'publiclink'), '', tep_catalog_href_link('index.php', 'products_id=' . $products['products_id'],'SSL', true, 'forceview') ,' target="blank" ' ).
sprintf(CsrtAction::getLink('row_action_right', IMAGE_COPY_TO, 'copyto'), 'fancy', tep_href_link(self::FILENAME, 'pID=' . $products['products_id'] . '&action=copy_to') ,'' ).
sprintf(CsrtAction::getLink('row_action_right', IMAGE_EDIT, 'edit'), '', tep_href_link(self::FILENAME, 'pID=' . $products['products_id'] . '&action=new_product') ,'' ).
sprintf(CsrtAction::getLink('row_action_right', IMAGE_DELETE, 'delete'), 'fancy', tep_href_link(self::FILENAME, 'pID=' . $products['products_id'] . '&action=delete_product') ,'' ).
Modified: trunk/catalog/includes/classes/drivers/data/categorie.php
===================================================================
--- trunk/catalog/includes/classes/drivers/data/categorie.php 2012-01-18 17:13:31 UTC (rev 4019)
+++ trunk/catalog/includes/classes/drivers/data/categorie.php 2012-01-18 22:02:29 UTC (rev 4020)
@@ -153,7 +153,7 @@
* @param $option
*/
protected static function cstr_query($orderby='', $limit='', $option=''){
- $query="SELECT c.categories_id, parent_id, cd.categories_description, c.categories_image, cd.categories_name, sortchids_products, sortchids_content FROM " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd WHERE c.categories_status='1' AND c.categories_id = cd.categories_id AND cd.language_id = '" . self::$lg_id . "' ";
+ $query="SELECT c.categories_id, parent_id, cd.categories_description, c.categories_image, cd.categories_name, sortchids_products, sortchids_content FROM " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd WHERE " . DataForceStatus(" c.categories_status='1' AND ") . " c.categories_id = cd.categories_id AND cd.language_id = '" . self::$lg_id . "' ";
$query .=self::$where_query;
$query .=' ORDER BY ' .(!tep_not_null($orderby)? ' c.sort_order, cd.categories_name ASC ' : $orderby) ;
Modified: trunk/catalog/includes/classes/drivers/data/content.php
===================================================================
--- trunk/catalog/includes/classes/drivers/data/content.php 2012-01-18 17:13:31 UTC (rev 4019)
+++ trunk/catalog/includes/classes/drivers/data/content.php 2012-01-18 22:02:29 UTC (rev 4020)
@@ -135,7 +135,7 @@
protected static function cstr_query($orderby='', $limit='', $option=''){
$query="SELECT content_title AS title, c.content_id AS id, c.content_name AS name, content_text AS text, c.date_added as date_added
FROM " . TABLE_CONTENT_DESCRIPTION . " cd, " . TABLE_CONTENT . " c, " . TABLE_CONTENT_TO_CATEGORIES . " ctc, " . TABLE_CATEGORIES . " cat
- WHERE cat.categories_id=ctc.categories_id and cat.categories_status='1' AND c.content_status = '1' AND c.content_id = ctc.content_id AND cd.content_id = ctc.content_id AND cd.language_id = '" . self::$lg_id . "' " ;
+ WHERE cat.categories_id=ctc.categories_id " . DataForceStatus(" AND cat.categories_status='1' ") . " " . DataForceStatus(" AND c.content_status = '1' ") . " AND c.content_id = ctc.content_id AND cd.content_id = ctc.content_id AND cd.language_id = '" . self::$lg_id . "' " ;
$query .=self::$where_query;
$query .=' ORDER BY ' .(!tep_not_null($orderby)? ' c.sort_order, c.content_name ASC ' : $orderby) ;
Modified: trunk/catalog/includes/classes/drivers/data/product.php
===================================================================
--- trunk/catalog/includes/classes/drivers/data/product.php 2012-01-18 17:13:31 UTC (rev 4019)
+++ trunk/catalog/includes/classes/drivers/data/product.php 2012-01-18 22:02:29 UTC (rev 4020)
@@ -253,8 +253,9 @@
$query="SELECT distinct p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price,p.track_stock, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id, pd.products_viewed, p2c.categories_id, p.products_weight, products_type as type
FROM " . TABLE_PRODUCTS . " p , " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c
- WHERE p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '" . self::$lg_id . "' and p2c.products_id=p.products_id and c.categories_id=p2c.categories_id and c.categories_status='1' " ;
+ WHERE " . DataForceStatus(" p.products_status = '1' AND ") . " pd.products_id = p.products_id and pd.language_id = '" . self::$lg_id . "' and p2c.products_id=p.products_id and c.categories_id=p2c.categories_id " . DataForceStatus(" AND c.categories_status='1' ") . " " ;
+
$query .=self::$where_query;
$query .=' ORDER BY ' .(!tep_not_null($orderby)? ' p.products_date_added DESC ' : $orderby) ;
$query .=' LIMIT '.(!tep_not_null($limit)? '1' : $limit) ;
Modified: trunk/catalog/includes/functions/general.php
===================================================================
--- trunk/catalog/includes/functions/general.php 2012-01-18 17:13:31 UTC (rev 4019)
+++ trunk/catalog/includes/functions/general.php 2012-01-18 22:02:29 UTC (rev 4020)
@@ -1080,6 +1080,20 @@
return $f;
}
+/**
+ @fn DataForceStatus($clause)
+ @brief this function force status on datatype Required for admin view off data
+ @note use in sql Requete, next clause where and prev other clause
+ @param $clause string clause normal control status ( c.status='1' AND )
+ @return normal clause status or empty string
+*/
+function DataForceStatus($clause){
+ global $SecuKey;
+ if ( ( !empty($SecuKey) && (strlen($SecuKey)==40) && isset($_GET['forceview']) && (string)$_GET['forceview'] ==md5($SecuKey)) )
+ return '';
+ else
+ return ' '.$clause.' ';
+}
/** Alias */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|