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-02-08 17:03:29
|
Revision: 5129
http://sourceforge.net/p/oscss/svn/5129
Author: oscim
Date: 2014-02-08 17:03:24 +0000 (Sat, 08 Feb 2014)
Log Message:
-----------
Fix
Next develop for ameliored process and transversal action propagation
add new class event and implement in Backoffice
Next clean and reduction code in sqlxxx files
Modified Paths:
--------------
trunk/catalog/admin/includes/application_top.php
trunk/catalog/admin/includes/classes/MLinkTo.php
trunk/catalog/admin/includes/classes/ModTree.php
trunk/catalog/admin/includes/classes/ModTreePage.php
trunk/catalog/admin/includes/classes/SqlFilesDataDriverClass.php
trunk/catalog/admin/includes/classes/drivers/sqladmingroups.php
trunk/catalog/admin/includes/classes/drivers/sqladminuser.php
trunk/catalog/admin/includes/classes/drivers/sqlcategorie.php
trunk/catalog/admin/includes/classes/drivers/sqlcontent.php
trunk/catalog/admin/includes/classes/drivers/sqlfeatured.php
trunk/catalog/admin/includes/classes/drivers/sqllinkto.php
trunk/catalog/admin/includes/classes/drivers/sqlproduct.php
trunk/catalog/admin/includes/classes/oscss_cstr.php
trunk/catalog/admin/includes/classes/productUtility.php
trunk/catalog/admin/includes/functions/general.php
trunk/catalog/admin/includes/gabarit/categories/rightto.edit.gab
trunk/catalog/admin/includes/gabarit/featureds/edit.tab.childs.gab
trunk/catalog/admin/includes/gabarit/usersNotif/display_view.view.gab
trunk/catalog/admin/includes/javascript/modules/pages/adminUsers.js.php
trunk/catalog/admin/includes/languages/fr_FR/Categorie.txt
trunk/catalog/admin/includes/languages/fr_FR/Product.txt
trunk/catalog/admin/includes/modules/pages/adminGroup.php
trunk/catalog/admin/includes/modules/pages/adminUsers.php
trunk/catalog/admin/includes/modules/pages/categories.php
trunk/catalog/admin/includes/modules/pages/cms_content.php
trunk/catalog/admin/includes/modules/pages/products.php
trunk/catalog/admin/includes/modules/pages/usersNotif.php
trunk/catalog/admin/includes/modules/products/desc_base.php
trunk/catalog/common/classes/osCSS_Cache.php
Added Paths:
-----------
trunk/catalog/admin/includes/classes/EventsHandlerActive.php
trunk/catalog/admin/includes/classes/event_drivers/
trunk/catalog/admin/includes/classes/event_drivers/EventMess.php
trunk/catalog/admin/includes/classes/event_drivers/EventNotification.php
trunk/catalog/admin/includes/classes/event_drivers/EventTriggersCache.php
trunk/catalog/admin/includes/classes/event_drivers/EventTriggersSqlMaintenance.php
trunk/catalog/admin/includes/classes/listeners/EventMessListener.php
trunk/catalog/admin/includes/classes/listeners/EventNotificationListener.php
trunk/catalog/admin/includes/classes/listeners/EventTriggersCacheListener.php
trunk/catalog/admin/includes/classes/listeners/EventTriggersSqlMaintenanceListener.php
trunk/catalog/admin/includes/gabarit/adminGroup/edit.tab.acl.gab
trunk/catalog/admin/includes/gabarit/adminGroup/edit.tab.childs.gab
trunk/catalog/common/classes/EventHandler.php
Removed Paths:
-------------
trunk/catalog/admin/includes/gabarit/adminGroup/display_view.define_group.gab
trunk/catalog/admin/includes/gabarit/adminGroup/display_view.delete.gab
trunk/catalog/admin/includes/gabarit/adminGroup/display_view.edit.gab
trunk/catalog/admin/includes/gabarit/usersNotif/display_view.listing.gab
trunk/catalog/admin/includes/languages/fr_FR/modules/pages/adminGroup.txt
trunk/catalog/admin/includes/languages/fr_FR/modules/pages/adminUsers.txt
Modified: trunk/catalog/admin/includes/application_top.php
===================================================================
--- trunk/catalog/admin/includes/application_top.php 2014-02-06 21:02:52 UTC (rev 5128)
+++ trunk/catalog/admin/includes/application_top.php 2014-02-08 17:03:24 UTC (rev 5129)
@@ -32,7 +32,7 @@
//! gestionnaire d'erreur
include($rpa.DIR_WS_CLASSES.'ErrorHandlerActive.php');
ErrorHandlerActive::start();
-
+
// call Config Class And Init
require(DIR_FS_CATALOG.DIR_WS_COMMON_CLASSES . 'Config.php');
$Cfg = Config::getInstance((object)$conf, true);
@@ -46,8 +46,12 @@
//! element optionnel
if (file_exists($rpa.DIR_WS_INCLUDES . 'tables_files_modules.php'))
require($rpa.DIR_WS_INCLUDES . 'tables_files_modules.php');
-
-
+
+// error_reporting(E_ALL);
+ include($rpa.DIR_WS_CLASSES.'EventsHandlerActive.php');
+ $Events =EventsHandlerActive::Start($Cfg);
+
+
//! var init
$page_admin=(isset($_GET['page_admin']) || !empty($_GET['page_admin']) ) ? tep_sanitize_string($_GET['page_admin']) : 'index';
$action = (isset($_GET['action'])) ? tep_sanitize_string($_GET['action']) : '';
Added: trunk/catalog/admin/includes/classes/EventsHandlerActive.php
===================================================================
--- trunk/catalog/admin/includes/classes/EventsHandlerActive.php (rev 0)
+++ trunk/catalog/admin/includes/classes/EventsHandlerActive.php 2014-02-08 17:03:24 UTC (rev 5129)
@@ -0,0 +1,231 @@
+<?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
+ @portion code Copyright (c) 2002 osCommerce
+ @package osCSS-2 <www http://www.oscss.org>
+ @version 2.2.0
+ @date 10/06/10, 09:08
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @file EventsHandlerActive.php
+ @dir admin/includes/classes/
+*/
+
+
+require_once(DIR_FS_CATALOG. DIR_WS_COMMON_CLASSES . 'EventHandler.php' );
+
+
+/**
+ @interface EventListener
+ @brief Generic interface for all SubInterface specific listeners
+*/
+interface EventListener {
+}
+
+/**
+ @interface EventTriggersListener
+ @brief
+*/
+Interface EventTriggersListener{
+}
+
+
+
+/**
+ @class EventTriggers
+*/
+Class EventTriggers{
+ /**
+ @var called Class called mecanism
+ */
+ protected $called;
+ /**
+ @var string ACTION for process
+ */
+ protected $action;
+
+ public function __construct(){
+ }
+
+ /**
+ @fn GetAction()
+ @brief Get Value
+ @return string ACTION for process value
+ */
+ public function GetAction(){
+ return $this->action;
+ }
+
+ /**
+ @fn SetAction()
+ @brief Get Value
+ @param $action string ACTION for process val_description
+ */
+ public function SetAction($action){
+ $this->action = $action;
+ }
+ /**
+ @fn GetCalled()
+ @brief Get Value
+ @return called value
+ */
+ public function GetCalled(){
+ return $this->called;
+ }
+
+ /**
+ @fn SetCalled()
+ @brief Get Value
+ @param $called called Class called mecanism
+ */
+ public function SetCalled($called){
+ $this->called = $called;
+ }
+}
+
+
+
+
+/**
+ @class ErrorHandlerActive
+ @extends ErrorHandler
+*/
+class EventsHandlerActive
+ Extends Events
+ {
+
+ /**
+ @var array stcock all name of EventTriggers actived
+ */
+ protected static $Triggers = array();
+
+ /**
+ @fn start()
+ @param $Cfg Object Config
+ @return instance
+ */
+
+ public static function Start(Config $Cfg ) {
+ $obj = self::getInstance();
+
+// $obj->Mess->attach( new Mess() );
+
+ return $obj;
+ }
+
+
+
+ /**
+ @brief Load and Activate all Event Childs Mecanism for display event and internal action propagation
+ @param $class string init in class called
+ */
+ public static function ActiveForClass($class) {
+ $obj = self::getInstance();
+ $list_interface = class_implements($class);
+
+ foreach($list_interface as $interface){
+ $sub = substr($interface, 0, -9);
+
+
+ // Event Triggers Action
+ if( substr($sub,0,13) == 'EventTriggers' ){
+ if( !class_exists($sub) )
+ include_once(DIR_FS_CATALOG. DIR_WS_CLASSES . 'listeners/'.$interface.'.php' );
+
+ if(class_exists($sub)) {
+ array_push(self::$Triggers, $sub);
+
+ $obj->$sub->attach( new $sub() );
+ }
+
+ }
+ // Event for action info, dipslay message
+ elseif( substr($sub,0,5) == 'Event' ){
+ if( !class_exists($sub) )
+ include_once(DIR_FS_CATALOG. DIR_WS_CLASSES . 'listeners/'.$interface.'.php' );
+
+ if(class_exists($sub))
+ $obj->$sub->attach( new $sub() );
+ }
+
+ }
+ return $obj;
+ }
+
+
+ public static function Process(EventListener $objEventListener){
+ $obj = self::getInstance();
+
+ $class = get_class($objEventListener);
+ // delete Listener at end of string
+ $sub = substr($class, 0, -8);
+
+ $obj->$sub->notify($objEventListener);
+ }
+
+ /**
+ */
+ public static function Triggers( $args = NULL ){
+ $obj = self::getInstance();
+
+ foreach(self::$Triggers as $sub){
+
+ $listener = $sub.'Listener';
+ $new = new $listener();
+
+ foreach($args as $key=>$val){
+ $function = 'Set'.ucwords($key);
+ if(method_exists($new, $function))
+ $new->$function($val);
+ }
+
+ $obj->$sub->notify($new);
+ }
+
+ }
+
+
+}
+
+
+// class emailNotification
+// extends EventHandler
+// {
+//
+//
+// public function update(SplSubject $subject, &$arg = NULL){
+// global $language;
+// // $array = (isset($arg['config'])
+// // ? $arg['config']
+// // : array(
+// // 'email_use_html'=>_cst_bool('EMAIL_USE_HTML'),
+// // 'message'=>''
+// // )
+// // );
+// //
+// // $tpl = (isset($arg['tpl']) ? $arg['tpl'] : 'defaut' );
+// // $subject = (isset($arg['subject']) ? $arg['subject'] : '' );
+// // $email = (isset($arg['email']) ? $arg['email'] : false);
+// // $name = (isset($arg['name']) ? $arg['name'] : false);
+// //
+// // if(!$email || !$name)
+// // return false;
+// //
+// // $message_final=tep_post_prepare_email($tpl.'.tpl',$language,$array);
+//
+// // tep_mail( $name , $email ,$subject, $message_final, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
+//
+// // if( ! tep_mail( $firstname , $email ,__('subject email text subject create account'), $message_final, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS) )
+// // $messageStack->add_session(sprintf(__('error in process send mail for %s'), $firstname .' '. $email ), 'error');
+// // else
+// // $messageStack->add_session(sprintf(__('send mail for %s ok'), $firstname .' '. $email), 'success');
+// // print_r($comment);
+// // $emails_2_notify = array('jo...@do...', 'fra...@du...');
+// // foreach($emails_2_notify as $email){
+// // // mail($email, 'Comment added', $comment['body']);
+// // }
+// }
+// }
+
+
+
+?>
\ No newline at end of file
Modified: trunk/catalog/admin/includes/classes/MLinkTo.php
===================================================================
--- trunk/catalog/admin/includes/classes/MLinkTo.php 2014-02-06 21:02:52 UTC (rev 5128)
+++ trunk/catalog/admin/includes/classes/MLinkTo.php 2014-02-08 17:03:24 UTC (rev 5129)
@@ -140,6 +140,52 @@
}
/**
+ @brief load block for manipulate data in sqlxxx
+ base in parent and right to childs
+ @param $action string (create/update/fetch/delete) for called LinkCreate/LinkUpdate/LinkFetch/LinkDelete
+ @param @child string name of child called
+ @param $child_id data id ressouce
+ @param
+ */
+ public static function SqlRightToAction($action , $child, $child_id, $array=array()){
+ $r = array();
+
+ foreach(self::$RL as $rows){
+ if(DataTypes::is_active($rows)) {
+
+ $child = self::RetroDatatype($child);
+
+ //master class
+ // call for obtain subclass
+ $sqlxx = 'sql'.$rows;
+ $sqlxx::getInstance();
+
+ $param =array(
+ 'datatype'=> $child,
+ 'datatype_id'=> $child_id,
+ '_array'=> ( (count($array[$rows]) > 0)? $array[$rows] : array() )
+ );
+
+ $function = 'Link'.ucwords($action);
+ $class = 'sql'.$rows.'data';
+
+ $r[$rows] = self::$function($class, $param);
+ }
+ }
+
+ if($action=='fetch'){
+ foreach($r as $row)
+ if(!is_array($row))
+ return false;
+ }
+ else{
+ if(in_array(false, $r ))
+ return false;
+ }
+ return $r;
+ }
+
+ /**
@brief load in html gabarit for construct link to Datatype rootListing
les elements de langue sont recherché dans les fichier des classes maitres
@param $classname string name support class
@@ -216,5 +262,143 @@
}
+
+
+ /**
+ @remarks This list of 4 method Specific for sqlxxxdata
+ LinkCreate
+ LinkUpdate
+ LinkDelete
+ LinkFetch
+ */
+
+ /**
+ @fn LinkCreate($opt)
+ @brief Specific for manage link to other data
+ @note normlised methode used in childs datatype
+ @param $support string name of support class
+ @param $opt array()
+ @return boolean false KO Or int id > 0 OK
+ */
+ private static function LinkCreate($support, $opt){
+ self::getInstance();
+
+ if(!isset($opt['datatype_id']))
+ return false;
+ else
+ $id = (int)$opt['datatype_id'];
+
+
+
+ if(isset($opt['datatype']))
+ $datatype = $opt['datatype'] ;
+ else
+ $datatype = DATATYPES_DEFAULT_NOSELECTED;
+
+
+ $data_array_link = $opt['_array'];
+
+ $support::delete(array('datatype'=> $datatype , 'datatype_id'=>$id ));
+
+ $res = true;
+
+ foreach($data_array_link as $value)
+ if($support::fetch(
+ array(
+ 'id'=> $value,
+ 'datatype'=> $datatype,
+ 'datatype_id'=> $id,
+ )
+ ) == false )
+ $res = $support::create(
+ array(
+ 'id'=> $value,
+ 'datatype'=> $datatype,
+ 'datatype_id'=> $id,
+ )
+ );
+
+ return $res;
+ }
+
+ /**
+ @fn LinkUpdate($opt)
+ @brief Specific for manage link to other data
+ @note normlised methode used in childs datatype
+ @param $support string name of support class
+ @param $opt array()
+ @return boolean false KO Or int id > 0 OK
+ */
+ private static function LinkUpdate($support,$opt){
+ return self::LinkCreate($opt);
+ }
+
+ /**
+ @fn LinkDelete($opt)
+ @brief Specific for manage link to other data
+ @note normlised methode used in childs datatype
+ @param $support string name of support class
+ @param $opt array()
+ @return boolean false KO Or True OK
+ */
+ private static function LinkDelete($support,$opt){
+ self::getInstance();
+
+ if(!isset($opt['datatype_id']))
+ return false;
+ else
+ $id = (int)$opt['datatype_id'];
+
+
+ if(isset($opt['datatype']))
+ $datatype = $opt['datatype'] ;
+ else
+ $datatype = DATATYPES_DEFAULT_NOSELECTED;
+
+
+ $data_array_link = $opt['_array'];
+
+ $res = $support::delete(array('datatype'=> $datatype , 'datatype_id'=>$id ));
+
+ return $res;
+ }
+
+ /**
+ @fn LinkFetch($opt)
+ @brief Specific for manage link to other data
+ @note normlised methode used in childs datatype
+ @param $support string name of support class
+ @param $opt array()
+ @return array() list object or false KO
+ */
+ private static function LinkFetch($support,$opt){
+
+ if(!isset($opt['datatype_id']))
+ return false;
+ else
+ $id = (int)$opt['datatype_id'];
+
+ if(isset($opt['datatype']))
+ $datatype = $opt['datatype'] ;
+ else
+ $datatype = DATATYPES_DEFAULT_NOSELECTED;
+
+ $list = $support::fetch(
+ array(
+ 'datatype'=> $datatype,
+ 'datatype_id'=> $id,
+ ),
+ true
+ );
+
+ if(!$list)
+ return array();
+ elseif(is_object($list))
+ $liste[]=$list;
+ else
+ $liste=$list;
+
+ return $liste;
+ }
}
?>
\ No newline at end of file
Modified: trunk/catalog/admin/includes/classes/ModTree.php
===================================================================
--- trunk/catalog/admin/includes/classes/ModTree.php 2014-02-06 21:02:52 UTC (rev 5128)
+++ trunk/catalog/admin/includes/classes/ModTree.php 2014-02-08 17:03:24 UTC (rev 5129)
@@ -829,7 +829,12 @@
// if( preg_match('#f#i',$ListAvailable) )
// $action_str.=sprintf(CsrtAction::getLink('row_action_right', __('image view public') , 'publiclink'), '', tep_catalog_href_link('index.php', 'products_id=' . $products['id'],'SSL', true, 'forceview') ,' target="blank" ' );
-
+ if(preg_match('#p#i',$ListAvailable) && tep_action_check('preview', $FileName))
+ $action_str.=sprintf(CsrtAction::getLink('row_action_right', IMAGE_DELETE, 'preview'), 'fancy', tep_href_link($FileName, 'cID=' . $item['id'] . '&action=preview') ,'' );
+
+ if( preg_match('#v#i',$ListAvailable ))
+ $action_str.=sprintf(CsrtAction::getLink('row_action_right', IMAGE_DETAILS, 'view'), '', tep_href_link($FileName, 'cID=' . $item['id'] . '&action=view' ),'' );
+
if( preg_match('#n#i',$ListAvailable ))
$action_str.=sprintf(CsrtAction::getLink('row_action_right', IMAGE_DETAILS, 'noedit'), '', tep_href_link($FileName, 'cID=' . $item['id'] . '&action=noedit' ),'' );
Modified: trunk/catalog/admin/includes/classes/ModTreePage.php
===================================================================
--- trunk/catalog/admin/includes/classes/ModTreePage.php 2014-02-06 21:02:52 UTC (rev 5128)
+++ trunk/catalog/admin/includes/classes/ModTreePage.php 2014-02-08 17:03:24 UTC (rev 5129)
@@ -63,18 +63,22 @@
@brief generic action call and process for normlaized action in subchilds module
For surcharge Action put string action in siwtch on subchilds module
@param $blokRedirect default false, for block redirect by modify header in php function
+ @param $params array put in base array put in sqlxxx
@return none
*/
- public static function GenericAction($blokRedirect=false){
- global $messageStack, $languages_id;
+ public static function GenericAction($blokRedirect=false, $params=array() ){
+ global $messageStack, $languages_id, $Cfg;
$class=self::GetClassName();
$sqlclass='sql'.self::GetClassDatatype();
+ $list_interface = class_implements($class);
+
if(!tep_action_check(self::$action, $class::FILENAME)){
$messageStack->add_session(__('@'.$class.' your are not access data'), 'error');
tep_redirect(tep_href_link($class::FILENAME));
}
+
switch(self::$action){
/**
@@ -93,25 +97,39 @@
@remarks specific Ajax call
*/
case 'update_cell':
- try {
- $params = array();
+ try {
+
$params['id'] = $_REQUEST['id'];
$params['sqlarray'] = $sqlclass::ExtractForm( $class::ExtractValByName($languages_id, $_REQUEST['columnName'], $_REQUEST['value']) );
$params['action']=self::$action;
$params['language_id']= $languages_id;
if( $sqlclass::update( $params ) != 1 )
- throw new Exception(__('@'.$class.' error in update process')) ;
-
- $messageStack->add_session(__('@'.$class.' success in update process'), 'success');
-
+ throw new Exception(__(' error in update process', $class)) ;
+
+ if(in_array('EventMessListener', $list_interface))
+ EventsHandlerActive::Process(
+ new EventMessListener( __('success in update process', $class) , 'success')
+ );
+
+
+ // trigger event
+ EventsHandlerActive::Triggers(
+ array(
+ 'action'=>self::$action,
+ 'called'=>self::GetClassDatatype()
+ )
+ );
// display value for return
echo $_REQUEST['value'];
}
catch (Exception $e) {
-
- $messageStack->add_session($e->getMessage() , 'error');
+ if(in_array('EventMessListener', $list_interface))
+ EventsHandlerActive::Process(
+ new EventMessListener(__($e->getMessage(), $class) , 'error')
+ );
}
+
break;
/**
@@ -122,18 +140,32 @@
try {
if($class::$Id <=0 )
- throw new Exception(__('@'.$class.' error load data')) ;
+ throw new Exception(__('error load data', $class)) ;
if( !$sqlclass::delete(array('id'=>$class::$Id)) )
- throw new Exception( sprintf(__('error delet for post id %s'), $class::$Id ) ) ;
+ throw new Exception( sprintf(__('error delete id %s', $class), $class::$Id ) ) ;
+ if(in_array('EventMessListener', $list_interface))
+ EventsHandlerActive::Process(
+ new EventMessListener( sprintf(__('delete id %s success', $class), $class::$Id ) , 'success')
+ );
- $messageStack->add_session(sprintf(__('delete post id %s success'), $class::$Id ), 'success');
}
catch (Exception $e) {
- $messageStack->add_session($e->getMessage() , 'error');
+ if(in_array('EventMessListener', $list_interface))
+ EventsHandlerActive::Process(
+ new EventMessListener(__($e->getMessage(), $class) , 'error')
+ );
}
+ // trigger event
+ EventsHandlerActive::Triggers(
+ array(
+ 'action'=>self::$action,
+ 'called'=>self::GetClassDatatype()
+ )
+ );
+
if(!$blokRedirect)
tep_redirect(tep_href_link($class::FILENAME) );
break;
@@ -143,21 +175,42 @@
@remarks normal page
*/
case 'insert':
+
+
try {
-
- $params = array();
+
$params['action']=$class::$action;
$params['post']=$_POST;
$params['language_id']= $languages_id;
$params['sqlarray'] = $sqlclass::ExtractForm($_POST);
- $_id=$sqlclass::create($params);
-
+
+
+ $class::$Id=$sqlclass::create($params);
+
+ if( is_int($class::$Id) && $class::$Id <=0)
+ throw new Exception(__('error in update process', $class) ) ;
+
+ if(in_array('EventMessListener', $list_interface))
+ EventsHandlerActive::Process(
+ new EventMessListener(__('success in create process', $class) , 'success')
+ );
+
+ // trigger event
+ EventsHandlerActive::Triggers(
+ array(
+ 'action'=>self::$action,
+ 'called'=>self::GetClassDatatype()
+ )
+ );
+
if(!$blokRedirect)
- tep_redirect(tep_href_link($class::FILENAME, 'cID=' . $_id.'&action=edit'));
-
+ tep_redirect(tep_href_link($class::FILENAME, 'cID=' . $class::$Id.'&action=edit'));
}
catch (Exception $e) {
- $messageStack->add_session($e->getMessage() , 'error');
+ if(in_array('EventMessListener', $list_interface))
+ EventsHandlerActive::Process(
+ new EventMessListener(__($e->getMessage(), $class) , 'error')
+ );
if(!$blokRedirect)
tep_redirect(tep_href_link($class::FILENAME));
@@ -166,10 +219,11 @@
case 'update':
+error_reporting(E_ALL);
try {
if( $class::$Id <=0 )
- throw new Exception(__('@'.$class.' error load data')) ;
+ throw new Exception(__('error load data', $class)) ;
$params['id']= $class::$Id;
$params['action']=$class::$action;
@@ -182,11 +236,21 @@
$function = (isset($_POST['origin'])? 'add_session' : 'add' );
if( is_int($res) && $res <=0)
- throw new Exception(__('@'.$class.' error in update process') ) ;
- else
- $messageStack->$function(__('@'.$class.' success in update process') , 'success');
+ throw new Exception(__('error in update process', $class) ) ;
+ if(in_array('EventMessListener', $list_interface))
+ EventsHandlerActive::Process(
+ new EventMessListener(__('success in update process', $class) , 'success')
+ );
+ // trigger event
+ EventsHandlerActive::Triggers(
+ array(
+ 'action'=>self::$action,
+ 'called'=>self::GetClassDatatype()
+ )
+ );
+
if(isset($_POST['up_and_close']) ){
if(!$blokRedirect)
tep_redirect(tep_href_link($class::FILENAME));
@@ -196,10 +260,14 @@
tep_redirect(tep_href_link($class::FILENAME, 'cID=' . $class::$Id.'&action=edit'));
}
- exit;
+ if(!$blokRedirect)
+ exit;
}
catch (Exception $e) {
- $messageStack->add_session($e->getMessage() , 'error');
+ if(in_array('EventMessListener', $list_interface))
+ EventsHandlerActive::Process(
+ new EventMessListener(__($e->getMessage(), $class) , 'error')
+ );
if($class::$Id >0 ){
if(!$blokRedirect)
@@ -215,8 +283,48 @@
// generic redirect if error
tep_redirect(tep_href_link($class::FILENAME) );
break;
+
+
+ case 'new':
+ /**
+ @remarks Check count status type. If one status , get next etape
+ */
+
+ $res = tep_get_status_array(self::GetClassDatatype(),0,'status_name');
+
+ if(count($res)<=1)
+ tep_redirect(tep_href_link($class::FILENAME, 'action=insert'));
+ case 'edit':
+
+ global $oscss;
+
+ foreach($class::$InitInfo['edit']['listing'] as $key=>$row ){
+
+ if(substr($key, 0,5) == 'edit_' && isset($row['active_value_language']) && $row['active_value_language'] ) {
+ if($o == 0){
+ /// Editeur Load
+ $oscss->_add_ext(BO_WISIWYG_SELECTED,'editeur/');
+ $o++;
+ }
+
+ for ($i=0, $n=sizeof($class::$languages); $i<$n; $i++)
+ echo $oscss->_call(BO_WISIWYG_SELECTED,'_top',$row['input_name'].'[' . $class::$languages[$i]['id'] . ']','600','400');
+ }
+ }
+ break;
+
+
default:
+
+ // trigger event
+ EventsHandlerActive::Triggers(
+ array(
+ 'Action'=>self::$action,
+ 'ClassRoot'=>$class,
+ 'Called'=>self::GetClassDatatype()
+ )
+ );
}
}
Modified: trunk/catalog/admin/includes/classes/SqlFilesDataDriverClass.php
===================================================================
--- trunk/catalog/admin/includes/classes/SqlFilesDataDriverClass.php 2014-02-06 21:02:52 UTC (rev 5128)
+++ trunk/catalog/admin/includes/classes/SqlFilesDataDriverClass.php 2014-02-08 17:03:24 UTC (rev 5129)
@@ -103,6 +103,20 @@
/**
+ @fn ExtractForm($data)
+ @brief extract data forms for put in db
+ @param $data array
+ @return array
+ */
+// public static function ExtractForm($data){
+// $class = self::$DataDriverType;
+// new $class();
+//
+// return self::ExtractDataForm($class::Specimen(), $data);
+// }
+
+
+ /**
@fn ExtractDataForm($data)
@brief extract data forms for put in db
@param $specimen array modele
Modified: trunk/catalog/admin/includes/classes/drivers/sqladmingroups.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqladmingroups.php 2014-02-06 21:02:52 UTC (rev 5128)
+++ trunk/catalog/admin/includes/classes/drivers/sqladmingroups.php 2014-02-08 17:03:24 UTC (rev 5129)
@@ -11,10 +11,14 @@
*/
+require_once( DIR_FS_ADMIN . DIR_WS_CLASSES . 'SqlFilesDataDriverClass.php');
class sqladmingroups
- implements ModSqlDataDriver{
+ Extends SqlFilesDataDriverClass
+ implements
+ ModSqlDataDriver
+ {
public static $modules;
@@ -37,15 +41,17 @@
*/
public static function create($option){
self::getInstance();
-
$DB=Database::getInstance();
$sql_data_array = array();
$error = 0 ;
+ $specimen = self::Specimen();
- if(isset($option['name'])) $sql_data_array['admin_groups_name'] = $option['name'];
- if(isset($option['status'])) $sql_data_array['admin_groups_status'] = (int)$option['status'];
-
+ $post =(isset($option['post'])? $option['post'] : array() );
+ $dataarray =(isset($option['sqlarray'])? $option['sqlarray'] : array() );
+
+ self::PrepaDataAfterUse( $specimen , $dataarray, $post );
+ $sql_data_array = self::GetSqlArray();
// $sql_data_array['admin_created'] = 'now()';
$DB->beginTransaction();
@@ -79,7 +85,8 @@
public static function update($option){
self::getInstance();
$DB=Database::getInstance();
-
+ $specimen = self::Specimen();
+
if(!isset($option['id']) )
return false;
@@ -94,12 +101,12 @@
if(strlen($where)<3)
return false;
+ $post =(isset($option['post'])? $option['post'] : array() );
+ $dataarray =(isset($option['sqlarray'])? $option['sqlarray'] : array() );
+
+ self::PrepaDataAfterUse( $specimen , $dataarray, $post );
+ $sql_data_array = self::GetSqlArray();
- $dataarray = (isset($option['sqlarray'])? $option['sqlarray'] : array() );
-
- if(isset($dataarray['name'])) $sql_data_array['admin_groups_name'] = (string)$dataarray['name'];
- if(isset($dataarray['status'])) $sql_data_array['admin_groups_status'] = (int)$dataarray['status'];
-
$DB->beginTransaction();
if(count($sql_data_array)>0){
@@ -191,10 +198,13 @@
// index des notification pour ce groupe
$DB->query("delete from " . TABLE_NOTIFICATION . " where chknotif_user = '" . (int)$_id . "' AND chknotif_uniq = '0' ");
+
// reliquat message de ce groupe
- $DB->query("delete from " . TABLE_ADMIN_NOTIFICATION . " where user_id = '" . (int)$_id . "' AND notif_type = '0' ");
+ sqladminnotification::delete(array('user_id'=>(int)$_id , 'type'=>'0'));
+
// utilisateur de ce groupe
$res = sqladminuser::fetch(array('group_id'=>(int)$_id));
+
// groupe
$DB->query("delete from " . TABLE_ADMIN_GROUPS . " where admin_groups_id = '" . (int)$_id . "'");
@@ -218,7 +228,19 @@
}
-
+ /**
+ @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 CleanKey()
@brief Clean string name key
Modified: trunk/catalog/admin/includes/classes/drivers/sqladminuser.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqladminuser.php 2014-02-06 21:02:52 UTC (rev 5128)
+++ trunk/catalog/admin/includes/classes/drivers/sqladminuser.php 2014-02-08 17:03:24 UTC (rev 5129)
@@ -11,11 +11,13 @@
@dir admin/includes/classes/drivers/
*/
+require_once( DIR_FS_ADMIN . DIR_WS_CLASSES . 'SqlFilesDataDriverClass.php');
/**
@class sqladminuser
*/
class sqladminuser
+ Extends SqlFilesDataDriverClass
implements ModSqlDataDriver{
public static $modules;
@@ -40,26 +42,19 @@
self::getInstance();
$DB=Database::getInstance();
$error = 0 ;
- $sql_data_array = array();
+ $specimen = self::Specimen();
+ $post =(isset($option['post'])? $option['post'] : array() );
+ $dataarray =(isset($option['sqlarray'])? $option['sqlarray'] : array() );
- $_post = (isset($option['post'])? $option['post'] : array() );
- $sqlarray = (isset($option['sqlarray'])? $option['sqlarray'] : array() );
-
-
- if(!isset($sqlarray['password']))
+ self::PrepaDataAfterUse( $specimen , $dataarray, $post );
+ $sql_data_array = self::GetSqlArray();
+
+ if(!isset($option['password']))
return false;
+ else
+ $sql_data_array['admin_password'] = (string)$option['password'];
- if(isset($sqlarray['groups_id'])) $sql_data_array['admin_groups_id'] = $sqlarray['groups_id'];
- if(isset($sqlarray['firstname'])) $sql_data_array['admin_firstname'] = (string)$sqlarray['firstname'];
- if(isset($sqlarray['lastname'])) $sql_data_array['admin_lastname'] = (string)$sqlarray['lastname'];
- if(isset($sqlarray['email_address'])) $sql_data_array['admin_email_address']= (string)$sqlarray['email_address'];
- if(isset($sqlarray['password'])) $sql_data_array['admin_password'] = (string)$sqlarray['password'];
- if(isset($sqlarray['language_id'])) $sql_data_array['admin_language_id'] = (int)$sqlarray['language_id'];
- if(isset($sqlarray['status'])) $sql_data_array['admin_status'] = (int)$sqlarray['status'];
- if(isset($sqlarray['url_openid'])) $sql_data_array['url_openid'] = (string)$sqlarray['url_openid'];
-// if(isset($sqlarray['uniqkey'])) $sql_data_array['uniqkey'] = (string)$sqlarray['uniqkey'];
-
$DB->beginTransaction();
if(count($sql_data_array) > 0) {
@@ -94,31 +89,28 @@
$DB=Database::getInstance();
$error = 0 ;
+ $specimen = self::Specimen();
- $sql_data_array = array();
+ $post =(isset($option['post'])? $option['post'] : array() );
+ $dataarray =(isset($option['sqlarray'])? $option['sqlarray'] : array() );
+ print_r($specimen);
+ print_r($dataarray);
+
+ self::PrepaDataAfterUse( $specimen , $dataarray, $post );
+
+ $sql_data_array = self::GetSqlArray();
+
$where ='';
if(isset($option['id'])) $where .="AND admin_id = '".(int)$option['id']."' ";
$DB->beginTransaction();
- $_post = (isset($option['post'])? $option['post'] : array() );
- $sqlarray = (isset($option['sqlarray'])? $option['sqlarray'] : array() );
-
-
- if(isset($sqlarray['groups_id'])) $sql_data_array['admin_groups_id'] = $sqlarray['groups_id'];
- if(isset($sqlarray['firstname'])) $sql_data_array['admin_firstname'] = (string)$sqlarray['firstname'];
- if(isset($sqlarray['lastname'])) $sql_data_array['admin_lastname'] = (string)$sqlarray['lastname'];
- if(isset($sqlarray['email_address'])) $sql_data_array['admin_email_address']= (string)$sqlarray['email_address'];
- if(isset($sqlarray['password'])) $sql_data_array['admin_password'] = (string)$sqlarray['password'];
- if(isset($sqlarray['language_id'])) $sql_data_array['admin_language_id'] = (int)$sqlarray['language_id'];
- if(isset($sqlarray['status'])) $sql_data_array['admin_status'] = (int)$sqlarray['status'];
- if(isset($sqlarray['url_openid'])) $sql_data_array['url_openid'] = (string)$sqlarray['url_openid'];
-
if(count($sql_data_array)>0 ){
$sql_data_array['admin_modified'] = 'now()';
if( !tep_db_perform(TABLE_ADMIN, $sql_data_array, 'update' , substr($where,3) ) )
$error++;
+
}
else
return false;
@@ -170,7 +162,7 @@
$sql="SELECT * FROM " . TABLE_ADMIN . " a ".
" LEFT JOIN " . TABLE_ADMIN_GROUPS . " g ON (a.admin_groups_id=g.admin_groups_id) ".
- " WHERE ".substr($sql,3);
+ " WHERE 1 ".$sql;
$res=$DB->query($sql);
@@ -184,7 +176,7 @@
$array=array();
foreach($res->fetchAllAssoc() as $result)
- $array[]= ((!$shortkey)? $result : self::CleanKey($result));
+ $array[]= ((!$shortkey)? $result : self::CleanKey($result));
return $array;
}
@@ -205,15 +197,10 @@
return false;
- // ACA START DELETE CATEGORY
-// self::$modules->delete($categories[$i]['id']);
+ sqladminnotification::delete( array('user_id'=> (int)$_id , 'type'=>'1'));
-
- $DB->query("delete from " . TABLE_ADMIN_NOTIFICATION . " where user_id = '" . (int)$_id . "' AND notif_type = '1' ");
-
$DB->query("delete from " . TABLE_ADMIN . " where admin_id = '" . (int)$_id . "'");
-
return true;
}
@@ -225,14 +212,14 @@
public static function Specimen($shortkey=false){
$par = array(
'admin_id' => -1,
- 'admin_groups_id' => '',
+ 'admin_groups_id' => 0,
'admin_firstname' => '',
'admin_lastname' => '',
'admin_email_address' => '',
'admin_modified' => '',
'admin_password' => '',
- 'admin_language_id' => '',
- 'admin_status' => '',
+ 'admin_language_id' => 0,
+ 'admin_status' => 0,
'url_openid' => '',
);
@@ -240,7 +227,19 @@
}
-
+ /**
+ @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 CleanKey()
@brief Clean string name key
Modified: trunk/catalog/admin/includes/classes/drivers/sqlcategorie.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlcategorie.php 2014-02-06 21:02:52 UTC (rev 5128)
+++ trunk/catalog/admin/includes/classes/drivers/sqlcategorie.php 2014-02-08 17:03:24 UTC (rev 5129)
@@ -14,12 +14,19 @@
require_once( DIR_FS_ADMIN . DIR_WS_CLASSES . 'SqlFilesDataDriverClass.php');
+
+
/**
@class sqlcategorie
*/
class sqlcategorie
extends SqlFilesDataDriverClass
- implements ModSqlDataDriver{
+ implements
+ ModSqlDataDriver
+
+ // Event propagation Action
+
+ {
/**
@var boolean use submodule in this class
@@ -343,6 +350,8 @@
/**
@brief delete row
+ @param option array
+ @return boolean true OK false KO
*/
public static function delete($option){
new self();
@@ -353,19 +362,7 @@
else
return false;
-
- $category_image_query = $DB->query("select categories_image from " . TABLE_CATEGORIES . " where categories_id = '" . (int)$_id . "'");
- $category_image = tep_db_fetch_array($category_image_query);
-
- $duplicate_image_query = tep_db_query("select count(*) as total from " . TABLE_CATEGORIES . " where categories_image = '" . tep_db_input($category_image['categories_image']) . "'");
- $duplicate_image = tep_db_fetch_array($duplicate_image_query);
-
- if ($duplicate_image['total'] < 2) {
- if (file_exists(DIR_FS_CATALOG_IMAGES . $category_image['categories_image'])) {
- @unlink(DIR_FS_CATALOG_IMAGES . $category_image['categories_image']);
- }
- }
-
+
// ACA START DELETE CATEGORY
self::$modules->delete($_id);
@@ -404,98 +401,8 @@
));
}
- /**
- @brief Function link to for contruct link featured vs datatype
- @note normlised methode used in childs datatype
- */
- public static function ListLinkTo($opt){
- if(!isset($opt['id']))
- return false;
- else
- $id = (int)$opt['id'];
-
- if(isset($opt['datatype']))
- $datatype = $opt['datatype'] ;
- else
- $datatype = DATATYPES_DEFAULT_NOSELECTED;
-
- switch($datatype){
- case 'product': // retro compatible
- $datatype = $datatype.'s';
- break;
- default:
- $datatype = $datatype;
- }
-
- $DB=Database::getInstance();
-
- $table = tep_cst_define('TABLE_'.strtoupper($datatype).'_TO_CATEGORIES');
-
- if($table =='false')
- return false;
-
- $res = $DB->query($sql="SELECT * FROM " . $table . " WHERE ".$datatype."_id = " . (int)$id . " ");
-
- $list = array();
- foreach($res->fetchAllAssoc() as $row)
- $list[] = new objectInfo( $row );
-
-
- $liste=$list;
-
- return $liste;
- }
-
- /**
- @brief Function link to for contruct link featued vs datatype
- @note normlised methode used in childs datatype
- */
- public static function AddLinkTo($opt){
-
- self::getInstance();
-
- if(!isset($opt['id']))
- return false;
- else
- $data_id = (int)$opt['id'];
-
-
- if(isset($opt['datatype']))
- $datatype = $opt['datatype'] ;
- else
- $datatype = DATATYPES_DEFAULT_NOSELECTED;
-
-
- switch($datatype){
- case 'product': // retro compatible
- $datatype = $datatype.'s';
- break;
- default:
- $datatype = $datatype;
- }
-
- $data_array_link = $opt['_array'];
-
- self::getInstance();
- $DB=Database::getInstance();
-
- $table = tep_cst_define('TABLE_'.strtoupper($datatype).'_TO_CATEGORIES');
-
- if($table =='false')
- return false;
-
- $DB->query($sql="delete from " . $table . " where ".$datatype."_id='" . (int)$data_id . "' ");
-
- if(!is_array($data_array_link) || count($data_array_link) == 0)
- $DB->query($sql="INSERT INTO " . $table . " (".$datatype."_id, categories_id) VALUES ('" . (int)$data_id . "', '".ORPHELIN_COLLECTOR."')");
- else
- foreach($data_array_link as $value)
- $DB->query($sql="INSERT INTO " . $table . " (".$datatype."_id, categories_id) VALUES ('" . (int)$data_id . "', '" . (int)preg_replace('#.*_#i','',$value). "')");
-
- return true;
- }
-
+
/**
@brief Speciemen
@return array or object
@@ -550,7 +457,27 @@
+
/**
+ @fn CleanKey()
+ @brief Clean string name key
+ */
+ public static function CleanKey($array){
+ self::getInstance();
+ $object= new stdclass();
+
+ foreach($array as $key=>$value){
+ if( strpos($key,'categories_') ===0)
+ $key=substr($key,11);
+
+ $object->$key = $value;
+ }
+
+ return $object;
+ }
+
+
+ /**
@fn MaintenanceTables()
@brief clean and maintient link table and data
*/
@@ -560,10 +487,13 @@
self::UpdateCheckLoopByPair();
}
-
-
-
/**
+ Internal methode specific
+ This methode is private !
+ */
+
+
+ /**
@fn UpdateCheckLoop()
@brief Check parent_id / rowid and block loop context
*/
@@ -595,25 +525,171 @@
}
+
+
+}
+
+
+/**
+ @class sqlcategoriedata
+ @brief manage all childs data in link to
+ @note this class is normalized
+*/
+class sqlcategoriedata{
+ public function create($option){
+ $DB=Database::getInstance();
+
+
+ if(!isset($option['datatype_id']))
+ return false;
+
+ $value = tep_db_prepare_input($option['id']);
+ $data_id = (isset($option['datatype_id']) ? tep_db_prepare_input($option['datatype_id']) : 0 );
+
+ if(isset($option['datatype']))
+ $datatype = $option['datatype'] ;
+ else
+ $datatype = DATATYPES_DEFAULT_NOSELECTED;
+
+ switch($datatype){
+ case 'product': // retro compatible
+ $datatype = $datatype.'s';
+ break;
+ default:
+ $datatype = $datatype;
+ }
+
+ $table = tep_cst_define('TABLE_'.strtoupper($datatype).'_TO_CATEGORIES');
+
+ if($table =='false')
+ return false;
+
+ $sql="INSERT INTO " . $table . " (".$datatype."_id, categories_id) VALUES ('" . (int)$data_id . "', '" . (int)preg_replace('#.*_#i','',$value). "')";
+
+ return $DB->query($sql);
+ }
+
+ public function update($option){
+ return $this->create($option);
+ }
+
+ public function delete($option){
+ $DB=Database::getInstance();
+
+ $data_id = (isset($option['datatype_id']) ? tep_db_prepare_input($option['datatype_id']) : 0 );
+
+ if(isset($option['datatype']))
+ $datatype = $option['datatype'] ;
+ else
+ $datatype = DATATYPES_DEFAULT_NOSELECTED;
+
+ switch($datatype){
+ case 'product': // retro compatible
+ $datatype = $datatype.'s';
+ break;
+ default:
+ $datatype = $datatype;
+ }
+
+ $table = tep_cst_define('TABLE_'.strtoupper($datatype).'_TO_CATEGORIES');
+
+ if($table =='false')
+ return false;
+
+ $sql = '';
+ if( $data_id > 0)
+ $sql .= "AND ".$datatype."_id='" . (int)$data_id . "' ";
+
+ $sql="DELETE FROM " . $table . " WHERE 1 ".$sql;
+
+ return $DB->query($sql);
+ }
+
+ public function fetch($option, $shortkey = false){
+ $DB=Database::getInstance();
+
+ if(!isset($option['datatype_id']))
+ return false;
+ else
+ $data_id =(int)$option['datatype_id'];
+
+ if(isset($option['datatype']))
+ $datatype = $option['datatype'] ;
+ else
+ $datatype = DATATYPES_DEFAULT_NOSELECTED;
+
+ switch($datatype){
+ case 'product': // retro compatible
+ $datatype = $datatype.'s';
+ break;
+ default:
+ $datatype = $datatype;
+ }
+
+ $table = tep_cst_define('TABLE_'.strtoupper($datatype).'_TO_CATEGORIES');
+
+ if($table =='false')
+ return false;
+
+ $sql = '';
+ if(isset($option['datatype_id']))
+ $sql .="AND ".$datatype."_id = " . (int)$option['datatype_id'] . " ";
+ if(isset($option['id']))
+ $sql .="AND categories_id = " . (int)preg_replace('#.*_#i','',$option['id']) . " ";
+
+
+ $sql="SELECT * FROM " . $table . " WHERE 1 ".$sql;
+
+ $res=$DB->query($sql);
+
+ if(!is_object($res) )
+ return false;
+ $num = $res->__get('numRows');
+
+ if($num == 1){
+ $result=$res->fetchAssoc();
+ return ((!$shortkey)? $result : self::CleanKey($result));
+ }
+ elseif($num > 1){
+ $array=array();
+
+ foreach($res->fetchAllAssoc() as $result)
+ $array[]= ((!$shortkey)? $result : self::CleanKey($result));
+
+ return $array;
+ }
+
+ return false;
+ }
+
/**
+ @brief
+ @return array product empty
+ */
+ public static function Specimen($shortkey=false){
+ $par = array(
+ 'categories_id' => '',
+ 'datatype_id' => '',
+ );
+
+ return ((!$shortkey)? $par : self::CleanKey($par));
+ }
+
+
+
+ /**
@fn CleanKey()
@brief Clean string name key
*/
public static function CleanKey($array){
- self::getInstance();
+ new self();
$object= new stdclass();
foreach($array as $key=>$value){
- if( strpos($key,'categories_') ===0)
- $key=substr($key,11);
-
$object->$key = $value;
}
return $object;
}
-
}
-
-
?>
\ No newline at end of file
Modified: trunk/catalog/admin/includes/classes/drivers/sqlcontent.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlcontent.php 2014-02-06 21:02:52 UTC (rev 5128)
+++ trunk/catalog/admin/includes/classes/drivers/sqlcontent.php 2014-02-08 17:03:24 UTC (rev 5129)
@@ -96,6 +96,16 @@
}
+ /*
+ Use transversal Datatype Rootlisting and update in data
+ Not in context update one col
+ */
+ if($error ==0 && isset($post['linkto'])){
+ $r = MLinkTo::SqlRightToAction('create', 'content', $content_id, $post['linkto']) ;
+ if($r == false)
+ $error++;
+ }
+
$modules->create($content_id);
if( $error > 0){
@@ -149,11 +159,13 @@
$sql_data_array = array_merge($sql_data_array, $modules->get_update_table_content());
- if(count($sql_data_array) > 0 )
+
+ if(count($sql_data_array) > 0 || count($sql_data_array_lg) > 0){
+ $sql_data_array['last_modified'] = 'NOW()';
if ( ! tep_db_perform(TABLE_CONTENT, $sql_data_array, 'update', "content_id = '" . (int)$content_id . "'") )
$error++;
+ }
-
// language table
if( $error <= 0)
if(isset($sql_data_array_lg['lg']) && count($sql_data_array_lg['lg']) > 0)
@@ -165,14 +177,14 @@
$error++;
}
-
- if(isset($post['linkto'])){
- $r = MLinkTo::SqlLeftTo('content', $content_id, $post['linkto']) ;
+
+ if($error ==0 && isset($post['linkto'])){
+ $r = MLinkTo::SqlRightToAction('update', 'content', $content_id, $post['linkto']) ;
if($r == false)
$error++;
}
-
+
$modules->after_update ($content_id);
if( $error > 0){
@@ -281,7 +293,7 @@
/*
Use transversal Datatype Rootlisting and update in data
*/
- $r = MLinkTo::SqlRightTo('content', $row['content_id']) ;
+ $r = MLinkTo::SqlRightToAction(__FUNCTION__, 'content', $row['content_id'] ) ;
if($r == false)
$error++;
else
@@ -318,50 +330,40 @@
/**
@brief delete row
@param option array
+ @param $trigger boolean false for block triggers
+ @return boolean true OK false KO
*/
- public static function delete($option){
+ public static function delete($option, $trigger=true){
new self();
$DB=Database::getInstance();
$modules = self::$modules;
$res = false;
- $product_categories = array();
+ $error = 0;
+
if(isset($option['id']))
$cms_id = (int)tep_db_input($option['id']) ;
else
return false;
- if(isset($option['catarray'])){
- foreach($option['catarray'] as $k=>$v)
- $_categories[$k]=(int)tep_db_input($v) ;
+ if($trigger) {
+ $r = MLinkTo::SqlRightToAction('delete', 'content', (int)$cms_id) ;
+ if($r == false)
+ $error++;
+ }
- for ($i=0, $n=sizeof($_categories); $i<$n; $i++) {
- $DB->query("DELETE FROM " . TABLE_CONTENT_TO_CATEGORIES . " WHERE content_id = '" . (int)$cms_id . "' AND categories_id = '" . (int)$product_categories[$i] . "'");
- }
- }
- else
- $DB->query("delete from " . TABLE_CONTENT_TO_CATEGORIES . " where content_id = '" . (int)$cms_id . "'");
+ $modules->delete($cms_id);
+ // childs tables
+ $DB->query("delete from " . TABLE_CONTENT_DESCRIPTION . " where content_id = '" . (int)$cms_id . "'");
- $product_categories_query = $DB->query("SELECT COUNT(*) AS total FROM " . TABLE_CONTENT_TO_CATEGORIES . " WHERE content_id = '" . (int)$cms_id . "'");
- $product_categories = tep_db_fetch_array($product_categories_query);
+ // master table
+ $DB->query("delete from " . TABLE_CONTENT . " where content_id = '" . (int)$cms_id . "'");
- if ($product_categories['total'] == '0') {
+ return true;
- $modules->delete($cms_id);
- // childs tables
- $DB->query("delete from " . TABLE_CONTENT_DESCRIPTION . " where content_id = '" . (int)$cms_id . "'");
-
- // master table
- $DB->query("delete from " . TABLE_CONTENT . " where content_id = '" . (int)$cms_id . "'");
-
- return true;
- }
- else
- return false;
-
return false;
}
@@ -452,6 +454,12 @@
@brief clean and maintient link table and data
*/
public static function Maintenance(){
+
+ $DB=Database::getInstance();
+
+ // callback if status not exists
+ $DB->query($sql="update " . TABLE_CONTENT . " set content_type = 1 where content_type < 1 ");
+
self::UpdateOrphelin();
}
Modified: trunk/catalog/admin/includes/classes/drivers/sqlfeatured.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlfeatured.php 2014-02-06 21:02:52 UTC (rev 5128)
+++ trunk/catalog/admin/includes/classes/drivers/sqlfeatured.php 2014-02-08 17:03:24 UTC (rev 5129)
@@ -13,28 +13,19 @@
require_once( DIR_FS_ADMIN . DIR_WS_CLASSES . 'SqlFilesDataDriverClass.php');
require_once( DIR_FS_ADMIN . DIR_WS_CLASSES . 'drivers/sqllinkto.php');
+
+
/**
@class sqlfeatured
@brief manage db update/insert/delete for featured
*/
class sqlfeatured
extends SqlFilesDataDriverClass
- implements ModSqlDataDriver{
+ implements
+ ModSqlDataDriver
+ {
- public static $modules;
- protected static $_instance;
-
- protected function __construct(){
- }
-
-
- public static function getInstance() {
- if(self::$_instance == null) self::$_instance = new self();
- return self::$_instance;
- }
-
-
/**
@brief create new ligne in table configuration
*/
@@ -361,83 +352,8 @@
return parent::ExtractDataForm(self::Specimen(), $data);
}
- /**
- @brief Function link to for contruct link featured vs datatype
- @note normlised methode used in childs datatype
- */
- public static function ListLinkTo($opt){
- if(!isset($opt['id']))
- return false;
- else
- $id = (int)$opt['id'];
- if(isset($opt['datatype']))
- $datatype = $opt['datatype'] ;
- else
- $datatype = DATATYPES_DEFAULT_NOSELECTED;
-
- $list = sqlfeatureddata::fetch(
- array(
- 'datatype'=> $datatype,
- 'datatype_id'=> $id,
- ),
- true
- );
-
- if(!$list)
- return array();
- elseif(is_object($list))
- $liste[]=$list;
- else
- $liste=$list;
-
- return $liste;
- }
-
- /**
- @brief Function link to for contruct link featued vs datatype
- @note normlised methode used in childs datatype
- */
- public static function AddLinkTo($opt){
- self::getInstance();
-
- if(!isset($opt['id']))
- return false;
- else
- $id = (int)$opt['id'];
-
-
- if(isset($opt['datatype']))
- $datatype = $opt['datatype'] ;
- else
- $datatype = DATATYPES_DEFAULT_NOSELECTED;
-
-
- $data_array_link = $opt['_array'];
-
- sqlfeatureddata::delete(array('datatype'=> $datatype , 'datatype_id'=>$id ));
-
- $res = true;
-
- foreach($data_array_link as $value)
- if(sqlfeatureddata::fetch(
- array(
- 'id'=> $value,
- 'datatype'=> $datatype,
- 'datatype_id'=> $id,
- )
- ) == false )
- $res = sqlfeatureddata::create(
- array(
- 'id'=> $value,
- 'datatype'=> $datatype,
- 'datatype_id'=> $id,
- )
- );
- return $res;
- }
-
}
@@ -534,7 +450,7 @@
if(isset($option['datatype_id']) )
$tmp['datatype_id'] = tep_db_prepare_input($option['datatype_id']);
-
+
return parent::delete($tmp);
}
Modified: trunk/catalog/admin/includes/classes/drivers/sqllinkto.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqllinkto.php 2014-02-06 21:02:52 UTC (rev 5128)
+++ trunk/catalog/admin/includes/classes/drivers/sqllinkto.php 2014-02-08 17:03:24 UTC (rev 5129)
@@ -167,6 +167,7 @@
@brief delete row
*/
public static function delete($option){
+
new self();
$DB=Database::getInstance();
@@ -178,7 +179,6 @@
if(isset($option['datatype_child'])) $where .="AND datatype_child = '".(string)$option['datatype_child']."' ";
if(isset($option['datatype_child_id'])) $where .="AND datatype_child_id = '".(int)$option['datatype_child_id']."' ";
-
if($where=='')
return false;
Modified: trunk/catalog/admin/includes/classes/drivers/sqlproduct.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlproduct.php 2014-02-06 21:02:52 UTC (rev 5128)
+++ trunk/catalog/admin/includes/classes/drivers/sqlproduct.php 2014-02-08 17:03:24 UTC (rev 5129)
@@ -81,10 +81,6 @@
$products_id = $resobj->__get('insertId');
- $res = $DB->query("insert into " . TABLE_PRODUCTS_TO_CATEGORIES . " (products_id, categories_id) values ('" . (int)$products_id . "', '".ORPHELIN_COLLECTOR."')");
- if(!$res)
- $error++;
-
$list_languages=tep_get_languages();
for ($i=0, $n=sizeof($list_languages); $i<$n; $i++) {
$language_id = $list_languages[$i]['id'];
@@ -96,6 +92,16 @@
$error++;
}
+ /*
+ Use transversal Datatype Rootlisting and update in data
+ Not in context update one col
+ */
+ if($error ==0 && isset($post['linkto'])){
+ $r = MLinkTo::SqlRightToAction('create', 'product', $products_id, $post['linkto']) ;
+ if($r == false)
+ $error++;
+ }
+
if( $error > 0){
$DB->rollbackTransaction();
return false;
@@ -214,15 +220,12 @@
Use transversal Datatype Rootlisting and update in data
Not in context update one col
*/
- if(count($sql_data_array) > 2) {
- if(isset($post['linkto'])){
- $r = MLinkTo::SqlLeftTo('product', $products_id, $post['linkto']) ;
- if($r == false)
- $error++;
- }
+ if($error ==0 && isset($post['linkto'])){
+ $r = MLinkTo::SqlRightToAction('update', 'product', $products_id, $post['linkto']) ;
+ if($r == false)
+ $error++;
}
-
if($error ==0 ) {
/// Separate Pricing Per Customer
$customers_group_query = $DB->query("select customers_group_id, customers_group_name from " . TABLE_CUSTOMERS_GROUPS . " where customers_group_id != '0' order by customers_group_id");
@@ -379,9 +382,9 @@
/*
Use transversal Datatype Rootlisting and update in data
*/
- $r = MLinkTo::SqlRightTo('product', (int)$product['products_id']) ;
- if($r == false)
- $error++;
+ $r = MLinkTo::SqlRightToAction(__FUNCTION__, 'product', (int)$product['products_id'] ) ;
+ if($r == false)
+ $error++;
else
$product = array_merge($product,$r);
@@ -428,13 +431,17 @@
/**
@brief delete row
+ @param option array
+ @param $trigger boolean false for block triggers
+ @return boolean true OK false KO
*/
- public static function delete($option){
+ public static function delete($option, $trigger=true){
new self();
$DB=Database::getInstance();
$modules = self::$modules;
$res = false;
+ $error = 0;
$product_categories = array();
if(isset($option['id']))
@@ -443,31 +450,32 @@
return false;
- if(isset($option['catarray'])){
- foreach($option['catarray'] as $k=>$v)
- $product_categories[$k]=(int)tep_db_input($v) ;
+ if($trigger) {
+ $r = MLinkTo::SqlRightToAction('delete', 'product', (int)$product_id) ;
+ if($r == false)
+ $error++;
+ }
+
+ $modules->delete($product_id);
+
+ tep_db_query("delete from " . TABLE_SPECIALS . " where products_id = '" . (int)$product_id . "'");
+ tep_db_query("delete from " . TABLE_PRODUCTS_GROUPS . " where products_id = '" . (int)$product_id . "'");
- for ($i=0, $n=sizeof($product_categories); $i<$n; $i++) {
- $DB->query($s="DELETE FROM " . TABLE_PRODUCTS_TO_CATEGORIES . " WHERE products_id = '" . (int)$product_id . "' AND categories_id = '" . (int)$product_categories[$i] . "' LIMIT 1 ");
- }
- }
- else
- $DB->query($s="DELETE FROM " . TABLE_PRODUCTS_TO_CATEGORIES . " WHERE products_id = '" . (int)$product_id . "' ");
+ // force delete ref products in cart
+ tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET . " where products_id = '" . (int)$product_id . "'");
+ tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where products_id = '" . (int)$product_id . "'");
- $product_categories_query = $DB->query("SELECT COUNT(*) AS total FROM " . TABLE_PRODUCTS_TO_CATEGORIES . " WHERE products_id = '" . (int)$product_id . "'");
- $product_categories = tep_db_fetch_array($product_categories_query);
+ sqlproductattribute::delete(array('products_id'=>$product_id));
- if ($product_categories['total'] == '0') {
- $modules->delete($product_id);
+ tep_db_query("delete from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$product_id . "'");
- $res=tep_remove_product($product_id);
- }
- else
- return false;
+ tep_db_query("delete from " . TABLE_PRODUCTS . " where products_id = '" . (int)$product_id . "'");
+ qtpro_doctor_amputate_all_from_product($product_id);
+
return $res;
}
@@ -606,7 +614,8 @@
return $product['id'];
}
-
+
+
/**
@fn MaintenanceTables()
@brief clean and maintient link table and data
@@ -628,8 +637,6 @@
$DB->query($sql="update " . TABLE_PRODUCTS_DESCRIPTION . " set language_id = 1 where language_id =0 ");
self::UpdateOrphelin();
-
- self::UpdateOrphelin();
}
@@ -705,81 +712,9 @@
}
- /**
- @brief Function link to for contruct link featured vs datatype
- @note normlised methode used in childs datatype
- */
- public static function ListLinkTo($opt){
- if(!isset($opt['id']))
- return false;
- else
- $id = (int)$opt['id'];
+
- if(isset($opt['datatype']))
- $datatype = $opt['datatype'] ;
- else
- $datatype = DATATYPES_DEFAULT_NOSELECTED;
- $list = sqlproductdata::fetch(
- array(
- 'datatype'=> $datatype,
- 'datatype_id'=> $id,
- ),
- true
- );
- if(!$list)
- return array();
- elseif(is_object($list))
- $liste[]=$list;
- else
- $liste=$list;
-
- return $liste;
- }
-
- /**
- @brief Function link to for contruct link featued vs datatype
- @note normlised methode used in childs datatype
- */
- public static function AddLinkTo($opt){
-
- new self();
-
- if(!isset($opt['id']))
- return false;
- else
- $id = (int)$opt['id'];
-
-
- if(isset($opt['datatype']))
- $datatype = $opt['datatype'] ;
- else
- $datatype = DATATYPES_DEFAULT_NOSELECTED;
-
-
- $data_array_link = $opt['_array'];
-
- sqlproductdata::delete(array('datatype'=> $datatype , 'datatype_id'=>$id ));
- $res = true;
-
- foreach($data_array_link as $value)
- if(sqlproductdata::fetch(
- array(
- 'id'=> $value,
- 'datatype'=> $datatype,
- 'datatype_id'=> $id,
- )
- ) == false )
- $res = sqlproductdata::create(
- array(
- 'id'=> $value,
- 'datatype'=> $datatype,
- 'datatype_id'=> $id,
- )
- );
- return $res;
- }
-
}
Added: trunk/catalog/admin/includes/classes/event_drivers/EventMess.php
===================================================================
--- trunk/catalog/admin/includes/classes/event_drivers/EventMess.php (rev 0)
+++ trunk/catalog/admin/includes/classes/event_drivers/EventMess.php 2014-02-08 17:03:24 UTC (rev 5129)
@@ -0,0 +1,34 @@
+<?php
+/**
+ @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 13/12/2013, 15:46
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+ @file EventMess.php
+ @dir admin/includes/classes/event_drivers/
+*/
+
+
+/**
+ @class EventMess
+*/
+class EventMess
+ extends EventHandler
+// Implements
+// EventNotify
+ {
+
+
+ public function update(SplSubject $subject, EventMessListener &$arg = NULL){
+ $messageStack = messageStack::getInstance();
+
+ $messageStackFunction = (isset($_GET['forceajax']) ? 'add' : 'add_session' );
+
+ $messageStack->$messageStackFunction($arg->GetMessage() , $arg->GetType());
+ }
+}
+
+
+?>
\ No newline at end of file
Added: trunk/catalog/admin/includes/classes/event_drivers/EventNotification.php
===================================...
[truncated message content] |
|
From: <os...@us...> - 2014-02-06 21:02:55
|
Revision: 5128
http://sourceforge.net/p/oscss/svn/5128
Author: oscim
Date: 2014-02-06 21:02:52 +0000 (Thu, 06 Feb 2014)
Log Message:
-----------
Fix
Modified Paths:
--------------
trunk/catalog/templates/defaut/includes/boxes/myaccount.php
Modified: trunk/catalog/templates/defaut/includes/boxes/myaccount.php
===================================================================
--- trunk/catalog/templates/defaut/includes/boxes/myaccount.php 2014-02-06 20:48:33 UTC (rev 5127)
+++ trunk/catalog/templates/defaut/includes/boxes/myaccount.php 2014-02-06 21:02:52 UTC (rev 5128)
@@ -78,7 +78,7 @@
$objectBoxes = new BoxesListenerRow(
__('link text login'),
__('link text login'),
- tep_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL')
+ tep_href_link(FILENAME_LOGIN, '', 'SSL')
);
$list[] = $objectBoxes;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2014-02-06 20:48:36
|
Revision: 5127
http://sourceforge.net/p/oscss/svn/5127
Author: oscim
Date: 2014-02-06 20:48:33 +0000 (Thu, 06 Feb 2014)
Log Message:
-----------
Fix
Modified Paths:
--------------
trunk/catalog/templates/defaut/includes/boxes/shopping_cart_short.php
Modified: trunk/catalog/templates/defaut/includes/boxes/shopping_cart_short.php
===================================================================
--- trunk/catalog/templates/defaut/includes/boxes/shopping_cart_short.php 2014-02-06 20:47:31 UTC (rev 5126)
+++ trunk/catalog/templates/defaut/includes/boxes/shopping_cart_short.php 2014-02-06 20:48:33 UTC (rev 5127)
@@ -1,14 +1,15 @@
<?php
/**
- *\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 04/10/2013, 08:18
- *\author oscim <mail aur...@os...> <www http://www.oscim.fr>
- *\encode UTF-8
- *\group boxes
- *\file shopping_cart_short.php
+ @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 04/10/2013, 08:18
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+ @group boxes
+ @file shopping_cart_short.php
+ @dir templates/defaut/includes/boxes/
*/
@@ -21,9 +22,9 @@
/**
@remarks Process Specific Boxes
*/
- global $total_nb_products_with_qty;
+ global $total_nb_products_with_qty, $cart;
$currencies=$page->return_object('currencies');
- $cart=$page->return_object('cart');
+
$total_nb_products_with_qty = 0;
if (is_object($cart) &&$cart->count_contents() > 0) {
$products = $cart->get_products();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2014-02-06 20:47:36
|
Revision: 5126
http://sourceforge.net/p/oscss/svn/5126
Author: oscim
Date: 2014-02-06 20:47:31 +0000 (Thu, 06 Feb 2014)
Log Message:
-----------
Fix
Modified Paths:
--------------
trunk/catalog/templates/defaut/includes/gabarit/box.cart.short.gab
Modified: trunk/catalog/templates/defaut/includes/gabarit/box.cart.short.gab
===================================================================
--- trunk/catalog/templates/defaut/includes/gabarit/box.cart.short.gab 2014-02-06 20:10:19 UTC (rev 5125)
+++ trunk/catalog/templates/defaut/includes/gabarit/box.cart.short.gab 2014-02-06 20:47:31 UTC (rev 5126)
@@ -1,12 +1,14 @@
<?php
/**
- @licence GPL 2005-2010 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.0
+ @version 2.2.0
@date 16/09/10, 02:17
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
+ @file box.cart.short.gab
+ @dir templates/defaut/includes/gabarit/
*/
global $total_nb_products_with_qty, $currencies,$cart;
?>
@@ -16,7 +18,7 @@
<a href="<?php echo tep_href_link(FILENAME_SHOPPING_CART) ?>"><?php echo $total_nb_products_with_qty .' '.( ( $total_nb_products_with_qty == '1' )? __('box shopping cart products nb') : __('box shopping cart products nbs') ) ?></a><br />
<ul>
<?php foreach($cart->show_list_total() as $i=>$tot): ?>
- <li><span><?php echo $tot->text; ?></span> <?php echo htmlentities($currencies->format($tot->value)) ; ?><li>
+ <li><span><?php echo $tot->text; ?></span> <?php echo htmlentities($currencies->format($tot->value)) ; ?></li>
<?php endforeach; ?>
</ul>
</li>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2014-02-06 20:10:23
|
Revision: 5125
http://sourceforge.net/p/oscss/svn/5125
Author: oscim
Date: 2014-02-06 20:10:19 +0000 (Thu, 06 Feb 2014)
Log Message:
-----------
Fix
Modified Paths:
--------------
trunk/catalog/includes/classes/drivers/data/content.php
Modified: trunk/catalog/includes/classes/drivers/data/content.php
===================================================================
--- trunk/catalog/includes/classes/drivers/data/content.php 2014-02-06 17:50:07 UTC (rev 5124)
+++ trunk/catalog/includes/classes/drivers/data/content.php 2014-02-06 20:10:19 UTC (rev 5125)
@@ -142,7 +142,7 @@
$content['name']
);
- $DataRow->SetText($content['text']);
+ $DataRow->SetText( tep_output_string_protected($content['text']) );
$DataRow->SetChapo( self::parse_content($content['text'],$content['id'], true) );
foreach($listlinkto as $row){
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2014-02-06 17:50:11
|
Revision: 5124
http://sourceforge.net/p/oscss/svn/5124
Author: oscim
Date: 2014-02-06 17:50:07 +0000 (Thu, 06 Feb 2014)
Log Message:
-----------
Fix
Next develop for centralise continue..
REport in module Use ModTreePage
Modified Paths:
--------------
trunk/catalog/admin/includes/classes/ModTree.php
trunk/catalog/admin/includes/classes/ModTreePage.php
trunk/catalog/admin/includes/classes/drivers/sqladminuser.php
trunk/catalog/admin/includes/modules/pages/adminUsers.php
trunk/catalog/admin/includes/modules/pages/categories.php
trunk/catalog/admin/includes/modules/pages/cms_content.php
trunk/catalog/admin/includes/modules/pages/countries.php
trunk/catalog/admin/includes/modules/pages/currencies.php
trunk/catalog/admin/includes/modules/pages/customers.php
trunk/catalog/admin/includes/modules/pages/featureds.php
trunk/catalog/admin/includes/modules/pages/navigation_links.php
trunk/catalog/admin/includes/modules/pages/products.php
trunk/catalog/admin/includes/modules/pages/usersNotif.php
trunk/catalog/admin/includes/template/oscss/header-1.php
trunk/catalog/admin/includes/template/oscss/inc/lib.template.php
Modified: trunk/catalog/admin/includes/classes/ModTree.php
===================================================================
--- trunk/catalog/admin/includes/classes/ModTree.php 2014-02-05 17:55:04 UTC (rev 5123)
+++ trunk/catalog/admin/includes/classes/ModTree.php 2014-02-06 17:50:07 UTC (rev 5124)
@@ -783,18 +783,99 @@
return call_user_func(array(self::$code, 'GetDBValue'),$ID);
}
+ /**
+ @brief alias GenericRowsActions
+ */
+ public static function ButtonRowsActions($item){
+ return self::GenericRowsActions($item);
+ }
+
+ /**
+ @brief alias GenericRowsFlag
+ */
+ public static function RowStatus($item){
+ return self::GenericRowsFlag($item);
+ }
- public static function ButtonRowsActions($item){
- $FileName=call_user_func(array(self::$code, 'GetFILENAME'));
+ /**
+ @brief alias GenericRowsFlag
+ */
+ public static function RowHidden($item){
+ return self::GenericRowsFlag($item, 'hidden', 'viewflag');
+ }
+
+ /**
+ @fn GenericRowsActions( $item, $ListAvailable='ed', $listLeft='', $listRight = '' )
+ @brief Construct all action
+ @param array row current
+ @param $ListAvailable string list of generic action activate
+ - e : edit
+ - c : copy to
+ - d : delete (confirm by popup )
+ - v : view
+ - n : noedit
+ - p : preview (ajax popup)
+ - f : public link front
+ @param $listLeft string complet action in list of already action
+ @param $listRight string complet action (right)
+ @return string
+ Final html for cola action in Datatables display
+ */
+ protected static function GenericRowsActions($item, $ListAvailable='ed', $listLeft='', $listRight = '' ){
+ $FileName=self::GetFILENAME();
+ $class = self::GetClassName();
+
+ $action_str = '';
+
+// if( preg_match('#f#i',$ListAvailable) )
+// $action_str.=sprintf(CsrtAction::getLink('row_action_right', __('image view public') , 'publiclink'), '', tep_catalog_href_link('index.php', 'products_id=' . $products['id'],'SSL', true, 'forceview') ,' target="blank" ' );
+
+ if( preg_match('#n#i',$ListAvailable ))
+ $action_str.=sprintf(CsrtAction::getLink('row_action_right', IMAGE_DETAILS, 'noedit'), '', tep_href_link($FileName, 'cID=' . $item['id'] . '&action=noedit' ),'' );
+
+ if( preg_match('#c#i',$ListAvailable) && tep_action_check('copy_to', $FileName))
+ $action_str.=sprintf(CsrtAction::getLink('row_action_right', IMAGE_COPY_TO, 'copyto'), 'fancy', tep_href_link($FileName, 'cID=' . $item['id'] . '&action=copy_to') ,'' );
+
+ if(preg_match('#e#i',$ListAvailable) && tep_action_check('edit', $FileName))
+ $action_str.=sprintf(CsrtAction::getLink('row_action_right', IMAGE_EDIT, 'edit'), '', tep_href_link($FileName, 'cID=' . $item['id'] . '&action=edit') ,'' );
+
+ if(preg_match('#d#i',$ListAvailable) && tep_action_check('delete', $FileName))
+ $action_str.=sprintf(CsrtAction::getLink('row_action_right', IMAGE_DELETE, 'delete'), 'fancy', tep_href_link($FileName, 'cID=' . $item['id'] . '&action=delete') ,'' );
+
+
return sprintf(CsrtAction::getFormat('row_action'),
- '',
- sprintf(CsrtAction::getLink('row_action_right', IMAGE_EDIT, 'edit'), '', tep_href_link($FileName, 'iID=' . $item['id'] . '&action=edit') ,'' ).
- sprintf(CsrtAction::getLink('row_action_right', IMAGE_DELETE, 'delete'), 'fancy', tep_href_link($FileName, 'iID=' . $item['id'] . '&action=delete') ,'' )
+ $listRight,
+ $listLeft. $action_str
);
}
+
+
+ /**
+ @fn GenericRowsFlag($item, $flag='status')
+ @param array row current
+ @param flag string short colonne name
+ @param $action string name of action
+ @param $type string type of flag (view template)
+ @return string html
+ image + link for ajax process update flag
+ */
+ protected static function GenericRowsFlag($item, $flag='status', $action='setflag', $type='row_flag'){
+ $FileName=self::GetFILENAME();
+
+ $exclude=array('action','cID','forceajax','type','class','file','function','funct', 'mod', $action);
+
+ $query_s='action='.$action.'&cID=' . $item['id'].'&flag=';
+ return '<a class="ajaxinline" href="' . tep_href_link($FileName, tep_get_all_get_params($exclude).$query_s.(($item[$flag] == '1')? '0' : '1') ) . '">'.
+ sprintf(
+ CsrtAction::getFormat($type),
+ (int)$item[$flag],
+ ( ($item[$flag] == '1')? IMAGE_ICON_STATUS_GREEN : IMAGE_ICON_STATUS_RED)
+ ).
+ '</a>';
+ }
}
Modified: trunk/catalog/admin/includes/classes/ModTreePage.php
===================================================================
--- trunk/catalog/admin/includes/classes/ModTreePage.php 2014-02-05 17:55:04 UTC (rev 5123)
+++ trunk/catalog/admin/includes/classes/ModTreePage.php 2014-02-06 17:50:07 UTC (rev 5124)
@@ -246,14 +246,14 @@
if(!is_object($class::$Info))
$class::$Info = $class::GetDBValue();
$action = '';
- return $class::RowStatus(array('status'=>(int)$_GET['flag'], 'id'=>(int)$class::$Id));
+ print $class::RowStatus(array('status'=>(int)$_GET['flag'], 'id'=>(int)$class::$Id));
break;
case 'viewflag':
if(!is_object($class::$Info))
$class::$Info = $class::GetDBValue();
$action = '';
- return $class::RowHidden(array('hidden'=>(int)$class::$Info->hidden, 'id'=>(int)$class::$Id));
+ print $class::RowHidden(array('hidden'=>(int)$class::$Info->hidden, 'id'=>(int)$class::$Id));
break;
/**
Modified: trunk/catalog/admin/includes/classes/drivers/sqladminuser.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqladminuser.php 2014-02-05 17:55:04 UTC (rev 5123)
+++ trunk/catalog/admin/includes/classes/drivers/sqladminuser.php 2014-02-06 17:50:07 UTC (rev 5124)
@@ -7,12 +7,14 @@
@date 29/10/2013, 20:11
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
- @class manage link table configuration
+ @file sqladminuser.php
+ @dir admin/includes/classes/drivers/
*/
-
-error_reporting(E_ALL);
+/**
+ @class sqladminuser
+*/
class sqladminuser
implements ModSqlDataDriver{
Modified: trunk/catalog/admin/includes/modules/pages/adminUsers.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/adminUsers.php 2014-02-05 17:55:04 UTC (rev 5123)
+++ trunk/catalog/admin/includes/modules/pages/adminUsers.php 2014-02-06 17:50:07 UTC (rev 5124)
@@ -598,49 +598,7 @@
}
- /**
- @fn display_view()
- @brief this methode is switch for call gabarit action
- */
-// public function display_view(){
-// $action=self::$action;
-// $MG= false;
-// switch ($action) {
-//
-// /**
-// @remarks Ajax View result
-// */
-// case 'setflag':
-// return self::RowStatus(array('status'=>(int)$_GET['flag'], 'id'=>(int)$_GET['cID']));
-// break;
-//
-//
-// /**
-// @remarks Normal View Page
-// */
-// case 'new':
-// $action='edit';
-// case 'delete':
-// case 'edit':
-// $MG= true;
-// self::$Info=self::GetDBValue();
-// break;
-//
-// case 'listing':
-// default:
-// $MG= true;
-// $action='listing';
-// }
-//
-// if($MG)
-// return MGabCont::CallGab($action,__FUNCTION__,self::MASTER);
-// else
-// return MGabCont::CallGab($action,__FUNCTION__,__CLASS__);
-// }
-
-
-
/**
@fn ButtonRowsActions($item)
@return string html
@@ -648,18 +606,11 @@
public static function ButtonRowsActions($item){
$left = '';
- if(tep_action_check('new', self::FILENAME) || $_SESSION['login_id'] == $item['admin_id'])
+ if(tep_action_check('edit', self::FILENAME) || $_SESSION['login_id'] == $item['admin_id'])
$left .=sprintf(CsrtAction::getLink('row_action_right', IMAGE_EDIT, 'edit'), '', tep_href_link(self::FILENAME, 'cID=' . $item['id'] . '&action=edit') ,'' );
- if(tep_action_check('delete',self::FILENAME))
- $left .=sprintf(CsrtAction::getLink('row_action_right', IMAGE_DELETE, 'delete'), 'fancy', tep_href_link(self::FILENAME, 'cID=' . $item['id'] . '&action=delete') ,'' );
- return sprintf(
- CsrtAction::getFormat('row_action'),
- ''
- ,
- $left
- );
+ return parent::GenericRowsActions($item, 'nd', $action_str_left, $action_str);
}
/**
@@ -679,25 +630,11 @@
( IMAGE_ICON_STATUS_GREEN )
);
- return '<a class="ajaxinline" href="' . tep_href_link(self::FILENAME, tep_get_all_get_params($exclude).$query_s.(($item['status'] == '1')? '0' : '1') ) . '">'.
- sprintf(
- CsrtAction::getFormat('row_flag'),
- (int)$item['status'],
- ( ($item['status'] == '1')? IMAGE_ICON_STATUS_GREEN : IMAGE_ICON_STATUS_RED)
- ).
- '</a>';
- }
+ return parent::RowStatus($item);
+ }
/**
- @brief return Filename
- */
- public static function GetFILENAME(){
- return self::FILENAME;
- }
-
-
- /**
@brief Check email if not exists
@param $email string email
@param $admin_id int admin id
Modified: trunk/catalog/admin/includes/modules/pages/categories.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/categories.php 2014-02-05 17:55:04 UTC (rev 5123)
+++ trunk/catalog/admin/includes/modules/pages/categories.php 2014-02-06 17:50:07 UTC (rev 5124)
@@ -744,7 +744,7 @@
}
-/** public static InterfacedTJsonS */
+
/**
@fn get_item_action($products)
@brief fonction qui construit l'affichage de la colonne action
@@ -752,68 +752,21 @@
@param $products array
@return string
*/
- public static function ButtonRowsActions($categories){
- $action_str_left='';
+ public static function ButtonRowsActions($item){
$action_str ='';
- $action_str_left.=sprintf(CsrtAction::getLink('row_action_right', ICON_FOLDER, 'childs'), '', tep_href_link(self::FILENAME, 'cPath=' . $categories['id'] ),'' );
+ $action_str.=sprintf(CsrtAction::getLink('row_action_right', ICON_FOLDER, 'childs'), '', tep_href_link(self::FILENAME, 'cPath=' . $item['id'] ),'' );
- $action_str.=sprintf(CsrtAction::getLink('row_action_right', __('image view public') , 'publiclink'), '', tep_catalog_href_link('index.php', 'cPath=' . $categories['cPath'],'SSL', true, 'forceview') ,' target="blank" ' );
- $action_str.=sprintf(CsrtAction::getLink('row_action_right', IMAGE_DETAILS, 'noedit'), '', tep_href_link(self::FILENAME, 'cPath=' . self::$cPath . '&cID=' . $categories['id'] . '&action=noedit' ),'' );
+ $action_str_left=sprintf(CsrtAction::getLink('row_action_right', __('image view public') , 'publiclink'), '', tep_catalog_href_link('index.php', 'cPath=' . $categories['cPath'],'SSL', true, 'forceview') ,' target="blank" ' );
+
+ $action_str .=self::$modules->display_ColumnRowAction($item['id']) ;
- if(tep_action_check('edit', self::FILENAME))
- $action_str.=sprintf(CsrtAction::getLink('row_action_right', IMAGE_EDIT, 'edit'), '', tep_href_link(self::FILENAME, 'cPath=' . self::$cPath . '&cID=' . $categories['id'] . '&action=edit' ),'' );
- if(tep_action_check('delete', self::FILENAME))
- $action_str.= sprintf(CsrtAction::getLink('row_action_right', IMAGE_DELETE, 'delete'), 'fancy', tep_href_link(self::FILENAME, 'cPath=' . self::$cPath . '&cID=' . $categories['id'] . '&action=delete') ,'' );
-
- return sprintf(
- CsrtAction::getFormat('row_action'),
- self::$modules->display_ColumnRowAction($categories['id']) .
- $action_str_left
- ,
- $action_str
- );
+ return parent::GenericRowsActions($item, 'nced', $action_str_left, $action_str);
}
- /**
- @brief return format html for row status
- @param $product array restuts row
- @return string html
- */
- public static function RowStatus($categories){
- $exclude=array('action','cID','forceajax','type','class','function','funct', 'mod');
- $query_s='action=setflag&cID=' . $categories['id'].'&flag=';
- return '<a class="ajaxinline" href="' . tep_href_link(self::FILENAME, tep_get_all_get_params($exclude).$query_s.(($categories['status'] == '1')? '0' : '1') ) . '">'.
- sprintf(
- CsrtAction::getFormat('row_flag'),
- (int)$categories['status'],
- ( ($categories['status'] == '1')? IMAGE_ICON_STATUS_GREEN : IMAGE_ICON_STATUS_RED)
- ).
- '</a>';
- }
- /**
- @brief return format html for row hidden
- @param $product array restuts row
- @return string html
- */
- public static function RowHidden($categories){
- $exclude=array('action','cID','forceajax','type','class','function','funct', 'mod');
- $query_s='action=viewflag&cID=' . $categories['id'].'&flag=';
-
- return '<a class="ajaxinline" href="' . tep_href_link(self::FILENAME, tep_get_all_get_params($exclude).$query_s.(($categories['hidden'] == '1')? '0' : '1') ) . '">'.
- sprintf(
- CsrtAction::getFormat('row_flag'),
- (int)$categories['hidden'],
- ( ($categories['hidden'] == '1')? IMAGE_ICON_STATUS_GREEN : IMAGE_ICON_STATUS_RED)
- ).
- '</a>';
- }
-
-
-
/** static InterfacedInnerHtml */
public static function detail_row_page($id){
@@ -823,15 +776,6 @@
}
- /**
- @brief return Filename
- */
- public static function GetFILENAME(){
- return self::FILENAME;
- }
-
-
-
/**
@brief format db value for display page
@param $_query ressource db sql
Modified: trunk/catalog/admin/includes/modules/pages/cms_content.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/cms_content.php 2014-02-05 17:55:04 UTC (rev 5123)
+++ trunk/catalog/admin/includes/modules/pages/cms_content.php 2014-02-06 17:50:07 UTC (rev 5124)
@@ -622,67 +622,22 @@
/**
@fn get_item_action($content)
@brief private model for row action
- @param $content array
+ @param $item array
*/
- public static function ButtonRowsActions($content){
+ public static function ButtonRowsActions($item){
- $action_str_left='';
$action_str ='';
- $action_str.=sprintf(CsrtAction::getLink('row_action_right', __('image view public') , 'publiclink'), '', tep_catalog_href_link('index.php', 'content=' . $content['id'],'SSL', true, 'forceview') ,' target="blank" ' );
- $action_str.=sprintf(CsrtAction::getLink('row_action_right', IMAGE_DETAILS, 'noedit'), '', tep_href_link(self::FILENAME, 'cID=' . $content['id'] . '&action=noedit') ,'' );
+ $action_str_left=sprintf(CsrtAction::getLink('row_action_right', __('image view public') , 'publiclink'), '', tep_catalog_href_link('index.php', 'content=' . $item['id'],'SSL', true, 'forceview') ,' target="blank" ' );
- if(tep_action_check('edit', self::FILENAME))
- $action_str.=sprintf(CsrtAction::getLink('row_action_right', IMAGE_EDIT, 'edit'), '', tep_href_link(self::FILENAME, 'cID=' . $content['id'] . '&action=edit') ,'' );
- if(tep_action_check('delete', self::FILENAME))
- $action_str.=sprintf(CsrtAction::getLink('row_action_right', IMAGE_DELETE, 'delete'), 'fancy', tep_href_link(self::FILENAME, 'cID=' . $content['id'] . '&action=delete') ,'' );
- return sprintf(
- CsrtAction::getFormat('row_action'),
- self::$modules->display_ColumnRowAction($content['id']).
- $action_str_left
- ,
- $action_str
- );
- }
+ $action_str = self::$modules->display_ColumnRowAction($item['id']);
- /**
- @fn get_item_status($content)
- @brief private model for row status
- @param $content array
- */
- public static function RowStatus($content){
- $exclude=array('action','cID','forceajax','type','class','function','funct', 'mod');
- $query_s='action=setflag&cID=' . $content['id'].'&flag=';
-
- return '<a class="ajaxinline" href="' . tep_href_link(self::FILENAME, tep_get_all_get_params($exclude).$query_s.(($content['status'] == '1')? '0' : '1') ) . '">'.
- sprintf(
- CsrtAction::getFormat('row_flag'),
- (int)$content['status'],
- ( ($content['status'] == '1')? IMAGE_ICON_STATUS_GREEN : IMAGE_ICON_STATUS_RED)
- ).
- '</a>';
+
+ return parent::GenericRowsActions($item, 'ned', $action_str_left, $action_str);
}
- /**
- @fn get_item_content_hidden($content)
- @brief private model for row hidden
- @param $content array
- */
- public static function RowHidden($content){
- $exclude=array('action','cID','forceajax','type','class','function','funct', 'mod');
- $query_s='action=viewflag&cID=' . $content['id'].'&flag=';
-
- return '<a class="ajaxinline" href="' . tep_href_link(self::FILENAME, tep_get_all_get_params($exclude).$query_s.(($content['hidden'] == '1')? '0' : '1') ) . '">'.
- sprintf(
- CsrtAction::getFormat('row_flag'),
- (int)$content['hidden'],
- ( ($content['hidden'] == '1')? IMAGE_ICON_STATUS_GREEN : IMAGE_ICON_STATUS_RED)
- ).
- '</a>';
- }
-
/**
@fn HrefLink($id, $action='edit')
@brief retrun link specififc this data
Modified: trunk/catalog/admin/includes/modules/pages/countries.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/countries.php 2014-02-05 17:55:04 UTC (rev 5123)
+++ trunk/catalog/admin/includes/modules/pages/countries.php 2014-02-06 17:50:07 UTC (rev 5124)
@@ -350,8 +350,6 @@
$res = false;
switch (self::$action) {
-
-
case 'new_zone':
self::$Info = sqlzones::Specimen( true);
break;
@@ -480,8 +478,6 @@
- /** public static InterfacedTJsonS */
-
/**
@brief format db value for display page
@param $_query ressource db sql
@@ -501,7 +497,7 @@
foreach(self::$InitInfo['modele']['listing'] as $k=>$row)
if( ($value = self::FormatDBValueRow($k, $item)) && $value !=false )
$ord[$k]= $value;
- elseif($k == 'visible') $ord[$k]=self::RowStatus($item);
+ elseif($k == 'visible') $ord[$k]=self::GenericRowsFlag($item, 'visible');
else $ord[$k]=$item[$k];
$res[]=$ord;
@@ -515,45 +511,7 @@
return $res;
}
- /**
- @fn ButtonRowsActions($item)
- @return string html
- */
- public static function ButtonRowsActions($item){
- $action_str = '';
- if(tep_action_check('edit', self::FILENAME))
- $action_str .=sprintf(CsrtAction::getLink('row_action_right', IMAGE_DELETE, 'edit'), '', tep_href_link(self::FILENAME, 'cID=' . $item['id'] . '&action=edit') ,'' );
- if(tep_action_check('delete', self::FILENAME))
- $action_str .=sprintf(CsrtAction::getLink('row_action_right', IMAGE_DELETE, 'delete'), 'fancy', tep_href_link(self::FILENAME, 'cID=' . $item['id'] . '&action=delete') ,'' );
-
- return sprintf(
- CsrtAction::getFormat('row_action'),
- ''
- ,
- $action_str
- );
- }
-
- /**
- @brief return format html for row status
- @param $product array restuts row product
- @return string html
- */
- protected static function RowStatus($item){
- $exclude=array('action','pID','forceajax','type','class','function','funct', 'mod');
- $query_s='action=setflag&cID=' . $item['id'].'&flag=';
-
- return '<a class="ajaxinline" href="' . tep_href_link(self::FILENAME, tep_get_all_get_params($exclude).$query_s.(($item['visible'] == '1')? '0' : '1') ) . '">'.
- sprintf(
- CsrtAction::getFormat('row_flag'),
- (int)$item['visible'],
- ( ($item['visible'] == '1')? IMAGE_ICON_STATUS_GREEN : IMAGE_ICON_STATUS_RED)
- ).
- '</a>';
- }
-
-
}
?>
\ No newline at end of file
Modified: trunk/catalog/admin/includes/modules/pages/currencies.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/currencies.php 2014-02-05 17:55:04 UTC (rev 5123)
+++ trunk/catalog/admin/includes/modules/pages/currencies.php 2014-02-06 17:50:07 UTC (rev 5124)
@@ -430,54 +430,6 @@
}
}
-
- /**
- @fn ButtonRowsActions($item)
- @return string html
- */
- public static function ButtonRowsActions($item){
- $left = '';
-
- if(tep_action_check('new', self::FILENAME) || $_SESSION['login_id'] == $item['admin_id'])
- $left .=sprintf(CsrtAction::getLink('row_action_right', IMAGE_EDIT, 'edit'), '', tep_href_link(self::FILENAME, 'cID=' . $item['id'] . '&action=edit') ,'' );
-
- if(tep_action_check('delete',self::FILENAME))
- $left .=sprintf(CsrtAction::getLink('row_action_right', IMAGE_DELETE, 'delete'), 'fancy', tep_href_link(self::FILENAME, 'cID=' . $item['id'] . '&action=delete') ,'' );
-
- return sprintf(
- CsrtAction::getFormat('row_action'),
- ''
- ,
- $left
- );
- }
-
- /**
- @brief return format html for row status
- @param $product array restuts row product
- @return string html
- */
- public static function RowStatus($item){
- $exclude=array('action','setflag','forceajax','cID','class','function','flag', 'mod');
- $query_s='action=setflag&cID=' . $item['id'].'&flag=';
-
- // force admin not desactive
- if($item['id'] ==1 || !tep_action_check('edit', self::FILENAME))
- return sprintf(
- CsrtAction::getFormat('row_flag'),
- (int)1,
- ( IMAGE_ICON_STATUS_GREEN )
- );
-
- return '<a class="ajaxinline" href="' . tep_href_link(self::FILENAME, tep_get_all_get_params($exclude).$query_s.(($item['status'] == '1')? '0' : '1') ) . '">'.
- sprintf(
- CsrtAction::getFormat('row_flag'),
- (int)$item['status'],
- ( ($item['status'] == '1')? IMAGE_ICON_STATUS_GREEN : IMAGE_ICON_STATUS_RED)
- ).
- '</a>';
- }
-
}
?>
\ No newline at end of file
Modified: trunk/catalog/admin/includes/modules/pages/customers.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/customers.php 2014-02-05 17:55:04 UTC (rev 5123)
+++ trunk/catalog/admin/includes/modules/pages/customers.php 2014-02-06 17:50:07 UTC (rev 5124)
@@ -872,8 +872,6 @@
- /** static InterfacedInnerHtml */
-
public static function detail_row_page($id){
// force rattribution id
$_REQUEST['cID'] = (int)$id;
@@ -888,43 +886,25 @@
/**
- @brief return format html for row status
- @param $product array restuts row
- @return string html
- */
- public static function RowStatus($customers){
- $exclude=array('action','cID','forceajax','type','class','function','funct', 'mod');
- $query_s='action=setflag&cID=' . $customers['id'].'&flag=';
-
- return '<a class="ajaxinline" href="' . tep_href_link(self::FILENAME, tep_get_all_get_params($exclude).$query_s.(($customers['status'] == '1')? '0' : '1') ) . '">'.
- sprintf(
- CsrtAction::getFormat('row_flag'),
- (int)$customers['status'],
- ( ($customers['status'] == '1')? IMAGE_ICON_STATUS_GREEN : IMAGE_ICON_STATUS_RED)
- ).
- '</a>';
- }
-
- /**
@brief return format html for row
@param $product array restuts row
@return string html
*/
- public static function RowStatusDa($customers){
+// 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>';
+// }
- $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
@@ -932,17 +912,15 @@
@param $orders array
@return string
*/
- public static function ButtonRowsActions($customers){
+ public static function ButtonRowsActions($item){
global $SecuKey;
- return sprintf(
- CsrtAction::getFormat('row_action'),
- self::$modules->display_ColumnRowAction($customers['id']) ,
- sprintf(CsrtAction::getLink('row_action_right', __('incarner'), 'incarner'), '', tep_catalog_href_link('login.php','osCAdminDirect='.md5($SecuKey.date('d')).'&id='.$customers['id'],'SSL', false ) ,'').
- sprintf(CsrtAction::getLink('row_action_right', IMAGE_EDIT, 'noedit'), '', tep_href_link(self::FILENAME,'cID=' . $customers['id'].'&action=noedit' ),'' ).
- sprintf(CsrtAction::getLink('row_action_right', __('@customers button vcard'), 'vcard'), '', tep_href_link(self::FILENAME,'cID=' . $customers['id'].'&action=vcard' ) ,'').
- sprintf(CsrtAction::getLink('row_action_right', IMAGE_EDIT, 'edit'), '', tep_href_link(self::FILENAME,'cID=' . $customers['id'].'&action=edit' ),'' ).
- sprintf(CsrtAction::getLink('row_action_right', IMAGE_DELETE, 'delete'), 'fancy', tep_href_link(self::FILENAME, 'cID=' . $customers['id'].'&action=delete' ) ,'' )
- );
+
+ $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($customers['id']);
+ return parent::GenericRowsActions($item, 'ned', $action_str_left, $action_str);
}
@@ -1001,18 +979,16 @@
foreach(self::$InitInfo['modele']['listing'] as $k=>$row){
if( ($value = self::FormatDBValueRow($k, $item)) && $value !=false )
$ord[$k]= $value;
- elseif($k == 'entry_gender'){
- if($row == 'm')
- $ord[$k]=MALE;
- elseif($row == 'f')
- $ord[$k]=FEMALE;
- elseif($row == 'l')
- $ord[$k]=MLLE;
- }
- elseif($k == 'group_ra') $ord[$k]=self::RowStatusDa($item);
- 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];
+ 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];
}
$ord[0]=$item['id'];
Modified: trunk/catalog/admin/includes/modules/pages/featureds.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/featureds.php 2014-02-05 17:55:04 UTC (rev 5123)
+++ trunk/catalog/admin/includes/modules/pages/featureds.php 2014-02-06 17:50:07 UTC (rev 5124)
@@ -442,39 +442,8 @@
return $res;
}
- /**
- @fn ButtonRowsActions($item)
- @return string html
- */
- public static function ButtonRowsActions($item){
- return sprintf(
- CsrtAction::getFormat('row_action'),
-''
- ,
- sprintf(CsrtAction::getLink('row_action_right', IMAGE_DELETE, 'edit'), '', tep_href_link(self::FILENAME, 'cID=' . $item['id'] . '&action=edit') ,'' ).
- sprintf(CsrtAction::getLink('row_action_right', IMAGE_DELETE, 'delete'), 'fancy', tep_href_link(self::FILENAME, 'cID=' . $item['id'] . '&action=delete') ,'' )
- );
- }
- /**
- @brief return format html for row status
- @param $product array restuts row product
- @return string html
- */
- protected static function RowStatus($item){
- $exclude=array('action','flag','file','setflag','forceajax');
- $query_s='action=setflag&cID=' . $item['id'].'&flag=';
- return '<a class="ajaxinline" href="' . tep_href_link(self::FILENAME, $query_s.(($item['status'] == '1')? '0' : '1') ) . '">'.
- sprintf(
- CsrtAction::getFormat('row_flag'),
- (int)$item['status'],
- ( ($item['status'] == '1')? IMAGE_ICON_STATUS_GREEN : IMAGE_ICON_STATUS_RED)
- ).
- '</a>';
- }
-
-
}
?>
\ No newline at end of file
Modified: trunk/catalog/admin/includes/modules/pages/navigation_links.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/navigation_links.php 2014-02-05 17:55:04 UTC (rev 5123)
+++ trunk/catalog/admin/includes/modules/pages/navigation_links.php 2014-02-06 17:50:07 UTC (rev 5124)
@@ -554,39 +554,7 @@
return $res;
}
- /**
- @fn ButtonRowsActions($item)
- @return string html
- */
- public static function ButtonRowsActions($item){
- return sprintf(
- CsrtAction::getFormat('row_action'),
-''
- ,
- sprintf(CsrtAction::getLink('row_action_right', IMAGE_DELETE, 'edit'), '', tep_href_link(self::FILENAME, 'cID=' . $item['id'] . '&action=edit') ,'' ).
- sprintf(CsrtAction::getLink('row_action_right', IMAGE_DELETE, 'delete'), 'fancy', tep_href_link(self::FILENAME, 'cID=' . $item['id'] . '&action=delete') ,'' )
- );
- }
- /**
- @brief return format html for row status
- @param $product array restuts row product
- @return string html
- */
- public static function RowStatus($item){
- $exclude=array('action','cID','forceajax','type','class','function','funct', 'mod');
- $query_s='action=setflag&cID=' . $item['id'].'&flag=';
-
- return '<a class="ajaxinline" href="' . tep_href_link(self::FILENAME, tep_get_all_get_params($exclude).$query_s.(($item['status'] == 1)? '0' : '1') ) . '">'.
- sprintf(
- CsrtAction::getFormat('row_flag'),
- (int)$item['status'],
- ( ($item['status'] == 1)? IMAGE_ICON_STATUS_GREEN : IMAGE_ICON_STATUS_RED)
- ).
- '</a>';
- }
-
-
/**
Return a navigation links name
*/
Modified: trunk/catalog/admin/includes/modules/pages/products.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/products.php 2014-02-05 17:55:04 UTC (rev 5123)
+++ trunk/catalog/admin/includes/modules/pages/products.php 2014-02-06 17:50:07 UTC (rev 5124)
@@ -919,19 +919,15 @@
break;
case 'setflag':
-
-// if(!tep_action_check('setflag', self::FILENAME)){
-
if ( ($_GET['flag'] == '0') || ($_GET['flag'] == '1') ) {
if (isset(self::$Id))
sqlproduct::update(array('id'=>self::$Id, 'sqlarray'=>array('products_status'=>$_GET['flag'])));
-// tep_set_product_status(self::$Id, $_GET['flag']);
osCSS_Cache::clear('product');
}
$messageStack->add(__('@product update status product'), 'success');
-// }
+
if(!isset($_GET['forceajax']))
tep_redirect(tep_href_link(self::FILENAME, tep_get_all_get_params(array('action','cPath','cID','setflag','flag'), false) ));
break;
@@ -1091,22 +1087,6 @@
}
-
-
- /**
- @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_js('new_product');
-
- }
-
-
/**
@fn featured::GetDBValue();
@brief return DB value adapted for current action
@@ -1339,14 +1319,14 @@
$MG=false;
self::$Info=self::GetDBValue();
break;
- case 'noedit':
- $action = 'edit';
- self::$Info=self::GetDBValue();
- break;
-
+
case 'new':
$MG=false;
break;
+
+
+ case 'noedit':
+ $action = 'edit';
case 'edit':
self::$Info=self::GetDBValue();
@@ -1375,46 +1355,24 @@
}
-
-
-
-/** public static InterfacedTJsonS */
-
/**
- @fn get_item_action($products)
- @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 $products array
+ @fn ButtonRowsActions($products)
+ @brief Display action button in Row line
+ @param $item array
@return string
*/
- public static function ButtonRowsActions($products){
- $action_str_left='';
+ public static function ButtonRowsActions($item){
$action_str ='';
+
+ $action_str_left =sprintf(CsrtAction::getLink('row_action_right', __('image view public') , 'publiclink'), '', tep_catalog_href_link('index.php', 'products_id=' . $products['id'],'SSL', true, 'forceview') ,' target="blank" ' );
+
if(_cst_bool('STOCK_CHECK') && tep_action_check('view', FILENAME_STOCK) )
- $action_str_left.=sprintf(CsrtAction::getLink('row_action_right', __('txt stock') , 'stock'), 'fancyView', tep_href_link(FILENAME_STOCK, 'product_id=' . $products['id'].'&origin='.self::FILENAME) ,'' );
+ $action_str.=sprintf(CsrtAction::getLink('row_action_right', __('txt stock') , 'stock'), 'fancyView', tep_href_link(FILENAME_STOCK, 'product_id=' . $item['id'].'&origin='.self::FILENAME) ,'' );
- $action_str.=sprintf(CsrtAction::getLink('row_action_right', __('image view public') , 'publiclink'), '', tep_catalog_href_link('index.php', 'products_id=' . $products['id'],'SSL', true, 'forceview') ,' target="blank" ' );
- $action_str.=sprintf(CsrtAction::getLink('row_action_right', IMAGE_DETAILS, 'noedit'), '', tep_href_link(self::FILENAME, 'cID=' . $products['id'] . '&action=noedit' ),'' );
+ $action_str .= self::$modules->display_ColumnRowAction($item['id']);
- if(tep_action_check('copy_to', self::FILENAME))
- $action_str.=sprintf(CsrtAction::getLink('row_action_right', IMAGE_COPY_TO, 'copyto'), 'fancy', tep_href_link(self::FILENAME, 'cID=' . $products['id'] . '&action=copy_to') ,'' );
-
- if(tep_action_check('edit', self::FILENAME))
- $action_str.=sprintf(CsrtAction::getLink('row_action_right', IMAGE_EDIT, 'edit'), '', tep_href_link(self::FILENAME, 'cID=' . $products['id'] . '&action=edit') ,'' );
-
- if(tep_action_check('delete', self::FILENAME))
- $action_str.=sprintf(CsrtAction::getLink('row_action_right', IMAGE_DELETE, 'delete'), 'fancy', tep_href_link(self::FILENAME, 'cID=' . $products['id'] . '&action=delete') ,'' );
-
-
-
- return sprintf(
- CsrtAction::getFormat('row_action'),
- self::$modules->display_ColumnRowAction($products['id']).
- $action_str_left
- ,
- $action_str
- );
+ return parent::GenericRowsActions($item, 'nced', $action_str_left, $action_str);
}
@@ -1454,15 +1412,8 @@
}
- /**
- @brief return Filename
- */
- public static function GetFILENAME(){
- return self::FILENAME;
- }
-
/** methode specific module */
public static function NameVirtualID($id){
@@ -1487,27 +1438,8 @@
return true;
}
- /**
- @brief return format html for row status
- @param $product array restuts row product
- @return string html
- */
- public static function RowStatus($products){
- $exclude=array('action','cID','forceajax','type','class','function','funct', 'mod');
- $query_s='action=setflag&cID=' . $products['id'].'&flag=';
- return '<a class="ajaxinline" href="' . tep_href_link(self::FILENAME, tep_get_all_get_params($exclude).$query_s.(($products['status'] == '1')? '0' : '1') ) . '">'.
- sprintf(
- CsrtAction::getFormat('row_flag'),
- (int)$products['status'],
- ( ($products['status'] == '1')? IMAGE_ICON_STATUS_GREEN : IMAGE_ICON_STATUS_RED)
- ).
- '</a>';
- }
-
-
-
/**
@brief format db value for display page
@param $_query ressource db sql
Modified: trunk/catalog/admin/includes/modules/pages/usersNotif.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/usersNotif.php 2014-02-05 17:55:04 UTC (rev 5123)
+++ trunk/catalog/admin/includes/modules/pages/usersNotif.php 2014-02-06 17:50:07 UTC (rev 5124)
@@ -13,6 +13,7 @@
require_once(DIR_FS_ADMIN . DIR_WS_CLASSES .'ModTreePage.php');
+error_reporting(E_ALL);
/**
@class usersNotif
*/
@@ -21,8 +22,9 @@
implements
InterfaceModule,
ExtModConfig,
-// InterfacedTJsonS,
- InterfacedInnerHtml{
+ InterfacedTJsonS,
+ InterfacedInnerHtml
+ {
/**
@def FILENAME
*/
@@ -42,6 +44,7 @@
*/
protected static $XmlBase;
+ public static $list;
/**
class constructor
*/
@@ -60,10 +63,14 @@
global $languages_id;
self::$code=__CLASS__;
+ self::$datatype='adminnotification';
self::$action=(isset($_REQUEST['action'])? (string)$_REQUEST['action'] : 'listing' );
self::$Id=(isset($_REQUEST['cID'])? (int)$_REQUEST['cID'] : 0 );
+ // instancie MLinkTo
+ MLinkTo::getInstance(self::$datatype);
+
MGabCont::SetCurrentName(__CLASS__);
/**
@@ -202,27 +209,14 @@
public function check_action($actions){
global $messageStack, $oscss;
- self::$action=$actions;
+ if(!empty($actions))
+ self::$action=$actions;
+
$DB=Database::getInstance();
switch (self::$action) {
/**
- @remarks specific save in session value filters
- */
- case 'filters':
- /*
- Call Prev Process
- */
- self::actionFilter();
-
- tep_redirect(tep_href_link(self::FILENAME));
- break;
-
-
-
-
- /**
@remarks action multi
*/
case 'multi':
@@ -240,19 +234,10 @@
tep_redirect(tep_href_link(self::FILENAME));
break;
+ default:
+ parent::GenericAction();
+ }
- case 'delete':
- $nID=tep_db_prepare_input($_GET['cID']);
-
- if( $DB->query($sql="DELETE FROM ".TABLE_ADMIN_NOTIFICATION." WHERE notif_id='".(int)$nID."' AND ( ( notif_type='0' and user_id='".$_SESSION['login_id']."') OR (notif_type='1' and user_id='".$_SESSION['login_groups_id']."') ) LIMIT 1") )
- $messageStack->add_session(__('success notif detail delete'), 'success');
-
- tep_redirect(tep_href_link(self::FILENAME));
- break;
- default:
-
- }
-
return self::$action;
}
@@ -288,6 +273,7 @@
case 'view':
$DB=Database::getInstance();
$res=$DB->query($sql="SELECT notif_id,notif_type,user_id,notif_key,notif_data,notif_text, notif_date FROM ".TABLE_ADMIN_NOTIFICATION." WHERE notif_id='".(int)self::$Id ."' AND ( ( notif_type='0' and user_id='".$_SESSION['login_id']."') OR (notif_type='1' and user_id='".$_SESSION['login_groups_id']."') )");
+
self::$Info=new objectInfo($res->fetchAssoc());
break;
@@ -344,58 +330,37 @@
- public static function load_db_config($ID){
- $DB=Database::getInstance();
- $res=$DB->query($sql="SELECT * FROM ".TABLE_NOTIFICATION." WHERE chknotif_id='".(int)$ID."' AND ( ( chknotif_uniq='0' and chknotif_user='".$_SESSION['login_id']."') OR (chknotif_uniq='1' and chknotif_user='".$_SESSION['login_groups_id']."') )");
- self::$Info=new objectInfo($res->fetchAssoc());
- }
-
-
-
/**
@fn display_view()
@brief this methode is switch for call gabarit action
*/
public function display_view(){
$action=self::$action;
-
+ $MG=true;
+
switch ($action) {
-
- /**
- @remarks Ajax View result
- */
-// case 'setflag':
-// return self::RowStatus(array('status'=>(int)$_GET['flag'], 'id'=>(int)self::$Id));
-// break;
-
- /**
- @remarks Normal View Page
- */
-
-// case 'delete':
-// self::GetDBValue(self::$Id);
-// return MGabCont::CallGab(self::$action,__FUNCTION__,__CLASS__);
-// break;
case 'view':
+ $MG = false;
self::GetDBValue(self::$Id);
- return tep_get_include_contents(self::$code.'/display_view.view');
+// return tep_get_include_contents(self::$code.'/display_view.view');
break;
default:
- return MGabCont::CallGab('listing',__FUNCTION__,self::MASTER);
+ $action = parent::GenericDisplay($action);
}
+ if( ! empty($action) ){
+ if($MG)
+ return MGabCont::CallGab($action,__FUNCTION__,self::MASTER);
+ else
+ return MGabCont::CallGab($action,__FUNCTION__,__CLASS__);
+ }
+
}
- /** public static InterfacedTJsonS */
-
-
-
-
-
/** static InterfacedInnerHtml */
/**
@@ -421,39 +386,28 @@
@brief private model for row action
@param $content array
*/
- public static function ButtonRowsActions($content){
- return sprintf(
- CsrtAction::getFormat('row_action'),
- '' ,
- sprintf(CsrtAction::getLink('row_action_right', IMAGE_VIEW, 'view'), 'fancy', tep_href_link(self::FILENAME, 'cID=' . $content['id'] . '&action=view') ,'' ).
- sprintf(CsrtAction::getLink('row_action_right', IMAGE_DELETE, 'delete'), '', tep_href_link(self::FILENAME, 'cID=' . $content['id'] . '&action=delete') ,'' )
- );
- }
+// public static function ButtonRowsActions($content){
+// return sprintf(
+// CsrtAction::getFormat('row_action'),
+// '' ,
+// sprintf(CsrtAction::getLink('row_action_right', IMAGE_VIEW, 'view'), 'fancy', tep_href_link(self::FILENAME, 'cID=' . $content['id'] . '&action=view') ,'' ).
+// sprintf(CsrtAction::getLink('row_action_right', IMAGE_DELETE, 'delete'), 'fancy', tep_href_link(self::FILENAME, 'cID=' . $content['id'] . '&action=delete') ,'' )
+// );
+// }
- /**
- @brief return Filename
- */
- public static function GetFILENAME(){
- return self::FILENAME;
- }
-
/**
@brief format db value for display page
@param $_query ressource db sql
@return array
*/
- protected static function FormatDBValue($_query){
+ public static function FormatDBValue($_query){
$DB=Database::getInstance();
$res=array();
switch (self::$action) {
- case 'edit';
- global $query_numrows,$languages_id;
-
- break;
case 'listing':
global $query_numrows,$languages_id;
@@ -463,9 +417,10 @@
$item[0]=tep_draw_checkbox_field('action_multi['.$item['id'].']','action_mutli_'.$item['id'],$item['id'],false, '','class="multi"');
foreach(self::$InitInfo['modele']['listing'] as $k=>$row){
- if($k == 'action') $ord[$k]=self::ButtonRowsActions($item);
- elseif(in_array($k,array('date') ) )$ord[$k]=((isset($item[$k]) && $item[$k] !='1000-01-01 00:00:00' )? tep_date_short($item[$k]) : '' );
- else $ord[$k]=$item[$k];
+ if( ($value = self::FormatDBValueRow($k, $item)) && $value !=false )
+ $ord[$k]= $value;
+ else
+ $ord[$k]=$item[$k];
}
@@ -478,41 +433,44 @@
$res[]=$ord;
}
break;
+
+ default:
+ $res = parent::FormatDBValueDefault($_query);
}
return $res;
}
- public static function get_right_bar(){
- $heading=$contents=array();
+// public static function get_right_bar(){
+// $heading=$contents=array();
+//
+// switch(self::$action){
+//
+// case 'view':
+// // self::load_db_values((int)$_GET['nID']);
+//
+// $heading[] = array('text' => __('heading notification view') );
+// $contents[] = array('text' => '<label>' . __('text info key notif') . '</label>' . self::$Info->notif_key);
+// $contents[] = array('text' => '<label>' . __('text info date notif') . '</label>' . tep_datetime_short(self::$Info->notif_date) );
+// $contents=array_merge($contents, self::detailSupll(self::$Info->notif_data));
+// $contents[] = array('text' => '<label>' . __('text info content notif') . '</label>' . self::$Info->notif_text);
+//
+// $contents[] = array('class'=>'button_nav','text' =>
+// sprintf(CsrtAction::getLink('button_nav', IMAGE_DELETE), 'ActionYes', tep_href_link(usersNotif::FILENAME, 'nID=' . self::$Info->notif_id . '&action=delete') ,'' ).
+// tep_js_back(tep_href_link(self::FILENAME, 'nID=' . self::$Info->notif_id ), IMAGE_BACK)
+// );
+// break;
+// default:
+// }
+//
+// if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {
+// $box = new box;
+// return $box->infoBox($heading, $contents);
+// }
+// }
- switch(self::$action){
- case 'view':
-// self::load_db_values((int)$_GET['nID']);
-
- $heading[] = array('text' => __('heading notification view') );
- $contents[] = array('text' => '<label>' . __('text info key notif') . '</label>' . self::$Info->notif_key);
- $contents[] = array('text' => '<label>' . __('text info date notif') . '</label>' . tep_datetime_short(self::$Info->notif_date) );
- $contents=array_merge($contents, self::detailSupll(self::$Info->notif_data));
- $contents[] = array('text' => '<label>' . __('text info content notif') . '</label>' . self::$Info->notif_text);
-
- $contents[] = array('class'=>'button_nav','text' =>
- sprintf(CsrtAction::getLink('button_nav', IMAGE_DELETE), 'ActionYes', tep_href_link(usersNotif::FILENAME, 'nID=' . self::$Info->notif_id . '&action=delete') ,'' ).
- tep_js_back(tep_href_link(self::FILENAME, 'nID=' . self::$Info->notif_id ), IMAGE_BACK)
- );
- break;
- default:
- }
-
- if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {
- $box = new box;
- return $box->infoBox($heading, $contents);
- }
- }
-
-
/** Specific module */
/**
@@ -521,98 +479,55 @@
@param $data string GET
@return array $contents
*/
- private static function detailSupll($data){
- if(empty($data)) return array();
- $array=tep_extrac_querystring($data);
- $contents=array();
+// private static function detailSupll($data){
+// if(empty($data)) return array();
+// $array=tep_extrac_querystring($data);
+// $contents=array();
+//
+// foreach($array as $k=>$item)
+// if(tep_not_null($item)) {
+// switch($k) {
+// case 'customers_id';
+// $contents[] = array('text' => tep_customers_row_action($item) );
+// break;
+// default:
+// $contents[] = array('text' => '<label>' . $k . ' : </label>' . $item );
+// }
+// }
+//
+// return $contents;
+// }
- foreach($array as $k=>$item)
- if(tep_not_null($item)) {
- switch($k) {
- case 'customers_id';
- $contents[] = array('text' => tep_customers_row_action($item) );
- break;
- default:
- $contents[] = array('text' => '<label>' . $k . ' : </label>' . $item );
- }
- }
-
- return $contents;
- }
-
/**
@fn loadNotifUser()
@brief call user notification current user
*/
- private static function loadNotifUser(){
- if(is_array(self::$list) && count(self::$list)>0 ) return self::$list;
- $DB=Database::getInstance();
- $res=$DB->query($sql="SELECT notif_id,notif_type,user_id,notif_key,notif_data,notif_text,notif_date FROM ".TABLE_ADMIN_NOTIFICATION." WHERE ( notif_type='0' and user_id='".$_SESSION['login_id']."') OR (notif_type='1' and user_id='".$_SESSION['login_groups_id']."') ORDER BY notif_date ASC");
-
- $list=$res->fetchAllAssoc();
-
- foreach($list as $notif){
- if(isset($notif['notif_data'])) self::$list[]=array_merge((array)$notif, (array)tep_extrac_querystring($notif['notif_data']));
- else self::$list[]=$notif;
- }
- return self::$list;
- }
-
-
-
- /**
- @fn loadXml()
- @brief load xml base method and action defaut
- */
-// private static function loadXml(){
-// global $messageStack;
-//
-// $FeedUrl = DIR_FS_ROOT_DOCS.'admin/data/notification_src.xml';
-//
-// if(!$SimpleParser = @simplexml_load_file($FeedUrl))
-// $messageStack->add_session( __('Flux introuvable'), 'error');
-//
-// self::$XmlBase = $SimpleParser;
+// private static function loadNotifUser(){
+// if(is_array(self::$list) && count(self::$list)>0 )
+// return self::$list;
+//
+// $DB=Database::getInstance();
+// $res=$DB->query($sql="SELECT notif_id,notif_type,user_id,notif_key,notif_data,notif_text,notif_date FROM ".TABLE_ADMIN_NOTIFICATION." WHERE ( notif_type='0' and user_id='".$_SESSION['login_id']."') OR (notif_type='1' and user_id='".$_SESSION['login_groups_id']."') ORDER BY notif_date ASC");
+//
+// $list=$res->fetchAllAssoc();
+//
+// foreach($list as $notif){
+// if(isset($notif['notif_data'])) self::$list[]=array_merge((array)$notif, (array)tep_extrac_querystring($notif['notif_data']));
+// else self::$list[]=$notif;
+// }
+// return self::$list;
// }
- /**
- @fn XmlMethod()
- @brief call method possible for alert
- @return array for tep_pulldown
- */
-// private static function XmlMethod(){
-// if(!is_object(self::$XmlBase)) return array();
-// $array=array();
-//
-// foreach(self::$XmlBase->method->mode as $item)
-// $array[]=array('id'=>(string)$item,'text'=>(string)$item);
-//
-// return $array;
-// }
/**
- @fn XmlAction()
- @brief call action possible for alert
- @return array for tep_pulldown
- */
-// private static function XmlAction(){
-// if(!is_object(self::$XmlBase)) return array();
-// $array=array();
-//
-// foreach(self::$XmlBase->metier->action as $item)
-// $array[]=array('id'=>(string)$item,'text'=>(string)$item);
-//
-// return $array;
-// }
-
- /**
@fn CountNotif()
@brief call count notification for current user
*/
- public static function CountNotif(){
- self::loadNotifUser();
- return count(self::$list);
- }
+// public static function CountNotif(){
+// // self::loadNotifUser();
+// // return count(self::$list);
+//
+// }
}
Modified: trunk/catalog/admin/includes/template/oscss/header-1.php
===================================================================
--- trunk/catalog/admin/includes/template/oscss/header-1.php 2014-02-05 17:55:04 UTC (rev 5123)
+++ trunk/catalog/admin/includes/template/oscss/header-1.php 2014-02-06 17:50:07 UTC (rev 5124)
@@ -1,24 +1,21 @@
<?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.0
+ @version 2.2.0
@date 21/03/11, 13:59
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
*/
$class_widget="adminBlock";
-/// force call class notification
-/// TODO a deporter en module
-require_once(DIR_WS_MODULES.'pages/usersNotif.php');
?>
<div id="headInfos">
<h1><?php echo tep_image(DIR_WS_TEMPLATE . 'img/1/oscss.png', 'osCSS'); ?></h1>
<h2><?php echo PROJECT_VERSION ;?></h2>
<a href="<?php echo tep_catalog_href_link() ?>"><?php echo HEADER_TITLE_ONLINE_CATALOG ;?></a><span> | </span>
- <a href="<?php echo tep_href_link(FILENAME_USERSNOTIF, '', 'NONSSL') ?>" class="messages"><?php echo __('notifications') ?> (<?php echo usersNotif::CountNotif() ?>)</a><span> | </span>
+ <a href="<?php echo tep_href_link(FILENAME_USERSNOTIF, '', 'NONSSL') ?>" class="messages"><?php echo __('notifications') ?> (<?php echo CountNotif() ?>)</a><span> | </span>
<?php if($sess !=0) : ?>
<a href="<?php echo tep_href_link('', 'mode_menu=0', 'NONSSL') ?>" class="messages"><?php echo __('Admin menu') ?></a><span> | </span>
Modified: trunk/catalog/admin/includes/template/oscss/inc/lib.template.php
===================================================================
--- trunk/catalog/admin/includes/template/oscss/inc/lib.template.php 2014-02-05 17:55:04 UTC (rev 5123)
+++ trunk/catalog/admin/includes/template/oscss/inc/lib.template.php 2014-02-06 17:50:07 UTC (rev 5124)
@@ -1,12 +1,14 @@
<?php
/**
- @licence GPL 2005-2010 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.0
+ @version 2.2.0
@date 05/01/11, 17:14
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
+ @file lib.template.php
+ @dir admin/includes/templates/oscss/inc/
*/
/**
@@ -31,4 +33,23 @@
require($widg['name']);
}
}
+
+/**
+ @brief count notification for current user
+ @return int
+*/
+function CountNotif(){
+
+ $res = sqladminnotification::fetch(array(), true);
+
+ if(is_object($res))
+ $nbr = 1;
+ elseif(is_array($res))
+ $nbr = count($res);
+ else
+ $nbr = 0;
+
+ return $nbr;
+}
+
?>
\ 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-02-05 17:55:07
|
Revision: 5123
http://sourceforge.net/p/oscss/svn/5123
Author: oscim
Date: 2014-02-05 17:55:04 +0000 (Wed, 05 Feb 2014)
Log Message:
-----------
Fix
Next dev and implement new process in module page
Modified Paths:
--------------
trunk/catalog/admin/includes/classes/ModTree.php
trunk/catalog/admin/includes/classes/ModTreePage.php
trunk/catalog/admin/includes/classes/SqlFilesDataDriverClass.php
trunk/catalog/admin/includes/classes/drivers/sqlcountries.php
trunk/catalog/admin/includes/classes/drivers/sqlfeatured.php
trunk/catalog/admin/includes/classes/drivers/sqlnavigation_links.php
trunk/catalog/admin/includes/gabarit/orders/display_view.edit.gab
trunk/catalog/admin/includes/javascript/modules/pages/orders.js.php
trunk/catalog/admin/includes/modules/pages/cms_content.php
trunk/catalog/admin/includes/modules/pages/currencies.php
trunk/catalog/admin/includes/modules/pages/featureds.php
trunk/catalog/admin/includes/modules/pages/orders.php
trunk/catalog/admin/includes/modules/pages/products.php
trunk/test/phpunit/Back/sqlxxx/sqlcountriesTest.php
trunk/test/phpunit/Back/sqlxxx/sqlcurrencieTest.php
trunk/test/phpunit/Back/sqlxxx/sqlfeaturedTest.php
trunk/test/phpunit/Back/sqlxxx/sqlnavigation_linksTest.php
trunk/test/phpunit/Back/sqlxxx/sqlproductsTest.php
Added Paths:
-----------
trunk/catalog/admin/includes/gabarit/orders/edit.tab.detail.gab
trunk/catalog/admin/includes/gabarit/orders/edit.tab.generic.gab
trunk/catalog/admin/includes/gabarit/orders/edit.tab.history.gab
trunk/catalog/admin/includes/gabarit/orders/edit.tab.service.gab
trunk/catalog/admin/includes/gabarit/orders/edit.tab.shipping.gab
trunk/catalog/admin/includes/languages/fr_FR/Featured.txt
trunk/catalog/admin/includes/languages/fr_FR/Order.txt
Removed Paths:
-------------
trunk/catalog/admin/includes/languages/fr_FR/modules/pages/featureds.txt
trunk/catalog/admin/includes/languages/fr_FR/modules/pages/orders.txt
Modified: trunk/catalog/admin/includes/classes/ModTree.php
===================================================================
--- trunk/catalog/admin/includes/classes/ModTree.php 2014-02-05 15:18:33 UTC (rev 5122)
+++ trunk/catalog/admin/includes/classes/ModTree.php 2014-02-05 17:55:04 UTC (rev 5123)
@@ -298,6 +298,7 @@
foreach($allcats as $row)
$list .=$row['id'].',';
}
+ if(strlen($list) > 1)
self::$InitInfo['adjust']['sWhere'] .=" AND cat.categories_id IN (".substr($list, 0,-1).") ";
}
Modified: trunk/catalog/admin/includes/classes/ModTreePage.php
===================================================================
--- trunk/catalog/admin/includes/classes/ModTreePage.php 2014-02-05 15:18:33 UTC (rev 5122)
+++ trunk/catalog/admin/includes/classes/ModTreePage.php 2014-02-05 17:55:04 UTC (rev 5123)
@@ -224,7 +224,7 @@
@fn GenericDisplay()
@brief Generic Display for process normal action normalized
Use static $action var for choose $action gabarit display
- @return string
+ @return string Or Html
*/
public static function GenericDisplay(){
@@ -246,14 +246,14 @@
if(!is_object($class::$Info))
$class::$Info = $class::GetDBValue();
$action = '';
- print $class::RowStatus(array('status'=>(int)$_GET['flag'], 'id'=>(int)$class::$Id));
+ return $class::RowStatus(array('status'=>(int)$_GET['flag'], 'id'=>(int)$class::$Id));
break;
case 'viewflag':
if(!is_object($class::$Info))
$class::$Info = $class::GetDBValue();
$action = '';
- print $class::RowHidden(array('hidden'=>(int)$class::$Info->hidden, 'id'=>(int)$class::$Id));
+ return $class::RowHidden(array('hidden'=>(int)$class::$Info->hidden, 'id'=>(int)$class::$Id));
break;
/**
Modified: trunk/catalog/admin/includes/classes/SqlFilesDataDriverClass.php
===================================================================
--- trunk/catalog/admin/includes/classes/SqlFilesDataDriverClass.php 2014-02-05 15:18:33 UTC (rev 5122)
+++ trunk/catalog/admin/includes/classes/SqlFilesDataDriverClass.php 2014-02-05 17:55:04 UTC (rev 5123)
@@ -213,7 +213,8 @@
@return none
*/
public static function PrepaDataAfterUse( $specimen , $dataarray, $post ){
-
+ self::$sql_array = array();
+ self::$sql_array_lg = array();
// call specimen and report value for defined key
foreach($specimen as $key=>$item) {
// obtain string value contain in specimen
Modified: trunk/catalog/admin/includes/classes/drivers/sqlcountries.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlcountries.php 2014-02-05 15:18:33 UTC (rev 5122)
+++ trunk/catalog/admin/includes/classes/drivers/sqlcountries.php 2014-02-05 17:55:04 UTC (rev 5123)
@@ -1,21 +1,25 @@
<?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.2
+ @version 2.2.0
@date 10/10/2013, 10:30
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
- @encode UTF-8
- @class sqlcountries
@file sqlcountries.php
- @brief manage insert/update/delete in zone tables
+ @dir admin/includes/classes/drivers/
*/
+require_once( DIR_FS_ADMIN . DIR_WS_CLASSES . 'SqlFilesDataDriverClass.php');
+/**
+ @class sqlcountries
+ @brief manage insert/update/delete in zone tables
+*/
class sqlcountries
+ extends SqlFilesDataDriverClass
implements ModSqlDataDriver{
public static $modules;
@@ -38,27 +42,47 @@
public static function create($option){
self::getInstance();
- if(!isset($option['name']))
+ $DB=Database::getInstance();
+ $error= 0;
+ $specimen = self::Specimen();
+
+
+ $post=(isset($option['post']) ? $option['post'] : array() );
+ $dataarray =(isset($option['sqlarray'])? $option['sqlarray'] : array() );
+
+ self::PrepaDataAfterUse( $specimen , $dataarray, $post );
+
+ $sql_data_array = self::GetSqlArray();
+ $sql_data_array_lg = self::GetSqlArrayLg();
+
+ if(!isset($sql_data_array['countries_name']))
return false;
+
+ if(isset($sql_data_array['countries_id']))
+ unset($sql_data_array['countries_id']);
+
+ $DB->beginTransaction();
- $DB=Database::getInstance();
- $error = 0 ;
+ if(count($sql_data_array) > 0 ){
+ $res=tep_db_perform(TABLE_COUNTRIES, $sql_data_array);
- $sql_data_array['countries_name'] = tep_db_prepare_input($option['name']);
- $sql_data_array['countries_localname'] = (isset($option['localname'])) ? tep_db_prepare_input($option['localname']) :'NULL';
- $sql_data_array['countries_iso_code_2'] = (isset($option['iso_code_2'])) ?strtoupper( tep_db_prepare_input($option['iso_code_2'])) :'NULL';
- $sql_data_array['countries_iso_code_3'] = (isset($option['iso_code_3'])) ?strtoupper( tep_db_prepare_input($option['iso_code_3'])) :'NULL';
- $sql_data_array['address_format_id'] = (int) (isset($option['address_format_id'])) ? tep_db_prepare_input($option['address_format_id']) :'1';
- $sql_data_array['country_visible'] = (isset($option['visible'])) ? tep_db_prepare_input($option['visible']) :'0';
+ if(!$res)
+ $error++;
+ else
+ $id = $res->__get('insertId');
+ }
- $res=tep_db_perform(TABLE_COUNTRIES, $sql_data_array);
-
- if(!$res)
- return $res;
- else
- return $res->__get('insertId');
+ if( $error > 0){
+ $DB->rollbackTransaction();
+ return false;
+ }
+ else{
+ $DB->commitTransaction();
+ return $id;
+ }
}
+
/**
@brief update ligne in table configuration
*/
@@ -72,30 +96,30 @@
$error = 0 ;
$sql_data_array =array();
- $where ='';
- if(isset($option['id'])) $where .="AND countries_id = '".(int)$option['id']."' ";
+ $error= 0;
+ $specimen = self::Specimen();
+
- if( strlen(substr($where,3)) < 2)
- return false;
+
+ $post=(isset($option['post']) ? $option['post'] : array() );
+ $dataarray =(isset($option['sqlarray'])? $option['sqlarray'] : array() );
+
+ self::PrepaDataAfterUse( $specimen , $dataarray, $post );
+
+
+ $sql_data_array = self::GetSqlArray();
+ $sql_data_array_lg = self::GetSqlArrayLg();
+
+
+ if(isset($sql_data_array['countries_id']))
+ unset($sql_data_array['countries_id']);
+
- if(isset($option['post']))
- $post = $option['post'];
-
- if(isset($option['sqlarray']))
- $sqlarray = $option['sqlarray'];
-
$DB->beginTransaction();
- if(isset($post['name']))$sql_data_array['countries_name'] = tep_db_prepare_input($post['name']);
- if(isset($post['localname'])) $sql_data_array['countries_localname'] = tep_db_prepare_input($post['localname']);
- if(isset($post['iso_code_2'])) $sql_data_array['countries_iso_code_2'] = strtoupper(tep_db_prepare_input($post['iso_code_2'])) ;
- if(isset($post['iso_code_3'])) $sql_data_array['countries_iso_code_3'] = strtoupper(tep_db_prepare_input($post['iso_code_3']));
- if(isset($post['address_format'])) $sql_data_array['address_format_id'] =(int) tep_db_prepare_input($post['address_format']);
- if(isset($post['visible'])) $sql_data_array['country_visible'] = (int)tep_db_prepare_input($post['visible']);
+ if(count($sql_data_array)>0){
-
- if(count($sql_data_array)>0){
- if( ! tep_db_perform(TABLE_COUNTRIES, $sql_data_array, 'update' , substr($where,3) ) )
+ if( ! tep_db_perform(TABLE_COUNTRIES, $sql_data_array, 'update' , " countries_id = '".(int)$option['id']."' " ) )
$error++;
}
else
@@ -226,7 +250,18 @@
}
+ /**
+ @fn ExtractForm($data)
+ @brief extract data forms for put in db
+ @param $data array
+ @return array
+ */
+ public static function ExtractForm($data){
+ self::getInstance();
+ return parent::ExtractDataForm(self::Specimen(), $data);
+ }
+
/**
@fn CleanKey()
@brief Clean string name key
Modified: trunk/catalog/admin/includes/classes/drivers/sqlfeatured.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlfeatured.php 2014-02-05 15:18:33 UTC (rev 5122)
+++ trunk/catalog/admin/includes/classes/drivers/sqlfeatured.php 2014-02-05 17:55:04 UTC (rev 5123)
@@ -357,7 +357,7 @@
*/
public static function ExtractForm($data){
self::getInstance();
-// self::Specimen();
+
return parent::ExtractDataForm(self::Specimen(), $data);
}
Modified: trunk/catalog/admin/includes/classes/drivers/sqlnavigation_links.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlnavigation_links.php 2014-02-05 15:18:33 UTC (rev 5122)
+++ trunk/catalog/admin/includes/classes/drivers/sqlnavigation_links.php 2014-02-05 17:55:04 UTC (rev 5123)
@@ -56,15 +56,25 @@
$sql_data_array = self::GetSqlArray();
$sql_data_array_lg = self::GetSqlArrayLg();
+ if(isset($sql_data_array['nav_link_id']))
+ unset($sql_data_array['nav_link_id']);
+
+
+
$DB->beginTransaction();
try{
if( count($sql_data_array) <= 0 )
throw new Exception("no data");
- if( ($res=tep_db_perform(TABLE_NAVIGATION_LINKS, $sql_data_array) ) && !$res)
+ if( ($res=tep_db_perform(TABLE_NAVIGATION_LINKS, $sql_data_array) ) && !$res )
throw new Exception("in sql create");
-
+
+ if( !is_object($res)){
+ $DB->rollbackTransaction();
+ return false;
+ }
+
$id = $res->__get('insertId');
@@ -127,7 +137,8 @@
$sql_data_array = self::GetSqlArray();
$sql_data_array_lg = self::GetSqlArrayLg();
-
+// print_r($specimen);
+// exit;
$DB->beginTransaction();
$where ='';
@@ -325,13 +336,13 @@
}
$par = array(
- 'nav_link_id' => '',
+ 'nav_link_id' => -1,
'nav_mode' => 2, // 1,2
'nav_sort_order' => 5,
'nav_css_id' => '',
'nav_file' => '',
'nav_link_type' => 1,
- 'customers_status' => '',
+ 'customers_status' => 0,
'nav_link_status' => 0,
'parent_id' => 0,
@@ -339,9 +350,9 @@
'lg' =>$tmp_lg,
);
- foreach(tep_get_languages() as $lg){
- $par['name'][$lg['id']] ='';
- }
+// foreach(tep_get_languages() as $lg){
+// $par['name'][$lg['id']] ='';
+// }
return ((!$shortkey)? $par : self::CleanKey($par));
}
Modified: trunk/catalog/admin/includes/gabarit/orders/display_view.edit.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/orders/display_view.edit.gab 2014-02-05 15:18:33 UTC (rev 5122)
+++ trunk/catalog/admin/includes/gabarit/orders/display_view.edit.gab 2014-02-05 17:55:04 UTC (rev 5123)
@@ -1,696 +1,63 @@
<?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 05/11/2013, 11:35
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
+ @file display_view.edit.gab
+ @dir admin/includes/gabarit/orders/
*/
global $price, $current_theme;
+$page= MGabCont::CallSt('GetClassName');
-
?>
-<h3><?php echo sprintf(__('@orders heading edit num %s ref %s'),orders::$order->info['orders_id'] , orders::$order->info['orders_ref'] ) ; ?></h3>
+<h3><?php echo sprintf(__('@orders heading edit num %s ref %s'),orders::$Info->info['orders_id'] , orders::$Info->info['orders_ref'] ) ; ?></h3>
<div class="box_uniq main-orders">
<div id="tabs">
- <ul>
- <li><a href="#tabs-1"><?php echo __('tab orders briefs'); ?></a></li>
- <li><a href="#tabs-2"><?php echo __('tab orders details'); ?></a></li>
- <li><a href="#tabs-3"><?php echo __('tab orders history'); ?></a></li>
- <?php if(orders::$order->display_shipping ): ?>
- <li><a href="#tabs-4"><?php echo __('tab orders shipping'); ?></a></li>
- <?php endif; ?>
- <?php if(orders::$order->display_service): ?>
- <li><a href="#tabs-5"><?php echo __('tab orders service'); ?></a></li>
- <?php endif; ?>
- </ul>
-
- <div id="tabs-1" class="tabPage">
-
-
-<!-- DRAW DETAIL CUSTOMERS -->
- <div class="box_uniq block_form">
- <fieldset class="block_field fleft w_50" >
- <legend class="Ctrtirroir"><?php echo __('entry customer'); ?></legend>
- <p class="block_input tirroir">
- <?php echo tep_address_format(orders::$order->customer['format_id'], orders::$order->customer, 1, '', '<br />'); ?><br />
- </p>
- </fieldset>
-
- <fieldset class="block_field fleft w_50" >
- <legend class="Ctrtirroir"><?php echo __('legend contact customers'); ?></legend>
- <p class="block_input tirroir">
- <strong><?php echo __('entry telephone number'); ?></strong><?php echo orders::$order->customer['telephone']; ?>
- <br />
-
- <strong><?php echo __('entry email address'); ?></strong><?php echo '<a href="mailto:' . orders::$order->customer['email_address'] . '">' . orders::$order->customer['email_address'] . '</a>'; ?>
- <br />
-
- <strong><?php echo __('entry ip'); ?></strong><?php echo orders::$order->info['ip_address']; ?>
- </p>
- </fieldset>
-
- </div>
-
-<!-- DRAW ADRESS SHIPING / BILLING -->
-
- <?php /** Billing Address */ ?>
- <div class="box_uniq block_form">
-
- <fieldset class="block_field fleft w_50" >
-
- <legend>
- <?php echo __('entry billing address'); ?>
- <?php if( !in_array(orders::$order->info['orders_status_id'], array(DEFAULT_ORDERS_STATUS_COMPLETED, DEFAULT_ORDERS_STATUS_ANNULATE ) ) ): ?>
- <span class="row_action">
- <?php echo sprintf(CsrtAction::getLink('row_action_right', IMAGE_EDIT, 'edit'), '', tep_href_link(orders::FILENAME, 'action=edit&oID='.orders::$oID. '&address=billing') ,'' ) ?>
- </span>
- <?php endif; ?>
- </legend>
-
- <div class="block_input">
- <?php if(!isset($_REQUEST['address']) || ( isset($_REQUEST['address']) && $_REQUEST['address'] !='billing' ) ): ?>
- <?php echo tep_address_format(orders::$order->billing['format_id'], orders::$order->billing, 1, '', '<br />'); ?>
- <?php else: ?>
-
-
- <?php echo tep_draw_form('add_deliv', orders::FILENAME,'oID='.orders::$oID.'&action=address&address=billing', 'post', ' class="block_form"'); ?>
-
- <?php if(_cst_bool('ACCOUNT_COMPANY')): ?>
- <?php echo tep_draw_input_field('address[company]','company', orders::$order->billing['company']) ; ?>
- <?php endif; ?>
-
- <?php echo tep_draw_input_field('address[name]','name', orders::$order->billing['name'] ); ?>
-
- <?php echo tep_draw_input_field('address[street_address]','street_address', orders::$order->billing['street_address']) ; ?>
-
- <?php echo tep_draw_input_field('address[suburb]','suburb', orders::$order->billing['suburb']) ; ?>
-
- <?php echo tep_draw_input_field('address[postcode]','postcode', orders::$order->billing['postcode']) ; ?>
-
- <?php echo tep_draw_input_field('address[city]','city', orders::$order->billing['city']) ; ?>
-
- <?php echo tep_draw_pull_down_menu('address[country]', worldUtility::get_countries(), worldUtility::GetCountryIdByName(orders::$order->billing['country']) ) ; ?>
-
- <?php if(_cst_bool('ACCOUNT_STATE')): ?>
- <?php echo tep_draw_input_field('address[state]','state', orders::$order->billing['state']) ; ?>
- <?php endif; ?>
-
-
- <div class="button_nav">
- <?php echo tep_js_back(tep_href_link(orders::FILENAME, tep_get_all_get_params(array('address')) ), IMAGE_CANCEL);?>
- <?php echo tep_image_submit('button_update.gif', IMAGE_UPDATE); ?>
- </div>
-
- </form>
- <?php endif; ?>
- </div>
- </fieldset>
-
- <?php /** Shipping address */ ?>
- <fieldset class="block_field fleft w_50 " >
- <legend>
- <?php echo __('entry shipping address'); ?>
-
- <?php if( !in_array(orders::$order->info['orders_status_id'], array(DEFAULT_ORDERS_STATUS_COMPLETED, DEFAULT_ORDERS_STATUS_ANNULATE ) ) ): ?>
- <?php if(isset(orders::$order->delivery['street_address'])): ?>
- <span class="row_action">
- <?php echo sprintf(CsrtAction::getLink('row_action_right', IMAGE_EDIT, 'edit'), '', tep_href_link(orders::FILENAME, 'action=edit&oID='.orders::$oID . '&address=delivery') ,'' ) ?>
- </span>
- <?php endif; ?>
- <?php endif; ?>
- </legend>
-
- <?php if(isset(orders::$order->delivery['street_address'])): ?>
- <div class="block_input">
- <?php if(!isset($_REQUEST['address']) || ( isset($_REQUEST['address']) && $_REQUEST['address'] !='delivery' ) ): ?>
- <?php echo tep_address_format(orders::$order->delivery['format_id'], orders::$order->delivery, 1, '', '<br />'); ?>
- <?php else: ?>
-
-
- <?php echo tep_draw_form('add_ship', orders::FILENAME,'oID='.orders::$oID.'&action=address&address=delivery', 'post', ' class="block_form"'); ?>
- <ul>
- <li>
- <label for ="notify"><?php echo __('entry shipping address actived'); ?></label>
- <?php echo tep_draw_checkbox_field('address[activate]', '', '', (!empty(orders::$order->delivery['name']) ? true :false) ); ?>
- </li>
-
- <?php if(_cst_bool('ACCOUNT_COMPANY')): ?>
- <li><?php echo tep_draw_input_field('address[company]','company', orders::$order->delivery['company']) ; ?></li>
- <?php endif; ?>
-
- <li><?php echo tep_draw_input_field('address[name]','name', orders::$order->delivery['name'] ); ?></li>
-
- <li><?php echo tep_draw_input_field('address[street_address]','street_address', orders::$order->delivery['street_address']) ; ?></li>
-
- <li><?php echo tep_draw_input_field('address[suburb]','suburb', orders::$order->delivery['suburb']) ; ?></li>
-
- <li><?php echo tep_draw_input_field('address[postcode]','postcode', orders::$order->delivery['postcode']) ; ?></li>
-
- <li><?php echo tep_draw_input_field('address[city]','city', orders::$order->delivery['city']) ; ?></li>
-
- <li><?php echo tep_draw_pull_down_menu('address[country]', worldUtility::get_countries(), worldUtility::GetCountryIdByName(orders::$order->delivery['country']) ) ; ?></li>
-
- <?php if(_cst_bool('ACCOUNT_STATE')): ?>
- <li><?php echo tep_draw_input_field('address[state]','state', orders::$order->delivery['state']) ; ?></li>
- <?php endif; ?>
-
- </ul>
-
- <div class="button_nav">
- <?php echo tep_js_back(tep_href_link(orders::FILENAME, tep_get_all_get_params(array('address')) ), IMAGE_CANCEL);?>
- <?php echo tep_image_submit('button_update.gif', IMAGE_UPDATE); ?>
- </div>
-
- </form>
- <?php endif; ?>
- </div>
- <?php endif; ?>
-
- </fieldset>
- </div>
-
-<!-- DRAW METHOD SHIPING / BILLING -->
-
-
- <?php /** Payment Methode */ ?>
- <div class="box_uniq block_form">
- <fieldset class="block_field fleft w_50 ">
- <legend><?php echo __('entry payment method'); ?>
- <?php if( !in_array(orders::$order->info['orders_status_id'], array(DEFAULT_ORDERS_STATUS_COMPLETED, DEFAULT_ORDERS_STATUS_ANNULATE ) ) ): ?>
- <span class="row_action">
- <?php echo sprintf(CsrtAction::getLink('row_action_right', IMAGE_EDIT, 'edit'), '', tep_href_link(orders::FILENAME, 'action=edit&oID='.orders::$oID . '&mod=payment') ,'' ) ?>
- </span>
- <?php endif; ?>
- </legend>
- <div class="block_input">
-
- <?php if(!isset($_REQUEST['mod']) || ( isset($_REQUEST['mod']) && $_REQUEST['mod'] !='payment' ) ): ?>
- <?php echo orders::$order->info['payment_method'] ; ?>
- <?php /*echo orders::$order->mod['class_payment'] ;*/ ?>
-
- <div id="modPay">
- <?php echo orders::ViewMod('payment', orders::$order->mod['class_payment']) ?>
- </div>
-
- <?php else: ?>
- <?php echo tep_draw_form('mod_pay', orders::FILENAME,'oID='.orders::$oID.'&action=mod&mod=payment', 'post', ' class="block_form"'); ?>
-
- <?php echo tep_draw_pull_down_menu('mod[payment]', orders::PrepaPullDownType('payment'), orders::$order->mod['class_payment'] , '') ; ?>
-
- <div id="modPay">
- <?php echo orders::EditMod('payment', orders::$order->mod['class_payment']) ?>
- </div>
-
- <div class="button_nav">
- <?php echo tep_js_back(tep_href_link(orders::FILENAME, tep_get_all_get_params(array('mod')) ), IMAGE_CANCEL);?>
- <?php echo tep_image_submit('button_update.gif', IMAGE_UPDATE); ?>
- </div>
- </form>
- <?php endif; ?>
+ <ul>
+ <?php $g = 0; foreach($page::GetListTabs() as $objTabs ): $g++; ?>
+ <li><a href="#tabs-<?php echo $g ?>"><?php echo $objTabs->GetTitle(); ?></a></li>
+ <?php endforeach; ?>
+ </ul>
+
+
+<div class="box_uniq">
+ <?php $g = 0; foreach($page::GetListTabs() as $objTabs ): $g++; ?>
+ <div id="tabs-<?php echo $g ?>" class="tabPage">
+ <div class="block_form">
+ <?php echo $objTabs->GetContent(); ?>
</div>
- </fieldset>
+ </div>
+ <?php endforeach; ?>
+ <div class="separator"></div>
+</div>
+
+
+ <div class="main-orders master">
+ <div class="main-orders block fleft w_50 padd_w">
- <?php /** Shipping Methode */ ?>
- <?php if(isset(orders::$order->delivery['street_address'])): ?>
- <fieldset class="block_field fleft w_50 ">
- <legend><?php echo __('entry shipping method'); ?>
- <?php if( !in_array(orders::$order->info['orders_status_id'], array(DEFAULT_ORDERS_STATUS_COMPLETED, DEFAULT_ORDERS_STATUS_ANNULATE ) ) ): ?>
- <span class="row_action">
- <?php echo sprintf(CsrtAction::getLink('row_action_right', IMAGE_EDIT, 'edit'), '', tep_href_link(orders::FILENAME, 'action=edit&oID='.orders::$oID . '&mod=shipping') ,'' ) ?>
- </span>
- <?php endif; ?>
- </legend>
- <div class="block_input">
- <?php if(!isset($_REQUEST['mod']) || ( isset($_REQUEST['mod']) && $_REQUEST['mod'] !='shipping' ) ): ?>
- <?php //echo orders::GetTitle('shipping',orders::$order->mod['class_shipping']) ; ?>
+ <div class="block_field fleft w_50" >
+ <h4><?php echo __('legend contact customers'); ?></h4>
+ <p class="clear block_input">
+ <strong><?php echo __('entry telephone number'); ?></strong><?php echo orders::$Info->customer['telephone']; ?>
+ <br />
- <div id="modPay">
- <?php echo orders::ViewMod('shipping', orders::$order->mod['class_shipping']) ?>
- </div>
+ <strong><?php echo __('entry email address'); ?></strong><?php echo '<a href="' .tep_href_link( FILENAME_MAIL , 'cus...@os...'.orders::$Info->customer['email_address'].'&origin='. orders::FILENAME .'&origin_id='.orders::$Info->info['orders_id']). '">' . orders::$Info->customer['email_address']. '</a>'; ?>
+ <br />
- <?php else: ?>
- <?php echo tep_draw_form('mod_pay', orders::FILENAME,'oID='.orders::$oID.'&action=mod&mod=shipping', 'post', ' class="block_form"'); ?>
-
- <?php echo tep_draw_pull_down_menu('mod[shipping]', orders::PrepaPullDownType('shipping'), orders::$order->mod['class_shipping'] , '') ; ?>
-
- <div id="modShip">
- <?php echo orders::EditMod('shipping', orders::$order->mod['class_shipping']) ?>
- </div>
-
- <div class="button_nav">
- <?php echo tep_js_back(tep_href_link(orders::FILENAME, tep_get_all_get_params(array('mod')) ), IMAGE_CANCEL);?>
- <?php echo tep_image_submit('button_update.gif', IMAGE_UPDATE); ?>
- </div>
- </form>
- <?php endif; ?>
- </div>
- </fieldset>
- <?php endif; ?>
- </div>
-
-
- <div class="box_uniq block_form">
-
- <table class="main-orders history padd_w">
- <thead>
- <tr>
- <th width="15%"><?php echo __('table heading date added'); ?></th>
- <th class="tcenter" width="10%"><?php echo __('table heading customer notified'); ?></th>
- <th class="tcenter" width="10%"><?php echo __('table heading status'); ?></th>
- <th><?php echo __('table heading comments'); ?></th>
- </tr>
- </thead>
- <tbody>
- <?php
- if( !is_array(orders::$order->lasthistory)): echo '<tr>' . "\n" . '<td colspan="5">' . __('text no order history') . '</td>' . "\n" . '</tr>' . "\n";
- else : ?>
- <tr>
- <td class="tcenter"><?php echo orders::$order->lasthistory['date_added']; ?></td>
- <td class="tcenter"><?php echo orders::$order->lasthistory['customer_notified']; ?></td>
- <td class="tcenter" style="width:40px; background:<?php echo orders::$order->lasthistory['color'] ?> url('includes/template/<?php echo $current_theme ?>/img/<?php echo $_SESSION['login_groups_id'] ?>/bg_graph.png') bottom left repeat-y;"><?php echo orders::$order->lasthistory['orders_status']; ?></td>
- <td><?php echo unhtmlentities(orders::$order->lasthistory['comments']); ?></td>
- </tr>
- <?php endif; ?>
- </tbody>
- </table>
- </div>
-
- <?php if( !in_array(orders::$order->info['orders_status_id'], array(DEFAULT_ORDERS_STATUS_COMPLETED, DEFAULT_ORDERS_STATUS_ANNULATE ) ) ): ?>
- <?php /*if(orders::$update) :*/?>
-<!-- DRAW FORM UPDATE BLOCK -->
- <?php echo tep_draw_form('status_form', orders::FILENAME,'oID='.orders::$oID.'&action=update_order', 'post', ' class="block_form"'); ?>
- <fieldset class="block_field">
- <legend><?php echo __('legend update order history'); ?></legend>
-
- <p class="block_input">
- <label for="status"><?php echo __('entry status'); ?></label>
- <?php echo tep_draw_pull_down_menu('status', orders::$orders_statuses, orders::$order->info['orders_status']); ?>
+ <strong><?php echo __('entry ip'); ?></strong><?php echo orders::$Info->info['ip_address']; ?>
</p>
-
- <p class="block_input inline">
- <label for ="notify"><?php echo __('entry notify customer'); ?></label>
- <?php echo tep_draw_checkbox_field('notify', '', '', true); ?>
- </p>
-
- <fieldset id="cont_comments" class="block_field">
- <legend class="Ctrtirroir" ><?php echo __('table heading comments'); ?></legend>
- <div class="block_input tirroir">
- <?php echo tep_draw_textarea_field('comments', '', '30', '5', '','style="width:100%"'); ?>
- </div>
- <br /><br />
- </fieldset>
-
- <div class="button_nav">
- <?php echo tep_image_submit('button_update.gif', IMAGE_UPDATE); ?>
- </div>
- </fieldset>
- </form>
- <?php /*endif;*/ ?>
- <?php endif; ?>
- </div>
-
-
- <?php /** DEtail commande */ ?>
- <div id="tabs-2" class="tabPage">
-
- <?php echo tep_draw_form('status_form', orders::FILENAME,'oID='.orders::$oID.'&action=update_order', 'post', ' class="block_form"'); ?>
- <div class="edit">
- <table class="dataTableBase orders">
- <thead>
- <tr>
- <?php if(_cst_bool('MODULE_ACCOUNT_RETURN_PRODUCTS_STATUS')): ?>
- <th><?php echo __('table heading return'); ?></th>
- <?php endif; ?>
- <th><?php echo __('table heading id'); ?></th>
- <th><?php echo __('table heading products'); ?></th>
- <th><?php echo __('table heading products model'); ?></th>
-
-
- <th><?php echo __('table heading price excluding tax'); ?></th>
- <th><?php echo __('table heading price including tax'); ?></th>
- <th><?php echo __('table heading tax'); ?></th>
- <th><?php echo __('table heading quantity'); ?></th>
- <th><?php echo __('table heading total excluding tax'); ?></th>
- <th><?php echo __('table heading total including tax'); ?></th>
- </tr>
- </thead>
- <tbody>
-
- <?php for ($i=0, $n=sizeof(orders::$order->products); $i<$n; $i++): ?>
- <tr>
- <?php if(_cst_bool('MODULE_ACCOUNT_RETURN_PRODUCTS_STATUS')): ?>
- <td><?php
- //BEGIN RMA MODULE
- $returns_check_query = tep_db_query("SELECT r.rma_value, rp.products_id FROM " . TABLE_RETURNS . " r, " . TABLE_RETURNS_PRODUCTS_DATA . " rp where r.returns_id = rp.returns_id and r.order_id = '" . orders::$oID . "' and rp.products_id = '" . orders::$order->products[$i]['id'] . "' ");
- if (!tep_db_num_rows($returns_check_query)){
-
- if (orders::$order->products[$i]['return'] != '1') {
- $return_link = '<a href="' . tep_href_link(FILENAME_RETURN_PRODUCT, 'order_id=' . orders::$oID . '&products_id=' . (orders::$order->products[$i]['id']), 'NONSSL') . '">' . tep_image(DIR_WS_ICONS .'icon_rma_return.png', TEXT_SHEDULE_RETURN ).'</a>';
- }
- // if (orders::$orders_status !=DEFAULT_ORDERS_STATUS_COMPLETED ) $return_link = '';
- } else {
- $returns = tep_db_fetch_array($returns_check_query);
- $return_link = '<a href=' . tep_href_link(FILENAME_RETURNS, 'cID=' . $returns['rma_value']) . '><font color=red><b><i>Returns</b></i></font></a>';
- }
- echo $return_link; ?>
- </td>
- <?php endif; ?>
- <td class="tcenter">
- <strong>
- <a href="<?php echo tep_href_link(FILENAME_PRODUCTS, 'action=edit&pID='.orders::$order->products[$i]['id']) ?>"><?php echo orders::$order->products[$i]['id'] ?></a>
- </strong>
- </td>
- <td class="tleft">
- <span class="fleft">
- <a href="#" class="screenshot" rel="<?php echo tep_href_link('document.php', 'mod=img&typ=product&w=200&h=200&id='.orders::$order->products[$i]['id']) ?>">
- <?php echo orders::$order->products[$i]['name'] ?>
- </a>
- </span>
- <span><?php echo tep_draw_attribute_products(orders::$order->products[$i]['attributes'],orders::$order->products[$i]['qty'], orders::$order->info['currency'], orders::$order->info['currency_value']); ?></span>
- </td>
- <td class="tcenter"><?php echo orders::$order->products[$i]['model'] ?></td>
- <td class="tcenter"><?php echo $price->format(orders::$order->products[$i]['final_price'], true, orders::$order->info['currency'], orders::$order->info['currency_value']) ?></td>
- <td class="tcenter"><?php echo $price->format(tep_add_tax(orders::$order->products[$i]['final_price'], orders::$order->products[$i]['tax']), true, orders::$order->info['currency'], orders::$order->info['currency_value']) ?></td>
- <td class="tcenter"><?php echo tep_display_tax_value(orders::$order->products[$i]['tax']) . '%' ?></td>
- <td class="tcenter">
- <?php
- /** TODO Integrer update
- Integrer Etat des stocks courant si stock actif */
- ?>
- <?php echo orders::$order->products[$i]['qty'] ?>
- </td>
- <td class="tright"><?php echo $price->format(orders::$order->products[$i]['final_price'] * orders::$order->products[$i]['qty'], true, orders::$order->info['currency'], orders::$order->info['currency_value']) ?></td>
- <td class="tright"><?php echo $price->format(tep_add_tax(orders::$order->products[$i]['final_price'], orders::$order->products[$i]['tax']) * orders::$order->products[$i]['qty'], true, orders::$order->info['currency'], orders::$order->info['currency_value']) ?></td>
- </tr>
- <?php endfor; ?>
-
- <!-- Block Total -->
- <?php for ($i = 0, $n = sizeof(orders::$order->totals); $i < $n; $i++) { ?>
- <tr>
- <?php if(_cst_bool('MODULE_ACCOUNT_RETURN_PRODUCTS_STATUS')): ?>
- <td> </td>
- <?php endif; ?>
- <td colspan="8" class="tright"><?php echo orders::$order->totals[$i]['title'] ?></td>
- <td class="tright"><?php echo orders::$order->totals[$i]['text'] ?></td>
- </tr>
- <?php } ?>
- <!-- Block Total eof-->
-
- </tbody>
- </table>
- <?php if( !in_array(orders::$order->info['orders_status_id'], array(DEFAULT_ORDERS_STATUS_COMPLETED, DEFAULT_ORDERS_STATUS_ANNULATE ) ) ): ?>
- <div class="button_nav">
- <?php echo tep_image_submit('button_update.gif', IMAGE_UPDATE); ?>
- </div>
- <?php endif; ?>
- </fieldset>
- <br class="clear" />
- </div>
- </form>
- </div>
-
-
-
-
- <?php
- /**
- History Orders
- */
- ?>
- <div id="tabs-3" class="tabPage">
- <div class="edit">
- <table class="main-orders history">
- <thead>
- <tr>
- <th width="15%"><?php echo __('table heading date added'); ?></th>
- <th class="tcenter" width="10%"><?php echo __('table heading customer notified'); ?></th>
- <th class="tcenter" width="10%"><?php echo __('table heading status'); ?></th>
- <th><?php echo __('table heading comments'); ?></th>
- </tr>
- </thead>
- <tbody>
- <?php
- if( orders::$order->history ==false ) echo '<tr>' . "\n" . '<td colspan="5">' . __('text no order history') . '</td>' . "\n" . '</tr>' . "\n";
- else
- foreach(orders::$order->history as $item): ?>
- <tr>
- <td><?php echo $item['date_added']; ?></td>
- <td class="tcenter"><?php echo $item['customer_notified']; ?></td>
- <td class="tcenter" style="width:40px; background:<?php echo $item['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['orders_status']; ?></td>
- <td><?php echo unhtmlentities($item['comments']); ?></td>
- </tr>
- <?php endforeach; ?>
- </tbody>
- </table>
- <br class="clear" />
- </div>
- </div>
-
-
-
-
-
- <?php
- /**
- Liste and manage shipping
- */
- ?>
-
- <?php if(orders::$order->display_shipping): ?>
- <div id="tabs-4" class="tabPage">
-
-
- <?php if(orders::$order->allshipping !=false): ?>
- <h4><?php echo __('@orders heading list expedition') ?></h4>
- <table class="dataTableBase orders shipping allshipping">
- <thead>
- <tr>
- <th><?php echo __('table heading id'); ?></th>
- <th><?php echo __('table heading date expedition'); ?></th>
- <th><?php echo __('table heading tracking number'); ?></th>
- <th><?php echo __('table heading methode'); ?></th>
- <th><?php echo __('table heading status'); ?></th>
- </tr>
- </thead>
- <tbody>
- <?php $i = 0; foreach (orders::$order->allshipping as $ashipping): $i++; ?>
- <?php if(isset($ashipping->row_id)): ?>
- <tr>
- <td class="tcenter">
- <strong>
- <a href="<?php echo tep_href_link(FILENAME_SHIPPING,'action=edit&oID='.$ashipping->row_id); ?>"><?php echo (!empty($ashipping->shipping_ref)?$ashipping->shipping_ref:$ashipping->row_id); ?></a>
- </strong>
- </td>
- <td class="tcenter">
- <?php echo tep_datetime_short($ashipping->date_expedition); ?>
- </td>
-
- <td class="tcenter">
- <?php echo '<a href="'.$ashipping->tracking_url.'" target="blank">'.$ashipping->tracking.'</a>'; ?>
- </td>
-
- <td class="tcenter">
- <?php echo $ashipping->method; ?>
- </td>
- <td class="tcenter">
- <?php echo $ashipping->status; ?>
- </td>
- </tr>
- <?php endif; ?>
- <?php endforeach; ?>
- </tbody>
- </table>
- <?php endif; ?>
-
- <br />
-
- <div class="edit">
- <h4><?php echo __('@orders heading form expedition'); ?></h4>
- <!-- DEB Form add expedition -->
- <?php echo tep_draw_form('add_deliv', orders::FILENAME,'oID='.orders::$oID.'&action=shipping&method=add', 'post', ' class="block_form"'); ?>
- <table class="dataTableBase orders">
- <thead>
- <tr>
- <th><?php echo __('table heading id'); ?></th>
- <th><?php echo __('table heading products'); ?></th>
- <th><?php echo __('table heading quantity in order'); ?></th>
- <th><?php echo __('table heading quantity deja expedie'); ?></th>
- <th><?php echo __('table heading quantity a expedie'); ?></th>
- </tr>
- </thead>
- <tbody>
- <?php $i = 0; foreach (orders::$order->pshipping as $pshipping): $i++; ?>
- <tr>
- <td class="tcenter">
- <strong>
- <a href="<?php echo tep_href_link(FILENAME_PRODUCTS, 'action=edit&pID='.$pshipping->id) ?>"><?php echo $pshipping->id ?></a>
- </strong>
- </td>
- <td class="tleft">
- <span class="fleft">
- <a href="#" class="screenshot" rel="<?php echo tep_href_link('document.php', 'mod=img&typ=product&w=200&h=200&id='.$pshipping->id) ?>">
- <?php echo $pshipping->name ?>
- </a>
- </span>
- <span><?php echo tep_draw_attribute_products($pshipping->attributes,$pshipping->qty ,orders::$order->info['currency'], orders::$order->info['currency_value']); ?></span>
- </td>
- <td class="tcenter">
- <?php echo $pshipping->qty ?>
- </td>
- <td class="tcenter">
- <?php echo $pshipping->qt_expedie ?>
- </td>
-
- <td class="tcenter">
- <?php if( ($pshipping->qty - $pshipping->qt_expedie) >= 0 ): ?>
- <?php echo tep_draw_input_field('shipping_qt['.tep_get_uprid($pshipping->id, $pshipping->attrib) .']','', ($pshipping->qty - $pshipping->qt_expedie) ) .tep_draw_hidden_field('shipping_qt_max['.tep_get_uprid($pshipping->id, $pshipping->attrib).']','', ($pshipping->qty - $pshipping->qt_expedie) ) ; ?>
- <?php else: ?>
- <?php echo ($pshipping->qty - $pshipping->qt_expedie); ?>
- <?php endif; ?>
- </td>
-
- </tr>
- <?php endforeach; ?>
-
- </tbody>
- </table>
-
-
- <?php if( (bool)orders::$order->display_shipping_add ) : ?>
- <fieldset class="block_field fleft w_50" >
- <legend><?php echo __('entry shipping new expedition details'); ?></legend>
-
-
- <p class="block_input">
- <label><?php echo __('@orders label shipping module'); ?></label>
- <?php echo orders::$order->mod['class_shipping'] ; ?>
- </p>
-
-
- <p class="block_input">
- <label><?php echo __('label shipping tracking number'); ?></label>
- <?php echo tep_draw_input_field('shipping_tracing_number','', '' ); ?>
- </p>
- <p class="block_input">
- <label><?php echo __('label shipping tracking url'); ?></label>
- <?php //echo tep_draw_input_field('shipping_tracing_url','', '' ); ?>
-
- <?php if(tep_not_null(orders::GetModVar( 'shipping',orders::$order->mod['class_shipping'], 'tracking_url'))) : ?>
- <?php echo orders::GetModVar( 'shipping',orders::$order->mod['class_shipping'], 'tracking_url') . tep_draw_hidden_field('shipping_tracing_url','', orders::GetModVar( 'shipping',orders::$order->mod['class_shipping'], 'tracking_url') ) . tep_draw_hidden_field('shipping_method','',orders::$order->mod['class_shipping'] ); ?>
- <?php else: ?>
- <?php echo __('@orders shipping tracking url no found for this module') . tep_draw_hidden_field('shipping_method','',orders::$order->mod['class_shipping'] ); ?>
- <?php endif; ?>
- </p>
- </fieldset>
-
-
- <div class="button_nav">
- <?php echo tep_image_submit('button_update.gif', IMAGE_UPDATE); ?>
- </div>
- <?php endif; ?>
- <br class="clear" />
+ </div>
</div>
- <!-- END Form add expedition -->
- </form>
- </div>
- <?php endif; ?>
-
-
-
-
<?php
- /**
- Liste and manage active service and contract
- */
- ?>
- <?php if(orders::$order->display_service): ?>
- <div id="tabs-5" class="tabPage">
- <table class="dataTableBase orders">
- <thead>
- <tr>
- <th><?php echo __('table heading id'); ?></th>
- <th><?php echo __('table heading quantity'); ?></th>
- <th><?php echo __('table heading products'); ?></th>
- <th><?php echo __('table heading total excluding tax'); ?></th>
-
- <th><?php echo __('table heading active initial'); ?></th>
- <th><?php echo __('table heading revival'); ?></th>
- <th><?php echo __('table heading auto_retry'); ?></th>
-
-
- <th><?php echo __('table heading current status'); ?></th>
- </tr>
- </thead>
- <tbody>
- <?php $i = 0; foreach (orders::$order->service as $service): $i++; ?>
- <tr>
- <td class="tcenter"><?php echo (!empty($service->service_ref)?$service->service_ref: $service->id) ?></td>
- <td class="tcenter">
- <?php echo $service->qty ?>
- </td>
- <td class="tleft">
- <span class="fleft">
- <a href="#" class="screenshot" rel="<?php echo tep_href_link('document.php', 'mod=img&typ=product&w=200&h=200&id='.$service->id) ?>">
- <?php echo $service->name ?>
- </a>
- </span>
- <span><?php echo tep_draw_attribute_products($service->attributes,$service->qty, orders::$order->info['currency'], orders::$order->info['currency_value']); ?></span>
- </td>
-
-
- <td class="tright"><?php echo $price->format($service->final_price * $service->qty, true, orders::$order->info['currency'], orders::$order->info['currency_value']) ?></td>
-
- <td class="tcenter"><?php echo tep_datetime_short($service->date_start) ?></td>
- <td class="tcenter"><?php echo tep_datetime_short($service->date_revival) ?></td>
- <td class="tcenter"> <?php echo $service->auto_retry_html ?> </td>
- <td class="tleft"> <?php echo $service->status_html ?> </td>
- </tr>
- <?php endforeach; ?>
-
- </tbody>
- </table>
- </div>
- <?php endif; ?>
-
-
-
-
-
-
-
-
-
- <div class="main-orders master">
-
-
-
- <div class="main-orders block fleft w_50 padd_w">
-
- <div class="block_field fleft w_50" >
- <h4><?php echo __('legend contact customers'); ?></h4>
- <p class="clear block_input">
- <strong><?php echo __('entry telephone number'); ?></strong><?php echo orders::$order->customer['telephone']; ?>
- <br />
-
- <strong><?php echo __('entry email address'); ?></strong><?php echo '<a href="' .tep_href_link( FILENAME_MAIL , 'cus...@os...'.orders::$order->customer['email_address'].'&origin='. orders::FILENAME .'&origin_id='.orders::$order->info['orders_id']). '">' . orders::$order->customer['email_address']. '</a>'; ?>
- <br />
-
- <strong><?php echo __('entry ip'); ?></strong><?php echo orders::$order->info['ip_address']; ?>
- </p>
- </div>
-
- </div>
-
-
- <?php
/**
DRAW BLOCK DOCS EXISTS OR LINK PDF CREATE
*/
@@ -716,7 +83,7 @@
<?php if(( $filepath=$datadocs->GetDoc('packingslip', $_GET['oID'])) && file_exists($filepath)): ?>
<tr>
- <td><a href="<?php echo tep_href_link('document.php', 'mod=packingslip&id='.$_GET['oID']) ?>"><?php echo orders::$order->info['orders_ref'] ?></a></td>
+ <td><a href="<?php echo tep_href_link('document.php', 'mod=packingslip&id='.$_GET['oID']) ?>"><?php echo orders::$Info->info['orders_ref'] ?></a></td>
<td><?php echo round((filesize($filepath)/1000),1).' Ko' ; ?></td>
<td><?php echo tep_datetime_short(date('Y-m-d H:i:s',filemtime($filepath))) ; ?></td>
<td><?php echo sprintf(CsrtAction::getLink('row_action_right', IMAGE_DELETE, 'trash'), '', tep_href_link(orders::FILENAME, 'file_type=packingslip&action=deletefile&id='.$_GET['oID'].'&oID='.$_GET['oID']) ,'' ) ; ?></td>
@@ -734,7 +101,7 @@
<th></th>
</tr>
- <?php $i = 0; if(orders::$order->allshipping !=false) foreach (orders::$order->allshipping as $ashipping): $i++; ?>
+ <?php $i = 0; if(orders::$Info->allshipping !=false) foreach (orders::$Info->allshipping as $ashipping): $i++; ?>
<?php if(isset($ashipping->row_id)): ?>
<?php if(( $filepath=$datadocs->GetDoc('delivery', $ashipping->row_id)) && file_exists($filepath)): ?>
<tr>
@@ -760,7 +127,7 @@
<?php if(( $filepath=$datadocs->GetDoc('invoices', $_GET['oID'])) && file_exists($filepath)): ?>
<tr>
- <td><a href="<?php echo tep_href_link('document.php', 'mod=invoice&id='.$_GET['oID']) ?>"><?php echo orders::$order->info['facture_ref'] ?></a></td>
+ <td><a href="<?php echo tep_href_link('document.php', 'mod=invoice&id='.$_GET['oID']) ?>"><?php echo orders::$Info->info['facture_ref'] ?></a></td>
<td><?php echo round((filesize($filepath)/1000),1).' Ko' ; ?></td>
<td><?php echo tep_datetime_short(date('Y-m-d H:i:s',filemtime($filepath))) ; ?></td>
<td><?php echo sprintf(CsrtAction::getLink('row_action_right', IMAGE_DELETE, 'trash'), '', tep_href_link(orders::FILENAME, 'file_type=invoice&action=deletefile&id='.$_GET['oID'].'&oID='.$_GET['oID']) ,'' ) ; ?></td>
@@ -775,8 +142,8 @@
</table>
</div>
-</div>
+
<div class="button_nav">
<?php echo tep_js_back(tep_href_link(orders::FILENAME), IMAGE_CANCEL);?>
</div>
Added: trunk/catalog/admin/includes/gabarit/orders/edit.tab.detail.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/orders/edit.tab.detail.gab (rev 0)
+++ trunk/catalog/admin/includes/gabarit/orders/edit.tab.detail.gab 2014-02-05 17:55:04 UTC (rev 5123)
@@ -0,0 +1,112 @@
+<?php
+/**
+ @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 05/11/2013, 11:35
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+ @file edit.tab.detail.gab
+ @dir admin/includes/gabarit/orders/
+*/
+global $price, $current_theme;
+
+
+?>
+
+ <?php echo tep_draw_form('status_form', orders::FILENAME,'cID='.orders::$Id.'&action=update_order', 'post', ' class="block_form"'); ?>
+ <div class="edit">
+ <table class="dataTableBase orders">
+ <thead>
+ <tr>
+ <?php if(_cst_bool('MODULE_ACCOUNT_RETURN_PRODUCTS_STATUS')): ?>
+ <th><?php echo __('table heading return'); ?></th>
+ <?php endif; ?>
+ <th><?php echo __('table heading id'); ?></th>
+ <th><?php echo __('table heading products'); ?></th>
+ <th><?php echo __('table heading products model'); ?></th>
+
+
+ <th><?php echo __('table heading price excluding tax'); ?></th>
+ <th><?php echo __('table heading price including tax'); ?></th>
+ <th><?php echo __('table heading tax'); ?></th>
+ <th><?php echo __('table heading quantity'); ?></th>
+ <th><?php echo __('table heading total excluding tax'); ?></th>
+ <th><?php echo __('table heading total including tax'); ?></th>
+ </tr>
+ </thead>
+ <tbody>
+
+ <?php for ($i=0, $n=sizeof(orders::$Info->products); $i<$n; $i++): ?>
+ <tr>
+ <?php if(_cst_bool('MODULE_ACCOUNT_RETURN_PRODUCTS_STATUS')): ?>
+ <td><?php
+ //BEGIN RMA MODULE
+ $returns_check_query = tep_db_query("SELECT r.rma_value, rp.products_id FROM " . TABLE_RETURNS . " r, " . TABLE_RETURNS_PRODUCTS_DATA . " rp where r.returns_id = rp.returns_id and r.order_id = '" . orders::$Id . "' and rp.products_id = '" . orders::$Info->products[$i]['id'] . "' ");
+ if (!tep_db_num_rows($returns_check_query)){
+
+ if (orders::$Info->products[$i]['return'] != '1') {
+ $return_link = '<a href="' . tep_href_link(FILENAME_RETURN_PRODUCT, 'order_id=' . orders::$Id . '&products_id=' . (orders::$Info->products[$i]['id']), 'NONSSL') . '">' . tep_image(DIR_WS_ICONS .'icon_rma_return.png', TEXT_SHEDULE_RETURN ).'</a>';
+ }
+ // if (orders::$Infos_status !=DEFAULT_ORDERS_STATUS_COMPLETED ) $return_link = '';
+ } else {
+ $returns = tep_db_fetch_array($returns_check_query);
+ $return_link = '<a href=' . tep_href_link(FILENAME_RETURNS, 'cID=' . $returns['rma_value']) . '><font color=red><b><i>Returns</b></i></font></a>';
+ }
+ echo $return_link; ?>
+ </td>
+ <?php endif; ?>
+ <td class="tcenter">
+ <strong>
+ <a href="<?php echo tep_href_link(FILENAME_PRODUCTS, 'action=edit&pID='.orders::$Info->products[$i]['id']) ?>"><?php echo orders::$Info->products[$i]['id'] ?></a>
+ </strong>
+ </td>
+ <td class="tleft">
+ <span class="fleft">
+ <a href="#" class="screenshot" rel="<?php echo tep_href_link('document.php', 'mod=img&typ=product&w=200&h=200&id='.orders::$Info->products[$i]['id']) ?>">
+ <?php echo orders::$Info->products[$i]['name'] ?>
+ </a>
+ </span>
+ <span><?php echo tep_draw_attribute_products(orders::$Info->products[$i]['attributes'],orders::$Info->products[$i]['qty'], orders::$Info->info['currency'], orders::$Info->info['currency_value']); ?></span>
+ </td>
+ <td class="tcenter"><?php echo orders::$Info->products[$i]['model'] ?></td>
+ <td class="tcenter"><?php echo $price->format(orders::$Info->products[$i]['final_price'], true, orders::$Info->info['currency'], orders::$Info->info['currency_value']) ?></td>
+ <td class="tcenter"><?php echo $price->format(tep_add_tax(orders::$Info->products[$i]['final_price'], orders::$Info->products[$i]['tax']), true, orders::$Info->info['currency'], orders::$Info->info['currency_value']) ?></td>
+ <td class="tcenter"><?php echo tep_display_tax_value(orders::$Info->products[$i]['tax']) . '%' ?></td>
+ <td class="tcenter">
+ <?php
+ /** TODO Integrer update
+ Integrer Etat des stocks courant si stock actif */
+ ?>
+ <?php echo orders::$Info->products[$i]['qty'] ?>
+ </td>
+ <td class="tright"><?php echo $price->format(orders::$Info->products[$i]['final_price'] * orders::$Info->products[$i]['qty'], true, orders::$Info->info['currency'], orders::$Info->info['currency_value']) ?></td>
+ <td class="tright"><?php echo $price->format(tep_add_tax(orders::$Info->products[$i]['final_price'], orders::$Info->products[$i]['tax']) * orders::$Info->products[$i]['qty'], true, orders::$Info->info['currency'], orders::$Info->info['currency_value']) ?></td>
+ </tr>
+ <?php endfor; ?>
+
+ <!-- Block Total -->
+ <?php for ($i = 0, $n = sizeof(orders::$Info->totals); $i < $n; $i++) { ?>
+ <tr>
+ <?php if(_cst_bool('MODULE_ACCOUNT_RETURN_PRODUCTS_STATUS')): ?>
+ <td> </td>
+ <?php endif; ?>
+ <td colspan="8" class="tright"><?php echo orders::$Info->totals[$i]['title'] ?></td>
+ <td class="tright"><?php echo orders::$Info->totals[$i]['text'] ?></td>
+ </tr>
+ <?php } ?>
+ <!-- Block Total eof-->
+
+ </tbody>
+ </table>
+ <?php if( !in_array(orders::$Info->info['orders_status_id'], array(DEFAULT_ORDERS_STATUS_COMPLETED, DEFAULT_ORDERS_STATUS_ANNULATE ) ) ): ?>
+ <div class="button_nav">
+ <?php echo tep_image_submit('button_update.gif', IMAGE_UPDATE); ?>
+ </div>
+ <?php endif; ?>
+ </fieldset>
+ <br class="clear" />
+ </div>
+ </form>
+
Added: trunk/catalog/admin/includes/gabarit/orders/edit.tab.generic.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/orders/edit.tab.generic.gab (rev 0)
+++ trunk/catalog/admin/includes/gabarit/orders/edit.tab.generic.gab 2014-02-05 17:55:04 UTC (rev 5123)
@@ -0,0 +1,299 @@
+<?php
+/**
+ @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 05/11/2013, 11:35
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+ @file edit.tab.generic.gab
+ @dir admin/includes/gabarit/orders/
+*/
+global $price, $current_theme;
+
+
+?>
+
+<!-- DRAW DETAIL CUSTOMERS -->
+ <div class="box_uniq block_form">
+ <fieldset class="block_field fleft w_50" >
+ <legend class="Ctrtirroir"><?php echo __('entry customer'); ?></legend>
+ <p class="block_input tirroir">
+ <?php echo tep_address_format(orders::$Info->customer['format_id'], orders::$Info->customer, 1, '', '<br />'); ?><br />
+ </p>
+ </fieldset>
+
+ <fieldset class="block_field fleft w_50" >
+ <legend class="Ctrtirroir"><?php echo __('legend contact customers'); ?></legend>
+ <p class="block_input tirroir">
+ <strong><?php echo __('entry telephone number'); ?></strong><?php echo orders::$Info->customer['telephone']; ?>
+ <br />
+
+ <strong><?php echo __('entry email address'); ?></strong><?php echo '<a href="mailto:' . orders::$Info->customer['email_address'] . '">' . orders::$Info->customer['email_address'] . '</a>'; ?>
+ <br />
+
+ <strong><?php echo __('entry ip'); ?></strong><?php echo orders::$Info->info['ip_address']; ?>
+ </p>
+ </fieldset>
+
+ </div>
+
+<!-- DRAW ADRESS SHIPING / BILLING -->
+
+ <?php /** Billing Address */ ?>
+ <div class="box_uniq block_form">
+
+ <fieldset class="block_field fleft w_50" >
+
+ <legend>
+ <?php echo __('entry billing address'); ?>
+ <?php if( !in_array(orders::$Info->info['orders_status_id'], array(DEFAULT_ORDERS_STATUS_COMPLETED, DEFAULT_ORDERS_STATUS_ANNULATE ) ) ): ?>
+ <span class="row_action">
+ <?php echo sprintf(CsrtAction::getLink('row_action_right', IMAGE_EDIT, 'edit'), '', tep_href_link(orders::FILENAME, 'action=edit&cID='.orders::$Id. '&address=billing') ,'' ) ?>
+ </span>
+ <?php endif; ?>
+ </legend>
+
+ <div class="block_input">
+ <?php if(!isset($_REQUEST['address']) || ( isset($_REQUEST['address']) && $_REQUEST['address'] !='billing' ) ): ?>
+ <?php echo tep_address_format(orders::$Info->billing['format_id'], orders::$Info->billing, 1, '', '<br />'); ?>
+ <?php else: ?>
+
+
+ <?php echo tep_draw_form('add_deliv', orders::FILENAME,'cID='.orders::$Id.'&action=address&address=billing', 'post', ' class="block_form"'); ?>
+
+ <?php if(_cst_bool('ACCOUNT_COMPANY')): ?>
+ <?php echo tep_draw_input_field('address[company]','company', orders::$Info->billing['company']) ; ?>
+ <?php endif; ?>
+
+ <?php echo tep_draw_input_field('address[name]','name', orders::$Info->billing['name'] ); ?>
+
+ <?php echo tep_draw_input_field('address[street_address]','street_address', orders::$Info->billing['street_address']) ; ?>
+
+ <?php echo tep_draw_input_field('address[suburb]','suburb', orders::$Info->billing['suburb']) ; ?>
+
+ <?php echo tep_draw_input_field('address[postcode]','postcode', orders::$Info->billing['postcode']) ; ?>
+
+ <?php echo tep_draw_input_field('address[city]','city', orders::$Info->billing['city']) ; ?>
+
+ <?php echo tep_draw_pull_down_menu('address[country]', worldUtility::get_countries(), worldUtility::GetCountryIdByName(orders::$Info->billing['country']) ) ; ?>
+
+ <?php if(_cst_bool('ACCOUNT_STATE')): ?>
+ <?php echo tep_draw_input_field('address[state]','state', orders::$Info->billing['state']) ; ?>
+ <?php endif; ?>
+
+
+ <div class="button_nav">
+ <?php echo tep_js_back(tep_href_link(orders::FILENAME, tep_get_all_get_params(array('address')) ), IMAGE_CANCEL);?>
+ <?php echo tep_image_submit('button_update.gif', IMAGE_UPDATE); ?>
+ </div>
+
+ </form>
+ <?php endif; ?>
+ </div>
+ </fieldset>
+
+ <?php /** Shipping address */ ?>
+ <fieldset class="block_field fleft w_50 " >
+ <legend>
+ <?php echo __('entry shipping address'); ?>
+
+ <?php if( !in_array(orders::$Info->info['orders_status_id'], array(DEFAULT_ORDERS_STATUS_COMPLETED, DEFAULT_ORDERS_STATUS_ANNULATE ) ) ): ?>
+ <?php if(isset(orders::$Info->delivery['street_address'])): ?>
+ <span class="row_action">
+ <?php echo sprintf(CsrtAction::getLink('row_action_right', IMAGE_EDIT, 'edit'), '', tep_href_link(orders::FILENAME, 'action=edit&cID='.orders::$Id . '&address=delivery') ,'' ) ?>
+ </span>
+ <?php endif; ?>
+ <?php endif; ?>
+ </legend>
+
+ <?php if(isset(orders::$Info->delivery['street_address'])): ?>
+ <div class="block_input">
+ <?php if(!isset($_REQUEST['address']) || ( isset($_REQUEST['address']) && $_REQUEST['address'] !='delivery' ) ): ?>
+ <?php echo tep_address_format(orders::$Info->delivery['format_id'], orders::$Info->delivery, 1, '', '<br />'); ?>
+ <?php else: ?>
+
+
+ <?php echo tep_draw_form('add_ship', orders::FILENAME,'cID='.orders::$Id.'&action=address&address=delivery', 'post', ' class="block_form"'); ?>
+ <ul>
+ <li>
+ <label for ="notify"><?php echo __('entry shipping address actived'); ?></label>
+ <?php echo tep_draw_checkbox_field('address[activate]', '', '', (!empty(orders::$Info->delivery['name']) ? true :false) ); ?>
+ </li>
+
+ <?php if(_cst_bool('ACCOUNT_COMPANY')): ?>
+ <li><?php echo tep_draw_input_field('address[company]','company', orders::$Info->delivery['company']) ; ?></li>
+ <?php endif; ?>
+
+ <li><?php echo tep_draw_input_field('address[name]','name', orders::$Info->delivery['name'] ); ?></li>
+
+ <li><?php echo tep_draw_input_field('address[street_address]','street_address', orders::$Info->delivery['street_address']) ; ?></li>
+
+ <li><?php echo tep_draw_input_field('address[suburb]','suburb', orders::$Info->delivery['suburb']) ; ?></li>
+
+ <li><?php echo tep_draw_input_field('address[postcode]','postcode', orders::$Info->delivery['postcode']) ; ?></li>
+
+ <li><?php echo tep_draw_input_field('address[city]','city', orders::$Info->delivery['city']) ; ?></li>
+
+ <li><?php echo tep_draw_pull_down_menu('address[country]', worldUtility::get_countries(), worldUtility::GetCountryIdByName(orders::$Info->delivery['country']) ) ; ?></li>
+
+ <?php if(_cst_bool('ACCOUNT_STATE')): ?>
+ <li><?php echo tep_draw_input_field('address[state]','state', orders::$Info->delivery['state']) ; ?></li>
+ <?php endif; ?>
+
+ </ul>
+
+ <div class="button_nav">
+ <?php echo tep_js_back(tep_href_link(orders::FILENAME, tep_get_all_get_params(array('address')) ), IMAGE_CANCEL);?>
+ <?php echo tep_image_submit('button_update.gif', IMAGE_UPDATE); ?>
+ </div>
+
+ </form>
+ <?php endif; ?>
+ </div>
+ <?php endif; ?>
+
+ </fieldset>
+ </div>
+
+<!-- DRAW METHOD SHIPING / BILLING -->
+
+
+ <?php /** Payment Methode */ ?>
+ <div class="box_uniq block_form">
+ <fieldset class="block_field fleft w_50 ">
+ <legend><?php echo __('entry payment method'); ?>
+ <?php if( !in_array(orders::$Info->info['orders_status_id'], array(DEFAULT_ORDERS_STATUS_COMPLE...
[truncated message content] |
|
From: <os...@us...> - 2014-02-05 15:18:37
|
Revision: 5122
http://sourceforge.net/p/oscss/svn/5122
Author: oscim
Date: 2014-02-05 15:18:33 +0000 (Wed, 05 Feb 2014)
Log Message:
-----------
Fix
Implements new code for clean call data and display in loop page
Progess centralised code for min ligne in core
Simplifie usage file.gab
Clean code and use next gen class in sqlxxx
Modified Paths:
--------------
trunk/catalog/admin/includes/classes/MGabCont.php
trunk/catalog/admin/includes/classes/ModTree.php
trunk/catalog/admin/includes/classes/ModTreePage.php
trunk/catalog/admin/includes/classes/ModTwo.php
trunk/catalog/admin/includes/classes/SqlFilesDataDriverClass.php
trunk/catalog/admin/includes/classes/drivers/sqlcurrencie.php
trunk/catalog/admin/includes/classes/drivers/sqlcustomer.php
trunk/catalog/admin/includes/classes/drivers/sqlfeatured.php
trunk/catalog/admin/includes/classes/drivers/sqlnavigation_links.php
trunk/catalog/admin/includes/classes/drivers/sqlproduct.php
trunk/catalog/admin/includes/gabarit/MGabCont/display_view.edit.gab
trunk/catalog/admin/includes/languages/fr_FR/modules/pages/navigation_links.txt
trunk/catalog/admin/includes/modules/pages/adminUsers.php
trunk/catalog/admin/includes/modules/pages/categories.php
trunk/catalog/admin/includes/modules/pages/cms_content.php
trunk/catalog/admin/includes/modules/pages/countries.php
trunk/catalog/admin/includes/modules/pages/currencies.php
trunk/catalog/admin/includes/modules/pages/customers.php
trunk/catalog/admin/includes/modules/pages/navigation_links.php
trunk/catalog/admin/includes/modules/pages/products.php
Added Paths:
-----------
trunk/catalog/admin/includes/gabarit/MGabCont/edit.tab.generic.gab
trunk/catalog/admin/includes/gabarit/countries/edit.tab.state.gab
trunk/catalog/admin/includes/gabarit/featureds/edit.tab.childs.gab
trunk/catalog/admin/includes/gabarit/navigation_links/edit.tab.advanced.gab
trunk/catalog/admin/includes/gabarit/navigation_links/edit.tab.generic.gab
trunk/catalog/admin/includes/gabarit/products/edit.tab.generic.gab
Removed Paths:
-------------
trunk/catalog/admin/includes/gabarit/countries/display_view.edit.gab
trunk/catalog/admin/includes/gabarit/featureds/display_view.delete.gab
trunk/catalog/admin/includes/gabarit/featureds/display_view.edit.gab
trunk/catalog/admin/includes/gabarit/navigation_links/display_view.delete.gab
trunk/catalog/admin/includes/gabarit/navigation_links/display_view.edit.gab
trunk/catalog/admin/includes/gabarit/products/display_view.edit.gab
Modified: trunk/catalog/admin/includes/classes/MGabCont.php
===================================================================
--- trunk/catalog/admin/includes/classes/MGabCont.php 2014-02-05 06:50:48 UTC (rev 5121)
+++ trunk/catalog/admin/includes/classes/MGabCont.php 2014-02-05 15:18:33 UTC (rev 5122)
@@ -67,6 +67,7 @@
}
+
/**
@brief define current name class Childs
*/
Modified: trunk/catalog/admin/includes/classes/ModTree.php
===================================================================
--- trunk/catalog/admin/includes/classes/ModTree.php 2014-02-05 06:50:48 UTC (rev 5121)
+++ trunk/catalog/admin/includes/classes/ModTree.php 2014-02-05 15:18:33 UTC (rev 5122)
@@ -42,8 +42,62 @@
}
+/**
+ @class TabsListeners
+ @brief for format tabs in display pages
+*/
+Class TabsListeners {
+ /**
+ @var string title
+ */
+ protected $title;
+ /**
+ @var string content html result of extract gab
+ */
+ protected $content;
+ public function __construct($title, $content){
+ $this->title = $title;
+ $this->content = $content;
+ }
+
+ /**
+ @fn GetContent()
+ @brief Get Value
+ @return string value
+ */
+ public function GetContent(){
+ return $this->content;
+ }
+ /**
+ @fn SetContent()
+ @brief Get Value
+ @param $content string content html result of extract gab
+ */
+ public function SetContent($content){
+ $this->content = $content;
+ }
+
+ /**
+ @fn GetTitle()
+ @brief Get Value
+ @return string value
+ */
+ public function GetTitle(){
+ return $this->title;
+ }
+
+ /**
+ @fn SetTitle()
+ @brief Get Value
+ @param $title string title
+ */
+ public function SetTitle($title){
+ $this->title = $title;
+ }
+}
+
/**
@class ModTree Abstract
@brief class for module type pages
@@ -74,8 +128,12 @@
@var array for stock generic filter activate
*/
protected static $generictfilter = array();
-
/**
+ @var array list of tabs in current dispay,
+ this tabs is master parent of tabs
+ */
+ public static $tabs = array();
+ /**
@brief Load , adjust and define var environement exe for module
This function replace the module constructor method .
*/
@@ -87,9 +145,25 @@
parent::Clean();
}
+ /**
+ */
+ public static function GetListTabs( ){
+ return self::$tabs;
+ }
+
+ /**
+ AddTabs( TabsListeners $objTabs , $pos = -1)
+ @param $objTabs object TabsListeners
+ @param $pos int if not precised, add in end, else replace or force current val
+ @return none;
+ */
+ public static function AddTabs( TabsListeners $objTabs , $pos = -1){
+ if($pos === -1)
+ $pos=count(self::$tabs);
+
+ self::$tabs[$pos] = $objTabs;
+ }
-
-
/**
@brief Construct base transversal data object
This key is unified in core
@@ -502,6 +576,7 @@
}
/**
+ @fn DFilterAllfields()
@brief Use in listing dataTable For filter listing
@return array
0 => array
@@ -516,7 +591,9 @@
return ((isset(self::$InitInfo['allfields'][$action])) ? self::$InitInfo['allfields'][$action] : array());
}
+
/**
+ @fn DMenuModule()
@brief Use in listing dataTable call by ajax Base theader table , for display table
@return array
0 => array
@@ -540,6 +617,11 @@
/**
@fn tep_get_modele($param='modele')
+ @brief provider Construct model used in called by ajax
+ @param none But use func_get_args for collect data params
+ @note
+ Replace by used Specimen for normalize code
+ But this code adjust col by filter cols used in filter
@return array
*/
public static function tep_get_modele(){
@@ -552,8 +634,10 @@
/**
+ @fn DisplayCol()
@brief Display colum for all fields
- @param $args array
+ @param none But use func_get_args for collect data params
+ @return array
*/
public static function DisplayCol(){
$opt = func_get_args();
@@ -657,6 +741,14 @@
return self::$datatype;
}
+ /**
+ @brief return Filename
+ */
+ public static function GetFILENAME(){
+ $class = self::GetClassName();
+ return $class::FILENAME;
+ }
+
/**
@brief Check result or return array (' ',...)
*/
Modified: trunk/catalog/admin/includes/classes/ModTreePage.php
===================================================================
--- trunk/catalog/admin/includes/classes/ModTreePage.php 2014-02-05 06:50:48 UTC (rev 5121)
+++ trunk/catalog/admin/includes/classes/ModTreePage.php 2014-02-05 15:18:33 UTC (rev 5122)
@@ -31,6 +31,295 @@
protected static $CurrentExternal = array();
/**
+ @brief generic load other file in page
+ */
+ public function get_header(){
+ $class=self::GetClassName();
+ tep_include_file(DIR_WS_JS . "modules/pages/".$class.".js.php",true);
+
+ if(self::$modules !=false)
+ self::$modules->get_header_js(self::$action);
+ }
+
+ /**
+ @fn display_view()
+ @brief this methode is switch for call gabarit action
+ */
+ public function display_view(){
+ $class=self::GetClassName();
+ $action = $class::$action;
+
+ switch ($action) {
+ default:
+ $action = self::GenericDisplay($action);
+ }
+
+ if( ! empty($action) )
+ return MGabCont::CallGab($action,__FUNCTION__,$class::MASTER);
+ }
+
+ /**
+ @fn GenericAction()
+ @brief generic action call and process for normlaized action in subchilds module
+ For surcharge Action put string action in siwtch on subchilds module
+ @param $blokRedirect default false, for block redirect by modify header in php function
+ @return none
+ */
+ public static function GenericAction($blokRedirect=false){
+ global $messageStack, $languages_id;
+
+ $class=self::GetClassName();
+ $sqlclass='sql'.self::GetClassDatatype();
+
+ if(!tep_action_check(self::$action, $class::FILENAME)){
+ $messageStack->add_session(__('@'.$class.' your are not access data'), 'error');
+ tep_redirect(tep_href_link($class::FILENAME));
+ }
+
+ switch(self::$action){
+ /**
+ @remarks specific save in session value filters
+ */
+ case 'filters':
+ /*
+ Call Prev Process
+ */
+ self::actionFilter();
+
+ if(!$blokRedirect)
+ tep_redirect(tep_href_link($class::FILENAME));
+ break;
+ /**
+ @remarks specific Ajax call
+ */
+ case 'update_cell':
+ try {
+ $params = array();
+ $params['id'] = $_REQUEST['id'];
+ $params['sqlarray'] = $sqlclass::ExtractForm( $class::ExtractValByName($languages_id, $_REQUEST['columnName'], $_REQUEST['value']) );
+ $params['action']=self::$action;
+ $params['language_id']= $languages_id;
+
+ if( $sqlclass::update( $params ) != 1 )
+ throw new Exception(__('@'.$class.' error in update process')) ;
+
+ $messageStack->add_session(__('@'.$class.' success in update process'), 'success');
+
+ // display value for return
+ echo $_REQUEST['value'];
+ }
+ catch (Exception $e) {
+
+ $messageStack->add_session($e->getMessage() , 'error');
+ }
+ break;
+
+ /**
+ @remarks Delete post
+ */
+ case 'deleteconfirm':
+
+ try {
+
+ if($class::$Id <=0 )
+ throw new Exception(__('@'.$class.' error load data')) ;
+
+ if( !$sqlclass::delete(array('id'=>$class::$Id)) )
+ throw new Exception( sprintf(__('error delet for post id %s'), $class::$Id ) ) ;
+
+ $messageStack->add_session(sprintf(__('delete post id %s success'), $class::$Id ), 'success');
+
+ }
+ catch (Exception $e) {
+ $messageStack->add_session($e->getMessage() , 'error');
+ }
+
+ if(!$blokRedirect)
+ tep_redirect(tep_href_link($class::FILENAME) );
+ break;
+
+
+ /**
+ @remarks normal page
+ */
+ case 'insert':
+ try {
+
+ $params = array();
+ $params['action']=$class::$action;
+ $params['post']=$_POST;
+ $params['language_id']= $languages_id;
+ $params['sqlarray'] = $sqlclass::ExtractForm($_POST);
+ $_id=$sqlclass::create($params);
+
+ if(!$blokRedirect)
+ tep_redirect(tep_href_link($class::FILENAME, 'cID=' . $_id.'&action=edit'));
+
+ }
+ catch (Exception $e) {
+ $messageStack->add_session($e->getMessage() , 'error');
+
+ if(!$blokRedirect)
+ tep_redirect(tep_href_link($class::FILENAME));
+ }
+ break;
+
+
+ case 'update':
+
+ try {
+ if( $class::$Id <=0 )
+ throw new Exception(__('@'.$class.' error load data')) ;
+
+ $params['id']= $class::$Id;
+ $params['action']=$class::$action;
+ $params['post']=$_POST;
+ $params['language_id']= $languages_id;
+ $params['sqlarray'] = $sqlclass::ExtractForm($_POST);
+
+ $res =$sqlclass::update($params);
+
+ $function = (isset($_POST['origin'])? 'add_session' : 'add' );
+
+ if( is_int($res) && $res <=0)
+ throw new Exception(__('@'.$class.' error in update process') ) ;
+ else
+ $messageStack->$function(__('@'.$class.' success in update process') , 'success');
+
+
+ if(isset($_POST['up_and_close']) ){
+ if(!$blokRedirect)
+ tep_redirect(tep_href_link($class::FILENAME));
+ }
+ else {
+ if(!$blokRedirect)
+ tep_redirect(tep_href_link($class::FILENAME, 'cID=' . $class::$Id.'&action=edit'));
+ }
+
+ exit;
+ }
+ catch (Exception $e) {
+ $messageStack->add_session($e->getMessage() , 'error');
+
+ if($class::$Id >0 ){
+ if(!$blokRedirect)
+ tep_redirect(tep_href_link($class::FILENAME, 'cID=' . $class::$class.'&action=edit'));
+ }
+ else{
+ if(!$blokRedirect)
+ tep_redirect(tep_href_link($class::FILENAME));
+ }
+ }
+
+ if(!$blokRedirect)
+ // generic redirect if error
+ tep_redirect(tep_href_link($class::FILENAME) );
+ break;
+
+ default:
+ }
+ }
+
+ /**
+ @fn GenericDisplay()
+ @brief Generic Display for process normal action normalized
+ Use static $action var for choose $action gabarit display
+ @return string
+ */
+ public static function GenericDisplay(){
+
+ $class=self::GetClassName();
+ $action = self::$action;
+
+
+ if(!tep_action_check(self::$action, $class::FILENAME))
+ tep_redirect(tep_href_link($class::FILENAME));
+
+ switch(self::$action){
+ /**
+ @remarks Ajax View result
+ */
+ case 'update_cell':
+ break;
+
+ case 'setflag':
+ if(!is_object($class::$Info))
+ $class::$Info = $class::GetDBValue();
+ $action = '';
+ print $class::RowStatus(array('status'=>(int)$_GET['flag'], 'id'=>(int)$class::$Id));
+ break;
+ case 'viewflag':
+ if(!is_object($class::$Info))
+ $class::$Info = $class::GetDBValue();
+
+ $action = '';
+ print $class::RowHidden(array('hidden'=>(int)$class::$Info->hidden, 'id'=>(int)$class::$Id));
+ break;
+
+ /**
+ @remarks Normal View Page
+ */
+ case 'new_light':
+ case 'new':
+ $action = 'edit';
+ case 'edit':
+ case 'noedit':
+ $action = 'edit';
+ case 'delete':
+ case 'copy_to':
+
+ if(!is_object($class::$Info))
+ $class::$Info = $class::GetDBValue();
+
+ // add default tab for manipulate if not already exist
+ if( count($class::GetListTabs()) == 0 ){
+ $tab = new TabsListeners(
+ __('@'.$class.' tab data') ,
+ MGabCont::CallGab('generic','edit.tab',self::MASTER)
+ );
+
+ $class::AddTabs( $tab );
+ }
+
+ if( $class::$modules !=false ) {
+ $class::$modules->display_edit($contents,$class::$Id);
+ if(is_array($contents))
+ foreach ($contents as $value) {
+
+ $text = '';
+
+ if (isset($value['key']) && $value['text'] =='automatic'){
+ foreach (MGabCont::CallSt('DisplayCol',array('left', $value['key']) ) as $sub){
+ $text .= $class::DisplayField($sub, '', $class::$Info);
+ }
+ }
+ elseif (!empty($value['text']))
+ $text .= $value['text']."\n";
+ else
+ $text .= '<br />';
+
+ $tab = new TabsListeners(
+ $value['title'] ,
+ $text
+ );
+
+ $class::AddTabs( $tab );
+// if(!empty($value['title']))echo '<li><a href="#tabs-'.$g.'">'.$value['title'].'</a></li>'."\n";
+// $g++;
+ }
+ }
+ break;
+
+ break;
+ case 'listing':
+ $action = 'listing';
+ default:
+ }
+
+ return $action;
+ }
+
+ /**
@fn actionFilter()
@brief initiate the execution of the action "filters"
reset and initialization of columns and their filter
@@ -294,12 +583,14 @@
/**
@brief return Fields
@param $key string alias or name of field
+ @param $format default is false , else use format compatible usage printf
+ @param $obj default is false , else Init static var defined in page
@return bool flase or array
*/
- public static function DisplayField($key, $format = '', $obj=false){
+ public static function DisplayField($key, $format = false, $obj=false){
static $tmp;
- if(!tep_not_null($format))
+ if(!$format || empty($format))
$format = '<div class="block_input input-one">%s</div>';
if(!$obj)
Modified: trunk/catalog/admin/includes/classes/ModTwo.php
===================================================================
--- trunk/catalog/admin/includes/classes/ModTwo.php 2014-02-05 06:50:48 UTC (rev 5121)
+++ trunk/catalog/admin/includes/classes/ModTwo.php 2014-02-05 15:18:33 UTC (rev 5122)
@@ -75,9 +75,9 @@
public static $InitInfo=array();
/**
- @var array $modules
+ @var $modules object result AcaFactory
*/
- public static $modules=array();
+ public static $modules;
/**
@var objet $Info
Modified: trunk/catalog/admin/includes/classes/SqlFilesDataDriverClass.php
===================================================================
--- trunk/catalog/admin/includes/classes/SqlFilesDataDriverClass.php 2014-02-05 06:50:48 UTC (rev 5121)
+++ trunk/catalog/admin/includes/classes/SqlFilesDataDriverClass.php 2014-02-05 15:18:33 UTC (rev 5122)
@@ -147,8 +147,6 @@
}
$sqlarray[$key]=implode('|', $list_img);
}
- else
- $sqlarray[$key]='';
}
elseif( preg_match('#(date)#', $key) && isset($data[$key]) ){
$sqlarray[$key] = (date('Y-m-d') < tep_date_raw($data[$key])) ? tep_date_raw($data[$key]).' 00:00:00' : '1000-01-01 00:00:00';
@@ -192,8 +190,6 @@
$sqlarray[$tmpkey]=implode('|', $list_img);
}
- else
- $sqlarray[$key]='';
}
else
foreach($item as $k=>$row){
@@ -217,8 +213,7 @@
@return none
*/
public static function PrepaDataAfterUse( $specimen , $dataarray, $post ){
- self::$sql_array = array();
- self::$sql_array_lg = array();
+
// call specimen and report value for defined key
foreach($specimen as $key=>$item) {
// obtain string value contain in specimen
Modified: trunk/catalog/admin/includes/classes/drivers/sqlcurrencie.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlcurrencie.php 2014-02-05 06:50:48 UTC (rev 5121)
+++ trunk/catalog/admin/includes/classes/drivers/sqlcurrencie.php 2014-02-05 15:18:33 UTC (rev 5122)
@@ -7,15 +7,19 @@
@date 12/01/2014, 08:07
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
- @file sqlcip.php
+ @file sqlcurrencie.php
@dir /admin/includes/classes/drivers/
*/
+
+require_once( DIR_FS_ADMIN . DIR_WS_CLASSES . 'SqlFilesDataDriverClass.php');
+
/**
- @class sqlcip
+ @class sqlcurrencie
@brief manage insert/update/delete in currencies tables
*/
class sqlcurrencie
+ extends SqlFilesDataDriverClass
implements ModSqlDataDriver{
public static $modules;
@@ -37,36 +41,34 @@
*/
public static function create($option){
self::getInstance();
-
+ $specimen = self::Specimen();
$DB=Database::getInstance();
$error = 0;
$DB->beginTransaction();
if( ! isset($option['sqlarray']) )
return false;
- else
- $sqlarray = (array)$option['sqlarray'];
-
- if(!isset($sqlarray['code']))
+ $post=(isset($option['post']) ? $option['post'] : array() );
+ $dataarray =(isset($option['sqlarray'])? $option['sqlarray'] : array() );
+
+ self::PrepaDataAfterUse( $specimen , $dataarray, $post );
+
+
+ $sql_data_array = self::GetSqlArray();
+
+ if(!isset($sql_data_array['code']))
return false;
- $sql_data_array['title'] = tep_db_prepare_input($sqlarray['title']);
- $sql_data_array['code'] = tep_db_prepare_input($sqlarray['code']);
- $sql_data_array['symbol_left'] = (isset($option['symbol_left']) ? tep_db_prepare_input($sqlarray['symbol_left']) : '' );
- $sql_data_array['symbol_right'] = (isset($option['symbol_right']) ? tep_db_prepare_input($sqlarray['symbol_right']) : '' );
- $sql_data_array['decimal_point'] = tep_db_prepare_input($sqlarray['decimal_point']);
- $sql_data_array['thousands_point'] = tep_db_prepare_input($sqlarray['thousands_point']);
- $sql_data_array['decimal_places'] = tep_db_prepare_input($sqlarray['decimal_places']);
- $sql_data_array['value'] = (isset($option['value']) ? tep_db_prepare_input($sqlarray['value']) : 1 );
-// $sql_data_array['last_update'] = tep_db_prepare_input($sqlarray['last_update']);
-
+ if( count($sql_data_array) > 0){
+ $res=tep_db_perform(TABLE_CURRENCIES, $sql_data_array);
- $res=tep_db_perform(TABLE_CURRENCIES, $sql_data_array);
-
- if(!$res)
- $error++;
+ if(!$res){
+ $DB->rollbackTransaction();
+ return false;
+ }
+ }
$id = $res->__get('insertId');
@@ -86,7 +88,7 @@
public static function update($option){
self::getInstance();
$DB=Database::getInstance();
-
+ $specimen = self::Specimen();
$error = 0;
$sql_data_array = array();
@@ -95,26 +97,21 @@
if( ! isset($option['sqlarray']) )
return false;
- else
- $sqlarray = (array)$option['sqlarray'];
-
-
+
+ $post=(isset($option['post']) ? $option['post'] : array() );
+ $dataarray =(isset($option['sqlarray'])? $option['sqlarray'] : array() );
+
+ self::PrepaDataAfterUse( $specimen , $dataarray, $post );
+
+
+ $sql_data_array = self::GetSqlArray();
+
$DB->beginTransaction();
$where ='';
if(isset($option['id'])) $where .="AND currencies_id = '".(int)$option['id']."' ";
-
- if(isset($sqlarray['title'])) $sql_data_array['title'] = tep_db_prepare_input($sqlarray['title']);
- if(isset($sqlarray['code'])) $sql_data_array['code'] = tep_db_prepare_input($sqlarray['code']);
- if(isset($sqlarray['symbol_left'])) $sql_data_array['symbol_left'] = tep_db_prepare_input($sqlarray['symbol_left']);
- if(isset($sqlarray['symbol_right'])) $sql_data_array['symbol_right'] = tep_db_prepare_input($sqlarray['symbol_right']);
- if(isset($sqlarray['decimal_point'])) $sql_data_array['decimal_point'] = tep_db_prepare_input($sqlarray['decimal_point']);
- if(isset($sqlarray['thousands_point'])) $sql_data_array['thousands_point'] = tep_db_prepare_input($sqlarray['thousands_point']);
- if(isset($sqlarray['decimal_places'])) $sql_data_array['decimal_places'] = tep_db_prepare_input($sqlarray['decimal_places']);
- if(isset($sqlarray['value'])) $sql_data_array['value'] = tep_db_prepare_input($sqlarray['value']);
-
-
+
if(count($sql_data_array) > 0) {
$sql_data_array['last_updated'] = 'NOW()';
// $sql_data_array['user_update'] = @$_SESSION['login_id'];
@@ -253,6 +250,18 @@
return $object;
}
+ /**
+ @fn ExtractForm($data)
+ @brief extract data forms for put in db
+ @param $data array
+ @return array
+ */
+ public static function ExtractForm($data){
+ self::getInstance();
+
+ return parent::ExtractDataForm(self::Specimen(), $data);
+ }
+
}
Modified: trunk/catalog/admin/includes/classes/drivers/sqlcustomer.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlcustomer.php 2014-02-05 06:50:48 UTC (rev 5121)
+++ trunk/catalog/admin/includes/classes/drivers/sqlcustomer.php 2014-02-05 15:18:33 UTC (rev 5122)
@@ -11,8 +11,13 @@
*/
-
+require_once( DIR_FS_ADMIN . DIR_WS_CLASSES . 'drivers/sqllinkto.php');
+/**
+ @class sqlcustomer
+ @brief manage db update/insert/delete
+*/
class sqlcustomer
+ extends SqlFilesDataDriverClass
implements ModSqlDataDriver{
public static $modules;
@@ -338,7 +343,8 @@
@return array product empty
*/
public static function Specimen($shortkey=false){
- $par = array( 'customers_id' => '',
+ $par = array(
+ 'customers_id' => '',
'customers_gender' => '',
'customers_firstname' => '',
@@ -377,6 +383,19 @@
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);
+ }
+
+
/**
@fn randomize()
@brief Generate password
Modified: trunk/catalog/admin/includes/classes/drivers/sqlfeatured.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlfeatured.php 2014-02-05 06:50:48 UTC (rev 5121)
+++ trunk/catalog/admin/includes/classes/drivers/sqlfeatured.php 2014-02-05 15:18:33 UTC (rev 5122)
@@ -1,21 +1,24 @@
<?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.2
+ @version 2.2.0
@date 22/09/2013 ,22:50:08
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
- @class sqlfeatured
@file sqlfeatured.php
- @brief manage db update/insert/delete for featured
+ @dir asmin/includes/classes/drivers/
*/
require_once( DIR_FS_ADMIN . DIR_WS_CLASSES . 'SqlFilesDataDriverClass.php');
require_once( DIR_FS_ADMIN . DIR_WS_CLASSES . 'drivers/sqllinkto.php');
-
+/**
+ @class sqlfeatured
+ @brief manage db update/insert/delete for featured
+*/
class sqlfeatured
+ extends SqlFilesDataDriverClass
implements ModSqlDataDriver{
public static $modules;
@@ -39,48 +42,56 @@
self::getInstance();
$DB=Database::getInstance();
$error = 0;
+ $list_languages=tep_get_languages();
+ $specimen = self::Specimen();
+
+
$DB->beginTransaction();
if( ! isset($option['sqlarray']) )
return false;
- else
- $sqlarray = (array)$option['sqlarray'];
+
-
- if(!isset($sqlarray['type']))
- return false;
-
+ $post=(isset($option['post']) ? $option['post'] : array() );
+ $dataarray =(isset($option['sqlarray'])? $option['sqlarray'] : array() );
+
+ self::PrepaDataAfterUse( $specimen , $dataarray, $post );
+
+
+ $sql_data_array = self::GetSqlArray();
+ $sql_data_array_lg = self::GetSqlArrayLg();
- $sql_data_array['k_status_type'] = tep_db_prepare_input($sqlarray['type']);
- $sql_data_array['featured_uniqkey'] = ((isset($sqlarray['key']) && strlen($sqlarray['key'])>5) ? tep_db_prepare_input($sqlarray['key']) :'uniqkey'.rand() );
- $sql_data_array['featured_min'] = (isset($sqlarray['min'])) ? tep_db_prepare_input($sqlarray['min']) :1;
- $sql_data_array['featured_max'] = (isset($sqlarray['max'])) ? tep_db_prepare_input($sqlarray['max']) :5;
- $sql_data_array['featured_status'] = (isset($sqlarray['status'])) ? tep_db_prepare_input($sqlarray['status']) :0;
+
+ if(!isset($sql_data_array['k_status_type']))
+ return false;
+
+ if(count($sql_data_array)>0 || count($sql_data_array_lg)>0 ) {
+ $sql_data_array['date_added'] = 'NOW()';
+ $sql_data_array['user_added'] = @$_SESSION['login_id'];
- $sql_data_array['date_added'] = 'NOW()';
- $sql_data_array['user_added'] = @$_SESSION['login_id'];
+ $res=tep_db_perform(TABLE_FEATURED, $sql_data_array);
- $res=tep_db_perform(TABLE_FEATURED, $sql_data_array);
+ if(!$res){
+ $DB->rollbackTransaction();
+ return false;
+ }
+ }
+ else
+ $error++;
- if(!$res)
- $error++;
-
$id = $res->__get('insertId');
- foreach(tep_get_languages() as $lg) {
+ // language table
+ if( $error <= 0)
+ if(count($sql_data_array_lg['lg']) > 0)
+ foreach($sql_data_array_lg['lg'] as $key=>$sql_data_array){
+ $sql_data_array['featured_id'] = $id;
+ $sql_data_array['languages_id'] = $key;
+ $res=tep_db_perform(TABLE_FEATURED_DESCRIPTION, $sql_data_array );
+ if(!$res)
+ $error++;
+ }
- $row = $sqlarray['langue'];
-
- $sql_data_array_lg = array(
- 'featured_id'=>(int)$id,
- 'languages_id'=>(int)$lg['id'],
- 'featured_title'=> ((isset($row['title'][$lg['id']])) ? tep_db_prepare_input($row['title'][$lg['id']]) : '' ),
- );
- if( ! tep_db_perform(TABLE_FEATURED_DESCRIPTION, $sql_data_array_lg) )
- $error++;
- }
-
-
if( $error > 0){
$DB->rollbackTransaction();
return false;
@@ -100,12 +111,13 @@
$DB=Database::getInstance();
$error = 0;
-
+ $list_languages=tep_get_languages();
+ $specimen = self::Specimen();
+
if(!isset($option['id']))
return false;
-
- $DB->beginTransaction();
-
+
+
$where ='';
$where_lg ='';
if(isset($option['id'])){
@@ -117,46 +129,42 @@
if( ! isset($option['sqlarray']) )
return false;
- else
- $sqlarray = (array)$option['sqlarray'];
- if(isset($option['post'])){
- $post=$option['post'];
- }
+
+ $post=(isset($option['post']) ? $option['post'] : array() );
+ $dataarray =(isset($option['sqlarray'])? $option['sqlarray'] : array() );
+
+ self::PrepaDataAfterUse( $specimen , $dataarray, $post );
+
+
+ $sql_data_array = self::GetSqlArray();
+ $sql_data_array_lg = self::GetSqlArrayLg();
+
+ $DB->beginTransaction();
- if(isset($sqlarray['new_type']))$sql_data_array['k_status_type'] = tep_db_prepare_input($sqlarray['new_type']);
- if(isset($sqlarray['featured_uniqkey']) && !empty($sqlarray['featured_uniqkey'])) $sql_data_array['featured_uniqkey'] = tep_db_prepare_input($sqlarray['featured_uniqkey']);
- if(isset($sqlarray['min']))$sql_data_array['featured_min'] = tep_db_prepare_input($sqlarray['min']);
- if(isset($sqlarray['max'])) $sql_data_array['featured_max'] = (int)tep_db_prepare_input($sqlarray['max']);
- if(isset($sqlarray['status'])) $sql_data_array['featured_status'] = (int)tep_db_prepare_input($sqlarray['status']);
+ if(count($sql_data_array)>0 || count($sql_data_array_lg)>0 ) {
+ $sql_data_array['date_update'] = 'NOW()';
+ $sql_data_array['user_update'] = @$_SESSION['login_id'];
- $sql_data_array['date_update'] = 'NOW()';
- $sql_data_array['user_update'] = @$_SESSION['login_id'];
+ if( ! tep_db_perform(TABLE_FEATURED, $sql_data_array, 'update' , substr($where,3) ) )
+ $error++;
+ }
- if( ! tep_db_perform(TABLE_FEATURED, $sql_data_array, 'update' , substr($where,3) ) )
- $error++;
+ // language table
+ if( $error <= 0)
+ if(count($sql_data_array_lg['lg']) > 0)
+ foreach($sql_data_array_lg['lg'] as $key=>$sql_data_array){
+ $wh = $where_lg;
+ $wh .= "AND languages_id = '".(int)$key."' ";
+ unset($sql_data_array['language_id']);
+
+ $res=tep_db_perform(TABLE_FEATURED_DESCRIPTION, $sql_data_array, 'update', substr($wh,3) );
+ if(!$res)
+ $error++;
+ }
- foreach(tep_get_languages() as $lg) {
-
- $row = $post['langue'];
-
- $where_lg .= "AND languages_id = '".(int)$lg['id']."' ";
-
- $sql_data_array_lg = array();
-
- if(isset($row['title'][$lg['id']]) && is_array($row['title']) )
- $sql_data_array_lg['featured_title'] = ((!empty($row['title'][$lg['id']])) ? tep_db_prepare_input($row['title'][$lg['id']]) : '' );
- elseif(isset($post['featured_title']) && is_string($post['featured_title']) )
- $sql_data_array_lg['featured_title'] = ((!empty($post['featured_title'])) ? tep_db_prepare_input($post['featured_title']) : '' );
-
- if( count($sql_data_array_lg) > 0)
- if( ! tep_db_perform(TABLE_FEATURED_DESCRIPTION, $sql_data_array_lg, 'update' , substr($where_lg,3)) )
- $error++;
-
- }
-
if( $error > 0){
$DB->rollbackTransaction();
return false;
@@ -288,6 +296,19 @@
@return array product empty
*/
public static function Specimen($shortkey=false){
+
+ $tmp_lg = array();
+ $ListLanguages = tep_get_languages();
+ for ($i=0, $n=sizeof($ListLanguages); $i<$n; $i++) {
+ $tp = array(
+ 'featured_title' => '', // depend language table
+ 'featured_title' => '', // depend language table
+ 'language_id' => $ListLanguages[$i]['id'],
+ );
+
+ $tmp_lg[$ListLanguages[$i]['id']] = ((!$shortkey)? $tp : self::CleanKey($tp));
+ }
+
$par = array(
'row_id' => '',
'featured_uniqkey' => '',
@@ -295,19 +316,12 @@
'featured_min' => 1,
'featured_max' => 10,
'featured_status' => '',
+
+ // language table
+ 'lg' =>$tmp_lg,
);
- foreach(tep_get_languages() as $lg){
- $obj = ((!$shortkey)? array('featured_title'=>'') : self::CleanKey(array('featured_title'=>'')));
- foreach($obj as $k=>$r) {
- $par['langue'][$k][$lg['id']] = $r;
- $par['lg'][$lg['id']][$k] = $r; // old, not use
- }
-
- }
-
-
return ((!$shortkey)? $par : self::CleanKey($par));
}
@@ -318,24 +332,36 @@
@brief Clean string name key
*/
public static function CleanKey($array){
- self::getInstance();
- $object= new stdclass();
+ self::getInstance();
+ $object= new stdclass();
- foreach($array as $key=>$value){
- if( strpos($key,'row_') ===0)
- $key=substr($key,strlen('row_'));
- elseif( strpos($key,'featured_') ===0)
- $key=substr($key,strlen('featured_'));
- elseif( strpos($key,'k_status_') ===0)
- $key=substr($key,strlen('k_status_'));
+ foreach($array as $key=>$value){
+ if( strpos($key,'row_') ===0)
+ $key=substr($key,strlen('row_'));
+ elseif( strpos($key,'featured_') ===0)
+ $key=substr($key,strlen('featured_'));
+ elseif( strpos($key,'k_status_') ===0)
+ $key=substr($key,strlen('k_status_'));
- $object->$key = $value;
- }
+ $object->$key = $value;
+ }
- return $object;
+ return $object;
}
/**
+ @fn ExtractForm($data)
+ @brief extract data forms for put in db
+ @param $data array
+ @return array
+ */
+ public static function ExtractForm($data){
+ self::getInstance();
+// self::Specimen();
+ return parent::ExtractDataForm(self::Specimen(), $data);
+ }
+
+ /**
@brief Function link to for contruct link featured vs datatype
@note normlised methode used in childs datatype
*/
Modified: trunk/catalog/admin/includes/classes/drivers/sqlnavigation_links.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlnavigation_links.php 2014-02-05 06:50:48 UTC (rev 5121)
+++ trunk/catalog/admin/includes/classes/drivers/sqlnavigation_links.php 2014-02-05 15:18:33 UTC (rev 5122)
@@ -1,21 +1,26 @@
<?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 10/05/2012 ,17:48:30
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
- @class sqlnavigation_links
@file sqlnavigation_links.php
- @brief manage db update/insert/delete for navigation_links
+ @dir admin/includes/classes/drivers/
*/
+require_once( DIR_FS_ADMIN . DIR_WS_CLASSES . 'SqlFilesDataDriverClass.php');
+/**
+ @class sqlnavigation_links
+ @brief manage db update/insert/delete for navigation_links
+*/
class sqlnavigation_links
+ extends SqlFilesDataDriverClass
implements ModSqlDataDriver{
public static $modules;
@@ -39,20 +44,20 @@
self::getInstance();
$DB=Database::getInstance();
$error= 0;
+ $specimen = self::Specimen();
+
+
+ $post=(isset($option['post']) ? $option['post'] : array() );
+ $dataarray =(isset($option['sqlarray'])? $option['sqlarray'] : array() );
+
+ self::PrepaDataAfterUse( $specimen , $dataarray, $post );
+
+
+ $sql_data_array = self::GetSqlArray();
+ $sql_data_array_lg = self::GetSqlArrayLg();
+
$DB->beginTransaction();
- if(isset($option['sqlarray']))
- $sqlarray=$option['sqlarray'];
-
- $sql_data_array['nav_mode'] = (isset($sqlarray['mode'])) ? tep_db_prepare_input($sqlarray['mode']) :'2';
- $sql_data_array['nav_link_type'] = (isset($sqlarray['type'])) ? tep_db_prepare_input($sqlarray['type']) :'0';
- $sql_data_array['nav_link_status'] = (isset($sqlarray['status'])) ? tep_db_prepare_input($sqlarray['status']) :'0';
- $sql_data_array['parent_id'] = (isset($sqlarray['parent_id'])) ? tep_db_prepare_input($sqlarray['parent_id']) :'0';
- $sql_data_array['customers_status'] = (isset($sqlarray['customers_status'])) ? tep_db_prepare_input($sqlarray['customers_status']) :'0';
- $sql_data_array['nav_sort_order'] = (isset($sqlarray['sort_order'])) ? tep_db_prepare_input($sqlarray['sort_order']) :'0';
- $sql_data_array['nav_css_id'] = (isset($sqlarray['css_id'])) ? tep_db_prepare_input($sqlarray['css_id']) :'';
- $sql_data_array['nav_file'] = (isset($sqlarray['file'])) ? tep_db_prepare_input($sqlarray['file']) :'';
-
try{
if( count($sql_data_array) <= 0 )
throw new Exception("no data");
@@ -70,21 +75,18 @@
throw new Exception("in sql update");
+ if(count($sql_data_array_lg['lg']) > 0)
+ foreach($sql_data_array_lg['lg'] as $key=>$sql_data_array){
+ $where_lg .= "AND languages_id = '".(int)$key."' ";
+ $sql_data_array['language_id'] = $key;
+ $sql_data_array['nav_link_id'] = $id;
+
+ $res=tep_db_perform(TABLE_NAVIGATION_LINKS_DESCRIPTION, $sql_data_array );
+ if(!$res)
+ $error++;
+ }
- foreach(tep_get_languages() as $lg) {
- $row = $option['langue'];
-
- $sql_data_array_lg = array(
- 'nav_link_id'=> (int)$id,
- 'language_id'=> (int)$lg['id'],
- 'nav_name'=> ((isset($row['title'][$lg['id']])) ? tep_db_prepare_input($row['title'][$lg['id']]) : '' ),
- );
-
- if( ! tep_db_perform(TABLE_NAVIGATION_LINKS_DESCRIPTION, $sql_data_array_lg) )
- throw new Exception("in sql create TABLE_NAVIGATION_LINKS_DESCRIPTION");
- }
-
}
catch(Exception $e){
// print_r($e);
@@ -110,75 +112,64 @@
self::getInstance();
$DB=Database::getInstance();
$error= 0;
-
+ $specimen = self::Specimen();
+
+
if(!isset($option['id']))
- return 'id';
-
+ return false;
+
+ $post=(isset($option['post']) ? $option['post'] : array() );
+ $dataarray =(isset($option['sqlarray'])? $option['sqlarray'] : array() );
+
+ self::PrepaDataAfterUse( $specimen , $dataarray, $post );
+
+
+ $sql_data_array = self::GetSqlArray();
+ $sql_data_array_lg = self::GetSqlArrayLg();
+
+
$DB->beginTransaction();
$where ='';
- if(isset($option['id'])) $where .="AND nav_link_id = '".(int)$option['id']."' ";
+ $where_lg = '';
+ if(isset($option['id'])) $where .= $where_lg = "AND nav_link_id = '".(int)$option['id']."' ";
if(isset($option['type'])) $where .="AND nav_link_type = '".(int)$option['type']."' ";
if(isset($option['status'])) $where .="AND nav_link_status = '".(int)$option['status']."' ";
if(isset($option['mode'])) $where .="AND nav_mode = '".(int)$option['mode']."' ";
- if(isset($option['post']))
- $post=$option['post'];
- if(isset($option['sqlarray']))
- $sqlarray=$option['sqlarray'];
-
- if(isset($sqlarray['type'])) $sql_data_array['nav_link_type'] = tep_db_prepare_input($sqlarray['type']);
- if(isset($sqlarray['status'])) $sql_data_array['nav_link_status'] = tep_db_prepare_input($sqlarray['status']);
- if(isset($sqlarray['mode'])) $sql_data_array['nav_mode'] = tep_db_prepare_input($sqlarray['mode']);
- if(isset($sqlarray['parent_id'])) $sql_data_array['parent_id'] = (int)tep_db_prepare_input($sqlarray['parent_id']);
- if(isset($sqlarray['css_id'])) $sql_data_array['nav_css_id'] = (int)tep_db_prepare_input($sqlarray['css_id']);
- if(isset($sqlarray['customers_status']))$sql_data_array['customers_status'] = (int)tep_db_prepare_input($sqlarray['customers_status']);
- if(isset($sqlarray['sort_order'])) $sql_data_array['nav_sort_order'] = (int)tep_db_prepare_input($sqlarray['sort_order']);
- if(isset($sqlarray['file'])) $sql_data_array['nav_file'] = tep_db_prepare_input($sqlarray['file']);
-
-
if(count((array)$sql_data_array)> 0){
+
if( ! tep_db_perform(TABLE_NAVIGATION_LINKS, $sql_data_array, 'update' , substr($where,3) ) )
$error++;
+ if( $error <= 0){
+ $res = $DB->query("SELECT nav_link_id as id FROM " . TABLE_NAVIGATION_LINKS ." WHERE ". substr($where, 3 ).' LIMIT 1' );
+ $result = $res->fetchAssoc();
- $res = $DB->query("SELECT nav_link_id as id FROM " . TABLE_NAVIGATION_LINKS ." WHERE ". substr($where, 3 ).' LIMIT 1' );
- $result = $res->fetchAssoc();
+ $sql_data_array = array();
+ $sql_data_array['nav_cpath'] = self::GetcPath($result['id']);
- $sql_data_array = array();
- $sql_data_array['nav_cpath'] = self::GetcPath($result['id']);
-
- if( ! tep_db_perform(TABLE_NAVIGATION_LINKS, $sql_data_array, 'update' , " nav_link_id = '".$result['id']."' " ) )
- $error++;
+ if( ! tep_db_perform(TABLE_NAVIGATION_LINKS, $sql_data_array, 'update' , " nav_link_id = '".$result['id']."' " ) )
+ $error++;
+ }
}
- foreach(tep_get_languages() as $lg) {
+ // language table
+ if( $error <= 0)
+ if(count($sql_data_array_lg['lg']) > 0)
+ foreach($sql_data_array_lg['lg'] as $key=>$sql_data_array){
+
+ $wh = $where_lg;
+ $wh .= "AND language_id = '".(int)$key."' ";
+ unset($sql_data_array['language_id']);
- $where_lg = $where. "AND language_id = '".(int)$lg['id']."' ";
- $sql_data_array = array();
+ $res=tep_db_perform(TABLE_NAVIGATION_LINKS_DESCRIPTION, $sql_data_array, 'update', substr($wh,3) );
+ if(!$res)
+ $error++;
+ }
- if(isset($option['langue'] )){
- $row = $option['langue'];
- if(isset($row['name'][$lg['id']]))
- $sql_data_array['nav_name'] = tep_db_prepare_input($row['name'][$lg['id']]) ;
- }
- elseif(isset($post['name']) ){
- $sql_data_array['nav_name'] = tep_db_prepare_input($option['name']) ;
- }
-
-
-
-
-
- if(count((array)$sql_data_array)> 0)
- if( !tep_db_perform(TABLE_NAVIGATION_LINKS_DESCRIPTION, $sql_data_array, 'update' , substr($where_lg,3)) )
- $error++;
-
- }
-
-
if( $error > 0){
$DB->rollbackTransaction();
return false;
@@ -321,6 +312,18 @@
@return array product empty
*/
public static function Specimen($shortkey=false){
+
+ $tmp_lg = array();
+ $ListLanguages = tep_get_languages();
+ for ($i=0, $n=sizeof($ListLanguages); $i<$n; $i++) {
+ $tp = array(
+ 'nav_name' => '', // depend language table
+ 'language_id' => $ListLanguages[$i]['id'],
+ );
+
+ $tmp_lg[$ListLanguages[$i]['id']] = ((!$shortkey)? $tp : self::CleanKey($tp));
+ }
+
$par = array(
'nav_link_id' => '',
'nav_mode' => 2, // 1,2
@@ -329,8 +332,11 @@
'nav_file' => '',
'nav_link_type' => 1,
'customers_status' => '',
- 'nav_link_status' => 1,
+ 'nav_link_status' => 0,
'parent_id' => 0,
+
+ // language table
+ 'lg' =>$tmp_lg,
);
foreach(tep_get_languages() as $lg){
@@ -340,8 +346,18 @@
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){
+ self::getInstance();
+// self::Specimen();
+ return parent::ExtractDataForm(self::Specimen(), $data);
+ }
-
/**
@fn CleanKey()
@brief Clean string name key
Modified: trunk/catalog/admin/includes/classes/drivers/sqlproduct.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlproduct.php 2014-02-05 06:50:48 UTC (rev 5121)
+++ trunk/catalog/admin/includes/classes/drivers/sqlproduct.php 2014-02-05 15:18:33 UTC (rev 5122)
@@ -140,10 +140,7 @@
$sql_data_array = self::GetSqlArray();
$sql_data_array_lg = self::GetSqlArrayLg();
- // clean return date
- unset( $sql_data_array['date_added'] );
- unset( $sql_data_array['last_modified'] );
-
+
if(( $origin = self::fetch(array('id'=>$products_id), true) ) && !$origin )
$action = 'insert_product';
else
@@ -164,10 +161,12 @@
if(count($sql_data_array) > 0 || count($sql_data_array_lg) ){
$sql_data_array['products_last_modified'] ='now()';
$sql_data_array = array_merge($sql_data_array, $modules->get_update_table_products());
+
if( ! tep_db_perform(TABLE_PRODUCTS, $sql_data_array, 'update',"products_id = '" . (int)$products_id . "'") )
$error++;
}
-
+
+
// language table
if( $error <= 0)
if(isset($sql_data_array_lg['lg']) && count($sql_data_array_lg['lg']) > 0){
@@ -209,6 +208,7 @@
}
}
}
+
/*
Use transversal Datatype Rootlisting and update in data
@@ -222,6 +222,7 @@
}
}
+
if($error ==0 ) {
/// Separate Pricing Per Customer
$customers_group_query = $DB->query("select customers_group_id, customers_group_name from " . TABLE_CUSTOMERS_GROUPS . " where customers_group_id != '0' order by customers_group_id");
Modified: trunk/catalog/admin/includes/gabarit/MGabCont/display_view.edit.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/MGabCont/display_view.edit.gab 2014-02-05 06:50:48 UTC (rev 5121)
+++ trunk/catalog/admin/includes/gabarit/MGabCont/display_view.edit.gab 2014-02-05 15:18:33 UTC (rev 5122)
@@ -2,14 +2,15 @@
/**
@licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
@package osCSS-2 <www http://www.oscss.org>
- @version 2.1.2
+ @version 2.2.0
@date 19/10/2013, 09:17
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
+ @file display_view.edit.gab
+ @dir admin/includes/gabarit/featureds/
*/
$page= MGabCont::CallSt('GetClassName');
-
?>
<h3><?php echo __('@'.$page.' heading title edit'); ?></h3>
@@ -33,49 +34,21 @@
<div id="tabs">
<ul>
- <li><a href="#tabs-1"><?php echo __('@'.$page.' tab data'); ?></a></li>
- <?php
- if(isset($page::$modules ) ) {
- $g=6;
- $page::$modules->display_edit($contents,@$cID);
- if(is_array($contents))
- foreach ($contents as $value) {
- if(!empty($value['title']))echo '<li><a href="#tabs-'.$g.'">'.$value['title'].'</a></li>'."\n";
- $g++;
- }
- }
- ?>
+ <?php $g = 0; foreach($page::GetListTabs() as $objTabs ): $g++; ?>
+ <li><a href="#tabs-<?php echo $g ?>"><?php echo $objTabs->GetTitle(); ?></a></li>
+ <?php endforeach; ?>
</ul>
<div class="edit box_left w_70" >
- <div id="tabs-1" class="tabPage">
- <?php foreach (MGabCont::CallSt('DisplayCol','left') as $value): ?>
- <?php echo $page::DisplayField($value, '', $page::$Info); ?>
- <?php endforeach; ?>
- </div>
- <?php
- $g=6;
- if(isset($contents) && is_array($contents)){
- reset($contents);
- foreach ($contents as $value) {
- echo '<div id="tabs-'.$g.'" class="tabPage">'."\n";
- if (isset($value['key']) && $value['text'] =='automatic'){
- foreach (MGabCont::CallSt('DisplayCol',array('left', $value['key']) ) as $sub){
- echo $page::DisplayField($sub, '', $page::$Info);
- }
- }
- elseif (!empty($value['text']))
- echo $value['text']."\n";
- else echo '<br />';
-
- echo '<div class="separator"></div></div>'."\n";
- $g++;
- }
- }
- ?>
-
+ <?php $g = 0; foreach($page::GetListTabs() as $objTabs ): $g++; ?>
+ <div id="tabs-<?php echo $g ?>" class="tabPage">
+ <div class="block_form">
+ <?php echo $objTabs->GetContent(); ?>
+ </div>
+ </div>
+ <?php endforeach; ?>
<div class="separator"></div>
</div>
Added: trunk/catalog/admin/includes/gabarit/MGabCont/edit.tab.generic.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/MGabCont/edit.tab.generic.gab (rev 0)
+++ trunk/catalog/admin/includes/gabarit/MGabCont/edit.tab.generic.gab 2014-02-05 15:18:33 UTC (rev 5122)
@@ -0,0 +1,18 @@
+<?php
+/**
+ @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 14/10/2013 ,17:48:30
+ @author oscim <mail os...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+ @file edit.tab.generic.gab
+ @dir admin/includes/gabarit/MGabCont/
+*/
+$page= MGabCont::CallSt('GetClassName');
+?>
+
+<?php foreach (MGabCont::CallSt('DisplayCol','left') as $value): ?>
+ <?php echo $page::DisplayField($value, false, $page::$Info); ?>
+<?php endforeach; ?>
Deleted: trunk/catalog/admin/includes/gabarit/countries/display_view.edit.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/countries/display_view.edit.gab 2014-02-05 06:50:48 UTC (rev 5121)
+++ trunk/catalog/admin/includes/gabarit/countries/display_view.edit.gab 2014-02-05 15:18:33 UTC (rev 5122)
@@ -1,92 +0,0 @@
-<?php
-/**
- @licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
- @portion code Copyright (c) 2002 osCommerce
- @package osCSS-2 <www http://www.oscss.org>
- @version 2.1.2
- @date 10/10/2013, 10:30
- @author oscim <mail aur...@os...> <www http://www.oscim.fr>
- @encode UTF-8
-*/
-?>
-<h3><?php echo __('heading title edit'); ?></h3>
-
-<div class="box_uniq block_form">
-
-
- <div id="tabs">
- <ul>
- <li><a href="#tabs-1"><?php echo __('countries tab specification'); ?></a></li>
- <?php if(_cst_bool('ACCOUNT_STATE')) : ?>
- <li><a href="#tabs-2"><?php echo __('countries tab state'); ?></a></li>
- <?php endif; ?>
- </ul>
-
-
- <div id="tabs-1" class="tabPage">
-
- <?php echo tep_draw_form('categories', countries::FILENAME, 'action='.((countries::$action == 'new')?'insert' : 'update&cID='.$_GET['cID']), 'post') ?>
-
- <fieldset class="block_fieldset">
-
- <?php echo countries::DisplayField('name'); ?>
-
- <?php echo countries::DisplayField('localname'); ?>
-
- <?php echo countries::DisplayField('iso_code_2'); ?>
-
- <?php echo countries::DisplayField('iso_code_3'); ?>
-
- <?php echo countries::DisplayField('address_format'); ?>
-
-
- <p class="block_input button_nav">
- <?php
- echo tep_image_submit('', IMAGE_UPDATE) /*. tep_image_submit('', IMAGE_UPDATE_AND_CLOSE,' name="up_and_close"' )*/;
- echo tep_js_back(tep_href_link(countries::FILENAME), IMAGE_CANCEL) ;
- ?>
- </p>
-
- </fieldset>
- </form>
- </div>
-
-
- <?php if(_cst_bool('ACCOUNT_STATE')) : ?>
- <div id="tabs-2" class="tabPage">
- <div class="button_nav">
- <?php echo '<a class="button fancy" href="' . tep_href_link(countries::FILENAME,'action=new_zone&cID='.countries::$Id) . '">' .tep_image(DIR_WS_ICONS.'icon_add_new.png',IMAGE_INSERT ) . __('image insert zone') . '</a>'; ?>
- </div>
-
- <table class="dataTable">
- <thead>
- <tr>
- <th><?php echo __('table heading zone name') ?></th>
- <th class="tcenter"><?php echo __('table heading zone code') ?></th>
- <th class="tright" style="width:100px"><?php echo __('table heading action'); ?></th>
- </tr>
- </thead>
- <tbody>
- <?php if(countries::$Info->childs !=false)
- foreach(countries::$Info->childs as $zones) : ?>
- <tr class="view parent " >
- <td><?php echo $zones->name; ?></td>
- <td class="tcenter"><?php echo $zones->code; ?></td>
- <td>
- <span class="view fils fright">
- <?php
- echo '<a class="buttonimg fancy" href="' . tep_href_link(countries::FILENAME, 'cID='.countries::$Id.'&id=' . $zones->id . '&action=edit_zone') . '">' . tep_image(DIR_WS_ICONS . 'icon_edit.png',IMAGE_EDIT ) . '</a> ';
- echo '<a class="buttonimg fancy" href="' . tep_href_link(countries::FILENAME, 'cID='.countries::$Id.'&id=' . $zones->id . '&action=delete_zone') . '">' . tep_image(DIR_WS_ICONS . 'icon_delete.png',IMAGE_DELETE ) . '</a>';
- ?>
- </span>
- </td>
- </tr>
- <?php endforeach; ?>
- </tbody>
- </table>
- </div>
- <?php endif; ?>
- <br class="clear" />
- </div>
-
-</div>
Added: trunk/catalog/admin/includes/gabarit/countries/edit.tab.state.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/countries/edit.tab.state.gab (rev 0)
+++ trunk/catalog/admin/includes/gabarit/countries/edit.tab.state.gab 2014-02-05 15:18:33 UTC (rev 5122)
@@ -0,0 +1,46 @@
+<?php
+/**
+ @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 14/10/2013 ,17:48:30
+ @author oscim <mail os...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+ @file edit.tab.state.gab
+ @dir admin/includes/gabarit/countries/
+*/
+?>
+
+<div class="button_nav">
+<?php echo '<a class="button fancy" href="' . tep_href_link(countries::FILENAME,'action=new_zone&cID='.countries::$Id) . '">' .tep_image(DIR_WS_ICONS.'icon_add_new.png',IMAGE_INSERT ) . __('image insert zone') . '</a>'; ?>
+</div>
+
+<table class="dataTable">
+ <thead>
+ <tr>
+ <th><?php echo __('table heading zone name') ?></th>
+ <th class="tcenter"><?php echo __('table heading zone code') ?></th>
+ <th class="tright" style="width:100px"><?php echo __('table heading action'); ?></th>
+ </tr>
+ </thead>
+ <tbody>
+ <?php if(countries::$Info->childs !=false)
+ foreach(countries::$Info->childs as $zones) : ?>
+ <tr class="view parent " >
+ <td><?php echo $zones->name; ?></td>
+ <td class="tcenter"><?php echo $zones->code; ?></td>
+ <td>
+ <span class="view fils fright">
+ <?php
+echo '<a class="buttonimg fancy" href="' . tep_href_link(countries::FILENAME, 'cID='.countries::$Id.'&id=' . $zones->id . '&action=edit_zone') . '">' . tep_image(DIR_WS_ICONS . 'icon_edit.png',IMAGE_EDIT ) . '</a> ';
+echo '<a class="buttonimg fancy" href="' . tep_href_link(countries::FILENAME, 'cID='.countries::$Id.'&id=' . $zones->id . '&action=delete_zone') . '">' . tep_image(DIR_WS_ICONS . 'icon_delete.png',IMAGE_DELETE ) . '</a>';
+ ?>
+ </span>
+ </td>
+ </tr>
+ <?php endforeach; ?>
+ </tbody>
+</table>
+
+
Deleted: trunk/catalog/admin/includes/gabarit/featureds/display_view.delete.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/featureds/display_view.delete.gab 2014-02-05 06:50:48 UTC (rev 5121)
+++ trunk/catalog/admin/includes/gabarit/featureds/display_view.delete.gab 2014-02-05 15:18:33 UTC (rev 5122)
@@ -1,34 +0,0 @@
-<?php
-/**
- @licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
- @portion code Copyright (c) 2002 osCommerce
- @package osCSS-2 <www http://www.oscss.org>
- @version 2.1.1
- @date 22/04/2012 ,22:50:08
- @author genrated by GenerCode
- @encode UTF-8
-*/
-?>
-<h3><?php echo __('@featureds heading title delete featured'); ?></h3>
-
-
-<div class="box_uniq block_form">
-
-
- <?php echo tep_draw_form('zone', featureds::FILENAME, 'action=delete_confirm', 'post') ?>
-
-
- <p class="block_input button_nav">
- <?php
- echo tep_draw_hidden_field('cID', '', featureds::$Id);
-
- echo tep_image_submit('button_delete.gif', IMAGE_DELETE);
- echo tep_js_back(tep_href_link(featureds::FILENAME), IMAGE_CANCEL) ;
- ?>
- </p>
- </form>
- </div>
-
- <br class="clear" />
-
-</div>
Deleted: trunk/catalog/admin/includes/gabarit/featureds/display_view.edit.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/featureds/display_view.edit.gab 2014-02-05 06:50:48 UTC (rev 5121)
+++ trunk/catalog/admin/includes/gabarit/featureds/display_view.edit.gab 2014-02-05 15:18:33 UTC (rev 5122)
@@ -1,94 +0,0 @@
-<?php
-/**
- @licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
- @portion code Copyright (c) 2002 osCommerce
- @package osCSS-2 <www http://www.oscss.org>
- @version 2.1.2
- @date 22/09/2013 ,22:50:08
- @author genrated by GenerCode
- @encode UTF-8
-*/
-?>
-<h3><?php echo __('heading title edit'); ?></h3>
-
-<div class="box_uniq block_form">
-<?php echo tep_draw_form('featureds', featureds::FILENAME, 'action='.((featureds::$action == 'new')?'insert' : 'update&cID='.$_GET['cID']), 'post') ?>
-
- <div id="tabs">
- <ul>
- <li><a href="#tabs-1"><?php echo __('@featureds tab specification'); ?></a></li>
- <li><a href="#tabs-2"><?php echo __('@featureds tab childs'); ?></a></li>
- </ul>
-
- <div class="edit">
- <div id="tabs-1" class="tabPage">
- <?php echo featureds::DisplayField('title', '%s'); ?>
-
- <p class="block_input">
- <?php echo featureds::DisplayField('uniqkey', '%s'); ?>
- </p>
-
- <p class="block_input">
- <?php echo featureds::DisplayField('type', '%s'); ?>
- </p>
-
- <p class="block_input">
- <?php echo featureds::DisplayField('min', '%s'); ?>
- </p>
-
- <p class="block_input">
- <?php echo featureds::DisplayField('max', '%s'); ?>
- </p>
-
- <!-- <p class="block_input">
- <Label><?php //echo __('text info featureds visible') ?></label>
- <?php //echo tep_draw_radio_field('featureds_visible', 'featureds_visible_1', '1', $featureds_visible_Y) . ' ' . VISIBLE_YES . ' ' . tep_draw_radio_field('featureds_visible', 'featureds_visible_0', '0', $featureds_visible_N) . ' ' . VISIBLE_NO ?>
- </p>-->
-
-
- <p class="block_input button_nav">
- <?php
- echo tep_image_submit('', IMAGE_UPDATE) /*. tep_image_submit('', IMAGE_UPDATE_AND_CLOSE,' name="up_and_close"' )*/;
- echo tep_js_back(tep_href_link(featureds::FILENAME), IMAGE_CANCEL) ;
- ?>
- </p>
- <br class="clear" />
- </div>
-
-
- <div id="tabs-2" class="tabPage">
-
- <table class="dataTable">
- <thead>
- <tr>
- <th><?php echo __('@featureds table heading datatype') ?></th>
- <th><?php echo __('@featureds table heading datatype id') ?></th>
- <th><?php echo __('@featureds table heading date added') ?></th>
- <th><?php echo __('@featureds table heading user added') ?></th>
- </tr>
- </thead>
- <tbody>
- <?php if(is_array(featureds::$Info->listchilds)) foreach(featureds::$Info->listchilds as $row): ?>
- <tr>
- <td class="tcenter"><?php echo $row->datatype ?></td>
- <td class="tcenter">
- <strong>
- <a href="<?php //echo featureds::HrefLink($row->datatype_id, 'edit', $row->datatype) ?>" ><?php echo $row->datatype_id ?></a>
- </strong>
- </td>
- <td class="tcenter"><?php echo tep_date_short($row->date_added) ?></td>
- <td class="tcenter"><?php echo $row->user_added ?></td>
- </tr>
- <?php endforeach; ?>
- </tbody>
- </table>
-
- <br class="clear" />
- </div>
-
- </div>
-
-
- </div>
-</form>
-</div>
Added: trunk/catalog/admin/includes/gabarit/featureds/edit.tab.childs.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/featureds/edit.tab.childs.gab (rev 0)
+++ trunk/catalog/admin/includes/gabarit/featureds/edit.tab.childs.gab 2014-02-05 15:18:33 UTC (rev 5122)
@@ -0,0 +1,39 @@
+<?php
+/**
+ @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 14/10/2013 ,17:48:30
+ @author oscim <mail os...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+ @file edit.tab.childs.gab
+ @dir admin/includes/gabarit/featureds/
+*/
+?>
+
+<table class="dataTable">
+ <thead>
+ <tr>
+ <th><?php echo __('@featureds table heading datatype') ?></th>
+ <th><?php echo __('@featureds table heading datatype id') ?></th>
+ <th><?php echo __('@featureds table heading date added') ?></th>
+ <th><?php echo __('@featureds table heading user added') ?></th>
+ </tr>
+ </thead>
+ <tbody>
+ <?php foreach(featureds::$Info->listchilds as $row): ?>
+ <tr>
+ <td class="tcenter"><?php echo $row->datatype ?></td>
+ <td class="tcenter">
+ <strong>
+ <a href="<?php //echo featureds::HrefLink($row->datatype_id, 'edit', $row->datatype) ?>" ><?php echo $row->datatype_id ?></a>
+ </strong>
+ </td>
+ <td class="tcenter"><?php echo tep_date_short($row->date_added) ?></td>
+ <td class="tcenter"><?php echo $row->user_added ?></td>
+ </tr>
+ <?php endforeach; ?>
+ </tbody>
+</table>
+
Deleted: trunk/catalog/admin/includes/gabarit/navigation_links/display_view.delete.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/navigatio...
[truncated message content] |
|
From: <os...@us...> - 2014-02-05 06:50:52
|
Revision: 5121
http://sourceforge.net/p/oscss/svn/5121
Author: oscim
Date: 2014-02-05 06:50:48 +0000 (Wed, 05 Feb 2014)
Log Message:
-----------
Fix an dupgrade code
Modified Paths:
--------------
trunk/extensions/PAYPAL_IPN_stable/catalog/admin/includes/languages/fr_FR/modules/payment/paypal_ipn/paypal_ipn.txt
trunk/extensions/PAYPAL_IPN_stable/catalog/admin/includes/modules/payment/paypal_ipn/paypal_ipn.php
Modified: trunk/extensions/PAYPAL_IPN_stable/catalog/admin/includes/languages/fr_FR/modules/payment/paypal_ipn/paypal_ipn.txt
===================================================================
--- trunk/extensions/PAYPAL_IPN_stable/catalog/admin/includes/languages/fr_FR/modules/payment/paypal_ipn/paypal_ipn.txt 2014-02-04 23:53:36 UTC (rev 5120)
+++ trunk/extensions/PAYPAL_IPN_stable/catalog/admin/includes/languages/fr_FR/modules/payment/paypal_ipn/paypal_ipn.txt 2014-02-05 06:50:48 UTC (rev 5121)
@@ -18,5 +18,37 @@
$lang['module payment paypal ipn text last confirm']="Paiment par carte bancaire ou compte paypal" ;
-
+/* Configuration */
+$lang['MODULE_PAYMENT_PAYPAL_IPN_ICON_S']="Icone pour ce mode paiement" ;
+$lang['MODULE_PAYMENT_PAYPAL_IPN_ICON_L']="Choix d'un icone" ;
+$lang['MODULE_PAYMENT_PAYPAL_IPN_EWP_OPENSSL_S']="OpenSSL Location" ;
+$lang['MODULE_PAYMENT_PAYPAL_IPN_EWP_OPENSSL_L']="Do you want to enable Encrypted Web Payments?" ;
+$lang['MODULE_PAYMENT_PAYPAL_IPN_EWP_STATUS_S']="Enable Encrypted Web Payments " ;
+$lang['MODULE_PAYMENT_PAYPAL_IPN_EWP_STATUS_L']="Do you want to enable Encrypted Web Payments?" ;
+$lang['MODULE_PAYMENT_PAYPAL_IPN_EWP_PRIVATE_KEY_S']="Your Private Key" ;
+$lang['MODULE_PAYMENT_PAYPAL_IPN_EWP_PRIVATE_KEY_L']="The location of your Private Key to use for signing the data. (*.pem)" ;
+$lang['MODULE_PAYMENT_PAYPAL_IPN_EWP_PUBLIC_KEY_S']="IYour Public Key" ;
+$lang['MODULE_PAYMENT_PAYPAL_IPN_EWP_PUBLIC_KEY_L']="The location of your Public Certificate to use for signing the data. (*.pem)" ;
+$lang['MODULE_PAYMENT_PAYPAL_IPN_EWP_PAYPAL_KEY_S']="PayPals Public Certificate" ;
+$lang['MODULE_PAYMENT_PAYPAL_IPN_EWP_PAYPAL_KEY_L']="The location of the PayPal Public Certificate for encrypting the data." ;
+$lang['MODULE_PAYMENT_PAYPAL_IPN_EWP_CERT_ID_S']="Your PayPal Public Certificate ID" ;
+$lang['MODULE_PAYMENT_PAYPAL_IPN_EWP_CERT_ID_L']="The Certificate ID to use from your PayPal Encrypted Payment Settings Profile." ;
+$lang['MODULE_PAYMENT_PAYPAL_IPN_EWP_WORKING_DIRECTORY_S']="Working Directory" ;
+$lang['MODULE_PAYMENT_PAYPAL_IPN_EWP_WORKING_DIRECTORY_L']="The working directory to use for temporary files. (trailing slash needed)" ;
+$lang['MODULE_PAYMENT_PAYPAL_IPN_ICON_S']="Icone pour ce mode paiement" ;
+$lang['MODULE_PAYMENT_PAYPAL_IPN_ICON_L']="Choix d'un icone" ;
+$lang['MODULE_PAYMENT_PAYPAL_IPN_ICON_S']="Icone pour ce mode paiement" ;
+$lang['MODULE_PAYMENT_PAYPAL_IPN_ICON_L']="Choix d'un icone" ;
+$lang['MODULE_PAYMENT_PAYPAL_IPN_ICON_S']="Icone pour ce mode paiement" ;
+$lang['MODULE_PAYMENT_PAYPAL_IPN_ICON_L']="Choix d'un icone" ;
+$lang['MODULE_PAYMENT_PAYPAL_IPN_ICON_S']="Icone pour ce mode paiement" ;
+$lang['MODULE_PAYMENT_PAYPAL_IPN_ICON_L']="Choix d'un icone" ;
+$lang['MODULE_PAYMENT_PAYPAL_IPN_ICON_S']="Icone pour ce mode paiement" ;
+$lang['MODULE_PAYMENT_PAYPAL_IPN_ICON_L']="Choix d'un icone" ;
+$lang['MODULE_PAYMENT_PAYPAL_IPN_ICON_S']="Icone pour ce mode paiement" ;
+$lang['MODULE_PAYMENT_PAYPAL_IPN_ICON_L']="Choix d'un icone" ;
+$lang['MODULE_PAYMENT_PAYPAL_IPN_ICON_S']="Icone pour ce mode paiement" ;
+$lang['MODULE_PAYMENT_PAYPAL_IPN_ICON_L']="Choix d'un icone" ;
+$lang['MODULE_PAYMENT_PAYPAL_IPN_ICON_S']="Icone pour ce mode paiement" ;
+$lang['MODULE_PAYMENT_PAYPAL_IPN_ICON_L']="Choix d'un icone" ;
?>
\ No newline at end of file
Modified: trunk/extensions/PAYPAL_IPN_stable/catalog/admin/includes/modules/payment/paypal_ipn/paypal_ipn.php
===================================================================
--- trunk/extensions/PAYPAL_IPN_stable/catalog/admin/includes/modules/payment/paypal_ipn/paypal_ipn.php 2014-02-04 23:53:36 UTC (rev 5120)
+++ trunk/extensions/PAYPAL_IPN_stable/catalog/admin/includes/modules/payment/paypal_ipn/paypal_ipn.php 2014-02-05 06:50:48 UTC (rev 5121)
@@ -7,15 +7,21 @@
@date 13/08/2013, 09:40
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
+ @subpackage paypal_ipn <www http://plugins.oscss.org>
+ @dir /admin/includes/modules/payment/paypal_ipn
+*/
- @subpackage paypal_ipn <www http://plugins.oscss.org>
+require_once(DIR_FS_ADMIN . DIR_WS_CLASSES .'ModOneSimple.php');
+
+/**
@file paypal_ipn.php
@class paypal_ipn
*/
class paypal_ipn
- implements
- InterfaceModule,
- InterfaceAcaPayment
+ Extends ModOneSimple
+// implements
+// InterfaceModule,
+// InterfaceAcaPayment
{
public $code;
@@ -143,22 +149,6 @@
public function keys() {return array(); }
*/
- /**
- @fn check()
- @brief test if count all var , and keys is equal
- @return boolean true/false
- */
- function check() {/* return false;*/
- if (!isset($this->_check)) {
- $check_query = tep_db_query("select configuration_key from " . TABLE_CONFIGURATION . " where configuration_key LIKE 'MODULE_PAYMENT_PAYPAL_IPN_%' ");
- if( tep_db_num_rows($check_query) == count($this->keys()) ) $this->_check=true;
- else {
- $this->remove();
- $this->_check=false;
- }
- }
- return $this->_check;
- }
/**
@fn install()
@@ -214,34 +204,110 @@
$DB->query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Page Style', 'MODULE_PAYMENT_PAYPAL_IPN_PAGE_STYLE', '', 'The page style to use for the transaction procedure (defined at your PayPal Profile page)', '6', '20', now())");
$DB->query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Debug E-Mail Address', 'MODULE_PAYMENT_PAYPAL_IPN_DEBUG_EMAIL', '', 'All parameters of an Invalid IPN notification will be sent to this email address if one is entered.', '6', '21', now())");
$DB->query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('cURL Proxy server', 'MODULE_PAYMENT_PAYPAL_IPN_PROXY_SERVER', '', 'If curl transactions need to go through a proxy, type the address here starting with http://. Otherwise, leave it blank. The current GoDaddy proxy address is http://proxy.shr.secureserver.net:3128', '6', '22', now())");
- $DB->query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Encrypted Web Payments', 'MODULE_PAYMENT_PAYPAL_IPN_EWP_STATUS', 'False', 'Do you want to enable Encrypted Web Payments?', '6', '30', 'tep_cfg_select_pull_down(array(\'True\'=>\'True\', \'False\'=>\'False\'), ', now())");
- $DB->query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Your Private Key', 'MODULE_PAYMENT_PAYPAL_IPN_EWP_PRIVATE_KEY', '', 'The location of your Private Key to use for signing the data. (*.pem)', '6', '31', now())");
- $DB->query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Your Public Certificate', 'MODULE_PAYMENT_PAYPAL_IPN_EWP_PUBLIC_KEY', '', 'The location of your Public Certificate to use for signing the data. (*.pem)', '6', '32', now())");
- $DB->query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('PayPals Public Certificate', 'MODULE_PAYMENT_PAYPAL_IPN_EWP_PAYPAL_KEY', '', 'The location of the PayPal Public Certificate for encrypting the data.', '6', '33', now())");
- $DB->query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Your PayPal Public Certificate ID', 'MODULE_PAYMENT_PAYPAL_IPN_EWP_CERT_ID', '', 'The Certificate ID to use from your PayPal Encrypted Payment Settings Profile.', '6', '34', now())");
- $DB->query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Working Directory', 'MODULE_PAYMENT_PAYPAL_IPN_EWP_WORKING_DIRECTORY', '', 'The working directory to use for temporary files. (trailing slash needed)', '6', '35', now())");
- $DB->query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('OpenSSL Location', 'MODULE_PAYMENT_PAYPAL_IPN_EWP_OPENSSL', '/usr/bin/openssl', 'The location of the openssl binary file.', '6', '36', now())");
- $DB->query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('".__('Icone pour ce mode paiement')."', 'MODULE_PAYMENT_PAYPAL_IPN_ICON', '', '".addslashes(__("Choix d'un icone"))."', '6', '5', 'tep_cfg_choose_img(', NULL, now())");
+ $list = array(
+// array(
+// 'key'=>'MODULE_PAYMENT_MONEYORDER_PAYTO',
+// 'value'=>'',
+// 'type'=> 2
+// ),
+// array(
+// 'key'=>'MODULE_PAYMENT_MONEYORDER_ZONE',
+// 'value'=>'2.50',
+// 'type'=> 2,
+// 'use'=>'tep_get_zone_class_title',
+// 'set'=>'tep_cfg_pull_down_zone_classes('
+// ),
+// array(
+// 'key'=>'MODULE_PAYMENT_MONEYORDER_SORT_ORDER',
+// 'value'=>5,
+// 'type'=> 2
+// ),
+ array(
+ 'key'=>'MODULE_PAYMENT_PAYPAL_IPN_ICON',
+ 'value'=>'',
+ 'type'=> 2,
+ 'set_function'=>'tep_cfg_choose_img('
+ ),
+ array(
+ 'key'=>'MODULE_PAYMENT_PAYPAL_IPN_EWP_STATUS',
+ 'value'=>'/usr/bin/openssl',
+ 'type'=> 2,
+ 'set'=>'tep_cfg_select_pull_down(array(\'True\'=>\'True\', \'False\'=>\'False\'),'
+ ),
+ array(
+ 'key'=>'MODULE_PAYMENT_PAYPAL_IPN_EWP_PRIVATE_KEY',
+ 'value'=>'',
+ 'type'=> 2,
+ ),
+ array(
+ 'key'=>'MODULE_PAYMENT_PAYPAL_IPN_EWP_PUBLIC_KEY',
+ 'value'=>'',
+ 'type'=> 2,
+ ),
+ array(
+ 'key'=>'MODULE_PAYMENT_PAYPAL_IPN_EWP_PAYPAL_KEY',
+ 'value'=>'',
+ 'type'=> 2,
+ ),
+ array(
+ 'key'=>'MODULE_PAYMENT_PAYPAL_IPN_EWP_CERT_ID',
+ 'value'=>'',
+ 'type'=> 2,
+ ),
+ array(
+ 'key'=>'MODULE_PAYMENT_PAYPAL_IPN_EWP_WORKING_DIRECTORY',
+ 'value'=>'',
+ 'type'=> 2,
+ ),
+ array(
+ 'key'=>'MODULE_PAYMENT_PAYPAL_IPN_EWP_OPENSSL',
+ 'value'=>'/usr/bin/openssl',
+ 'type'=> 2,
+ ),
+ array(
+ 'key'=>'MODULE_PAYMENT_PAYPAL_IPN_EWP_OPENSSL',
+ 'value'=>'/usr/bin/openssl',
+ 'type'=> 2,
+ )
+ );
+
+ $error = 0;
+ foreach($list as $row)
+ if(!sqlconfiguration::fetch(array('key'=>$row['key'])) )
+ if ( ! sqlconfiguration::create($row) )
+ $error++;
}
- /**
- @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() {
- tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
- }
/**
@fn keys()
@return array all key configuration define by this module
*/
function keys() {
- return array( 'MODULE_PAYMENT_PAYPAL_IPN_GATEWAY_SERVER', 'MODULE_PAYMENT_PAYPAL_IPN_ID', 'MODULE_PAYMENT_PAYPAL_IPN_SORT_ORDER', 'MODULE_PAYMENT_PAYPAL_IPN_CURRENCY', 'MODULE_PAYMENT_PAYPAL_IPN_ZONE', 'MODULE_PAYMENT_PAYPAL_IPN_PREPARE_ORDER_STATUS_ID', 'MODULE_PAYMENT_PAYPAL_IPN_ORDER_STATUS_ID', 'MODULE_PAYMENT_PAYPAL_IPN_COMP_ORDER_STATUS_ID', 'MODULE_PAYMENT_PAYPAL_IPN_TRANSACTION_TYPE', 'MODULE_PAYMENT_PAYPAL_IPN_MOVE_TAX_TO_TOTAL_AMOUNT', 'MODULE_PAYMENT_PAYPAL_IPN_PAGE_STYLE', 'MODULE_PAYMENT_PAYPAL_IPN_DEBUG_EMAIL', 'MODULE_PAYMENT_PAYPAL_IPN_PROXY_SERVER', 'MODULE_PAYMENT_PAYPAL_IPN_EWP_STATUS', 'MODULE_PAYMENT_PAYPAL_IPN_EWP_PRIVATE_KEY', 'MODULE_PAYMENT_PAYPAL_IPN_EWP_PUBLIC_KEY', 'MODULE_PAYMENT_PAYPAL_IPN_EWP_PAYPAL_KEY', 'MODULE_PAYMENT_PAYPAL_IPN_EWP_CERT_ID', 'MODULE_PAYMENT_PAYPAL_IPN_EWP_WORKING_DIRECTORY', 'MODULE_PAYMENT_PAYPAL_IPN_EWP_OPENSSL','MODULE_PAYMENT_PAYPAL_IPN_ICON');
+ return array(
+ 'MODULE_PAYMENT_PAYPAL_IPN_GATEWAY_SERVER',
+ 'MODULE_PAYMENT_PAYPAL_IPN_ID',
+ 'MODULE_PAYMENT_PAYPAL_IPN_SORT_ORDER',
+ 'MODULE_PAYMENT_PAYPAL_IPN_CURRENCY',
+ 'MODULE_PAYMENT_PAYPAL_IPN_ZONE',
+ 'MODULE_PAYMENT_PAYPAL_IPN_PREPARE_ORDER_STATUS_ID',
+ 'MODULE_PAYMENT_PAYPAL_IPN_ORDER_STATUS_ID',
+ 'MODULE_PAYMENT_PAYPAL_IPN_COMP_ORDER_STATUS_ID',
+ 'MODULE_PAYMENT_PAYPAL_IPN_TRANSACTION_TYPE',
+ 'MODULE_PAYMENT_PAYPAL_IPN_MOVE_TAX_TO_TOTAL_AMOUNT',
+ 'MODULE_PAYMENT_PAYPAL_IPN_PAGE_STYLE',
+ 'MODULE_PAYMENT_PAYPAL_IPN_DEBUG_EMAIL',
+ 'MODULE_PAYMENT_PAYPAL_IPN_PROXY_SERVER',
+ 'MODULE_PAYMENT_PAYPAL_IPN_EWP_STATUS',
+ 'MODULE_PAYMENT_PAYPAL_IPN_EWP_PRIVATE_KEY',
+ 'MODULE_PAYMENT_PAYPAL_IPN_EWP_PUBLIC_KEY',
+ 'MODULE_PAYMENT_PAYPAL_IPN_EWP_PAYPAL_KEY',
+ 'MODULE_PAYMENT_PAYPAL_IPN_EWP_CERT_ID',
+ 'MODULE_PAYMENT_PAYPAL_IPN_EWP_WORKING_DIRECTORY',
+ 'MODULE_PAYMENT_PAYPAL_IPN_EWP_OPENSSL',
+ 'MODULE_PAYMENT_PAYPAL_IPN_ICON'
+ );
}
}
?>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2014-02-04 23:53:43
|
Revision: 5120
http://sourceforge.net/p/oscss/svn/5120
Author: oscim
Date: 2014-02-04 23:53:36 +0000 (Tue, 04 Feb 2014)
Log Message:
-----------
Fix url exterbal for confirm payment
Modified Paths:
--------------
trunk/catalog/templates/defaut/includes/gabarit/checkout/confirmation.gab
Modified: trunk/catalog/templates/defaut/includes/gabarit/checkout/confirmation.gab
===================================================================
--- trunk/catalog/templates/defaut/includes/gabarit/checkout/confirmation.gab 2014-02-04 23:46:53 UTC (rev 5119)
+++ trunk/catalog/templates/defaut/includes/gabarit/checkout/confirmation.gab 2014-02-04 23:53:36 UTC (rev 5120)
@@ -10,7 +10,8 @@
@file confirmation.gab
@dir templates/defaut/includes/gabarit/checkout/
*/
-global $page,$customer_id, $sendto, $order_total_modules, $currencies, $cart,$addresses_count,$order, $payment_modules;
+global $page,$customer_id, $sendto, $order_total_modules, $currencies, $cart,$addresses_count,$order, $payment_modules, $payment;
+
?>
<div id="checkoutConfirmation" class="">
<?php $boxe =$page->oscss_boxes->_return('checkout_progressbar'); ?>
@@ -76,7 +77,7 @@
if ($confirmation = $payment_modules->confirmation()) {
?>
<div class="contenBox paymentInformation">
- <h3><?php echo HEADING_PAYMENT_INFORMATION; ?></h3>
+ <h3><?php echo __('heading payment information'); ?></h3>
<p><?php echo $confirmation['title']; ?></p>
<?php if (isset($confirmation['fields']))
@@ -100,7 +101,7 @@
</div>
<?php } ?>
- <?php echo tep_draw_form('checkout_confirmation',(isset($$payment->form_action_url) ?$$payment->form_action_url : tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL') ), 'post'); ?>
+ <?php echo tep_draw_form('checkout_confirmation',(isset($payment_modules->modules[$payment]->form_action_url) ? $payment_modules->modules[$payment]->form_action_url : tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL') ), 'post'); ?>
<?php if (is_array($payment_modules->modules)) echo $payment_modules->process_button(); ?>
<div class="btn-group">
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2014-02-04 23:46:56
|
Revision: 5119
http://sourceforge.net/p/oscss/svn/5119
Author: oscim
Date: 2014-02-04 23:46:53 +0000 (Tue, 04 Feb 2014)
Log Message:
-----------
Fix link var
Modified Paths:
--------------
trunk/catalog/templates/defaut/includes/gabarit/checkout/shipping.gab
Modified: trunk/catalog/templates/defaut/includes/gabarit/checkout/shipping.gab
===================================================================
--- trunk/catalog/templates/defaut/includes/gabarit/checkout/shipping.gab 2014-02-04 23:46:01 UTC (rev 5118)
+++ trunk/catalog/templates/defaut/includes/gabarit/checkout/shipping.gab 2014-02-04 23:46:53 UTC (rev 5119)
@@ -1,13 +1,15 @@
<?php
/**
- @licence GPL 2005-2010 The osCSS developers - osCSS Open Source E-commerce
- @package osCSS-2 <www http://www.oscss.org>
- @version 2.1.2
- @date 18/12/2013, 08:18
- @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
+ @package osCSS-2 <www http://www.oscss.org>
+ @version 2.2.0
+ @date 18/12/2013, 08:18
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+ @file confirmation.gab
+ @dir templates/defaut/includes/gabarit/checkout/
*/
-global $page,$customer_id, $sendto, $quotes, $currencies, $cart;
+global $page,$customer_id, $sendto, $quotes, $currencies, $cart, $shipping;
?>
<div id ="checkoutShipping" class="row orderProcess">
@@ -65,8 +67,10 @@
<?php else: ?>
<ul class="shippingSelect listMethod ">
- <?php for ($j=0, $n2=sizeof($quotes[$i]['methods']); $j<$n2; $j++) {// set the radio button to be checked if it is the method chosen
- $checked = (($quotes[$i]['id'] . '_' . $quotes[$i]['methods'][$j]['id'] == $shipping['id']) ? true : false); ?>
+ <?php for ($j=0, $n2=sizeof($quotes[$i]['methods']); $j<$n2; $j++) {
+ // set the radio button to be checked if it is the method chosen
+ $checked = (($quotes[$i]['id'] . '_' . $quotes[$i]['methods'][$j]['id'] == $shipping['id']) ? true : false);
+ ?>
<li class="nameMethod">
<span class="methodTitle"><?php echo $quotes[$i]['methods'][$j]['title']; ?></span>
<?php if(isset($quotes[$i]['methods'][$j]['detail'])): ?>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2014-02-04 23:46:06
|
Revision: 5118
http://sourceforge.net/p/oscss/svn/5118
Author: oscim
Date: 2014-02-04 23:46:01 +0000 (Tue, 04 Feb 2014)
Log Message:
-----------
Fix link var
Modified Paths:
--------------
trunk/catalog/templates/defaut/includes/gabarit/checkout/confirmation.gab
Modified: trunk/catalog/templates/defaut/includes/gabarit/checkout/confirmation.gab
===================================================================
--- trunk/catalog/templates/defaut/includes/gabarit/checkout/confirmation.gab 2014-02-04 23:38:28 UTC (rev 5117)
+++ trunk/catalog/templates/defaut/includes/gabarit/checkout/confirmation.gab 2014-02-04 23:46:01 UTC (rev 5118)
@@ -1,14 +1,16 @@
<?php
/**
- @licence GPL 2005-2010 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.0
+ @version 2.2.0
@date 18/11/10, 21:53
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
+ @file confirmation.gab
+ @dir templates/defaut/includes/gabarit/checkout/
*/
-global $page,$customer_id, $sendto, $order_total_modules, $currencies, $cart,$addresses_count,$order;
+global $page,$customer_id, $sendto, $order_total_modules, $currencies, $cart,$addresses_count,$order, $payment_modules;
?>
<div id="checkoutConfirmation" class="">
<?php $boxe =$page->oscss_boxes->_return('checkout_progressbar'); ?>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2014-02-04 23:38:33
|
Revision: 5117
http://sourceforge.net/p/oscss/svn/5117
Author: oscim
Date: 2014-02-04 23:38:28 +0000 (Tue, 04 Feb 2014)
Log Message:
-----------
Add require in header file for conserve dependance and usage in cli mode
Modified Paths:
--------------
trunk/catalog/includes/classes/shipping.php
Modified: trunk/catalog/includes/classes/shipping.php
===================================================================
--- trunk/catalog/includes/classes/shipping.php 2014-02-04 23:35:52 UTC (rev 5116)
+++ trunk/catalog/includes/classes/shipping.php 2014-02-04 23:38:28 UTC (rev 5117)
@@ -12,6 +12,7 @@
*/
+require_once(DIR_FS_CATALOG . DIR_WS_COMMON_CLASSES . 'shippingUtility.php');
/**
@class shipping
@brief class de d'appel et execution des modules de livraison
@@ -35,6 +36,7 @@
self::initialise($module);
$this->quote();
+
}
public static function getInstance($module='') {
@@ -130,7 +132,6 @@
elseif ($submod->enabled) $include_quotes[] = $submod;
}
-
$size = sizeof($include_quotes);
foreach($include_quotes as $key=>$submod) {
$quotes = $submod->quote($method);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2014-02-04 23:35:57
|
Revision: 5116
http://sourceforge.net/p/oscss/svn/5116
Author: oscim
Date: 2014-02-04 23:35:52 +0000 (Tue, 04 Feb 2014)
Log Message:
-----------
Fix Set and use methode in configuration
Modified Paths:
--------------
trunk/catalog/admin/includes/modules/shipping/item.php
Modified: trunk/catalog/admin/includes/modules/shipping/item.php
===================================================================
--- trunk/catalog/admin/includes/modules/shipping/item.php 2014-02-04 22:59:53 UTC (rev 5115)
+++ trunk/catalog/admin/includes/modules/shipping/item.php 2014-02-04 23:35:52 UTC (rev 5116)
@@ -115,15 +115,15 @@
'key'=>'MODULE_SHIPPING_ITEM_TAX_CLASS',
'value'=>0,
'type'=> 2,
- 'use_function'=>'tep_get_tax_class_title',
- 'set_function'=>'tep_cfg_pull_down_tax_classes('
+ 'use'=>'tep_get_tax_class_title',
+ 'set'=>'tep_cfg_pull_down_tax_classes('
),
array(
'key'=>'MODULE_SHIPPING_ITEM_ZONE',
- 'value'=>'2.50',
+ 'value'=>'',
'type'=> 2,
- 'use_function'=>'tep_get_zone_class_title',
- 'set_function'=>'tep_cfg_pull_down_zone_shipping('
+ 'use'=>'tep_get_zone_class_title',
+ 'set'=>'tep_cfg_pull_down_zone_shipping('
),
array(
'key'=>'MODULE_SHIPPING_ITEM_SORT_ORDER',
@@ -140,8 +140,8 @@
'key'=>'MODULE_SHIPPING_ITEM_MIN_DELAI',
'value'=>'172800',
'type'=> 2,
- 'use_function'=>'tep_get_delai_title',
- 'set_function'=>'tep_cfg_pull_down_delai('
+ 'use'=>'tep_get_delai_title',
+ 'set'=>'tep_cfg_pull_down_delai('
),
);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2014-02-04 23:00:02
|
Revision: 5115
http://sourceforge.net/p/oscss/svn/5115
Author: oscim
Date: 2014-02-04 22:59:53 +0000 (Tue, 04 Feb 2014)
Log Message:
-----------
Fix regeression and submodule in specific folder
Modified Paths:
--------------
trunk/catalog/admin/includes/modules/configuration/modconfigSubMod.php
Modified: trunk/catalog/admin/includes/modules/configuration/modconfigSubMod.php
===================================================================
--- trunk/catalog/admin/includes/modules/configuration/modconfigSubMod.php 2014-02-04 22:52:18 UTC (rev 5114)
+++ trunk/catalog/admin/includes/modules/configuration/modconfigSubMod.php 2014-02-04 22:59:53 UTC (rev 5115)
@@ -201,23 +201,34 @@
foreach(scan(DIR_FS_ADMIN. DIR_WS_MODULES.$obj_dt->module_directory) as $row){
if( substr($row,-3) =='php'){
+ $class = substr($row,0, -4);
- $class = substr($row,0, -4);
+ $tmp = modulesUtility::LoadModule(self::$submodtype, $row);
+ $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;
-
+ $tmp = modulesUtility::LoadModule(self::$submodtype, $row);
+ $dbl[]=$tmp->classe;
+ self::$module[]= $tmp;
}
}
foreach(scan(DIR_FS_CATALOG_MODULES.$obj_dt->module_directory) as $row){
if( substr($row,-3) =='php'){
+ $class = substr($row,0, -4);
- $class = substr($row,0, -4);
+ $tmp = modulesUtility::LoadModule(self::$submodtype, $row);
+ if( !in_array($tmp->classe, $dbl) )
+ 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);
- if( !in_array($tmp->classe, $dbl) )
+ $tmp = modulesUtility::LoadModule(self::$submodtype, $row);
+ $dbl[]=$tmp->classe;
self::$module[]= $tmp;
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2014-02-04 22:52:21
|
Revision: 5114
http://sourceforge.net/p/oscss/svn/5114
Author: oscim
Date: 2014-02-04 22:52:18 +0000 (Tue, 04 Feb 2014)
Log Message:
-----------
clean code and delete code commented
Modified Paths:
--------------
trunk/catalog/includes/classes/shipping.php
Modified: trunk/catalog/includes/classes/shipping.php
===================================================================
--- trunk/catalog/includes/classes/shipping.php 2014-02-04 22:52:04 UTC (rev 5113)
+++ trunk/catalog/includes/classes/shipping.php 2014-02-04 22:52:18 UTC (rev 5114)
@@ -99,7 +99,7 @@
* @param $module
*/
public function quote($method = '', $module = '') {
- global $total_weight, $shipping_weight, $shipping_quoted/*, $shipping_num_boxes*/;
+ global $total_weight, $shipping_weight, $shipping_quoted;
$quotes_array = array();
@@ -130,17 +130,14 @@
elseif ($submod->enabled) $include_quotes[] = $submod;
}
+
$size = sizeof($include_quotes);
-// for ($i=0; $i<$size; $i++) {
-// $quotes = $GLOBALS[$include_quotes[$i]]->quote($method);
-// if (is_array($quotes)) $quotes_array[] = $quotes;
-// }
foreach($include_quotes as $key=>$submod) {
$quotes = $submod->quote($method);
- if (is_array($quotes)) $quotes_array[] = $quotes;
+ if (is_array($quotes))
+ $quotes_array[] = $quotes;
}
}
-
return $quotes_array;
}
@@ -167,17 +164,10 @@
}
}
}
- else {
-// var_dump($module->quotes);
- }
-
}
-// print_r($rates);
$cheapest = false;
for ($i=0, $n=sizeof($rates); $i<$n; $i++) {
-
-// print_r($rates[$i]);
if (is_array($cheapest)) {
if ($rates[$i]['cost'] < $cheapest['cost']) {
$cheapest = $rates[$i];
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2014-02-04 22:52:09
|
Revision: 5113
http://sourceforge.net/p/oscss/svn/5113
Author: oscim
Date: 2014-02-04 22:52:04 +0000 (Tue, 04 Feb 2014)
Log Message:
-----------
Fix
Modified Paths:
--------------
trunk/test/phpunit/Front/shippingTest.php
Modified: trunk/test/phpunit/Front/shippingTest.php
===================================================================
--- trunk/test/phpunit/Front/shippingTest.php 2014-02-04 22:36:10 UTC (rev 5112)
+++ trunk/test/phpunit/Front/shippingTest.php 2014-02-04 22:52:04 UTC (rev 5113)
@@ -191,7 +191,7 @@
$this->assertArrayHasKey('delai', $method);
$this->assertArrayHasKey('date_remise_provider', $method);
- $this->assertArrayHasKey('date_delivery', $method);
+ $this->assertArrayHasKey('date_delivery', $method);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2014-02-04 22:36:21
|
Revision: 5112
http://sourceforge.net/p/oscss/svn/5112
Author: oscim
Date: 2014-02-04 22:36:10 +0000 (Tue, 04 Feb 2014)
Log Message:
-----------
Fix error UnitTest in control quote return methode
Modified Paths:
--------------
trunk/test/phpunit/Front/shippingTest.php
Modified: trunk/test/phpunit/Front/shippingTest.php
===================================================================
--- trunk/test/phpunit/Front/shippingTest.php 2014-02-04 22:24:55 UTC (rev 5111)
+++ trunk/test/phpunit/Front/shippingTest.php 2014-02-04 22:36:10 UTC (rev 5112)
@@ -98,7 +98,7 @@
* @depends testshippingshoppingcart
*/
public function testshippingloadclass($cart){
- global $order;
+
//! load order
$order = new order;
@@ -120,10 +120,8 @@
* @depends testshippingshoppingcart
*/
public function testshippingquote($cart){
- global $order;
-
//! load order
- $order = new order;
+ $order = new order();
//! tot cart
$total_weight = $cart->show_weight();
@@ -131,6 +129,7 @@
$shipping = new shipping;
+
$quote= $shipping->quote();
$this -> assertTrue ( (count($quote) > 0) , 'error shipping loadclass quote' ) ;
@@ -144,7 +143,7 @@
$this->assertArrayHasKey('methods', $row);
$this -> assertTrue ( (is_array($row['methods'])) , 'error shipping loadclass quote method in not array' ) ;
- $this -> assertTrue ( (count($row['methods']) > 0) , 'error shipping loadclass quote in not null' ) ;
+ $this -> assertTrue ( (count($row['methods']) >= 0) , 'error shipping loadclass quote in not null' ) ;
foreach($row['methods'] as $r)
$this->checkarraymethod($r);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2014-02-04 22:24:58
|
Revision: 5111
http://sourceforge.net/p/oscss/svn/5111
Author: oscim
Date: 2014-02-04 22:24:55 +0000 (Tue, 04 Feb 2014)
Log Message:
-----------
Fix
Modified Paths:
--------------
trunk/catalog/admin/includes/modules/configuration/modexpedition.php
Modified: trunk/catalog/admin/includes/modules/configuration/modexpedition.php
===================================================================
--- trunk/catalog/admin/includes/modules/configuration/modexpedition.php 2014-02-04 21:46:00 UTC (rev 5110)
+++ trunk/catalog/admin/includes/modules/configuration/modexpedition.php 2014-02-04 22:24:55 UTC (rev 5111)
@@ -57,12 +57,15 @@
*/
case 'zones':
- if(isset($_POST['modconfigSubMod'][__CLASS__]['zone']) && is_array($_POST['modconfigSubMod'][__CLASS__]['zone']) ){
- foreach($_POST['modconfigSubMod'][__CLASS__]['zone'] as $key=>$row){
+ if(isset($_POST[__CLASS__]['zone']) && is_array($_POST[__CLASS__]['zone']) ){
+ foreach($_POST[__CLASS__]['zone'] as $key=>$row){
$sql_a['id'] = (int)tep_db_prepare_input($key);
$sql_a['name'] = tep_db_prepare_input($row);
- sqlgeozone::update($sql_a);
+ if( ! sqlgeozone::update($sql_a) )
+ $messageStack->add_session(__('save config not ok'), 'error');
+ else
+ $messageStack->add_session(__('save config ok'), 'success');
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2014-02-04 21:46:04
|
Revision: 5110
http://sourceforge.net/p/oscss/svn/5110
Author: oscim
Date: 2014-02-04 21:46:00 +0000 (Tue, 04 Feb 2014)
Log Message:
-----------
Fix
Modified Paths:
--------------
trunk/catalog/install/data/sample/appareil_photo/oscss_sample_data.sql
Modified: trunk/catalog/install/data/sample/appareil_photo/oscss_sample_data.sql
===================================================================
--- trunk/catalog/install/data/sample/appareil_photo/oscss_sample_data.sql 2014-02-04 21:33:32 UTC (rev 5109)
+++ trunk/catalog/install/data/sample/appareil_photo/oscss_sample_data.sql 2014-02-04 21:46:00 UTC (rev 5110)
@@ -37,7 +37,7 @@
INSERT IGNORE INTO osc_customers (customers_id, customers_gender, customers_firstname, customers_lastname, customers_dob, customers_email_address, customers_default_address_id, customers_telephone, customers_fax, customers_password, customers_newsletter) VALUES
-(1, 'm', 'Jean-Claude', 'Duce', '1970-05-21 00:00:00', 'jc...@os...', 2, '0102010201', '', '1fc083b2afc17b6206a28e316c41ba0a:0d', '1');
+(1, 'm', 'Jean-Claude', 'Duce', '1970-05-21 00:00:00', 'jc...@os...', 1, '0102010201', '', '1fc083b2afc17b6206a28e316c41ba0a:0d', '1');
INSERT IGNORE INTO osc_customers_info (customers_info_id, customers_info_date_of_last_logon, customers_info_number_of_logons, customers_info_date_account_created, customers_info_date_account_last_modified) VALUES
(1, '2012-07-31 09:07:26', 6, '2012-07-24 12:34:55', '2012-07-24 12:42:20');
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2014-02-04 21:33:36
|
Revision: 5109
http://sourceforge.net/p/oscss/svn/5109
Author: oscim
Date: 2014-02-04 21:33:32 +0000 (Tue, 04 Feb 2014)
Log Message:
-----------
Fix
Modified Paths:
--------------
trunk/catalog/admin/includes/modules/pages/cms_content.php
Modified: trunk/catalog/admin/includes/modules/pages/cms_content.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/cms_content.php 2014-02-04 17:29:37 UTC (rev 5108)
+++ trunk/catalog/admin/includes/modules/pages/cms_content.php 2014-02-04 21:33:32 UTC (rev 5109)
@@ -893,7 +893,7 @@
@param $_query ressource db sql
@return array
*/
- private static function FormatDBValue($_query){
+ protected static function FormatDBValue($_query){
$DB=Database::getInstance();
$res=array();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2014-02-04 17:29:40
|
Revision: 5108
http://sourceforge.net/p/oscss/svn/5108
Author: oscim
Date: 2014-02-04 17:29:37 +0000 (Tue, 04 Feb 2014)
Log Message:
-----------
Fix for Unittest
Add unittest for breadcrumb and messagestack
Add unittest for driverData in Frontoffice
Modified Paths:
--------------
trunk/catalog/includes/classes/breadcrumb.php
trunk/catalog/includes/classes/messageStack.php
trunk/test/phpunit/Front/datas/DriverDatacategorieTest.php
Added Paths:
-----------
trunk/test/phpunit/Front/datas/DriverData.php
trunk/test/phpunit/Front/datas/DriverDatacontentest.php
trunk/test/phpunit/Front/datas/DriverDataproductest.php
Modified: trunk/catalog/includes/classes/breadcrumb.php
===================================================================
--- trunk/catalog/includes/classes/breadcrumb.php 2014-02-04 14:43:22 UTC (rev 5107)
+++ trunk/catalog/includes/classes/breadcrumb.php 2014-02-04 17:29:37 UTC (rev 5108)
@@ -1,62 +1,76 @@
<?php if (!defined('HTTP_SERVER')) die('You can not access this file directly!');
/**
- @licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
- @portion code Copyright (c) 2002 osCommerce
- @package osCSS-2 <www http://www.oscss.org>
- @version 2.1.2
- @date 07/12/13, 22:54
- @author oscim <mail aur...@os...> <www http://www.oscim.fr>
- @encode UTF-8
- *\ingroup FrontClass
- *\file breadcrumb.php
- *\class breadcrumb
- *\dir includes/classes/
- *
- * \li - add NOT_RECUP_CASSE_IN_TXT_CATEGORIES Actif par defaut @a Hors-constructeur
+ @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 07/12/13, 22:54
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+ @ingroup FrontClass
+ @file breadcrumb.php
+ @dir includes/classes/
*/
+
+
+/**
+ @class breadcrumb
+*/
class breadcrumb{
/**
- *
- * @var $_trail array
- */
- protected $_trail;
+ @var $_trail array
+ */
+ protected $_trail = array();
/**
+ @brief constructor
+ @return none
+ */
+ public function __construct(){
+ $this->reset();
+ }
+
+ /**
@brief reset all, or row for id
+ @return none
*/
- function reset($id=0) {
- if($id>0) {
+ protected function reset($id=0) {
+ if($id > 0) {
$id = $id-1;
unset($this->_trail[$id]);
sort($this->_trail);
}
- elseif($id==0) $this->_trail = array();
+ elseif( $id == 0 )
+ $this->_trail = array();
}
/**
- *
- * @param $title
- * @param $link
+ @fn add($title, $link = '')
+ @brief add item in pile
+ @param $title
+ @param $link
+ @return none
*/
- function add($title, $link = '') {
+ public function add($title, $link = '') {
$this->_trail[] = array('title' => $title, 'link' => $link);
}
/**
- *
- * @param $separator
- * @return string
+ @fn trail($separator = ' - ', $format='<li>%s</li>')
+ @param $separator string
+ @param $format string for printf format
+ @return string
*/
- function trail($separator = ' - ', $format='<li>%s</li>') {
+ public function trail($separator = ' - ', $format='<li>%s</li>') {
$trail_string = '';
-
- for ($i=0, $n=sizeof($this->_trail); $i<$n; $i++) {
- if (isset($this->_trail[$i]['link']) && tep_not_null($this->_trail[$i]['link'])) {
- $link = '<a href="' . $this->_trail[$i]['link'] . '" class="breadCrumb">' . ((!_cst_bool('NOT_RECUP_CASSE_IN_TXT_CATEGORIES'))?strtolower($this->_trail[$i]['title']) : $this->_trail[$i]['title']) . '</a>';
+
+ foreach($this->_trail as $row){
+ if (isset($row['link']) && tep_not_null($row['link'])) {
+ $link = '<a href="' . $row['link'] . '" class="breadCrumb">' . ((!_cst_bool('NOT_RECUP_CASSE_IN_TXT_CATEGORIES'))?strtolower($row['title']) : $row['title']) . '</a>';
} else {
- $link = $this->_trail[$i]['title'];
+ $link = $row['title'];
}
if (($i+1) < $n) $link .= $separator;
Modified: trunk/catalog/includes/classes/messageStack.php
===================================================================
--- trunk/catalog/includes/classes/messageStack.php 2014-02-04 14:43:22 UTC (rev 5107)
+++ trunk/catalog/includes/classes/messageStack.php 2014-02-04 17:29:37 UTC (rev 5108)
@@ -115,7 +115,7 @@
*/
public function add($class, $message, $type = 'error') {
$this->messages[] = array(
- 'type'=>$this->getTypeInt($type),
+ 'type'=>(is_int($type)? $type : $this->getTypeInt($type) ),
'class'=>$class, // obsolete
'text'=>$message
);
@@ -133,7 +133,7 @@
}
$messageToStack[] = array(
- 'type'=>$this->getTypeInt($type),
+ 'type'=>(is_int($type)? $type : $this->getTypeInt($type) ),
'class'=>$class,// obsolete
'text'=>$message
);
@@ -175,14 +175,18 @@
}
/**
- @brief Calcul présence des erreurs
+ @fn size($type='')
+ @brief Calcul présence des erreurs
+ @param $type int or string name of type
+ @return int value of current error
*/
- /*private*/ function size($class='') {
+ public function size($type='') {
$count = 0;
- if($class=='') return count($this->messages);
+ if($type=='')
+ return count($this->messages);
else
for ($i=0, $n=sizeof($this->messages); $i<$n; $i++) {
- if ($this->messages[$i]['type'] == $class) {
+ if ($this->messages[$i]['type'] == (is_int($type)? $type : $this->getTypeInt($type) )) {
$count++;
}
}
@@ -201,6 +205,7 @@
@brief Draw erreur
*/
public function _draw($type=''){
+
if ($type!='' && $this->size($type) > 0)
$data = $this->output($type) ;
elseif($type=='')
@@ -227,6 +232,7 @@
@brief Draw number error
*/
public function _draw_nbr($type){
+
print $this->size($type);
}
Added: trunk/test/phpunit/Front/datas/DriverData.php
===================================================================
--- trunk/test/phpunit/Front/datas/DriverData.php (rev 0)
+++ trunk/test/phpunit/Front/datas/DriverData.php 2014-02-04 17:29:37 UTC (rev 5108)
@@ -0,0 +1,134 @@
+<?php
+/**
+ @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 22/08/11, 20:42
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+ @file test/phpunit/Front/datas/DriverData.php
+*/
+
+
+
+
+/**
+ * \class DriverDatacategorieTest
+ */
+class DriverData
+ extends PHPUnit_Framework_TestCase
+{
+ /**
+ @var string name current Datatype for test
+ */
+ public $type = '';
+
+// public $na = 'DataListenerRowProduct';
+ /**
+ @var boolean active this test is Datatype is active
+ */
+ public static $enabled = false;
+ /**
+ @var object current data
+ */
+ public static $ObjData;
+
+
+ function testFix(){
+
+ }
+
+
+ /**
+ @depends testDataActived
+ */
+ public function DataLoadDriver(){
+ if( ! self::$enabled )
+ return ;
+
+ include_once( DIR_FS_CATALOG . DIR_WS_CLASSES . 'drivers/data/'.$this->type.'.php');
+
+
+ $class = $this->type;
+
+ self::$ObjData=$class::getInstance();
+
+ $this->assertTrue ( is_object(self::$ObjData) , 'error load class public data for manipulate content' ) ;
+
+ return self::$ObjData;
+ }
+
+
+ /**
+ @depends testDataLoadDriver
+ */
+ public function DataLoadListingItems(){
+
+ if( ! self::$enabled )
+ return ;
+
+ // obtain listing for childs data
+ // this data is present in Rootlisting Data view environement configuration and DATATYPES_ROOTLISTING_NAMEOFDATATYPE
+ $listing = DataTypes::GetListing('leftto', $this->type);
+
+ $this->assertTrue ( is_array($listing) , 'error load listing array categorie by DataTypes::GetListing ' ) ;
+
+ global $languages_id;
+ $query = 'SELECT DISTINCT '.
+ $listing['col_count'] . ' as id'.
+ ' '. sprintf($listing['tables'], $listing['col_count'] , $this->type , $languages_id ).
+ ' '. $listing['where'].
+ '';
+
+
+ $query .= " GROUP BY ".$listing['col_count']." ";
+ $query .= " ORDER BY RAND() LIMIT 10 " ;
+
+ $this->assertTrue ( (is_string($query)) , 'error request construct ' ) ;
+
+ $DB=Database::getInstance();
+
+ $res = $DB->query($query);
+
+ $this->assertTrue ( ($res != false) , 'error Sql:Query::'.$query ) ;
+
+ $res_q = $res->fetchAllAssoc();
+
+ $this->assertTrue ( (is_array($res_q)) , 'error request construct ' ) ;
+
+ foreach($res_q as $row)
+ $this->assertArrayHasKey('id', $row);
+
+
+ return $res_q;
+ }
+
+
+ /**
+ @depends testDataLoadListingItems
+ */
+ public function DataLoadItem($res_q){
+
+ if( ! self::$enabled )
+ return ;
+
+ foreach($res_q as $row){
+
+ $res_obj = self::$ObjData->get_item($row['id']);
+
+ $nameofclass = 'DataListenerRow'.ucwords($this->type);
+
+ $this->assertClassHasAttribute('id', $nameofclass);
+ $this->assertClassHasAttribute('type', $nameofclass);
+ $this->assertClassHasAttribute('href', $nameofclass);
+ $this->assertClassHasAttribute('key', $nameofclass);
+ $this->assertClassHasAttribute('title', $nameofclass);
+ $this->assertClassHasAttribute('name', $nameofclass);
+ }
+ }
+
+
+}
+
+
+?>
\ No newline at end of file
Modified: trunk/test/phpunit/Front/datas/DriverDatacategorieTest.php
===================================================================
--- trunk/test/phpunit/Front/datas/DriverDatacategorieTest.php 2014-02-04 14:43:22 UTC (rev 5107)
+++ trunk/test/phpunit/Front/datas/DriverDatacategorieTest.php 2014-02-04 17:29:37 UTC (rev 5108)
@@ -7,7 +7,7 @@
@date 22/08/11, 20:42
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
- @file test/phpunit/Front/DriverDatacategorieTest.php
+ @file test/phpunit/Front/datas/DriverDatacategorieTest.php
@brief test unitaire class customer public
@remarks To run this script as CLI: phpunit filename.php
*/
@@ -15,30 +15,24 @@
require(substr(dirname(__FILE__),0,-5).'/_top.php');
+require_once(dirname(__FILE__).'/DriverData.php');
+
/**
* \class DriverDatacategorieTest
*/
-class DriverDatacategorieTest
- extends PHPUnit_Framework_TestCase
+class DriverDatacategorieest
+ extends DriverData
{
- /**
- @var string name current Datatype for test
- */
- public $type = 'categorie';
+
-// public $na = 'DataListenerRowProduct';
- /**
- @var boolean active this test is Datatype is active
- */
- public static $enabled ;
- /**
- @var object current data
- */
- public static $ObjData;
+ function __construct(){
+ $this->type = 'categorie';
+ }
-
public function testDataActived(){
+
+// var_dump($this->type);
self::$enabled = (! DataTypes::is_active($this->type)
? false
: true
@@ -47,26 +41,15 @@
$this->assertTrue ( (self::$enabled == true) , 'this test is not active' ) ;
+
+ return self::$enabled;
}
-
+
/**
@depends testDataActived
*/
public function testDataLoadDriver(){
-
- if( ! self::$enabled )
- return ;
-
- include_once( DIR_FS_CATALOG . DIR_WS_CLASSES . 'drivers/data/categorie.php');
- include_once( DIR_FS_CATALOG . DIR_WS_CLASSES . 'Stock.php');
-
- $class = $this->type;
-
- self::$ObjData=$class::getInstance();
-
- $this->assertTrue ( is_object(self::$ObjData) , 'error load class public data for manipulate content' ) ;
-
- return self::$ObjData;
+ return $this->DataLoadDriver();
}
@@ -78,9 +61,12 @@
if( ! self::$enabled )
return ;
+ $DT = DataTypes::getInstance();
+ $obj = $DT->GetTypeData($this->type);
+
+ $listing = $obj->listing_sql;
// obtain listing for childs data
// this data is present in Rootlisting Data view environement configuration and DATATYPES_ROOTLISTING_NAMEOFDATATYPE
- $listing = DataTypes::GetListing('leftto', $this->type);
$this->assertTrue ( is_array($listing) , 'error load listing array categorie by DataTypes::GetListing ' ) ;
@@ -113,33 +99,14 @@
return $res_q;
}
-
/**
@depends testDataLoadListingItems
*/
public function testDataLoadItem($res_q){
-
- if( ! self::$enabled )
- return ;
-
- foreach($res_q as $row){
-
- $res_obj = self::$ObjData->get_item($row['id']);
- print_r($res_obj);
-
- $nameofclass = 'DataListenerRow'.ucwords($this->type); //get_class($res_obj);
-// print_r($nameofclass);
- $this->assertClassHasAttribute('id', $nameofclass);
- $this->assertClassHasAttribute('type', $nameofclass);
- $this->assertClassHasAttribute('href', $nameofclass);
- $this->assertClassHasAttribute('key', $nameofclass);
- $this->assertClassHasAttribute('title', $nameofclass);
- $this->assertClassHasAttribute('name', $nameofclass);
- }
+ return $this->DataLoadItem($res_q);
}
-
}
Added: trunk/test/phpunit/Front/datas/DriverDatacontentest.php
===================================================================
--- trunk/test/phpunit/Front/datas/DriverDatacontentest.php (rev 0)
+++ trunk/test/phpunit/Front/datas/DriverDatacontentest.php 2014-02-04 17:29:37 UTC (rev 5108)
@@ -0,0 +1,97 @@
+<?php
+/**
+ @licence GPL 2005-2011 The osCSS developers - osCSS Open Source E-commerce
+ @portion code Copyright (c) 2002 osCommerce
+ @package osCSS-2 <www http://www.oscss.org>
+ @version 2.1.1
+ @date 22/08/11, 20:42
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+ @file test/phpunit/Front/datas/DriverDatacontentTest.php
+ @brief test unitaire class customer public
+ @remarks To run this script as CLI: phpunit filename.php
+*/
+// specific for test
+require(substr(dirname(__FILE__),0,-5).'/_top.php');
+
+
+require_once(dirname(__FILE__).'/DriverData.php');
+
+
+/**
+ * \class DriverDatacategorieTest
+ */
+class DriverDatacontentest
+ extends DriverData
+{
+
+
+ function __construct(){
+ $this->type = 'content';
+ }
+
+ public function testDataActived(){
+
+// var_dump($this->type);
+ self::$enabled = (! DataTypes::is_active($this->type)
+ ? false
+ : true
+ );
+
+
+
+ $this->assertTrue ( (self::$enabled == true) , 'this test is not active' ) ;
+
+ return self::$enabled;
+ }
+
+ /**
+ @depends testDataActived
+ */
+ public function testDataLoadDriver(){
+ return $this->DataLoadDriver();
+ }
+
+
+ /**
+ @depends testDataLoadDriver
+ */
+ public function testDataLoadListingItems(){
+ return $this->DataLoadListingItems();
+ }
+
+ /**
+ @depends testDataLoadListingItems
+ */
+// public function testDataLoadItem($res_q){
+// return $this->DataLoadItem($res_q);
+// }
+ /**
+ @depends testDataLoadListingItems
+ */
+ public function testDataLoadItem($res_q){
+
+ if( ! self::$enabled )
+ return ;
+
+ foreach($res_q as $row){
+
+ $res_obj = self::$ObjData->get_item($row['id']);
+// print_r($res_obj);
+
+ $nameofclass = 'DataListenerRow'.ucwords($this->type); //get_class($res_obj);
+// print_r($nameofclass);
+ $this->assertClassHasAttribute('id', $nameofclass);
+ $this->assertClassHasAttribute('type', $nameofclass);
+ $this->assertClassHasAttribute('href', $nameofclass);
+ $this->assertClassHasAttribute('key', $nameofclass);
+ $this->assertClassHasAttribute('title', $nameofclass);
+ $this->assertClassHasAttribute('name', $nameofclass);
+ }
+ }
+
+
+}
+
+
+?>
\ No newline at end of file
Added: trunk/test/phpunit/Front/datas/DriverDataproductest.php
===================================================================
--- trunk/test/phpunit/Front/datas/DriverDataproductest.php (rev 0)
+++ trunk/test/phpunit/Front/datas/DriverDataproductest.php 2014-02-04 17:29:37 UTC (rev 5108)
@@ -0,0 +1,98 @@
+<?php
+/**
+ @licence GPL 2005-2011 The osCSS developers - osCSS Open Source E-commerce
+ @portion code Copyright (c) 2002 osCommerce
+ @package osCSS-2 <www http://www.oscss.org>
+ @version 2.1.1
+ @date 22/08/11, 20:42
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+ @file test/phpunit/Front/datats/DriverDataproductest.php
+ @brief test unitaire class customer public
+ @remarks To run this script as CLI: phpunit filename.php
+*/
+// specific for test
+require(substr(dirname(__FILE__),0,-5).'/_top.php');
+
+
+require_once(dirname(__FILE__).'/DriverData.php');
+
+require_once( DIR_FS_CATALOG . DIR_WS_CLASSES . 'Stock.php');
+
+/**
+ * \class DriverDatacategorieTest
+ */
+class DriverDataproductest
+ extends DriverData
+{
+
+
+ function __construct(){
+ $this->type = 'product';
+ }
+
+ public function testDataActived(){
+
+// var_dump($this->type);
+ self::$enabled = (! DataTypes::is_active($this->type)
+ ? false
+ : true
+ );
+
+
+
+ $this->assertTrue ( (self::$enabled == true) , 'this test is not active' ) ;
+
+ return self::$enabled;
+ }
+
+ /**
+ @depends testDataActived
+ */
+ public function testDataLoadDriver(){
+ return $this->DataLoadDriver();
+ }
+
+
+ /**
+ @depends testDataLoadDriver
+ */
+ public function testDataLoadListingItems(){
+ return $this->DataLoadListingItems();
+ }
+
+ /**
+ @depends testDataLoadListingItems
+ */
+// public function testDataLoadItem($res_q){
+// return $this->DataLoadItem($res_q);
+// }
+ /**
+ @depends testDataLoadListingItems
+ */
+ public function testDataLoadItem($res_q){
+
+ if( ! self::$enabled )
+ return ;
+
+ foreach($res_q as $row){
+
+ $res_obj = self::$ObjData->get_item($row['id']);
+// print_r($res_obj);
+
+ $nameofclass = 'DataListenerRow'.ucwords($this->type); //get_class($res_obj);
+// print_r($nameofclass);
+ $this->assertClassHasAttribute('id', $nameofclass);
+ $this->assertClassHasAttribute('type', $nameofclass);
+ $this->assertClassHasAttribute('href', $nameofclass);
+ $this->assertClassHasAttribute('key', $nameofclass);
+ $this->assertClassHasAttribute('title', $nameofclass);
+ $this->assertClassHasAttribute('name', $nameofclass);
+ }
+ }
+
+
+}
+
+
+?>
\ 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-02-04 14:43:25
|
Revision: 5107
http://sourceforge.net/p/oscss/svn/5107
Author: oscim
Date: 2014-02-04 14:43:22 +0000 (Tue, 04 Feb 2014)
Log Message:
-----------
Fix reset static value
Modified Paths:
--------------
trunk/catalog/admin/includes/classes/SqlFilesDataDriverClass.php
Modified: trunk/catalog/admin/includes/classes/SqlFilesDataDriverClass.php
===================================================================
--- trunk/catalog/admin/includes/classes/SqlFilesDataDriverClass.php 2014-02-04 14:28:19 UTC (rev 5106)
+++ trunk/catalog/admin/includes/classes/SqlFilesDataDriverClass.php 2014-02-04 14:43:22 UTC (rev 5107)
@@ -217,7 +217,8 @@
@return none
*/
public static function PrepaDataAfterUse( $specimen , $dataarray, $post ){
-
+ self::$sql_array = array();
+ self::$sql_array_lg = array();
// call specimen and report value for defined key
foreach($specimen as $key=>$item) {
// obtain string value contain in specimen
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2014-02-04 14:28:23
|
Revision: 5106
http://sourceforge.net/p/oscss/svn/5106
Author: oscim
Date: 2014-02-04 14:28:19 +0000 (Tue, 04 Feb 2014)
Log Message:
-----------
Fix
Implements Unittest for process orders
Clean and ameliored class shipping, pauyement and order_total
Deletes code use $GLOBAL vars for passed and manipulate subchilds modules
Add requrire in header file for use in cli call
Add test generic datatype
Modified Paths:
--------------
trunk/catalog/admin/includes/modules/pages/orders.php
trunk/catalog/checkout_confirmation.php
trunk/catalog/checkout_process.php
trunk/catalog/common/class.interfaces.php
trunk/catalog/common/classes/HistoryMail.php
trunk/catalog/common/classes/NumRef.php
trunk/catalog/common/classes/notification.php
trunk/catalog/common/classes/order.php
trunk/catalog/common/classes/price.php
trunk/catalog/common/modules/core/email/history_internal.php
trunk/catalog/includes/classes/AbstractAcaModule.php
trunk/catalog/includes/classes/category_tree.php
trunk/catalog/includes/classes/checkout_process.php
trunk/catalog/includes/classes/order_total.php
trunk/catalog/includes/classes/payment.php
trunk/catalog/includes/classes/shipping.php
trunk/catalog/includes/functions/general.php
trunk/catalog/includes/modules/order_total/ot_shipping.php
trunk/catalog/includes/modules/order_total/ot_subtotal.php
trunk/catalog/includes/modules/order_total/ot_tax.php
trunk/catalog/includes/modules/order_total/ot_total.php
trunk/catalog/templates/defaut/includes/gabarit/checkout/payment_address.gab
trunk/catalog/templates/defaut/includes/gabarit/checkout/shipping_address.gab
trunk/catalog/templates/defaut/includes/gabarit/pages/shopping_cart.gab
Added Paths:
-----------
trunk/test/phpunit/Front/core/orders/
trunk/test/phpunit/Front/core/orders/OrderTest.php
trunk/test/phpunit/Front/datas/
trunk/test/phpunit/Front/datas/DriverDatacategorieTest.php
trunk/test/phpunit/Front/no_stock.xml
Modified: trunk/catalog/admin/includes/modules/pages/orders.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/orders.php 2014-02-03 17:52:07 UTC (rev 5105)
+++ trunk/catalog/admin/includes/modules/pages/orders.php 2014-02-04 14:28:19 UTC (rev 5106)
@@ -1143,15 +1143,15 @@
$query_raw = "SELECT DISTINCT ".$adjust->listfields.
" FROM " . TABLE_ORDERS . " o ".
- " LEFT JOIN " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id) ".
+ " LEFT JOIN " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id AND ot.class = 'ot_total' ) ".
" LEFT JOIN " . TABLE_ORDERS_PRODUCTS . " op on (op.orders_id = o.orders_id) ".
" LEFT JOIN " . TABLE_STATUS . " s ON(o.orders_status = s.status_id and s.status_type='orders' and s.language_id = '" . (int)$adjust->languages_id . "') ".
- " WHERE o.orders_type >= 0 AND ot.class = 'ot_total' ".$adjust->sWhere.
+ " WHERE o.orders_type >= 0 ".$adjust->sWhere.
+// " GROUP BY o.orders_id ".
" ORDER BY ".((!empty($adjust->sOrder)) ? $adjust->sOrder : 'o.orders_id DESC');
-
- $_split = new splitPageResults($adjust->page, $adjust->rowbyp, $query_raw, $query_numrows);
-
+// echo $query_raw;
+ $_split = new splitPageResults($adjust->page, $adjust->rowbyp, $query_raw, $query_numrows/*, $_query->__get('numRows')*/ );
$_query = $DB->query($query_raw);
$res=self::FormatDBValue($_query);
Modified: trunk/catalog/checkout_confirmation.php
===================================================================
--- trunk/catalog/checkout_confirmation.php 2014-02-03 17:52:07 UTC (rev 5105)
+++ trunk/catalog/checkout_confirmation.php 2014-02-04 14:28:19 UTC (rev 5106)
@@ -106,7 +106,7 @@
$page->post_init();
- $order_totals = $order_total_modules->process();
+ $order_totals = $order_total_modules->process( $order );
$page->add_var_page('order_totals',$order_totals);
@@ -116,7 +116,7 @@
*/
$aca_modules = new checkout_process('', 'holding');
- $res=$aca_modules->process_exe($order_totals);
+ $res=$aca_modules->process_exe($customer_id,$order_totals);
$pre_order_id=$res['the_order_id'];
tep_session_register('pre_order_id');
Modified: trunk/catalog/checkout_process.php
===================================================================
--- trunk/catalog/checkout_process.php 2014-02-03 17:52:07 UTC (rev 5105)
+++ trunk/catalog/checkout_process.php 2014-02-04 14:28:19 UTC (rev 5106)
@@ -69,7 +69,7 @@
/**
Si la methode contient une redirection, le reste de de process n'est pas executés
*/
- $order_totals = $order_total_modules->process();
+ $order_totals = $order_total_modules->process( $order , $price);
$res=$aca_modules->preventDuplicate( array('order_totals'=>$order_totals,'order'=>$order) );
Modified: trunk/catalog/common/class.interfaces.php
===================================================================
--- trunk/catalog/common/class.interfaces.php 2014-02-03 17:52:07 UTC (rev 5105)
+++ trunk/catalog/common/class.interfaces.php 2014-02-04 14:28:19 UTC (rev 5106)
@@ -152,7 +152,12 @@
Interface class support moduel ACA specifique order total
*/
Interface InterfaceAcaOrderTotal {
- public function process();
+ /**
+ @fn process( $order )
+ @brief calulate and extract data
+ @return none
+ */
+ public function process( CstrOrder $order , InterfaceCurrencies $currencies);
}
/**
Modified: trunk/catalog/common/classes/HistoryMail.php
===================================================================
--- trunk/catalog/common/classes/HistoryMail.php 2014-02-03 17:52:07 UTC (rev 5105)
+++ trunk/catalog/common/classes/HistoryMail.php 2014-02-04 14:28:19 UTC (rev 5106)
@@ -1,16 +1,20 @@
<?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 01/01/2013, 16:16
- @author oscim <mail aur...@os...> <www http://www.oscim.fr>
- @encode UTF-8
- @class HistoryMail
- @brief This class is manager call for methode in check or generate password proteced
+ @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 01/01/2013, 16:16
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+ @file HistoryMail.php
+ @dir common/classes/
*/
+/**
+ @class HistoryMail
+ @brief This class is manager call for methode in check or generate password proteced
+*/
class HistoryMail {
/**
@var path childs module
@@ -92,6 +96,7 @@
*/
public function AddMail($cid, $to, $toadd, $from, $fromadd , $subject,$content){
self::getInstance();
+
return self::$ChildMod->AddMail($cid,$subject, $to, $toadd, $from, $fromadd , $content);
}
}
Modified: trunk/catalog/common/classes/NumRef.php
===================================================================
--- trunk/catalog/common/classes/NumRef.php 2014-02-03 17:52:07 UTC (rev 5105)
+++ trunk/catalog/common/classes/NumRef.php 2014-02-04 14:28:19 UTC (rev 5106)
@@ -35,10 +35,12 @@
if(empty($class))
return false;
// if module modele exists load
+
require_once(DIR_FS_CATALOG . DIR_WS_COMMON . 'modules/core/numref/'. $this->type.'/'.$class.'.php');
$model = ucwords($class) ;
self::$child = new $model();
+
}
Modified: trunk/catalog/common/classes/notification.php
===================================================================
--- trunk/catalog/common/classes/notification.php 2014-02-03 17:52:07 UTC (rev 5105)
+++ trunk/catalog/common/classes/notification.php 2014-02-04 14:28:19 UTC (rev 5106)
@@ -143,33 +143,5 @@
}
-/**
-CREATE TABLE IF NOT EXISTS osc_admin_notification (
- notif_id int(11) NOT NULL auto_increment,
- notif_type varchar(10) NOT NULL COMMENT 'user/group',
- user_id int(11) NOT NULL,
- notif_key varchar(100) NOT NULL,
- notif_data varchar(250) NOT NULL,
- notif_text text NOT NULL,
- PRIMARY KEY (notif_id)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-CREATE TABLE IF NOT EXISTS osc_checknotif (
- chknotif_id int(11) NOT NULL auto_increment,
- chknotif_key varchar(100) NOT NULL,
- chknotif_uniq int(1) NOT NULL COMMENT 'user=0/grp=1',
- chknotif_user int(11) NOT NULL COMMENT 'if chknotif_uniq this = grp_id',
- chknotif_status int(1) NOT NULL,
- chknotif_method varchar(15) NOT NULL default 'email',
- PRIMARY KEY (chknotif_id)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-
---
--- Contenu de la table osc_checknotif
---
-
-INSERT INTO osc_checknotif (chknotif_id, chknotif_key, chknotif_uniq, chknotif_user, chknotif_status) VALUES
-(1, 'create_account', 0, 1, 1);
-*/
-
?>
\ No newline at end of file
Modified: trunk/catalog/common/classes/order.php
===================================================================
--- trunk/catalog/common/classes/order.php 2014-02-03 17:52:07 UTC (rev 5105)
+++ trunk/catalog/common/classes/order.php 2014-02-04 14:28:19 UTC (rev 5106)
@@ -36,8 +36,32 @@
$objectorder=new order(1);
*/
-class order {
+Interface CstrOrder{
/**
+ @fn order($order_id = '', $table = '')
+ @param $order_id int
+ @param $table string
+ */
+ function order($order_id = '', $table = '');
+
+ /**
+ @fn query($order_id)
+ @brief Recuperation d'un command enregsitré
+ @param $order_id int
+ */
+ function query($order_id);
+
+ /**
+ @fn cart()
+ @brief Call Public specific Environement for Generate checkout page
+ */
+ public function cart( shoppingCart $cart , $customer_id, $sendto, $billto, $shipping);
+}
+
+
+class order
+ Implements CstrOrder{
+ /**
@var General info for current orders
*/
public $info;
@@ -104,7 +128,10 @@
// link_post_variable('cc_number');
// link_post_variable('cc_expires');
link_post_variable('comments');
- $this->cart();
+
+ global $customer_id, $sendto, $billto, $cart,$shipping;
+
+ $this->cart($cart , $customer_id, $sendto, $billto, $shipping);
}
@@ -332,10 +359,16 @@
/**
@fn cart()
@brief Call Public specific Environement for Generate checkout page
+ @param $cart Object ShoppingCart
+ @param $customer_id Int
+ @param $sendto int
+ @param $billto int
+ @param $shipping array result of quote() methode and choose methode
+
*/
- public function cart() {
+ public function cart( shoppingCart $cart , $customer_id, $sendto, $billto, $shipping) {
- global $customer_id, $sendto, $billto, $cart, $languages_id, $currency, $currencies, $shipping, $payment,$tax_address,$coupon_sav, $shipping_mod, $shipping_modules;
+ global $languages_id, $currency, $currencies, /*$shipping,*/ $payment,$tax_address,$coupon_sav, $shipping_mod, $shipping_modules;
$this->content_type = $cart->get_content_type();
@@ -356,10 +389,10 @@
'currency' => $currency,
'currency_value' => $currencies->currencies[$currency]['value'],
'payment_method' => $payment,
- 'cc_type' => (isset($GLOBALS['cc_type']) ? $GLOBALS['cc_type'] : ''),
- 'cc_owner' => (isset($GLOBALS['cc_owner']) ? $GLOBALS['cc_owner'] : ''),
- 'cc_number' => (isset($GLOBALS['cc_number']) ? $GLOBALS['cc_number'] : ''),
- 'cc_expires' => (isset($GLOBALS['cc_expires']) ? $GLOBALS['cc_expires'] : ''),
+// 'cc_type' => (isset($GLOBALS['cc_type']) ? $GLOBALS['cc_type'] : ''),
+// 'cc_owner' => (isset($GLOBALS['cc_owner']) ? $GLOBALS['cc_owner'] : ''),
+// 'cc_number' => (isset($GLOBALS['cc_number']) ? $GLOBALS['cc_number'] : ''),
+// 'cc_expires' => (isset($GLOBALS['cc_expires']) ? $GLOBALS['cc_expires'] : ''),
'shipping_method' => $shipping['title'],
'shipping_cost_ht' => (isset($shipping['cost_ht'])? $shipping['cost_ht']:0),
'shipping_cost' => $shipping['cost'],
Modified: trunk/catalog/common/classes/price.php
===================================================================
--- trunk/catalog/common/classes/price.php 2014-02-03 17:52:07 UTC (rev 5105)
+++ trunk/catalog/common/classes/price.php 2014-02-04 14:28:19 UTC (rev 5106)
@@ -1,9 +1,9 @@
<?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.1
+ @version 2.2.0
@date 20/10/11, 11:50
\author oscim <mail aur...@os...> <www http://www.oscim.fr>
ORDONEZ Olivier <mail in...@ol...> <www http://www.olivier-ordonez.fr>
@@ -45,9 +45,30 @@
*/
+Interface InterfacePrice {
-class price {
+}
+/**
+ @Interface InterfaceCurrencies
+ @brief containt methode of currency manipulate and public display
+*/
+Interface InterfaceCurrencies {
+ /**
+ * \brief Alias currency_format pour display
+ * @param $number
+ * @param $calculate_currency_value bool
+ * @param $currency_type
+ * @param $currency_value
+ */
+ public function format($number, $calculate_currency_value = true, $currency_type = '', $currency_value = '');
+}
+
+class price
+ Implements
+ InterfacePrice,
+ InterfaceCurrencies{
+
public $currencies;
public $customer;
Modified: trunk/catalog/common/modules/core/email/history_internal.php
===================================================================
--- trunk/catalog/common/modules/core/email/history_internal.php 2014-02-03 17:52:07 UTC (rev 5105)
+++ trunk/catalog/common/modules/core/email/history_internal.php 2014-02-04 14:28:19 UTC (rev 5106)
@@ -1,16 +1,22 @@
<?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 01/01/2013, 16:16
- @author oscim <mail aur...@os...> <www http://www.oscim.fr>
- @encode UTF-8
- @class HistoryMail
- @brief Thsi class stock and manipule email file saved on local Document dir
+ @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 01/01/2013, 16:16
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+ @file internal.php
+ @dir common/classes/
*/
+require_once(DIR_FS_CATALOG . DIR_WS_COMMON_CLASSES .'DatasFiles.php');
+
+/**
+ @class internal
+ @brief
+*/
Class internal
{
Modified: trunk/catalog/includes/classes/AbstractAcaModule.php
===================================================================
--- trunk/catalog/includes/classes/AbstractAcaModule.php 2014-02-03 17:52:07 UTC (rev 5105)
+++ trunk/catalog/includes/classes/AbstractAcaModule.php 2014-02-04 14:28:19 UTC (rev 5106)
@@ -9,7 +9,7 @@
@encode UTF-8
@file AbstractAcaModule.php
@dir includes/classes/
- \brief
+ @brief
Ces classes sont les classes de base de l'appel des structure aca, elle ne sont appelé que par l'intermisiaire de class enfants
*/
@@ -152,7 +152,22 @@
return $list_mod;
}
+ /**
+ @fn CountMod($active=true)
+ @brief count submodule actived
+ @return int
+ */
+ public function CountMod($active=true){
+ $count = 0;
+ foreach ($this->modules as $key=>$module) {
+ if ($module->enabled)
+ $count++;
+ }
+
+ return $count;
+ }
+
/**
@brief Appel magic
@param $method string
Modified: trunk/catalog/includes/classes/category_tree.php
===================================================================
--- trunk/catalog/includes/classes/category_tree.php 2014-02-03 17:52:07 UTC (rev 5105)
+++ trunk/catalog/includes/classes/category_tree.php 2014-02-04 14:28:19 UTC (rev 5106)
@@ -1,23 +1,25 @@
<?php if (!defined('HTTP_SERVER')) die('You can not access this file directly!');
/**
- *\licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
- *\portion code Copyright (c) 2002 osCommerce
- *\package osCSS-2 <www http://www.oscss.org>
- *\version 2.1.2
- *\date 02/10/2013, 08:18
- *\author oscim <mail aur...@os...> <www http://www.oscim.fr>
- *\encode UTF-8
- *\group boxes
- *\file category_tree.php
- *\class osC_Category_tree
+ @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
+ @date 02/10/2013, 08:18
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+ @group boxes
+ @file category_tree.php
+ @dir includes/classes/
+*/
- Menu des catégories
- - add NOT_RECUP_CASSE_IN_TXT_CATEGORIES Actif par defaut @a Hors-constructeur
-
- TODO: End comment code / oscim 30//11/2010
+/**
+ @class category_tree
+ @brief arbres des categories
+ @note
+ Use configuartion
+ - NOT_RECUP_CASSE_IN_TXT_CATEGORIES Actif par defaut
*/
-
class category_tree {
public $root_category_id = 0,
$max_level = 0,
@@ -47,107 +49,122 @@
/**
@var name datatype for current list categorie or default datatype
*/
- protected $datatype = '';
+ protected $datatype = false;
/**
- * \fn __construct()
+ @fn __construct()
+ @param $datatype false or string for fix specific datatype child called in categorie
*/
- function __construct($datatype ="") {
- global $languages_id, $osCSS_Cache , $language;
+ function __construct($datatype =false ) {
-
+ if($datatype !=false)
$this->SetDatatype($datatype);
+
+ $this->GetData();
+ }
- if ($osCSS_Cache->read('categorie-tree-' . $language.'-type-'.$this->datatype, 720)) {
- $this->data = $osCSS_Cache->getCache();
- }
- else {
- $this->data = array();
- $sql = " AND cat.categories_hidden='1' ";
+
+ /**
+ @brief call data in categorie
+ @return data array
+ */
+ protected function GetData(){
+ global $languages_id, $osCSS_Cache , $language;
+
+ if ($osCSS_Cache->read('categorie-tree-' . $language.'-type-'.$this->datatype/*.'-'.$this->root_category_id*/, 720)) {
+ $this->data = $osCSS_Cache->getCache();
+ }
+ else {
+ $this->data = array();
+ $sql = " AND cat.categories_hidden='1' ";
- $sql .= "AND cat.categories_datatype = '".$this->datatype."' ";
+ if($this->datatype !=false)
+ $sql .= "AND cat.categories_datatype IN (".$this->datatype.") ";
+
+ categorie::add_where_query($sql);
+ $list = categorie::get_query('','','',array('limit'=>0));
- categorie::add_where_query($sql);
- $list = categorie::get_query('','','',array('limit'=>0));
+ foreach($list as $categories)
+ if( (bool)$categories->GetStatus())
+ $this->data[$categories->GetParentId()][$categories->GetId()] =$categories;
+ $osCSS_Cache->writeBuffer($this->data);
+ }
+
+ return $this->data;
+ }
- foreach($list as $categories)
- if( (bool)$categories->GetStatus())
- $this->data[$categories->GetParentId()][$categories->GetId()] =$categories;
+ /**
+ @fn buildBranch($parent_id, $level = 0)
+ @brief Constructeur de branche
+ @param $parent_id int
+ @param $level int
+ @return string
+ */
+ private function buildBranch($parent_id, $level = 0) {
- $osCSS_Cache->writeBuffer($this->data);
- }
+ $result = $this->parent_group_start_string;
- }
+ $data = $this->GetData();
+ if (isset($data[$parent_id])) {
+ $nbr = 0;
+ foreach ($data[$parent_id] as $category_id => $category) {
+ $category_link = $this->buildBreadcrumb($category_id);
- /**
- *\fn buildBranch($parent_id, $level = 0)
- *\brief Constructeur de branche
- * @param int $parent_id
- * @param int $level
- */
- private function buildBranch($parent_id, $level = 0) {
+ if ($level == 0 ||(isset($data[$category_id]) ) ) $result .= sprintf($this->root_start_string,' class="cat'.$parent_id.'_'.$category_id.'" ') ;
+ else $result .= $this->child_start_string ;
- $result = $this->parent_group_start_string;
+ $result .= str_repeat($this->spacer_string, $this->spacer_multiplier * $level) . '<a title="'. $category->GetName() .'" href="' . $category->GetHref() . '">';
- if (isset($this->data[$parent_id])) {
- $nbr = 0;
- foreach ($this->data[$parent_id] as $category_id => $category) {
+ if ($this->follow_cpath === true) {
+ if (in_array($category_id, $this->cpath_array)) $result .= $this->cpath_start_string . $category->GetName() . $this->cpath_end_string;
+ else $result .= (!_cst_bool('NOT_RECUP_CASSE_IN_TXT_CATEGORIES'))?strtolower($category->GetName()) : $category->GetName();
+ } else
+ $result .= (!_cst_bool('NOT_RECUP_CASSE_IN_TXT_CATEGORIES'))? strtolower($category->GetName()) : $category->GetName();
- $category_link = $this->buildBreadcrumb($category_id);
+ $result .= '</a>';
- if ($level == 0 ||(isset($this->data[$category_id]) ) ) $result .= sprintf($this->root_start_string,' class="cat'.$parent_id.'_'.$category_id.'" ') ;
- else $result .= $this->child_start_string ;
- $result .= str_repeat($this->spacer_string, $this->spacer_multiplier * $level) . '<a title="'. $category->GetName() .'" href="' . $category->GetHref() . '">';
- if ($this->follow_cpath === true) {
- if (in_array($category_id, $this->cpath_array)) $result .= $this->cpath_start_string . $category->GetName() . $this->cpath_end_string;
- else $result .= (!_cst_bool('NOT_RECUP_CASSE_IN_TXT_CATEGORIES'))?strtolower($category->GetName()) : $category->GetName();
- } else
- $result .= (!_cst_bool('NOT_RECUP_CASSE_IN_TXT_CATEGORIES'))? strtolower($category->GetName()) : $category->GetName();
+ if (isset($data[$category_id]) && (($this->max_level == '0') || ($this->max_level > $level+1))) {
+ if ($this->follow_cpath === true) {
+ if (in_array($category_id, $this->cpath_array))
+ $result .= $this->buildBranch($category_id, $level+1);
+ } else
+ $result .= $this->buildBranch($category_id, $level+1);
+ }
- $result .= '</a>';
+ if ( ($this->max_level<$level) && ( (in_array($category_id,$this->cpath_array) && tep_has_category_subcategories($category_id) != false) || ($this->follow_cpath === false && tep_has_category_subcategories($category_id) != false ) ) )
+ $result .= "\n" ;
+ else
+ $result .= $this->child_end_string ;
+ $nbr++;
+ }
+ }
+ $result .= $this->parent_group_end_string;
+ return $result;
+ }
- if (isset($this->data[$category_id]) && (($this->max_level == '0') || ($this->max_level > $level+1))) {
- if ($this->follow_cpath === true) {
- if (in_array($category_id, $this->cpath_array))
- $result .= $this->buildBranch($category_id, $level+1);
- } else
- $result .= $this->buildBranch($category_id, $level+1);
- }
- if ( ($this->max_level<$level) && ( (in_array($category_id,$this->cpath_array) && tep_has_category_subcategories($category_id) != false) || ($this->follow_cpath === false && tep_has_category_subcategories($category_id) != false ) ) )
- $result .= "\n" ;
- else
- $result .= $this->child_end_string ;
-
- $nbr++;
- }
- }
- $result .= $this->parent_group_end_string;
-
- return $result;
- }
-
-
/**
- *\fn buildBranchArray($parent_id, $level = 0, $result = '')
- *\brief Constructeur des branche en tableaux
- * @param int $parent_id
- * @param int $level
- * @param string $result
+ @fn buildBranchArray($parent_id, $level = 0, $result = '')
+ @brief Constructeur des branche en tableaux
+ @param int $parent_id
+ @param int $level
+ @param string $result
+ @return array $result
*/
private function buildBranchArray($parent_id, $level = 0, $result = '') {
if (empty($result)) {
$result = array();
}
- if (isset($this->data[$parent_id])) {
- foreach ($this->data[$parent_id] as $category_id => $category) {
+ $data = $this->GetData();
+ if (isset($data[$parent_id])) {
+ foreach ($data[$parent_id] as $category_id => $category) {
$category_link = $category_id;
@@ -160,7 +177,7 @@
'childs'=> $category->GetChilds(), //['childs'],
);
- if (isset($this->data[$category_id]) && (($this->max_level == '0') || ($this->max_level > $level+1))) {
+ if (isset($data[$category_id]) && (($this->max_level == '0') || ($this->max_level > $level+1))) {
if ($this->follow_cpath === true) {
if (in_array($category_id, $this->cpath_array)) $result = $this->buildBranchArray($category_id, $level+1, $result);
} else {
@@ -175,14 +192,16 @@
/**
- * \fn buildBreadcrumb($category_id, $level = 0)
- * @param $category_id int
- * @param $level int
+ @fn buildBreadcrumb($category_id, $level = 0)
+ @param $category_id int
+ @param $level int
+ @return string
*/
private function buildBreadcrumb($category_id, $level = 0) {
$breadcrumb = '';
- foreach ($this->data as $parent => $categories) {
+ $data = $this->GetData();
+ foreach ($data as $parent => $categories) {
foreach ($categories as $id => $info) {
if ($id == $category_id) {
if ($level < 1) $breadcrumb = $id;
@@ -199,8 +218,9 @@
/**
- * \fn buildTree($parent_id = '')
- * @param $parent_id
+ @fn buildTree($parent_id = '')
+ @param $parent_id
+ @return string
*/
public function buildTree($parent_id = '') {
return $this->buildBranch((empty($parent_id) ? $this->root_category_id : $parent_id));
@@ -210,9 +230,10 @@
*/
/**
- * \fn getTree($parent_id = '')
- * \brief Recup menu en array
- * @param $parent_id
+ @fn getTree($parent_id = '')
+ @brief Recup menu en array
+ @param $parent_id
+ @return array
*/
public function getTree($parent_id = '') {
return $this->buildBranchArray((empty($parent_id) ? $this->root_category_id : $parent_id));
@@ -220,25 +241,28 @@
/**
- * \fn SetDatatype($datatype)
- * @param $datatype string codename for datatype
+ @fn SetDatatype($datatype)
+ @param $datatype string codename for datatype
+ @return none
*/
- private function SetDatatype($datatype='') {
- $this->datatype = (tep_not_null($datatype) ? $datatype : DATATYPES_DEFAULT_NOSELECTED );
+ private function SetDatatype($datatype=false) {
+ $this->datatype = ( (!$datatype) ? DATATYPES_DEFAULT_NOSELECTED : $datatype );
}
/**
- * \fn setRootCategoryID($root_category_id)
- * @param $root_category_id int
+ @fn setRootCategoryID($root_category_id)
+ @param $root_category_id int
+ @return none
*/
private function setRootCategoryID($root_category_id) {
$this->root_category_id = $root_category_id;
}
/**
- * \fn setMaximumLevel($max_level)
- * \brief nbr niveau
- * @param int $max_level
+ @fn setMaximumLevel($max_level)
+ @brief nbr niveau
+ @param int $max_level
+ @return none
*/
public function setMaximumLevel($max_level) {
$this->max_level = $max_level;
@@ -248,10 +272,11 @@
*/
/**
- * \fn setRootString($root_start_string, $root_end_string)
- * \brief Encapsulation Root
- * @param string $root_start_string
- * @param string $root_end_string
+ @fn setRootString($root_start_string, $root_end_string)
+ @brief Encapsulation Root
+ @param string $root_start_string
+ @param string $root_end_string
+ @return none
*/
public function setRootString($root_start_string, $root_end_string) {
$this->root_start_string = $root_start_string;
@@ -259,9 +284,10 @@
}
/**
- * \brief Encapsulation item Root
- * @param $parent_start_string string
- * @param $parent_end_string string
+ @brief Encapsulation item Root
+ @param $parent_start_string string
+ @param $parent_end_string string
+ @return none
*/
public function setParentString($parent_start_string, $parent_end_string) {
$this->parent_start_string = $parent_start_string;
@@ -269,22 +295,23 @@
}
/**
- * \brief Encapsulation Parent
- * @param $parent_group_start_string string
- * @param $parent_group_end_string string
+ @brief Encapsulation Parent
+ @param $parent_group_start_string string
+ @param $parent_group_end_string string
+ @return none
*/
public function setParentGroupString($parent_group_start_string, $parent_group_end_string) {
$this->parent_group_start_string = $parent_group_start_string;
$this->parent_group_end_string = $parent_group_end_string;
}
- /**
- */
/**
- * \brief Encapsulation item parent
- * @param $child_start_string string
- * @param $child_end_string string
+ @fn setChildString($child_start_string, $child_end_string)
+ @brief Encapsulation item parent
+ @param $child_start_string string
+ @param $child_end_string string
+ @return none
*/
public function setChildString($child_start_string, $child_end_string) {
$this->child_start_string = $child_start_string;
@@ -292,14 +319,17 @@
}
/**
- * \fn setBreadcrumbSeparator($breadcrumb_separator)
- * @param $breadcrumb_separator string
+ @fn setBreadcrumbSeparator($breadcrumb_separator)
+ @param $breadcrumb_separator string
+ @return none
*/
public function setBreadcrumbSeparator($breadcrumb_separator) {
$this->breadcrumb_separator = $breadcrumb_separator;
}
/**
+ @fn setSpacerString($spacer_string, $spacer_multiplier = 2)
+ @return none
*/
public function setSpacerString($spacer_string, $spacer_multiplier = 2) {
$this->spacer_string = $spacer_string;
@@ -307,6 +337,8 @@
}
/**
+ @fn setCategoryPath($cpath, $cpath_start_string = '', $cpath_end_string = ''
+ @return none
*/
public function setCategoryPath($cpath, $cpath_start_string = '', $cpath_end_string = '') {
$this->follow_cpath = true;
@@ -316,13 +348,17 @@
}
/**
+ @fn setFollowCategoryPath($follow_cpath)
+ @return none
*/
public function setFollowCategoryPath($follow_cpath) {
if ($follow_cpath === true) $this->follow_cpath = true;
else $this->follow_cpath = false;
}
- /**
+ /**
+ @fn setCategoryPathString($cpath_start_string, $cpath_end_string)
+ @return none
*/
public function setCategoryPathString($cpath_start_string, $cpath_end_string) {
$this->cpath_start_string = $cpath_start_string;
@@ -335,7 +371,7 @@
}
/**
- * \example
+ @example
NOTE:
Modified: trunk/catalog/includes/classes/checkout_process.php
===================================================================
--- trunk/catalog/includes/classes/checkout_process.php 2014-02-03 17:52:07 UTC (rev 5105)
+++ trunk/catalog/includes/classes/checkout_process.php 2014-02-04 14:28:19 UTC (rev 5106)
@@ -5,24 +5,31 @@
@package osCSS-2 <www http://www.oscss.org>
@version 2.1.2
@date 04/07/2013, 10:36
- \author oscim <mail aur...@os...> <www http://www.oscim.fr>
- \encode UTF-8
- \class checkout_process
- \dir includes/classes/
- \brief Process order and holding order
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+ @file checkout_process.php
+ @dir includes/classes/
+*/
+include_once(DIR_FS_CATALOG . DIR_WS_COMMON_CLASSES .'NumRef.php');
+include_once(DIR_FS_CATALOG . DIR_WS_COMMON_CLASSES .'Template.php');
+include_once(DIR_FS_CATALOG . DIR_WS_COMMON_CLASSES .'PHPMailer.php');
+
+include_once(DIR_FS_CATALOG . DIR_WS_COMMON_CLASSES .'HistoryMail.php');
+include_once(DIR_FS_CATALOG . DIR_WS_COMMON_CLASSES .'notification.php');
+
+
+/**
+ @class checkout_process
+ @brief Process order and holding order
\subpage checkout_process Manual class
-
Process order and holding order
-
\section english (en) Process order Process order and holding order
-
\section francais (fr) Gestion des process et des modules associé
Cette class assure l'ensemble des pre-enregsitrement et enregsitrement des commande dans l'epsace public.\n
Elle centralise l'ensemble des modifications des commandes, et leur confirmation
*/
-
class checkout_process
extends AbstractAcaModule{
@@ -231,9 +238,14 @@
return $this->process_confirm($array['pre_order_id']);
}
else {
-
+
+ if(isset($array['customer_id']) && $array['customer_id'] > 0)
+ $customer_id = $array['customer_id'];
+ else{
+ global $customer_id;
+ }
// create orders
- return $this->process_exe($array['order_totals'],$array['order']);
+ return $this->process_exe($customer_id, $array['order_totals'],$array['order']);
}
}
@@ -315,8 +327,8 @@
* @param $order_totals
* @param $order object orders|null
*/
- public function process_exe($order_totals,$order=''){
- global $customer_id, $currencies,$order;
+ public function process_exe($customer_id, $order_totals,$order=''){
+ global $currencies;
$error = 0;
$ip = tep_get_ip_address();
@@ -431,15 +443,7 @@
// $products_ordered .= $order->products[$i]['qty'] . ' x ' . $order->products[$i]['name'] . ' (' . $order->products[$i]['model'] . ') = ' . $currencies->display_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']) . $products_ordered_attributes . "\n";
}
-// if(self::$mode)
-// exit;
- /*
- Force reload order for obtain rowid line
- */
-// $page = Page::getInstance();
-// $order = new order((int)self::$Id);
-
/**
Before process module ACA
*/
@@ -612,7 +616,6 @@
}
-
/**
Before process module ACA
*/
@@ -681,6 +684,7 @@
//save mail in email docs
$HM2 = HistoryMail::getInstance();
+
$HM2->AddMail(
$order->customer['id'],
$order->customer['firstname'].' '.$order->customer['lastname'] ,
@@ -691,10 +695,8 @@
$message_final['html']
);
-
/// admin notif
notification::notifInMess('checkout_process','copy '.EMAIL_TEXT_SUBJECT,$message_final,'customers_id='.$order->customer['id']);
-
}
/**
Modified: trunk/catalog/includes/classes/order_total.php
===================================================================
--- trunk/catalog/includes/classes/order_total.php 2014-02-03 17:52:07 UTC (rev 5105)
+++ trunk/catalog/includes/classes/order_total.php 2014-02-04 14:28:19 UTC (rev 5106)
@@ -1,19 +1,21 @@
<?php if (!defined('HTTP_SERVER')) die('You can not access this file directly!');
/**
- \licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
- \portion code Copyright (c) 2002 osCommerce
- \package osCSS-2 <www http://www.oscss.org>
- \version 2.1.2
- \date 25/07/2013, 11:33
- \author oscim <mail aur...@os...> <www http://www.oscim.fr>
- \encode UTF-8
- \class order_total
- \dir includes/classes/
+ @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 25/07/2013, 11:33
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+ @file order_total.php
+ @dir includes/classes/
+*/
- \brief Prend en charge la gestion des moduel order_total actif.
+/**
+ @class order_total
+ @brief Prend en charge la gestion des moduel order_total actif.
Intervient dans les checkout, les shopping,
*/
-
class order_total
extends AbstractAcaModule{
public $modules;
@@ -32,8 +34,10 @@
$list_mod[$class] = $cl[$class]->sort_order;
}
- if (isset($_SESSION['sppc_customer_group_id']) && $_SESSION['sppc_customer_group_id'] != '0') $customer_group_id = $_SESSION['sppc_customer_group_id'];
- else $customer_group_id = '0';
+ if (isset($_SESSION['sppc_customer_group_id']) && $_SESSION['sppc_customer_group_id'] != '0')
+ $customer_group_id = $_SESSION['sppc_customer_group_id'];
+ else
+ $customer_group_id = '0';
$customer_ot_query = tep_db_query("select IF(c.customers_order_total_allowed <> '', c.customers_order_total_allowed, cg.group_order_total_allowed) as order_total_allowed from " . TABLE_CUSTOMERS . " c, " . TABLE_CUSTOMERS_GROUPS . " cg where c.customers_id = '" . $customer_id . "' and cg.customers_group_id = '" . $customer_group_id . "'");
$customer_ot = tep_db_fetch_array($customer_ot_query);
@@ -53,23 +57,28 @@
/** ---- CHECKOUT PROCESS ------*/
/**
*/
- public function process() {
+ public function process( CstrOrder $order ) {
+ global $price;
+
+
$order_total_array = array();
if (is_array($this->modules) && count($this->modules)>0) {
reset($this->modules);
- while (list($class, $value) = each($this->modules)) {
- if ($GLOBALS[$class]->enabled) {
- $GLOBALS[$class]->process();
- for ($i=0, $n=sizeof($GLOBALS[$class]->output); $i<$n; $i++) {
- if (tep_not_null($GLOBALS[$class]->output[$i]['title']) && tep_not_null($GLOBALS[$class]->output[$i]['text'])) {
- $order_total_array[] = array( 'code' => $GLOBALS[$class]->code,
- 'title' => $GLOBALS[$class]->output[$i]['title'],
- 'text_ht' => @$GLOBALS[$class]->output[$i]['text_ht'],
- 'text' => $GLOBALS[$class]->output[$i]['text'],
- 'value_ht' => $GLOBALS[$class]->output[$i]['value_ht'],
- 'value' => $GLOBALS[$class]->output[$i]['value'],
- 'sort_order' => $GLOBALS[$class]->sort_order);
+ foreach($this->modules as $class=>$submod){
+ if ($submod->enabled) {
+
+ $submod->process( $order, $price );
+
+ for ($i=0, $n=sizeof($submod->output); $i<$n; $i++) {
+ if (tep_not_null($submod->output[$i]['title']) && tep_not_null($submod->output[$i]['text'])) {
+ $order_total_array[] = array( 'code' => $submod->code,
+ 'title' => $submod->output[$i]['title'],
+ 'text_ht' => $submod->output[$i]['text_ht'],
+ 'text' => $submod->output[$i]['text'],
+ 'value_ht' => $submod->output[$i]['value_ht'],
+ 'value' => $submod->output[$i]['value'],
+ 'sort_order' => $submod->sort_order);
}
}
}
@@ -86,16 +95,17 @@
if (is_array($this->modules)) {
reset($this->modules);
- while (list($class, $value) = each($this->modules)) {
- if ($GLOBALS[$class]->enabled) {
- $size = sizeof($GLOBALS[$class]->output);
+ foreach($this->modules as $class=>$submod){
+ if ($submod->enabled) {
+ $size = sizeof($submod->output);
+
for ($i=0; $i<$size; $i++) {
$output_string .=sprintf($f_lin,
sprintf($f_col,
- $GLOBALS[$class]->output[$i]['title'],
- @$GLOBALS[$class]->output[$i]['text_ht'],
- $GLOBALS[$class]->output[$i]['text'])
+ $submod->output[$i]['title'],
+ $submod->output[$i]['text_ht'],
+ $submod->output[$i]['text'])
."\n")
."\n";
}
@@ -124,10 +134,10 @@
}
} else {
reset($this->modules);
- foreach ($this->modules as $key=>$module) {
+ foreach ($this->modules as $class=>$submod) {
$funct='shopping_cart_action';
- if (($module->enabled) and (method_exists($module, $funct ))) {
- return $this->modules[$key]->$funct($action);
+ if (($submod->enabled) and (method_exists($submod, $funct ))) {
+ return $submod->$funct($action);
}
}
}
@@ -153,10 +163,10 @@
}
} else {
reset($this->modules);
- foreach ($this->modules as $key=>$module) {
+ foreach ($this->modules as $class=>$submod){
$funct='draw_cart';
- if (($module->enabled) && (isset($module->shopping_cart) && $module->shopping_cart) && (method_exists($module, $funct )) ) {
- $product= $this->modules[$key]->$funct($product);
+ if (($submod->enabled) && (isset($submod->shopping_cart) && $submod->shopping_cart) && (method_exists($submod, $funct )) ) {
+ $product= $submod->$funct($product);
}
}
}
@@ -179,10 +189,10 @@
}
} else {
reset($this->modules);
- foreach ($this->modules as $key=>$module) {
+ foreach ($this->modules as $class=>$submod){
$funct='process_cart';
- if (($module->enabled) && (isset($module->shopping_cart) && $module->shopping_cart) && (method_exists($module, $funct )) ) {
- $product= $this->modules[$key]->$funct($product);
+ if (($submod->enabled) && (isset($submod->shopping_cart) && $submod->shopping_cart) && (method_exists($submod, $funct )) ) {
+ $product= $submod->$funct($product);
}
}
}
@@ -203,8 +213,9 @@
reset($this->modules);
if(empty($funct)) return;
- foreach ($this->modules as $key=>$module) {
- if (($module->enabled) && (isset($module->shopping_cart) && $module->shopping_cart) && (method_exists($module, $funct ))) $res[$key]=$this->modules[$key]->$funct($action);
+ foreach ($this->modules as $class=>$submod){
+ if (($submod->enabled) && (isset($submod->shopping_cart) && $submod->shopping_cart) && (method_exists($submod, $funct )))
+ $res[$key]=$submod->$funct($action);
}
return $res;
Modified: trunk/catalog/includes/classes/payment.php
===================================================================
--- trunk/catalog/includes/classes/payment.php 2014-02-03 17:52:07 UTC (rev 5105)
+++ trunk/catalog/includes/classes/payment.php 2014-02-04 14:28:19 UTC (rev 5106)
@@ -1,36 +1,38 @@
<?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 02/03/2012, 21:44
+ @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 25/07/2013, 11:33
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
- \class payment
- \file
- \dir includes/classes/
+ @file paymentpayment.php
+ @dir includes/classes/
+*/
- \brief appel et init des modules de paiement
+
+/**
+ @class payment
+ @brief appel et init des modules de paiement
*/
-
class payment
extends AbstractAcaModule{
/**
- @var
+ @var array
*/
public $mod=array();
/**
- @var
+ @var array list of subobject
*/
public $modules=array();
/**
- @var
+ @var current selected submodule
*/
public static $selected_module = '';
/**
- @var
+ @var current instance
*/
protected static $_instance;
@@ -77,8 +79,10 @@
}
}
- if (isset($_SESSION['sppc_customer_group_id']) && $_SESSION['sppc_customer_group_id'] != '0') $customer_group_id = $_SESSION['sppc_customer_group_id'];
- else $customer_group_id = '0';
+ if (isset($_SESSION['sppc_customer_group_id']) && $_SESSION['sppc_customer_group_id'] != '0')
+ $customer_group_id = $_SESSION['sppc_customer_group_id'];
+ else
+ $customer_group_id = '0';
$customer_payment_query = tep_db_query("select IF(c.customers_payment_allowed <> '', c.customers_payment_allowed, cg.group_payment_allowed) as payment_allowed from " . TABLE_CUSTOMERS . " c, " . TABLE_CUSTOMERS_GROUPS . " cg where c.customers_id = '" . $customer_id . "' and cg.customers_group_id = '" . $customer_group_id . "'");
$customer_ot = tep_db_fetch_array($customer_payment_query);
@@ -86,21 +90,21 @@
foreach($include_modules as $imod){
if( ( count($temp_payment_array)==0 || in_array($imod['file'], $temp_payment_array ) ) ){
- if(!class_exists($imod['class'])) break;
- $this->modules[$imod['class']]=$GLOBALS[$imod['class']] = new $imod['class'];
- $this->mod[]=$imod['class'];
+ if(!class_exists($imod['class'])) break;
+ $this->modules[$imod['class']]=$GLOBALS[$imod['class']] = new $imod['class'];
+ $this->mod[]=$imod['class'];
}
}
// if there is only one payment method, select it as default because in
// checkout_confirmation.php the $payment variable is being assigned the
// $_POST['payment'] value which will be empty (no radio button selection possible)
- if ( (tep_count_payment_modules() == 1) && (!isset($GLOBALS[$payment]) || (isset($GLOBALS[$payment]) && !is_object($GLOBALS[$payment]))) ) {
+ if ( (!isset($this->modules[$payment]) || (isset($this->modules[$payment]) && !is_object($this->modules[$payment]))) ) {
/*self::$selected_module=*/$payment = $include_modules[0]['class'];
}
- if ( (tep_not_null($module)) && (in_array($module, $this->mod)) && (isset($GLOBALS[$module]->form_action_url)) ) {
- $this->form_action_url = $GLOBALS[$module]->form_action_url;
+ if ( (tep_not_null($module)) && (in_array($module, $this->mod)) && (isset($this->modules[$module]->form_action_url)) ) {
+ $this->form_action_url = $this->modules[$module]->form_action_url;
}
}
@@ -119,9 +123,9 @@
public function update_status() {
if (is_array($this->mod) && strlen(self::$selected_module) > 3) {
- if (is_object($GLOBALS[self::$selected_module])) {
- if (method_exists($GLOBALS[self::$selected_module], 'update_status')) {
- $GLOBALS[self::$selected_module]->update_status();
+ if (is_object($this->modules[self::$selected_module])) {
+ if (method_exists($this->modules[self::$selected_module], 'update_status')) {
+ $this->modules[self::$selected_module]->update_status();
}
}
}
@@ -150,7 +154,7 @@
reset($this->mod);
foreach($this->mod as $class){
- if (isset($GLOBALS[$class]) &&$GLOBALS[$class]->enabled) $js .= $GLOBALS[$class]->javascript_validation();
+ if (isset($this->modules[$class]) && $this->modules[$class]->enabled) $js .= $this->modules[$class]->javascript_validation();
}
$js .= "\n" .'if (document.getElementById("conditions").checked != true) {' . "\n" .
@@ -183,11 +187,11 @@
public function selection() {
$selection_array = array();
- if (is_array($this->mod)) {
- reset($this->mod);
- foreach($this->mod as $class){
- if (isset($GLOBALS[$class]) && $GLOBALS[$class]->enabled) {
- $selection = $GLOBALS[$class]->selection();
+ if (is_array($this->modules)) {
+ reset($this->modules);
+ foreach($this->modules as $class=>$submod ){
+ if (is_object($submod) && $submod->enabled) {
+ $selection = $submod->selection();
if (is_array($selection))
$selection_array[] = $selection;
}
@@ -201,8 +205,8 @@
*/
public function pre_confirmation_check() {
if (is_array($this->mod)) {
- if (is_object($GLOBALS[self::$selected_module]) && ($GLOBALS[self::$selected_module]->enabled) && method_exists($GLOBALS[self::$selected_module], 'pre_confirmation_check') ) {
- $GLOBALS[self::$selected_module]->pre_confirmation_check();
+ if (is_object($this->modules[self::$selected_module]) && ($this->modules[self::$selected_module]->enabled) && method_exists($this->modules[self::$selected_module], 'pre_confirmation_check') ) {
+ $this->modules[self::$selected_module]->pre_confirmation_check();
}
}
@@ -213,8 +217,8 @@
*/
public function confirmation() {
if (is_array($this->mod)) {
- if (is_object($GLOBALS[self::$selected_module]) && ($GLOBALS[self::$selected_module]->enabled) && method_exists($GLOBALS[self::$selected_module], 'confirmation') ) {
- return $GLOBALS[self::$selected_module]->confirmation();
+ if (is_object($this->modules[self::$selected_module]) && ($this->modules[self::$selected_module]->enabled) && method_exists($this->modules[self::$selected_module], 'confirmation') ) {
+ return $this->modules[self::$selected_module]->confirmation();
}
}
}
@@ -224,8 +228,8 @@
*/
public function process_button() {
if (is_array($this->mod)) {
- if (is_object($GLOBALS[self::$selected_module]) && ($GLOBALS[self::$selected_module]->enabled)&& method_exists($GLOBALS[self::$selected_module], 'process_button') ) {
- return $GLOBALS[self::$selected_module]->process_button();
+ if (is_object($this->modules[self::$selected_module]) && ($this->modules[self::$selected_module]->enabled)&& method_exists($this->modules[self::$selected_module], 'process_button') ) {
+ return $this->modules[self::$selected_module]->process_button();
}
}
}
@@ -235,8 +239,8 @@
*/
function before_process() {
if (is_array($this->mod)) {
- if (is_object($GLOBALS[self::$selected_module]) && ($GLOBALS[self::$selected_module]->enabled)&& method_exists($GLOBALS[self::$selected_module], 'before_process') ) {
- return $GLOBALS[self::$selected_module]->before_process();
+ if (is_object($this->modules[self::$selected_module]) && ($this->modules[self::$selected_module]->enabled)&& method_exists($this->modules[self::$selected_module], 'before_process') ) {
+ return $this->modules[self::$selected_module]->before_process();
}
}
}
@@ -246,8 +250,8 @@
*/
public function after_process() {
if (is_array($this->mod)) {
- if (is_object($GLOBALS[self::$selected_module]) && ($GLOBALS[self::$selected_module]->enabled)&& method_exists($GLOBALS[self::$selected_module], 'after_process') ) {
- return $GLOBALS[self::$selected_module]->after_process();
+ if (is_object($this->modules[self::$selected_module]) && ($this->modules[self::$selected_module]->enabled)&& method_exists($this->modules[self::$selected_module], 'after_process') ) {
+ return $this->modules[self::$selected_module]->after_process();
}
}
}
@@ -257,16 +261,16 @@
*/
function payment_succes() {
if (is_array($this->mod)) {
- if (is_object($GLOBALS[self::$selected_module]) && ($GLOBALS[self::$selected_module]->enabled)&& method_exists($GLOBALS[self::$selected_module], 'payment_succes') ) {
- return $GLOBALS[self::$selected_module]->payment_succes();
+ if (is_object($this->modules[self::$selected_module]) && ($this->modules[self::$selected_module]->enabled)&& method_exists($this->modules[self::$selected_module], 'payment_succes') ) {
+ return $this->modules[self::$selected_module]->payment_succes();
}
}
}
public function get_error() {
if (is_array($this->mod)) {
- if (is_object($GLOBALS[self::$selected_module]) && ($GLOBALS[self::$selected_module]->enabled)&& method_exists($GLOBALS[self::$selected_module], 'pre_confirmation_check') ) {
- return $GLOBALS[self::$selected_module]->get_error();
+ if (is_object($this->modules[self::$selected_module]) && ($this->modules[self::$selected_module]->enabled)&& method_exists($this->modules[self::$selected_module], 'pre_confirmation_check') ) {
+ return $this->modules[self::$selected_module]->get_error();
}
}
}
Modified: trunk/catalog/includes/classes/shipping.php
===================================================================
--- trunk/catalog/includes/classes/shipping.php 2014-02-03 17:52:07 UTC (rev 5105)
+++ trunk/catalog/includes/classes/shipping.php 2014-02-04 14:28:19 UTC (rev 5106)
@@ -1,22 +1,28 @@
<?php if (!defined('HTTP_SERVER')) die('You can not access this file directly!');
/**
- \licence GPL 2005-2010 The osCSS developers - osCSS Open Source E-commerce
- \portion code Copyright (c) 2002 osCommerce
- \package osCSS-2 <www http://www.oscss.org>
- \version 2.1.0
- \date 29/11/10, 11:33
- \author oscim <mail aur...@os...> <www http://www.oscim.fr>
- \encode UTF-8
- \class shipping
- \file
- \dir includes/classes/
+ @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 25/07/2013, 11:33
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+ @file shipping.php
+ @dir includes/classes/
+*/
- \brief class de d'appel et execution des modules de livraison
+
+/**
+ @class shipping
+ @brief class de d'appel et execution des modules de livraison
*/
-
class shipping
extends AbstractAcaModule{
- var $modules;
+
+ /**
+ @var array list of submodule object
+ */
+ public $modules = array();
/**
@p int nombre colis
@@ -27,6 +33,8 @@
function __construct($module='') {
self::initialise($module);
+
+ $this->quote();
}
public static function getInstance($module='') {
@@ -53,16 +61,21 @@
if (tep_not_null($module) && is_array($module)) {
$mod=substr($module["id"], strpos($module["id"],'_')+1);
$this->selected_module = $module;
- if(($path=$page->fix_file(DIR_WS_INCLUDES .'languages/'. $language . '/modules/shipment/' . $mod . '.php',true)) !=false) require($path);
- if(($path=$page->fix_file(DIR_WS_MODULES . 'shipment/' . $mod . '.php')) !=false) require($path);
+ if(($path=$page->fix_file(DIR_WS_INCLUDES .'languages/'. $language . '/modules/shipment/' . $mod . '.php',true)) !=false)
+ require($path);
+ if(($path=$page->fix_file(DIR_WS_MODULES . 'shipment/' . $mod . '.php')) !=false)
+ require($path);
+
$include_modules[] = array_merge($module, array('class' =>$mod) );
- } else {
+ }
+ else {
foreach(parent::initialise_type('MODULE_SHIPPING_INSTALLED','shipping') as $class){
- $include_modules[] = array('class' => $class, 'file' => $class . '.php');
+ $include_modules[] = array('class' => $class, 'file' => $class . '.php');
}
}
- if (isset($_SESSION['sppc_customer_group_id']) && $_SESSION['sppc_customer_group_id'] != '0') $customer_group_id = $_SESSION['sppc_customer_group_id'];
+ if (isset($_SESSION['sppc_customer_group_id']) && $_SESSION['sppc_customer_group_id'] != '0')
+ $customer_group_id = $_SESSION['sppc_customer_group_id'];
else $customer_group_id = '0';
$customer_shipment_query = tep_db_query("select IF(c.customers_shipment_allowed <> '', c.customers_shipment_allowed, cg.group_shipment_allowed) as shipment_allowed from " . TABLE_CUSTOMERS . " c, " . TABLE_CUSTOMERS_GROUPS . " cg where c.customers_id = '" . $customer_id . "' and cg.customers_group_id = '" . $customer_group_id . "'");
@@ -71,12 +84,15 @@
foreach($include_modules as $imod){
if( ( count($temp_ot_array)==0 || in_array($imod['file'], $temp_ot_array ) ) ){
- if(!empty($imod['class']) && !class_exists($imod['class'])) break;
- $this->modules[$imod['class']]=$GLOBALS[$imod['class']] = new $imod['class'];
+ if(!empty($imod['class']) && !class_exists($imod['class']))
+ break;
+ $this->modules[$imod['class']]=$GLOBALS[$imod['class']] = new $imod['class'];
}
}
}
+
+
/**
* \fn quote($method = '', $module = '')
* @param $method
@@ -107,16 +123,20 @@
reset($this->modules);
- foreach($this->modules as $class=>$s){
+ foreach($this->modules as $class=>$submod){
if (tep_not_null($module)) {
- if ( ($module == $class) && ($GLOBALS[$class]->enabled) ) $include_quotes[] = $class;
+ if ( ($module == $class) && ($submod->enabled) ) $include_quotes[] = $submod;
}
- elseif ($GLOBALS[$class]->enabled) $include_quotes[] = $class;
+ elseif ($submod->enabled) $include_quotes[] = $submod;
}
$size = sizeof($include_quotes);
- for ($i=0; $i<$size; $i++) {
- $quotes = $GLOBALS[$include_quotes[$i]]->quote($method);
+// for ($i=0; $i<$size; $i++) {
+// $quotes = $GLOBALS[$include_quotes[$i]]->quote($method);
+// if (is_array($quotes)) $quotes_array[] = $quotes;
+// }
+ foreach($include_quotes as $key=>$submod) {
+ $quotes = $submod->quote($method);
if (is_array($quotes)) $quotes_array[] = $quotes;
}
}
@@ -133,8 +153,8 @@
$rates = array();
reset($this->modules);
- foreach($this->modules as $class=>$s){
- if ($GLOBALS[$class]->enabled && (($quotes = $GLOBALS[$class]->quotes) !=false) ) {
+ foreach($this->modules as $class=>$module){
+ if ($module->enabled && (($quotes = $module->quotes) !=false) ) {
for ($i=0, $n=sizeof($quotes['methods']); $i<$n; $i++) {
if (isset($quotes['methods'][$i]['cost']) && tep_not_null($quotes['methods'][$i]['cost'])) {
$rates[] =array_merge($quotes['methods'][$i], array(
@@ -147,10 +167,17 @@
}
}
}
+ else {
+// var_dump($module->quotes);
+ }
+
}
+// print_r($rates);
$cheapest = false;
for ($i=0, $n=sizeof($rates); $i<$n; $i++) {
+
+// print_r($rates[$i]);
if (is_array($cheapest)) {
if ($rates[$i]['cost'] < $cheapest['cost']) {
$cheapest = $rates[$i];
Modified: trunk/catalog/includes/functions/general.php
===================================================================
--- trunk/catalog/includes/functions/general.php 2014-02-03 17:52:07 UTC (rev 5105)
+++ trunk/catalog/includes/functions/general.php 2014-02-04 14:28:19 UTC (rev 5106)
@@ -288,7 +288,7 @@
$class = substr($modules_array[$i], 0, strrpos($modules_array[$i], '.'));
if ($active && isset($GLOBALS[$class]) && is_object($GLOBALS[$class])) {
if ($GLOBALS[$class]->enabled) {
- $count++;
+ $count++;
}
}
}
@@ -458,6 +458,7 @@
$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']);
@@ -1083,12 +1084,27 @@
/** Alias */
function tep_get_countries_with_iso_codes($countries_id) { return tep_get_countries($countries_id, true); }
function tep_get_country_name($country_id) { $country_array = tep_get_countries($country_id); return $country_array['countries_name']; }
-function tep_count_credit_modules() { return tep_count_modules(MODULE_CREDIT_INSTALLED); }
-function tep_count_payment_modules() { return tep_count_modules(MODULE_PAYMENT_INSTALLED); }
-function tep_count_shipping_modules() { return tep_count_modules(MODULE_SHIPPING_INSTALLED); }
+/**
+ @fn tep_count_payment_modules()
+ @brief count submodule activated
+*/
+function tep_count_payment_modules() {
+ $obj = payment::getInstance();
+ return $obj->CountMod();
+}
/**
+ @fn tep_count_shipping_modules()
+ @brief count submodule activated
+*/
+function tep_count_shipping_modules() {
+ $obj = shipping::getInstance();
+ return $obj->CountMod();
+}
+
+
+/**
Fonctions remplacé par des class
=> Retrocompatibilité
*/
Modified: trunk/catalog/includes/modules/order_total/ot_shipping.php
===================================================================
--- trunk/catalog/includes/modules/order_total/ot_shipping.php 2014-02-03 17:52:07 UTC (rev 5105)
+++ trunk/catalog/includes/modules/order_total/ot_shipping.php 2014-02-04 14:28:19 UTC (rev 5106)
@@ -1,14 +1,18 @@
<?php
/**
- @licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
- @portion code Copyright (c) 2002 osCommerce
+ @licence GPL 2005-2012 The osCSS developers - osCSS Open Source E-commerce
@package osCSS-2 <www http://www.oscss.org>
- @version 2.1.1
- @date 02/03/2012, 20:02
+ @version 2.2.0
+ @date 25/05/10, 18:50
@author oscim <mail aur...@os...> <www http://www.oscim.fr>...
[truncated message content] |
|
From: <os...@us...> - 2014-02-03 17:52:11
|
Revision: 5105
http://sourceforge.net/p/oscss/svn/5105
Author: oscim
Date: 2014-02-03 17:52:07 +0000 (Mon, 03 Feb 2014)
Log Message:
-----------
Fix check by unittest
Modified Paths:
--------------
trunk/catalog/admin/includes/classes/drivers/sqlextrafields.php
trunk/catalog/admin/includes/classes/drivers/sqlextrafieldsFactory.php
trunk/catalog/admin/includes/classes/drivers/sqlproduct.php
trunk/catalog/common/classes/datatype_drivers/Data_content.php
trunk/catalog/common/classes/datatype_drivers/Data_product.php
trunk/catalog/includes/classes/ErrorHandlerActive.php
trunk/test/phpunit/Back/sqlxxx/sqlextrafieldsFactoryTest.php
trunk/test/phpunit/Back/sqlxxx/sqlextrafieldsTest.php
trunk/test/phpunit/Back/sqlxxx/sqlproductsTest.php
Modified: trunk/catalog/admin/includes/classes/drivers/sqlextrafields.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlextrafields.php 2014-02-03 15:07:49 UTC (rev 5104)
+++ trunk/catalog/admin/includes/classes/drivers/sqlextrafields.php 2014-02-03 17:52:07 UTC (rev 5105)
@@ -44,6 +44,9 @@
self::PrepaDataAfterUse( $specimen , $dataarray, array() );
$_data_array = self::GetSqlArray();
+
+ unset($_data_array['date_added']);
+ unset($_data_array['last_modified']);
if(isset($_data_array['id']))
unset($_data_array['id']);
@@ -73,7 +76,6 @@
else
$error++;
-
if( $error > 0){
$DB->rollbackTransaction();
return false;
@@ -109,7 +111,10 @@
self::PrepaDataAfterUse( $specimen , $dataarray, array() );
$_data_array = self::GetSqlArray();
-
+
+ unset($_data_array['date_added']);
+ unset($_data_array['last_modified']);
+
if(isset($_data_array['id']))
unset($_data_array['id']);
@@ -119,8 +124,6 @@
$DB->beginTransaction();
-
-
if( count($sql_data_array) > 0){
// $sql_data_array['fields_type'] = self::$fields_type;
Modified: trunk/catalog/admin/includes/classes/drivers/sqlextrafieldsFactory.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlextrafieldsFactory.php 2014-02-03 15:07:49 UTC (rev 5104)
+++ trunk/catalog/admin/includes/classes/drivers/sqlextrafieldsFactory.php 2014-02-03 17:52:07 UTC (rev 5105)
@@ -39,7 +39,7 @@
*/
public static function update($option){
- if(/*!isset($option['key']) &&*/ !isset($option['id']))
+ if(!isset($option['id']))
return false;
self::SetFieldType(self::$data);
Modified: trunk/catalog/admin/includes/classes/drivers/sqlproduct.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlproduct.php 2014-02-03 15:07:49 UTC (rev 5104)
+++ trunk/catalog/admin/includes/classes/drivers/sqlproduct.php 2014-02-03 17:52:07 UTC (rev 5105)
@@ -140,7 +140,10 @@
$sql_data_array = self::GetSqlArray();
$sql_data_array_lg = self::GetSqlArrayLg();
-
+ // clean return date
+ unset( $sql_data_array['date_added'] );
+ unset( $sql_data_array['last_modified'] );
+
if(( $origin = self::fetch(array('id'=>$products_id), true) ) && !$origin )
$action = 'insert_product';
else
@@ -161,12 +164,10 @@
if(count($sql_data_array) > 0 || count($sql_data_array_lg) ){
$sql_data_array['products_last_modified'] ='now()';
$sql_data_array = array_merge($sql_data_array, $modules->get_update_table_products());
-
if( ! tep_db_perform(TABLE_PRODUCTS, $sql_data_array, 'update',"products_id = '" . (int)$products_id . "'") )
$error++;
}
-
// language table
if( $error <= 0)
if(isset($sql_data_array_lg['lg']) && count($sql_data_array_lg['lg']) > 0){
@@ -208,7 +209,6 @@
}
}
}
-
/*
Use transversal Datatype Rootlisting and update in data
@@ -222,7 +222,6 @@
}
}
-
if($error ==0 ) {
/// Separate Pricing Per Customer
$customers_group_query = $DB->query("select customers_group_id, customers_group_name from " . TABLE_CUSTOMERS_GROUPS . " where customers_group_id != '0' order by customers_group_id");
Modified: trunk/catalog/common/classes/datatype_drivers/Data_content.php
===================================================================
--- trunk/catalog/common/classes/datatype_drivers/Data_content.php 2014-02-03 15:07:49 UTC (rev 5104)
+++ trunk/catalog/common/classes/datatype_drivers/Data_content.php 2014-02-03 17:52:07 UTC (rev 5105)
@@ -76,7 +76,7 @@
" LEFT JOIN " . TABLE_CONTENT_DESCRIPTION . " ".$this->p."d ON( ".$this->p."d.content_id = ".$this->p.".content_id AND ".$this->p."d.language_id = '" . (int)$languages_id . "' ) ".
"";
- $this->listing_sql['where'] = " WHERE ".DataForceStatus(" ".$this->p.".content_status='1' ")." AND ".$this->p."d.content_title <>'' ";
+ $this->listing_sql['where'] = " WHERE ".DataForceStatus(" ".$this->p.".content_status='1' ")." ";
$this->listing_sql['groupby'] = " ".$this->p.".content_id ";
@@ -129,11 +129,11 @@
return true;
break;
case 'cpath':
- if( isset($_GET['content']) && is_numeric($_GET['content']) )
+ if( isset($_GET['content']) )
return true;
break;
case 'unique':
- if(isset($_GET['content']) && ( is_int($_GET['content']) || is_numeric($_GET['content'])) )
+ if(isset($_GET['content']) && ( (int)$_GET['content']>0) )
return true;
break;
}
@@ -308,7 +308,7 @@
DataTypes::transversal('transversal');
if ( ($objectContent =content::get_item((int)$_GET['content'])) ==false )
- tep_redirect(tep_href_link('','ServerError=404') );
+ return tep_redirect(tep_href_link('','ServerError=404') );
$linkcat = $objectContent->GetLinkTo('categorie');
Modified: trunk/catalog/common/classes/datatype_drivers/Data_product.php
===================================================================
--- trunk/catalog/common/classes/datatype_drivers/Data_product.php 2014-02-03 15:07:49 UTC (rev 5104)
+++ trunk/catalog/common/classes/datatype_drivers/Data_product.php 2014-02-03 17:52:07 UTC (rev 5105)
@@ -149,7 +149,7 @@
$this->listing_sql['leftto']['tables'] .= " LEFT JOIN " . TABLE_PRODUCTS_DESCRIPTION . " ".$this->p."d ON( ".$this->p."d.products_id = ".$this->p.".products_id AND ".$this->p."d.language_id = '%3\$s' )";
- $this->listing_sql['leftto']['groupby'] = ", ".$this->p."data.datatype_child_id = %1\$s, ".$this->p."data.datatype_child='%2\$s' ";
+ $this->listing_sql['leftto']['groupby'] = ", ".$this->p."data.datatype_child_id , ".$this->p."data.datatype_child ";
return $this->listing_sql['leftto'];
}
@@ -589,8 +589,8 @@
$_SESSION['recently_viewed']['product'] = $recently_viewed;
}
-// $page->product->pile_img[]=$product_info['products_image'];
- $page_content = $page->force_content('product_info.php');
+ $page_content = 'product_info.php';
+ $page->force_content($page_content);
$page->SetVar('current_object', $objectProduct);
Modified: trunk/catalog/includes/classes/ErrorHandlerActive.php
===================================================================
--- trunk/catalog/includes/classes/ErrorHandlerActive.php 2014-02-03 15:07:49 UTC (rev 5104)
+++ trunk/catalog/includes/classes/ErrorHandlerActive.php 2014-02-03 17:52:07 UTC (rev 5105)
@@ -53,7 +53,7 @@
$obj = self::getInstance();
if( in_array(getenv('OSCSS_ENVIRONEMENT'), array('autotesting','testing','developpement')) ){
- include(DIR_FS_CATALOG.DIR_WS_COMMON_CLASSES.'ErrorHandler_drivers/MockWriter.php');
+ require_once(DIR_FS_CATALOG.DIR_WS_COMMON_CLASSES.'ErrorHandler_drivers/MockWriter.php');
self::$mock=new MockWriter();
$obj->attach(self::$mock);
}
Modified: trunk/test/phpunit/Back/sqlxxx/sqlextrafieldsFactoryTest.php
===================================================================
--- trunk/test/phpunit/Back/sqlxxx/sqlextrafieldsFactoryTest.php 2014-02-03 15:07:49 UTC (rev 5104)
+++ trunk/test/phpunit/Back/sqlxxx/sqlextrafieldsFactoryTest.php 2014-02-03 17:52:07 UTC (rev 5105)
@@ -62,7 +62,7 @@
public function testextrafieldsFactoryCreat( $specimen ){
- $id = sqlextrafieldsFactory::create($specimen['sqlarray']);
+ $id = sqlextrafieldsFactory::create($specimen);
$this -> assertTrue ( ((int)$id >0) , 'Error extrafieldsFactory not create' ) ;
@@ -99,7 +99,11 @@
*/
public function testextrafieldsFactoryUpdate( $specimen ){
- $res = sqlextrafieldsFactory::update($specimen);
+ $array = array(
+ 'id'=>$specimen['id'],
+ 'sqlarray'=>$specimen
+ );
+ $res = sqlextrafieldsFactory::update($array);
$this -> assertTrue ( ($res == 1) , 'Error extrafieldsFactory not update' ) ;
Modified: trunk/test/phpunit/Back/sqlxxx/sqlextrafieldsTest.php
===================================================================
--- trunk/test/phpunit/Back/sqlxxx/sqlextrafieldsTest.php 2014-02-03 15:07:49 UTC (rev 5104)
+++ trunk/test/phpunit/Back/sqlxxx/sqlextrafieldsTest.php 2014-02-03 17:52:07 UTC (rev 5105)
@@ -62,7 +62,7 @@
public function testextrafieldsCreat( $specimen ){
- $id = sqlextrafields::create($specimen['sqlarray']);
+ $id = sqlextrafields::create($specimen);
$this -> assertTrue ( ((int)$id >0) , 'Error extrafields not create' ) ;
@@ -98,9 +98,12 @@
* @depends testextrafieldsFetch
*/
public function testextrafieldsUpdate( $specimen ){
+ $array = array(
+ 'id'=>$specimen['id'],
+ 'sqlarray'=>$specimen
+ );
+ $res = sqlextrafields::update($array);
- $res = sqlextrafields::update($specimen);
-
$this -> assertTrue ( ($res == 1) , 'Error extrafields not update' ) ;
return $specimen;
Modified: trunk/test/phpunit/Back/sqlxxx/sqlproductsTest.php
===================================================================
--- trunk/test/phpunit/Back/sqlxxx/sqlproductsTest.php 2014-02-03 15:07:49 UTC (rev 5104)
+++ trunk/test/phpunit/Back/sqlxxx/sqlproductsTest.php 2014-02-03 17:52:07 UTC (rev 5105)
@@ -70,11 +70,9 @@
$res = sqlproduct::create( $specimen );
- $id=$res;
+ $this -> assertTrue ( ($res > 0) , 'Error product not create' ) ;
- $this -> assertTrue ( ($res >0) , 'Error product not create' ) ;
-
- $specimen['id'] = $id;
+ $specimen['id'] = $res;
return $specimen;
}
@@ -126,13 +124,13 @@
$array=array(
'id'=>$tmp['products_id'],
'sqlarray'=>sqlproduct::ExtractForm($specimen),
- 'post'=>$specimen,
+ 'post'=>$tmp,
);
$res = sqlproduct::update($array);
- $this -> assertTrue ( ($res == 1) , 'Error product not update' ) ;
+ $this -> assertTrue ( $res == 1 , 'Error product not update' ) ;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|