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...> - 2014-05-26 08:34:55
|
Revision: 5204
http://sourceforge.net/p/oscss/svn/5204
Author: oscim
Date: 2014-05-26 08:34:52 +0000 (Mon, 26 May 2014)
Log Message:
-----------
Fix
Modified Paths:
--------------
trunk/catalog/admin/includes/modules/pages/customers.php
Modified: trunk/catalog/admin/includes/modules/pages/customers.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/customers.php 2014-05-15 15:13:39 UTC (rev 5203)
+++ trunk/catalog/admin/includes/modules/pages/customers.php 2014-05-26 08:34:52 UTC (rev 5204)
@@ -1,451 +1,1081 @@
<?php if (!defined('HTTP_SERVER')) die('You can not access this file directly!');
/**
- @licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
- @portion code Copyright (c) 2002 osCommerce
+ @licence GPL 2005-2014 The osCSS developers - osCSS Open Source E-commerce
@package osCSS-2 <www http://www.oscss.org>
- @version 2.1.1
- @date 16/11/11, 23:36
+ @version 2.2.0
+ @date 18/09/13, 09:44
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
- @class sqlcustomer
+ @file customers.php
+ @dir admin/includes/modules/pages/
*/
-require_once( DIR_FS_ADMIN . DIR_WS_CLASSES . 'drivers/sqllinkto.php');
+require_once(DIR_FS_ADMIN . DIR_WS_CLASSES .'ModTreePage.php');
+
+require_once(DIR_FS_ADMIN . DIR_WS_CLASSES .'listeners/EventMessListener.php');
+
/**
- @class sqlcustomer
- @brief manage db update/insert/delete
+ @class customers
*/
-class sqlcustomer
- extends SqlFilesDataDriverClass
- implements ModSqlDataDriver{
+class customers
+ extends ModTreePage /// new abstract class for nextgen module
+ implements
+
+ InterfaceModule
+
+ // base module config structure
+ ,ExtModConfig
- public static $modules;
+ // global GetConf methode
+ ,IntModTree
+ // datatable and editable by ajax
+ ,InterfacedTJsonS
+ // detail row in chidls
+ ,InterfacedInnerHtml
+ // use filter generic
+ , FilterTabsData
+
+ // Events Interface for display and exec all notification
+ , EventMessInterface
+ {
- protected static $_instance;
+ const FILENAME = FILENAME_CUSTOMERS;
- protected function __construct(){
- self::$modules=new AcaFactory('account'/*,'MODULE_ACACAT_INSTALLED_BO'*/);
-// self::$modules->set_image_handler();
- }
-
-
-
/**
- @brief create new ligne in table configuration
+ @var array $actions
*/
- public static function create($option){
- new self();
+ public static $actions;
+ /**
+ @var array $languages
+ */
+ public static $languages;
+ /**
+ @var array $newsletter_array
+ */
+ public static $newsletter_array;
+ /**
+ @var bool $processed
+ */
+ public static $processed;
+ /**
+ @var array $DiversInfo transport var
+ */
+ public static $DiversInfo;
+ /**
+ @var obj $box
+ */
+ public static $box;
+ /**
+ @var bool $error
+ */
+ public static $error=false;
- if(!isset($option['password']) || !isset($option['email']) )
- return false;
+ public function __construct(){
+ self::Clean();
+ self::GetConf();
+ }
+
+ public static function GetConf(){
+ global $languages_id, $conf;
+
+ self::PreLoad(__CLASS__, 'customer' , $languages_id);
+ /**
+ @remarks Call and init all class required for display, event, process
+ */
$DB=Database::getInstance();
- $error = 0 ;
+ //
+ self::$modules=new AcaFactory('account');
- $_post = (isset($option['post'])? $option['post'] : array() );
- $sqlarray = $option['sqlarray'];
+
+ /**
+ @remarks not load if not first init
+ */
+ if(!defined('JSONSTATMENT')){
+ //! active datatable in ajax, precise les GET necessaire
+ if(!defined('JSONSTATMENT')) define('JSONSTATMENT', 'ModTwo=true&mod=page&type='.self::$code );
+ //! detail item in ajax
+ if(!defined('AJAXSTATMENTDETAIL'))define('AJAXSTATMENTDETAIL', 'mod=page&type='.self::$code);
- $sql_data_array = array();
- $sql_data_array['customers_firstname'] = $sqlarray['customers_firstname'];
- $sql_data_array['customers_lastname'] = $sqlarray['customers_lastname'];
- $sql_data_array['customers_telephone'] = $sqlarray['customers_telephone'];
- $sql_data_array['customers_fax'] = $sqlarray['customers_fax'];
- $sql_data_array['customers_newsletter'] = $sqlarray['customers_newsletter'];
- $sql_data_array['customers_group_ra'] = $sqlarray['customers_group_ra'];
- $sql_data_array['customers_email_address'] = $option['email'];
- if(isset($option['password']))$sql_data_array['customers_password'] = $option['password'];
+ self::$newsletter_array=array(array('id' => '1', 'text' => __('entry newsletter yes')),
+ array('id' => '0', 'text' => __('entry newsletter no'))
+ );
- if (_cst_bool('ACCOUNT_GENDER'))
- $sql_data_array['customers_gender'] = $sqlarray['customers_gender'];
+ }
+ /**
+ @remarks this define col theader title, and ajust html code
+ Just for Edit listing
+ */
+ self::$allfields = array(
+ 'c.customers_id' => array(
+ 'sort'=>true,
+ 'alias'=>'id',
+ 'text'=>__('@customers table heading id'),
+ 'width'=>'2%',
+ 'class'=>'tcenter',
+ 'default'=>true,
+ ),
+ 'c.customers_type' => array(
+ 'sort'=>true,
+ 'alias'=>'type',
+ 'text'=>__('@customers table heading type'),
+ 'class'=>'tcenter',
+ 'width'=>'4%',
+ 'edit'=>array(
+ 'input_name'=>'customers_type',
+ 'input_type'=>'select',
+ 'class'=>'tleft',
+ 'input_size'=>'1',
+ 'required_status'=>true,
+ 'select_values'=>tep_get_status_array(self::$datatype,0,'status_name'),
+ 'position_col'=>'right',
+ 'position_grp'=>5
+ ),
+ ),
+ "CONCAT(customers_firstname, ' ', customers_lastname)" => array(
+ 'sort'=>true,
+ 'alias'=>'master_name',
+ 'text'=>__('@customers table heading master_name'),
+ 'default'=>true,
+ 'width'=>'15%',
+ ),
+ );
+
+ self::$allfields['c.customers_gender'] = array(
+ 'sort'=>true,
+ 'alias'=>'gender',
+ 'text'=>__('@customers table heading gender'),
+ 'class'=>'tright',
+ 'edit'=>array(
+ 'input_name'=>'customers_gender',
+// 'input_type'=>'radio',
+ 'input_type'=>'select',
+ 'input_size'=>1,
+ 'select_values'=>array(
+ array('id'=>'m', 'text'=> MALE ),
+ array('id'=>'f', 'text'=> FEMALE ),
+ array('id'=>'l', 'text'=> MLLE ),
+ ),
+ 'class'=>'tleft',
+ 'position_grp'=>1
+ ),
+ );
+ self::$allfields['c.customers_firstname'] = array(
+ 'sort'=>true,
+ 'alias'=>'firstname',
+ 'text'=>__('@customers table heading firstname'),
+// 'class'=>'tcenter',
+ 'edit'=>array(
+ 'input_name'=>'customers_firstname',
+ 'position_grp'=>1
+ ),
+ );
+ self::$allfields['c.customers_lastname'] = array(
+ 'sort'=>true,
+ 'alias'=>'lastname',
+ 'text'=>__('@customers table heading lastname'),
+// 'class'=>'tcenter',
+ 'edit'=>array(
+ 'input_name'=>'customers_lastname',
+ 'position_grp'=>1
+ ),
+ );
+
if (_cst_bool('ACCOUNT_DOB'))
- $sql_data_array['customers_dob'] = tep_date_raw($sqlarray['customers_dob']);
+ self::$allfields['c.customers_dob'] = array(
+ 'sort'=>true,
+ 'alias'=>'dob',
+ 'text'=>__('@customers table heading dob'),
+ 'class'=>'tcenter',
+ 'edit'=>array(
+ 'input_name'=>'customers_dob',
+ ),
+ );
+ self::$allfields['c.customers_email_address'] = array(
+ 'sort'=>true,
+ 'alias'=>'email_address',
+ 'text'=>__('@customers table heading email address'),
+ 'edit'=>array(
+ 'input_name'=>'customers_email_address',
+ 'required_status'=>true,
+ 'position_grp'=>1
+ ),
+ );
+ self::$allfields['c.customers_telephone'] = array(
+ 'sort'=>true,
+ 'alias'=>'telephone',
+ 'text'=>__('@customers table heading telephone'),
+ 'edit'=>array(
+ 'input_name'=>'customers_telephone',
+ 'required_status'=>true,
+ ),
+ );
+ self::$allfields['c.customers_fax'] = array(
+ 'sort'=>true,
+ 'alias'=>'fax',
+ 'text'=>__('@customers table heading fax'),
+ 'edit'=>array(
+ 'input_name'=>'customers_fax',
+ ),
+ );
+ self::$allfields['l.name'] = array(
+ 'sort'=>true,
+ 'alias'=>'language',
+ 'text'=>__('@customers table heading language'),
+ 'class'=>'tcenter',
+// 'edit'=>array(
+// 'input_name'=>'customers_telephone',
+// 'required_status'=>true,
+// ),
+ );
+ self::$allfields['c.customers_group_id'] = array(
+ 'sort'=>true,
+ 'alias'=>'group_id',
+ 'text'=>__('@customers table heading group id'),
+ 'class'=>'tcenter',
+ );
+// self::$allfields['cg.customers_group_name'] = array(
+// 'sort'=>true,
+// 'alias'=>'cat_title',
+// 'text'=>__('@customers table heading group name'),
+// 'default'=>true,
+// );
- self::$modules->load_post_values($_post);
+ self::$allfields['c.customers_discount'] = array(
+ 'sort'=>true,
+ 'alias'=>'discount',
+ 'text'=>__('@customers table heading discount'),
+ 'class'=>'tright',
+ 'edit'=>array(
+ 'input_name'=>'customers_discount',
+ 'input_size'=>'5',
+ 'position_col'=>'right',
+ 'position_grp'=>5
+ ),
+ );
+ self::$allfields['c.customers_balance_account'] = array(
+ 'sort'=>true,
+ 'alias'=>'balance_account',
+ 'text'=>__('@customers table heading balance account'),
+ 'class'=>'tright',
+ 'edit'=>array(
+ 'input_name'=>'customers_balance_account',
+ 'input_size'=>'5',
+ 'reedit'=>false,
+ 'position_col'=>'right',
+ 'position_grp'=>5
+ ),
+ );
+ self::$allfields['c.customers_shopping_points'] = array(
+ 'sort'=>true,
+ 'alias'=>'shopping_points',
+ 'text'=>__('@customers table heading shopping points'),
+ 'class'=>'tright',
+ 'edit'=>array(
+ 'input_name'=>'customers_shopping_points',
+ 'input_size'=>'5',
+ 'position_col'=>'right',
+ 'position_grp'=>6
+ ),
+ );
- $DB->beginTransaction();
+ self::$allfields['c.customers_newsletter'] = array(
+ 'sort'=>true,
+ 'alias'=>'newsletter',
+ 'text'=>__('@customers table heading newsletter'),
+ 'class'=>'tright',
+ 'edit'=>array(
+ 'input_name'=>'customers_newsletter',
+ 'input_type'=>'radio',
+ 'values_list'=>array(
+ array('id'=>0, 'text'=> __('@customers newsletter no') ),
+ array('id'=>1, 'text'=>__('@customers newsletter yes') ),
+ ),
+ ),
+ );
+ self::$allfields['ci.global_product_notifications'] = array(
+ 'sort'=>true,
+ 'alias'=>'global_product_notifications',
+ 'text'=>__('@customers table heading global product notifications'),
+ 'class'=>'tright',
+ 'edit'=>array(
+ 'input_name'=>'global_product_notifications',
+ 'input_type'=>'radio',
+ 'values_list'=>array(
+ array('id'=>0, 'text'=> __('@customers product notifications no') ),
+ array('id'=>1, 'text'=>__('@customers product notifications yes') ),
+ ),
+ ),
+ );
- $sql_data_array = array_merge($sql_data_array, self::$modules->insert_table_prim() );
+ self::$allfields['ci.customers_info_date_account_created'] = array(
+ 'sort'=>true,
+ 'alias'=>'date_account_created',
+ 'text'=>__('@customers table heading date added'),
+ 'width'=>'8%',
+ 'class'=>'tcenter',
+ 'edit'=>array(
+ 'input_type'=>'date@advanced',
+ 'input_name'=>'date_account_created',
+ 'input_size'=>'10',
+ 'reedit'=>false,
+ 'position_col'=>'right',
+ 'position_grp'=>10
+ ),
+ );
+ self::$allfields['ci.customers_info_date_account_last_modified'] = array(
+ 'sort'=>true,
+ 'alias'=>'date_account_last_modified',
+ 'text'=>__('@customers table heading last modified'),
+ 'width'=>'8%',
+ 'class'=>'tcenter',
+ 'edit'=>array(
+ 'input_type'=>'date@advanced',
+ 'input_name'=>'date_account_last_modified',
+ 'input_size'=>'10',
+ 'reedit'=>false,
+ 'position_col'=>'right',
+ 'position_grp'=>10
+ ),
+ );
+ self::$allfields['ci.customers_info_date_of_last_logon'] = array(
+ 'sort'=>true,
+ 'alias'=>'date_last_logon',
+ 'text'=>__('@customers table heading last logon'),
+ 'class'=>'tright',
+ 'default'=>true,
+ 'edit'=>array(
+ 'input_type'=>'date@advanced',
+ 'input_name'=>'date_last_logon',
+ 'input_size'=>'10',
+ 'reedit'=>false,
+ 'position_col'=>'right',
+ 'position_grp'=>10
+ ),
+ );
+ self::$allfields['ci.customers_info_number_of_logons'] = array(
+ 'sort'=>true,
+ 'alias'=>'number_of_logons',
+ 'text'=>__('@customers table heading number of logons'),
+ 'default'=>true,
+ 'class'=>'tcenter',
+ 'edit'=>array(
+ 'input_name'=>'customers_info_number_of_logons',
+ 'input_size'=>'5',
+ 'reedit'=>false,
+ 'position_col'=>'right',
+ 'position_grp'=>9
+ ),
+ );
- $_return= $sql_data_array;
- $resobj=tep_db_perform(TABLE_CUSTOMERS, $sql_data_array);
+ self::$allfields['c.customers_group_ra'] = array(
+ 'sort'=>true,
+ 'alias'=>'group_ra',
+ 'text'=>__('@customers table heading group ra'),
+ 'width'=>'5%',
+ 'default'=>true,
+ 'class'=>'tcenter',
+ 'edit'=>array(
+ 'input_type'=>'radio',
+ 'input_size'=>'1',
+ 'input_name'=>'customers_group_ra',
+ 'values_list'=>array(
+ array('id'=>0, 'text'=>__('@customers text group off') ),
+ array('id'=>1, 'text'=>__('@customers text group yes') ),
+ ),
+ 'position_col'=>'right',
+ 'position_grp'=>2
+ ),
+ );
+ self::$allfields['c.customers_status'] = array(
+ 'sort'=>true,
+ 'alias'=>'status',
+ 'text'=>__('@customers table heading status'),
+ 'width'=>'5%',
+ 'default'=>true,
+ 'class'=>'tcenter',
+ 'edit'=>array(
+ 'input_type'=>'radio',
+ 'input_size'=>'1',
+ 'input_name'=>'customers_status',
+ 'values_list'=>array(
+ array('id'=>0, 'text'=>__('@customers text status off') ),
+ array('id'=>1, 'text'=>__('@customers text status on') ),
+ ),
+ 'position_col'=>'right',
+ 'position_grp'=>3
+ ),
+ );
- if(!$resobj)
- $error++;
- $lastid=$resobj->__get('insertId');
+ /// @remarks min fields and not view directly colonne fields
+ $listfield = " c.customers_id as id, c.customers_email_address as email_address, ";
- $sql_data_array = array(
- 'customers_info_id' => $lastid,
- 'customers_info_date_account_created' => 'now()',
- 'global_product_notifications' => $sqlarray['global_product_notifications']
- );
+ /// @remarks Active forms filter
+ $mutli=array();
- if($lastid > 0)
- if( ! tep_db_perform(TABLE_CUSTOMERS_INFO, $sql_data_array) )
- $error++;
+ /**
+ @remarks Active forms filter
+ @note
+ array[
+ // For normalised filter define on method ConvertInitVar
+ generic =>
+ array (
+ 'string'
+ // , ....
+ );
+ mod =>
+ array(
+ 'title'=>__('@products filter tab manufacturer'),
+ 'content'=>tep_get_include_contents('manufacturers/filter.manufacturer'),
+ )
+ ]
+ */
+ $tab = MLinkTo::GetFilters(self::$datatype );
+ /**
+ @remarks this define menu master module in page
+ @note use $boutons[action][] = array(params)
- self::$modules->load_post_values(array_merge(array('customers_id'=>$lastid),$_post) );
+ params :
+ 'type'=>'getLink',
+ 'format'=>'button_nav',
+ 'image'=>'',
+ 'cssclass'=>'button',
+ 'title'=>__('image create new content'),
+ 'url'=>tep_href_link(self::FILENAME, 'action=new'),
+ */
+ $boutons = array();
+ $boutons['listing'][]=array(
+ 'type'=>'getLink',
+ 'format'=>'button_nav',
+ 'image'=>'',
+ 'cssclass'=>'button',
+ 'title'=>__('@customers image create new customer'),
+ 'url'=>tep_href_link(self::FILENAME, 'action=new'),
+ );
+ $boutons['listing'][]=array(
+ 'type'=>'getLink',
+ 'format'=>'button_nav',
+ 'image'=>'',
+ 'cssclass'=>'button linkrss',
+ 'title'=>tep_image(DIR_WS_ICONS.'icon_feed.png' , IMAGE_TRACKED_LOW_STOCK,16,16) .__('@customers link rss new customer'),
+ 'url'=>tep_href_link(FILENAME_FEEDS,'box=new_customers'),
+ );
- self::$modules->insert_table_second();
-// $sql_data_array = array_merge($sql_data_array, self::$modules->insert_table_second() );
+ /**
+ Call Base Init and construct $InitInfo for process Filter
+ $listfield string list row in db
+ $mutli array action multiple
+ $filter array put list off activate tab filter
+ $boutons array
+ */
+ self::ConvertInitVar( $listfield, $mutli, $tab, $boutons);
-// $_return=array_merge($_return,$sql_data_array,array('customers_id'=>$lastid));
-// return $lastid;
-
- if( $error > 0){
- $DB->rollbackTransaction();
- return false;
- }
- else{
- $DB->commitTransaction();
- return $lastid;
- }
}
+
+
+
/**
- @brief update ligne in table configuration
- */
- public static function update($option){
- new self();
+ * \fn check_action($actionss)
+ * \brief execut action
+ * @param $actionss string
+ */
+ public function check_action($actions){
+ global $languages_id, $messageStack, $language;
- if(!isset($option['id']) || isset($option['email']))
- return false;
+ $DB=Database::getInstance();
+ $_return=array();
- $DB=Database::getInstance();
- $error = 0 ;
- $where ='';
- if(isset($option['id'])) $where .="AND customers_id = '".(int)$option['id']."' ";
- if(isset($option['email'])) $where .="AND customers_email_address = '".(int)$option['email']."' ";
+ if(!empty($actions))
+ self::$action=$actions;
+
+ switch (self::$action) {
+
+ /**
+ @remarks specific Ajax call
+ */
+ case 'update_cell':
+ try {
+ if($_REQUEST['columnName'] == 'customers_email_address'){
+ if( ! sqlcustomer::userTestNotExists($_REQUEST['value']) )
+ throw new Exception(__('email address is already used') ) ;
+ }
+ parent::GenericAction();
- $_post = $option['post'];
- $sqlarray = $option['sqlarray'];
+ }
+ catch (Exception $e) {
+ self::PutMessage(
+ new EventMessListener(__($e->getMessage(), __CLASS__) , 'error')
+ );
+ }
+ break;
+
+ /**
+ @remarks specific ajax action
+ */
+ case 'setflag':
+ if ( ($_GET['flag'] == '0') || ($_GET['flag'] == '1') ) {
+ $newsletter_id = tep_db_prepare_input($_GET['cID']);
- $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']) && !empty($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(isset($sqlarray['customers_discount']))$sql_data_array['customers_discount'] = $sqlarray['customers_discount'];
- if(isset($sqlarray['customers_balance_account']))$sql_data_array['customers_balance_account'] = $sqlarray['customers_balance_account'];
+ if (!empty($newsletter_id))
+ $DB->query("update " . TABLE_CUSTOMERS . " set customers_status = '" .(int) $_GET['flag'] . "' where customers_id = '" . (int)$newsletter_id . "'");
+ }
- if (_cst_bool('ACCOUNT_GENDER'))
- $sql_data_array['customers_gender'] = $sqlarray['customers_gender'];
+ $messageStack->add(__('@customers update status customers'), 'success');
- if (_cst_bool('ACCOUNT_DOB'))
- $sql_data_array['customers_dob'] = tep_date_raw($sqlarray['customers_dob']);
+ if(!isset($_GET['forceajax']))
+ tep_redirect(tep_href_link(self::FILENAME, 'cID=' . $_GET['cID']));
+ break;
- self::$modules->load_post_values($_post);
+ case 'setflagda':
+ if ( ($_GET['flag'] == '0') || ($_GET['flag'] == '1') ) {
+ $newsletter_id = tep_db_prepare_input($_GET['cID']);
- $DB->beginTransaction();
+ if (!empty($newsletter_id))
+ $DB->query("update " . TABLE_CUSTOMERS . " set customers_group_ra = '" .(int) $_GET['flag'] . "' where customers_id = '" . (int)$newsletter_id . "'");
+ }
- $sql_data_array = array_merge($sql_data_array, self::$modules->update_table_prim());
+ $messageStack->add(__('@customers update confirm status customers'), 'success');
- $_return= $sql_data_array;
+ if(!isset($_GET['forceajax']))
+ tep_redirect(tep_href_link(self::FILENAME, 'cID=' . $_GET['cID']));
- if( ! tep_db_perform(TABLE_CUSTOMERS, $sql_data_array, 'update' , substr($where,3)) )
- $error++;
+ break;
- $sql_data_array = array(
- 'global_product_notifications' => $sqlarray['global_product_notifications']
- );
+ case 'vcard':
+ $result=sqlcustomer::fetch(array('id'=> tep_db_prepare_input(self::$Id) ), true );
+
+ if(!$result || !is_object($result))
+ return false;
- if($error ==0)
- if( !tep_db_perform(TABLE_CUSTOMERS_INFO, $sql_data_array, 'update' , " customers_info_id = '".(int)$option['id']."' " ) )
- $error++;
+ $vt="HOME";
+ if($result->gender)
+ $gender='Mr' ;
+ else
+ $gender='Ms' ;
- self::$modules->load_post_values($_post);
- $sql_data_array = array_merge($sql_data_array, self::$modules->update_table_second());
+ $vcard_content = "BEGIN:VCARD\r\n";
+ $vcard_content .= "N:".$result->lastname.";".$result->firstname.";;;\r\n";
+ $vcard_content .= "FN:".$result->firstname.".".$result->lastname."\r\n";
+ $vcard_content .= "EMAIL:".$result->email_address."\r\n";
+ $vcard_content .= "TEL;type=".$vt.";type=pref:".$result->telephone."\r\n";
+ $vcard_content .= "TEL;type=".$vt.";type=FAX:".$result->fax."\r\n";
+ $vcard_content .= "VERSION:3.0\r\n";
+ $vcard_content .= "END:VCARD\r\n\r\n";
- self::$modules->after_update((int)$option['id']);
+ if(!isset($_GET['forceajax'])){
+ header('Content-Disposition: inline; filename="'.$result->lastname.'.'.$result->firstname.'.vcf"');
+ header('Content-Type: application/x-vcard; charset=utf-8');
+ echo $vcard_content;
+ exit;
+ }
+ else {
+ return $vcard_content;
+ }
+
+ break;
- if( $error > 0){
- $DB->rollbackTransaction();
- return false;
- }
- else{
- $DB->commitTransaction();
- return 1;
- }
- }
+ /**
+ @remarks specific multi action
+ */
+ case 'multi':
+ tep_redirect(tep_href_link(self::FILENAME) );
+ break;
+ /**
+ @remarks normal page
+ */
+ case 'insert':
- /**
- @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
+ if(!tep_action_check('edit', self::FILENAME))
+ tep_redirect(tep_href_link(self::FILENAME));
+ global $languages_id;
- object(stdClass)[13]
- public 'id' => string '1' (length=1)
+ $_id=sqlcustomer::create(array('password'=>'', 'email'=>'', 'language_id'=>$languages_id) );
- OR
- array(
- object(stdClass)[13]
- ...
- object(stdClass)[13]
- ..
- )
+ tep_redirect(tep_href_link(self::FILENAME, tep_get_all_get_params(array('action','cPath','cID'),false).'cID=' . $_id.'&action=edit'));
+ break;
+ case 'update':
+ $array = array();
+ $array['post'] = $_POST;
+ $array['sqlarray'] = array();
- */
- public static function fetch($option,$shortkey=false){
- new self();
- $DB=Database::getInstance();
+ global $languages_id,$messageStack;
- $sql ="";
- if(isset($option['id'])) $sql .="AND c.customers_id = '".(int)tep_db_input($option['id'])."' ";
- if(isset($option['address_book_id'])) $sql .="AND a.address_book_id = '".(int)tep_db_input($option['address_book_id'])."' ";
- if(isset($option['group_id'])) $sql .="AND c.customers_group_id = '".(int)tep_db_input($option['group_id'])."' ";
- if(isset($option['lg_id'])) $sql .="AND c.customers_language = '".(int)tep_db_input($option['lg_id'])."' ";
- if(isset($option['email'])) $sql .="AND c.customers_email_address = '".(string)tep_db_input($option['email'])."' ";
+ foreach(sqlcustomer::Specimen(array(),false) as $key=>$row){
+ if(in_array($key, array('customers_group_id','customers_newsletter','global_product_notifications','customers_shopping_points')))
+ $array['sqlarray'][$key]=(isset($_POST[$key])) ? (int)tep_db_prepare_input($_POST[$key]) : 0;
+ else
+ $array['sqlarray'][$key]=(isset($_POST[$key])) ? tep_db_prepare_input($_POST[$key]) : '';
+ }
- if(strlen($sql) < 1 )
- return false;
- // base customers
- $sql = "SELECT
- c.customers_id,
- c.customers_lastname,
- c.customers_gender,
- c.customers_dob,
- c.customers_newsletter,
- c.customers_firstname,
- c.customers_default_address_id,
- c.customers_email_address,
- c.customers_group_ra,
- c.customers_telephone,
- c.customers_fax,
- a.entry_country_id,
- c.customers_group_id,
- c.customers_language ,
- cg.customers_group_name,
- c.customers_shopping_points,
- c.customers_balance_account,
- c.customers_discount,
- customers_info_date_account_created as date_account_created,
- customers_info_date_account_last_modified as date_account_last_modified,
- customers_info_date_of_last_logon as date_last_logon,
- customers_info_number_of_logons as number_of_logons ,
- global_product_notifications ,
- COUNT(o.customers_id) as orders,
- z.zone_name,
- co.countries_id,
- co.countries_name,
- co.countries_iso_code_2,
- co.countries_iso_code_3,
- co.address_format_id ".
- " FROM " . TABLE_CUSTOMERS . " c ".
- " LEFT JOIN " . TABLE_CUSTOMERS_INFO . " ON( customers_info_id = c.customers_id ) ".
- " LEFT JOIN " . TABLE_ADDRESS_BOOK . " a ON ( c.customers_id = a.customers_id and c.customers_default_address_id = a.address_book_id ) ".
- " LEFT JOIN " . TABLE_ZONES . " z ON (a.entry_zone_id = z.zone_id) ".
- " LEFT JOIN " . TABLE_COUNTRIES . " co ON (a.entry_country_id = co.countries_id) ".
- " LEFT JOIN " . TABLE_CUSTOMERS_GROUPS . " cg ON ( c.customers_group_id = cg.customers_group_id ) ".
- " LEFT JOIN " . TABLE_ORDERS . " o ON( o.customers_id = c.customers_id ) ".
- " WHERE ".substr($sql,3).
- " GROUP BY o.customers_id ";
+ if(!is_array($array['sqlarray']) || count($array['sqlarray']) < 1)
+ return false;
- $res=$DB->query($sql);
+ $testobj = new objectInfo($array['sqlarray']);
+// var_dump();
+ try{
+ /*
+ * \brief test user is exists email address in db
+ */
+ if ( strlen($testobj->customers_email_address) < 3)
+ throw new Exception(__('entry email address error please add email'));
- $num = $res->__get('numRows');
+ if ( self::$action =='insert' && sqlcustomer::fetch(array('email'=>$testobj->customers_email_address) ) != false )
+ throw new Exception(__('entry email address error exists'));
- if($num == 1){
- $result=$res->fetchAssoc();
+ if (strlen($testobj->customers_firstname) < ENTRY_FIRST_NAME_MIN_LENGTH)
+ throw new Exception(__("Le nombre de caractéres ne suffit pour le nom, min:").ENTRY_FIRST_NAME_MIN_LENGTH);
+ if (strlen($testobj->customers_lastname) < ENTRY_LAST_NAME_MIN_LENGTH)
+ throw new Exception(__("Le nombre de caractéres ne suffit pour le nom, min:").ENTRY_LAST_NAME_MIN_LENGTH);
+ if (_cst_bool('ACCOUNT_DOB'))
+ if (!checkdate(substr(tep_date_raw($testobj->customers_dob), 5, 2), substr(tep_date_raw($testobj->customers_dob), 8, 2), substr(tep_date_raw($testobj->customers_dob), 0, 4)))
+ throw new Exception(__("Le format de la date de naissance n'est pas correct"));
+ if (strlen($testobj->customers_email_address) < ENTRY_EMAIL_ADDRESS_MIN_LENGTH)
+ throw new Exception(__("L'adresse email est trop courte, min:").ENTRY_EMAIL_ADDRESS_MIN_LENGTH);
- $result['mod'] = self::$modules->fetch(array('customers_id'=>$result['customers_id'], 'shortkey'=>$shortkey));
+ if (!emailUtility::tep_validate_email($testobj->customers_email_address))
+ throw new Exception(ENTRY_EMAIL_ADDRESS_CHECK_ERROR);
+
+ if(self::$Id > 0 && ! sqlcustomer::userTestNotExists($testobj->customers_email_address) )
+ throw new Exception(__('email address is already used') ) ;
- // put all val origin module in current result
- foreach($result['mod'] as $submod=>$array)
- if(is_array($array))
- foreach($array as $key=>$val)
- $result[$key] = $val;
+ if (strlen($testobj->customers_telephone) < ENTRY_TELEPHONE_MIN_LENGTH)throw new Exception(__("Le numero de téléphone est trop court"));
- return ((!$shortkey)? $result : self::CleanKey($result));
- }
- elseif($num > 1){
- $array=array();
- foreach($res->fetchAllAssoc() as $result){
- $result['mod'] = self::$modules->fetch(array('customers_id'=>$result['customers_id'], 'shortkey'=>$shortkey));
+ }catch(Exception $e){
+ $messageStack->add_session($e->getMessage(), 'error');
- $array[]= ((!$shortkey)? $result : self::CleanKey($result));
- }
+ if(self::$Id > 0 )
+ tep_redirect(tep_href_link(self::FILENAME, 'cID=' .self::$Id.'&action=edit'));
+ else
+ tep_redirect(tep_href_link(self::FILENAME));
+ }
- return $array;
+
+ if(self::$Id <= 0 ){
+ $array['password']=$mdp=sqlcustomer::randomize();
+ $array['email']=$array['sqlarray']['customers_email_address'];
+ $_id=sqlcustomer::create($array);
+ $result=sqlcustomer::fetch(array('id'=>$_id), false );
+ }
+ else{
+ $array['id']=$_id=tep_db_prepare_input(self::$Id);
+ $result=sqlcustomer::update($array, false);
+
+ $result=sqlcustomer::fetch(array('id'=>$_id), false );
+ }
+
+ if( is_array($result) ){
+
+ /**
+ @remarks Notify customer by email
+
+ TODO: Deport le template email dans dossier documents
+ */
+ if(isset($_POST['new_customers_notif'])) {
+
+ $myarray = array(
+ 'email_use_html'=>_cst_bool('EMAIL_USE_HTML'),
+ 'links'=>HTTP_SERVER ,
+ 'firstname'=>$result['customers_firstname'],
+ 'lastname'=>$result['customers_lastname'],
+ 'email'=>$result['customers_email_address'],
+ 'password'=>$mdp,
+ 'message'=>''
+ );
+ $message_final=tep_post_prepare_email('add_customer.tpl',$language,$myarray);
+
+
+ if( ! tep_mail($result['customers_firstname'] . ' ' . $result['customers_lastname'], $result['customers_email_address'],__('creat new compte for customers'), $message_final) )
+ $messageStack->add_session(sprintf(__('error in process send mail for %s'), $result['customers_firstname'] .' '. $result['customers_email_address'] ), 'error');
+ else
+ $messageStack->add_session(sprintf(__('send mail for %s ok'), $result['customers_firstname'] .' '. $result['customers_email_address']), 'success');
+
+ }
+
+
+ $myarray['from']=STORE_OWNER;
+ $myarray['email_use_html']=_cst_bool('EMAIL_USE_HTML');
+ $myarray['message']=$message_final;
+
+ if( ! notification::notifInMess('admin_new_customers',__('subject copy creat new compte for customers') ,$message_final, 'customers_id='.$_id) ){
+ $messageStack->add_session(sprintf(__('error in process notification for %s'), STORE_OWNER .' '. STORE_OWNER_EMAIL_ADDRESS ), 'error');
+ }
+
+ $messageStack->add(__('customers save success'), 'success');
+
+ if(isset($_POST['up_and_close']) )
+ tep_redirect(tep_href_link(self::FILENAME));
+ else
+ tep_redirect(tep_href_link(self::FILENAME, 'cID=' .$_id.'&action=edit'));
+ }
+ else /*if (self::$error == true) */{
+ $_POST['customers_gender']='m';
+ $Info = new objectInfo($_POST);
+ if(self::$action =='insert')
+ $dest_form='insert';
+ else
+ $dest_form='update';
+
+ $messageStack->add(__('error save in process'), 'error');
+ }
+
+ break;
+ /**
+ @remarks Test key , by ajax
+ */
+ case 'isValidRef':
+
+ $ref = tep_db_prepare_input(trim($_REQUEST['stringref']));
+
+ if (strlen($ref) < ENTRY_EMAIL_ADDRESS_MIN_LENGTH){
+ self::$Info['isValidRef'] = false;
+
+ self::PutMessage(
+ new EventMessListener(__('email is too short', __CLASS__) )
+ );
+
+ if(!isset($_GET['forceajax']))
+ tep_redirect(tep_href_link(self::FILENAME, tep_get_all_get_params(array('action','cID'), false).'action=edit' ));
+ }
+// throw new Exception(__("L'adresse email est trop courte, min:").ENTRY_EMAIL_ADDRESS_MIN_LENGTH);
+
+ elseif (!emailUtility::tep_validate_email($ref)){
+ self::$Info['isValidRef'] = false;
+
+ self::PutMessage(
+ new EventMessListener(__('email is valid', __CLASS__) )
+ );
+
+ if(!isset($_GET['forceajax']))
+ tep_redirect(tep_href_link(self::FILENAME, tep_get_all_get_params(array('action','cID'), false).'action=edit' ));
+ }
+// throw new Exception(ENTRY_EMAIL_ADDRESS_CHECK_ERROR);
+
+ elseif( sqlcustomer::userTestNotExists($ref) === true){
+ self::$Info['isValidRef'] = true;
+
+ self::PutMessage(
+ new EventMessListener(__('email is valid', __CLASS__) , 'success')
+ );
+
+ if(!isset($_GET['forceajax']))
+ tep_redirect(tep_href_link(self::FILENAME, tep_get_all_get_params(array('action','cID'), false).'action=edit' ));
+ }
+ else{
+ self::$Info['isValidRef'] = false;
+
+ self::PutMessage(
+ new EventMessListener(__('email is already used', __CLASS__) )
+ );
+
+
+ if(!isset($_GET['forceajax']))
+ tep_redirect(tep_href_link(self::FILENAME));
+ }
+ break;
+ default:
+ parent::GenericAction();
}
- return false;
+ return self::$action;
}
+
+ /**
+ @fn get_header()
+ @brief load js and call childs module
+ @return no return
+ */
+ public function get_header(){
+ tep_include_file(DIR_WS_JS . "modules/pages/".__CLASS__.".js.php",true);
+
+ /** aca */ self::$modules->get_header(self::$action);
+
+ /** aca */ self::$modules->get_header_js(self::$action);
+ }
+
+
/**
- @brief delete row
+ @fn featured::GetDBValue();
+ @brief return DB value adapted for current action
+ Use self::action for determine switch
+ @return
*/
- public static function delete($option){
- new self();
+ public static function GetDBValue(){
+
$DB=Database::getInstance();
- if(isset($option['id']))
- $_id = (int)tep_db_input($option['id']) ;
- else
- return false;
+ $action=self::$action;
+// var_dump(self::$Id);
+ switch ($action) {
- $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 . "'");
+ case 'detail':
+ case 'delete':
+ case 'view':
+ case 'noedit':
+ case 'edit':
+ case 'new':
+ if(self::$Id > 0)
+ $arry=sqlcustomer::fetch(array('id'=>(int)self::$Id),true);
+ else
+ $arry=sqlcustomer::Specimen(true);
- self::$modules->deleteconfirm_account($_id);
-// self::$modules->delete($_id);
+ $res=self::FormatDBValue($arry);
+ return $res;
+ break;
- $DB->query("delete from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$_id . "'");
+ case 'listing':
+ default:
- return true;
+ /**
+ @remarks retrun object load one inventaire
+ */
+ global $query_numrows, $languages_id;
+ $adjust=new objectInfo(self::$InitInfo['adjust']);
+
+
+ /**
+ @remarks replace id by name col
+ */
+ if(!empty($adjust->sWhere)) {
+
+ foreach(self::$allfields as $key=>$row){
+ if(is_array($row) && isset($row['alias']) ){
+ $k[] = '#[(]'.$row['alias'].'[)]#i';
+ $k[] = '# '.$row['alias'].' #i';
+ $k[] = '# \.'.$row['alias'].'#i';
+
+ $v[] = '('.$key.')';
+ $v[] = ' '.$key.' ';
+ $v[] = '.'.$key.' ';
+ }
+ }
+
+ if(isset($k))
+ $adjust->sWhere = preg_replace($k,$v, $adjust->sWhere);
+ }
+
+
+ $query_raw = "select ".$adjust->listfields.", c.customers_id as id from " . TABLE_CUSTOMERS . " c ".
+ " JOIN " . TABLE_CUSTOMERS_INFO . " ci ON(c.customers_id =ci.customers_info_id ) ".
+ " LEFT JOIN " . TABLE_LANGUAGES . " l ON(c.customers_language =l.languages_id ) ";
+// " LEFT JOIN " . TABLE_CUSTOMERS_GROUPS . " cg ON(c.customers_group_id = cg.customers_group_id) ";
+
+ /* DEB Sub module add table */
+ $r = self::$modules->__call('GetConf', array('languages_id'=>(int)$adjust->languages_id, 'type'=>'tables')) ;
+ foreach($r as $mod=>$value){
+ foreach($value as $key=>$string){
+ $query_raw .= $string;
+ }
+ }
+ /* END Sub module add col */
+
+ $query_raw .= ((strlen($adjust->sWhere)>4) ? " WHERE ".substr($adjust->sWhere, 3) : '').
+ " GROUP BY c.customers_id ";
+
+ /* DEB Sub module add table */
+ $r = self::$modules->__call('GetConf', array('languages_id'=>(int)$adjust->languages_id, 'type'=>'group_by')) ;
+ foreach($r as $mod=>$value){
+ foreach($value as $key=>$string){
+ $query_raw .= $string;
+ }
+ }
+ /* END Sub module add col */
+
+ $query_raw .= " ORDER BY ".((!empty($adjust->sOrder)) ? $adjust->sOrder : ' ci.customers_info_date_account_created DESC ');
+
+ $_query = $DB->query($query_raw);
+ $query_numrows = $_query->__get('numRows');
+ $_split = new splitPageResults($adjust->page, $adjust->rowbyp, $query_raw, $query_numrows);
+ $_query = $DB->query($query_raw);
+
+ $res=self::FormatDBValue($_query);
+
+ return $res;
+
+ }
+
+
}
+
+
/**
- @brief
- @return array product empty
*/
- public static function Specimen($shortkey=false){
- new self();
-
- $par = array(
- 'customers_id' => 0,
+ public function display_view() {
+ $action=self::$action;
+ $MG= true;
- 'customers_type' => 1,
-
- 'customers_gender' => 'm',
- 'customers_firstname' => '',
- 'customers_lastname' => '',
- 'customers_email_address' => '',
- 'customers_telephone' => '',
- 'customers_fax' => '',
- 'customers_language' => '',
- 'entry_country_id' => '',
+ switch($action){
+ /**
+ @remarks Ajax View result
+ */
+ case 'setflagda':
+ return self::GenericRowsFlag(self::$Id, 'group_ra', 'setflagda');/// RowStatusDa(array('group_ra'=>(int)$_GET['flag'], 'id'=>(int)self::$Id));
+ break;
+ /**
+ @remarks Ajax View result
+ */
+ case 'isValidRef':
+ $stringref = tep_db_prepare_input($_REQUEST['stringref']) ;
- 'customers_group_id' => '',
- 'customers_group_name' => '',
+ if( ! (bool)self::$list['isValidRef'])
+ $print = tep_draw_input_field('customers_email_address', '', (string)$stringref , '');
+ else
+ $print = $stringref. tep_draw_hidden_field('customers_email_address', '', (string)$stringref, ' ');
- 'customers_discount' => '',
- 'customers_shopping_points' => '',
- 'customers_balance_account' => 0,
+ return $print;
+ break;
+
+ /**
+ @remarks Normal View Page
+ */
+ case 'new':
+ $action='edit';
+ default:
+ $action = parent::GenericDisplay($action);
+ }
+
+
+ if( ! empty($action) )
+ return MGabCont::CallGab($action,__FUNCTION__, ( ($MG) ? self::MASTER : __CLASS__ ) );
+ }
- 'customers_default_address_id' => '',
- 'customers_group_ra' => '',
- 'date_account_created' => '',
- 'date_account_last_modified' => '',
- 'date_last_logon' => '',
- 'number_of_logons' => '',
- 'customers_newsletter' => '',
- 'global_product_notifications' => '',
+ public static function detail_row_page($id){
+ // force rattribution id
+ $_REQUEST['cID'] = (int)$id;
+ self::GetConf();
+ self::load_db_values((int)$id);
- 'orders' => '',
- );
+ $res=tep_db_query($customers_query_raw = "select sum(op.products_quantity * op.final_price) as ordersum from " . TABLE_CUSTOMERS . " c, " . TABLE_ORDERS_PRODUCTS . " op, " . TABLE_ORDERS . " o where c.customers_id = o.customers_id and c.customers_id='".(int)$id."' and o.orders_id = op.orders_id group by c.customers_firstname, c.customers_lastname order by ordersum DESC");
+ $r=tep_db_fetch_array($res);
+ self::$Info->orders_sum=$r['ordersum'];
+ return MGabCont::CallGab('inline','display_view',__CLASS__);
+ }
- if (_cst_bool('ACCOUNT_DOB'))
- $par['customers_dob']='';
- return ((!$shortkey)? $par : self::CleanKey($par));
+
+ /**
+ @fn ButtonRowsActions($orders)
+ @brief fonction qui construit l'affichage de la colonne action
+ La mise en forme est contenu dans les ressource xml du template en cours
+ @param $orders array
+ @return string
+ */
+ public static function ButtonRowsActions($item){
+ global $SecuKey;
+
+ $action_str_left =sprintf(CsrtAction::getLink('row_action_right', __('incarner'), 'incarner'), '', tep_catalog_href_link('login.php','osCAdminDirect='.md5($SecuKey.date('d')).'&id='.$item['id'],'SSL', false ) ,'');
+
+ $action_str_left .=sprintf(CsrtAction::getLink('row_action_right', __('@customers button vcard'), 'vcard'), '', tep_href_link(self::FILENAME,'cID=' . $item['id'].'&action=vcard' ) ,'');
+
+ $action_str = self::$modules->display_ColumnRowAction($item['id']);
+ $action_str .=sprintf(CsrtAction::getLink('row_action_right', __('@customers button email'), 'email'), '', tep_mailto($item['email_address'],self::FILENAME) ,'');
+
+ return parent::GenericRowsActions($item, 'ned', $action_str_left, $action_str);
}
- /**
- @fn ExtractForm($data)
- @brief extract data forms for put in db
- @param $data array
- @return array
- */
- public static function ExtractForm($data){
- new self();
-
- return parent::ExtractDataForm(self::Specimen(), $data);
- }
-
+
/**
- @fn randomize()
- @brief Generate password
+ @param string $value
*/
- public static function randomize() {
- $salt = "abchefghjkmnpqrstuvwxyz0123456789";
- srand((double)microtime()*1000000);
- $i = 0;
- $pass='';
- while ($i <= 7) {
- $num = rand() % 33;
- $tmp = substr($salt, $num, 1);
- $pass = $pass . $tmp;
- $i++;
- }
- return $pass;
+ public static function tep_view_gender_human($value){
+ $s='';
+ if($value=='m') $s= MALE;
+ elseif($value=='f') $s= FEMALE;
+ elseif($value=='l') $s= MLLE;
+ return $s;
}
+
+
/**
- @fn CleanKey()
- @brief Clean string name key
+ @brief format db value for display page
+ @param $_query ressource db sql
+ @return array
*/
- public static function CleanKey($array){
- new self();
-
- $object= new stdclass();
+ protected static function FormatDBValue($_query){
+ $DB=Database::getInstance();
+ $res=array();
- foreach($array as $key=>$value){
- if( strpos($key,'customers_') ===0)
- $key=substr($key,10);
+ switch (self::$action) {
+ case 'listing':
+ global $languages_id, $price;
+ /* DEB Sub module add col */
+ self::GetExternalFieldsForFormat( self::$allfieldsexternal );
+
- $object->$key = $value;
- }
+ while ($item = $_query->fetchAssoc()) {
+ $ord =array();
+
+ $item[0]=$item['id'];
+ $item[1]=tep_draw_checkbox_field('action_multi['.$item['id'].']','action_mutli_'.$item['id'],$item['id']);
- return $object;
+ foreach(self::$InitInfo['modele']['listing'] as $k=>$row){
+ if( ($value = self::FormatDBValueRow($k, $item)) && $value !=false )
+ $ord[$k]= $value;
+ elseif($k == 'entry_gender')
+ $ord[$k]=self::tep_view_gender_human($row);
+ elseif($k == 'group_ra')
+ $ord[$k]=self::GenericRowsFlag($item, 'group_ra', 'setflagda', 'row_etat');
+ elseif($k == 'discount')
+ $ord[$k]=$item[$k].' %';
+ elseif($k == 'balance_account')
+ $ord[$k]=(($item[$k]>=0) ? '+' : '-' ).' '. $price->format($item[$k], true) ;
+ else
+ $ord[$k]=$item[$k];
+ }
+
+ $res[]=$ord;
+ }
+ break;
+ default:
+ $res = parent::FormatDBValueDefault($_query);
+ }
+
+ return $res;
}
-
-
-
- /**
- @fn userTestNotExists($customers_email_address)
- @brief test user exists
- @param $customers_email_address
- @return boolean true OK : not exists | bool false KO Exsists
- */
- static public function userTestNotExists($customers_email_address){
- $check_email = tep_db_query("select customers_email_address from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($customers_email_address) . "' ");
- return (tep_db_num_rows($check_email))? false : true ;
- }
+
+
+
+
+
+
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2014-05-15 15:13:42
|
Revision: 5203
http://sourceforge.net/p/oscss/svn/5203
Author: oscim
Date: 2014-05-15 15:13:39 +0000 (Thu, 15 May 2014)
Log Message:
-----------
Fix
Modified Paths:
--------------
trunk/catalog/admin/includes/classes/drivers/sqlorder.php
Modified: trunk/catalog/admin/includes/classes/drivers/sqlorder.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlorder.php 2014-05-15 14:16:08 UTC (rev 5202)
+++ trunk/catalog/admin/includes/classes/drivers/sqlorder.php 2014-05-15 15:13:39 UTC (rev 5203)
@@ -138,9 +138,6 @@
$post = $option['post'];
- if( isset($option['orders_ref']) )
- $sql_data_array['orders_ref'] = trim($option['orders_ref']);
-
if( isset($option['facture_ref']) ) {
$sql_data_array['facture_ref'] = trim($option['facture_ref']);
@@ -150,9 +147,19 @@
$sql_data_array['facture_id'] = self::GetNumberInvoice();
}
- if( isset($option['type']) )
+ if( isset($option['type']) ){
$sql_data_array['orders_type'] = $option['orders_type'];
-
+
+ if( isset($option['orders_ref']) )
+ $sql_data_array['orders_ref'] = trim($option['orders_ref']);
+ else {
+ // New Ref
+ $numref= new NumRef('orders');
+ $ref = $numref->GetNewNumRef('', new objectInfo($order) );
+
+ $sql_data_array['orders_ref'] = $ref;
+ }
+ }
// specific for soap event
$sql_data_array['synchro_event'] = ( isset($option['synchro_event'])? (int)$option['synchro_event'] : '0');
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2014-05-15 14:16:11
|
Revision: 5202
http://sourceforge.net/p/oscss/svn/5202
Author: oscim
Date: 2014-05-15 14:16:08 +0000 (Thu, 15 May 2014)
Log Message:
-----------
Fix
Clean code for structure format
Adjust sql
Modified Paths:
--------------
trunk/catalog/admin/includes/classes/customerUtility.php
trunk/catalog/admin/includes/functions/general.php
trunk/catalog/common/classes/order.php
trunk/catalog/includes/classes/ExtraFieldsUse.php
trunk/catalog/includes/classes/checkout_process.php
trunk/catalog/includes/functions/general.php
trunk/catalog/includes/modules/account/address_book.php
trunk/catalog/install/includes/sql/mysql/tables/osc_orders.sql
trunk/catalog/install/includes/sql/mysql/upgrade/2.1.1rc_2.1.2/tables/osc_orders.sql
Added Paths:
-----------
trunk/catalog/common/classes/addressUtility.php
Modified: trunk/catalog/admin/includes/classes/customerUtility.php
===================================================================
--- trunk/catalog/admin/includes/classes/customerUtility.php 2014-04-09 08:04:24 UTC (rev 5201)
+++ trunk/catalog/admin/includes/classes/customerUtility.php 2014-05-15 14:16:08 UTC (rev 5202)
@@ -3,12 +3,17 @@
@licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
@portion code Copyright (c) 2002 osCommerce
@package osCSS-2 <www http://www.oscss.org>
- @version 2.1.1
+ @version 2.1.2
@date 02/03/2012, 13:41
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
- @class customerUtility
*/
+
+require_once(DIR_FS_CATALOG . DIR_WS_COMMON_CLASSES .'addressUtility.php');
+
+/**
+ @class customerUtility
+*/
class customerUtility {
@@ -27,130 +32,21 @@
/**
- @brief Get list of address_format_id's
- @note specific for coutry chosse format adresse
- @return array(array('id'=>'','value'=>''))
+ @note ist old called, please use new class addressUtility
*/
public static function get_address_formats() {
- $address_format_query = tep_db_query("select address_format_id from " . TABLE_ADDRESS_FORMAT . " order by address_format_id");
- $address_format_array = array();
- while ($address_format_values = tep_db_fetch_array($address_format_query)) {
- $address_format_array[] = array('id' => $address_format_values['address_format_id'],
- 'text' => $address_format_values['address_format_id']);
- }
- return $address_format_array;
+ return addressUtility::GetAddressFormats();
}
+
/**
- @fn address_format($address_format_id, $address, $html, $boln, $eoln)
- @brief Constructeur l'adrresse (facturation, livrairson)
- @param $address_format_id int id format
- @param $address array content adresse book detail
- array(
- [company]
- firstname
- lastname
- // or
- [name]
- street_address
- suburb
- city
- state
-
- country_id
- zone_id
-
- // or
- [country]
-
- postcode
- )
- @param $html (bool)
- @param $boln
- @param $eoln
+ @note ist old called, please use new class addressUtility
*/
public static function address_format($address_format_id, $address, $html, $boln, $eoln) {
+ return addressUtility::FormatAddress($address_format_id, $address, $html, $boln, $eoln);
+ }
- if(!is_array($address) && !is_object($address) )
- return false;
- /// get format adresse modele
- $address_format_query = tep_db_query("select address_format as format from " . TABLE_ADDRESS_FORMAT . " where address_format_id = '" . (int)$address_format_id . "'");
- $address_format = tep_db_fetch_array($address_format_query);
-
- if(is_array($address) && count($address)>0 )
- $objad = new objectInfo($address);
- elseif(is_object($address))
- $objad = $address;
-
- $company = ( (_cst_bool('ACCOUNT_COMPANY')) ? tep_output_string_protected($objad->company) : '' );
-
- if (isset($objad->firstname) && tep_not_null($objad->firstname)) {
- $firstname = tep_output_string_protected($objad->firstname);
- $lastname = tep_output_string_protected($objad->lastname);
- } elseif (isset($objad->name) && tep_not_null($objad->name)) {
- $firstname = tep_output_string_protected($objad->name);
- $lastname = '';
- } else {
- $firstname = '';
- $lastname = '';
- }
- $street = tep_output_string_protected($objad->street_address);
- $suburb = tep_output_string_protected($objad->suburb);
- $city = tep_output_string_protected($objad->city);
- $state = tep_output_string_protected($objad->state);
- if (isset($objad->country_id) && tep_not_null($objad->country_id)) {
- $country = tep_get_country_name($objad->country_id);
-
- if (isset($objad->zone_id) && tep_not_null($objad->zone_id)) {
- $state = tep_get_zone_code($objad->country_id, $objad->zone_id, $state);
- }
- } elseif (isset($objad->country) && tep_not_null($objad->country)) {
- $country = tep_output_string_protected($objad->country);
- } else {
- $country = '';
- }
- $postcode = tep_output_string_protected($objad->postcode);
- $zip = $postcode;
-
- if ($html==1) {
- // HTML Mode
- $HR = '<hr>';
- $hr = '<hr>';
- if ( ($boln == '') && ($eoln == "\n") ) { // Values not specified, use rational defaults
- $CR = '<br />';
- $cr = '<br />';
- $eoln = $cr;
- } else { // Use values supplied
- $CR = $eoln . $boln;
- $cr = $CR;
- }
- }
- else {
- // Text Mode
- $CR = $eoln;
- $cr = $CR;
- $HR = '----------------------------------------';
- $hr = '----------------------------------------';
- }
-
- $statecomma = '';
- $streets = $street;
- if ($suburb != '') $streets = $street . $cr . $suburb;
- if ($country == '') $country = tep_output_string_protected($objad->country);
- if ($state != '') $statecomma = $state . ', ';
-
- $fmt = $address_format['format'];
- eval("\$address = \"$fmt\";");
-
- if ( (tep_not_null($company)) ) {
- $address = $company . $cr . $address;
- }
-
- return $address;
- }
-
-
/**
@author oscim <mail os...@os...> <www http://www.oscim.fr>
@brief Fournis un standard d'action pour la colonne client
Modified: trunk/catalog/admin/includes/functions/general.php
===================================================================
--- trunk/catalog/admin/includes/functions/general.php 2014-04-09 08:04:24 UTC (rev 5201)
+++ trunk/catalog/admin/includes/functions/general.php 2014-05-15 14:16:08 UTC (rev 5202)
@@ -789,8 +789,8 @@
function tep_customers_name($customers_id) { return customerUtility::customers_name($customers_id); }
-function tep_get_address_formats() { return customerUtility::get_address_formats(); }
-function tep_address_format($address_format_id, $address, $html, $boln, $eoln) { return customerUtility::address_format($address_format_id, $address, $html, $boln, $eoln); }
+function tep_get_address_formats() { return addressUtility::GetAddressFormats(); }
+function tep_address_format($address_format_id, $address, $html, $boln, $eoln) { return addressUtility::FormatAddress($address_format_id, $address, $html, $boln, $eoln); }
function tep_get_zone_code($country, $zone, $def_state) { return worldUtility::get_zone_code($country, $zone, $def_state); }
function tep_get_countries($default = '', $exclude=array()) { return worldUtility::get_countries($default, $exclude); }
Added: trunk/catalog/common/classes/addressUtility.php
===================================================================
--- trunk/catalog/common/classes/addressUtility.php (rev 0)
+++ trunk/catalog/common/classes/addressUtility.php 2014-05-15 14:16:08 UTC (rev 5202)
@@ -0,0 +1,180 @@
+<?php if (!defined('HTTP_SERVER')) die('You can not access this file directly!');
+/**
+ @licence GPL 2005-2014 The osCSS developers - osCSS Open Source E-commerce
+ @package osCSS-2 <www http://www.oscss.org>
+ @version 2.2.0
+ @date 12/07/2013, 20:14
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+ @file addressUtility.php
+ @dir /common/classes/
+*/
+
+
+class addressUtility {
+
+
+ /**
+ @brief Get list of address_format_id's
+ @note specific for coutry chosse format adresse
+ @return array(array('id'=>'','value'=>''))
+ */
+ public static function GetAddressFormats() {
+ $address_format_query = tep_db_query("select address_format_id from " . TABLE_ADDRESS_FORMAT . " order by address_format_id");
+ $address_format_array = array();
+ while ($address_format_values = tep_db_fetch_array($address_format_query)) {
+ $address_format_array[] = array('id' => $address_format_values['address_format_id'],
+ 'text' => $address_format_values['address_format_id']);
+ }
+ return $address_format_array;
+ }
+
+
+
+////
+// Returns the address_format_id for the given country
+// TABLES: countries;
+ function GetFormatId($country_id) {
+ $DB=Database::getInstance();
+ $address_format_query = $DB->query("select address_format_id as format_id from " . TABLE_COUNTRIES . " where countries_id = '" . (int)$country_id . "'");
+ if ($address_format_query->__get('numRows')) {
+ $address_format = $address_format_query->fetchAssoc();
+ return $address_format['format_id'];
+ } else {
+ return '1';
+ }
+ }
+
+
+
+ /**
+ @fn FormatAddress($address_format_id, $address, $html, $boln, $eoln)
+ @brief Constructeur l'adrresse (facturation, livrairson)
+ @param $address_format_id int id format
+ @param $address array content adresse book detail
+ array(
+ [company]
+ firstname
+ lastname
+ // or
+ [name]
+ street_address
+ suburb
+ city
+ state
+
+ country_id
+ zone_id
+
+ // or
+ [country]
+
+ postcode
+ )
+ @param $html (bool)
+ @param $boln
+ @param $eoln
+ */
+ function FormatAddress($address_format_id, $address, $html, $boln, $eoln) {
+
+
+ if(!is_array($address) && !is_object($address) )
+ return false;
+
+ $string = '';
+ $DB=Database::getInstance();
+ $address_format_query = $DB->query("select address_format as format from " . TABLE_ADDRESS_FORMAT . " where address_format_id = '" . (int)$address_format_id . "'");
+ $address_format = $address_format_query->fetchAssoc();
+
+ if(is_array($address) && count($address)>0 )
+ $obj = new objectInfo($address);
+ elseif(is_object($address))
+ $obj = $address;
+
+
+ if ($html) {
+// HTML Mode
+ $HR = '<hr />';
+ $hr = '<hr />';
+ if ( ($boln == '') && ($eoln == "\n") ) { // Values not specified, use rational defaults
+ $CR = '<br />';
+ $cr = '<br />';
+ $eoln = $cr;
+ } else { // Use values supplied
+ $CR = $eoln . $boln;
+ $cr = $CR;
+ }
+ } else {
+// Text Mode
+ $CR = $eoln;
+ $cr = $CR;
+ $HR = '----------------------------------------';
+ $hr = '----------------------------------------';
+ }
+
+ if ( _cst_bool('ACCOUNT_COMPANY')){
+ $company = tep_output_string_protected($obj->company);
+ if(isset($obj->extra ) ){
+ foreach($obj->extra as $row)
+ if($row->epf_class =='company')
+ $company .= $cr.tep_output_string_protected($row->value) ;
+ }
+ $company .=$cr;
+ }
+
+ $personnal = ( (isset($obj->firstname) && tep_not_null($obj->firstname)) ? tep_output_string_protected($obj->firstname) : '' );
+ $personnal .= ( (isset($obj->firstname) && tep_not_null($obj->firstname) && isset($obj->lastname) && tep_not_null($obj->lastname)) ? ' ' : '' );
+ $personnal .= ( (isset($obj->lastname) && tep_not_null($obj->lastname)) ? tep_output_string_protected($obj->lastname) : '' );
+ if(isset($obj->extra ) ){
+ foreach($obj->extra as $row)
+ if($row->epf_class =='personnal')
+ $personnal .= $cr.tep_output_string_protected($row->value) ;
+ }
+ $personnal .=$cr;
+
+
+ $streets = tep_output_string_protected($obj->street_address);
+ $streets .=( (isset($obj->suburb) && tep_not_null($obj->suburb)) ? $cr.tep_output_string_protected($obj->suburb) : '' );
+ if(isset($obj->extra ) ){
+ foreach($obj->extra as $row)
+ if($row->epf_class =='address')
+ $streets .= $cr.tep_output_string_protected($row->value) ;
+ }
+
+ $city = tep_output_string_protected($obj->city);
+ $state = tep_output_string_protected($obj->state);
+ if (isset($obj->country_id) && tep_not_null($obj->country_id)) {
+ $country = tep_get_country_name($obj->country_id);
+
+ if (isset($obj->zone_id) && tep_not_null($obj->zone_id)) {
+ $state = tep_get_zone_code($obj->country_id, $obj->zone_id, $state);
+ }
+ } elseif (isset($obj->country) && tep_not_null($obj->country)) {
+ $country = tep_output_string_protected($obj->country);
+ } else {
+ $country = '';
+ }
+ $postcode = tep_output_string_protected($obj->postcode);
+ $zip = $postcode;
+
+
+
+
+
+
+
+ $statecomma = '';
+
+ if ($state != '') $statecomma = $state . ', ';
+
+ $fmt = $address_format['format'];
+ eval("\$string = \"$fmt\";");
+
+
+
+ return $string;
+ }
+
+}
+
+?>
Modified: trunk/catalog/common/classes/order.php
===================================================================
--- trunk/catalog/common/classes/order.php 2014-04-09 08:04:24 UTC (rev 5201)
+++ trunk/catalog/common/classes/order.php 2014-05-15 14:16:08 UTC (rev 5202)
@@ -178,6 +178,7 @@
, delivery_company
, delivery_street_address
, delivery_suburb
+ , delivery_extra
, delivery_city
, delivery_postcode
, delivery_state
@@ -185,8 +186,13 @@
, delivery_address_format_id
, billing_name, billing_company
, billing_street_address
- , billing_suburb, billing_city
- , billing_postcode, billing_state, billing_country, billing_address_format_id
+ , billing_suburb
+ , billing_extra
+ , billing_city
+ , billing_postcode
+ , billing_state
+ , billing_country
+ , billing_address_format_id
, payment_method
, cc_type
, cc_owner
@@ -292,6 +298,7 @@
'postcode' => $order['delivery_postcode'],
'state' => $order['delivery_state'],
'country' => $order['delivery_country'],
+ 'extra' => unserialize($order['delivery_extra']),
'format_id' => $order['delivery_address_format_id']);
if (empty($this->delivery['name']) && empty($this->delivery['street_address'])) {
@@ -306,6 +313,7 @@
'postcode' => $order['billing_postcode'],
'state' => $order['billing_state'],
'country' => $order['billing_country'],
+ 'extra' => unserialize($order['billing_extra']),
'format_id' => $order['billing_address_format_id']);
$index = 0;
@@ -317,7 +325,7 @@
'qty' => $orders_products['products_quantity'],
'id' => $orders_products['products_id'],
'type' => $orders_products['products_type'],
- 'name' => $orders_products['products_name'],
+ 'name' => stripslashes($orders_products['products_name']),
'model' => $orders_products['products_model'],
'tax' => $orders_products['products_tax'],
'price' => $orders_products['products_price'],
@@ -378,22 +386,29 @@
global $languages_id, $currency, $currencies, /*$shipping,*/ $payment,$tax_address,$coupon_sav, $shipping_mod, $shipping_modules;
$this->content_type = $cart->get_content_type();
-// print_r($shipping);
-// exit;
- $customer_address_query = tep_db_query("select c.customers_firstname, c.customers_lastname, c.customers_telephone, c.customers_email_address, ab.entry_company, ab.entry_street_address, ab.entry_suburb, ab.entry_postcode, ab.entry_city, ab.entry_zone_id, z.zone_name, co.countries_id, co.countries_name, co.countries_iso_code_2, co.countries_iso_code_3, co.address_format_id, ab.entry_state from " . TABLE_CUSTOMERS . " c, " . TABLE_ADDRESS_BOOK . " ab left join " . TABLE_ZONES . " z on (ab.entry_zone_id = z.zone_id) left join " . TABLE_COUNTRIES . " co on (ab.entry_country_id = co.countries_id) where c.customers_id = '" . (int)$customer_id . "' and ab.customers_id = '" . (int)$customer_id . "' and c.customers_default_address_id = ab.address_book_id");
+
+ $customer_address_query = tep_db_query($sql = "select c.customers_firstname, c.customers_lastname, c.customers_telephone, c.customers_email_address, ab.entry_company, ab.entry_street_address, ab.entry_suburb, ab.entry_postcode, ab.entry_city, ab.entry_zone_id, z.zone_name, co.countries_id, co.countries_name, co.countries_iso_code_2, co.countries_iso_code_3, co.address_format_id, ab.entry_state from " . TABLE_CUSTOMERS . " c, " . TABLE_ADDRESS_BOOK . " ab left join " . TABLE_ZONES . " z on (ab.entry_zone_id = z.zone_id) left join " . TABLE_COUNTRIES . " co on (ab.entry_country_id = co.countries_id) where c.customers_id = '" . (int)$customer_id . "' and ab.customers_id = '" . (int)$customer_id . "' and c.customers_default_address_id = ab.address_book_id");
$customer_address = tep_db_fetch_array($customer_address_query);
// if not default address for this customer, use billto address
if( ! $customer_address ){
$customer_address_query = tep_db_query($sql = "select c.customers_firstname, c.customers_lastname, c.customers_telephone, c.customers_email_address, ab.entry_company, ab.entry_street_address, ab.entry_suburb, ab.entry_postcode, ab.entry_city, ab.entry_zone_id, z.zone_name, co.countries_id, co.countries_name, co.countries_iso_code_2, co.countries_iso_code_3, co.address_format_id, ab.entry_state from " . TABLE_CUSTOMERS . " c, " . TABLE_ADDRESS_BOOK . " ab left join " . TABLE_ZONES . " z on (ab.entry_zone_id = z.zone_id) left join " . TABLE_COUNTRIES . " co on (ab.entry_country_id = co.countries_id) where c.customers_id = '" . (int)$customer_id . "' and ab.customers_id = '" . (int)$customer_id . "' and ab.address_book_id = '" . (int)$billto . "' ");
$customer_address = tep_db_fetch_array($customer_address_query);
}
-
+
$shipping_address_query = tep_db_query("select ab.entry_firstname, ab.entry_lastname, ab.entry_company, ab.entry_street_address, ab.entry_suburb, ab.entry_postcode, ab.entry_city, ab.entry_zone_id, z.zone_name, ab.entry_country_id, c.countries_id, c.countries_name, c.countries_iso_code_2, c.countries_iso_code_3, c.address_format_id, ab.entry_state from " . TABLE_ADDRESS_BOOK . " ab left join " . TABLE_ZONES . " z on (ab.entry_zone_id = z.zone_id) left join " . TABLE_COUNTRIES . " c on (ab.entry_country_id = c.countries_id) where ab.customers_id = '" . (int)$customer_id . "' and ab.address_book_id = '" . (int)$sendto . "'");
$shipping_address = tep_db_fetch_array($shipping_address_query);
+
+ // extract extra for this address
+ $EFU = new ExtraFieldsUse('addressbook', $languages_id );
+ $shipping_address['extra'] = ExtraFieldsUse::GetExtraFieldsForId($sendto);
$billing_address_query = tep_db_query("select ab.entry_firstname, ab.entry_lastname, ab.entry_company, ab.entry_street_address, ab.entry_suburb, ab.entry_postcode, ab.entry_city, ab.entry_zone_id, z.zone_name, ab.entry_country_id, c.countries_id, c.countries_name, c.countries_iso_code_2, c.countries_iso_code_3, c.address_format_id, ab.entry_state from " . TABLE_ADDRESS_BOOK . " ab left join " . TABLE_ZONES . " z on (ab.entry_zone_id = z.zone_id) left join " . TABLE_COUNTRIES . " c on (ab.entry_country_id = c.countries_id) where ab.customers_id = '" . (int)$customer_id . "' and ab.address_book_id = '" . (int)$billto . "'");
$billing_address = tep_db_fetch_array($billing_address_query);
+ // extract extra for this address
+ $EFU = new ExtraFieldsUse('addressbook', $languages_id );
+ $billing_address['extra'] = ExtraFieldsUse::GetExtraFieldsForId($billto);
+
$tax_address_query = tep_db_query("select ab.entry_country_id, ab.entry_zone_id from " . TABLE_ADDRESS_BOOK . " ab left join " . TABLE_ZONES . " z on (ab.entry_zone_id = z.zone_id) where ab.customers_id = '" . (int)$customer_id . "' and ab.address_book_id = '" . (int)($this->content_type == 'virtual' ? $billto : $sendto) . "'");
$tax_address = tep_db_fetch_array($tax_address_query);
@@ -466,6 +481,7 @@
'zone_id' => $shipping_address['entry_zone_id'],
'country' => array('id' => $shipping_address['countries_id'], 'title' => $shipping_address['countries_name'], 'iso_code_2' => $shipping_address['countries_iso_code_2'], 'iso_code_3' => $shipping_address['countries_iso_code_3']),
'country_id' => $shipping_address['entry_country_id'],
+ 'extra' => $shipping_address['extra'],
'format_id' => $shipping_address['address_format_id']);
$this->billing = array('firstname' => $billing_address['entry_firstname'],
@@ -479,6 +495,7 @@
'zone_id' => $billing_address['entry_zone_id'],
'country' => array('id' => $billing_address['countries_id'], 'title' => $billing_address['countries_name'], 'iso_code_2' => $billing_address['countries_iso_code_2'], 'iso_code_3' => $billing_address['countries_iso_code_3']),
'country_id' => $billing_address['entry_country_id'],
+ 'extra' => $shipping_address['extra'],
'format_id' => $billing_address['address_format_id']);
$index = 0;
@@ -496,7 +513,7 @@
$this->products[$index] = array(
'qty' => $prdct['quantity'],
- 'name' => $prdct['name'],
+ 'name' => stripslashes($prdct['name']),
'model' => $prdct['model'],
'type' => $prdct['type'],
Modified: trunk/catalog/includes/classes/ExtraFieldsUse.php
===================================================================
--- trunk/catalog/includes/classes/ExtraFieldsUse.php 2014-04-09 08:04:24 UTC (rev 5201)
+++ trunk/catalog/includes/classes/ExtraFieldsUse.php 2014-05-15 14:16:08 UTC (rev 5202)
@@ -74,12 +74,9 @@
*/
private static function GetExtraFields($id = 0, $ref='', $restrict_mod='', $group_class=''){
-
-
$DB=Database::getInstance();
$list = array();
-
$sql = "SELECT
ce.fields_id,
@@ -95,6 +92,7 @@
cei.fields_name,
cei.fields_format as format,
cei.fields_name as label
+
FROM " . TABLE_EXTRA_FIELDS . " ce
@@ -134,7 +132,7 @@
$robj->id = (int) $extra_fields['fields_id'];
$robj->name = (string) $extra_fields['fields_name'];// obsolete
- $robj->label = (string) $extra_fields['fields_name'];
+ $robj->label = (string) $extra_fields['label'];
$robj->placeholder = (string) $extra_fields['label'];
$robj->input_name = (string) 'fields_'.$extra_fields['fields_id'];
@@ -231,15 +229,13 @@
// global $languages_id;
$DB=Database::getInstance();
// ne liste que les element FO
+ $list = self::GetExtraFields(0, '', $restrict_mod, $group_class);
-
- $list = self::GetExtraFields(0, '', $restrict_mod, $group_class);
-
foreach($list as $robj ){
$value='';
if($id>0){
- $value_query = $DB->query("select value from " . TABLE_EXTRA_FIELDS_TO . " where data_type='".self::$datatype."' AND data_id=" . $id . " and fields_id=" . $robj->id );
+ $value_query = $DB->query( "select value from " . TABLE_EXTRA_FIELDS_TO . " where data_type='".self::$datatype."' AND data_id=" . $id . " and fields_id=" . $robj->id );
$value_info = $value_query->fetchAssoc();
$value_list = explode("\n", $value_info['value']);
for($i = 0, $n = sizeof($value_list); $i < $n; $i++)
@@ -285,6 +281,7 @@
e.fields_id as id,
e.fields_input_type as input_type,
e.fields_key as fkey,
+ e.fields_group_class as fclass,
fields_advanced_search,
e.fields_active_value_language as value_language,
l.fields_name as label,
@@ -327,14 +324,14 @@
// $val = $value;
}
- $array[ (!empty($e['fkey'])?$e['fkey'] :$e['id']) ]=new objectInfo( array(
+ $array[ (!empty($e['epf_key'])?$e['fkey'] :$e['id']) ]=new objectInfo( array(
'label'=>(string)$e['label'],
+ 'placeholder'=>(string)$e['label'],
'name'=>(string)$e['label'], // obsolete
- 'placeholder'=>(string)$e['label'],
-
'value' => $value, // obsolete
'epf_key'=>(string)$e['fkey'],
+ 'epf_class'=>(string)$e['fclass'],
'epf_id'=>(int)$e['id'], // obsolete
'id'=>(int)$e['id'],
// 'epf_show_in_listing'=>(int)$e['epf_show_in_listing'],
Modified: trunk/catalog/includes/classes/checkout_process.php
===================================================================
--- trunk/catalog/includes/classes/checkout_process.php 2014-04-09 08:04:24 UTC (rev 5201)
+++ trunk/catalog/includes/classes/checkout_process.php 2014-05-15 14:16:08 UTC (rev 5202)
@@ -482,7 +482,7 @@
$DB=Database::getInstance();
/// table order
- $order_query = $DB->query("select orders_prefix,orders_type, customers_id, customers_name, customers_company, customers_street_address, customers_suburb, customers_city, customers_postcode, customers_state, customers_country, customers_telephone, customers_email_address, customers_address_format_id, delivery_name, delivery_company, delivery_street_address, delivery_suburb, delivery_city, delivery_postcode, delivery_state, delivery_country, delivery_address_format_id, billing_name, billing_company, billing_street_address, billing_suburb, billing_city, billing_postcode, billing_state, billing_country, billing_address_format_id, payment_method, cc_type, cc_owner, cc_number, cc_expires, currency, currency_value, date_purchased, orders_status, last_modified, ip_address, class_payment, class_shipping from " . TABLE_ORDERS . " where orders_id = '" . (int)$pre_order_id . "'");
+ $order_query = $DB->query("select orders_prefix,orders_type, customers_id, customers_name, customers_company, customers_street_address, customers_suburb, customers_city, customers_postcode, customers_state, customers_country, customers_telephone, customers_email_address, customers_address_format_id, delivery_name, delivery_company, delivery_street_address, delivery_suburb, delivery_extra, delivery_city, delivery_postcode, delivery_state, delivery_country, delivery_address_format_id, billing_name, billing_company, billing_street_address, billing_suburb, billing_extra, billing_city, billing_postcode, billing_state, billing_country, billing_address_format_id, payment_method, cc_type, cc_owner, cc_number, cc_expires, currency, currency_value, date_purchased, orders_status, last_modified, ip_address, class_payment, class_shipping from " . TABLE_ORDERS . " where orders_id = '" . (int)$pre_order_id . "'");
$order = $order_query->fetchAssoc();
// New Ref
@@ -523,6 +523,7 @@
'delivery_company' => tep_db_input($order['delivery_company']),
'delivery_street_address' => tep_db_input($order['delivery_street_address']),
'delivery_suburb' => tep_db_input($order['delivery_suburb']),
+ 'delivery_extra' => tep_db_input($order['delivery_extra']),
'delivery_city' => tep_db_input($order['delivery_city']),
'delivery_postcode' => tep_db_input($order['delivery_postcode']),
'delivery_state' => tep_db_input($order['delivery_state']),
@@ -532,6 +533,7 @@
'billing_company' => tep_db_input($order['billing_company']),
'billing_street_address' => tep_db_input($order['billing_street_address']),
'billing_suburb' => tep_db_input($order['billing_suburb']),
+ 'billing_extra' => tep_db_input($order['billing_extra']),
'billing_city' => tep_db_input($order['billing_city']),
'billing_postcode' => tep_db_input($order['billing_postcode']),
'billing_state' => tep_db_input($order['billing_state']),
@@ -709,8 +711,9 @@
*/
private function insert_order($customer_id, $order, $update=''){
+// print_r($order->customer);
+// exit;
-
$sql_data_array = array(
'customers_id' => $customer_id,
'orders_type' => ((!self::$mode)? '-1' : '0'),
@@ -730,6 +733,7 @@
'delivery_company' => $order->delivery['company'],
'delivery_street_address' => (string)$order->delivery['street_address'],
'delivery_suburb' => $order->delivery['suburb'],
+ 'delivery_extra' => $order->delivery['delivery_extra'],
'delivery_city' => (string)$order->delivery['city'],
'delivery_postcode' => $order->delivery['postcode'],
'delivery_state' => $order->delivery['state'],
@@ -739,6 +743,7 @@
'billing_company' => $order->billing['company'],
'billing_street_address' => (string)$order->billing['street_address'],
'billing_suburb' => $order->billing['suburb'],
+ 'billing_extra' => $order->billing['billing_extra'],
'billing_city' => (string)$order->billing['city'],
'billing_postcode' => $order->billing['postcode'],
'billing_state' => $order->billing['state'],
Modified: trunk/catalog/includes/functions/general.php
===================================================================
--- trunk/catalog/includes/functions/general.php 2014-04-09 08:04:24 UTC (rev 5201)
+++ trunk/catalog/includes/functions/general.php 2014-05-15 14:16:08 UTC (rev 5202)
@@ -436,98 +436,8 @@
-////
-// Returns the address_format_id for the given country
-// TABLES: countries;
- function tep_get_address_format_id($country_id) {
- $DB=Database::getInstance();
- $address_format_query = $DB->query("select address_format_id as format_id from " . TABLE_COUNTRIES . " where countries_id = '" . (int)$country_id . "'");
- if ($address_format_query->__get('numRows')) {
- $address_format = $address_format_query->fetchAssoc();
- return $address_format['format_id'];
- } else {
- return '1';
- }
- }
-////
-// Return a formatted address
-// TABLES: address_format
- function tep_address_format($address_format_id, $address, $html, $boln, $eoln) {
- $DB=Database::getInstance();
- $address_format_query = $DB->query("select address_format as format from " . TABLE_ADDRESS_FORMAT . " where address_format_id = '" . (int)$address_format_id . "'");
- $address_format = $address_format_query->fetchAssoc();
-
- $company = tep_output_string_protected($address['company']);
- if (isset($address['firstname']) && tep_not_null($address['firstname'])) {
- $firstname = tep_output_string_protected($address['firstname']);
- $lastname = tep_output_string_protected($address['lastname']);
- } elseif (isset($address['name']) && tep_not_null($address['name'])) {
- $firstname = tep_output_string_protected($address['name']);
- $lastname = '';
- } else {
- $firstname = '';
- $lastname = '';
- }
- $street = tep_output_string_protected($address['street_address']);
- $suburb = tep_output_string_protected($address['suburb']);
- $city = tep_output_string_protected($address['city']);
- $state = tep_output_string_protected($address['state']);
- if (isset($address['country_id']) && tep_not_null($address['country_id'])) {
- $country = tep_get_country_name($address['country_id']);
-
- if (isset($address['zone_id']) && tep_not_null($address['zone_id'])) {
- $state = tep_get_zone_code($address['country_id'], $address['zone_id'], $state);
- }
- } elseif (isset($address['country']) && tep_not_null($address['country'])) {
- $country = tep_output_string_protected($address['country']);
- } else {
- $country = '';
- }
- $postcode = tep_output_string_protected($address['postcode']);
- $zip = $postcode;
-
- if ($html) {
-// HTML Mode
- $HR = '<hr />';
- $hr = '<hr />';
- if ( ($boln == '') && ($eoln == "\n") ) { // Values not specified, use rational defaults
- $CR = '<br />';
- $cr = '<br />';
- $eoln = $cr;
- } else { // Use values supplied
- $CR = $eoln . $boln;
- $cr = $CR;
- }
- } else {
-// Text Mode
- $CR = $eoln;
- $cr = $CR;
- $HR = '----------------------------------------';
- $hr = '----------------------------------------';
- }
-
- $statecomma = '';
- $streets = $street;
- if ($suburb != '') $streets = $street . $cr . $suburb;
-// if ($country == '') $country = tep_output_string_protected($address['country']);
- if ($state != '') $statecomma = $state . ', ';
-
- $fmt = $address_format['format'];
- eval("\$address = \"$fmt\";");
-
- if ( (_cst_bool('ACCOUNT_COMPANY')) && (tep_not_null($company)) ) {
- $address = $company . $cr . $address;
- }
-
- return $address;
- }
-
-
-
-
-
function tep_get_manufacturers($manufacturers_array = '') {
$DB=Database::getInstance();
if (!is_array($manufacturers_array)) $manufacturers_array = array();
@@ -765,77 +675,19 @@
*/
function tep_get_extra_fields($datatype, $id, $special_mod='', $group_class='', $format=false){
global $languages_id;
- $DB=Database::getInstance();
- // ne liste que les element FO
+ $EFU = new ExtraFieldsUse($datatype, $languages_id );
+ return ExtraFieldsUse::DisplayExtraFieldsForDataId($id, $special_mod, $group_class, $format);
+}
- $sql = "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
- LEFT JOIN " . TABLE_EXTRA_FIELDS_LABELS . " cei ON( cei.fields_id=ce.fields_id AND cei.languages_id ='" . $languages_id."' )
- WHERE
- ce.fields_type = '".$datatype."'
- AND ce.fields_admin IN ( 0 , 3 )
- AND ce.fields_status=1 ";
- if(tep_not_null($special_mod))
- $sql .= " AND fields_special_mod='".$special_mod."' ";
- else
- $sql .= " AND fields_special_mod='' ";
-
- if(tep_not_null($group_class))
- $sql .= " AND fields_group_class='".$group_class."' ";
- else
- $sql .= " AND fields_group_class='' ";
-
- $sql .= " ORDER BY ce.fields_sort ASC, ce.fields_key ";
-
- $extra_fields_query = $DB->query($sql);
- $extra_fields_string ='';
- if($extra_fields_query->__get('numRows')>0){
- while($extra_fields = $extra_fields_query->fetchAssoc()){
- $value='';
- if($id>0){
- $value_query = $DB->query("select value from " . TABLE_EXTRA_FIELDS_TO . " where data_type='".$datatype."' AND data_id=" . $id . " and fields_id=" . $extra_fields['fields_id']);
- $value_info = $value_query->fetchAssoc();
- $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];
- }
-
-
- $robj = new stdClass();
- $robj->id = (int) $extra_fields['fields_id'];
- $robj->name = (string) $extra_fields['fields_name'];
- $robj->input_name = (string) 'fields_'.$extra_fields['fields_id'];
- $robj->input_type = (int) $extra_fields['fields_input_type'];
- $robj->input_value = $value; //$extra_fields['fields_input_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);
- }
-
- if(!$format)
- $extra_fields_string .=ExtraUtility::DisplayRow($robj, false );
- else
- $extra_fields_string .=ExtraUtility::DisplayRow($robj, false, $format);
- }
- }
- return $extra_fields_string;
+/**
+ EPF
+ Recup du label d'un champs epf
+*/
+function tep_epf_label($id, $key, $datatype=''){
+ global $languages_id;
+ $EFU = new ExtraFieldsUse('', $languages_id );
+ return ExtraFieldsUse::GetLabelForEpfId($id);
+
}
@@ -856,19 +708,7 @@
}
-/**
- EPF
- Recup du label d'un champs epf
-*/
-function tep_epf_label($id){
- global $languages_id;
- $DB=Database::getInstance();
- $resobj=$DB->query("SELECT epf_label FROM ".TABLE_PRODUCTS_EXTRA_FIELDS_LABELS." WHERE epf_id='".(int)$id."' and languages_id='".(int)$languages_id."' ");
- $res=$resobj->fetchAssoc();
- return $res['epf_label'];
-}
-
/**
* \fn tep_mail($to_name, $to_email_address, $email_subject, $email_text, $from_email_name, $from_email_address)
* \brief
@@ -1117,7 +957,10 @@
function tep_count_customer_address_book_entries($id = '', $check_session = true) {return customer::count_customer_address_book_entries($id , $check_session ); }
function tep_address_label($customers_id, $address_id = 1, $html = false, $boln = '', $eoln = "\n") {return customer::address_label($customers_id, $address_id , $html , $boln, $eoln ); }
-
+function tep_get_address_format_id($country_id) { return addressUtility::GetFormatId($country_id); }
+function tep_address_format($address_format_id, $address, $html, $boln, $eoln){ return addressUtility::FormatAddress($address_format_id, $address, $html, $boln, $eoln); }
+
+
function tep_get_tax_rate($class_id, $country_id = -1, $zone_id = -1) { global $price; return $price->get_tax_rate($class_id, $country_id, $zone_id); }
function tep_get_tax_description($class_id, $country_id, $zone_id) { global $price; return $price->get_tax_description($class_id, $country_id, $zone_id); }
function tep_add_tax($products_price, $tax, $force=false, $strict=true) { global $price; return $price->display_with_tax($products_price, $tax, $force, $strict); }
Modified: trunk/catalog/includes/modules/account/address_book.php
===================================================================
--- trunk/catalog/includes/modules/account/address_book.php 2014-04-09 08:04:24 UTC (rev 5201)
+++ trunk/catalog/includes/modules/account/address_book.php 2014-05-15 14:16:08 UTC (rev 5202)
@@ -76,7 +76,7 @@
- if(isset($_GET['action'])){
+ if(isset($_REQUEST['aca_mod']) && $_REQUEST['aca_mod'] == $this->code){
/// call js view last time
$file=DIR_WS_INCLUDES.'js/'.__CLASS__.'.js.php';
if( ($file=page::fix_file($file)) && $file !=false ) $page->javascript->add_script($file, array('sort'=>30));
@@ -198,9 +198,48 @@
$res = tep_db_perform(TABLE_CUSTOMERS, $sql_data_array, 'update', "customers_id = '" . (int)$customer_id . "'");
+
}
+ /*
+ Section for update extra
+ */
+ $extra_fields_query = tep_db_query($s="select ce.fields_id, fields_key, fields_required_email from " . TABLE_EXTRA_FIELDS . " ce where ce.fields_type = 'addressbook' AND ce.fields_status=1 and fields_admin IN(0,3) AND fields_special_mod ='' ");
+
+ while($extra_fields = tep_db_fetch_array($extra_fields_query)) {
+ tep_db_query("DELETE FROM " . TABLE_EXTRA_FIELDS_TO . " WHERE fields_id = '".$extra_fields['fields_id']."' AND data_id= '".$new_address_book_id."' ");
+
+ if(isset($_POST['fields_' . $extra_fields['fields_id']])){
+ $sql_data_array = array(
+ 'data_type'=>'addressbook',
+ 'data_id' => (int)$new_address_book_id,
+ 'fields_id' => $extra_fields['fields_id'],
+ 'value' => tep_db_prepare_input($_POST['fields_' . $extra_fields['fields_id']]) );
+ }
+ else {
+ $sql_data_array = array(
+ 'data_type'=>'addressbook',
+ 'data_id' => (int)$new_address_book_id,
+ 'fields_id' => $extra_fields['fields_id'],
+ 'value' => '');
+ /// value in list mutli
+ if(isset($_POST['fields_' . $extra_fields['fields_id'] . '_total'])){
+ $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'] .= tep_db_prepare_input($_POST['fields_' . $extra_fields['fields_id'] . '_' . $i]);
+ }
+ }
+ }
+ }
+
+ $res = tep_db_perform(TABLE_EXTRA_FIELDS_TO, $sql_data_array);
+ if(!$res)
+ $error++;
+ }
$page->messageStack->add_session('addressbook', __('SUCCESS_ADDRESS_BOOK_ENTRY_UPDATED'), 'success');
}
@@ -294,7 +333,7 @@
$v['href']= self::href_link();
return new objectInfo( array(
'type'=>'menu',
- 'pile'=>'overview', // myaccount
+ 'pile'=>'myaccount', // this pile for load in page template; this value possible (myaccount | overview )
'conteneur'=>array(new objectInfo($v))
));
}
@@ -375,7 +414,7 @@
self::$adress_book=$this->cInfo->adress_book;
self::$count=$this->cInfo->the_count;
- $v['title']=__("Carnet d'adresses personnel");
+ $v['title']=__("carnet adresses personnel");
$v['content']=tep_output_string_protected(tep_get_include_contents('account/'.__CLASS__.'/'.__FUNCTION__.'.page'),false,true);
return new objectInfo( $v );
Modified: trunk/catalog/install/includes/sql/mysql/tables/osc_orders.sql
===================================================================
--- trunk/catalog/install/includes/sql/mysql/tables/osc_orders.sql 2014-04-09 08:04:24 UTC (rev 5201)
+++ trunk/catalog/install/includes/sql/mysql/tables/osc_orders.sql 2014-05-15 14:16:08 UTC (rev 5202)
@@ -34,6 +34,7 @@
delivery_company varchar(32) ,
delivery_street_address varchar(64) not null ,
delivery_suburb varchar(32) ,
+ delivery_extra TEXT NULL,
delivery_city varchar(32) not null ,
delivery_postcode varchar(10) not null ,
delivery_state varchar(32) ,
@@ -43,6 +44,7 @@
billing_company varchar(32) ,
billing_street_address varchar(64) not null ,
billing_suburb varchar(32) ,
+ billing_extra TEXT NULL,
billing_city varchar(32) not null ,
billing_postcode varchar(10) not null ,
billing_state varchar(32) ,
Modified: trunk/catalog/install/includes/sql/mysql/upgrade/2.1.1rc_2.1.2/tables/osc_orders.sql
===================================================================
--- trunk/catalog/install/includes/sql/mysql/upgrade/2.1.1rc_2.1.2/tables/osc_orders.sql 2014-04-09 08:04:24 UTC (rev 5201)
+++ trunk/catalog/install/includes/sql/mysql/upgrade/2.1.1rc_2.1.2/tables/osc_orders.sql 2014-05-15 14:16:08 UTC (rev 5202)
@@ -18,3 +18,7 @@
ALTER TABLE osc_orders ADD facture_ref VARCHAR( 32 ) NULL AFTER facture_id ;
ALTER TABLE osc_orders ADD synchro_event INT( 1 ) NOT NULL DEFAULT '0';
+
+ALTER TABLE osc_orders ADD delivery_extra TEXT NULL AFTER delivery_suburb;
+
+ALTER TABLE osc_orders ADD billing_extra TEXT NULL AFTER billing_suburb;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2014-04-09 08:04:30
|
Revision: 5201
http://sourceforge.net/p/oscss/svn/5201
Author: oscim
Date: 2014-04-09 08:04:24 +0000 (Wed, 09 Apr 2014)
Log Message:
-----------
Upgrade exts
Modified Paths:
--------------
trunk/catalog/admin/includes/classes/aca.php
trunk/catalog/admin/includes/exts/package/tags/datatype.php
trunk/extensions/ACCOUNT_PAYPAL_stable/catalog/admin/includes/modules/account/account_paypal.php
trunk/extensions/ACCOUNT_PAYPAL_stable/catalog/includes/languages/fr_FR/modules/account/account_paypal.txt
trunk/extensions/ACCOUNT_PAYPAL_stable/catalog/includes/modules/account/account_paypal.php
Added Paths:
-----------
trunk/extensions/ACCOUNT_PAYPAL_stable/catalog/admin/includes/gabarit/customers/
trunk/extensions/ACCOUNT_PAYPAL_stable/catalog/admin/includes/gabarit/customers/paypal/
trunk/extensions/ACCOUNT_PAYPAL_stable/catalog/admin/includes/gabarit/customers/paypal/display_edit.edit.gab
trunk/extensions/ACCOUNT_PAYPAL_stable/catalog/templates/defaut/includes/gabarit/account/paypal/
Removed Paths:
-------------
trunk/extensions/ACCOUNT_PAYPAL_stable/catalog/admin/includes/gabarit/customers.account_paypal.view.gab
trunk/extensions/ACCOUNT_PAYPAL_stable/catalog/templates/defaut/includes/gabarit/account/account_paypal/
Modified: trunk/catalog/admin/includes/classes/aca.php
===================================================================
--- trunk/catalog/admin/includes/classes/aca.php 2014-04-08 07:30:54 UTC (rev 5200)
+++ trunk/catalog/admin/includes/classes/aca.php 2014-04-09 08:04:24 UTC (rev 5201)
@@ -11,7 +11,7 @@
*/
-
+error_reporting(E_ALL);
/**
@class AcaFactory
@brief call generic module, by factory class
@@ -61,7 +61,7 @@
public function __call($method, $attrs) {
$r=array();
foreach ($this->modules as $key=>$module) {
- if (method_exists($module, $method )) /// control presence method
+ if (method_exists($module, $method ) && $module->enabled ) /// control presence method
$r[$key]=$this->modules[$key]->$method($attrs);
}
@@ -503,7 +503,7 @@
}
/**
- Debug: show all modules names that are registered.
+ @brief Debug: show all modules names that are registered.
*/
function show_registered_modules() {
//
Modified: trunk/catalog/admin/includes/exts/package/tags/datatype.php
===================================================================
--- trunk/catalog/admin/includes/exts/package/tags/datatype.php 2014-04-08 07:30:54 UTC (rev 5200)
+++ trunk/catalog/admin/includes/exts/package/tags/datatype.php 2014-04-09 08:04:24 UTC (rev 5201)
@@ -68,7 +68,7 @@
/**-----------------------------conflicts--------------------------- */
public function conflicts_check_for_remove() {
-ue;
+
}
/**
Copied: trunk/extensions/ACCOUNT_PAYPAL_stable/catalog/admin/includes/gabarit/customers/paypal/display_edit.edit.gab (from rev 5187, trunk/extensions/ACCOUNT_PAYPAL_stable/catalog/admin/includes/gabarit/customers.account_paypal.view.gab)
===================================================================
--- trunk/extensions/ACCOUNT_PAYPAL_stable/catalog/admin/includes/gabarit/customers/paypal/display_edit.edit.gab (rev 0)
+++ trunk/extensions/ACCOUNT_PAYPAL_stable/catalog/admin/includes/gabarit/customers/paypal/display_edit.edit.gab 2014-04-09 08:04:24 UTC (rev 5201)
@@ -0,0 +1,23 @@
+<?php
+/**
+ @licence GPL 2005-2011 The osCSS developers - osCSS Open Source E-commerce
+ @package account_paypal osCSS-2 <www http://www.oscss.org>
+ @version 2.1.0
+ @date 18/04/11, 21:43
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+*/
+global $languages_id,$processed;
+?>
+
+<div class="block_input">
+ <fieldset class="block_field">
+
+ <legend><?php echo __('legend paypal') ?></legend>
+
+ <p>
+ <label for="rib_bic"><?php echo __('account paypal email'); ?></label>
+ <?php echo tep_draw_input_field('account_paypal[account_paypal]', 'account_paypal', (isset(account_paypal::$account_paypal) ? account_paypal::$account_paypal : '' ) ); ?>
+ </p>
+ </fieldset>
+</div>
Deleted: trunk/extensions/ACCOUNT_PAYPAL_stable/catalog/admin/includes/gabarit/customers.account_paypal.view.gab
===================================================================
--- trunk/extensions/ACCOUNT_PAYPAL_stable/catalog/admin/includes/gabarit/customers.account_paypal.view.gab 2014-04-08 07:30:54 UTC (rev 5200)
+++ trunk/extensions/ACCOUNT_PAYPAL_stable/catalog/admin/includes/gabarit/customers.account_paypal.view.gab 2014-04-09 08:04:24 UTC (rev 5201)
@@ -1,23 +0,0 @@
-<?php
-/**
- @licence GPL 2005-2011 The osCSS developers - osCSS Open Source E-commerce
- @package account_paypal osCSS-2 <www http://www.oscss.org>
- @version 2.1.0
- @date 18/04/11, 21:43
- @author oscim <mail aur...@os...> <www http://www.oscim.fr>
- @encode UTF-8
-*/
-global $languages_id,$processed;
-?>
-
-<div class="block_input">
- <fieldset class="block_field">
-
- <legend><?php echo __('legend paypal') ?></legend>
-
- <p>
- <label for="rib_bic"><?php echo __('account paypal email'); ?></label>
- <?php echo tep_draw_input_field('account_paypal[account_paypal]', 'account_paypal', (isset(account_paypal::$account_paypal) ? account_paypal::$account_paypal : '' ) ); ?>
- </p>
- </fieldset>
-</div>
Modified: trunk/extensions/ACCOUNT_PAYPAL_stable/catalog/admin/includes/modules/account/account_paypal.php
===================================================================
--- trunk/extensions/ACCOUNT_PAYPAL_stable/catalog/admin/includes/modules/account/account_paypal.php 2014-04-08 07:30:54 UTC (rev 5200)
+++ trunk/extensions/ACCOUNT_PAYPAL_stable/catalog/admin/includes/modules/account/account_paypal.php 2014-04-09 08:04:24 UTC (rev 5201)
@@ -10,7 +10,11 @@
@brief view information rib customers
*/
+require_once( DIR_FS_CATALOG . DIR_WS_COMMON_CLASSES . 'ExtraUtility.php');
+require_once(DIR_FS_ADMIN . DIR_WS_CLASSES .'ModOne.php');
+
class account_paypal
+ Extends ModOne
implements InterfaceModule{
/**
@a object
@@ -40,74 +44,212 @@
}
- public function check_action($actions){
- global $oscss, $languages_id;
- self::$action=$actions['action'];
+ /**
+ @brief Load , adjust and define var environement GetConf master module
+ @param $opt array
+ type => '' string name type for define return
+ languages_id => '' int
+ */
+ public function GetConf($opt){
+ $array = array();
- $customers_id=customers::$cID;
- switch(self::$action){
- case 'insert':
- case 'update':
- $bas_user=tep_db_query($sql="select fields_id from " . TABLE_CUSTOMERS_TO_EXTRA_FIELDS . " where customers_id='" .(int) $customers_id."'");
- while ($extra_fields = tep_db_fetch_array($bas_user)) {
- $res[]=$extra_fields['fields_id'];
+ global $languages_id;
+
+ /// create cache for speed load page
+ $osCSS_Cache = new osCSS_Cache();
+ if ($osCSS_Cache->read('extra-'.MGabCont::CallSt('GetClassDatatype').'-'.__CLASS__.'-' . $languages_id.'-type', 720))
+ $epf = $osCSS_Cache->getCache();
+ else {
+ $languages = tep_get_languages();
+ $epf_query = tep_db_query($sql="select e.fields_id, e.fields_input_type, e.fields_size ,e.fields_key, l.fields_name, l.languages_id from " . TABLE_EXTRA_FIELDS . " e join " . TABLE_EXTRA_FIELDS_LABELS . " l where fields_type='customer' AND e.fields_status and e.fields_key='CUSTO_PAYPAL' and l.languages_id='".(int)$languages_id."' and (e.fields_id = l.fields_id) order by e.fields_sort");
+ $epf = $epf_query->fetchAllAssoc();
+ $res= $osCSS_Cache->writeBuffer($epf);
+ }
+
+
+
+ switch ($opt['type']) {
+ case 'allfields':
+
+ foreach($epf as $e){
+ $array['epf2pp'.__class__.$e['fields_id'].'.value'] = array(
+ 'sort'=>true,
+ 'alias'=>'extra_'.(!empty($e['fields_key'])? $e['fields_key'] : $e['fields_id'] ),
+ 'text'=>$e['fields_name'],
+// 'width'=>'8%',
+ 'class'=>'tleft',
+ 'position_tab'=>'extra',
+ 'edit'=>array(
+ 'input_type'=>ExtraUtility::GetInputType($e['fields_input_type']),
+ 'input_size'=>$e['fields_size'],
+ 'input_name'=> (string)'fields_'.$e['fields_id'],
+// 'values_list'=>array(
+// array('id'=>0, 'text'=>__('@customers text status off') ),
+// array('id'=>1, 'text'=>__('@customers text status on') ),
+// ),
+ 'position_col'=>'extra',
+ 'position_grp'=>3
+ ),
+ );
+
+ }
+
+ break;
+
+ case 'tables':
+
+ global $languages_id;
+
+
+ foreach($epf as $e){
+ $array['epf2pp'.__class__.$e['fields_id']] = " LEFT JOIN " . TABLE_EXTRA_FIELDS_TO . " epf2pp".__class__.$e['fields_id']." ON( epf2pp".__class__.$e['fields_id'].".data_id=c.customers_id AND epf2pp".__class__.$e['fields_id'].".fields_id = '".$e['fields_id']."' AND data_type='customer') ";
+ }
+
+ break;
+
+
+
+ }
+ return $array;
}
- $extra_fields_query = tep_db_query($sql="select ce.fields_id from " . TABLE_EXTRA_FIELDS . " ce, " . TABLE_EXTRA_FIELDS_INFO . " cei where ce.fields_status=1 and ce.fields_id=cei.fields_id and cei.languages_id =" . $languages_id." and fields_key='CUSTO_PAYPAL' ");
- $extra_fields = tep_db_fetch_array($extra_fields_query);
- if(isset($_POST[__CLASS__])){
- $sql_data_array = array('value' => tep_db_prepare_input($_POST[__CLASS__]['account_paypal']) );
- }
- else {
- $sql_data_array = array( 'value' => '');
- }
- if(in_array($extra_fields['fields_id'],$res))
- tep_db_perform(TABLE_CUSTOMERS_TO_EXTRA_FIELDS, $sql_data_array, 'update', "fields_id='".(int)$extra_fields['fields_id']."' and customers_id='".(int)$customers_id."'");
- else{
- $sql_data_array['customers_id']=(int)$customers_id;
- $sql_data_array['fields_id']=(int)$extra_fields['fields_id'];
- tep_db_perform(TABLE_CUSTOMERS_TO_EXTRA_FIELDS, $sql_data_array);
- }
- break;
-/*
- case 'deleteconfirm':
- tep_db_query("delete from " . TABLE_CUSTOMERS_RIB . " where customers_id = '" . (int)$customer_id . "'");
+ /**
+ @brief format db value for this allfields
+ @param $key string name key
+ @param $item array
+ */
+ public function formatdbvalue($key,$item){
+ global $languages_id;
- break;*/
+ switch($key){
+ // extra
+ default:
+ $value = $item[$key];
+ }
+
+ return $value;
+ }
+
+ /**
+ @brief Call by fetch sqlcustomers
+ @param $option array
+ @param $item array
+ array
+ 0 =>
+ array
+ 'customers_id' => string '2' (length=1)
+ 'shortkey' => boolean false
+ */
+ public function fetch($option){
+
+ $customers_id=$option[0]['customers_id'];
+ $shortkey=$option[0]['shortkey'];
+
+
+ return $this->load_db_values((int)$customers_id);
+ }
+
+ /**
+ @brief action methode
+ */
+ public function check_action($action){
+ global $languages_id;
+ $action=$action;
+ $messageStack=messageStack::getInstance();
+
+ 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_LABELS . " cei WHERE fields_type='customer' AND ce.fields_status=1 and ce.fields_status=1 and cei.fields_id=ce.fields_id and cei.languages_id ='". $languages_id ."' AND ce.fields_key='CUSTO_PAYPAL' ");
+ while($extra_fields = tep_db_fetch_array($extra_fields_query)){
+
+/**
+TODO Prendre en charge le type de champs pour le control
+*/
+ if(strlen($_POST['fields_' . $extra_fields['fields_id']])<$extra_fields['fields_size'])
+ if($extra_fields['fields_required_status'] > 0)
+ throw new Exception(sprintf('entry extra fields (%s) error length %s',$extra_fields['fields_name'],$extra_fields['fields_size']) );
+ else
+ $messageStack->add(sprintf('entry extra fields (%s) error length %s',$extra_fields['fields_name'],$extra_fields['fields_size']), 'warning');
+ }
+
+ }catch(Exception $e){
+ $messageStack->add($e->getMessage(), 'error');
+ }
+ break;
}
- return $actions;
+
+ return $action;
}
-
- public function load_db_values($cID) {
+ public function deleteconfirm_account ($customers_id){
global $languages_id;
- $extra_fields_query = tep_db_query($sql="select ce.fields_id, ce.fields_input_type, ce.fields_input_value, ce.fields_required_status, cei.fields_name, ce.fields_status, ce.fields_key from " . TABLE_EXTRA_FIELDS . " ce, " . TABLE_EXTRA_FIELDS_INFO . " cei where ce.fields_status=1 and ce.fields_id=cei.fields_id and cei.languages_id =" . $languages_id." and ce.fields_key='CUSTO_PAYPAL' ");
- $extra_fields = tep_db_fetch_array($extra_fields_query);
+ $extra_fields_query = tep_db_query("select ce.fields_id from " . TABLE_EXTRA_FIELDS . " ce where fields_type='customer' AND ce.fields_status=1 and fields_key='CUSTO_PAYPAL' order by ce.fields_group_class");
- $value_query = tep_db_query($sql="SELECT ex.value as val FROM " . TABLE_CUSTOMERS_TO_EXTRA_FIELDS . " ex WHERE customers_id=" . (int)$cID . " AND fields_id='" . (int)$extra_fields['fields_id']."'");
- $value_info = tep_db_fetch_array($value_query);
+ while($extra_fields = tep_db_fetch_array($extra_fields_query)){
+ tep_db_query($sql="DELETE from " . TABLE_EXTRA_FIELDS_TO . " where data_type = 'customer' AND data_id='" .(int) $customers_id."' AND fields_id='".$extra_fields['fields_id']."'");
+ }
+ }
- self::$account_paypal= $value_info['val'];
+ /**
+ @brief methode call by sqlcustomer, and process after update master table customers
+ */
+ public function after_update($customers_id) {
+ // instance Factory Extra
+ new sqlextrafieldsto('customer');
+
+ return sqlextrafieldsto::SaveToDataId($customers_id, __CLASS__);
}
- public function load_post_values ($post) {
-// self::$cInfo->objectInfo($post);
+ public function load_db_values($customer_id) {
+ global $languages_id;
+
+ $customers = array();
+
+ // ne liste que les champs qui n'appartiennent pas a un modules precis
+ $extra_fields_query = tep_db_query($sql = "select ce.fields_id, ce.fields_input_type, ce.fields_key, cef.value, ce.fields_required_status, cei.fields_name as text,cei.fields_format as format, ce.fields_status, ce.fields_input_type from " . TABLE_EXTRA_FIELDS . " ce LEFT JOIN " . TABLE_EXTRA_FIELDS_TO . " cef on ( cef.data_type = 'customer' AND cef.data_id='" . $customer_id . "' and cef.fields_id=ce.fields_id ), " . TABLE_EXTRA_FIELDS_LABELS . " cei where fields_key='CUSTO_PAYPAL' AND ce.fields_type='customer' AND ce.fields_status=1 and cei.fields_id=ce.fields_id and cei.languages_id =" . $languages_id." order by ce.fields_sort");
+ $extra_fields_string = '';
+
+ if(tep_db_num_rows($extra_fields_query)>0){
+ $customers = array();
+ while($extra_fields = tep_db_fetch_array($extra_fields_query)){
+
+ $value='';
+ $input ='';
+
+ $customers[(!empty($extra_fields['fields_key']) ? $extra_fields['fields_key'] : $extra_fields['fields_id'])] =new objectInfo($extra_fields);
+ }
+ }
+
+ return $customers;
}
+ public static function get_extra_fields($customer_id,$languages_id){
+ // instance Factory Extra
+ new sqlextrafieldsto('customer');
+ return sqlextrafieldsto::FormatToDataId($customer_id, $languages_id, customers::$processed, __CLASS__);
+ }
+
+
+
public function display_edit(&$contents,$id) {
global $languages_id;
self::$cID =$id;
self::load_db_values($id);
- $contents []= array('title'=> __('account paypal'),
- 'text'=> tep_get_include_contents('customers.'.__CLASS__.'.view') );
+ $contents[]= array(
+ 'title'=> __('account paypal'),
+ 'text'=> tep_get_include_contents('customers/paypal/'.__FUNCTION__.'.edit')
+ );
return $contents;
}
@@ -115,50 +257,69 @@
-/** Functions for modules administration */
- function check() { return false;
- if (!isset($this->_check)) {
- $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_ACA_ACCOUNT_PAYPAL_SORT_ORDER'");
- $this->_check = tep_db_num_rows($check_query);
- }
- return $this->_check;
- }
+ /**
+ @remarks implements InterfaceModule depend
+ if module twin in backoffice, report all content install in the other module
+ public function install() {return true;}
+ public function keys() {return array(); }
+ */
+
+ /**
+ @fn install()
+ @brief add all configuration
+ @note
+ - Modules can emarquer sql installation instructions, however, in the case of transverse information, or dependent of an extension, preferring the implementation of an extension, file with sql independent
+ - please, pefix all var configuration by 'MODULE_OT__MODTYPENAME_MAJ_'
+ - if module twin in backoffice, report all content install in the other module
+ - Not use language in DB , but function :__()
+ for MODULE_TOTO_ST
+ var title MODULE_TOTO_ST_S (small description)
+ var description MODULE_TOTO_ST_L (long description)
+ */
function install() {
+
+ $list = array(
+ array(
+ 'key'=>'MODULE_ACA_ACCOUNT_PAYPAL_SORT_ORDER',
+ 'value'=>5,
+ 'type'=> 1
+ ),
+ );
+
$error = 0;
- $DB=Database::getInstance();
- $DB->beginTransaction();
-
-
- if( !tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added,configuration_type) values ('".addslashes(__("Ordre de tri"))."', 'MODULE_ACA_ACCOUNT_PAYPAL_SORT_ORDER', '0', '".addslashes(__("Ordre de tri, dans l'affichage"))."', '1', '0', now(),1)") )
- $error++;
-
+ foreach($list as $row)
+ if(!sqlconfiguration::fetch(array('key'=>$row['key'])) )
+ if ( ! sqlconfiguration::create($row) )
+ $error++;
+
$languages = tep_get_languages();
- $res=tep_db_query("INSERT INTO ".TABLE_EXTRA_FIELDS." (fields_id, fields_input_type, fields_input_value, fields_status, fields_required_status, fields_size, fields_required_email, fields_key, fields_admin, fields_special_mod, fields_group_class) VALUES('', 0, '', 1, 0, 0, 0, 'CUSTO_PAYPAL', 2, '".__CLASS__."', '".__CLASS__."');");
- if( ! $res )
- $error++;
+ $EF = new sqlextrafieldsFactory('customer');
+
+ $array = array('sqlarray'=>array(
+ 'key'=>'CUSTO_PAYPAL',
+ 'special_mod'=>$this->code,
+ 'size'=>50,
+
+ ));
+ $_id=sqlextrafieldsFactory::create($array);
- for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
- if( ! tep_db_query($sql ="INSERT INTO ".TABLE_EXTRA_FIELDS_LABELS." (fields_id, languages_id, fields_name) VALUES('".tep_db_insert_id($res)."', '".(int)$languages[$i]['id']."', '".__('Compte paypal')."');") )
- $error++;
- }
+ for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
+ sqlextrafieldslabels::create(array(
+ 'id'=>$_id,
+ 'languages_id'=>(int)$languages[$i]['id'],
+ 'name'=>__('Compte paypal'),
+ 'format'=>'%label% %input%',
+ ));
+ }
- if( $error > 0){
- $DB->rollbackTransaction();
- return false;
- }
- else{
- $DB->commitTransaction();
- return 1;
- }
}
- function remove() {
- foreach($this->keys as $key)
- tep_db_query(" delete from" . TABLE_CONFIGURATION . " WHERE configuration_key='".$key."' limit 1");
- }
-
+ /**
+ @fn keys()
+ @return array all key configuration define by this module
+ */
function keys() {
return array('MODULE_ACA_ACCOUNT_PAYPAL_SORT_ORDER');
}
Modified: trunk/extensions/ACCOUNT_PAYPAL_stable/catalog/includes/languages/fr_FR/modules/account/account_paypal.txt
===================================================================
--- trunk/extensions/ACCOUNT_PAYPAL_stable/catalog/includes/languages/fr_FR/modules/account/account_paypal.txt 2014-04-08 07:30:54 UTC (rev 5200)
+++ trunk/extensions/ACCOUNT_PAYPAL_stable/catalog/includes/languages/fr_FR/modules/account/account_paypal.txt 2014-04-09 08:04:24 UTC (rev 5201)
@@ -1,9 +1,10 @@
<?php
/**
@licence GPL 2005-2011 The osCSS developers - osCSS Open Source E-commerce
- @package account_paypal osCSS-2 <www http://www.oscss.org>
+ @portion code Copyright (c) 2002 osCommerce
+ @package osCSS-2 <www http://www.oscss.org>
@version 2.1.0
- @date 18/04/11, 21:43
+ @date 02/03/11, 14:05
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
*/
@@ -11,20 +12,10 @@
$lang['module aca account paypal text title']= 'Gestion paypal client';
$lang['module aca account paypal description']= 'Gerer les paypal clients';
-$lang['view et update my account paypal']= 'Voir / modifier mon compte paypal';
-$lang['account paypal']= 'Mon compte paypal';
+$lang['account_paypal link my paypal']= 'Compte Paypal';
+$lang['account paypal']= 'Compte Paypal';
-$lang['information account paypal']= 'Information du compte';
+$lang['information account paypal']= 'informations de mon compte';
$lang['titulaire du compte']= 'Titulaire du compte';
-$lang['account paypal email adrress']= 'Email: ';
-
-/* Widget */
- $lang['@account_paypal widget view']= 'Compte paypal vendeur';
- $lang['@account_paypal master account identify']= "Identification";
- $lang['@account_paypal account user email']= "Email";
-
-/* menu */
- $lang['@account_paypal link manage']= 'Compte paypal vendeur';
-
-
+$lang['account paypal email adrress']= 'Email compte Paypal: ';
?>
\ No newline at end of file
Modified: trunk/extensions/ACCOUNT_PAYPAL_stable/catalog/includes/modules/account/account_paypal.php
===================================================================
--- trunk/extensions/ACCOUNT_PAYPAL_stable/catalog/includes/modules/account/account_paypal.php 2014-04-08 07:30:54 UTC (rev 5200)
+++ trunk/extensions/ACCOUNT_PAYPAL_stable/catalog/includes/modules/account/account_paypal.php 2014-04-09 08:04:24 UTC (rev 5201)
@@ -9,8 +9,13 @@
@class account_paypal
*/
+require_once(DIR_FS_CATALOG . DIR_WS_CLASSES .'ModPublicOne.php');
+
+
+
class account_paypal
- extends AbstractAccount
+ extends
+ ModPublicOne
implements InterfaceModule{
/**
@@ -29,10 +34,6 @@
@var string
*/
public static $display_view_form_title;
- /**
- @var array
- */
- public static $current;
/**
@var string action
*/
@@ -41,6 +42,8 @@
@var string
*/
public static $type ='account';
+
+
/**
*/
function __construct(){
@@ -52,10 +55,6 @@
$this->enabled = true;
- // box path base
- $this->path_box = 'account/'.__CLASS__.'/';
-
-
$this->sql_data_array=array();
$this->cInfo = new objectInfo(array());
@@ -63,13 +62,17 @@
$page->new_class('javascript');
/// script validate js
-// $page->javascript->add_framework("ext/jquery/jquery.min.js");
-// $page->javascript->add_script("ext/jquery/jquery.validate.min.js", array('sort'=>30));
-//
-// /// call js view last time
-// $file=DIR_WS_INCLUDES.'js/'.__CLASS__.'.js.php';
-// if( ($file=page::fix_file($file)) && $file !=false ) $page->javascript->add_script($file, array('sort'=>30));
+ $page->javascript->add_framework("ext/jquery/jquery.min.js");
+ $page->javascript->add_script("ext/jquery/jquery.validate.min.js", array('sort'=>30));
+ /// call js view last time
+ $file=DIR_WS_INCLUDES.'js/'.__CLASS__.'.js.php';
+ if( ($file=page::fix_file($file)) && $file !=false ) $page->javascript->add_script($file, array('sort'=>30));
+
+ global $page, $lang,$language;
+ if(($path=$page->fix_file(DIR_WS_LANGUAGES . $language.'/InstantGagnant.txt' ,true, true)) !=false)
+ include($path);
+
}
public function get_header($action=''){}
@@ -140,119 +143,41 @@
/**
*/
- public function load_db_values($customer_id) {
- global $languages_id;
-// global $customer_id;
- $extra_fields_query = tep_db_query($sql="select ce.fields_id, ce.fields_input_type, ce.fields_input_value, ce.fields_required_status, cei.fields_name, ce.fields_status, ce.fields_key from " . TABLE_EXTRA_FIELDS . " ce, " . TABLE_EXTRA_FIELDS_INFO . " cei where ce.fields_status=1 and ce.fields_id=cei.fields_id and cei.languages_id =" . $languages_id." and ce.fields_key='CUSTO_PAYPAL' ");
-
- $extra_fields = tep_db_fetch_array($extra_fields_query);
-
- $value_query = tep_db_query($sql="select value from " . TABLE_CUSTOMERS_TO_EXTRA_FIELDS . " where customers_id=" . (int)$customer_id . " and fields_id=" . $extra_fields['fields_id']);
-
- if(tep_db_num_rows($value_query)>0) $value_info = tep_db_fetch_array($value_query);
- else $value_info=array('value'=>'');
-
- self::$account_paypal= $value_info['value'];
+ public function load_db_values($cID) {
+// global $languages_id;
+// $extra_fields_query = tep_db_query($sql="select ce.fields_id, ce.fields_input_type, ce.fields_input_value, ce.fields_required_status, cei.fields_name, ce.fields_status, ce.fields_key from " . TABLE_EXTRA_FIELDS . " ce, " . TABLE_EXTRA_FIELDS_INFO . " cei where ce.fields_status=1 and ce.fields_id=cei.fields_id and cei.languages_id =" . $languages_id." and ce.fields_key='CUSTO_PAYPAL' ");
+//
+// $extra_fields = tep_db_fetch_array($extra_fields_query);
+//
+// $value_query = tep_db_query($sql="select value from " . TABLE_CUSTOMERS_TO_EXTRA_FIELDS . " where customers_id=" . (int)$cID . " and fields_id=" . $extra_fields['fields_id']);
+//
+// if(tep_db_num_rows($value_query)>0) $value_info = tep_db_fetch_array($value_query);
+// else $value_info=array('value'=>'');
+//
+// self::$account_paypal= $value_info['value'];
}
-
- public function repost_values () {
- // Repost all values that are not arrays
- foreach ($this->pInfo as $key=>$val) {
- if (!is_array($this->pInfo[$key])) echo "\n".tep_draw_hidden_field($this->code .'['.$key.']', stripslashes($val))."\n";
-
- }
- }
-
/**
- List des element du block my account
- */
-// public function display_view_min_listMyAccount($cID){
-// global $page;
-//
-// $v['title']=__("view et update my account paypal");
-// $v['href_link']= tep_href_link(FILENAME_ACCOUNT, 'aca_mod='.$this->code.'&aca_type='.$this->type.'&aca_action=display_view', 'SSL');
-// return array(new objectInfo($v));
-// }
-
-
- /**
@fn CstrMenu()
@brief Prepare menu
*/
public function CstrMenu(){
global $page;
$customer_id=$page->the_var('customer_id');
-// $this->load_db_values($customer_id);
switch(self::$action){
default:
- $v['title']=__("@account_paypal link manage");
+ $v['title']=__("account_paypal link my paypal");
$v['href']= self::href_link();
return new objectInfo( array(
'type'=>'menu',
- 'pile'=>'myaccount',
+ 'pile'=>'overview', // myaccount
'conteneur'=>array(new objectInfo($v))
));
}
}
-
- /**
- * \fn display_view($pID='')
- * \brief Affiche Block edit/modif reviews
- * @param $pID int id products
- * @p $customer_id int current
- */
-// public function display_view($pID=''){
-// global $customers_id;
-// // $customers_id=$page->the_var('customer_id');
-// $this->load_db_values($customers_id);
-// $cust = customer::getInstance();
-//
-// self::$account = $cust->the_customer(); //$page->_call('customer','the_customer');
-//
-//
-// return new objectInfo(array('title'=>__("account paypal"),'content'=> tep_output_string_protected(tep_get_include_contents(__CLASS__.'.'.__FUNCTION__)) ) );
-// }
- public function display_view($pID=''){
- global $page;
-
- $customer_id=$page->the_var('customer_id');
-
- switch(self::$action){
- default:
-
- if(isset($_GET['aca_action'])){
-
- self::$account = $page->_call('customer','the_customer');
-// self::$list=$this->cInfo;
-/*
- // add box
- $page->oscss_boxes->_add('marketing_'.__CLASS__,'right',array('sort'=>61));*/
-
-
- $v['title']=__("@account_paypal title page");
-
- $v['content']=tep_output_string_protected(tep_get_include_contents($this->path_box.__FUNCTION__.'.page'),false,true);
- return new objectInfo( $v );
- }
- else {
-// $obj = customer::getInstance();
-// $customer=$obj->the_customer();
-//
-// self::$current=new objectInfo($customer);
-// $v['title']=__("@account_paypal widget view");
-// $v['href']= tep_href_link(FILENAME_ACCOUNT, 'aca_mod='.$this->code.'&aca_type='.$this->type.'&aca_action=display_view', 'SSL');
-// $v['content']=tep_output_string_protected(tep_get_include_contents('account/'.__CLASS__.'/box_view'),false,true);
-// return new objectInfo(array(
-// 'type'=>'box',
-// 'conteneur'=>array(new objectInfo( $v ))
-// ));
- }
- }
- }
-
+
/**
@brief internal link
@param classic action
@@ -268,6 +193,7 @@
break;
case 'page':
$base .='display_view';
+
break;
default:
$base .='display_view'. ((!empty($action))?'&action=ab_'.$action : '');
@@ -278,13 +204,37 @@
}
-/** implements InterfaceModule depend */
- public function check() {}
- public function install() {}
- public function remove() {}
- public function keys() {
- return array('MODULE_ACA_ACCOUNT_PAYPAL_SORT_ORDER');
+ /**
+ * \fn display_view($pID='')
+ * \brief Affiche Block edit/modif reviews
+ * @param $pID int id products
+ * @p $customer_id int current
+ */
+ public function display_view($pID=''){
+ global $page;
+ $customer_id=$page->the_var('customer_id');
+ $this->load_db_values($customer_id);
+ self::$account = $page->_call('customer','the_customer');
+
+
+ return new objectInfo(array(
+ 'title'=>__("account paypal"),
+ 'content'=> tep_output_string_protected(tep_get_include_contents('account/paypal/'.__FUNCTION__.'.edit'))
+ ) );
}
+
+
+
+ /**
+ * \brief Form delete entry address book
+ */
+// private static function form_delete(){
+// self::$display_view_form_title=__('HEADING_TITLE_DELETE_ENTRY');
+// return tep_get_include_contents(__CLASS__.'.'.__FUNCTION__);
+// }
+
+
+
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2014-04-08 07:30:57
|
Revision: 5200
http://sourceforge.net/p/oscss/svn/5200
Author: oscim
Date: 2014-04-08 07:30:54 +0000 (Tue, 08 Apr 2014)
Log Message:
-----------
Fix use "type" in object data
Modified Paths:
--------------
trunk/catalog/includes/modules/also_purchased_products.php
trunk/catalog/includes/modules/featured.php
trunk/catalog/includes/modules/listing.php
trunk/catalog/includes/modules/listing_cat.php
trunk/catalog/includes/modules/listing_catchild_and_product.php
trunk/catalog/includes/modules/listing_featured.php
trunk/catalog/includes/modules/listing_manufacturer_products.php
trunk/catalog/includes/modules/listing_pages.php
trunk/catalog/includes/modules/new_products.php
trunk/catalog/includes/modules/product_listing.php
trunk/catalog/includes/modules/upcoming_products.php
trunk/catalog/templates/defaut/Childs_tpl/module.php
Modified: trunk/catalog/includes/modules/also_purchased_products.php
===================================================================
--- trunk/catalog/includes/modules/also_purchased_products.php 2014-04-07 12:29:39 UTC (rev 5199)
+++ trunk/catalog/includes/modules/also_purchased_products.php 2014-04-08 07:30:54 UTC (rev 5200)
@@ -63,7 +63,7 @@
$pd=product::get_item($new_products['products_id']);
if($pd !=false){
// $pd->aca=$aca_listing->return_db_min($new_products['products_id']);
- $pd->type = 'product';
+ $pd->data = 'product';
$p[]=$pd;
}
}
Modified: trunk/catalog/includes/modules/featured.php
===================================================================
--- trunk/catalog/includes/modules/featured.php 2014-04-07 12:29:39 UTC (rev 5199)
+++ trunk/catalog/includes/modules/featured.php 2014-04-08 07:30:54 UTC (rev 5200)
@@ -88,7 +88,7 @@
if( DataTypes::is_active($dt)){
$pd = $dt::get_item($featured['id']);
if($pd !=false) {
- $pd->type = $dt;
+ $pd->data = $dt;
$p[]=$pd;
}
}
Modified: trunk/catalog/includes/modules/listing.php
===================================================================
--- trunk/catalog/includes/modules/listing.php 2014-04-07 12:29:39 UTC (rev 5199)
+++ trunk/catalog/includes/modules/listing.php 2014-04-08 07:30:54 UTC (rev 5200)
@@ -58,7 +58,7 @@
// call loop for Aca modules
$pd->aca=$aca_listing->return_db_min($listing['id']);
// add type data in current item
- $pd->type = $subtype;
+ $pd->data = $subtype;
$p[]=$pd;
}
Modified: trunk/catalog/includes/modules/listing_cat.php
===================================================================
--- trunk/catalog/includes/modules/listing_cat.php 2014-04-07 12:29:39 UTC (rev 5199)
+++ trunk/catalog/includes/modules/listing_cat.php 2014-04-08 07:30:54 UTC (rev 5200)
@@ -68,7 +68,7 @@
$pd=categorie::get_item($ele_db['categories_id']);
if($pd !=false){
- $pd->type = 'categorie';
+ $pd->data = 'categorie';
$p[]= $pd;
}
Modified: trunk/catalog/includes/modules/listing_catchild_and_product.php
===================================================================
--- trunk/catalog/includes/modules/listing_catchild_and_product.php 2014-04-07 12:29:39 UTC (rev 5199)
+++ trunk/catalog/includes/modules/listing_catchild_and_product.php 2014-04-08 07:30:54 UTC (rev 5200)
@@ -90,7 +90,7 @@
while ($listing = tep_db_fetch_array($listing_query)){
$pd=product::get_item($listing['products_id']);
- $pd->type = 'product';
+ $pd->data = 'product';
$p[]=$pd;
}
Modified: trunk/catalog/includes/modules/listing_featured.php
===================================================================
--- trunk/catalog/includes/modules/listing_featured.php 2014-04-07 12:29:39 UTC (rev 5199)
+++ trunk/catalog/includes/modules/listing_featured.php 2014-04-08 07:30:54 UTC (rev 5200)
@@ -81,7 +81,7 @@
continue;
// call loop for Aca modules
// add type data in current item
- $pd->type = $subtype;
+ $pd->data = $subtype;
$p[]=$pd;
}
Modified: trunk/catalog/includes/modules/listing_manufacturer_products.php
===================================================================
--- trunk/catalog/includes/modules/listing_manufacturer_products.php 2014-04-07 12:29:39 UTC (rev 5199)
+++ trunk/catalog/includes/modules/listing_manufacturer_products.php 2014-04-08 07:30:54 UTC (rev 5200)
@@ -67,7 +67,7 @@
while ($listing_manufacturer_products = $res->fetchAssoc()){
$pd=product::get_item($listing_manufacturer_products['products_id']);
$pd->aca=$aca_listing->return_db_min($listing_manufacturer_products['products_id']);
- $pd->type = 'product';
+ $pd->data = 'product';
$p[]=$pd;
}
Modified: trunk/catalog/includes/modules/listing_pages.php
===================================================================
--- trunk/catalog/includes/modules/listing_pages.php 2014-04-07 12:29:39 UTC (rev 5199)
+++ trunk/catalog/includes/modules/listing_pages.php 2014-04-08 07:30:54 UTC (rev 5200)
@@ -30,7 +30,7 @@
$pd=content::get_item($listing['content_id']);
- $pd->type = 'content';
+ $pd->data = 'content';
$p[]=$pd;
}
Modified: trunk/catalog/includes/modules/new_products.php
===================================================================
--- trunk/catalog/includes/modules/new_products.php 2014-04-07 12:29:39 UTC (rev 5199)
+++ trunk/catalog/includes/modules/new_products.php 2014-04-08 07:30:54 UTC (rev 5200)
@@ -90,7 +90,7 @@
$pd=product::get_item($new_products['id']);
if($pd !=false){
- $pd->type = 'product';
+ $pd->data = 'product';
$p[]=$pd;
}
}
Modified: trunk/catalog/includes/modules/product_listing.php
===================================================================
--- trunk/catalog/includes/modules/product_listing.php 2014-04-07 12:29:39 UTC (rev 5199)
+++ trunk/catalog/includes/modules/product_listing.php 2014-04-08 07:30:54 UTC (rev 5200)
@@ -28,7 +28,7 @@
while ($listing = tep_db_fetch_array($listing_query)){
$pd=product::get_item($listing['products_id']);
$pd->aca=$aca_listing->return_db_min($listing['products_id']);
- $pd->type = 'product';
+ $pd->data = 'product';
$p[]=$pd;
}
Modified: trunk/catalog/includes/modules/upcoming_products.php
===================================================================
--- trunk/catalog/includes/modules/upcoming_products.php 2014-04-07 12:29:39 UTC (rev 5199)
+++ trunk/catalog/includes/modules/upcoming_products.php 2014-04-08 07:30:54 UTC (rev 5200)
@@ -47,7 +47,7 @@
while ($new_products = $res->fetchAssoc() ){
$pd=product::get_item($new_products['products_id']);
$pd->aca=$aca_listing->return_db_min($new_products['products_id']);
- $pd->type = 'product';
+ $pd->data = 'product';
$p[]=$pd;
}
Modified: trunk/catalog/templates/defaut/Childs_tpl/module.php
===================================================================
--- trunk/catalog/templates/defaut/Childs_tpl/module.php 2014-04-07 12:29:39 UTC (rev 5199)
+++ trunk/catalog/templates/defaut/Childs_tpl/module.php 2014-04-08 07:30:54 UTC (rev 5200)
@@ -46,11 +46,11 @@
<?php endif; ?>
- <div class=" one <?php echo $ele->type ?>">
+ <div class=" one <?php echo $ele->data ?>">
- <?php if($ele->type =='product'): /** PRODUCTS */ ?>
+ <?php if($ele->data =='product'): /** PRODUCTS */ ?>
<section class="col-sm-3 col-xs-6 outerblock">
<div class="innerblock">
<?php if (tep_not_null( $ele->GetPrice() ) && $page->_draw_in_page('PRODUCT_LIST_PRICE')) { ?>
@@ -109,13 +109,13 @@
<?php else : /** Other */ ?>
<section class="col-sm-3 col-xs-6 outerblock">
<div class="innerblock">
- <p class="title <?php echo $ele->type ?>">
+ <p class="title <?php echo $ele->data ?>">
<a href="<?php echo $ele->GetHref() ; ?>" ><?php echo $ele->GetTitle() ?></a>
</p>
- <p class="img-thumbnail <?php echo $ele->type ?>">
+ <p class="img-thumbnail <?php echo $ele->data ?>">
<?php echo '<a href="' . $ele->GetHref(). '">' . tep_image(DIR_WS_IMAGES . $ele->GetImage(), $ele->GetTitle(), $page->_conf_value('SIDEBAR_IMG_WIDTH'), $page->_conf_value('SIDEBAR_IMAGE_HEIGHT')) . '</a>' ;?>
</p>
- <p class="preview <?php echo $ele->type ?>">
+ <p class="preview <?php echo $ele->data ?>">
<?php echo truncate(strip_tags(unhtmlentities( $ele->GetText() )), 100) ?>
</p>
</div>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2014-04-07 12:29:42
|
Revision: 5199
http://sourceforge.net/p/oscss/svn/5199
Author: oscim
Date: 2014-04-07 12:29:39 +0000 (Mon, 07 Apr 2014)
Log Message:
-----------
Fix
Modified Paths:
--------------
trunk/catalog/admin/includes/gabarit/products/edit.tab.generic.gab
trunk/catalog/admin/includes/modules/pages/featureds.php
trunk/catalog/admin/includes/modules/pages/products.php
Modified: trunk/catalog/admin/includes/gabarit/products/edit.tab.generic.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/products/edit.tab.generic.gab 2014-04-05 14:42:23 UTC (rev 5198)
+++ trunk/catalog/admin/includes/gabarit/products/edit.tab.generic.gab 2014-04-07 12:29:39 UTC (rev 5199)
@@ -19,13 +19,13 @@
<?php echo $page::DisplayField('name','%s',$page::$Info); ?>
- <fieldset class="block_field">
- <legend><?php echo __('@products text legend ref and model'); ?></legend>
- <?php echo $page::DisplayField('products_ref','',$page::$Info); ?>
- <?php if($page::CheckClassProduct('CLASS_MODELE')): ?>
- <?php echo $page::DisplayField('model','',$page::$Info); ?>
- <?php endif; ?>
- </fieldset>
+ <?php if($page::CheckClassProduct('CLASS_REF') || $page::CheckClassProduct('CLASS_MODELE') ): ?>
+ <fieldset class="block_field">
+ <legend><?php echo __('@products text legend ref and model'); ?></legend>
+ <?php echo $page::DisplayField('products_ref','',$page::$Info); ?>
+ <?php echo $page::DisplayField('model','',$page::$Info); ?>
+ </fieldset>
+ <?php endif; ?>
<?php if($page::CheckClassProduct('CLASS_SORTORDER')): ?>
<li class="block_input">
@@ -39,14 +39,15 @@
-
+ <?php if($page::CheckClassProduct('CLASS_BARCODE')): ?>
<fieldset class="block_field">
<legend><?php echo __('@products text legend barcode'); ?></legend>
<?php echo $page::DisplayField('barcode_type','',$page::$Info); ?>
<?php echo $page::DisplayField('barcode','',$page::$Info); ?>
</fieldset>
-
+ <?php endif; ?>
+
<fieldset class="block_field">
<ul>
<?php foreach ($page::$modules->__call('display_inline',array('flag'=>'general','pid'=> $page::$Info->id)) as $value){ $title[]=$value['title']; $text[]=$value['text']; } ?>
Modified: trunk/catalog/admin/includes/modules/pages/featureds.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/featureds.php 2014-04-05 14:42:23 UTC (rev 5198)
+++ trunk/catalog/admin/includes/modules/pages/featureds.php 2014-04-07 12:29:39 UTC (rev 5199)
@@ -46,10 +46,6 @@
const FILENAME = FILENAME_FEATURED;
/**
- @var string file
- */
- public static $Id;
- /**
@var array listchilds current edit
*/
public static $listchilds= array();
Modified: trunk/catalog/admin/includes/modules/pages/products.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/products.php 2014-04-05 14:42:23 UTC (rev 5198)
+++ trunk/catalog/admin/includes/modules/pages/products.php 2014-04-07 12:29:39 UTC (rev 5199)
@@ -181,7 +181,11 @@
),
),
- 'p.products_model' => array(
+ );
+
+
+ if( self::CheckClassProduct('CLASS_MODELE') )
+ self::$allfields['p.products_model']= array(
'sort'=>true,
'alias'=>'model',
'text'=>__('products table heading modele'),
@@ -189,8 +193,7 @@
'input_name'=>'products_model',
'required_status'=>false,
),
- ),
- );
+ );
self::$allfields['p.products_type']= array(
'sort'=>true,
@@ -221,6 +224,7 @@
'default'=>true,
);
+// if(self::CheckClassProduct('CLASS_SORTORDER'))
self::$allfields['p.products_ordered']= array(
'sort'=>true,
'search'=>true,
@@ -236,7 +240,7 @@
// ),
);
-
+ if( self::CheckClassProduct('CLASS_REF') )
if(isset($_SESSION['filters'][__CLASS__]['bystock']) && ($_SESSION['filters'][__CLASS__]['bystock'] == 2) ) {
self::$allfields['if(ps.products_stock_ref, ps.products_stock_ref , p.products_ref)']= array(
'sort'=>true,
@@ -343,18 +347,19 @@
// /** TODO implements adjust col by cumul attributes */
}
else {
- self::$allfields['p.products_weight']= array(
- 'sort'=>true,
- 'alias'=>'weight',
- 'text'=>__('products table heading weight'),
- 'default'=>true,
- 'class'=>'tright',
- 'edit'=>array(
- 'input_name'=>'products_weight',
- 'input_size'=>'16',
- 'position_grp'=>6.8
- ),
- );
+ if(self::CheckClassProduct('CLASS_WEIGHT'))
+ self::$allfields['p.products_weight']= array(
+ 'sort'=>true,
+ 'alias'=>'weight',
+ 'text'=>__('products table heading weight'),
+ 'default'=>true,
+ 'class'=>'tright',
+ 'edit'=>array(
+ 'input_name'=>'products_weight',
+ 'input_size'=>'16',
+ 'position_grp'=>6.8
+ ),
+ );
// if($conf->extends->CUSTOMERS_GROUPS->enabled){
@@ -452,7 +457,7 @@
),
);
-// if(_cst_bool('SET_BARCODE')) {
+ if(/*_cst_bool('SET_BARCODE') &&*/ self::CheckClassProduct('CLASS_BARCODE') ) {
self::$allfields['p.products_barcode_type']= array(
'sort'=>true,
'alias'=>'barcode_type',
@@ -469,7 +474,6 @@
);
if(isset($_SESSION['filters'][__CLASS__]['bystock']) && ($_SESSION['filters'][__CLASS__]['bystock'] > 0) ) {
-
self::$allfields['if(ps.products_stock_barcode, ps.products_stock_barcode , p.products_barcode)']= array(
'sort'=>true,
'alias'=>'barcode',
@@ -492,9 +496,9 @@
),
);
}
-// }
+ }
- if(_cst_bool('STOCK_CHECK')) {
+ if(_cst_bool('STOCK_CHECK') && self::CheckClassProduct('CLASS_STOCK') ) {
if(isset($_SESSION['filters'][__CLASS__]['bystock']) && $_SESSION['filters'][__CLASS__]['bystock'] ==2 )
self::$allfields['if(ps.products_stock_quantity, ps.products_stock_quantity, p.products_quantity)']= array(
'sort'=>true,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2014-04-05 14:42:27
|
Revision: 5198
http://sourceforge.net/p/oscss/svn/5198
Author: oscim
Date: 2014-04-05 14:42:23 +0000 (Sat, 05 Apr 2014)
Log Message:
-----------
Fix
Modified Paths:
--------------
trunk/catalog/admin/includes/classes/drivers/sqlextrafields.php
trunk/catalog/admin/includes/classes/fileUtility.php
trunk/catalog/admin/includes/exts/package/CIP.php
trunk/catalog/admin/includes/exts/package/tags/addfile.php
trunk/catalog/admin/includes/exts/package/tags/addfilelg.php
trunk/catalog/admin/includes/modules/configuration/modconfigSubMod.php
trunk/catalog/admin/includes/modules/newsletters/new_products.php
trunk/catalog/admin/includes/modules/newsletters/newsletter.php
trunk/catalog/admin/includes/modules/pages/customers.php
trunk/catalog/admin/includes/modules/pages/held_orders.php
trunk/catalog/includes/classes/ExtraFieldsUse.php
Modified: trunk/catalog/admin/includes/classes/drivers/sqlextrafields.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlextrafields.php 2014-03-27 10:21:17 UTC (rev 5197)
+++ trunk/catalog/admin/includes/classes/drivers/sqlextrafields.php 2014-04-05 14:42:23 UTC (rev 5198)
@@ -44,7 +44,7 @@
self::PrepaDataAfterUse( $specimen , $dataarray, array() );
$_data_array = self::GetSqlArray();
-
+
unset($_data_array['date_added']);
unset($_data_array['last_modified']);
@@ -279,6 +279,8 @@
$par = array(
'fields_id' =>-1,
+ 'fields_type' =>'product', // Data
+
'fields_active_value_language' =>0,
'fields_value_list' =>0,
'fields_sort' =>5,
@@ -335,7 +337,7 @@
$objEF= sqlextrafields::fetch(array('id'=>$epf_id) , true);
- new sqlextrafieldsto('product');
+ new sqlextrafieldsto($datatype);
$dump = sqlextrafieldsto::fetch(array('id'=>$epf_id, 'data_type'=>$datatype , 'data_id'=>(int)$data_id) , true);
if(!$dump)
Modified: trunk/catalog/admin/includes/classes/fileUtility.php
===================================================================
--- trunk/catalog/admin/includes/classes/fileUtility.php 2014-03-27 10:21:17 UTC (rev 5197)
+++ trunk/catalog/admin/includes/classes/fileUtility.php 2014-04-05 14:42:23 UTC (rev 5198)
@@ -144,11 +144,11 @@
if(substr($testpath,-1) !='/')
$testpath .= '/';
-
- if (!file_exists($testpath) && !is_dir($testpath)) {
+ $testpath = trim($testpath);
+ if ( !empty($testpath) && !file_exists($testpath) && !is_dir($testpath)) {
if( ! @mkdir($testpath, 755, true) ) {
- var_dump($testpath);
- self::ComportForError(__CLASS__.'->'.__FUNCTION__.'::'.__LINE__.__("cant create dir text"), 'error');
+// var_dump($testpath);
+ self::ComportForError(__CLASS__.'->'.__FUNCTION__.'::'.__LINE__.__("cant create dir text") . ' '.$testpath, 'error');
}
}
Modified: trunk/catalog/admin/includes/exts/package/CIP.php
===================================================================
--- trunk/catalog/admin/includes/exts/package/CIP.php 2014-03-27 10:21:17 UTC (rev 5197)
+++ trunk/catalog/admin/includes/exts/package/CIP.php 2014-04-05 14:42:23 UTC (rev 5198)
@@ -521,7 +521,7 @@
//! backup
- if (!$this->total_backup()){
+ if ( _cst_bool('ALLOW_FILES_BACKUP') && !$this->total_backup()){
self::InProcess(__("Erreur durant traitement de cette fonction total_backup()"), __CLASS__.'->'.__FUNCTION__.'::'.__LINE__,'block');
return false;
}
Modified: trunk/catalog/admin/includes/exts/package/tags/addfile.php
===================================================================
--- trunk/catalog/admin/includes/exts/package/tags/addfile.php 2014-03-27 10:21:17 UTC (rev 5197)
+++ trunk/catalog/admin/includes/exts/package/tags/addfile.php 2014-04-05 14:42:23 UTC (rev 5198)
@@ -137,7 +137,7 @@
// check if file is already copied
if(fileUtility::equal_files($backup_file,$fs_filename)) continue;
- if (!_cst_bool('ALLOW_OVERWRITE_MODIFIED')) {
+ if (_cst_bool('ALLOW_OVERWRITE_MODIFIED') !='false') {
if (!is_file($cip_file)) {
$msg="Backup file ".$backup_file." is not exists. This file needed to check if file". $fs_filename. " was modified since Contrib Installer have been installed.";
@@ -270,7 +270,7 @@
$fs_filename=replace_path_admin($this->fs_filename($i));
if (!file_exists($cip_file) && is_file($cip_file)) {
- CIP::InProcess("Run time error: <strong>".__("le fichier de la contrib qui esy declare dans install n est pas trouve ")."</strong><br /> "."<pre> fichier :: ".$cip_file."</pre>" , __CLASS__.'->'.__FUNCTION__.'::'.__LINE__,'block');
+ CIP::InProcess("Run time error: <strong>".__("le fichier de la contrib qui est declare dans install n est pas trouve ")."</strong><br /> "."<pre> fichier :: ".$cip_file."</pre>" , __CLASS__.'->'.__FUNCTION__.'::'.__LINE__,'block');
return true;
}
@@ -287,8 +287,9 @@
If we couldn't backup we should print an error and stop.
If Total_Backup havn't been done we should do it.
*/
-// if (_cst_bool('ALLOW_FILES_BACKUP'))
- parent::backup_file(replace_path_admin($this->data['filename'][$i]));
+ if ( _cst_bool('ALLOW_FILES_BACKUP') ){
+ parent::backup_file(replace_path_admin($this->data['filename'][$i]));
+ }
if(!ci_remove($this->fs_filename($i)))
CIP::InProcess("Run time error: ".__('impossible supprimer ce fichier ')."<pre> ".$fs_filename."</pre>", __CLASS__.'->'.__FUNCTION__.'::'.__LINE__,'info');
Modified: trunk/catalog/admin/includes/exts/package/tags/addfilelg.php
===================================================================
--- trunk/catalog/admin/includes/exts/package/tags/addfilelg.php 2014-03-27 10:21:17 UTC (rev 5197)
+++ trunk/catalog/admin/includes/exts/package/tags/addfilelg.php 2014-04-05 14:42:23 UTC (rev 5198)
@@ -159,7 +159,8 @@
If we couldn't backup we should print an error and stop.
If Total_Backup havn't been done we should do it.
*/
- if (_cst_bool('ALLOW_FILES_BACKUP')) parent::backup_file(replace_path_admin($this->data['filename'][$i]));
+ if ( _cst_bool('ALLOW_FILES_BACKUP') )
+ parent::backup_file(replace_path_admin($this->data['filename'][$i]));
if(!ci_remove($this->fs_filename($i)))CIP::InProcess("Run time error: ".__('impossible supprimer ce fichier ')."<pre> ".$fs_filename."</pre>", __CLASS__.'->'.__FUNCTION__.'::'.__LINE__,'info');
}
Modified: trunk/catalog/admin/includes/modules/configuration/modconfigSubMod.php
===================================================================
--- trunk/catalog/admin/includes/modules/configuration/modconfigSubMod.php 2014-03-27 10:21:17 UTC (rev 5197)
+++ trunk/catalog/admin/includes/modules/configuration/modconfigSubMod.php 2014-04-05 14:42:23 UTC (rev 5198)
@@ -189,7 +189,7 @@
@return array list ok object
*/
public function load_db_values($Id){
-
+
self::$module = array();
self::$list = parent::load_db_values(0);
@@ -204,15 +204,19 @@
$class = substr($row,0, -4);
$tmp = modulesUtility::LoadModule(self::$submodtype, $row);
- $dbl[]=$tmp->classe;
- self::$module[]= $tmp;
+ if( !in_array($tmp->classe, $dbl) ){
+ $dbl[]=$tmp->classe;
+ self::$module[]= $tmp;
+ }
}
elseif(is_dir( DIR_FS_ADMIN. DIR_WS_MODULES.$obj_dt->module_directory .$row)){
$class = $row;
$tmp = modulesUtility::LoadModule(self::$submodtype, $row);
- $dbl[]=$tmp->classe;
- self::$module[]= $tmp;
+ if( !in_array($tmp->classe, $dbl) ){
+ $dbl[]=$tmp->classe;
+ self::$module[]= $tmp;
+ }
}
}
@@ -221,19 +225,22 @@
$class = substr($row,0, -4);
$tmp = modulesUtility::LoadModule(self::$submodtype, $row);
- if( !in_array($tmp->classe, $dbl) )
+ if( !in_array($tmp->classe, $dbl) ){
+ $dbl[]=$tmp->classe;
self::$module[]= $tmp;
+ }
}
elseif(is_dir( DIR_FS_CATALOG_MODULES. DIR_WS_MODULES.$obj_dt->module_directory .$row)){
$class = $row;
$tmp = modulesUtility::LoadModule(self::$submodtype, $row);
- $dbl[]=$tmp->classe;
- self::$module[]= $tmp;
+ if( !in_array($tmp->classe, $dbl) ){
+ $dbl[]=$tmp->classe;
+ self::$module[]= $tmp;
+ }
}
}
-
-
+
return self::$list;
}
Modified: trunk/catalog/admin/includes/modules/newsletters/new_products.php
===================================================================
--- trunk/catalog/admin/includes/modules/newsletters/new_products.php 2014-03-27 10:21:17 UTC (rev 5197)
+++ trunk/catalog/admin/includes/modules/newsletters/new_products.php 2014-04-05 14:42:23 UTC (rev 5198)
@@ -148,7 +148,7 @@
}
/// mode normal , send
else
- $mail_query = $DB->query($sql="select s.customers_id as id,customers_gender as gender, s.customers_firstname as firstname, s.customers_lastname as lastname, s.customers_email_address as email , s.customers_email_address , ci.customers_info_date_account_created as created, ci.customers_info_date_of_last_logon, customers_shopping_points as points from " . TABLE_CUSTOMERS . " s ," . TABLE_CUSTOMERS_INFO. " ci where s.customers_newsletter = '1' AND s.customers_id=customers_info_id and NOT EXISTS(SELECT * FROM ".TABLE_NEWSLETTERS_SENT." ns WHERE ns.customers_id=s.customers_id AND ns.newsletters_id='" . $newsletter_id ."' and module_type='".__CLASS__."') LIMIT ".$max);
+ $mail_query = $DB->query($sql="select s.customers_id as id,customers_gender as gender, s.customers_firstname as firstname, s.customers_lastname as lastname, s.customers_email_address as email , s.customers_email_address , ci.customers_info_date_account_created as created, ci.customers_info_date_of_last_logon, customers_shopping_points as points from " . TABLE_CUSTOMERS . " s ," . TABLE_CUSTOMERS_INFO. " ci where customers_status > 0 AND s.customers_newsletter = '1' AND s.customers_id=customers_info_id and NOT EXISTS(SELECT * FROM ".TABLE_NEWSLETTERS_SENT." ns WHERE ns.customers_id=s.customers_id AND ns.newsletters_id='" . $newsletter_id ."' and module_type='".__CLASS__."') LIMIT ".$max);
if($mail_query->__get('numRows')) {
Modified: trunk/catalog/admin/includes/modules/newsletters/newsletter.php
===================================================================
--- trunk/catalog/admin/includes/modules/newsletters/newsletter.php 2014-03-27 10:21:17 UTC (rev 5197)
+++ trunk/catalog/admin/includes/modules/newsletters/newsletter.php 2014-04-05 14:42:23 UTC (rev 5198)
@@ -101,7 +101,7 @@
}
/// mode normal , send
else
- $mail_query = $DB->query($sql="select s.customers_id as id,customers_gender as gender, s.customers_firstname as firstname, s.customers_lastname as lastname, s.customers_email_address as email , s.customers_email_address , ci.customers_info_date_account_created as created, ci.customers_info_date_of_last_logon, customers_shopping_points as points from " . TABLE_CUSTOMERS . " s ," . TABLE_CUSTOMERS_INFO. " ci where s.customers_newsletter = '1' AND s.customers_id=customers_info_id and NOT EXISTS(SELECT * FROM ".TABLE_NEWSLETTERS_SENT." ns WHERE ns.customers_id=s.customers_id AND ns.newsletters_id='" . $newsletter_id ."' and module_type='".__CLASS__."') LIMIT ".$max);
+ $mail_query = $DB->query($sql="select s.customers_id as id,customers_gender as gender, s.customers_firstname as firstname, s.customers_lastname as lastname, s.customers_email_address as email , s.customers_email_address , ci.customers_info_date_account_created as created, ci.customers_info_date_of_last_logon, customers_shopping_points as points from " . TABLE_CUSTOMERS . " s ," . TABLE_CUSTOMERS_INFO. " ci where customers_status > 0 AND s.customers_newsletter = '1' AND s.customers_id=customers_info_id and NOT EXISTS(SELECT * FROM ".TABLE_NEWSLETTERS_SENT." ns WHERE ns.customers_id=s.customers_id AND ns.newsletters_id='" . $newsletter_id ."' and module_type='".__CLASS__."') LIMIT ".$max);
if($mail_query->__get('numRows')) {
while ($mail = $mail_query->fetchAssoc()) {
Modified: trunk/catalog/admin/includes/modules/pages/customers.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/customers.php 2014-03-27 10:21:17 UTC (rev 5197)
+++ trunk/catalog/admin/includes/modules/pages/customers.php 2014-04-05 14:42:23 UTC (rev 5198)
@@ -1,1081 +1,451 @@
<?php if (!defined('HTTP_SERVER')) die('You can not access this file directly!');
/**
- @licence GPL 2005-2014 The osCSS developers - osCSS Open Source E-commerce
+ @licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
+ @portion code Copyright (c) 2002 osCommerce
@package osCSS-2 <www http://www.oscss.org>
- @version 2.2.0
- @date 18/09/13, 09:44
+ @version 2.1.1
+ @date 16/11/11, 23:36
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
- @file customers.php
- @dir admin/includes/modules/pages/
+ @class sqlcustomer
*/
-require_once(DIR_FS_ADMIN . DIR_WS_CLASSES .'ModTreePage.php');
-
-require_once(DIR_FS_ADMIN . DIR_WS_CLASSES .'listeners/EventMessListener.php');
-error_reporting(E_ALL);
+require_once( DIR_FS_ADMIN . DIR_WS_CLASSES . 'drivers/sqllinkto.php');
/**
- @class customers
+ @class sqlcustomer
+ @brief manage db update/insert/delete
*/
-class customers
- extends ModTreePage /// new abstract class for nextgen module
- implements
-
- InterfaceModule
-
- // base module config structure
- ,ExtModConfig
+class sqlcustomer
+ extends SqlFilesDataDriverClass
+ implements ModSqlDataDriver{
- // global GetConf methode
- ,IntModTree
- // datatable and editable by ajax
- ,InterfacedTJsonS
- // detail row in chidls
- ,InterfacedInnerHtml
- // use filter generic
- , FilterTabsData
-
- // Events Interface for display and exec all notification
- , EventMessInterface
- {
+ public static $modules;
- const FILENAME = FILENAME_CUSTOMERS;
+ protected static $_instance;
+ protected function __construct(){
+ self::$modules=new AcaFactory('account'/*,'MODULE_ACACAT_INSTALLED_BO'*/);
+// self::$modules->set_image_handler();
+ }
+
+
+
/**
- @var array $actions
+ @brief create new ligne in table configuration
*/
- public static $actions;
- /**
- @var array $languages
- */
- public static $languages;
- /**
- @var array $newsletter_array
- */
- public static $newsletter_array;
- /**
- @var bool $processed
- */
- public static $processed;
- /**
- @var array $DiversInfo transport var
- */
- public static $DiversInfo;
- /**
- @var obj $box
- */
- public static $box;
- /**
- @var bool $error
- */
- public static $error=false;
+ public static function create($option){
+ new self();
+ if(!isset($option['password']) || !isset($option['email']) )
+ return false;
- public function __construct(){
- self::Clean();
- self::GetConf();
- }
-
- public static function GetConf(){
- global $languages_id, $conf;
-
- self::PreLoad(__CLASS__, 'customer' , $languages_id);
- /**
- @remarks Call and init all class required for display, event, process
- */
$DB=Database::getInstance();
- //
- self::$modules=new AcaFactory('account');
+ $error = 0 ;
-
- /**
- @remarks not load if not first init
- */
- if(!defined('JSONSTATMENT')){
+ $_post = (isset($option['post'])? $option['post'] : array() );
+ $sqlarray = $option['sqlarray'];
- //! active datatable in ajax, precise les GET necessaire
- if(!defined('JSONSTATMENT')) define('JSONSTATMENT', 'ModTwo=true&mod=page&type='.self::$code );
- //! detail item in ajax
- if(!defined('AJAXSTATMENTDETAIL'))define('AJAXSTATMENTDETAIL', 'mod=page&type='.self::$code);
+ $sql_data_array = array();
+ $sql_data_array['customers_firstname'] = $sqlarray['customers_firstname'];
+ $sql_data_array['customers_lastname'] = $sqlarray['customers_lastname'];
+ $sql_data_array['customers_telephone'] = $sqlarray['customers_telephone'];
+ $sql_data_array['customers_fax'] = $sqlarray['customers_fax'];
+ $sql_data_array['customers_newsletter'] = $sqlarray['customers_newsletter'];
+ $sql_data_array['customers_group_ra'] = $sqlarray['customers_group_ra'];
- self::$newsletter_array=array(array('id' => '1', 'text' => __('entry newsletter yes')),
- array('id' => '0', 'text' => __('entry newsletter no'))
- );
+ $sql_data_array['customers_email_address'] = $option['email'];
+ if(isset($option['password']))$sql_data_array['customers_password'] = $option['password'];
- }
+ if (_cst_bool('ACCOUNT_GENDER'))
+ $sql_data_array['customers_gender'] = $sqlarray['customers_gender'];
- /**
- @remarks this define col theader title, and ajust html code
- Just for Edit listing
- */
- self::$allfields = array(
- 'c.customers_id' => array(
- 'sort'=>true,
- 'alias'=>'id',
- 'text'=>__('@customers table heading id'),
- 'width'=>'2%',
- 'class'=>'tcenter',
- 'default'=>true,
- ),
- 'c.customers_type' => array(
- 'sort'=>true,
- 'alias'=>'type',
- 'text'=>__('@customers table heading type'),
- 'class'=>'tcenter',
- 'width'=>'4%',
- 'edit'=>array(
- 'input_name'=>'customers_type',
- 'input_type'=>'select',
- 'class'=>'tleft',
- 'input_size'=>'1',
- 'required_status'=>true,
- 'select_values'=>tep_get_status_array(self::$datatype,0,'status_name'),
- 'position_col'=>'right',
- 'position_grp'=>5
- ),
- ),
- "CONCAT(customers_firstname, ' ', customers_lastname)" => array(
- 'sort'=>true,
- 'alias'=>'master_name',
- 'text'=>__('@customers table heading master_name'),
- 'default'=>true,
- 'width'=>'15%',
- ),
- );
+ if (_cst_bool('ACCOUNT_DOB'))
+ $sql_data_array['customers_dob'] = tep_date_raw($sqlarray['customers_dob']);
- self::$allfields['c.customers_gender'] = array(
- 'sort'=>true,
- 'alias'=>'gender',
- 'text'=>__('@customers table heading gender'),
- 'class'=>'tright',
- 'edit'=>array(
- 'input_name'=>'customers_gender',
-// 'input_type'=>'radio',
- 'input_type'=>'select',
- 'input_size'=>1,
- 'select_values'=>array(
- array('id'=>'m', 'text'=> MALE ),
- array('id'=>'f', 'text'=> FEMALE ),
- array('id'=>'l', 'text'=> MLLE ),
- ),
- 'class'=>'tleft',
- 'position_grp'=>1
- ),
- );
- self::$allfields['c.customers_firstname'] = array(
- 'sort'=>true,
- 'alias'=>'firstname',
- 'text'=>__('@customers table heading firstname'),
-// 'class'=>'tcenter',
- 'edit'=>array(
- 'input_name'=>'customers_firstname',
- 'position_grp'=>1
- ),
- );
- self::$allfields['c.customers_lastname'] = array(
- 'sort'=>true,
- 'alias'=>'lastname',
- 'text'=>__('@customers table heading lastname'),
-// 'class'=>'tcenter',
- 'edit'=>array(
- 'input_name'=>'customers_lastname',
- 'position_grp'=>1
- ),
- );
- if (_cst_bool('ACCOUNT_DOB'))
- self::$allfields['c.customers_dob'] = array(
- 'sort'=>true,
- 'alias'=>'dob',
- 'text'=>__('@customers table heading dob'),
- 'class'=>'tcenter',
- 'edit'=>array(
- 'input_name'=>'customers_dob',
- ),
- );
- self::$allfields['c.customers_email_address'] = array(
- 'sort'=>true,
- 'alias'=>'email_address',
- 'text'=>__('@customers table heading email address'),
- 'edit'=>array(
- 'input_name'=>'customers_email_address',
- 'required_status'=>true,
- 'position_grp'=>1
- ),
- );
- self::$allfields['c.customers_telephone'] = array(
- 'sort'=>true,
- 'alias'=>'telephone',
- 'text'=>__('@customers table heading telephone'),
- 'edit'=>array(
- 'input_name'=>'customers_telephone',
- 'required_status'=>true,
- ),
- );
- self::$allfields['c.customers_fax'] = array(
- 'sort'=>true,
- 'alias'=>'fax',
- 'text'=>__('@customers table heading fax'),
- 'edit'=>array(
- 'input_name'=>'customers_fax',
- ),
- );
- self::$allfields['l.name'] = array(
- 'sort'=>true,
- 'alias'=>'language',
- 'text'=>__('@customers table heading language'),
- 'class'=>'tcenter',
-// 'edit'=>array(
-// 'input_name'=>'customers_telephone',
-// 'required_status'=>true,
-// ),
- );
+ self::$modules->load_post_values($_post);
- self::$allfields['c.customers_group_id'] = array(
- 'sort'=>true,
- 'alias'=>'group_id',
- 'text'=>__('@customers table heading group id'),
- 'class'=>'tcenter',
- );
-// self::$allfields['cg.customers_group_name'] = array(
-// 'sort'=>true,
-// 'alias'=>'cat_title',
-// 'text'=>__('@customers table heading group name'),
-// 'default'=>true,
-// );
+ $DB->beginTransaction();
- self::$allfields['c.customers_discount'] = array(
- 'sort'=>true,
- 'alias'=>'discount',
- 'text'=>__('@customers table heading discount'),
- 'class'=>'tright',
- 'edit'=>array(
- 'input_name'=>'customers_discount',
- 'input_size'=>'5',
- 'position_col'=>'right',
- 'position_grp'=>5
- ),
- );
- self::$allfields['c.customers_balance_account'] = array(
- 'sort'=>true,
- 'alias'=>'balance_account',
- 'text'=>__('@customers table heading balance account'),
- 'class'=>'tright',
- 'edit'=>array(
- 'input_name'=>'customers_balance_account',
- 'input_size'=>'5',
- 'reedit'=>false,
- 'position_col'=>'right',
- 'position_grp'=>5
- ),
- );
- self::$allfields['c.customers_shopping_points'] = array(
- 'sort'=>true,
- 'alias'=>'shopping_points',
- 'text'=>__('@customers table heading shopping points'),
- 'class'=>'tright',
- 'edit'=>array(
- 'input_name'=>'customers_shopping_points',
- 'input_size'=>'5',
- 'position_col'=>'right',
- 'position_grp'=>6
- ),
- );
+ $sql_data_array = array_merge($sql_data_array, self::$modules->insert_table_prim() );
- self::$allfields['c.customers_newsletter'] = array(
- 'sort'=>true,
- 'alias'=>'newsletter',
- 'text'=>__('@customers table heading newsletter'),
- 'class'=>'tright',
- 'edit'=>array(
- 'input_name'=>'customers_newsletter',
- 'input_type'=>'radio',
- 'values_list'=>array(
- array('id'=>0, 'text'=> __('@customers newsletter no') ),
- array('id'=>1, 'text'=>__('@customers newsletter yes') ),
- ),
- ),
- );
- self::$allfields['ci.global_product_notifications'] = array(
- 'sort'=>true,
- 'alias'=>'global_product_notifications',
- 'text'=>__('@customers table heading global product notifications'),
- 'class'=>'tright',
- 'edit'=>array(
- 'input_name'=>'global_product_notifications',
- 'input_type'=>'radio',
- 'values_list'=>array(
- array('id'=>0, 'text'=> __('@customers product notifications no') ),
- array('id'=>1, 'text'=>__('@customers product notifications yes') ),
- ),
- ),
- );
+ $_return= $sql_data_array;
- self::$allfields['ci.customers_info_date_account_created'] = array(
- 'sort'=>true,
- 'alias'=>'date_account_created',
- 'text'=>__('@customers table heading date added'),
- 'width'=>'8%',
- 'class'=>'tcenter',
- 'edit'=>array(
- 'input_type'=>'date@advanced',
- 'input_name'=>'date_account_created',
- 'input_size'=>'10',
- 'reedit'=>false,
- 'position_col'=>'right',
- 'position_grp'=>10
- ),
- );
- self::$allfields['ci.customers_info_date_account_last_modified'] = array(
- 'sort'=>true,
- 'alias'=>'date_account_last_modified',
- 'text'=>__('@customers table heading last modified'),
- 'width'=>'8%',
- 'class'=>'tcenter',
- 'edit'=>array(
- 'input_type'=>'date@advanced',
- 'input_name'=>'date_account_last_modified',
- 'input_size'=>'10',
- 'reedit'=>false,
- 'position_col'=>'right',
- 'position_grp'=>10
- ),
- );
- self::$allfields['ci.customers_info_date_of_last_logon'] = array(
- 'sort'=>true,
- 'alias'=>'date_last_logon',
- 'text'=>__('@customers table heading last logon'),
- 'class'=>'tright',
- 'default'=>true,
- 'edit'=>array(
- 'input_type'=>'date@advanced',
- 'input_name'=>'date_last_logon',
- 'input_size'=>'10',
- 'reedit'=>false,
- 'position_col'=>'right',
- 'position_grp'=>10
- ),
- );
- self::$allfields['ci.customers_info_number_of_logons'] = array(
- 'sort'=>true,
- 'alias'=>'number_of_logons',
- 'text'=>__('@customers table heading number of logons'),
- 'default'=>true,
- 'class'=>'tcenter',
- 'edit'=>array(
- 'input_name'=>'customers_info_number_of_logons',
- 'input_size'=>'5',
- 'reedit'=>false,
- 'position_col'=>'right',
- 'position_grp'=>9
- ),
- );
+ $resobj=tep_db_perform(TABLE_CUSTOMERS, $sql_data_array);
+ if(!$resobj)
+ $error++;
- self::$allfields['c.customers_group_ra'] = array(
- 'sort'=>true,
- 'alias'=>'group_ra',
- 'text'=>__('@customers table heading group ra'),
- 'width'=>'5%',
- 'default'=>true,
- 'class'=>'tcenter',
- 'edit'=>array(
- 'input_type'=>'radio',
- 'input_size'=>'1',
- 'input_name'=>'customers_group_ra',
- 'values_list'=>array(
- array('id'=>0, 'text'=>__('@customers text group off') ),
- array('id'=>1, 'text'=>__('@customers text group yes') ),
- ),
- 'position_col'=>'right',
- 'position_grp'=>2
- ),
- );
- self::$allfields['c.customers_status'] = array(
- 'sort'=>true,
- 'alias'=>'status',
- 'text'=>__('@customers table heading status'),
- 'width'=>'5%',
- 'default'=>true,
- 'class'=>'tcenter',
- 'edit'=>array(
- 'input_type'=>'radio',
- 'input_size'=>'1',
- 'input_name'=>'customers_status',
- 'values_list'=>array(
- array('id'=>0, 'text'=>__('@customers text status off') ),
- array('id'=>1, 'text'=>__('@customers text status on') ),
- ),
- 'position_col'=>'right',
- 'position_grp'=>3
- ),
- );
+ $lastid=$resobj->__get('insertId');
+ $sql_data_array = array(
+ 'customers_info_id' => $lastid,
+ 'customers_info_date_account_created' => 'now()',
+ 'global_product_notifications' => $sqlarray['global_product_notifications']
+ );
- /// @remarks min fields and not view directly colonne fields
- $listfield = " c.customers_id as id, c.customers_email_address as email_address, ";
+ if($lastid > 0)
+ if( ! tep_db_perform(TABLE_CUSTOMERS_INFO, $sql_data_array) )
+ $error++;
- /// @remarks Active forms filter
- $mutli=array();
- /**
- @remarks Active forms filter
- @note
- array[
- // For normalised filter define on method ConvertInitVar
- generic =>
- array (
- 'string'
- // , ....
- );
- mod =>
- array(
- 'title'=>__('@products filter tab manufacturer'),
- 'content'=>tep_get_include_contents('manufacturers/filter.manufacturer'),
- )
- ]
- */
- $tab = MLinkTo::GetFilters(self::$datatype );
+ self::$modules->load_post_values(array_merge(array('customers_id'=>$lastid),$_post) );
- /**
- @remarks this define menu master module in page
- @note use $boutons[action][] = array(params)
+ self::$modules->insert_table_second();
- params :
- 'type'=>'getLink',
- 'format'=>'button_nav',
- 'image'=>'',
- 'cssclass'=>'button',
- 'title'=>__('image create new content'),
- 'url'=>tep_href_link(self::FILENAME, 'action=new'),
- */
- $boutons = array();
- $boutons['listing'][]=array(
- 'type'=>'getLink',
- 'format'=>'button_nav',
- 'image'=>'',
- 'cssclass'=>'button',
- 'title'=>__('@customers image create new customer'),
- 'url'=>tep_href_link(self::FILENAME, 'action=new'),
- );
- $boutons['listing'][]=array(
- 'type'=>'getLink',
- 'format'=>'button_nav',
- 'image'=>'',
- 'cssclass'=>'button linkrss',
- 'title'=>tep_image(DIR_WS_ICONS.'icon_feed.png' , IMAGE_TRACKED_LOW_STOCK,16,16) .__('@customers link rss new customer'),
- 'url'=>tep_href_link(FILENAME_FEEDS,'box=new_customers'),
- );
+// $sql_data_array = array_merge($sql_data_array, self::$modules->insert_table_second() );
+// $_return=array_merge($_return,$sql_data_array,array('customers_id'=>$lastid));
- /**
- Call Base Init and construct $InitInfo for process Filter
- $listfield string list row in db
- $mutli array action multiple
- $filter array put list off activate tab filter
- $boutons array
- */
- self::ConvertInitVar( $listfield, $mutli, $tab, $boutons);
+// return $lastid;
-
+ if( $error > 0){
+ $DB->rollbackTransaction();
+ return false;
+ }
+ else{
+ $DB->commitTransaction();
+ return $lastid;
+ }
}
-
-
-
/**
- * \fn check_action($actionss)
- * \brief execut action
- * @param $actionss string
- */
- public function check_action($actions){
- global $languages_id, $messageStack, $language;
+ @brief update ligne in table configuration
+ */
+ public static function update($option){
+ new self();
- $DB=Database::getInstance();
- $_return=array();
+ if(!isset($option['id']) || isset($option['email']))
+ return false;
+ $DB=Database::getInstance();
+ $error = 0 ;
- if(!empty($actions))
- self::$action=$actions;
+ $where ='';
+ if(isset($option['id'])) $where .="AND customers_id = '".(int)$option['id']."' ";
+ if(isset($option['email'])) $where .="AND customers_email_address = '".(int)$option['email']."' ";
-
- switch (self::$action) {
-
- /**
- @remarks specific Ajax call
- */
- case 'update_cell':
- try {
- if($_REQUEST['columnName'] == 'customers_email_address'){
- if( ! sqlcustomer::userTestNotExists($_REQUEST['value']) )
- throw new Exception(__('email address is already used') ) ;
- }
- parent::GenericAction();
- }
- catch (Exception $e) {
- self::PutMessage(
- new EventMessListener(__($e->getMessage(), __CLASS__) , 'error')
- );
- }
- break;
-
- /**
- @remarks specific ajax action
- */
+ $_post = $option['post'];
+ $sqlarray = $option['sqlarray'];
- case 'setflag':
- if ( ($_GET['flag'] == '0') || ($_GET['flag'] == '1') ) {
- $newsletter_id = tep_db_prepare_input($_GET['cID']);
- if (!empty($newsletter_id))
- $DB->query("update " . TABLE_CUSTOMERS . " set customers_status = '" .(int) $_GET['flag'] . "' where customers_id = '" . (int)$newsletter_id . "'");
- }
+ $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']) && !empty($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(isset($sqlarray['customers_discount']))$sql_data_array['customers_discount'] = $sqlarray['customers_discount'];
+ if(isset($sqlarray['customers_balance_account']))$sql_data_array['customers_balance_account'] = $sqlarray['customers_balance_account'];
- $messageStack->add(__('@customers update status customers'), 'success');
+ if (_cst_bool('ACCOUNT_GENDER'))
+ $sql_data_array['customers_gender'] = $sqlarray['customers_gender'];
- if(!isset($_GET['forceajax']))
- tep_redirect(tep_href_link(self::FILENAME, 'cID=' . $_GET['cID']));
+ if (_cst_bool('ACCOUNT_DOB'))
+ $sql_data_array['customers_dob'] = tep_date_raw($sqlarray['customers_dob']);
- break;
- case 'setflagda':
- if ( ($_GET['flag'] == '0') || ($_GET['flag'] == '1') ) {
- $newsletter_id = tep_db_prepare_input($_GET['cID']);
+ self::$modules->load_post_values($_post);
- if (!empty($newsletter_id))
- $DB->query("update " . TABLE_CUSTOMERS . " set customers_group_ra = '" .(int) $_GET['flag'] . "' where customers_id = '" . (int)$newsletter_id . "'");
- }
+ $DB->beginTransaction();
- $messageStack->add(__('@customers update confirm status customers'), 'success');
+ $sql_data_array = array_merge($sql_data_array, self::$modules->update_table_prim());
- if(!isset($_GET['forceajax']))
- tep_redirect(tep_href_link(self::FILENAME, 'cID=' . $_GET['cID']));
+ $_return= $sql_data_array;
- break;
+ if( ! tep_db_perform(TABLE_CUSTOMERS, $sql_data_array, 'update' , substr($where,3)) )
+ $error++;
- case 'vcard':
+ $sql_data_array = array(
+ 'global_product_notifications' => $sqlarray['global_product_notifications']
+ );
- $result=sqlcustomer::fetch(array('id'=> tep_db_prepare_input(self::$Id) ), true );
-
- if(!$result || !is_object($result))
- return false;
- $vt="HOME";
+ if($error ==0)
+ if( !tep_db_perform(TABLE_CUSTOMERS_INFO, $sql_data_array, 'update' , " customers_info_id = '".(int)$option['id']."' " ) )
+ $error++;
- if($result->gender)
- $gender='Mr' ;
- else
- $gender='Ms' ;
- $vcard_content = "BEGIN:VCARD\r\n";
+ self::$modules->load_post_values($_post);
+ $sql_data_array = array_merge($sql_data_array, self::$modules->update_table_second());
- $vcard_content .= "N:".$result->lastname.";".$result->firstname.";;;\r\n";
- $vcard_content .= "FN:".$result->firstname.".".$result->lastname."\r\n";
- $vcard_content .= "EMAIL:".$result->email_address."\r\n";
- $vcard_content .= "TEL;type=".$vt.";type=pref:".$result->telephone."\r\n";
- $vcard_content .= "TEL;type=".$vt.";type=FAX:".$result->fax."\r\n";
- $vcard_content .= "VERSION:3.0\r\n";
- $vcard_content .= "END:VCARD\r\n\r\n";
- if(!isset($_GET['forceajax'])){
- header('Content-Disposition: inline; filename="'.$result->lastname.'.'.$result->firstname.'.vcf"');
- header('Content-Type: application/x-vcard; charset=utf-8');
- echo $vcard_content;
- exit;
- }
- else {
- return $vcard_content;
- }
-
- break;
+ self::$modules->after_update((int)$option['id']);
- /**
- @remarks specific multi action
- */
- case 'multi':
- tep_redirect(tep_href_link(self::FILENAME) );
- break;
+ if( $error > 0){
+ $DB->rollbackTransaction();
+ return false;
+ }
+ else{
+ $DB->commitTransaction();
+ return 1;
+ }
+ }
- /**
- @remarks normal page
- */
- case 'insert':
- if(!tep_action_check('edit', self::FILENAME))
- tep_redirect(tep_href_link(self::FILENAME));
- global $languages_id;
+ /**
+ @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
- $_id=sqlcustomer::create(array('password'=>'', 'email'=>'', 'language_id'=>$languages_id) );
+ object(stdClass)[13]
+ public 'id' => string '1' (length=1)
- tep_redirect(tep_href_link(self::FILENAME, tep_get_all_get_params(array('action','cPath','cID'),false).'cID=' . $_id.'&action=edit'));
- break;
- case 'update':
- $array = array();
- $array['post'] = $_POST;
- $array['sqlarray'] = array();
+ OR
+ array(
+ object(stdClass)[13]
+ ...
+ object(stdClass)[13]
+ ..
+ )
- global $languages_id,$messageStack;
+ */
+ public static function fetch($option,$shortkey=false){
+ new self();
+ $DB=Database::getInstance();
- foreach(sqlcustomer::Specimen(array(),false) as $key=>$row){
- if(in_array($key, array('customers_group_id','customers_newsletter','global_product_notifications','customers_shopping_points')))
- $array['sqlarray'][$key]=(isset($_POST[$key])) ? (int)tep_db_prepare_input($_POST[$key]) : 0;
- else
- $array['sqlarray'][$key]=(isset($_POST[$key])) ? tep_db_prepare_input($_POST[$key]) : '';
- }
+ $sql ="";
+ if(isset($option['id'])) $sql .="AND c.customers_id = '".(int)tep_db_input($option['id'])."' ";
+ if(isset($option['address_book_id'])) $sql .="AND a.address_book_id = '".(int)tep_db_input($option['address_book_id'])."' ";
+ if(isset($option['group_id'])) $sql .="AND c.customers_group_id = '".(int)tep_db_input($option['group_id'])."' ";
+ if(isset($option['lg_id'])) $sql .="AND c.customers_language = '".(int)tep_db_input($option['lg_id'])."' ";
+ if(isset($option['email'])) $sql .="AND c.customers_email_address = '".(string)tep_db_input($option['email'])."' ";
+ if(strlen($sql) < 1 )
+ return false;
- if(!is_array($array['sqlarray']) || count($array['sqlarray']) < 1)
- return false;
+ // base customers
+ $sql = "SELECT
+ c.customers_id,
+ c.customers_lastname,
+ c.customers_gender,
+ c.customers_dob,
+ c.customers_newsletter,
+ c.customers_firstname,
+ c.customers_default_address_id,
+ c.customers_email_address,
+ c.customers_group_ra,
+ c.customers_telephone,
+ c.customers_fax,
+ a.entry_country_id,
+ c.customers_group_id,
+ c.customers_language ,
+ cg.customers_group_name,
+ c.customers_shopping_points,
+ c.customers_balance_account,
+ c.customers_discount,
+ customers_info_date_account_created as date_account_created,
+ customers_info_date_account_last_modified as date_account_last_modified,
+ customers_info_date_of_last_logon as date_last_logon,
+ customers_info_number_of_logons as number_of_logons ,
+ global_product_notifications ,
+ COUNT(o.customers_id) as orders,
+ z.zone_name,
+ co.countries_id,
+ co.countries_name,
+ co.countries_iso_code_2,
+ co.countries_iso_code_3,
+ co.address_format_id ".
+ " FROM " . TABLE_CUSTOMERS . " c ".
+ " LEFT JOIN " . TABLE_CUSTOMERS_INFO . " ON( customers_info_id = c.customers_id ) ".
+ " LEFT JOIN " . TABLE_ADDRESS_BOOK . " a ON ( c.customers_id = a.customers_id and c.customers_default_address_id = a.address_book_id ) ".
+ " LEFT JOIN " . TABLE_ZONES . " z ON (a.entry_zone_id = z.zone_id) ".
+ " LEFT JOIN " . TABLE_COUNTRIES . " co ON (a.entry_country_id = co.countries_id) ".
+ " LEFT JOIN " . TABLE_CUSTOMERS_GROUPS . " cg ON ( c.customers_group_id = cg.customers_group_id ) ".
+ " LEFT JOIN " . TABLE_ORDERS . " o ON( o.customers_id = c.customers_id ) ".
+ " WHERE ".substr($sql,3).
+ " GROUP BY o.customers_id ";
- $testobj = new objectInfo($array['sqlarray']);
-// var_dump();
- try{
- /*
- * \brief test user is exists email address in db
- */
- if ( strlen($testobj->customers_email_address) < 3)
- throw new Exception(__('entry email address error please add email'));
+ $res=$DB->query($sql);
- if ( self::$action =='insert' && sqlcustomer::fetch(array('email'=>$testobj->customers_email_address) ) != false )
- throw new Exception(__('entry email address error exists'));
+ $num = $res->__get('numRows');
- if (strlen($testobj->customers_firstname) < ENTRY_FIRST_NAME_MIN_LENGTH)
- throw new Exception(__("Le nombre de caractéres ne suffit pour le nom, min:").ENTRY_FIRST_NAME_MIN_LENGTH);
- if (strlen($testobj->customers_lastname) < ENTRY_LAST_NAME_MIN_LENGTH)
- throw new Exception(__("Le nombre de caractéres ne suffit pour le nom, min:").ENTRY_LAST_NAME_MIN_LENGTH);
- if (_cst_bool('ACCOUNT_DOB'))
- if (!checkdate(substr(tep_date_raw($testobj->customers_dob), 5, 2), substr(tep_date_raw($testobj->customers_dob), 8, 2), substr(tep_date_raw($testobj->customers_dob), 0, 4)))
- throw new Exception(__("Le format de la date de naissance n'est pas correct"));
+ if($num == 1){
+ $result=$res->fetchAssoc();
- if (strlen($testobj->customers_email_address) < ENTRY_EMAIL_ADDRESS_MIN_LENGTH)
- throw new Exception(__("L'adresse email est trop courte, min:").ENTRY_EMAIL_ADDRESS_MIN_LENGTH);
- if (!emailUtility::tep_validate_email($testobj->customers_email_address))
- throw new Exception(ENTRY_EMAIL_ADDRESS_CHECK_ERROR);
-
- if(self::$Id > 0 && ! sqlcustomer::userTestNotExists($testobj->customers_email_address) )
- throw new Exception(__('email address is already used') ) ;
+ $result['mod'] = self::$modules->fetch(array('customers_id'=>$result['customers_id'], 'shortkey'=>$shortkey));
- if (strlen($testobj->customers_telephone) < ENTRY_TELEPHONE_MIN_LENGTH)throw new Exception(__("Le numero de téléphone est trop court"));
+ // put all val origin module in current result
+ foreach($result['mod'] as $submod=>$array)
+ if(is_array($array))
+ foreach($array as $key=>$val)
+ $result[$key] = $val;
+ return ((!$shortkey)? $result : self::CleanKey($result));
+ }
+ elseif($num > 1){
+ $array=array();
- }catch(Exception $e){
- $messageStack->add_session($e->getMessage(), 'error');
+ foreach($res->fetchAllAssoc() as $result){
+ $result['mod'] = self::$modules->fetch(array('customers_id'=>$result['customers_id'], 'shortkey'=>$shortkey));
- if(self::$Id > 0 )
- tep_redirect(tep_href_link(self::FILENAME, 'cID=' .self::$Id.'&action=edit'));
- else
- tep_redirect(tep_href_link(self::FILENAME));
- }
+ $array[]= ((!$shortkey)? $result : self::CleanKey($result));
+ }
-
- if(self::$Id <= 0 ){
- $array['password']=$mdp=sqlcustomer::randomize();
- $array['email']=$array['sqlarray']['customers_email_address'];
- $_id=sqlcustomer::create($array);
- $result=sqlcustomer::fetch(array('id'=>$_id), false );
- }
- else{
- $array['id']=$_id=tep_db_prepare_input(self::$Id);
- $result=sqlcustomer::update($array, false);
-
- $result=sqlcustomer::fetch(array('id'=>$_id), false );
- }
-
- if( is_array($result) ){
-
- /**
- @remarks Notify customer by email
-
- TODO: Deport le template email dans dossier documents
- */
- if(isset($_POST['new_customers_notif'])) {
-
- $myarray = array(
- 'email_use_html'=>_cst_bool('EMAIL_USE_HTML'),
- 'links'=>HTTP_SERVER ,
- 'firstname'=>$result['customers_firstname'],
- 'lastname'=>$result['customers_lastname'],
- 'email'=>$result['customers_email_address'],
- 'password'=>$mdp,
- 'message'=>''
- );
- $message_final=tep_post_prepare_email('add_customer.tpl',$language,$myarray);
-
-
- if( ! tep_mail($result['customers_firstname'] . ' ' . $result['customers_lastname'], $result['customers_email_address'],__('creat new compte for customers'), $message_final) )
- $messageStack->add_session(sprintf(__('error in process send mail for %s'), $result['customers_firstname'] .' '. $result['customers_email_address'] ), 'error');
- else
- $messageStack->add_session(sprintf(__('send mail for %s ok'), $result['customers_firstname'] .' '. $result['customers_email_address']), 'success');
-
- }
-
-
- $myarray['from']=STORE_OWNER;
- $myarray['email_use_html']=_cst_bool('EMAIL_USE_HTML');
- $myarray['message']=$message_final;
-
- if( ! notification::notifInMess('admin_new_customers',__('subject copy creat new compte for customers') ,$message_final, 'customers_id='.$_id) ){
- $messageStack->add_session(sprintf(__('error in process notification for %s'), STORE_OWNER .' '. STORE_OWNER_EMAIL_ADDRESS ), 'error');
- }
-
- $messageStack->add(__('customers save success'), 'success');
-
- if(isset($_POST['up_and_close']) )
- tep_redirect(tep_href_link(self::FILENAME));
- else
- tep_redirect(tep_href_link(self::FILENAME, 'cID=' .$_id.'&action=edit'));
- }
- else /*if (self::$error == true) */{
- $_POST['customers_gender']='m';
- $Info = new objectInfo($_POST);
- if(self::$action =='insert')
- $dest_form='insert';
- else
- $dest_form='update';
-
- $messageStack->add(__('error save in process'), 'error');
- }
-
- break;
- /**
- @remarks Test key , by ajax
- */
- case 'isValidRef':
-
- $ref = tep_db_prepare_input(trim($_REQUEST['stringref']));
-
- if (strlen($ref) < ENTRY_EMAIL_ADDRESS_MIN_LENGTH){
- self::$Info['isValidRef'] = false;
-
- self::PutMessage(
- new EventMessListener(__('email is too short', __CLASS__) )
- );
-
- if(!isset($_GET['forceajax']))
- tep_redirect(tep_href_link(self::FILENAME, tep_get_all_get_params(array('action','cID'), false).'action=edit' ));
- }
-// throw new Exception(__("L'adresse email est trop courte, min:").ENTRY_EMAIL_ADDRESS_MIN_LENGTH);
-
- elseif (!emailUtility::tep_validate_email($ref)){
- self::$Info['isValidRef'] = false;
-
- self::PutMessage(
- new EventMessListener(__('email is valid', __CLASS__) )
- );
-
- if(!isset($_GET['forceajax']))
- tep_redirect(tep_href_link(self::FILENAME, tep_get_all_get_params(array('action','cID'), false).'action=edit' ));
- }
-// throw new Exception(ENTRY_EMAIL_ADDRESS_CHECK_ERROR);
-
- elseif( sqlcustomer::userTestNotExists($ref) === true){
- self::$Info['isValidRef'] = true;
-
- self::PutMessage(
- new EventMessListener(__('email is valid', __CLASS__) , 'success')
- );
-
- if(!isset($_GET['forceajax']))
- tep_redirect(tep_href_link(self::FILENAME, tep_get_all_get_params(array('action','cID'), false).'action=edit' ));
- }
- else{
- self::$Info['isValidRef'] = false;
-
- self::PutMessage(
- new EventMessListener(__('email is already used', __CLASS__) )
- );
-
-
- if(!isset($_GET['forceajax']))
- tep_redirect(tep_href_link(self::FILENAME));
- }
- break;
- default:
- parent::GenericAction();
+ return $array;
}
- return self::$action;
+ return false;
}
-
- /**
- @fn get_header()
- @brief load js and call childs module
- @return no return
- */
- public function get_header(){
- tep_include_file(DIR_WS_JS . "modules/pages/".__CLASS__.".js.php",true);
-
- /** aca */ self::$modules->get_header(self::$action);
-
- /** aca */ self::$modules->get_header_js(self::$action);
- }
-
-
/**
- @fn featured::GetDBValue();
- @brief return DB value adapted for current action
- Use self::action for determine switch
- @return
+ @brief delete row
*/
- public static function GetDBValue(){
-
+ public static function delete($option){
+ new self();
$DB=Database::getInstance();
+ if(isset($option['id']))
+ $_id = (int)tep_db_input($option['id']) ;
+ else
+ return false;
- $action=self::$action;
-// var_dump(self::$Id);
- switch ($action) {
- case 'detail':
- case 'delete':
- case 'view':
- case 'noedit':
- case 'edit':
- case 'new':
- if(self::$Id > 0)
- $arry=sqlcustomer::fetch(array('id'=>(int)self::$Id),true);
- else
- $arry=sqlcustomer::Specimen(true);
+ $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 . "'");
- $res=self::FormatDBValue($arry);
+ self::$modules->deleteconfirm_account($_id);
+// self::$modules->delete($_id);
- return $res;
- break;
- case 'listing':
- default:
+ $DB->query("delete from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$_id . "'");
- /**
- @remarks retrun object load one inventaire
- */
- global $query_numrows, $languages_id;
- $adjust=new objectInfo(self::$InitInfo['adjust']);
-
-
- /**
- @remarks replace id by name col
- */
- if(!empty($adjust->sWhere)) {
-
- foreach(self::$allfields as $key=>$row){
- if(is_array($row) && isset($row['alias']) ){
- $k[] = '#[(]'.$row['alias'].'[)]#i';
- $k[] = '# '.$row['alias'].' #i';
- $k[] = '# \.'.$row['alias'].'#i';
-
- $v[] = '('.$key.')';
- $v[] = ' '.$key.' ';
- $v[] = '.'.$key.' ';
- }
- }
-
- if(isset($k))
- $adjust->sWhere = preg_replace($k,$v, $adjust->sWhere);
- }
-
-
- $query_raw = "select ".$adjust->listfields.", c.customers_id as id from " . TABLE_CUSTOMERS . " c ".
- " JOIN " . TABLE_CUSTOMERS_INFO . " ci ON(c.customers_id =ci.customers_info_id ) ".
- " LEFT JOIN " . TABLE_LANGUAGES . " l ON(c.customers_language =l.languages_id ) ";
-// " LEFT JOIN " . TABLE_CUSTOMERS_GROUPS . " cg ON(c.customers_group_id = cg.customers_group_id) ";
-
- /* DEB Sub module add table */
- $r = self::$modules->__call('GetConf', array('languages_id'=>(int)$adjust->languages_id, 'type'=>'tables')) ;
- foreach($r as $mod=>$value){
- foreach($value as $key=>$string){
- $query_raw .= $string;
- }
- }
- /* END Sub module add col */
-
- $query_raw .= ((strlen($adjust->sWhere)>4) ? " WHERE ".substr($adjust->sWhere, 3) : '').
- " GROUP BY c.customers_id ";
-
- /* DEB Sub module add table */
- $r = self::$modules->__call('GetConf', array('languages_id'=>(int)$adjust->languages_id, 'type'=>'group_by')) ;
- foreach($r as $mod=>$value){
- foreach($value as $key=>$string){
- $query_raw .= $string;
- }
- }
- /* END Sub module add col */
-
- $query_raw .= " ORDER BY ".((!empty($adjust->sOrder)) ? $adjust->sOrder : ' ci.customers_info_date_account_created DESC ');
-
- $_query = $DB->query($query_raw);
- $query_numrows = $_query->__get('numRows');
- $_split = new splitPageResults($adjust->page, $adjust->rowbyp, $query_raw, $query_numrows);
- $_query = $DB->query($query_raw);
-
- $res=self::FormatDBValue($_query);
-
- return $res;
-
- }
-
-
+ return true;
}
-
-
/**
+ @brief
+ @return array product empty
*/
- public function display_view() {
- $action=self::$action;
- $MG= true;
+ public static function Specimen($shortkey=false){
+ new self();
+
+ $par = array(
+ 'customers_id' => 0,
- switch($action){
- /**
- @remarks Ajax View result
- */
- case 'setflagda':
- return self::GenericRowsFlag(self::$Id, 'group_ra', 'setflagda');/// RowStatusDa(array('group_ra'=>(int)$_GET['flag'], 'id'=>(int)self::$Id));
- break;
- /**
- @remarks Ajax View result
- */
- case 'isValidRef':
- $stringref = tep_db_prepare_input($_REQUEST['stringref']) ;
+ 'customers_type' => 1,
+
+ 'customers_gender' => 'm',
+ 'customers_firstname' => '',
+ 'customers_lastname' => '',
+ 'customers_email_address' => '',
+ 'customers_telephone' => '',
+ 'customers_fax' => '',
+ 'customers_language' => '',
+ 'entry_country_id' => '',
- if( ! (bool)self::$list['isValidRef'])
- $print = tep_draw_input_field('customers_email_address', '', (string)$stringref , '');
- else
- $print = $stringref. tep_draw_hidden_field('customers_email_address', '', (string)$stringref, ' ');
+ 'customers_group_id' => '',
+ 'customers_group_name' => '',
- return $print;
- break;
-
- /**
- @remarks Normal View Page
- */
- case 'new':
- $action='edit';
- default:
- $action = parent::GenericDisplay($action);
- }
-
-
- if( ! empty($action) )
- return MGabCont::CallGab($action,__FUNCTION__, ( ($MG) ? self::MASTER : __CLASS__ ) );
- }
+ 'customers_discount' => '',
+ 'customers_shopping_points' => '',
+ 'customers_balance_account' => 0,
+ 'customers_default_address_id' => '',
+ 'customers_group_ra' => '',
+ 'date_account_created' => '',
+ 'date_account_last_modified' => '',
+ 'date_last_logon' => '',
+ 'number_of_logons' => '',
- public static function detail_row_page($id){
- // force rattribution id
- $_REQUEST['cID'] = (int)$id;
- self::GetConf();
- self::load_db_values((int)$id);
+ 'customers_newsletter' => '',
+ 'global_product_notifications' => '',
- $res=tep_db_query($customers_query_raw = "select sum(op.products_quantity * op.final_price) as ordersum from " . TABLE_CUSTOMERS . " c, " . TABLE_ORDERS_PRODUCTS . " op, " . TABLE_ORDERS . " o where c.customers_id = o.customers_id and c.customers_id='".(int)$id."' and o.orders_id = op.orders_id group by c.customers_firstname, c.customers_lastname order by ordersum DESC");
- $r=tep_db_fetch_array($res);
- self::$Info->orders_sum=$r['ordersum'];
- return MGabCont::CallGab('inline','display_view',__CLASS__);
- }
+ 'orders' => '',
+ );
+ if (_cst_bool('ACCOUNT_DOB'))
+ $par['customers_dob']='';
-
- /**
- @fn ButtonRowsActions($orders)
- @brief fonction qui construit l'affichage de la colonne action
- La mise en forme est contenu dans les ressource xml du template en cours
- @param $orders array
- @return string
- */
- public static function ButtonRowsActions($item){
- global $SecuKey;
-
- $action_str_left =sprintf(CsrtAction::getLink('row_action_right', __('incarner'), 'incarner'), '', tep_catalog_href_link('login.php','osCAdminDirect='.md5($SecuKey.date('d')).'&id='.$item['id'],'SSL', false ) ,'');
-
- $action_str_left .=sprintf(CsrtAction::getLink('row_action_right', __('@customers button vcard'), 'vcard'), '', tep_href_link(self::FILENAME,'cID=' . $item['id'].'&action=vcard' ) ,'');
-
- $action_str = self::$modules->display_ColumnRowAction($item['id']);
- $action_str .=sprintf(CsrtAction::getLink('row_action_right', __('@customers button email'), 'email'), '', tep_mailto($item['email_address'],self::FILENAME) ,'');
-
- return parent::GenericRowsActions($item, 'ned', $action_str_left, $action_str);
+ return ((!$shortkey)? $par : self::CleanKey($par));
}
+ /**
+ @fn ExtractForm($data)
+ @brief extract data forms for put in db
+ @param $data array
+ @return array
+ */
+ public static function ExtractForm($data){
+ new self();
+
+ return parent::ExtractDataForm(self::Specimen(), $data);
+ }
-
+
/**
- @param string $value
+ @fn randomize()
+ @brief Generate password
*/
- public static function tep_view_gender_human($value){
- $s='';
- if($value=='m') $s= MALE;
- elseif($value=='f') $s= FEMALE;
- elseif($value=='l') $s= MLLE;
- return $s;
+ public static function randomize() {
+ $salt = "abchefghjkmnpqrstuvwxyz0123456789";
+ srand((double)microtime()*1000000);
+ $i = 0;
+ $pass='';
+ while ($i <= 7) {
+ $num = rand() % 33;
+ $tmp = substr($salt, $num, 1);
+ $pass = $pass . $tmp;
+ $i++;
+ }
+ return $pass;
}
-
-
/**
- @brief format db value for display page
- @param $_query ressource db sql
- @return array
+ @fn CleanKey()
+ @brief Clean string name key
*/
- protected static function FormatDBValue($_query){
- $DB=Database::getInstance();
- $res=array();
+ public static function CleanKey($array){
+ new self();
+
+ $object= new stdclass();
- switch (self::$action) {
- case 'listing':
- global $languages_id, $price;
+ foreach($array as $key=>$value){
+ if( strpos($key,'customers_') ===0)
+ $key=substr($key,10);
- /* DEB Sub module add col */
- self::GetExternalFieldsForFormat( self::$allfieldsexternal );
-
- while ($item = $_query->fetchAssoc()) {
- $ord =array();
-
- $item[0]=$item['id'];
- $item[1]=tep_draw_checkbox_field('action_multi['.$item['id'].']','action_mutli_'.$item['id'],$item['id']);
+ $object->$key = $value;
+ }
- foreach(self::$InitInfo['modele']['listing'] as $k=>$row){
- if( ($value = self::FormatDBValueRow($k, $item)) && $value !=false )
- $ord[$k]= $value;
- elseif($k == 'entry_gender')
- $ord[$k]=self::tep_view_gender_human($row);
- elseif($k == 'group_ra')
- $...
[truncated message content] |
|
From: <os...@us...> - 2014-03-27 10:21:21
|
Revision: 5197
http://sourceforge.net/p/oscss/svn/5197
Author: oscim
Date: 2014-03-27 10:21:17 +0000 (Thu, 27 Mar 2014)
Log Message:
-----------
fix
Modified Paths:
--------------
trunk/catalog/admin/includes/classes/drivers/sqlorder.php
trunk/catalog/admin/includes/functions/lib.orders.php
trunk/catalog/admin/includes/modules/pages/held_orders.php
trunk/catalog/common/classes/order.php
trunk/catalog/includes/classes/ExtraFieldsUse.php
trunk/catalog/includes/classes/drivers/data/categorie.php
Modified: trunk/catalog/admin/includes/classes/drivers/sqlorder.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlorder.php 2014-03-19 07:54:11 UTC (rev 5196)
+++ trunk/catalog/admin/includes/classes/drivers/sqlorder.php 2014-03-27 10:21:17 UTC (rev 5197)
@@ -320,7 +320,8 @@
$sql_data_array['last_modified'] = 'NOW()';
- tep_db_perform(TABLE_ORDERS, $sql_data_array, 'update', "orders_id = '" . $id . "'");
+ if( !tep_db_perform(TABLE_ORDERS, $sql_data_array, 'update', "orders_id = '" . $id . "'") )
+ $error++;
}
@@ -334,7 +335,7 @@
// if ($notify)
require_once(DIR_WS_FUNCTIONS. 'lib.orders.php');
- OrdersNotify($id,$order->info, $order->customer, $status, $comments);
+ OrdersNotify($id,$order->info, $order->customer, $status, implode("\n\r", self::$comment) );
if($error !=false)
return false;
Modified: trunk/catalog/admin/includes/functions/lib.orders.php
===================================================================
--- trunk/catalog/admin/includes/functions/lib.orders.php 2014-03-19 07:54:11 UTC (rev 5196)
+++ trunk/catalog/admin/includes/functions/lib.orders.php 2014-03-27 10:21:17 UTC (rev 5197)
@@ -72,10 +72,10 @@
@param $status_name string
@param $comments string
*/
-function OrdersNotify($oID,$array_order_info, $array_customer, $status, $comments){
+function OrdersNotify($oID,$array_order_info, $array_customer, $status, $comments/*, $languages_id*/){
// TODO Prise en charge language client
- global $language, $messageStack;
+ global $language, $messageStack,$languages_id;
$DB=Database::getInstance();
$orders_status_array=array();
Modified: trunk/catalog/admin/includes/modules/pages/held_orders.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/held_orders.php 2014-03-19 07:54:11 UTC (rev 5196)
+++ trunk/catalog/admin/includes/modules/pages/held_orders.php 2014-03-27 10:21:17 UTC (rev 5197)
@@ -567,7 +567,7 @@
$orders[1]=tep_draw_checkbox_field('action_multi['.$orders['orders_id'].']','action_mutli_'.$orders['orders_id'],$orders['orders_id'], '','',' class="multi" ');
foreach(self::$InitInfo['modele']['listing'] as $k=>$row){
- if( ($value = self::FormatDBValueRow($k, $item)) && $value !=false )
+ if( ($value = self::FormatDBValueRow($k, $orders)) && $value !=false )
$ord[$k]= $value;
elseif($k == 'order_total') $ord[$k]=strip_tags($orders['order_total']);
elseif($k == 'customers_id') $ord[$k]=tep_customers_row_action($orders['customers_id'], array('origin'=>self::FILENAME));
Modified: trunk/catalog/common/classes/order.php
===================================================================
--- trunk/catalog/common/classes/order.php 2014-03-19 07:54:11 UTC (rev 5196)
+++ trunk/catalog/common/classes/order.php 2014-03-27 10:21:17 UTC (rev 5197)
@@ -382,7 +382,12 @@
// exit;
$customer_address_query = tep_db_query("select c.customers_firstname, c.customers_lastname, c.customers_telephone, c.customers_email_address, ab.entry_company, ab.entry_street_address, ab.entry_suburb, ab.entry_postcode, ab.entry_city, ab.entry_zone_id, z.zone_name, co.countries_id, co.countries_name, co.countries_iso_code_2, co.countries_iso_code_3, co.address_format_id, ab.entry_state from " . TABLE_CUSTOMERS . " c, " . TABLE_ADDRESS_BOOK . " ab left join " . TABLE_ZONES . " z on (ab.entry_zone_id = z.zone_id) left join " . TABLE_COUNTRIES . " co on (ab.entry_country_id = co.countries_id) where c.customers_id = '" . (int)$customer_id . "' and ab.customers_id = '" . (int)$customer_id . "' and c.customers_default_address_id = ab.address_book_id");
$customer_address = tep_db_fetch_array($customer_address_query);
-
+ // if not default address for this customer, use billto address
+ if( ! $customer_address ){
+ $customer_address_query = tep_db_query($sql = "select c.customers_firstname, c.customers_lastname, c.customers_telephone, c.customers_email_address, ab.entry_company, ab.entry_street_address, ab.entry_suburb, ab.entry_postcode, ab.entry_city, ab.entry_zone_id, z.zone_name, co.countries_id, co.countries_name, co.countries_iso_code_2, co.countries_iso_code_3, co.address_format_id, ab.entry_state from " . TABLE_CUSTOMERS . " c, " . TABLE_ADDRESS_BOOK . " ab left join " . TABLE_ZONES . " z on (ab.entry_zone_id = z.zone_id) left join " . TABLE_COUNTRIES . " co on (ab.entry_country_id = co.countries_id) where c.customers_id = '" . (int)$customer_id . "' and ab.customers_id = '" . (int)$customer_id . "' and ab.address_book_id = '" . (int)$billto . "' ");
+ $customer_address = tep_db_fetch_array($customer_address_query);
+ }
+
$shipping_address_query = tep_db_query("select ab.entry_firstname, ab.entry_lastname, ab.entry_company, ab.entry_street_address, ab.entry_suburb, ab.entry_postcode, ab.entry_city, ab.entry_zone_id, z.zone_name, ab.entry_country_id, c.countries_id, c.countries_name, c.countries_iso_code_2, c.countries_iso_code_3, c.address_format_id, ab.entry_state from " . TABLE_ADDRESS_BOOK . " ab left join " . TABLE_ZONES . " z on (ab.entry_zone_id = z.zone_id) left join " . TABLE_COUNTRIES . " c on (ab.entry_country_id = c.countries_id) where ab.customers_id = '" . (int)$customer_id . "' and ab.address_book_id = '" . (int)$sendto . "'");
$shipping_address = tep_db_fetch_array($shipping_address_query);
Modified: trunk/catalog/includes/classes/ExtraFieldsUse.php
===================================================================
--- trunk/catalog/includes/classes/ExtraFieldsUse.php 2014-03-19 07:54:11 UTC (rev 5196)
+++ trunk/catalog/includes/classes/ExtraFieldsUse.php 2014-03-27 10:21:17 UTC (rev 5197)
@@ -93,7 +93,8 @@
ce.fields_required_status,
cei.fields_name,
- cei.fields_format as format
+ cei.fields_format as format,
+ cei.fields_name as label
FROM " . TABLE_EXTRA_FIELDS . " ce
@@ -134,6 +135,7 @@
$robj->name = (string) $extra_fields['fields_name'];// obsolete
$robj->label = (string) $extra_fields['fields_name'];
+ $robj->placeholder = (string) $extra_fields['label'];
$robj->input_name = (string) 'fields_'.$extra_fields['fields_id'];
$robj->input_type = (int) $extra_fields['fields_input_type'];
@@ -328,6 +330,8 @@
$array[ (!empty($e['epf_key'])?$e['fkey'] :$e['id']) ]=new objectInfo( array(
'label'=>(string)$e['label'],
'name'=>(string)$e['label'], // obsolete
+ 'placeholder'=>(string)$e['label'],
+
'value' => $value, // obsolete
'epf_key'=>(string)$e['fkey'],
Modified: trunk/catalog/includes/classes/drivers/data/categorie.php
===================================================================
--- trunk/catalog/includes/classes/drivers/data/categorie.php 2014-03-19 07:54:11 UTC (rev 5196)
+++ trunk/catalog/includes/classes/drivers/data/categorie.php 2014-03-27 10:21:17 UTC (rev 5197)
@@ -13,7 +13,7 @@
require_once(DIR_FS_CATALOG . DIR_WS_CLASSES . 'DataStatmentFO.php');
require_once(DIR_FS_CATALOG . DIR_WS_CLASSES . 'drivers/DataListenerRow.php');
require_once(DIR_FS_CATALOG . DIR_WS_CLASSES . 'drivers/DataListenerRowCategorie.php');
-error_reporting(E_ALL);
+
/**
\class categorie
\brief Control init et gestion des data product
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2014-03-19 07:54:14
|
Revision: 5196
http://sourceforge.net/p/oscss/svn/5196
Author: oscim
Date: 2014-03-19 07:54:11 +0000 (Wed, 19 Mar 2014)
Log Message:
-----------
Fix
Modified Paths:
--------------
trunk/catalog/admin/includes/modules/pages/shippings.php
trunk/catalog/includes/classes/drivers/data/categorie.php
trunk/catalog/includes/classes/drivers/data/product.php
trunk/catalog/includes/modules/featured.php
trunk/catalog/install/includes/sql/mysql/tables/osc_shipping.sql
trunk/catalog/install/includes/sql/mysql/upgrade/2.1.1rc_2.1.2/tables/osc_shipping.sql
Modified: trunk/catalog/admin/includes/modules/pages/shippings.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/shippings.php 2014-03-17 12:57:51 UTC (rev 5195)
+++ trunk/catalog/admin/includes/modules/pages/shippings.php 2014-03-19 07:54:11 UTC (rev 5196)
@@ -572,7 +572,7 @@
$query_raw = "SELECT DISTINCT ".$adjust->listfields.
" FROM " . TABLE_SHIPPING . " s ".
" LEFT JOIN " . TABLE_ORDERS . " o on (o.orders_id = s.orders_id) ".
- " LEFT JOIN " . TABLE_STATUS . " st ON( st.status_id = s.row_id and st.status_type='".self::$datatype."_progress' and st.language_id = '" . (int)$adjust->languages_id . "') ".
+ " LEFT JOIN " . TABLE_STATUS . " st ON( st.status_id = s.status and st.status_type='".self::$datatype."_progress' and st.language_id = '" . (int)$adjust->languages_id . "') ".
" WHERE 1 ".$adjust->sWhere.
" ORDER BY ".((!empty($adjust->sOrder)) ? $adjust->sOrder : 's.row_id DESC');
Modified: trunk/catalog/includes/classes/drivers/data/categorie.php
===================================================================
--- trunk/catalog/includes/classes/drivers/data/categorie.php 2014-03-17 12:57:51 UTC (rev 5195)
+++ trunk/catalog/includes/classes/drivers/data/categorie.php 2014-03-19 07:54:11 UTC (rev 5196)
@@ -13,7 +13,7 @@
require_once(DIR_FS_CATALOG . DIR_WS_CLASSES . 'DataStatmentFO.php');
require_once(DIR_FS_CATALOG . DIR_WS_CLASSES . 'drivers/DataListenerRow.php');
require_once(DIR_FS_CATALOG . DIR_WS_CLASSES . 'drivers/DataListenerRowCategorie.php');
-
+error_reporting(E_ALL);
/**
\class categorie
\brief Control init et gestion des data product
@@ -51,6 +51,13 @@
public static function resetInstance(){
self::$_instance = null;
+
+ // Reset query if class is called by other driver data
+ //categorieData::reset_query();
+ // FIX oscim 18/03/2014
+ categorieData::$where_query='';
+
+
return self::getInstance();
}
@@ -144,17 +151,9 @@
$DataRow->SetImages($res);
$DataRow->SetImage($res[0]);
}
-//
$DataRow->SetText($content['categories_description']);
-// $res['cpath']= self::get_path($content['categories_id'] );
-// $res['href']=tep_href_link(FILENAME_DEFAULT,'cPath=' . $res['cpath']);
-// $res['key']=$content['categories_id'];
-// $res['datatype']=$content['categories_datatype'];
-// $res['id']=$content['categories_id'];
-// $res['title']=$content['categories_name'];
-// $res['name']=$content['categories_name'];
-
+
// $res['status']=self::countChidlsAll($content['categories_id'], $content['categories_datatype'], $content['categories_status']);
// $res['childs']=self::get_has_category_subcategories($content['categories_id']);
@@ -165,10 +164,7 @@
// Calculate Cpath after put in cache
// $DataRow->SetCpath( self::get_path($content['categories_id'] ));
-
-// self::$object_data[$content['categories_id']]=$DataRow;
-
-
+
}
}
Modified: trunk/catalog/includes/classes/drivers/data/product.php
===================================================================
--- trunk/catalog/includes/classes/drivers/data/product.php 2014-03-17 12:57:51 UTC (rev 5195)
+++ trunk/catalog/includes/classes/drivers/data/product.php 2014-03-19 07:54:11 UTC (rev 5196)
@@ -418,14 +418,19 @@
/**
- Construct a category path to the product
- // TABLES: products_to_categories
+ @fn get_product_path($products_id)
+ @brief Construct a category path to the product
+ TABLES: products_to_categories
+ @param $products_id int id product
+ @return cpath string (ex: 01_12)
*/
public static function get_product_path($products_id) {
$cPath = '';
if((int)$products_id ==0 )return false;
if( ($category=self::get_item($products_id)) == false) return false;
+ // Fix for reset context
+ categorie::resetInstance();
$cPath = categorie::get_path( $category->GetId());
if(!is_object(self::$object_data[(int)$products_id])) self::$object_data[(int)$products_id]=new objectInfo(array());
Modified: trunk/catalog/includes/modules/featured.php
===================================================================
--- trunk/catalog/includes/modules/featured.php 2014-03-17 12:57:51 UTC (rev 5195)
+++ trunk/catalog/includes/modules/featured.php 2014-03-19 07:54:11 UTC (rev 5196)
@@ -44,7 +44,7 @@
// type simple
$sql = "SELECT fda.datatype_child_id as id, datatype_child as datatype , featured_title FROM ".TABLE_LINKTO." fda ".
" LEFT JOIN ". TABLE_FEATURED_DESCRIPTION." fd ON(fd.featured_id = fda.datatype_parent_id AND fda.datatype_parent = 'featured' AND languages_id = '".$languages_id."' ) ".
- " LEFT JOIN ". TABLE_FEATURED." f ON(fda.featured_id = f.row_id ) ".
+ " LEFT JOIN ". TABLE_FEATURED." f ON(fda.datatype_child_id = f.row_id ) ".
" WHERE k_status_type = '1' ".$wh_feat.
" ";
Modified: trunk/catalog/install/includes/sql/mysql/tables/osc_shipping.sql
===================================================================
--- trunk/catalog/install/includes/sql/mysql/tables/osc_shipping.sql 2014-03-17 12:57:51 UTC (rev 5195)
+++ trunk/catalog/install/includes/sql/mysql/tables/osc_shipping.sql 2014-03-19 07:54:11 UTC (rev 5196)
@@ -18,6 +18,7 @@
--
CREATE TABLE IF NOT EXISTS osc_shipping (
row_id int(11) NOT NULL AUTO_INCREMENT,
+ shippings_type INT(1) NOT NULL DEFAULT '1',
shipping_ref VARCHAR( 32 ) NULL DEFAULT NULL,
orders_id int(11) NOT NULL,
method varchar(64) NOT NULL,
Modified: trunk/catalog/install/includes/sql/mysql/upgrade/2.1.1rc_2.1.2/tables/osc_shipping.sql
===================================================================
--- trunk/catalog/install/includes/sql/mysql/upgrade/2.1.1rc_2.1.2/tables/osc_shipping.sql 2014-03-17 12:57:51 UTC (rev 5195)
+++ trunk/catalog/install/includes/sql/mysql/upgrade/2.1.1rc_2.1.2/tables/osc_shipping.sql 2014-03-19 07:54:11 UTC (rev 5196)
@@ -12,3 +12,4 @@
--+######################################################################--+
ALTER TABLE osc_shipping ADD shipping_ref VARCHAR( 32 ) NULL DEFAULT NULL AFTER row_id ;
+ALTER TABLE osc_shipping ADD shippings_type INT(1) NOT NULL DEFAULT '1' AFTER row_id ;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2014-03-17 12:57:54
|
Revision: 5195
http://sourceforge.net/p/oscss/svn/5195
Author: oscim
Date: 2014-03-17 12:57:51 +0000 (Mon, 17 Mar 2014)
Log Message:
-----------
Fix?\194?\187
Modified Paths:
--------------
trunk/catalog/admin/includes/modules/pages/cms_content.php
trunk/catalog/common/modules/core/numref/bills/sakura.php
trunk/catalog/install/data/sample/appareil_photo/oscss_sample_data.sql
trunk/catalog/install/includes/language/fr_FR/osc_status.txt
trunk/catalog/install/includes/sql/mysql/data/20_osc_status.sql
trunk/catalog/install/includes/sql/mysql/data/40_osc_content.sql
trunk/catalog/install/includes/sql/mysql/data/91_osc_content_description.sql
Modified: trunk/catalog/admin/includes/modules/pages/cms_content.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/cms_content.php 2014-03-13 17:05:39 UTC (rev 5194)
+++ trunk/catalog/admin/includes/modules/pages/cms_content.php 2014-03-17 12:57:51 UTC (rev 5195)
@@ -36,6 +36,8 @@
,InterfacedTJsonS
// detail row in chidls
,InterfacedInnerHtml
+ // use filter generic
+ , FilterTabsData
// Events Interface for display and exec all notification
, EventMessInterface
Modified: trunk/catalog/common/modules/core/numref/bills/sakura.php
===================================================================
--- trunk/catalog/common/modules/core/numref/bills/sakura.php 2014-03-13 17:05:39 UTC (rev 5194)
+++ trunk/catalog/common/modules/core/numref/bills/sakura.php 2014-03-17 12:57:51 UTC (rev 5195)
@@ -38,10 +38,10 @@
$coyymm=''; $max='';
- $posindice=8;
- $sql = "SELECT MAX(SUBSTRING(orders_ref FROM ".$posindice.")) as max";
+ $posindice=9;
+ $sql = "SELECT MAX(SUBSTRING(facture_ref FROM ".$posindice.")) as max";
$sql.= " FROM ".TABLE_ORDERS." ";
- $sql.= " WHERE orders_ref LIKE '".$this->prefix."____-%'";
+ $sql.= " WHERE facture_ref LIKE '".$this->prefix."_____-%'";
$resql=$DB->query($sql);
@@ -71,10 +71,10 @@
$DB=Database::getInstance();
// D'abord on recupere la valeur max
- $posindice=8;
- $sql = "SELECT MAX(SUBSTRING(orders_ref FROM ".$posindice.")) as max";
+ $posindice=9;
+ $sql = "SELECT MAX(SUBSTRING(facture_ref FROM ".$posindice.")) as max";
$sql.= " FROM ".TABLE_ORDERS." ";
- $sql.= " WHERE orders_ref like '".$this->prefix."____-%'";
+ $sql.= " WHERE facture_ref like '".$this->prefix."_____-%'";
$resql=$DB->query($sql);
if ($resql)
Modified: trunk/catalog/install/data/sample/appareil_photo/oscss_sample_data.sql
===================================================================
--- trunk/catalog/install/data/sample/appareil_photo/oscss_sample_data.sql 2014-03-13 17:05:39 UTC (rev 5194)
+++ trunk/catalog/install/data/sample/appareil_photo/oscss_sample_data.sql 2014-03-17 12:57:51 UTC (rev 5195)
@@ -211,9 +211,9 @@
-INSERT IGNORE INTO osc_featured_data (row_id, featured_id, datatype, datatype_id, date_added, user_added, date_update, user_update, date_start, date_end) VALUES
-(2, 1, 'product', 11, '2012-07-04 08:37:58', 1, '0000-00-00 00:00:00', 0, '1000-01-01 00:00:00', '1000-01-01 00:00:00'),
-(3, 1, 'product', 12, '2012-07-04 08:38:07', 1, '0000-00-00 00:00:00', 0, '1000-01-01 00:00:00', '1000-01-01 00:00:00');
+-- INSERT IGNORE INTO osc_linkto (row_id, featured_id, datatype, datatype_id, date_added, user_added, date_update, user_update, date_start, date_end) VALUES
+-- (2, 1, 'product', 11, '2012-07-04 08:37:58', 1, '0000-00-00 00:00:00', 0, '1000-01-01 00:00:00', '1000-01-01 00:00:00'),
+-- (3, 1, 'product', 12, '2012-07-04 08:38:07', 1, '0000-00-00 00:00:00', 0, '1000-01-01 00:00:00', '1000-01-01 00:00:00');
INSERT IGNORE INTO osc_images ( pathkey, path, file, date_added, last_modified, width, height, ext) VALUES
Modified: trunk/catalog/install/includes/language/fr_FR/osc_status.txt
===================================================================
--- trunk/catalog/install/includes/language/fr_FR/osc_status.txt 2014-03-13 17:05:39 UTC (rev 5194)
+++ trunk/catalog/install/includes/language/fr_FR/osc_status.txt 2014-03-17 12:57:51 UTC (rev 5195)
@@ -54,6 +54,11 @@
$lg['OSC_CMS_CONTENT_SIMPLE']="Simple page cms" ;
$lg['OSC_CMS_CONTENT_FIXE']="Fixe (necessaire au core)" ;
+/* customer type */
+$lg['OSC_CUSTOMERS_PERSO']="Particulier" ;
+$lg['OSC_CUSTOMERS_PRO']="Professionel" ;
+$lg['OSC_CUSTOMERS_EMAILLING']="Emailling" ;
+
/* attybute option type */
$lg['OSC_ATTRIBUTE_OPTIONTYPE_SELECT']="Select" ;
$lg['OSC_ATTRIBUTE_OPTIONTYPE_TEXT']="Text" ;
Modified: trunk/catalog/install/includes/sql/mysql/data/20_osc_status.sql
===================================================================
--- trunk/catalog/install/includes/sql/mysql/data/20_osc_status.sql 2014-03-13 17:05:39 UTC (rev 5194)
+++ trunk/catalog/install/includes/sql/mysql/data/20_osc_status.sql 2014-03-17 12:57:51 UTC (rev 5195)
@@ -54,7 +54,7 @@
INSERT IGNORE INTO osc_status (status_id, status_type, language_id, status_name, status_color) VALUES (1, 'content', 1, 'OSC_CMS_CONTENT_SIMPLE','');
-INSERT IGNORE INTO osc_status (status_id, status_type, language_id, status_name, status_color) VALUES (2, 'content', 2, 'OSC_CMS_CONTENT_FIXE','');
+INSERT IGNORE INTO osc_status (status_id, status_type, language_id, status_name, status_color) VALUES (2, 'content', 1, 'OSC_CMS_CONTENT_FIXE','');
INSERT IGNORE INTO osc_status (status_id, status_type, language_id, status_name, status_color) VALUES (1, 'featured', 1, 'OSC_FEATURED_UNE','');
INSERT IGNORE INTO osc_status (status_id, status_type, language_id, status_name, status_color) VALUES (2, 'featured', 1, 'OSC_FEATURED_SELECTION','');
Modified: trunk/catalog/install/includes/sql/mysql/data/40_osc_content.sql
===================================================================
--- trunk/catalog/install/includes/sql/mysql/data/40_osc_content.sql 2014-03-13 17:05:39 UTC (rev 5194)
+++ trunk/catalog/install/includes/sql/mysql/data/40_osc_content.sql 2014-03-17 12:57:51 UTC (rev 5195)
@@ -13,7 +13,7 @@
insert into osc_content (content_id, content_type, content_name, date_added, last_modified, content_status) values ('1', 2, 'informationBox_shipping', NOW(), NULL, '1');
-insert into osc_content (content_id, content_type,content_type,content_name, date_added, last_modified, content_status) values ('2', 2, 'informationBox_privacy', NOW(), NULL, '1');
+insert into osc_content (content_id, content_type,content_name, date_added, last_modified, content_status) values ('2', 2, 'informationBox_privacy', NOW(), NULL, '1');
insert into osc_content (content_id, content_type,content_name, date_added, last_modified, content_status) values ('3', 2, 'informationBox_conditions', NOW(), NULL, '1');
insert into osc_content (content_id, content_type,content_name, date_added, last_modified, content_status) values ('4', 2, 'Page_contact_us', NOW(), NULL, '1');
insert into osc_content (content_id, content_type,content_name, date_added, last_modified, content_status) values ('5', 2, 'Page_contact_us_success', NOW(), NULL, '1');
Modified: trunk/catalog/install/includes/sql/mysql/data/91_osc_content_description.sql
===================================================================
--- trunk/catalog/install/includes/sql/mysql/data/91_osc_content_description.sql 2014-03-13 17:05:39 UTC (rev 5194)
+++ trunk/catalog/install/includes/sql/mysql/data/91_osc_content_description.sql 2014-03-17 12:57:51 UTC (rev 5195)
@@ -13,14 +13,14 @@
-insert into osc_content_description (content_id,content_type, content_title, content_text, language_id) values ('1', 2, 'OSC_CONTENT_DESCRIPTION_SHIPPING_T', 'OSC_CONTENT_DESCRIPTION_SHIPPING_D', '1');
-insert into osc_content_description (content_id,content_type, content_title, content_text, language_id) values ('2', 2, 'OSC_CONTENT_DESCRIPTION_PRIVACY_T', 'OSC_CONTENT_DESCRIPTION_PRIVACY_D', '1');
-insert into osc_content_description (content_id,content_type, content_title, content_text, language_id) values ('3', 2, 'OSC_CONTENT_DESCRIPTION_CONDITIONS_T', 'OSC_CONTENT_DESCRIPTION_CONDITIONS_D', '1');
-insert into osc_content_description (content_id,content_type, content_title, content_text, language_id) values ('4', 2, 'OSC_CONTENT_DESCRIPTION_CONTACT_T', 'OSC_CONTENT_DESCRIPTION_CONTACT_D', '1');
-insert into osc_content_description (content_id,content_type, content_title, content_text, language_id) values ('5', 2, '', '', '1');
-insert into osc_content_description (content_id,content_type, content_title, content_text, language_id) values ('6', 2, '', '', '1');
-insert into osc_content_description (content_id,content_type, content_title, content_text, language_id) values ('7', 2, '', '', '1');
-insert into osc_content_description (content_id,content_type, content_title, content_text, language_id) values ('8', 2, '', '', '1');
-insert into osc_content_description (content_id,content_type, content_title, content_text, language_id) values ('9', 2, 'OSC_CONTENT_DESCRIPTION_HOME_T', 'OSC_CONTENT_DESCRIPTION_HOME_D', '1');
+insert into osc_content_description (content_id, content_title, content_text, language_id) values ('1', 'OSC_CONTENT_DESCRIPTION_SHIPPING_T', 'OSC_CONTENT_DESCRIPTION_SHIPPING_D', '1');
+insert into osc_content_description (content_id, content_title, content_text, language_id) values ('2', 'OSC_CONTENT_DESCRIPTION_PRIVACY_T', 'OSC_CONTENT_DESCRIPTION_PRIVACY_D', '1');
+insert into osc_content_description (content_id, content_title, content_text, language_id) values ('3', 'OSC_CONTENT_DESCRIPTION_CONDITIONS_T', 'OSC_CONTENT_DESCRIPTION_CONDITIONS_D', '1');
+insert into osc_content_description (content_id, content_title, content_text, language_id) values ('4', 'OSC_CONTENT_DESCRIPTION_CONTACT_T', 'OSC_CONTENT_DESCRIPTION_CONTACT_D', '1');
+insert into osc_content_description (content_id, content_title, content_text, language_id) values ('5', '', '', '1');
+insert into osc_content_description (content_id, content_title, content_text, language_id) values ('6', '', '', '1');
+insert into osc_content_description (content_id, content_title, content_text, language_id) values ('7', '', '', '1');
+insert into osc_content_description (content_id, content_title, content_text, language_id) values ('8', '', '', '1');
+insert into osc_content_description (content_id, content_title, content_text, language_id) values ('9', 'OSC_CONTENT_DESCRIPTION_HOME_T', 'OSC_CONTENT_DESCRIPTION_HOME_D', '1');
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2014-03-13 17:05:42
|
Revision: 5194
http://sourceforge.net/p/oscss/svn/5194
Author: oscim
Date: 2014-03-13 17:05:39 +0000 (Thu, 13 Mar 2014)
Log Message:
-----------
Fix
Modified Paths:
--------------
trunk/catalog/install/includes/sql/mysql/data/20_osc_status.sql
Modified: trunk/catalog/install/includes/sql/mysql/data/20_osc_status.sql
===================================================================
--- trunk/catalog/install/includes/sql/mysql/data/20_osc_status.sql 2014-03-13 16:21:25 UTC (rev 5193)
+++ trunk/catalog/install/includes/sql/mysql/data/20_osc_status.sql 2014-03-13 17:05:39 UTC (rev 5194)
@@ -54,7 +54,7 @@
INSERT IGNORE INTO osc_status (status_id, status_type, language_id, status_name, status_color) VALUES (1, 'content', 1, 'OSC_CMS_CONTENT_SIMPLE','');
-INSERT IGNORE INTO osc_status (status_id, status_type, language_id, status_name, status_color) VALUES (1, 'content', 2, 'OSC_CMS_CONTENT_FIXE','');
+INSERT IGNORE INTO osc_status (status_id, status_type, language_id, status_name, status_color) VALUES (2, 'content', 2, 'OSC_CMS_CONTENT_FIXE','');
INSERT IGNORE INTO osc_status (status_id, status_type, language_id, status_name, status_color) VALUES (1, 'featured', 1, 'OSC_FEATURED_UNE','');
INSERT IGNORE INTO osc_status (status_id, status_type, language_id, status_name, status_color) VALUES (2, 'featured', 1, 'OSC_FEATURED_SELECTION','');
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2014-03-13 16:21:27
|
Revision: 5193
http://sourceforge.net/p/oscss/svn/5193
Author: oscim
Date: 2014-03-13 16:21:25 +0000 (Thu, 13 Mar 2014)
Log Message:
-----------
Fix
Modified Paths:
--------------
trunk/catalog/admin/includes/classes/emailUtility.php
trunk/catalog/admin/includes/modules/pages/customers.php
trunk/catalog/templates/defaut/Childs_tpl/module.php
Modified: trunk/catalog/admin/includes/classes/emailUtility.php
===================================================================
--- trunk/catalog/admin/includes/classes/emailUtility.php 2014-03-13 09:20:34 UTC (rev 5192)
+++ trunk/catalog/admin/includes/classes/emailUtility.php 2014-03-13 16:21:25 UTC (rev 5193)
@@ -1,16 +1,19 @@
<?php if (!defined('HTTP_SERVER')) die('You can not access this file directly!');
/**
- @licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
+ @licence GPL 2005-2014 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
+ @version 2.2.0
@date 17/11/11, 15:27
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
- @class emailUtility
+ @file emailUtility.php
*/
+/**
+ @class emailUtility
+*/
class emailUtility {
@@ -260,5 +263,92 @@
return $t;
}
+
+
+ /**
+ * \brief test forme email
+ * @param $email string
+ */
+ public static function tep_validate_email($email) {
+ $valid_address = true;
+
+ $mail_pat = '^(.+)@(.+)$';
+ $valid_chars = "[^] \(\)<>@,;:\.\\\"\[]";
+ $atom = "$valid_chars+";
+ $quoted_user='(\"[^\"]*\")';
+ $word = "($atom|$quoted_user)";
+ $user_pat = "^$word(\.$word)*$";
+ $ip_domain_pat='^\[([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\]$';
+ $domain_pat = "^$atom(\.$atom)*$";
+
+ if (preg_match('/'.$mail_pat.'/i', $email, $components)) {
+ $user = $components[1];
+ $domain = $components[2];
+ // validate user
+ if (preg_match('/'.$user_pat.'/i', $user)) {
+ // validate domain
+ if (preg_match('/'.$ip_domain_pat.'/i', $domain, $ip_components)) {
+ // this is an IP address
+ for ($i=1;$i<=4;$i++) {
+ if ($ip_components[$i] > 255) {
+ $valid_address = false;
+ break;
+ }
+ }
+ }
+ else {
+ // Domain is a name, not an IP
+ if (preg_match('/'.$domain_pat.'/i', $domain)) {
+ /* domain name seems valid, but now make sure that it ends in a valid TLD or ccTLD
+ and that there's a hostname preceding the domain or country. */
+ $domain_components = explode(".", $domain);
+ // Make sure there's a host name preceding the domain.
+ if (sizeof($domain_components) < 2) {
+ $valid_address = false;
+ } else {
+ $top_level_domain = strtolower($domain_components[sizeof($domain_components)-1]);
+ // Allow all 2-letter TLDs (ccTLDs)
+ if (preg_match('/^[a-z][a-z]$/i', $top_level_domain) != 1) {
+ $tld_pattern = '';
+ // Get authorized TLDs from text file
+ $tlds = file(DIR_WS_INCLUDES . 'tld.txt');
+ while (list(,$line) = each($tlds)) {
+ // Get rid of comments
+ $words = explode('#', $line);
+ $tld = trim($words[0]);
+ // TLDs should be 3 letters or more
+ if (preg_match('/^[a-z]{3,}$/i', $tld) == 1) {
+ $tld_pattern .= '^' . $tld . '$|';
+ }
+ }
+ // Remove last '|'
+ $tld_pattern = substr($tld_pattern, 0, -1);
+ if (preg_match("/$tld_pattern/i", $top_level_domain) == 0) {
+ $valid_address = false;
+ }
+ }
+ }
+ }
+ else {
+ $valid_address = false;
+ }
+ }
+ }
+ else {
+ $valid_address = false;
+ }
+ }
+ else {
+ $valid_address = false;
+ }
+ if ($valid_address && _cst_bool('ENTRY_EMAIL_ADDRESS_CHECK') == 'true') {
+ if (!checkdnsrr($domain, "MX") && !checkdnsrr($domain, "A")) {
+ $valid_address = false;
+ }
+ }
+ return $valid_address;
+ }
+
+
}
?>
Modified: trunk/catalog/admin/includes/modules/pages/customers.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/customers.php 2014-03-13 09:20:34 UTC (rev 5192)
+++ trunk/catalog/admin/includes/modules/pages/customers.php 2014-03-13 16:21:25 UTC (rev 5193)
@@ -607,6 +607,15 @@
@remarks normal page
*/
case 'insert':
+
+ if(!tep_action_check('edit', self::FILENAME))
+ tep_redirect(tep_href_link(self::FILENAME));
+ global $languages_id;
+
+ $_id=sqlcustomer::create(array('password'=>'', 'email'=>'', 'language_id'=>$languages_id) );
+
+ tep_redirect(tep_href_link(self::FILENAME, tep_get_all_get_params(array('action','cPath','cID'),false).'cID=' . $_id.'&action=edit'));
+ break;
case 'update':
$array = array();
$array['post'] = $_POST;
@@ -648,7 +657,7 @@
if (strlen($testobj->customers_email_address) < ENTRY_EMAIL_ADDRESS_MIN_LENGTH)
throw new Exception(__("L'adresse email est trop courte, min:").ENTRY_EMAIL_ADDRESS_MIN_LENGTH);
- if (!self::tep_validate_email($testobj->customers_email_address))
+ if (!emailUtility::tep_validate_email($testobj->customers_email_address))
throw new Exception(ENTRY_EMAIL_ADDRESS_CHECK_ERROR);
if(self::$Id > 0 && ! sqlcustomer::userTestNotExists($testobj->customers_email_address) )
@@ -755,7 +764,7 @@
}
// throw new Exception(__("L'adresse email est trop courte, min:").ENTRY_EMAIL_ADDRESS_MIN_LENGTH);
- elseif (!self::tep_validate_email($ref)){
+ elseif (!emailUtility::tep_validate_email($ref)){
self::$Info['isValidRef'] = false;
self::PutMessage(
@@ -1065,93 +1074,8 @@
- /**
- * \brief test forme email
- * @param $email string
- */
- private static function tep_validate_email($email) {
- $valid_address = true;
- $mail_pat = '^(.+)@(.+)$';
- $valid_chars = "[^] \(\)<>@,;:\.\\\"\[]";
- $atom = "$valid_chars+";
- $quoted_user='(\"[^\"]*\")';
- $word = "($atom|$quoted_user)";
- $user_pat = "^$word(\.$word)*$";
- $ip_domain_pat='^\[([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\]$';
- $domain_pat = "^$atom(\.$atom)*$";
- if (preg_match('/'.$mail_pat.'/i', $email, $components)) {
- $user = $components[1];
- $domain = $components[2];
- // validate user
- if (preg_match('/'.$user_pat.'/i', $user)) {
- // validate domain
- if (preg_match('/'.$ip_domain_pat.'/i', $domain, $ip_components)) {
- // this is an IP address
- for ($i=1;$i<=4;$i++) {
- if ($ip_components[$i] > 255) {
- $valid_address = false;
- break;
- }
- }
- }
- else {
- // Domain is a name, not an IP
- if (preg_match('/'.$domain_pat.'/i', $domain)) {
- /* domain name seems valid, but now make sure that it ends in a valid TLD or ccTLD
- and that there's a hostname preceding the domain or country. */
- $domain_components = explode(".", $domain);
- // Make sure there's a host name preceding the domain.
- if (sizeof($domain_components) < 2) {
- $valid_address = false;
- } else {
- $top_level_domain = strtolower($domain_components[sizeof($domain_components)-1]);
- // Allow all 2-letter TLDs (ccTLDs)
- if (preg_match('/^[a-z][a-z]$/i', $top_level_domain) != 1) {
- $tld_pattern = '';
- // Get authorized TLDs from text file
- $tlds = file(DIR_WS_INCLUDES . 'tld.txt');
- while (list(,$line) = each($tlds)) {
- // Get rid of comments
- $words = explode('#', $line);
- $tld = trim($words[0]);
- // TLDs should be 3 letters or more
- if (preg_match('/^[a-z]{3,}$/i', $tld) == 1) {
- $tld_pattern .= '^' . $tld . '$|';
- }
- }
- // Remove last '|'
- $tld_pattern = substr($tld_pattern, 0, -1);
- if (preg_match("/$tld_pattern/i", $top_level_domain) == 0) {
- $valid_address = false;
- }
- }
- }
- }
- else {
- $valid_address = false;
- }
- }
- }
- else {
- $valid_address = false;
- }
- }
- else {
- $valid_address = false;
- }
- if ($valid_address && ENTRY_EMAIL_ADDRESS_CHECK == 'true') {
- if (!checkdnsrr($domain, "MX") && !checkdnsrr($domain, "A")) {
- $valid_address = false;
- }
- }
- return $valid_address;
- }
-
-
-
-
}
Modified: trunk/catalog/templates/defaut/Childs_tpl/module.php
===================================================================
--- trunk/catalog/templates/defaut/Childs_tpl/module.php 2014-03-13 09:20:34 UTC (rev 5192)
+++ trunk/catalog/templates/defaut/Childs_tpl/module.php 2014-03-13 16:21:25 UTC (rev 5193)
@@ -33,16 +33,23 @@
<?php } ?>
-
- <div class="row">
-
<?php /**
* Loop Data
*/
- foreach($themodule->module_db->content as $ele): ?>
-
+ $i = 0; foreach($themodule->module_db->content as $ele): ?>
+
+ <?php if( $i%4 ==0 ) : ?>
+ <?php if( $i>0 ) : ?>
+ </div>
+ <?php endif; ?>
+ <div class="row">
+ <?php endif; ?>
+
+
<div class=" one <?php echo $ele->type ?>">
+
+
<?php if($ele->type =='product'): /** PRODUCTS */ ?>
<section class="col-sm-3 col-xs-6 outerblock">
<div class="innerblock">
@@ -115,9 +122,11 @@
</section>
<?php endif; ?>
</div>
- <?php endforeach; ?>
+
+
+ <?php $i++; endforeach; ?>
- </div>
+ </div> <!--Last Div for loop and class row -->
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2014-03-13 09:20:36
|
Revision: 5192
http://sourceforge.net/p/oscss/svn/5192
Author: oscim
Date: 2014-03-13 09:20:34 +0000 (Thu, 13 Mar 2014)
Log Message:
-----------
Fix
progress rewrite code in customer page
BO Fix format date in listing and form
Modified Paths:
--------------
trunk/catalog/admin/includes/classes/ModTreePage.php
trunk/catalog/admin/includes/classes/drivers/sqlcustomer.php
trunk/catalog/admin/includes/classes/oscss_cstr.php
trunk/catalog/admin/includes/header.php
trunk/catalog/admin/includes/javascript/modules/pages/customers.js.php
trunk/catalog/admin/includes/modules/pages/adminAccount.php
trunk/catalog/admin/includes/modules/pages/customers.php
trunk/catalog/templates/defaut/includes/gabarit/checkout/payment_address.gab
Modified: trunk/catalog/admin/includes/classes/ModTreePage.php
===================================================================
--- trunk/catalog/admin/includes/classes/ModTreePage.php 2014-03-12 12:56:32 UTC (rev 5191)
+++ trunk/catalog/admin/includes/classes/ModTreePage.php 2014-03-13 09:20:34 UTC (rev 5192)
@@ -730,7 +730,9 @@
elseif($key == 'image')
return (!empty($data['image']) ? tep_info_image($data['image'], $data['name'], TEMP_BO_SMALL_IMAGE_WIDTH, TEMP_BO_SMALL_IMAGE_HEIGHT) : ' N/A');
// Format Date
- elseif(in_array($key,array('added', 'modified','available','last_logon', 'last_modified') ) )
+ elseif( preg_match('#last_logon#i', $key) )
+ return ((isset($data[$key]) && $data[$key] !='1000-01-01 00:00:00' )? tep_datetime_short($data[$key]) : '' );
+ elseif( preg_match('#date|added|modified|available|last_logon|last_modified#i', $key) )
return ((isset($data[$key]) && $data[$key] !='1000-01-01 00:00:00' )? tep_date_short($data[$key]) : '' );
/// DEB Sub module add col
elseif( isset(self::$CurrentExternal[$key]) ){
Modified: trunk/catalog/admin/includes/classes/drivers/sqlcustomer.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlcustomer.php 2014-03-12 12:56:32 UTC (rev 5191)
+++ trunk/catalog/admin/includes/classes/drivers/sqlcustomer.php 2014-03-13 09:20:34 UTC (rev 5192)
@@ -433,6 +433,19 @@
return $object;
}
+
+
+
+ /**
+ @fn userTestNotExists($customers_email_address)
+ @brief test user exists
+ @param $customers_email_address
+ @return boolean true OK : not exists | bool false KO Exsists
+ */
+ static public function userTestNotExists($customers_email_address){
+ $check_email = tep_db_query("select customers_email_address from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($customers_email_address) . "' ");
+ return (tep_db_num_rows($check_email))? false : true ;
+ }
}
Modified: trunk/catalog/admin/includes/classes/oscss_cstr.php
===================================================================
--- trunk/catalog/admin/includes/classes/oscss_cstr.php 2014-03-12 12:56:32 UTC (rev 5191)
+++ trunk/catalog/admin/includes/classes/oscss_cstr.php 2014-03-13 09:20:34 UTC (rev 5192)
@@ -403,6 +403,8 @@
// use template admin
if( file_exists( DIR_WS_TEMPLATE . 'img/' .$_SESSION['login_groups_id'] . '/' . $cdig ) )
$file_img = DIR_WS_TEMPLATE . 'img/' .$_SESSION['login_groups_id'] . '/' . $cdig ;
+ elseif( file_exists( DIR_WS_TEMPLATE . 'img/1/' . $cdig ) )
+ $file_img = DIR_WS_TEMPLATE . 'img/1/' . $cdig ;
elseif( file_exists( DIR_WS_INCLUDES . 'template/defaut/img/' .$_SESSION['login_groups_id'] . '/' . $cdig ) )
$file_img = DIR_WS_INCLUDES . 'template/defaut/img/' .$_SESSION['login_groups_id'] . '/' . $cdig;
elseif( file_exists( DIR_WS_INCLUDES . 'template/defaut/img/1/' . $cdig ) )
Modified: trunk/catalog/admin/includes/header.php
===================================================================
--- trunk/catalog/admin/includes/header.php 2014-03-12 12:56:32 UTC (rev 5191)
+++ trunk/catalog/admin/includes/header.php 2014-03-13 09:20:34 UTC (rev 5192)
@@ -239,7 +239,7 @@
<?php if($col): ?>
<?php $i=0; foreach($col as $k=>$row):
- if(isset($col2[$k]['edit']) ){
+ if(isset($col2[$k]['edit']) && (!isset($col2[$k]['edit']['reedit']) || $col2[$k]['edit']['reedit'] !=false) ){
echo ' { '
." event: 'click', \n"
."loadtype: 'POST',\n"
Modified: trunk/catalog/admin/includes/javascript/modules/pages/customers.js.php
===================================================================
--- trunk/catalog/admin/includes/javascript/modules/pages/customers.js.php 2014-03-12 12:56:32 UTC (rev 5191)
+++ trunk/catalog/admin/includes/javascript/modules/pages/customers.js.php 2014-03-13 09:20:34 UTC (rev 5192)
@@ -15,12 +15,23 @@
(function(){ // début de scope local
OSCSS_JSCORE.customers = OSCSS_JSCORE.customers || {};
// déclaration de la classe de validation proprement dite
-OSCSS_JSCORE.customers.utlis = {
+OSCSS_JSCORE.customers.utils = {
// déclaration de nos variables statiques
// déclaration de nos méthodes
// Check
+ Init:function( ) {
+
+ $("input#customers_email_address").change(function(){
+ self.isValidRef( $(this) );
+ });
+
+ },
+
+
+ // déclaration de nos méthodes
+ // Check
CheckForm:function( ) {
// onload
@@ -97,7 +108,22 @@
},
+ // Public methode
+ isValidRef:function( $current ) {
+ var stringRef = $current.val();
+ if(stringRef.length <= 1 )
+ return false;
+
+ $.get("<?php echo tep_get_http().DIR_WS_ADMIN .customers::FILENAME ?>",
+ { 'action': "isValidRef", 'forceajax' : true , 'stringref': stringRef },
+ function(data) {
+ $current.replaceWith(data);
+ });
+ return true;
+ },
+
+
/**
Internal methode
*/
@@ -108,13 +134,13 @@
};
// trick JavaScript pour émuler le self:: en PHP : on utilise une variable locale
-var self = OSCSS_JSCORE.customers.utlis;
+var self = OSCSS_JSCORE.customers.utils;
})(); // fin de scope locale
//--></script>
+<?php oscss_cstr::CallBack('OSCSS_JSCORE.customers.utils.Init();'); // Active check key ?>
+<?php oscss_cstr::CallBack('OSCSS_JSCORE.customers.utils.CheckForm();'); // Active check key ?>
-<?php oscss_cstr::CallBack('OSCSS_JSCORE.customers.utlis.CheckForm();'); // Active check key ?>
-
Modified: trunk/catalog/admin/includes/modules/pages/adminAccount.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/adminAccount.php 2014-03-12 12:56:32 UTC (rev 5191)
+++ trunk/catalog/admin/includes/modules/pages/adminAccount.php 2014-03-13 09:20:34 UTC (rev 5192)
@@ -197,9 +197,6 @@
$contents[] = array('class' => 'button_nav', 'text' => tep_image_submit('button_delete.gif', __('image valider')) . ' <a class="button" href="' . tep_href_link(self::FILENAME) . '">' . IMAGE_CANCEL . '</a>');
break;
default:
- parent::$action=self::$action;
- parent::$Info=parent::load_db_values($_SESSION['login_id']);
-
$res='<div id="button_nav">';
if(self::$action !='edit_member')
@@ -208,9 +205,6 @@
$res .= sprintf(CsrtAction::getLink('button_nav', __('update password') ), '', tep_href_link(self::FILENAME, 'action=update_pass') ,'' );
$res .= '</div>';
-
-// $res .= parent::get_right_bar();
-
return $res;
}
Modified: trunk/catalog/admin/includes/modules/pages/customers.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/customers.php 2014-03-12 12:56:32 UTC (rev 5191)
+++ trunk/catalog/admin/includes/modules/pages/customers.php 2014-03-13 09:20:34 UTC (rev 5192)
@@ -13,17 +13,31 @@
require_once(DIR_FS_ADMIN . DIR_WS_CLASSES .'ModTreePage.php');
-
+require_once(DIR_FS_ADMIN . DIR_WS_CLASSES .'listeners/EventMessListener.php');
+error_reporting(E_ALL);
/**
@class customers
*/
class customers
extends ModTreePage /// new abstract class for nextgen module
implements
- InterfaceModule,
- ExtModConfig,
- InterfacedTJsonS,
- InterfacedInnerHtml
+
+ InterfaceModule
+
+ // base module config structure
+ ,ExtModConfig
+
+ // global GetConf methode
+ ,IntModTree
+ // datatable and editable by ajax
+ ,InterfacedTJsonS
+ // detail row in chidls
+ ,InterfacedInnerHtml
+ // use filter generic
+ , FilterTabsData
+
+ // Events Interface for display and exec all notification
+ , EventMessInterface
{
const FILENAME = FILENAME_CUSTOMERS;
@@ -56,11 +70,8 @@
@var bool $error
*/
public static $error=false;
- /**
- @var int Id customers
- */
- public static $Id;
+
public function __construct(){
self::Clean();
self::GetConf();
@@ -69,32 +80,14 @@
public static function GetConf(){
global $languages_id, $conf;
- self::$code=__CLASS__;
- self::$datatype='customer';
-
- self::$action=(isset($_REQUEST['action'])? $_REQUEST['action'] : 'listing' );
- self::$Id=(isset($_REQUEST['cID'])? (int)$_REQUEST['cID'] : 0 );
-
- global $oscss,$language,$lang;
- $oscss->pile_file_lang(DIR_FS_ADMIN.DIR_WS_LANGUAGES.$language.'/'.ucwords('customer').'.txt');
-
-
+ self::PreLoad(__CLASS__, 'customer' , $languages_id);
/**
@remarks Call and init all class required for display, event, process
*/
$DB=Database::getInstance();
//
self::$modules=new AcaFactory('account');
- // Event
- EventsHandlerActive::ActiveForClass(__CLASS__);
- // instancie MLinkTo
- MLinkTo::getInstance(self::$datatype);
- // Set Name in MAster Gab
- MGabCont::SetCurrentName(__CLASS__);
- //
- self::$languages = tep_get_languages();
- // Fix for clean value in unittest loop
- self::$Info = array();
+
/**
@remarks not load if not first init
@@ -113,19 +106,6 @@
}
-
- global $languages_id;
- /**
- @remarks define var execution sql in GetDBValue()
- */
- self::$InitInfo['adjust']=array(
- 'languages_id'=>$languages_id,
- 'page'=>1,
- 'rowbyp'=>10,
- 'sOrder'=>'',
- 'sWhere'=>'',
- );
-
/**
@remarks this define col theader title, and ajust html code
Just for Edit listing
@@ -335,46 +315,48 @@
self::$allfields['ci.customers_info_date_account_created'] = array(
'sort'=>true,
- 'alias'=>'added',
+ 'alias'=>'date_account_created',
'text'=>__('@customers table heading date added'),
'width'=>'8%',
'class'=>'tcenter',
-// 'edit'=>array(
-// 'input_name'=>'customers_info_date_account_created',
-// 'input_size'=>'5',
-// 'reedit'=>false,
-// 'position_col'=>'right',
-// 'position_grp'=>5
-// ),
-
+ 'edit'=>array(
+ 'input_type'=>'date@advanced',
+ 'input_name'=>'date_account_created',
+ 'input_size'=>'10',
+ 'reedit'=>false,
+ 'position_col'=>'right',
+ 'position_grp'=>10
+ ),
);
self::$allfields['ci.customers_info_date_account_last_modified'] = array(
'sort'=>true,
- 'alias'=>'modified',
+ 'alias'=>'date_account_last_modified',
'text'=>__('@customers table heading last modified'),
'width'=>'8%',
'class'=>'tcenter',
-// 'edit'=>array(
-// 'input_name'=>'customers_info_date_account_last_modified',
-// 'input_size'=>'5',
-// 'reedit'=>false,
-// 'position_col'=>'right',
-// 'position_grp'=>5
-// ),
+ 'edit'=>array(
+ 'input_type'=>'date@advanced',
+ 'input_name'=>'date_account_last_modified',
+ 'input_size'=>'10',
+ 'reedit'=>false,
+ 'position_col'=>'right',
+ 'position_grp'=>10
+ ),
);
self::$allfields['ci.customers_info_date_of_last_logon'] = array(
'sort'=>true,
- 'alias'=>'last_logon',
+ 'alias'=>'date_last_logon',
'text'=>__('@customers table heading last logon'),
'class'=>'tright',
'default'=>true,
-// 'edit'=>array(
-// 'input_name'=>'customers_info_date_of_last_logon',
-// 'input_size'=>'20',
-// 'reedit'=>false,
-// 'position_col'=>'right',
-// 'position_grp'=>5
-// ),
+ 'edit'=>array(
+ 'input_type'=>'date@advanced',
+ 'input_name'=>'date_last_logon',
+ 'input_size'=>'10',
+ 'reedit'=>false,
+ 'position_col'=>'right',
+ 'position_grp'=>10
+ ),
);
self::$allfields['ci.customers_info_number_of_logons'] = array(
'sort'=>true,
@@ -456,9 +438,7 @@
)
]
*/
- $tab = array();
- if( count( tep_get_status_array(self::$datatype) ) > 1)
- $tab['generic'][] ='subtype' ;
+ $tab = MLinkTo::GetFilters(self::$datatype );
/**
@remarks this define menu master module in page
@@ -524,7 +504,28 @@
switch (self::$action) {
+
/**
+ @remarks specific Ajax call
+ */
+ case 'update_cell':
+ try {
+ if($_REQUEST['columnName'] == 'customers_email_address'){
+ if( ! sqlcustomer::userTestNotExists($_REQUEST['value']) )
+ throw new Exception(__('email address is already used') ) ;
+ }
+
+ parent::GenericAction();
+
+ }
+ catch (Exception $e) {
+ self::PutMessage(
+ new EventMessListener(__($e->getMessage(), __CLASS__) , 'error')
+ );
+ }
+ break;
+
+ /**
@remarks specific ajax action
*/
@@ -625,7 +626,7 @@
return false;
$testobj = new objectInfo($array['sqlarray']);
-
+// var_dump();
try{
/*
* \brief test user is exists email address in db
@@ -644,16 +645,28 @@
if (!checkdate(substr(tep_date_raw($testobj->customers_dob), 5, 2), substr(tep_date_raw($testobj->customers_dob), 8, 2), substr(tep_date_raw($testobj->customers_dob), 0, 4)))
throw new Exception(__("Le format de la date de naissance n'est pas correct"));
- if (strlen($testobj->customers_email_address) < ENTRY_EMAIL_ADDRESS_MIN_LENGTH) throw new Exception(__("L'adresse email est trop courte, min:").ENTRY_EMAIL_ADDRESS_MIN_LENGTH);
- if (!self::tep_validate_email($testobj->customers_email_address))throw new Exception(ENTRY_EMAIL_ADDRESS_CHECK_ERROR);
+ if (strlen($testobj->customers_email_address) < ENTRY_EMAIL_ADDRESS_MIN_LENGTH)
+ throw new Exception(__("L'adresse email est trop courte, min:").ENTRY_EMAIL_ADDRESS_MIN_LENGTH);
+
+ if (!self::tep_validate_email($testobj->customers_email_address))
+ throw new Exception(ENTRY_EMAIL_ADDRESS_CHECK_ERROR);
+
+ if(self::$Id > 0 && ! sqlcustomer::userTestNotExists($testobj->customers_email_address) )
+ throw new Exception(__('email address is already used') ) ;
+
if (strlen($testobj->customers_telephone) < ENTRY_TELEPHONE_MIN_LENGTH)throw new Exception(__("Le numero de téléphone est trop court"));
}catch(Exception $e){
- $messageStack->add($e->getMessage(), 'error');
- $error=true;
+ $messageStack->add_session($e->getMessage(), 'error');
+
+ if(self::$Id > 0 )
+ tep_redirect(tep_href_link(self::FILENAME, 'cID=' .self::$Id.'&action=edit'));
+ else
+ tep_redirect(tep_href_link(self::FILENAME));
}
+
if(self::$Id <= 0 ){
$array['password']=$mdp=sqlcustomer::randomize();
$array['email']=$array['sqlarray']['customers_email_address'];
@@ -723,7 +736,59 @@
}
break;
+ /**
+ @remarks Test key , by ajax
+ */
+ case 'isValidRef':
+ $ref = tep_db_prepare_input(trim($_REQUEST['stringref']));
+
+ if (strlen($ref) < ENTRY_EMAIL_ADDRESS_MIN_LENGTH){
+ self::$Info['isValidRef'] = false;
+
+ self::PutMessage(
+ new EventMessListener(__('email is too short', __CLASS__) )
+ );
+
+ if(!isset($_GET['forceajax']))
+ tep_redirect(tep_href_link(self::FILENAME, tep_get_all_get_params(array('action','cID'), false).'action=edit' ));
+ }
+// throw new Exception(__("L'adresse email est trop courte, min:").ENTRY_EMAIL_ADDRESS_MIN_LENGTH);
+
+ elseif (!self::tep_validate_email($ref)){
+ self::$Info['isValidRef'] = false;
+
+ self::PutMessage(
+ new EventMessListener(__('email is valid', __CLASS__) )
+ );
+
+ if(!isset($_GET['forceajax']))
+ tep_redirect(tep_href_link(self::FILENAME, tep_get_all_get_params(array('action','cID'), false).'action=edit' ));
+ }
+// throw new Exception(ENTRY_EMAIL_ADDRESS_CHECK_ERROR);
+
+ elseif( sqlcustomer::userTestNotExists($ref) === true){
+ self::$Info['isValidRef'] = true;
+
+ self::PutMessage(
+ new EventMessListener(__('email is valid', __CLASS__) , 'success')
+ );
+
+ if(!isset($_GET['forceajax']))
+ tep_redirect(tep_href_link(self::FILENAME, tep_get_all_get_params(array('action','cID'), false).'action=edit' ));
+ }
+ else{
+ self::$Info['isValidRef'] = false;
+
+ self::PutMessage(
+ new EventMessListener(__('email is already used', __CLASS__) )
+ );
+
+
+ if(!isset($_GET['forceajax']))
+ tep_redirect(tep_href_link(self::FILENAME));
+ }
+ break;
default:
parent::GenericAction();
}
@@ -758,7 +823,7 @@
$action=self::$action;
-
+// var_dump(self::$Id);
switch ($action) {
@@ -868,7 +933,20 @@
case 'setflagda':
return self::GenericRowsFlag(self::$Id, 'group_ra', 'setflagda');/// RowStatusDa(array('group_ra'=>(int)$_GET['flag'], 'id'=>(int)self::$Id));
break;
+ /**
+ @remarks Ajax View result
+ */
+ case 'isValidRef':
+ $stringref = tep_db_prepare_input($_REQUEST['stringref']) ;
+ if( ! (bool)self::$list['isValidRef'])
+ $print = tep_draw_input_field('customers_email_address', '', (string)$stringref , '');
+ else
+ $print = $stringref. tep_draw_hidden_field('customers_email_address', '', (string)$stringref, ' ');
+
+ return $print;
+ break;
+
/**
@remarks Normal View Page
*/
@@ -879,12 +957,8 @@
}
- if( ! empty($action) ){
- if($MG)
- return MGabCont::CallGab($action,__FUNCTION__,self::MASTER);
- else
- return MGabCont::CallGab($action,__FUNCTION__,__CLASS__);
- }
+ if( ! empty($action) )
+ return MGabCont::CallGab($action,__FUNCTION__, ( ($MG) ? self::MASTER : __CLASS__ ) );
}
@@ -925,10 +999,6 @@
}
- /** Interne module */
-// public static function tep_view_news_human($value){
-// return ($value == '1')? __('entry newsletter yes') : ('entry newsletter no') ;
-// }
/**
@param string $value
@@ -943,20 +1013,7 @@
-
/**
- * \fn userTestNotExists($customers_email_address)
- * \brief test user exists
- * @param $customers_email_address
- */
-// static public function userTestNotExists($customers_email_address){
-// $check_email = tep_db_query("select customers_email_address from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($customers_email_address) . "' ");
-// return (tep_db_num_rows($check_email))? false : true ;
-// }
-
-
-
- /**
@brief format db value for display page
@param $_query ressource db sql
@return array
@@ -994,9 +1051,6 @@
$ord[$k]=$item[$k];
}
-
-
-
$res[]=$ord;
}
break;
Modified: trunk/catalog/templates/defaut/includes/gabarit/checkout/payment_address.gab
===================================================================
--- trunk/catalog/templates/defaut/includes/gabarit/checkout/payment_address.gab 2014-03-12 12:56:32 UTC (rev 5191)
+++ trunk/catalog/templates/defaut/includes/gabarit/checkout/payment_address.gab 2014-03-13 09:20:34 UTC (rev 5192)
@@ -9,7 +9,7 @@
@file payment_address.gab
@dir templstes/defaut/includes/gabarit/checkout/
*/
-global $page,$customer_id, $sendto, $quotes, $currencies, $cart,$addresses_count,$addresses_query;
+global $page,$customer_id, $billto, $quotes, $currencies, $cart,$addresses_count,$addresses_query;
?>
<div id="checkoutPaymentAddress" >
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2014-03-12 12:56:38
|
Revision: 5191
http://sourceforge.net/p/oscss/svn/5191
Author: oscim
Date: 2014-03-12 12:56:32 +0000 (Wed, 12 Mar 2014)
Log Message:
-----------
Fix
Modified Paths:
--------------
trunk/catalog/Documents/oscss.version.xml
trunk/catalog/install/includes/sql/mysql/data/40_osc_content.sql
trunk/catalog/install/includes/sql/mysql/data/91_osc_content_description.sql
trunk/catalog/install/includes/sql/mysql/data/92_osc_content_to_categories.sql
Modified: trunk/catalog/Documents/oscss.version.xml
===================================================================
--- trunk/catalog/Documents/oscss.version.xml 2014-03-12 10:51:23 UTC (rev 5190)
+++ trunk/catalog/Documents/oscss.version.xml 2014-03-12 12:56:32 UTC (rev 5191)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<core>
<version>2.2.0</version>
- <svn>5167</svn>
+ <svn>5191</svn>
<level>unstable</level>
<template_admin>oscss</template_admin>
Modified: trunk/catalog/install/includes/sql/mysql/data/40_osc_content.sql
===================================================================
--- trunk/catalog/install/includes/sql/mysql/data/40_osc_content.sql 2014-03-12 10:51:23 UTC (rev 5190)
+++ trunk/catalog/install/includes/sql/mysql/data/40_osc_content.sql 2014-03-12 12:56:32 UTC (rev 5191)
@@ -20,4 +20,5 @@
insert into osc_content (content_id, content_type,content_name, date_added, last_modified, content_status) values ('6', 2, 'Page_account_created_but_confirm', NOW(), NULL, '1');
insert into osc_content (content_id, content_type,content_name, date_added, last_modified, content_status) values ('7', 2, 'Page_account_created', NOW(), NULL, '1');
insert into osc_content (content_id, content_type,content_name, date_added, last_modified, content_status) values ('8', 2, 'text_search_help', NOW(), NULL, '1');
+insert into osc_content (content_id, content_type,content_name, date_added, last_modified, content_status) values ('9', 2, 'Page_home', NOW(), NULL, '1');
Modified: trunk/catalog/install/includes/sql/mysql/data/91_osc_content_description.sql
===================================================================
--- trunk/catalog/install/includes/sql/mysql/data/91_osc_content_description.sql 2014-03-12 10:51:23 UTC (rev 5190)
+++ trunk/catalog/install/includes/sql/mysql/data/91_osc_content_description.sql 2014-03-12 12:56:32 UTC (rev 5191)
@@ -13,13 +13,14 @@
-insert into osc_content_description (content_id, content_title, content_text, language_id) values ('1', 'OSC_CONTENT_DESCRIPTION_SHIPPING_T', 'OSC_CONTENT_DESCRIPTION_SHIPPING_D', '1');
-insert into osc_content_description (content_id, content_title, content_text, language_id) values ('2', 'OSC_CONTENT_DESCRIPTION_PRIVACY_T', 'OSC_CONTENT_DESCRIPTION_PRIVACY_D', '1');
-insert into osc_content_description (content_id, content_title, content_text, language_id) values ('3', 'OSC_CONTENT_DESCRIPTION_CONDITIONS_T', 'OSC_CONTENT_DESCRIPTION_CONDITIONS_D', '1');
-insert into osc_content_description (content_id, content_title, content_text, language_id) values ('4', 'OSC_CONTENT_DESCRIPTION_CONTACT_T', 'OSC_CONTENT_DESCRIPTION_CONTACT_D', '1');
-insert into osc_content_description (content_id, content_title, content_text, language_id) values ('5', '', '', '1');
-insert into osc_content_description (content_id, content_title, content_text, language_id) values ('6', '', '', '1');
-insert into osc_content_description (content_id, content_title, content_text, language_id) values ('7', '', '', '1');
-insert into osc_content_description (content_id, content_title, content_text, language_id) values ('8', '', '', '1');
+insert into osc_content_description (content_id,content_type, content_title, content_text, language_id) values ('1', 2, 'OSC_CONTENT_DESCRIPTION_SHIPPING_T', 'OSC_CONTENT_DESCRIPTION_SHIPPING_D', '1');
+insert into osc_content_description (content_id,content_type, content_title, content_text, language_id) values ('2', 2, 'OSC_CONTENT_DESCRIPTION_PRIVACY_T', 'OSC_CONTENT_DESCRIPTION_PRIVACY_D', '1');
+insert into osc_content_description (content_id,content_type, content_title, content_text, language_id) values ('3', 2, 'OSC_CONTENT_DESCRIPTION_CONDITIONS_T', 'OSC_CONTENT_DESCRIPTION_CONDITIONS_D', '1');
+insert into osc_content_description (content_id,content_type, content_title, content_text, language_id) values ('4', 2, 'OSC_CONTENT_DESCRIPTION_CONTACT_T', 'OSC_CONTENT_DESCRIPTION_CONTACT_D', '1');
+insert into osc_content_description (content_id,content_type, content_title, content_text, language_id) values ('5', 2, '', '', '1');
+insert into osc_content_description (content_id,content_type, content_title, content_text, language_id) values ('6', 2, '', '', '1');
+insert into osc_content_description (content_id,content_type, content_title, content_text, language_id) values ('7', 2, '', '', '1');
+insert into osc_content_description (content_id,content_type, content_title, content_text, language_id) values ('8', 2, '', '', '1');
+insert into osc_content_description (content_id,content_type, content_title, content_text, language_id) values ('9', 2, 'OSC_CONTENT_DESCRIPTION_HOME_T', 'OSC_CONTENT_DESCRIPTION_HOME_D', '1');
Modified: trunk/catalog/install/includes/sql/mysql/data/92_osc_content_to_categories.sql
===================================================================
--- trunk/catalog/install/includes/sql/mysql/data/92_osc_content_to_categories.sql 2014-03-12 10:51:23 UTC (rev 5190)
+++ trunk/catalog/install/includes/sql/mysql/data/92_osc_content_to_categories.sql 2014-03-12 12:56:32 UTC (rev 5191)
@@ -17,5 +17,7 @@
insert into osc_content_to_categories (content_id, categories_id) values ('5', '2');
insert into osc_content_to_categories (content_id, categories_id) values ('6', '2');
insert into osc_content_to_categories (content_id, categories_id) values ('7', '2');
+insert into osc_content_to_categories (content_id, categories_id) values ('8', '2');
+insert into osc_content_to_categories (content_id, categories_id) values ('9', '2');
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2014-03-12 10:51:26
|
Revision: 5190
http://sourceforge.net/p/oscss/svn/5190
Author: oscim
Date: 2014-03-12 10:51:23 +0000 (Wed, 12 Mar 2014)
Log Message:
-----------
Fix
Modified Paths:
--------------
trunk/catalog/admin/includes/modules/pages/customers.php
trunk/test/phpunit/Back/modules/pages/pagecustomersTest.php
Added Paths:
-----------
trunk/test/phpunit/Back/modules/pages/pagenewsletterModeleTest.php
Modified: trunk/catalog/admin/includes/modules/pages/customers.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/customers.php 2014-03-12 10:43:13 UTC (rev 5189)
+++ trunk/catalog/admin/includes/modules/pages/customers.php 2014-03-12 10:51:23 UTC (rev 5190)
@@ -926,9 +926,9 @@
/** Interne module */
- public static function tep_view_news_human($value){
- return ($value == '1')? __('entry newsletter yes') : ('entry newsletter no') ;
- }
+// public static function tep_view_news_human($value){
+// return ($value == '1')? __('entry newsletter yes') : ('entry newsletter no') ;
+// }
/**
@param string $value
@@ -949,10 +949,10 @@
* \brief test user exists
* @param $customers_email_address
*/
- static public function userTestNotExists($customers_email_address){
- $check_email = tep_db_query("select customers_email_address from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($customers_email_address) . "' ");
- return (tep_db_num_rows($check_email))? false : true ;
- }
+// static public function userTestNotExists($customers_email_address){
+// $check_email = tep_db_query("select customers_email_address from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($customers_email_address) . "' ");
+// return (tep_db_num_rows($check_email))? false : true ;
+// }
Modified: trunk/test/phpunit/Back/modules/pages/pagecustomersTest.php
===================================================================
--- trunk/test/phpunit/Back/modules/pages/pagecustomersTest.php 2014-03-12 10:43:13 UTC (rev 5189)
+++ trunk/test/phpunit/Back/modules/pages/pagecustomersTest.php 2014-03-12 10:51:23 UTC (rev 5190)
@@ -167,8 +167,9 @@
$this->CheckAction($objtmp);
$res = ob_get_contents();
ob_end_clean();
- $this->assertTrue ( ( strlen($res) > 100) , 'Error retrun action::'.$action ) ;
+ $this->assertTrue ( ( strlen($res) == 0) , 'Error retrun action::'.$action ) ;
+
}
/**
@@ -184,7 +185,12 @@
$action = 'new';
$get = array();
$res = $this->CallGetDBValue($objtmp,$action, $get);
- $res = $this->CheckAction($objtmp);
+
+ ob_start();
+ $this->CheckAction($objtmp);
+ $res = ob_get_contents();
+ ob_end_clean();
+
$this->assertTrue ( ( strlen($res) > 700) , 'Error retrun action::'.$action ) ;
}
@@ -207,6 +213,7 @@
$this->assertTrue ( ( strlen($res) > 1600) , 'Error retrun action::'.$action ) ;
}
+
/**
@brief test display form edit
@param $objtmp object result testcustomersConf
Added: trunk/test/phpunit/Back/modules/pages/pagenewsletterModeleTest.php
===================================================================
--- trunk/test/phpunit/Back/modules/pages/pagenewsletterModeleTest.php (rev 0)
+++ trunk/test/phpunit/Back/modules/pages/pagenewsletterModeleTest.php 2014-03-12 10:51:23 UTC (rev 5190)
@@ -0,0 +1,201 @@
+<?php
+/**
+ * \file test/phpunit/Back/currencieTest.php
+ * \brief test unitaire class currencie Backoffice
+ * \remarks To run this script as CLI: phpunit filename.php
+ * \author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ */
+
+// specific for test
+require_once(substr( dirname(__FILE__), 0, -14).'/_top.php');
+
+require_once(substr( dirname(__FILE__), 0, -14).'/_topDisplay.php');
+
+global $base_path;
+
+
+
+
+include_once($base_path.'includes/modules/pages/newslettersModeles.php');
+
+
+
+/**
+ * \class currencieTest
+ */
+class pagenewsletterModeleTest
+ extends PHPUnit_Framework_TestCase
+{
+
+ /**
+ @var int
+ */
+ static public $Id;
+
+ function __construct()
+ {
+
+ }
+
+ /**
+ @brief test methode conf and static vars
+ */
+ public function testcurrencieConf(){
+
+ $objtmp = new newslettersModeles();
+
+ $this->assertTrue ( ( is_array(newslettersModeles::$InitInfo) && count(newslettersModeles::$InitInfo)>0 ) , 'Error InitInfo is not array' ) ;
+
+ // count
+
+ return $objtmp;
+ }
+
+
+ /**
+ @brief test methode GetDBValue
+ @depends testcurrencieConf
+ */
+ public function testnewslettersModelesGetDBValue($objtmp){
+
+ $action = 'listing';
+ $get = array();
+
+ $res = $this-> CallGetDBValue($objtmp,$action, $get);
+
+ $this->assertTrue ( ( is_array($res) ) , 'Error GetDBValue listing' ) ;
+
+
+ $action = 'edit';
+ $get = array();
+ $get['cID'] = 1;
+
+ $res = $this-> CallGetDBValue($objtmp,$action, $get);
+
+ $this->assertTrue ( ( is_object($res) ) , 'Error GetDBValue edit' ) ;
+
+ $action = 'delete';
+ $get = array();
+ $get['cID'] = 1;
+
+ $res = $this-> CallGetDBValue($objtmp,$action, $get);
+
+ $this->assertTrue ( ( is_object($res) ) , 'Error GetDBValue delete' ) ;
+
+
+ return $objtmp;
+ }
+
+
+ /**
+ @brief test display flag action
+ @depends testnewslettersModelesGetDBValue
+ */
+ public function testnewslettersModelesPrintFlag($objtmp){
+
+ $action = 'setflag';
+ $get = array();
+ $get['flag'] = 1;
+ $get['cID'] = 1;
+ $get['forceajax'] = 1;
+
+ $res = $this-> CallGetDBValue($objtmp,$action, $get);
+
+ ob_start();
+ $this->CheckAction($objtmp);
+ $res = ob_get_contents();
+ ob_end_clean();
+
+
+ $this->assertTrue ( ( strlen($res) >150) , 'Error retrun action::'.$action) ;
+
+ }
+
+ /**
+ @brief test display form new customers
+ @depends testnewslettersModelesGetDBValue
+ */
+ public function testnewslettersModelesPrintNew($objtmp){
+
+ $action = 'new';
+ $get = array();
+
+ $res = $this-> CallGetDBValue($objtmp,$action, $get);
+
+ $res = $this->CheckAction($objtmp);
+ $this->assertTrue ( ( strlen($res) > 700) , 'Error retrun action::'.$action ) ;
+
+ }
+
+ /**
+ @brief test display form edit
+ @depends testnewslettersModelesGetDBValue
+ */
+ public function testnewslettersModelesPrintEdit($objtmp){
+
+
+ $action = 'edit';
+ $get = array();
+ $get['cID'] = 1;
+
+ $res = $this-> CallGetDBValue($objtmp,$action, $get);
+
+ $res = $this->CheckAction($objtmp);
+ $this->assertTrue ( ( strlen($res) > 1600) , 'Error retrun action::'.$action ) ;
+ }
+
+ /**
+ @brief test display form edit
+ @depends testnewslettersModelesGetDBValue
+ */
+ public function testnewslettersModelesPrintDelete($objtmp){
+
+
+ $action = 'delete';
+ $get = array();
+ $get['cID'] = 1;
+ $get['forceajax'] = 1;
+
+ $res = $this-> CallGetDBValue($objtmp,$action, $get);
+
+ $res = $this->CheckAction($objtmp);
+ $this->assertTrue ( ( strlen($res) > 630) , 'Error retrun action::'.$action ) ;
+ }
+
+
+
+
+ /**
+ @brief
+ */
+ public function CheckAction($objtmp){
+
+ $res = $objtmp->display_view();
+
+ return $res;
+ }
+
+ /**
+ @brief
+ */
+ public function CallGetDBValue($objtmp,$action, $get){
+
+
+ foreach($get as $k=>$v)
+ $_GET[$k] = $v;
+
+ newslettersModeles::Clean();
+ newslettersModeles::GetConf();
+
+
+ newslettersModeles::$action = $action;
+
+ $objtmp->check_action($action);
+
+ $res = newslettersModeles::GetDBValue();
+ return $res;
+ }
+
+}
+
+?>
\ 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...> - 2014-03-12 10:43:17
|
Revision: 5189
http://sourceforge.net/p/oscss/svn/5189
Author: oscim
Date: 2014-03-12 10:43:13 +0000 (Wed, 12 Mar 2014)
Log Message:
-----------
Fix
Add Unittest
Modified Paths:
--------------
trunk/catalog/admin/includes/classes/drivers/sqlcustomer.php
trunk/catalog/admin/includes/modules/pages/customers.php
trunk/catalog/admin/includes/modules/pages/newslettersModeles.php
trunk/catalog/install/includes/sql/mysql/data/20_osc_status.sql
Modified: trunk/catalog/admin/includes/classes/drivers/sqlcustomer.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlcustomer.php 2014-03-11 17:13:16 UTC (rev 5188)
+++ trunk/catalog/admin/includes/classes/drivers/sqlcustomer.php 2014-03-12 10:43:13 UTC (rev 5189)
@@ -341,9 +341,11 @@
new self();
$par = array(
- 'customers_id' => '',
+ 'customers_id' => 0,
- 'customers_gender' => '',
+ 'customers_type' => 1,
+
+ 'customers_gender' => 'm',
'customers_firstname' => '',
'customers_lastname' => '',
'customers_email_address' => '',
@@ -357,7 +359,7 @@
'customers_discount' => '',
'customers_shopping_points' => '',
- 'customers_balance_account' => '',
+ 'customers_balance_account' => 0,
'customers_default_address_id' => '',
Modified: trunk/catalog/admin/includes/modules/pages/customers.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/customers.php 2014-03-11 17:13:16 UTC (rev 5188)
+++ trunk/catalog/admin/includes/modules/pages/customers.php 2014-03-12 10:43:13 UTC (rev 5189)
@@ -145,7 +145,16 @@
'text'=>__('@customers table heading type'),
'class'=>'tcenter',
'width'=>'4%',
-
+ 'edit'=>array(
+ 'input_name'=>'customers_type',
+ 'input_type'=>'select',
+ 'class'=>'tleft',
+ 'input_size'=>'1',
+ 'required_status'=>true,
+ 'select_values'=>tep_get_status_array(self::$datatype,0,'status_name'),
+ 'position_col'=>'right',
+ 'position_grp'=>5
+ ),
),
"CONCAT(customers_firstname, ' ', customers_lastname)" => array(
'sort'=>true,
Modified: trunk/catalog/admin/includes/modules/pages/newslettersModeles.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/newslettersModeles.php 2014-03-11 17:13:16 UTC (rev 5188)
+++ trunk/catalog/admin/includes/modules/pages/newslettersModeles.php 2014-03-12 10:43:13 UTC (rev 5189)
@@ -62,24 +62,26 @@
global $languages_id;
self::$code=__CLASS__;
- self::$datatype='newsletters_modeles';
-
-
- self::$action=(isset($_REQUEST['action'])? $_REQUEST['action'] : 'listing' );
- self::$Id=(isset($_REQUEST['cID'])? (int)$_REQUEST['cID'] : 0 );
-
- // aca
- self::$modules=new AcaFactory(__CLASS__);
- // Event
- EventsHandlerActive::ActiveForClass(__CLASS__);
- // instancie MLinkTo
- MLinkTo::getInstance(self::$datatype);
- // Set Name in MAster Gab
- MGabCont::SetCurrentName(__CLASS__);
- //
- self::$languages = tep_get_languages();
+// self::$datatype='newsletters_modeles';
+//
+//
+// self::$action=(isset($_REQUEST['action'])? $_REQUEST['action'] : 'listing' );
+// self::$Id=(isset($_REQUEST['cID'])? (int)$_REQUEST['cID'] : 0 );
+//
+// // aca
+// self::$modules=new AcaFactory(__CLASS__);
+// // Event
+// EventsHandlerActive::ActiveForClass(__CLASS__);
+// // instancie MLinkTo
+// MLinkTo::getInstance(self::$datatype);
+// // Set Name in MAster Gab
+// MGabCont::SetCurrentName(__CLASS__);
+// //
+// self::$languages = tep_get_languages();
+ self::PreLoad(__CLASS__, 'newsletters_modeles' , $languages_id);
+
/**
@remarks not load if not first init
*/
@@ -98,20 +100,20 @@
/**
@remarks define var execution sql in GetDBValue()
*/
- self::$InitInfo['adjust']=array(
- 'languages_id'=>$languages_id,
- 'page'=>1,
- 'rowbyp'=>10,
- 'sOrder'=>'',
- 'sWhere'=>'',
- );
+// self::$InitInfo['adjust']=array(
+// 'languages_id'=>$languages_id,
+// 'page'=>1,
+// 'rowbyp'=>10,
+// 'sOrder'=>'',
+// 'sWhere'=>'',
+// );
/**
@remarks this define col theader title, and ajust html code
Just for Edit listing
*/
- self::$allfields = array();
+// self::$allfields = array();
self::$allfields['nm.nmodele_id'] = array(
'sort'=>true,
@@ -243,7 +245,7 @@
)
]
*/
- $tab = array();
+ $tab = MLinkTo::GetFilters(self::$datatype );
/**
@remarks this define menu master module in page
@@ -291,18 +293,18 @@
switch (self::$action) {
- case 'setflag':
- if ( ($_GET['flag'] == '0') || ($_GET['flag'] == '1') ) {
- if (self::$Id > 0)
- sqlnewsletters_modeles::update(array('id'=> (int)self::$Id , 'post'=>array('status'=>(int) $_GET['flag'] )));
- }
+// case 'setflag':
+// if ( ($_GET['flag'] == '0') || ($_GET['flag'] == '1') ) {
+// if (self::$Id > 0)
+// sqlnewsletters_modeles::update(array('id'=> (int)self::$Id , 'post'=>array('status'=>(int) $_GET['flag'] )));
+// }
+//
+// $messageStack->add(__('@newslettersModeles update status'), 'success');
+//
+// if(!isset($_GET['forceajax']))
+// tep_redirect(tep_href_link(self::FILENAME, 'cID=' .self::$Id));
+// break;
- $messageStack->add(__('@newslettersModeles update status'), 'success');
-
- if(!isset($_GET['forceajax']))
- tep_redirect(tep_href_link(self::FILENAME, 'cID=' .self::$Id));
- break;
-
/**
@remarks Normal page
*/
@@ -443,12 +445,6 @@
$action=self::$action;
$MG = true;
switch ($action) {
- /**
- @remarks Ajax View result
- */
- case 'setflag':
- return self::RowStatus(array('status'=>(int)$_GET['flag'], 'nmodele_id'=>(int)self::$Id));
- break;
/**
@remarks Normal View Page
@@ -584,23 +580,23 @@
/**
Nombre d'envoi a effectué
*/
- public function count_send(){
- $DB=Database::getInstance();
- $mail_query = $DB->query("SELECT COUNT(*) as count FROM " . TABLE_CUSTOMERS . " WHERE customers_newsletter = '1' ");
- $mail = $mail_query->fetchAssoc();
- return $mail['count'];
- }
+// public function count_send(){
+// $DB=Database::getInstance();
+// $mail_query = $DB->query("SELECT COUNT(*) as count FROM " . TABLE_CUSTOMERS . " WHERE customers_newsletter = '1' ");
+// $mail = $mail_query->fetchAssoc();
+// return $mail['count'];
+// }
/**
Nombre d'envoi deja effetué
@a int nmodele_id
*/
- public static function count_sended_ok($nmodele_id, $code){
- $DB=Database::getInstance();
- $mail_query = $DB->query($sql="SELECT COUNT(*) AS count FROM ".TABLE_NEWSLETTERS_MODELES_SENT." WHERE nmodele_id = '" . $nmodele_id. "' AND module_type='".$code."' ");
- $mail = $mail_query->fetchAssoc();
- return $mail['count'];
- }
+// public static function count_sended_ok($nmodele_id, $code){
+// $DB=Database::getInstance();
+// $mail_query = $DB->query($sql="SELECT COUNT(*) AS count FROM ".TABLE_NEWSLETTERS_MODELES_SENT." WHERE nmodele_id = '" . $nmodele_id. "' AND module_type='".$code."' ");
+// $mail = $mail_query->fetchAssoc();
+// return $mail['count'];
+// }
}
?>
\ No newline at end of file
Modified: trunk/catalog/install/includes/sql/mysql/data/20_osc_status.sql
===================================================================
--- trunk/catalog/install/includes/sql/mysql/data/20_osc_status.sql 2014-03-11 17:13:16 UTC (rev 5188)
+++ trunk/catalog/install/includes/sql/mysql/data/20_osc_status.sql 2014-03-12 10:43:13 UTC (rev 5189)
@@ -78,5 +78,6 @@
INSERT IGNORE INTO osc_status (status_id, status_type, language_id, status_name, status_color) VALUES (2, 'shipping_progress', 1, 'OSC_SHIPPING_TRANSMITTED_CARRIER', '');
INSERT IGNORE INTO osc_status (status_id, status_type, language_id, status_name, status_color) VALUES (3, 'shipping_progress', 1, 'OSC_SHIPPING_LIVERY', '');
-INSERT IGNORE INTO osc_status (status_id, status_type, language_id, status_name, status_color) VALUES (1, 'customers', 1, 'OSC_CUSTOMERS_PERSO', '');
-INSERT IGNORE INTO osc_status (status_id, status_type, language_id, status_name, status_color) VALUES (2, 'customers', 1, 'OSC_CUSTOMERS_PRO', '');
+INSERT IGNORE INTO osc_status (status_id, status_type, language_id, status_name, status_color) VALUES (1, 'customer', 1, 'OSC_CUSTOMERS_PERSO', '');
+INSERT IGNORE INTO osc_status (status_id, status_type, language_id, status_name, status_color) VALUES (2, 'customer', 1, 'OSC_CUSTOMERS_PRO', '');
+INSERT IGNORE INTO osc_status (status_id, status_type, language_id, status_name, status_color) VALUES (3, 'customer', 1, 'OSC_CUSTOMERS_EMAILLING', '');
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2014-03-11 17:13:19
|
Revision: 5188
http://sourceforge.net/p/oscss/svn/5188
Author: oscim
Date: 2014-03-11 17:13:16 +0000 (Tue, 11 Mar 2014)
Log Message:
-----------
Fix
Modified Paths:
--------------
trunk/catalog/admin/includes/classes/drivers/sqlorder.php
trunk/catalog/admin/includes/classes/productUtility.php
trunk/catalog/admin/includes/gabarit/adminGroup/edit.tab.acl.gab
trunk/catalog/admin/includes/modules/pages/orders.php
trunk/catalog/common/classes/datatype_drivers/Data_home.php
trunk/catalog/common/classes/notification.php
trunk/catalog/includes/classes/core_page/customer.php
trunk/catalog/includes/languages/fr_FR/modeles/email/mouton/password_forgotten.txt
trunk/catalog/templates/defaut/includes/gabarit/account/password.gab
Modified: trunk/catalog/admin/includes/classes/drivers/sqlorder.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlorder.php 2014-03-10 14:14:50 UTC (rev 5187)
+++ trunk/catalog/admin/includes/classes/drivers/sqlorder.php 2014-03-11 17:13:16 UTC (rev 5188)
@@ -377,8 +377,6 @@
$ID = $option['id'];
}
- error_reporting(E_ALL);
-// exit;
// if( ! isset($option['language_id']) )
// self::$error = __('no language_id');
// else
@@ -432,8 +430,11 @@
)
*/
public static function delete($option){
+
$DB=Database::getInstance();
-
+ $error = 0;
+
+
$sql ="";
if(isset($option['id'])){
$_oID = tep_db_prepare_input($option['id']);
@@ -452,27 +453,54 @@
$cid = $check['customers_id'];
}
+ if($cid<=0)
+ return false;
+
+ $DB->beginTransaction();
if(isset($option['restock']))
- tep_products_restock($_oID,$cid);
+ if( ! tep_products_restock($_oID,$cid) )
+ $error++;
- if(isset($option['del_shipping']))
- sqlshipping::delete(array('orders_id'=>$_oID));
+ if($error ==0 && isset($option['del_shipping']))
+ if( ! sqlshipping::delete(array('orders_id'=>$_oID)) )
+ $error++;
- if(isset($option['del_services']))
- sqlservices::delete(array('orders_id'=>$_oID));
+ if( $error ==0 && isset($option['del_services']))
+ if( ! sqlservices::delete(array('orders_id'=>$_oID)) )
+ $error++;
$sql = substr($sql,3);
- $DB->query("delete from " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " where ".$sql);
- $DB->query("delete from " . TABLE_ORDERS_PRODUCTS . " where ".$sql);
- $DB->query("delete from " . TABLE_ORDERS_STATUS_HISTORY . " where ".$sql);
- $DB->query("delete from " . TABLE_ORDERS_TOTAL . " where ".$sql);
+ $_sql = "delete from " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " where ".$sql;
+ if( $error ==0 && !$DB->query($_sql) )
+ $error++;
- $res= $DB->query("delete from " . TABLE_ORDERS . " where ".$sql);
+ $_sql = "delete from " . TABLE_ORDERS_PRODUCTS . " where ".$sql;
+ if( $error ==0 && !$DB->query($_sql) )
+ $error++;
+
+ $_sql = "delete from " . TABLE_ORDERS_STATUS_HISTORY . " where ".$sql;
+ if( $error ==0 && !$DB->query($_sql) )
+ $error++;
+
+ $_sql = "delete from " . TABLE_ORDERS_TOTAL . " where ".$sql;
+ if( $error ==0 && !$DB->query($_sql) )
+ $error++;
+
+ $_sql = "delete from " . TABLE_ORDERS . " where ".$sql;
+ if( $error ==0 && !$DB->query($_sql) )
+ $error++;
- return $res;
+ if( $error > 0){
+ $DB->rollbackTransaction();
+ return false;
+ }
+ else{
+ $DB->commitTransaction();
+ return 1;
+ }
}
/**
Modified: trunk/catalog/admin/includes/classes/productUtility.php
===================================================================
--- trunk/catalog/admin/includes/classes/productUtility.php 2014-03-10 14:14:50 UTC (rev 5187)
+++ trunk/catalog/admin/includes/classes/productUtility.php 2014-03-11 17:13:16 UTC (rev 5188)
@@ -307,6 +307,8 @@
$products_modules->products_restock($order['products_id'],$customers_id,$order['products_quantity'],($order['products_quantity'] *$order['final_price'] ) );
}
}
+
+ return true;
}
}
Modified: trunk/catalog/admin/includes/gabarit/adminGroup/edit.tab.acl.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/adminGroup/edit.tab.acl.gab 2014-03-10 14:14:50 UTC (rev 5187)
+++ trunk/catalog/admin/includes/gabarit/adminGroup/edit.tab.acl.gab 2014-03-11 17:13:16 UTC (rev 5188)
@@ -52,7 +52,7 @@
}
?>
<tr class="dataTableRowBoxes" id="afi_<?php echo $group_boxes['admin_boxes_id'] ?>">
- <td width="40"><?php echo adminGroup::status_flag($checked,'action=setflagpage&gID='.adminGroup::$Id.'&admin_boxes_id='.$group_boxes['file']); ?></td>
+ <td width="40"><?php echo adminGroup::status_flag($checked,'action=setflagpage&cID='.adminGroup::$Id.'&admin_boxes_id='.$group_boxes['file']); ?></td>
<td><b><?php echo ucwords($group_boxes['admin_boxes_name']) . ' ' . tep_draw_hidden_field('checked_' . $group_boxes['admin_boxes_id'], '', $checkedBox) . tep_draw_hidden_field('unchecked_' . $group_boxes['admin_boxes_id'], '', $uncheckedBox); ?></b></td>
</tr>
<tr class="dataTableRow">
Modified: trunk/catalog/admin/includes/modules/pages/orders.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/orders.php 2014-03-10 14:14:50 UTC (rev 5187)
+++ trunk/catalog/admin/includes/modules/pages/orders.php 2014-03-11 17:13:16 UTC (rev 5188)
@@ -637,7 +637,7 @@
@remarks Update status Orders
*/
case 'update_order':
- $cID=(int)$_GET['cID'];
+ $cID=(int)self::$Id;
$status = tep_db_prepare_input($_POST['status']);
if (up_status_order($cID, $status , $_POST) ){
// $messageStack->add_session(__('success order updated'), 'success');
@@ -687,7 +687,7 @@
*/
case 'deleteconfirm':
- $param = array('id'=>(int)$_GET['cID']);
+ $param = array('id'=>(int)self::$Id);
if(isset($_POST['restock'])) $param['restock'] = true;
if(isset($_POST['delete_shipping'])) $param['del_shipping'] = true;
@@ -711,7 +711,7 @@
if(!isset($_POST['address']) || !is_array($_POST['address']))
return false;
- $cID=(int)$_GET['cID'];
+ $cID=(int)self::$Id;
$type=(string)tep_db_input($_GET['address']);
if(!self::test_cID((int)self::$Id))
@@ -745,7 +745,7 @@
if(!isset($_POST['mod']) || !is_array($_POST['mod']))
return false;
- $cID=(int)$_GET['cID'];
+ $cID=(int)self::$Id;
$type=(string)tep_db_input($_GET['mod']);
if(!self::test_cID((int)self::$Id))
@@ -774,7 +774,7 @@
*/
case 'shipping':
- $cID=(int)$_GET['cID'];
+ $cID=(int)self::$Id;
$track=(string)tep_db_prepare_input($_POST['shipping_tracing_number']);
$trackurl=(string)tep_db_prepare_input($_POST['shipping_tracing_url']);
@@ -837,7 +837,7 @@
*/
case 'setflag':
$redirect = false;
- if (isset($_GET['sID'])){
+ if ((int)self::$Id > 0){
/// Activate / Desactivate
if (isset($_GET['flag']) && ( ($_GET['flag'] == '0') || ($_GET['flag'] == '1') ) ) {
Modified: trunk/catalog/common/classes/datatype_drivers/Data_home.php
===================================================================
--- trunk/catalog/common/classes/datatype_drivers/Data_home.php 2014-03-10 14:14:50 UTC (rev 5187)
+++ trunk/catalog/common/classes/datatype_drivers/Data_home.php 2014-03-11 17:13:16 UTC (rev 5188)
@@ -14,6 +14,9 @@
@note depend class AbstractHeader_tags fgor priority of home.
*/
+
+require_once( DIR_FS_CATALOG . DIR_WS_COMMON_CLASSES . '/AbstractHeader_tags.php');
+
class Data_home
implements
DataTypesData
Modified: trunk/catalog/common/classes/notification.php
===================================================================
--- trunk/catalog/common/classes/notification.php 2014-03-10 14:14:50 UTC (rev 5187)
+++ trunk/catalog/common/classes/notification.php 2014-03-11 17:13:16 UTC (rev 5188)
@@ -37,18 +37,18 @@
$DB=Database::getInstance();
$r=$DB->query("select * from ".self::TABLE." where chknotif_status > 0 AND chknotif_key='".(string)$key."' " );
- if( ! $r->__get('numRows') ){
- /**
- @remarks if not key exits in config , force put master admin
- */
- self::$conf[] = array(
- 'chknotif_method' => 'sql',
- 'chknotif_user'=> 1, // force notif pour l'admin 1
- 'chknotif_uniq'=> 0, // force notif uniquement pour user
- );
- }
- else
+ if( $r->__get('numRows') )
self::$conf=$r->fetchAllAssoc();
+
+
+ /**
+ @remarks Force put notification for master admin, admin id 1
+ */
+ self::$conf[] = array(
+ 'chknotif_method' => 'sql',
+ 'chknotif_user'=> 1, // force notif pour l'admin 1
+ 'chknotif_uniq'=> 0, // force notif uniquement pour user
+ );
}
Modified: trunk/catalog/includes/classes/core_page/customer.php
===================================================================
--- trunk/catalog/includes/classes/core_page/customer.php 2014-03-10 14:14:50 UTC (rev 5187)
+++ trunk/catalog/includes/classes/core_page/customer.php 2014-03-11 17:13:16 UTC (rev 5188)
@@ -505,7 +505,7 @@
tep_db_query("update " . TABLE_CUSTOMERS_INFO . " set customers_info_date_account_last_modified = now() where customers_info_id = '" . $this->customer_id . "'");
- self::PassmessageStack('account', SUCCESS_PASSWORD_UPDATED, 'success');
+// self::PassmessageStack('account', SUCCESS_PASSWORD_UPDATED, 'success');
return true;
}
return false;
Modified: trunk/catalog/includes/languages/fr_FR/modeles/email/mouton/password_forgotten.txt
===================================================================
--- trunk/catalog/includes/languages/fr_FR/modeles/email/mouton/password_forgotten.txt 2014-03-10 14:14:50 UTC (rev 5187)
+++ trunk/catalog/includes/languages/fr_FR/modeles/email/mouton/password_forgotten.txt 2014-03-11 17:13:16 UTC (rev 5188)
@@ -9,7 +9,7 @@
@encode UTF-8
*/
$lang['EMAIL_SEPARATOR']="------------------------------------------------------" ;
-$lang['EMAIL_TEXT_SUBJECT']="" ;
+$lang['EMAIL_TEXT_SUBJECT']=" [" . STORE_NAME . "] Renouvellement de mot de passe " ;
$lang['EMAIL_TEXT_FOOTER_LG1']=" " ;
$lang['EMAIL_WELCOME']="Renouellemet de mot de passe.\n Vous avez oublié votre mot de passe sur <strong>" . STORE_NAME . "</strong>\n Cher(e) " ;
Modified: trunk/catalog/templates/defaut/includes/gabarit/account/password.gab
===================================================================
--- trunk/catalog/templates/defaut/includes/gabarit/account/password.gab 2014-03-10 14:14:50 UTC (rev 5187)
+++ trunk/catalog/templates/defaut/includes/gabarit/account/password.gab 2014-03-11 17:13:16 UTC (rev 5188)
@@ -36,7 +36,7 @@
<div class="form-group">
<label for="confirmation" class="col-sm-2 control-label"><?php echo __('entry password confirmation'); ?></label>
<div class="col-sm-10">
- <?php echo tep_draw_password_field('confirmation','confirmation','', true, ' class="form-control" placeholder="Confirmation" '); ?>
+ <?php echo tep_draw_password_field('password_confirmation','password_confirmation','', true, ' class="form-control" placeholder="Confirmation" '); ?>
<?php $page->messageStack->_draw_inline('confirmation'); ?>
</div>
</div>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2014-03-10 14:14:55
|
Revision: 5187
http://sourceforge.net/p/oscss/svn/5187
Author: oscim
Date: 2014-03-10 14:14:50 +0000 (Mon, 10 Mar 2014)
Log Message:
-----------
Fix UnitTest
Adjust configfile unittest
Modified Paths:
--------------
trunk/catalog/admin/includes/classes/ModTreePage.php
trunk/catalog/admin/includes/modules/pages/customers.php
trunk/test/phpunit/Back/modules/configuration/ConfigurationModuleTest.php
trunk/test/phpunit/Back/modules/pages/pageadmingroupTest.php
trunk/test/phpunit/Back/modules/pages/pagecategoriesTest.php
trunk/test/phpunit/Back/modules/pages/pagecurrencieTest.php
trunk/test/phpunit/Back/modules/pages/pagecustomersTest.php
trunk/test/phpunit/Back/modules/pages/pageproductsTest.php
trunk/test/phpunit/Back/modules/pages/pagesadminusersTest.php
trunk/test/phpunit/Back/modules/pages/pagescountrieTest.php
trunk/test/phpunit/Back/modules/pages/pagesnavigation_linkTest.php
trunk/test/phpunit/Back/modules/pages/pagesserviceTest.php
trunk/test/phpunit/Back/modules/pages/pagesshippingTest.php
trunk/test/phpunit/Back/phpunittest.xml
trunk/test/phpunit/Back/test_nostock.xml
trunk/test/phpunit/Front/no_stock.xml
trunk/test/phpunit/Front/phpunittest.xml
trunk/test/phpunit/Front/test_no_stock.xml
Modified: trunk/catalog/admin/includes/classes/ModTreePage.php
===================================================================
--- trunk/catalog/admin/includes/classes/ModTreePage.php 2014-03-10 13:14:47 UTC (rev 5186)
+++ trunk/catalog/admin/includes/classes/ModTreePage.php 2014-03-10 14:14:50 UTC (rev 5187)
@@ -445,9 +445,6 @@
if(!tep_action_check(self::$action, $class::FILENAME))
tep_redirect(tep_href_link($class::FILENAME));
- // specific ajax call mode return
- $view = in_array(getenv('OSCSS_ENVIRONEMENT'), array('autotesting') );
-
switch(self::$action){
/**
@remarks Ajax View result
@@ -459,19 +456,13 @@
$action = '';
$res = $class::RowStatus(array('status'=>(int)$_GET['flag'], 'id'=>(int)$class::$Id));
- if($view)
- return $res;
- else
- print $res;
+ print $res;
break;
case 'viewflag':
$action = '';
$res = $class::RowHidden(array('hidden'=>(int)$_GET['flag'], 'id'=>(int)$class::$Id));
- if($view)
- return $res;
- else
- print $res;
+ print $res;
break;
/**
Modified: trunk/catalog/admin/includes/modules/pages/customers.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/customers.php 2014-03-10 13:14:47 UTC (rev 5186)
+++ trunk/catalog/admin/includes/modules/pages/customers.php 2014-03-10 14:14:50 UTC (rev 5187)
@@ -857,7 +857,7 @@
@remarks Ajax View result
*/
case 'setflagda':
- return self::RowStatusDa(array('group_ra'=>(int)$_GET['flag'], 'id'=>(int)self::$Id));
+ return self::GenericRowsFlag(self::$Id, 'group_ra', 'setflagda');/// RowStatusDa(array('group_ra'=>(int)$_GET['flag'], 'id'=>(int)self::$Id));
break;
/**
@@ -894,26 +894,7 @@
}
- /**
- @brief return format html for row
- @param $product array restuts row
- @return string html
- */
-// public static function RowStatusDa($customers){
-//
-// $exclude=array('action','cID','forceajax','type','class','function','funct', 'mod');
-// $query_s='action=setflagda&cID=' . $customers['id'].'&flag=';
-//
-// return '<a class="ajaxinline" href="' . tep_href_link(self::FILENAME, tep_get_all_get_params($exclude).$query_s.(($customers['group_ra'] == '1')? '0' : '1') ) . '">'.
-// sprintf(
-// CsrtAction::getFormat('row_etat'),
-// (int)$customers['group_ra'],
-// ( ($customers['group_ra'] == '1')? IMAGE_ICON_STATUS_GREEN : IMAGE_ICON_STATUS_RED)
-// ).
-// '</a>';
-// }
-
/**
@fn ButtonRowsActions($orders)
@brief fonction qui construit l'affichage de la colonne action
Modified: trunk/test/phpunit/Back/modules/configuration/ConfigurationModuleTest.php
===================================================================
--- trunk/test/phpunit/Back/modules/configuration/ConfigurationModuleTest.php 2014-03-10 13:14:47 UTC (rev 5186)
+++ trunk/test/phpunit/Back/modules/configuration/ConfigurationModuleTest.php 2014-03-10 14:14:50 UTC (rev 5187)
@@ -105,32 +105,38 @@
@brief test methode conf and static vars
@depends testallmodulesgenericConf
*/
-// public function testallmodulesgenericDrawHeader($arrtmp){
-//
-// foreach($arrtmp as $key=>$row){
-//
-// $val = $row->draw_header();
-//
-// if( $val === false )
-// $this->assertTrue ( false , 'Error load subschilds mod draw_header() type configuration for '.$key ) ;
-// }
-// }
+ public function testallmodulesgenericDrawHeader($arrtmp){
+ foreach($arrtmp as $key=>$row){
+
+ ob_start();
+ $row->draw_header();
+ $val = ob_get_contents();
+ ob_end_clean();
+
+ if( $val === false )
+ $this->assertTrue ( false , 'Error load subschilds mod draw_header() type configuration for '.$key ) ;
+ }
+ }
+
/**
@brief test methode conf and static vars
@depends testallmodulesgenericConf
*/
-// public function testallmodulesgenericDraw($arrtmp){
-//
-// foreach($arrtmp as $key=>$row){
-//
-// $val = $row->draw();
-//
-// if( $val === false )
-// $this->assertTrue ( false , 'Error load subschilds mod draw() type configuration for '.$key ) ;
-// }
-// }
+ public function testallmodulesgenericDraw($arrtmp){
+ foreach($arrtmp as $key=>$row){
+
+ ob_start();
+ $row->draw();
+ $val = ob_get_contents();
+ ob_end_clean();
+
+ if( $val === false )
+ $this->assertTrue ( false , 'Error load subschilds mod draw() type configuration for '.$key ) ;
+ }
+ }
+
}
?>
\ No newline at end of file
Modified: trunk/test/phpunit/Back/modules/pages/pageadmingroupTest.php
===================================================================
--- trunk/test/phpunit/Back/modules/pages/pageadmingroupTest.php 2014-03-10 13:14:47 UTC (rev 5186)
+++ trunk/test/phpunit/Back/modules/pages/pageadmingroupTest.php 2014-03-10 14:14:50 UTC (rev 5187)
@@ -101,7 +101,10 @@
$get['forceajax'] = 1;
$res = $this->CallGetDBValue($objtmp,$action, $get);
- $res = $this->CheckAction($objtmp);
+ ob_start();
+ $this->CheckAction($objtmp);
+ $res = ob_get_contents();
+ ob_end_clean();
$this->assertTrue ( ( strlen($res) >150) , 'Error retrun action::'.$action) ;
@@ -118,7 +121,9 @@
$res = $this->CallGetDBValue($objtmp,$action, $get);
$res = $this->CheckAction($objtmp);
- $this->assertTrue ( ( strlen($res) > 2000) , 'Error retrun action::'.$action ) ;
+
+
+ $this->assertTrue ( ( strlen($res) > 100) , 'Error retrun action::'.$action ) ;
}
Modified: trunk/test/phpunit/Back/modules/pages/pagecategoriesTest.php
===================================================================
--- trunk/test/phpunit/Back/modules/pages/pagecategoriesTest.php 2014-03-10 13:14:47 UTC (rev 5186)
+++ trunk/test/phpunit/Back/modules/pages/pagecategoriesTest.php 2014-03-10 14:14:50 UTC (rev 5187)
@@ -114,7 +114,10 @@
$res = $this-> CallGetDBValue($objtmp,$action, $get);
- $res = $this->CheckAction($objtmp);
+ ob_start();
+ $this->CheckAction($objtmp);
+ $res = ob_get_contents();
+ ob_end_clean();
$this->assertTrue ( ( strlen($res) >300) , 'Error retrun action::'.$action) ;
@@ -129,7 +132,10 @@
$res = $this-> CallGetDBValue($objtmp,$action, $get);
- $res = $this->CheckAction($objtmp);
+ ob_start();
+ $this->CheckAction($objtmp);
+ $res = ob_get_contents();
+ ob_end_clean();
$this->assertTrue ( ( strlen($res) >300) , 'Error retrun action::'.$action) ;
}
Modified: trunk/test/phpunit/Back/modules/pages/pagecurrencieTest.php
===================================================================
--- trunk/test/phpunit/Back/modules/pages/pagecurrencieTest.php 2014-03-10 13:14:47 UTC (rev 5186)
+++ trunk/test/phpunit/Back/modules/pages/pagecurrencieTest.php 2014-03-10 14:14:50 UTC (rev 5187)
@@ -93,23 +93,26 @@
@brief test display flag action
@depends testcurrenciesGetDBValue
*/
-// public function testcurrenciesPrintFlag($objtmp){
-//
-// $action = 'setflag';
-// $get = array();
-// $get['flag'] = 1;
-// $get['cID'] = 1;
-// $get['forceajax'] = 1;
-//
-// $res = $this-> CallGetDBValue($objtmp,$action, $get);
-//
-// $res = $this->CheckAction($objtmp);
-//
-//
-// $this->assertTrue ( ( strlen($res) >150) , 'Error retrun action::'.$action) ;
-//
-// }
+ public function testcurrenciesPrintFlag($objtmp){
+ $action = 'setflag';
+ $get = array();
+ $get['flag'] = 1;
+ $get['cID'] = 1;
+ $get['forceajax'] = 1;
+
+ $res = $this-> CallGetDBValue($objtmp,$action, $get);
+
+ ob_start();
+ $this->CheckAction($objtmp);
+ $res = ob_get_contents();
+ ob_end_clean();
+
+
+ $this->assertTrue ( ( strlen($res) >150) , 'Error retrun action::'.$action) ;
+
+ }
+
/**
@brief test display form new customers
@depends testcurrenciesGetDBValue
Modified: trunk/test/phpunit/Back/modules/pages/pagecustomersTest.php
===================================================================
--- trunk/test/phpunit/Back/modules/pages/pagecustomersTest.php 2014-03-10 13:14:47 UTC (rev 5186)
+++ trunk/test/phpunit/Back/modules/pages/pagecustomersTest.php 2014-03-10 14:14:50 UTC (rev 5187)
@@ -122,9 +122,12 @@
$get['forceajax'] = 1;
$res = $this->CallGetDBValue($objtmp,$action, $get);
- $res = $this->CheckAction($objtmp);
-// var_dump($res);
-// exit;
+
+ ob_start();
+ $this->CheckAction($objtmp);
+ $res = ob_get_contents();
+ ob_end_clean();
+
$this->assertTrue ( ( strlen($res) >300) , 'Error retrun action::'.$action) ;
$action = 'setflagda';
@@ -135,7 +138,11 @@
$get['forceajax'] = 1;
$res = $this->CallGetDBValue($objtmp,$action, $get);
- $res = $this->CheckAction($objtmp);
+
+ ob_start();
+ $this->CheckAction($objtmp);
+ $res = ob_get_contents();
+ ob_end_clean();
$this->assertTrue ( ( strlen($res) >300) , 'Error retrun action::'.$action) ;
}
@@ -156,7 +163,10 @@
$get['forceajax'] = 1;
$res = $this->CallGetDBValue($objtmp,$action, $get);
- $res = $this->CheckAction($objtmp);
+ ob_start();
+ $this->CheckAction($objtmp);
+ $res = ob_get_contents();
+ ob_end_clean();
$this->assertTrue ( ( strlen($res) > 100) , 'Error retrun action::'.$action ) ;
}
Modified: trunk/test/phpunit/Back/modules/pages/pageproductsTest.php
===================================================================
--- trunk/test/phpunit/Back/modules/pages/pageproductsTest.php 2014-03-10 13:14:47 UTC (rev 5186)
+++ trunk/test/phpunit/Back/modules/pages/pageproductsTest.php 2014-03-10 14:14:50 UTC (rev 5187)
@@ -80,7 +80,7 @@
// $res = products::tep_get_list();
$action = 'listing';
$get = array();
-// $get['pID'] = self::$Id;
+// $get['cID'] = self::$Id;
$res = $this->CallGetDBValue($objtmp,$action, $get);
@@ -118,7 +118,7 @@
// action default : Edit
$action = 'edit';
$get = array();
- $get['pID'] = self::$Id;
+ $get['cID'] = self::$Id;
$res = $this->CallGetDBValue($objtmp,$action, $get);
@@ -157,7 +157,7 @@
// action default : Edit
$action = 'delete';
$get = array();
- $get['pID'] = self::$Id;
+ $get['cID'] = self::$Id;
$res = $this->CallGetDBValue($objtmp,$action, $get);
@@ -191,22 +191,27 @@
@brief test display flag action
@depends testproductsConf
*/
-// public function testproductsPrintFlag($objtmp){
-//
-// $action = 'setflag';
-// $get = array();
-// $get['flag'] = 1;
-// $get['pID'] = 1;
-//
-// $get['forceajax'] = 1;
-//
-// $res = $this->CallGetDBValue($objtmp,$action, $get);
-// $res = $this->CheckAction($objtmp);
-//
-// $this->assertTrue ( ( strlen($res) >300) , 'Error retrun action::'.$action) ;
-//
-// }
+ public function testproductsPrintFlag($objtmp){
+ $action = 'setflag';
+ $get = array();
+ $get['flag'] = 1;
+ $get['cID'] = 1;
+
+ $get['forceajax'] = 1;
+
+
+
+ ob_start();
+ $this->CallGetDBValue($objtmp,$action, $get);
+ $this->CheckAction($objtmp);
+ $res = ob_get_contents();
+ ob_end_clean();
+
+ $this->assertTrue ( ( strlen($res) >300) , 'Error retrun action::'.$action) ;
+
+ }
+
/**
@brief test display form new customers
@depends testproductsConf
@@ -231,7 +236,7 @@
$action = 'edit';
$get = array();
- $get['pID'] = 1;
+ $get['cID'] = 1;
$res = $this->CallGetDBValue($objtmp,$action, $get);
$res = $this->CheckAction($objtmp);
@@ -247,7 +252,7 @@
$action = 'delete';
$get = array();
- $get['pID'] = 1;
+ $get['cID'] = 1;
$res = $this->CallGetDBValue($objtmp,$action, $get);
$res = $this->CheckAction($objtmp);
Modified: trunk/test/phpunit/Back/modules/pages/pagesadminusersTest.php
===================================================================
--- trunk/test/phpunit/Back/modules/pages/pagesadminusersTest.php 2014-03-10 13:14:47 UTC (rev 5186)
+++ trunk/test/phpunit/Back/modules/pages/pagesadminusersTest.php 2014-03-10 14:14:50 UTC (rev 5187)
@@ -101,7 +101,11 @@
$get['forceajax'] = 1;
$res = $this->CallGetDBValue($objtmp,$action, $get);
- $res = $this->CheckAction($objtmp);
+
+ ob_start();
+ $this->CheckAction($objtmp);
+ $res = ob_get_contents();
+ ob_end_clean();
$this->assertTrue ( ( strlen($res) >150) , 'Error retrun action::'.$action) ;
Modified: trunk/test/phpunit/Back/modules/pages/pagescountrieTest.php
===================================================================
--- trunk/test/phpunit/Back/modules/pages/pagescountrieTest.php 2014-03-10 13:14:47 UTC (rev 5186)
+++ trunk/test/phpunit/Back/modules/pages/pagescountrieTest.php 2014-03-10 14:14:50 UTC (rev 5187)
@@ -103,7 +103,10 @@
$res = $this-> CallGetDBValue($objtmp,$action, $get);
- $res = $this->CheckAction($objtmp);
+ ob_start();
+ $this->CheckAction($objtmp);
+ $res = ob_get_contents();
+ ob_end_clean();
$this->assertTrue ( ( strlen($res) >300) , 'Error retrun action::'.$action) ;
Modified: trunk/test/phpunit/Back/modules/pages/pagesnavigation_linkTest.php
===================================================================
--- trunk/test/phpunit/Back/modules/pages/pagesnavigation_linkTest.php 2014-03-10 13:14:47 UTC (rev 5186)
+++ trunk/test/phpunit/Back/modules/pages/pagesnavigation_linkTest.php 2014-03-10 14:14:50 UTC (rev 5187)
@@ -103,7 +103,10 @@
$res = $this-> CallGetDBValue($objtmp,$action, $get);
- $res = $this->CheckAction($objtmp);
+ ob_start();
+ $this->CheckAction($objtmp);
+ $res = ob_get_contents();
+ ob_end_clean();
$this->assertTrue ( ( strlen($res) >300) , 'Error retrun action::'.$action) ;
Modified: trunk/test/phpunit/Back/modules/pages/pagesserviceTest.php
===================================================================
--- trunk/test/phpunit/Back/modules/pages/pagesserviceTest.php 2014-03-10 13:14:47 UTC (rev 5186)
+++ trunk/test/phpunit/Back/modules/pages/pagesserviceTest.php 2014-03-10 14:14:50 UTC (rev 5187)
@@ -103,7 +103,10 @@
$res = $this-> CallGetDBValue($objtmp,$action, $get);
- $res = $this->CheckAction($objtmp);
+ ob_start();
+ $this->CheckAction($objtmp);
+ $res = ob_get_contents();
+ ob_end_clean();
$this->assertTrue ( ( strlen($res) >300) , 'Error retrun action::'.$action) ;
Modified: trunk/test/phpunit/Back/modules/pages/pagesshippingTest.php
===================================================================
--- trunk/test/phpunit/Back/modules/pages/pagesshippingTest.php 2014-03-10 13:14:47 UTC (rev 5186)
+++ trunk/test/phpunit/Back/modules/pages/pagesshippingTest.php 2014-03-10 14:14:50 UTC (rev 5187)
@@ -101,7 +101,10 @@
$res = $this-> CallGetDBValue($objtmp,$action, $get);
- $res = $this->CheckAction($objtmp);
+ ob_start();
+ $this->CheckAction($objtmp);
+ $res = ob_get_contents();
+ ob_end_clean();
$this->assertTrue ( ( strlen($res) >300) , 'Error retrun action::'.$action) ;
Modified: trunk/test/phpunit/Back/phpunittest.xml
===================================================================
--- trunk/test/phpunit/Back/phpunittest.xml 2014-03-10 13:14:47 UTC (rev 5186)
+++ trunk/test/phpunit/Back/phpunittest.xml 2014-03-10 14:14:50 UTC (rev 5187)
@@ -101,8 +101,13 @@
<filter>
<blacklist>
+ <file>../../../catalog/common/classes/Template.php</file>
+
<file>../../../catalog/common/classes/Database.php</file>
+ <directory>../../../catalog/common/classes/sql_drivers/</directory>
+
<file>../../../catalog/common/classes/fpdf.php</file>
+
<file>../../../catalog/common/classes/PHPMailer.php</file>
</blacklist>
</filter>
Modified: trunk/test/phpunit/Back/test_nostock.xml
===================================================================
--- trunk/test/phpunit/Back/test_nostock.xml 2014-03-10 13:14:47 UTC (rev 5186)
+++ trunk/test/phpunit/Back/test_nostock.xml 2014-03-10 14:14:50 UTC (rev 5187)
@@ -71,9 +71,16 @@
<filter>
<blacklist>
+ <file>../../../catalog/common/classes/Template.php</file>
+
<file>../../../catalog/common/classes/Database.php</file>
+ <directory>../../../catalog/common/classes/sql_drivers/</directory>
+
<file>../../../catalog/common/classes/fpdf.php</file>
+
<file>../../../catalog/common/classes/PHPMailer.php</file>
+ <directory>../../../catalog/common/classes/mailer_drivers/</directory>
+
</blacklist>
</filter>
</phpunit>
\ No newline at end of file
Modified: trunk/test/phpunit/Front/no_stock.xml
===================================================================
--- trunk/test/phpunit/Front/no_stock.xml 2014-03-10 13:14:47 UTC (rev 5186)
+++ trunk/test/phpunit/Front/no_stock.xml 2014-03-10 14:14:50 UTC (rev 5187)
@@ -1,11 +1,11 @@
<phpunit>
<logging>
- <log type="coverage-html" target="../../../html/rapport/front/" charset="UTF-8"
+ <log type="coverage-html" target="../../../html/rapport/front/nostock/" charset="UTF-8"
yui="true" highlight="false"
lowUpperBound="35" highLowerBound="70"/>
<!-- <log type="json" target="../../../html/json/logfile.json"/> -->
- <log type="testdox-html" target="../../../html/test/doc/front/testdox.html" yui="true" highlight="false"/>
+ <log type="testdox-html" target="../../../html/test/doc/front/nostock/testdox.html" yui="true" highlight="false"/>
</logging>
<php>
@@ -41,9 +41,16 @@
<filter>
<blacklist>
+ <file>../../../catalog/common/classes/Template.php</file>
+
<file>../../../catalog/common/classes/Database.php</file>
+ <directory>../../../catalog/common/classes/sql_drivers/</directory>
+
<file>../../../catalog/common/classes/fpdf.php</file>
+
<file>../../../catalog/common/classes/PHPMailer.php</file>
+ <directory>../../../catalog/common/classes/mailer_drivers/</directory>
+
</blacklist>
</filter>
</phpunit>
\ No newline at end of file
Modified: trunk/test/phpunit/Front/phpunittest.xml
===================================================================
--- trunk/test/phpunit/Front/phpunittest.xml 2014-03-10 13:14:47 UTC (rev 5186)
+++ trunk/test/phpunit/Front/phpunittest.xml 2014-03-10 14:14:50 UTC (rev 5187)
@@ -1,11 +1,11 @@
<phpunit>
<logging>
- <log type="coverage-html" target="../../../html/rapport/front/" charset="UTF-8"
+ <log type="coverage-html" target="../../../html/rapport/front/all/" charset="UTF-8"
yui="true" highlight="false"
lowUpperBound="35" highLowerBound="70"/>
<!-- <log type="json" target="../../../html/json/logfile.json"/> -->
- <log type="testdox-html" target="../../../html/test/doc/front/testdox.html" yui="true" highlight="false"/>
+ <log type="testdox-html" target="../../../html/test/doc/front/all/testdox.html" yui="true" highlight="false"/>
</logging>
<php>
@@ -41,9 +41,16 @@
<filter>
<blacklist>
+ <file>../../../catalog/common/classes/Template.php</file>
+
<file>../../../catalog/common/classes/Database.php</file>
+ <directory>../../../catalog/common/classes/sql_drivers/</directory>
+
<file>../../../catalog/common/classes/fpdf.php</file>
+
<file>../../../catalog/common/classes/PHPMailer.php</file>
+ <directory>../../../catalog/common/classes/mailer_drivers/</directory>
+
</blacklist>
</filter>
</phpunit>
\ No newline at end of file
Modified: trunk/test/phpunit/Front/test_no_stock.xml
===================================================================
--- trunk/test/phpunit/Front/test_no_stock.xml 2014-03-10 13:14:47 UTC (rev 5186)
+++ trunk/test/phpunit/Front/test_no_stock.xml 2014-03-10 14:14:50 UTC (rev 5187)
@@ -1,11 +1,11 @@
<phpunit>
<logging>
- <log type="coverage-html" target="../../../html/rapport/front/" charset="UTF-8"
+ <log type="coverage-html" target="../../../html/rapport/front/nostock/" charset="UTF-8"
yui="true" highlight="false"
lowUpperBound="35" highLowerBound="70"/>
<!-- <log type="json" target="../../../html/json/logfile.json"/> -->
- <log type="testdox-html" target="../../../html/test/doc/front/testdox.html" yui="true" highlight="false"/>
+ <log type="testdox-html" target="../../../html/test/doc/front/nostock/testdox.html" yui="true" highlight="false"/>
</logging>
<php>
@@ -41,9 +41,16 @@
<filter>
<blacklist>
+ <file>../../../catalog/common/classes/Template.php</file>
+
<file>../../../catalog/common/classes/Database.php</file>
+ <directory>../../../catalog/common/classes/sql_drivers/</directory>
+
<file>../../../catalog/common/classes/fpdf.php</file>
+
<file>../../../catalog/common/classes/PHPMailer.php</file>
+ <directory>../../../catalog/common/classes/mailer_drivers/</directory>
+
</blacklist>
</filter>
</phpunit>
\ 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...> - 2014-03-10 13:14:50
|
Revision: 5186
http://sourceforge.net/p/oscss/svn/5186
Author: oscim
Date: 2014-03-10 13:14:47 +0000 (Mon, 10 Mar 2014)
Log Message:
-----------
Fix exclude file in Unittest by config.xml in PHpunit; this file exclued is external oscss Core
Modified Paths:
--------------
trunk/test/phpunit/Back/phpunittest.xml
trunk/test/phpunit/Back/test_nostock.xml
trunk/test/phpunit/Front/no_stock.xml
trunk/test/phpunit/Front/phpunittest.xml
trunk/test/phpunit/Front/test_no_stock.xml
Modified: trunk/test/phpunit/Back/phpunittest.xml
===================================================================
--- trunk/test/phpunit/Back/phpunittest.xml 2014-03-10 12:52:37 UTC (rev 5185)
+++ trunk/test/phpunit/Back/phpunittest.xml 2014-03-10 13:14:47 UTC (rev 5186)
@@ -8,9 +8,6 @@
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
- forceCoversAnnotation="true"
- mapTestClassNameToCoveredClassName="true"
- printerClass="PHPUnit_TextUI_ResultPrinter"
processIsolation="false"
stopOnError="false"
stopOnFailure="false"
@@ -104,14 +101,9 @@
<filter>
<blacklist>
- <directory>../svn/</directory>
- <directory>../../../test/</directory>
- <directory>../../../extensions/</directory>
- <directory>../../../languages/</directory>
- <directory>../../../dev/</directory>
- <directory>../../../netinstall/</directory>
- <file>../../.svn</file>
-<!-- <file>../../test</file> -->
+ <file>../../../catalog/common/classes/Database.php</file>
+ <file>../../../catalog/common/classes/fpdf.php</file>
+ <file>../../../catalog/common/classes/PHPMailer.php</file>
</blacklist>
</filter>
</phpunit>
\ No newline at end of file
Modified: trunk/test/phpunit/Back/test_nostock.xml
===================================================================
--- trunk/test/phpunit/Back/test_nostock.xml 2014-03-10 12:52:37 UTC (rev 5185)
+++ trunk/test/phpunit/Back/test_nostock.xml 2014-03-10 13:14:47 UTC (rev 5186)
@@ -1,4 +1,21 @@
-<phpunit>
+<phpunit
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/3.7/phpunit.xsd"
+ backupGlobals="true"
+ backupStaticAttributes="false"
+ cacheTokens="true"
+ colors="true"
+ convertErrorsToExceptions="true"
+ convertNoticesToExceptions="true"
+ convertWarningsToExceptions="true"
+ processIsolation="false"
+ stopOnError="false"
+ stopOnFailure="false"
+ stopOnIncomplete="false"
+ stopOnSkipped="false"
+ testSuiteLoaderClass="PHPUnit_Runner_StandardTestSuiteLoader"
+ verbose="true"
+ >
<php>
<env name="OSCSS_ENVIRONEMENT" value="autotesting"/>
@@ -54,13 +71,9 @@
<filter>
<blacklist>
- <directory>../svn/</directory>
- <directory>../../../test/</directory>
- <directory>../../../extensions/</directory>
- <directory>../../../languages/</directory>
- <directory>../../../dev/</directory>
- <directory>../../../netinstall/</directory>
- <file>../../.svn</file>
+ <file>../../../catalog/common/classes/Database.php</file>
+ <file>../../../catalog/common/classes/fpdf.php</file>
+ <file>../../../catalog/common/classes/PHPMailer.php</file>
</blacklist>
</filter>
</phpunit>
\ No newline at end of file
Modified: trunk/test/phpunit/Front/no_stock.xml
===================================================================
--- trunk/test/phpunit/Front/no_stock.xml 2014-03-10 12:52:37 UTC (rev 5185)
+++ trunk/test/phpunit/Front/no_stock.xml 2014-03-10 13:14:47 UTC (rev 5186)
@@ -41,13 +41,9 @@
<filter>
<blacklist>
- <directory>../svn/</directory>
- <directory>../../../test/</directory>
- <directory>../../../extensions/</directory>
- <directory>../../../languages/</directory>
- <directory>../../../dev/</directory>
- <directory>../../../netinstall/</directory>
- <file>../../.svn</file>
+ <file>../../../catalog/common/classes/Database.php</file>
+ <file>../../../catalog/common/classes/fpdf.php</file>
+ <file>../../../catalog/common/classes/PHPMailer.php</file>
</blacklist>
</filter>
</phpunit>
\ No newline at end of file
Modified: trunk/test/phpunit/Front/phpunittest.xml
===================================================================
--- trunk/test/phpunit/Front/phpunittest.xml 2014-03-10 12:52:37 UTC (rev 5185)
+++ trunk/test/phpunit/Front/phpunittest.xml 2014-03-10 13:14:47 UTC (rev 5186)
@@ -41,13 +41,9 @@
<filter>
<blacklist>
- <directory>../svn/</directory>
- <directory>../../../test/</directory>
- <directory>../../../extensions/</directory>
- <directory>../../../languages/</directory>
- <directory>../../../dev/</directory>
- <directory>../../../netinstall/</directory>
- <file>../../.svn</file>
+ <file>../../../catalog/common/classes/Database.php</file>
+ <file>../../../catalog/common/classes/fpdf.php</file>
+ <file>../../../catalog/common/classes/PHPMailer.php</file>
</blacklist>
</filter>
</phpunit>
\ No newline at end of file
Modified: trunk/test/phpunit/Front/test_no_stock.xml
===================================================================
--- trunk/test/phpunit/Front/test_no_stock.xml 2014-03-10 12:52:37 UTC (rev 5185)
+++ trunk/test/phpunit/Front/test_no_stock.xml 2014-03-10 13:14:47 UTC (rev 5186)
@@ -41,13 +41,9 @@
<filter>
<blacklist>
- <directory>../svn/</directory>
- <directory>../../../test/</directory>
- <directory>../../../extensions/</directory>
- <directory>../../../languages/</directory>
- <directory>../../../dev/</directory>
- <directory>../../../netinstall/</directory>
- <file>../../.svn</file>
+ <file>../../../catalog/common/classes/Database.php</file>
+ <file>../../../catalog/common/classes/fpdf.php</file>
+ <file>../../../catalog/common/classes/PHPMailer.php</file>
</blacklist>
</filter>
</phpunit>
\ 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...> - 2014-03-10 12:52:41
|
Revision: 5185
http://sourceforge.net/p/oscss/svn/5185
Author: oscim
Date: 2014-03-10 12:52:37 +0000 (Mon, 10 Mar 2014)
Log Message:
-----------
Fix
REport tag for home page in Datatype and clean code in seo class
Modified Paths:
--------------
trunk/catalog/admin/includes/widget/ProductsLast.php
trunk/catalog/admin/includes/widget/homeStock.php
trunk/catalog/common/classes/datatype_drivers/Data_home.php
trunk/catalog/common/classes/seo_url.php
trunk/catalog/includes/functions/general.php
Modified: trunk/catalog/admin/includes/widget/ProductsLast.php
===================================================================
--- trunk/catalog/admin/includes/widget/ProductsLast.php 2014-03-06 10:51:36 UTC (rev 5184)
+++ trunk/catalog/admin/includes/widget/ProductsLast.php 2014-03-10 12:52:37 UTC (rev 5185)
@@ -58,7 +58,7 @@
</tr>
<?php foreach($_query->fetchAllAssoc() as $row) : ?>
<tr>
- <td class="tcenter"><strong><a href="<?php echo tep_href_link(FILENAME_PRODUCTS, 'pID='.$row['products_id'].'&action=edit') ?>"><?php echo $row['products_id'] ?></a></strong></td>
+ <td class="tcenter"><strong><a href="<?php echo tep_href_link(FILENAME_PRODUCTS, 'cID='.$row['products_id'].'&action=edit') ?>"><?php echo $row['products_id'] ?></a></strong></td>
<td style="width:200px;"><?php echo $row['products_name'] ?></td>
<td class="tcenter"><?php echo tep_date_short($row['products_date_added']) ?></td>
<td class="tcenter">
@@ -84,7 +84,7 @@
</tr>
<?php foreach($_query2->fetchAllAssoc() as $row) : ?>
<tr>
- <td class="tcenter"><strong><a href="<?php echo tep_href_link(FILENAME_PRODUCTS, 'pID='.$row['products_id'].'&action=edit') ?>"><?php echo $row['products_id'] ?></a></strong></td>
+ <td class="tcenter"><strong><a href="<?php echo tep_href_link(FILENAME_PRODUCTS, 'cID='.$row['products_id'].'&action=edit') ?>"><?php echo $row['products_id'] ?></a></strong></td>
<td style="width:200px;"><?php echo $row['products_name'] ?></td>
<td class="tcenter"><?php echo tep_date_short($row['products_last_modified']) ?></td>
<td class="tcenter">
@@ -110,7 +110,7 @@
</tr>
<?php foreach($_query3->fetchAllAssoc() as $row) : ?>
<tr>
- <td class="tcenter"><strong><a href="<?php echo tep_href_link(FILENAME_PRODUCTS, 'pID='.$row['products_id'].'&action=edit') ?>"><?php echo $row['products_id'] ?></a></strong></td>
+ <td class="tcenter"><strong><a href="<?php echo tep_href_link(FILENAME_PRODUCTS, 'cID='.$row['products_id'].'&action=edit') ?>"><?php echo $row['products_id'] ?></a></strong></td>
<td style="width:200px;"><?php echo $row['products_name'] ?></td>
<td class="tcenter"><?php echo tep_date_short($row['products_date_available']) ?></td>
<td class="tcenter">
Modified: trunk/catalog/admin/includes/widget/homeStock.php
===================================================================
--- trunk/catalog/admin/includes/widget/homeStock.php 2014-03-06 10:51:36 UTC (rev 5184)
+++ trunk/catalog/admin/includes/widget/homeStock.php 2014-03-10 12:52:37 UTC (rev 5185)
@@ -51,8 +51,8 @@
</tr>
<?php $i = 0; foreach($l as $p) : $i++; if( $i> $conf->widget_max_line) break; ?>
<tr>
- <td class="tcenter"><strong><a href="<?php echo tep_href_link(FILENAME_PRODUCTS, 'pID='.$p['products_id'].'&action=edit') ?>"><?php echo $p['products_id'] ?></a></strong></td>
- <td class="tcenter"><strong><a href="<?php echo tep_href_link(FILENAME_PRODUCTS, 'pID='.$p['products_id'].'&action=edit') ?>"><?php echo $p['ref'] ?></a></strong></td>
+ <td class="tcenter"><strong><a href="<?php echo tep_href_link(FILENAME_PRODUCTS, 'cID='.$p['products_id'].'&action=edit') ?>"><?php echo $p['products_id'] ?></a></strong></td>
+ <td class="tcenter"><strong><a href="<?php echo tep_href_link(FILENAME_PRODUCTS, 'cID='.$p['products_id'].'&action=edit') ?>"><?php echo $p['ref'] ?></a></strong></td>
<?php if(isset($p['option']) && is_array($p['option'])) : ?>
<td style="width:200px;"><?php echo htmlspecialchars($p['products_name']).' <i>'.htmlspecialchars(implode(' ,',$p['option'])).'</i>' ?></td>
<td class="tcenter">
Modified: trunk/catalog/common/classes/datatype_drivers/Data_home.php
===================================================================
--- trunk/catalog/common/classes/datatype_drivers/Data_home.php 2014-03-06 10:51:36 UTC (rev 5184)
+++ trunk/catalog/common/classes/datatype_drivers/Data_home.php 2014-03-10 12:52:37 UTC (rev 5185)
@@ -1,15 +1,17 @@
<?php if (!defined('HTTP_SERVER')) die('You can not access this file directly!');
/**
- @licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
+ @licence GPL 2005-2014 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
+ @version 2.2.0
@date 16/03/2013, 16:16
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
@brief Use gabarit static html in dir content
Or form
OR module aca action and exec
+
+ @note depend class AbstractHeader_tags fgor priority of home.
*/
class Data_home
@@ -117,7 +119,13 @@
switch($mode){
default:
- $sql = "select head_title_tag as tName, head_desc_tag, head_keywords_tag from " . TABLE_FULL_TAG . " ft, " . TABLE_FULL_TAG_DESCRIPTION . " ftd where ft.tag_id=ftd.tag_id and ft.page_type='page' and ft.page_id = 'home' and ftd.language_id = '" . (int)$language_id. "' Limit 1";
+ $id=AbstractHeader_tags::get_prio_cms('home');
+
+ if(is_int($id) )
+ $sql = "select c.content_id as ID, IF(head_title_tag<>'', head_title_tag,content_title) as tName, head_desc_tag, head_keywords_tag from " . TABLE_CONTENT . " c LEFT JOIN " . TABLE_CONTENT_DESCRIPTION . " cd ON(c.content_id=cd.content_id) LEFT JOIN " . TABLE_FULL_TAG . " ft ON (ft.page_id = c.content_id and ft.page_type='content') LEFT JOIN " . TABLE_FULL_TAG_DESCRIPTION . " ftd ON (ft.tag_id=ftd.tag_id and ftd.language_id = '" . $language_id. "' ) where c.content_name='Page_home' and cd.language_id='".(int)$language_id."' ".DataForceStatus(" AND c.content_status='1' ")." " ;
+ else
+ $sql = "select ft.page_id as ID, head_title_tag as tName, head_desc_tag, head_keywords_tag from " . TABLE_FULL_TAG . " ft, " . TABLE_FULL_TAG_DESCRIPTION . " ftd where ft.tag_id=ftd.tag_id and ft.page_type='home' and ftd.language_id = '" . $language_id. "' " ;
+
$rsql = $DB->query($sql);
if($rsql->__get('numRows') ){
$result = $rsql->fetchAssoc();
@@ -129,7 +137,6 @@
}
$result['sql']=$sql;
}
-
return $result;
}
@@ -137,17 +144,24 @@
@brief Prepare an dgenere all cache for divers
*/
public function SeoCacheQuery(/*$language_id*/){
- global $language_id;
+ global $languages_id;
$DB=Database::getInstance();
$return_array = array();
+
+ $id=AbstractHeader_tags::get_prio_cms('home');
- $res=$DB->query( "select ft.page_id as ID, head_title_tag as tName, head_desc_tag, head_keywords_tag from " . TABLE_FULL_TAG . " ft, " . TABLE_FULL_TAG_DESCRIPTION . " ftd where ft.tag_id=ftd.tag_id and ft.page_type='home' and ftd.language_id = '" . $language_id. "' " );
+ if(is_int($id) )
+ $sql = "select c.content_id as ID, content_title as tName from " . TABLE_CONTENT . " c LEFT JOIN " . TABLE_CONTENT_DESCRIPTION . " cd ON(c.content_id=cd.content_id) where c.content_name='Page_home' and cd.language_id='".(int)$languages_id."' ".DataForceStatus(" AND c.content_status='1' ")." " ;
+ else
+ $sql = "select ft.page_id as ID, head_title_tag as tName, head_desc_tag, head_keywords_tag from " . TABLE_FULL_TAG . " ft, " . TABLE_FULL_TAG_DESCRIPTION . " ftd where ft.tag_id=ftd.tag_id and ft.page_type='home' and ftd.language_id = '" . $languages_id. "' " ;
+
+ $res=$DB->query( $sql );
while ($result =$res->fetchAssoc()){
$return_array[] = array ($result['ID'],$result,strtoupper($this->DataType)) ;
}
- return $return_array ;
+ return $return_array = array() ;
}
Modified: trunk/catalog/common/classes/seo_url.php
===================================================================
--- trunk/catalog/common/classes/seo_url.php 2014-03-06 10:51:36 UTC (rev 5184)
+++ trunk/catalog/common/classes/seo_url.php 2014-03-10 12:52:37 UTC (rev 5185)
@@ -470,8 +470,7 @@
$arflip = array_flip($this->reg_anchors);
if(count($p3)==0)
- if($page ==FILENAME_HOME)
- $p3['home'] = 'home';
+ $p3['home'] = 'home';
foreach ($p3 as $key => $value){
@@ -497,25 +496,6 @@
default:
$container[$key] = @$value;
-
- switch(true){
- case ( $page == FILENAME_HOME):
- $id=AbstractHeader_tags::get_prio_cms('home');
- //! home by cms
- if(is_int($id)) {
- $url = $this->make_url($page, DataTypes::Getseoquery('t', '', $id, $this->languages_id) , "content", $id, $separator);
- $this->ValidateName($url, "t", $id, $connection, $separator);
- }
- //! home by page content
- else {
- $url = $this->make_url('home', DataTypes::Getseoquery('h', '', 'home', $this->languages_id), 'home', '', $separator);
- $this->ValidateName($url, "h", 'home', $connection, $separator);
- }
- break;
- default:
- if(is_array($p2)) $container[$key] = $value;
- break;
- }
}
}
Modified: trunk/catalog/includes/functions/general.php
===================================================================
--- trunk/catalog/includes/functions/general.php 2014-03-06 10:51:36 UTC (rev 5184)
+++ trunk/catalog/includes/functions/general.php 2014-03-10 12:52:37 UTC (rev 5185)
@@ -672,7 +672,7 @@
chargement du texte sous forme de constante ou via présent cms. cms prioritaire. si aucun des 2 renvoi commentaire élément absent
*/
function tep_draw_txt_block($text_main){
- if (($text=tep_get_cms_content ( strtolower($text_main))) !=false) echo $text;
+ if (($text=tep_get_cms_content( $text_main)) !=false) echo $text;
elseif(defined(strtoupper($text_main))) echo constant(strtoupper($text_main));
else echo '<span class="info">'.sprintf(ALERT_CST_MAIN_ABS,$text_main ).'</span>';
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2014-03-06 10:51:41
|
Revision: 5184
http://sourceforge.net/p/oscss/svn/5184
Author: oscim
Date: 2014-03-06 10:51:36 +0000 (Thu, 06 Mar 2014)
Log Message:
-----------
Fix
Modified Paths:
--------------
trunk/catalog/create_account.php
trunk/catalog/includes/languages/fr_FR/account.txt
trunk/catalog/includes/languages/fr_FR/modeles/email/mouton/create_account.txt
trunk/catalog/includes/languages/fr_FR/modeles/email/mouton/create_account_confirm.txt
trunk/catalog/templates/defaut/includes/js/create_account.js.php
trunk/test/phpunit/Back/phpunittest.xml
Modified: trunk/catalog/create_account.php
===================================================================
--- trunk/catalog/create_account.php 2014-03-04 16:57:37 UTC (rev 5183)
+++ trunk/catalog/create_account.php 2014-03-06 10:51:36 UTC (rev 5184)
@@ -86,7 +86,7 @@
$message_final=tep_post_prepare_email('create_account.tpl',$language,$myarray);
}
- tep_mail($user->firstname . ' ' . $user->lastname, $user->email_address, sprintf(EMAIL_SUBJECT, STORE_NAME) , $message_final, STORE_OWNER, EMAIL_FROM);
+ tep_mail($user->firstname . ' ' . $user->lastname, $user->email_address, EMAIL_TEXT_SUBJECT , $message_final, STORE_OWNER, EMAIL_FROM);
$myarray = array(
@@ -156,7 +156,7 @@
$message_final=tep_post_prepare_email('create_account_confirm.tpl',$language,$myarray);
- tep_mail($user['customers_firstname'] . ' ' . $user['customers_lastname'], $email_address, sprintf(EMAIL_SUBJECT_CONFIRM, STORE_NAME), $message_final, STORE_OWNER, EMAIL_FROM);
+ tep_mail($user['customers_firstname'] . ' ' . $user['customers_lastname'], $email_address, EMAIL_TEXT_SUBJECT, $message_final, STORE_OWNER, EMAIL_FROM);
notification::notif('create_account_confirm',__('user account confirm'),$myarray, 'customers_id='.$user->id);
Modified: trunk/catalog/includes/languages/fr_FR/account.txt
===================================================================
--- trunk/catalog/includes/languages/fr_FR/account.txt 2014-03-04 16:57:37 UTC (rev 5183)
+++ trunk/catalog/includes/languages/fr_FR/account.txt 2014-03-06 10:51:36 UTC (rev 5184)
@@ -63,7 +63,11 @@
$lang['entry password'] = "Mot de passe";
$lang['entry password confirmation'] = "Confirmation";
$lang['entry newsletter']="Inscription aux newsletters";
-
+ $lang['entry date of birth'] = "Date de naissance";
+
+ $lang['entry date of birth is format'] = "Format des dates : jj/mm/aaaa 12/03/1970 ";
+ $lang['entry date of birth required'] = "Préciser votre date de naissance";
+ $lang['entry date of birth error %s'] = "Votre date de naissance doit contenir %s caractères ";
$lang['entry gender required'] = "Preciser votre civilité";
$lang['entry post code required'] = "Preciser un code postal";
$lang['entry city required'] = "Preciser la ville";
Modified: trunk/catalog/includes/languages/fr_FR/modeles/email/mouton/create_account.txt
===================================================================
--- trunk/catalog/includes/languages/fr_FR/modeles/email/mouton/create_account.txt 2014-03-04 16:57:37 UTC (rev 5183)
+++ trunk/catalog/includes/languages/fr_FR/modeles/email/mouton/create_account.txt 2014-03-06 10:51:36 UTC (rev 5184)
@@ -15,7 +15,7 @@
$lang['EMAIL_TEXT']="Vous pouvez maintenant participer aux divers services que nous devons vous offrir. Certains de ces services incluent :\n<li>Panier permanent - N'importe quels produits ajoutés à votre panier en ligne restent là jusqu'à ce que vous les supprimiez, ou les consultiez.</li>' \n <li><strong>Carnet d'adresses </strong> - Nous pouvons maintenant livrer vos produits à une adresse différente de la vôtre ! C'est parfait pour envoyer des cadeaux d'anniversaire adressés à l'intention d'autres personnes.</li>\n<li><strong>Historique de commande</strong> - Voir vos historiques d'achats que vous avez effectués chez nous.</li>\n\n" ;
$lang['EMAIL_CONTACT']="Pour obtenir de l'aide sur n'importe lequel de nos services en ligne, envoyez s'il vous plaît un e-mail au propriétaire du magasin : " . STORE_OWNER_EMAIL_ADDRESS . " \n" ;
$lang['EMAIL_WARNING']="<strong class=\"notice\">REMARQUE :</strong> Si cette adresse e-mail vous a été communiqué par un de nos clients. Si vous n'êtes pas un membre, envoyez s'il vous plaît un e-mail à " . STORE_OWNER_EMAIL_ADDRESS . "\n" ;
-$lang['EMAIL_SUBJECT']="Bienvenue sur " . STORE_NAME. " " ;
+$lang['EMAIL_TEXT_SUBJECT']="Bienvenue sur " . STORE_NAME. " " ;
$lang['EMAIL_GREET_MR']="Cher M. " ;
$lang['EMAIL_GREET_MS']="Chère M<sup>me</sup> " ;
$lang['EMAIL_GREET_ML']="Chère M<sup>lle</sup> " ;
Modified: trunk/catalog/includes/languages/fr_FR/modeles/email/mouton/create_account_confirm.txt
===================================================================
--- trunk/catalog/includes/languages/fr_FR/modeles/email/mouton/create_account_confirm.txt 2014-03-04 16:57:37 UTC (rev 5183)
+++ trunk/catalog/includes/languages/fr_FR/modeles/email/mouton/create_account_confirm.txt 2014-03-06 10:51:36 UTC (rev 5184)
@@ -19,7 +19,7 @@
$lang['EMAIL_TEXT_LINK_CONFIRM']="Liens d'activation de votre compte" ;
$lang['EMAIL_TEXT_LINK_CONFIRM_DETAIL']="liens pour activer votre compte " ;
-$lang['EMAIL_SUBJECT']="Bienvenue sur " . STORE_NAME. " " ;
+$lang['EMAIL_TEXT_SUBJECT']="Bienvenue sur " . STORE_NAME. " " ;
$lang['EMAIL_GREET_MR']="Cher M. " ;
$lang['EMAIL_GREET_MS']="Chère M<sup>me</sup> " ;
$lang['EMAIL_GREET_ML']="Chère M<sup>lle</sup> " ;
Modified: trunk/catalog/templates/defaut/includes/js/create_account.js.php
===================================================================
--- trunk/catalog/templates/defaut/includes/js/create_account.js.php 2014-03-04 16:57:37 UTC (rev 5183)
+++ trunk/catalog/templates/defaut/includes/js/create_account.js.php 2014-03-06 10:51:36 UTC (rev 5184)
@@ -43,7 +43,13 @@
required: true,
minlength: <?php echo ENTRY_LAST_NAME_MIN_LENGTH; ?>
},
- dob: "required",
+ <?php if (_cst_bool('ACCOUNT_GENDER')): ?>
+ dob: {
+ required: true,
+ date: true,
+ minlength:10
+ },
+ <?php endif; ?>
email_address: {
required: true,
email: true,
@@ -108,7 +114,13 @@
required: "<?php echo __('entry last name required'); ?>",
minlength: "<?php printf(__('entry last name error %s'), ENTRY_LAST_NAME_MIN_LENGTH); ?>"
},
- dob: "<?php echo ENTRY_DATE_OF_BIRTH_ERROR; ?>",
+ <?php if (_cst_bool('ACCOUNT_GENDER')): ?>
+ dob:{
+ date: "<?php echo __('entry date of birth is format'); ?>",
+ required: "<?php echo __('entry date of birth required'); ?>",
+ minlength: "<?php printf(__('entry date of birth error %s'), 10); ?>"
+ },
+ <?php endif; ?>
email_address: {
required: "<?php echo __('entry email address required'); ?>",
minlength: "<?php printf(__('entry last name error %s'), ENTRY_EMAIL_ADDRESS_MIN_LENGTH); ?>"
Modified: trunk/test/phpunit/Back/phpunittest.xml
===================================================================
--- trunk/test/phpunit/Back/phpunittest.xml 2014-03-04 16:57:37 UTC (rev 5183)
+++ trunk/test/phpunit/Back/phpunittest.xml 2014-03-06 10:51:36 UTC (rev 5184)
@@ -1,4 +1,24 @@
-<phpunit>
+<phpunit
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/3.7/phpunit.xsd"
+ backupGlobals="true"
+ backupStaticAttributes="false"
+ cacheTokens="true"
+ colors="true"
+ convertErrorsToExceptions="true"
+ convertNoticesToExceptions="true"
+ convertWarningsToExceptions="true"
+ forceCoversAnnotation="true"
+ mapTestClassNameToCoveredClassName="true"
+ printerClass="PHPUnit_TextUI_ResultPrinter"
+ processIsolation="false"
+ stopOnError="false"
+ stopOnFailure="false"
+ stopOnIncomplete="false"
+ stopOnSkipped="false"
+ testSuiteLoaderClass="PHPUnit_Runner_StandardTestSuiteLoader"
+ verbose="true"
+ >
<logging>
<log type="coverage-html" target="../../../html/rapport/admin/all" charset="UTF-8"
yui="true" highlight="false"
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2014-03-04 16:57:40
|
Revision: 5183
http://sourceforge.net/p/oscss/svn/5183
Author: oscim
Date: 2014-03-04 16:57:37 +0000 (Tue, 04 Mar 2014)
Log Message:
-----------
Fix
clean code
Modified Paths:
--------------
trunk/catalog/admin/includes/classes/drivers/sqlnewsletters_modeles.php
trunk/catalog/admin/includes/languages/fr_FR/Adminuser.txt
trunk/catalog/admin/includes/modules/pages/newslettersModeles.php
trunk/catalog/checkout_shipping_address.php
Modified: trunk/catalog/admin/includes/classes/drivers/sqlnewsletters_modeles.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlnewsletters_modeles.php 2014-02-28 15:55:20 UTC (rev 5182)
+++ trunk/catalog/admin/includes/classes/drivers/sqlnewsletters_modeles.php 2014-03-04 16:57:37 UTC (rev 5183)
@@ -12,31 +12,25 @@
@brief manage db update/insert/delete for navigation_links
*/
+error_reporting(E_ALL);
+require_once( DIR_FS_ADMIN . DIR_WS_CLASSES . 'SqlFilesDataDriverClass.php');
-
-
class sqlnewsletters_modeles
- implements ModSqlDataDriver{
+ extends SqlFilesDataDriverClass
+ implements ModSqlDataDriver
+ {
- public static $modules;
+ /**
+ @var boolean use submodule in this class
+ */
+ public $use_modules = false;
- 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();
+ new self();
$DB=Database::getInstance();
$error = 0 ;
$sql_data_array = array();
@@ -73,37 +67,63 @@
@brief update ligne in table configuration
*/
public static function update($option){
- self::getInstance();
+ new self();
+ $DB=Database::getInstance();
+ $error=0;
+ $specimen = self::Specimen();
if(!isset($option['id']))
- return 'id';
+ return false;
- $DB=Database::getInstance();
- $error = 0 ;
+
$where ='';
-
if(isset($option['id'])) $where .="AND nmodele_id = '".(int)$option['id']."' ";
if(isset($option['languages_id'])) $where .="AND languages_id = '".(int)$option['languages_id']."' ";
if(isset($option['status'])) $where .="AND status = '".(int)$option['status']."' ";
- if(isset($option['post']))
- $post = $option['post'];
+ $post =array();
+ if(isset($option['post'])){
+ $post=(array)$option['post'];
+ }
- $DB->beginTransaction();
+
+ $dataarray = (array)(isset($option['sqlarray'])? $option['sqlarray'] : array() );
- if(isset($post['status']))$sql_data_array['status'] = tep_db_prepare_input($post['status']);
- if(isset($post['title']))$sql_data_array['title'] = tep_db_prepare_input($post['title']);
- if(isset($post['content']))$sql_data_array['nmodele_content'] = tep_db_prepare_input($post['content']);
+ self::PrepaDataAfterUse( $specimen , $dataarray, $post );
- if(count((array)$sql_data_array)<= 0)
- return false;
+ $sql_data_array_prem = self::GetSqlArray();
+ $sql_data_array_lg = self::GetSqlArrayLg();
+
+// print_r($sql_data_array);
+// print_r($sql_data_array_lg);
+// exit;
+ $DB->beginTransaction();
- $sql_data_array['last_update'] = 'NOW()';
+
+ if(isset($sql_data_array_lg['lg']) && count($sql_data_array_lg['lg']) > 0){
+ foreach($sql_data_array_lg['lg'] as $key=>$sql_data_array){
+ $sql_data_array['last_update'] = 'NOW()';
+
+ if($sql_data_array_prem['status'])
+ $sql_data_array['status'] = $sql_data_array_prem['status'];
- if( !tep_db_perform(TABLE_NEWSLETTERS_MODELES, $sql_data_array, 'update' , substr($where,3) ) )
+ if( !tep_db_perform(TABLE_NEWSLETTERS_MODELES, $sql_data_array, 'update' , substr($where,3) ) )
$error++;
+ }
+ }
+// if(isset($post['status']))$sql_data_array['status'] = tep_db_prepare_input($post['status']);
+// if(isset($post['title']))$sql_data_array['title'] = tep_db_prepare_input($post['title']);
+// if(isset($post['content']))$sql_data_array['nmodele_content'] = tep_db_prepare_input($post['content']);
+// if(count((array)$sql_data_array)<= 0)
+// return false;
+//
+// $sql_data_array['last_update'] = 'NOW()';
+//
+// if( !tep_db_perform(TABLE_NEWSLETTERS_MODELES, $sql_data_array, 'update' , substr($where,3) ) )
+// $error++;
+
if( $error > 0){
$DB->rollbackTransaction();
return false;
@@ -136,7 +156,7 @@
*/
public static function fetch($option,$shortkey=false){
- self::getInstance();
+ new self();
$DB=Database::getInstance();
$where ="";
@@ -145,42 +165,53 @@
if(isset($option['status'])) $where .="AND status = '".(int)$option['status']."' ";
- if($where=='')
- return false;
-
-
$sql="SELECT * FROM " . TABLE_NEWSLETTERS_MODELES . " a ".
- " WHERE ".substr($where,3);
+ " WHERE 1 ".$where;
- $res=$DB->query($sql);
-
+ $res = $DB->query($sql);
$num = $res->__get('numRows');
- if($num == 1){
- $result=$res->fetchAssoc();
+ if($num == 1)
+ $cInfo_array[] = $res->fetchAssoc();
+ else
+ foreach($res->fetchAllAssoc() as $row)
+ $cInfo_array[] = $row;
+ foreach($cInfo_array as $row) {
+ $row['lg'] = array();
+
+ $catlg = array(
+ 'title'=>$row['title'],
+ 'nmodele_content'=>$row['nmodele_content']
+ );
+ $row['lg'][ $row['languages_id'] ] =((!$shortkey)? $catlg : self::CleanKey($catlg)) ;
+
+
+ $result[] = $row;
+ }
+
- return ((!$shortkey)? $result : self::CleanKey($result));
+ if($num == 1){
+ return ((!$shortkey)? $result[0] : self::CleanKey($result[0])) ;
}
elseif($num > 1){
$array=array();
- foreach($res->fetchAllAssoc() as $result)
- $array[]= ((!$shortkey)? $result : self::CleanKey($result));
+ foreach($result as $lg)
+ $array[]= ((!$shortkey)? $lg : self::CleanKey($lg));
return $array;
}
-
- return false;
+ return false;
}
/**
@brief delete row
*/
public static function delete($option){
- self::getInstance();
+ new self();
$DB=Database::getInstance();
$where ="";
@@ -208,27 +239,55 @@
@return array product empty
*/
public static function Specimen($shortkey=false){
+
+ new self();
+
+ $ListLanguages=tep_get_languages();
+
+ $tmp_lg = array();
+ for ($i=0, $n=sizeof($ListLanguages); $i<$n; $i++) {
+ $tmp = array(
+ 'nmodele_content' => '', // depend language table
+ 'title' => '', // depend language table
+ 'language_id' => $ListLanguages[$i]['id'],
+ );
+
+ $tmp_lg[$ListLanguages[$i]['id']] = ((!$shortkey)? $tmp : self::CleanKey($tmp));
+ }
+
+
$par = array(
- 'nmodele_id' => '',
- 'languages_id' => 1,
- 'status' => 0,
- 'date_added' => '',
- 'last_update' => '',
- 'title' => '',
- 'nmodele_content' => '',
+ 'nmodele_id' => '',
+ 'languages_id' => 1,
+ 'status' => 0,
+ 'date_added' => '',
+ 'last_update' => '',
+
+ // language table
+ 'lg' =>$tmp_lg,
);
return ((!$shortkey)? $par : self::CleanKey($par));
}
+
+ /**
+ @fn ExtractForm($data)
+ @brief extract data forms for put in db
+ @param $data array
+ @return array
+ */
+ public static function ExtractForm($data){
+
+ return self::ExtractDataForm(self::Specimen(), $data);
+ }
-
/**
@fn CleanKey()
@brief Clean string name key
*/
public static function CleanKey($array){
- self::getInstance();
+ new self();
$object= new stdclass();
foreach($array as $key=>$value){
Modified: trunk/catalog/admin/includes/languages/fr_FR/Adminuser.txt
===================================================================
--- trunk/catalog/admin/includes/languages/fr_FR/Adminuser.txt 2014-02-28 15:55:20 UTC (rev 5182)
+++ trunk/catalog/admin/includes/languages/fr_FR/Adminuser.txt 2014-03-04 16:57:37 UTC (rev 5183)
@@ -16,8 +16,8 @@
/* entry */
$lang['@adminUsers table heading id']="Id" ;
- $lang['@adminUsers table heading lastname']="Prénom" ;
- $lang['@adminUsers table heading firstname']="Nom" ;
+ $lang['@adminUsers table heading lastname']="Nom" ;
+ $lang['@adminUsers table heading firstname']="Prénom" ;
$lang['@adminUsers table heading email']="Email" ;
$lang['@adminUsers table heading groups name']="Groupe" ;
$lang['@adminUsers table heading lognum']="Accès" ;
Modified: trunk/catalog/admin/includes/modules/pages/newslettersModeles.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/newslettersModeles.php 2014-02-28 15:55:20 UTC (rev 5182)
+++ trunk/catalog/admin/includes/modules/pages/newslettersModeles.php 2014-03-04 16:57:37 UTC (rev 5183)
@@ -12,15 +12,24 @@
require_once(DIR_FS_ADMIN . DIR_WS_CLASSES .'ModTreePage.php');
+require_once(DIR_FS_ADMIN . DIR_WS_CLASSES .'listeners/EventMessListener.php');
/**
@class newslettersModeles
*/
class newslettersModeles
extends ModTreePage /// new abstract class for nextgen module
implements
- ExtModPage,
- InterfacedTJsonS,
- InterfaceModule {
+ InterfaceModule
+ ,ExtModConfig
+ ,InterfacedTJsonS
+ ,InterfacedInnerHtml
+
+ // Events Interface for display and exec all notification
+ , EventMessInterface
+
+ // Event propagation Action
+// , EventTriggersCacheInterface
+ {
const FILENAME ='newslettersModeles.php';
@@ -63,9 +72,14 @@
self::$modules=new AcaFactory(__CLASS__);
// Event
EventsHandlerActive::ActiveForClass(__CLASS__);
- //
- MGabCont::SetCurrentName(__CLASS__);
-
+ // instancie MLinkTo
+ MLinkTo::getInstance(self::$datatype);
+ // Set Name in MAster Gab
+ MGabCont::SetCurrentName(__CLASS__);
+ //
+ self::$languages = tep_get_languages();
+
+
/**
@remarks not load if not first init
*/
@@ -80,7 +94,6 @@
foreach(tep_get_languages() as $row)
$list_lg[] = array('id'=>$row['id'], 'text'=>$row['name']);
- MGabCont::SetCurrentName(__CLASS__);
/**
@remarks define var execution sql in GetDBValue()
@@ -109,21 +122,21 @@
'class'=>'tcenter',
'default'=>true,
);
- self::$allfields['nm.languages_id'] = array(
- 'sort'=>true,
- 'search'=>true,
- 'alias'=>'languages_id',
- 'text'=>__('newslettersmodeles table heading languages id'),
- 'width'=>'2%',
- 'class'=>'tcenter',
- 'default'=>true,
- 'edit'=>array(
- 'input_type'=>'select',
- 'input_size'=>'1',
- 'input_name'=>'languages_id',
- 'select_values'=>$list_lg,
- ),
- );
+// self::$allfields['nm.languages_id'] = array(
+// 'sort'=>true,
+// 'search'=>true,
+// 'alias'=>'languages_id',
+// 'text'=>__('newslettersmodeles table heading languages id'),
+// 'width'=>'2%',
+// 'class'=>'tcenter',
+// 'default'=>true,
+// 'edit'=>array(
+// 'input_type'=>'select',
+// 'input_size'=>'1',
+// 'input_name'=>'languages_id',
+// 'select_values'=>$list_lg,
+// ),
+// );
self::$allfields['nm.status'] = array(
'sort'=>true,
'search'=>true,
@@ -132,6 +145,17 @@
'width'=>'2%',
'class'=>'tcenter',
'default'=>true,
+ 'edit'=>array(
+ 'input_type'=>'radio',
+ 'input_size'=>'1',
+ 'input_name'=>'status',
+ 'values_list'=>array(
+ array('id'=>0, 'text'=>__('@products text status off') ),
+ array('id'=>1, 'text'=>__('@products text status on') ),
+ ),
+ 'position_col'=>'right',
+ 'position_grp'=>5
+ ),
);
self::$allfields['nm.title'] = array(
'sort'=>true,
@@ -142,10 +166,10 @@
'class'=>'tcenter',
'default'=>true,
'edit'=>array(
- 'input_name'=>'title',
+ 'input_name'=>'lg[title]',
'input_size'=>'64',
'required_status'=>true,
-// 'active_value_language'=>true,
+ 'active_value_language'=>true,
),
);
self::$allfields['nm.nmodele_content'] = array(
@@ -158,10 +182,10 @@
'default'=>true,
'edit'=>array(
'input_type'=>'textarea@advanced',
- 'input_name'=>'content',
- 'input_size'=>'1',
+ 'input_name'=>'lg[nmodele_content]',
+ 'input_size'=>'64',
'required_status'=>true,
-// 'active_value_language'=>true,
+ 'active_value_language'=>true,
),
);
self::$allfields['nm.date_added'] = array(
@@ -182,6 +206,18 @@
'class'=>'tcenter',
'default'=>true,
);
+
+// if( self::$action == 'edit' ){
+// self::$allfields['nm.last_update'] = array(
+// 'sort'=>true,
+// 'search'=>true,
+// 'alias'=>'modified',
+// 'text'=>__('newslettersmodeles table heading last update'),
+// 'width'=>'5%',
+// 'class'=>'tcenter',
+// 'default'=>true,
+// );
+// }
/// @remarks min fields and not view directly colonne fields
@@ -270,45 +306,45 @@
/**
@remarks Normal page
*/
- case 'insert':
- case 'update':
- $newsletter_id = self::$Id;
+// case 'insert':
+// case 'update':
+// $newsletter_id = self::$Id;
+//
+// $newsletter_module = tep_db_prepare_input($_POST['module']);
+// $title = tep_db_prepare_input($_POST['title']);
+// $content = tep_db_prepare_input($_POST['content']);
+//
+// $newsletter_error = false;
+//
+// if ($newsletter_error == false) {
+// $sql_data_array = array('languages_id' => 1,
+// 'nmodele_content' => $content,
+// 'title' => $title,
+// );
+//
+// if (self::$action == 'insert') {
+// $sql_data_array['date_added'] = 'now()';
+// $sql_data_array['status'] = '0';
+// // $sql_data_array['locked'] = '0';
+//
+// $res=tep_db_perform(TABLE_NEWSLETTERS_MODELES, $sql_data_array);
+// $newsletter_id = $res->__get('insertId');
+// }
+// elseif (self::$action == 'update') {
+// $sql_data_array['last_update'] = 'now()';
+// tep_db_perform(TABLE_NEWSLETTERS_MODELES, $sql_data_array, 'update', "nmodele_id = '" . (int)$newsletter_id . "'");
+// }
+//
+// tep_redirect(tep_href_link(self::FILENAME, 'cID=' . $newsletter_id));
+// } else {
+// //! init wisywyg
+// $oscss->_add_ext(BO_WISIWYG_SELECTED,'editeur/');
+// echo $oscss->_call(BO_WISIWYG_SELECTED,'_top','content','600','400');
+// }
+// break;
+//
- $newsletter_module = tep_db_prepare_input($_POST['module']);
- $title = tep_db_prepare_input($_POST['title']);
- $content = tep_db_prepare_input($_POST['content']);
- $newsletter_error = false;
-
- if ($newsletter_error == false) {
- $sql_data_array = array('languages_id' => 1,
- 'nmodele_content' => $content,
- 'title' => $title,
- );
-
- if (self::$action == 'insert') {
- $sql_data_array['date_added'] = 'now()';
- $sql_data_array['status'] = '0';
- // $sql_data_array['locked'] = '0';
-
- $res=tep_db_perform(TABLE_NEWSLETTERS_MODELES, $sql_data_array);
- $newsletter_id = $res->__get('insertId');
- }
- elseif (self::$action == 'update') {
- $sql_data_array['last_update'] = 'now()';
- tep_db_perform(TABLE_NEWSLETTERS_MODELES, $sql_data_array, 'update', "nmodele_id = '" . (int)$newsletter_id . "'");
- }
-
- tep_redirect(tep_href_link(self::FILENAME, 'cID=' . $newsletter_id));
- } else {
- //! init wisywyg
- $oscss->_add_ext(BO_WISIWYG_SELECTED,'editeur/');
- echo $oscss->_call(BO_WISIWYG_SELECTED,'_top','content','600','400');
- }
- break;
-
-
-
default:
parent::GenericAction();
@@ -418,6 +454,7 @@
@remarks Normal View Page
*/
case 'preview':
+ $MG = false;
self::$Info=self::GetDBValue(self::$Id);
break;
default:
@@ -425,7 +462,7 @@
}
if( ! empty($action) )
- return MGabCont::CallGab($action,__FUNCTION__, (($MG)?self::MASTER : __CLASS__) );
+ return MGabCont::CallGab($action,__FUNCTION__, (($MG)? self::MASTER : __CLASS__) );
}
Modified: trunk/catalog/checkout_shipping_address.php
===================================================================
--- trunk/catalog/checkout_shipping_address.php 2014-02-28 15:55:20 UTC (rev 5182)
+++ trunk/catalog/checkout_shipping_address.php 2014-03-04 16:57:37 UTC (rev 5183)
@@ -1,14 +1,15 @@
<?php
/**
- @licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
+ @licence GPL 2005-2014 The osCSS developers - osCSS Open Source E-commerce
@portion code Copyright (c) 2002 osCommerce
@package osCSS-2 <www http://www.oscss.org>
- @version 2.1.2
+ @version 2.2.0
@date 09/12/2013, 22:44
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
- *\file
- *\brief page display shipping choose and/or add address
+ @file checkout_shipping_address.php
+ @dir /
+ @brief page display shipping choose and/or add address
*/
require('includes/application_top.php');
@@ -46,26 +47,32 @@
// process a new shipping address
if (tep_not_null($_POST['firstname']) && tep_not_null($_POST['lastname']) && tep_not_null($_POST['street_address'])) {
- $cust=customer::getInstance($customer_id);
- $res=$cust->the_customer();
- $addBook=$cust->userLoadAddress($res['customers_default_address_id']);
+ $cust=customer::getInstance($customer_id);
+ $res=$cust->the_customer();
+ $addBook=$cust->userLoadAddress($res['customers_default_address_id']);
- /// if address book not completed, update
- if(empty($addBook['entry_gender']) && empty($addBook['entry_street_address']) )
- $res=$cust->userAddAddressBook($_POST, $addBook['address_book_id']);
- /// add new adress
- else
- $res=$cust->userAddAddressBook($_POST);
+ /// if address book not completed, update
+ if(empty($addBook['entry_gender']) && empty($addBook['entry_street_address']) )
+ $res=$cust->userAddAddressBook($_POST, $addBook['address_book_id']);
+ /// add new adress
+ else
+ $res=$cust->userAddAddressBook($_POST);
- if($res == false)
- tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING_ADDRESS, '', 'SSL'));
+ if($res == false)
+ tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING_ADDRESS, '', 'SSL'));
- if (!tep_session_is_registered('sendto')) tep_session_register('sendto');
- $sendto = tep_db_insert_id($res);
+ if (!tep_session_is_registered('sendto'))
+ tep_session_register('sendto');
+ $sendto = tep_db_insert_id($res);
- if (tep_session_is_registered('shipping')) tep_session_unregister('shipping');
+ if (tep_session_is_registered('shipping'))
+ tep_session_unregister('shipping');
- tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));
+ $_SESSION['country_id'] = $_POST['country'];
+ if (_cst_bool('ACCOUNT_STATE'))
+ $_SESSION['zone_id'] = $_POST['state_id'];
+
+ tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));
// process the selected shipping destination
} elseif (isset($_POST['address'])) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2014-02-28 15:55:24
|
Revision: 5182
http://sourceforge.net/p/oscss/svn/5182
Author: oscim
Date: 2014-02-28 15:55:20 +0000 (Fri, 28 Feb 2014)
Log Message:
-----------
Fix
Modified Paths:
--------------
trunk/catalog/admin/includes/gabarit/configuration/modstatus.listing.gab
trunk/catalog/admin/includes/modules/configuration/modstatus.php
trunk/catalog/admin/includes/modules/pages/header_tags.php
trunk/catalog/checkout_shipping_address.php
trunk/catalog/common/classes/FieldsDisplay.php
trunk/catalog/common/classes/osCSS_pdf.php
trunk/catalog/common/classes/price.php
trunk/catalog/common/classes/shoppingCart.php
trunk/catalog/includes/classes/ExtraFieldsUse.php
trunk/catalog/includes/classes/ModPublicOneShipping.php
trunk/catalog/includes/classes/navigation_history.php
trunk/catalog/includes/classes/shipping.php
trunk/catalog/templates/defaut/includes/gabarit/account/edit.gab
Modified: trunk/catalog/admin/includes/gabarit/configuration/modstatus.listing.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/configuration/modstatus.listing.gab 2014-02-25 14:16:22 UTC (rev 5181)
+++ trunk/catalog/admin/includes/gabarit/configuration/modstatus.listing.gab 2014-02-28 15:55:20 UTC (rev 5182)
@@ -49,7 +49,12 @@
<td class="tcenter" style="width:40px; background:<?php echo $item->status_color ?> url('includes/template/<?php echo $current_theme ?>/img/<?php echo $_SESSION['login_groups_id'] ?>/bg_graph.png') bottom left repeat-y;"><?php echo $item->status_color ?></td>
<td class="row_action">
<span class="view fils fleft">
- <?php echo '<a class="buttonimg" href="' . tep_href_link(FILENAME_CONFIGURATION, tep_get_all_get_params(array('action','sID')). 'sID=' .$item->status_id. '&action=edit') . '">' . tep_image(DIR_WS_ICONS . 'icon_edit.png',IMAGE_EDIT ). '</a> <a class="buttonimg" href="' . tep_href_link(FILENAME_CONFIGURATION, tep_get_all_get_params(array('action','sID')). 'sID=' . $item->status_id . '&action=delete') . '">' . tep_image(DIR_WS_ICONS . 'icon_delete.png',IMAGE_DELETE).'</a>'; ?>
+ <?php
+ printf(CsrtAction::getLink('row_action_right', IMAGE_EDIT , 'edit'), '', tep_href_link(FILENAME_CONFIGURATION, tep_get_all_get_params(array('action','sID')). 'sID=' .$item->status_id. '&action=edit','SSL', true, '') ,'' );
+
+ printf(CsrtAction::getLink('row_action_right', IMAGE_DELETE , 'delete'), '', tep_href_link(FILENAME_CONFIGURATION, tep_get_all_get_params(array('action','sID')). 'sID=' .$item->status_id. '&action=delete','SSL', true, '') ,'' );
+
+ ?>
</span>
<span class="fright">
<?php if ($item->status_id == @$_GET['sID']) { echo tep_image(DIR_WS_ICONS . 'icon_arrow_right.gif', ''); }
Modified: trunk/catalog/admin/includes/modules/configuration/modstatus.php
===================================================================
--- trunk/catalog/admin/includes/modules/configuration/modstatus.php 2014-02-25 14:16:22 UTC (rev 5181)
+++ trunk/catalog/admin/includes/modules/configuration/modstatus.php 2014-02-28 15:55:20 UTC (rev 5182)
@@ -12,9 +12,11 @@
La modification des status
*/
+error_reporting(E_ALL);
+Class modstatus
+ implements ext_configuration
+ {
-Class modstatus /*implements ext_configuration*/{
-
/**
@var array liste des type de status dispo
*/
@@ -163,14 +165,13 @@
$s ='<div class="button_nav">'."\n".
-// '<a class="button" href="'.tep_href_link(FILENAME_CONFIGURATION, tep_get_all_get_params(array('action','sID')).'action=addtype').'">'. tep_image(DIR_WS_ICONS.'icon_add_new.png' , __('Add status type',__CLASS__)).__('Add status type',__CLASS__).'</a>'."\n".
'<a class="button" href="'.tep_href_link(FILENAME_CONFIGURATION, tep_get_all_get_params(array('action','sID')).'action=add').'">'. tep_image(DIR_WS_ICONS.'icon_add_new.png' , __('add status',__CLASS__)).__('add status',__CLASS__).'</a>'."\n";
- $s .= tep_draw_form('statustype', FILENAME_CONFIGURATION,'', 'get', ' class=""');
+ $s .= tep_draw_form('statustype', FILENAME_CONFIGURATION,'gID=30&action=list', 'get', ' class=""');
$s .= '<p>'.
- tep_draw_hidden_field('gparentID',$_GET['gparentID']).
- tep_draw_hidden_field('gID',$_GET['gID']).
- tep_draw_hidden_field('action','list').
+ tep_draw_hidden_field('gparentID','gparentID',$_GET['gparentID']).
+ tep_draw_hidden_field('gID','gID',$_GET['gID']).
+ tep_draw_hidden_field('action','action','list').
tep_draw_pull_down_menu('type', $r, (isset($_GET['type']) ? $_GET['type'] : 'orders' ) , ' class="button" onchange="submit()"').
'</p>';
$s .= '</form>';
@@ -466,19 +467,12 @@
$contents = array('form' => tep_draw_form('status', FILENAME_CONFIGURATION, tep_get_all_get_params(array('action','sID')). '&sID=' . $oInfo->status_id . '&action=deleteconfirm'));
$contents[] = array('text' => __('text info delete intro'));
$contents[] = array('text' => '<strong>' . $oInfo->status_name . '</strong>');
- if (self::$remove_status) $contents[] = array('class' => 'button_nav','text' => tep_image_submit('button_delete.gif', IMAGE_DELETE) . ' <a class="button" href="' . tep_href_link(FILENAME_CONFIGURATION, tep_get_all_get_params(array('action','sID')). '&sID=' . $oInfo->status_id) . '">' . IMAGE_CANCEL . '</a>');
- break;
- default:
- if (isset($oInfo) && is_object($oInfo)) {
- $heading[] = array('text' => $oInfo->status_name );
-
- $languages = tep_get_languages();
- for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
- $txt=(isset($oInfo->name[$languages[$i]['id']]) ?$oInfo->name[$languages[$i]['id']] : '');
- $contents[] = array('text' => tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . ' ' . $txt );
- }
- }
+ $contents[] = array('class' => 'button_nav','text' => tep_image_submit('button_delete.gif', IMAGE_DELETE) . ' <a class="button" href="' . tep_href_link(FILENAME_CONFIGURATION, tep_get_all_get_params(array('action','sID')). '&sID=' . $oInfo->status_id) . '">' . IMAGE_CANCEL . '</a>');
break;
+
+
+ default:
+ break;
}
if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {
Modified: trunk/catalog/admin/includes/modules/pages/header_tags.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/header_tags.php 2014-02-25 14:16:22 UTC (rev 5181)
+++ trunk/catalog/admin/includes/modules/pages/header_tags.php 2014-02-28 15:55:20 UTC (rev 5182)
@@ -10,14 +10,37 @@
@dir admin/includes/modules/pages/
*/
+
+require_once(DIR_FS_ADMIN . DIR_WS_CLASSES .'ModOne.php');
+require_once(DIR_FS_ADMIN . DIR_WS_CLASSES .'listeners/EventMessListener.php');
+
+require_once(DIR_FS_CATALOG . DIR_WS_COMMON_CLASSES .'AbstractHeader_tags.php');
+
+
/**
@class header_tag
@extends common/classes/AbstractHeader_tags
*/
class header_tags
- extends AbstractHeader_tags
- implements ExtModPage {
+// extends AbstractHeader_tags
+ extends ModOne
+ implements
+ InterfaceModule,
+ /*IntModTwo, */ /// new interface module for nextgen module
+ ExtModConfig,
+
+
+ // this class send email
+// EventMail ,
+// EventNotif ,
+
+ // Events Interface for display and exec all notification
+ EventMessInterface
+
+// implements ExtModPage
+ {
+
const FILENAME = FILENAME_FULL_TAG;
/**
@param string
@@ -36,6 +59,10 @@
*/
public static $pInfo;
/**
+ @param object
+ */
+ public static $parent;
+ /**
Element systeme, non listé
@param array
*/
@@ -80,7 +107,11 @@
self::$code=__CLASS__;
global $language,$languages_id;
- parent::load_lang();
+
+ self::$parent = new AbstractHeader_tags();
+// var_dump(__file__.''. __line__);
+
+ self::$parent->load_lang();
self::$languages = tep_get_languages();
}
@@ -103,10 +134,12 @@
case 'update':
$_id = tep_db_prepare_input(self::$nameID);
- $com=parent::load_db_base($_id, $mode_key);
+ $com= self::$parent->load_db_base($_id, $mode_key);
- $myarray=array('page_type' => $mode_key,
- 'page_id' => $_id);
+ $myarray=array(
+ 'page_type' => $mode_key,
+ 'page_id' => $_id
+ );
if(isset($com->tag_id)){
tep_db_perform(TABLE_FULL_TAG, $myarray, 'update', " tag_id='".$com->tag_id."'" );
@@ -118,23 +151,26 @@
$tag_id=$products_query->__get('insertId');
}
- $com=parent::load_post_values($_POST);
+ $com= self::$parent->load_post($_POST);
$com->tag_id=$tag_id;
- $com2=parent::load_db_values($_id, $mode_key);
+ $com2= self::$parent->load_db($_id, $mode_key);
+
for ($i=0, $n=sizeof(self::$languages); $i<$n; $i++) {
- if(parent::load_db_descr_check($tag_id,self::$languages[$i]['id'])) $action='update';
- else $action='insert';
+ if( self::$parent->load_db_descr_check($tag_id,self::$languages[$i]['id']))
+ $action='update';
+ else
+ $action='insert';
- parent::insert_db_values($tag_id,$action,$com,self::$languages[$i]['id']);
+ self::$parent->insert_db_values($tag_id,$action, new objectInfo($com->header_tags) ,self::$languages[$i]['id']);
}
tep_redirect(tep_href_link(self::FILENAME, 'name='.self::$nameID.'&action=edit'));
break;
case 'edit':
$_id = tep_db_prepare_input(self::$nameID);
- $com=parent::load_db_values($_id, $mode_key);
+ $com= self::$parent->load_db($_id, $mode_key);
break;
default:
}
@@ -152,7 +188,7 @@
foreach (scan(DIR_FS_CATALOG . 'templates/' . TEMPLATE_NAME .'/'. DIR_WS_INCLUDES.'content/') as $file) {
if (substr("$file", -4) == '.php') {
$name=substr("$file",0,strlen($file)-4);
- if(!in_array($name, self::$not_list) && parent::get_prio_cms($name)==false ) {
+ if(!in_array($name, self::$not_list) && self::$parent->get_prio_cms($name)==false ) {
self::$list[]=array('file'=>$file, 'name'=>$name, 'key'=>$name);
@@ -164,7 +200,7 @@
foreach (scan(DIR_FS_CATALOG .'templates/' . DEFAULT_TEMPLATE_NAME .'/'. DIR_WS_INCLUDES.'content/') as $file) {
if (substr("$file", -4) == '.php') {
$name=substr("$file",0,strlen($file)-4);
- if(!in_array($name, self::$not_list) && parent::get_prio_cms($name)==false ) {
+ if(!in_array($name, self::$not_list) && self::$parent->get_prio_cms($name)==false ) {
self::$list[]=array('file'=>$file, 'name'=>$name, 'key'=>$name);
}
@@ -192,7 +228,7 @@
//! chosse page/generic
$mode_key=(isset($_GET['name']) && $_GET['name']=='generic')? 'generic' : 'page';
- self::$pInfo=new objectInfo(parent::load_db_values(@$_GET['name'],$mode_key));
+ self::$pInfo=new objectInfo( self::$parent->load_db(@$_GET['name'],$mode_key));
switch (self::$action) {
case 'edit':
@@ -227,51 +263,7 @@
return tep_get_include_contents(self::$code.'.form');
}
- /**
- @remarks implements InterfaceModule depend
- if module twin in backoffice, report all content install in the other module
- public function check() {return true;}
- public function install() {return true;}
- public function remove() {return true;}
- public function keys() {return array(); }
- */
- /**
- @fn check()
- @brief test if count all var , and keys is equal
- @return boolean true/false
- */
- function check() { return true; }
-
-
- /**
- @fn keys()
- @return array all key configuration define by this module
- */
- function keys() { return array(); }
-
- /**
- @fn install()
- @brief add all configuration
- @note
- - Modules can emarquer sql installation instructions, however, in the case of transverse information, or dependent of an extension, preferring the implementation of an extension, file with sql independent
- - please, pefix all var configuration by 'MODULE_OT__MODTYPENAME_MAJ_'
- - if module twin in backoffice, report all content install in the other module
- - Not use language in DB , but function :__()
- for MODULE_TOTO_ST
- var title MODULE_TOTO_ST_S (small description)
- var description MODULE_TOTO_ST_L (long description)
- */
- function install() { return false; }
-
- /**
- @fn remove()
- @brief delete all configuration
- @note
- - please, pefix all var configuration by 'MODULE_PAYMENT__MODTYPENAME_MAJ_'
- - if module twin in backoffice, report all content remove in the other module
- */
- function remove() { return false; }
}
?>
\ No newline at end of file
Modified: trunk/catalog/checkout_shipping_address.php
===================================================================
--- trunk/catalog/checkout_shipping_address.php 2014-02-25 14:16:22 UTC (rev 5181)
+++ trunk/catalog/checkout_shipping_address.php 2014-02-28 15:55:20 UTC (rev 5182)
@@ -82,13 +82,20 @@
$sendto = $_POST['address'];
- $check_address_query = tep_db_query("select count(*) as total from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$customer_id . "' and address_book_id = '" . (int)$sendto . "'");
+ $check_address_query = tep_db_query("select entry_zone_id as zone_id, entry_country_id as country_id from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$customer_id . "' and address_book_id = '" . (int)$sendto . "'");
$check_address = tep_db_fetch_array($check_address_query);
- if ($check_address['total'] == '1') {
- if ($reset_shipping == true) tep_session_unregister('shipping');
+ if (tep_db_num_rows($check_address_query) == 1 ) {
+ tep_session_unregister('shipping');
+
+ $_SESSION['country_id'] = $check_address['country_id'];
+ if (_cst_bool('ACCOUNT_STATE'))
+ $_SESSION['zone_id'] = $check_address['zone_id'];
+
+
tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));
- } else {
+ }
+ else {
tep_session_unregister('sendto');
}
} else {
Modified: trunk/catalog/common/classes/FieldsDisplay.php
===================================================================
--- trunk/catalog/common/classes/FieldsDisplay.php 2014-02-25 14:16:22 UTC (rev 5181)
+++ trunk/catalog/common/classes/FieldsDisplay.php 2014-02-28 15:55:20 UTC (rev 5182)
@@ -310,7 +310,7 @@
break;
case 4: // select
- $input .= self::draw_pull_down_menu($prefix, $rows->select_values, $rows->input_value, $params, ' class="form-control" ').$flag_r;
+ $input .= self::draw_pull_down_menu($prefix, $rows->select_values, $rows->input_value, $params , $rows->required_status).$flag_r;
break;
case 6: // select mutli
Modified: trunk/catalog/common/classes/osCSS_pdf.php
===================================================================
--- trunk/catalog/common/classes/osCSS_pdf.php 2014-02-25 14:16:22 UTC (rev 5181)
+++ trunk/catalog/common/classes/osCSS_pdf.php 2014-02-28 15:55:20 UTC (rev 5182)
@@ -132,20 +132,20 @@
@brief call module present for pdf
@param $pull_down boolean , format for pull down menu, or just array
*/
- public static function get_module($pull_down=true){
- global $messageStack;
- if (!is_dir(BATCH_PRINT_INC))
- $messageStack->add_session(sprintf(__("error problem opening directory %s "),BATCH_PRINT_INC), 'error');
+// public static function get_module($pull_down=true){
+// global $messageStack;
+// if (!is_dir(BATCH_PRINT_INC))
+// $messageStack->add_session(sprintf(__("error problem opening directory %s "),BATCH_PRINT_INC), 'error');
+//
+// $file_type_array = array();
+// foreach(scan(BATCH_PRINT_INC) as $file) {
+// $ext = strrchr($file, ".");
+// if ($ext == ".php")
+// if($pull_down) $file_type_array[] = array('id' => substr($file,0,-4),'text' => __('BP template '.str_replace(array('-'),array("_"),substr($file,0,-4))));
+// else $file_type_array[] = substr($file,0,-4);
+// }
+// return $file_type_array;
+// }
- $file_type_array = array();
- foreach(scan(BATCH_PRINT_INC) as $file) {
- $ext = strrchr($file, ".");
- if ($ext == ".php")
- if($pull_down) $file_type_array[] = array('id' => substr($file,0,-4),'text' => __('BP template '.str_replace(array('-'),array("_"),substr($file,0,-4))));
- else $file_type_array[] = substr($file,0,-4);
- }
- return $file_type_array;
- }
-
}
?>
\ No newline at end of file
Modified: trunk/catalog/common/classes/price.php
===================================================================
--- trunk/catalog/common/classes/price.php 2014-02-25 14:16:22 UTC (rev 5181)
+++ trunk/catalog/common/classes/price.php 2014-02-28 15:55:20 UTC (rev 5182)
@@ -156,18 +156,24 @@
* @return float
*/
private function get_db_products_price($products_id, $customers_group_id='NaN') {
- if ($customers_group_id == 'NaN') $customers_group_id = $this->get_customer_group_id();
+ if ($customers_group_id == 'NaN')
+ $customers_group_id = $this->get_customer_group_id();
$pid = tep_get_prid($products_id);
if ($customers_group_id > 0) { // recup prix spécifiqu au groupe
- $price_query = tep_db_query("select customers_group_price as products_price from " . TABLE_PRODUCTS_GROUPS . " where products_id = '" .$pid. "' and customers_group_id = '" . $customers_group_id . "'");
- if (tep_db_num_rows($price_query)) $products_price = tep_db_fetch_array($price_query);
+ $price_query = tep_db_query($sql = "select customers_group_price as products_price from " . TABLE_PRODUCTS_GROUPS . " where products_id = '" .$pid. "' and customers_group_id = '" . $customers_group_id . "'");
+
+
+ if (tep_db_num_rows($price_query))
+ $products_price = tep_db_fetch_array($price_query);
}
if (!isset($products_price['products_price'])) { // si pas de prix pour le groupe, recup prix général
$objectProduct=product::get_item($pid);
if(!$objectProduct)
return 0;
+
+
$products_price['products_price']=(float) $objectProduct->GetPrice();
}
@@ -240,6 +246,7 @@
$objectProduct=product::get_item($pid);
if(!$objectProduct)
return false;
+
return $this->get_tax_rate($objectProduct->GetTaxClassId(), $country_id, $zone_id);
}
@@ -556,26 +563,24 @@
Récupération du taux de la taxe d'un produit à partir de l'identifiant de la taxe
*/
public function get_tax_rate($class_id, $country_id = -1, $zone_id = -1) {
- global $customer_zone_id, $customer_country_id;
+ // Geolocalisation
+ if ( ($country_id == -1) && ($zone_id == -1) ){
+ $country_id = ( ( isset($_SESSION['customer_zone_id']) && $_SESSION['customer_zone_id'] > 0) ? $_SESSION['customer_zone_id'] : STORE_COUNTRY );
+ $zone_id = ( ( isset($_SESSION['customer_country_id']) && $_SESSION['customer_country_id'] > 0) ? $_SESSION['customer_country_id'] : STORE_ZONE );
+ }
+
// Gestion de l'exemption totale de taxe
- if (self::is_SPPC_tax_exempt()) return 0;;
+ if (self::is_SPPC_tax_exempt())
+ return 0;
- // Geolocalisation
- if ( ($country_id == -1) && ($zone_id == -1) ) {
- if (!tep_session_is_registered('customer_id')) {
- $country_id = STORE_COUNTRY;
- $zone_id = STORE_ZONE;
- } else {
- $country_id = $customer_country_id;
- $zone_id = $customer_zone_id;
- }
- }
- if(isset(self::$_taxrate_Cache[(int)$country_id .'_'.(int)$zone_id .'_'.(int)$class_id])) return self::$_taxrate_Cache[(int)$country_id .'_'.(int)$zone_id .'_'.(int)$class_id];
+ if(isset(self::$_taxrate_Cache[(int)$country_id .'_'.(int)$zone_id .'_'.(int)$class_id]))
+ return self::$_taxrate_Cache[(int)$country_id .'_'.(int)$zone_id .'_'.(int)$class_id];
- $tax_query = tep_db_query("select sum(tax_rate) as tax_rate from " . TABLE_TAX_RATES . " tr left join " . TABLE_ZONES_TO_GEO_ZONES . " za on (tr.tax_zone_id = za.geo_zone_id) left join " . TABLE_GEO_ZONES . " tz on (tz.geo_zone_id = tr.tax_zone_id) where (za.zone_country_id is null or za.zone_country_id = '0' or za.zone_country_id = '" . (int)$country_id . "') and (za.zone_id is null or za.zone_id = '0' or za.zone_id = '" . (int)$zone_id . "') and tr.tax_class_id = '" . (int)$class_id . "' " . self::get_SPPC_sql_specific_tax_exemption() . " group by tr.tax_priority");
+ $tax_query = tep_db_query($sql = "select sum(tax_rate) as tax_rate from " . TABLE_TAX_RATES . " tr left join " . TABLE_ZONES_TO_GEO_ZONES . " za on (tr.tax_zone_id = za.geo_zone_id) left join " . TABLE_GEO_ZONES . " tz on (tz.geo_zone_id = tr.tax_zone_id) where (za.zone_country_id is null or za.zone_country_id = '0' or za.zone_country_id = '" . (int)$country_id . "') and (za.zone_id is null or za.zone_id = '0' or za.zone_id = '" . (int)$zone_id . "') and tr.tax_class_id = '" . (int)$class_id . "' " . self::get_SPPC_sql_specific_tax_exemption() . " group by tr.tax_priority");
- if (!tep_db_num_rows($tax_query)) return self::$_taxrate_Cache[(int)$country_id .'_'.(int)$zone_id .'_'.(int)$class_id] = 0;
+ if (!tep_db_num_rows($tax_query))
+ return self::$_taxrate_Cache[(int)$country_id .'_'.(int)$zone_id .'_'.(int)$class_id] = 0;
$tax_multiplier = 1.0;
while ($tax = tep_db_fetch_array($tax_query)) {
@@ -657,6 +662,7 @@
$res_array=$this->calcul_price($products_id,$products_price, $products_tax_rate, $specials_products_price ,1, $tax_force);
+
$style = strtolower($style);
$output_price = $this->currency_format($res_array['price_ttc']).($tax_sym?$this->display_tax_symbol($style):'');
@@ -704,21 +710,15 @@
* @param $zone_id
*/
public function get_tax_description($class_id, $country_id, $zone_id) {
-
- if($class_id<=0)
- return '';
// Gestion de l'exemption totale de taxe
- if (self::is_SPPC_tax_exempt())
- return '';
+ if (self::is_SPPC_tax_exempt()) return '';
- if(isset(self::$_taxdesc_Cache[(int)$country_id .'_'.(int)$zone_id .'_'.(int)$class_id]) )
- return self::$_taxdesc_Cache[(int)$country_id .'_'.(int)$zone_id .'_'.(int)$class_id];
+ if(isset(self::$_taxdesc_Cache[(int)$country_id .'_'.(int)$zone_id .'_'.(int)$class_id]) ) return self::$_taxdesc_Cache[(int)$country_id .'_'.(int)$zone_id .'_'.(int)$class_id];
- $tax_query = tep_db_query("select tax_description from " . TABLE_TAX_RATES . " tr left join " . TABLE_ZONES_TO_GEO_ZONES . " za on (tr.tax_zone_id = za.geo_zone_id) left join " . TABLE_GEO_ZONES . " tz on (tz.geo_zone_id = tr.tax_zone_id) where (za.zone_country_id is null or za.zone_country_id = '0' or za.zone_country_id = '" . (int)$country_id . "') and (za.zone_id is null or za.zone_id = '0' or za.zone_id = '" . (int)$zone_id . "') and tr.tax_class_id = '" . (int)$class_id . "' " . self::get_SPPC_sql_specific_tax_exemption() . " order by tr.tax_priority");
+ $tax_query = tep_db_query($sql = "select tax_description from " . TABLE_TAX_RATES . " tr left join " . TABLE_ZONES_TO_GEO_ZONES . " za on (tr.tax_zone_id = za.geo_zone_id) left join " . TABLE_GEO_ZONES . " tz on (tz.geo_zone_id = tr.tax_zone_id) where (za.zone_country_id is null or za.zone_country_id = '0' or za.zone_country_id = '" . (int)$country_id . "') and (za.zone_id is null or za.zone_id = '0' or za.zone_id = '" . (int)$zone_id . "') and tr.tax_class_id = '" . (int)$class_id . "' " . self::get_SPPC_sql_specific_tax_exemption() . " order by tr.tax_priority");
- if (!tep_db_num_rows($tax_query))
- return self::$_taxdesc_Cache[(int)$country_id .'_'.(int)$zone_id .'_'.(int)$class_id] = TEXT_UNKNOWN_TAX_RATE;
+ if (!tep_db_num_rows($tax_query)) return self::$_taxdesc_Cache[(int)$country_id .'_'.(int)$zone_id .'_'.(int)$class_id] = TEXT_UNKNOWN_TAX_RATE;
$tax_description = '';
while ($tax = tep_db_fetch_array($tax_query)) {
Modified: trunk/catalog/common/classes/shoppingCart.php
===================================================================
--- trunk/catalog/common/classes/shoppingCart.php 2014-02-25 14:16:22 UTC (rev 5181)
+++ trunk/catalog/common/classes/shoppingCart.php 2014-02-28 15:55:20 UTC (rev 5182)
@@ -56,7 +56,7 @@
/**
*/
function __construct() {
- if (tep_session_is_registered('customer_id'))
+ if (tep_session_is_registered('customer_id')&& $_SESSION['customer_id']>0)
self::$_session = new CartStockageCustomer();
else
self::$_session = new CartStockage();
Modified: trunk/catalog/includes/classes/ExtraFieldsUse.php
===================================================================
--- trunk/catalog/includes/classes/ExtraFieldsUse.php 2014-02-25 14:16:22 UTC (rev 5181)
+++ trunk/catalog/includes/classes/ExtraFieldsUse.php 2014-02-28 15:55:20 UTC (rev 5182)
@@ -3,7 +3,7 @@
@licence GPL 2005-2014 The osCSS developers - osCSS Open Source E-commerce
@package osCSS-2 <www http://www.oscss.org>
@version 2.2.0
- @date 20/02/2014, 09:17
+ @date 218/02/2014, 09:17
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
@file ExtraFieldsUse.php
@@ -86,7 +86,7 @@
ce.fields_active_value_language,
ce.fields_value_list,
- ce.fields_size,
+ ce.fields_size as fields_input_size,
ce.fields_input_type,
ce.fields_input_value,
@@ -140,14 +140,27 @@
$robj->input_size = (int) $extra_fields['fields_input_size'];
$robj->input_value = $value;
$robj->input_format = $extra_fields['format'];
- $robj->required_status = $extra_fields['fields_required_status'];
+ $robj->required_status = (int)$extra_fields['fields_required_status'];
$robj->values_list = explode("\n", $extra_fields['fields_input_value']);
if($extra_fields['fields_value_list'] == 1)
- $robj->select_values = self::GetExtraFieldsValue($extra_fields['fields_id'], (($extra_fields['fields_active_value_language']==1)? self::$language_id : 0 ) );
+
+
+ $tmp = self::GetExtraFieldsValue($extra_fields['fields_id'], (($extra_fields['fields_active_value_language']==1)? self::$language_id : 0 ) );
+
+ if(!$robj->required_status){
+ $robj->select_values = array( array('id'=>'', 'text'=>'--') );
+ foreach($tmp as $row)
+ $robj->select_values[] = $row;
+ }
+ else
+ $robj->select_values = $tmp ;
+// if($robj->required_status)
+// array_unshift($robj->select_values, array('id'='', 'text'=>'--') );
+
// foreach($robj->values_list as $item)
// {
// $item = trim($item);
@@ -188,7 +201,7 @@
$DB=Database::getInstance();
$list = self::GetExtraFields($epfid,$epfkey);
-
+ $extra_fields_string = '';
foreach($list as $robj ){
foreach($opt as $key=>$row)
Modified: trunk/catalog/includes/classes/ModPublicOneShipping.php
===================================================================
--- trunk/catalog/includes/classes/ModPublicOneShipping.php 2014-02-25 14:16:22 UTC (rev 5181)
+++ trunk/catalog/includes/classes/ModPublicOneShipping.php 2014-02-28 15:55:20 UTC (rev 5182)
@@ -205,14 +205,35 @@
@return none
*/
public function update_status( IntShippingDepend $objectRef ) {
+
if ($this->GetEnabled()) {
- $cst = 'MODULE_SHIPPING_'.$this->code.'_ZONE';
+ $cst = 'MODULE_SHIPPING_'.strtoupper($this->code).'_ZONE';
if(!defined($cst))
return $this->SetEnabled(true);
-
+
$cst = constant($cst);
- if ( ((int)$cst > 0) && ((int)$cst == shipping::getGeoZoneID($order->delivery['country']['id'], $order->delivery['zone_id'])) )
+ $list_interface = class_implements($this->code);
+
+ if(get_class($objectRef) =='shoppingCart' ) {
+ $country = @$_SESSION['country_id'];
+ if (_cst_bool('ACCOUNT_STATE'))
+ $zone_id = @$_SESSION['zone_id'];
+ }
+ elseif( get_class($objectRef) =='Order' ) {
+ $country = $objectRef->delivery['country']['id'];
+ if (_cst_bool('ACCOUNT_STATE'))
+ $zone_id = $objectRef->delivery['zone_id'];
+ }
+
+ if($country<=0 )
+ $country = STORE_COUNTRY;
+
+
+ if(_cst_bool('ACCOUNT_STATE') && $zone_id<=0 )
+ $zone_id = STORE_ZONE;
+
+ if ( ((int)$cst > 0) && in_array( (int)$cst , shipping::getGeoZoneID($country, $zone_id ) ) )
return $this->SetEnabled(true);
elseif ((int)$cst == 0)
return $this->SetEnabled(true);
Modified: trunk/catalog/includes/classes/navigation_history.php
===================================================================
--- trunk/catalog/includes/classes/navigation_history.php 2014-02-25 14:16:22 UTC (rev 5181)
+++ trunk/catalog/includes/classes/navigation_history.php 2014-02-28 15:55:20 UTC (rev 5182)
@@ -58,6 +58,7 @@
self::$_id = self::MAX_NAVSESSION ;
}
+
if(is_array($this->path))
foreach($this->path as $k=>$row)
$this->NoDbl[$k] =$row['link'] ;
@@ -66,6 +67,8 @@
$this->reset();
self::$_id = sizeof($this->path);
+
+// print_r($this->path);
}
/**
@@ -108,7 +111,7 @@
if(
( isset($this->NoDbl[(self::$_id-1)]) && $array['url'] == $this->NoDbl[(self::$_id-1)] )
- || in_array(trim($page), array('document.php', 'ajax_exe.php', '404.php',FILENAME_LOGOFF))
+ || in_array(trim($page), array('default.php','checkout_.php','checkout_shipping.php','checkout_payment.php','checkout_confirmation.php','checkout.php','document.php', 'ajax_exe.php', '404.php', FILENAME_LOGOFF))
|| isset($_REQUEST['action'])
|| isset($_REQUEST['cache'])
)
Modified: trunk/catalog/includes/classes/shipping.php
===================================================================
--- trunk/catalog/includes/classes/shipping.php 2014-02-25 14:16:22 UTC (rev 5181)
+++ trunk/catalog/includes/classes/shipping.php 2014-02-28 15:55:20 UTC (rev 5182)
@@ -105,15 +105,20 @@
@return false KO , Or OK array
*/
public function GetSelected(){
+
+ if(!is_object($this->ObjectRef))
+ return false;
+
if(isset($this->modules[$this->_module])){
- if( count($this->_quotes)>0 )
- $quotes_l = $this->_quotes;
- else{
- $sub = $this->modules[$this->_module];
-
- $quotes_l = array($sub->quote($this->_method, $this->ObjectRef));
- }
+ $sub = $this->modules[$this->_module];
+
+ $sub->update_status( $this->ObjectRef );
+
+ if( ! $sub->GetEnabled() )
+ return false;
+
+ $quotes_l = array($sub->quote($this->_method, $this->ObjectRef));
foreach($quotes_l as $quotes){
foreach($quotes['methods'] as $quote)
@@ -278,7 +283,7 @@
public function cheapest() {
- if( count($this->_quotes)<=0 )
+// if( count($this->_quotes)<=0 )
$this->quote('',$this->ObjectRef);
$rates = array();
@@ -325,31 +330,35 @@
@param $country_id \a int de customers venant de order
@param $zone_id \a int de customers venant de order
*/
- protected static function getGeoZoneID($country_id, $zone_id) {
- $cache=array();
- static $cache;
+ public static function getGeoZoneID($country_id, $zone_id) {
- $key = 'country_'.(int)$country_id.'zone_'.(int)$zone_id;
- if(isset($cache[$key])) return $cache[$key];
-
$DB=Database::getInstance();
+
+ if (_cst_bool('ACCOUNT_STATE')) {
// First, check for a Geo Zone that explicity includes the country & specific zone (useful for splitting countries with zones up)
- $zone_query = $DB->query("select gz.geo_zone_id from " . TABLE_GEO_ZONES . " gz left join " . TABLE_ZONES_TO_GEO_ZONES . " ztgz on (gz.geo_zone_id = ztgz.geo_zone_id) where ztgz.zone_country_id = '" . (int)$country_id . "' and ztgz.zone_id = '" . (int)$zone_id . "' and LOWER(gz.geo_zone_name) like 'shp%'");
-
- if ($zone_query->__get('numRows')) {
- $zone = $zone_query->fetchAssoc();
- return $cache[$key]=$zone['geo_zone_id'];
- }
+ $zone_query = $DB->query($sql = "select gz.geo_zone_id from " . TABLE_GEO_ZONES . " gz left join " . TABLE_ZONES_TO_GEO_ZONES . " ztgz on (gz.geo_zone_id = ztgz.geo_zone_id) where ztgz.zone_country_id = '" . (int)$country_id . "' and ztgz.zone_id = '" . (int)$zone_id . "' and LOWER(gz.geo_zone_name) like 'shp%'");
+// echo $sql;
+ if ($zone_query->__get('numRows') > 0) {
+ $list = array();
+ foreach($zone_query->fetchAllAssoc() as $row)
+ $list[] = $row['id'];
+
+ return $list;
+ }
+ }
else {
// No luck… Now check for a Geo Zone for the country and "All Zones" of the country.
- $zone_query = $DB->query("select gz.geo_zone_id from " . TABLE_GEO_ZONES . " gz left join " . TABLE_ZONES_TO_GEO_ZONES . " ztgz on (gz.geo_zone_id = ztgz.geo_zone_id) where ztgz.zone_country_id = '" . (int)$country_id . "' and (ztgz.zone_id = '0' or ztgz.zone_id is NULL) and LOWER(gz.geo_zone_name) like 'shp%'");
-
- if ($zone_query->__get('numRows')) {
- $zone = $zone_query->fetchAssoc();
- return $cache[$key]=$zone['geo_zone_id'];
+ $zone_query = $DB->query($sql ="select gz.geo_zone_id as id from " . TABLE_GEO_ZONES . " gz left join " . TABLE_ZONES_TO_GEO_ZONES . " ztgz on (gz.geo_zone_id = ztgz.geo_zone_id) where ztgz.zone_country_id = '" . (int)$country_id . "' and (ztgz.zone_id = '0' OR ztgz.zone_id is NULL) and LOWER(gz.geo_zone_name) like 'shp%'");
+// echo $sql;
+ if ($zone_query->__get('numRows') > 0 ) {
+ $list = array();
+ foreach($zone_query->fetchAllAssoc() as $row)
+ $list[] = $row['id'];
+
+ return $list;
}
}
- return $cache[$key]=false;
+ return false;
}
/**
Modified: trunk/catalog/templates/defaut/includes/gabarit/account/edit.gab
===================================================================
--- trunk/catalog/templates/defaut/includes/gabarit/account/edit.gab 2014-02-25 14:16:22 UTC (rev 5181)
+++ trunk/catalog/templates/defaut/includes/gabarit/account/edit.gab 2014-02-28 15:55:20 UTC (rev 5182)
@@ -53,10 +53,12 @@
<?php if ( $page->_draw_in_page('ACCOUNT_DOB')): ?>
- <li class="BlockRows">
- <label for="accountEditDob"><?php echo ENTRY_DATE_OF_BIRTH; ?></label>
- <?php echo tep_draw_input_field('dob','accountEditDob', tep_date_short($cust['customers_dob'])) . ' ' . (tep_not_null(ENTRY_DATE_OF_BIRTH_TEXT) ? '<span class="inputRequirement">' . ENTRY_DATE_OF_BIRTH_TEXT . '</span>': ''); ?>
- </li>
+ <div class="form-group">
+ <label for="addyLastname" class="col-sm-2 control-label"><?php echo __('entry date of birth'); ?></label>
+ <div class="col-sm-10">
+ <?php echo tep_draw_input_field('dob','accountEditDob',(($cust['customers_dob'] !='1000-01-01') ? tep_date_short($cust['customers_dob']) : '' ) , ' class="form-control form-control-static" placeholder="'. __('entry date of birth').'" '); ?>
+ </div>
+ </div>
<?php endif; ?>
@@ -89,6 +91,7 @@
<?php echo tep_get_extra_fields('customer', $cust['customers_id'],'','telephone');?>
</fieldset>
+
<fieldset class="account">
<legend><?php echo __('category extra fields') ?></legend>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2014-02-25 14:16:27
|
Revision: 5181
http://sourceforge.net/p/oscss/svn/5181
Author: oscim
Date: 2014-02-25 14:16:22 +0000 (Tue, 25 Feb 2014)
Log Message:
-----------
Clean code
Fix view page in FrontEnd
Modified Paths:
--------------
trunk/catalog/common/classes/datatype_drivers/Data_featured.php
Modified: trunk/catalog/common/classes/datatype_drivers/Data_featured.php
===================================================================
--- trunk/catalog/common/classes/datatype_drivers/Data_featured.php 2014-02-24 14:37:33 UTC (rev 5180)
+++ trunk/catalog/common/classes/datatype_drivers/Data_featured.php 2014-02-25 14:16:22 UTC (rev 5181)
@@ -1,15 +1,19 @@
<?php if (!defined('HTTP_SERVER')) die('You can not access this file directly!');
/**
- @licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
- @portion code Copyright (c) 2002 osCommerce
- @package osCSS-2 <www http://www.oscss.org>
- @version 2.1.1
- @date 16/03/2012, 16:16
- @author oscim <mail aur...@os...> <www http://www.oscim.fr>
- @encode UTF-8
+ @licence GPL 2005-2014 The osCSS developers - osCSS Open Source E-commerce
+ @portion code Copyright (c) 2002 osCommerce
+ @package osCSS-2 <www http://www.oscss.org>
+ @version 2.2.0
+ @date 16/03/2012, 16:16
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+ @file Data_featured.php
+ @dir common/classes/datatype_drivers/
*/
-
+/**
+ @class Data_featured
+*/
class Data_featured
implements
DataTypesData,
@@ -129,8 +133,8 @@
*/
public function is_type($mode='unique'){
-
- if( isset($_GET['featured']) )
+// print_r($_GET);
+// if( isset($_GET['featured']) )
switch(strtolower($mode)){
case 'preload_root':
@@ -144,14 +148,15 @@
}
break;
- case 'transversal':
+ case 'transversal':
+ case 'listing':
+// case 'unique':
+ if( isset($_GET['featured']) && is_numeric($_GET['featured']) )
return true;
break;
- case 'listing':
- return true;
- break;
// listing mode, block home page
case 'unique':
+ if( isset($_GET['featured']) && is_numeric($_GET['featured']) )
DataTypes::ForceChilds($this->DataType, 'product');
break;
}
@@ -182,20 +187,50 @@
public function SeoGetQuery($mode, $subtype, $id, $language_id){
$DB=Database::getInstance();
+// switch($mode){
+// default:
+// $sql = "SELECT row_id as ID , featured_title as tName FROM ".TABLE_FEATURED." f LEFT JOIN ".TABLE_FEATURED_DESCRIPTION." fd ON(fd.featured_id = f.row_id AND languages_id ='".(int)$language_id."' ) WHERE row_id='".(int)$id."' LIMIT 1";
+// $rsql = $DB->query($sql);
+// $result = $rsql->fetchAssoc();
+// $result['head_desc_tag']='';
+// $result['head_keywords_tag']='';
+//
+// $result['sql']=$sql;
+// }
+
switch($mode){
default:
- $sql = "SELECT row_id as ID , featured_title as tName FROM ".TABLE_FEATURED." f LEFT JOIN ".TABLE_FEATURED_DESCRIPTION." fd ON(fd.featured_id = f.row_id AND languages_id ='".(int)$language_id."' ) WHERE row_id='".(int)$id."' LIMIT 1";
+// $sql = "SELECT categories_name as tName FROM ".TABLE_CATEGORIES_DESCRIPTION." WHERE categories_id='".(int)$id."' AND language_id='".(int)$language_id."' LIMIT 1";
+ $sql = "SELECT featured_id as ID , featured_title as tName FROM ".TABLE_FEATURED_DESCRIPTION." fd WHERE featured_id='".(int)$id."' AND languages_id='".(int)$language_id."' LIMIT 1";
+
$rsql = $DB->query($sql);
$result = $rsql->fetchAssoc();
- $result['head_desc_tag']='';
- $result['head_keywords_tag']='';
-
$result['sql']=$sql;
}
return $result;
+
}
+
+
+
+ public function SeoCacheQuery(){
+ global $languages_id;
+ $DB=Database::getInstance();
+ $return_array = array();
+
+ $sql= "select pd.featured_id as ID ,IF(featured_title <>'', featured_title , head_title_tag) as tName, head_desc_tag, head_keywords_tag from " . TABLE_FEATURED_DESCRIPTION . " pd LEFT JOIN " . TABLE_FULL_TAG . " ft ON(ft.page_id=pd.featured_id AND ft.page_type='featured') LEFT JOIN ".TABLE_FULL_TAG_DESCRIPTION . " ftd ON(ft.tag_id=ftd.tag_id and ftd.language_id = '" . (int)$languages_id. "') WHERE pd.languages_id = '" . (int)$languages_id. "' " ;
+
+ $res=$DB->query($sql );
+
+ while ($result =$res->fetchAssoc()){
+ $result['path']= $result['tName'] ;
+ $return_array[] = array ($result['ID'], $result, 'FEATURED') ;
+ }
+
+ return $return_array;
+ }
/**
@brief chargement des données transversal
@param $listing object page driver listing
@@ -210,10 +245,9 @@
$category_depth = $page->GetVar('category_depth');
$page->init('featured.php',$language);
- $this->ChildsType = $type;
+ $this->ChildsType = $type;
-
-
+
/// get the categorie name and put it on the header
if (isset($_GET['featured'])) {
@@ -246,7 +280,9 @@
- $listing->QueryAddWhere( " AND ".$this->listing_sql['col_count']." = '".$_GET['featured']."' ");
+ $listing->QueryAddWhere( " AND ".$this->p."data.datatype_parent_id = '".$_GET['featured']."' ");
+
+ return true;
}
}
@@ -269,13 +305,13 @@
@remarks put filename in template content/ specifi c
or no retrun for normal page listing
*/
- return 'featuredHeaderListing.php';
+// return 'featuredHeaderListing.php';
break;
}
- return $page_content;
+ return ;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2014-02-24 14:37:35
|
Revision: 5180
http://sourceforge.net/p/oscss/svn/5180
Author: oscim
Date: 2014-02-24 14:37:33 +0000 (Mon, 24 Feb 2014)
Log Message:
-----------
Fix
Modified Paths:
--------------
trunk/catalog/includes/classes/category_tree.php
Modified: trunk/catalog/includes/classes/category_tree.php
===================================================================
--- trunk/catalog/includes/classes/category_tree.php 2014-02-22 15:15:03 UTC (rev 5179)
+++ trunk/catalog/includes/classes/category_tree.php 2014-02-24 14:37:33 UTC (rev 5180)
@@ -79,7 +79,7 @@
$sql = " AND cat.categories_hidden='1' ";
if($this->datatype !=false)
- $sql .= "AND cat.categories_datatype IN (".$this->datatype.") ";
+ $sql .= "AND cat.categories_datatype IN ('".$this->datatype."') ";
categorie::add_where_query($sql);
$list = categorie::get_query('','','',array('limit'=>0));
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|