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-15 16:51:15
|
Revision: 5154
http://sourceforge.net/p/oscss/svn/5154
Author: oscim
Date: 2014-02-15 16:51:13 +0000 (Sat, 15 Feb 2014)
Log Message:
-----------
Fix
Modified Paths:
--------------
trunk/catalog/common/classes/datatype_drivers/Data_categorie.php
trunk/catalog/common/classes/order.php
trunk/catalog/common/classes/shoppingCart.php
Modified: trunk/catalog/common/classes/datatype_drivers/Data_categorie.php
===================================================================
--- trunk/catalog/common/classes/datatype_drivers/Data_categorie.php 2014-02-15 16:14:54 UTC (rev 5153)
+++ trunk/catalog/common/classes/datatype_drivers/Data_categorie.php 2014-02-15 16:51:13 UTC (rev 5154)
@@ -441,6 +441,7 @@
$obj->image = $categories->GetImage();
$obj->name = $categories->GetTitle();
$obj->description = $categories->GetText();
+ $obj->href = $categories->GetHref();
$page->SetVar('RootListing',$obj);
$page->SetVar('current_id',$current_category_id);
Modified: trunk/catalog/common/classes/order.php
===================================================================
--- trunk/catalog/common/classes/order.php 2014-02-15 16:14:54 UTC (rev 5153)
+++ trunk/catalog/common/classes/order.php 2014-02-15 16:51:13 UTC (rev 5154)
@@ -378,7 +378,8 @@
global $languages_id, $currency, $currencies, /*$shipping,*/ $payment,$tax_address,$coupon_sav, $shipping_mod, $shipping_modules;
$this->content_type = $cart->get_content_type();
-
+// print_r($shipping);
+// exit;
$customer_address_query = tep_db_query("select c.customers_firstname, c.customers_lastname, c.customers_telephone, c.customers_email_address, ab.entry_company, ab.entry_street_address, ab.entry_suburb, ab.entry_postcode, ab.entry_city, ab.entry_zone_id, z.zone_name, co.countries_id, co.countries_name, co.countries_iso_code_2, co.countries_iso_code_3, co.address_format_id, ab.entry_state from " . TABLE_CUSTOMERS . " c, " . TABLE_ADDRESS_BOOK . " ab left join " . TABLE_ZONES . " z on (ab.entry_zone_id = z.zone_id) left join " . TABLE_COUNTRIES . " co on (ab.entry_country_id = co.countries_id) where c.customers_id = '" . (int)$customer_id . "' and ab.customers_id = '" . (int)$customer_id . "' and c.customers_default_address_id = ab.address_book_id");
$customer_address = tep_db_fetch_array($customer_address_query);
@@ -400,10 +401,14 @@
// '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_carrier' => $shipping['carrier'],
'shipping_method' => $shipping['title'],
'shipping_cost_ht' => (isset($shipping['cost_ht'])? $shipping['cost_ht']:0),
'shipping_cost' => $shipping['cost'],
'shipping_tax' => (isset($shipping['shipping_tax_total'])?$shipping['shipping_tax_total']:0),
+
+
'subtotal_ht' => 0,
'subtotal_taxe' => 0,
'subtotal' => 0,
@@ -421,10 +426,10 @@
}
- list($module, $method) = explode('_', @$shipping['id']);
+// list($module, $method) = explode('_', @$shipping['id']);
$this->mod = array(
- 'class_payment'=> $payment,
- 'class_shipping'=> $module
+ 'class_payment'=> $payment,
+ 'class_shipping'=> $shipping['id']
);
$this->customer = array('id' => (int)$customer_id,
@@ -555,7 +560,8 @@
$index++;
}
- if( is_object( $this->coupon ) ) $this->info = $this->coupon->finalize_discount($this->info);
+ if( is_object( $this->coupon ) )
+ $this->info = $this->coupon->finalize_discount($this->info);
}
@@ -577,6 +583,26 @@
case 'weight';
$value_check = $this->info['total_weight'];
break;
+
+
+ case 'subtotal_taxe';
+ case 'tax';
+ $value_check = $this->info['subtotal'];
+ break;
+
+ case 'subtotal';
+ $value_check = $this->info['subtotal'];
+ break;
+ case 'subtotal_ht';
+ $value_check = $this->info['subtotal_ht'];
+ break;
+
+
+ case 'total_ht';
+ $value_check = $this->info['total_ht'];
+ break;
+
+ case 'total';
case 'price';
default:
$value_check = $this->info['total'];
Modified: trunk/catalog/common/classes/shoppingCart.php
===================================================================
--- trunk/catalog/common/classes/shoppingCart.php 2014-02-15 16:14:54 UTC (rev 5153)
+++ trunk/catalog/common/classes/shoppingCart.php 2014-02-15 16:51:13 UTC (rev 5154)
@@ -47,8 +47,12 @@
@var stock data current user stocked in session , is object CartStockage
*/
protected static $_session;
+ /**
+ @var array list of major/minor total cart price
+ Use by shipping, payment, coupon, ..
+ */
+ protected $_AppliInTotal = array();
-
/**
*/
function __construct() {
@@ -98,8 +102,6 @@
@return result of method
*/
protected function CallerStockageExe(CartSession $obj, $method, $args){
-
-
return $obj->$method($args);
}
@@ -129,6 +131,13 @@
}
+ // applie major/minor in total cart or total weight
+ foreach($this->_AppliInTotal as $key=>$row)
+ if($row->action == '+')
+ $this->total += $row->valueprice;
+ elseif($row->action == '-')
+ $this->total -= $row->valueprice;
+
if(!isset($this->cartID )) $this->cartID = $this->generate_cart_id();
}
@@ -157,6 +166,7 @@
function reset($reset_database = false) {
$this->total = 0;
+ $this->_AppliInTotal = 0;
$this->weight = 0;
$this->content_type = false;
@@ -180,23 +190,23 @@
if (!tep_session_is_registered('customer_id'))
return false;
+ self::$_session = new CartStockageCustomer();
-
// force call Normal CartStockage in session for replace in selected Cart
$obj = new CartStockage();
- $list = $this->CallerStockageExe( $obj , 'Get', array()); //$this->session;
+ $list = $this->CallerStockageExe( $obj , 'Get', array());
foreach($list as $stringpid=>$row){
$this->CallerStockageExe (self::$_session, 'Set', array(
$stringpid,
- $row
+ (int)$row
)
);
if( isset($row['attributes']) )
$this->CallerStockageExe (self::$_session, 'SetAttribute', array(
$stringpid,
- $row
+ (int)$row
)
);
@@ -457,6 +467,22 @@
}
/**
+ @fn SetInTotal( $object )
+ @brief put in cart major/minor action in total price
+ @return true OK / False Ko
+ */
+ public function SetInTotal( $object ){
+ if(is_object($object)) {
+ if( !isset( $this->_AppliInTotal[$object->id] ))
+ $this->_AppliInTotal[$object->id] = $object;
+
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
@fn GetTotal();
@brief GetTotal()
@return Total price
@@ -470,9 +496,12 @@
case 'item';
$value_check = $this->count_contents();
break;
+
case 'weight';
$value_check = $this->weight;
break;
+
+ case 'total';
case 'price';
default:
$value_check = $this->total;
@@ -655,7 +684,13 @@
foreach($grp as $line)
$list[] = $line;
}
-
+
+ //! load order
+// $order = new order;
+// $ObjectShipping = shipping::resetInstance();
+// $ObjectShipping->SetObjectRef( $this );
+// $ObjectShipping->cheapset();
+
$this->DC->products=$list;
$this->DC->hidden=$hidden;
$this->DC->any_out_of_stock=$any_out_of_stock;
@@ -704,9 +739,20 @@
return $list;
}
+ public function ShowShippingHelp(){
+ $order = new order();
+ $shipping = new shipping();
+
+// $this->ListTotal = strip_tags($this->show_total());
+// $list = $this->otm->_extents('show_list_total');
+ return $shipping->ShowShipping('cart');
+ }
+
+
+
/**
@fn generate_cart_id($length = 5)
@brief generate uniq id for current cart
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2014-02-15 16:14:59
|
Revision: 5153
http://sourceforge.net/p/oscss/svn/5153
Author: oscim
Date: 2014-02-15 16:14:54 +0000 (Sat, 15 Feb 2014)
Log Message:
-----------
Fix
Next work clean file and add comment
Next work implement new interface, listeners and class in shipping process and next step
Modified Paths:
--------------
trunk/catalog/admin/includes/classes/ModTree.php
trunk/catalog/admin/includes/classes/ModTreePage.php
trunk/catalog/admin/includes/classes/drivers/sqlcontent.php
trunk/catalog/ajax_exe.php
trunk/catalog/checkout_confirmation.php
trunk/catalog/checkout_shipping.php
trunk/catalog/includes/classes/ErrorHandlerActive.php
trunk/catalog/includes/classes/ModPublicOneShipping.php
trunk/catalog/includes/classes/breadcrumb.php
trunk/catalog/includes/classes/core_page/develop.php
trunk/catalog/includes/classes/core_page/listing.php
trunk/catalog/includes/classes/drivers/page/GabaritTemplate.php
trunk/catalog/includes/classes/navigation_history.php
trunk/catalog/includes/classes/order_total.php
trunk/catalog/includes/classes/shipping.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_total.php
trunk/catalog/templates/defaut/Childs_tpl/content.php
Modified: trunk/catalog/admin/includes/classes/ModTree.php
===================================================================
--- trunk/catalog/admin/includes/classes/ModTree.php 2014-02-15 07:15:39 UTC (rev 5152)
+++ trunk/catalog/admin/includes/classes/ModTree.php 2014-02-15 16:14:54 UTC (rev 5153)
@@ -399,9 +399,8 @@
$i++;
}
}
-// print_r(self::$InitInfo);
-// exit;
+
self::$InitInfo['modele']['listing']['action']=false;
self::$InitInfo['theader']['listing']['action']= array( 'class'=>'row_action', 'txt'=>__('@'.self::$code.' table heading action') );
self::$InitInfo['tfooter']['listing']['action']= array( 'class'=>'row_action', 'txt'=>__('@'.self::$code.' table heading action') );
@@ -848,15 +847,15 @@
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);
+ $exclude=array('action','cID','forceajax','type','class','file','flag','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') ) . '">'.
+ return '<a class="ajaxinline" href="' . tep_href_link($FileName, tep_get_all_get_params($exclude).$query_s.(( (int)$item[$flag] == 1)? 0 : 1) ) . '">'.
sprintf(
CsrtAction::getFormat($type),
(int)$item[$flag],
- ( ($item[$flag] == '1')? IMAGE_ICON_STATUS_GREEN : IMAGE_ICON_STATUS_RED)
+ ( ((int)$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-15 07:15:39 UTC (rev 5152)
+++ trunk/catalog/admin/includes/classes/ModTreePage.php 2014-02-15 16:14:54 UTC (rev 5153)
@@ -315,9 +315,6 @@
if($res ===false || count($res)<=1)
tep_redirect(tep_href_link($class::FILENAME, 'action=insert'));
- // load data if not loaded
- if(!is_object($class::$Info))
- $class::$Info = $class::GetDBValue();
break;
@@ -385,6 +382,10 @@
default:
+ // load data if not loaded
+ if(!is_object($class::$Info))
+ $class::$Info = $class::GetDBValue();
+
// trigger event
EventsHandlerActive::Triggers(
array(
@@ -396,6 +397,19 @@
}
}
+
+ public static function GenericGetDbValue($action){
+ $class=self::GetClassName();
+ $sqlclass='sql'.self::GetClassDatatype();
+
+ switch($action){
+ default:
+ // load data if not loaded
+ if(!is_object($class::$Info))
+ return $class::GetDBValue();
+ }
+ }
+
/**
@fn GenericDisplay()
@brief Generic Display for process normal action normalized
@@ -422,9 +436,8 @@
case 'setflag':
$action = '';
+ $res = $class::RowStatus(array('status'=>(int)$_GET['flag'], 'id'=>(int)$class::$Id));
- $res = $class::RowStatus(array('status'=>(int)$class::$Info->status, 'id'=>(int)$class::$Id));
-
if($view)
return $res;
else
@@ -432,7 +445,7 @@
break;
case 'viewflag':
$action = '';
- $res = $class::RowHidden(array('hidden'=>(int)$class::$Info->hidden, 'id'=>(int)$class::$Id));
+ $res = $class::RowHidden(array('hidden'=>(int)$_GET['flag'], 'id'=>(int)$class::$Id));
if($view)
return $res;
@@ -558,8 +571,7 @@
@return bool flase or array
*/
public static function GetEditFieldsDefine($key){
-// print_r(self::$InitInfo['edit']['listing']);
-// exit;
+
if(isset(self::$InitInfo['edit']['listing']['edit_'.$key] ) )
return self::$InitInfo['edit']['listing']['edit_'.$key];
Modified: trunk/catalog/admin/includes/classes/drivers/sqlcontent.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlcontent.php 2014-02-15 07:15:39 UTC (rev 5152)
+++ trunk/catalog/admin/includes/classes/drivers/sqlcontent.php 2014-02-15 16:14:54 UTC (rev 5153)
@@ -271,13 +271,14 @@
if(isset($option['language_id']) && $option['language_id'] > 0)
- $content_query = $DB->query("select cd.content_text, cd.content_title from " . TABLE_CONTENT_DESCRIPTION . " cd where cd.content_id = '" . (int)$row['content_id'] . "' AND language_id='" . (int)$option['language_id'] . "'");
+ $content_query = $DB->query("select * from " . TABLE_CONTENT_DESCRIPTION . " cd where cd.content_id = '" . (int)$row['content_id'] . "' AND language_id='" . (int)$option['language_id'] . "'");
else
- $content_query = $DB->query("select cd.content_text, cd.content_title from " . TABLE_CONTENT_DESCRIPTION . " cd where cd.content_id = '" . (int)$row['content_id'] . "' ");
+ $content_query = $DB->query("select * from " . TABLE_CONTENT_DESCRIPTION . " cd where cd.content_id = '" . (int)$row['content_id'] . "' ");
$row['lg'] = array();
foreach($content_query->fetchAllAssoc() as $item){
- $row['lg'][$item['language_id']] = ((!$shortkey)? $item : self::CleanKey($item)) ;
+ $tmp = ((!$shortkey)? $item : self::CleanKey($item)) ;
+ $row['lg'][$item['language_id']] = $tmp;
}
tep_db_free_result($content_query);
@@ -386,8 +387,7 @@
'date_added' => '',
'last_modified' => '',
'content_status' => '',
- 'categories' => array(),
-
+
'lg' =>$tmp_lg,
'mod'=>$modules->Specimen($shortkey), // other external sub module
Modified: trunk/catalog/ajax_exe.php
===================================================================
--- trunk/catalog/ajax_exe.php 2014-02-15 07:15:39 UTC (rev 5152)
+++ trunk/catalog/ajax_exe.php 2014-02-15 16:14:54 UTC (rev 5153)
@@ -1,14 +1,15 @@
<?php
/**
- *\licence GPL 2005-2010 The osCSS developers - osCSS Open Source E-commerce
- *\portion code Copyright (c) 2002 osCommerce
- *\package osCSS-2 <www http://www.oscss.org>
- @version 2.1.1
- @date 20/10/11, 11:25
- *\author oscim <mail aur...@os...> <www http://www.oscim.fr>
- *\encode UTF-8
- *\file ajax_exe.php
- *\brief prise en charge action et affichage via ajax
+ @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 20/10/11, 11:25
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+ @file ajax_exe.php
+ @dir /
+ @brief prise en charge action et affichage via ajax
*/
require('includes/application_top.php');
Modified: trunk/catalog/checkout_confirmation.php
===================================================================
--- trunk/catalog/checkout_confirmation.php 2014-02-15 07:15:39 UTC (rev 5152)
+++ trunk/catalog/checkout_confirmation.php 2014-02-15 16:14:54 UTC (rev 5153)
@@ -58,8 +58,8 @@
- $Object_shipping= new shipping();
- $shipping_module = $Object_shipping->GetSelected($shipping);
+ $Object_shipping= shipping::getInstance();
+ $shipping_module = $Object_shipping->GetSelected();
// var_dump($shipping_modules);
//! mise a jour status payment
$tt=$payment_modules->update_status();
Modified: trunk/catalog/checkout_shipping.php
===================================================================
--- trunk/catalog/checkout_shipping.php 2014-02-15 07:15:39 UTC (rev 5152)
+++ trunk/catalog/checkout_shipping.php 2014-02-15 16:14:54 UTC (rev 5153)
@@ -100,13 +100,7 @@
tep_session_unregister('shipping');
else {
$shipping =$ObjectShipping->GetSelected();
-// if ( (isset($quote[0]['methods'][0]['title'])) && (isset($quote[0]['methods'][0]['cost'])) ) {
-// $shipping = array('id' => $postshipping,
-// 'title' => $quote[0]['module'] . ' (' . $quote[0]['methods'][0]['title'] . ')',
-// 'cost_ht' => $quote[0]['methods'][0]['cost_ht'],
-// 'cost' => $quote[0]['methods'][0]['cost']);
- tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
-// }
+ tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
}
}
else{
@@ -123,9 +117,6 @@
}
}
-// get all available shipping quotes
-// $quotes = $ObjectShipping->quote();
-
// if no shipping method has been selected, automatically select the cheapest method. if the modules status was changed when none were available, to save on implementing a javascript force-selection method, also automatically select the cheapest shipping method if more than one module is now enabled
if ( !tep_session_is_registered('shipping') || ( tep_session_is_registered('shipping') && ($shipping == false) && (tep_count_shipping_modules() > 1) ) ){
$shipping = $ObjectShipping->cheapest();
Modified: trunk/catalog/includes/classes/ErrorHandlerActive.php
===================================================================
--- trunk/catalog/includes/classes/ErrorHandlerActive.php 2014-02-15 07:15:39 UTC (rev 5152)
+++ trunk/catalog/includes/classes/ErrorHandlerActive.php 2014-02-15 16:14:54 UTC (rev 5153)
@@ -43,6 +43,9 @@
*/
protected static $mock;
+ public static function GetMock(){
+ return self::$mock;
+ }
/**
@fn start()
@public and init process for ErrorHandler if OSCSS_GARBAGE_ERROR is true
@@ -52,11 +55,11 @@
public static function start() {
$obj = self::getInstance();
- if( in_array(getenv('OSCSS_ENVIRONEMENT'), array('autotesting','testing','developpement')) ){
- require_once(DIR_FS_CATALOG.DIR_WS_COMMON_CLASSES.'ErrorHandler_drivers/MockWriter.php');
- self::$mock=new MockWriter();
- $obj->attach(self::$mock);
- }
+// if( in_array(getenv('OSCSS_ENVIRONEMENT'), array('autotesting', 'testing', 'developpement')) ){
+ require_once(DIR_FS_CATALOG.DIR_WS_COMMON_CLASSES.'ErrorHandler_drivers/MockWriter.php');
+ self::$mock=new MockWriter();
+ $obj->attach(self::$mock);
+// }
//! init Exception
set_exception_handler('exception_handler');
Modified: trunk/catalog/includes/classes/ModPublicOneShipping.php
===================================================================
--- trunk/catalog/includes/classes/ModPublicOneShipping.php 2014-02-15 07:15:39 UTC (rev 5152)
+++ trunk/catalog/includes/classes/ModPublicOneShipping.php 2014-02-15 16:14:54 UTC (rev 5153)
@@ -232,9 +232,7 @@
$value = constant($NameVarConfig);
- if(!is_object($obj))
- var_dump($obj);
-
+
$this->value_total = 0;
$value_check = 0;
switch($value){
Modified: trunk/catalog/includes/classes/breadcrumb.php
===================================================================
--- trunk/catalog/includes/classes/breadcrumb.php 2014-02-15 07:15:39 UTC (rev 5152)
+++ trunk/catalog/includes/classes/breadcrumb.php 2014-02-15 16:14:54 UTC (rev 5153)
@@ -66,6 +66,8 @@
$trail_string = '';
+ $i = 0;
+ $n =count($this->_trail);
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>';
@@ -76,6 +78,7 @@
if (($i+1) < $n) $link .= $separator;
$trail_string .=sprintf($format, $link);
+ $i++;
}
return $trail_string;
Modified: trunk/catalog/includes/classes/core_page/develop.php
===================================================================
--- trunk/catalog/includes/classes/core_page/develop.php 2014-02-15 07:15:39 UTC (rev 5152)
+++ trunk/catalog/includes/classes/core_page/develop.php 2014-02-15 16:14:54 UTC (rev 5153)
@@ -1,12 +1,14 @@
<?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 14/03/2012, 17:46
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
+ @file develop.php
+ @dir includes/classes/core_page/
*/
class develop{
@@ -18,8 +20,9 @@
public function draw_block(){
error_reporting(0);
- global $page,$mock;
+ global $page;
+ $mock=ErrorHandlerActive::GetMock();
/// list All mod no type
reset($page->page['modules']);
@@ -212,13 +215,14 @@
color:black;
line-height:17px;
background:white none repeat scroll 0 0;
- border:1px solid black;
+ border:1px solid black;
padding:1em;
position:fixed;
right:0;
top:0;
font-size:14px;
padding:3px; margin:0;
+ z-index:99999999999;
}
#develop:hover{
opacity:0.8;
@@ -239,6 +243,7 @@
height:50%;
background:white;
border:2px solid black;
+ z-index:99999999999;
}
#DevContent{clear:both;display:block;position:relative;width:100%;min-height:250px;height:100%;overflow:auto;}
#view-box .DevBar {width:100%; height:25px; text-align:center; background:black; color:white;}
@@ -254,7 +259,8 @@
#view-box .TextDevelop {min-height: 300px;height: 300px;
overflow: auto;
padding: 1em;
- position: relative;}
+ position: relative;
+ }
/* END Block debugg public template */
</style>
Modified: trunk/catalog/includes/classes/core_page/listing.php
===================================================================
--- trunk/catalog/includes/classes/core_page/listing.php 2014-02-15 07:15:39 UTC (rev 5152)
+++ trunk/catalog/includes/classes/core_page/listing.php 2014-02-15 16:14:54 UTC (rev 5153)
@@ -133,7 +133,6 @@
$query = 'SELECT DISTINCT '.
$listing['col_count'] . ' as id'.
- ' ,p.products_id '.
' '. sprintf($listing['tables'], $listing['col_count'] , self::$type_object, $languages_id ).
' '. $listing['where'].
'';
Modified: trunk/catalog/includes/classes/drivers/page/GabaritTemplate.php
===================================================================
--- trunk/catalog/includes/classes/drivers/page/GabaritTemplate.php 2014-02-15 07:15:39 UTC (rev 5152)
+++ trunk/catalog/includes/classes/drivers/page/GabaritTemplate.php 2014-02-15 16:14:54 UTC (rev 5153)
@@ -1,18 +1,23 @@
<?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 09/12/2012, 00:44
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
+ @file GabaritTemplate.php
+ @dir includes/classes/drivers/page/
+*/
+
+
+/**
@class GabaritTemplate
@brief Adjust conportement for master construct public page
This class it's basic load for osCSS
It's possible add new class for modifie process and determine conportement this master class constructor.
*/
-
class GabaritTemplate
extends page
{
@@ -97,6 +102,8 @@
// reel normal page
$reel = substr($page->page['content'],0,-4);
$basename = array(
+ $page->page['type'],
+ $page->page['type'].'.template' ,
$reel,
$reel.'.template' ,
'template',
@@ -113,6 +120,7 @@
// array suffixe name
foreach($suffixe as $suf){
$test = str_replace(array('%1%.','%2%.','%3%'), array('',$suf.'.',$name), $format_file);
+
if( parent::TestFile($path . $test) ){
$page->page['gabarit']= $test ;
return parent::$GlobalCache['gabarit']=$page->page['gabarit'];
@@ -286,8 +294,11 @@
@var content childs
*/
protected $content;
+ /**
+ @var boolean block or no display
+ */
+ protected $_continue = true;
-
function __construct($content, $title =''){
$this->title = $title;
@@ -311,5 +322,13 @@
function GetContent(){
return $this->content;
}
+
+ function SetContinue($continue){
+ $this->_continue = $continue;
+ }
+
+ function GetContinue(){
+ return $this->_continue;
+ }
}
?>
\ No newline at end of file
Modified: trunk/catalog/includes/classes/navigation_history.php
===================================================================
--- trunk/catalog/includes/classes/navigation_history.php 2014-02-15 07:15:39 UTC (rev 5152)
+++ trunk/catalog/includes/classes/navigation_history.php 2014-02-15 16:14:54 UTC (rev 5153)
@@ -108,7 +108,7 @@
if(
( isset($this->NoDbl[(self::$_id-1)]) && $array['url'] == $this->NoDbl[(self::$_id-1)] )
- || in_array(trim($page), array('document.php', 'ajax_exe.php', '404.php'))
+ || in_array(trim($page), array('document.php', 'ajax_exe.php', '404.php',FILENAME_LOGOFF))
|| isset($_REQUEST['action'])
|| isset($_REQUEST['cache'])
)
Modified: trunk/catalog/includes/classes/order_total.php
===================================================================
--- trunk/catalog/includes/classes/order_total.php 2014-02-15 07:15:39 UTC (rev 5152)
+++ trunk/catalog/includes/classes/order_total.php 2014-02-15 16:14:54 UTC (rev 5153)
@@ -189,7 +189,7 @@
reset($this->modules);
if(empty($funct)) return;
- return $this->InCart($funct, $class, $array);
+ return $this->InCart($funct, '', $array);
}
/**
Modified: trunk/catalog/includes/classes/shipping.php
===================================================================
--- trunk/catalog/includes/classes/shipping.php 2014-02-15 07:15:39 UTC (rev 5152)
+++ trunk/catalog/includes/classes/shipping.php 2014-02-15 16:14:54 UTC (rev 5153)
@@ -76,49 +76,10 @@
return self::getInstance();
}
- /**
- @fn initialise($module = '')
- @brief class constructor
- @param $module string/empty le nom du module, passé apres choix
- */
- private function initialise($module = '') {
- global $language, $customer_id,$PHP_SELF, $page ,$lang;
- $include_modules = array();
- 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/shipping/' . $mod . '.php',true)) !=false)
- require($path);
- if(($path=$page->fix_file(DIR_WS_MODULES . 'shipping/' . $mod . '.php')) !=false)
- require($path);
-
- $include_modules[] = array_merge($module, array('class' =>$mod) );
- }
- else {
- foreach(parent::initialise_type('MODULE_SHIPPING_INSTALLED','shipping') as $class){
- $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'];
- 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 . "'");
- $customer_ot = tep_db_fetch_array($customer_shipment_query);
- $temp_ot_array= (tep_not_null($customer_ot['shipment_allowed']) ) ? explode(';', $customer_ot['shipment_allowed']) : array() ;
-
- 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']] = new $imod['class'];
- }
- }
- }
-
/**
+ @fn ModExist($module='')
+ @return return true OK ; false KO
*/
public function ModExist($module=''){
if(isset($this->modules[$module]))
@@ -128,6 +89,8 @@
}
/**
+ @fn GetModule($module='')
+ @return object sub module ofr OK or flase KO
*/
public function GetModule($module=''){
if(isset($this->modules[$module]))
@@ -137,15 +100,12 @@
}
/**
+ @fn GetSelected()
+ @brief Get detail methode selected
+ @return false KO , Or OK array
*/
public function GetSelected(){
-// var_dump($this->_module);
-// print_r($this->_quotes);
-// exit;
-
-
if(isset($this->modules[$this->_module])){
-// $sub = $this->modules[$this->_module];
if( count($this->_quotes)>0 )
$quotes_l = $this->_quotes;
@@ -155,29 +115,17 @@
$quotes_l = array($sub->quote($this->_method, $this->ObjectRef));
}
-// if (($quotes = $this->quote($this->_method, $this->_module)) !=false ) {
- foreach($quotes_l as $quotes){
-
-
- foreach($quotes['methods'] as $quote)
-// }
- if (isset($quote['cost']) ) {
-
- return array_merge($quote, array(
- 'id' => $quotes['id'] . '_' . $quote['id'],
- )
- );
- }
-
+ foreach($quotes_l as $quotes){
+ foreach($quotes['methods'] as $quote)
+ if (isset($quote['cost']) ) {
+
+ return array_merge($quote, array(
+ 'id' => $quotes['id'] . '_' . $quote['id'],
+ 'carrier'=>$quotes['module'],
+ )
+ );
+ }
}
-// foreach($this->_quotes['methods'] as $row ){
-//
-// if ($row['id'] == $this->_method ) {
-// $row['module'] = $this->_module;
-// return $row;
-// }
-// }
-// }
}
@@ -299,8 +247,7 @@
global $order, $cart;
foreach($this->modules as $class=>$submod){
-// if (is_object($order) && is_object($cart))
- $submod->update_status( $this->ObjectRef );
+ $submod->update_status( $this->ObjectRef );
if (tep_not_null($module)) {
if ( ($module == $class) && ($submod->GetEnabled()) )
@@ -314,15 +261,14 @@
foreach($include_quotes as $key=>$submod) {
$quotes = $submod->quote($method, $this->ObjectRef);
if (is_array($quotes)){
- $quotes['title'] = $quotes['module'] . ' [' .$quotes['methods'][$i]['id'] . ']' ;
+ $quotes['carrier'] =$quotes['module'];
$quotes_array[] = $quotes;
}
}
}
-// print_r($quotes_array);
-// exit;
+
$this->_quotes = $quotes_array;
-// return $quotes_array;
+
}
/**
@@ -330,10 +276,7 @@
@brief Meilleur methode (la moins chere)
*/
public function cheapest() {
-
-
- if ( count($this->modules) > 0) {
if( count($this->_quotes)<=0 )
$this->quote('',$this->ObjectRef);
@@ -341,25 +284,20 @@
$rates = array();
reset($this->modules);
-// foreach($this->modules as $class=>$module){
-// if (($quotes = $module->quotes) !=false ) {
+
foreach($this->_quotes as $quotes){
-// print_r($quotes);
-// }
-// for ($i=0, $n=sizeof($quotes['methods']); $i<$n; $i++) {
+
foreach($quotes['methods'] as $quote)
-// }
- if (isset($quote['cost']) ) {
-
+
+// $rates[] =$quote;
$rates[] =array_merge($quote, array(
'id' => $quotes['id'] . '_' . $quote['id'],
)
);
- }
-// }
-// }
- }
+ }
+
+
$cheapest = false;
for ($i=0, $n=sizeof($rates); $i<$n; $i++) {
if (is_array($cheapest)) {
@@ -371,8 +309,13 @@
}
}
- return $cheapest;
- }
+ list($module, $method) = explode('_', $cheapest['id']);
+ $this->_method = $method;
+ $this->_module= $module;
+
+
+ return $this->GetSelected();
+
}
/**
@@ -396,13 +339,14 @@
if ($zone_query->__get('numRows')) {
$zone = $zone_query->fetchAssoc();
return $cache[$key]=$zone['geo_zone_id'];
- } else {
+ }
+ else {
// No luck… Now check for a Geo Zone for the country and "All Zones" of the country.
$zone_query = $DB->query("select gz.geo_zone_id from " . TABLE_GEO_ZONES . " gz left join " . TABLE_ZONES_TO_GEO_ZONES . " ztgz on (gz.geo_zone_id = ztgz.geo_zone_id) where ztgz.zone_country_id = '" . (int)$country_id . "' and (ztgz.zone_id = '0' or ztgz.zone_id is NULL) and LOWER(gz.geo_zone_name) like 'shp%'");
if ($zone_query->__get('numRows')) {
- $zone = $zone_query->fetchAssoc();
- return $cache[$key]=$zone['geo_zone_id'];
+ $zone = $zone_query->fetchAssoc();
+ return $cache[$key]=$zone['geo_zone_id'];
}
}
return $cache[$key]=false;
@@ -421,5 +365,47 @@
$title);
}
+
+ /**
+ @fn initialise($module = '')
+ @brief class constructor
+ @param $module string/empty le nom du module, passé apres choix
+ */
+ private function initialise($module = '') {
+ global $language, $customer_id,$PHP_SELF, $page ,$lang;
+
+ $include_modules = array();
+ 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/shipping/' . $mod . '.php',true)) !=false)
+ require($path);
+ if(($path=$page->fix_file(DIR_WS_MODULES . 'shipping/' . $mod . '.php')) !=false)
+ require($path);
+
+ $include_modules[] = array_merge($module, array('class' =>$mod) );
+ }
+ else {
+ foreach(parent::initialise_type('MODULE_SHIPPING_INSTALLED','shipping') as $class){
+ $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'];
+ 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 . "'");
+ $customer_ot = tep_db_fetch_array($customer_shipment_query);
+ $temp_ot_array= (tep_not_null($customer_ot['shipment_allowed']) ) ? explode(';', $customer_ot['shipment_allowed']) : array() ;
+
+ 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']] = new $imod['class'];
+ }
+ }
+ }
}
?>
\ No newline at end of file
Modified: trunk/catalog/includes/modules/order_total/ot_shipping.php
===================================================================
--- trunk/catalog/includes/modules/order_total/ot_shipping.php 2014-02-15 07:15:39 UTC (rev 5152)
+++ trunk/catalog/includes/modules/order_total/ot_shipping.php 2014-02-15 16:14:54 UTC (rev 5153)
@@ -50,6 +50,10 @@
}
}
+ public function Calculate(){
+
+ }
+
/**
@fn process( $order )
@brief calulate and extract data
@@ -62,6 +66,8 @@
$shipping_cost_ht=0;
+
+
$module = substr($order->mod['class_shipping'], 0, strpos($order->mod['class_shipping'], '_'));
if (tep_not_null($order->info['shipping_method'])) {
@@ -78,7 +84,7 @@
$order->info['subtotal_ht'] += $order->info['shipping_cost_ht'];
$this->output[] = $b=array(
- 'title' => $order->info['shipping_method'] . ':',
+ 'title' => $this->title .' -'.$order->info['shipping_carrier'].' -'.$order->info['shipping_method'],
'text_ht' => $currencies->format($shipping_cost_ht, true, $order->info['currency'], $order->info['currency_value']),
'text' => $currencies->format($order->info['shipping_cost'], true, $order->info['currency'], $order->info['currency_value']),
'value_ht' => $order->info['shipping_cost_ht'],
@@ -99,7 +105,8 @@
// set object reference
$ObjectShipping->SetObjectRef( $cart );
// check optimised metdhod
- if ( !tep_session_is_registered('shipping') )
+
+ if ( !tep_session_is_registered('shipping') || !is_array($_SESSION['shipping']) )
$cheapest = $ObjectShipping->cheapest();
else{
$postshipping = $_SESSION['shipping']['id'];
@@ -111,9 +118,15 @@
$cheapest =$ObjectShipping->GetSelected();
}
-
- global $shipping;
- $_SESSION['shipping'] = $shipping = $cheapest;
+ // adjust total in cart , add value of cost
+ $tmp = new stdClass;
+ $tmp->id = __CLASS__;
+ $tmp->action = '+';
+ $tmp->valueprice = $cheapest['cost'];
+ $cart->SetInTotal( $tmp );
+
+ global $shipping;
+ $_SESSION['shipping'] = $shipping = $cheapest;
$this->SetPreOutput(new objectInfo(array(
'text'=>'<a href="#" class="shippingaddbox">'.$this->title ." ??</a><br />".$cheapest['title'],
Modified: trunk/catalog/includes/modules/order_total/ot_subtotal.php
===================================================================
--- trunk/catalog/includes/modules/order_total/ot_subtotal.php 2014-02-15 07:15:39 UTC (rev 5152)
+++ trunk/catalog/includes/modules/order_total/ot_subtotal.php 2014-02-15 16:14:54 UTC (rev 5153)
@@ -58,10 +58,10 @@
public function process( CstrOrder $order , InterfaceCurrencies $currencies){
$this->output[] = array('title' => $this->title . ':',
- 'text_ht' => $currencies->format($order->info['subtotal_ht'], true, $order->info['currency'], $order->info['currency_value']),
- 'text' => $currencies->format($order->info['subtotal'], true, $order->info['currency'], $order->info['currency_value']),
- 'value_ht' => $order->info['subtotal_ht'],
- 'value' => $order->info['subtotal']
+ 'text_ht' => $currencies->format($order->GetTotal('subtotal_ht'), true, $order->info['currency'], $order->info['currency_value']),
+ 'text' => $currencies->format($order->GetTotal('subtotal'), true, $order->info['currency'], $order->info['currency_value']),
+ 'value_ht' => $order->GetTotal('subtotal_ht'), //$order->info['subtotal_ht'],
+ 'value' => $order->GetTotal('subtotal'), //$order->info['subtotal']
);
}
@@ -71,7 +71,7 @@
public function show_list_total(shoppingCart $cart) {
$this->SetPreOutput(new objectInfo(array('text'=>$this->title,
- 'value'=> $cart->ListTotal,
+ 'value'=> $cart->GetTotal('price'),
)
) );
return $this->GetPreOutput();
Modified: trunk/catalog/includes/modules/order_total/ot_total.php
===================================================================
--- trunk/catalog/includes/modules/order_total/ot_total.php 2014-02-15 07:15:39 UTC (rev 5152)
+++ trunk/catalog/includes/modules/order_total/ot_total.php 2014-02-15 16:14:54 UTC (rev 5153)
@@ -27,7 +27,7 @@
, OrderTotalInterface
// add in display cart
-// , OrderTotalCartInterface
+ , OrderTotalCartInterface
{
@@ -38,7 +38,9 @@
if(defined('MODULE_ORDER_TOTAL_TOTAL_SORT_ORDER'))
$this->sort_order= MODULE_ORDER_TOTAL_TOTAL_SORT_ORDER ;
-
+// if(defined('MODULE_ORDER_TOTAL_TAX_ENABLED_CART'))
+// $this->SetShoppingCart(MODULE_ORDER_TOTAL_TAX_ENABLED_CART);
+ $this->SetShoppingCart(true);
}
/**
@@ -51,14 +53,33 @@
public function process( CstrOrder $order , InterfaceCurrencies $currencies) {
$this->output[] = array('title' => $this->title . ':',
- 'text_ht' => '<strong>' . $currencies->format($order->info['total_ht'], true, $order->info['currency'], $order->info['currency_value']) . '</strong>',
- 'text' => '<strong>' . $currencies->format($order->info['total'], true, $order->info['currency'], $order->info['currency_value']) . '</strong>',
- 'value_ht' => $order->info['total_ht'],
- 'value' => round($order->info['total'],2)
+ 'text_ht' => '<strong>' . $currencies->format($order->GetTotal('total_ht'), true, $order->info['currency'], $order->info['currency_value']) . '</strong>',
+ 'text' => '<strong>' . $currencies->format($order->GetTotal('total'), true, $order->info['currency'], $order->info['currency_value']) . '</strong>',
+ 'value_ht' => $order->GetTotal('total_ht'),
+ 'value' => round($order->GetTotal('total'),2)
);
}
+
+
+ /**
+ @implements OrderTotalCartInterface
+ @remarks required by Interface
+ */
+ /**
+ @remarks shopping_cart
+ */
+ public function show_list_total(shoppingCart $cart) {
+ $this->SetPreOutput(new objectInfo(array(
+ 'text'=>$this->title,
+ 'value'=> $cart->GetTotal('price'),
+ )
+ ) );
+ return $this->GetPreOutput();
+ }
+
+
/**
@implements IntMod
@remarks required by Interface
Modified: trunk/catalog/templates/defaut/Childs_tpl/content.php
===================================================================
--- trunk/catalog/templates/defaut/Childs_tpl/content.php 2014-02-15 07:15:39 UTC (rev 5152)
+++ trunk/catalog/templates/defaut/Childs_tpl/content.php 2014-02-15 16:14:54 UTC (rev 5153)
@@ -3,13 +3,16 @@
@licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
@package osCSS-2 <www http://www.oscss.org>
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @version 2.2.0
@encode UTF-8
+ @file content.php
+ @dir templates/defaut/Childs_tpl/
*/
global $page;
require_once($page->oscss_content());
-if(!isset($SectionTplPC) || !is_object($SectionTplPC)) {
+if(!isset($SectionTplPC) || !is_object($SectionTplPC)){
$SectionTplPC = new SectionTpl(
tep_output_string_protected(tep_get_include_contents('pages/'.substr($page->oscss_body_id(),5 )),false,true) ,
__('heading title '.str_replace('_', ' ',substr($page->oscss_body_id(),5 ) ) )
@@ -18,6 +21,9 @@
?>
+
+<?php if( $SectionTplPC->GetContinue() ): ?>
+
<header>
<h1 class="main-content title <?php echo $language ;?>"><?php echo unhtmlentities( $SectionTplPC->GetTitle() ); ?></h1>
</header>
@@ -27,4 +33,6 @@
<?php echo unhtmlentities( $SectionTplPC->GetContent() ) ?>
-</section>
\ No newline at end of file
+</section>
+
+<?php endif; ?>
\ 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-15 07:15:45
|
Revision: 5152
http://sourceforge.net/p/oscss/svn/5152
Author: oscim
Date: 2014-02-15 07:15:39 +0000 (Sat, 15 Feb 2014)
Log Message:
-----------
Clean code and centralise lg in widget
Modified Paths:
--------------
trunk/catalog/admin/includes/languages/fr_FR/Admingroup.txt
trunk/catalog/admin/includes/languages/fr_FR/Content.txt
trunk/catalog/admin/includes/languages/fr_FR/ExtraFields.txt
trunk/catalog/admin/includes/languages/fr_FR/Order.txt
trunk/catalog/admin/includes/widget/AdminGroupsNew.php
trunk/catalog/admin/includes/widget/ContentLast.php
trunk/catalog/admin/includes/widget/orderLast.php
trunk/catalog/admin/includes/widget/salesStats.php
Removed Paths:
-------------
trunk/catalog/admin/includes/languages/fr_FR/widget/AdminGroupsNew.txt
trunk/catalog/admin/includes/languages/fr_FR/widget/ContentLast.txt
trunk/catalog/admin/includes/languages/fr_FR/widget/salesStats.txt
Modified: trunk/catalog/admin/includes/languages/fr_FR/Admingroup.txt
===================================================================
--- trunk/catalog/admin/includes/languages/fr_FR/Admingroup.txt 2014-02-14 15:24:49 UTC (rev 5151)
+++ trunk/catalog/admin/includes/languages/fr_FR/Admingroup.txt 2014-02-15 07:15:39 UTC (rev 5152)
@@ -72,4 +72,12 @@
$lang['image edit']="Editer" ;
$lang['image define groups']="gestion des droits" ;
+
+
+/* Widget */
+ $lang['AdminGroupsNew heading']="Groupes d'utilisateurs" ;
+
+ $lang['AdminGroupsNew box reference']="Réf." ;
+ $lang['AdminGroupsNew box title']="Nom" ;
+ $lang['AdminGroupsNew box nbr_users']="utilisateurs" ;
?>
\ No newline at end of file
Modified: trunk/catalog/admin/includes/languages/fr_FR/Content.txt
===================================================================
--- trunk/catalog/admin/includes/languages/fr_FR/Content.txt 2014-02-14 15:24:49 UTC (rev 5151)
+++ trunk/catalog/admin/includes/languages/fr_FR/Content.txt 2014-02-15 07:15:39 UTC (rev 5152)
@@ -80,6 +80,22 @@
$lang['text info delete cms_content']="Êtes-vous sûr de vouloir supprimer ce contenu ?" ;
+
+/* Widget */
+ $lang['ContentLast heading']="Articles (pages)" ;
+
+ $lang['ContentLast tab added']="Nouveaux" ;
+ $lang['ContentLast tab updated']="Modifiés" ;
+
+ $lang['ContentLast box reference']="Réf." ;
+ $lang['ContentLast box content']="titre" ;
+ $lang['ContentLast box date']="modifié le" ;
+ $lang['ContentLast box status']="Etat" ;
+
+ $lang['ContentLast txt active']="Actif" ;
+ $lang['ContentLast txt inactive']="Inactif" ;
+
+
/* Configuration - Datatype */
/* tab configuration */
@@ -93,4 +109,8 @@
$lang['datatypeconfig heading Configuration du modules']="Options de ce module" ;
+
+
+
+
?>
\ No newline at end of file
Modified: trunk/catalog/admin/includes/languages/fr_FR/ExtraFields.txt
===================================================================
--- trunk/catalog/admin/includes/languages/fr_FR/ExtraFields.txt 2014-02-14 15:24:49 UTC (rev 5151)
+++ trunk/catalog/admin/includes/languages/fr_FR/ExtraFields.txt 2014-02-15 07:15:39 UTC (rev 5152)
@@ -88,6 +88,10 @@
$lang['text delete intro']="Êtes-vous sûr de vouloir supprimer ce champ ?" ;
$lang['text display number of fields']="Afficher %s sur %s" ;
+/* Delete*/
+ $lang['heading title delete']="Suppression d'un champs " ;
+
+
/* entry list */
$lang['text yes']="oui" ;
$lang['text no']="non" ;
Modified: trunk/catalog/admin/includes/languages/fr_FR/Order.txt
===================================================================
--- trunk/catalog/admin/includes/languages/fr_FR/Order.txt 2014-02-14 15:24:49 UTC (rev 5151)
+++ trunk/catalog/admin/includes/languages/fr_FR/Order.txt 2014-02-15 07:15:39 UTC (rev 5152)
@@ -208,6 +208,8 @@
$lang['box title orders']="Commandes" ;
+ /* SaleStats */
+ $lang['box title sales']="Stats des ventes" ;
/* A voir si encoer utilise */
$lang['qty orders']="Cmd" ;
Deleted: trunk/catalog/admin/includes/languages/fr_FR/widget/AdminGroupsNew.txt
===================================================================
--- trunk/catalog/admin/includes/languages/fr_FR/widget/AdminGroupsNew.txt 2014-02-14 15:24:49 UTC (rev 5151)
+++ trunk/catalog/admin/includes/languages/fr_FR/widget/AdminGroupsNew.txt 2014-02-15 07:15:39 UTC (rev 5152)
@@ -1,17 +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 02/03/2012, 20:02
- @author oscim <mail aur...@os...> <www http://www.oscim.fr>
- @encode UTF-8
-*/
-$lang['AdminGroupsNew heading']="Groupes d'utilisateurs" ;
-
-$lang['AdminGroupsNew box reference']="Réf." ;
-$lang['AdminGroupsNew box title']="Nom" ;
-$lang['AdminGroupsNew box nbr_users']="utilisateurs" ;
-
-?>
\ No newline at end of file
Deleted: trunk/catalog/admin/includes/languages/fr_FR/widget/ContentLast.txt
===================================================================
--- trunk/catalog/admin/includes/languages/fr_FR/widget/ContentLast.txt 2014-02-14 15:24:49 UTC (rev 5151)
+++ trunk/catalog/admin/includes/languages/fr_FR/widget/ContentLast.txt 2014-02-15 07:15:39 UTC (rev 5152)
@@ -1,23 +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 02/03/2012, 20:02
- @author oscim <mail aur...@os...> <www http://www.oscim.fr>
- @encode UTF-8
-*/
-$lang['ContentLast heading']="Articles (pages)" ;
-
-$lang['ContentLast tab added']="Nouveaux" ;
-$lang['ContentLast tab updated']="Modifiés" ;
-
-$lang['ContentLast box reference']="Réf." ;
-$lang['ContentLast box content']="titre" ;
-$lang['ContentLast box date']="modifié le" ;
-$lang['ContentLast box status']="Etat" ;
-
-$lang['ContentLast txt active']="Actif" ;
-$lang['ContentLast txt inactive']="Inactif" ;
-?>
\ No newline at end of file
Deleted: trunk/catalog/admin/includes/languages/fr_FR/widget/salesStats.txt
===================================================================
--- trunk/catalog/admin/includes/languages/fr_FR/widget/salesStats.txt 2014-02-14 15:24:49 UTC (rev 5151)
+++ trunk/catalog/admin/includes/languages/fr_FR/widget/salesStats.txt 2014-02-15 07:15:39 UTC (rev 5152)
@@ -1,11 +0,0 @@
-<?php
-/**
- @licence GPL 2005-2010 The osCSS developers - osCSS Open Source E-commerce
- @package osCSS-2 <www http://www.oscss.org>
- @version 2.0.9h
- @date 06/06/10, 15:49
- @author oscim <mail aur...@os...> <www http://www.oscim.fr>
- @encode UTF-8
-*/
-$lang['box title sales']="Stats des ventes" ;
-?>
\ No newline at end of file
Modified: trunk/catalog/admin/includes/widget/AdminGroupsNew.php
===================================================================
--- trunk/catalog/admin/includes/widget/AdminGroupsNew.php 2014-02-14 15:24:49 UTC (rev 5151)
+++ trunk/catalog/admin/includes/widget/AdminGroupsNew.php 2014-02-15 07:15:39 UTC (rev 5152)
@@ -1,14 +1,20 @@
<?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
- @date 02/03/2012, 20:02
+ @version 2.2.0
+ @date 04/07/2013, 10:02
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
+ @file AdminGroupNew.php
+ @dir admin/includes/widget/
*/
+global $conf,$oscss, $language;
+
+$oscss->pile_file_lang(DIR_WS_LANGUAGES . $language . '/Admingroup.txt');
+
$_query = tep_db_query("SELECT g.admin_groups_id as id, g.admin_groups_name as name , COUNT(u.admin_id) as nbr_users FROM ".TABLE_ADMIN_GROUPS ." g LEFT JOIN ". TABLE_ADMIN_USERS . " u ON(g.admin_groups_id = u.admin_groups_id) GROUP BY g.admin_groups_id ORDER BY admin_groups_name ASC LIMIT 5");
if( !$_query->__get('numRows') )
Modified: trunk/catalog/admin/includes/widget/ContentLast.php
===================================================================
--- trunk/catalog/admin/includes/widget/ContentLast.php 2014-02-14 15:24:49 UTC (rev 5151)
+++ trunk/catalog/admin/includes/widget/ContentLast.php 2014-02-15 07:15:39 UTC (rev 5152)
@@ -1,12 +1,14 @@
<?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 11/04/2012, 20:02
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
+ @file ContentLast.php
+ @dir admin/includes/widget/
*/
//! @remarks depend Data_product active
@@ -14,7 +16,10 @@
return false;
global $languages_id, $conf;
+global $conf,$oscss, $language;
+$oscss->pile_file_lang(DIR_WS_LANGUAGES . $language . '/Content.txt');
+
$DB=Database::getInstance();
Modified: trunk/catalog/admin/includes/widget/orderLast.php
===================================================================
--- trunk/catalog/admin/includes/widget/orderLast.php 2014-02-14 15:24:49 UTC (rev 5151)
+++ trunk/catalog/admin/includes/widget/orderLast.php 2014-02-15 07:15:39 UTC (rev 5152)
@@ -7,34 +7,86 @@
@date 04/07/2013, 10:02
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
- @file orderStats.php
+ @file orderLast.php
@dir admin/includes/widget/
*/
-global $oscss,$language,$lang;
-$oscss->pile_file_lang(DIR_WS_LANGUAGES . $language . '/Order.txt');
+global $conf;
+$_query = tep_db_query("SELECT o.*, status_name FROM " . TABLE_ORDERS . " o LEFT JOIN " . TABLE_STATUS . " s ON(s.status_id=o.orders_status AND status_type='orders' AND language_id = '" . $languages_id . "') ORDER BY date_purchased DESC LIMIT ".$conf->widget_max_line);
-$orders_contents = '<ul>';
-$orders_status_query = tep_db_query("select status_name as orders_status_name,status_id as orders_status_id from " . TABLE_STATUS . " where status_type='orders' and language_id = '" . $languages_id . "'");
+$_query2 = tep_db_query("SELECT o.*, status_name FROM " . TABLE_ORDERS . " o LEFT JOIN " . TABLE_STATUS . " s ON(s.status_id=o.orders_status AND status_type='orders' AND language_id = '" . $languages_id . "') ORDER BY last_modified DESC LIMIT ".$conf->widget_max_line);
+
+
+$add = ( !$_query->__get('numRows') ) ? false : true ;
+$up = ( !$_query2->__get('numRows') ) ? false : true ;
+
+
+if( !$up && !$add )
+ return false;
+
+$datadocs=new DatasFiles;
?>
-<div id="orderStats" class="<?php echo $widg['class'] ?>">
-<h3><?php echo __('box title orders'); ?></h3>
-<?php
- while ($orders_status = tep_db_fetch_array($orders_status_query)) {
- $orders_pending_query = tep_db_query("select count(*) as count from " . TABLE_ORDERS . " where orders_status = '" . $orders_status['orders_status_id'] . "'");
- $orders_pending = tep_db_fetch_array($orders_pending_query);
+<div id="orderLast" class="<?php echo $widg['class'] ?>">
+<h3><a href="<?php echo tep_href_link(FILENAME_ORDERS); ?>"><?php echo __('orderLast box title'); ?></a></h3>
- if (tep_admin_check_boxes(FILENAME_ORDERS, 'sub_boxes') == true) {
- $orders_contents .= '<li><a href="' . tep_href_link(FILENAME_ORDERS, 'selected_box=customers&status=' . $orders_status['orders_status_id']) . '">' . $orders_status['orders_status_name'] . '</a>: ' . $orders_pending['count'] . '</li>';
+ <div id="tabs">
+ <ul>
+ <li><a href="#tabs-1"><?php echo __('orderLast tab added'); ?></a></li>
+ <li><a href="#tabs-2"><?php echo __('orderLast tab updated'); ?></a></li>
+ </ul>
- } else {
- $orders_contents .= '<li>' . $orders_status['orders_status_name'] . ': ' . $orders_pending['count'] . '</li>';
- }
+ <div id="tabs-1" class="tabPage">
- }
- $orders_contents .= '</ul>';
+ <table class="dataTableBase">
+ <tr>
+ <th><?php echo __('orderLast box reference'); ?></th>
+ <th><?php echo __('orderLast box docs'); ?></th>
+ <th><?php echo __('orderLast box customers'); ?></th>
+ <th><?php echo __('orderLast box date'); ?></th>
+ <th><?php echo __('orderLast box status'); ?></th>
+ </tr>
+ <?php foreach($_query->fetchAllAssoc() as $row) : ?>
+ <tr>
+ <td class="tcenter"><strong><a href="<?php echo tep_href_link(FILENAME_ORDERS, 'oID='.$row['orders_id'].'&action=edit') ?>"><?php echo (!empty($row['orders_ref'])? $row['orders_ref'] : $row['orders_id'] ) ?></strong></td>
+ <td class="tcenter">
+ <?php if(( $filepath=$datadocs->GetDoc('packingslip', $row['orders_id'] )) && file_exists($filepath)): ?>
+ <a href="<?php echo tep_href_link('document.php', 'mod=packingslip&id='. $row['orders_id']) ?>"><?php echo basename($filepath) ?></a>
+ <?php endif; ?>
+ </td>
+ <td style="width:200px;"><?php echo tep_customers_row_action($row['customers_id'], array()) ?></td>
+ <td class="tcenter"><?php echo tep_date_short($row['date_purchased']) ?></td>
+ <td class="tcenter"><?php echo $row['status_name'] ?></td>
+ </tr>
+ <?php endforeach; ?>
+ </table>
+ </div>
- echo $orders_contents ;
-?>
+
+ <div id="tabs-2" class="tabPage">
+ <table class="dataTableBase">
+ <tr>
+ <th><?php echo __('orderLast box reference'); ?></th>
+ <th><?php echo __('orderLast box docs'); ?></th>
+ <th><?php echo __('orderLast box customers'); ?></th>
+ <th><?php echo __('orderLast box date'); ?></th>
+ <th><?php echo __('orderLast box status'); ?></th>
+ </tr>
+ <?php foreach($_query2->fetchAllAssoc() as $row) : ?>
+ <tr>
+ <td class="tcenter"><strong><a href="<?php echo tep_href_link(FILENAME_ORDERS, 'oID='.$row['orders_id'].'&action=edit') ?>"><?php echo (!empty($row['orders_ref'])? $row['orders_ref'] : $row['orders_id'] ) ?></strong></td>
+ <td class="tcenter">
+ <?php if(( $filepath=$datadocs->GetDoc('packingslip', $row['orders_id'] )) && file_exists($filepath)): ?>
+ <a href="<?php echo tep_href_link('document.php', 'mod=packingslip&id='. $row['orders_id']) ?>"><?php echo basename($filepath) ?></a>
+ <?php endif; ?>
+ </td>
+ <td style="width:200px;"><?php echo tep_customers_row_action($row['customers_id'], array()) ?></td>
+ <td class="tcenter"><?php echo tep_date_short($row['last_modified']) ?></td>
+ <td class="tcenter"><?php echo $row['status_name'] ?></td>
+ </tr>
+ <?php endforeach; ?>
+ </table>
+ </div>
+
+ </div>
</div>
\ No newline at end of file
Modified: trunk/catalog/admin/includes/widget/salesStats.php
===================================================================
--- trunk/catalog/admin/includes/widget/salesStats.php 2014-02-14 15:24:49 UTC (rev 5151)
+++ trunk/catalog/admin/includes/widget/salesStats.php 2014-02-15 07:15:39 UTC (rev 5152)
@@ -1,13 +1,19 @@
<?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
- @date 24/04/11, 18:07
+ @version 2.2.0
+ @date 04/07/2013, 10:02
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
+ @file salesSatst.php
+ @dir admin/includes/widget/
*/
+
+global $oscss,$language,$lang;
+$oscss->pile_file_lang(DIR_WS_LANGUAGES . $language . '/Order.txt');
+
?>
<div id="salesStats" class="<?php echo $widg['class'] ?>" >
<h3><?php echo '<a href="' . tep_href_link(FILENAME_GRAPHS_STATS, 'vue=Sales', 'NONSSL') . '">'. __('box title sales') .'</a>';?></h3>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2014-02-14 15:24:52
|
Revision: 5151
http://sourceforge.net/p/oscss/svn/5151
Author: oscim
Date: 2014-02-14 15:24:49 +0000 (Fri, 14 Feb 2014)
Log Message:
-----------
Fix
Modified Paths:
--------------
trunk/catalog/ajax_exe.php
trunk/catalog/checkout_shipping.php
Modified: trunk/catalog/ajax_exe.php
===================================================================
--- trunk/catalog/ajax_exe.php 2014-02-14 15:24:16 UTC (rev 5150)
+++ trunk/catalog/ajax_exe.php 2014-02-14 15:24:49 UTC (rev 5151)
@@ -31,6 +31,7 @@
$file= $page->fix_file(DIR_WS_TRIGGERS . $action . '.inc');
if( ($r=page::TestFile($file)) && $r !=false ){
require_once($file);
+ page::StopCacheVar();
exit;
}
@@ -44,6 +45,7 @@
$box_left=$page->oscss_boxes->_call($_GET['box'],'ajax');
$boxe =$page->oscss_boxes->_return($_GET['box']);
include(DIR_WS_TEMPLATES.$page->the_template().'/boxe.php');
+ page::StopCacheVar();
}
?>
\ No newline at end of file
Modified: trunk/catalog/checkout_shipping.php
===================================================================
--- trunk/catalog/checkout_shipping.php 2014-02-14 15:24:16 UTC (rev 5150)
+++ trunk/catalog/checkout_shipping.php 2014-02-14 15:24:49 UTC (rev 5151)
@@ -22,13 +22,13 @@
// if there is nothing in the customers cart, redirect them to the shopping cart page
- if ($cart->count_contents() < 1) tep_redirect(tep_href_link(FILENAME_SHOPPING_CART));
+ if ($cart->count_contents() < 1)
+ tep_redirect(tep_href_link(FILENAME_SHOPPING_CART));
/// Stock Check
- if (! Stock::check_cart() ) tep_redirect(tep_href_link(FILENAME_SHOPPING_CART));
+ if (! Stock::check_cart() )
+ tep_redirect(tep_href_link(FILENAME_SHOPPING_CART));
- /* reinit shipping*/
- tep_session_unregister('shipping');
//! if no shipping destination address was selected, use the customers own address as default
if (!tep_session_is_registered('sendto')) {
@@ -40,17 +40,14 @@
$check_address = $check_address_query->fetchAssoc();
if ($check_address['total'] != '1') {
$sendto = $customer_default_address_id;
- if (tep_session_is_registered('shipping')) tep_session_unregister('shipping');
+ if (tep_session_is_registered('shipping'))
+ tep_session_unregister('shipping');
}
}
//! load order
$order = new order;
-
- //! register a random ID in the session to check throughout the checkout procedure against alterations in the shopping cart contents
- if (!tep_session_is_registered('cartID')) tep_session_register('cartID');
- $cartID = $cart->cartID;
-
+
//! if the order contains only virtual products, forward the customer to the billing page as a shipping address is not needed
if ($order->content_type == 'virtual') {
if (!tep_session_is_registered('shipping')) tep_session_register('shipping');
@@ -58,14 +55,21 @@
$sendto = false;
tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
}
+
+ //! register a random ID in the session to check throughout the checkout procedure against alterations in the shopping cart contents
+ if (!tep_session_is_registered('cartID'))
+ tep_session_register('cartID');
+
+ $cartID = $cart->cartID;
- //! tot cart
- $total_weight = $cart->show_weight();
- $total_count = $cart->count_contents();
+ $total_weight = $cart->GetTotal('weight');
+ $total_count = $cart->GetTotal('item');
+
//! load all enabled shipping modules
- $shipping_modules = new shipping;
+ $ObjectShipping = shipping::resetInstance();
+ $ObjectShipping->SetObjectRef( $cart );
// process the selected shipping method free
@@ -78,23 +82,31 @@
if ( (tep_count_shipping_modules() > 0) ) {
if ( (isset($_POST['shipping']) && strpos($_POST['shipping'], '_')) ) {
- $shipping = $_POST['shipping'] ;
+ $postshipping = $_POST['shipping'] ;
+ list($module, $method) = explode('_', $postshipping);
+
+ $ObjectShipping->SetModuleName($module);
+ $ObjectShipping->SetMethodName($method);
+
- list($module, $method) = explode('_', $shipping);
+
+ if ( $ObjectShipping->ModExist($module) ) {
+
+
+
+ $quote = $ObjectShipping->quote($method, $module);
- if ( $shipping_modules->ModExist($module) ) {
- $quote = $shipping_modules->quote($method, $module);
-
if (isset($quote['error']))
tep_session_unregister('shipping');
else {
- if ( (isset($quote[0]['methods'][0]['title'])) && (isset($quote[0]['methods'][0]['cost'])) ) {
- $shipping = array('id' => $shipping,
- 'title' => $quote[0]['module'] . ' (' . $quote[0]['methods'][0]['title'] . ')',
- 'cost_ht' => $quote[0]['methods'][0]['cost_ht'],
- 'cost' => $quote[0]['methods'][0]['cost']);
+ $shipping =$ObjectShipping->GetSelected();
+// if ( (isset($quote[0]['methods'][0]['title'])) && (isset($quote[0]['methods'][0]['cost'])) ) {
+// $shipping = array('id' => $postshipping,
+// 'title' => $quote[0]['module'] . ' (' . $quote[0]['methods'][0]['title'] . ')',
+// 'cost_ht' => $quote[0]['methods'][0]['cost_ht'],
+// 'cost' => $quote[0]['methods'][0]['cost']);
tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
- }
+// }
}
}
else{
@@ -112,11 +124,11 @@
}
// get all available shipping quotes
- $quotes = $shipping_modules->quote();
+// $quotes = $ObjectShipping->quote();
// if no shipping method has been selected, automatically select the cheapest method. if the modules status was changed when none were available, to save on implementing a javascript force-selection method, also automatically select the cheapest shipping method if more than one module is now enabled
if ( !tep_session_is_registered('shipping') || ( tep_session_is_registered('shipping') && ($shipping == false) && (tep_count_shipping_modules() > 1) ) ){
- $shipping = $shipping_modules->cheapest();
+ $shipping = $ObjectShipping->cheapest();
tep_session_register('shipping');
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2014-02-14 15:24:19
|
Revision: 5150
http://sourceforge.net/p/oscss/svn/5150
Author: oscim
Date: 2014-02-14 15:24:16 +0000 (Fri, 14 Feb 2014)
Log Message:
-----------
Re-write important section section in shipping class for support selected medthode in other page and correct display by ot_shipping
Fix and add trigger ajax in frontoffice
NExt dev and clean code , add comment
Modified Paths:
--------------
trunk/catalog/includes/classes/ModPublicOneShipping.php
trunk/catalog/includes/classes/shipping.php
trunk/catalog/includes/modules/order_total/ot_shipping.php
trunk/catalog/includes/modules/shipping/flat.php
trunk/catalog/includes/modules/shipping/free.php
trunk/catalog/includes/modules/shipping/mzmt.php
trunk/catalog/includes/modules/shipping/spu.php
trunk/catalog/templates/defaut/includes/gabarit/checkout/shipping.gab
trunk/catalog/templates/defaut/includes/triggers/cart_line.inc
trunk/catalog/templates/defaut/includes/triggers/cart_totaux.inc
trunk/test/phpunit/Front/core/orders/OrderTest.php
trunk/test/phpunit/Front/shippingTest.php
Added Paths:
-----------
trunk/catalog/templates/defaut/includes/gabarit/checkout/shipping.method.gab
Modified: trunk/catalog/includes/classes/ModPublicOneShipping.php
===================================================================
--- trunk/catalog/includes/classes/ModPublicOneShipping.php 2014-02-14 11:09:01 UTC (rev 5149)
+++ trunk/catalog/includes/classes/ModPublicOneShipping.php 2014-02-14 15:24:16 UTC (rev 5150)
@@ -33,13 +33,14 @@
@brief calulate
@return array
*/
- public function quote($method = '');
+// public function quote($method = '');
/**
- @fn update_status( Order $order , ShoppingCart $cart)
- @brief adjust status for context
+ @brief adjust status in context existant and specific module
+ This method use Set/Get Enabled for update status
+ @param $objectRef object implements IntShippingDepend Interface (Order, shoppingCart))
@return none
*/
- public function update_status( Order $order , ShoppingCart $cart);
+ public function update_status( IntShippingDepend $objectRef );
}
@@ -136,7 +137,7 @@
}
/**
- @fn GetName()
+ @fn GetShoppingCart()
@brief Get Value
@return shopping_cart value
*/
@@ -145,7 +146,7 @@
}
/**
- @fn SetName()
+ @fn SetShoppingCart()
@brief Get Value
@param $fieldname shopping_cart val_description
*/
@@ -174,13 +175,14 @@
// }
/**
- @fn show_list_total( shoppingCart $cart)
+ @fn ShowInCart( shoppingCart $cart)
+ @brief This call inline cart detail in
@remarks init by Class ShoppongCart
@param $cart shoppingCart object
@return array
*/
-// public function show_list_total( shoppingCart $cart) {
-// return $this->GetPreOutput();
+// public function ShowInProcess( $step ) {
+// return $this->GetDescription(($module,$method, $step);
// }
@@ -188,17 +190,21 @@
$ref = 'module shipping '.$module.' text way';
if(!empty($method))
- $ref = ' '.$method;
+ $ref .= ' '.$method;
if(!empty($step))
- $ref = ' '.$step;
+ $ref .= ' '.$step;
return __( $ref.' detail');
}
/**
+ @brief adjust status in context existant and specific module
+ This method use Set/Get Enabled for update status
+ @param $objectRef object implements IntShippingDepend Interface (Order, shoppingCart))
+ @return none
*/
- public function update_status( Order $order , ShoppingCart $cart) {
+ public function update_status( IntShippingDepend $objectRef ) {
if ($this->GetEnabled()) {
$cst = 'MODULE_SHIPPING_'.$this->code.'_ZONE';
if(!defined($cst))
@@ -223,9 +229,11 @@
@return none
*/
protected function determineTableMethod($NameVarConfig, $obj) {
- global $total_count, $shipping_weight;
$value = constant($NameVarConfig);
+
+ if(!is_object($obj))
+ var_dump($obj);
$this->value_total = 0;
$value_check = 0;
@@ -256,7 +264,7 @@
return null;
}
- public function GetTotal(){
+ protected function GetTotal(){
return $this->value_total;
}
Modified: trunk/catalog/includes/classes/shipping.php
===================================================================
--- trunk/catalog/includes/classes/shipping.php 2014-02-14 11:09:01 UTC (rev 5149)
+++ trunk/catalog/includes/classes/shipping.php 2014-02-14 15:24:16 UTC (rev 5150)
@@ -31,17 +31,35 @@
*/
public static $shipping_num_boxes = 1;
/**
+ @var Object reference for called GetTotal()
+ */
+ protected $ObjectRef;
+ /**
+ @var list internal for stock calculate quote for all carrier
+ */
+ protected $_quotes = array();
+ /**
+ @var string name module internal
+ */
+ protected $_module = '';
+ /**
+ @var string name method internal
+ */
+ protected $_method = '';
+ /**
@var ressource instance
*/
protected static $_instance;
/**
+ @fn constructor
*/
- function __construct($module='') {
+ protected function __construct($module='') {
self::initialise($module);
}
/**
+ @fn getInstance($module='')
*/
public static function getInstance($module='') {
if(self::$_instance == null)
@@ -51,6 +69,7 @@
}
/**
+ @fn resetInstance()
*/
public static function resetInstance() {
self::$_instance = null;
@@ -119,45 +138,148 @@
/**
*/
- public function GetSelected($shipping=array()){
-
- if(is_array($shipping))
- $module_method = $shipping['id'];
-
- list($module, $method) = explode('_', $module_method);
+ public function GetSelected(){
+// var_dump($this->_module);
+// print_r($this->_quotes);
+// exit;
- if(isset($this->modules[$module])){
- $sub = $this->modules[$module];
- if (($quotes = $this->quote($method, $module)) !=false ) {
+ if(isset($this->modules[$this->_module])){
+// $sub = $this->modules[$this->_module];
- foreach($quotes[0]['methods'] as $row ){
-
- if ($row['id'] == $method ) {
- $row['module'] = $module;
- return $row;
- }
- }
+ if( count($this->_quotes)>0 )
+ $quotes_l = $this->_quotes;
+ else{
+ $sub = $this->modules[$this->_module];
+
+ $quotes_l = array($sub->quote($this->_method, $this->ObjectRef));
}
+// if (($quotes = $this->quote($this->_method, $this->_module)) !=false ) {
+ foreach($quotes_l as $quotes){
+
+
+ foreach($quotes['methods'] as $quote)
+// }
+ if (isset($quote['cost']) ) {
+
+ return array_merge($quote, array(
+ 'id' => $quotes['id'] . '_' . $quote['id'],
+ )
+ );
+ }
+
+ }
+// foreach($this->_quotes['methods'] as $row ){
+//
+// if ($row['id'] == $this->_method ) {
+// $row['module'] = $this->_module;
+// return $row;
+// }
+// }
+// }
+
}
return false;
}
+
+ /**
+ @fn SetObjectRef( IntShippingDepend $ObjectReference)
+ @brief Fix objetc reference for calculate shipping
+ This object is shoppingCart or Order
+ @param $ObjectReference object implement IntShippingDepend Interface
+ @return none
+ */
+ public function SetObjectRef( IntShippingDepend $ObjectReference){
+ $this->ObjectRef = $ObjectReference;
+ }
+
+ /**
+ @fn GetTotal( $type ='')
+ @brief
+ @return int/float total type
+ */
+ public function GetTotal( $type =''){
+ return $this->ObjectRef->GetTotal($type) ;
+ }
+ /**
+ @fn GetMethode()
+ @brief Get Value
+ @return $_method value
+ */
+ public function GetMethodeName(){
+ return $this->_method;
+ }
+
+ /**
+ @fn SetMethode()
+ @brief Get Value
+ @param $_$method $_method string value method selected
+ */
+ public function SetMethodeName($_method){
+ $this->_method = $_method;
+ }
+
+ /**
+ @fn GetModule()
+ @brief Get Value
+ @return _module value
+ */
+ public function GetModuleName(){
+ return $this->_module;
+ }
+
+ /**
+ @fn SetModule()
+ @brief Get Value
+ @param $_module _module string value module selected; internal value
+ */
+ public function SetModuleName($_module){
+ $this->_module = $_module;
+ }
+
+ /**
+ @fn GetQuotes())
+ @brief Fix objetc reference for calculate shipping
+ This object is shoppingCart or Order
+ @param $ObjectReference object implement IntShippingDepend Interface
+ @return none
+ */
+ public function GetQuotes( ){
+ if( count($this->_quotes)<=0 )
+ $this->quote();
+
+ return $this->_quotes ;
+ }
+
+
+
+ /**
+ */
+ public function ShowShipping($step){
+
+ $result = array();
+
+ foreach($this->modules as $class=>$submod){
+ $result[]= $submod->GetDescription($class,'', $step);
+ }
+
+ return $result;
+ }
+
/**
@fn quote($method = '', $module = '')
@param $method
@param $module
*/
public function quote($method = '', $module = '') {
- global $total_weight, $shipping_weight, $shipping_quoted;
-
$quotes_array = array();
if (is_array($this->modules)) {
- $shipping_quoted = '';
+
// self::$shipping_num_boxes = 1;
- $shipping_weight = $total_weight;
+ $shipping_weight = $this->ObjectRef->GetTotal('weight');
if (SHIPPING_BOX_WEIGHT >= $shipping_weight*SHIPPING_BOX_PADDING/100) {
$shipping_weight = $shipping_weight+SHIPPING_BOX_WEIGHT;
@@ -177,8 +299,8 @@
global $order, $cart;
foreach($this->modules as $class=>$submod){
- if (is_object($order) && is_object($cart))
- $this->update_status($order, $cart);
+// if (is_object($order) && is_object($cart))
+ $submod->update_status( $this->ObjectRef );
if (tep_not_null($module)) {
if ( ($module == $class) && ($submod->GetEnabled()) )
@@ -190,14 +312,17 @@
$size = sizeof($include_quotes);
foreach($include_quotes as $key=>$submod) {
- $quotes = $submod->quote($method);
+ $quotes = $submod->quote($method, $this->ObjectRef);
if (is_array($quotes)){
$quotes['title'] = $quotes['module'] . ' [' .$quotes['methods'][$i]['id'] . ']' ;
$quotes_array[] = $quotes;
}
}
}
- return $quotes_array;
+// print_r($quotes_array);
+// exit;
+ $this->_quotes = $quotes_array;
+// return $quotes_array;
}
/**
@@ -205,22 +330,34 @@
@brief Meilleur methode (la moins chere)
*/
public function cheapest() {
- if (is_array($this->modules)) {
+
+
+
+ if ( count($this->modules) > 0) {
+
+ if( count($this->_quotes)<=0 )
+ $this->quote('',$this->ObjectRef);
+
$rates = array();
reset($this->modules);
- foreach($this->modules as $class=>$module){
- if (($quotes = $module->quotes) !=false ) {
- for ($i=0, $n=sizeof($quotes['methods']); $i<$n; $i++) {
- if (isset($quotes['methods'][$i]['cost']) ) {
+// foreach($this->modules as $class=>$module){
+// if (($quotes = $module->quotes) !=false ) {
+ foreach($this->_quotes as $quotes){
+// print_r($quotes);
+// }
+// for ($i=0, $n=sizeof($quotes['methods']); $i<$n; $i++) {
+ foreach($quotes['methods'] as $quote)
+// }
+ if (isset($quote['cost']) ) {
- $rates[] =array_merge($quotes['methods'][$i], array(
- 'id' => $quotes['id'] . '_' . $quotes['methods'][$i]['id'],
+ $rates[] =array_merge($quote, array(
+ 'id' => $quotes['id'] . '_' . $quote['id'],
)
);
}
- }
- }
+// }
+// }
}
$cheapest = false;
@@ -245,7 +382,7 @@
@param $country_id \a int de customers venant de order
@param $zone_id \a int de customers venant de order
*/
- public static function getGeoZoneID($country_id, $zone_id) {
+ protected static function getGeoZoneID($country_id, $zone_id) {
$cache=array();
static $cache;
@@ -277,7 +414,7 @@
* @param $path
* @param $title
*/
- public static function get_icon($path, $title) {
+ protected static function get_icon($path, $title) {
return tep_image( (strpos($path,DIR_WS_CATALOG) ==false )
? substr(str_replace('//','/',$path), strlen(DIR_WS_CATALOG) )
: $path,
Modified: trunk/catalog/includes/modules/order_total/ot_shipping.php
===================================================================
--- trunk/catalog/includes/modules/order_total/ot_shipping.php 2014-02-14 11:09:01 UTC (rev 5149)
+++ trunk/catalog/includes/modules/order_total/ot_shipping.php 2014-02-14 15:24:16 UTC (rev 5150)
@@ -32,7 +32,7 @@
{
- function ot_shipping() {
+ public function __construct() {
$this->code = __CLASS__;
$this->title = __('module order total shipping title');
@@ -57,7 +57,7 @@
@param $currencies Object currencies
@return none
*/
- public function process( CstrOrder $order , InterfaceCurrencies $currencies){
+ public function process( CstrOrder $order , InterfaceCurrencies $currencies ){
global $currencies;
$shipping_cost_ht=0;
@@ -94,27 +94,35 @@
*/
public function show_list_total( shoppingCart $cart ) {
- global $order, $total_weight, $total_count;
-
- //! load order
- $order = new order;
+ // call shipping class
+ $ObjectShipping = shipping::getInstance();
+ // set object reference
+ $ObjectShipping->SetObjectRef( $cart );
+ // check optimised metdhod
+ if ( !tep_session_is_registered('shipping') )
+ $cheapest = $ObjectShipping->cheapest();
+ else{
+ $postshipping = $_SESSION['shipping']['id'];
+ list($module, $method) = explode('_', $postshipping);
- //! tot cart
- $total_weight = $cart->show_weight();
- $total_count = $cart->count_contents();
+ $ObjectShipping->SetModuleName($module);
+ $ObjectShipping->SetMethodeName($method);
-
- $shipping = new shipping();
+ $cheapest =$ObjectShipping->GetSelected();
+ }
- $quote= $shipping->quote();
- $cheapest = $shipping->cheapest();
-
+ global $shipping;
+ $_SESSION['shipping'] = $shipping = $cheapest;
+
$this->SetPreOutput(new objectInfo(array(
- 'text'=>$this->title ."<br />".$cheapest['title'],
- 'value'=> $cheapest['cost']
+ 'text'=>'<a href="#" class="shippingaddbox">'.$this->title ." ??</a><br />".$cheapest['title'],
+ 'value'=> $cheapest['cost'],
+
+ 'form'=>tep_get_include_contents('checkout/shipping.method')
+
) ) );
-
+
return $this->GetPreOutput();
}
Modified: trunk/catalog/includes/modules/shipping/flat.php
===================================================================
--- trunk/catalog/includes/modules/shipping/flat.php 2014-02-14 11:09:01 UTC (rev 5149)
+++ trunk/catalog/includes/modules/shipping/flat.php 2014-02-14 15:24:16 UTC (rev 5150)
@@ -47,7 +47,8 @@
$this->update_status($order, $cart);
}
-/** Interface InterfaceAcaShipping */
+
+
public function quote($method = '') {
global $order;
Modified: trunk/catalog/includes/modules/shipping/free.php
===================================================================
--- trunk/catalog/includes/modules/shipping/free.php 2014-02-14 11:09:01 UTC (rev 5149)
+++ trunk/catalog/includes/modules/shipping/free.php 2014-02-14 15:24:16 UTC (rev 5150)
@@ -80,7 +80,14 @@
return $this->quotes;
}
- public function update_status( Order $order , ShoppingCart $cart) {
+
+ /**
+ @brief adjust status in context existant and specific module
+ This method use Set/Get Enabled for update status
+ @param $objectRef object implements IntShippingDepend Interface (Order, shoppingCart))
+ @return none
+ */
+ public function update_status( IntShippingDepend $objectRef ) {
//! livraison gratuite
if (_cst_bool('MODULE_SHIPPING_FREE')) {
Modified: trunk/catalog/includes/modules/shipping/mzmt.php
===================================================================
--- trunk/catalog/includes/modules/shipping/mzmt.php 2014-02-14 11:09:01 UTC (rev 5149)
+++ trunk/catalog/includes/modules/shipping/mzmt.php 2014-02-14 15:24:16 UTC (rev 5150)
@@ -37,7 +37,11 @@
$order_total;
function __construct() {
+
+
$this->code = __CLASS__;
+ $this->title = __('module shipping mzmt text title');
+ $this->description = __('module shipping mzmt text description');
$this->icon = '';
$this->num_geozones = (defined('MODULE_SHIPPING_MZMT_NUMBER_GEOZONES') ? MODULE_SHIPPING_MZMT_NUMBER_GEOZONES : 3 );
@@ -47,6 +51,13 @@
$this->sort_order= MODULE_SHIPPING_MZMT_SORT_ORDER ;
if(defined('MODULE_SHIPPING_MZMT_TAX_CLASS'))
$this->SetShoppingCart(MODULE_SHIPPING_MZMT_TAX_CLASS);
+
+ global $order, $cart;
+ if (is_object($order) && is_object($cart)){
+ $this->update_status($order, $cart);
+
+ $this->order = $order;
+ }
}
/**
@@ -57,10 +68,11 @@
@fn quote($method = '')
*/
public function quote($method = '') {
- global $order,$shipping_weight;
+ global $shipping_weight;
-
+ $order = $this->order;
$delai = (defined('MODULE_SHIPPING_MZMT_MIN_DELAI')? MODULE_SHIPPING_MZMT_MIN_DELAI: 0);
+
$array = shippingUtility::getDelai( $delai );
$combined_quote_weight = (shipping::$shipping_num_boxes * $shipping_weight);
@@ -69,7 +81,6 @@
'module' => __('module shipping mzmt geozone ' . $this->delivery_geozone . ' text title') . ' (' . $combined_quote_weight . ' '.UNIT_WEIGHT_NAME.')',
'methods' => array()
);
-
$this->determineTableMethod(constant('MODULE_SHIPPING_MZMT_GEOZONE_' . $this->delivery_geozone . '_MODE') , $order );
@@ -125,24 +136,43 @@
return $this->quotes;
}
- public function update_status( Order $order , ShoppingCart $cart) {
+ /**
+ @brief adjust status in context existant and specific module
+ This method use Set/Get Enabled for update status
+ @param $objectRef object implements IntShippingDepend Interface (Order, shoppingCart))
+ @return none
+ */
+ public function update_status( IntShippingDepend $objectRef ) {
- if ($this->GetEnabled()) {
+ if ($this->enabled == true ) {
+ $this->enabled = false;
for ($n=1; $n<=$this->num_geozones; $n++) {
if(tep_cst_define('MODULE_SHIPPING_MZMT_GEOZONE_' . $n . '_ID') =='false'){
- $this->SetEnabled(false);
break;
}
if ( ((int)constant('MODULE_SHIPPING_MZMT_GEOZONE_' . $n . '_ID') > 0) && ((int)constant('MODULE_SHIPPING_MZMT_GEOZONE_' . $n . '_ID') == shipping::getGeoZoneID($order->delivery['country']['id'], $order->delivery['zone_id'])) ) {
- $this->SetEnabled(true);
+ $this->enabled = true;
$this->delivery_geozone = $n;
break;
}
+// elseif ( ((int)constant('MODULE_SHIPPING_MZMT_GEOZONE_' . $n . '_ID') == 0) && ($n == (int)$this->num_geozones) ) {
+// $this->enabled = true;
+// $this->delivery_geozone = $n;
+// break;
+// }
}
}
}
+
+
+
+
+
+
+
+
}
?>
Modified: trunk/catalog/includes/modules/shipping/spu.php
===================================================================
--- trunk/catalog/includes/modules/shipping/spu.php 2014-02-14 11:09:01 UTC (rev 5149)
+++ trunk/catalog/includes/modules/shipping/spu.php 2014-02-14 15:24:16 UTC (rev 5150)
@@ -39,9 +39,6 @@
if(defined('MODULE_SHIPPING_MZMT_SORT_ORDER'))
$this->sort_order= MODULE_SHIPPING_MZMT_SORT_ORDER ;
- global $order, $cart;
- if (is_object($order) && is_object($cart))
- $this->update_status($order, $cart);
}
Modified: trunk/catalog/templates/defaut/includes/gabarit/checkout/shipping.gab
===================================================================
--- trunk/catalog/templates/defaut/includes/gabarit/checkout/shipping.gab 2014-02-14 11:09:01 UTC (rev 5149)
+++ trunk/catalog/templates/defaut/includes/gabarit/checkout/shipping.gab 2014-02-14 15:24:16 UTC (rev 5150)
@@ -46,58 +46,11 @@
<p class="infoText"><?php echo __('text enter shipping information'); ?></p>
<?php endif; ?>
- <p class="infoText weight"><?php echo __('total weight').' '.$cart->show_weight().' '.UNIT_WEIGHT_NAME; ?></p>
+<!-- <p class="infoText weight"><?php echo __('total weight').' '.$cart->show_weight().' '.UNIT_WEIGHT_NAME; ?></p> -->
- <?php if ($free_shipping == true): /** Free shipping */ ?>
- <p><?php echo __('free shipping title'); ?> <?php if (isset($quotes[0]['icon'])) echo $quotes[0]['icon']; ?></p>
- <p><?php echo sprintf(__('free shipping description %s'), $currencies->format(MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER)) . tep_draw_hidden_field('shipping', 'free_free'); ?></p>
- <?php else: /** choose method shipping */ ?>
+ <?php echo tep_get_include_contents('checkout/shipping.method'); ?>
- <ul class="shippingSelect listSelect listModules">
- <?php $radio_buttons = 0; for ($i=0, $n=sizeof($quotes); $i<$n; $i++) :?>
- <li class="radio">
- <label for="shipping<?php echo $i; ?>">
- <span class="methodName"><?php echo $quotes[$i]['module']; ?></span>
- <span class="methodIcon"><?php if (isset($quotes[$i]['icon']) && tep_not_null($quotes[$i]['icon'])) { echo $quotes[$i]['icon']; } ?></span>
-
-
- <?php if (isset($quotes[$i]['error'])): ?>
- <span><?php echo $quotes[$i]['error']; ?></span>
-
- <?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);
- ?>
- <li class="nameMethod">
- <span class="methodTitle"><?php echo $quotes[$i]['methods'][$j]['title']; ?></span>
- <?php if(isset($quotes[$i]['methods'][$j]['detail'])): ?>
- <span class="methodDetail"><?php echo $quotes[$i]['methods'][$j]['detail']; ?></span>
- <?php endif; ?>
-
-
- <?php if(isset($quotes[$i]['methods'][$j]['date_delivery'])): ?>
- <span class="methodDateDelivery"><?php echo sprintf(__('text estimate delivery %s'), $quotes[$i]['methods'][$j]['date_delivery'] ); ?></span>
- <?php endif; ?>
-
- <?php if ( ($n >= 1) || ($n2 >= 1) ): ?>
- <span class="methodPrice"><?php echo $currencies->format($quotes[$i]['methods'][$j]['cost']); ?></span>
- <?php echo tep_draw_radio_field('shipping','shipping'.$i, $quotes[$i]['id'] . '_' . $quotes[$i]['methods'][$j]['id'], $checked); ?>
- <?php else: ?>
- <?php echo $currencies->format($quotes[$i]['methods'][$j]['cost']) . tep_draw_hidden_field('shipping', $quotes[$i]['id'] . '_' . $quotes[$i]['methods'][$j]['id']); ?>
- <?php endif; ?>
- </li>
- <?php $radio_buttons++;
- } ?>
- </ul>
- <?php endif; // if (isset($quotes[$i]['error'])) ?>
- </label>
- </li>
- <?php endfor; // for ($i=0, $n=sizeof($quotes); $i<$n; $i++) ?>
- </ul>
- <?php endif; // if ($free_shipping == true) ?>
</div>
</div>
Added: trunk/catalog/templates/defaut/includes/gabarit/checkout/shipping.method.gab
===================================================================
--- trunk/catalog/templates/defaut/includes/gabarit/checkout/shipping.method.gab (rev 0)
+++ trunk/catalog/templates/defaut/includes/gabarit/checkout/shipping.method.gab 2014-02-14 15:24:16 UTC (rev 5150)
@@ -0,0 +1,59 @@
+<?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 18/12/2013, 08:18
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+ @file shipping.method.gab
+ @dir templates/defaut/includes/gabarit/checkout/
+*/
+
+global $currencies, $shipping;
+
+$ObjectShipping = shipping::getInstance();
+?>
+<ul class="shippingSelect listSelect listModules">
+ <?php
+
+ foreach($ObjectShipping->GetQuotes() as $i=>$carrier):?>
+ <li class="radio">
+ <label for="shipping<?php echo $i; ?>">
+ <span class="methodName"><?php echo $carrier['module']; ?></span>
+<!-- <span class="methodIcon"><?php if (isset($carrier['icon']) && tep_not_null($carrier['icon'])) { echo $carrier['icon']; } ?></span> -->
+
+
+ <?php if (isset($carrier['error'])): ?>
+ <span><?php echo $carrier['error']; ?></span>
+
+ <?php else: ?>
+ <ul class="shippingSelect listMethod ">
+ <?php
+ foreach($carrier['methods'] as $j=>$method):
+ // set the radio button to be checked if it is the method chosen
+ $checked = (($carrier['id'] . '_' . $method['id'] == $shipping['id']) ? true : false);
+ ?>
+ <li class="nameMethod">
+ <span class="methodTitle"><?php echo $method['title']; ?></span>
+ <?php if(isset($method['detail'])): ?>
+ <span class="methodDetail"><?php echo $method['detail']; ?></span>
+ <?php endif; ?>
+
+
+ <?php if(isset($method['date_delivery'])): ?>
+ <span class="methodDateDelivery"><?php echo sprintf(__('text estimate delivery %s'), $method['date_delivery'] ); ?></span>
+ <?php endif; ?>
+
+ <span class="methodPrice"><?php echo $currencies->format($method['cost']); ?></span>
+ <?php echo tep_draw_radio_field('shipping','shipping'.$i, $carrier['id'] . '_' . $method['id'], $checked); ?>
+
+ </li>
+ <?php
+ endforeach; ?>
+ </ul>
+ <?php endif; ?>
+ </label>
+ </li>
+ <?php endforeach; ?>
+</ul>
Modified: trunk/catalog/templates/defaut/includes/triggers/cart_line.inc
===================================================================
--- trunk/catalog/templates/defaut/includes/triggers/cart_line.inc 2014-02-14 11:09:01 UTC (rev 5149)
+++ trunk/catalog/templates/defaut/includes/triggers/cart_line.inc 2014-02-14 15:24:16 UTC (rev 5150)
@@ -44,6 +44,9 @@
@remarks check stock and prepare alert message
*/
if( ! Stock::check_inline($current) ){
+
+ $cart->remove($current['id']);
+
/// add in cart session
$cart->add_cart($current['id'], $product_qty_get, $attributes, false);
Modified: trunk/catalog/templates/defaut/includes/triggers/cart_totaux.inc
===================================================================
--- trunk/catalog/templates/defaut/includes/triggers/cart_totaux.inc 2014-02-14 11:09:01 UTC (rev 5149)
+++ trunk/catalog/templates/defaut/includes/triggers/cart_totaux.inc 2014-02-14 15:24:16 UTC (rev 5150)
@@ -13,12 +13,16 @@
global $cart;
if (is_object($cart) && $cart->count_contents() > 0) {
+
foreach($cart->show_list_total() as $i=>$tot) {
- $det .= '<li>'. sprintf('<span class="text">%s </span> <span class="value">%s</span>' ,$tot->text, $currencies->format($tot->value)) .'</li>' ;
+ $det .= '<li>'. sprintf('<span class="text">%s </span> <span class="value">%s</span>' ,$tot->text, $currencies->format($tot->value));
+
+ if(isset($tot->form) )
+ $det .= $tot->form;
+
+ $det .='</li>' ;
}
-
- $det .= '<li><span class="text">'.__('box shopping cart weight').'</span> <span class="value">'.$cart->show_weight().' '.UNIT_WEIGHT_NAME.'</span></li>'."\n";
}
/// force return by
Modified: trunk/test/phpunit/Front/core/orders/OrderTest.php
===================================================================
--- trunk/test/phpunit/Front/core/orders/OrderTest.php 2014-02-14 11:09:01 UTC (rev 5149)
+++ trunk/test/phpunit/Front/core/orders/OrderTest.php 2014-02-14 15:24:16 UTC (rev 5150)
@@ -134,7 +134,7 @@
$this ->assertTrue ( ( is_object($order) ) , 'Order Step Payment :: order is not object ' ) ;
//! load all enabled shipping modules
- $objShipping = new shipping();
+ $objShipping = shipping::getInstance();
$shipping = $objShipping->cheapest();
Modified: trunk/test/phpunit/Front/shippingTest.php
===================================================================
--- trunk/test/phpunit/Front/shippingTest.php 2014-02-14 11:09:01 UTC (rev 5149)
+++ trunk/test/phpunit/Front/shippingTest.php 2014-02-14 15:24:16 UTC (rev 5150)
@@ -98,7 +98,7 @@
$total_weight = $cart->show_weight();
$total_count = $cart->count_contents();
- $shipping = new shipping;
+ $shipping = shipping::getInstance();
$this -> assertTrue ( (is_object($shipping)) , 'error shipping loadclass' ) ;
@@ -122,7 +122,7 @@
$total_weight = $cart->show_weight();
$total_count = $cart->count_contents();
- $shipping = new shipping;
+ $shipping = shipping::getInstance();
$quote= $shipping->quote();
@@ -162,7 +162,7 @@
$total_weight = $cart->show_weight();
$total_count = $cart->count_contents();
- $shipping = new shipping;
+ $shipping = shipping::getInstance();
$quote= $shipping->quote();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2014-02-14 11:09:04
|
Revision: 5149
http://sourceforge.net/p/oscss/svn/5149
Author: oscim
Date: 2014-02-14 11:09:01 +0000 (Fri, 14 Feb 2014)
Log Message:
-----------
Fix
Modified Paths:
--------------
trunk/catalog/includes/classes/ModPublicOneShipping.php
trunk/catalog/includes/classes/shipping.php
trunk/catalog/includes/modules/shipping/mzmt.php
trunk/test/phpunit/Front/core/orders/OrderTest.php
trunk/test/phpunit/Front/shippingTest.php
Modified: trunk/catalog/includes/classes/ModPublicOneShipping.php
===================================================================
--- trunk/catalog/includes/classes/ModPublicOneShipping.php 2014-02-14 08:44:17 UTC (rev 5148)
+++ trunk/catalog/includes/classes/ModPublicOneShipping.php 2014-02-14 11:09:01 UTC (rev 5149)
@@ -204,12 +204,14 @@
if(!defined($cst))
return $this->SetEnabled(true);
- $cst = constant('MODULE_SHIPPING_'.$this->code.'_ZONE');
- $this->SetEnabled(false);
+ $cst = constant($cst);
+
if ( ((int)$cst > 0) && ((int)$cst == shipping::getGeoZoneID($order->delivery['country']['id'], $order->delivery['zone_id'])) )
- $this->SetEnabled(true);
+ return $this->SetEnabled(true);
elseif ((int)$cst == 0)
- $this->SetEnabled(true);
+ return $this->SetEnabled(true);
+
+ $this->SetEnabled(false);
}
}
Modified: trunk/catalog/includes/classes/shipping.php
===================================================================
--- trunk/catalog/includes/classes/shipping.php 2014-02-14 08:44:17 UTC (rev 5148)
+++ trunk/catalog/includes/classes/shipping.php 2014-02-14 11:09:01 UTC (rev 5149)
@@ -39,18 +39,15 @@
*/
function __construct($module='') {
self::initialise($module);
-
- $this->quote();
-
}
/**
*/
public static function getInstance($module='') {
- if(self::$_instance == null) {
- self::$_instance = new self($module);
- }
- return self::$_instance;
+ if(self::$_instance == null)
+ self::$_instance = new self($module);
+
+ return self::$_instance;
}
/**
Modified: trunk/catalog/includes/modules/shipping/mzmt.php
===================================================================
--- trunk/catalog/includes/modules/shipping/mzmt.php 2014-02-14 08:44:17 UTC (rev 5148)
+++ trunk/catalog/includes/modules/shipping/mzmt.php 2014-02-14 11:09:01 UTC (rev 5149)
@@ -37,11 +37,7 @@
$order_total;
function __construct() {
-
-
$this->code = __CLASS__;
- $this->title = __('module shipping mzmt text title');
- $this->description = __('module shipping mzmt text description');
$this->icon = '';
$this->num_geozones = (defined('MODULE_SHIPPING_MZMT_NUMBER_GEOZONES') ? MODULE_SHIPPING_MZMT_NUMBER_GEOZONES : 3 );
@@ -51,10 +47,6 @@
$this->sort_order= MODULE_SHIPPING_MZMT_SORT_ORDER ;
if(defined('MODULE_SHIPPING_MZMT_TAX_CLASS'))
$this->SetShoppingCart(MODULE_SHIPPING_MZMT_TAX_CLASS);
-
- global $order, $cart;
- if (is_object($order) && is_object($cart))
- $this->update_status($order, $cart);
}
/**
@@ -65,10 +57,10 @@
@fn quote($method = '')
*/
public function quote($method = '') {
- global $order, $shipping_weight;
+ global $order,$shipping_weight;
+
$delai = (defined('MODULE_SHIPPING_MZMT_MIN_DELAI')? MODULE_SHIPPING_MZMT_MIN_DELAI: 0);
-
$array = shippingUtility::getDelai( $delai );
$combined_quote_weight = (shipping::$shipping_num_boxes * $shipping_weight);
@@ -77,6 +69,7 @@
'module' => __('module shipping mzmt geozone ' . $this->delivery_geozone . ' text title') . ' (' . $combined_quote_weight . ' '.UNIT_WEIGHT_NAME.')',
'methods' => array()
);
+
$this->determineTableMethod(constant('MODULE_SHIPPING_MZMT_GEOZONE_' . $this->delivery_geozone . '_MODE') , $order );
@@ -134,35 +127,22 @@
public function update_status( Order $order , ShoppingCart $cart) {
- if ($this->enabled == true ) {
- $this->enabled = false;
+ if ($this->GetEnabled()) {
for ($n=1; $n<=$this->num_geozones; $n++) {
if(tep_cst_define('MODULE_SHIPPING_MZMT_GEOZONE_' . $n . '_ID') =='false'){
+ $this->SetEnabled(false);
break;
}
if ( ((int)constant('MODULE_SHIPPING_MZMT_GEOZONE_' . $n . '_ID') > 0) && ((int)constant('MODULE_SHIPPING_MZMT_GEOZONE_' . $n . '_ID') == shipping::getGeoZoneID($order->delivery['country']['id'], $order->delivery['zone_id'])) ) {
- $this->enabled = true;
+ $this->SetEnabled(true);
$this->delivery_geozone = $n;
break;
}
-// elseif ( ((int)constant('MODULE_SHIPPING_MZMT_GEOZONE_' . $n . '_ID') == 0) && ($n == (int)$this->num_geozones) ) {
-// $this->enabled = true;
-// $this->delivery_geozone = $n;
-// break;
-// }
}
}
}
-
-
-
-
-
-
-
-
}
?>
Modified: trunk/test/phpunit/Front/core/orders/OrderTest.php
===================================================================
--- trunk/test/phpunit/Front/core/orders/OrderTest.php 2014-02-14 08:44:17 UTC (rev 5148)
+++ trunk/test/phpunit/Front/core/orders/OrderTest.php 2014-02-14 11:09:01 UTC (rev 5149)
@@ -128,9 +128,13 @@
$total_weight = $cart->show_weight();
$total_count = $cart->count_contents();
-
+ $order = new order;
+
+
+ $this ->assertTrue ( ( is_object($order) ) , 'Order Step Payment :: order is not object ' ) ;
+
//! load all enabled shipping modules
- $objShipping = shipping::getInstance();
+ $objShipping = new shipping();
$shipping = $objShipping->cheapest();
Modified: trunk/test/phpunit/Front/shippingTest.php
===================================================================
--- trunk/test/phpunit/Front/shippingTest.php 2014-02-14 08:44:17 UTC (rev 5148)
+++ trunk/test/phpunit/Front/shippingTest.php 2014-02-14 11:09:01 UTC (rev 5149)
@@ -31,20 +31,11 @@
function __construct()
{
-
-
- //! tot cart
-// $total_weight = $cart->show_weight();
-// $total_count = $cart->count_contents();
-
-
}
protected function setUp()
{
-// global $user,$address;
-
$address=array( 'gender'=>'m',
'firstname' => 'testtest2',
'lastname' => 'testtest2',
@@ -99,6 +90,7 @@
*/
public function testshippingloadclass($cart){
+ global $order, $cart;
//! load order
$order = new order;
@@ -120,6 +112,9 @@
* @depends testshippingshoppingcart
*/
public function testshippingquote($cart){
+
+ global $order, $cart;
+
//! load order
$order = new order();
@@ -158,6 +153,8 @@
* @depends testshippingshoppingcart
*/
public function testshippingcheapest($cart){
+
+ global $order, $cart;
//! load order
$order = new order;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2014-02-14 08:44:21
|
Revision: 5148
http://sourceforge.net/p/oscss/svn/5148
Author: oscim
Date: 2014-02-14 08:44:17 +0000 (Fri, 14 Feb 2014)
Log Message:
-----------
Fix
Add free methode
Add comment
Modified Paths:
--------------
trunk/catalog/admin/includes/modules/shipping/spu.php
trunk/catalog/includes/modules/shipping/flat.php
trunk/catalog/includes/modules/shipping/item.php
trunk/catalog/includes/modules/shipping/mzmt.php
trunk/catalog/includes/modules/shipping/spu.php
trunk/test/phpunit/Back/phpunittest.xml
trunk/test/phpunit/Back/test_nostock.xml
Added Paths:
-----------
trunk/catalog/admin/includes/modules/shipping/free.php
trunk/catalog/admin/includes/modules/shipping/mzmt.php
trunk/catalog/includes/modules/shipping/free.php
Added: trunk/catalog/admin/includes/modules/shipping/free.php
===================================================================
--- trunk/catalog/admin/includes/modules/shipping/free.php (rev 0)
+++ trunk/catalog/admin/includes/modules/shipping/free.php 2014-02-14 08:44:17 UTC (rev 5148)
@@ -0,0 +1,179 @@
+<?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 05/01/2014, 12:45
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+ @file free.php
+ @dir admin/includes/modules/shipping/
+*/
+
+require_once(DIR_FS_ADMIN . DIR_WS_CLASSES .'ModOneSimple.php');
+
+
+
+/**
+ @class free
+ @extends ModOneSimple
+*/
+class free
+ Extends ModOneSimple
+ {
+ /**
+ @var
+ */
+ public $icon;
+ /**
+ @var string name of subtype module
+ */
+ public $subtype = 'shipping';
+ /**
+ @var string name of subtype module
+ */
+ public $parenttype = 'orders';
+ /**
+ @var
+ */
+ public $tax_class;
+ /**
+ @var use in gabarit file
+ */
+ public static $current;
+ /**
+ @var use shipping/delivery saterday
+ */
+ public $with_saterday = false;
+ /**
+ @var use shipping/delivery sunday
+ */
+ public $with_sunday = false;
+
+
+ /**
+ @brief class constructor
+ */
+ public function __construct() {
+ $this->code =__CLASS__;
+ $this->title = __('module shipping free text title');
+ $this->description = __('module shipping free text description');
+ $this->sort_order = (defined('MODULE_SHIPPING_FREE_SORT_ORDER')? MODULE_SHIPPING_FREE_SORT_ORDER : 0) ;
+ $this->icon = ( (defined('MODULE_SHIPPING_FREE_ICON') && tep_not_null('MODULE_SHIPPING_FREE_ICON') ) ? MODULE_SHIPPING_FREE_ICON : '');
+ $this->tax_class = 0;
+ $delai = (defined('MODULE_SHIPPING_FREE_MIN_DELAI')? MODULE_SHIPPING_FREE_MIN_DELAI: 0);
+
+
+ self::$current= array(
+ 'id' => $this->code,
+ 'title' => $this->title,
+ 'icon'=>tep_image($this->icon, $this->title),
+ 'with_saterday' => $this->with_saterday,
+ 'min_delai' => $delai,
+ );
+
+ $array = shippingUtility::getDelai( $delai );
+
+ self::$current['delai'] = $array['delai'];
+ self::$current['date_remise_provider'] = $array['date_dep'];
+ self::$current['date_delivery'] = $array['date_liv'];
+ }
+
+
+
+
+ /**
+ @remarks implements InterfaceModule depend
+ if module twin in backoffice, report all content install in the other module
+ public function install() {return true;}
+ public function keys() {return array(); }
+ */
+
+ /**
+ @fn install()
+ @brief add all configuration
+ @note
+ - Modules can emarquer sql installation instructions, however, in the case of transverse information, or dependent of an extension, preferring the implementation of an extension, file with sql independent
+ - please, pefix all var configuration by 'MODULE_OT__MODTYPENAME_MAJ_'
+ - if module twin in backoffice, report all content install in the other module
+ - Not use language in DB , but function :__()
+ for MODULE_TOTO_ST
+ var title MODULE_TOTO_ST_S (small description)
+ var description MODULE_TOTO_ST_L (long description)
+ */
+ public function install() {
+
+ $list = array(
+ array(
+ 'key'=>'MODULE_SHIPPING_FREE',
+ 'value'=>'false',
+ 'type'=> 2,
+ 'use'=>'tep_value_for_humain',
+ 'set'=>'tep_cfg_select_option(array(\'true\', \'false\'),'
+ ),
+
+ array(
+ 'key'=>'MODULE_SHIPPING_FREE_MODE',
+ 'value'=>'both',
+ 'type'=> 2,
+ 'set'=>'tep_cfg_select_option(array(\'both\', \'item\', \'weight\', \'price\'),'
+ ),
+ array(
+ 'key'=>'MODULE_SHIPPING_FREE_OVER',
+ 'value'=>'200',
+ 'type'=> 2
+ ),
+ array(
+ 'key'=>'MODULE_SHIPPING_FREE_DESTINATION',
+ 'value'=>'both',
+ 'type'=> 2,
+ 'set'=>'tep_cfg_select_option(array(\'both\', \'national\', \'international\'),'
+ ),
+ array(
+ 'key'=>'MODULE_SHIPPING_FREE_SORT_ORDER',
+ 'value'=>5,
+ 'type'=> 2
+ ),
+ array(
+ 'key'=>'MODULE_SHIPPING_FREE_ICON',
+ 'value'=>'',
+ 'type'=> 2,
+ 'set'=>'tep_cfg_choose_img('
+ ),
+ array(
+ 'key'=>'MODULE_SHIPPING_FREE_MIN_DELAI',
+ 'value'=>'172800',
+ 'type'=> 2,
+ 'use'=>'tep_get_delai_title',
+ 'set'=>'tep_cfg_pull_down_delai('
+ ),
+ );
+
+ $error = 0;
+ foreach($list as $row)
+ if(!sqlconfiguration::fetch(array('key'=>$row['key'])) )
+ if ( ! sqlconfiguration::create($row) )
+ $error++;
+
+
+ $this->_check = true;
+ }
+
+ /**
+ @fn keys()
+ @return array all key configuration define by this module
+ */
+ public function keys() {
+ return array(
+ 'MODULE_SHIPPING_FREE',
+ 'MODULE_SHIPPING_FREE_OVER',
+ 'MODULE_SHIPPING_FREE_MODE',
+ 'MODULE_SHIPPING_FREE_DESTINATION',
+ 'MODULE_SHIPPING_FREE_MIN_DELAI',
+ 'MODULE_SHIPPING_FREE_SORT_ORDER',
+ 'MODULE_SHIPPING_FREE_ICON',
+ );
+ }
+
+}
+?>
\ No newline at end of file
Added: trunk/catalog/admin/includes/modules/shipping/mzmt.php
===================================================================
--- trunk/catalog/admin/includes/modules/shipping/mzmt.php (rev 0)
+++ trunk/catalog/admin/includes/modules/shipping/mzmt.php 2014-02-14 08:44:17 UTC (rev 5148)
@@ -0,0 +1,208 @@
+<?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 05/01/2014, 12:45
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+ @file mzmt.php
+ @dir admin/includes/modules/shipping/
+*/
+
+require_once(DIR_FS_ADMIN . DIR_WS_CLASSES .'ModOneSimple.php');
+
+/**
+ @class mzmt
+ @extends ModOneSimple
+*/
+class mzmt
+ Extends ModOneSimple{
+ /**
+ @var
+ */
+ public $icon;
+ /**
+ @var
+ */
+ public $tax_class = 0 ;
+ /**
+ @var string name of subtype module
+ */
+ public $subtype = 'shipping';
+ /**
+ @var string name of subtype module
+ */
+ public $parenttype = 'orders';
+ /**
+ @var use in gabarit file
+ */
+ public static $current;
+ /**
+ @var use shipping/delivery saterday
+ */
+ public $with_saterday = false;
+ /**
+ @var use shipping/delivery sunday
+ */
+ public $with_sunday = false;
+
+// class constructor
+ public function __construct() {
+ $this->code = __CLASS__;
+ $this->title = __('module shipping text mzmt title');
+ $this->description = __('module shipping mzmt text description');
+ $this->sort_order = (defined('MODULE_SHIPPING_MZMT_SORT_ORDER')? MODULE_SHIPPING_MZMT_SORT_ORDER: 0);
+ $this->icon = (defined('MODULE_SHIPPING_MZMT_ICON')? MODULE_SHIPPING_MZMT_ICON : '');
+ $this->enabled = true ;
+
+ $this->num_geozones = (defined('MODULE_SHIPPING_MZMT_NUMBER_GEOZONES') ? MODULE_SHIPPING_MZMT_NUMBER_GEOZONES : 3 );
+ $this->num_tables = (defined('MODULE_SHIPPING_MZMT_NUMBER_TABLES') ? MODULE_SHIPPING_MZMT_NUMBER_TABLES : 3 );
+
+ global $order;
+ if (is_object($order)) $this->update_status($order);
+ }
+
+// class methods
+ public function update_status($order) {
+ if ($this->enabled == true ) {
+ $this->enabled = false;
+ if ( ((int)MODULE_SHIPPING_MZMT_ZONE > 0) && ((int)MODULE_SHIPPING_MZMT_ZONE == shipping::getGeoZoneID($order->delivery['country']['id'], $order->delivery['zone_id'])) )
+ $this->enabled = true;
+ elseif ((int)MODULE_SHIPPING_MZMT_ZONE == 0)
+ $this->enabled = true;
+ }
+ }
+
+
+
+ /**
+ @remarks implements InterfaceModule depend
+ if module twin in backoffice, report all content install in the other module
+ public function install() {return true;}
+ public function keys() {return array(); }
+ */
+
+
+ /**
+ @fn install()
+ @brief add all configuration
+ @note
+ - Modules can emarquer sql installation instructions, however, in the case of transverse information, or dependent of an extension, preferring the implementation of an extension, file with sql independent
+ - please, pefix all var configuration by 'MODULE_OT__MODTYPENAME_MAJ_'
+ - if module twin in backoffice, report all content install in the other module
+ - Not use language in DB , but function :__()
+ for MODULE_TOTO_ST
+ var title MODULE_TOTO_ST_S (small description)
+ var description MODULE_TOTO_ST_L (long description)
+ */
+ public function install() {
+
+
+
+ $list = array(
+ array(
+ 'key'=>'MODULE_SHIPPING_MZMT_NUMBER_GEOZONES',
+ 'value'=>'0.0',
+ 'type'=> 2
+ ),
+ array(
+ 'key'=>'MODULE_SHIPPING_MZMT_NUMBER_TABLES',
+ 'value'=>0,
+ 'type'=> 2
+ ),
+ array(
+ 'key'=>'MODULE_SHIPPING_MZMT_TAX_CLASS',
+ 'value'=>0,
+ 'type'=> 2,
+ 'use'=>'tep_get_tax_class_title',
+ 'set'=>'tep_cfg_pull_down_tax_classes('
+ ),
+ array(
+ 'key'=>'MODULE_SHIPPING_MZMT_SORT_ORDER',
+ 'value'=>5,
+ 'type'=> 2
+ ),
+ array(
+ 'key'=>'MODULE_SHIPPING_MZMT_ICON',
+ 'value'=>'',
+ 'type'=> 2,
+ 'set'=>'tep_cfg_choose_img('
+ ),
+ );
+
+ for ($n=1; $n<=$this->num_geozones; $n++) {
+ $list[] =array(
+ 'key'=>'MODULE_SHIPPING_MZMT_GEOZONE_'.$n.'_ID',
+ 'value'=>'0.0',
+ 'type'=> 2,
+ 'use'=>'tep_get_zone_class_title',
+ 'set'=>'tep_cfg_pull_down_zone_shipping('
+ );
+ $list[] =array(
+ 'key'=>'MODULE_SHIPPING_MZMT_GEOZONE_'.$n.'_MODE',
+ 'value'=>'0.0',
+ 'type'=> 2,
+ 'set'=>'tep_cfg_select_option(array(\'weight\', \'price\', \'count\'), ',
+ );
+ $list[] =array(
+ 'key'=>'MODULE_SHIPPING_MZMT_GEOZONE_'.$n.'_HANDLING',
+ 'value'=>'0.0',
+ 'type'=> 2
+ );
+ $list[] =array(
+ 'key'=>'MODULE_SHIPPING_MZMT_GEOZONE_'.$n.'_ICON',
+ 'value'=>'',
+ 'type'=> 2,
+ 'set'=>'tep_cfg_choose_img('
+ );
+
+ for ($j=1; $j<=$this->num_tables; $j++) {
+ $list[] =array(
+ 'key'=>'MODULE_SHIPPING_MZMT_GEOZONE_'.$n.'_TABLE_'.$j,
+ 'value'=>'0.0',
+ 'type'=> 2
+ );
+ }
+ }
+
+
+ $error = 0;
+ foreach($list as $row)
+ if(!sqlconfiguration::fetch(array('key'=>$row['key'])) )
+ if ( ! sqlconfiguration::create($row) )
+ $error++;
+
+
+ $this->_check = true;
+ }
+
+
+ /**
+ @fn keys()
+ @return array all key configuration define by this module
+ */
+ public function keys() {
+ $keys = array(
+ 'MODULE_SHIPPING_MZMT_TAX_CLASS',
+ 'MODULE_SHIPPING_MZMT_SORT_ORDER',
+ 'MODULE_SHIPPING_MZMT_NUMBER_GEOZONES',
+ 'MODULE_SHIPPING_MZMT_NUMBER_TABLES'
+ );
+
+ for ($n=1; $n<=$this->num_geozones; $n++) {
+ $keys[] = 'MODULE_SHIPPING_MZMT_GEOZONE_' . $n . '_ID';
+ $keys[] = 'MODULE_SHIPPING_MZMT_GEOZONE_' . $n . '_MODE';
+ $keys[] = 'MODULE_SHIPPING_MZMT_GEOZONE_' . $n . '_HANDLING';
+ $keys[] = 'MODULE_SHIPPING_MZMT_GEOZONE_' . $n . '_ICON';
+
+ for ($j=1; $j<=$this->num_tables; $j++) {
+ $keys[] = 'MODULE_SHIPPING_MZMT_GEOZONE_' . $n . '_TABLE_' . $j;
+ }
+ }
+
+ return $keys;
+ }
+
+}
+?>
\ No newline at end of file
Modified: trunk/catalog/admin/includes/modules/shipping/spu.php
===================================================================
--- trunk/catalog/admin/includes/modules/shipping/spu.php 2014-02-14 08:16:23 UTC (rev 5147)
+++ trunk/catalog/admin/includes/modules/shipping/spu.php 2014-02-14 08:44:17 UTC (rev 5148)
@@ -110,8 +110,8 @@
'key'=>'MODULE_SHIPPING_SPU_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_SPU_ZIP',
@@ -127,7 +127,7 @@
'key'=>'MODULE_SHIPPING_SPU_ICON',
'value'=>'',
'type'=> 2,
- 'set_function'=>'tep_cfg_choose_img('
+ 'set'=>'tep_cfg_choose_img('
),
);
Modified: trunk/catalog/includes/modules/shipping/flat.php
===================================================================
--- trunk/catalog/includes/modules/shipping/flat.php 2014-02-14 08:16:23 UTC (rev 5147)
+++ trunk/catalog/includes/modules/shipping/flat.php 2014-02-14 08:44:17 UTC (rev 5148)
@@ -3,31 +3,30 @@
@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 09/01/12, 12:42
+ @version 2.2.0
+ @date 14/02/2014, 12:45
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
+ @file flat.php
+ @dir includes/modules/shipping/
*/
-// class flat
-// implements InterfaceModule, InterfaceAcaShipping{
+
require_once(DIR_FS_CATALOG . DIR_WS_CLASSES .'ModPublicOneShipping.php');
-
+/**
+ @class flat
+ @extends ModPublicOneShipping
+ @implements IntMod normal base all module
+ @implements ShippingInterface Functionnnal Interface : specific for all order total module
+ @implements ShippingCheapestInterface Functionnnal Interface : Actiavte cheapset selected methode
+*/
class flat
Extends ModPublicOneShipping
implements
-// InterfaceModule,
-// InterfaceAcaShipping
-
- // normal base all module
- IntMod
-
- // Functionnnal Interface
- // specific for all order total module
- , ShippingInterface
- // Actiavte cheapset selected methode
- , ShippingCheapestInterface
+ IntMod
+ , ShippingInterface
+ , ShippingCheapestInterface
// add in display cart
// , ShippingCartInterface
{
Added: trunk/catalog/includes/modules/shipping/free.php
===================================================================
--- trunk/catalog/includes/modules/shipping/free.php (rev 0)
+++ trunk/catalog/includes/modules/shipping/free.php 2014-02-14 08:44:17 UTC (rev 5148)
@@ -0,0 +1,128 @@
+<?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.2.0
+ @date 14/02/2014, 12:45
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+ @file free.php
+ @dir includes/modules/shipping/
+*/
+
+require_once(DIR_FS_CATALOG . DIR_WS_CLASSES .'ModPublicOneShipping.php');
+
+/**
+ @class free
+ @extends ModPublicOneShipping
+ @implements IntMod normal base all module
+ @implements ShippingInterface Functionnnal Interface : specific for all order total module
+ @implements ShippingCheapestInterface Functionnnal Interface : Actiavte cheapset selected methode
+*/
+class free
+ Extends ModPublicOneShipping
+ implements
+ IntMod
+ , ShippingInterface
+ , ShippingCheapestInterface
+ // add in display cart
+// , ShippingCartInterface
+ {
+
+
+// class constructor
+ public function __construct() {
+ $this->code = 'free';
+ $this->icon = ( (defined('MODULE_SHIPPING_FREE_ICON') && tep_not_null('MODULE_SHIPPING_FREE_ICON'))? substr(MODULE_SHIPPING_FREE_ICON,strlen(DIR_WS_CATALOG)) : '');
+
+ if(defined('MODULE_SHIPPING_FREE_SORT_ORDER'))
+ $this->sort_order= MODULE_SHIPPING_FREE_SORT_ORDER ;
+ if(defined('MODULE_SHIPPING_FREE_TAX_CLASS'))
+ $this->SetShoppingCart(MODULE_SHIPPING_FREE_TAX_CLASS);
+
+ global $order, $cart;
+ if (is_object($order) && is_object($cart))
+ $this->update_status($order, $cart);
+ }
+
+
+/** Interface InterfaceAcaShipping */
+
+ public function quote($method = '') {
+ global $order, $total_count;
+
+ $delai = (defined('MODULE_SHIPPING_FREE_MIN_DELAI')? MODULE_SHIPPING_FREE_MIN_DELAI: 0);
+
+ $array = shippingUtility::getDelai( $delai );
+
+ $this->quotes = array(
+ 'id' => $this->code,
+ 'module' => __('module shipping free text title in shipping'),
+ 'methods' => array(
+ array(
+ 'id' => $this->code,
+ 'tax'=>0,
+ 'title' => __('module shipping free text way'),
+
+ 'delai' => $array['delai'],
+ 'date_remise_provider' => $array['date_dep'],
+ 'date_delivery' => $array['date_liv'],
+
+ 'cost_ht' => 0,
+ 'cost' => 0
+ )
+ )
+ );
+
+ if (tep_not_null($this->icon)) $this->quotes['icon'] = shipping::get_icon($this->icon, $this->title);
+
+ return $this->quotes;
+ }
+
+ public function update_status( Order $order , ShoppingCart $cart) {
+
+ //! livraison gratuite
+ if (_cst_bool('MODULE_SHIPPING_FREE')) {
+ $pass = false;
+ switch (MODULE_SHIPPING_FREE_DESTINATION) {
+ case 'national': if ($order->delivery['country_id'] == STORE_COUNTRY) $pass = true; break;
+ case 'international': if ($order->delivery['country_id'] != STORE_COUNTRY) $pass = true; break;
+ case 'both': $pass = true; break;
+ }
+
+ if(!$pass)
+ return $this->SetEnabled(false);
+
+
+ switch(MODULE_SHIPPING_FREE_MODE){
+ case 'item';
+ $value_check = $cart->count_contents();
+ break;
+ case 'weight';
+ $value_check = $total_weight = $cart->show_weight();
+ break;
+ case 'price';
+ $value_check = $order->info['total'];
+ break;
+ default:
+ $list = array(
+ $cart->count_contents(),
+ $total_weight = $cart->show_weight(),
+ $order->info['total']
+ );
+
+ foreach($list as $row)
+ if($value_check >$row)
+ $value_check = $row;
+ }
+
+ if ( $value_check >= MODULE_SHIPPING_FREE_OVER )
+ return $this->SetEnabled(true);
+ }
+
+ $this->SetEnabled(false);
+ }
+
+}
+?>
\ No newline at end of file
Modified: trunk/catalog/includes/modules/shipping/item.php
===================================================================
--- trunk/catalog/includes/modules/shipping/item.php 2014-02-14 08:16:23 UTC (rev 5147)
+++ trunk/catalog/includes/modules/shipping/item.php 2014-02-14 08:44:17 UTC (rev 5148)
@@ -3,31 +3,29 @@
@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 111/05/2012, 12:45
+ @version 2.2.0
+ @date 14/02/2014, 12:45
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
+ @file item.php
+ @dir includes/modules/shipping/
*/
require_once(DIR_FS_CATALOG . DIR_WS_CLASSES .'ModPublicOneShipping.php');
/**
- @class item
+ @class item
+ @extends ModPublicOneShipping
+ @implements IntMod normal base all module
+ @implements ShippingInterface Functionnnal Interface : specific for all order total module
+ @implements ShippingCheapestInterface Functionnnal Interface : Actiavte cheapset selected methode
*/
class item
Extends ModPublicOneShipping
implements
-
-
- // normal base all module
IntMod
-
- // Functionnnal Interface
- // specific for all order total module
- , ShippingInterface
-
- // add in display cart
-// , ShippingCartInterface
+ , ShippingInterface
+ , ShippingCheapestInterface
{
Modified: trunk/catalog/includes/modules/shipping/mzmt.php
===================================================================
--- trunk/catalog/includes/modules/shipping/mzmt.php 2014-02-14 08:16:23 UTC (rev 5147)
+++ trunk/catalog/includes/modules/shipping/mzmt.php 2014-02-14 08:44:17 UTC (rev 5148)
@@ -1,35 +1,32 @@
<?php
/**
- @licence GPL 2005-2009 The osCSS developers - osCSS Open Source E-commerce
- @package oscss-2 <www http://www.oscss.org>
- @version Rc-3
- @date 18/04/10, 16:17
+ @licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
+ @portion code Copyright (c) 2002 osCommerce
+ @package osCSS-2 <www http://www.oscss.org>
+ @version 2.2.0
+ @date 14/02/2014, 12:45
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
- @encode UTF-8
+ @encode UTF-8
+ @file mzmt.php
+ @dir includes/modules/shipping/
*/
+
require_once(DIR_FS_CATALOG . DIR_WS_CLASSES .'ModPublicOneShipping.php');
/**
- @class mzmt
+ @class mzmt
+ @extends ModPublicOneShipping
+ @implements IntMod normal base all module
+ @implements ShippingInterface Functionnnal Interface : specific for all order total module
+ @implements ShippingCheapestInterface Functionnnal Interface : Actiavte cheapset selected methode
*/
class mzmt
Extends ModPublicOneShipping
implements
-
-
- // normal base all module
- IntMod
-
- // Functionnnal Interface
- // specific for all order total module
- , ShippingInterface
-
- // Actiavte cheapset selected methode
- , ShippingCheapestInterface
-
- // add in display cart
-// , ShippingCartInterface
+ IntMod
+ , ShippingInterface
+ , ShippingCheapestInterface
{
@@ -161,75 +158,11 @@
-
- /**
- @implements IntMod
- */
-
-
- public function check() {
- if (!isset($this->_check)) {
- $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key LIKE 'MODULE_SHIPPING_MZMT_%' ");
- if( tep_db_num_rows($check_query) == (4+ ($this->num_geozones* 4)+(+$this->num_tables *$this->num_geozones) ) ) $this->_check=true;
- else {
- $this->remove();
- $this->_check=false;
- }
- }
- return $this->_check;
- }
+
- public function install() {
- $DB=Database::getInstance();
- $DB->query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('tax class', 'MODULE_SHIPPING_MZMT_TAX_CLASS', '0', 'use the following tax class on the shipping fee.', '6', '0', 'tep_get_tax_class_title', 'tep_cfg_pull_down_tax_classes(', now())");
- $DB->query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('sort order', 'MODULE_SHIPPING_MZMT_SORT_ORDER', '0', 'sort order of display.', '6', '0', now())");
- $DB->query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('number geozones', 'MODULE_SHIPPING_MZMT_NUMBER_GEOZONES', '".(defined('MODULE_SHIPPING_MZMT_NUMBER_GEOZONES')? MODULE_SHIPPING_MZMT_NUMBER_GEOZONES : '3')."', 'use the following tax class on the shipping fee.', '6', '0', now())");
- $DB->query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('number tables', 'MODULE_SHIPPING_MZMT_NUMBER_TABLES', '".(defined('MODULE_SHIPPING_MZMT_NUMBER_TABLES')? MODULE_SHIPPING_MZMT_NUMBER_TABLES : '3')."', 'Sort order of display.', '6', '0', now())");
- for ($n=1; $n<=$this->num_geozones; $n++) {
- $DB->query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('<hr />Geo Zone $n', 'MODULE_SHIPPING_MZMT_GEOZONE_".$n."_ID', '', 'Enable this for the following geo zone.', '6', '0', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_shipping(', 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 ('Geo Zone $n Table Method', 'MODULE_SHIPPING_MZMT_GEOZONE_".$n."_MODE', 'weight', 'The shipping cost is based on the total weight, total price, or total count of the items ordered.', '6', '0', 'tep_cfg_select_option(array(\'weight\', \'price\', \'count\'), ', now())");
- $DB->query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Geo Zone $n Handling Fee', 'MODULE_SHIPPING_MZMT_GEOZONE_".$n."_HANDLING', '0', 'Handling Fee for this shipping geo zone', '6', '0', now())");
- $DB->query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added,set_function) values ('choose icon', 'MODULE_SHIPPING_MZMT_GEOZONE_".$n."_ICON', '', 'choose icon transporteur', '6', '0', now(),'tep_cfg_choose_img(')");
-
- for ($j=1; $j<=$this->num_tables; $j++) {
- $DB->query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Geo Zone $n Shipping Table $j', 'MODULE_SHIPPING_MZMT_GEOZONE_".$n."_TABLE_".$j."', '', 'Shipping table $j for this geo zone', '6', '0', now())");
- }
-
-
- }
- }
-
- public function remove() {
- tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key LIKE 'MODULE_SHIPPING_MZMT_%' ");
- }
-
- public function keys() {
- $keys = array( 'MODULE_SHIPPING_MZMT_TAX_CLASS', 'MODULE_SHIPPING_MZMT_SORT_ORDER','MODULE_SHIPPING_MZMT_NUMBER_GEOZONES','MODULE_SHIPPING_MZMT_NUMBER_TABLES');
-
- for ($n=1; $n<=$this->num_geozones; $n++) {
- $keys[] = 'MODULE_SHIPPING_MZMT_GEOZONE_' . $n . '_ID';
- $keys[] = 'MODULE_SHIPPING_MZMT_GEOZONE_' . $n . '_MODE';
- $keys[] = 'MODULE_SHIPPING_MZMT_GEOZONE_' . $n . '_HANDLING';
- $keys[] = 'MODULE_SHIPPING_MZMT_GEOZONE_' . $n . '_ICON';
-
- for ($j=1; $j<=$this->num_tables; $j++) {
- $keys[] = 'MODULE_SHIPPING_MZMT_GEOZONE_' . $n . '_TABLE_' . $j;
- }
- }
-
- return $keys;
- }
-
-
-/** PRIVATE/PUBLIC Specific module */
-
-
-
-
-
}
?>
Modified: trunk/catalog/includes/modules/shipping/spu.php
===================================================================
--- trunk/catalog/includes/modules/shipping/spu.php 2014-02-14 08:16:23 UTC (rev 5147)
+++ trunk/catalog/includes/modules/shipping/spu.php 2014-02-14 08:44:17 UTC (rev 5148)
@@ -3,35 +3,29 @@
@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 06/05/2012, 00:04
+ @version 2.2.0
+ @date 14/02/2014, 12:45
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
+ @file spu.php
+ @dir includes/modules/shipping/
@CONTRIB is Store Pickup Shipping Module (http://www.oscommerce.com/community/contributions,164)
Made to work with latest check-out procedure by Matthijs (Mattice) >> e-mail: ma...@xs... >> site: http://www.matthijs.org
-
- NOTE: Utilise fichier text pour les langue et __()
*/
require_once(DIR_FS_CATALOG . DIR_WS_CLASSES .'ModPublicOneShipping.php');
/**
- @class spu
+ @class spu
+ @extends ModPublicOneShipping
+ @implements IntMod normal base all module
+ @implements ShippingInterface Functionnnal Interface : specific for all order total module
*/
class spu
Extends ModPublicOneShipping
implements
-
-
- // normal base all module
- IntMod
-
- // Functionnnal Interface
- // specific for all order total module
+ IntMod
, ShippingInterface
-
- // add in display cart
-// , ShippingCartInterface
{
Modified: trunk/test/phpunit/Back/phpunittest.xml
===================================================================
--- trunk/test/phpunit/Back/phpunittest.xml 2014-02-14 08:16:23 UTC (rev 5147)
+++ trunk/test/phpunit/Back/phpunittest.xml 2014-02-14 08:44:17 UTC (rev 5148)
@@ -27,7 +27,8 @@
<const name="MODULE_SHIPPING_INSTALLED_BO" value="mzmt.php;mzmt.php;item.php;flat.php;spu.php"/>
<const name="MODULE_SHIPPING_INSTALLED" value="mzmt.php;mzmt.php;item.php;flat.php;spu.php"/>
<const name="MODULE_PAYMENT_INSTALLED_BO" value="moneyorder.php"/>
- <const name="MODULE_PAYMENT_INSTALLED" value="moneyorder.php"/>
+ <const name="MODULE_PAYMENT_INSTALLED" value="moneyorder.php;cod.php"/>
+ <const name="MODULE_ORDER_TOTAL_INSTALLED" value="ot_total.php;ot_subtotal.php;ot_tax.php;ot_shippng.php"/>
<const name="MODULE_CAT_INSTALLED" value=""/>
<const name="MODULE_CAT_INSTALLED_BO" value="header_tags.php;"/>
Modified: trunk/test/phpunit/Back/test_nostock.xml
===================================================================
--- trunk/test/phpunit/Back/test_nostock.xml 2014-02-14 08:16:23 UTC (rev 5147)
+++ trunk/test/phpunit/Back/test_nostock.xml 2014-02-14 08:44:17 UTC (rev 5148)
@@ -14,7 +14,32 @@
<log type="testdox-html" target="../../../html/test/doc/admin/nostock/testdox.html" yui="true" highlight="false"/>
</logging>
+ <php>
+ <env name="OSCSS_ENVIRONEMENT" value="autotesting"/>
+
+ <!-- General config -->
+
+
+ <!-- load modules subtype -->
+ <const name="MODULE_ACCOUNT_INSTALLED" value="account_extra.php;address_book.php;history.php"/>
+ <const name="MODULE_ACCOUNT_INSTALLED_BO" value="address_book.php;history.php"/>
+ <const name="MODULE_CONTENT_INSTALLED" value="header_tags.php;"/>
+ <const name="MODULE_CONTENT_INSTALLED_BO" value="header_tags.php;"/>
+ <const name="MODULE_ACAPRO_INSTALLED_BO" value="desc_base.php;header_tags.php;"/>
+ <const name="MODULE_ACAPRO_INSTALLED_BO" value="desc_base.php;"/>
+ <const name="MODULE_ACAPRO_INSTALLED" value="desc_base.php;"/>
+ <const name="MODULE_SHIPPING_INSTALLED_BO" value="mzmt.php;mzmt.php;item.php;flat.php;spu.php"/>
+ <const name="MODULE_SHIPPING_INSTALLED" value="mzmt.php;mzmt.php;item.php;flat.php;spu.php"/>
+ <const name="MODULE_PAYMENT_INSTALLED_BO" value="moneyorder.php"/>
+ <const name="MODULE_PAYMENT_INSTALLED" value="moneyorder.php;cod.php"/>
+ <const name="MODULE_ORDER_TOTAL_INSTALLED" value="ot_total.php;ot_subtotal.php;ot_tax.php;ot_shippng.php"/>
+ <const name="MODULE_CAT_INSTALLED" value=""/>
+ <const name="MODULE_CAT_INSTALLED_BO" value="header_tags.php;"/>
+
+ <!-- Product config -->
+ <const name="STOCK_CHECK" value="true"/>
+ </php>
<testsuites>
<testsuite name="all">
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2014-02-14 08:16:26
|
Revision: 5147
http://sourceforge.net/p/oscss/svn/5147
Author: oscim
Date: 2014-02-14 08:16:23 +0000 (Fri, 14 Feb 2014)
Log Message:
-----------
Fix
Modified Paths:
--------------
trunk/catalog/admin/includes/classes/GraphUtility.php
trunk/catalog/admin/includes/modules/pages/graphs_stats.php
trunk/catalog/admin/includes/template/defaut/header-1.php
trunk/catalog/common/classes/datatype_drivers/Data_featured.php
Modified: trunk/catalog/admin/includes/classes/GraphUtility.php
===================================================================
--- trunk/catalog/admin/includes/classes/GraphUtility.php 2014-02-13 15:30:14 UTC (rev 5146)
+++ trunk/catalog/admin/includes/classes/GraphUtility.php 2014-02-14 08:16:23 UTC (rev 5147)
@@ -1,9 +1,9 @@
<?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 06/11/13, 09:55
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
@@ -50,6 +50,8 @@
@return path img
*/
static public function CallGraph($class, $mini=false){
+
+ $path = DIR_FS_ROOT_DOCS . 'admin/images/graphs/';
$class=(!empty($class) ? $class : self::$graph );
@@ -61,9 +63,15 @@
$width=$width=isset($_REQUEST['width'])? ((int)$_REQUEST['width']) : 200 ;
eval('$ratio = ('.self::$ratio.');');
$height=($width * $ratio);
- $PathImgCache=DIR_FS_ROOT_DOCS . 'admin/images/graphs/'.$class.'-' . $width .'.'. self::$_extension;
+
+ if(file_exists($path))
+ fileUtility::_mkdir($path);
+
+ $PathImgCache=$path.$class.'-' . $width .'.'. self::$_extension;
+
+
$Driver->CallConfig($class,array(
'mini'=>(bool)$mini,
'width'=>$width,
Modified: trunk/catalog/admin/includes/modules/pages/graphs_stats.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/graphs_stats.php 2014-02-13 15:30:14 UTC (rev 5146)
+++ trunk/catalog/admin/includes/modules/pages/graphs_stats.php 2014-02-14 08:16:23 UTC (rev 5147)
@@ -35,7 +35,7 @@
/**
@var Folder image result graph
*/
- const PATH_IMG_GRAPH = 'admin/images/graph/';
+ const PATH_IMG_GRAPH = 'admin/images/graphs/';
/**
@var
*/
Modified: trunk/catalog/admin/includes/template/defaut/header-1.php
===================================================================
--- trunk/catalog/admin/includes/template/defaut/header-1.php 2014-02-13 15:30:14 UTC (rev 5146)
+++ trunk/catalog/admin/includes/template/defaut/header-1.php 2014-02-14 08:16:23 UTC (rev 5147)
@@ -1,12 +1,14 @@
<?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
+ @file header-1.php
+ @dir admin/includes/templates/defaut/
*/
$class_widget="adminBlock";
?>
@@ -15,7 +17,7 @@
<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_ADMINNOTIF, '', 'NONSSL') ?>" class="messages"><?php echo __('notifications') ?> (<?php echo 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/common/classes/datatype_drivers/Data_featured.php
===================================================================
--- trunk/catalog/common/classes/datatype_drivers/Data_featured.php 2014-02-13 15:30:14 UTC (rev 5146)
+++ trunk/catalog/common/classes/datatype_drivers/Data_featured.php 2014-02-14 08:16:23 UTC (rev 5147)
@@ -25,7 +25,7 @@
@var DataType array reg for seo class
*/
public $reg_anchors = array(
- 'featureds_id' => 'f'
+ 'featured' => 'f'
);
/**
@var DataType array reg check for control get params , please respect order $reg_anchors
@@ -130,7 +130,7 @@
public function is_type($mode='unique'){
- if( isset($_GET['featureds_id']) )
+ if( isset($_GET['featured']) )
switch(strtolower($mode)){
case 'preload_root':
@@ -215,27 +215,38 @@
/// get the categorie name and put it on the header
- if (isset($_GET['featureds_id'])) {
+ if (isset($_GET['featured'])) {
- $man=$DB->query("select * from " . TABLE_FEATURED . " f where f.row_id = '" . (int)$_GET['featureds_id'] . "' ");
- $manuf= $man->fetchAssoc();
- tep_db_free_result($man);
- $image = $manuf['featureds_image'];
- $page->breadcrumb->add($manuf['featureds_name'], tep_href_link(FILENAME_DEFAULT, 'featureds_id=' . $_GET['featureds_id']));
- $page->add_var_page('featureds',$manuf);
+ $page->add_var_page('RootListing',$obj);
+ $page->add_var_page('current_id',(int)$_GET['featured']);
+
+ $breadcrumb=$page->return_object('breadcrumb');
+
+ $featured = featured::get_item((int)$_GET['featured']);
+ if ( ! is_object($featured) )
+ return false;
+
+ $breadcrumb->add( __('@featured breadcrumb root'), $featured->href );
+ $breadcrumb->add( $featured->title , $featured->href );
+
// var use in draw master detail listing
$obj = new stdClass();
- $obj->image = $manuf['featureds_image'];
- $obj->name = $manuf['featureds_name'];
+ $obj->type = $this->DataType ;
+ $obj->image = $featured->image ;
+ $obj->name = $featured->title ;
+ $obj->href = $featured->title ;
$obj->description = false;
$page->add_var_page('RootListing',$obj);
- $page->add_var_page('current_id',(int)$_GET['featureds_id']);
+ $page->add_var_page('current_id',(int)$_GET['featured']);
+ $page->add_var_page('current_type',(string)'featured');
+
+
-
+ $listing->QueryAddWhere( " AND ".$this->listing_sql['col_count']." = '".$_GET['featured']."' ");
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2014-02-13 15:30:18
|
Revision: 5146
http://sourceforge.net/p/oscss/svn/5146
Author: oscim
Date: 2014-02-13 15:30:14 +0000 (Thu, 13 Feb 2014)
Log Message:
-----------
Add file featured for display and manipulate frontend
Add structure code for manage and display shipping sub module in all context
Fic
Modified Paths:
--------------
trunk/catalog/admin/password_forgotten.php
trunk/catalog/checkout_confirmation.php
trunk/catalog/checkout_process.php
trunk/catalog/checkout_shipping.php
trunk/catalog/common/classes/datatype_drivers/Data_featured.php
trunk/catalog/common/classes/shippingUtility.php
trunk/catalog/includes/classes/ModPublicOneShipping.php
trunk/catalog/includes/classes/shipping.php
trunk/catalog/includes/modules/order_total/ot_shipping.php
Added Paths:
-----------
trunk/catalog/includes/classes/drivers/DataListenerRowFeatured.php
trunk/catalog/includes/classes/drivers/ModTypeShippingListenerRow.php
trunk/catalog/includes/classes/drivers/data/featured.php
Modified: trunk/catalog/admin/password_forgotten.php
===================================================================
--- trunk/catalog/admin/password_forgotten.php 2014-02-13 11:12:35 UTC (rev 5145)
+++ trunk/catalog/admin/password_forgotten.php 2014-02-13 15:30:14 UTC (rev 5146)
@@ -1,12 +1,14 @@
<?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/05/2012, 17:28
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
+ @file password_forgotten.php
+ @dir admin/
*/
// Start the clock for the page parse time log
define('PAGE_PARSE_START_TIME', microtime());
@@ -32,17 +34,18 @@
// force config in object, by stdclass
$conf = (object)$conf;
-error_reporting(E_ALL);
- //! gestionnaire d'erreur
- if(OSCSS_GARBAGE_ERROR==true) {
- include(DIR_WS_CLASSES.'osC_ErrorHandler.php');
- $errorHandler = osC_ErrorHandler::start();
- $errorHandler->attach($mock=new MockWriter());
- $file=( (getenv('HTTPS') == 'on')? 'err-login-php-ssl' : 'err-login-php' );
- $errorHandler->attachFileWriter(DIR_FS_ROOT_DOCS.'admin/'.DIR_LOGS.$file.'.log');
- }
+
+ // garbage collector init
+ require_once(DIR_WS_CLASSES.'ErrorHandlerActive.php');
+ $errorHandler = ErrorHandlerActive::start();
+
+
+ // call Config Class And Init
+ require(DIR_FS_CATALOG.DIR_WS_COMMON_CLASSES . 'Config.php');
+ $Cfg = Config::getInstance((object)$conf, true);
+
require(DIR_WS_FUNCTIONS . 'general.php');
-error_reporting(E_ALL);
+
// set php_self in the local scope
$PHP_SELF = (isset($_SERVER['PHP_SELF']) ? $_SERVER['PHP_SELF'] : $_SERVER['SCRIPT_NAME']);
@@ -242,6 +245,6 @@
require(DIR_WS_TEMPLATE.basename(__FILE__));
- if(OSCSS_GARBAGE_ERROR==true)$errorHandler = osC_ErrorHandler::stop();
+ if(OSCSS_GARBAGE_ERROR==true)$errorHandler = ErrorHandler::stop();
?>
\ No newline at end of file
Modified: trunk/catalog/checkout_confirmation.php
===================================================================
--- trunk/catalog/checkout_confirmation.php 2014-02-13 11:12:35 UTC (rev 5145)
+++ trunk/catalog/checkout_confirmation.php 2014-02-13 15:30:14 UTC (rev 5146)
@@ -50,11 +50,17 @@
//! chargement payment
$payment_modules = payment::getInstance($payment);
+
//! chargement order
$order = new order;
$page->add_object('order',$order);
+
+
+ $Object_shipping= new shipping();
+ $shipping_module = $Object_shipping->GetSelected($shipping);
+// var_dump($shipping_modules);
//! mise a jour status payment
$tt=$payment_modules->update_status();
Modified: trunk/catalog/checkout_process.php
===================================================================
--- trunk/catalog/checkout_process.php 2014-02-13 11:12:35 UTC (rev 5145)
+++ trunk/catalog/checkout_process.php 2014-02-13 15:30:14 UTC (rev 5146)
@@ -44,12 +44,14 @@
// load selected payment module
$payment_modules = payment::getInstance($payment);
-
+
+ $order = new order;
+
// load the selected shipping module
$shipping_modules = shipping::getInstance();
- $order = new order;
+
/**
Before process module ACA
*/
Modified: trunk/catalog/checkout_shipping.php
===================================================================
--- trunk/catalog/checkout_shipping.php 2014-02-13 11:12:35 UTC (rev 5145)
+++ trunk/catalog/checkout_shipping.php 2014-02-13 15:30:14 UTC (rev 5146)
@@ -81,7 +81,8 @@
$shipping = $_POST['shipping'] ;
list($module, $method) = explode('_', $shipping);
- if ( (isset($$module)&& is_object($$module)) ) {
+
+ if ( $shipping_modules->ModExist($module) ) {
$quote = $shipping_modules->quote($method, $module);
if (isset($quote['error']))
@@ -89,7 +90,7 @@
else {
if ( (isset($quote[0]['methods'][0]['title'])) && (isset($quote[0]['methods'][0]['cost'])) ) {
$shipping = array('id' => $shipping,
- 'title' => (($free_shipping == true) ? $quote[0]['methods'][0]['title'] : $quote[0]['module'] . ' (' . $quote[0]['methods'][0]['title'] . ')'),
+ 'title' => $quote[0]['module'] . ' (' . $quote[0]['methods'][0]['title'] . ')',
'cost_ht' => $quote[0]['methods'][0]['cost_ht'],
'cost' => $quote[0]['methods'][0]['cost']);
tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
Modified: trunk/catalog/common/classes/datatype_drivers/Data_featured.php
===================================================================
--- trunk/catalog/common/classes/datatype_drivers/Data_featured.php 2014-02-13 11:12:35 UTC (rev 5145)
+++ trunk/catalog/common/classes/datatype_drivers/Data_featured.php 2014-02-13 15:30:14 UTC (rev 5146)
@@ -111,7 +111,7 @@
// for letto
$this->listing_sql['leftto']['rows'] = array(
- "".$this->p."data.datatype_parent_id as goutegout_id"=>0,
+ "".$this->p."data.datatype_parent_id as featured_id"=>0,
" GROUP_CONCAT(".$this->p."data.datatype_parent_id) as featured_ids "=>0,
);
Modified: trunk/catalog/common/classes/shippingUtility.php
===================================================================
--- trunk/catalog/common/classes/shippingUtility.php 2014-02-13 11:12:35 UTC (rev 5145)
+++ trunk/catalog/common/classes/shippingUtility.php 2014-02-13 15:30:14 UTC (rev 5146)
@@ -1,12 +1,17 @@
<?php if (!defined('HTTP_SERVER')) die('You can not access this file directly!');
/**
- @licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
+ @licence GPL 2005-2014 The osCSS developers - osCSS Open Source E-commerce
@portion code Copyright (c) 2002 osCommerce
@package osCSS-2 <www http://www.oscss.org>
- @version 2.1.0
+ @version 2.2.0
@date 06/02/11, 20:14
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
+ @file shippingUtility.php
+ @dir common/classes/
+*/
+
+/**
@class shippingUtility
*/
class shippingUtility {
@@ -17,19 +22,20 @@
if time is supp at 12h , add 1 days
@param $delai_date timestamp for number days of delai
@param $with_saterday boolean
+ @param $max_time int Hour for add one day is next
@return array(
delai (in day)
date_liv (date)
)
*/
- public static function getDelai($delai, $with_saterday = false) {
+ public static function getDelai($delai, $with_saterday = false, $max_time = 12) {
$totOuvrables = 0;
$time = time();
$heure = (int)date("H", $time);
// Départ de la livraison le jour même ou le lendemain selon l'heure (12h00)
- $date_depart = ($heure > 12) ? $time + 86400: $time;
+ $date_depart = ($heure > $max_time) ? $time + 86400: $time;
$date_depart = datetimeUtility::NextDayOpened($date_depart, $with_saterday, false, true);
$date_livraison = $date_depart + (int)$delai;
Modified: trunk/catalog/includes/classes/ModPublicOneShipping.php
===================================================================
--- trunk/catalog/includes/classes/ModPublicOneShipping.php 2014-02-13 11:12:35 UTC (rev 5145)
+++ trunk/catalog/includes/classes/ModPublicOneShipping.php 2014-02-13 15:30:14 UTC (rev 5146)
@@ -13,6 +13,9 @@
require_once(DIR_FS_CATALOG . DIR_WS_CLASSES .'ModPublicOne.php');
+require_once(DIR_FS_CATALOG . DIR_WS_CLASSES .'drivers/ModTypeShippingListenerRow.php');
+
+
/**
@interface IntModPublicOneShipping
@brief new interface module for next generation module
@@ -48,9 +51,9 @@
}
+// Class ShippingRowListeners
-
/**
@interface InterfaceAcaShipping
@brief Interface class support moduel ACA specifique order total
@@ -180,6 +183,19 @@
// return $this->GetPreOutput();
// }
+
+ function GetDescription($module='',$method='', $step=''){
+
+ $ref = 'module shipping '.$module.' text way';
+ if(!empty($method))
+ $ref = ' '.$method;
+
+ if(!empty($step))
+ $ref = ' '.$step;
+
+ return __( $ref.' detail');
+ }
+
/**
*/
public function update_status( Order $order , ShoppingCart $cart) {
Added: trunk/catalog/includes/classes/drivers/DataListenerRowFeatured.php
===================================================================
--- trunk/catalog/includes/classes/drivers/DataListenerRowFeatured.php (rev 0)
+++ trunk/catalog/includes/classes/drivers/DataListenerRowFeatured.php 2014-02-13 15:30:14 UTC (rev 5146)
@@ -0,0 +1,24 @@
+<?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 01/01/2012, 18:17
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+ @dir includes/classes/drivers/
+ @file DataListenerRowFeatured.php
+*/
+
+/**
+ @class DataListenerRowFeatured
+*/
+
+require_once(DIR_FS_CATALOG . DIR_WS_CLASSES . 'drivers/DataListenerRow.php');
+
+Class DataListenerRowFeatured
+ extends DataListenerRow{
+
+}
+
+?>
Added: trunk/catalog/includes/classes/drivers/ModTypeShippingListenerRow.php
===================================================================
--- trunk/catalog/includes/classes/drivers/ModTypeShippingListenerRow.php (rev 0)
+++ trunk/catalog/includes/classes/drivers/ModTypeShippingListenerRow.php 2014-02-13 15:30:14 UTC (rev 5146)
@@ -0,0 +1,105 @@
+<?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 01/01/2012, 18:17
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+ @dir includes/classes/drivers/
+ @file ModTypeShippingListenerRow.php
+*/
+
+
+
+/**
+ @Interface DataListenerRowInterface
+ @note used by drivers/data/xxx in frontoffice
+
+*/
+Interface ModTypeShippingListenerRowInterface{
+}
+
+
+
+/**
+ @class DataListenerRow
+*/
+Class ModTypeShippingListenerRow
+ implements
+ ModTypeShippingListenerRowInterface
+ {
+ /**
+ @var title string name title lg
+ */
+ protected $title = '';
+ /**
+ @var id string name of class
+ */
+ protected $id ='';
+ /**
+ @var icon string path icon
+ */
+ protected $icon = false;
+
+
+ public function __construct($id, $title){
+ $this->SetId($id);
+ $this->SetTitle($title);
+ }
+
+
+ /**
+ @fn GetIcon()
+ @brief Get Value
+ @return icon value
+ */
+ public function GetIcon(){
+ return $this->icon;
+ }
+
+ /**
+ @fn SetIcon()
+ @brief Get Value
+ @param $icon icon string path icon
+ */
+ public function SetIcon($icon){
+ $this->icon = $icon;
+ }
+ /**
+ @fn GetId()
+ @brief Get Value
+ @return id value
+ */
+ public function GetId(){
+ return $this->id;
+ }
+
+ /**
+ @fn SetId()
+ @brief Get Value
+ @param $id id string name of class
+ */
+ public function SetId($id){
+ $this->id = $id;
+ }
+ /**
+ @fn GetTitle()
+ @brief Get Value
+ @return title value
+ */
+ public function GetTitle(){
+ return $this->title;
+ }
+
+ /**
+ @fn SetTitle()
+ @brief Get Value
+ @param $title title string name title lg
+ */
+ public function SetTitle($title){
+ $this->title = $title;
+ }
+}
+
+?>
Added: trunk/catalog/includes/classes/drivers/data/featured.php
===================================================================
--- trunk/catalog/includes/classes/drivers/data/featured.php (rev 0)
+++ trunk/catalog/includes/classes/drivers/data/featured.php 2014-02-13 15:30:14 UTC (rev 5146)
@@ -0,0 +1,722 @@
+<?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.1.1
+ @date 16/01/2014 ,17:08:29
+ @author genrated by GenerCode
+ @encode UTF-8
+ @file driver.featured.php
+*/
+
+
+
+require_once(DIR_FS_CATALOG . DIR_WS_CLASSES . 'drivers/DataListenerRow.php');
+require_once(DIR_FS_CATALOG . DIR_WS_CLASSES . 'drivers/DataListenerRowFeatured.php');
+
+/**
+ @class featured
+ Control init et gestion des data featured
+*/
+class featured {
+
+ //! @p object
+ protected static $_instance;
+
+ public static $modules = array();
+
+ /**
+ */
+ protected function __construct($full=false) {
+ global $languages_id;
+
+ DataTypes::CompletRequest('leftto', 'featured');
+
+ if($full) self::start_module();
+ }
+
+ protected function start_module(){
+ $pdm=featuredModule::getInstance();
+ self::$modules=$pdm->ret_modules();
+ return $pdm;
+ }
+
+ public static function getInstance($full=false) {
+ if(self::$_instance == null) self::$_instance = new self($full);
+ return self::$_instance;
+ }
+
+ public static function resetInstance(){
+ self::$_instance = null;
+ return self::getInstance();
+ }
+
+
+
+
+ /**
+ Data function
+ */
+
+ /**
+ * \fn get_query($id='',$search='',$exclude='',$option='')
+ * \brief generation automatique de requetes pour exraire les données .
+ * Cet appel est mis en cache afin d'optimiser les requetes, de maniére incremental pour chaque item, et par item.
+ * @param $id integer id
+ * @param $search string champs qui sera recherché dans tous les champs de la db
+ * @param $exclude tableau d'ecxlusion de item par id
+ * @param $option array option passé par couple key/values
+ * @return object
+ */
+ public static function get_query($id='',$search='',$exclude='',$option=array()){ global $languages_id; new self(); return featuredData::get_query($id,$search,$exclude,$option); }
+ /**
+ * \fn get_item($id)
+ * \brief appel d'un produit par son id, il sera recupere dans la pile du cache, ou via une requet sql
+ * @param $id
+ * @return object
+ */
+ public static function get_item($id,$option=array()){ /*new self();*/ return featuredData::get_item($id,$option); }
+ //REMOVEDEB_LINKTOCATEGORIE
+ public static function get_featured_cat($id){ new self(); return featuredData::get_featured_cat($id); }
+ public static function get_featured_path($id){ new self(); return featuredData::get_featured_path($id); }
+ public static function get_featured_in_cat($current_category_id=0, $exclude=''){ new self(); return featuredData::get_featured_in_cat($current_category_id=0, $exclude=''); }
+ //REMOVEEND_LINKTOCATEGORIE
+
+ public static function get_byDate($max, $exclude){ new self(); return featuredData::get_byDate($max, $exclude); }
+
+ public static function get_img($id, $img_num=0){ new self(); return featuredData::get_img($id, $img_num); }
+ /**
+ * \fn get_extra_featured($featureds_id, $key='')
+ */
+ public static function get_extra_featured($_id, $key='') { new self(); return featuredData::GetExtraFields($_id, $key); }
+
+ //REMOVEDEB_LINKTOCATEGORIE
+ /**
+ * \fn get_count_featureds_in_category($category_id, $include_inactive = false)
+ */
+ public static function get_count_in_category($category_id, $include_inactive = false) { new self(); return featuredData::count_in_category($category_id, $include_inactive); }
+ //REMOVEEND_LINKTOCATEGORIE
+}
+
+
+/**
+ @class featuredData
+ Traitement sql des featured
+*/
+class featuredData
+ extends DataStatmentFO
+ implements Interfacedata{
+
+ /**
+ @var $cache array cache result
+ */
+ public static $cache=array();
+ /**
+ @var array
+ */
+ public static $opt=array();
+ /**
+ @var array cache
+ */
+ public static $array_data=array();
+ /**
+ @var string
+ */
+ private static $where_query='';
+ /**
+ @var object
+ */
+ protected static $_instance;
+ /**
+ @var array cache
+ */
+ public static $object_data;
+
+ /**
+ */
+ protected function __construct() {
+ global $languages_id;
+ }
+
+
+ /**
+ @brief Prepa donnée sortie
+ */
+ protected static function statment_query($featured_query,$exclude='',$search=''){
+
+ $display_lang=self::$obj_language->fetchAssoc();
+ if (empty($exclude))$exclude=array();
+ $tabl=$res=array();
+
+ if(!$featured_query)
+ return false;
+
+ $listlinkto = DataTypes::GetLeftRoot('featured');
+
+
+ while ($featured = $featured_query->fetchAssoc()) {
+ if (!in_array($featured['name'],$exclude)) {
+ $res=$featured;
+
+ $DataRow = new DataListenerRowFeatured(
+ $featured['id'],
+ $featured['type'],
+ tep_href_link( FILENAME_DEFAULT,'featured=' . $featured['id'] ),
+ $featured['id'],
+ $featured['featured_title'],
+ $featured['featured_title']
+ );
+
+// $res=explode('|', $featured['images']);
+// if(is_array($res)) {
+// $DataRow->SetImages($res);
+// $DataRow->SetImage($res[0]);
+// }
+ $DataRow->SetExtra( self::GetExtraFields($featured['id']) );
+
+ $DataRow->SetText($featured['text']);
+
+// $res['href']=tep_href_link(FILENAME_FEATURED,'featured=' . $featured['id']);
+// $res['title']=$featured['featured_title'];
+// $res['name']=$featured['featured_title'];
+// $res['original']=$featured['featured_description'];
+//
+// $res['images']=explode('|', $featured['images']);
+// $res['image']= @$res['images'][0];
+//
+ foreach($listlinkto as $row){
+
+ $namerow = $row.'_id';
+ // retro compatibilité
+ if(!isset($featured[$namerow]))
+ $namerow = $row.'s_id';
+
+ if(isset($featured[$namerow]))
+ $DataRow->SetLinkTo($row, $featured[$namerow] );
+
+ if(preg_match('#([0-9]*,)*#', $featured[ $row.'_ids'])){
+
+ $li = explode(',',$featured[ $row.'_ids']);
+ foreach($li as $id){
+ $DataRow->SetLinkTo($row, $id);
+ }
+ }
+ }
+
+ self::$object_data[$featured['id']]=$tabl[$featured['id']]=$DataRow ; //new objectInfo($res);
+// self::$array_data[$featured['id']]->text=self::parse_featured($res['text'],$featured['id']);
+ self::add_cache($featured['id']);
+ }
+ }
+
+// if((count(self::$object_data)>0))
+// foreach(self::$object_data as $k=>$featured)
+// if (!in_array($featured->name,$exclude)) {
+// if((!empty($search) && strstr($featured->name,$search) !=false) || empty($search)) $tabl[$featured->id]=$featured;
+// }
+// print_r(self::$object_data);
+// exit;
+ return $tabl;
+ }
+
+ /**
+ @brief Ajout constrainte clause where
+ */
+ protected static function add_where_query($add){ self::$where_query .=' '.$add; }
+
+ /**
+ */
+ protected static function reset_query() { self::$where_query=''; }
+
+ /**
+ @brief Requeteur
+ */
+ protected static function cstr_query($orderby='', $limit='', $option=''){
+
+ global $languages_id;
+
+ $listing = DataTypes::GetListing('leftto', 'featured');
+
+ $query = 'SELECT DISTINCT '.
+ ' f.row_id AS id'.
+ ' ,fd.featured_title'.
+// ' ,f.featured_type AS type'.
+ ' ,fd.featured_title AS name'.
+// ' ,fd.featured_description AS text'.
+ ' ,f.date_added as date_added'.
+// ' ,f.featured_image AS images'.
+ " FROM " . TABLE_FEATURED . " f ".
+ " LEFT JOIN " . TABLE_FEATURED_DESCRIPTION . " fd ON( fd.featured_id = f.row_id AND fd.languages_id = '".$languages_id."' ) ".
+ 'WHERE 1 ';
+ $query .=self::$where_query;
+
+ $query .=' ORDER BY ' .(!tep_not_null($orderby)? ' fd.featured_title ASC ' : $orderby) ;
+ $query .=' LIMIT '.(!tep_not_null($limit)? '1' : $limit) ;
+
+ return $query;
+ }
+
+ /**
+ @brief Extract img et complete cache avec img extraites
+ */
+ private static function extract_img($id,$featured,$pattern){
+ preg_match_all($pattern, $featured, $images);
+ //! mise en cache
+ self::$object_data[$id]->images=$images ;
+ }
+
+ /**
+ @brief Parse featured texte
+ Fucntion qui permet de prendre en charge des element contenu dans la description du cms.
+ */
+ private static function parse_featured($featured,$id){
+
+ $pattern ="#<img (.+)[^>]/>#i";
+ self::extract_img($id,$featured,$pattern);
+
+ $sortie=(isset(self::$opt['img']) && !_test_bool(self::$opt['img']))? preg_replace($pattern, '', $featured) : $featured;
+ if(isset(self::$opt['more']) && _test_bool(self::$opt['more'])){
+ if(strpos($sortie,'<!-- pagebreak -->') > 0)
+ $sortie = substr($sortie, 0, strpos($sortie,'<!-- pagebreak -->'));
+ }
+ /// process replace in text the var config in constante
+ $pattern = "/%_.*_%/i";
+ preg_match_all($pattern, $sortie, $replace,PREG_OFFSET_CAPTURE);
+ foreach($replace as $item){
+ if(isset($item[0][0])){
+ $i= (string)$item[0][0];
+ if($i =='') break;
+ $re = substr( $i, 2 , strlen($i)-4) ;
+ if($re !='' && tep_cst_define($re) !=false){
+ $sortie = preg_replace("/%_".$re."_%/",tep_cst_define($re) , $sortie );
+ }
+ }
+ }
+
+ return $sortie;
+ }
+
+
+
+
+ public static function getInstance() {
+ if(self::$_instance == null) self::$_instance = new self();
+ return self::$_instance;
+ }
+
+ public static function resetInstance(){
+ self::$_instance = null;
+ return self::getInstance();
+ }
+
+ //REMOVEDEB_LINKTOCATEGORIE
+ /**
+ @brief Function recuperation des page associé a une cat
+ @param $current_category_id int l'id de la categorie courante ou null
+ @param $exclude array tableau d'exclusion
+ */
+ public static function get_featured_in_cat($current_category_id=0, $exclude='',$option=''){
+ global $languages_id;
+// self::start($option);
+ self::reset_query();
+ $DB=Database::getInstance();
+ self::$lg_id=(int)$languages_id;
+ self::add_where_query(" AND cat2c.categories_id = '" . (int)$current_category_id . "' ");
+ $featured_query = $DB->query($sql=self::cstr_query('',25) );
+
+ return self::statment_query($featured_query,$exclude);
+ }
+ //REMOVEEND_LINKTOCATEGORIE
+
+ /**
+ @brief Appel item
+ @param $id string featured_name le nom du titre
+ @param $search string critere for search
+ @param $exclude array tableau d'exclusion
+ @param $option array tableau d'option
+ */
+ public static function get_query($id='',$search='',$exclude='',$option=array()){
+ global $languages_id;
+
+ self::start($option);
+
+ self::reset_query();
+ $DB=Database::getInstance();
+ self::$lg_id=(int)$languages_id;
+ $search=tep_db_prepare_input($search);
+
+ if (count(self::$cache)>0) self::add_where_query(' AND f.row_id NOT IN ('.self::in_cache().') ');
+ //! soit id soit sherach name key
+ self::add_where_query((tep_not_null($id) && is_numeric($id) ? " AND f.row_id = '" . $id . "' ": (!empty($search)?" AND fd.featured_title LIKE '%" . tep_db_input($search) . "%' ":'') ));
+
+ $sql=self::cstr_query((string)@$option['orderby'],@$option['limit'],(array)@$option);
+
+
+ $featured_query = $DB->query($sql );
+
+ return self::statment_query($featured_query,$exclude,$search);
+ }
+
+ /**
+ Alias unique ID
+ */
+ public static function get_item($id,$option=array()){
+
+ if(isset(self::$object_data[(int)$id]) && is_object(self::$object_data[(int)$id]) ){
+ return self::$object_data[(int)$id];
+ }elseif( preg_match('#\d#',$id) && (int)$id > 0 ) {
+ if( ($result=self::get_query($id) ) && $result != false )
+ return $result[$id] ;
+ }elseif( strlen($id) > 0 && is_string($id) ) {
+ $db_list=self::get_query('',$id);
+ foreach($db_list as $item)
+ if((string)$id==(string)$item->name)return $item;
+ }
+
+ return false;
+ }
+
+ //REMOVEDEB_LINKTOCATEGORIE
+ /**
+ Function recuperation de la cat d'un featured_id
+
+ @author oscim <mail a...@os... /><web http://www.oscim.fr /> - OscssTeam
+ @param
+ @a int l'id de la cat
+ */
+ public static function get_featured_cat($featured_id){
+// $DB=Database::getInstance();
+// $cur = $DB->query("SELECT categories_id from " . TABLE_FEATURED_TO_CATEGORIES . " WHERE featured_id='" . (int)$featured_id . "'");
+// if($cur->__get('numRows')) {
+// $display = $cur->fetchAssoc();
+// //! mise en cache
+// self::$object_data[$featured_id]->parent_id=$display['categories_id'];
+// return $display['categories_id'];
+// }
+// else return false;
+ }
+
+ /**
+ Construct a category path to the featured
+ @author oscim <mail a...@os... /><web http://www.oscim.fr /> - OscssTeam
+ @param
+ @a int l'id de la ressource
+ */
+ public static function get_featured_path($featured_id) {
+ $cPath = '';
+
+// $category_query = tep_db_query("select p2c.categories_id from " . TABLE_FEATURED . " p, " . TABLE_FEATURED_TO_CATEGORIES . " p2c where p.featured_id = '" . (int)$featured_id . "' and p.featured_status = '1' and p.featured_id = p2c.featured_id limit 1");
+// if (tep_db_num_rows($category_query)) {
+// $category = tep_db_fetch_array($category_query);
+//
+// $categories = tep_get_parent_categories(array(), $category['categories_id']);
+// $categories = array_reverse($categories);
+// $cPath = implode('_', $categories);
+//
+// if (tep_not_null($cPath)) $cPath .= '_';
+// $cPath .= $category['categories_id'];
+// }
+
+ return $featured_id;
+ }
+ //REMOVEEND_LINKTOCATEGORIE
+
+ /**
+ Recupere la liste des article cms triée par date
+
+ @note Article Type News, not in Page_xxx
+ @author oscim - <mail aur...@os...> <www http://www.oscim.fr>
+ @param
+ @a int max le nombre d'item dans le tableau
+ @a array tableau d'exclusion des id
+ @return array
+ */
+ public static function get_byDate($max=10, $exclude='') {
+ global $languages_id;
+
+ self::start();
+ self::reset_query();
+ $DB=Database::getInstance();
+ self::$lg_id=(int)$languages_id;
+ self::add_where_query(" AND fd.featured_title NOT LIKE 'Page_%' ");
+ $sql=self::cstr_query(" f.date_added DESC ", $max);
+ $featured_query = $DB->query($sql);
+
+ return self::statment_query($featured_query,$exclude);
+ }
+
+ /**
+ Return balise img
+ */
+ public static function get_img($id, $img_num=0){
+ if(is_array( self::$object_data[$id]->images[$img_num])&& isset( self::$object_data[$id]->images[$img_num][0]) )
+ return (string)self::$object_data[$id]->images[$img_num][0];
+ }
+
+ //REMOVEDEB_LINKTOCATEGORIE
+ /**
+ @fn count_in_category($category_id, $include_inactive = false)
+ @brief count data in categorie
+ */
+ public static function count_in_category($category_id, $include_inactive = false) {
+// $featureds_count = 0;
+// $DB=Database::getInstance();
+//
+//
+// $sql =" SELECT COUNT(p.featured_id) as TOTAL ".
+// " FROM " . TABLE_FEATURED . " p , " . TABLE_FEATURED_TO_CATEGORIES . " p2c ".
+// " LEFT JOIN ".TABLE_CATEGORIES." cat ON(cat.categories_id=p2c.categories_id AND categories_status > 0) ".
+// " WHERE p.featured_id = p2c.featured_id and ( cat.categories_id = '" . (int)$category_id . "' OR cat.parent_id= '" . (int)$category_id . "' OR cat.categories_cpath LIKE '%" . (int)$category_id . "%' ) ";
+// if (!$include_inactive)
+// $sql .=" AND p.featured_status = '1' ";
+//
+// $_query = $DB->query($sql);
+//
+//
+// if($_query->__get('numRows') >0 ) $result = $_query->fetchAssoc();
+// else $result['TOTAL']= 0;
+//
+// $featureds_count += $result['TOTAL'];
+
+ return 1;
+ }
+ //REMOVEEND_LINKTOCATEGORIE
+
+ /**
+ @brief Champs extra featured Recupere la totalite des element supplementaire generic.
+ Les chamsp appartenant à des modules ne sont pas chargée
+ [extra] => Array
+ (
+ [key or id ] => objectInfo Object
+ (
+ [label] => le montant d'une part
+ [value] => 5
+ [epf_key] => MONTANT_PART
+ [epf_id] => id epf
+ )
+ )
+ */
+ public static function GetExtraFields($_id, $key=''){
+ $array= array();
+
+ if(isset(self::$object_data[(int)$_id]) && isset(self::$object_data[(int)$_id]->extra) && empty($key) )$array= self::$object_data[(int)$_id]->extra;
+ else {
+ $DB=Database::getInstance();
+ $array=array();
+ $sql = "SELECT
+ e.fields_id as id,
+ e.fields_input_type as input_type,
+ e.fields_key as fkey,
+ fields_advanced_search,
+ e.fields_active_value_language as value_language,
+ l.fields_name as label,
+ l.fields_format as input_format,
+ p2epf.value as value
+ FROM " . TABLE_EXTRA_FIELDS_TO . " p2epf ,
+ " . TABLE_EXTRA_FIELDS . " e
+ JOIN " . TABLE_EXTRA_FIELDS_LABELS . " l ON e.fields_id = l.fields_id
+ WHERE
+ p2epf.fields_id=e.fields_id
+ AND data_type='featured'
+ AND data_id = '" . (int)$_id . "'
+ AND ( l.languages_id='".self::$lg_id."' OR l.languages_id= 0)
+ AND fields_special_mod='".$key."'
+ ORDER BY fields_sort ASC " ;
+ $epf_query = $DB->query($sql);
+
+ while( $e = $epf_query->fetchAssoc() ) {
+
+
+ $val = $DB->query( $sql ="SELECT p2epf.value as value FROM " . TABLE_EXTRA_FIELDS_TO . " p2epf WHERE p2epf.fields_id=".$e['id']." AND data_type='featured' AND data_id = '" . (int)$_id . "' AND languages_id='". (($e['value_language']==1 && !in_array( (int)$e['input_type'] , array(4,2)) )? self::$lg_id : 0)."' ");
+ $result = $val->fetchAssoc();
+
+ switch((int)$e['input_type'] ) {
+ case 2: // radio
+ case 4: // select
+ case 6: // select mutli
+ case 7: // checkbox mutli
+ case 3: // checkbox
+ $val = self::GetEFValue($e['id'] ,$result['value'] , (($e['value_language']==1)? self::$lg_id : 0) );
+ break;
+ case 0: // classic
+ case 1: // textarea
+ case 5: // hidden
+ default:
+ $val = $result['value'];
+ }
+
+ $array[ (!empty($e['epf_key'])?$e['fkey'] :$e['id']) ]=new objectInfo( array(
+ 'label'=>(string)$e['label'],
+ 'name'=>(string)$e['label'], // obsolete
+ 'value' => $val, // obsolete
+ 'input_value' => $val,
+ 'epf_key'=>(string)$e['fkey'],
+ 'epf_id'=>(int)$e['id'], // obsolete
+ 'id'=>(int)$e['id'],
+// 'epf_show_in_listing'=>(int)$e['epf_show_in_listing'],
+ 'input_type'=>(int)$e['input_type'],
+ 'input_format'=>$e['input_format'],
+ 'required_status'=>0,
+ // 'epf_advanced_search'=>(int)$e['epf_advanced_search']
+ ) );
+
+
+ }
+
+ if(!isset(self::$object_data[(int)$_id]))self::$object_data[(int)$_id]=new objectInfo(array());
+ self::$object_data[(int)$_id]->extra = $array;
+ }
+
+ return $array;
+ }
+
+ /**
+ @fn GetEFValue($epfid,$values, $languages_id, $separator = ', ')
+ @brief get in db for extract all value for EF stocked in id value and not string
+ @param $epfid int
+ @param $values string (id, id,...)
+ @param $languages_id int or 0 for value not multi language
+ @param $separator seperator result
+ */
+ public static function GetEFValue($epfid,$values, $languages_id, $separator = ', '){
+ $DB=Database::getInstance();
+ $val = '';
+ $s='';
+
+ $a = explode(',',$values);
+ foreach($a as $r)
+ if(!empty($r))$val .=(int)$r.",";
+
+ if(strlen($val) <= 0)
+ return '';
+
+ $val = $DB->query( $sql ="SELECT fields_value as value FROM " . TABLE_EXTRA_FIELDS_VALUES . " p2epf WHERE value_id IN (".substr($val, 0, -1).") AND fields_id = '" . (int)$epfid . "' AND languages_id='".(int) $languages_id."' ORDER BY sort_order ");
+ $result = $val->fetchAllAssoc();
+
+ foreach($result as $r)
+ $s .=$r['value'] .$separator;
+
+ return substr($s, 0, -1);
+ }
+
+}
+
+
+
+/**
+ @class AbstractProduct
+ @brief Force mise en forme via class absctarction des modules de produits
+*/
+abstract class AbstractFeatured {
+ // Force la classe étendue à définir cette méthode
+ abstract protected function display_view($pID,$class='');
+ abstract protected function load_db_values($pID);
+ abstract protected function get_header($action='');
+ // méthode commune
+// public function printOut() { }
+}
+
+
+
+/**
+ @class featuredModule
+ @brief Traitement des modules associé
+*/
+class featuredModule
+ extends AbstractAcaModule
+ implements InterfaceAcaGene {
+
+ /**
+ @var string Les modules actif
+ */
+ public $modules;
+
+ protected static $_instance;
+
+ /**
+ */
+ protected function __construct() {
+ global $language, $page;
+ $this->name=__CLASS__;
+ $this->modules=array();
+ $list_mod=array();
+ foreach(parent::initialise_type('MODULE_FEATURED_INSTALLED','featured') as $class){
+ $cl[$class]=new $class ();
+ $list_mod[$class] = $cl[$class]->sort_order;
+ }
+ asort($list_mod);
+ foreach($list_mod as $class=>$s){
+ $this->modules[$class] =$cl[$class];
+ }
+ unset($cl);unset($list_mod);
+ return $this->modules;
+ }
+
+
+ public static function getInstance() {
+ if(self::$_instance == null) self::$_instance = new self();
+ return self::$_instance;
+ }
+
+ public static function resetInstance(){
+ self::$_instance = null;
+ return self::getInstance();
+ }
+
+ /**
+ * \fn display_view($pID,$class='',$exclude=array() )
+ @brief Affiche module elemennt html
+ Block principal d'affichage, liste ou vue des élément. Block principal de page
+ @param $pID int le Id du produits
+ @param $class string le nom de la class appelé, ou vide pour toutes les class enfants
+ @param $exclude array
+ */
+ public function display_view($pID,$class='',$exclude=array() ){
+ global $page;
+ if (!empty($class)) {
+ if (isset($this->modules[$class]) && $this->modules[$class]->enabled and (method_exists($class, 'display_view' ))){
+ $this->modules[$class]->load_db_values($pID);
+ return $this->modules[$class]->display_view($pID);
+ }
+ } else {
+ $c=array();
+ if(isset($this->modules) && is_array($this->modules))
+ foreach ($this->modules as $key=>$module) {
+ if ( !in_array($key,$exclude) && ($module->enabled) and (method_exists($module, 'display_view' ))) {
+ $this->modules[$key]->load_db_values($pID);
+ $c[$key]=$this->modules[$key]->display_view($pID);
+ }
+ }
+ return $c;
+ }
+ }
+
+ /**
+ Affiche module display_view mini
+
+ @param
+ @a int cID le Id du customers
+ @a string class le nom de la class appelé, ou vide pour toutes les class enfants
+ */
+ public function display_view_min($cID,$class=''){
+ global $page;
+ if (!empty($class)) {
+ if (isset($this->modules[$class]) && $this->modules[$class]->enabled and (method_exists($module, 'display_view_min' ))){
+ $this->modules[$class]->load_db_values($cID);
+ return $this->modules[$class]->display_view_min($cID);
+ }
+ } else {
+ $c='';
+ foreach ($this->modules as $key=>$module) {
+ if (($module->enabled) and (method_exists($module, 'display_view_min' ))) {
+ $this->modules[$key]->load_db_values($cID);
+ $c .=$this->modules[$key]->display_view_min($cID);
+ }
+ }
+ return $c;
+ }
+ }
+}
+
+?>
\ No newline at end of file
Modified: trunk/catalog/includes/classes/shipping.php
===================================================================
--- trunk/catalog/includes/classes/shipping.php 2014-02-13 11:12:35 UTC (rev 5145)
+++ trunk/catalog/includes/classes/shipping.php 2014-02-13 15:30:14 UTC (rev 5146)
@@ -12,6 +12,8 @@
*/
+
+
require_once(DIR_FS_CATALOG . DIR_WS_COMMON_CLASSES . 'shippingUtility.php');
/**
@class shipping
@@ -100,9 +102,52 @@
}
}
-
+ /**
+ */
+ public function ModExist($module=''){
+ if(isset($this->modules[$module]))
+ return true;
+
+ return false;
+ }
/**
+ */
+ public function GetModule($module=''){
+ if(isset($this->modules[$module]))
+ return $this->modules[$module];
+
+ return false;
+ }
+
+ /**
+ */
+ public function GetSelected($shipping=array()){
+
+ if(is_array($shipping))
+ $module_method = $shipping['id'];
+
+ list($module, $method) = explode('_', $module_method);
+
+ if(isset($this->modules[$module])){
+ $sub = $this->modules[$module];
+
+ if (($quotes = $this->quote($method, $module)) !=false ) {
+
+ foreach($quotes[0]['methods'] as $row ){
+
+ if ($row['id'] == $method ) {
+ $row['module'] = $module;
+ return $row;
+ }
+ }
+ }
+
+ }
+
+ return false;
+ }
+ /**
@fn quote($method = '', $module = '')
@param $method
@param $module
@@ -139,7 +184,7 @@
$this->update_status($order, $cart);
if (tep_not_null($module)) {
- if ( ($module == $class) && ($module->GetEnabled()) )
+ if ( ($module == $class) && ($submod->GetEnabled()) )
$include_quotes[] = $submod;
}
elseif ($submod->GetEnabled())
@@ -149,8 +194,10 @@
$size = sizeof($include_quotes);
foreach($include_quotes as $key=>$submod) {
$quotes = $submod->quote($method);
- if (is_array($quotes))
+ if (is_array($quotes)){
+ $quotes['title'] = $quotes['module'] . ' [' .$quotes['methods'][$i]['id'] . ']' ;
$quotes_array[] = $quotes;
+ }
}
}
return $quotes_array;
@@ -169,11 +216,9 @@
if (($quotes = $module->quotes) !=false ) {
for ($i=0, $n=sizeof($quotes['methods']); $i<$n; $i++) {
if (isset($quotes['methods'][$i]['cost']) ) {
+
$rates[] =array_merge($quotes['methods'][$i], array(
'id' => $quotes['id'] . '_' . $quotes['methods'][$i]['id'],
- 'title' => $quotes['module'] . (!empty($quotes['methods'][$i]['title']) ? ' (' .$quotes['methods'][$i]['title'] . ')' : '' ),
-// 'cost_ht' => @$quotes['methods'][$i]['cost_ht'],
-// 'cost' => $quotes['methods'][$i]['cost']
)
);
}
Modified: trunk/catalog/includes/modules/order_total/ot_shipping.php
===================================================================
--- trunk/catalog/includes/modules/order_total/ot_shipping.php 2014-02-13 11:12:35 UTC (rev 5145)
+++ trunk/catalog/includes/modules/order_total/ot_shipping.php 2014-02-13 15:30:14 UTC (rev 5146)
@@ -62,38 +62,13 @@
$shipping_cost_ht=0;
- if (_cst_bool('MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING')) {
- switch (MODULE_ORDER_TOTAL_SHIPPING_DESTINATION) {
- case 'national':
- if ($order->delivery['country_id'] == STORE_COUNTRY) $pass = true; break;
- case 'international':
- if ($order->delivery['country_id'] != STORE_COUNTRY) $pass = true; break;
- case 'both':
- $pass = true; break;
- default:
- $pass = false; break;
- }
+ $module = substr($order->mod['class_shipping'], 0, strpos($order->mod['class_shipping'], '_'));
- if ( ($pass == true) && ( ($order->info['total'] - $order->info['shipping_cost']) >= MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER) ) {
- $order->info['shipping_method'] = FREE_SHIPPING_TITLE;
- $order->info['total'] -= $order->info['shipping_cost'];
- $order->info['shipping_cost'] = $order->info['shipping_cost_ht'] = 0;
- }
- }
+ if (tep_not_null($order->info['shipping_method'])) {
+ $shipping_tax = tep_get_tax_rate($order->info['shipping_tax'], $order->delivery['country']['id'], $order->delivery['zone_id']);
+ $shipping_tax_description = tep_get_tax_description($order->info['shipping_tax'], $order->delivery['country']['id'], $order->delivery['zone_id']);
- $module = substr($GLOBALS['shipping']['id'], 0, strpos($GLOBALS['shipping']['id'], '_'));
-
- if (tep_not_null($order->info['shipping_method'])) {
- if ( !_cst_bool('MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING')){
- $shipping_tax = tep_get_tax_rate($GLOBALS[$module]->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
- $shipping_tax_description = tep_get_tax_description($GLOBALS[$module]->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
- }
- else {
- $shipping_tax=0;
- $shipping_tax_description='';
- }
-
$order->info['tax'] += ($order->info['shipping_cost']-$order->info['shipping_cost_ht']);
@$order->info['tax_groups']["$shipping_tax_description"] += ($order->info['shipping_cost']-$order->info['shipping_cost_ht']);
$order->info['total'] += $order->info['shipping_cost'];
@@ -102,12 +77,13 @@
$order->info['subtotal_ht'] += $order->info['shipping_cost_ht'];
- $this->output[] = $b=array('title' => $order->info['shipping_method'] . ':',
- 'text_ht' => $currencies->format($shipping_cost_ht, true, $order->info['currency'], $order->info['currency_value']),
- 'text' => $currencies->format($order->info['shipping_cost'], true, $order->info['currency'], $order->info['currency_value']),
- 'value_ht' => $order->info['shipping_cost_ht'],
- 'value' => $order->info['shipping_cost'],
- );
+ $this->output[] = $b=array(
+ 'title' => $order->info['shipping_method'] . ':',
+ 'text_ht' => $currencies->format($shipping_cost_ht, true, $order->info['currency'], $order->info['currency_value']),
+ 'text' => $currencies->format($order->info['shipping_cost'], true, $order->info['currency'], $order->info['currency_value']),
+ 'value_ht' => $order->info['shipping_cost_ht'],
+ 'value' => $order->info['shipping_cost'],
+ );
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2014-02-13 11:12:41
|
Revision: 5145
http://sourceforge.net/p/oscss/svn/5145
Author: oscim
Date: 2014-02-13 11:12:35 +0000 (Thu, 13 Feb 2014)
Log Message:
-----------
Fix
Add interface for GetTotal in order and cart, Use interface in shipping class for calculate
Clean code
Modified Paths:
--------------
trunk/catalog/common/class.interfaces.php
trunk/catalog/common/classes/order.php
trunk/catalog/common/classes/shoppingCart.php
trunk/catalog/includes/classes/ModPublicOneShipping.php
trunk/catalog/includes/classes/shipping.php
trunk/catalog/includes/languages/fr_FR/modules/shipping/flat.txt
trunk/catalog/includes/languages/fr_FR/modules/shipping/item.txt
trunk/catalog/includes/languages/fr_FR/modules/shipping/mzmt.txt
trunk/catalog/includes/languages/fr_FR/modules/shipping/spu.txt
trunk/catalog/includes/modules/shipping/flat.php
trunk/catalog/includes/modules/shipping/item.php
trunk/catalog/includes/modules/shipping/mzmt.php
trunk/catalog/includes/modules/shipping/spu.php
Modified: trunk/catalog/common/class.interfaces.php
===================================================================
--- trunk/catalog/common/class.interfaces.php 2014-02-13 08:19:21 UTC (rev 5144)
+++ trunk/catalog/common/class.interfaces.php 2014-02-13 11:12:35 UTC (rev 5145)
@@ -109,7 +109,7 @@
/**
@interface InterfaceAcaProcess
- @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+
Interface class support moduel ACA specifique general
*/
Interface InterfaceAcaGene {
@@ -119,7 +119,7 @@
/**
@interface InterfaceAcaProcess
- @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+
Interface class support moduel ACA specifique general
*/
Interface InterfaceAcaProcess {
@@ -129,7 +129,7 @@
/**
@interface InterfaceAcaPayment
- @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+
Interface class support moduel ACA specifique general
*/
Interface InterfaceAcaPayment {
@@ -156,10 +156,22 @@
// public function quote($method = '');
// public function update_status($order);
}
+/**
+ @interface IntShippingDepend
+ @brief link other ressource for compatibility shipping calculate
+*/
+Interface IntShippingDepend {
+ /**
+ @fn GetTotal();
+ @brief GetTotal()
+ @return Total price
+ */
+ public function GetTotal($type='price');
+}
/**
@interface InterfaceAccount
- @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+
@brief Interface class support module aca account, complement classic interface
@note use in Frontend
*/
@@ -169,7 +181,7 @@
/**
@interface InterfaceAcaPayment
- @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+
Interface class support des class data charger traitement et recup des elements type
cf cms, products, categories
*/
Modified: trunk/catalog/common/classes/order.php
===================================================================
--- trunk/catalog/common/classes/order.php 2014-02-13 08:19:21 UTC (rev 5144)
+++ trunk/catalog/common/classes/order.php 2014-02-13 11:12:35 UTC (rev 5145)
@@ -60,7 +60,14 @@
class order
- Implements CstrOrder{
+ Implements
+
+ //
+ CstrOrder
+
+ // Link construct for shipping and calculate methode
+ , IntShippingDepend
+ {
/**
@var General info for current orders
*/
@@ -474,7 +481,8 @@
foreach($products as $prdct){
- $this->products[$index] = array('qty' => $prdct['quantity'],
+ $this->products[$index] = array(
+ 'qty' => $prdct['quantity'],
'name' => $prdct['name'],
'model' => $prdct['model'],
'type' => $prdct['type'],
@@ -553,9 +561,31 @@
+ /**
+ @fn GetTotal();
+ @brief GetTotal()
+ @return Total price
+ */
+ public function GetTotal($type='price'){
+
+ $value_check = 0;
+ switch($type){
+ case 'item';
+ foreach( $this->products as $row)
+ $value_check += $row['qty'];
+ break;
+ case 'weight';
+ $value_check = $this->info['total_weight'];
+ break;
+ case 'price';
+ default:
+ $value_check = $this->info['total'];
+ }
+
+ return $value_check;
+ }
-
/**
@brief Adjust sous tot for calculate total order
*/
Modified: trunk/catalog/common/classes/shoppingCart.php
===================================================================
--- trunk/catalog/common/classes/shoppingCart.php 2014-02-13 08:19:21 UTC (rev 5144)
+++ trunk/catalog/common/classes/shoppingCart.php 2014-02-13 11:12:35 UTC (rev 5145)
@@ -20,7 +20,12 @@
/**
@class shoppingCart
*/
-class shoppingCart {
+class shoppingCart
+ Implements
+
+ // Link construct for shipping and calculate methode
+ IntShippingDepend
+ {
/**
@var Total panier numeric
*/
@@ -93,6 +98,8 @@
@return result of method
*/
protected function CallerStockageExe(CartSession $obj, $method, $args){
+
+
return $obj->$method($args);
}
@@ -437,23 +444,45 @@
/**
- \brief Renvoi du total panier
+ @note alias obsolete not use, prefer GetTotal()
*/
public function show_total() {
-
- $this->calculate();
- return $this->total;
+ return $this->GetTotal('price');
}
-
/**
- \brief Renvoi du poids total du panier
+ @note alias obsolete not use, prefer GetTotal()
*/
public function show_weight() {
+ return $this->GetTotal('weight');
+ }
- $this->calculate();
- return $this->weight;
+ /**
+ @fn GetTotal();
+ @brief GetTotal()
+ @return Total price
+ */
+ public function GetTotal($type='price'){
+
+ $this->calculate();
+
+ $value_check = 0;
+ switch($type){
+ case 'item';
+ $value_check = $this->count_contents();
+ break;
+ case 'weight';
+ $value_check = $this->weight;
+ break;
+ case 'price';
+ default:
+ $value_check = $this->total;
+ }
+
+
+ return $value_check;
}
+
/**
*/
public function get_content_type() {
@@ -626,6 +655,7 @@
foreach($grp as $line)
$list[] = $line;
}
+
$this->DC->products=$list;
$this->DC->hidden=$hidden;
$this->DC->any_out_of_stock=$any_out_of_stock;
@@ -646,6 +676,7 @@
/**
@brief Init base module actif pour la page shopping_cart
Intervention boucle definiton des produits
+ @param $product array
*/
private function process_cart($product){
$this->init_ot();
@@ -669,6 +700,7 @@
$this->ListTotal = strip_tags($this->show_total());
$list = $this->otm->_extents('show_list_total');
+
return $list;
}
Modified: trunk/catalog/includes/classes/ModPublicOneShipping.php
===================================================================
--- trunk/catalog/includes/classes/ModPublicOneShipping.php 2014-02-13 08:19:21 UTC (rev 5144)
+++ trunk/catalog/includes/classes/ModPublicOneShipping.php 2014-02-13 11:12:35 UTC (rev 5145)
@@ -26,20 +26,31 @@
*/
Interface ShippingInterface {
/**
- @fn process( $order )
- @brief calulate and extract data
+ @fn quote($method = '')
+ @brief calulate
+ @return array
+ */
+ public function quote($method = '');
+ /**
+ @fn update_status( Order $order , ShoppingCart $cart)
+ @brief adjust status for context
@return none
*/
-// public function process( CstrOrder $order , InterfaceCurrencies $currencies);
+ public function update_status( Order $order , ShoppingCart $cart);
+}
- public function quote($method = '');
-
-
- public function update_status( Order $order , ShoppingCart $cart);
-
+/**
+ @interface ShippingCheapestInterface
+ @brief activate section cheapset in shipping class for selected automated by price
+*/
+Interface ShippingCheapestInterface {
+
}
+
+
+
/**
@interface InterfaceAcaShipping
@brief Interface class support moduel ACA specifique order total
@@ -70,6 +81,8 @@
// public function show_list_total( shoppingCart $cart );
}
+
+
/**
@class ModOneShipping
*/
@@ -95,6 +108,11 @@
@var string path image
*/
public $icon;
+ /**
+ @var value float, int for stock in internal calulate
+ This value stocked is weight, price or count product
+ */
+ protected $value_total = 0;
/**
@fn GetName()
@@ -179,6 +197,82 @@
}
}
+
+ /**
+ @fn determineTableMethod($NameVarConfig)
+ @brief calculate
+ @param $NameVarConfig name of var used
+ @return none
+ */
+ protected function determineTableMethod($NameVarConfig, $obj) {
+ global $total_count, $shipping_weight;
+
+ $value = constant($NameVarConfig);
+
+ $this->value_total = 0;
+ $value_check = 0;
+ switch($value){
+ case 'item';
+ $value_check = $obj->GetTotal('item');
+ break;
+ case 'weight';
+ $value_check = $obj->GetTotal('weight');
+ break;
+ case 'price';
+ $value_check = $obj->GetTotal('price');
+ break;
+ default:
+ $list = array(
+ $obj->GetTotal('item'),
+ $obj->GetTotal('weight'),
+ $obj->GetTotal('price')
+ );
+
+ foreach($list as $row)
+ if($value_check >$row)
+ $value_check = $row;
+ }
+
+ $this->value_total = $value_check;
+
+ return null;
+ }
+
+ public function GetTotal(){
+ return $this->value_total;
+ }
+
+ /**
+ @fn determineShipping($NameVarConfig)
+ @brief Extract tables
+ This table is containt in valueref:valueprice, valueref:valueprice,...
+ */
+ protected function determineShipping($NameVarConfig) {
+
+ $table_cost = preg_split("/[:,]/" , constant($NameVarConfig) );
+ $shipping_factor=0;
+ $shipping = 0;
+
+ for ($i=0, $n=sizeof($table_cost); $i<$n; $i+=2){
+ if ($this->GetTotal() <= $table_cost[$i] && isset($table_cost[$i+1]) && tep_not_null($table_cost[$i+1]) ){
+ $shipping_factor = $table_cost[$i+1];
+ break;
+ }
+ }
+
+ //! calcul pour table de prix en %
+ if (substr_count($shipping_factor, '%') > 0)
+ $shipping = ((($this->GetTotal()*10)/10)*((str_replace('%', '', $shipping_factor))/100));
+ else
+ $shipping = str_replace('$', '', $shipping_factor);
+
+
+ //! majoration tare emballage
+// if ($this->geozone_mode == 'weight')
+// $shipping = $shipping * shipping::$shipping_num_boxes;
+
+ return $shipping;
+ }
}
?>
Modified: trunk/catalog/includes/classes/shipping.php
===================================================================
--- trunk/catalog/includes/classes/shipping.php 2014-02-13 08:19:21 UTC (rev 5144)
+++ trunk/catalog/includes/classes/shipping.php 2014-02-13 11:12:35 UTC (rev 5145)
@@ -24,14 +24,17 @@
@var array list of submodule object
*/
public $modules = array();
-
/**
- @p int nombre colis
+ @var number box calculate by max SHIPPING_MAX_WEIGHT global
*/
public static $shipping_num_boxes = 1;
-
+ /**
+ @var ressource instance
+ */
protected static $_instance;
+ /**
+ */
function __construct($module='') {
self::initialise($module);
@@ -39,6 +42,8 @@
}
+ /**
+ */
public static function getInstance($module='') {
if(self::$_instance == null) {
self::$_instance = new self($module);
@@ -46,14 +51,16 @@
return self::$_instance;
}
+ /**
+ */
public static function resetInstance() {
self::$_instance = null;
return self::getInstance();
}
/**
- * \fn initialise($module = '')
- * \brief class constructor
+ @fn initialise($module = '')
+ @brief class constructor
@param $module string/empty le nom du module, passé apres choix
*/
private function initialise($module = '') {
@@ -96,9 +103,9 @@
/**
- * \fn quote($method = '', $module = '')
- * @param $method
- * @param $module
+ @fn quote($method = '', $module = '')
+ @param $method
+ @param $module
*/
public function quote($method = '', $module = '') {
global $total_weight, $shipping_weight, $shipping_quoted;
@@ -150,8 +157,8 @@
}
/**
- * \fn cheapest()
- \brief Meilleur methode (la moins chere)
+ @fn cheapest()
+ @brief Meilleur methode (la moins chere)
*/
public function cheapest() {
if (is_array($this->modules)) {
@@ -190,9 +197,9 @@
}
/**
- * \fn getGeoZoneID($country_id, $zone_id)
- \brief Necessaire dans les module enfants
- Control $zone_id && $country_id. Si false module desactivé
+ @fn getGeoZoneID($country_id, $zone_id)
+ @brief Necessaire dans les module enfants
+ Control $zone_id && $country_id. Si false module desactivé
@param $country_id \a int de customers venant de order
@param $zone_id \a int de customers venant de order
*/
Modified: trunk/catalog/includes/languages/fr_FR/modules/shipping/flat.txt
===================================================================
--- trunk/catalog/includes/languages/fr_FR/modules/shipping/flat.txt 2014-02-13 08:19:21 UTC (rev 5144)
+++ trunk/catalog/includes/languages/fr_FR/modules/shipping/flat.txt 2014-02-13 11:12:35 UTC (rev 5145)
@@ -1,17 +1,16 @@
<?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 01/11/2012, 12:45
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
+ @file geozone.txt
+ @dir /includes/languages/fr_FR/shipping/
*/
-
-$lang['module shipping text flat title']="Forfait" ;
-$lang['module shipping text flat description']="livraison au forfait :" ;
$lang['module shipping flat text way']="soit :" ;
$lang['module shipping flat text title in shipping']="Forfait :" ;
?>
\ No newline at end of file
Modified: trunk/catalog/includes/languages/fr_FR/modules/shipping/item.txt
===================================================================
--- trunk/catalog/includes/languages/fr_FR/modules/shipping/item.txt 2014-02-13 08:19:21 UTC (rev 5144)
+++ trunk/catalog/includes/languages/fr_FR/modules/shipping/item.txt 2014-02-13 11:12:35 UTC (rev 5145)
@@ -1,16 +1,16 @@
<?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 01/11/2012, 12:45
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
+ @file geozone.txt
+ @dir /includes/languages/fr_FR/shipping/
*/
-$lang['module shipping item text title']="transporteur" ;
-$lang['module shipping item text description']="livraison classique :" ;
$lang['module shipping item text way']="soit :" ;
$lang['module shipping item text title in shipping']="transporteur :" ;
?>
\ No newline at end of file
Modified: trunk/catalog/includes/languages/fr_FR/modules/shipping/mzmt.txt
===================================================================
--- trunk/catalog/includes/languages/fr_FR/modules/shipping/mzmt.txt 2014-02-13 08:19:21 UTC (rev 5144)
+++ trunk/catalog/includes/languages/fr_FR/modules/shipping/mzmt.txt 2014-02-13 11:12:35 UTC (rev 5145)
@@ -1,13 +1,17 @@
<?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.0.9
- @date 23/07/10, 15:22
+ @version 2.2.0
+ @date 23/07/2010, 15:22
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
+ @file geozone.txt
+ @dir /includes/languages/fr_FR/shipping/
*/
+
$lang['module shipping mzmt text title']="MultiGeoZone MultiTable" ;
$lang['module shipping mzmt text description']="Multiple geo zone shipping with multiple tables to each geo zone." ;
Modified: trunk/catalog/includes/languages/fr_FR/modules/shipping/spu.txt
===================================================================
--- trunk/catalog/includes/languages/fr_FR/modules/shipping/spu.txt 2014-02-13 08:19:21 UTC (rev 5144)
+++ trunk/catalog/includes/languages/fr_FR/modules/shipping/spu.txt 2014-02-13 11:12:35 UTC (rev 5145)
@@ -1,14 +1,14 @@
<?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
- @date 111/05/2012, 12:45
+ @version 2.2.0
+ @date 11/05/2012, 12:45
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
- @CONTRIB is Store Pickup Shipping Module (http://www.oscommerce.com/community/contributions,164)
- Made to work with latest check-out procedure by Matthijs (Mattice) >> e-mail: ma...@xs... >> site: http://www.matthijs.org
+ @file spu.txt
+ @dir /includes/languages/fr_FR/shipping/
*/
Modified: trunk/catalog/includes/modules/shipping/flat.php
===================================================================
--- trunk/catalog/includes/modules/shipping/flat.php 2014-02-13 08:19:21 UTC (rev 5144)
+++ trunk/catalog/includes/modules/shipping/flat.php 2014-02-13 11:12:35 UTC (rev 5145)
@@ -36,8 +36,6 @@
function __construct() {
$this->code =__CLASS__;
- $this->title = __('module shipping flat text title');
- $this->description = __('module shipping flat text description');
$this->icon = ( (defined('MODULE_SHIPPING_FLAT_ICON') && tep_not_null('MODULE_SHIPPING_FLAT_ICON') ) ? MODULE_SHIPPING_FLAT_ICON : '');
if(defined('MODULE_SHIPPING_FLAT_SORT_ORDER'))
Modified: trunk/catalog/includes/modules/shipping/item.php
===================================================================
--- trunk/catalog/includes/modules/shipping/item.php 2014-02-13 08:19:21 UTC (rev 5144)
+++ trunk/catalog/includes/modules/shipping/item.php 2014-02-13 11:12:35 UTC (rev 5145)
@@ -34,8 +34,6 @@
// class constructor
public function __construct() {
$this->code = 'item';
- $this->title = __('module shipping item text title');
- $this->description = __('module shipping item text description');
$this->icon = ( (defined('MODULE_SHIPPING_ITEM_ICON') && tep_not_null('MODULE_SHIPPING_ITEM_ICON'))? substr(MODULE_SHIPPING_ITEM_ICON,strlen(DIR_WS_CATALOG)) : '');
if(defined('MODULE_SHIPPING_ITEM_SORT_ORDER'))
Modified: trunk/catalog/includes/modules/shipping/mzmt.php
===================================================================
--- trunk/catalog/includes/modules/shipping/mzmt.php 2014-02-13 08:19:21 UTC (rev 5144)
+++ trunk/catalog/includes/modules/shipping/mzmt.php 2014-02-13 11:12:35 UTC (rev 5145)
@@ -81,13 +81,13 @@
'methods' => array()
);
- $this->determineTableMethod(constant('MODULE_SHIPPING_MZMT_GEOZONE_' . $this->delivery_geozone . '_MODE'));
+ $this->determineTableMethod(constant('MODULE_SHIPPING_MZMT_GEOZONE_' . $this->delivery_geozone . '_MODE') , $order );
if ($method) {
$j = substr($method, 5);
- $shipping = $this->determineShipping(preg_split("/[:,]/" , constant('MODULE_SHIPPING_MZMT_GEOZONE_' . $this->delivery_geozone . '_TABLE_' . $j)));
+ $shipping = $this->determineShipping(preg_split("/[:,]/" , constant('MODULE_SHIPPING_MZMT_GEOZONE_' . $this->delivery_geozone . '_TABLE_' . $j)) );
$this->quotes['methods'][] = array(
'id' => 'table' . $j,
@@ -228,51 +228,8 @@
- /**
- Mode base calcul
- */
- private function determineTableMethod($geozone_mode) {
- global $total_count, $shipping_weight;
- $this->geozone_mode = $geozone_mode;
- if ($this->geozone_mode == 'price') {
- $this->order_total = $_SESSION['cart']->show_total();
- } elseif ($this->geozone_mode == 'count') {
- $this->order_total = $total_count;
- } else {
- $this->order_total = $shipping_weight;
- }
-
- return null;
- }
-
- /**
- Calcul shipping
- */
- private function determineShipping($table_cost) {
- $shipping_factor=0;
- for ($i=0, $n=sizeof($table_cost); $i<$n; $i+=2){
- if ($this->order_total <= $table_cost[$i] && isset($table_cost[$i+1]) && tep_not_null($table_cost[$i+1]) ){
- $shipping_factor = $table_cost[$i+1];
- break;
- }
- }
-
- //! calcul pour table de prix en %
- if (substr_count($shipping_factor, '%') > 0)
- $shipping = ((($this->order_total*10)/10)*((str_replace('%', '', $shipping_factor))/100));
- else
- $shipping = str_replace('$', '', $shipping_factor);
-
-
- //! majoration tare emballage
- if ($this->geozone_mode == 'weight')
- $shipping = $shipping * shipping::$shipping_num_boxes;
-
- return $shipping;
- }
-
}
?>
Modified: trunk/catalog/includes/modules/shipping/spu.php
===================================================================
--- trunk/catalog/includes/modules/shipping/spu.php 2014-02-13 08:19:21 UTC (rev 5144)
+++ trunk/catalog/includes/modules/shipping/spu.php 2014-02-13 11:12:35 UTC (rev 5145)
@@ -40,8 +40,6 @@
*/
function __construct() {
$this->code = __CLASS__;
- $this->title = __('Récupération des articles au magasin');
- $this->description = __('Récupération des articles au magasin durant les heures ouvrées.');
$this->icon = (defined('MODULE_SHIPPING_SPU_ICON')? MODULE_SHIPPING_SPU_ICON : '');
if(defined('MODULE_SHIPPING_MZMT_SORT_ORDER'))
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2014-02-13 08:19:24
|
Revision: 5144
http://sourceforge.net/p/oscss/svn/5144
Author: oscim
Date: 2014-02-13 08:19:21 +0000 (Thu, 13 Feb 2014)
Log Message:
-----------
Clean code and implement Mod
Modified Paths:
--------------
trunk/catalog/checkout_shipping.php
trunk/catalog/includes/modules/account/address_book.php
trunk/catalog/includes/modules/account/history.php
trunk/catalog/includes/modules/products/desc_base.php
trunk/catalog/includes/modules/shipping/flat.php
trunk/catalog/includes/modules/shipping/mzmt.php
Modified: trunk/catalog/checkout_shipping.php
===================================================================
--- trunk/catalog/checkout_shipping.php 2014-02-12 17:54:55 UTC (rev 5143)
+++ trunk/catalog/checkout_shipping.php 2014-02-13 08:19:21 UTC (rev 5144)
@@ -1,14 +1,15 @@
<?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
+ @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 09/12/2013, 22:44
- @author oscim <mail aur...@os...> <www http://www.oscim.fr>
- @encode UTF-8
- *\file
- *\brief page display choose shipping method
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+ @file checkout_shipping.php
+ @dir /
+ @brief page display choose shipping method
*/
require('includes/application_top.php');
@@ -65,42 +66,26 @@
//! load all enabled shipping modules
$shipping_modules = new shipping;
- //! livraison gratuite
- if (_cst_bool('MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING')) {
- $pass = false;
- switch (MODULE_ORDER_TOTAL_SHIPPING_DESTINATION) {
- case 'national': if ($order->delivery['country_id'] == STORE_COUNTRY) $pass = true; break;
- case 'international': if ($order->delivery['country_id'] != STORE_COUNTRY) $pass = true; break;
- case 'both': $pass = true; break;
- }
- $free_shipping = false;
- if ( ($pass == true) && ($order->info['total'] >= MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER) ) {
- $free_shipping = true;
- include(DIR_WS_LANGUAGES . $language . '/modules/order_total/ot_shipping.php');
- }
- }
- else $free_shipping = false;
+
// process the selected shipping method free
- if ( isset($_POST['action']) && ($_POST['action'] == 'process') ) {
+ if ( (isset($_POST['action']) && ($_POST['action'] == 'process')) ) {
if (!tep_session_is_registered('comments')) tep_session_register('comments');
if (tep_not_null($_POST['comments'])) $comments = tep_db_prepare_input($_POST['comments']);
if (!tep_session_is_registered('shipping')) tep_session_register('shipping');
- if ( (tep_count_shipping_modules() > 0) || ($free_shipping) ) {
+ if ( (tep_count_shipping_modules() > 0) ) {
- if ( (isset($_POST['shipping'])) && (strpos($_POST['shipping'], '_')) ) {
- $shipping = $_POST['shipping'];
+ if ( (isset($_POST['shipping']) && strpos($_POST['shipping'], '_')) ) {
+ $shipping = $_POST['shipping'] ;
+
list($module, $method) = explode('_', $shipping);
- if ( (isset($$module)&& is_object($$module)) || ($shipping == 'free_free') ) {
- if ($shipping == 'free_free') {
- $quote[0]['methods'][0]['title'] = FREE_SHIPPING_TITLE;
- $quote[0]['methods'][0]['cost'] = '0';
- } else {
+ if ( (isset($$module)&& is_object($$module)) ) {
$quote = $shipping_modules->quote($method, $module);
- }
- if (isset($quote['error'])) tep_session_unregister('shipping');
+
+ if (isset($quote['error']))
+ tep_session_unregister('shipping');
else {
if ( (isset($quote[0]['methods'][0]['title'])) && (isset($quote[0]['methods'][0]['cost'])) ) {
$shipping = array('id' => $shipping,
Modified: trunk/catalog/includes/modules/account/address_book.php
===================================================================
--- trunk/catalog/includes/modules/account/address_book.php 2014-02-12 17:54:55 UTC (rev 5143)
+++ trunk/catalog/includes/modules/account/address_book.php 2014-02-13 08:19:21 UTC (rev 5144)
@@ -1,48 +1,35 @@
<?php
/**
- @licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
+ @licence GPL 2005-2014 The osCSS developers - osCSS Open Source E-commerce
@portion code Copyright (c) 2002 osCommerce
@package osCSS-2 <www http://www.oscss.org>
- @version 2.1.2
+ @version 2.2.0
@date 09/12/2013, 22:44
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
- *\dir includes/modules/account/
- *\file
- *\class address_book
- *\group modules
- *\brief Address book for customers
+ @dir includes/modules/account/
+ @file address_book.php
+ @group modules
+ @brief Address book for customers
*/
+require_once(DIR_FS_CATALOG . DIR_WS_CLASSES .'ModPublicOne.php');
+
+/**
+ @class address_book
+*/
class address_book
extends
- AbstractAccount
+ ModPublicOne
implements
- InterfaceModule
+ // normal base all module
+ IntMod
+
+// InterfaceModule
,InterfaceAccount
{
- /**
- @var string
- */
- public $code;
/**
- @var string
- */
- public $title;
- /**
- @var string
- */
- public $description;
- /**
- @var int
- */
- public $sort_order;
- /**
- @var boolean
- */
- public $enabled = true;
- /**
@var array
*/
public static $account;
@@ -410,53 +397,6 @@
- /**
- @remarks implements InterfaceModule depend
- if module twin in backoffice, report all content install in the other module
- public function check() {return true;}
- public function install() {return true;}
- public function remove() {return true;}
- public function keys() {return array(); }
- */
-
- /**
- @fn check()
- @brief test if count all var , and keys is equal
- @return boolean true/false
- */
- function check() { return false; }
-
-
- /**
- @fn keys()
- @return array all key configuration define by this module
- */
- function keys() {
- return array();
- }
-
- /**
- @fn install()
- @brief add all configuration
- @note
- - Modules can emarquer sql installation instructions, however, in the case of transverse information, or dependent of an extension, preferring the implementation of an extension, file with sql independent
- - please, pefix all var configuration by 'MODULE_OT__MODTYPENAME_MAJ_'
- - if module twin in backoffice, report all content install in the other module
- - Not use language in DB , but function :__()
- for MODULE_TOTO_ST
- var title MODULE_TOTO_ST_S (small description)
- var description MODULE_TOTO_ST_L (long description)
- */
- function install() { return false; }
-
- /**
- @fn remove()
- @brief delete all configuration
- @note
- - please, pefix all var configuration by 'MODULE_PAYMENT__MODTYPENAME_MAJ_'
- - if module twin in backoffice, report all content remove in the other module
- */
- function remove() { return false; }
}
?>
\ No newline at end of file
Modified: trunk/catalog/includes/modules/account/history.php
===================================================================
--- trunk/catalog/includes/modules/account/history.php 2014-02-12 17:54:55 UTC (rev 5143)
+++ trunk/catalog/includes/modules/account/history.php 2014-02-13 08:19:21 UTC (rev 5144)
@@ -12,42 +12,26 @@
@dir includes/modules/account/
*/
+
+require_once(DIR_FS_CATALOG . DIR_WS_CLASSES .'ModPublicOne.php');
+
/**
@class history
@brief Address book for customers
*/
class history
extends
- AbstractAccount
+ ModPublicOne
implements
- InterfaceModule
+
+ // normal base all module
+ IntMod
+
+// InterfaceModule
,InterfaceAccount
{
-
-
-
- /**
- @var string
- */
- public $code;
/**
- @var string
- */
- public $title;
- /**
- @var string
- */
- public $description;
- /**
- @var int
- */
- public $sort_order;
- /**
- @var boolean
- */
- public $enabled = true;
- /**
@var array
*/
public static $current;
@@ -329,54 +313,6 @@
}
-
- /**
- @remarks implements InterfaceModule depend
- if module twin in backoffice, report all content install in the other module
- public function check() {return true;}
- public function install() {return true;}
- public function remove() {return true;}
- public function keys() {return array(); }
- */
-
- /**
- @fn check()
- @brief test if count all var , and keys is equal
- @return boolean true/false
- */
- function check() { return false; }
-
-
- /**
- @fn keys()
- @return array all key configuration define by this module
- */
- function keys() {
- return array();
- }
-
- /**
- @fn install()
- @brief add all configuration
- @note
- - Modules can emarquer sql installation instructions, however, in the case of transverse information, or dependent of an extension, preferring the implementation of an extension, file with sql independent
- - please, pefix all var configuration by 'MODULE_OT__MODTYPENAME_MAJ_'
- - if module twin in backoffice, report all content install in the other module
- - Not use language in DB , but function :__()
- for MODULE_TOTO_ST
- var title MODULE_TOTO_ST_S (small description)
- var description MODULE_TOTO_ST_L (long description)
- */
- function install() { return false; }
-
- /**
- @fn remove()
- @brief delete all configuration
- @note
- - please, pefix all var configuration by 'MODULE_PAYMENT__MODTYPENAME_MAJ_'
- - if module twin in backoffice, report all content remove in the other module
- */
- function remove() { return false; }
}
?>
\ No newline at end of file
Modified: trunk/catalog/includes/modules/products/desc_base.php
===================================================================
--- trunk/catalog/includes/modules/products/desc_base.php 2014-02-12 17:54:55 UTC (rev 5143)
+++ trunk/catalog/includes/modules/products/desc_base.php 2014-02-13 08:19:21 UTC (rev 5144)
@@ -1,26 +1,29 @@
<?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 06/01/12, 11:16
- \author oscim <mail aur...@os...> <www http://www.oscim.fr>
- \encode UTF-8
- \brief Description product
+ @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
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+ @brief Description product
*/
require_once(DIR_FS_CATALOG . DIR_WS_CLASSES . 'drivers/ModTypeListenerRow.php');
+require_once(DIR_FS_CATALOG . DIR_WS_CLASSES .'ModPublicOne.php');
-
/**
@class desc_base
*/
class desc_base
- extends AbstractProduct
- implements InterfaceModule {
+ extends ModPublicOne
+ implements
+ // normal base all module
+ IntMod
+
+ {
/**
@var access in .gab
@@ -46,8 +49,8 @@
$this->title = __('desc base text title');
$this->description = __('description produit dans la page produit');
$this->sort_order = (defined('MODULE_ACAPRO_DESC_BASE_SORT_ORDER')) ? MODULE_ACAPRO_DESC_BASE_SORT_ORDER : 0 ;
- $this->enabled = true;
+
if(!is_object($page)) return null;
$this->language_id=$page->the_var('languages_id');
}
@@ -108,52 +111,5 @@
}
- /**
- @remarks implements InterfaceModule depend
- if module twin in backoffice, report all content install in the other module
- public function check() {return true;}
- public function install() {return true;}
- public function remove() {return true;}
- public function keys() {return array(); }
- */
-
- /**
- @fn check()
- @brief test if count all var , and keys is equal
- @return boolean true/false
- */
- function check() { return false; }
-
-
- /**
- @fn keys()
- @return array all key configuration define by this module
- */
- function keys() {
- return array();
- }
-
- /**
- @fn install()
- @brief add all configuration
- @note
- - Modules can emarquer sql installation instructions, however, in the case of transverse information, or dependent of an extension, preferring the implementation of an extension, file with sql independent
- - please, pefix all var configuration by 'MODULE_OT__MODTYPENAME_MAJ_'
- - if module twin in backoffice, report all content install in the other module
- - Not use language in DB , but function :__()
- for MODULE_TOTO_ST
- var title MODULE_TOTO_ST_S (small description)
- var description MODULE_TOTO_ST_L (long description)
- */
- function install() { return false; }
-
- /**
- @fn remove()
- @brief delete all configuration
- @note
- - please, pefix all var configuration by 'MODULE_PAYMENT__MODTYPENAME_MAJ_'
- - if module twin in backoffice, report all content remove in the other module
- */
- function remove() { return false; }
}
?>
\ No newline at end of file
Modified: trunk/catalog/includes/modules/shipping/flat.php
===================================================================
--- trunk/catalog/includes/modules/shipping/flat.php 2014-02-12 17:54:55 UTC (rev 5143)
+++ trunk/catalog/includes/modules/shipping/flat.php 2014-02-13 08:19:21 UTC (rev 5144)
@@ -26,7 +26,8 @@
// Functionnnal Interface
// specific for all order total module
, ShippingInterface
-
+ // Actiavte cheapset selected methode
+ , ShippingCheapestInterface
// add in display cart
// , ShippingCartInterface
{
Modified: trunk/catalog/includes/modules/shipping/mzmt.php
===================================================================
--- trunk/catalog/includes/modules/shipping/mzmt.php 2014-02-12 17:54:55 UTC (rev 5143)
+++ trunk/catalog/includes/modules/shipping/mzmt.php 2014-02-13 08:19:21 UTC (rev 5144)
@@ -25,13 +25,15 @@
// specific for all order total module
, ShippingInterface
+ // Actiavte cheapset selected methode
+ , ShippingCheapestInterface
+
// add in display cart
// , ShippingCartInterface
{
- public
- $num_zones,
+ public $num_zones,
$num_tables,
$delivery_geozone,
$geozone_mode,
@@ -58,8 +60,13 @@
$this->update_status($order, $cart);
}
-/** Interface InterfaceAcaShipping */
+ /**
+ @implements InterfaceAcaShipping
+ */
+ /**
+ @fn quote($method = '')
+ */
public function quote($method = '') {
global $order, $shipping_weight;
@@ -96,21 +103,21 @@
}
else {
for ($j=1; $j<=$this->num_tables; $j++) {
- if (!tep_not_null(constant('MODULE_SHIPPING_MZMT_GEOZONE_' . $this->delivery_geozone . '_TABLE_' . $j))) continue;
+ if (!tep_not_null(constant('MODULE_SHIPPING_MZMT_GEOZONE_' . $this->delivery_geozone . '_TABLE_' . $j))) continue;
- $shipping = $this->determineShipping(preg_split("/[:,]/" , constant('MODULE_SHIPPING_MZMT_GEOZONE_' . $this->delivery_geozone . '_TABLE_' . $j)));
+ $shipping = $this->determineShipping(preg_split("/[:,]/" , constant('MODULE_SHIPPING_MZMT_GEOZONE_' . $this->delivery_geozone . '_TABLE_' . $j)));
- $this->quotes['methods'][] = array(
- 'id' => 'table' . $j,
- 'title' => __('module shipping mzmt geozone ' . $this->delivery_geozone . ' table ' . $j . ' text way'),
+ $this->quotes['methods'][] = array(
+ 'id' => 'table' . $j,
+ 'title' => __('module shipping mzmt geozone ' . $this->delivery_geozone . ' table ' . $j . ' text way'),
- 'delai' => $array['delai'],
- 'date_remise_provider' => $array['date_dep'],
- 'date_delivery' => $array['date_liv'],
+ 'delai' => $array['delai'],
+ 'date_remise_provider' => $array['date_dep'],
+ 'date_delivery' => $array['date_liv'],
- 'cost_ht' => $shipping + constant('MODULE_SHIPPING_MZMT_GEOZONE_' . $this->delivery_geozone . '_HANDLING'),
- 'cost' => $shipping + constant('MODULE_SHIPPING_MZMT_GEOZONE_' . $this->delivery_geozone . '_HANDLING')
- );
+ 'cost_ht' => $shipping + constant('MODULE_SHIPPING_MZMT_GEOZONE_' . $this->delivery_geozone . '_HANDLING'),
+ 'cost' => $shipping + constant('MODULE_SHIPPING_MZMT_GEOZONE_' . $this->delivery_geozone . '_HANDLING')
+ );
}
}
@@ -152,8 +159,14 @@
}
}
-/** Interface InterfaceModule */
-
+
+
+
+ /**
+ @implements IntMod
+ */
+
+
public function check() {
if (!isset($this->_check)) {
$check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key LIKE 'MODULE_SHIPPING_MZMT_%' ");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2014-02-12 17:54:58
|
Revision: 5143
http://sourceforge.net/p/oscss/svn/5143
Author: oscim
Date: 2014-02-12 17:54:55 +0000 (Wed, 12 Feb 2014)
Log Message:
-----------
Fix
Modified Paths:
--------------
trunk/catalog/common/class.interfaces.php
Modified: trunk/catalog/common/class.interfaces.php
===================================================================
--- trunk/catalog/common/class.interfaces.php 2014-02-12 17:53:06 UTC (rev 5142)
+++ trunk/catalog/common/class.interfaces.php 2014-02-12 17:54:55 UTC (rev 5143)
@@ -98,15 +98,13 @@
/**
@interface InterfaceModule
- @author oscim <mail aur...@os...> <www http://www.oscim.fr>
- Interface class pour tous les modules
+ @note obsolete, please user IntMod
*/
Interface InterfaceModule {
- //! Force la classe implements à définir cette méthode
- public function check();
- public function install();
- public function remove();
- public function keys();
+// public function check();
+// public function install();
+// public function remove();
+// public function keys();
}
/**
@@ -146,28 +144,17 @@
public function get_error();
}
-/**
- @interface InterfaceAcaOrderTotal
- @author oscim <mail aur...@os...> <www http://www.oscim.fr>
- Interface class support moduel ACA specifique order total
-*/
-Interface InterfaceAcaOrderTotal {
- /**
- @fn process( $order )
- @brief calulate and extract data
- @return none
- */
- public function process( CstrOrder $order , InterfaceCurrencies $currencies);
-}
+
+
+
+
/**
- @interface InterfaceAcaOrderTotal
- @author oscim <mail aur...@os...> <www http://www.oscim.fr>
- Interface class support moduel ACA specifique order total
+ @note obsolete, please user ShippingInterface
*/
Interface InterfaceAcaShipping {
- public function quote($method = '');
- public function update_status($order);
+// public function quote($method = '');
+// public function update_status($order);
}
/**
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2014-02-12 17:53:11
|
Revision: 5142
http://sourceforge.net/p/oscss/svn/5142
Author: oscim
Date: 2014-02-12 17:53:06 +0000 (Wed, 12 Feb 2014)
Log Message:
-----------
Fix
add centralized code for module in FrontOffice
Implement in order total and shipping module
Modified Paths:
--------------
trunk/catalog/admin/includes/classes/ModOne.php
trunk/catalog/admin/includes/classes/ModTree.php
trunk/catalog/admin/includes/classes/drivers/sqlextrafields.php
trunk/catalog/admin/includes/classes/drivers/sqlextrafieldsto.php
trunk/catalog/admin/includes/classes/drivers/sqlextrafieldsvalues.php
trunk/catalog/admin/includes/classes/drivers/sqlfeatured.php
trunk/catalog/admin/includes/classes/drivers/sqlproduct.php
trunk/catalog/admin/includes/modules/configuration/modconfig.php
trunk/catalog/admin/includes/modules/configuration/modextra.php
trunk/catalog/admin/includes/modules/pages/products.php
trunk/catalog/admin/includes/template/defaut/gabarit-view.php
trunk/catalog/admin/includes/template/oscss/gabarit-view.php
trunk/catalog/common/classes/FieldsDisplay.php
trunk/catalog/common/classes/datatype_drivers/Data_categorie.php
trunk/catalog/common/classes/datatype_drivers/Data_content.php
trunk/catalog/common/classes/datatype_drivers/Data_error.php
trunk/catalog/common/classes/datatype_drivers/Data_product.php
trunk/catalog/common/classes/formUtility.php
trunk/catalog/includes/classes/drivers/data/product.php
trunk/catalog/includes/classes/order_total.php
trunk/catalog/includes/classes/shipping.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/includes/modules/shipping/flat.php
trunk/catalog/includes/modules/shipping/item.php
trunk/catalog/includes/modules/shipping/mzmt.php
trunk/catalog/includes/modules/shipping/spu.php
Added Paths:
-----------
trunk/catalog/common/classes/Mod.php
trunk/catalog/includes/classes/ModPublicOne.php
trunk/catalog/includes/classes/ModPublicOneOrderTotal.php
trunk/catalog/includes/classes/ModPublicOneShipping.php
Modified: trunk/catalog/admin/includes/classes/ModOne.php
===================================================================
--- trunk/catalog/admin/includes/classes/ModOne.php 2014-02-11 14:19:15 UTC (rev 5141)
+++ trunk/catalog/admin/includes/classes/ModOne.php 2014-02-12 17:53:06 UTC (rev 5142)
@@ -11,6 +11,8 @@
*/
+require_once(DIR_FS_CATALOG . DIR_WS_COMMON_CLASSES .'Mod.php');
+
/**
@interface IntModTwo
@brief new interface module for next generation module
@@ -20,20 +22,11 @@
Abstract Class ModOne
+ Extends Mod
Implements IntModOne{
-
/**
- @remarks implements InterfaceModule depend
- if module twin in backoffice, report all content install in the other module
- public function check() {return true;}
- public function install() {return true;}
- public function remove() {return true;}
- public function keys() {return array(); }
- */
-
- /**
@fn check()
@brief test if count all var , and keys is equal
@return boolean true/false
@@ -44,11 +37,7 @@
foreach($this->keys() as $key){
if(!sqlconfiguration::fetch(array('key'=>$key)) )
$error++;
-
-// var_dump($key);
-
}
-// exit;
if( $error > 0)
$this->_check = false;
else
@@ -58,28 +47,7 @@
return $this->_check;
}
-
/**
- @fn keys()
- @return array all key configuration define by this module
- */
- function keys() { return array(); }
-
- /**
- @fn install()
- @brief add all configuration
- @note
- - Modules can emarquer sql installation instructions, however, in the case of transverse information, or dependent of an extension, preferring the implementation of an extension, file with sql independent
- - please, pefix all var configuration by 'MODULE_OT__MODTYPENAME_MAJ_'
- - if module twin in backoffice, report all content install in the other module
- - Not use language in DB , but function :__()
- for MODULE_TOTO_ST
- var title MODULE_TOTO_ST_S (small description)
- var description MODULE_TOTO_ST_L (long description)
- */
- function install() { return false; }
-
- /**
@fn remove()
@brief delete all configuration
@note
Modified: trunk/catalog/admin/includes/classes/ModTree.php
===================================================================
--- trunk/catalog/admin/includes/classes/ModTree.php 2014-02-11 14:19:15 UTC (rev 5141)
+++ trunk/catalog/admin/includes/classes/ModTree.php 2014-02-12 17:53:06 UTC (rev 5142)
@@ -21,24 +21,7 @@
*/
Interface IntModTree {
- /**
- @remarks Use in listing dataTable call by ajax
- */
- public static function GetConf();
- /**
- @brief return FILENAME Const defined in class Child
- */
- public static function GetFILENAME();
- /**
- @brief return DB value adapted for current action
- */
- public static function GetDBValue();
- /**
- @brief return DB value adapted for current action
- */
- public static function tep_get_list($page=1,$rowbyp=10,$sOrder='',$sWhere='',$options='');
-
}
Modified: trunk/catalog/admin/includes/classes/drivers/sqlextrafields.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlextrafields.php 2014-02-11 14:19:15 UTC (rev 5141)
+++ trunk/catalog/admin/includes/classes/drivers/sqlextrafields.php 2014-02-12 17:53:06 UTC (rev 5142)
@@ -201,7 +201,7 @@
*/
public static function delete($option){
$DB=Database::getInstance();
-
+ $error = 0;
$sql ="";
if(isset($option['id'])) $sql .="AND fields_id = '".(int)$option['id']."' ";
if(isset($option['key'])) $sql .="AND fields_key = '".(string)tep_db_input($option['key'])."' ";
@@ -211,11 +211,46 @@
if(strlen($sql)==0)
return false;
- $sql ="DELETE FROM ".TABLE_EXTRA_FIELDS." WHERE ".substr($sql,3);
+ $sql ="SELECT fields_id as id FROM ".TABLE_EXTRA_FIELDS." WHERE 1".$sql;
$res=$DB->query($sql);
+
+ $DB->beginTransaction();
+
+ if($res){
+ $tmp = $res->fetchAllAssoc();
+ $id = $tmp['id'];
+
+ // Delete fields links labels
+ if($error ==0)
+ if( ! sqlextrafieldslabels::delete(array('fields_id'=>$id)) )
+ $error++;
+
+ // Delete file value link extra link data
+ if($error ==0)
+ if( ! sqlextrafieldsto::delete(array('fields_id'=>$id)) )
+ $error++;
+
+ // Delete file value link
+ if($error ==0)
+ if( ! sqlextrafieldsvalues::delete(array('fields_id'=>$id)) )
+ $error++;
+
- return $res;
+ $sql ="SELECT fields_id FROM ".TABLE_EXTRA_FIELDS." WHERE fields_id = '".$id."' LIMIT 1";
+
+ if($error ==0)
+ $res=$DB->query($sql);
+ }
+
+ if( $error > 0){
+ $DB->rollbackTransaction();
+ return false;
+ }
+ else{
+ $DB->commitTransaction();
+ return 1;
+ }
}
/**
@@ -296,7 +331,8 @@
@return string
*/
public static function GetValue($epf_id, $datatype='', $data_id=0){
-
+ global $languages_id;
+
$objEF= sqlextrafields::fetch(array('id'=>$epf_id) , true);
new sqlextrafieldsto('product');
@@ -305,8 +341,23 @@
if(!$dump)
return '';
- if( in_array( $objEF->input_type , array(2, 3, 7, 4, 6 )) )
- var_dump($objEF);
+ $value = '';
+
+ if( in_array( $objEF->input_type , array(2, 3, 7, 4, 6 )) ){
+
+ // multi
+ if(in_array( $objEF->input_type , array(6, 7 )) ) {
+ foreach(explode(',', $dump->value) as $fid){
+ $val = sqlextrafieldsvalues::fetch(array('id'=>$fid,'fields_id'=>$epf_id, 'languages_id'=> (($objEF->active_value_language)? $languages_id: 0) ) , true);
+ $value .= $val->fields_value;
+ }
+ }
+ // value in table value
+ else{
+ $val = sqlextrafieldsvalues::fetch(array('id'=>$dump->value,'fields_id'=>$epf_id, 'languages_id'=> (($objEF->active_value_language)? $languages_id: 0) ) , true);
+ $value = $val->fields_value;
+ }
+ }
else
$value = $dump->value;
Modified: trunk/catalog/admin/includes/classes/drivers/sqlextrafieldsto.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlextrafieldsto.php 2014-02-11 14:19:15 UTC (rev 5141)
+++ trunk/catalog/admin/includes/classes/drivers/sqlextrafieldsto.php 2014-02-12 17:53:06 UTC (rev 5142)
@@ -122,7 +122,7 @@
if(strlen($sql)==0)
return false;
- $sql ="DELETE FROM ".TABLE_EXTRA_FIELDS_TO." WHERE ".substr($sql,3);
+ $sql ="DELETE FROM ".TABLE_EXTRA_FIELDS_TO." WHERE ".substr($sql,3)." LIMIT 1" ;
$res=$DB->query($sql);
@@ -269,7 +269,14 @@
$robj->select_values = array();
if( $extra_fields['value_list'] ==1 && in_array($extra_fields['fields_input_type'] , array(3,4,6,7))){
$list = sqlextrafieldsvalues::fetch(array('fields_id'=>$extra_fields['fields_id'], 'languages_id'=> ( ($robj->active_value_language)? $languages_id : 0 ) ), true);
+
+ if(is_object($list))
+ $list = array($list);
if(is_array($list))
+ $list = $list;
+ else
+ $list = array();
+
foreach($list as $item)
{
$robj->select_values[] = array('id' => $item->value_id, 'text' => $item->fields_value);
@@ -285,8 +292,8 @@
$label = ExtraUtility::FormatLabels($robj, $edit);
$input = ExtraUtility::FormatFields($robj, $edit,''/* self::$data*/);
-
- $extra_fields_string .= str_replace( array('%label%', '%input%'), array($label, $input) , $extra_fields['format'] ) ;
+
+ $extra_fields_string .= '<div class="block_input input-one col-sm-10">'. str_replace( array('%label%', '%input%'), array($label, $input) , $extra_fields['format'] ) .'</div>';
}
}
Modified: trunk/catalog/admin/includes/classes/drivers/sqlextrafieldsvalues.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlextrafieldsvalues.php 2014-02-11 14:19:15 UTC (rev 5141)
+++ trunk/catalog/admin/includes/classes/drivers/sqlextrafieldsvalues.php 2014-02-12 17:53:06 UTC (rev 5142)
@@ -180,9 +180,10 @@
if(strlen($sql) < 5)
return false;
- $DB->query($s="DELETE FROM " . TABLE_EXTRA_FIELDS_VALUES ." WHERE ". substr($sql,3) );
-
- return true;
+
+ // TODO Delete extrafiedsto content value
+ $sql="DELETE FROM " . TABLE_EXTRA_FIELDS_VALUES ." WHERE 1 ". $sql ;
+ return $DB->query( $sql );
}
/**
Modified: trunk/catalog/admin/includes/classes/drivers/sqlfeatured.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlfeatured.php 2014-02-11 14:19:15 UTC (rev 5141)
+++ trunk/catalog/admin/includes/classes/drivers/sqlfeatured.php 2014-02-12 17:53:06 UTC (rev 5142)
@@ -458,7 +458,7 @@
if(isset($option['datatype']) )
$tmp['datatype_child'] = tep_db_prepare_input($option['datatype']);
if(isset($option['datatype_id']) )
- $tmp['datatype_id'] = tep_db_prepare_input($option['datatype_id']);
+ $tmp['datatype_child_id'] = tep_db_prepare_input($option['datatype_id']);
return parent::delete($tmp);
Modified: trunk/catalog/admin/includes/classes/drivers/sqlproduct.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlproduct.php 2014-02-11 14:19:15 UTC (rev 5141)
+++ trunk/catalog/admin/includes/classes/drivers/sqlproduct.php 2014-02-12 17:53:06 UTC (rev 5142)
@@ -155,7 +155,7 @@
// recalculate price net
if(isset($sql_data_array['products_price_gross'])) {
- if($action == 'update_product' && is_object($origin))
+ if($action == 'update_product' && is_object($origin) && !isset($sql_data_array['products_tax_class_id']))
$sql_data_array['products_price'] = ( $sql_data_array['products_price_gross'] / ((tep_get_tax_rate_value($origin->tax_class_id) / 100 ) + 1) );
else
$sql_data_array['products_price'] = ( $sql_data_array['products_price_gross'] / ((tep_get_tax_rate_value($sql_data_array['products_tax_class_id']) / 100 ) + 1) );
@@ -488,17 +488,19 @@
new self();
$modules = self::$modules;
-
+
$ListLanguages=tep_get_languages();
- $tmp_lg = array();
+ $tmp_lg = array();
for ($i=0, $n=sizeof($ListLanguages); $i<$n; $i++) {
- $tmp_lg[$ListLanguages[$i]['id']] = array(
+ $tmp = array(
'products_name' => '', // depend language table
'products_description' => '', // depend language table
'products_url' => '',
'language_id' => $ListLanguages[$i]['id'],
);
+
+ $tmp_lg[$ListLanguages[$i]['id']] = ((!$shortkey)? $tmp : self::CleanKey($tmp));
}
$par = array(
@@ -808,7 +810,7 @@
if(isset($option['datatype']) )
$tmp['datatype_child'] = tep_db_prepare_input($option['datatype']);
if(isset($option['datatype_id']) )
- $tmp['datatype_id'] = tep_db_prepare_input($option['datatype_id']);
+ $tmp['datatype_child_id'] = tep_db_prepare_input($option['datatype_id']);
return parent::delete($tmp);
Modified: trunk/catalog/admin/includes/modules/configuration/modconfig.php
===================================================================
--- trunk/catalog/admin/includes/modules/configuration/modconfig.php 2014-02-11 14:19:15 UTC (rev 5141)
+++ trunk/catalog/admin/includes/modules/configuration/modconfig.php 2014-02-12 17:53:06 UTC (rev 5142)
@@ -163,7 +163,7 @@
if (!empty($row->set)){
if(strpos($row->set,'(') === false) $row->set.='(';
- eval('$value_field = ' . $row->set . '"' . htmlspecialchars($row->value) . '","'.$row->key.'");');
+ @eval('$value_field = ' . $row->set . '"' . htmlspecialchars($row->value) . '","'.$row->key.'");');
}
else $value_field = tep_draw_input_field('configuration['.$row->key.']', '',$row->value);
Modified: trunk/catalog/admin/includes/modules/configuration/modextra.php
===================================================================
--- trunk/catalog/admin/includes/modules/configuration/modextra.php 2014-02-11 14:19:15 UTC (rev 5141)
+++ trunk/catalog/admin/includes/modules/configuration/modextra.php 2014-02-12 17:53:06 UTC (rev 5142)
@@ -12,7 +12,16 @@
require_once(DIR_FS_ADMIN . DIR_WS_CLASSES .'listeners/ExtraFieldsListener.php');
-Class modextra{
+require_once(DIR_FS_ADMIN . DIR_WS_CLASSES .'listeners/EventMessListener.php');
+require_once(DIR_FS_ADMIN . DIR_WS_CLASSES .'listeners/EventTriggersCacheListener.php');
+
+Class modextra
+ Implements
+ // Events Interface for display and exec all notification
+ EventMessInterface
+ {
+
+
const FILENAME = FILENAME_CONFIGURATION;
/**
@var object
@@ -70,12 +79,14 @@
// instance Factory Extra
new sqlextrafieldsFactory(self::$data);
-
+ // Event
+ EventsHandlerActive::ActiveForClass(__CLASS__);
+ //
$this->EFL = new ExtraFieldsListener($this->code, self::FILENAME);
-
if(self::$id > 0)
$this->EFL->SetId( self::$id );
+
//! @remarks Force load language centralised
global $oscss,$language, $languages_id;
$oscss->pile_file_lang(DIR_FS_ADMIN.DIR_WS_LANGUAGES.$language.'/modules/filters.txt');
@@ -128,13 +139,21 @@
break;
case 'value_deleteconfirm':
+
$ObjectEF= sqlextrafieldsFactory::fetch(array('id'=>self::$id), true);
$vid = (isset($_GET['vid']) ? $_GET['vid'] : 0 );
if ( $vid > 0 && ( $ObjectEFValue = sqlextrafieldsvalues::fetch(array('id'=>$vid))) && $ObjectEFValue !=false ){
- if( ! sqlextrafieldsvalues::delete( array('id'=>$vid) ) )
- $messageStack->add_session(__('error delete for extra fields'), 'error');
+ if( ! sqlextrafieldsvalues::delete( array('id'=>$vid, 'fields_id'=>self::$id) ) )
+ EventsHandlerActive::Process(
+ new EventMessListener(__('error delete for extra fields', __CLASS__) )
+ );
+ else
+ EventsHandlerActive::Process(
+ new EventMessListener(__('success delete for extra fields', __CLASS__), 'success' )
+ );
+
tep_redirect(tep_href_link(FILENAME_CONFIGURATION, FILENAME_CFG.'&action=edit&id=' . self::$id));
}
@@ -193,9 +212,13 @@
}
if( $error > 0)
- $messageStack->add_session(__('error update for extra fields'), 'error');
- else
- $messageStack->add_session(__('succes update for extra fields'), 'success');
+ EventsHandlerActive::Process(
+ new EventMessListener(__('error delete for extra fields', __CLASS__) )
+ );
+ else
+ EventsHandlerActive::Process(
+ new EventMessListener(__('succes update for extra fields', __CLASS__) , 'success')
+ );
tep_redirect(tep_href_link(FILENAME_CONFIGURATION, FILENAME_CFG.'&action=edit&id=' . self::$id));
@@ -221,17 +244,25 @@
$array['sqlarray'] = sqlextrafieldsFactory::ExtractForm($_POST);
if( ! sqlextrafieldsFactory::update( $array ) )
- $messageStack->add_session(__('error update for extra fields'), 'error');
+ EventsHandlerActive::Process(
+ new EventMessListener(__('error update for extra fields', __CLASS__) )
+ );
else
- $messageStack->add_session(__('succes update for extra fields'), 'success');
+ EventsHandlerActive::Process(
+ new EventMessListener(__('succes update for extra fields', __CLASS__) , 'success')
+ );
}
}
else{
if( ! $fields_id = sqlextrafieldsFactory::create( $array ) )
- $messageStack->add_session(__('error create for extra fields'), 'error');
+ EventsHandlerActive::Process(
+ new EventMessListener(__('error create for extra fields', __CLASS__) )
+ );
else{
self::$id = $fields_id;
- $messageStack->add_session(__('succes create for extra fields'), 'success');
+ EventsHandlerActive::Process(
+ new EventMessListener(__('succes create for extra fields', __CLASS__) , 'success')
+ );
}
}
@@ -248,15 +279,25 @@
if(! sqlextrafieldslabels::fetch($data_array) ){
if( ! sqlextrafieldslabels::create($data_array) )
- $messageStack->add_session(__('error create for extra fields label'), 'error');
+ EventsHandlerActive::Process(
+ new EventMessListener(__('error create for extra fields label', __CLASS__) )
+ );
else
- $messageStack->add_session(__('succes create for extra fields label'), 'success');
+ EventsHandlerActive::Process(
+ new EventMessListener(__('succes create for extra fields label', __CLASS__) , 'success')
+ );
+
}
else{
if (! sqlextrafieldslabels::update($data_array) )
- $messageStack->add_session(__('error update for extra fields label'), 'error');
+ EventsHandlerActive::Process(
+ new EventMessListener(__('error update for extra fields label', __CLASS__) )
+ );
else
- $messageStack->add_session(__('succes update for extra fields label'), 'success');
+ EventsHandlerActive::Process(
+ new EventMessListener(__('succes update for extra fields label', __CLASS__) , 'success')
+ );
+
}
}
@@ -280,11 +321,16 @@
$fields_id = tep_db_prepare_input(self::$id);
tep_db_query("delete from " . TABLE_EXTRA_FIELDS_LABELS . " where fields_id = '" . (int)$fields_id . "'");
- tep_db_query("delete from " . TABLE_CUSTOMERS_TO_EXTRA_FIELDS . " where fields_id = '" . (int)$fields_id . "'");
+ if( ! sqlextrafieldsFactory::delete( array('id'=>$fields_id) ) )
+ EventsHandlerActive::Process(
+ new EventMessListener(__('error delete for extra fields', __CLASS__) )
+ );
+ else
+ EventsHandlerActive::Process(
+ new EventMessListener(__('succes delete for extra fields', __CLASS__) , 'success')
+ );
- sqlextrafieldsFactory::delete( array('id'=>$fields_id) );
-
tep_redirect(tep_href_link(FILENAME_CONFIGURATION, tep_get_all_get_params(array('action'),false) ));
break;
@@ -300,7 +346,7 @@
'sqlarray'=> array('status'=>(int)tep_db_prepare_input($_GET['flag']))
)
) )
- $messageStack->add_session(__('error update for extra fields'), 'error');
+ $messageStack->add_session(__('error update for extra fields'));
if(!isset($_GET['forceajax']))
tep_redirect(tep_href_link(FILENAME_CONFIGURATION, tep_get_all_get_params(array('action'),false)));
@@ -346,7 +392,7 @@
case 'value_edit':
$vid = (isset($_GET['vid']) ? $_GET['vid'] : 0 );
if($vid > 0){
- $fields_value_list=sqlextrafieldsvalues::fetch(array('id'=>(int)$vid ), true);
+ $fields_value_list=sqlextrafieldsvalues::fetch(array('id'=>(int)$vid, 'fields_id'=>self::$id ), true);
$fields= sqlextrafieldsFactory::fetch(array('id'=>(int)self::$id ), true);
}
else{
Modified: trunk/catalog/admin/includes/modules/pages/products.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/products.php 2014-02-11 14:19:15 UTC (rev 5141)
+++ trunk/catalog/admin/includes/modules/pages/products.php 2014-02-12 17:53:06 UTC (rev 5142)
@@ -33,7 +33,6 @@
, EventMessInterface
// Event propagation Action
- // Event propagation Action
, EventTriggersCacheInterface
, EventTriggersSqlMaintenanceInterface
{
@@ -229,11 +228,21 @@
self::$allfields['p.products_type']= array(
'sort'=>true,
'search'=>true,
- 'alias'=>'type_id',
+ 'alias'=>'type',
'text'=>__('products table heading type id'),
'width'=>'5%',
'class'=>'tleft',
'default'=>true,
+ 'edit'=>array(
+ 'input_name'=>'products_type',
+ 'input_type'=>'select',
+ 'class'=>'tleft',
+ 'input_size'=>'1',
+ 'required_status'=>true,
+ 'select_values'=>tep_get_status_array('product',0,'status_name'),
+ 'position_col'=>'right',
+ 'position_grp'=>5
+ ),
);
self::$allfields['s.status_name']= array(
'sort'=>true,
Modified: trunk/catalog/admin/includes/template/defaut/gabarit-view.php
===================================================================
--- trunk/catalog/admin/includes/template/defaut/gabarit-view.php 2014-02-11 14:19:15 UTC (rev 5141)
+++ trunk/catalog/admin/includes/template/defaut/gabarit-view.php 2014-02-12 17:53:06 UTC (rev 5142)
@@ -1,9 +1,9 @@
<?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.0.9
+ @version 2.2.0
@date 11/08/10, 10:06
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
@@ -12,7 +12,7 @@
$css=($_GET['forceview']=='print')? 'print' : 'view' ;
$CHARSET=(isset($_GET['forcecharset']))?$_GET['forcecharset'] : CHARSET ;
@include(DIR_WS_INCLUDES . 'content/'.$page_admin.'.top.inc');
-require(DIR_WS_TEMPLATE.'inc/lib.template.php');
+ if (($init_theme=tep_test_gab_ele('inc/lib.template')) !=false) require($init_theme);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <?php echo HTML_PARAMS; ?> >
Modified: trunk/catalog/admin/includes/template/oscss/gabarit-view.php
===================================================================
--- trunk/catalog/admin/includes/template/oscss/gabarit-view.php 2014-02-11 14:19:15 UTC (rev 5141)
+++ trunk/catalog/admin/includes/template/oscss/gabarit-view.php 2014-02-12 17:53:06 UTC (rev 5142)
@@ -1,9 +1,9 @@
<?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.0.9
+ @version 2.2.0
@date 11/08/10, 10:06
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
@@ -12,7 +12,7 @@
$css=($_GET['forceview']=='print')? 'print' : 'view' ;
$CHARSET=(isset($_GET['forcecharset']))?$_GET['forcecharset'] : CHARSET ;
@include(DIR_WS_INCLUDES . 'content/'.$page_admin.'.top.inc');
-require(DIR_WS_TEMPLATE.'inc/lib.template.php');
+ if (($init_theme=tep_test_gab_ele('inc/lib.template')) !=false) require($init_theme);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <?php echo HTML_PARAMS; ?> >
Modified: trunk/catalog/common/classes/FieldsDisplay.php
===================================================================
--- trunk/catalog/common/classes/FieldsDisplay.php 2014-02-11 14:19:15 UTC (rev 5141)
+++ trunk/catalog/common/classes/FieldsDisplay.php 2014-02-12 17:53:06 UTC (rev 5142)
@@ -227,14 +227,18 @@
else
$input .= substr($rows->input_value,0, -1);
break;
+ // Select and Select multi
case 6:
case 7:
if(isset($rows->select_values) && is_array($rows->select_values)){
foreach($rows->select_values as $k=>$item)
- if(in_array($item['id'], $rows->input_value))$input .= $item['text'];
+ if(in_array($item['id'], $rows->input_value))
+ $input .= $item['text'];
}
else
$input .= substr($rows->input_value,0, -1);
+
+
break;
/**
@remarks textarea input
@@ -302,7 +306,7 @@
break;
case 6: // select mutli
- $input .= self::draw_pull_down_menu($prefix.'[]', $rows->select_values, (array)explode(',',$rows->input_value, $params), ' class="form-control" multiple="multiple" '.$params).$flag_r;
+ $input .= self::draw_pull_down_menu($prefix.'[]', $rows->select_values, (array)explode(',',$rows->input_value), ' class="form-control" multiple="multiple" '.$params).$flag_r;
break;
case 5: // hidden
Added: trunk/catalog/common/classes/Mod.php
===================================================================
--- trunk/catalog/common/classes/Mod.php (rev 0)
+++ trunk/catalog/common/classes/Mod.php 2014-02-12 17:53:06 UTC (rev 5142)
@@ -0,0 +1,124 @@
+<?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 12/07/2013, 09:17
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+ @file Mod.php
+ @dir common/classes/
+*/
+
+
+/**
+ @interface IntMod
+ @note if module twin in backoffice, report all content install in the other module
+*/
+Interface IntMod {
+ /**
+ @fn check()
+ @brief test if count all var , and keys is equal
+ @return boolean true/false
+ */
+ public function check();
+ /**
+ @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
+ */
+ public function remove();
+ /**
+ @fn install()
+ @brief add all configuration
+ @note
+ - Modules can emarquer sql installation instructions, however, in the case of transverse information, or dependent of an extension, preferring the implementation of an extension, file with sql independent
+ - please, pefix all var configuration by 'MODULE_OT__MODTYPENAME_MAJ_'
+ - if module twin in backoffice, report all content install in the other module
+ - Not use language in DB , but function :__()
+ for MODULE_TOTO_ST
+ var title MODULE_TOTO_ST_S (small description)
+ var description MODULE_TOTO_ST_L (long description)
+ */
+ public function install();
+ /**
+ @fn keys()
+ @return array all key configuration define by this module
+ */
+ public function keys();
+}
+
+
+Abstract Class Mod
+ Implements IntMod{
+
+ /**
+ @var int order sort module in list module
+ */
+ public $sort_order = 50;
+ /**
+ @var boolean active / inactive module by context
+ */
+ public $enabled = true;
+
+
+ /**
+ @fn GetName()
+ @brief Get Value
+ @return shopping_cart value
+ */
+ public function GetEnabled(){
+ return $this->enabled;
+ }
+
+ /**
+ @fn SetName()
+ @brief Get Value
+ @param $fieldname shopping_cart val_description
+ */
+ public function SetEnabled($enabled){
+ $this->enabled = (bool)$enabled;
+ }
+
+ /**
+ @fn check()
+ @brief test if count all var , and keys is equal
+ @return boolean true/false
+ */
+ function check() { return true; }
+
+
+ /**
+ @fn keys()
+ @return array all key configuration define by this module
+ */
+ function keys() { return array(); }
+
+ /**
+ @fn install()
+ @brief add all configuration
+ @note
+ - Modules can emarquer sql installation instructions, however, in the case of transverse information, or dependent of an extension, preferring the implementation of an extension, file with sql independent
+ - please, pefix all var configuration by 'MODULE_OT__MODTYPENAME_MAJ_'
+ - if module twin in backoffice, report all content install in the other module
+ - Not use language in DB , but function :__()
+ for MODULE_TOTO_ST
+ var title MODULE_TOTO_ST_S (small description)
+ var description MODULE_TOTO_ST_L (long description)
+ */
+ function install() { return false; }
+
+ /**
+ @fn remove()
+ @brief delete all configuration
+ @note
+ - please, pefix all var configuration by 'MODULE_PAYMENT__MODTYPENAME_MAJ_'
+ - if module twin in backoffice, report all content remove in the other module
+ */
+ function remove() { return true; }
+}
+
+
+?>
Modified: trunk/catalog/common/classes/datatype_drivers/Data_categorie.php
===================================================================
--- trunk/catalog/common/classes/datatype_drivers/Data_categorie.php 2014-02-11 14:19:15 UTC (rev 5141)
+++ trunk/catalog/common/classes/datatype_drivers/Data_categorie.php 2014-02-12 17:53:06 UTC (rev 5142)
@@ -355,10 +355,12 @@
$DB=Database::getInstance();
$return_array = array();
- $res = $DB->query( "select ft.page_id as ID , head_title_tag as tName, head_desc_tag, head_keywords_tag from " . TABLE_FULL_TAG . " ft, " . TABLE_FULL_TAG_DESCRIPTION . " ftd where ft.tag_id=ftd.tag_id and ft.page_type='cat' and ftd.language_id = '" . (int)$languages_id. "'" );
-
-
+ $sql= "select pd.categories_id as ID ,IF(categories_name <>'', categories_name , head_title_tag) as tName, head_desc_tag, head_keywords_tag from " . TABLE_CATEGORIES_DESCRIPTION . " pd LEFT JOIN " . TABLE_FULL_TAG . " ft ON(ft.page_id=pd.categories_id AND ft.page_type='cat') LEFT JOIN ".TABLE_FULL_TAG_DESCRIPTION . " ftd ON(ft.tag_id=ftd.tag_id and ftd.language_id = '" . (int)$languages_id. "') WHERE pd.language_id = '" . (int)$languages_id. "' " ;
+
+ $res = $DB->query($sql);
+
while ($result =$res->fetchAssoc()){
+ $result['path']= $result['tName'] ;
$return_array[] = array ($result['ID'], $result, 'CATEGORIE') ;
}
Modified: trunk/catalog/common/classes/datatype_drivers/Data_content.php
===================================================================
--- trunk/catalog/common/classes/datatype_drivers/Data_content.php 2014-02-11 14:19:15 UTC (rev 5141)
+++ trunk/catalog/common/classes/datatype_drivers/Data_content.php 2014-02-12 17:53:06 UTC (rev 5142)
@@ -190,23 +190,13 @@
global $languages_id;
$DB=Database::getInstance();
$return_array = array();
- if( _test_bool('SEO_ADD_CAT_PARENT') )
- $res=$DB->query( "select ft.page_id as ID, head_title_tag as tName, head_desc_tag, head_keywords_tag from " . TABLE_FULL_TAG . " ft, " . TABLE_FULL_TAG_DESCRIPTION . " ftd where ft.tag_id=ftd.tag_id and ft.page_type='content' and ftd.language_id = '" . (int)$languages_id. "'" );
- else
- $res=$DB->query( $sql="SELECT DISTINCT ft.page_id as ID , head_title_tag as tName, head_desc_tag, head_keywords_tag, cd.categories_cpath from " . TABLE_FULL_TAG . " ft LEFT JOIN ".TABLE_CONTENT_TO_CATEGORIES." cd2 ON page_id=cd2.content_id JOIN ".TABLE_CATEGORIES." cd ON cd.categories_id = cd2.categories_id , " . TABLE_FULL_TAG_DESCRIPTION . " ftd where ft.tag_id=ftd.tag_id and ft.page_type='content' and ftd.language_id = '" . (int)$languages_id. "' GROUP BY ID" );
+ $sql= "select pd.content_id as ID ,IF(content_title <>'', content_title , head_title_tag) as tName, head_desc_tag, head_keywords_tag from " . TABLE_CONTENT_DESCRIPTION . " pd LEFT JOIN " . TABLE_FULL_TAG . " ft ON(ft.page_id=pd.content_id AND ft.page_type='content') LEFT JOIN ".TABLE_FULL_TAG_DESCRIPTION . " ftd ON(ft.tag_id=ftd.tag_id and ftd.language_id = '" . (int)$languages_id. "') WHERE pd.language_id = '" . (int)$languages_id. "' " ;
+
+ $res = $DB->query($sql);
+
while ($result =$res->fetchAssoc()){
- $path = '';
-
- if(isset($result['categories_cpath']) && !empty($result['categories_cpath'])) {
- $list = explode('_',$result['categories_cpath']);
-
- foreach($list as $row )
- $path .= DataTypes::Getseoquery('c', '', $row, $languages_id).'-';
- }
-
- $result['path']= $path . ((isset($result['url']) && !empty($result['url']) )? $result['url'] : $result['tName']) ;
-
+ $result['path']= $result['tName'] ;
$return_array[] = array ($result['ID'], $result, 'CONTENT') ;
}
Modified: trunk/catalog/common/classes/datatype_drivers/Data_error.php
===================================================================
--- trunk/catalog/common/classes/datatype_drivers/Data_error.php 2014-02-11 14:19:15 UTC (rev 5141)
+++ trunk/catalog/common/classes/datatype_drivers/Data_error.php 2014-02-12 17:53:06 UTC (rev 5142)
@@ -134,7 +134,7 @@
@remarks Alert and log
*/
//! gestionnaire d'erreur
- $errorHandler = osC_ErrorHandler::start();
+ $errorHandler = ErrorHandlerActive::start();
// fichier de log d'erreur http
$errorHandler->attachFileWriter(DIR_FS_ROOT_DOCS.'public/logs/server-http.log');
trigger_error(sprintf(__FILE__.'::'.__LINE__.' Error type %s : SERVER: %s', (int)$_GET['ServerError'], print_r($_SERVER, true) ) , E_USER_ERROR);
Modified: trunk/catalog/common/classes/datatype_drivers/Data_product.php
===================================================================
--- trunk/catalog/common/classes/datatype_drivers/Data_product.php 2014-02-11 14:19:15 UTC (rev 5141)
+++ trunk/catalog/common/classes/datatype_drivers/Data_product.php 2014-02-12 17:53:06 UTC (rev 5142)
@@ -252,28 +252,13 @@
$DB=Database::getInstance();
$return_array = array();
- $prod_cache = array();
-// if( _test_bool('SEO_ADD_CAT_PARENT') )
-// $res=$DB->query( $sql= "select ft.page_id as ID ,IF(products_name <>'', products_name , head_title_tag) as tName, head_desc_tag, head_keywords_tag from " . TABLE_FULL_TAG . " ft LEFT JOIN " . TABLE_FULL_TAG_DESCRIPTION . " ftd ON(ft.tag_id=ftd.tag_id and ftd.language_id = '" . (int)$languages_id. "') LEFT JOIN ".TABLE_PRODUCTS_DESCRIPTION." pd ON (ft.tag_id=pd.products_id and pd.language_id = '" . (int)$languages_id. "') WHERE ft.page_type='product' " );
- $res=$DB->query( $sql= "select pd.products_id as ID ,IF(products_name <>'', products_name , head_title_tag) as tName, head_desc_tag, head_keywords_tag from " . TABLE_PRODUCTS_DESCRIPTION . " pd LEFT JOIN " . TABLE_FULL_TAG . " ft ON(ft.page_id=pd.products_id AND ft.page_type='product') LEFT JOIN ".TABLE_FULL_TAG_DESCRIPTION . " ftd ON(ft.tag_id=ftd.tag_id and ftd.language_id = '" . (int)$languages_id. "') WHERE pd.language_id = '" . (int)$languages_id. "' " );
+ $res=$DB->query( $sql= "select pd.products_id as ID ,IF(products_name <>'', products_name , head_title_tag) as tName, head_desc_tag, head_keywords_tag from " . TABLE_PRODUCTS_DESCRIPTION . " pd LEFT JOIN " . TABLE_FULL_TAG . " ft ON(ft.page_id=pd.products_id AND ft.page_type='product') LEFT JOIN ".TABLE_FULL_TAG_DESCRIPTION . " ftd ON(ft.tag_id=ftd.tag_id and ftd.language_id = '" . (int)$languages_id. "') WHERE pd.language_id = '" . (int)$languages_id. "' " );
while ($result =$res->fetchAssoc()){
- $path = '';
-
- if(isset($result['categories_cpath']) && !empty($result['categories_cpath'])) {
- $list = explode('_',$result['categories_cpath']);
-
-
- foreach($list as $row ){
- if( preg_match('#\d#i',$row) )
- $path .= DataTypes::Getseoquery('c', '',$row, $languages_id).'-';
- }
- }
-
- $result['path']= $path . ((isset($result['url']) && !empty($result['url']) )? $result['url'] : $result['tName']) ;
+ $result['path']= $result['tName'] ;
$return_array[] = array($result['ID'],$result, 'PRODUCT');
}
Modified: trunk/catalog/common/classes/formUtility.php
===================================================================
--- trunk/catalog/common/classes/formUtility.php 2014-02-11 14:19:15 UTC (rev 5141)
+++ trunk/catalog/common/classes/formUtility.php 2014-02-12 17:53:06 UTC (rev 5142)
@@ -199,12 +199,15 @@
if (tep_not_null($parameters)) $field .= ' ' . $parameters;
$field .= '>';
- if (empty($default) && isset($GLOBALS[$name])) $default = stripslashes((string)$GLOBALS[$name]);
+// if (empty($default) && isset($GLOBALS[$name])) $default = stripslashes((string)$GLOBALS[$name]);
for ($i=0, $n=sizeof($values); $i<$n; $i++) {
if(isset($values[$i])){
$field .= '<option value="' . tep_output_string($values[$i]['id']) . '"';
- if ($default == $values[$i]['id']) $field .= ' selected="selected"';
+ if (
+ (is_string($default) && $default == $values[$i]['id'])
+ || (is_array($default) && in_array($values[$i]['id'], $default ) )
+ ) $field .= ' selected="selected"';
$field .= '>' . tep_output_string($values[$i]['text'], array('"' => '"', '\'' => ''', '<' => '<', '>' => '>')) . '</option>';
}
}
Added: trunk/catalog/includes/classes/ModPublicOne.php
===================================================================
--- trunk/catalog/includes/classes/ModPublicOne.php (rev 0)
+++ trunk/catalog/includes/classes/ModPublicOne.php 2014-02-12 17:53:06 UTC (rev 5142)
@@ -0,0 +1,40 @@
+<?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 12/07/2013, 09:17
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+ @file ModOne.php
+ @dir includes/classes/
+*/
+
+
+require_once(DIR_FS_CATALOG . DIR_WS_COMMON_CLASSES .'Mod.php');
+
+/**
+ @interface IntModTwo
+ @brief new interface module for next generation module
+*/
+Interface IntModPublicOne {
+}
+
+
+class ModPublicOne
+ Extends Mod
+ Implements IntModPublicOne
+ {
+ /**
+ @var
+ */
+ public $title;
+ /**
+ @var
+ */
+ public $description;
+
+}
+
+
+?>
Added: trunk/catalog/includes/classes/ModPublicOneOrderTotal.php
===================================================================
--- trunk/catalog/includes/classes/ModPublicOneOrderTotal.php (rev 0)
+++ trunk/catalog/includes/classes/ModPublicOneOrderTotal.php 2014-02-12 17:53:06 UTC (rev 5142)
@@ -0,0 +1,156 @@
+<?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 12/07/2013, 09:17
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+ @file ModOne.php
+ @dir includes/classes/
+*/
+
+
+require_once(DIR_FS_CATALOG . DIR_WS_CLASSES .'ModPublicOne.php');
+
+/**
+ @interface IntModPublicOneOrderTotal
+ @brief new interface module for next generation module
+*/
+Interface IntModPublicOneOrderTotal {
+}
+
+/**
+ @interface InterfaceOrderTotal
+ @brief Interface class support moduel ACA specifique order total
+*/
+Interface OrderTotalInterface {
+ /**
+ @fn process( $order )
+ @brief calulate and extract data
+ @return none
+ */
+ public function process( CstrOrder $order , InterfaceCurrencies $currencies);
+}
+
+/**
+ @interface InterfaceAcaOrderTotal
+ @brief Interface class support moduel ACA specifique order total
+*/
+Interface OrderTotalCartInterface {
+ /**
+ @fn process_cart( shoppingCart $cart, $rowlinecart=array())
+ @implements OrderTotalCartInterface
+ @remarks required by Interface
+ @param $rowlinecart array
+ @return array
+ */
+ public function process_cart( shoppingCart $cart, $rowlinecart=array());
+
+ /**
+ @fn init_draw(shoppingCart $cart )
+ @param $cart shoppingCart object
+ @return none;
+ */
+ public function init_draw(shoppingCart $cart );
+
+ /**
+ @fn show_list_total( shoppingCart $cart)
+ @remarks init by Class ShoppongCart
+ @param $cart shoppingCart object
+ @return array
+ */
+ public function show_list_total( shoppingCart $cart );
+}
+
+/**
+ @class ModOneOrderTotal
+*/
+class ModPublicOneOrderTotal
+ Extends ModPublicOne
+ Implements
+ IntModPublicOneOrderTotal{
+ /**
+ @var array
+ required by OrderTotalInterface
+ */
+ public $output = array();
+ /**
+ @var array use in cart
+ required by OrderTotalCartInterface
+ */
+ protected $pre_output = array();
+ /**
+ @var boolean active/inactive in cart
+ required by OrderTotalCartInterface
+ */
+ protected $shopping_cart = false;
+
+ /**
+ @fn GetName()
+ @brief Get Value
+ @return shopping_cart value
+ */
+ public function GetPreOutput(){
+ return $this->pre_output;
+ }
+
+ /**
+ @fn SetName()
+ @brief Get Value
+ @param $pre_output array
+ */
+ public function SetPreOutput($pre_output = array()){
+ $this->pre_output = $pre_output;
+ }
+
+ /**
+ @fn GetName()
+ @brief Get Value
+ @return shopping_cart value
+ */
+ public function GetShoppingCart(){
+ return (bool)$this->shopping_cart;
+ }
+
+ /**
+ @fn SetName()
+ @brief Get Value
+ @param $fieldname shopping_cart val_description
+ */
+ public function SetShoppingCart($shopping_cart){
+ $this->shopping_cart = (bool)$shopping_cart;
+ }
+
+
+ /**
+ @fn process_cart( shoppingCart $cart, $rowlinecart=array())
+ @implements OrderTotalCartInterface
+ @remarks required by Interface
+ @param $rowlinecart array
+ @return array
+ */
+ public function process_cart( shoppingCart $cart, $rowlinecart=array()){
+ return $rowlinecart;
+ }
+
+ /**
+ @fn init_draw(shoppingCart $cart )
+ @param $cart shoppingCart object
+ @return none;
+ */
+ public function init_draw(shoppingCart $cart ){
+ }
+
+ /**
+ @fn show_list_total( shoppingCart $cart)
+ @remarks init by Class ShoppongCart
+ @param $cart shoppingCart object
+ @return array
+ */
+ public function show_list_total( shoppingCart $cart) {
+ return $this->GetPreOutput();
+ }
+}
+
+?>
Added: trunk/catalog/includes/classes/ModPublicOneShipping.php
===================================================================
--- trunk/catalog/includes/classes/ModPublicOneShipping.php (rev 0)
+++ trunk/catalog/includes/classes/ModPublicOneShipping.php 2014-02-12 17:53:06 UTC (rev 5142)
@@ -0,0 +1,184 @@
+<?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 12/07/2013, 09:17
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+ @file ModOne.php
+ @dir includes/classes/
+*/
+
+
+require_once(DIR_FS_CATALOG . DIR_WS_CLASSES .'ModPublicOne.php');
+
+/**
+ @interface IntModPublicOneShipping
+ @brief new interface module for next generation module
+*/
+Interface IntModPublicOneShipping {
+}
+
+/**
+ @interface InterfaceShipping
+ @brief Interface class support moduel ACA specifique order total
+*/
+Interface ShippingInterface {
+ /**
+ @fn process( $order )
+ @brief calulate and extract data
+ @return none
+ */
+// public function process( CstrOrder $order , InterfaceCurrencies $currencies);
+
+
+ public function quote($method = '');
+
+
+ public function update_status( Order $order , ShoppingCart $cart);
+
+}
+
+/**
+ @interface InterfaceAcaShipping
+ @brief Interface class support moduel ACA specifique order total
+*/
+Interface ShippingCartInterface {
+ /**
+ @fn process_cart( shoppingCart $cart, $rowlinecart=array())
+ @implements ShippingCartInterface
+ @remarks required by Interface
+ @param $rowlinecart array
+ @return array
+ */
+// public function process_cart( shoppingCart $cart, $rowlinecart=array());
+
+ /**
+ @fn init_draw(shoppingCart $cart )
+ @param $cart shoppingCart object
+ @return none;
+ */
+// public function init_draw(shoppingCart $cart );
+
+ /**
+ @fn show_list_total( shoppingCart $cart)
+ @remarks init by Class ShoppongCart
+ @param $cart shoppingCart object
+ @return array
+ */
+// public function show_list_total( shoppingCart $cart );
+}
+
+/**
+ @class ModOneShipping
+*/
+class ModPublicOneShipping
+ Extends ModPublicOne
+ Implements
+ IntModPublicOneShipping{
+ /**
+ @var int tax class
+ */
+ public $tax_class = -1;
+ /**
+ @var array use in cart
+ required by ShippingCartInterface
+ */
+// protected $pre_output = array();
+ /**
+ @var boolean active/inactive in cart
+ required by ShippingCartInterface
+ */
+ protected $shopping_cart = false;
+ /**
+ @var string path image
+ */
+ public $icon;
+
+ /**
+ @fn GetName()
+ @brief Get Value
+ @return shopping_cart value
+ */
+ public function GetTaxClass(){
+ return $this->tax_class;
+ }
+
+ /**
+ @fn SetName()
+ @brief Get Value
+ @param $tax_class int
+ */
+ public function SetTaxClass($tax_class){
+ $this->tax_class = $tax_class;
+ }
+
+ /**
+ @fn GetName()
+ @brief Get Value
+ @return shopping_cart value
+ */
+ public function GetShoppingCart(){
+ return (bool)$this->shopping_cart;
+ }
+
+ /**
+ @fn SetName()
+ @brief Get Value
+ @param $fieldname shopping_cart val_description
+ */
+ public function SetShoppingCart($shopping_cart){
+ $this->shopping_cart = (bool)$shopping_cart;
+ }
+
+
+ /**
+ @fn process_cart( shoppingCart $cart, $rowlinecart=array())
+ @implements ShippingCartInterface
+ @remarks required by Interface
+ @param $rowlinecart array
+ @return array
+ */
+// public function process_cart( shoppingCart $cart, $rowlinecart=array()){
+// return $rowlinecart;
+// }
+
+ /**
+ @fn init_draw(shoppingCart $cart )
+ @param $cart shoppingCart object
+ @return none;
+ */
+// public function init_draw(shoppingCart $cart ){
+// }
+
+ /**
+ @fn show_list_total( shoppingCart $cart)
+ @remarks init by Class ShoppongCart
+ @param $cart shoppingCart object
+ @return array
+ */
+// public function show_list_total( shoppingCart $cart) {
+// return $this->GetPreOutput();
+// }
+
+ /**
+ */
+ public function update_status( Order $order , ShoppingCart $cart) {
+ if ($this->GetEnabled()) {
+ $cst = 'MODULE_SHIPPING_'.$this->code.'_ZONE';
+ if(!defined($cst))
+ return $this->SetEnabled(true);
+
+ $cst = constant('MODULE_SHIPPING_'.$this->code.'_ZONE');
+ $this->SetEnabled(false);
+ if ( ((int)$cst > 0) && ((int)$cst == shipping::getGeoZoneID($order->delivery['country']['id'], $order->delivery['zone_id'])) )
+ $this->SetEnabled(true);
+ elseif ((int)$cst == 0)
+ $this->SetEnabled(true);
+ }
+ }
+
+}
+
+?>
Modified: trunk/catalog/includes/classes/drivers/data/product.php
===================================================================
--- trunk/catalog/includes/classes/drivers/data/product.php 2014-02-11 14:19:15 UTC (rev 5141)
+++ trunk/catalog/includes/classes/drivers/data/product.php 2014-02-12 17:53:06 UTC (rev 5142)
@@ -257,9 +257,7 @@
$DataRow->SetAction('buy', (!Stock::check_inline(array('quantity'=>1, 'id'=>$content['products_id'], 'track_stock'=>(int)$content['track_stock'], 'attributes'=>array(), 'current_quantity'=>(int)$content['products_quantity']))?'true':'false'));
-
foreach($listlinkto as $row){
-
$namerow = $row.'_id';
// retro compatibilité
if(!isset($content[$namerow]))
@@ -458,21 +456,20 @@
AND data_type='product'
AND data_id = '" . (int)$_id . "'
AND ( l.languages_id='".self::$lg_id."' OR l.languages_id= 0)
- AND fields_special_mod='".$key."'
+AND fields_special_mod='".$key."'
ORDER BY fields_sort ASC " ;
$epf_query = $DB->query($sql);
-
+// AND fields_special_mod='".$key."'
while( $e = $epf_query->fetchAssoc() ) {
$value = '';
- $val = $DB->query( $sql ="SELECT p2epf.value as value FROM " . TABLE_EXTRA_FIELDS_TO . " p2epf WHERE p2epf.fields_id=".$e['id']." AND data_type='product' AND data_id = '" . (int)$_id . "' AND languages_id='". (($e['value_language']==1 && !in_array( (int)$e['input_type'] , array(4,2)) )? self::$lg_id : 0)."' " );
-
+ $val = $DB->query( $sql ="SELECT p2epf.value as value FROM " . TABLE_EXTRA_FIELDS_TO . " p2epf WHERE p2epf.fields_id=".$e['id']." AND data_type='product' AND data_id = '" . (int)$_id . "' " );
+
if($val !=false && $val->__get('numRows')){
$result = $val->fetchAssoc();
$value = $result['value'];
}
-
switch((int)$e['input_type'] ) {
case 2: // radio
case 4: // select
Modified: trunk/catalog/includes/classes/order_total.php
===================================================================
--- trunk/catalog/includes/classes/order_total.php 2014-02-11 14:19:15 UTC (rev 5141)
+++ trunk/catalog/includes/classes/order_total.php 2014-02-12 17:53:06 UTC (rev 5142)
@@ -43,12 +43,14 @@
$customer_ot = tep_db_fetch_array($customer_ot_query);
$temp_ot_array= (tep_not_null($customer_ot['order_total_allowed']) ) ? explode(';', $customer_ot['order_total_allowed']) : array() ;
- if(!isset($list_mod) ||!is_array($list_mod) || count($list_mod)==0) return false;
- asort($list_mod);
+ asort($list_mod);
+
foreach($list_mod as $class=>$sort){
- $GLOBALS[$class]= $this->modules[$class] =$cl[$class];
+ if(!in_array($class,$temp_ot_array))
+ $this->modules[$class] =$cl[$class];
}
+
unset($cl);unset($list_mod);
return $this->modules;
@@ -66,7 +68,7 @@
reset($this->modules);
foreach($this->modules as $class=>$submod){
- if ($submod->enabled) {
+ if ( $submod->GetEnabled() ) {
$submod->process( $order, $price );
@@ -154,49 +156,23 @@
@return href de retour
Fournis une action au panier
*/
- function draw_cart($class='',$product=''){
+ function draw_cart($class='',$array=''){
global $page, $lang,$goto,$parameters, $cart;
- if (!empty($class)) {
- if (isset($this->modules[$class]) && $this->modules[$class]->enabled && (isset($module->shopping_cart) && $module->shopping_cart) && (method_exists($module, $funct ))){
- $funct='draw_cart';
- $product= $this->modules[$class]->$funct($product);
- }
- } else {
- reset($this->modules);
- foreach ($this->modules as $class=>$submod){
- $funct='draw_cart';
- if (($submod->enabled) && (isset($submod->shopping_cart) && $submod->shopping_cart) && (method_exists($submod, $funct )) ) {
- $product= $submod->$funct($product);
- }
- }
- }
- return $product;
+
+ return $this->InCart(__FUNCTION__, $class, $array);
}
/**
- @package oscss-2 <www http://www.oscss.org>
- @author oscim <mail os...@os...> <www http://www.oscim.fr>
+ @param $class
+ @param $array
@remarks Class shopping_cart_action
@return href de retour
Fournis une action au panier
*/
- function process_cart($class='',$product=''){
- global $page, $lang,$goto,$parameters;;
- if (!empty($class)) {
- if (isset($this->modules[$class]) && $this->modules[$class]->enabled && (isset($module->shopping_cart) && $module->shopping_cart) && (method_exists($module, $funct ))){
- $funct='process_cart';
- $product= $this->modules[$class]->$funct($product);
- }
- } else {
- reset($this->modules);
- foreach ($this->modules as $class=>$submod){
- $funct='process_cart';
- if (($submod->enabled) && (isset($submod->shopping_cart) && $submod->shopping_cart) && (method_exists($submod, $funct )) ) {
- $product= $submod->$funct($product);
- }
- }
- }
- return $product;
+ function process_cart($class='',$array=array()){
+ global $page, $lang,$goto,$parameters;
+
+ return $this->InCart(__FUNCTION__, $class, $array, true);
}
/**
@@ -213,14 +189,42 @@
reset($this->modules);
if(empty($funct)) return;
- 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 $this->InCart($funct, $class, $array);
+ }
+
+ /**
+ @fn InCart($function, $class, $array, $modreturn=false)
+ @param $function string name og method called
+ @param $class string force specific mod
+ @param $array array data
+ @param $modreturn boolean
+ @return &array or array(class=>array(result))
+ */
+ private function InCart($function, $class, &$array, $modreturn=false){
+ global $page, $lang,$goto,$parameters, $cart;
+
+ if (!empty($class) && isset($this->modules[$class]) ) {
+ $list = array($class=>$this->modules[$class]);
+ }
+ else
+ $list = $this->modules;
+
+ foreach ($list as $class=>$submod){
+ $list_interface = class_implements($class);
- return $res;
+ if(in_array( 'OrderTotalCartInterface', $list_interface))
+ if ($submod->GetEnabled() && $submod->GetShoppingCart() && method_exists($submod, $function ) ){
+ if(!$modreturn)
+ $array[]= $submod->$function($cart, $array);
+ else
+ $array= $submod->$function($cart, $array);
+ }
+ }
+
+ return $array;
}
+
}
Modified: trunk/catalog/includes/classes/shipping.php
===================================================================
--- trunk/catalog/includes/classes/shipping.php 2014-02-11 14:19:15 UTC (rev 5141)
+++ trunk/catalog/includes/classes/shipping.php 2014-02-12 17:53:06 UTC (rev 5142)
@@ -63,9 +63,9 @@
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)
+ if(($path=$page->fix_file(DIR_WS_INCLUDES .'languages/'. $language . '/modules/shipping/' . $mod . '.php',true)) !=false)
require($path);
- if(($path=$page->fix_file(DIR_WS_MODULES . 'shipment/' . $mod . '.php')) !=false)
+ if(($path=$page->fix_file(DIR_WS_MODULES . 'shipping/' . $mod . '.php')) !=false)
require($path);
$include_modules[] = array_merge($module, array('class' =>$mod) );
@@ -88,7 +88,7 @@
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'];
+ $this->modules[$imod['class']] = new $imod['class'];
}
}
}
@@ -124,12 +124,19 @@
$include_quotes = array();
reset($this->modules);
+
+ global $order, $cart;
+ foreach($this->modules as $class=>$submod){
- foreach($this->modules as $class=>$submod){
+ if (is_object($order) && is_object($cart))
+ $this->update_status($order, $cart);
+
if (tep_not_null($module)) {
- if ( ($module == $class) && ($submod->enabled) ) $include_quotes[] = $submod;
+ if ( ($module == $class) && ($module->GetEnabled()) )
+ $include_quotes[] = $submod;
}
- elseif ($submod->enabled) $include_quotes[] = $submod;
+ elseif ($submod->GetEnabled())
+ $include_quotes[] = $submod;
}
$size = sizeof($include_quotes);
@@ -152,12 +159,12 @@
reset($this->modules);
foreach($this->modules as $class=>$module){
- if ($module->enabled && (($quotes = $module->quotes) !=false) ) {
+ if (($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'])) {
+ if (isset($quotes['methods'][$i]['cost']) ) {
$rates[] =array_merge($quotes['methods'][$i], array(
'id' => $quotes['id'] . '_' . $quotes['methods'][$i]['id'],
- 'title' => $quotes['module'] . ' (' . $quotes['methods'][$i]['title'] . ')',
+ 'title' => $quotes['module'] . (!empty($quotes['methods'][$i]['title']) ? ' (' .$quotes['methods'][$i]['title'] . ')' : '' ),
// 'cost_ht' => @$quotes['methods'][$i]['cost_ht'],
// 'cost' => $quotes['methods'][$i]['cost']
)
Modified: trunk/catalog/includes/modules/order_total/ot_shipping.php
===================================================================
--- trunk/catalog/includes/modules/order_total/ot_shipping.php 2014-02-11 14:19:15 UTC (rev 5141)
+++ trunk/catalog/includes/modules/order_total/ot_shipping.php 2014-02-12 17:53:06 UTC (rev 5142)
@@ -10,54 +10,43 @@
@dir includes/modules/order_total/
*/
+
+require_once(DIR_FS_CATALOG . DIR_WS_CLASSES .'ModPublicOneOrderTotal.php');
+
/**
- @class ot_shipping
+ @class ot_subtotal
*/
-class ot_shipping {
- /**
- @var
- */
- public $title;
- /**
- @var
- */
- public $description;
- /**
- @var
- */
- public $sort_order;
- /**
- @var
- */
- public $enabled;
- /**
- @var
- */
- public $shopping_cart;
- /**
- @var
- */
- public $output;
- /**
- @var
- */
- public $pre_output;
+class ot_shipping
+ Extends ModPublicOneOrderTotal
+ implements
+
+ // normal base all module
+ IntMod
+
+ // Functionnnal Interface
+ // specific for all order total module
+ , OrderTotalInterface
+
+ // add in display cart
+ , OrderTotalCartInterface
+ {
+
function ot_shipping() {
- $this->code = 'ot_shipping';
+
+ $this->code = __CLASS__;
$this->title = __('module order total shipping title');
$this->description = __('module order total shipping description');
- $this->sort_order = (defined('MODULE_ORDER_TOTAL_SHIPPING_SORT_ORDER')) ? MODULE_ORDER_TOTAL_SHIPPING_SORT_ORDER : 3 ;
- $this->enabled = true;
- $this->shopping_cart=true; // active mode process
+
- $this->output = array();
- $this->pre_output = array();
+ if(defined('MODULE_ORDER_TOTAL_SHIPPING_SORT_ORDER'))
+ $this->sort_order= MODULE_ORDER_TOTAL_SHIPPING_SORT_ORDER ;
+ if(defined('MODULE_ORDER_TOTAL_SHIPPING_ENABLED_CART'))
+ $this->SetShoppingCart(MODULE_ORDER_TOTAL_SHIPPING_ENABLED_CART);
global $currencies, $cart;
if(is_object($cart) && $cart->get_content_type() =='virtual'){
- $this->enabled = false;
- return false;
+ $this->SetEnabled(false);
}
}
@@ -127,36 +116,50 @@
/**
@remarks shopping_cart
*/
- public function show_list_total() {
- global $currencies, $cart;
+ public function show_list_total( shoppingCart $cart ) {
+ global $order, $total_weight, $total_count;
+
+ //! load order
+ $order = new order;
- $ship=shipping::getInstance();
- $ship->quote();
- $result=$ship->cheapest();
+ //! tot cart
+ $total_weight = $cart->show_weight();
+ $total_count = $cart->count_contents();
- $this->pre_output = new objectInfo(array('text'=>$this->title,
- 'value'=> $result['cost']
- )
- );
+
+ $shipping = new shipping();
+ $quote= $shipping->quote();
- return $this->pre_output;
+ $cheapest = $shipping->cheapest();
+
+ $this->SetPreOutput(new objectInfo(array(
+ 'text'=>$this->title ."<br />".$cheapest['title'],
+ 'value'=> $cheapest['cost']
+ ) ) );
+
+ return $this->GetPreOutput(...
[truncated message content] |
|
From: <os...@us...> - 2014-02-11 14:19:19
|
Revision: 5141
http://sourceforge.net/p/oscss/svn/5141
Author: oscim
Date: 2014-02-11 14:19:15 +0000 (Tue, 11 Feb 2014)
Log Message:
-----------
Fix
Modified Paths:
--------------
trunk/catalog/admin/includes/gabarit/categories/display_view.new_light.gab
trunk/catalog/admin/includes/modules/pages/categories.php
Modified: trunk/catalog/admin/includes/gabarit/categories/display_view.new_light.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/categories/display_view.new_light.gab 2014-02-11 14:11:37 UTC (rev 5140)
+++ trunk/catalog/admin/includes/gabarit/categories/display_view.new_light.gab 2014-02-11 14:19:15 UTC (rev 5141)
@@ -10,7 +10,7 @@
*/
global $oscss;
-
+$page= MGabCont::CallSt('GetClassName');
$DT = DataTypes::getInstance();
?>
@@ -18,24 +18,24 @@
<h3><?php echo __('text info heading edit category'); ?></h3>
<div class="box_uniq block_form">
- <?php echo tep_draw_form('categories', categories::FILENAME, 'action=insert&cPath=' . categories::$cPath, 'post') ?>
+ <?php echo tep_draw_form('$page', $page::FILENAME, 'action=insert&cPath=' . $page::$cPath, 'post') ?>
<!-- <p class="block_input"> -->
<div class="tabs_lang">
<ul>
- <?php for ($i=0, $n=sizeof(categories::$languages); $i<$n; $i++) { ?>
- <li><a href="#fieldset_<?php echo $i ?>"><?php echo tep_language_image( categories::$languages[$i]['directory'] . '/images/' . categories::$languages[$i]['image'], categories::$languages[$i]['name']); ?></a></li>
+ <?php for ($i=0, $n=sizeof($page::$languages); $i<$n; $i++) { ?>
+ <li><a href="#fieldset_<?php echo $i ?>"><?php echo tep_language_image( $page::$languages[$i]['directory'] . '/images/' . $page::$languages[$i]['image'], $page::$languages[$i]['name']); ?></a></li>
<?php } ?>
</ul>
- <?php for ($i=0, $n=sizeof(categories::$languages); $i<$n; $i++) { ?>
+ <?php for ($i=0, $n=sizeof($page::$languages); $i<$n; $i++) { ?>
<fieldset id="fieldset_<?php echo $i ?>">
- <legend><?php echo tep_image(DIR_WS_CATALOG_LANGUAGES . categories::$languages[$i]['directory'] . '/images/' . categories::$languages[$i]['image'], categories::$languages[$i]['name'], TEMP_BO_HEADING_IMAGE_WIDTH, TEMP_BO_HEADING_IMAGE_HEIGHT); ?></legend>
+ <legend><?php echo tep_image(DIR_WS_CATALOG_LANGUAGES . $page::$languages[$i]['directory'] . '/images/' . $page::$languages[$i]['image'], $page::$languages[$i]['name'], TEMP_BO_HEADING_IMAGE_WIDTH, TEMP_BO_HEADING_IMAGE_HEIGHT); ?></legend>
<p class="block_input" style="width:90%;">
- <label for="<?php echo 'content_title' . categories::$languages[$i]['id']; ?>"><?php echo __('text edit categories name'); ?></label>
- <?php echo tep_draw_input_field('categories_name[' . categories::$languages[$i]['id'] . ']', '', categories::$Info->categories_name[categories::$languages[$i]['id']]) ; ?>
+ <label for="<?php echo 'content_title' . $page::$languages[$i]['id']; ?>"><?php echo __('text edit name', $page); ?></label>
+ <?php echo tep_draw_input_field('categorie_name[' . $page::$languages[$i]['id'] . ']', '', $page::$Info->$page_name[$page::$languages[$i]['id']]) ; ?>
</p>
</fieldset>
<?php } ?>
@@ -47,9 +47,9 @@
<div>
- <?php echo tep_draw_hidden_field('categories_datatype','', @$_GET['datatype']).
-tep_draw_hidden_field('categories_status','', categories::$Info->categories_status).
-tep_draw_hidden_field('categories_hidden','', categories::$Info->categories_hidden).
+ <?php echo tep_draw_hidden_field('$page_datatype','', @$_GET['datatype']).
+tep_draw_hidden_field('$page_status','', $page::$Info->$page_status).
+tep_draw_hidden_field('$page_hidden','', $page::$Info->$page_hidden).
tep_draw_hidden_field('origin', '',@$_GET['origin']);
// tep_draw_hidden_field();
?>
@@ -63,16 +63,16 @@
<dl>
<dd class="block_input w_90 CategoryView ">
- <label for="products_date_available"><?php echo __('txt categories'); ?></label>
+ <label for="products_date_available"><?php echo __('txt $page'); ?></label>
<ul id="cat_list_in_edit" class="ChooseSelect">
- <li class="<?php echo (((int)categories::$Info->parent_id == '0')? 'selected' : 'noselected') ?>"><?php echo tep_draw_radio_field('cPath','cat_0', '0', ((int)categories::$Info->parent_id == '0') ).' '.__('text categorie racine') ?></li>
- <?php foreach(categorieUtility::get_cat_list(array('root'=>0,'incre'=>false, 'datatype'=>categories::$Info->categories_datatype)) as $v)
- if(categories::$Info->categories_id != $v['categories_id']){
- $etat = ((categories::$Info->parent_id > 0 && categories::$Info->parent_id == $v['categories_id']) ? true :false );
+ <li class="<?php echo (((int)$page::$Info->parent_id == '0')? 'selected' : 'noselected') ?>"><?php echo tep_draw_radio_field('cPath','cat_0', '0', ((int)$page::$Info->parent_id == '0') ).' '.__('text categorie racine') ?></li>
+ <?php foreach(categorieUtility::get_cat_list(array('root'=>0,'incre'=>false, 'datatype'=>$page::$Info->$page_datatype)) as $v)
+ if($page::$Info->$page_id != $v['$page_id']){
+ $etat = (($page::$Info->parent_id > 0 && $page::$Info->parent_id == $v['$page_id']) ? true :false );
echo '<li class="'.(($etat)? 'selected' : 'noselected').'">'.
tep_decal(($v['niveau']+1)).
- ' '. tep_draw_radio_field('cPath','cat_'.$v['categories_id'], (string)$v['categories_id'],(bool)$etat).
- ' '.$v['categories_name'].
+ ' '. tep_draw_radio_field('cPath','cat_'.$v['$page_id'], (string)$v['$page_id'],(bool)$etat).
+ ' '.$v['$page_name'].
'</li>';
} ?>
</ul>
@@ -81,7 +81,7 @@
<dt class="button_nav block_input" style="width:95%;">
<?php
echo tep_image_submit('', __('image add cat and edit')) . tep_image_submit('', IMAGE_UPDATE_AND_CLOSE,' name="up_and_close"' );
- echo tep_js_back(tep_href_link(categories::FILENAME, 'cPath=' . categories::$cPath . (isset($_GET['cID']) ? '&cID=' . $_GET['cID'] : '') ), IMAGE_CANCEL) ;
+ echo tep_js_back(tep_href_link($page::FILENAME, 'cPath=' . $page::$cPath . (isset($_GET['cID']) ? '&cID=' . $_GET['cID'] : '') ), IMAGE_CANCEL) ;
?>
</dt>
</dl>
Modified: trunk/catalog/admin/includes/modules/pages/categories.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/categories.php 2014-02-11 14:11:37 UTC (rev 5140)
+++ trunk/catalog/admin/includes/modules/pages/categories.php 2014-02-11 14:19:15 UTC (rev 5141)
@@ -561,14 +561,17 @@
$MG= true;
switch($action){
+ case 'new_light':
+ $MG=false;
+
+ break;
default:
$action = parent::GenericDisplay($action);
}
- if( ! empty($action) ){
- if($MG)
- return MGabCont::CallGab($action,__FUNCTION__,self::MASTER);
- }
+ if( ! empty($action) )
+ return MGabCont::CallGab($action,__FUNCTION__,( ($MG) ? self::MASTER : __CLASS__ ) );
+
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2014-02-11 14:11:40
|
Revision: 5140
http://sourceforge.net/p/oscss/svn/5140
Author: oscim
Date: 2014-02-11 14:11:37 +0000 (Tue, 11 Feb 2014)
Log Message:
-----------
Fix
Modified Paths:
--------------
trunk/catalog/admin/includes/classes/ModTreePage.php
trunk/catalog/admin/includes/classes/drivers/sqlfeatured.php
Modified: trunk/catalog/admin/includes/classes/ModTreePage.php
===================================================================
--- trunk/catalog/admin/includes/classes/ModTreePage.php 2014-02-11 12:54:16 UTC (rev 5139)
+++ trunk/catalog/admin/includes/classes/ModTreePage.php 2014-02-11 14:11:37 UTC (rev 5140)
@@ -203,8 +203,8 @@
$class::$Id=$sqlclass::create($params);
-
- if( is_int($class::$Id) && $class::$Id <=0)
+
+ if( !is_int($class::$Id) || $class::$Id <=0)
throw new Exception(__('error in update process', $class) ) ;
if(in_array('EventMessInterface', $list_interface))
Modified: trunk/catalog/admin/includes/classes/drivers/sqlfeatured.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlfeatured.php 2014-02-11 12:54:16 UTC (rev 5139)
+++ trunk/catalog/admin/includes/classes/drivers/sqlfeatured.php 2014-02-11 14:11:37 UTC (rev 5140)
@@ -73,7 +73,7 @@
$id = $res->__get('insertId');
// language table
- if( $error <= 0)
+ 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;
@@ -82,7 +82,24 @@
if(!$res)
$error++;
}
+ }
+ else{
+ for ($i=0, $n=sizeof($list_languages); $i<$n; $i++) {
+ $language_id = $list_languages[$i]['id'];
+
+ $sql_data_array = array(
+ 'featured_title' => '',
+ 'featured_id' => $id,
+ 'language_id' => $language_id
+ );
+
+ $res=tep_db_perform(TABLE_FEATURED_DESCRIPTION, $sql_data_array);
+ if(!$res)
+ $error++;
+ }
+ }
+
if( $error > 0){
$DB->rollbackTransaction();
return false;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2014-02-11 12:54:19
|
Revision: 5139
http://sourceforge.net/p/oscss/svn/5139
Author: oscim
Date: 2014-02-11 12:54:16 +0000 (Tue, 11 Feb 2014)
Log Message:
-----------
Fix
Modified Paths:
--------------
trunk/catalog/admin/includes/classes/drivers/sqlextrafields.php
trunk/catalog/admin/includes/classes/drivers/sqlextrafieldsto.php
trunk/catalog/admin/includes/classes/productUtility.php
trunk/catalog/admin/includes/functions/general.php
trunk/catalog/admin/includes/modules/pages/adminUsers.php
trunk/catalog/admin/includes/modules/products/products_extra.php
Modified: trunk/catalog/admin/includes/classes/drivers/sqlextrafields.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlextrafields.php 2014-02-11 10:44:37 UTC (rev 5138)
+++ trunk/catalog/admin/includes/classes/drivers/sqlextrafields.php 2014-02-11 12:54:16 UTC (rev 5139)
@@ -286,6 +286,32 @@
return parent::ExtractDataForm(self::Specimen(true), $data);
}
+
+
+ /**
+ @brief methode for centralised construct result value depend on config Extra
+ @param $epf_id int
+ @param $datatype string
+ @param $data_id int
+ @return string
+ */
+ public static function GetValue($epf_id, $datatype='', $data_id=0){
+
+ $objEF= sqlextrafields::fetch(array('id'=>$epf_id) , true);
+
+ new sqlextrafieldsto('product');
+ $dump = sqlextrafieldsto::fetch(array('id'=>$epf_id, 'data_type'=>$datatype , 'data_id'=>(int)$data_id) , true);
+
+ if(!$dump)
+ return '';
+
+ if( in_array( $objEF->input_type , array(2, 3, 7, 4, 6 )) )
+ var_dump($objEF);
+ else
+ $value = $dump->value;
+
+ return $value;
+ }
}
Modified: trunk/catalog/admin/includes/classes/drivers/sqlextrafieldsto.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlextrafieldsto.php 2014-02-11 10:44:37 UTC (rev 5138)
+++ trunk/catalog/admin/includes/classes/drivers/sqlextrafieldsto.php 2014-02-11 12:54:16 UTC (rev 5139)
@@ -85,7 +85,26 @@
*/
public static function fetch($option,$shortkey=false){
+ $DB=Database::getInstance();
+
+ $sql ="";
+ if(isset($option['id'])) $sql .="AND fields_id = '".(int)$option['id']."' ";
+ if(isset($option['data_id'])) $sql .="AND data_id = '".(int)$option['data_id']."' ";
+ $sql .="AND data_type = '".(string)self::$data."' ";
+
+ $sql ="SELECT * FROM ".TABLE_EXTRA_FIELDS_TO." WHERE ".substr($sql,3);
+
+ $res=$DB->query($sql);
+ $num = $res->__get('numRows');
+
+ if( $num == 1)
+ return ((!$shortkey)? $res->fetchAssoc() : self::CleanKey($res->fetchAssoc() ));
+ elseif( $num > 1){
+ return ((!$shortkey)? $res->fetchAllAssoc() : self::CleanKey($res->fetchAllAssoc() ));
+ }
+ else
+ return false;
}
/**
@@ -113,8 +132,21 @@
+ /**
+ @fn CleanKey()
+ @brief Clean string name key
+ */
+ public static function CleanKey($array){
+ $object= new stdclass();
+ foreach($array as $key=>$value){
+ $object->$key = $value;
+ }
+
+ return $object;
+ }
+
/**
@brief save datas for data id
@param $id int id to data
Modified: trunk/catalog/admin/includes/classes/productUtility.php
===================================================================
--- trunk/catalog/admin/includes/classes/productUtility.php 2014-02-11 10:44:37 UTC (rev 5138)
+++ trunk/catalog/admin/includes/classes/productUtility.php 2014-02-11 12:54:16 UTC (rev 5139)
@@ -173,47 +173,10 @@
}
- /**
- @fn get_product_extra_value($epf_id, $product_id, $language_id)
- @brief Generation des value de product extra value
- Si langue , table TABLE_PRODUCTS_DESCRIPTION sinon table TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS
- @package extra_fields_products
- @param $epf_id int/string id epf ou key epf
- @param $product_id
- @param $language_id
- */
- public static function get_product_extra_value($epf_id, $product_id, $language_id) {
- if(is_int($epf_id)|| (int)$epf_id > 0 )
- $epf_query = tep_db_query($sql = "select e.epf_id, e.epf_input_type, epf_input_type,e.epf_active_value_language from " . TABLE_PRODUCTS_EXTRA_FIELDS . " e where e.epf_id = '" . (int)$epf_id."'");
- else
- $epf_query = tep_db_query($sql = "select e.epf_id, e.epf_input_type, epf_input_type, e.epf_active_value_language from " . TABLE_PRODUCTS_EXTRA_FIELDS . " e where e.epf_key = '" . $epf_id."'");
- $e = tep_db_fetch_array($epf_query);
- $product_query = tep_db_query($sql = "select products_extra_fields_value from " . TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS . " where products_id = '" . (int)$product_id . "' and products_extra_fields_id = '" . (int)$e['epf_id'] . "' AND languages_id = 0 ");
- $product = tep_db_fetch_array($product_query);
-
-
- if( in_array( $e['epf_input_type'], array(2, 3, 7, 4, 6 )) )
- return self::extra_field_list_value($product['products_extra_fields_value'], (int)$e['epf_id'] , (($e['epf_active_value_language']==1)? $language_id: 0) );
- else
- return $product['products_extra_fields_value'];
- }
-
/**
- @fn extra_field_list_value($value_id, $epf_id, $lgid)
- @brief value in list
- @package extra_fields_products
- */
- private static function extra_field_list_value($value_id, $epf_id, $lgid) {
- $sql = tep_db_query("select epf_value, parent_id from " . TABLE_PRODUCTS_EXTRA_FIELDS_VALUES . " where value_id = " . (int)$value_id." AND epf_id = ".$epf_id." AND languages_id = ".$lgid." ");
- $value = tep_db_fetch_array($sql);
- return $value['epf_value'];
- }
-
-
- /**
@fn list_epf_children($parent_id)
@brief Generation des products extra value
@package extra_fields_products
Modified: trunk/catalog/admin/includes/functions/general.php
===================================================================
--- trunk/catalog/admin/includes/functions/general.php 2014-02-11 10:44:37 UTC (rev 5138)
+++ trunk/catalog/admin/includes/functions/general.php 2014-02-11 12:54:16 UTC (rev 5139)
@@ -823,7 +823,6 @@
function tep_get_product_list($exclude = ''){ return productUtility::get_product_list($exclude); }
function tep_options_name($options_id) { return productUtility::options_name($options_id); }
function tep_values_name($values_id) { return productUtility::values_name($values_id); }
-function tep_get_product_extra_value($epf_id, $product_id, $language_id) { return productUtility::get_product_extra_value($epf_id, $product_id, $language_id); }
function tep_list_epf_children($parent_id) { return productUtility::list_epf_children($parent_id); }
Modified: trunk/catalog/admin/includes/modules/pages/adminUsers.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/adminUsers.php 2014-02-11 10:44:37 UTC (rev 5138)
+++ trunk/catalog/admin/includes/modules/pages/adminUsers.php 2014-02-11 12:54:16 UTC (rev 5139)
@@ -14,7 +14,6 @@
require_once(DIR_FS_ADMIN . DIR_WS_CLASSES .'listeners/EventMessListener.php');
require_once(DIR_FS_ADMIN . DIR_WS_CLASSES .'listeners/EventNotificationListener.php');
-error_reporting(E_ALL);
/**
@class adminUsers
@@ -382,7 +381,7 @@
@remarks Classic page
*/
case 'insert':
-
+ global $language;
// /// generated random password
$makePassword = self::randomize();
@@ -391,13 +390,14 @@
);
-
+ $firstname = tep_db_prepare_input($_POST['firstname']);
+ $email = tep_db_prepare_input($_POST['email_address']);
parent::GenericAction(true, $myarray);
$myarray = array(
'links'=>HTTP_SERVER . DIR_WS_ADMIN,
- 'admin_firstname'=>tep_db_prepare_input($_POST['firstname']),
- 'admin_email_address'=>tep_db_prepare_input($_POST['email_address']),
+ 'admin_firstname'=>$firstname,
+ 'admin_email_address'=>$email,
'hiddenPassword'=>$makePassword,
'message'=>''
);
@@ -405,8 +405,12 @@
// $message_final=tep_post_prepare_email('admin_members_new.tpl',$language,$myarray);
if( is_int(self::$Id) && self::$Id> 0){
+
+
+
$user = sqladminuser::fetch(array('id'=>self::$Id), true);
+ $myarray['from']=STORE_OWNER;
EventsHandlerActive::Process(
new EventNotificationListener(
'admin_members_new',
@@ -417,31 +421,18 @@
);
}
-// $myarray = array(
-// 'email_use_html'=>_cst_bool('EMAIL_USE_HTML'),
-// 'links'=>HTTP_SERVER . DIR_WS_ADMIN,
-// 'admin_firstname'=>tep_db_prepare_input($_POST['firstname']),
-// 'admin_email_address'=>tep_db_prepare_input($_POST['email_address']),
-// 'hiddenPassword'=>$makePassword,
-// 'message'=>''
-// );
+ $message_final=tep_post_prepare_email('admin_members_new.tpl',$language,$myarray);
-// $message_final=tep_post_prepare_email('admin_members_new.tpl',$language,$myarray);
-//
-// //! envoi a l'user
-// 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');
+ //! envoi a l'user
+ 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');
// $myarray['from']=STORE_OWNER;
-// $myarray['email_use_html']=_cst_bool('EMAIL_USE_HTML');
-//
-// if( ! notification::notif('admin_members_new',__('subject copy creat new compte for admin') ,$myarray, 'user_id='.$_id) )
-// $messageStack->add_session(sprintf(__('error in process notification for %s'), STORE_OWNER .' '. STORE_OWNER_EMAIL_ADDRESS ), 'error');
-// // }
+
tep_redirect(tep_href_link(self::FILENAME ));
break;
@@ -558,10 +549,10 @@
}
else{
$res = sqladminuser::Specimen(true);
+
+ if(isset($_GET['group_id']))
+ $res->groups_id = tep_db_prepare_input($_GET['group_id']);
}
-
- if(!isset($_GET['group_id']))
- $res->groups_id = tep_db_prepare_input($_GET['group_id']);
return self::FormatDBValue($res);
Modified: trunk/catalog/admin/includes/modules/products/products_extra.php
===================================================================
--- trunk/catalog/admin/includes/modules/products/products_extra.php 2014-02-11 10:44:37 UTC (rev 5138)
+++ trunk/catalog/admin/includes/modules/products/products_extra.php 2014-02-11 12:54:16 UTC (rev 5139)
@@ -136,7 +136,8 @@
switch($key){
// extra
default:
- $value = tep_get_product_extra_value((string)$key , (int)$item['id'] , $languages_id);
+ $epf_id = substr($key, 6);
+ $value = sqlextrafields::GetValue($epf_id, 'product', $item['id']);
}
return $value;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2014-02-11 10:44:40
|
Revision: 5138
http://sourceforge.net/p/oscss/svn/5138
Author: oscim
Date: 2014-02-11 10:44:37 +0000 (Tue, 11 Feb 2014)
Log Message:
-----------
Fix
Clean olds files
Add new type in cms page
Modified Paths:
--------------
trunk/catalog/admin/includes/appli_top_Test.php
trunk/catalog/admin/includes/classes/ModTreePage.php
trunk/catalog/admin/includes/classes/categorieUtility.php
trunk/catalog/admin/includes/classes/drivers/sqlcustomer.php
trunk/catalog/admin/includes/modules/account/address_book.php
trunk/catalog/admin/includes/modules/pages/customers.php
trunk/catalog/admin/includes/modules/pages/products.php
trunk/catalog/common/classes/PasswordUtility.php
trunk/catalog/install/includes/language/fr_FR/osc_status.txt
trunk/catalog/install/includes/sql/mysql/data/20_osc_status.sql
trunk/catalog/install/includes/sql/mysql/data/40_osc_content.sql
trunk/catalog/install/includes/sql/mysql/tables/osc_content.sql
Removed Paths:
-------------
trunk/catalog/admin/includes/gabarit/categories/display_view.delete.gab
trunk/catalog/admin/includes/gabarit/cms_content/display_view.new.gab
trunk/catalog/admin/includes/gabarit/products/display_view.new.gab
Modified: trunk/catalog/admin/includes/appli_top_Test.php
===================================================================
--- trunk/catalog/admin/includes/appli_top_Test.php 2014-02-11 01:59:08 UTC (rev 5137)
+++ trunk/catalog/admin/includes/appli_top_Test.php 2014-02-11 10:44:37 UTC (rev 5138)
@@ -52,10 +52,11 @@
if (file_exists($rpa.DIR_WS_INCLUDES . 'tables_files_modules.php'))
require($rpa.DIR_WS_INCLUDES . 'tables_files_modules.php');
-
+
// Event Handler
- include($rpa.DIR_WS_CLASSES.'EventsHandlerActive.php');
- $Events =EventsHandlerActive::Start($Cfg);
+ include_once($rpa.DIR_WS_CLASSES.'EventsHandlerActive.php');
+ $l=EventsHandlerActive::Start($Cfg);
+
// other load
include_once(DIR_FS_ADMIN.DIR_WS_CLASSES . 'objectInfo.php');
Modified: trunk/catalog/admin/includes/classes/ModTreePage.php
===================================================================
--- trunk/catalog/admin/includes/classes/ModTreePage.php 2014-02-11 01:59:08 UTC (rev 5137)
+++ trunk/catalog/admin/includes/classes/ModTreePage.php 2014-02-11 10:44:37 UTC (rev 5138)
@@ -70,37 +70,6 @@
);
}
- /**
- @fn GenericAction()
- */
- public static function GenericGetDbValue($action, $blokRedirect=false, $params=array() ){
- global $messageStack, $languages_id, $Cfg;
-
- $class=self::GetClassName();
- $sqlclass='sql'.self::GetClassDatatype();
-
-// $list_interface = class_implements($class);
-
- switch ($class::$action) {
-
- case 'delete':
- case 'edit':
- case 'new':
- if( (int)$class::$Id > 0) {
- $obj = $sqlclass::fetch(array('id'=>$class::$Id , 'language_id'=>$languages_id), true);
- }
- else{
- $obj = $sqlclass::Specimen(true);
- }
-
- $obj = $class::FormatDBValue($obj);
-
- return $obj;
- break;
-
- default:
- }
- }
/**
@fn GenericAction()
@@ -319,7 +288,7 @@
if($class::$Id >0 ){
if(!$blokRedirect)
- tep_redirect(tep_href_link($class::FILENAME, 'cID=' . $class::$class.'&action=edit'));
+ tep_redirect(tep_href_link($class::FILENAME, 'cID=' . $class::$Id.'&action=edit'));
}
else{
if(!$blokRedirect)
@@ -370,8 +339,8 @@
// loop in active fields containt active_value_language
// this called wiswig loader
+ $o=0;
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
@@ -453,6 +422,7 @@
case 'setflag':
$action = '';
+
$res = $class::RowStatus(array('status'=>(int)$class::$Info->status, 'id'=>(int)$class::$Id));
if($view)
Modified: trunk/catalog/admin/includes/classes/categorieUtility.php
===================================================================
--- trunk/catalog/admin/includes/classes/categorieUtility.php 2014-02-11 01:59:08 UTC (rev 5137)
+++ trunk/catalog/admin/includes/classes/categorieUtility.php 2014-02-11 10:44:37 UTC (rev 5138)
@@ -154,7 +154,7 @@
if(is_array($res))
foreach($res as $row){
if (! in_array($row->id, $exclude )){
- $category_tree_array[] = array( 'id' => $row->id, 'text' => tep_decal(substr_count($row->cpath,'_')) . $row->name[$lg]);
+ $category_tree_array[] = array( 'id' => $row->id, 'text' => tep_decal(substr_count($row->cpath,'_')) . $row->lg[$lg]->name);
$new_opt = $opt;
$new_opt['parent_id'] = (int)$row->id;
Modified: trunk/catalog/admin/includes/classes/drivers/sqlcustomer.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlcustomer.php 2014-02-11 01:59:08 UTC (rev 5137)
+++ trunk/catalog/admin/includes/classes/drivers/sqlcustomer.php 2014-02-11 10:44:37 UTC (rev 5138)
@@ -30,17 +30,12 @@
}
- public static function getInstance() {
- if(self::$_instance == null) self::$_instance = new self();
- return self::$_instance;
- }
-
/**
@brief create new ligne in table configuration
*/
public static function create($option){
- self::getInstance();
+ new self();
if(!isset($option['password']) || !isset($option['email']) )
return false;
@@ -122,7 +117,7 @@
@brief update ligne in table configuration
*/
public static function update($option){
- self::getInstance();
+ new self();
if(!isset($option['id']) || isset($option['email']))
return false;
@@ -222,7 +217,7 @@
*/
public static function fetch($option,$shortkey=false){
- self::getInstance();
+ new self();
$DB=Database::getInstance();
$sql ="";
@@ -314,7 +309,7 @@
@brief delete row
*/
public static function delete($option){
- self::getInstance();
+ new self();
$DB=Database::getInstance();
if(isset($option['id']))
@@ -343,6 +338,8 @@
@return array product empty
*/
public static function Specimen($shortkey=false){
+ new self();
+
$par = array(
'customers_id' => '',
@@ -419,7 +416,8 @@
@brief Clean string name key
*/
public static function CleanKey($array){
- self::getInstance();
+ new self();
+
$object= new stdclass();
foreach($array as $key=>$value){
Deleted: trunk/catalog/admin/includes/gabarit/categories/display_view.delete.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/categories/display_view.delete.gab 2014-02-11 01:59:08 UTC (rev 5137)
+++ trunk/catalog/admin/includes/gabarit/categories/display_view.delete.gab 2014-02-11 10:44:37 UTC (rev 5138)
@@ -1,45 +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 06/10/2013, 15:42
- @author oscim <mail aur...@os...> <www http://www.oscim.fr>
- @encode UTF-8
-*/
-global $languages_id;
-
-?>
-
- <h3><?php echo __('text info heading delete category'); ?></h3>
- <div class="box_uniq block_form">
- <?php echo tep_draw_form('categories', categories::FILENAME, 'action=delete_confirm') . tep_draw_hidden_field('categories_id', '', categories::$Info->id) ?>
-
- <p><?php echo __('text delete category intro') ?></p>
- <p><strong><?php echo categories::$Info->name[$languages_id] ?></strong></p>
-
- <?php if (categories::$Info->listcount> 0): ?>
-
- <?php if (categories::$Info->listcount['childs']> 0): ?>
- <h4><?php echo sprintf(__('text delete warning childs'), categories::$Info->listcount['childs']) ?></h4>
- <p><?php echo tep_draw_checkbox_field('delete_childs_in_cat',"delete_childs_in_cat", '', false).' '.__('text delete exe childs') ?></p>
- <?php endif; ?>
-
- <?php foreach(array_map('trim',explode(',',categories::$Info->datatype)) as $row) : ?>
-
- <?php if ( isset(categories::$Info->listcount[$row]) && categories::$Info->listcount[$row] > 0) : ?>
- <h4><?php echo sprintf(__('text delete warning datatypes %1$s number %2$s'), $row, categories::$Info->listcount[$row] ) ?></h4>
- <p><?php echo tep_draw_checkbox_field('delete_in_cat['.$row.']',"delete_in_cat_".$row, '', false).' '.sprintf(__('text delete datatype %s exe'), $row ) ?></p>
- <?php endif; ?>
-
- <?php endforeach; ?>
-
- <?php endif; ?>
-
-
- <div class="button_nav">
- <?php echo tep_image_submit('button_delete.gif', IMAGE_DELETE) . tep_js_back(tep_href_link(categories::FILENAME, 'cID=' . categories::$Info->id), IMAGE_CANCEL) ?>
- </div>
- </form>
- </div>
\ No newline at end of file
Deleted: trunk/catalog/admin/includes/gabarit/cms_content/display_view.new.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/cms_content/display_view.new.gab 2014-02-11 01:59:08 UTC (rev 5137)
+++ trunk/catalog/admin/includes/gabarit/cms_content/display_view.new.gab 2014-02-11 10:44:37 UTC (rev 5138)
@@ -1,36 +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 21/02/2012, 23:13
- @author oscim <mail aur...@os...> <www http://www.oscim.fr>
- @encode UTF-8
-*/
-?>
-<h3><?php print __('text new content'); ?></h3>
-<?php echo tep_draw_form('new_content', cms_content::FILENAME, 'action=insert', 'post'); ?>
- <div class="block_form">
- <div class="box_left">
- <dl>
- <dt class="block_input">
- <label for="content_type"><?php echo __('text content type'); ?></label>
- <?php echo tep_draw_pull_down_menu('content_type', tep_get_status_array('content',0,'status_name'),'' /*contents::$DiversInfo['contents_virtual_typeID']*/); ?>
- </dt>
- </dl>
- </div>
- <div class="box_right">
- <?php echo __('text info intro choose content type') ?>
- </div>
-
- <div class="button_nav">
- <?php
- echo tep_image_submit('button_preview.gif', IMAGE_ADD) .
- tep_js_back(tep_href_link(cms_content::FILENAME), IMAGE_CANCEL)
- ?>
- </div>
-
- </div>
-
-</form>
\ No newline at end of file
Deleted: trunk/catalog/admin/includes/gabarit/products/display_view.new.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/products/display_view.new.gab 2014-02-11 01:59:08 UTC (rev 5137)
+++ trunk/catalog/admin/includes/gabarit/products/display_view.new.gab 2014-02-11 10:44:37 UTC (rev 5138)
@@ -1,36 +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 21/02/2012, 23:13
- @author oscim <mail aur...@os...> <www http://www.oscim.fr>
- @encode UTF-8
-*/
-?>
-<h3><?php print __('text new product'); ?></h3>
-<?php echo tep_draw_form('new_product', products::FILENAME, 'action=insert', 'post'); ?>
- <div class="block_form">
- <div class="box_left">
- <dl>
- <dt class="block_input">
- <label for="products_virtual_type_id"><?php echo __('text products type'); ?></label>
- <?php echo tep_draw_pull_down_menu('products_virtual_type_id', tep_get_status_array('product',0,'status_name'), products::$DiversInfo['products_virtual_typeID']); ?>
- </dt>
- </dl>
- </div>
- <div class="box_right" >
- <p class="Info"><?php echo __('text info intro choose product type') ?></p>
- </div>
-
- <div class="button_nav">
- <?php
- echo tep_image_submit('button_preview.gif', IMAGE_ADD) .
- tep_js_back(tep_href_link(products::FILENAME), IMAGE_CANCEL)
- ?>
- </div>
-
- </div>
-
-</form>
\ No newline at end of file
Modified: trunk/catalog/admin/includes/modules/account/address_book.php
===================================================================
--- trunk/catalog/admin/includes/modules/account/address_book.php 2014-02-11 01:59:08 UTC (rev 5137)
+++ trunk/catalog/admin/includes/modules/account/address_book.php 2014-02-11 10:44:37 UTC (rev 5138)
@@ -209,13 +209,9 @@
*/
public function check_action($action){
- // for retro-compatibilite, NOT USE
-// if(is_array($action))
-// self::$action=$action['action'];
-// else
- self::$action=$action;
+ if(!empty($action))
+ self::$action=$action;
-
$languages = tep_get_languages();
$messageStack=messageStack::getInstance();
@@ -644,7 +640,7 @@
switch(customers::$action){
case 'inline-delete';
- $this->check_action( array('action'=>customers::$action) );
+ $this->check_action( customers::$action );
$contents[]= array('title'=> __('Adresse'),
'text'=>
@@ -654,7 +650,7 @@
case 'inline-new';
case 'inline-edit';
- $this->check_action( array('action'=>customers::$action) );
+ $this->check_action( customers::$action );
$contents[]= array('title'=> __('Adresse'),
'text'=>
Modified: trunk/catalog/admin/includes/modules/pages/customers.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/customers.php 2014-02-11 01:59:08 UTC (rev 5137)
+++ trunk/catalog/admin/includes/modules/pages/customers.php 2014-02-11 10:44:37 UTC (rev 5138)
@@ -93,8 +93,9 @@
MGabCont::SetCurrentName(__CLASS__);
//
self::$languages = tep_get_languages();
+ // Fix for clean value in unittest loop
+ self::$Info = array();
-
/**
@remarks not load if not first init
*/
Modified: trunk/catalog/admin/includes/modules/pages/products.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/products.php 2014-02-11 01:59:08 UTC (rev 5137)
+++ trunk/catalog/admin/includes/modules/pages/products.php 2014-02-11 10:44:37 UTC (rev 5138)
@@ -1333,11 +1333,7 @@
self::$Info=self::GetDBValue();
break;
- case 'new':
- $MG=false;
- break;
-
case 'noedit':
$action = 'edit';
case 'edit':
@@ -1359,12 +1355,8 @@
$action = parent::GenericDisplay($action);
}
- if( ! empty($action) ){
- if($MG)
- return MGabCont::CallGab($action,__FUNCTION__,self::MASTER);
- else
- return MGabCont::CallGab($action,__FUNCTION__,__CLASS__);
- }
+ if( ! empty($action) )
+ return MGabCont::CallGab($action,__FUNCTION__, ( ($MG)? self::MASTER : __CLASS__ ) );
}
@@ -1377,7 +1369,7 @@
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" ' );
+ $action_str_left =sprintf(CsrtAction::getLink('row_action_right', __('image view public') , 'publiclink'), '', tep_catalog_href_link('index.php', 'products_id=' . $item['id'],'SSL', true, 'forceview') ,' target="blank" ' );
if(_cst_bool('STOCK_CHECK') && tep_action_check('view', FILENAME_STOCK) )
Modified: trunk/catalog/common/classes/PasswordUtility.php
===================================================================
--- trunk/catalog/common/classes/PasswordUtility.php 2014-02-11 01:59:08 UTC (rev 5137)
+++ trunk/catalog/common/classes/PasswordUtility.php 2014-02-11 10:44:37 UTC (rev 5138)
@@ -86,5 +86,6 @@
return self::$ChildMod->encrypt_password($plain);
}
+
}
?>
Modified: trunk/catalog/install/includes/language/fr_FR/osc_status.txt
===================================================================
--- trunk/catalog/install/includes/language/fr_FR/osc_status.txt 2014-02-11 01:59:08 UTC (rev 5137)
+++ trunk/catalog/install/includes/language/fr_FR/osc_status.txt 2014-02-11 10:44:37 UTC (rev 5138)
@@ -51,7 +51,8 @@
$lg['OSC_GEO_ZONE_SHIPPING']="Livraisons" ;
/* cms content type */
-$lg['OSC_CMS_CONTENT_SIMPLE']="Simple" ;
+$lg['OSC_CMS_CONTENT_SIMPLE']="Simple page cms" ;
+$lg['OSC_CMS_CONTENT_FIXE']="Fixe (necessaire au core)" ;
/* attybute option type */
$lg['OSC_ATTRIBUTE_OPTIONTYPE_SELECT']="Select" ;
Modified: trunk/catalog/install/includes/sql/mysql/data/20_osc_status.sql
===================================================================
--- trunk/catalog/install/includes/sql/mysql/data/20_osc_status.sql 2014-02-11 01:59:08 UTC (rev 5137)
+++ trunk/catalog/install/includes/sql/mysql/data/20_osc_status.sql 2014-02-11 10:44:37 UTC (rev 5138)
@@ -54,6 +54,7 @@
INSERT IGNORE INTO osc_status (status_id, status_type, language_id, status_name, status_color) VALUES (1, 'content', 1, 'OSC_CMS_CONTENT_SIMPLE','');
+INSERT IGNORE INTO osc_status (status_id, status_type, language_id, status_name, status_color) VALUES (1, 'content', 2, 'OSC_CMS_CONTENT_FIXE','');
INSERT IGNORE INTO osc_status (status_id, status_type, language_id, status_name, status_color) VALUES (1, 'featured', 1, 'OSC_FEATURED_UNE','');
INSERT IGNORE INTO osc_status (status_id, status_type, language_id, status_name, status_color) VALUES (2, 'featured', 1, 'OSC_FEATURED_SELECTION','');
Modified: trunk/catalog/install/includes/sql/mysql/data/40_osc_content.sql
===================================================================
--- trunk/catalog/install/includes/sql/mysql/data/40_osc_content.sql 2014-02-11 01:59:08 UTC (rev 5137)
+++ trunk/catalog/install/includes/sql/mysql/data/40_osc_content.sql 2014-02-11 10:44:37 UTC (rev 5138)
@@ -12,12 +12,12 @@
--+######################################################################--+
-insert into osc_content (content_id, content_name, date_added, last_modified, content_status) values ('1', 'informationBox_shipping', NOW(), NULL, '1');
-insert into osc_content (content_id, content_name, date_added, last_modified, content_status) values ('2', 'informationBox_privacy', NOW(), NULL, '1');
-insert into osc_content (content_id, content_name, date_added, last_modified, content_status) values ('3', 'informationBox_conditions', NOW(), NULL, '1');
-insert into osc_content (content_id, content_name, date_added, last_modified, content_status) values ('4', 'Page_contact_us', NOW(), NULL, '1');
-insert into osc_content (content_id, content_name, date_added, last_modified, content_status) values ('5', 'Page_contact_us_success', NOW(), NULL, '1');
-insert into osc_content (content_id, content_name, date_added, last_modified, content_status) values ('6', 'Page_account_created_but_confirm', NOW(), NULL, '1');
-insert into osc_content (content_id, content_name, date_added, last_modified, content_status) values ('7', 'Page_account_created', NOW(), NULL, '1');
-insert into osc_content (content_id, content_name, date_added, last_modified, content_status) values ('8', 'text_search_help', NOW(), NULL, '1');
+insert into osc_content (content_id, content_type, content_name, date_added, last_modified, content_status) values ('1', 2, 'informationBox_shipping', NOW(), NULL, '1');
+insert into osc_content (content_id, content_type,content_type,content_name, date_added, last_modified, content_status) values ('2', 2, 'informationBox_privacy', NOW(), NULL, '1');
+insert into osc_content (content_id, content_type,content_name, date_added, last_modified, content_status) values ('3', 2, 'informationBox_conditions', NOW(), NULL, '1');
+insert into osc_content (content_id, content_type,content_name, date_added, last_modified, content_status) values ('4', 2, 'Page_contact_us', NOW(), NULL, '1');
+insert into osc_content (content_id, content_type,content_name, date_added, last_modified, content_status) values ('5', 2, 'Page_contact_us_success', NOW(), NULL, '1');
+insert into osc_content (content_id, content_type,content_name, date_added, last_modified, content_status) values ('6', 2, 'Page_account_created_but_confirm', NOW(), NULL, '1');
+insert into osc_content (content_id, content_type,content_name, date_added, last_modified, content_status) values ('7', 2, 'Page_account_created', NOW(), NULL, '1');
+insert into osc_content (content_id, content_type,content_name, date_added, last_modified, content_status) values ('8', 2, 'text_search_help', NOW(), NULL, '1');
Modified: trunk/catalog/install/includes/sql/mysql/tables/osc_content.sql
===================================================================
--- trunk/catalog/install/includes/sql/mysql/tables/osc_content.sql 2014-02-11 01:59:08 UTC (rev 5137)
+++ trunk/catalog/install/includes/sql/mysql/tables/osc_content.sql 2014-02-11 10:44:37 UTC (rev 5138)
@@ -15,7 +15,7 @@
drop table if exists osc_content;
create table osc_content (
content_id int(10) unsigned not null auto_increment,
- content_type varchar(64) not null DEFAULT '1',
+ content_type int(11) not null DEFAULT '1',
content_name varchar(64) not null ,
date_added datetime default '1000-01-01 00:00:00' null ,
last_modified datetime default '1000-01-01 00:00:00' null ,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2014-02-11 01:59:11
|
Revision: 5137
http://sourceforge.net/p/oscss/svn/5137
Author: oscim
Date: 2014-02-11 01:59:08 +0000 (Tue, 11 Feb 2014)
Log Message:
-----------
Fix
Modified Paths:
--------------
trunk/catalog/common/classes/PasswordUtility.php
Modified: trunk/catalog/common/classes/PasswordUtility.php
===================================================================
--- trunk/catalog/common/classes/PasswordUtility.php 2014-02-11 01:53:33 UTC (rev 5136)
+++ trunk/catalog/common/classes/PasswordUtility.php 2014-02-11 01:59:08 UTC (rev 5137)
@@ -1,877 +1,90 @@
-<?php
+<?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 30/03/2012, 09:32
- @author oscim <mail aur...@os...> <www http://www.oscim.fr>
- @encode UTF-8
- @file general.php
- @dir admin/includes/functions/
+ @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 06/12/11, 16:16
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+ @class PasswordUtility
+ @brief This class is manager call for methode in check or generate password proteced
*/
-/**
- @brief Include classes automatically when they are instantiated.
- @original-code TYPOlight Open Source CMS Copyright (C) 2005-2010 Leo Feyer
- @param string $type type module
- @return none or false
-*/
-function __autoload($strClassName) {
- // standard
- if (file_exists(DIR_FS_ADMIN.DIR_WS_CLASSES . $strClassName . '.php')) {
- include_once(DIR_FS_ADMIN.DIR_WS_CLASSES . $strClassName . '.php');
- return;
- }
- // listeners
- if (file_exists(DIR_FS_ADMIN.DIR_WS_CLASSES .'listeners/'. $strClassName . '.php')) {
- include_once(DIR_FS_ADMIN.DIR_WS_CLASSES .'listeners/'. $strClassName . '.php');
- return;
- }
- // drivers
- if (file_exists(DIR_FS_ADMIN.DIR_WS_CLASSES .'drivers/'. $strClassName . '.php')) {
- include_once(DIR_FS_ADMIN.DIR_WS_CLASSES .'drivers/'. $strClassName . '.php');
- return;
- }
- if (file_exists(DIR_FS_ADMIN.DIR_WS_CLASSES . 'osCSS_'.$strClassName . '.php')) {
- include_once(DIR_FS_ADMIN.DIR_WS_CLASSES . 'osCSS_'.$strClassName . '.php');
- return;
- }
- // Common
- if (file_exists(DIR_FS_CATALOG.DIR_WS_COMMON_CLASSES . $strClassName . '.php')) {
- include_once(DIR_FS_CATALOG.DIR_WS_COMMON_CLASSES . $strClassName . '.php');
- return;
- }
- if (file_exists(DIR_FS_CATALOG.DIR_WS_COMMON_CLASSES . 'osCSS_'.$strClassName . '.php')) {
- include_once(DIR_FS_CATALOG.DIR_WS_COMMON_CLASSES . 'osCSS_'.$strClassName . '.php');
- return;
- }
- // Exts in folder
- if (file_exists(DIR_FS_ADMIN.DIR_WS_MODULES . $strClassName . '/' . $strClassName . '.php')) {
- include_once(DIR_FS_ADMIN.DIR_WS_MODULES . $strClassName . '/' . $strClassName . '.php');
- return;
- }
- /** Nom class et path imbrique mondossier_maclass = mondossier/maclass.php
- Uniquement dans admin/includes
- */
- $strClassName=str_replace('_','/',$strClassName);
- if (file_exists(DIR_FS_ADMIN. DIR_WS_INCLUDES. dirname($strClassName) . '/' . basename($strClassName) . '.php')) {
- include_once(DIR_FS_ADMIN. DIR_WS_INCLUDES. dirname($strClassName) . '/' . basename($strClassName) . '.php');
- return basename($strClassName);
- }
+class PasswordUtility {
+ /**
+ @var path childs module
+ */
+ const PATH_CHILDS_MOD = 'modules/core/password/';
+ /**
+ @var Prefix file in childs module
+ */
+ const PREFIX_FILE_CHILDS_MOD = 'Pass_';
+ /**
+ @var ressource Id current instance
+ */
+ protected static $_instance;
+ /**
+ @var object Childs mod instance
+ */
+ protected static $ChildMod = false;
-// trigger_error(sprintf('Could not load class %s', $strClassName), E_USER_ERROR);
- return false;
-}
+ /**
+ @brief constructor
+ */
+ protected function __construct(){
+ global $conf;
-/**
- @fn tep_admin_check_login()
- @brief Verifie si user loggé, sinon renvoi sur login
- puis Verifie l'acl sur la page en cours, sinon renvoi vers forbiden
-*/
-function tep_admin_check_login() {
- global $navigation, $current_page;
- if (!tep_session_is_registered('login_id')) {
- $navigation->set_snapshot();
- tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
- }
- else {
- $acl = oscss_acl::getInstance();
+ if(self::$ChildMod !=false) return ;
- if( ! $acl->PageRight($current_page) )
- $acl->Block();
- }
-}
+ $file = self::PREFIX_FILE_CHILDS_MOD.$conf->ModPassword.'.php';
-/**
- @fn tep_action_check()
- @brief test acl groups puis utilisateur pour l'action precisé
-*/
-function tep_action_check($action, $_page) {
- $acl = oscss_acl::getInstance();
+ if(!file_exists(DIR_FS_CATALOG.DIR_WS_COMMON.self::PATH_CHILDS_MOD.$file))
+ throw new Exception('Not found file password module');
- if( ! $acl->PageRight($_page) )
- tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
- else
- return (bool)$acl->ActionRight($action,$_page) ;
-}
+ $current = $conf->ModPassword;
+ require_once(DIR_FS_CATALOG.DIR_WS_COMMON.self::PATH_CHILDS_MOD.$file);
+ self::$ChildMod = new $current();
+ }
-/**
- @author OscssTeam
- @version 1.0
- @return 'true' or 'false' value to display boxes and files in index.php
-*/
-function tep_admin_check_boxes($filename, $boxes='') {
- global $login_groups_id;
- if($login_groups_id==1)return true;
- $dbquery = tep_db_query("select admin_files_id from " . TABLE_ADMIN_FILES . " where FIND_IN_SET( '" . $login_groups_id . "', admin_groups_id) and admin_files_is_boxes = '1' and admin_files_name = '" . $filename . "'");
+ /**
+ @brief call current class
+ */
+ public static function getInstance(){
+ if(self::$_instance == null)
+ self::$_instance = new self();
- $return_value = false;
- if (tep_db_num_rows($dbquery)) {
- $return_value = true;
- }
- return $return_value;
-}
-
-
-/**
- @fn tep_redirect($url)
- @brief Redirect to another page or site
- @param $url string path
- @return none
- */
-function tep_redirect($url) {
- static $i ;
-
- if ( (strstr($url, "\n") != false) || (strstr($url, "\r") != false) ) tep_redirect(tep_href_link(FILENAME_DEFAULT, '', 'NONSSL', false));
-
- if ( (ENABLE_SSL == true) && ( getenv('HTTPS') == 'on') ) { // We are loading an SSL page
- if (substr($url, 0, strlen(HTTP_SERVER)) == HTTP_SERVER) { // NONSSL url
- $url = HTTPS_SERVER . substr($url, strlen(HTTP_SERVER)); // Change it to SSL
+ return self::$_instance;
}
- }
- // garbage collector stop
- ErrorHandlerActive::stop();
-
- // close session
- tep_session_close();
-
- // redirect
- if(! in_array(getenv('OSCSS_ENVIRONEMENT'), array('autotesting')) ){
- header('Location: ' . $url);
- exit;
- }
- else
- return ;
-}
-
-/**
- @fn tep_get_http()
- @brief retrun url server
-*/
-function tep_get_http(){
- return ( (ENABLE_SSL == true) && (getenv('HTTPS') == 'on') ) ? HTTPS_SERVER : HTTP_SERVER;
-}
-
-/**
- @fn tep_get_httpdir()
- @brief return http and base dir server
-*/
-function tep_get_httpdir(){
- return ( (ENABLE_SSL == true) && (getenv('HTTPS') == 'on') ) ? HTTPS_SERVER.DIR_WS_HTTPS_CATALOG : HTTP_SERVER.DIR_WS_HTTP_CATALOG;
-}
-
-
-/**
- * \fn tep_parse_input_field_data($data, $parse)
- * \brief Parse the data used in the html tags to ensure the tags will not break
- * @param $data
- * @param $parse
- */
-function tep_parse_input_field_data($data, $parse) {
- return strtr(trim($data), $parse);
-}
-
-/**
- @author OscssTeam
-*/
-function tep_output_string($string, $translate = false, $protected = false) {
- if ($protected == true) return htmlspecialchars($string);
- else {
- if ($translate == false) return tep_parse_input_field_data($string, array('"' => '"'));
- else return tep_parse_input_field_data($string, $translate);
- }
-}
-
-/**
- @author OscssTeam
-*/
-function tep_output_string_protected($string) {
- return tep_output_string($string, false, true);
-}
-
-/**
- @author OscssTeam
- Correction retour get ou post (secure)
-*/
-function tep_sanitize_string($string) {
- $string = preg_replace('/ +/', ' ', $string);
- return preg_replace("/[<>]/", '_', $string);
-}
-
-/**
- *\fn tep_sanitize_request($string)
- *\brief suppression et nettoyage request value (sécu)
- \param string la chaîne à nettoyer
-*/
-function tep_sanitize_request($string) {
- $string = htmlspecialchars(strip_tags($string));
- return preg_replace("#(\./|\.\./|(\<|%3C)|(\>|%3E)|(\<|%3C).*script.*(\>|%3E))*#i",'',$string);
-}
-
-/**
- @fn __($str,$prefix='',$mode=false)
- @brief convert in current langue for all string passed
- @param $str string la chaine
- @param $prefix string name of prefix in '@prefix ' for specific text
- @return string
-*/
-function __($str,$prefix='',$mode=false) {
- global $lang;
- $new_str='';
- if(!empty($prefix))
- $new_str='@'.$prefix.' '.$str;
-
- if(isset($lang[$new_str]))
- $final = $lang[$new_str];
- elseif(isset($lang[$str]))
- $final = $lang[$str];
- else
- $final = $str;
-
- return nl2br($final);
-}
-
-/**
- @author oscim - OscssTeam
- @version 1.6
- Suppression systhematqiue de la var page_admin specifique au rewriting
-*/
-function tep_get_all_get_params($exclude_array = '',$w3c=true) {
- global $_GET;
- if ($exclude_array == '') $exclude_array = array('page_admin',tep_session_name(),'error');
- else {$exclude_array[]='page_admin';$exclude_array[]=tep_session_name();$exclude_array[]='error'; }
- $get_url = '';
- reset($_GET);
- while (list($key, $value) = each($_GET))
- if (!in_array($key, $exclude_array)) $get_url .= $key . '=' . tep_sanitize_string($value) . (($w3c)?'&':'&');
-
- return $get_url;
-}
-
-/**
- @author oscim - OscssTeam
- @version 1.6
- Suppression systhematqiue de la var page_admin specifique au rewriting
-*/
-function tep_get_all_post_params($exclude_array = '') {
- global $_GET;
- if ($exclude_array == '') $exclude_array = array('page_admin',tep_session_name(),'error');
- else {$exclude_array[]='page_admin';$exclude_array[]=tep_session_name();$exclude_array[]='error'; }
- $add_post='';
- reset($_GET);
- while (list($key, $value) = each($_GET))
- if (!in_array($key, $exclude_array)) $add_post .= tep_draw_hidden_field($key, '', htmlspecialchars(stripslashes(tep_sanitize_string($value))));
-
- return $add_post;
-}
-
-
-
-
-
-/**
- @package oscss
- @author OscssTeam
- @version 2
- Réecriture des dates dans des formats correctes pour la langue
-*/
-function tep_strftime($format, $timestamp=false) {
- if (!$timestamp) $timestamp = time();
- $pattern = array(
- '%a'=>array('const'=>'NameOf_DAY_MINI','ftime'=>'%w'),
- '%A'=>array('const'=>'NameOf_DAY','ftime'=>'%w'),
- '%b'=>array('const'=>'NameOf_MONTH_MINI','ftime'=>'%m'),
- '%B'=>array('const'=>'NameOf_MONTH','ftime'=>'%m')
- );
- foreach ($pattern as $code=>$infos)
- if (preg_match("/$code/",$format) && defined($infos['const'].'_'.strftime($infos['ftime'], $timestamp)))
- $format = preg_replace("/$code/", constant($infos['const'].'_'.strftime($infos['ftime'], $timestamp)), $format);
- return strFtime($format, $timestamp);
-}
-
-
-/**
- @package oscss
- @author OscssTeam
-*/
-function tep_break_string($string, $len, $break_char = '-') {
- $l = 0;
- $output = '';
- for ($i=0, $n=strlen($string); $i<$n; $i++) {
- $char = substr($string, $i, 1);
- if ($char != ' ') $l++;
- else $l = 0;
- if ($l > $len) {
- $l = 1;
- $output .= $break_char;
+ /**
+ @brief Force reset current instance class
+ */
+ public static function resetInstance(){
+ self::$_instance = null;
+ return self::getInstance();
}
- $output .= $char;
- }
- return $output;
-}
-/**
- @fn tep_not_null($value)
- @brief test if not null, normalise control
- @param $value string
- @return boolean true ok | false not ok
-*/
-function tep_not_null($value) {
- if (is_array($value)) {
- if (sizeof($value) > 0) return true;
- else return false;
- } else {
- if ( (is_string($value) || is_int($value)) && ($value != '' && $value != '1000-01-01 00:00:00' ) && (strtolower($value) != 'null') && (strlen(trim($value)) > 0)) return true;
- else return false;
- }
-}
-/**
- @fn tep_browser_detect($component)
- @return HTTP_USER_AGENT
-*/
-function tep_browser_detect($component) {
- return stristr($_SERVER['HTTP_USER_AGENT'], $component);
-}
-
-
-
-/**
- @fn tep_round($value, $precision)
- @brief Wrapper function for round()
- @param $value valur for arround
- @param $precision int number round
-*/
-function tep_round($value, $precision) {
- return round($value, $precision);
-}
-
-/**
- @fn tep_class_exists($namespace_class)
- @brief custom class exists
- load class :: path_class_and_class_name >> include(path/class/and/class/name) et class_exists(name)
- @param string path et class name
- @return bool
-*/
-function tep_class_exists($namespace_class){
- return ( (($class=__autoload($namespace_class)) && $class !=false) && class_exists($class) )? true : false;
-}
-
-/**
- @fn tep_call_function($function, $parameter, $object = '')
- @brief call user function / class and ajust call fro PHP 5.2 vs 5.3 and up
- @note Appel de function. ou de class
-*/
-function tep_call_function($function, $parameter, $object = '') {
- if (is_string($object) && $object == '') return call_user_func($function, $parameter);
- else return call_user_func(array($object, $function), $parameter);
-}
-
-
-/**
- @fn tep_set_time_limit($limit)
- @brief Sets timeout for the current script.Cant be used in safe mode.
- @param $limit int
- @return none
-*/
-function tep_set_time_limit($limit) {
- if (!get_cfg_var('safe_mode'))
- @set_time_limit($limit);
-}
-
-/**
- @fn tep_rand($min = null, $max = null)
- @param $min int value min
- @param $max int value max
- @return value random
-*/
-function tep_rand($min = null, $max = null) {
- static $seeded;
-
- if (!$seeded) {
- mt_srand((double)microtime()*1000000);
- $seeded = true;
- }
-
- if (isset($min) && isset($max)) {
- if ($min >= $max) return $min;
- else return mt_rand($min, $max);
- } else {
- return mt_rand();
- }
-}
-
-
-/**
- @fn tep_convert_linefeeds($from, $to, $string)
- @return string
-*/
-function tep_convert_linefeeds($from, $to, $string) {
- return str_replace($from, $to, $string);
-}
-
-
-/**
- @fn tep_string_to_int($string)
- @param $string
- @return int
-*/
-function tep_string_to_int($string) {
- return (int)$string;
-}
-
-
-/**
- @fn tep_array_to_string($array, $exclude = '', $equals = '=', $separator = '&')
- @brief convert array in string , by concat all key / value
- @note use for convert array in Get param
- @param $array array
- @param $exclude array for exclude key
- @param $equals separator between key /value
- @param $separator separator for between row array
- @return string
-*/
-function tep_array_to_string($array, $exclude = '', $equals = '=', $separator = '&') {
- if (!is_array($exclude)) $exclude = array();
- $get_string = '';
- if (sizeof($array) > 0) {
- while (list($key, $value) = each($array)) {
- if ( (!in_array($key, $exclude)) ) {
- $get_string .= $key . $equals . $value . $separator;
- }
+ /**
+ @brief This funstion validates a plain text password with an encrpyted password
+ @page login.php(public)
+ */
+ public static function validate_password($plain, $encrypted){
+ self::getInstance();
+ return self::$ChildMod->validate_password($plain, $encrypted);
}
- $remove_chars = strlen($separator);
- $get_string = substr($get_string, 0, -$remove_chars);
- }
- return $get_string;
-}
-
-/**
- @brief Map global to GET variable
- @note Replication lib public
-*/
-function link_get_variable($var_name){
- if (isset($_GET[$var_name]))$GLOBALS[$var_name] =& $_GET[$var_name];
-}
-
-
-/**
- @brief Map global to POST variable
- @note Replication lib public
-*/
-function link_post_variable($var_name){
- if (isset($_POST[$var_name])) $GLOBALS[$var_name] =& $_POST[$var_name];
-}
-
-/**
- @fn _cst_bool($text)
- @brief test value specific the constant for boolean result
- @param string/boolean defini par une constante!
- @return boolean true/false
-*/
-function _cst_bool($text){
- if(!tep_not_null($text)) return false;
- $value=tep_cst_define($text);
- if( (is_string($value) && strtoupper($value)=='TRUE')||( is_bool($value) && $value==TRUE) ) return true;
- elseif( (is_string($value) && (strtoupper($value)=='FALSE')) || ( is_bool($value) && $value==FALSE) ) return false;
- return false;
-}
-
-/**
- @fn _test_bool($value)
- @brief test value for boolean result
- @param string/boolean
- @return boolean true/false
-*/
-function _test_bool($value){
- if(empty($value))
- return false;
- elseif(
- (is_string($value) && (strtoupper($value)==='TRUE' ) )
- ||( is_bool($value) && (bool)$value )
- || (is_numeric($value) && $value=1) || (preg_match('#[0-9]#', $value) && (int)$value === 1)
- )
- return true;
-
- return false;
-}
-
-/**
- @fn tep_cst_define($text)
- @brief test if constant is defined
- @note Test si une constante est defini , si celle-ci existe, renvoi sa valeur, sinon return (string)'false'
- @param $text string value for test
- @return value after test or string (false)
-*/
-function tep_cst_define($text){
- if(defined(strtoupper($text))) return constant(strtoupper($text));
- else return 'false';
-}
-
-/**
- Extraction chaine type GET en tableau
- @author oscim <mail os...@os...> <www http://www.oscim.fr>
- @param
- @a string class=www&fucntion=ddd
- @a string [null] la clef de tableau a retourner
- @return array
-*/
-function tep_extrac_querystring($query='',$search=''){
- $s=(!empty($query))?$query : $_SERVER['QUERY_STRING'];
-
- $r=explode('&',$s);
- foreach($r as $e){
- $i=strpos($e,'=');
- $f[substr($e,0,$i)]=substr($e,($i+1));
- }
- if(!empty($search) && isset($f[$search]) ) return $f[$search];
- elseif (!empty($search)) return false;
- else return $f;
-}
-
-/**
- Convertion de tableau au format json
- @param array
-*/
-function convert_json($array){
- if(function_exists('json_encode'))
- return json_encode($array);
-}
-
-
-/**
- @brief Recup info sys
-*/
-function tep_get_system_information() {
- $DB=Database::getInstance();
- $db_query = tep_db_query("select now() as datetime");
- $db = tep_db_fetch_array($db_query);
-
- list($system, $host, $kernel) = preg_split('/[\s,]+/', @exec('uname -a'), 5);
-
- return array('date' => tep_datetime_short(date('Y-m-d H:i:s')),
- 'system' => $system,
- 'kernel' => $kernel,
- 'host' => $host,
- 'ip' => gethostbyname($host),
- 'uptime' => @exec('uptime'),
- 'http_server' => @$_SERVER['SERVER_SOFTWARE'],
- 'php' => PHP_VERSION,
- 'zend' => (function_exists('zend_version') ? zend_version() : ''),
- 'db_server' => DB_SERVER,
- 'db_ip' => gethostbyname(DB_SERVER),
- 'db_connector' => DB_CONNECTOR ,
- 'db_version' => $DB->server_info(),
- 'db_date' => tep_datetime_short($db['datetime']));
-}
-
-/**
- @fn get_info_core($file,$name='svn')
- @brief Recuperation des element de svn basé sur le fichier oscss.version.xml
- @param $file path acces file
- @param $name string le tag qui doit être retourné (all for return all tags)
-*/
-function get_info_core($file,$name='svn'){
- if(!file_exists($file)) return die(__('Erreur récuperation fichier'));
- $SimpleParser = simplexml_load_file($file);
-
- if($name=='all')
- return $SimpleParser;
- elseif(!isset($SimpleParser->$name))
- die(__('Erreur récuperation tag '.$name)) ;
- else
- return (string)$SimpleParser->$name;
-}
-
-/**
- @brief array map for tep_menu or detail status if id
- @param $type string key col status
- @param $id int if is > 0 return array specific this id
- @param $orderby string name col for order by
- @param $sort string ASC/DESC sort result
- @return array for tep_tab_menu if $id=0
- Or array specific id if key + id exists
-*/
-function tep_get_status_array($type='orders', $id=0, $orderby='status_id', $sort='ASC'){
- global $languages_id;
- $loop = array();
- $list = array();
- $all = sqlstatus::fetch(array(
- 'type'=>$type,
- 'language_id'=>(int)$languages_id,
- 'status'=>1,
- ),
- true
- );
- if(!$all)
- return false;
-
- if(is_object($all))
- $loop[] = $all;
- else
- $loop = $all;
-
- foreach($loop as $status)
- if($id > 0 && (int)$id == $status->id)
- return array('id' => $status->id, 'text' => $status->name);
- else $list[] = array('id' => $status->id , 'text' => $status->name);
-
- if($id > 0)
- return false;
- else
- return $list;
-}
-
-
-/**
- @package oscss
- @author OscssTeam
-*/
-function tep_tax_classes_pull_down($parameters, $selected = '') {
- $select_string = '<select ' . $parameters . '>';
- $classes_query = tep_db_query("select tax_class_id, tax_class_title from " . TABLE_TAX_CLASS . " order by tax_class_title");
- while ($classes = tep_db_fetch_array($classes_query)) {
- $select_string .= '<option value="' . $classes['tax_class_id'] . '"';
- if ($selected == $classes['tax_class_id']) $select_string .= ' selected="selected"';
- $select_string .= '>' . $classes['tax_class_title'] . '</option>';
- }
- $select_string .= '</select>';
-
- return $select_string;
-}
-
-/**
-Returns the tax rate for a tax class
- @package oscss-Rv
- @author oscim - OscssTeam
- @table tax_rates
-*/
-function tep_get_tax_rate_value($class_id) {
- $tax_query = tep_db_query("select tax_rate, tax_zone_id from " . TABLE_TAX_RATES . " where tax_class_id = '" . (int)$class_id . "' order by tax_priority");
- if (tep_db_num_rows($tax_query)) {
- $tax_table = array('tax_zone_id' => '0', 'tax_rate' => '0');
- while ($tax = tep_db_fetch_array($tax_query)) {
- if ($tax_table['tax_zone_id'] == '0'){
- $tax_table['tax_zone_id'] = $tax['tax_zone_id'];
- $tax_table['tax_rate'] = $tax['tax_rate'];
- }elseif ($tax_table['tax_zone_id'] == $tax['tax_zone_id']) $tax_table['tax_rate'] += $tax['tax_rate'];
+ /**
+ @brief This function makes a new password from a plaintext password.
+ @page create_account.php|password_forgotent.php(public)
+ */
+ public static function encrypt_password($plain){
+ self::getInstance();
+ return self::$ChildMod->encrypt_password($plain);
}
- return $tax_table['tax_rate'];
- }
- else return 0;
-}
-
-
-
-/**
- @fn status_name($type , $status_id, $language_id = '')
- @brief public methode return name human
- @param type status string
- @param $status_id int
- @param $language_id int
- @return array
-*/
-function status_name($type , $status_id, $language_id = '') {
- global $languages_id;
-
- if (!is_numeric($language_id)) $language_id = $languages_id;
-
- $status_query = tep_db_query("select status_name from " . TABLE_STATUS . " where status_type='".$type."' AND status_id = '" . $status_id . "' and language_id = '" . $language_id . "'");
- $status = tep_db_fetch_array($status_query);
-
- return $status['status_name'];
}
-/**
- Alias
-*/
-function tep_get_orders_status_name($orders_status_id, $language_id = '') {
- return status_name('orders',$orders_status_id, $language_id);
-}
-
-
-
-/**
- list templates directorys
- @package oscss
- @author OscssTeam
-*/
-function oscss_list_templates_admin() {
- $dir = dir(DIR_FS_ADMIN . DIR_WS_INCLUDES . 'template/');
- $themes_array = array();
- while ($file = $dir->read())
- if($file != '..' && $file !='.' && $file !='' && file_exists(DIR_FS_ADMIN . DIR_WS_INCLUDES . 'template/'.$file.'/gabarit-' . $_SESSION['login_groups_id'] . '.php'))
- $themes_array[] = array( 'id' => $file, 'text' => $file );
- $dir->close();
- return $themes_array;
-}
-
-/**
- list templates directorys
- @package oscss
- @author OscssTeam
-*/
-function oscss_check_url($url) {
- return preg_match("%^http://[_A-Z0-9-]+\.[_A-Z0-9-]+[.A-Z0-9-]*(/~|/?)[/_.A-Z0-9#?&=+-]*$%i",$url);
-}
-
-/**
- @package SEOURLs
- @author OscssTeam
- @version 2.1
- @note Function to reset SEO URLs database cache entries
-*/
-function tep_reset_cache_data_seo_urls($action){
- switch ($action){
- case 'reset':
- tep_db_query("DELETE FROM " . TABLE_SEO_CACHE . " WHERE cache_name LIKE '%seo_urls%'");
- tep_db_query("UPDATE ".TABLE_CONFIGURATION." SET configuration_value='false' WHERE configuration_key='SEO_URLS_CACHE_RESET'");
- break;
- default:
- }
- # The return value is used to set the value upon viewing
- # It's NOT returining a false to indicate failure!!
- return 'false';
-}
-
-/**
- @fn DataForceStatus($clause)
- @brief this function force status on datatype Required for admin view off data
- @note use in sql Requete, next clause where and prev other clause
- @param $clause string clause normal control status ( c.status='1' AND )
- @return normal clause status or empty string
-*/
-function DataForceStatus($clause){
- global $SecuKey;
- if ( ( !empty($SecuKey) && (strlen($SecuKey)==40) && isset($_GET['forceview']) && (string)$_GET['forceview'] ==md5($SecuKey)) )
- return '';
- else
- return ' '.$clause.' ';
-}
-
-/**
- @fn tep_cst_menu_conf($cst)
- Control la présence d'une constante de langue en remplacement de l'intitulé des menu de l'admin. Si cette constante n'est pas défini, une alerte est produite
- ne préciser que le contenu de la colonne key
-*/
-function tep_cst_menu_conf($cst){
- if (defined(strtoupper($cst))) return @constant(strtoupper($cst));
- elseif (defined('BOX_HEADING_CONF_'.strtoupper($cst))) return @constant('BOX_HEADING_CONF_'.strtoupper($cst));
- else return '<span class="error">'.'Erreur:: constante absente, nommé (BOX_HEADING_CONF_'.strtoupper($cst).') dans votre fichier de langue principal et ('.strtoupper($cst).') représente la key de la table sql'.'</span>';
-}
-
-
-/**
- Fonctions remplacé par des class
- => Retrocompatibilité
-*/
-function ajax_in_Sats($cl=''){
- if(!class_exists('ajax_in_Sats'))require_once(DIR_WS_MODULES.'pages/'.'graphs_stats'.'.php');
- return graphs_stats::ajax_in_Sats($cl);
-}
-
-
-
-
-
-function tep_get_file_permissions($mode) { return fileUtility::get_file_permissions($mode);}
-function tep_remove($source) { return fileUtility::_rmdir($source); }
-function bu_gzip($directory, $file_in, $ext='zip',$delete_file = false, $level = 6) { return fileUtility::compress_dir($directory, $file_in, $ext, $delete_file , $level); }
-function tep_zip_extractto($archive, $destination, $ext='zip') { return fileUtility::extractto($archive, $destination, $ext );}
-function scan($strFolder) { return fileUtility::_scandir($strFolder); }
-
-
-
-function tep_customers_name($customers_id) { return customerUtility::customers_name($customers_id); }
-function tep_get_address_formats() { return customerUtility::get_address_formats(); }
-function tep_address_format($address_format_id, $address, $html, $boln, $eoln) { return customerUtility::address_format($address_format_id, $address, $html, $boln, $eoln); }
-
-function tep_get_zone_code($country, $zone, $def_state) { return worldUtility::get_zone_code($country, $zone, $def_state); }
-function tep_get_countries($default = '', $exclude=array()) { return worldUtility::get_countries($default, $exclude); }
-function tep_get_country_zones($country_id) { return worldUtility::get_country_zones($country_id); }
-function tep_get_zone_class_title($zone_class_id){return worldUtility::get_zone_class_title($zone_class_id); }
-function tep_cfg_pull_down_zone_classes($zone_class_id, $key = '', $type='1'){return worldUtility::cfg_pull_down_zone_classes($zone_class_id, $key, $type); }
-function tep_cfg_pull_down_zone_shipping($zone_class_id, $key = ''){ return worldUtility::cfg_pull_down_zone_classes($zone_class_id, $key , '2'); }
-function tep_get_country_name($country_id){ return worldUtility::get_country_name($country_id); }
-function tep_geo_zones_pull_down($parameters, $selected = ''){ return worldUtility::geo_zones_pull_down($parameters, $selected ,1); }
-function tep_get_geo_zone_name($geo_zone_id){ return worldUtility::get_geo_zone_name($geo_zone_id); }
-
-function tep_get_languages($byindex=false, $public=true) { return language::get_languages($byindex, $public); }
-
-function get_cat_list($current_ID='',$incre=false){ return categorieUtility::get_cat_list(array('root'=>$current_ID,'incre'=>$incre)); }
-function tep_childs_in_category_count($categories_id) { return categorieUtility::childs_in_category_count($categories_id); }
-function tep_get_generated_category_path_ids($id, $from = 'category') { return categorieUtility::get_generated_category_path_ids($id, $from); }
-function tep_parse_category_path($cPath) { return categorieUtility::parse_category_path($cPath); }
-function tep_get_category_name($category_id, $language_id='') { return categorieUtility::get_category_name($category_id, $language_id); }
-function tep_generate_category_path($id, $from = 'category', $categories_array = '', $index = 0) { return categorieUtility::generate_category_path($id, $from, $categories_array, $index); }
-function tep_get_category_tree($parent_id = '0', $spacing = '', $exclude = '', $category_tree_array = '', $include_itself = false) {
- return categorieUtility::get_category_tree( array( 'parent_id'=> $parent_id, 'spacing'=> $spacing, 'exclude'=> $exclude, 'category_tree_array'=> $category_tree_array, 'include_itself'=> $include_itself ));
-}
-
-function tep_get_products_special_price($product_id) { return productUtility::get_products_special_price($product_id); }
-function tep_get_uprid($prid, $params) { return productUtility::get_uprid($prid, $params); }
-function tep_get_prid($uprid) { return productUtility::get_prid($uprid); }
-function tep_get_prid_array($uprid) { return productUtility::get_prid_array($uprid); }
-function tep_get_products_name($product_id, $language_id = 0) { return productUtility::get_products_name($product_id, $language_id); }
-function tep_products_restock($order_id, $customers_id=''){ return productUtility::products_restock($order_id, $customers_id); }
-function tep_get_product_list($exclude = ''){ return productUtility::get_product_list($exclude); }
-function tep_options_name($options_id) { return productUtility::options_name($options_id); }
-function tep_values_name($values_id) { return productUtility::values_name($values_id); }
-function tep_get_product_extra_value($epf_id, $product_id, $language_id) { return productUtility::get_product_extra_value($epf_id, $product_id, $language_id); }
-function tep_list_epf_children($parent_id) { return productUtility::list_epf_children($parent_id); }
-
-
-function tep_get_tax_rate($class_id, $country_id = -1, $zone_id = -1) { global $price; return $price->get_tax_rate($class_id, $country_id, $zone_id); }
-function tep_get_tax_description($class_id, $country_id, $zone_id) { global $price; return $price->get_tax_description($class_id, $country_id, $zone_id); }
-function tep_add_tax($products_price, $tax, $force=false, $strict=true) { global $price; return $price->display_with_tax($products_price, $tax, $force, $strict); }
-function tep_calculate_tax($products_price, $tax,$strict=false) { global $price; return $price->get_tax_amount($products_price, $tax,$strict=false); }
-function tep_display_tax_value($value, $padding = TAX_DECIMAL_PLACES) { global $price; return $price->display_tax_value($value, $padding); }
-function tep_get_tax_class_title($tax_class_id) { global $price; return $price->tep_get_tax_class_title($tax_class_id); }
-
-function qtpro_doctor_investigate_product($products_id){ return qtproUtility::doctor_investigate_product($products_id);}
-function qtpro_product_has_tracked_options($products_id){ return qtproUtility::product_has_tracked_options($products_id);}
-function qtpro_get_products_summary_stock($products_id){ return qtproUtility::get_products_summary_stock($products_id);}
-function qtpro_doctor_amputate_all_from_product($products_id){ return qtproUtility::doctor_amputate_all_from_product($products_id);}
-function qtpro_products_attributes_string2options_array($products_attributes_string){ return qtproUtility::products_attributes_string2options_array($products_attributes_string);}
-function qtpro_update_summary_stock($products_id){ return qtproUtility::update_summary_stock($products_id);}
-function qtpro_calculate_summary_stock($products_id){ return qtproUtility::calculate_summary_stock($products_id);}
-
-function tep_create_rma_value($length, $type = 'digits') {return ReturnsUtility::CreateReturnsKey($length, $type) ;}
-function tep_calculate_deduct($price, $tax){return ReturnsUtility::CalculateDeduct($price, $tax); }
-function tep_get_return_reason(){return ReturnsUtility::list_return_reasons();}
-function tep_get_returns_status(){return ReturnsUtility::list_returns_status();}
-function tep_get_refund_method(){return ReturnsUtility::list_refund_method();}
-function tep_remove_return($order_id, $restock = false){return ReturnsUtility::RemoveReturns($order_id, $restock);}
-function tep_get_return_reason_name($return_reason_id, $language_id = ''){return ReturnsUtility::status_name('return_reasons' , $return_reason_id, $language_id) ;}
-function tep_get_returns_status_name($returns_status_id, $language_id = ''){return ReturnsUtility::status_name('returns' ,$returns_status_id, $language_id);}
-function tep_get_refund_method_name($refund_method_id, $language_id = ''){return ReturnsUtility::status_name('refund_method' ,$refund_method_id, $language_id) ;}
-
-function tep_mail($to_name, $to_email_address, $email_subject, $email_text, $from_email_name='', $from_email_address='') { return emailUtility::tep_mail($to_name, $to_email_address, $email_subject, $email_text, $from_email_name, $from_email_address);}
-function tep_replace_for_mail($txt_mail,$subject,$html_reg,$text_reg,$mode='HTML') { return emailUtility::replace_for_mail($txt_mail,$subject,$html_reg,$text_reg,$mode);}
-function tep_post_prepare_email($template,$language,$myarray,$print=false) { return emailUtility::post_prepare_email($template,$language,$myarray,$print);}
-function tep_recup_template_mail() { return emailUtility::recup_template_mail();}
-
-function quote_oanda_currency($code, $base = DEFAULT_CURRENCY) {return localizationUtility::oanda_currency($code, $base);}
-function quote_xe_currency($to, $from = DEFAULT_CURRENCY){return localizationUtility::xe_currency($to, $from);}
-
-
-function tep_date_long($raw_date) { return datetimeUtility::date_long($raw_date); }
-function tep_date_short($raw_date){ return datetimeUtility::date_short($raw_date); }
-function tep_datetime_short($raw_datetime) { return datetimeUtility::datetime_short($raw_datetime); }
-
-
-/**
- @fn alias oscss_cstr::test_gab_theme($element,$ext='php')
- @brief load Template Environement
- @return (bool)false OR string path file
-*/
-function tep_test_gab_ele($element,$ext='php'){ return oscss_cstr::test_gab_theme($element,$ext); }
-
-/** @fn alias MGabCont::CallGab($filename); */
-function tep_get_include_contents($filename) { return MGabCont::CallGab($filename); }
-?>
\ 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-11 01:53:36
|
Revision: 5136
http://sourceforge.net/p/oscss/svn/5136
Author: oscim
Date: 2014-02-11 01:53:33 +0000 (Tue, 11 Feb 2014)
Log Message:
-----------
Fix
Modified Paths:
--------------
trunk/catalog/admin/includes/classes/MLinkTo.php
trunk/catalog/admin/includes/classes/ModTreePage.php
trunk/catalog/admin/includes/classes/SqlFilesDataDriverClass.php
trunk/catalog/admin/includes/classes/drivers/sqlorder.php
trunk/catalog/admin/includes/functions/general.php
trunk/catalog/admin/includes/modules/pages/newslettersModeles.php
trunk/catalog/admin/includes/modules/pages/orders.php
trunk/catalog/admin/includes/modules/pages/services.php
trunk/catalog/admin/includes/widget/orderLastinvoice.php
trunk/catalog/common/classes/PasswordUtility.php
Modified: trunk/catalog/admin/includes/classes/MLinkTo.php
===================================================================
--- trunk/catalog/admin/includes/classes/MLinkTo.php 2014-02-11 00:04:28 UTC (rev 5135)
+++ trunk/catalog/admin/includes/classes/MLinkTo.php 2014-02-11 01:53:33 UTC (rev 5136)
@@ -330,7 +330,7 @@
@return boolean false KO Or int id > 0 OK
*/
private static function LinkUpdate($support,$opt){
- return self::LinkCreate($opt);
+ return self::LinkCreate($support,$opt);
}
/**
Modified: trunk/catalog/admin/includes/classes/ModTreePage.php
===================================================================
--- trunk/catalog/admin/includes/classes/ModTreePage.php 2014-02-11 00:04:28 UTC (rev 5135)
+++ trunk/catalog/admin/includes/classes/ModTreePage.php 2014-02-11 01:53:33 UTC (rev 5136)
@@ -70,6 +70,37 @@
);
}
+ /**
+ @fn GenericAction()
+ */
+ public static function GenericGetDbValue($action, $blokRedirect=false, $params=array() ){
+ global $messageStack, $languages_id, $Cfg;
+
+ $class=self::GetClassName();
+ $sqlclass='sql'.self::GetClassDatatype();
+
+// $list_interface = class_implements($class);
+
+ switch ($class::$action) {
+
+ case 'delete':
+ case 'edit':
+ case 'new':
+ if( (int)$class::$Id > 0) {
+ $obj = $sqlclass::fetch(array('id'=>$class::$Id , 'language_id'=>$languages_id), true);
+ }
+ else{
+ $obj = $sqlclass::Specimen(true);
+ }
+
+ $obj = $class::FormatDBValue($obj);
+
+ return $obj;
+ break;
+
+ default:
+ }
+ }
/**
@fn GenericAction()
Modified: trunk/catalog/admin/includes/classes/SqlFilesDataDriverClass.php
===================================================================
--- trunk/catalog/admin/includes/classes/SqlFilesDataDriverClass.php 2014-02-11 00:04:28 UTC (rev 5135)
+++ trunk/catalog/admin/includes/classes/SqlFilesDataDriverClass.php 2014-02-11 01:53:33 UTC (rev 5136)
@@ -130,8 +130,10 @@
if(!is_array($specimen) && !is_object($specimen) )
return $sqlarray;
+
foreach($specimen as $key=>$item){
- if($key != self::$DataDriverType.'_id')
+
+ if(!in_array($key ,array( self::$DataDriverType.'_id', 'id') ) )
if( (is_int($item) /*|| is_bool($specimen[$key])*/) && isset($data[$key]))
$sqlarray[$key] = (!empty($data[$key]) ? tep_db_prepare_input((int)$data[$key]) : $item);
elseif(is_string($item)){
@@ -139,7 +141,7 @@
// and possible delete by checkbox
if($key == self::$DataDriverType.'_image'){
$img = array();
-
+
if (isset($data[$key.'_checkbox']) && is_array($data[$key.'_checkbox']) )
foreach((array)$data[$key.'_checkbox'] as $row)
$img[] = (preg_match('#[0-9]*#',$row)? (int)$row: (string)self::AddImage($row) );
@@ -161,6 +163,9 @@
}
$sqlarray[$key]=implode('|', $list_img);
}
+ elseif ( !isset($data[$key.'_checkbox']) || !is_array($data[$key.'_checkbox']) )
+ $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';
@@ -201,9 +206,10 @@
elseif( (int)$row > 0)
$list_img[] = $row;
}
-
- $sqlarray[$tmpkey]=implode('|', $list_img);
+ $sqlarray[$tmpkey]=implode('|', $list_img);
}
+ elseif (!isset($data[$tmpkey.'_checkbox']) || !is_array($data[$tmpkey.'_checkbox']) )
+ $sqlarray[$tmpkey]='';
}
else
foreach($item as $k=>$row){
@@ -216,6 +222,7 @@
}
}
+
return $sqlarray;
}
Modified: trunk/catalog/admin/includes/classes/drivers/sqlorder.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlorder.php 2014-02-11 00:04:28 UTC (rev 5135)
+++ trunk/catalog/admin/includes/classes/drivers/sqlorder.php 2014-02-11 01:53:33 UTC (rev 5136)
@@ -11,7 +11,11 @@
*/
+
+require_once( DIR_FS_ADMIN . DIR_WS_CLASSES . 'SqlFilesDataDriverClass.php');
+
class sqlorder
+ extends SqlFilesDataDriverClass
implements ModSqlDataDriver{
/**
@var object childs module class
@@ -373,6 +377,8 @@
$ID = $option['id'];
}
+ error_reporting(E_ALL);
+// exit;
// if( ! isset($option['language_id']) )
// self::$error = __('no language_id');
// else
Modified: trunk/catalog/admin/includes/functions/general.php
===================================================================
--- trunk/catalog/admin/includes/functions/general.php 2014-02-11 00:04:28 UTC (rev 5135)
+++ trunk/catalog/admin/includes/functions/general.php 2014-02-11 01:53:33 UTC (rev 5136)
@@ -78,8 +78,7 @@
}
else {
$acl = oscss_acl::getInstance();
- var_dump($current_page);
- exit;
+
if( ! $acl->PageRight($current_page) )
$acl->Block();
}
@@ -135,8 +134,6 @@
}
- if ( preg_match("#".FILENAME_LOGIN."#i", $url) ){
-
// garbage collector stop
ErrorHandlerActive::stop();
@@ -148,7 +145,6 @@
header('Location: ' . $url);
exit;
}
- }
else
return ;
}
Modified: trunk/catalog/admin/includes/modules/pages/newslettersModeles.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/newslettersModeles.php 2014-02-11 00:04:28 UTC (rev 5135)
+++ trunk/catalog/admin/includes/modules/pages/newslettersModeles.php 2014-02-11 01:53:33 UTC (rev 5136)
@@ -10,13 +10,13 @@
@dir admin/includes/modules/pages/
*/
-require_once(DIR_FS_ADMIN . DIR_WS_CLASSES .'ModTwo.php');
+require_once(DIR_FS_ADMIN . DIR_WS_CLASSES .'ModTreePage.php');
/**
@class newslettersModeles
*/
class newslettersModeles
- extends ModTwo /// new abstract class for nextgen module
+ extends ModTreePage /// new abstract class for nextgen module
implements
ExtModPage,
InterfacedTJsonS,
@@ -53,22 +53,27 @@
global $languages_id;
self::$code=__CLASS__;
+ self::$datatype='newsletters_modeles';
self::$action=(isset($_REQUEST['action'])? $_REQUEST['action'] : 'listing' );
self::$Id=(isset($_REQUEST['cID'])? (int)$_REQUEST['cID'] : 0 );
+ // aca
+ self::$modules=new AcaFactory(__CLASS__);
+ // Event
+ EventsHandlerActive::ActiveForClass(__CLASS__);
+ //
+ MGabCont::SetCurrentName(__CLASS__);
+
/**
@remarks not load if not first init
*/
if(!defined('JSONSTATMENT')) {
-
//! active datatable in ajax, precise les GET necessaire
define('JSONSTATMENT', 'ModTwo=true&mod=page&type='.self::$code);
//! detail item in ajax
define('AJAXSTATMENTDETAIL', 'mod=page&type='.self::$code);
-
-
}
$list_lg = array();
@@ -218,7 +223,15 @@
*/
$boutons = array();
-
+ $boutons['listing'][]=array(
+ 'type'=>'getLink',
+ 'format'=>'button_nav',
+ 'image'=>'',
+ 'cssclass'=>'',
+ 'title'=>__('image create new data', __CLASS__),
+ 'url'=>tep_href_link(self::FILENAME, 'action=new'),
+ );
+
/**
Call Base Init and construct $InitInfo for process Filter
$listfield string list row in db
@@ -235,80 +248,23 @@
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;
- case 'update_cell':
- try {
-
- $modele = array_keys(sqlnewsletters_modeles::Specimen());
- $params = array();
- $params['id'] = $_REQUEST['id'];
-
- if( in_array($_REQUEST['columnName'], $modele) )
- $params['sqlarray'] = array(
- $_REQUEST['columnName'] => (isset($_REQUEST['value']) ? tep_db_prepare_input($_REQUEST['value']) : 0)
- );
- else{
- $tab = explode('[', $_REQUEST['columnName']);
- $final = $tabs2 = array();
- foreach($tab as $row)
- $tabs2[] = ( (substr($row,-1)==']')?substr($row,0,-1) : $row );
-
- $tabs3 = array_reverse($tabs2);
- $max = count($tabs2);
- $i=0;
- foreach($tabs3 as $row){
- $i++;
- if($i==1) $final[$row] = (isset($_REQUEST['value']) ? tep_db_prepare_input($_REQUEST['value']) : 0);
- else
- $final[$row] = $final;
- }
-
- $params['post'] = $final;
- }
-
- $params['action']=self::$action;
-
- $params['language_id']= $languages_id;
-
- if( sqlnewsletters_modeles::update( $params ) != 1 )
- throw new Exception(__('@newslettersmodeles error in update process')) ;
-
- $messageStack->add_session(__('@newslettersmodeles success in update process'), 'success');
-
- // display value for return
- echo $_REQUEST['value'];
- }
- catch (Exception $e) {
-
- $messageStack->add_session($e->getMessage() , 'error');
- }
- break;
case 'setflag':
if ( ($_GET['flag'] == '0') || ($_GET['flag'] == '1') ) {
- $newsletter_id = tep_db_prepare_input($_GET['cID']);
-
- if (!empty($newsletter_id))
- sqlnewsletters_modeles::update(array('id'=> (int)$newsletter_id , 'post'=>array('status'=>(int) $_GET['flag'] )));
+ if (self::$Id > 0)
+ sqlnewsletters_modeles::update(array('id'=> (int)self::$Id , 'post'=>array('status'=>(int) $_GET['flag'] )));
}
$messageStack->add(__('@newslettersModeles update status'), 'success');
if(!isset($_GET['forceajax']))
- tep_redirect(tep_href_link(self::FILENAME, 'cID=' . $_GET['cID']));
+ tep_redirect(tep_href_link(self::FILENAME, 'cID=' .self::$Id));
break;
/**
@@ -316,7 +272,7 @@
*/
case 'insert':
case 'update':
- if (isset($_POST['newsletter_id'])) $newsletter_id = tep_db_prepare_input($_POST['newsletter_id']);
+ $newsletter_id = self::$Id;
$newsletter_module = tep_db_prepare_input($_POST['module']);
$title = tep_db_prepare_input($_POST['title']);
@@ -351,35 +307,17 @@
}
break;
- case 'deleteconfirm':
- $newsletter_id = tep_db_prepare_input($_GET['cID']);
- if( ! sqlnewsletters_modeles::delete(array('id'=>$newsletter_id)) )
- $messageStack->add(__('@newslettersModeles error in process delete'), 'error');
- else
- $messageStack->add(__('@newslettersModeles update status'), 'success');
- tep_redirect(tep_href_link(self::FILENAME));
- break;
+ default:
+ parent::GenericAction();
+ }
- case 'edit':
- case 'new':
- //! init wisywyg
- $oscss->_add_ext(BO_WISIWYG_SELECTED,'editeur/');
- echo $oscss->_call(BO_WISIWYG_SELECTED,'_top','content','600','400');
-
- break;
-
- }
-
return self::$action;
}
- public function get_header(){
- }
-
/**
@fn featured::GetDBValue();
@brief return DB value adapted for current action
@@ -467,7 +405,7 @@
global $language;
$action=self::$action;
-
+ $MG = true;
switch ($action) {
/**
@remarks Ajax View result
@@ -479,74 +417,32 @@
/**
@remarks Normal View Page
*/
- case 'delete':
- self::$Id=(int)$_GET['cID'];
- break;
- case 'insert':
- case 'update':
- $action='edit';
- break;
- case 'new':
- case 'edit':
- if(self::$Id > 0){
- self::$Info=self::GetDBValue(self::$Id);
- }
- $action='edit';
- break;
case 'preview':
self::$Info=self::GetDBValue(self::$Id);
break;
default:
- self::tep_get_list();
- $action='listing';
-
- /// use master gabarit
- MGabCont::SetCurrentName(__CLASS__);
- return MGabCont::CallGab('listing',__FUNCTION__,self::MASTER);
+ $action = parent::GenericDisplay($action);
}
- /// use master gabarit
- return MGabCont::CallGab($action,__FUNCTION__,__CLASS__);
- }
+ if( ! empty($action) )
+ return MGabCont::CallGab($action,__FUNCTION__, (($MG)?self::MASTER : __CLASS__) );
- /** public static InterfacedTJsonS */
-
- public static function ButtonRowsActions($array){
- return sprintf(
- CsrtAction::getFormat('row_action'),
- '',
- sprintf(CsrtAction::getLink('row_action_right', ICON_PREVIEW, 'preview'), '', tep_href_link(self::FILENAME, 'cID=' . $array['id']. '&action=preview') ,'' ).
- sprintf(CsrtAction::getLink('row_action_right', IMAGE_EDIT, 'edit'), '', tep_href_link(self::FILENAME, 'cID=' . $array['id']. '&action=edit') ,'' ).
- sprintf(CsrtAction::getLink('row_action_right', IMAGE_DELETE, 'delete'), 'fancy', tep_href_link(self::FILENAME, 'cID=' . $array['id'] . '&action=delete') ,'' )
- );
}
- public static function RowStatus($newslettersModeles){
- $exclude=array('action','cID','forceajax','type','class','function','funct', 'mod');
- $query_s='action=setflag&cID=' . $newslettersModeles['id'].'&flag=';
-
- return '<a class="ajaxinline" href="' . tep_href_link(self::FILENAME, tep_get_all_get_params($exclude).$query_s.(($newslettersModeles['status'] == '1')? '0' : '1') ) . '">'.
- sprintf(
- CsrtAction::getFormat('row_flag'),
- (int)$newslettersModeles['status'],
- ( ($newslettersModeles['status'] == '1')? IMAGE_ICON_STATUS_GREEN : IMAGE_ICON_STATUS_RED)
- ).
- '</a>';
+ public static function ButtonRowsActions($item){
+ return parent::GenericRowsActions($item, 'ped', $action_str_left, $action_str);
}
-
/** static InterfacedInnerHtml */
public static function detail_row_page($id){
global $language;
self::$Id=(int)$id;
-// self::$Info=self::GetDBValue((int)$id);
-// self::load_module();
return MGabCont::CallGab('inline','display_view',__CLASS__);
}
@@ -575,13 +471,10 @@
// $item[1]=tep_draw_checkbox_field('action_multi['.$item['id'].']','action_mutli_'.$item['id'],$item['id'],false, '','class="multi"');
-
+ $item[0]=$item['id'];
foreach(self::$InitInfo['modele']['listing'] as $k=>$row){
-
-
- if($k == 'action') $ord[$k]=self::ButtonRowsActions($item);
- elseif($k == 'status') $ord[$k]=self::RowStatus($item);
- elseif(in_array($k , array('added', 'modified' ,'available')) ) $ord[$k]=( (strlen($item[$k])==19 && !in_array($item[$k] ,array('1000-01-01 00:00:00', '0000-00-00 00:00:00' )) )? tep_date_short($item[$k]) : '' );
+ if( ($value = self::FormatDBValueRow($k, $item)) && $value !=false )
+ $ord[$k]= $value;
elseif($k == 'languages_id'){
foreach ($lg as $row_lg) {
if($item[$k] == $row_lg['id']) $ord[$k]= tep_language_image( $row_lg['directory'] . '/images/' . $row_lg['image'], $row_lg['name']) /*. ' '.$row_lg['name']*/;
@@ -589,7 +482,7 @@
}
else $ord[$k]=$item[$k];
}
- $ord[0]=$item['id'];
+
@@ -597,34 +490,9 @@
}
break;
- case 'detail':
- case 'new':
- case 'delete':
- case 'noedit':
- case 'edit':
- case 'copy_to':
default:
- global $languages_id;
+ $res = parent::FormatDBValueDefault($_query);
- $ord =array();
-
- if(is_object($_query)){
- $res = new stdClass;
- foreach($_query as $key=>$row) {
- switch($key){
- default:
-
- if( ($new_r = self::GetEditFieldsDefine($key) ) && $new_r !=false ){
- $new_r['input_value'] = $row;
- $edit = 'edit_'.$key;
- $res->$edit = new objectInfo($new_r);
- }
-
- $res->$key = $row;
- }
- }
- }
-
}
return $res;
Modified: trunk/catalog/admin/includes/modules/pages/orders.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/orders.php 2014-02-11 00:04:28 UTC (rev 5135)
+++ trunk/catalog/admin/includes/modules/pages/orders.php 2014-02-11 01:53:33 UTC (rev 5136)
@@ -13,6 +13,7 @@
require_once(DIR_FS_ADMIN . DIR_WS_CLASSES .'ModTreePage.php');
require_once(DIR_FS_ADMIN . DIR_WS_CLASSES .'listeners/EventMessListener.php');
+require_once(DIR_FS_ADMIN . DIR_WS_CLASSES .'listeners/EventNotificationListener.php');
/**
@@ -29,6 +30,7 @@
// Events Interface for display and exec all notification
, EventMessInterface
+ , EventNotificationInterface
{
/**
@@ -112,10 +114,13 @@
$status=(isset($_REQUEST['status'])? (string)$_REQUEST['status'] : '' );
+ // aca
self::$modules=new AcaFactory(__CLASS__);
-
+ // Event
+ EventsHandlerActive::ActiveForClass(__CLASS__);
+ //
MGabCont::SetCurrentName(__CLASS__);
-
+ //
self::$export= new export(__CLASS__);
/**
@@ -484,7 +489,6 @@
switch (self::$action) {
-
/**
@remarks specific save in session value filters
*/
@@ -573,22 +577,6 @@
tep_redirect(tep_href_link(self::FILENAME, 'cID='.$cID.'&action=edit'));
break;
- /**
- @remarks pdf generate
- */
-// case 'deletefile':
-//
-// $ID=(int)$_REQUEST['id'];
-// $type=$_REQUEST['file_type'] ;
-//
-// $datadocs=new DatasFiles;
-//
-// if(( $filepath=$datadocs->GetDoc($type, $ID)) && file_exists($filepath))
-// unlink($filepath);
-//
-// if(!isset($_GET['forceajax']))
-// tep_redirect(tep_href_link(self::FILENAME, 'cID='.self::$Id.'&action=edit'));
-// break;
/**
@@ -974,10 +962,7 @@
case 'edit':
-
- parent::GenericAction();
-
-
+
$activ_add = array();
$res= sqlorder::fetch(array('id'=>self::$Id));
Modified: trunk/catalog/admin/includes/modules/pages/services.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/services.php 2014-02-11 00:04:28 UTC (rev 5135)
+++ trunk/catalog/admin/includes/modules/pages/services.php 2014-02-11 01:53:33 UTC (rev 5136)
@@ -96,6 +96,10 @@
$status=(isset($_REQUEST['status'])? (string)$_REQUEST['status'] : '' );
+ global $oscss,$language,$lang;
+ $oscss->pile_file_lang(DIR_WS_LANGUAGES . $language . '/Service.txt');
+
+
self::$export= new export(__CLASS__);
/**
Modified: trunk/catalog/admin/includes/widget/orderLastinvoice.php
===================================================================
--- trunk/catalog/admin/includes/widget/orderLastinvoice.php 2014-02-11 00:04:28 UTC (rev 5135)
+++ trunk/catalog/admin/includes/widget/orderLastinvoice.php 2014-02-11 01:53:33 UTC (rev 5136)
@@ -1,14 +1,19 @@
<?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 04/07/2013, 10:02
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
+ @file orderLastinvoice.php
+ @dir admin/includes/widget/
*/
+global $oscss,$language,$lang;
+$oscss->pile_file_lang(DIR_WS_LANGUAGES . $language . '/Order.txt');
+
$_query = tep_db_query("SELECT o.*, status_name FROM " . TABLE_ORDERS . " o LEFT JOIN " . TABLE_STATUS . " s ON(s.status_id=o.orders_status AND status_type='orders' AND language_id = '" . $languages_id . "') WHERE o.facture_id IS NOT NULL ORDER BY orders_date_finished DESC LIMIT 5");
if( !$_query->__get('numRows') )
Modified: trunk/catalog/common/classes/PasswordUtility.php
===================================================================
--- trunk/catalog/common/classes/PasswordUtility.php 2014-02-11 00:04:28 UTC (rev 5135)
+++ trunk/catalog/common/classes/PasswordUtility.php 2014-02-11 01:53:33 UTC (rev 5136)
@@ -1,90 +1,877 @@
-<?php if (!defined('HTTP_SERVER')) die('You can not access this file directly!');
+<?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 06/12/11, 16:16
- @author oscim <mail aur...@os...> <www http://www.oscim.fr>
- @encode UTF-8
- @class PasswordUtility
- @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 30/03/2012, 09:32
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+ @file general.php
+ @dir admin/includes/functions/
*/
-class PasswordUtility {
- /**
- @var path childs module
- */
- const PATH_CHILDS_MOD = 'modules/core/password/';
- /**
- @var Prefix file in childs module
- */
- const PREFIX_FILE_CHILDS_MOD = 'Pass_';
- /**
- @var ressource Id current instance
- */
- protected static $_instance;
- /**
- @var object Childs mod instance
- */
- protected static $ChildMod = false;
+/**
+ @brief Include classes automatically when they are instantiated.
+ @original-code TYPOlight Open Source CMS Copyright (C) 2005-2010 Leo Feyer
+ @param string $type type module
+ @return none or false
+*/
+function __autoload($strClassName) {
+ // standard
+ if (file_exists(DIR_FS_ADMIN.DIR_WS_CLASSES . $strClassName . '.php')) {
+ include_once(DIR_FS_ADMIN.DIR_WS_CLASSES . $strClassName . '.php');
+ return;
+ }
+ // listeners
+ if (file_exists(DIR_FS_ADMIN.DIR_WS_CLASSES .'listeners/'. $strClassName . '.php')) {
+ include_once(DIR_FS_ADMIN.DIR_WS_CLASSES .'listeners/'. $strClassName . '.php');
+ return;
+ }
+ // drivers
+ if (file_exists(DIR_FS_ADMIN.DIR_WS_CLASSES .'drivers/'. $strClassName . '.php')) {
+ include_once(DIR_FS_ADMIN.DIR_WS_CLASSES .'drivers/'. $strClassName . '.php');
+ return;
+ }
+ if (file_exists(DIR_FS_ADMIN.DIR_WS_CLASSES . 'osCSS_'.$strClassName . '.php')) {
+ include_once(DIR_FS_ADMIN.DIR_WS_CLASSES . 'osCSS_'.$strClassName . '.php');
+ return;
+ }
+ // Common
+ if (file_exists(DIR_FS_CATALOG.DIR_WS_COMMON_CLASSES . $strClassName . '.php')) {
+ include_once(DIR_FS_CATALOG.DIR_WS_COMMON_CLASSES . $strClassName . '.php');
+ return;
+ }
+ if (file_exists(DIR_FS_CATALOG.DIR_WS_COMMON_CLASSES . 'osCSS_'.$strClassName . '.php')) {
+ include_once(DIR_FS_CATALOG.DIR_WS_COMMON_CLASSES . 'osCSS_'.$strClassName . '.php');
+ return;
+ }
+ // Exts in folder
+ if (file_exists(DIR_FS_ADMIN.DIR_WS_MODULES . $strClassName . '/' . $strClassName . '.php')) {
+ include_once(DIR_FS_ADMIN.DIR_WS_MODULES . $strClassName . '/' . $strClassName . '.php');
+ return;
+ }
+ /** Nom class et path imbrique mondossier_maclass = mondossier/maclass.php
+ Uniquement dans admin/includes
+ */
+ $strClassName=str_replace('_','/',$strClassName);
+ if (file_exists(DIR_FS_ADMIN. DIR_WS_INCLUDES. dirname($strClassName) . '/' . basename($strClassName) . '.php')) {
+ include_once(DIR_FS_ADMIN. DIR_WS_INCLUDES. dirname($strClassName) . '/' . basename($strClassName) . '.php');
+ return basename($strClassName);
+ }
+// trigger_error(sprintf('Could not load class %s', $strClassName), E_USER_ERROR);
+ return false;
+}
- /**
- @brief constructor
- */
- protected function __construct(){
- global $conf;
- if(self::$ChildMod !=false) return ;
+/**
+ @fn tep_admin_check_login()
+ @brief Verifie si user loggé, sinon renvoi sur login
+ puis Verifie l'acl sur la page en cours, sinon renvoi vers forbiden
+*/
+function tep_admin_check_login() {
+ global $navigation, $current_page;
+ if (!tep_session_is_registered('login_id')) {
+ $navigation->set_snapshot();
+ tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
+ }
+ else {
+ $acl = oscss_acl::getInstance();
- $file = self::PREFIX_FILE_CHILDS_MOD.$conf->ModPassword.'.php';
+ if( ! $acl->PageRight($current_page) )
+ $acl->Block();
+ }
+}
- if(!file_exists(DIR_FS_CATALOG.DIR_WS_COMMON.self::PATH_CHILDS_MOD.$file))
- throw new Exception('Not found file password module');
+/**
+ @fn tep_action_check()
+ @brief test acl groups puis utilisateur pour l'action precisé
+*/
+function tep_action_check($action, $_page) {
+ $acl = oscss_acl::getInstance();
- $current = $conf->ModPassword;
- require_once(DIR_FS_CATALOG.DIR_WS_COMMON.self::PATH_CHILDS_MOD.$file);
+ if( ! $acl->PageRight($_page) )
+ tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
+ else
+ return (bool)$acl->ActionRight($action,$_page) ;
+}
- self::$ChildMod = new $current();
- }
- /**
- @brief call current class
- */
- public static function getInstance(){
- if(self::$_instance == null)
- self::$_instance = new self();
+/**
+ @author OscssTeam
+ @version 1.0
+ @return 'true' or 'false' value to display boxes and files in index.php
+*/
+function tep_admin_check_boxes($filename, $boxes='') {
+ global $login_groups_id;
+ if($login_groups_id==1)return true;
+ $dbquery = tep_db_query("select admin_files_id from " . TABLE_ADMIN_FILES . " where FIND_IN_SET( '" . $login_groups_id . "', admin_groups_id) and admin_files_is_boxes = '1' and admin_files_name = '" . $filename . "'");
- return self::$_instance;
+ $return_value = false;
+ if (tep_db_num_rows($dbquery)) {
+ $return_value = true;
+ }
+ return $return_value;
+}
+
+
+/**
+ @fn tep_redirect($url)
+ @brief Redirect to another page or site
+ @param $url string path
+ @return none
+ */
+function tep_redirect($url) {
+ static $i ;
+
+ if ( (strstr($url, "\n") != false) || (strstr($url, "\r") != false) ) tep_redirect(tep_href_link(FILENAME_DEFAULT, '', 'NONSSL', false));
+
+ if ( (ENABLE_SSL == true) && ( getenv('HTTPS') == 'on') ) { // We are loading an SSL page
+ if (substr($url, 0, strlen(HTTP_SERVER)) == HTTP_SERVER) { // NONSSL url
+ $url = HTTPS_SERVER . substr($url, strlen(HTTP_SERVER)); // Change it to SSL
}
+ }
- /**
- @brief Force reset current instance class
- */
- public static function resetInstance(){
- self::$_instance = null;
- return self::getInstance();
+ // garbage collector stop
+ ErrorHandlerActive::stop();
+
+ // close session
+ tep_session_close();
+
+ // redirect
+ if(! in_array(getenv('OSCSS_ENVIRONEMENT'), array('autotesting')) ){
+ header('Location: ' . $url);
+ exit;
+ }
+ else
+ return ;
+}
+
+/**
+ @fn tep_get_http()
+ @brief retrun url server
+*/
+function tep_get_http(){
+ return ( (ENABLE_SSL == true) && (getenv('HTTPS') == 'on') ) ? HTTPS_SERVER : HTTP_SERVER;
+}
+
+/**
+ @fn tep_get_httpdir()
+ @brief return http and base dir server
+*/
+function tep_get_httpdir(){
+ return ( (ENABLE_SSL == true) && (getenv('HTTPS') == 'on') ) ? HTTPS_SERVER.DIR_WS_HTTPS_CATALOG : HTTP_SERVER.DIR_WS_HTTP_CATALOG;
+}
+
+
+/**
+ * \fn tep_parse_input_field_data($data, $parse)
+ * \brief Parse the data used in the html tags to ensure the tags will not break
+ * @param $data
+ * @param $parse
+ */
+function tep_parse_input_field_data($data, $parse) {
+ return strtr(trim($data), $parse);
+}
+
+/**
+ @author OscssTeam
+*/
+function tep_output_string($string, $translate = false, $protected = false) {
+ if ($protected == true) return htmlspecialchars($string);
+ else {
+ if ($translate == false) return tep_parse_input_field_data($string, array('"' => '"'));
+ else return tep_parse_input_field_data($string, $translate);
+ }
+}
+
+/**
+ @author OscssTeam
+*/
+function tep_output_string_protected($string) {
+ return tep_output_string($string, false, true);
+}
+
+/**
+ @author OscssTeam
+ Correction retour get ou post (secure)
+*/
+function tep_sanitize_string($string) {
+ $string = preg_replace('/ +/', ' ', $string);
+ return preg_replace("/[<>]/", '_', $string);
+}
+
+/**
+ *\fn tep_sanitize_request($string)
+ *\brief suppression et nettoyage request value (sécu)
+ \param string la chaîne à nettoyer
+*/
+function tep_sanitize_request($string) {
+ $string = htmlspecialchars(strip_tags($string));
+ return preg_replace("#(\./|\.\./|(\<|%3C)|(\>|%3E)|(\<|%3C).*script.*(\>|%3E))*#i",'',$string);
+}
+
+/**
+ @fn __($str,$prefix='',$mode=false)
+ @brief convert in current langue for all string passed
+ @param $str string la chaine
+ @param $prefix string name of prefix in '@prefix ' for specific text
+ @return string
+*/
+function __($str,$prefix='',$mode=false) {
+ global $lang;
+ $new_str='';
+ if(!empty($prefix))
+ $new_str='@'.$prefix.' '.$str;
+
+ if(isset($lang[$new_str]))
+ $final = $lang[$new_str];
+ elseif(isset($lang[$str]))
+ $final = $lang[$str];
+ else
+ $final = $str;
+
+ return nl2br($final);
+}
+
+/**
+ @author oscim - OscssTeam
+ @version 1.6
+ Suppression systhematqiue de la var page_admin specifique au rewriting
+*/
+function tep_get_all_get_params($exclude_array = '',$w3c=true) {
+ global $_GET;
+ if ($exclude_array == '') $exclude_array = array('page_admin',tep_session_name(),'error');
+ else {$exclude_array[]='page_admin';$exclude_array[]=tep_session_name();$exclude_array[]='error'; }
+ $get_url = '';
+ reset($_GET);
+ while (list($key, $value) = each($_GET))
+ if (!in_array($key, $exclude_array)) $get_url .= $key . '=' . tep_sanitize_string($value) . (($w3c)?'&':'&');
+
+ return $get_url;
+}
+
+/**
+ @author oscim - OscssTeam
+ @version 1.6
+ Suppression systhematqiue de la var page_admin specifique au rewriting
+*/
+function tep_get_all_post_params($exclude_array = '') {
+ global $_GET;
+ if ($exclude_array == '') $exclude_array = array('page_admin',tep_session_name(),'error');
+ else {$exclude_array[]='page_admin';$exclude_array[]=tep_session_name();$exclude_array[]='error'; }
+ $add_post='';
+ reset($_GET);
+ while (list($key, $value) = each($_GET))
+ if (!in_array($key, $exclude_array)) $add_post .= tep_draw_hidden_field($key, '', htmlspecialchars(stripslashes(tep_sanitize_string($value))));
+
+ return $add_post;
+}
+
+
+
+
+
+/**
+ @package oscss
+ @author OscssTeam
+ @version 2
+ Réecriture des dates dans des formats correctes pour la langue
+*/
+function tep_strftime($format, $timestamp=false) {
+ if (!$timestamp) $timestamp = time();
+ $pattern = array(
+ '%a'=>array('const'=>'NameOf_DAY_MINI','ftime'=>'%w'),
+ '%A'=>array('const'=>'NameOf_DAY','ftime'=>'%w'),
+ '%b'=>array('const'=>'NameOf_MONTH_MINI','ftime'=>'%m'),
+ '%B'=>array('const'=>'NameOf_MONTH','ftime'=>'%m')
+ );
+ foreach ($pattern as $code=>$infos)
+ if (preg_match("/$code/",$format) && defined($infos['const'].'_'.strftime($infos['ftime'], $timestamp)))
+ $format = preg_replace("/$code/", constant($infos['const'].'_'.strftime($infos['ftime'], $timestamp)), $format);
+ return strFtime($format, $timestamp);
+}
+
+
+/**
+ @package oscss
+ @author OscssTeam
+*/
+function tep_break_string($string, $len, $break_char = '-') {
+ $l = 0;
+ $output = '';
+ for ($i=0, $n=strlen($string); $i<$n; $i++) {
+ $char = substr($string, $i, 1);
+ if ($char != ' ') $l++;
+ else $l = 0;
+ if ($l > $len) {
+ $l = 1;
+ $output .= $break_char;
}
+ $output .= $char;
+ }
+ return $output;
+}
+/**
+ @fn tep_not_null($value)
+ @brief test if not null, normalise control
+ @param $value string
+ @return boolean true ok | false not ok
+*/
+function tep_not_null($value) {
+ if (is_array($value)) {
+ if (sizeof($value) > 0) return true;
+ else return false;
+ } else {
+ if ( (is_string($value) || is_int($value)) && ($value != '' && $value != '1000-01-01 00:00:00' ) && (strtolower($value) != 'null') && (strlen(trim($value)) > 0)) return true;
+ else return false;
+ }
+}
- /**
- @brief This funstion validates a plain text password with an encrpyted password
- @page login.php(public)
- */
- public function validate_password($plain, $encrypted){
- self::getInstance();
- return self::$ChildMod->validate_password($plain, $encrypted);
+/**
+ @fn tep_browser_detect($component)
+ @return HTTP_USER_AGENT
+*/
+function tep_browser_detect($component) {
+ return stristr($_SERVER['HTTP_USER_AGENT'], $component);
+}
+
+
+
+/**
+ @fn tep_round($value, $precision)
+ @brief Wrapper function for round()
+ @param $value valur for arround
+ @param $precision int number round
+*/
+function tep_round($value, $precision) {
+ return round($value, $precision);
+}
+
+/**
+ @fn tep_class_exists($namespace_class)
+ @brief custom class exists
+ load class :: path_class_and_class_name >> include(path/class/and/class/name) et class_exists(name)
+ @param string path et class name
+ @return bool
+*/
+function tep_class_exists($namespace_class){
+ return ( (($class=__autoload($namespace_class)) && $class !=false) && class_exists($class) )? true : false;
+}
+
+/**
+ @fn tep_call_function($function, $parameter, $object = '')
+ @brief call user function / class and ajust call fro PHP 5.2 vs 5.3 and up
+ @note Appel de function. ou de class
+*/
+function tep_call_function($function, $parameter, $object = '') {
+ if (is_string($object) && $object == '') return call_user_func($function, $parameter);
+ else return call_user_func(array($object, $function), $parameter);
+}
+
+
+/**
+ @fn tep_set_time_limit($limit)
+ @brief Sets timeout for the current script.Cant be used in safe mode.
+ @param $limit int
+ @return none
+*/
+function tep_set_time_limit($limit) {
+ if (!get_cfg_var('safe_mode'))
+ @set_time_limit($limit);
+}
+
+/**
+ @fn tep_rand($min = null, $max = null)
+ @param $min int value min
+ @param $max int value max
+ @return value random
+*/
+function tep_rand($min = null, $max = null) {
+ static $seeded;
+
+ if (!$seeded) {
+ mt_srand((double)microtime()*1000000);
+ $seeded = true;
+ }
+
+ if (isset($min) && isset($max)) {
+ if ($min >= $max) return $min;
+ else return mt_rand($min, $max);
+ } else {
+ return mt_rand();
+ }
+}
+
+
+/**
+ @fn tep_convert_linefeeds($from, $to, $string)
+ @return string
+*/
+function tep_convert_linefeeds($from, $to, $string) {
+ return str_replace($from, $to, $string);
+}
+
+
+/**
+ @fn tep_string_to_int($string)
+ @param $string
+ @return int
+*/
+function tep_string_to_int($string) {
+ return (int)$string;
+}
+
+
+/**
+ @fn tep_array_to_string($array, $exclude = '', $equals = '=', $separator = '&')
+ @brief convert array in string , by concat all key / value
+ @note use for convert array in Get param
+ @param $array array
+ @param $exclude array for exclude key
+ @param $equals separator between key /value
+ @param $separator separator for between row array
+ @return string
+*/
+function tep_array_to_string($array, $exclude = '', $equals = '=', $separator = '&') {
+ if (!is_array($exclude)) $exclude = array();
+ $get_string = '';
+ if (sizeof($array) > 0) {
+ while (list($key, $value) = each($array)) {
+ if ( (!in_array($key, $exclude)) ) {
+ $get_string .= $key . $equals . $value . $separator;
+ }
}
+ $remove_chars = strlen($separator);
+ $get_string = substr($get_string, 0, -$remove_chars);
+ }
+ return $get_string;
+}
- /**
- @brief This function makes a new password from a plaintext password.
- @page create_account.php|password_forgotent.php(public)
- */
- public function encrypt_password($plain){
- self::getInstance();
- return self::$ChildMod->encrypt_password($plain);
+
+/**
+ @brief Map global to GET variable
+ @note Replication lib public
+*/
+function link_get_variable($var_name){
+ if (isset($_GET[$var_name]))$GLOBALS[$var_name] =& $_GET[$var_name];
+}
+
+
+/**
+ @brief Map global to POST variable
+ @note Replication lib public
+*/
+function link_post_variable($var_name){
+ if (isset($_POST[$var_name])) $GLOBALS[$var_name] =& $_POST[$var_name];
+}
+
+/**
+ @fn _cst_bool($text)
+ @brief test value specific the constant for boolean result
+ @param string/boolean defini par une constante!
+ @return boolean true/false
+*/
+function _cst_bool($text){
+ if(!tep_not_null($text)) return false;
+ $value=tep_cst_define($text);
+ if( (is_string($value) && strtoupper($value)=='TRUE')||( is_bool($value) && $value==TRUE) ) return true;
+ elseif( (is_string($value) && (strtoupper($value)=='FALSE')) || ( is_bool($value) && $value==FALSE) ) return false;
+ return false;
+}
+
+/**
+ @fn _test_bool($value)
+ @brief test value for boolean result
+ @param string/boolean
+ @return boolean true/false
+*/
+function _test_bool($value){
+ if(empty($value))
+ return false;
+ elseif(
+ (is_string($value) && (strtoupper($value)==='TRUE' ) )
+ ||( is_bool($value) && (bool)$value )
+ || (is_numeric($value) && $value=1) || (preg_match('#[0-9]#', $value) && (int)$value === 1)
+ )
+ return true;
+
+ return false;
+}
+
+/**
+ @fn tep_cst_define($text)
+ @brief test if constant is defined
+ @note Test si une constante est defini , si celle-ci existe, renvoi sa valeur, sinon return (string)'false'
+ @param $text string value for test
+ @return value after test or string (false)
+*/
+function tep_cst_define($text){
+ if(defined(strtoupper($text))) return constant(strtoupper($text));
+ else return 'false';
+}
+
+/**
+ Extraction chaine type GET en tableau
+ @author oscim <mail os...@os...> <www http://www.oscim.fr>
+ @param
+ @a string class=www&fucntion=ddd
+ @a string [null] la clef de tableau a retourner
+ @return array
+*/
+function tep_extrac_querystring($query='',$search=''){
+ $s=(!empty($query))?$query : $_SERVER['QUERY_STRING'];
+
+ $r=explode('&',$s);
+ foreach($r as $e){
+ $i=strpos($e,'=');
+ $f[substr($e,0,$i)]=substr($e,($i+1));
+ }
+ if(!empty($search) && isset($f[$search]) ) return $f[$search];
+ elseif (!empty($search)) return false;
+ else return $f;
+}
+
+/**
+ Convertion de tableau au format json
+ @param array
+*/
+function convert_json($array){
+ if(function_exists('json_encode'))
+ return json_encode($array);
+}
+
+
+/**
+ @brief Recup info sys
+*/
+function tep_get_system_information() {
+ $DB=Database::getInstance();
+ $db_query = tep_db_query("select now() as datetime");
+ $db = tep_db_fetch_array($db_query);
+
+ list($system, $host, $kernel) = preg_split('/[\s,]+/', @exec('uname -a'), 5);
+
+ return array('date' => tep_datetime_short(date('Y-m-d H:i:s')),
+ 'system' => $system,
+ 'kernel' => $kernel,
+ 'host' => $host,
+ 'ip' => gethostbyname($host),
+ 'uptime' => @exec('uptime'),
+ 'http_server' => @$_SERVER['SERVER_SOFTWARE'],
+ 'php' => PHP_VERSION,
+ 'zend' => (function_exists('zend_version') ? zend_version() : ''),
+ 'db_server' => DB_SERVER,
+ 'db_ip' => gethostbyname(DB_SERVER),
+ 'db_connector' => DB_CONNECTOR ,
+ 'db_version' => $DB->server_info(),
+ 'db_date' => tep_datetime_short($db['datetime']));
+}
+
+/**
+ @fn get_info_core($file,$name='svn')
+ @brief Recuperation des element de svn basé sur le fichier oscss.version.xml
+ @param $file path acces file
+ @param $name string le tag qui doit être retourné (all for return all tags)
+*/
+function get_info_core($file,$name='svn'){
+ if(!file_exists($file)) return die(__('Erreur récuperation fichier'));
+ $SimpleParser = simplexml_load_file($file);
+
+ if($name=='all')
+ return $SimpleParser;
+ elseif(!isset($SimpleParser->$name))
+ die(__('Erreur récuperation tag '.$name)) ;
+ else
+ return (string)$SimpleParser->$name;
+}
+
+/**
+ @brief array map for tep_menu or detail status if id
+ @param $type string key col status
+ @param $id int if is > 0 return array specific this id
+ @param $orderby string name col for order by
+ @param $sort string ASC/DESC sort result
+ @return array for tep_tab_menu if $id=0
+ Or array specific id if key + id exists
+*/
+function tep_get_status_array($type='orders', $id=0, $orderby='status_id', $sort='ASC'){
+ global $languages_id;
+ $loop = array();
+ $list = array();
+ $all = sqlstatus::fetch(array(
+ 'type'=>$type,
+ 'language_id'=>(int)$languages_id,
+ 'status'=>1,
+ ),
+ true
+ );
+ if(!$all)
+ return false;
+
+ if(is_object($all))
+ $loop[] = $all;
+ else
+ $loop = $all;
+
+ foreach($loop as $status)
+ if($id > 0 && (int)$id == $status->id)
+ return array('id' => $status->id, 'text' => $status->name);
+ else $list[] = array('id' => $status->id , 'text' => $status->name);
+
+ if($id > 0)
+ return false;
+ else
+ return $list;
+}
+
+
+/**
+ @package oscss
+ @author OscssTeam
+*/
+function tep_tax_classes_pull_down($parameters, $selected = '') {
+ $select_string = '<select ' . $parameters . '>';
+ $classes_query = tep_db_query("select tax_class_id, tax_class_title from " . TABLE_TAX_CLASS . " order by tax_class_title");
+ while ($classes = tep_db_fetch_array($classes_query)) {
+ $select_string .= '<option value="' . $classes['tax_class_id'] . '"';
+ if ($selected == $classes['tax_class_id']) $select_string .= ' selected="selected"';
+ $select_string .= '>' . $classes['tax_class_title'] . '</option>';
+ }
+ $select_string .= '</select>';
+
+ return $select_string;
+}
+
+/**
+Returns the tax rate for a tax class
+ @package oscss-Rv
+ @author oscim - OscssTeam
+ @table tax_rates
+*/
+function tep_get_tax_rate_value($class_id) {
+ $tax_query = tep_db_query("select tax_rate, tax_zone_id from " . TABLE_TAX_RATES . " where tax_class_id = '" . (int)$class_id . "' order by tax_priority");
+ if (tep_db_num_rows($tax_query)) {
+ $tax_table = array('tax_zone_id' => '0', 'tax_rate' => '0');
+ while ($tax = tep_db_fetch_array($tax_query)) {
+ if ($tax_table['tax_zone_id'] == '0'){
+ $tax_table['tax_zone_id'] = $tax['tax_zone_id'];
+ $tax_table['tax_rate'] = $tax['tax_rate'];
+ }elseif ($tax_table['tax_zone_id'] == $tax['tax_zone_id']) $tax_table['tax_rate'] += $tax['tax_rate'];
}
+ return $tax_table['tax_rate'];
+ }
+ else return 0;
+}
+
+
+
+/**
+ @fn status_name($type , $status_id, $language_id = '')
+ @brief public methode return name human
+ @param type status string
+ @param $status_id int
+ @param $language_id int
+ @return array
+*/
+function status_name($type , $status_id, $language_id = '') {
+ global $languages_id;
+
+ if (!is_numeric($language_id)) $language_id = $languages_id;
+
+ $status_query = tep_db_query("select status_name from " . TABLE_STATUS . " where status_type='".$type."' AND status_id = '" . $status_id . "' and language_id = '" . $language_id . "'");
+ $status = tep_db_fetch_array($status_query);
+
+ return $status['status_name'];
}
-?>
+/**
+ Alias
+*/
+function tep_get_orders_status_name($orders_status_id, $language_id = '') {
+ return status_name('orders',$orders_status_id, $language_id);
+}
+
+
+
+/**
+ list templates directorys
+ @package oscss
+ @author OscssTeam
+*/
+function oscss_list_templates_admin() {
+ $dir = dir(DIR_FS_ADMIN . DIR_WS_INCLUDES . 'template/');
+ $themes_array = array();
+ while ($file = $dir->read())
+ if($file != '..' && $file !='.' && $file !='' && file_exists(DIR_FS_ADMIN . DIR_WS_INCLUDES . 'template/'.$file.'/gabarit-' . $_SESSION['login_groups_id'] . '.php'))
+ $themes_array[] = array( 'id' => $file, 'text' => $file );
+ $dir->close();
+ return $themes_array;
+}
+
+/**
+ list templates directorys
+ @package oscss
+ @author OscssTeam
+*/
+function oscss_check_url($url) {
+ return preg_match("%^http://[_A-Z0-9-]+\.[_A-Z0-9-]+[.A-Z0-9-]*(/~|/?)[/_.A-Z0-9#?&=+-]*$%i",$url);
+}
+
+/**
+ @package SEOURLs
+ @author OscssTeam
+ @version 2.1
+ @note Function to reset SEO URLs database cache entries
+*/
+function tep_reset_cache_data_seo_urls($action){
+ switch ($action){
+ case 'reset':
+ tep_db_query("DELETE FROM " . TABLE_SEO_CACHE . " WHERE cache_name LIKE '%seo_urls%'");
+ tep_db_query("UPDATE ".TABLE_CONFIGURATION." SET configuration_value='false' WHERE configuration_key='SEO_URLS_CACHE_RESET'");
+ break;
+ default:
+ }
+ # The return value is used to set the value upon viewing
+ # It's NOT returining a false to indicate failure!!
+ return 'false';
+}
+
+/**
+ @fn DataForceStatus($clause)
+ @brief this function force status on datatype Required for admin view off data
+ @note use in sql Requete, next clause where and prev other clause
+ @param $clause string clause normal control status ( c.status='1' AND )
+ @return normal clause status or empty string
+*/
+function DataForceStatus($clause){
+ global $SecuKey;
+ if ( ( !empty($SecuKey) && (strlen($SecuKey)==40) && isset($_GET['forceview']) && (string)$_GET['forceview'] ==md5($SecuKey)) )
+ return '';
+ else
+ return ' '.$clause.' ';
+}
+
+/**
+ @fn tep_cst_menu_conf($cst)
+ Control la présence d'une constante de langue en remplacement de l'intitulé des menu de l'admin. Si cette constante n'est pas défini, une alerte est produite
+ ne préciser que le contenu de la colonne key
+*/
+function tep_cst_menu_conf($cst){
+ if (defined(strtoupper($cst))) return @constant(strtoupper($cst));
+ elseif (defined('BOX_HEADING_CONF_'.strtoupper($cst))) return @constant('BOX_HEADING_CONF_'.strtoupper($cst));
+ else return '<span class="error">'.'Erreur:: constante absente, nommé (BOX_HEADING_CONF_'.strtoupper($cst).') dans votre fichier de langue principal et ('.strtoupper($cst).') représente la key de la table sql'.'</span>';
+}
+
+
+/**
+ Fonctions remplacé par des class
+ => Retrocompatibilité
+*/
+function ajax_in_Sats($cl=''){
+ if(!class_exists('ajax_in_Sats'))require_once(DIR_WS_MODULES.'pages/'.'graphs_stats'.'.php');
+ return graphs_stats::ajax_in_Sats($cl);
+}
+
+
+
+
+
+function tep_get_file_permissions($mode) { return fileUtility::get_file_permissions($mode);}
+function tep_remove($source) { return fileUtility::_rmdir($source); }
+function bu_gzip($directory, $file_in, $ext='zip',$delete_file = false, $level = 6) { return fileUtility::compress_dir($directory, $file_in, $ext, $delete_file , $level); }
+function tep_zip_extractto($archive, $destination, $ext='zip') { return fileUtility::extractto($archive, $destination, $ext );}
+function scan($strFolder) { return fileUtility::_scandir($strFolder); }
+
+
+
+function tep_customers_name($customers_id) { return customerUtility::customers_name($customers_id); }
+function tep_get_address_formats() { return customerUtility::get_address_formats(); }
+function tep_address_format($address_format_id, $address, $html, $boln, $eoln) { return customerUtility::address_format($address_format_id, $address, $html, $boln, $eoln); }
+
+function tep_get_zone_code($country, $zone, $def_state) { return worldUtility::get_zone_code($country, $zone, $def_state); }
+function tep_get_countries($default = '', $exclude=array()) { return worldUtility::get_countries($default, $exclude); }
+function tep_get_country_zones($country_id) { return worldUtility::get_country_zones($country_id); }
+function tep_get_zone_class_title($zone_class_id){return worldUtility::get_zone_class_title($zone_class_id); }
+function tep_cfg_pull_down_zone_classes($zone_class_id, $key = '', $type='1'){return worldUtility::cfg_pull_down_zone_classes($zone_class_id, $key, $type); }
+function tep_cfg_pull_down_zone_shipping($zone_class_id, $key = ''){ return worldUtility::cfg_pull_down_zone_classes($zone_class_id, $key , '2'); }
+function tep_get_country_name($country_id){ return worldUtility::get_country_name($country_id); }
+function tep_geo_zones_pull_down($parameters, $selected = ''){ return worldUtility::geo_zones_pull_down($parameters, $selected ,1); }
+function tep_get_geo_zone_name($geo_zone_id){ return worldUtility::get_geo_zone_name($geo_zone_id); }
+
+function tep_get_languages($byindex=false, $public=true) { return language::get_languages($byindex, $public); }
+
+function get_cat_list($current_ID='',$incre=false){ return categorieUtility::get_cat_list(array('root'=>$current_ID,'incre'=>$incre)); }
+function tep_childs_in_category_count($categories_id) { return categorieUtility::childs_in_category_count($categories_id); }
+function tep_get_generated_category_path_ids($id, $from = 'category') { return categorieUtility::get_generated_category_path_ids($id, $from); }
+function tep_parse_category_path($cPath) { return categorieUtility::parse_category_path($cPath); }
+function tep_get_category_name($category_id, $language_id='') { return categorieUtility::get_category_name($category_id, $language_id); }
+function tep_generate_category_path($id, $from = 'category', $categories_array = '', $index = 0) { return categorieUtility::generate_category_path($id, $from, $categories_array, $index); }
+function tep_get_category_tree($parent_id = '0', $spacing = '', $exclude = '', $category_tree_array = '', $include_itself = false) {
+ return categorieUtility::get_category_tree( array( 'parent_id'=> $parent_id, 'spacing'=> $spacing, 'exclude'=> $exclude, 'category_tree_array'=> $category_tree_array, 'include_itself'=> $include_itself ));
+}
+
+function tep_get_products_special_price($product_id) { return productUtility::get_products_special_price($product_id); }
+function tep_get_uprid($prid, $params) { return productUtility::get_uprid($prid, $params); }
+function tep_get_prid($uprid) { return productUtility::get_prid($uprid); }
+function tep_get_prid_array($uprid) { return productUtility::get_prid_array($uprid); }
+function tep_get_products_name($product_id, $language_id = 0) { return productUtility::get_products_name($product_id, $language_id); }
+function tep_products_restock($order_id, $customers_id=''){ return productUtility::products_restock($order_id, $customers_id); }
+function tep_get_product_list($exclude = ''){ return productUtility::get_product_list($exclude); }
+function tep_options_name($options_id) { return productUtility::options_name($options_id); }
+function tep_values_name($values_id) { return productUtility::values_name($values_id); }
+function tep_get_product_extra_value($epf_id, $product_id, $language_id) { return productUtility::get_product_extra_value($epf_id, $product_id, $language_id); }
+function tep_list_epf_children($parent_id) { return productUtility::list_epf_children($parent_id); }
+
+
+function tep_get_tax_rate($class_id, $country_id = -1, $zone_id = -1) { global $price; return $price->get_tax_rate($class_id, $country_id, $zone_id); }
+function tep_get_tax_description($class_id, $country_id, $zone_id) { global $price; return $price->get_tax_description($class_id, $country_id, $zone_id); }
+function tep_add_tax($products_price, $tax, $force=false, $strict=true) { global $price; return $price->display_with_tax($products_price, $tax, $force, $strict); }
+function tep_calculate_tax($products_price, $tax,$strict=false) { global $price; return $price->get_tax_amount($products_price, $tax,$strict=false); }
+function tep_display_tax_value($value, $padding = TAX_DECIMAL_PLACES) { global $price; return $price->display_tax_value($value, $padding); }
+function tep_get_tax_class_title($tax_class_id) { global $price; return $price->tep_get_tax_class_title($tax_class_id); }
+
+function qtpro_doctor_investigate_product($products_id){ return qtproUtility::doctor_investigate_product($products_id);}
+function qtpro_product_has_tracked_options($products_id){ return qtproUtility::product_has_tracked_options($products_id);}
+function qtpro_get_products_summary_stock($products_id){ return qtproUtility::get_products_summary_stock($products_id);}
+function qtpro_doctor_amputate_all_from_product($products_id){ return qtproUtility::doctor_amputate_all_from_product($products_id);}
+function qtpro_products_attributes_string2options_array($products_attributes_string){ return qtproUtility::products_attributes_string2options_array($products_attributes_string);}
+function qtpro_update_summary_stock($products_id){ return qtproUtility::update_summary_stock($products_id);}
+function qtpro_calculate_summary_stock($products_id){ return qtproUtility::calculate_summary_stock($products_id);}
+
+function tep_create_rma_value($length, $type = 'digits') {return ReturnsUtility::CreateReturnsKey($length, $type) ;}
+function tep_calculate_deduct($price, $tax){return ReturnsUtility::CalculateDeduct($price, $tax); }
+function tep_get_return_reason(){return ReturnsUtility::list_return_reasons();}
+function tep_get_returns_status(){return ReturnsUtility::list_returns_status();}
+function tep_get_refund_method(){return ReturnsUtility::list_refund_method();}
+function tep_remove_return($order_id, $restock = false){return ReturnsUtility::RemoveReturns($order_id, $restock);}
+function tep_get_return_reason_name($return_reason_id, $language_id = ''){return ReturnsUtility::status_name('return_reasons' , $return_reason_id, $language_id) ;}
+function tep_get_returns_status_name($returns_status_id, $language_id = ''){return ReturnsUtility::status_name('returns' ,$returns_status_id, $language_id);}
+function tep_get_refund_method_name($refund_method_id, $language_id = ''){return ReturnsUtility::status_name('refund_method' ,$refund_method_id, $language_id) ;}
+
+function tep_mail($to_name, $to_email_address, $email_subject, $email_text, $from_email_name='', $from_email_address='') { return emailUtility::tep_mail($to_name, $to_email_address, $email_subject, $email_text, $from_email_name, $from_email_address);}
+function tep_replace_for_mail($txt_mail,$subject,$html_reg,$text_reg,$mode='HTML') { return emailUtility::replace_for_mail($txt_mail,$subject,$html_reg,$text_reg,$mode);}
+function tep_post_prepare_email($template,$language,$myarray,$print=false) { return emailUtility::post_prepare_email($template,$language,$myarray,$print);}
+function tep_recup_template_mail() { return emailUtility::recup_template_mail();}
+
+function quote_oanda_currency($code, $base = DEFAULT_CURRENCY) {return localizationUtility::oanda_currency($code, $base);}
+function quote_xe_currency($to, $from = DEFAULT_CURRENCY){return localizationUtility::xe_currency($to, $from);}
+
+
+function tep_date_long($raw_date) { return datetimeUtility::date_long($raw_date); }
+function tep_date_short($raw_date){ return datetimeUtility::date_short($raw_date); }
+function tep_datetime_short($raw_datetime) { return datetimeUtility::datetime_short($raw_datetime); }
+
+
+/**
+ @fn alias oscss_cstr::test_gab_theme($element,$ext='php')
+ @brief load Template Environement
+ @return (bool)false OR string path file
+*/
+function tep_test_gab_ele($element,$ext='php'){ return oscss_cstr::test_gab_theme($element,$ext); }
+
+/** @fn alias MGabCont::CallGab($filename); */
+function tep_get_include_contents($filename) { return MGabCont::CallGab($filename); }
+?>
\ 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-11 00:04:32
|
Revision: 5135
http://sourceforge.net/p/oscss/svn/5135
Author: oscim
Date: 2014-02-11 00:04:28 +0000 (Tue, 11 Feb 2014)
Log Message:
-----------
Fix
stabilise manipulate row lang in sqlxxx and link modules/pages
Modified Paths:
--------------
trunk/catalog/Documents/oscss.version.xml
trunk/catalog/admin/includes/appli_top_Test.php
trunk/catalog/admin/includes/classes/EventsHandlerActive.php
trunk/catalog/admin/includes/classes/ModTree.php
trunk/catalog/admin/includes/classes/ModTreePage.php
trunk/catalog/admin/includes/classes/drivers/sqladminmenu.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/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/languages/fr_FR/Adminuser.txt
trunk/catalog/admin/includes/languages/fr_FR/Currencie.txt
trunk/catalog/admin/includes/languages/fr_FR/Customer.txt
trunk/catalog/admin/includes/languages/fr_FR/Order.txt
trunk/catalog/admin/includes/languages/fr_FR/Shipping.txt
trunk/catalog/admin/includes/languages/fr_FR/Stock.txt
trunk/catalog/admin/includes/languages/fr_FR/modules/account/account_extra.txt
trunk/catalog/admin/includes/modules/pages/categories.php
trunk/catalog/admin/includes/modules/pages/featureds.php
trunk/catalog/admin/includes/modules/pages/orders.php
trunk/catalog/admin/includes/widget/AdminUsersLast.php
trunk/catalog/admin/includes/widget/CustomerLast.php
trunk/catalog/admin/includes/widget/NewCustomersStats.php
trunk/catalog/admin/includes/widget/homeStock.php
trunk/catalog/admin/includes/widget/orderLast.php
trunk/catalog/admin/includes/widget/orderLastservice.php
trunk/catalog/admin/includes/widget/orderLastshipp.php
trunk/catalog/admin/includes/widget/orderStats.php
trunk/catalog/admin/logoff.php
Added Paths:
-----------
trunk/catalog/admin/includes/gabarit/MGabCont/display_view.new.gab
trunk/catalog/admin/includes/languages/fr_FR/Service.txt
Removed Paths:
-------------
trunk/catalog/admin/includes/languages/fr_FR/modules/pages/services.txt
trunk/catalog/admin/includes/languages/fr_FR/modules/pages/stock.txt
trunk/catalog/admin/includes/languages/fr_FR/widget/AdminUsersLast.txt
trunk/catalog/admin/includes/languages/fr_FR/widget/CustomerLast.txt
trunk/catalog/admin/includes/languages/fr_FR/widget/NewCustomersStats.txt
trunk/catalog/admin/includes/languages/fr_FR/widget/currencies_update_server.txt
trunk/catalog/admin/includes/languages/fr_FR/widget/homeStock.txt
trunk/catalog/admin/includes/languages/fr_FR/widget/orderLast.txt
trunk/catalog/admin/includes/languages/fr_FR/widget/orderLastinvoice.txt
trunk/catalog/admin/includes/languages/fr_FR/widget/orderLastservice.txt
trunk/catalog/admin/includes/languages/fr_FR/widget/orderLastshipp.txt
trunk/catalog/admin/includes/languages/fr_FR/widget/orderStats.txt
Modified: trunk/catalog/Documents/oscss.version.xml
===================================================================
--- trunk/catalog/Documents/oscss.version.xml 2014-02-10 21:16:21 UTC (rev 5134)
+++ trunk/catalog/Documents/oscss.version.xml 2014-02-11 00:04:28 UTC (rev 5135)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<core>
<version>2.2.0</version>
- <svn>4040</svn>
+ <svn>5035</svn>
<level>unstable</level>
<template_admin>oscss</template_admin>
Modified: trunk/catalog/admin/includes/appli_top_Test.php
===================================================================
--- trunk/catalog/admin/includes/appli_top_Test.php 2014-02-10 21:16:21 UTC (rev 5134)
+++ trunk/catalog/admin/includes/appli_top_Test.php 2014-02-11 00:04:28 UTC (rev 5135)
@@ -53,7 +53,11 @@
require($rpa.DIR_WS_INCLUDES . 'tables_files_modules.php');
-
+ // Event Handler
+ include($rpa.DIR_WS_CLASSES.'EventsHandlerActive.php');
+ $Events =EventsHandlerActive::Start($Cfg);
+
+ // other load
include_once(DIR_FS_ADMIN.DIR_WS_CLASSES . 'objectInfo.php');
include_once(DIR_FS_ADMIN.DIR_WS_CLASSES . 'emailUtility.php');
Modified: trunk/catalog/admin/includes/classes/EventsHandlerActive.php
===================================================================
--- trunk/catalog/admin/includes/classes/EventsHandlerActive.php 2014-02-10 21:16:21 UTC (rev 5134)
+++ trunk/catalog/admin/includes/classes/EventsHandlerActive.php 2014-02-11 00:04:28 UTC (rev 5135)
@@ -187,45 +187,4 @@
}
-// 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/ModTree.php
===================================================================
--- trunk/catalog/admin/includes/classes/ModTree.php 2014-02-10 21:16:21 UTC (rev 5134)
+++ trunk/catalog/admin/includes/classes/ModTree.php 2014-02-11 00:04:28 UTC (rev 5135)
@@ -352,6 +352,7 @@
if(is_array($row)){
$txt = (isset($row['text_short'])? $row['text_short'] : $row['text']) ;
$alias = (isset($row['alias'])? $row['alias'] : $clean);
+ $alias =str_replace(array('[',']'), array('_',''),$alias);
$css = (isset($row['class'])? $row['class'] : 'tleft')
// add css class for jseditable
.(isset($row['edit'])? ' edit_dbclick': '' );
@@ -367,8 +368,6 @@
// put for all other context
self::$InitInfo['edit']['listing']['edit_'.$alias] = $row['edit'];
-// self::$InitInfo['edit']['multi']['edit_'.$alias] = $row['edit'];
-// self::$InitInfo['edit']['listing_edit']['edit_'.$alias] = $row['edit'];
$tab = ( (isset($row['edit']['position_tab']) && !empty($row['edit']['position_tab']) )? $row['edit']['position_tab']: 'master' );
$colum = (isset($row['edit']['position_col'])? $row['edit']['position_col']: 'left' );
@@ -417,7 +416,7 @@
$i++;
}
}
-// print_r(self::$InitInfo['colum']);
+// print_r(self::$InitInfo);
// exit;
self::$InitInfo['modele']['listing']['action']=false;
Modified: trunk/catalog/admin/includes/classes/ModTreePage.php
===================================================================
--- trunk/catalog/admin/includes/classes/ModTreePage.php 2014-02-10 21:16:21 UTC (rev 5134)
+++ trunk/catalog/admin/includes/classes/ModTreePage.php 2014-02-11 00:04:28 UTC (rev 5135)
@@ -238,6 +238,7 @@
case 'update':
try {
+ // check if Id > 0 and this sqlxx::fetch return correct data
if( $class::$Id <=0 )
throw new Exception(__('error load data', $class)) ;
@@ -304,16 +305,24 @@
case 'new':
/**
- @remarks Check count status type. If one status , get next etape
+ @remarks Check count status type.
+ If one status , get next etape
+ IF false , this data not content col type
*/
-
+
$res = tep_get_status_array(self::GetClassDatatype(),0,'status_name');
- if(count($res)<=1)
+ if($res ===false || count($res)<=1)
tep_redirect(tep_href_link($class::FILENAME, 'action=insert'));
-
+ // load data if not loaded
+ if(!is_object($class::$Info))
+ $class::$Info = $class::GetDBValue();
+ break;
+
+
case 'edit':
+ // check if Id > 0 and this sqlxx::fetch return correct data
if($class::$Id > 0)
if(!$sqlclass::fetch(array('id'=>(int)$class::$Id), true) ) {
self::PutMessage(
@@ -321,12 +330,15 @@
);
tep_redirect(tep_href_link(self::FILENAME));
}
-
+
+ // load data if not loaded
if(!is_object($class::$Info))
$class::$Info = $class::GetDBValue();
global $oscss;
+ // loop in active fields containt active_value_language
+ // this called wiswig loader
foreach($class::$InitInfo['edit']['listing'] as $key=>$row ){
if(substr($key, 0,5) == 'edit_' && isset($row['active_value_language']) && $row['active_value_language'] ) {
@@ -344,6 +356,7 @@
break;
case 'copy_to':
+ // check if Id > 0 and this sqlxx::fetch return correct data
if($class::$Id > 0)
if(!$sqlclass::fetch(array('id'=>(int)$class::$Id), true) ) {
self::PutMessage(
@@ -431,7 +444,8 @@
*/
case 'new_light':
case 'new':
- $action = 'edit';
+ $action = 'new';
+ break;
case 'edit':
case 'noedit':
$action = 'edit';
Modified: trunk/catalog/admin/includes/classes/drivers/sqladminmenu.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqladminmenu.php 2014-02-10 21:16:21 UTC (rev 5134)
+++ trunk/catalog/admin/includes/classes/drivers/sqladminmenu.php 2014-02-11 00:04:28 UTC (rev 5135)
@@ -3,79 +3,106 @@
@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 29/10/2013, 20:11
+ @version 2.1.1
+ @date 22/09/11, 20:11
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
- @file sqladminuser.php
- @dir admin/includes/classes/drivers/
+ @class sqladminmenu
+ @brief Manage delete/update/insert in table admin groupe
+
+TODO :
+
+ EN cours de dev
+
+
+CREATE TABLE IF NOT EXISTS `osc_admin_m_menu` (
+ `rowid` int(11) NOT NULL AUTO_INCREMENT,
+ `admin_url` varchar(128) NOT NULL COMMENT 'fichier, avec get',
+ `sort_order` int(11) NOT NULL,
+ `parent_id` int(11) NOT NULL,
+ PRIMARY KEY (`rowid`),
+ UNIQUE KEY `admin_files_name` (`admin_url`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=115 ;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `osc_admin_m_menu_description`
+--
+
+CREATE TABLE IF NOT EXISTS `osc_admin_m_menu_description` (
+ `rowid` int(11) NOT NULL,
+ `language_id` int(11) NOT NULL,
+ `title` varchar(250) NOT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `osc_admin_m_menu_to_right`
+--
+
+CREATE TABLE IF NOT EXISTS `osc_admin_m_menu_to_right` (
+ `menu_id` int(11) DEFAULT NULL,
+ `type_id` int(1) NOT NULL COMMENT '0 group / 1 user',
+ `id_ref` int(11) DEFAULT NULL,
+ UNIQUE KEY `menuusergroup` (`menu_id`,`type_id`,`id_ref`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
*/
-require_once( DIR_FS_ADMIN . DIR_WS_CLASSES . 'SqlFilesDataDriverClass.php');
-/**
- @class sqladminuser
-*/
-class sqladminuser
- Extends SqlFilesDataDriverClass
+
+
+class sqladminmenu
implements ModSqlDataDriver{
-
+ /**
+ @var object childs module class
+ */
public static $modules;
-
+ /**
+ @var current ressource class
+ */
protected static $_instance;
+ /**
+ @var string error detail
+ */
+ public static $error = false;
+ /**
+ @brief constructor
+ no direct call, but is auto call by static public method
+ This method init Childs modules class
+ */
protected function __construct(){
- self::$modules=new AcaFactory('adminuser');
+ self::$modules=new AcaFactory('adminuser'/*,'MODULE_ACACAT_INSTALLED_BO'*/);
}
-
+ /**
+ @brief for call construct class in singletown
+ @return current instance
+ */
public static function getInstance() {
if(self::$_instance == null) self::$_instance = new self();
return self::$_instance;
}
-
/**
@brief create new ligne in table configuration
*/
public static function create($option){
self::getInstance();
- $DB=Database::getInstance();
- $error = 0 ;
- $specimen = self::Specimen();
- $post =(isset($option['post'])? $option['post'] : array() );
- $dataarray =(isset($option['sqlarray'])? $option['sqlarray'] : array() );
+ if(isset($option['admin_url'])) $sql_data_array['admin_url'] = $option['admin_url'];
+ if(isset($option['sort_order'])) $sql_data_array['sort_order'] = $option['sort_order'];
+ if(isset($option['parent_id'])) $sql_data_array['parent_id'] = $option['parent_id'];
- self::PrepaDataAfterUse( $specimen , $dataarray, $post );
- $sql_data_array = self::GetSqlArray();
-
- if(!isset($option['password']))
- return false;
+ $res=tep_db_perform(TABLE_ADMIN_MENU, $sql_data_array);
+
+ if(!$res)
+ return $res;
else
- $sql_data_array['admin_password'] = (string)$option['password'];
-
- $DB->beginTransaction();
-
- if(count($sql_data_array) > 0) {
- $sql_data_array['admin_created'] = 'now()';
-
- $res = tep_db_perform(TABLE_ADMIN, $sql_data_array) ;
- if( !$res )
- $error++;
- }
- else
- $error++;
-
- if( $error > 0){
- $DB->rollbackTransaction();
- return false;
- }
- else{
- $id = $res->__get('insertId');
- $DB->commitTransaction();
- return $id;
- }
+ return $res->__get('insertId');
}
/**
@@ -84,83 +111,59 @@
public static function update($option){
self::getInstance();
- if(!isset($option['id']) )
- return false;
+ if(!isset($option['id']) ){
+ self::$error= 'no id';
+ return false;
+ }else
+ $id = (int)$option['id'];
- $DB=Database::getInstance();
- $error = 0 ;
- $specimen = self::Specimen();
+ if(isset($option['rowid'])) $sql_data_array['rowid'] = $id;
+ if(isset($option['admin_url'])) $sql_data_array['admin_url'] = $option['admin_url'];
+ if(isset($option['sort_order'])) $sql_data_array['sort_order'] = $option['sort_order'];
+ if(isset($option['parent_id'])) $sql_data_array['parent_id'] = $option['parent_id'];
- $post =(isset($option['post'])? $option['post'] : array() );
- $dataarray =(isset($option['sqlarray'])? $option['sqlarray'] : array() );
- self::PrepaDataAfterUse( $specimen , $dataarray, $post );
-
- $sql_data_array = self::GetSqlArray();
+ $res=tep_db_perform(TABLE_ADMIN_MENU, $sql_data_array, 'update' , substr($where,3) );
- $where ='';
- if(isset($option['id'])) $where .="AND admin_id = '".(int)$option['id']."' ";
+ return $res;
+ }
- $DB->beginTransaction();
- 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;
-
- if( $error > 0){
- $DB->rollbackTransaction();
- return false;
- }
- else{
- $DB->commitTransaction();
- return 1;
- }
- }
-
/**
@brief load ligne in table configuration
@param option array
- id => row id int (configuration_id)
- key => string key (configuration_key)
- group_id => group_id int (configuration_group_id)
+ id => row id int (configuration_id)
+ key => string key (configuration_key)
+ group_id => group_id int (configuration_group_id)
@param $shortkey use cleankey for return short key
@return
object(stdClass)[13]
- public 'id' => string '1' (length=1)
+ public 'id' => string '1' (length=1)
OR
- array(
- object(stdClass)[13]
- ...
- object(stdClass)[13]
- ..
- )
+ array(
+ object(stdClass)[13]
+ ...
+ object(stdClass)[13]
+ ..
+ )
*/
public static function fetch($option,$shortkey=false){
self::getInstance();
- $DB=Database::getInstance();
- $error = 0 ;
+ $DB=Database::getInstance();
-
$sql ="";
if(isset($option['id'])) $sql .="AND admin_id = '".(int)tep_db_input($option['id'])."' ";
- if(isset($option['group_id'])) $sql .="AND a.admin_groups_id = '".(int)tep_db_input($option['group_id'])."' ";
- if(isset($option['email'])) $sql .="AND admin_email_address = '".(int)tep_db_input($option['email'])."' ";
- if(isset($option['uniqkey'])) $sql .="AND url_openid = '".(string)tep_db_input($option['uniqkey'])."' ";
+ if(isset($option['group_id'])) $sql .="AND a.admin_groups_id = '".(int)(string)tep_db_input($option['group_id'])."' ";
- $sql="SELECT * FROM " . TABLE_ADMIN . " a ".
- " LEFT JOIN " . TABLE_ADMIN_GROUPS . " g ON (a.admin_groups_id=g.admin_groups_id) ".
- " WHERE 1 ".$sql;
+ $sql="SELECT * FROM " . TABLE_ADMIN_MENU . " a ".
+ " LEFT JOIN " . TABLE_ADMIN_MENU_GROUPS . " g ON (a.admin_groups_id=g.admin_groups_id) ".
+ " WHERE ".substr($sql,3);
$res=$DB->query($sql);
@@ -174,7 +177,7 @@
$array=array();
foreach($res->fetchAllAssoc() as $result)
- $array[]= ((!$shortkey)? $result : self::CleanKey($result));
+ $array[]= ((!$shortkey)? $result : self::CleanKey($result));
return $array;
}
@@ -195,10 +198,15 @@
return false;
- sqladminnotification::delete( array('user_id'=> (int)$_id , 'type'=>'1'));
+ // ACA START DELETE
+ self::$modules->delete($_id);
- $DB->query("delete from " . TABLE_ADMIN . " where admin_id = '" . (int)$_id . "'");
+// $DB->query("delete from " . TABLE_ADMIN_MENU_NOTIFICATION . " where rowid = '" . (int)$_id . "' AND notif_type = '1' ");
+
+ $DB->query("delete from " . TABLE_ADMIN_MENU . " where rowid = '" . (int)$_id . "'");
+
+
return true;
}
@@ -207,37 +215,17 @@
@brief
@return array product empty
*/
- public static function Specimen($shortkey=false){
- $par = array(
- 'admin_id' => -1,
- 'admin_groups_id' => 0,
- 'admin_firstname' => '',
- 'admin_lastname' => '',
- 'admin_email_address' => '',
- 'admin_modified' => '',
- 'admin_password' => '',
- 'admin_language_id' => 0,
- 'admin_status' => 0,
- 'url_openid' => '',
- );
+ public static function Specimen(){
+ $par = array('rowid' => '',
+ 'admin_url' => '',
+ 'sort_order' => '',
+ 'parent_id' => '',
+ );
- return ((!$shortkey)? $par : self::CleanKey($par));
+ return 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 CleanKey()
@brief Clean string name key
@@ -247,13 +235,11 @@
$object= new stdclass();
foreach($array as $key=>$value){
- if( strpos($key,'admin_') ===0)
- $key=substr($key,6);
- elseif( $key =='url_openid')
- $key='uniqkey';
+ if( strpos($key,'admin_') ===0)
+ $key=substr($key,6);
- $object->$key = $value;
+ $object->$key = $value;
}
return $object;
Modified: trunk/catalog/admin/includes/classes/drivers/sqlcategorie.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlcategorie.php 2014-02-10 21:16:21 UTC (rev 5134)
+++ trunk/catalog/admin/includes/classes/drivers/sqlcategorie.php 2014-02-11 00:04:28 UTC (rev 5135)
@@ -84,12 +84,19 @@
$sql_data_array_lg = self::GetSqlArrayLg();
$DB->beginTransaction();
-
-
+
+ // Fix for create by no step type
+ if(count($sql_data_array) ==0){
+ $sql_data_array['parent_id'] = 0;
+ $sql_data_array['categories_datatype'] = DATATYPES_DEFAULT_NOSELECTED;
+ }
+
if(count($sql_data_array) > 0){
if(isset($sql_data_array['categories_datatype']) && $sql_data_array['categories_datatype'] =='-1')
$sql_data_array['categories_datatype'] = '';
+ $sql_data_array['date_added'] = 'NOW()';
+
$modules->get_insert_table_categories($sql_data_array,'');
$res=tep_db_perform(TABLE_CATEGORIES, $sql_data_array);
@@ -118,7 +125,7 @@
// language table
- if( $error <= 0)
+ 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['categories_id'] = $categories_id;
@@ -126,10 +133,27 @@
if(!$res)
$error++;
}
+ else{
+ for ($i=0, $n=sizeof($list_languages); $i<$n; $i++) {
+
+ $language_id = $list_languages[$i]['id'];
+
+ $sql_data_array = array(
+ 'categories_name' => '',
+ 'categories_description' => '',
+ 'categories_id' => $categories_id,
+ 'language_id' => $language_id
+ );
+
+ $res=tep_db_perform(TABLE_CATEGORIES_DESCRIPTION, $sql_data_array);
+ if(!$res)
+ $error++;
+ }
+ }
+ }
/// Child module, Call After Update process
$modules->after_update($categories_id);
-
if( $error > 0){
$DB->rollbackTransaction();
return false;
@@ -294,7 +318,6 @@
foreach($cInfo_array as $row) {
-
if($languages_id > 0)
$check_q = $DB->query($sql="select * from " . TABLE_CATEGORIES_DESCRIPTION . " cd where categories_id = '" .(int) $row['categories_id'] . "' AND language_id = '".(int)$languages_id."' ");
else
@@ -302,11 +325,7 @@
$row['lg'] = array();
foreach($check_q->fetchAllAssoc() as $catlg){
- $row['name'][$catlg['language_id']] = $catlg['categories_name'];
- $row['description'][$catlg['language_id']] = $catlg['categories_description'];
-
- $row['lg'][$catlg['language_id']]['categories_name'] = $catlg['categories_name'];
- $row['lg'][$catlg['language_id']]['categories_description'] = $catlg['categories_description'];
+ $row['lg'][$catlg['language_id']] = ((!$shortkey)? $catlg : self::CleanKey($catlg)) ;
}
$datatypes = array_map('trim',explode(',',$row['categories_datatype']));
@@ -414,11 +433,13 @@
$tmp_lg = array();
for ($i=0, $n=sizeof($ListLanguages); $i<$n; $i++) {
- $tmp_lg[$ListLanguages[$i]['id']] = array(
- 'categories_name' => '', // depend language table
+ $tmp = array(
+ 'categories_name' => ' ', // depend language table
'categories_description' => '', // depend language table
'language_id' => $ListLanguages[$i]['id'],
);
+
+ $tmp_lg[$ListLanguages[$i]['id']] = ((!$shortkey)? $tmp : self::CleanKey($tmp));
}
$result = array(
@@ -429,14 +450,10 @@
'categories_image'=>'',
'categories_status'=>0,
'categories_hidden'=>0,
-
+
// language table
'lg' =>$tmp_lg,
-
- // olds , not use
-// 'categories_name' =>array(1 =>'' ),
-// 'categories_description' =>array(1 =>'' ),
-
+
'mod'=>$modules->Specimen($shortkey), // other external sub module
);
Modified: trunk/catalog/admin/includes/classes/drivers/sqlcontent.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlcontent.php 2014-02-10 21:16:21 UTC (rev 5134)
+++ trunk/catalog/admin/includes/classes/drivers/sqlcontent.php 2014-02-11 00:04:28 UTC (rev 5135)
@@ -57,7 +57,11 @@
$DB->beginTransaction();
- if(count($sql_data_array) > 0) {
+ // for create empty data
+ if(count($sql_data_array) ==0)
+ $sql_data_array['content_name'] = '';
+
+ if(count($sql_data_array) > 0 ) {
$sql_data_array['date_added'] = 'now()';
// $sql_data_array = array_merge($sql_data_array, self::$modules->get_insert_table_content());
@@ -265,31 +269,19 @@
foreach($cInfo_array as $row) {
- if(!isset($option['language_id'])){
- // call all langue for this post
- for ($i=0, $n=sizeof($list_languages); $i<$n; $i++) {
- $language_id = $list_languages[$i]['id'];
- $content_query = $DB->query("select cd.content_text, cd.content_title from " . TABLE_CONTENT_DESCRIPTION . " cd where cd.content_id = '" . (int)$row['content_id'] . "' AND language_id='" . $language_id . "'");
- $content = tep_db_fetch_array($content_query);
- $row['text'][$language_id] = $content['content_text'];
- $row['title'][$language_id] = $content['content_title'];
+ if(isset($option['language_id']) && $option['language_id'] > 0)
+ $content_query = $DB->query("select cd.content_text, cd.content_title from " . TABLE_CONTENT_DESCRIPTION . " cd where cd.content_id = '" . (int)$row['content_id'] . "' AND language_id='" . (int)$option['language_id'] . "'");
+ else
+ $content_query = $DB->query("select cd.content_text, cd.content_title from " . TABLE_CONTENT_DESCRIPTION . " cd where cd.content_id = '" . (int)$row['content_id'] . "' ");
+
+ $row['lg'] = array();
+ foreach($content_query->fetchAllAssoc() as $item){
+ $row['lg'][$item['language_id']] = ((!$shortkey)? $item : self::CleanKey($item)) ;
+ }
+
+ tep_db_free_result($content_query);
- tep_db_free_result($content_query);
- }
- }
- else{
- $language_id = (int)$option['language_id'];
- $content_query = $DB->query("select cd.content_text, cd.content_title from " . TABLE_CONTENT_DESCRIPTION . " cd where cd.content_id = '" . (int)$row['content_id'] . "' AND language_id='" . $language_id . "'");
- $content = $content_query->fetchAssoc();
-
- $row['text'][$language_id] = $content['content_text'];
- $row['title'][$language_id] = $content['content_title'];
-
- tep_db_free_result($content_query);
- }
-
-
/*
Use transversal Datatype Rootlisting and update in data
*/
@@ -379,11 +371,13 @@
$tmp_lg = array();
for ($i=0, $n=sizeof($ListLanguages); $i<$n; $i++) {
- $tmp_lg[$ListLanguages[$i]['id']] = array(
+ $tmp = array(
'content_title' => '', // depend language table
'content_text' => '', // depend language table
'language_id' => $ListLanguages[$i]['id'],
);
+
+ $tmp_lg[$ListLanguages[$i]['id']] = ((!$shortkey)? $tmp : self::CleanKey($tmp));
}
$result = array(
@@ -399,11 +393,6 @@
'mod'=>$modules->Specimen($shortkey), // other external sub module
);
-// for ($i=0, $n=sizeof($list_languages); $i<$n; $i++) {
-// $result['cms_content']['content_text'][$list_languages[$i]['id']] = $result['text'][$list_languages[$i]['id']] = '';
-// $result['cms_content']['content_title'][$list_languages[$i]['id']] = $result['title'][$list_languages[$i]['id']] = '';
-// }
-
return ((!$shortkey)? $result : self::CleanKey($result));
}
Modified: trunk/catalog/admin/includes/classes/drivers/sqlfeatured.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlfeatured.php 2014-02-10 21:16:21 UTC (rev 5134)
+++ trunk/catalog/admin/includes/classes/drivers/sqlfeatured.php 2014-02-11 00:04:28 UTC (rev 5135)
@@ -207,10 +207,11 @@
$num = $res->__get('numRows');
- if($num == 1){
- $result=$res->fetchAssoc();
+ if($num >= 1){
+ $array=array();
+ global $languages_id;
-
+ foreach($res->fetchAllAssoc() as $result) {
// call all langue for this post
$whlg = '';
if(isset($option['language_id']))
@@ -222,30 +223,22 @@
$result['lg'][$row['languages_id']] = ((!$shortkey)? $row : self::CleanKey($row));
+ $array[]= $result;
+ }
+ }
+
- return ((!$shortkey)? $result : self::CleanKey($result));
+ if($num == 1){
+ return ((!$shortkey)? $array[0] : self::CleanKey($array[0])) ;
}
elseif($num > 1){
$array=array();
- global $languages_id;
- foreach($res->fetchAllAssoc() as $result) {
- // call all langue for this post
- $whlg = '';
- if(isset($option['language_id']))
- $whlg=" AND languages_id='" . $option['language_id'] . "' ";
+ foreach($array as $lg)
+ $array[]= ((!$shortkey)? $lg : self::CleanKey($lg));
- $_query = $DB->query("select languages_id , fd.featured_title from " . TABLE_FEATURED_DESCRIPTION . " fd where fd.featured_id = '" . (int)$result['row_id'] . "' ");
-
- foreach($_query->fetchAllAssoc() as $row)
- $result['lg'][$row['languages_id']] = ((!$shortkey)? $row : self::CleanKey($row));
-
-
- $array[]= ((!$shortkey)? $result : self::CleanKey($result));
- }
return $array;
}
-
return false;
}
Modified: trunk/catalog/admin/includes/classes/event_drivers/EventNotification.php
===================================================================
--- trunk/catalog/admin/includes/classes/event_drivers/EventNotification.php 2014-02-10 21:16:21 UTC (rev 5134)
+++ trunk/catalog/admin/includes/classes/event_drivers/EventNotification.php 2014-02-11 00:04:28 UTC (rev 5135)
@@ -21,7 +21,7 @@
{
- public function update(SplSubject $subject, EventNotificationInterface &$arg = NULL){
+ public function update(SplSubject $subject, EventNotificationListener &$arg = NULL){
$myarray = $arg->GetArray();
$myarray['from']=STORE_OWNER;
$myarray['email_use_html']=_cst_bool('EMAIL_USE_HTML');
Modified: trunk/catalog/admin/includes/classes/event_drivers/EventTriggersCache.php
===================================================================
--- trunk/catalog/admin/includes/classes/event_drivers/EventTriggersCache.php 2014-02-10 21:16:21 UTC (rev 5134)
+++ trunk/catalog/admin/includes/classes/event_drivers/EventTriggersCache.php 2014-02-11 00:04:28 UTC (rev 5135)
@@ -21,7 +21,7 @@
// EventNotify
{
- public function update(SplSubject $subject, EventTriggersCacheInterface &$arg = NULL){
+ public function update(SplSubject $subject, EventTriggersCacheListener &$arg = NULL){
if( !in_array($arg->GetAction(), array('listing','') ) ) {
// delete all cache content string 'Called'
Modified: trunk/catalog/admin/includes/classes/event_drivers/EventTriggersSqlMaintenance.php
===================================================================
--- trunk/catalog/admin/includes/classes/event_drivers/EventTriggersSqlMaintenance.php 2014-02-10 21:16:21 UTC (rev 5134)
+++ trunk/catalog/admin/includes/classes/event_drivers/EventTriggersSqlMaintenance.php 2014-02-11 00:04:28 UTC (rev 5135)
@@ -23,7 +23,7 @@
// EventNotify
{
- public function update(SplSubject $subject, EventTriggersSqlMaintenanceInterface &$arg = NULL){
+ public function update(SplSubject $subject, EventTriggersSqlMaintenanceListener &$arg = NULL){
//Specifific is not action
if( in_array($arg->GetAction(), array('listing','') ) ) {
Added: trunk/catalog/admin/includes/gabarit/MGabCont/display_view.new.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/MGabCont/display_view.new.gab (rev 0)
+++ trunk/catalog/admin/includes/gabarit/MGabCont/display_view.new.gab 2014-02-11 00:04:28 UTC (rev 5135)
@@ -0,0 +1,40 @@
+<?php
+/**
+ @licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
+ @package osCSS-2 <www http://www.oscss.org>
+ @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.new.gab
+ @dir admin/includes/gabarit/featureds/
+*/
+
+$page= MGabCont::CallSt('GetClassName');
+?>
+<h3><?php print __('text heading new', $page); ?></h3>
+<?php echo tep_draw_form('data_new', $page::FILENAME, 'action=insert', 'post'); ?>
+ <div class="block_form">
+ <div class="box_left">
+ <dl>
+ <dt class="block_input">
+
+ <?php echo $page::DisplayField('type','',$page::$Info); ?>
+ </dt>
+ </dl>
+ </div>
+
+ <div class="box_right" >
+ <p class="Info"><?php echo __('text info intro choose type', $page) ?></p>
+ </div>
+
+ <div class="button_nav">
+ <?php
+ echo tep_image_submit('button_preview.gif', IMAGE_ADD) .
+ tep_js_back(tep_href_link($page::FILENAME), IMAGE_CANCEL)
+ ?>
+ </div>
+
+ </div>
+
+</form>
\ No newline at end of file
Modified: trunk/catalog/admin/includes/languages/fr_FR/Adminuser.txt
===================================================================
--- trunk/catalog/admin/includes/languages/fr_FR/Adminuser.txt 2014-02-10 21:16:21 UTC (rev 5134)
+++ trunk/catalog/admin/includes/languages/fr_FR/Adminuser.txt 2014-02-11 00:04:28 UTC (rev 5135)
@@ -91,11 +91,22 @@
$lang['subject email text subject update account']="Modification de votre compte" ;
+/* Widget */
+ $lang['AdminUsersLast heading']="Utilisateurs privé" ;
+ $lang['AdminUsersLast tab added']="Creer" ;
+ $lang['AdminUsersLast tab updated']="Modifié" ;
+ $lang['AdminUsersLast box reference']="Réf." ;
+ $lang['AdminUsersLast box title']="Nom" ;
+ $lang['AdminUsersLast box date']="Crées le" ;
+ $lang['AdminUsersLast box date up']="Modifiés le" ;
+ $lang['AdminUsersLast box status']="Etat" ;
+
+/* other */
$lang['text info error email used']="Cette adresse Email est déjà utilisée " ;
$lang['js alert firstname']="Requis : Prénom " ;
$lang['your firstname must consist of at least 3 characters']="Votre prénom doit contenir au moins 3 caractères" ;
Modified: trunk/catalog/admin/includes/languages/fr_FR/Currencie.txt
===================================================================
--- trunk/catalog/admin/includes/languages/fr_FR/Currencie.txt 2014-02-10 21:16:21 UTC (rev 5134)
+++ trunk/catalog/admin/includes/languages/fr_FR/Currencie.txt 2014-02-11 00:04:28 UTC (rev 5135)
@@ -54,4 +54,10 @@
$lang['text info set as default']=" Definir comme valeur par defaut. (Requiert que vous utilisez la valeur 1.00 et lancer une mise à jour des devises)" ;
$lang['error remove default currency']="Erreur : La devise par défaut ne peut être supprimé. Merci de choisir une autre devise par défaut et de réessayer." ;
$lang['warning primary server failed']="Attention : Le serveur de taux de change primaire (%s) a echoué %s (%s) - essayer avec le serveur de taux de change secondaire." ;
+
+/* widget */
+ $lang['suivi des devises']="Suivi des devises" ;
+ $lang['currencies defaut current currencies']="Devise par defaut : " ;
+ $lang['currencies number configured devises']="Devises installées :" ;
+ $lang['currencies last update']="Dernière mise à jour des taux :" ;
?>
\ No newline at end of file
Modified: trunk/catalog/admin/includes/languages/fr_FR/Customer.txt
===================================================================
--- trunk/catalog/admin/includes/languages/fr_FR/Customer.txt 2014-02-10 21:16:21 UTC (rev 5134)
+++ trunk/catalog/admin/includes/languages/fr_FR/Customer.txt 2014-02-11 00:04:28 UTC (rev 5135)
@@ -148,6 +148,25 @@
/* */
$lang['text info delete customers ']="Vous confirmez la suppression de ce client ?!" ;
+
+/* Widget */
+ $lang['CustomerLast heading']="Client/membres" ;
+
+ $lang['CustomerLast tab added']="Nouveaux" ;
+ $lang['CustomerLast tab updated']="Modifiés" ;
+ $lang['CustomerLast tab da']="En attentes" ;
+ $lang['CustomerLast tab logon']="Connectés" ;
+
+ $lang['CustomerLast box reference']="Réf." ;
+ $lang['CustomerLast box customers']="Nom" ;
+ $lang['CustomerLast box date']="inscrit le" ;
+ $lang['CustomerLast box date up']="mise à jour" ;
+ $lang['CustomerLast box date log']="connecté le" ;
+ $lang['CustomerLast box available']="Att." ;
+ $lang['CustomerLast box status']="Etat" ;
+
+ $lang['box title graph new customers']="Insciption nouveaux clients" ;
+
/* Email subject */
$lang['subject copy creat new compte for customers']="Copie - creation de compte client par un admin" ;
$lang['creat new compte for customers']="Confirmation de votre inscription" ;
Modified: trunk/catalog/admin/includes/languages/fr_FR/Order.txt
===================================================================
--- trunk/catalog/admin/includes/languages/fr_FR/Order.txt 2014-02-10 21:16:21 UTC (rev 5134)
+++ trunk/catalog/admin/includes/languages/fr_FR/Order.txt 2014-02-11 00:04:28 UTC (rev 5135)
@@ -15,6 +15,7 @@
$lang['heading title search']="ID commande :" ;
$lang['heading title status']="Statut :" ;
+
/* Listing */
/* Filter */
$lang['view filtres for listing']="Options des filtres" ;
@@ -184,8 +185,30 @@
+/* Widget */
+ $lang['orderLast box title']="Commandes" ;
+ $lang['orderLast tab added']="Nouvelles" ;
+ $lang['orderLast tab updated']="Modifiées" ;
+
+ $lang['orderLast box reference']="Réf." ;
+ $lang['orderLast box docs']="Doc." ;
+ $lang['orderLast box customers']="Clients" ;
+ $lang['orderLast box date']="date" ;
+ $lang['orderLast box status']="Etat" ;
+
+ $lang['orderLastinvoice box title']="Les dernières commande facturé" ;
+ $lang['orderLastinvoice box reference']="Réf." ;
+ $lang['orderLastinvoice box docs']="Doc." ;
+ $lang['orderLastinvoice box customers']="Clients" ;
+ $lang['orderLastinvoice box date']="date" ;
+ $lang['orderLastinvoice box status']="Etat" ;
+
+
+ $lang['box title orders']="Commandes" ;
+
+
/* A voir si encoer utilise */
$lang['qty orders']="Cmd" ;
$lang['qty exedie']="Exp" ;
Copied: trunk/catalog/admin/includes/languages/fr_FR/Service.txt (from rev 5128, trunk/catalog/admin/includes/languages/fr_FR/modules/pages/services.txt)
===================================================================
--- trunk/catalog/admin/includes/languages/fr_FR/Service.txt (rev 0)
+++ trunk/catalog/admin/includes/languages/fr_FR/Service.txt 2014-02-11 00:04:28 UTC (rev 5135)
@@ -0,0 +1,39 @@
+<?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 04/03/2012, 16:07
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+*/
+$lang['heading title services']="Services" ;
+
+
+
+/* Listing */
+ $lang['@services table heading service id']="n°" ;
+ $lang['@services table heading service ref']="Ref." ;
+ $lang['@services table heading orders id']="Cmd n°" ;
+ $lang['@services table heading orders products id']="Produit" ;
+ $lang['@services table heading customers id']="Clients" ;
+ $lang['@services table heading date added']="Ajouté le" ;
+ $lang['@services table heading date start']="Activé le" ;
+ $lang['@services table heading date end']="Désactive le" ;
+ $lang['@services table heading date revival']="Renouvellement le" ;
+ $lang['@services table heading auto retry']="Reconduction" ;
+ $lang['@services table heading service status']="Etat" ;
+ $lang['@services table heading duration']="Durée" ;
+ $lang['@services table heading duration unit']="Durée unité" ;
+ $lang['@services table heading action']="Action" ;
+
+/* Widget */
+ $lang['orderLastservice box title']="Les derniers services" ;
+ $lang['orderLastservice box reference']="Réf." ;
+ $lang['orderLastservice box docs']="Doc." ;
+ $lang['orderLastservice box customers']="Clients" ;
+ $lang['orderLastservice box date']="date" ;
+ $lang['orderLastservice box date start']="depuis" ;
+ $lang['orderLastservice box status']="Etat" ;
+?>
\ No newline at end of file
Modified: trunk/catalog/admin/includes/languages/fr_FR/Shipping.txt
===================================================================
--- trunk/catalog/admin/includes/languages/fr_FR/Shipping.txt 2014-02-10 21:16:21 UTC (rev 5134)
+++ trunk/catalog/admin/includes/languages/fr_FR/Shipping.txt 2014-02-11 00:04:28 UTC (rev 5135)
@@ -8,7 +8,7 @@
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
*/
-$lang['heading title shipping']="Expeditions vers les clients" ;
+$lang['heading title shippings']="Expeditions vers les clients" ;
$lang['@shipping filter tab clause']="Généric" ;
@@ -23,7 +23,7 @@
$lang['@shipping table heading method']="Méthode" ;
$lang['@shipping table heading status']="Etat" ;
$lang['@shipping table heading pdf']="pdf" ;
- $lang['@shipping table heading action']="Action" ;
+ $lang['@shippings table heading action']="Action" ;
/* mutli */
@@ -43,8 +43,8 @@
$lang['@shipping heading edit num %s ref %s']="Edition fiche expedition n°%s - ref : %s" ;
/* entry */
- $lang['tab shipping briefs']="Description" ;
- $lang['tab shipping details']="Suivi" ;
+ $lang['tab data']="Caractéristique" ;
+ $lang['tab suivi']="Suivi" ;
$lang['shipping date expedition']="Expedité le : " ;
$lang['shipping method']="Méthode" ;
@@ -75,11 +75,23 @@
/* text */
$lang['text info delete shipping']="Vous confirmer vouloir supprimer cette expedition ?!" ;
+/* Widget */
+ $lang['orderLastshipp box title']="Les dernières expeditions" ;
+ $lang['orderLastshipp tab added']="Créer" ;
+ $lang['orderLastshipp tab updated']="Modifiées" ;
+
+ $lang['orderLastshipp box reference']="Réf." ;
+ $lang['orderLastshipp box docs']="Doc." ;
+ $lang['orderLastshipp box customers']="Clients" ;
+ $lang['orderLastshipp box date']="date" ;
+ $lang['orderLastshipp box status']="Etat" ;
+
/* Value list */
$lang['@shipping action txt print bl']="Generation des bons de livraisons/preparation" ;
+
/* status */
$lang['shipping opened']="Ouverte" ;
Modified: trunk/catalog/admin/includes/languages/fr_FR/Stock.txt
===================================================================
--- trunk/catalog/admin/includes/languages/fr_FR/Stock.txt 2014-02-10 21:16:21 UTC (rev 5134)
+++ trunk/catalog/admin/includes/languages/fr_FR/Stock.txt 2014-02-11 00:04:28 UTC (rev 5135)
@@ -39,4 +39,14 @@
/* message */
$lang['@stock error in update stock']="Erreur lors de la mise à jour du stock" ;
$lang['@stock success update stock']="Succes de la mise à jour du stock" ;
+
+
+/* widget */
+ $lang['heading stock %s']="Suivi de stock d'alerte (x %s)" ;
+
+ $lang['homeStock box id']="Id" ;
+ $lang['homeStock box reference']="Réf." ;
+ $lang['homeStock box name']="Produits" ;
+ $lang['homeStock box stock']="Stock" ;
+ $lang['homeStock box status']="Etat" ;
?>
\ No newline at end of file
Modified: trunk/catalog/admin/includes/languages/fr_FR/modules/account/account_extra.txt
===================================================================
--- trunk/catalog/admin/includes/languages/fr_FR/modules/account/account_extra.txt 2014-02-10 21:16:21 UTC (rev 5134)
+++ trunk/catalog/admin/includes/languages/fr_FR/modules/account/account_extra.txt 2014-02-11 00:04:28 UTC (rev 5135)
@@ -11,4 +11,8 @@
$lang['account extra info']="Gestion des champs supplémentaires pour les clients/membres" ;
$lang['Gerer le contenu des champs supplementaires client/membre']="Gérer le contenu des champs supplémentaires client/membre" ;
$lang['Extra']="Extra" ;
+
+
+$lang['address_book heading delete']="Supprimer une addresse" ;
+
?>
\ No newline at end of file
Deleted: trunk/catalog/admin/includes/languages/fr_FR/modules/pages/services.txt
===================================================================
--- trunk/catalog/admin/includes/languages/fr_FR/modules/pages/services.txt 2014-02-10 21:16:21 UTC (rev 5134)
+++ trunk/catalog/admin/includes/languages/fr_FR/modules/pages/services.txt 2014-02-11 00:04:28 UTC (rev 5135)
@@ -1,32 +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 04/03/2012, 16:07
- @author oscim <mail aur...@os...> <www http://www.oscim.fr>
- @encode UTF-8
-*/
-$lang['heading title services']="Services" ;
-
-
-
-/* Listing */
- $lang['@services table heading service id']="n°" ;
- $lang['@services table heading service ref']="Ref." ;
- $lang['@services table heading orders id']="Cmd n°" ;
- $lang['@services table heading orders products id']="Produit" ;
- $lang['@services table heading customers id']="Clients" ;
- $lang['@services table heading date added']="Ajouté le" ;
- $lang['@services table heading date start']="Activé le" ;
- $lang['@services table heading date end']="Désactive le" ;
- $lang['@services table heading date revival']="Renouvellement le" ;
- $lang['@services table heading auto retry']="Reconduction" ;
- $lang['@services table heading service status']="Etat" ;
- $lang['@services table heading duration']="Durée" ;
- $lang['@services table heading duration unit']="Durée unité" ;
- $lang['@services table heading action']="Action" ;
-
-
-?>
\ No newline at end of file
Deleted: trunk/catalog/admin/includes/languages/fr_FR/modules/pages/stock.txt
===================================================================
--- trunk/catalog/admin/includes/languages/fr_FR/modules/pages/stock.txt 2014-02-10 21:16:21 UTC (rev 5134)
+++ trunk/catalog/admin/includes/languages/fr_FR/modules/pages/stock.txt 2014-02-11 00:04:28 UTC (rev 5135)
@@ -1,24 +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 10/04/2012 , 15:00:00
- @author oscim <mail aur...@os...> <www http://www.oscim.fr>
- @encode UTF-8
-*/
-$lang['products stock']="Produits en stock" ;
-$lang['table title attributes']="Attributs" ;
-
-$lang['table heading id']="id" ;
-$lang['table heading name']="Produits" ;
-$lang['table heading model']="Modèle" ;
-$lang['table heading stock']="Stock" ;
-$lang['table heading mode stock']="Mode" ;
-$lang['table heading action']="Actions" ;
-
-$lang['@stock track stock in stock']="En stock" ;
-$lang['@stock track stock no stock']="Hors stock" ;
-$lang['@stock track stock limited']="Fin de serie" ;
-?>
\ No newline at end of file
Deleted: trunk/catalog/admin/includes/languages/fr_FR/widget/AdminUsersLast.txt
===================================================================
--- trunk/catalog/admin/includes/languages/fr_FR/widget/AdminUsersLast.txt 2014-02-10 21:16:21 UTC (rev 5134)
+++ trunk/catalog/admin/includes/languages/fr_FR/widget/AdminUsersLast.txt 2014-02-11 00:04:28 UTC (rev 5135)
@@ -1,23 +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 02/03/2012, 20:02
- @author oscim <mail aur...@os...> <www http://www.oscim.fr>
- @encode UTF-8
-*/
-$lang['AdminUsersLast heading']="Utilisateurs privé" ;
-
-$lang['AdminUsersLast tab added']="Creer" ;
-$lang['AdminUsersLast tab updated']="Modifié" ;
-
-
-$lang['AdminUsersLast box reference']="Réf." ;
-$lang['AdminUsersLast box title']="Nom" ;
-$lang['AdminUsersLast box date']="Crées le" ;
-$lang['AdminUsersLast box date up']="Modifiés le" ;
-$lang['AdminUsersLast box status']="Etat" ;
-
-?>
\ No newline at end of file
Deleted: trunk/catalog/admin/includes/languages/fr_FR/widget/CustomerLast.txt
===================================================================
--- trunk/catalog/admin/includes/languages/fr_FR/widget/CustomerLast.txt 2014-02-10 21:16:21 UTC (rev 5134)
+++ trunk/catalog/admin/includes/languages/fr_FR/widget/CustomerLast.txt 2014-02-11 00:04:28 UTC (rev 5135)
@@ -1,25 +0,0 @@
-<?php
-/**
- @licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
- @portion code Copyright (c) 2002 osCommerce
- @package osCSS-2 <www http://www.oscss.org>
- @version 2.1.1
- @date 02/03/2012, 20:02
- @author oscim <mail aur...@os...> <www http://www.oscim.fr>
- @encode UTF-8
-*/
-$lang['CustomerLast heading']="Client/membres" ;
-
-$lang['CustomerLast tab added']="Nouveaux" ;
-$lang['CustomerLast tab updated']="Modifiés" ;
-$lang['CustomerLast tab da']="En attentes" ;
-$lang['CustomerLast tab logon']="Connectés" ;
-
-$lang['CustomerLast box reference']="Réf." ;
-$lang['CustomerLast box customers']="Nom" ;
-$lang['CustomerLast box date']="inscrit le" ;
-$lang['CustomerLast box date up']="mise à jour" ;
-$lang['CustomerLast box date log']="connecté le" ;
-$lang['CustomerLast box available']="Att." ;
-$lang['CustomerLast box status']="Etat" ;
-?>
\ No newline at end of file
Deleted: trunk/catalog/admin/includes/languages/fr_FR/widget/NewCustomersStats.txt
===================================================================
--- trunk/catalog/admin/includes/languages/fr_FR/widget/NewCustomersStats.txt 2014-02-10 21:16:21 UTC (rev 5134)
+++ trunk/catalog/admin/includes/languages/fr_FR/widget/NewCustomersStats.txt 2014-02-11 00:04:28 UTC (rev 5135)
@@ -1,11 +0,0 @@
-<?php
-/**
- @licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
- @package osCSS-2 <www http://www.oscss.org>
- @version 2.1.1
- @date 24/04/2012, 15:49
- @author oscim <mail aur...@os...> <www http://www.oscim.fr>/
- @encode UTF-8
-*/
-$lang['box title graph new customers']="Insciption nouveaux clients" ;
-?>
\ No newline at end of file
Deleted: trunk/catalog/admin/includes/languages/fr_FR/widget/currencies_update_server.txt
===================================================================
--- trunk/catalog/admin/includes/languages/fr_FR/widget/currencies_update_server.txt 2014-02-10 21:16:21 UTC (rev 5134)
+++ trunk/catalog/admin/includes/languages/fr_FR/widget/currencies_update_server.txt 2014-02-11 00:04:28 UTC (rev 5135)
@@ -1,15 +0,0 @@
-<?php
-/**
- @licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
- @portion code Copyright (c) 2002 osCommerce
- @package osCSS-2 <www http://www.oscss.org>
- @version 2.1.1
- @date 26/04/2012, 20:02
- @author oscim <mail aur...@os...> <www http://www.oscim.fr>
- @encode UTF-8
-*/
-$lang['suivi des devises']="Suivi des devises" ;
-$lang['currencies defaut current currencies']="Devise par defaut : " ;
-$lang['currencies number configured devises']="Devises installées :" ;
-$lang['currencies last update']="Dernière mise à jour des taux :" ;
-?>
\ No newline at end of file
Deleted: trunk/catalog/admin/includes/languages/fr_FR/widget/homeStock.txt
===================================================================
--- trunk/catalog/admin/includes/languages/fr_FR/widget/homeStock.txt 2014-02-10 21:16:21 UTC (rev 5134)
+++ trunk/catalog/admin/includes/languages/fr_FR/widget/homeStock.txt 2014-02-11 00:04:28 UTC (rev 5135)
@@ -1,18 +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 20/07/2013, 20:02
- @author oscim <mail aur...@os...> <www http://www.oscim.fr>
- @encode UTF-8
-*/
-$lang['heading stock %s']="Suivi de stock d'alerte (x %s)" ;
-
-$lang['homeStock box id']="Id" ;
-$lang['homeStock box reference']="Réf." ;
-$lang['homeStock box name']="Produits" ;
-$lang['homeStock box stock']="Stock" ;
-$lang['homeStock box status']="Etat" ;
-?>
\ No newline at end of file
Deleted: trunk/catalog/admin/includes/languages/fr_FR/widget/orderLast.txt
===================================================================
--- trunk/catalog/admin/includes/languages/fr_FR/widget/orderLast.txt 2014-02-10 21:16:21 UTC (rev 5134)
+++ trunk/catalog/admin/includes/languages/fr_FR/widget/orderLast.txt 2014-02-11 00:04:28 UTC (rev 5135)
@@ -1,22 +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 0203/2012, 20:02
- @author oscim <mail aur...@os...> <www http://www.oscim.fr>
- @encode UTF-8
-*/
-$lang['orderLast box title']="Commandes" ;
-
-$lang['orderLast tab added']="Nouvelles" ;
-$lang['orderLast tab updated']="Modifiées" ;
-
-
-$lang['orderLast box reference']="Réf." ;
-$lang['orderLast box docs']="Doc." ;
-$lang['orderLast box customers']="Clients" ;
-$lang['orderLast box date']="date" ;
-$lang['orderLast box status']="Etat" ;
-?>
\ No newline at end of file
Deleted: trunk/catalog/admin/includes/languages/fr_FR/widget/orderLastinvoice.txt
===================================================================
--- trunk/catalog/admin/includes/languages/fr_FR/widget/orderLastinvoice.txt 2014-02-10 21:16:21 UTC (rev 5134)
+++ trunk/catalog/admin/includes/languages/fr_FR/widget/orderLastinvoice.txt 2014-02-11 00:04:28 UTC (rev 5135)
@@ -1,17 +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 0203/2012, 20:02
- @author oscim <mail aur...@os...> <www http://www.oscim.fr>
- @encode UTF-8
-*/
-$lang['orderLastinvoice box title']="Les dernières commande facturé" ;
-$lang['orderLastinvoice box reference']="Réf." ;
-$lang['orderLastinvoice box docs']="Doc." ;
-$lang['orderLastinvoice box customers']="Clients" ;
-$lang['orderLastinvoice box date']="date" ;
-$lang['orderLastinvoice box status']="Etat" ;
-?>
\ No newline at end of file
Deleted: trunk/catalog/admin/includes/languages/fr_FR/widget/orderLastservice.txt
===================================================================
--- trunk/catalog/admin/includes/languages/fr_FR/widget/orderLastservice.txt 2014-02-10 21:16:21 UTC (rev 5134)
+++ trunk/catalog/admin/includes/languages/fr_FR/widget/orderLastservice.txt 2014-02-11 00:04:28 UTC (rev 5135)
@@ -1,18 +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 0203/2012, 20:02
- @author oscim <mail aur...@os...> <www http://www.oscim.fr>
- @encode UTF-8
-*/
-$lang['orderLastservice box title']="Les derniers services" ;
-$lang['orderLastservice box reference']="Réf." ;
-$lang['orderLastservice box docs']="Doc." ;
-$lang['orderLastservice box customers']="Clients" ;
-$lang['orderLastservice box date']="date" ;
-$lang['orderLastservice box date start']="depuis" ;
-$lang['orderLastservice box status']="Etat" ;
-?>
\ No newline at end of file
Deleted: trunk/catalog/admin/includes/languages/fr_FR/widget/orderLastshipp.txt
===================================================================
--- trunk/catalog/admin/includes/languages/fr_FR/widget/orderLastshipp.txt 2014-02-10 21:16:21 UTC (rev 5134)
+++ trunk/catalog/admin/includes/languages/fr_FR/widget/orderLastshipp.txt 2014-02-11 00:04:28 UTC (rev 5135)
@@ -1,21 +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 06/11/2013, 20:02
- @author oscim <mail aur...@os...> <www http://www.oscim.fr>
- @encode UTF-8
-*/
-$lang['orderLastshipp box title']="Les dernières expeditions" ;
-
-$lang['orderLastshipp tab added']="Créer" ;
-$lang['orderLastshipp tab updated']="Modifiées" ;
-
-$lang['orderLastshipp box reference']="Réf." ;
-$lang['orderLastshipp box docs']="Doc." ;
-$lang['orderLastshipp box customers']="Clients" ;
-$lang['orderLastshipp box date']="date" ;
-$lang['orderLastshipp box status']="Etat" ;
-?>
\ No newline at end of file
Deleted: trunk/catalog/admin/includes/languages/fr_FR/widget/orderStats.txt
===================================================================
--- trunk/catalog/admin/includes/languages/fr_FR/widget/orderStats.txt 2014-02-10 21:16:21 UTC (rev 5134)
+++ trunk/catalog/admin/includes/languages/fr_FR/widget/orderStats.txt 2014-02-11 00:04:28 UTC (rev 5135)
@@ -1,11 +0,0 @@
-<?php
-/**
- @licence GPL 2005-2010 The osCSS developers - osCSS Open Source E-commerce
- @package osCSS-2 <www http://www.oscss.org>
- @version 2.1.0
- @date 14/01/11, 15:49
- @author oscim <mail aur...@os...> <www http://www.oscim.fr>
- @encode UTF-8
-*/
-$lang['box title orders']="Commandes" ;
-?>
\ No newline at end of file
Modified: trunk/catalog/admin/includes/modules/pages/categories.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/categories.php 2014-02-10 21:16:21 UTC (rev 5134)
+++ trunk/catalog/admin/includes/modules/pages/categories.php 2014-02-11 00:04:28 UTC (rev 5135)
@@ -137,9 +137,6 @@
'sWhere'=>'',
);
-
- MGabCont::SetCurrentName(__CLASS__);
-
self::$allfields = array();
self::$allfields['cat.categories_id'] = array(
@@ -229,14 +226,15 @@
'sort'=>true,
'alias'=>'name',
'text'=>__('categories table heading name'),
- 'default'=>true,
+ 'default'=>true,
'width'=>'18%',
'edit'=>array(
'input_name'=>'lg[categories_name]',
// 'input_type'=>'textarea@advanced',
-// 'input_size'=>'64',
-// 'required_status'=>true,
+ 'input_size'=>'64',
+ 'required_status'=>true,
'active_value_language'=>true,
+ 'position_col'=>'left',
),
);
self::$allfields['catd.categories_description'] = array(
@@ -430,23 +428,12 @@
tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . @$_GET['cPath'] ));
break;
-
-
-
-
-
-// case 'listing':
-// //! Entretient liens avec categorie
-// sqlcategorie::Maintenance();
-//
-// parent::GenericAction();
-// break;
-
default:
parent::GenericAction();
}
+ return self::$action;
}
@@ -635,7 +622,10 @@
while ($item = $_query->fetchAssoc()) {
$ord =array();
-
+
+ $item[0]=$item['id'];
+ $item[1]=tep_draw_checkbox_field('action_multi['.$item['id'].']','action_mutli_'.$item['id'],$item['id']);
+
foreach(self::$InitInfo['modele']['listing'] as $k=>$row){
if( ($value = self::FormatDBValueRow($k, $item)) && $value !=false )
$ord[$k]= $value;
@@ -645,9 +635,6 @@
$ord[$k]=$item[$k];
}
- $item[1]=tep_draw_checkbox_field('action_multi['.$item['id'].']','action_mutli_'.$item['id'],$item['id']);
- $ord[0]=$item['id'];
-
$res[]=$ord;
}
break;
Modified: trunk/catalog/admin/includes/modules/pages/featureds.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/featureds.php 2014-02-10 21:16:21 UTC (rev 5134)
+++ trunk/catalog/admin/includes/modules/pages/featureds.php 2014-02-11 00:04:28 UTC (rev 5135)
@@ -13,17 +13,16 @@
require_once(DIR_FS_ADMIN . DIR_WS_CLASSES .'ModTreePage.php');
-
+error_reporting(E_ALL);
/**
@class featureds
*/
class featureds
extends ModTreePage /// new abstract class for nextgen module
implements
- InterfaceModule,
- /*IntModTwo, */ /// new interface module for nextgen module
- InterfacedTJsonS,
- ExtModConfig
+ InterfaceModule
+ , InterfacedTJsonS
+ , ExtModConfig
{
const FILENAME = FILENAME_FEATURED;
@@ -36,8 +35,12 @@
@var array listchilds current edit
*/
public static $listchilds= array();
-
/**
+ @var array $languages
+ */
+ public static $languages;
+
+ /**
@brief class constructor
*/
public function __construct() {
@@ -62,6 +65,17 @@
global $oscss,$language,$lang;
$oscss->pile_file_lang(DIR_FS_ADMIN.DIR_WS_LANGUAGES.$language.'/'.ucwords(self::$datatype).'.txt');
+
+ self::$modules...
[truncated message content] |
|
From: <os...@us...> - 2014-02-10 21:16:27
|
Revision: 5134
http://sourceforge.net/p/oscss/svn/5134
Author: oscim
Date: 2014-02-10 21:16:21 +0000 (Mon, 10 Feb 2014)
Log Message:
-----------
Fix
Modified Paths:
--------------
trunk/catalog/admin/includes/application_top.php
trunk/catalog/admin/includes/classes/ModTreePage.php
trunk/catalog/admin/includes/classes/drivers/sqlnavigation_links.php
trunk/catalog/admin/includes/classes/oscss_cstr.php
trunk/catalog/common/classes/ErrorHandler_drivers/FileWriter.php
trunk/test/phpunit/Back/modules/pages/pagecategoriesTest.php
trunk/test/phpunit/Back/modules/pages/pagecurrencieTest.php
trunk/test/phpunit/Back/modules/pages/pagecustomersTest.php
trunk/test/phpunit/Back/modules/pages/pageproductsTest.php
trunk/test/phpunit/Back/modules/pages/pagesorderTest.php
Modified: trunk/catalog/admin/includes/application_top.php
===================================================================
--- trunk/catalog/admin/includes/application_top.php 2014-02-10 18:12:15 UTC (rev 5133)
+++ trunk/catalog/admin/includes/application_top.php 2014-02-10 21:16:21 UTC (rev 5134)
@@ -25,7 +25,6 @@
//force current directory
@chdir(DIR_FS_ADMIN);
-
//!Set the level of error reporting
((OSCSS_DEBUG==true)? error_reporting(-1) : error_reporting(0) );
@@ -46,8 +45,8 @@
//! 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);
+
+ // Event Handler
include($rpa.DIR_WS_CLASSES.'EventsHandlerActive.php');
$Events =EventsHandlerActive::Start($Cfg);
@@ -68,7 +67,6 @@
// garbage collector full activate
ErrorHandlerActive::full($Cfg);
-
/// define the project version
define('PROJECT_VERSION', get_info_core( DIR_FS_ROOT_DOCS.'oscss.version.xml','version').' - svn '.get_info_core( DIR_FS_ROOT_DOCS.'oscss.version.xml','svn'));
@@ -120,9 +118,9 @@
}
/// Admin begin
- if (!in_array($current_page, array('cronfile.php')) ) tep_admin_check_login();
+ if (!in_array($current_page, array('cronfile.php')) )
+ tep_admin_check_login();
-
// set the language
$lng = new language($Cfg);
if (!tep_session_is_registered('language') || empty($language) || isset($_GET['language'])) {
Modified: trunk/catalog/admin/includes/classes/ModTreePage.php
===================================================================
--- trunk/catalog/admin/includes/classes/ModTreePage.php 2014-02-10 18:12:15 UTC (rev 5133)
+++ trunk/catalog/admin/includes/classes/ModTreePage.php 2014-02-10 21:16:21 UTC (rev 5134)
@@ -409,7 +409,7 @@
case 'setflag':
$action = '';
- $res = $class::RowStatus(array('status'=>(int)$_GET['flag'], 'id'=>(int)$class::$Id));
+ $res = $class::RowStatus(array('status'=>(int)$class::$Info->status, 'id'=>(int)$class::$Id));
if($view)
return $res;
@@ -419,7 +419,7 @@
case 'viewflag':
$action = '';
$res = $class::RowHidden(array('hidden'=>(int)$class::$Info->hidden, 'id'=>(int)$class::$Id));
-
+
if($view)
return $res;
else
Modified: trunk/catalog/admin/includes/classes/drivers/sqlnavigation_links.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlnavigation_links.php 2014-02-10 18:12:15 UTC (rev 5133)
+++ trunk/catalog/admin/includes/classes/drivers/sqlnavigation_links.php 2014-02-10 21:16:21 UTC (rev 5134)
@@ -1,94 +1,415 @@
-<?php
+<?php if (!defined('HTTP_SERVER')) die('You can not access this file directly!');
/**
- * \file test/phpunit/Back/navigation_linksTest.php
- * \brief test unitaire class navigation_links Backoffice
- * \remarks To run this script as CLI: phpunit filename.php
- * \author oscim <mail aur...@os...> <www http://www.oscim.fr>
- */
+ @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/05/2012 ,17:48:30
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+ @file sqlnavigation_links.php
+ @dir admin/includes/classes/drivers/
+*/
-// specific for test
-require_once(substr( dirname(__FILE__), 0, -7).'/_top.php');
-global $base_path;
+require_once( DIR_FS_ADMIN . DIR_WS_CLASSES . 'SqlFilesDataDriverClass.php');
/**
- * \class navigation_linksTest
- */
-class sqlnavigation_linksTest
- extends PHPUnit_Framework_TestCase
-{
+ @class sqlnavigation_links
+ @brief manage db update/insert/delete for navigation_links
+*/
+class sqlnavigation_links
+ extends SqlFilesDataDriverClass
+ implements ModSqlDataDriver{
- /**
- @var int
- */
- static public $Id;
+ public static $modules;
- function __construct()
- {
+ protected static $_instance;
+
+ protected function __construct(){
}
- public function testnavigation_linksSpecimen(){
- $specimen = sqlnavigation_links::Specimen();
+ public static function getInstance() {
+ if(self::$_instance == null) self::$_instance = new self();
+ return self::$_instance;
+ }
- $this->assertTrue ( ( is_array($specimen) ) , 'Error navigation_links Specimen convert' ) ;
+ /**
+ @brief create new ligne in table configuration
+ */
+ public static function create($option){
+ 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();
+
+ if(isset($sql_data_array['nav_link_id']))
+ unset($sql_data_array['nav_link_id']);
+
- return array(
- 'sqlarray'=>$specimen,
- 'post'=>$specimen,
- );
+ $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 )
+ throw new Exception("in sql create");
+
+ if( !is_object($res)){
+ $DB->rollbackTransaction();
+ return false;
+ }
+
+ $id = $res->__get('insertId');
+
+
+ $sql_data_array = array();
+ $sql_data_array['nav_cpath'] = self::GetcPath($id);
+
+ if( ! tep_db_perform(TABLE_NAVIGATION_LINKS, $sql_data_array, 'update' , " nav_link_id = '".$id."' " ) )
+ 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++;
+ }
+
+
+ }
+ catch(Exception $e){
+// print_r($e);
+ $error++;
+ }
+
+
+
+ if( $error > 0){
+ $DB->rollbackTransaction();
+ return false;
+ }
+ else{
+ $DB->commitTransaction();
+ return $id;
+ }
}
/**
- * @brief test creat account user
- * @depends testnavigation_linksSpecimen
- */
- public function testnavigation_linksCreat( $specimen ){
+ @brief update ligne in table configuration
+ */
+ public static function update($option){
+ self::getInstance();
+ $DB=Database::getInstance();
+ $error= 0;
+ $specimen = self::Specimen();
+
+
+ if(!isset($option['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();
+
+ unset($sql_data_array['nav_link_id']);
+
+ $DB->beginTransaction();
- $id = sqlnavigation_links::create($specimen);
+ $where ='';
+ $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']."' ";
- $this -> assertTrue ( ((int)$id >0) , 'Error navigation_links not create' ) ;
+ if(count((array)$sql_data_array)> 0){
+
+ if( ! tep_db_perform(TABLE_NAVIGATION_LINKS, $sql_data_array, 'update' , substr($where,3) ) )
+ $error++;
- $specimen['id'] = $id;
- return $specimen;
+ 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();
+
+ $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++;
+ }
+ }
+
+ // 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']);
+
+ $res=tep_db_perform(TABLE_NAVIGATION_LINKS_DESCRIPTION, $sql_data_array, 'update', substr($wh,3) );
+ if(!$res)
+ $error++;
+ }
+
+
+ if( $error > 0){
+ $DB->rollbackTransaction();
+ return false;
+ }
+ else{
+ $DB->commitTransaction();
+ return 1;
+ }
}
+ /**
+ @brief load ligne in table configuration
+ @param option array
+ id => row id int (configuration_id)
+ key => string key (configuration_key)
+ group_id => group_id int (configuration_group_id)
+ @param $shortkey use cleankey for return short key
+ @return
+ object(stdClass)[13]
+ public 'id' => string '1' (length=1)
+
+ OR
+ array(
+ object(stdClass)[13]
+ ...
+ object(stdClass)[13]
+ ..
+ )
+
+ */
+ public static function fetch($option,$shortkey=false){
+ self::getInstance();
+ $DB=Database::getInstance();
+
+ $where ="";
+ $language_id = false;
+ if(isset($option['id'])) $where .="AND nav_link_id = '".(int)$option['id']."' ";
+ if(isset($option['mode'])) $where .="AND nav_mode = '".(int)$option['mode']."' ";
+ 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['parent_id'])) $where .="AND parent_id = '".(int)$option['parent_id']."' ";
+
+ if($where=='')
+ return false;
+
+
+ if(isset($option['language_id']))
+ $language_id = $option['language_id'];
+
+
+ $sql="SELECT * FROM " . TABLE_NAVIGATION_LINKS . " a ";
+ $sql.=" WHERE ".substr($where,3);
+
+ $res=$DB->query($sql);
+
+ $num = $res->__get('numRows');
+
+ if($num == 1){
+ $result=$res->fetchAssoc();
+
+ if($language_id > 0){
+ $_query = $DB->query($sql="select fd.nav_name from " . TABLE_NAVIGATION_LINKS_DESCRIPTION . " fd where fd.nav_link_id = '" . (int)$result['nav_link_id'] . "' AND language_id='" . (int)$language_id . "'");
+ $descr = $_query->fetchAssoc();
+
+ $result['name'][$language_id] = $descr['nav_name'];
+
+ tep_db_free_result($_query);
+ }
+ else{
+ // call all langue for this post
+ $_query = $DB->query($sql="select fd.* from " . TABLE_NAVIGATION_LINKS_DESCRIPTION . " fd where fd.nav_link_id = '" . (int)$result['nav_link_id'] . "' ");
+
+ foreach($_query->fetchAllAssoc() as $descr){
+ $result['name'][$descr['language_id']] = $descr['nav_name'];
+ }
+ tep_db_free_result($_query);
+
+ foreach(tep_get_languages() as $lg){
+ if(!isset($result['name'][$lg['id']]))
+ $result['name'][$lg['id']] ='';
+ }
+ }
+
+ return ((!$shortkey)? $result : self::CleanKey($result));
+ }
+ elseif($num > 1){
+ $array=array();
+
+ foreach($res->fetchAllAssoc() as $result){
+
+ $_query = $DB->query($sql="select fd.nav_name from " . TABLE_NAVIGATION_LINKS_DESCRIPTION . " fd where fd.nav_link_id = '" . (int)$result['nav_link_id'] . "' AND language_id='" . (int)$language_id . "'");
+ $descr = $_query->fetchAssoc();
+
+ $result['name']/*[$language_id]*/ = $descr['nav_name'];
+
+ tep_db_free_result($_query);
+
+ $array[]= ((!$shortkey)? $result : self::CleanKey($result));
+ }
+
+ return $array;
+ }
+
+ return false;
+ }
+
/**
- * @depends testnavigation_linksCreat
- */
- public function testnavigation_linksUpdate( $specimen ){
+ @brief delete row
+ */
+ public static function delete($option){
+ self::getInstance();
+ $DB=Database::getInstance();
+ $where ="";
+ if(isset($option['id'])) $where .="AND nav_link_id = '".(int)$option['id']."' ";
+ if(isset($option['type'])) $where .="AND nav_link_type = '".(int)$option['type']."' ";
+ if(isset($option['status'])) $where .="AND nav_link_status = '".(int)$option['status']."' ";
+ if(isset($option['mode'])) $where .="AND nav_mode = '".(int)$option['mode']."' ";
- $res=sqlnavigation_links::fetch( array('id'=>$specimen['id']) , true);
- $this -> assertTrue ( (is_object($res) ) , 'navigation_links not exists, or fetch error load ' ) ;
+ if($where=='')
+ return false;
+ $res = $DB->query("SELECT nav_link_id as id FROM " . TABLE_NAVIGATION_LINKS ." WHERE ". substr($where, 3 ).' LIMIT 1' );
+ $result = $res->fetchAssoc();
- $res = sqlnavigation_links::update($specimen);
- $this -> assertTrue ( ($res == 1) , 'Error navigation_links not update' ) ;
+ // childs tables
+ $DB->query("delete from " . TABLE_NAVIGATION_LINKS_DESCRIPTION . " where nav_link_id = '" . (int)$result['id'] . "'");
- return $specimen;
+ $DB->query("delete from " . TABLE_NAVIGATION_LINKS . " where nav_link_id = '" . (int)$result['id'] . "'");
+
+
+ return true;
}
/**
- * @depends testnavigation_linksCreat
- */
- public function testnavigation_linksDelete( $specimen ){
+ @brief
+ @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' => -1,
+ 'nav_mode' => 2, // 1,2
+ 'nav_sort_order' => 5,
+ 'nav_css_id' => '',
+ 'nav_file' => '',
+ 'nav_link_type' => 1,
+ 'customers_status' => 0,
+ 'nav_link_status' => 0,
+ 'parent_id' => 0,
+
+ // language table
+ 'lg' =>$tmp_lg,
+
+ 'listchilds'=>array()
+ );
- $res = sqlnavigation_links::delete( array('id'=>$specimen['id']) );
+// foreach(tep_get_languages() as $lg){
+// $par['name'][$lg['id']] ='';
+// }
- $this -> assertTrue ( ($res == true ) , 'Error navigation_links not delete' ) ;
+ 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
+ */
+ public static function CleanKey($array){
+ self::getInstance();
+ $object= new stdclass();
+
+ foreach($array as $key=>$value){
+ if( strpos($key,'nav_link_') ===0)
+ $key=substr($key,strlen('nav_link_'));
+ elseif( strpos($key,'nav_') ===0)
+ $key=substr($key,strlen('nav_'));
+
+ $object->$key = $value;
+ }
+
+ return $object;
}
+ /**
+ */
+ static function GetcPath($id, $array = array() ){
+
+ $DB=Database::getInstance();
+
+ $res = $DB->query("SELECT parent_id as id FROM " . TABLE_NAVIGATION_LINKS ." WHERE nav_link_id='".(int)$id."' LIMIT 1" );
+ $result = $res->fetchAssoc();
+
+ if($result['id'] == $id || $result['id'] == 0)
+ return implode(array_reverse($array), '_');
+ else{
+ $array[] = $result['id'];
+ return self::GetcPath($result['id'], $array );
+ }
+ }
}
+
?>
\ No newline at end of file
Modified: trunk/catalog/admin/includes/classes/oscss_cstr.php
===================================================================
--- trunk/catalog/admin/includes/classes/oscss_cstr.php 2014-02-10 18:12:15 UTC (rev 5133)
+++ trunk/catalog/admin/includes/classes/oscss_cstr.php 2014-02-10 21:16:21 UTC (rev 5134)
@@ -1,165 +1,500 @@
<?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 09/04/2012, 09:08
+ @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 06/01/2014, 11:28
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+ @class oscss_cstr
+ Constructeur de page et ordonanceur.
+ Prend en charge l'appel des extensions
+
+ NOTE:
+
+
+ chargement d'une extension
+ ex: $oscss->_add_ext('dsrte','editeur/');
+
+ Appel init top de l'extension
+ ex: echo $oscss->_call('dsrte','_top',[option]);
+
+ Appel script extension
+ ex: echo $oscss->_call('dsrte','_head',[option]);
+
+ Appel / exe extension
+ ex: echo $oscss->_call('dsrte','_draw',[option]);
+
*/
+class oscss_cstr {
-/**
- @class oscss_acl
-*/
-class oscss_acl {
- /**
- @var file name not control acl
- */
- private $authorise = array();
- /**
- @var page_id
- */
- private $page_id ;
- /**
- @var $page_name
- */
- private $page_name ;
- /**
- @var current object detail row
- */
- private $current = array() ;
- /**
- @var $cacheSess array detail row
- */
- protected $cacheSess = array() ;
- /**
- @var ressource instance
- */
+ /**
+ @var
+ */
+ private static $PileFile=array();
+ /**
+ @var string name file cache file exists
+ */
+ private static $key_file_cache;
+ /**
+ @var list all code stocked by call back
+ */
+ protected static $_CallBack;
+ /**
+ @var
+ */
protected static $_instance;
-
+
+ /**
+ @brief constructeur
+ */
+ protected function __construct(){
+ $this->vars=array();
+
+ /**
+ Pile des file de lang
+ */
+ $this->PileFileLang=array();
+
+ $this->base = (isset($_SERVER['REQUEST_URI'])?basename($_SERVER['REQUEST_URI']) : basename($_SERVER['PHP_SELF']));
+ //! key cache file
+ self::$key_file_cache= 'BO_files-'.md5( $this->base .(isset($_SESSION['login_firstname'])? $_SESSION['login_firstname']: 'guest'));
+ }
+
+ /**
+ @brief get instance
+ */
+ public static function getInstance() {
+ if(self::$_instance == null) self::$_instance = new self();
+ return self::$_instance;
+ }
+
+ /**
+ @brief Add constructeur
+ @param $class
+ */
+ private function add_obj($class){
+ if (class_exists($class)) $this->$class = new $class();
+ else return false;
+ }
+
/**
- @fn __construct()
- @brief constructor
+ @brief init class
*/
- protected function __construct(){
- $this->authorise=array(
- FILENAME_DEFAULT,
- FILENAME_FORBIDEN,
- FILENAME_LOGOFF,
- FILENAME_ADMIN_ACCOUNT
- );
+ public static function afterAppliTop(){
+ /**
+ @remarks init class
+ */
+ new CsrtAction();
+ }
- $this->page_id = 0;
+ /**
+ @fn _add_in($object, $name, $value)
+ @brief Ajout d'element a l'object precisé
+ @param $object object nom du sous l'object a qui ajoute l'element
+ @param $name string nom de var ajouté
+ @param $value array/string/int/... valeur
+ */
+ public function _add_in($object, $name, $value){
+ if (!isset($this->$object) && !$this->add_obj($object) )
+ die(_('pas d\'oject de ce nom')) ;
- $sql ="SELECT f.admin_files_id, f.admin_files_name FROM " . TABLE_ADMIN_FILES . " f , ".TABLE_ADMIN_GROUPS." u ".
- " WHERE FIND_IN_SET( '" .(int) $_SESSION['login_groups_id'] . "', f.admin_groups_id) AND u.admin_groups_id = '" .(int) $_SESSION['login_groups_id'] . "' AND admin_groups_status = 1 ";
+ //! operator
+ $obj=$this->$object;
+ if(is_object($value)){
+ $this->$name=$value;
+ }elseif(is_array($value)) {
+ $obj[$name]=$value;
+ $this->$object=$obj;
+ }
+ elseif(is_string($value)){
+ $obj[$name]=addslashes($value);
+ $this->$object=$obj;
+ }
+ }
- $_query = tep_db_query($sql);
- $tmp = array();
+ /**
+ @brief init d'un object
+ @param $object string nom de l'object
+ */
+ public function _add_init($object){
+ if (!isset($this->$object) && !$this->add_obj($object) ){
+ die(_('pas d\'oject de ce nom')) ;
+ }
+ return $this->$object;
+ }
- if (tep_db_num_rows($_query))
- foreach($_query->fetchAllAssoc() as $row){
- $tmp[$row['admin_files_id']] = $row['admin_files_name'];
- $this->cacheSess[$row['admin_files_name']] = $row;
- }
- $sql ="SELECT u.files_id, u.action FROM " . TABLE_ADMIN_FILES2RIGHT." u ".
- " WHERE ( u.type = '0' AND u.ref_id = '" .(int) $_SESSION['login_groups_id'] . "' ) OR ( u.type = '1' AND u.ref_id = '" .(int) $_SESSION['login_id'] . "' ) ";
+ /**
+ @fn _add_ext($name_object, $path)
+ @brief Init d'un plugin via un fichier oscss_init
+ @note Les functions seront aouté aux sous object
+ @param generic string path (ex:DIR_WS_PLUGIN) (terminé par /)
+ @param $name_object string nom de l'object
+ */
+ public function _add_ext($name_object, $path){
+ if(is_dir($path) && self::TestFile($path.$name_object.'/oscss_init.php') ) {
+ include_once($path.$name_object.'/oscss_init.php');
+ $this->add_obj($name_object.'_oscss');
+ }
+ else die(__('Error extention editeur introuvable'));
+ }
- $_query = tep_db_query($sql);
- if (tep_db_num_rows($_query))
- foreach($_query->fetchAllAssoc() as $row)
- $this->cacheSess[$tmp[$row['files_id']]]['action'][] = $row['action'];
+ /**
+ @fn _call($key_object, $funct)
+ @brief Appel public des function de chargeur des extensions
+ @param $key_object string object key de l'obj (ex 'dsrte' pour la class 'dsrte_oscss' )
+ @param $funct string $function de construction block (_top, _head, _draw)
+ @return object
+ */
+ public function _call($key_object, $funct /*[arg functions] */){
+ $oscss=$this;
+ $object=$key_object.'_oscss';
+ if(!isset($this->$object)) return false;
+ $vars='';
+ if(func_num_args()>2) {
+ for($i=2;$i<(func_num_args()-1);$i++){
+ $t[$i] = func_get_arg($i);
+ $vars.="\$t[$i],";
+ }
+ $t[$i] = func_get_arg($i);
+ $vars.="\$t[$i]";
+ }
+ if ($vars !='') {
+ eval("\$ret = \$this->\$object->$funct($vars);");
+ return $ret;
+ }
+ else return $this->$object->$funct();
+ }
- }
+ /**
+ stock var in array
+ key => value
+ */
+ public function add_var($key,$value){
+ $this->vars[(string)$key]=$value;
+ }
- /**
- @fn getInstance()
- @brief
- */
- public static function getInstance() {
- if(self::$_instance == null)
- self::$_instance = new self();
+ /**
+ @fn the_var($key)
+ @brief Retour du contenu de la var
+ @param $key string
+ @return var or false
+ */
+ public function the_var($key){
+ if(isset($this->vars[(string)$key])) return $this->vars[(string)$key];
+ else return false;
+ }
- return self::$_instance;
+
+
+ /**
+ @brief Chargeur de fichier de langues
+ @note Specifique au .txt
+ @param $path_file string pathfilename
+ @return none
+ */
+ public function pile_file_lang($path_file){
+ global $lang;
+ if(substr($path_file,0,strlen(DIR_FS_ADMIN)) !=DIR_FS_ADMIN && substr($path_file,0,strlen(DIR_FS_CATALOG)) !=DIR_FS_CATALOG ) $path_file= DIR_FS_ADMIN.$path_file;
+
+
+ if(!in_array($path_file,$this->PileFileLang))
+ if(self::TestFile($path_file)) include_once($path_file);
+
}
- /**
- @fn loafconfig($_page)
- @brief Froce reload $current for specific page
- @param $_page page.php for owner action
- @return bool true => Ok / false => KO
- */
- function loafconfig($_page){
- foreach($this->cacheSess as $key=>$row)
- if($_page ==$key){
- $this->page_id = $row['admin_files_id'];
- $this->page_name = $key;
+ /**
+ @fn cache_lang($load=true)
+ @brief Charge et stock le cache des fichier de lang en .txt
+ @note Appelé en debut et fin d'appli
+ @param $load boolean
+ @return none
+ */
+ public function cache_lang($load=true){
+ global $osCSS_Cache,$lang;
- $this->current = (isset($row['action'])?$row['action'] : false );
+ $key_file= 'BO_lang-'.$this->the_var('languages_id').'-'.md5($this->base.(isset($_SESSION['login_firstname'])? $_SESSION['login_firstname']: 'guest'));
- return true;
- }
+ if($load){
+ if ($osCSS_Cache->read($key_file, 3600) ) {
+ $res= $osCSS_Cache->getCache();
+ global $lang;
+ $lang=$res['lang'];
+ $this->PileFileLang=$res['PileFile'];
+ }
+ } else{
+ if(!isset($this->PileFileLang)) $this->PileFileLang=array();
+ $osCSS_Cache->read($key_file, 3600);
+ $PileFile=array();
+ foreach(get_included_files() as $e)
+ if(substr($e,-3)=='txt') $PileFile[]=$e;
- return false;
- }
+ if(count($PileFile)>0) {
+ $variable = array('lang'=>$lang,'PileFile'=>array_merge($PileFile,$this->PileFileLang) );
+ $osCSS_Cache->writeBuffer($variable);
+ }
+ }
+ }
- /**
- @fn PageRight()
- @brief
- @param $_page page.php for owner action
- @return bool true => Ok / false => KO
- */
- function PageRight($_page){
- $filename = trim($_page);
- if (
- in_array($filename,$this->authorise)
- || in_array(substr($filename,0,strpos($filename,'?') ),array('attributeManager.php'))
- )
- return true;
+ /**
+ test si fichier existe et cache du test
+ enregsitrement a la volee
+ return boolean
+ */
+ public static function TestFile($file){
+ global $osCSS_Cache,$lang;
- return $this->loafconfig($_page);
- }
+ $keytemp=md5($file);
- /**
- @fn ActionRight()
- @brief Check one action and one page
- @param $action string , name action
- @param $_page page.php for owner action
- @return bool true => Ok / false => KO
- */
- function ActionRight($action, $_page=''){
+ if ($osCSS_Cache->read(self::$key_file_cache, 3600) ) {
+ $res= $osCSS_Cache->getCache();
+ self::$PileFile=$res;
+ $result=self::Testfile_exists($file,$keytemp);
+ if(count($res) < count(self::$PileFile)){
+ $osCSS_Cache->clear(self::$key_file_cache);
+ $osCSS_Cache->writeBuffer(self::$PileFile);
+ }
+ }
+ else {
+ $result=self::Testfile_exists($file,$keytemp);
+ $osCSS_Cache->writeBuffer(self::$PileFile);
+ }
+ return _test_bool($result);
+ }
- if(strlen($action)<=0)
- return true;
+ private static function Testfile_exists($file,$keytemp){
+ if(isset(self::$PileFile[$keytemp])) return self::$PileFile[$keytemp];
+ elseif(file_exists($file)) return self::$PileFile[$keytemp]='true';
+ else return 'false';
+ }
- if($this->page_name !=trim($_page))
- if( ! $this->loafconfig($_page))
- return false;
+ /**
+ @fn oscss_cstr::test_gab_theme($element,$ext='php')
+ @brief load Template Environement
+ test présence élément de gabarit, retour false ou path
+ @return (bool)false OR string path file
+ */
+ public static function test_gab_theme($element,$ext='php'){
- if( (int) $_SESSION['login_groups_id'] == 1)
- return true;
- elseif ( $this->current ==false ) // no data in db fo restrict
- return true;
- elseif ( is_array($this->current) && in_array($action,$this->current) )
- return true;
+ if (self::TestFile(DIR_WS_TEMPLATE.$element.'-'.$_SESSION['login_groups_id'].'.'.$ext) )
+ return DIR_WS_TEMPLATE.$element.'-'.$_SESSION['login_groups_id'].'.'.$ext;
+ elseif (self::TestFile(DIR_WS_TEMPLATE.$element.'-'.$_SESSION['login_id'].'.'.$ext) )
+ return DIR_WS_TEMPLATE.$element.'-'.$_SESSION['login_id'].'.'.$ext;
+ elseif (self::TestFile(DIR_WS_TEMPLATE.$element.'-1.'.$ext) )
+ return DIR_WS_TEMPLATE.$element.'-1.'.$ext;
+ elseif (self::TestFile(DIR_WS_TEMPLATE.$element.'.'.$ext) )
+ return DIR_WS_TEMPLATE.$element.'.'.$ext;
+ elseif (self::TestFile(DIR_WS_INCLUDES.'template/'.DEFAULT_TEMPLATE_NAME.'/'.$element.'-'.$_SESSION['login_groups_id'].'.'.$ext) )
+ return DIR_WS_INCLUDES.'template/'.DEFAULT_TEMPLATE_NAME.'/'.$element.'-'.$_SESSION['login_groups_id'].'.'.$ext;
+ elseif (self::TestFile(DIR_WS_INCLUDES.'template/'.DEFAULT_TEMPLATE_NAME.'/'.$element.'-'.$_SESSION['login_id'].'.'.$ext) )
+ return DIR_WS_INCLUDES.'template/'.DEFAULT_TEMPLATE_NAME.'/'.$element.'-'.$_SESSION['login_id'].'.'.$ext;
+ elseif (self::TestFile(DIR_WS_INCLUDES.'template/'.DEFAULT_TEMPLATE_NAME.'/'.$element.'-1.'.$ext) )
+ return DIR_WS_INCLUDES.'template/'.DEFAULT_TEMPLATE_NAME.'/'.$element.'-1.'.$ext;
+ elseif (self::TestFile(DIR_WS_INCLUDES.'template/'.DEFAULT_TEMPLATE_NAME.'/'.$element.'.'.$ext) )
+ return DIR_WS_INCLUDES.'template/'.DEFAULT_TEMPLATE_NAME.'/'.$element.'.'.$ext;
+ else
+ return false;
+ }
- return false;
+ /**
+ @fn oscss_cstr::linkDocs($page_module)
+ @brief link for online docs, in http://wiki.oscss.org/documentation/
+ @param $page_module nom page courante
+ */
+// public static function linkDocs($page_module){
+// $url ="http://wiki.oscss.org/documentation/?";
+// $url.="version=2.1.0&lang=fr_FR&page=".$page_module."&path=".$page_module;
+// if(isset($_REQUEST['type'])) $url.="/".$_REQUEST['type'];
+// if(isset($_REQUEST['action'])) $url.="&action=".$_REQUEST['action'];
+// return $url;
+// }
+
+
+ /**
+ @fn oscss_cstr::CallBack($code, $mode='code',$pile='post_load')
+ @brief Add js put in header/footer page
+ @param $code path file or code
+ @param $mode string code / file
+ @param $pile name for current pile
+ */
+ public static function CallBack($code,$mode='code', $pile='post_load'){
+ self::$_CallBack;
+
+ if(!isset(self::$_CallBack->$pile))
+ self::$_CallBack->$pile = '';
+
+ if($mode =='code') {
+ self::$_CallBack->$pile .= addslashes($code). "\n";
+ }
+// elseif($mode =='js')
+// tep_include_file($code);
}
- /**
- @fn Block()
- @brief Force redirect and exit
- */
- function Block(){
- tep_redirect(tep_href_link(FILENAME_FORBIDEN,'', 'NONSSL'));
+ /**
+ @fn oscss_cstr::CallBackExec($pile='post_load')
+ @brief call js stocked by CallBack methode
+ @param $page_module nom page courante
+ */
+ public static function CallBackExec($pile='post_load'){
+ if(!isset(self::$_CallBack->$pile))
+ return ;
+ else
+ return stripslashes(self::$_CallBack->$pile);
}
+
+
+
+ public function debugg(){
+ print_r( $this);
+ }
}
+
+
+/**
+ @brief class de gestion des boutons , liens et commande d'action.
+ @class
+ TODO: integrer ACL
+*/
+
+class CsrtAction {
+
+ public static $SimpleP = null;
+
+ function __construct(){
+ if(self::$SimpleP === null) {
+
+ $FeedUrl = DIR_FS_ADMIN . DIR_WS_TEMPLATE.'data/icon_set.xml';
+
+ if(!self::$SimpleP = simplexml_load_file($FeedUrl))
+ if(!self::$SimpleP = simplexml_load_file('includes/template/defaut/data/icon_set.xml'))
+ return false;
+ }
+ }
+
+ /**
+ @fn getIcon($code)
+ @brief check and return file for icon code
+ @param $code unique id icon in data xml
+ @return string file name
+ */
+ public static function getIcon($code){
+ $ref=self::$SimpleP->img->icon;
+ if(isset($ref->$code)) return (string)$ref->$code;
+ }
+
+ /**
+ @fn getFullPathIcon($code)
+ @brief return fullpath icon
+ @param $code unique id icon in data xml
+ @return string path file name
+ */
+ public static function getFullPathIcon($code){
+ $cdig = self::getIcon($code);
+ $file_img='';
+
+ // use template admin
+ if( file_exists( DIR_WS_TEMPLATE . 'img/' .$_SESSION['login_groups_id'] . '/' . $cdig ) )
+ $file_img = DIR_WS_TEMPLATE . 'img/' .$_SESSION['login_groups_id'] . '/' . $cdig ;
+ elseif( file_exists( DIR_WS_INCLUDES . 'template/defaut/img/' .$_SESSION['login_groups_id'] . '/' . $cdig ) )
+ $file_img = DIR_WS_INCLUDES . 'template/defaut/img/' .$_SESSION['login_groups_id'] . '/' . $cdig;
+ elseif( file_exists( DIR_WS_INCLUDES . 'template/defaut/img/1/' . $cdig ) )
+ $file_img = DIR_WS_INCLUDES . 'template/defaut/img/1/' . $cdig;
+
+ return $file_img;
+ }
+
+
+ /**
+ @fn getFormat($code)
+ @brief check and return file for icon code
+ @param $code unique id icon in data xml
+ @return string file name
+ */
+ public static function getFormat($code){
+ $ref=self::$SimpleP->format;
+ if(isset($ref->$code)) return (string)$ref->$code;
+ }
+
+ /**
+ @brief construit le formatage des liens et bouton d'action
+ Organise le formatage des format destiné au spintf
+ Definis si texte ou image , si image ok
+ @param $code string (ex: row_action_right)
+ @param type string (button|link)
+ @param $txt string texte du bouton
+ @param $codeImg string le code de l'image, de l'incone
+ @return string for sptrinf
+ */
+ protected static function getbalise($code,$type,$txt,$codeImg=''){
+ new self();
+ $ref=self::$SimpleP->gabarit;
+ $mode='simple';
+ if(isset($ref->$code)){
+ $obj = $ref->$code->$type;
+
+ if(!empty($codeImg) ) {
+
+ $w=( ( (int)$obj->icon[0]['width']>0)? (int)$obj->icon[0]['width'] : '');
+ $h=( ( (int)$obj->icon[0]['height']>0)? (int)$obj->icon[0]['height'] : '');
+
+ $file_img = self::getFullPathIcon($codeImg);
+
+ if(isset($obj->icon[0]['src']) && (bool)$obj->icon[0]['src']){
+ $i=image_ratio::get_image($file_img ,$txt , $w,$h);
+ $img=$i['src'];
+ $mode='complexe';
+ }
+ else
+ $img= tep_image($file_img ,$txt , $w,$h );
+ }
+ else
+ $img =false;
+
+ if( $img != false ){
+ if($mode==='simple')
+ return str_replace('%_TEXT_%' , $img, (string)$obj->icon );
+ else
+ return str_replace(array('%_TEXT_%','%_SRC_%') , array($txt,$img), (string)$obj->icon );
+ }
+ else
+ return str_replace('%_TEXT_%', $txt, (string)$obj->text );
+ }
+ }
+
+ /**
+ @brief Alias getFormat($code,$txt,$codeImg='')
+ */
+ static public function getLink($code,$txt,$codeImg=''){
+ return self::getbalise($code,'link',$txt,$codeImg);
+ }
+
+ /**
+ @brief Alias getFormat($code,$txt,$codeImg='')
+ */
+ static public function getButton($code,$txt,$codeImg=''){
+ return self::getbalise($code,'button',$txt,$codeImg);
+ }
+//
+ /**
+ @brief Alias getFormat($code,$txt,$codeImg='')
+ */
+ static public function getSubmit($code,$txt,$codeImg=''){
+ return self::getbalise($code,'submit',$txt,$codeImg);
+ }
+
+ /**
+ @brief Alias getFormat($code,$codeImg='')
+ */
+ static public function getImage($code,$codeImg=''){
+ return self::getbalise($code,'image','',$codeImg);
+ }
+}
?>
\ No newline at end of file
Modified: trunk/catalog/common/classes/ErrorHandler_drivers/FileWriter.php
===================================================================
--- trunk/catalog/common/classes/ErrorHandler_drivers/FileWriter.php 2014-02-10 18:12:15 UTC (rev 5133)
+++ trunk/catalog/common/classes/ErrorHandler_drivers/FileWriter.php 2014-02-10 21:16:21 UTC (rev 5134)
@@ -21,21 +21,22 @@
public function __construct($filepath)
{
- $this->maxSize= 5 * 1024 * 1024;
- $intFileSize = @filesize($filepath);
- if ( $intFileSize >= $this->maxSize) {
- //On archive le fichier
- $strFileContent = file_get_contents($filepath);
- $strToFileGz = $filepath . '.' . date('Ymd_His') . '.gz';
- $strFileContentGz = gzencode($strFileContent,9);
- $objFileGz = @fopen($strToFileGz, 'w+');
- fwrite($objFileGz,$strFileContentGz);
- fclose($objFileGz);
- //On suprime le fichier
- unlink($filepath);
- }
+ $this->maxSize= 5 * 1024 * 1024;
+ $intFileSize = @filesize($filepath);
+ if ( $intFileSize >= $this->maxSize) {
+ //On archive le fichier
+ $strFileContent = file_get_contents($filepath);
+ $strToFileGz = $filepath . '.' . date('Ymd_His') . '.gz';
+ $strFileContentGz = gzencode($strFileContent,9);
+ $objFileGz = @fopen($strToFileGz, 'w+');
+ fwrite($objFileGz,$strFileContentGz);
+ fclose($objFileGz);
+ //On suprime le fichier
+ unlink($filepath);
+ }
+
if (FALSE === $this->_fp = @fopen($filepath,'a+')) {
- throw new Exception('Impossible d\'ouvrir le fichier de log');
+ die('Impossible d\'ouvrir le fichier de log');
}
}
Modified: trunk/test/phpunit/Back/modules/pages/pagecategoriesTest.php
===================================================================
--- trunk/test/phpunit/Back/modules/pages/pagecategoriesTest.php 2014-02-10 18:12:15 UTC (rev 5133)
+++ trunk/test/phpunit/Back/modules/pages/pagecategoriesTest.php 2014-02-10 21:16:21 UTC (rev 5134)
@@ -117,7 +117,7 @@
$get['forceajax'] = 1;
$res = $this-> CallGetDBValue($objtmp,$action, $get);
-
+
$res = $this->CheckAction($objtmp);
$this->assertTrue ( ( strlen($res) >300) , 'Error retrun action::'.$action) ;
Modified: trunk/test/phpunit/Back/modules/pages/pagecurrencieTest.php
===================================================================
--- trunk/test/phpunit/Back/modules/pages/pagecurrencieTest.php 2014-02-10 18:12:15 UTC (rev 5133)
+++ trunk/test/phpunit/Back/modules/pages/pagecurrencieTest.php 2014-02-10 21:16:21 UTC (rev 5134)
@@ -93,23 +93,23 @@
@brief test display flag action
@depends testcurrenciesGetDBValue
*/
- public function testcurrenciesPrintFlag($objtmp){
+// public function testcurrenciesPrintFlag($objtmp){
+//
+// $action = 'setflag';
+// $get = array();
+// $get['flag'] = 1;
+// $get['cID'] = 1;
+// $get['forceajax'] = 1;
+//
+// $res = $this-> CallGetDBValue($objtmp,$action, $get);
+//
+// $res = $this->CheckAction($objtmp);
+//
+//
+// $this->assertTrue ( ( strlen($res) >150) , 'Error retrun action::'.$action) ;
+//
+// }
- $action = 'setflag';
- $get = array();
- $get['flag'] = 1;
- $get['cID'] = 1;
- $get['forceajax'] = 1;
-
- $res = $this-> CallGetDBValue($objtmp,$action, $get);
-
- $res = $this->CheckAction($objtmp);
-
-
- $this->assertTrue ( ( strlen($res) >150) , 'Error retrun action::'.$action) ;
-
- }
-
/**
@brief test display form new customers
@depends testcurrenciesGetDBValue
Modified: trunk/test/phpunit/Back/modules/pages/pagecustomersTest.php
===================================================================
--- trunk/test/phpunit/Back/modules/pages/pagecustomersTest.php 2014-02-10 18:12:15 UTC (rev 5133)
+++ trunk/test/phpunit/Back/modules/pages/pagecustomersTest.php 2014-02-10 21:16:21 UTC (rev 5134)
@@ -91,20 +91,29 @@
public function testcustomersGetDBValue($objtmp){
// action default : listing
- $res = customers::tep_get_list();
+ $action = 'listing';
+ $get = array();
+
+ $res = $this->CallGetDBValue($objtmp,$action, $get);
$this->assertTrue ( ( is_array($res) ) , 'Error GetDBValue listing' ) ;
+ return array (
+ $objtmp
+ ,$res
+ );
}
/**
@brief test display flag action
@param $objtmp object result testcustomersConf
- @depends testcustomersConf
+ @depends testcustomersGetDBValue
*/
- public function testcustomersPrintFlag($objtmp){
-
+ public function testcustomersPrintFlag($result){
+ $objtmp = $result[0];
+ $list = $result[1];
+
$action = 'setflag';
$get = array();
$get['flag'] = 1;
@@ -112,8 +121,10 @@
$get['forceajax'] = 1;
- $res = $this->CheckAction($objtmp,$action, $get);
-
+ $res = $this->CallGetDBValue($objtmp,$action, $get);
+ $res = $this->CheckAction($objtmp);
+var_dump($res);
+// exit;
$this->assertTrue ( ( strlen($res) >300) , 'Error retrun action::'.$action) ;
$action = 'setflagda';
@@ -123,7 +134,8 @@
$get['forceajax'] = 1;
- $res = $this->CheckAction($objtmp,$action, $get);
+ $res = $this->CallGetDBValue($objtmp,$action, $get);
+ $res = $this->CheckAction($objtmp);
$this->assertTrue ( ( strlen($res) >300) , 'Error retrun action::'.$action) ;
}
@@ -131,17 +143,20 @@
/**
@brief test display form new customers
@param $objtmp object result testcustomersConf
- @depends testcustomersConf
+ @depends testcustomersGetDBValue
*/
- public function testcustomersPrintVcard($objtmp){
-
+ public function testcustomersPrintVcard($result){
+ $objtmp = $result[0];
+ $list = $result[1];
+
+
$action = 'vcard';
$get = array();
$get['cID'] = 1;
$get['forceajax'] = 1;
-
- $res = $this->CheckAction($objtmp,$action, $get);
+ $res = $this->CallGetDBValue($objtmp,$action, $get);
+ $res = $this->CheckAction($objtmp);
$this->assertTrue ( ( strlen($res) > 100) , 'Error retrun action::'.$action ) ;
}
@@ -149,14 +164,17 @@
/**
@brief test display form new customers
@param $objtmp object result testcustomersConf
- @depends testcustomersConf
+ @depends testcustomersGetDBValue
*/
- public function testcustomersPrintNew($objtmp){
-
+ public function testcustomersPrintNew($result){
+ $objtmp = $result[0];
+ $list = $result[1];
+
+
$action = 'new';
$get = array();
-
- $res = $this->CheckAction($objtmp,$action, $get);
+ $res = $this->CallGetDBValue($objtmp,$action, $get);
+ $res = $this->CheckAction($objtmp);
$this->assertTrue ( ( strlen($res) > 900) , 'Error retrun action::'.$action ) ;
}
@@ -164,26 +182,29 @@
/**
@brief test display form edit
@param $objtmp object result testcustomersConf
- @depends testcustomersConf
+ @depends testcustomersGetDBValue
*/
- public function testcustomersPrintEdit($objtmp){
+ public function testcustomersPrintEdit($result){
+ $objtmp = $result[0];
+ $list = $result[1];
-
$action = 'edit';
$get = array();
$get['cID'] = 1;
- $res = $this->CheckAction($objtmp,$action, $get);
+ $res = $this->CallGetDBValue($objtmp,$action, $get);
+ $res = $this->CheckAction($objtmp);
$this->assertTrue ( ( strlen($res) > 1600) , 'Error retrun action::'.$action ) ;
}
/**
@brief test display form edit
@param $objtmp object result testcustomersConf
- @depends testcustomersConf
+ @depends testcustomersGetDBValue
*/
-// public function testcustomersPrintDelete($objtmp){
-//
+// public function testcustomersPrintDelete($result){
+// $objtmp = $result[0];
+// $list = $result[1];
// $action = 'deleteconfirm';
// $get = array();
// $get['cID'] = 1;
@@ -195,27 +216,39 @@
+
+
/**
@brief
- @param $objtmp object result testcustomersConf
- @depends testcustomersConf
*/
- public function CheckAction($objtmp,$action, $get){
+ public function CheckAction($objtmp){
- $get['action'] = $action;
- foreach($get as $k=>$v){
- $_REQUEST[$k] = $v;
- $_GET[$k] = $v;
- }
+ $res = $objtmp->display_view();
- $res = customers::GetConf();
- $objtmp->check_action($action);
+ return $res;
+ }
+
+ /**
+ @brief
+ */
+ public function CallGetDBValue($objtmp,$action, $get){
+
- $res = $objtmp->display_view();
+ $_GET['action'] = $action;
+ foreach($get as $k=>$v)
+ $_GET[$k] = $v;
+
+ customers::Clean();
+ customers::GetConf();
+
+// customers::$action = $action;
+
+ $objtmp->check_action($action);
+
+ $res = customers::GetDBValue();
return $res;
}
-
}
?>
\ No newline at end of file
Modified: trunk/test/phpunit/Back/modules/pages/pageproductsTest.php
===================================================================
--- trunk/test/phpunit/Back/modules/pages/pageproductsTest.php 2014-02-10 18:12:15 UTC (rev 5133)
+++ trunk/test/phpunit/Back/modules/pages/pageproductsTest.php 2014-02-10 21:16:21 UTC (rev 5134)
@@ -191,22 +191,22 @@
@brief test display flag action
@depends testproductsConf
*/
- public function testproductsPrintFlag($objtmp){
+// public function testproductsPrintFlag($objtmp){
+//
+// $action = 'setflag';
+// $get = array();
+// $get['flag'] = 1;
+// $get['pID'] = 1;
+//
+// $get['forceajax'] = 1;
+//
+// $res = $this->CallGetDBValue($objtmp,$action, $get);
+// $res = $this->CheckAction($objtmp);
+//
+// $this->assertTrue ( ( strlen($res) >300) , 'Error retrun action::'.$action) ;
+//
+// }
- $action = 'setflag';
- $get = array();
- $get['flag'] = 1;
- $get['pID'] = 1;
-
- $get['forceajax'] = 1;
-
- $res = $this->CallGetDBValue($objtmp,$action, $get);
- $res = $this->CheckAction($objtmp);
-
- $this->assertTrue ( ( strlen($res) >300) , 'Error retrun action::'.$action) ;
-
- }
-
/**
@brief test display form new customers
@depends testproductsConf
@@ -285,8 +285,6 @@
$objtmp->check_action($action);
$res = products::GetDBValue();
-// $res = products::display_view();
-
return $res;
}
}
Modified: trunk/test/phpunit/Back/modules/pages/pagesorderTest.php
===================================================================
--- trunk/test/phpunit/Back/modules/pages/pagesorderTest.php 2014-02-10 18:12:15 UTC (rev 5133)
+++ trunk/test/phpunit/Back/modules/pages/pagesorderTest.php 2014-02-10 21:16:21 UTC (rev 5134)
@@ -30,7 +30,7 @@
/**
@var int
*/
- static public $Id;
+ static $list = array();
function __construct()
{
@@ -69,16 +69,22 @@
@brief test methode GetDBValue
@depends testordersConf
*/
- public function testadminsuersGetDBValue($objtmp){
+ public function testordersGetDBValue($objtmp){
// action default : listing
- $res = orders::tep_get_list();
+ $action = 'listing';
+ $get = array();
+ $get['oID'] = 11;
+ $res = $this->CallGetDBValue($objtmp , $action, $get);
+
+ $res = $this->CheckAction($objtmp);
$this->assertTrue ( ( is_array($res) ) , 'Error GetDBValue listing' ) ;
-// $res = orders::GetDBValue();
-
-
+ return array(
+ $objtmp
+ , $res
+ );
}
@@ -86,16 +92,19 @@
/**
@brief test display form edit
- @depends testordersConf
+ @depends testordersGetDBValue
*/
- public function testadminsuersPrintEdit($objtmp){
-
-
+ public function testordersPrintEdit($result){
+
+ $objtmp = $result[0];
+ $list = $result[1];
+
$action = 'edit';
$get = array();
$get['oID'] = 11;
- $res = $this->CheckAction($objtmp,$action, $get);
+ $res = $this->CallGetDBValue($objtmp,$action, $get);
+ $res = $this->CheckAction($objtmp);
$this->assertTrue ( ( strlen($res) > 2000) , 'Error retrun action::'.$action ) ;
}
@@ -103,48 +112,70 @@
/**
@brief test display form edit
- @depends testordersConf
+ @depends testordersGetDBValue
*/
- public function testadminsuersPrintCopyTo($objtmp){
-
+ public function testordersPrintCopyTo($result){
+ $objtmp = $result[0];
+ $list = $result[1];
$action = 'copyto';
$get = array();
$get['oID'] = 11;
- $res = $this->CheckAction($objtmp,$action, $get);
+ $res = $this->CallGetDBValue($objtmp,$action, $get);
+ $res = $this->CheckAction($objtmp);
$this->assertTrue ( ( strlen($res) > 400) , 'Error retrun action::'.$action ) ;
}
/**
@brief test display form edit
- @depends testordersConf
+ @depends testordersGetDBValue
*/
- public function testadminsuersPrintDelete($objtmp){
-
+ public function testordersPrintDelete($result){
+ $objtmp = $result[0];
+ $list = $result[1];
$action = 'delete';
$get = array();
$get['oID'] = 11;
$get['forceajax'] = true;
- $res = $this->CheckAction($objtmp,$action, $get);
+ $res = $this->CallGetDBValue($objtmp,$action, $get);
+ $res = $this->CheckAction($objtmp);
$this->assertTrue ( ( strlen($res) > 400) , 'Error retrun action::'.$action ) ;
}
+
+
+
+
+
/**
- @brief test display action page, no process action
- @depends testordersConf
+ @brief
*/
- public function CheckAction($objtmp,$action, $get){
+ public function CheckAction($objtmp){
- $get['action'] = $action;
- foreach($get as $k=>$v){
- $_REQUEST[$k] = $v;
+ $res = $objtmp->display_view();
+
+ return $res;
+ }
+
+ /**
+ @brief
+ */
+ public function CallGetDBValue($objtmp,$action, $get){
+
+
+ foreach($get as $k=>$v)
$_GET[$k] = $v;
- }
-
+
+ orders::Clean();
orders::GetConf();
- $res = $objtmp->display_view();
+
+ orders::$action = $action;
+
+ $objtmp->check_action($action);
+
+ $res = orders::GetDBValue();
return $res;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2014-02-10 18:12:18
|
Revision: 5133
http://sourceforge.net/p/oscss/svn/5133
Author: oscim
Date: 2014-02-10 18:12:15 +0000 (Mon, 10 Feb 2014)
Log Message:
-----------
Fix
Modified Paths:
--------------
trunk/catalog/admin/includes/classes/ModTreePage.php
trunk/catalog/admin/includes/classes/drivers/sqladmingroups.php
trunk/catalog/admin/includes/classes/drivers/sqladminmenu.php
trunk/catalog/admin/includes/classes/drivers/sqladminuser.php
trunk/catalog/admin/includes/classes/drivers/sqlnavigation_links.php
trunk/catalog/admin/includes/classes/drivers/sqlproduct.php
trunk/catalog/admin/includes/classes/oscss_cstr.php
trunk/catalog/admin/includes/functions/general.php
trunk/catalog/admin/includes/gabarit/featureds/edit.tab.childs.gab
trunk/catalog/admin/includes/modules/pages/featureds.php
trunk/catalog/admin/includes/template/defaut/header-1.php
trunk/catalog/install/includes/sql/mysql/tables/osc_extra_fields_to.sql
trunk/catalog/install/includes/sql/mysql/tables/osc_extra_fields_values.sql
trunk/test/phpunit/Back/_topDisplay.php
trunk/test/phpunit/Back/sqlxxx/sqladmingroupsTest.php
trunk/test/phpunit/Back/sqlxxx/sqladminuserTest.php
Modified: trunk/catalog/admin/includes/classes/ModTreePage.php
===================================================================
--- trunk/catalog/admin/includes/classes/ModTreePage.php 2014-02-10 14:57:38 UTC (rev 5132)
+++ trunk/catalog/admin/includes/classes/ModTreePage.php 2014-02-10 18:12:15 UTC (rev 5133)
@@ -394,10 +394,12 @@
$class=self::GetClassName();
$action = self::$action;
-
if(!tep_action_check(self::$action, $class::FILENAME))
tep_redirect(tep_href_link($class::FILENAME));
-
+
+ // specific ajax call mode return
+ $view = in_array(getenv('OSCSS_ENVIRONEMENT'), array('autotesting') );
+
switch(self::$action){
/**
@remarks Ajax View result
@@ -407,11 +409,21 @@
case 'setflag':
$action = '';
- print $class::RowStatus(array('status'=>(int)$_GET['flag'], 'id'=>(int)$class::$Id));
+ $res = $class::RowStatus(array('status'=>(int)$_GET['flag'], 'id'=>(int)$class::$Id));
+
+ if($view)
+ return $res;
+ else
+ print $res;
break;
case 'viewflag':
$action = '';
- print $class::RowHidden(array('hidden'=>(int)$class::$Info->hidden, 'id'=>(int)$class::$Id));
+ $res = $class::RowHidden(array('hidden'=>(int)$class::$Info->hidden, 'id'=>(int)$class::$Id));
+
+ if($view)
+ return $res;
+ else
+ print $res;
break;
/**
Modified: trunk/catalog/admin/includes/classes/drivers/sqladmingroups.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqladmingroups.php 2014-02-10 14:57:38 UTC (rev 5132)
+++ trunk/catalog/admin/includes/classes/drivers/sqladmingroups.php 2014-02-10 18:12:15 UTC (rev 5133)
@@ -52,11 +52,13 @@
self::PrepaDataAfterUse( $specimen , $dataarray, $post );
$sql_data_array = self::GetSqlArray();
-// $sql_data_array['admin_created'] = 'now()';
$DB->beginTransaction();
+
if(count($sql_data_array)>0){
+ unset($sql_data_array['admin_groups_id']);
+
$res=tep_db_perform(TABLE_ADMIN_GROUPS, $sql_data_array);
if(!$res)
@@ -110,13 +112,14 @@
$DB->beginTransaction();
if(count($sql_data_array)>0){
+ unset($sql_data_array['admin_groups_id']);
+
if( !tep_db_perform(TABLE_ADMIN_GROUPS, $sql_data_array, 'update' , substr($where,3) ) )
$error++;
}
else
$error++;
-
if( $error > 0){
$DB->rollbackTransaction();
return false;
@@ -219,9 +222,9 @@
*/
public static function Specimen($shortkey=false){
$result = array(
- 'admin_groups_id' => '',
+ 'admin_groups_id' => -1,
'admin_groups_name' => '',
- 'admin_groups_status' => '',
+ 'admin_groups_status' => 0,
);
return ((!$shortkey)? $result : self::CleanKey($result));
Modified: trunk/catalog/admin/includes/classes/drivers/sqladminmenu.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqladminmenu.php 2014-02-10 14:57:38 UTC (rev 5132)
+++ trunk/catalog/admin/includes/classes/drivers/sqladminmenu.php 2014-02-10 18:12:15 UTC (rev 5133)
@@ -3,106 +3,79 @@
@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/09/11, 20:11
+ @version 2.1.2
+ @date 29/10/2013, 20:11
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
- @class sqladminmenu
- @brief Manage delete/update/insert in table admin groupe
+ @file sqladminuser.php
+ @dir admin/includes/classes/drivers/
+*/
-TODO :
+require_once( DIR_FS_ADMIN . DIR_WS_CLASSES . 'SqlFilesDataDriverClass.php');
- EN cours de dev
-
-
-CREATE TABLE IF NOT EXISTS `osc_admin_m_menu` (
- `rowid` int(11) NOT NULL AUTO_INCREMENT,
- `admin_url` varchar(128) NOT NULL COMMENT 'fichier, avec get',
- `sort_order` int(11) NOT NULL,
- `parent_id` int(11) NOT NULL,
- PRIMARY KEY (`rowid`),
- UNIQUE KEY `admin_files_name` (`admin_url`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=115 ;
-
--- --------------------------------------------------------
-
---
--- Structure de la table `osc_admin_m_menu_description`
---
-
-CREATE TABLE IF NOT EXISTS `osc_admin_m_menu_description` (
- `rowid` int(11) NOT NULL,
- `language_id` int(11) NOT NULL,
- `title` varchar(250) NOT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-
--- --------------------------------------------------------
-
---
--- Structure de la table `osc_admin_m_menu_to_right`
---
-
-CREATE TABLE IF NOT EXISTS `osc_admin_m_menu_to_right` (
- `menu_id` int(11) DEFAULT NULL,
- `type_id` int(1) NOT NULL COMMENT '0 group / 1 user',
- `id_ref` int(11) DEFAULT NULL,
- UNIQUE KEY `menuusergroup` (`menu_id`,`type_id`,`id_ref`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-
+/**
+ @class sqladminuser
*/
+class sqladminuser
+ Extends SqlFilesDataDriverClass
+ implements ModSqlDataDriver{
+ public static $modules;
-
-
-class sqladminmenu
- implements ModSqlDataDriver{
- /**
- @var object childs module class
- */
- public static $modules;
- /**
- @var current ressource class
- */
protected static $_instance;
- /**
- @var string error detail
- */
- public static $error = false;
- /**
- @brief constructor
- no direct call, but is auto call by static public method
- This method init Childs modules class
- */
protected function __construct(){
- self::$modules=new AcaFactory('adminuser'/*,'MODULE_ACACAT_INSTALLED_BO'*/);
+ self::$modules=new AcaFactory('adminuser');
}
- /**
- @brief for call construct class in singletown
- @return current instance
- */
+
public static function getInstance() {
if(self::$_instance == null) self::$_instance = new self();
return self::$_instance;
}
+
/**
@brief create new ligne in table configuration
*/
public static function create($option){
self::getInstance();
+ $DB=Database::getInstance();
+ $error = 0 ;
+ $specimen = self::Specimen();
- if(isset($option['admin_url'])) $sql_data_array['admin_url'] = $option['admin_url'];
- if(isset($option['sort_order'])) $sql_data_array['sort_order'] = $option['sort_order'];
- if(isset($option['parent_id'])) $sql_data_array['parent_id'] = $option['parent_id'];
+ $post =(isset($option['post'])? $option['post'] : array() );
+ $dataarray =(isset($option['sqlarray'])? $option['sqlarray'] : array() );
- $res=tep_db_perform(TABLE_ADMIN_MENU, $sql_data_array);
+ 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(!$res)
- return $res;
- else
- return $res->__get('insertId');
+ $DB->beginTransaction();
+
+ if(count($sql_data_array) > 0) {
+ $sql_data_array['admin_created'] = 'now()';
+
+ $res = tep_db_perform(TABLE_ADMIN, $sql_data_array) ;
+ if( !$res )
+ $error++;
+ }
+ else
+ $error++;
+
+ if( $error > 0){
+ $DB->rollbackTransaction();
+ return false;
+ }
+ else{
+ $id = $res->__get('insertId');
+ $DB->commitTransaction();
+ return $id;
+ }
}
/**
@@ -111,59 +84,83 @@
public static function update($option){
self::getInstance();
- if(!isset($option['id']) ){
- self::$error= 'no id';
- return false;
- }else
- $id = (int)$option['id'];
+ if(!isset($option['id']) )
+ return false;
- if(isset($option['rowid'])) $sql_data_array['rowid'] = $id;
- if(isset($option['admin_url'])) $sql_data_array['admin_url'] = $option['admin_url'];
- if(isset($option['sort_order'])) $sql_data_array['sort_order'] = $option['sort_order'];
- if(isset($option['parent_id'])) $sql_data_array['parent_id'] = $option['parent_id'];
+ $DB=Database::getInstance();
+ $error = 0 ;
+ $specimen = self::Specimen();
+ $post =(isset($option['post'])? $option['post'] : array() );
+ $dataarray =(isset($option['sqlarray'])? $option['sqlarray'] : array() );
- $res=tep_db_perform(TABLE_ADMIN_MENU, $sql_data_array, 'update' , substr($where,3) );
+ self::PrepaDataAfterUse( $specimen , $dataarray, $post );
+
+ $sql_data_array = self::GetSqlArray();
- return $res;
- }
+ $where ='';
+ if(isset($option['id'])) $where .="AND admin_id = '".(int)$option['id']."' ";
+ $DB->beginTransaction();
+ 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;
+
+ if( $error > 0){
+ $DB->rollbackTransaction();
+ return false;
+ }
+ else{
+ $DB->commitTransaction();
+ return 1;
+ }
+ }
+
/**
@brief load ligne in table configuration
@param option array
- id => row id int (configuration_id)
- key => string key (configuration_key)
- group_id => group_id int (configuration_group_id)
+ id => row id int (configuration_id)
+ key => string key (configuration_key)
+ group_id => group_id int (configuration_group_id)
@param $shortkey use cleankey for return short key
@return
object(stdClass)[13]
- public 'id' => string '1' (length=1)
+ public 'id' => string '1' (length=1)
OR
- array(
- object(stdClass)[13]
- ...
- object(stdClass)[13]
- ..
- )
+ array(
+ object(stdClass)[13]
+ ...
+ object(stdClass)[13]
+ ..
+ )
*/
public static function fetch($option,$shortkey=false){
self::getInstance();
- $DB=Database::getInstance();
+ $DB=Database::getInstance();
+ $error = 0 ;
+
$sql ="";
if(isset($option['id'])) $sql .="AND admin_id = '".(int)tep_db_input($option['id'])."' ";
- if(isset($option['group_id'])) $sql .="AND a.admin_groups_id = '".(int)(string)tep_db_input($option['group_id'])."' ";
+ if(isset($option['group_id'])) $sql .="AND a.admin_groups_id = '".(int)tep_db_input($option['group_id'])."' ";
+ if(isset($option['email'])) $sql .="AND admin_email_address = '".(int)tep_db_input($option['email'])."' ";
+ if(isset($option['uniqkey'])) $sql .="AND url_openid = '".(string)tep_db_input($option['uniqkey'])."' ";
- $sql="SELECT * FROM " . TABLE_ADMIN_MENU . " a ".
- " LEFT JOIN " . TABLE_ADMIN_MENU_GROUPS . " g ON (a.admin_groups_id=g.admin_groups_id) ".
- " WHERE ".substr($sql,3);
+ $sql="SELECT * FROM " . TABLE_ADMIN . " a ".
+ " LEFT JOIN " . TABLE_ADMIN_GROUPS . " g ON (a.admin_groups_id=g.admin_groups_id) ".
+ " WHERE 1 ".$sql;
$res=$DB->query($sql);
@@ -177,7 +174,7 @@
$array=array();
foreach($res->fetchAllAssoc() as $result)
- $array[]= ((!$shortkey)? $result : self::CleanKey($result));
+ $array[]= ((!$shortkey)? $result : self::CleanKey($result));
return $array;
}
@@ -198,15 +195,10 @@
return false;
- // ACA START DELETE
- self::$modules->delete($_id);
+ sqladminnotification::delete( array('user_id'=> (int)$_id , 'type'=>'1'));
+ $DB->query("delete from " . TABLE_ADMIN . " where admin_id = '" . (int)$_id . "'");
-// $DB->query("delete from " . TABLE_ADMIN_MENU_NOTIFICATION . " where rowid = '" . (int)$_id . "' AND notif_type = '1' ");
-
- $DB->query("delete from " . TABLE_ADMIN_MENU . " where rowid = '" . (int)$_id . "'");
-
-
return true;
}
@@ -215,17 +207,37 @@
@brief
@return array product empty
*/
- public static function Specimen(){
- $par = array('rowid' => '',
- 'admin_url' => '',
- 'sort_order' => '',
- 'parent_id' => '',
- );
+ public static function Specimen($shortkey=false){
+ $par = array(
+ 'admin_id' => -1,
+ 'admin_groups_id' => 0,
+ 'admin_firstname' => '',
+ 'admin_lastname' => '',
+ 'admin_email_address' => '',
+ 'admin_modified' => '',
+ 'admin_password' => '',
+ 'admin_language_id' => 0,
+ 'admin_status' => 0,
+ 'url_openid' => '',
+ );
- return self::CleanKey($par);
+ 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 CleanKey()
@brief Clean string name key
@@ -235,11 +247,13 @@
$object= new stdclass();
foreach($array as $key=>$value){
- if( strpos($key,'admin_') ===0)
- $key=substr($key,6);
+ if( strpos($key,'admin_') ===0)
+ $key=substr($key,6);
+ elseif( $key =='url_openid')
+ $key='uniqkey';
- $object->$key = $value;
+ $object->$key = $value;
}
return $object;
Modified: trunk/catalog/admin/includes/classes/drivers/sqladminuser.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqladminuser.php 2014-02-10 14:57:38 UTC (rev 5132)
+++ trunk/catalog/admin/includes/classes/drivers/sqladminuser.php 2014-02-10 18:12:15 UTC (rev 5133)
@@ -93,9 +93,7 @@
$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();
@@ -106,6 +104,8 @@
$DB->beginTransaction();
if(count($sql_data_array)>0 ){
+
+ unset($sql_data_array['admin_id']);
$sql_data_array['admin_modified'] = 'now()';
if( !tep_db_perform(TABLE_ADMIN, $sql_data_array, 'update' , substr($where,3) ) )
Modified: trunk/catalog/admin/includes/classes/drivers/sqlnavigation_links.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlnavigation_links.php 2014-02-10 14:57:38 UTC (rev 5132)
+++ trunk/catalog/admin/includes/classes/drivers/sqlnavigation_links.php 2014-02-10 18:12:15 UTC (rev 5133)
@@ -1,412 +1,94 @@
-<?php if (!defined('HTTP_SERVER')) die('You can not access this file directly!');
+<?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 10/05/2012 ,17:48:30
- @author oscim <mail aur...@os...> <www http://www.oscim.fr>
- @encode UTF-8
- @file sqlnavigation_links.php
- @dir admin/includes/classes/drivers/
-*/
+ * \file test/phpunit/Back/navigation_linksTest.php
+ * \brief test unitaire class navigation_links Backoffice
+ * \remarks To run this script as CLI: phpunit filename.php
+ * \author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ */
+// specific for test
+require_once(substr( dirname(__FILE__), 0, -7).'/_top.php');
+global $base_path;
-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{
+ * \class navigation_linksTest
+ */
+class sqlnavigation_linksTest
+ extends PHPUnit_Framework_TestCase
+{
- public static $modules;
+ /**
+ @var int
+ */
+ static public $Id;
- protected static $_instance;
-
- protected function __construct(){
+ function __construct()
+ {
}
+ public function testnavigation_linksSpecimen(){
- public static function getInstance() {
- if(self::$_instance == null) self::$_instance = new self();
- return self::$_instance;
- }
+ $specimen = sqlnavigation_links::Specimen();
- /**
- @brief create new ligne in table configuration
- */
- public static function create($option){
- 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();
-
- if(isset($sql_data_array['nav_link_id']))
- unset($sql_data_array['nav_link_id']);
-
+ $this->assertTrue ( ( is_array($specimen) ) , 'Error navigation_links Specimen convert' ) ;
- $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 )
- throw new Exception("in sql create");
-
- if( !is_object($res)){
- $DB->rollbackTransaction();
- return false;
- }
-
- $id = $res->__get('insertId');
-
-
- $sql_data_array = array();
- $sql_data_array['nav_cpath'] = self::GetcPath($id);
-
- if( ! tep_db_perform(TABLE_NAVIGATION_LINKS, $sql_data_array, 'update' , " nav_link_id = '".$id."' " ) )
- 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++;
- }
-
-
- }
- catch(Exception $e){
-// print_r($e);
- $error++;
- }
-
-
-
- if( $error > 0){
- $DB->rollbackTransaction();
- return false;
- }
- else{
- $DB->commitTransaction();
- return $id;
- }
+ return array(
+ 'sqlarray'=>$specimen,
+ 'post'=>$specimen,
+ );
}
/**
- @brief update ligne in table configuration
- */
- public static function update($option){
- self::getInstance();
- $DB=Database::getInstance();
- $error= 0;
- $specimen = self::Specimen();
-
-
- if(!isset($option['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();
-
-// print_r($specimen);
-// exit;
- $DB->beginTransaction();
+ * @brief test creat account user
+ * @depends testnavigation_linksSpecimen
+ */
+ public function testnavigation_linksCreat( $specimen ){
- $where ='';
- $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']."' ";
+ $id = sqlnavigation_links::create($specimen);
- 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();
+ $this -> assertTrue ( ((int)$id >0) , 'Error navigation_links not create' ) ;
- $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++;
- }
- }
-
- // 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']);
-
- $res=tep_db_perform(TABLE_NAVIGATION_LINKS_DESCRIPTION, $sql_data_array, 'update', substr($wh,3) );
- if(!$res)
- $error++;
- }
-
-
- if( $error > 0){
- $DB->rollbackTransaction();
- return false;
- }
- else{
- $DB->commitTransaction();
- return 1;
- }
+ $specimen['id'] = $id;
+ return $specimen;
}
- /**
- @brief load ligne in table configuration
- @param option array
- id => row id int (configuration_id)
- key => string key (configuration_key)
- group_id => group_id int (configuration_group_id)
- @param $shortkey use cleankey for return short key
- @return
- object(stdClass)[13]
- public 'id' => string '1' (length=1)
-
- OR
- array(
- object(stdClass)[13]
- ...
- object(stdClass)[13]
- ..
- )
-
- */
- public static function fetch($option,$shortkey=false){
- self::getInstance();
- $DB=Database::getInstance();
-
- $where ="";
- $language_id = false;
- if(isset($option['id'])) $where .="AND nav_link_id = '".(int)$option['id']."' ";
- if(isset($option['mode'])) $where .="AND nav_mode = '".(int)$option['mode']."' ";
- 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['parent_id'])) $where .="AND parent_id = '".(int)$option['parent_id']."' ";
-
- if($where=='')
- return false;
-
-
- if(isset($option['language_id']))
- $language_id = $option['language_id'];
-
-
- $sql="SELECT * FROM " . TABLE_NAVIGATION_LINKS . " a ";
- $sql.=" WHERE ".substr($where,3);
-
- $res=$DB->query($sql);
-
- $num = $res->__get('numRows');
-
- if($num == 1){
- $result=$res->fetchAssoc();
-
- if($language_id > 0){
- $_query = $DB->query($sql="select fd.nav_name from " . TABLE_NAVIGATION_LINKS_DESCRIPTION . " fd where fd.nav_link_id = '" . (int)$result['nav_link_id'] . "' AND language_id='" . (int)$language_id . "'");
- $descr = $_query->fetchAssoc();
-
- $result['name'][$language_id] = $descr['nav_name'];
-
- tep_db_free_result($_query);
- }
- else{
- // call all langue for this post
- $_query = $DB->query($sql="select fd.* from " . TABLE_NAVIGATION_LINKS_DESCRIPTION . " fd where fd.nav_link_id = '" . (int)$result['nav_link_id'] . "' ");
-
- foreach($_query->fetchAllAssoc() as $descr){
- $result['name'][$descr['language_id']] = $descr['nav_name'];
- }
- tep_db_free_result($_query);
-
- foreach(tep_get_languages() as $lg){
- if(!isset($result['name'][$lg['id']]))
- $result['name'][$lg['id']] ='';
- }
- }
-
- return ((!$shortkey)? $result : self::CleanKey($result));
- }
- elseif($num > 1){
- $array=array();
-
- foreach($res->fetchAllAssoc() as $result){
-
- $_query = $DB->query($sql="select fd.nav_name from " . TABLE_NAVIGATION_LINKS_DESCRIPTION . " fd where fd.nav_link_id = '" . (int)$result['nav_link_id'] . "' AND language_id='" . (int)$language_id . "'");
- $descr = $_query->fetchAssoc();
-
- $result['name']/*[$language_id]*/ = $descr['nav_name'];
-
- tep_db_free_result($_query);
-
- $array[]= ((!$shortkey)? $result : self::CleanKey($result));
- }
-
- return $array;
- }
-
- return false;
- }
-
/**
- @brief delete row
- */
- public static function delete($option){
- self::getInstance();
- $DB=Database::getInstance();
+ * @depends testnavigation_linksCreat
+ */
+ public function testnavigation_linksUpdate( $specimen ){
- $where ="";
- if(isset($option['id'])) $where .="AND nav_link_id = '".(int)$option['id']."' ";
- if(isset($option['type'])) $where .="AND nav_link_type = '".(int)$option['type']."' ";
- if(isset($option['status'])) $where .="AND nav_link_status = '".(int)$option['status']."' ";
- if(isset($option['mode'])) $where .="AND nav_mode = '".(int)$option['mode']."' ";
- if($where=='')
- return false;
+ $res=sqlnavigation_links::fetch( array('id'=>$specimen['id']) , true);
+ $this -> assertTrue ( (is_object($res) ) , 'navigation_links not exists, or fetch error load ' ) ;
- $res = $DB->query("SELECT nav_link_id as id FROM " . TABLE_NAVIGATION_LINKS ." WHERE ". substr($where, 3 ).' LIMIT 1' );
- $result = $res->fetchAssoc();
+ $res = sqlnavigation_links::update($specimen);
- // childs tables
- $DB->query("delete from " . TABLE_NAVIGATION_LINKS_DESCRIPTION . " where nav_link_id = '" . (int)$result['id'] . "'");
+ $this -> assertTrue ( ($res == 1) , 'Error navigation_links not update' ) ;
- $DB->query("delete from " . TABLE_NAVIGATION_LINKS . " where nav_link_id = '" . (int)$result['id'] . "'");
-
-
- return true;
+ return $specimen;
}
/**
- @brief
- @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' => -1,
- 'nav_mode' => 2, // 1,2
- 'nav_sort_order' => 5,
- 'nav_css_id' => '',
- 'nav_file' => '',
- 'nav_link_type' => 1,
- 'customers_status' => 0,
- 'nav_link_status' => 0,
- 'parent_id' => 0,
-
- // language table
- 'lg' =>$tmp_lg,
- );
+ * @depends testnavigation_linksCreat
+ */
+ public function testnavigation_linksDelete( $specimen ){
-// foreach(tep_get_languages() as $lg){
-// $par['name'][$lg['id']] ='';
-// }
+ $res = sqlnavigation_links::delete( array('id'=>$specimen['id']) );
- return ((!$shortkey)? $par : self::CleanKey($par));
- }
+ $this -> assertTrue ( ($res == true ) , 'Error navigation_links not delete' ) ;
- /**
- @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
- */
- public static function CleanKey($array){
- self::getInstance();
- $object= new stdclass();
-
- foreach($array as $key=>$value){
- if( strpos($key,'nav_link_') ===0)
- $key=substr($key,strlen('nav_link_'));
- elseif( strpos($key,'nav_') ===0)
- $key=substr($key,strlen('nav_'));
-
- $object->$key = $value;
- }
-
- return $object;
}
- /**
- */
- static function GetcPath($id, $array = array() ){
-
- $DB=Database::getInstance();
-
- $res = $DB->query("SELECT parent_id as id FROM " . TABLE_NAVIGATION_LINKS ." WHERE nav_link_id='".(int)$id."' LIMIT 1" );
- $result = $res->fetchAssoc();
-
- if($result['id'] == $id || $result['id'] == 0)
- return implode(array_reverse($array), '_');
- else{
- $array[] = $result['id'];
- return self::GetcPath($result['id'], $array );
- }
- }
}
-
?>
\ No newline at end of file
Modified: trunk/catalog/admin/includes/classes/drivers/sqlproduct.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlproduct.php 2014-02-10 14:57:38 UTC (rev 5132)
+++ trunk/catalog/admin/includes/classes/drivers/sqlproduct.php 2014-02-10 18:12:15 UTC (rev 5133)
@@ -472,7 +472,7 @@
tep_db_query("delete from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$product_id . "'");
- tep_db_query("delete from " . TABLE_PRODUCTS . " where products_id = '" . (int)$product_id . "'");
+ $res =tep_db_query("delete from " . TABLE_PRODUCTS . " where products_id = '" . (int)$product_id . "'");
qtpro_doctor_amputate_all_from_product($product_id);
Modified: trunk/catalog/admin/includes/classes/oscss_cstr.php
===================================================================
--- trunk/catalog/admin/includes/classes/oscss_cstr.php 2014-02-10 14:57:38 UTC (rev 5132)
+++ trunk/catalog/admin/includes/classes/oscss_cstr.php 2014-02-10 18:12:15 UTC (rev 5133)
@@ -1,500 +1,165 @@
<?php if (!defined('HTTP_SERVER')) die('You can not access this file directly!');
/**
- @licence GPL 2005-2014 The osCSS developers - osCSS Open Source E-commerce
- @package oscss-2 <www http://www.oscss.org>
- @version 2.2.0
- @date 06/01/2014, 11:28
+ @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 09/04/2012, 09:08
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
- @encode UTF-8
- @class oscss_cstr
- Constructeur de page et ordonanceur.
- Prend en charge l'appel des extensions
+*/
- NOTE:
-
- chargement d'une extension
- ex: $oscss->_add_ext('dsrte','editeur/');
-
- Appel init top de l'extension
- ex: echo $oscss->_call('dsrte','_top',[option]);
-
- Appel script extension
- ex: echo $oscss->_call('dsrte','_head',[option]);
-
- Appel / exe extension
- ex: echo $oscss->_call('dsrte','_draw',[option]);
-
+/**
+ @class oscss_acl
*/
-
-class oscss_cstr {
-
- /**
- @var
- */
- private static $PileFile=array();
- /**
- @var string name file cache file exists
- */
- private static $key_file_cache;
- /**
- @var list all code stocked by call back
- */
- protected static $_CallBack;
- /**
- @var
- */
+class oscss_acl {
+ /**
+ @var file name not control acl
+ */
+ private $authorise = array();
+ /**
+ @var page_id
+ */
+ private $page_id ;
+ /**
+ @var $page_name
+ */
+ private $page_name ;
+ /**
+ @var current object detail row
+ */
+ private $current = array() ;
+ /**
+ @var $cacheSess array detail row
+ */
+ protected $cacheSess = array() ;
+ /**
+ @var ressource instance
+ */
protected static $_instance;
-
- /**
- @brief constructeur
- */
- protected function __construct(){
- $this->vars=array();
-
- /**
- Pile des file de lang
- */
- $this->PileFileLang=array();
-
- $this->base = (isset($_SERVER['REQUEST_URI'])?basename($_SERVER['REQUEST_URI']) : basename($_SERVER['PHP_SELF']));
- //! key cache file
- self::$key_file_cache= 'BO_files-'.md5( $this->base .(isset($_SESSION['login_firstname'])? $_SESSION['login_firstname']: 'guest'));
- }
-
- /**
- @brief get instance
- */
- public static function getInstance() {
- if(self::$_instance == null) self::$_instance = new self();
- return self::$_instance;
- }
-
- /**
- @brief Add constructeur
- @param $class
- */
- private function add_obj($class){
- if (class_exists($class)) $this->$class = new $class();
- else return false;
- }
-
+
/**
- @brief init class
+ @fn __construct()
+ @brief constructor
*/
- public static function afterAppliTop(){
- /**
- @remarks init class
- */
- new CsrtAction();
- }
+ protected function __construct(){
+ $this->authorise=array(
+ FILENAME_DEFAULT,
+ FILENAME_FORBIDEN,
+ FILENAME_LOGOFF,
+ FILENAME_ADMIN_ACCOUNT
+ );
+ $this->page_id = 0;
- /**
- @fn _add_in($object, $name, $value)
- @brief Ajout d'element a l'object precisé
- @param $object object nom du sous l'object a qui ajoute l'element
- @param $name string nom de var ajouté
- @param $value array/string/int/... valeur
- */
- public function _add_in($object, $name, $value){
- if (!isset($this->$object) && !$this->add_obj($object) )
- die(_('pas d\'oject de ce nom')) ;
- //! operator
- $obj=$this->$object;
- if(is_object($value)){
- $this->$name=$value;
- }elseif(is_array($value)) {
- $obj[$name]=$value;
- $this->$object=$obj;
- }
- elseif(is_string($value)){
- $obj[$name]=addslashes($value);
- $this->$object=$obj;
- }
- }
+ $sql ="SELECT f.admin_files_id, f.admin_files_name FROM " . TABLE_ADMIN_FILES . " f , ".TABLE_ADMIN_GROUPS." u ".
+ " WHERE FIND_IN_SET( '" .(int) $_SESSION['login_groups_id'] . "', f.admin_groups_id) AND u.admin_groups_id = '" .(int) $_SESSION['login_groups_id'] . "' AND admin_groups_status = 1 ";
- /**
- @brief init d'un object
- @param $object string nom de l'object
- */
- public function _add_init($object){
- if (!isset($this->$object) && !$this->add_obj($object) ){
- die(_('pas d\'oject de ce nom')) ;
- }
- return $this->$object;
- }
+ $_query = tep_db_query($sql);
+ $tmp = array();
+ if (tep_db_num_rows($_query))
+ foreach($_query->fetchAllAssoc() as $row){
+ $tmp[$row['admin_files_id']] = $row['admin_files_name'];
+ $this->cacheSess[$row['admin_files_name']] = $row;
+ }
- /**
- @fn _add_ext($name_object, $path)
- @brief Init d'un plugin via un fichier oscss_init
- @note Les functions seront aouté aux sous object
- @param generic string path (ex:DIR_WS_PLUGIN) (terminé par /)
- @param $name_object string nom de l'object
- */
- public function _add_ext($name_object, $path){
- if(is_dir($path) && self::TestFile($path.$name_object.'/oscss_init.php') ) {
- include_once($path.$name_object.'/oscss_init.php');
- $this->add_obj($name_object.'_oscss');
- }
- else die(__('Error extention editeur introuvable'));
- }
+ $sql ="SELECT u.files_id, u.action FROM " . TABLE_ADMIN_FILES2RIGHT." u ".
+ " WHERE ( u.type = '0' AND u.ref_id = '" .(int) $_SESSION['login_groups_id'] . "' ) OR ( u.type = '1' AND u.ref_id = '" .(int) $_SESSION['login_id'] . "' ) ";
+ $_query = tep_db_query($sql);
- /**
- @fn _call($key_object, $funct)
- @brief Appel public des function de chargeur des extensions
- @param $key_object string object key de l'obj (ex 'dsrte' pour la class 'dsrte_oscss' )
- @param $funct string $function de construction block (_top, _head, _draw)
- @return object
- */
- public function _call($key_object, $funct /*[arg functions] */){
- $oscss=$this;
- $object=$key_object.'_oscss';
- if(!isset($this->$object)) return false;
- $vars='';
- if(func_num_args()>2) {
- for($i=2;$i<(func_num_args()-1);$i++){
- $t[$i] = func_get_arg($i);
- $vars.="\$t[$i],";
- }
- $t[$i] = func_get_arg($i);
- $vars.="\$t[$i]";
- }
- if ($vars !='') {
- eval("\$ret = \$this->\$object->$funct($vars);");
- return $ret;
- }
- else return $this->$object->$funct();
- }
+ if (tep_db_num_rows($_query))
+ foreach($_query->fetchAllAssoc() as $row)
+ $this->cacheSess[$tmp[$row['files_id']]]['action'][] = $row['action'];
- /**
- stock var in array
- key => value
- */
- public function add_var($key,$value){
- $this->vars[(string)$key]=$value;
- }
+ }
- /**
- @fn the_var($key)
- @brief Retour du contenu de la var
- @param $key string
- @return var or false
- */
- public function the_var($key){
- if(isset($this->vars[(string)$key])) return $this->vars[(string)$key];
- else return false;
- }
+ /**
+ @fn getInstance()
+ @brief
+ */
+ public static function getInstance() {
+ if(self::$_instance == null)
+ self::$_instance = new self();
-
-
- /**
- @brief Chargeur de fichier de langues
- @note Specifique au .txt
- @param $path_file string pathfilename
- @return none
- */
- public function pile_file_lang($path_file){
- global $lang;
- if(substr($path_file,0,strlen(DIR_FS_ADMIN)) !=DIR_FS_ADMIN && substr($path_file,0,strlen(DIR_FS_CATALOG)) !=DIR_FS_CATALOG ) $path_file= DIR_FS_ADMIN.$path_file;
-
-
- if(!in_array($path_file,$this->PileFileLang))
- if(self::TestFile($path_file)) include_once($path_file);
-
+ return self::$_instance;
}
- /**
- @fn cache_lang($load=true)
- @brief Charge et stock le cache des fichier de lang en .txt
- @note Appelé en debut et fin d'appli
- @param $load boolean
- @return none
- */
- public function cache_lang($load=true){
- global $osCSS_Cache,$lang;
+ /**
+ @fn loafconfig($_page)
+ @brief Froce reload $current for specific page
+ @param $_page page.php for owner action
+ @return bool true => Ok / false => KO
+ */
+ function loafconfig($_page){
+ foreach($this->cacheSess as $key=>$row)
+ if($_page ==$key){
+ $this->page_id = $row['admin_files_id'];
+ $this->page_name = $key;
- $key_file= 'BO_lang-'.$this->the_var('languages_id').'-'.md5($this->base.(isset($_SESSION['login_firstname'])? $_SESSION['login_firstname']: 'guest'));
+ $this->current = (isset($row['action'])?$row['action'] : false );
- if($load){
- if ($osCSS_Cache->read($key_file, 3600) ) {
- $res= $osCSS_Cache->getCache();
- global $lang;
- $lang=$res['lang'];
- $this->PileFileLang=$res['PileFile'];
- }
- } else{
- if(!isset($this->PileFileLang)) $this->PileFileLang=array();
- $osCSS_Cache->read($key_file, 3600);
- $PileFile=array();
- foreach(get_included_files() as $e)
- if(substr($e,-3)=='txt') $PileFile[]=$e;
+ return true;
+ }
- if(count($PileFile)>0) {
- $variable = array('lang'=>$lang,'PileFile'=>array_merge($PileFile,$this->PileFileLang) );
- $osCSS_Cache->writeBuffer($variable);
- }
- }
- }
+ return false;
+ }
+ /**
+ @fn PageRight()
+ @brief
+ @param $_page page.php for owner action
+ @return bool true => Ok / false => KO
+ */
+ function PageRight($_page){
+ $filename = trim($_page);
- /**
- test si fichier existe et cache du test
- enregsitrement a la volee
- return boolean
- */
- public static function TestFile($file){
- global $osCSS_Cache,$lang;
+ if (
+ in_array($filename,$this->authorise)
+ || in_array(substr($filename,0,strpos($filename,'?') ),array('attributeManager.php'))
+ )
+ return true;
- $keytemp=md5($file);
+ return $this->loafconfig($_page);
+ }
- if ($osCSS_Cache->read(self::$key_file_cache, 3600) ) {
- $res= $osCSS_Cache->getCache();
- self::$PileFile=$res;
- $result=self::Testfile_exists($file,$keytemp);
- if(count($res) < count(self::$PileFile)){
- $osCSS_Cache->clear(self::$key_file_cache);
- $osCSS_Cache->writeBuffer(self::$PileFile);
- }
- }
- else {
- $result=self::Testfile_exists($file,$keytemp);
- $osCSS_Cache->writeBuffer(self::$PileFile);
- }
- return _test_bool($result);
- }
+ /**
+ @fn ActionRight()
+ @brief Check one action and one page
+ @param $action string , name action
+ @param $_page page.php for owner action
+ @return bool true => Ok / false => KO
+ */
+ function ActionRight($action, $_page=''){
- private static function Testfile_exists($file,$keytemp){
- if(isset(self::$PileFile[$keytemp])) return self::$PileFile[$keytemp];
- elseif(file_exists($file)) return self::$PileFile[$keytemp]='true';
- else return 'false';
- }
+ if(strlen($action)<=0)
+ return true;
- /**
- @fn oscss_cstr::test_gab_theme($element,$ext='php')
- @brief load Template Environement
- test présence élément de gabarit, retour false ou path
- @return (bool)false OR string path file
- */
- public static function test_gab_theme($element,$ext='php'){
+ if($this->page_name !=trim($_page))
+ if( ! $this->loafconfig($_page))
+ return false;
- if (self::TestFile(DIR_WS_TEMPLATE.$element.'-'.$_SESSION['login_groups_id'].'.'.$ext) )
- return DIR_WS_TEMPLATE.$element.'-'.$_SESSION['login_groups_id'].'.'.$ext;
- elseif (self::TestFile(DIR_WS_TEMPLATE.$element.'-'.$_SESSION['login_id'].'.'.$ext) )
- return DIR_WS_TEMPLATE.$element.'-'.$_SESSION['login_id'].'.'.$ext;
- elseif (self::TestFile(DIR_WS_TEMPLATE.$element.'-1.'.$ext) )
- return DIR_WS_TEMPLATE.$element.'-1.'.$ext;
- elseif (self::TestFile(DIR_WS_TEMPLATE.$element.'.'.$ext) )
- return DIR_WS_TEMPLATE.$element.'.'.$ext;
- elseif (self::TestFile(DIR_WS_INCLUDES.'template/'.DEFAULT_TEMPLATE_NAME.'/'.$element.'-'.$_SESSION['login_groups_id'].'.'.$ext) )
- return DIR_WS_INCLUDES.'template/'.DEFAULT_TEMPLATE_NAME.'/'.$element.'-'.$_SESSION['login_groups_id'].'.'.$ext;
- elseif (self::TestFile(DIR_WS_INCLUDES.'template/'.DEFAULT_TEMPLATE_NAME.'/'.$element.'-'.$_SESSION['login_id'].'.'.$ext) )
- return DIR_WS_INCLUDES.'template/'.DEFAULT_TEMPLATE_NAME.'/'.$element.'-'.$_SESSION['login_id'].'.'.$ext;
- elseif (self::TestFile(DIR_WS_INCLUDES.'template/'.DEFAULT_TEMPLATE_NAME.'/'.$element.'-1.'.$ext) )
- return DIR_WS_INCLUDES.'template/'.DEFAULT_TEMPLATE_NAME.'/'.$element.'-1.'.$ext;
- elseif (self::TestFile(DIR_WS_INCLUDES.'template/'.DEFAULT_TEMPLATE_NAME.'/'.$element.'.'.$ext) )
- return DIR_WS_INCLUDES.'template/'.DEFAULT_TEMPLATE_NAME.'/'.$element.'.'.$ext;
- else
- return false;
- }
+ if( (int) $_SESSION['login_groups_id'] == 1)
+ return true;
+ elseif ( $this->current ==false ) // no data in db fo restrict
+ return true;
+ elseif ( is_array($this->current) && in_array($action,$this->current) )
+ return true;
- /**
- @fn oscss_cstr::linkDocs($page_module)
- @brief link for online docs, in http://wiki.oscss.org/documentation/
- @param $page_module nom page courante
- */
-// public static function linkDocs($page_module){
-// $url ="http://wiki.oscss.org/documentation/?";
-// $url.="version=2.1.0&lang=fr_FR&page=".$page_module."&path=".$page_module;
-// if(isset($_REQUEST['type'])) $url.="/".$_REQUEST['type'];
-// if(isset($_REQUEST['action'])) $url.="&action=".$_REQUEST['action'];
-// return $url;
-// }
-
-
- /**
- @fn oscss_cstr::CallBack($code, $mode='code',$pile='post_load')
- @brief Add js put in header/footer page
- @param $code path file or code
- @param $mode string code / file
- @param $pile name for current pile
- */
- public static function CallBack($code,$mode='code', $pile='post_load'){
- self::$_CallBack;
-
- if(!isset(self::$_CallBack->$pile))
- self::$_CallBack->$pile = '';
-
- if($mode =='code') {
- self::$_CallBack->$pile .= addslashes($code). "\n";
- }
-// elseif($mode =='js')
-// tep_include_file($code);
+ return false;
}
- /**
- @fn oscss_cstr::CallBackExec($pile='post_load')
- @brief call js stocked by CallBack methode
- @param $page_module nom page courante
- */
- public static function CallBackExec($pile='post_load'){
- if(!isset(self::$_CallBack->$pile))
- return ;
- else
- return stripslashes(self::$_CallBack->$pile);
+ /**
+ @fn Block()
+ @brief Force redirect and exit
+ */
+ function Block(){
+ tep_redirect(tep_href_link(FILENAME_FORBIDEN,'', 'NONSSL'));
}
-
-
-
- public function debugg(){
- print_r( $this);
- }
}
-
-
-/**
- @brief class de gestion des boutons , liens et commande d'action.
- @class
- TODO: integrer ACL
-*/
-
-class CsrtAction {
-
- public static $SimpleP = null;
-
- function __construct(){
- if(self::$SimpleP === null) {
-
- $FeedUrl = DIR_FS_ADMIN . DIR_WS_TEMPLATE.'data/icon_set.xml';
-
- if(!self::$SimpleP = simplexml_load_file($FeedUrl))
- if(!self::$SimpleP = simplexml_load_file('includes/template/defaut/data/icon_set.xml'))
- return false;
- }
- }
-
- /**
- @fn getIcon($code)
- @brief check and return file for icon code
- @param $code unique id icon in data xml
- @return string file name
- */
- public static function getIcon($code){
- $ref=self::$SimpleP->img->icon;
- if(isset($ref->$code)) return (string)$ref->$code;
- }
-
- /**
- @fn getFullPathIcon($code)
- @brief return fullpath icon
- @param $code unique id icon in data xml
- @return string path file name
- */
- public static function getFullPathIcon($code){
- $cdig = self::getIcon($code);
- $file_img='';
-
- // use template admin
- if( file_exists( DIR_WS_TEMPLATE . 'img/' .$_SESSION['login_groups_id'] . '/' . $cdig ) )
- $file_img = DIR_WS_TEMPLATE . 'img/' .$_SESSION['login_groups_id'] . '/' . $cdig ;
- elseif( file_exists( DIR_WS_INCLUDES . 'template/defaut/img/' .$_SESSION['login_groups_id'] . '/' . $cdig ) )
- $file_img = DIR_WS_INCLUDES . 'template/defaut/img/' .$_SESSION['login_groups_id'] . '/' . $cdig;
- elseif( file_exists( DIR_WS_INCLUDES . 'template/defaut/img/1/' . $cdig ) )
- $file_img = DIR_WS_INCLUDES . 'template/defaut/img/1/' . $cdig;
-
- return $file_img;
- }
-
-
- /**
- @fn getFormat($code)
- @brief check and return file for icon code
- @param $code unique id icon in data xml
- @return string file name
- */
- public static function getFormat($code){
- $ref=self::$SimpleP->format;
- if(isset($ref->$code)) return (string)$ref->$code;
- }
-
- /**
- @brief construit le formatage des liens et bouton d'action
- Organise le formatage des format destiné au spintf
- Definis si texte ou image , si image ok
- @param $code string (ex: row_action_right)
- @param type string (button|link)
- @param $txt string texte du bouton
- @param $codeImg string le code de l'image, de l'incone
- @return string for sptrinf
- */
- protected static function getbalise($code,$type,$txt,$codeImg=''){
- new self();
- $ref=self::$SimpleP->gabarit;
- $mode='simple';
- if(isset($ref->$code)){
- $obj = $ref->$code->$type;
-
- if(!empty($codeImg) ) {
-
- $w=( ( (int)$obj->icon[0]['width']>0)? (int)$obj->icon[0]['width'] : '');
- $h=( ( (int)$obj->icon[0]['height']>0)? (int)$obj->icon[0]['height'] : '');
-
- $file_img = self::getFullPathIcon($codeImg);
-
- if(isset($obj->icon[0]['src']) && (bool)$obj->icon[0]['src']){
- $i=image_ratio::get_image($file_img ,$txt , $w,$h);
- $img=$i['src'];
- $mode='complexe';
- }
- else
- $img= tep_image($file_img ,$txt , $w,$h );
- }
- else
- $img =false;
-
- if( $img != false ){
- if($mode==='simple')
- return str_replace('%_TEXT_%' , $img, (string)$obj->icon );
- else
- return str_replace(array('%_TEXT_%','%_SRC_%') , array($txt,$img), (string)$obj->icon );
- }
- else
- return str_replace('%_TEXT_%', $txt, (string)$obj->text );
- }
- }
-
- /**
- @brief Alias getFormat($code,$txt,$codeImg='')
- */
- static public function getLink($code,$txt,$codeImg=''){
- return self::getbalise($code,'link',$txt,$codeImg);
- }
-
- /**
- @brief Alias getFormat($code,$txt,$codeImg='')
- */
- static public function getButton($code,$txt,$codeImg=''){
- return self::getbalise($code,'button',$txt,$codeImg);
- }
-//
- /**
- @brief Alias getFormat($code,$txt,$codeImg='')
- */
- static public function getSubmit($code,$txt,$codeImg=''){
- return self::getbalise($code,'submit',$txt,$codeImg);
- }
-
- /**
- @brief Alias getFormat($code,$codeImg='')
- */
- static public function getImage($code,$codeImg=''){
- return self::getbalise($code,'image','',$codeImg);
- }
-}
?>
\ No newline at end of file
Modified: trunk/catalog/admin/includes/functions/general.php
===================================================================
--- trunk/catalog/admin/includes/functions/general.php 2014-02-10 14:57:38 UTC (rev 5132)
+++ trunk/catalog/admin/includes/functions/general.php 2014-02-10 18:12:15 UTC (rev 5133)
@@ -78,6 +78,8 @@
}
else {
$acl = oscss_acl::getInstance();
+ var_dump($current_page);
+ exit;
if( ! $acl->PageRight($current_page) )
$acl->Block();
}
@@ -88,8 +90,12 @@
@brief test acl groups puis utilisateur pour l'action precisé
*/
function tep_action_check($action, $_page) {
- $acl = oscss_acl::getInstance();
- return (bool)$acl->ActionRight($action,$_page) ;
+ $acl = oscss_acl::getInstance();
+
+ if( ! $acl->PageRight($_page) )
+ tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
+ else
+ return (bool)$acl->ActionRight($action,$_page) ;
}
@@ -118,7 +124,8 @@
@return none
*/
function tep_redirect($url) {
-
+ static $i ;
+
if ( (strstr($url, "\n") != false) || (strstr($url, "\r") != false) ) tep_redirect(tep_href_link(FILENAME_DEFAULT, '', 'NONSSL', false));
if ( (ENABLE_SSL == true) && ( getenv('HTTPS') == 'on') ) { // We are loading an SSL page
@@ -127,8 +134,9 @@
}
}
- if ( ! in_array(getenv('OSCSS_ENVIRONEMENT'), array('autotesting')) || preg_match("#".FILENAME_LOGIN."#i", $url) ){
+ if ( preg_match("#".FILENAME_LOGIN."#i", $url) ){
+
// garbage collector stop
ErrorHandlerActive::stop();
@@ -136,7 +144,10 @@
tep_session_close();
// redirect
- header('Location: ' . $url);
+ if(! in_array(getenv('OSCSS_ENVIRONEMENT'), array('autotesting')) ){
+ header('Location: ' . $url);
+ exit;
+ }
}
else
return ;
@@ -215,6 +226,7 @@
*/
function __($str,$prefix='',$mode=false) {
global $lang;
+ $new_str='';
if(!empty($prefix))
$new_str='@'.$prefix.' '.$str;
Modified: trunk/catalog/admin/includes/gabarit/featureds/edit.tab.childs.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/featureds/edit.tab.childs.gab 2014-02-10 14:57:38 UTC (rev 5132)
+++ trunk/catalog/admin/includes/gabarit/featureds/edit.tab.childs.gab 2014-02-10 18:12:15 UTC (rev 5133)
@@ -10,6 +10,8 @@
@file edit.tab.childs.gab
@dir admin/includes/gabarit/featureds/
*/
+$page= MGabCont::CallSt('GetClassName');
+
?>
<table class="dataTable">
@@ -22,12 +24,12 @@
</tr>
</thead>
<tbody>
- <?php foreach(featureds::$Info->listchilds as $row): ?>
+ <?php foreach($page::$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>
+ <a href="<?php //echo $page::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>
Modified: trunk/catalog/admin/includes/modules/pages/featureds.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/featureds.php 2014-02-10 14:57:38 UTC (rev 5132)
+++ trunk/catalog/admin/includes/modules/pages/featureds.php 2014-02-10 18:12:15 UTC (rev 5133)
@@ -32,8 +32,11 @@
@var string file
*/
public static $Id;
+ /**
+ @var array listchilds current edit
+ */
+ public static $listchilds= array();
-
/**
@brief class constructor
*/
@@ -53,7 +56,7 @@
self::$code=__CLASS__;
self::$datatype = 'featured';
- self::$action=(isset($_REQUEST['action'])? (string)$_REQUEST['action'] : 'listing' );
+ self::$action=( (isset($_REQUEST['action']) && !empty($_REQUEST['action']) )? (string)$_REQUEST['action'] : 'listing' );
self::$Id=(isset($_REQUEST['cID'])? (int)$_REQUEST['cID'] : 0 );
global $oscss,$language,$lang;
@@ -216,7 +219,7 @@
/// @remarks min fields and not view directly colonne fields
- $listfield = 'k_status_type as type , featured_status,';
+ $listfield = 'k_status_type as type , featured_status, ';
/// @remarks Active forms filter
$mutli=array();
@@ -282,7 +285,9 @@
public function check_action($actions){
global $messageStack, $languages_id;
-
+ if(!empty($actions))
+ self::$action=$actions;
+
switch (self::$action) {
/**
@@ -303,7 +308,10 @@
if(!isset($_GET['forceajax']))
tep_redirect(tep_href_link(self::FILENAME, 'cID=' . $_GET['cID']));
break;
+
+
default:
+
parent::GenericAction();
}
@@ -329,27 +337,22 @@
if( (int)self::$Id > 0) {
$result= sqlfeatured::fetch(array('id'=>self::$Id ), true);
-
$res = sqlfeatureddata::fetch(array('featured_id'=>self::$Id), true);
if(is_object($res))
- $result->listchilds = array($res);
- else
- $result->listchilds = $res;
+ self::$listchilds = array($res);
+ elseif(is_array($res))
+ self::$listchilds = $res;
+
}
-
else{
$result = sqlfeatured::Specimen(true);
- $result->listchilds = array();
}
return self::FormatDBValue($result);
break;
-
-
case 'listing':
- default:
/**
@remarks retrun object load one inventaire
*/
@@ -369,6 +372,8 @@
$res=self::FormatDBValue($_query);
return $res;
+ break;
+
}
}
@@ -381,12 +386,13 @@
public function display_view(){
$action = self::$action;
+
switch ($action) {
/**
@remarks Ajax View result
*/
case 'edit':
- $action = parent::GenericDisplay($action);
+ $action = parent::GenericDisplay();
$tab = new TabsListeners(
__('@featureds tab childs') ,
Modified: trunk/catalog/admin/includes/template/defaut/header-1.php
===================================================================
--- trunk/catalog/admin/includes/template/defaut/header-1.php 2014-02-10 14:57:38 UTC (rev 5132)
+++ trunk/catalog/admin/includes/template/defaut/header-1.php 2014-02-10 18:12:15 UTC (rev 5133)
@@ -9,15 +9,13 @@
@encode UTF-8
*/
$class_widget="adminBlock";
-/// force call class notification
-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_ADMINNOTIF, '', 'NONSSL') ?>" class="messages"><?php echo __('notifications') ?> (<?php echo usersNotif::CountNotif() ?>)</a><span> | </span>
+ <a href="<?php echo tep_href_link(FILENAME_ADMINNOTIF, '', '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/install/includes/sql/mysql/tables/osc_extra_fields_to.sql
===================================================================
--- trunk/catalog/install/includes/sql/mysql/tables/osc_extra_fields_to.sql 2014-02-10 14:57:38 UTC (rev 5132)
+++ trunk/catalog/install/includes/sql/mysql/tables/osc_extra_fields_to.sql 2014-02-10 18:12:15 UTC (rev 5133)
@@ -18,7 +18,5 @@
data_id int(11) NOT NULL DEFAULT '0',
data_type varchar(30) NOT NULL,
value text,
- PRIMARY KEY (value_id,fields_id,languages_id),
- KEY IDX_EPF (fields_id,languages_id),
- KEY value_id (value_id)
+ PRIMARY KEY (fields_id,data_id,data_type)
) CHARSET=utf8;
Modified: trunk/catalog/install/includes/sql/mysql/tables/osc_extra_fields_values.sql
===================================================================
--- trunk/catalog/install/includes/sql/mysql/tables/osc_extra_fields_values.sql 2014-02-10 14:57:38 UTC (rev 5132)
+++ trunk/catalog/install/includes/sql/mysql/tables/osc_extra_fields_values.sql 2014-02-10 18:12:15 UTC (rev 5133)
@@ -20,8 +20,9 @@
parent_id int(10) unsigned NOT NULL DEFAULT '0',
sort_order int(11) NOT NULL DEFAULT '0',
fields_value varchar(64) DEFAULT NULL,
- PRIMARY KEY (value_id),
- KEY IDX_EPF (fields_id,languages_id)
+ PRIMARY KEY (value_id,fields_id,languages_id),
+ KEY IDX_EPF (fields_id,languages_id),
+ KEY value_id (value_id)
) DEFAULT CHARSET=utf8 ;
Modified: trunk/test/phpunit/Back/_topDisplay.php
===================================================================
--- trunk/test/phpunit/Back/_topDisplay.php 2014-02-10 14:57:38 UTC (rev 5132)
+++ trunk/test/phpunit/Back/_topDisplay.php 2014-02-10 18:12:15 UTC (rev 5133)
@@ -26,7 +26,8 @@
include_once(DIR_FS_CATALOG . DIR_WS_COMMON_CLASSES .'formUtility.php');
include_once(DIR_FS_CATALOG . DIR_WS_COMMON_CLASSES .'FieldsDisplay.php');
-require(DIR_WS_TEMPLATE.'inc/lib.template.php');
- if (($init_theme=tep_test_gab_ele('inc/preload')) !=false) require($init_theme);
+if (($init_theme=tep_test_gab_ele('inc/lib.template')) !=false) require($init_theme);
+if (($init_theme=tep_test_gab_ele('inc/preload')) !=false) require($init_theme);
+
?>
\ No newline at end of file
Modified: trunk/test/phpunit/Back/sqlxxx/sqladmingroupsTest.php
===================================================================
--- trunk/test/phpunit/Back/sqlxxx/sqladmingroupsTest.php 2014-02-10 14:57:38 UTC (rev 5132)
+++ trunk/test/phpunit/Back/sqlxxx/sqladmingroupsTest.php 2014-02-10 18:12:15 UTC (rev 5133)
@@ -31,22 +31,18 @@
public function testadmingroupsSpecimen(){
$specimen = array();
- $tmp = sqladmingroups::Specimen(true);
+ $specimen = sqladmingroups::Specimen();
- $this->assertTrue ( ( is_object($tmp) ) , 'Error admingroups Sepcimen return object' ) ;
-
-
- foreach($tmp as $key=>$val)
- $specimen[$key] = $val;
-
-
$this->assertTrue ( ( is_array($specimen) ) , 'Error admingroups Sepcimen convert' ) ;
// fix for suite test
- $specimen['name'] = 'XXX';
+ $specimen['admin_groups_name'] = 'XXX';
- return $specimen;
+ return array(
+ 'sqlarray'=>$specimen,
+ 'post'=>$specimen,
+ );
}
/**
@@ -56,7 +52,7 @@
public function testadmingroupsCreat( $specimen ){
- $res=sqladmingroups::fetch( array('name'=>$specimen['name']) , true);
+ $res=sqladmingroups::fetch( array('name'=>$specimen['sqlarray']['admin_groups_name']) , true);
if( is_object($res) ) {
$this -> assertTrue ( true , 'admingroups exists, action purge' ) ;
@@ -65,17 +61,14 @@
$this -> assertTrue ( ($check ==true ) , 'admingroups delete for prev test' ) ;
}
-
$id = sqladmingroups::create($specimen);
$this -> assertTrue ( ((int)$id >0) , 'Error admingroups not create' ) ;
- return array(
- 'id'=>$id,
- 'sqlarray'=>$specimen,
-// 'post'=>$specimen,
- );
+ $specimen['id'] = $id;
+
+ return $specimen;
}
@@ -88,10 +81,11 @@
$res=sqladmingroups::fetch( array('id'=>$specimen['id']) , true);
$this -> assertTrue ( (is_object($res) ) , 'admingroups not exists, or fetch error load ' ) ;
+ $specimen['sqlarray']['admin_groups_status'] = 1;
$res = sqladmingroups::update($specimen);
- $this -> assertTrue ( ($res == 1) , 'Error admingroups not update' ) ;
+ $this->assertTrue ( $res > 0 , 'Error admingroups not update' ) ;
return $specimen;
}
Modified: trunk/test/phpunit/Back/sqlxxx/sqladminuserTest.php
===================================================================
--- trunk/test/phpunit/Back/sqlxxx/sqladminuserTest.php 2014-02-10 14:57:38 UTC (rev 5132)
+++ trunk/test/phpunit/Back/sqlxxx/sqladminuserTest.php 2014-02-10 18:12:15 UTC (rev 5133)
@@ -19,62 +19,74 @@
class sqladminuserTest
extends PHPUnit_Framework_TestCase
{
- /**
- @var array
- */
- public $specimen;
- /**
- @var int
- */
- static public $Id;
+
function __construct()
{
- $this->specimen = sqladminuser::Specimen( );
}
+ /**
+ * \brief test creat account use...
[truncated message content] |
|
From: <os...@us...> - 2014-02-10 14:57:44
|
Revision: 5132
http://sourceforge.net/p/oscss/svn/5132
Author: oscim
Date: 2014-02-10 14:57:38 +0000 (Mon, 10 Feb 2014)
Log Message:
-----------
Fix
Next clean
Next dev
Implement new process modules in shipping , customers
Rename shipping modules pages in shippings for normalized name
Amelriored Support page modTree and ModTreePage
Clean .gab file
Implement Use EventHandler in shipping and order(partial)
ADjust file langue
Fix error in pdf harry model
Modified Paths:
--------------
trunk/catalog/Documents/modeles/pdf/harry/publicCustomers/delivery.php
trunk/catalog/Documents/modeles/pdf/harry/publicCustomers/invoice.php
trunk/catalog/Documents/modeles/pdf/harry/publicCustomers/packingslip.php
trunk/catalog/admin/includes/boxes/10_orders.php
trunk/catalog/admin/includes/classes/EventsHandlerActive.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/drivers/sqlextrafieldsto.php
trunk/catalog/admin/includes/classes/oscss_cstr.php
trunk/catalog/admin/includes/content/aca.top.inc
trunk/catalog/admin/includes/gabarit/orders/display_view.edit.gab
trunk/catalog/admin/includes/gabarit/shippings/display_view.edit.gab
trunk/catalog/admin/includes/gabarit/shippings/display_view.multi-action.gab
trunk/catalog/admin/includes/gabarit/shippings/display_view.multi.gab
trunk/catalog/admin/includes/modules/account/account_extra.php
trunk/catalog/admin/includes/modules/account/address_book.php
trunk/catalog/admin/includes/modules/account/history.php
trunk/catalog/admin/includes/modules/pages/customers.php
trunk/catalog/admin/includes/modules/pages/mail.php
trunk/catalog/admin/includes/modules/pages/orders.php
trunk/catalog/admin/includes/modules/pages/products.php
trunk/catalog/admin/includes/modules/pages/rapport.php
trunk/catalog/admin/includes/template/defaut/inc/lib.template.php
trunk/catalog/admin/includes/template/oscss/data/icon_set.xml
trunk/catalog/admin/includes/template/oscss/gabarit-1.php
trunk/catalog/common/classes/DatasFiles.php
trunk/catalog/install/includes/sql/mysql/tables/osc_extra_fields_to.sql
Added Paths:
-----------
trunk/catalog/admin/includes/gabarit/shippings/
trunk/catalog/admin/includes/gabarit/shippings/edit.tab.generic.gab
trunk/catalog/admin/includes/gabarit/shippings/edit.tab.suivi.gab
trunk/catalog/admin/includes/languages/fr_FR/Shipping.txt
trunk/catalog/admin/includes/modules/pages/shippings.php
trunk/catalog/admin/includes/template/oscss/img/1/link_pdf.jpg
Removed Paths:
-------------
trunk/catalog/admin/includes/gabarit/shipping/
trunk/catalog/admin/includes/languages/fr_FR/modules/pages/shipping.txt
trunk/catalog/admin/includes/modules/pages/shipping.php
trunk/catalog/admin/includes/template/oscss/header-1.php
trunk/catalog/admin/includes/template/oscss/inc/init_theme-1.php
trunk/catalog/admin/includes/template/oscss/inc/lib.template.php
trunk/catalog/admin/includes/template/oscss/inc/preload-1.php
Modified: trunk/catalog/Documents/modeles/pdf/harry/publicCustomers/delivery.php
===================================================================
--- trunk/catalog/Documents/modeles/pdf/harry/publicCustomers/delivery.php 2014-02-10 07:06:12 UTC (rev 5131)
+++ trunk/catalog/Documents/modeles/pdf/harry/publicCustomers/delivery.php 2014-02-10 14:57:38 UTC (rev 5132)
@@ -1,14 +1,16 @@
<?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 01/03/2012, 10:55
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
@brief A4 page pdf
@subpackage modele harry
+ @file delivery.php
+ @dir Documents/modeles/pdf/harry/publicCustomers/
*/
Modified: trunk/catalog/Documents/modeles/pdf/harry/publicCustomers/invoice.php
===================================================================
--- trunk/catalog/Documents/modeles/pdf/harry/publicCustomers/invoice.php 2014-02-10 07:06:12 UTC (rev 5131)
+++ trunk/catalog/Documents/modeles/pdf/harry/publicCustomers/invoice.php 2014-02-10 14:57:38 UTC (rev 5132)
@@ -1,14 +1,16 @@
<?php
/**
- @licence GPL $pdf->page_width 5-2012 The osCSS developers - osCSS Open Source E-commerce
- @portion code Copyright (c) $pdf->page_width 2 osCommerce
+ @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 01/03/2012, 10:55
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
@brief A4 page Invoice pdf
@subpackage modele harry
+ @file invoice.php
+ @dir Documents/modeles/pdf/harry/publicCustomers/
*/
Modified: trunk/catalog/Documents/modeles/pdf/harry/publicCustomers/packingslip.php
===================================================================
--- trunk/catalog/Documents/modeles/pdf/harry/publicCustomers/packingslip.php 2014-02-10 07:06:12 UTC (rev 5131)
+++ trunk/catalog/Documents/modeles/pdf/harry/publicCustomers/packingslip.php 2014-02-10 14:57:38 UTC (rev 5132)
@@ -1,14 +1,15 @@
<?php
/**
- @licence GPL $pdf->page_width 5-2012 The osCSS developers - osCSS Open Source E-commerce
- @portion code Copyright (c) $pdf->page_width 2 osCommerce
+ @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 01/03/2012, 10:55
+ @version 2.2.0
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
@brief A4 page Invoice pdf
@subpackage modele harry
+ @file packingslip.php
+ @dir Documents/modeles/pdf/harry/publicCustomers/
*/
@@ -20,7 +21,7 @@
*/
$le_Y=$pdf->block_marge;
- $hauteur_block = $pdf->DrawTypeAndRef($le_Y , tep_correct_entitie_put_pdf(__('iv print doc type invoice') ) , $order->info['facture_ref']);
+ $hauteur_block = $pdf->DrawTypeAndRef($le_Y , tep_correct_entitie_put_pdf(__('ps print doc type packingslip') ) , $order->info['orders_ref']);
/// add other info
Modified: trunk/catalog/admin/includes/boxes/10_orders.php
===================================================================
--- trunk/catalog/admin/includes/boxes/10_orders.php 2014-02-10 07:06:12 UTC (rev 5131)
+++ trunk/catalog/admin/includes/boxes/10_orders.php 2014-02-10 14:57:38 UTC (rev 5132)
@@ -28,12 +28,12 @@
$tabl_link[] = array(
'ss_menu',
'BOX_CUSTOMERS_SHIPPING',
- 'shipping',
- @$img['shipping'],
+ 'shippings',
+ @$img['shippings'],
4=> array(
- array('shipping.php?view=opened', 'BOX_CUSTOMERS_SHIPPING_OPENNED', 'orders',@$img['orders']),
- array('shipping.php?view=progress', 'BOX_CUSTOMERS_SHIPPING_PROGRESS', 'orders',@$img['orders']),
- array('shipping.php?view=closed', 'BOX_CUSTOMERS_SHIPPING_CLOSE', 'orders',@$img['orders']),
+ array('shippings.php?view=opened', 'BOX_CUSTOMERS_SHIPPING_OPENNED', 'shippings',@$img['shippings']),
+ array('shippings.php?view=progress', 'BOX_CUSTOMERS_SHIPPING_PROGRESS', 'shippings',@$img['shippings']),
+ array('shippings.php?view=closed', 'BOX_CUSTOMERS_SHIPPING_CLOSE', 'shippings',@$img['shippings']),
)
);
Modified: trunk/catalog/admin/includes/classes/EventsHandlerActive.php
===================================================================
--- trunk/catalog/admin/includes/classes/EventsHandlerActive.php 2014-02-10 07:06:12 UTC (rev 5131)
+++ trunk/catalog/admin/includes/classes/EventsHandlerActive.php 2014-02-10 14:57:38 UTC (rev 5132)
@@ -125,11 +125,10 @@
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' );
+ include_once(DIR_FS_CATALOG. DIR_WS_CLASSES . 'listeners/'.$sub.'Listener.php' );
if(class_exists($sub)) {
array_push(self::$Triggers, $sub);
@@ -141,13 +140,14 @@
// 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' );
-
+ include_once(DIR_FS_CATALOG. DIR_WS_CLASSES . 'listeners/'.$sub.'Listener.php' );
+
if(class_exists($sub))
$obj->$sub->attach( new $sub() );
}
}
+
return $obj;
}
@@ -158,7 +158,7 @@
$class = get_class($objEventListener);
// delete Listener at end of string
$sub = substr($class, 0, -8);
-
+
$obj->$sub->notify($objEventListener);
}
Modified: trunk/catalog/admin/includes/classes/ModTree.php
===================================================================
--- trunk/catalog/admin/includes/classes/ModTree.php 2014-02-10 07:06:12 UTC (rev 5131)
+++ trunk/catalog/admin/includes/classes/ModTree.php 2014-02-10 14:57:38 UTC (rev 5132)
@@ -107,10 +107,7 @@
Implements IntModTree
{
- /**
- @var current class string name
- */
- public static $code ='';
+
/**
@var current datatype used (string)
*/
Modified: trunk/catalog/admin/includes/classes/ModTreePage.php
===================================================================
--- trunk/catalog/admin/includes/classes/ModTreePage.php 2014-02-10 07:06:12 UTC (rev 5131)
+++ trunk/catalog/admin/includes/classes/ModTreePage.php 2014-02-10 14:57:38 UTC (rev 5132)
@@ -58,6 +58,19 @@
return MGabCont::CallGab($action,__FUNCTION__,$class::MASTER);
}
+
+ /**
+ @fn PutMessage( EventListener $Message )
+ @param $Message object
+ @return none
+ */
+ public static function PutMessage( EventListener $Message ){
+ EventsHandlerActive::Process(
+ $Message
+ );
+ }
+
+
/**
@fn GenericAction()
@brief generic action call and process for normlaized action in subchilds module
@@ -80,6 +93,10 @@
}
+ if( $class::$modules !=false)
+ $class::$modules->check_action($class::$action);
+
+
switch(self::$action){
/**
@remarks specific save in session value filters
@@ -107,8 +124,8 @@
if( $sqlclass::update( $params ) != 1 )
throw new Exception(__(' error in update process', $class)) ;
- if(in_array('EventMessListener', $list_interface))
- EventsHandlerActive::Process(
+ if(in_array('EventMessInterface', $list_interface))
+ self::PutMessage(
new EventMessListener( __('success in update process', $class) , 'success')
);
@@ -124,8 +141,8 @@
echo $_REQUEST['value'];
}
catch (Exception $e) {
- if(in_array('EventMessListener', $list_interface))
- EventsHandlerActive::Process(
+ if(in_array('EventMessInterface', $list_interface))
+ self::PutMessage(
new EventMessListener(__($e->getMessage(), $class) , 'error')
);
}
@@ -144,16 +161,16 @@
if( !$sqlclass::delete(array('id'=>$class::$Id)) )
throw new Exception( sprintf(__('error delete id %s', $class), $class::$Id ) ) ;
- if(in_array('EventMessListener', $list_interface))
- EventsHandlerActive::Process(
+ if(in_array('EventMessInterface', $list_interface))
+ self::PutMessage(
new EventMessListener( sprintf(__('delete id %s success', $class), $class::$Id ) , 'success')
);
}
catch (Exception $e) {
- if(in_array('EventMessListener', $list_interface))
- EventsHandlerActive::Process(
+ if(in_array('EventMessInterface', $list_interface))
+ self::PutMessage(
new EventMessListener(__($e->getMessage(), $class) , 'error')
);
}
@@ -190,8 +207,8 @@
if( is_int($class::$Id) && $class::$Id <=0)
throw new Exception(__('error in update process', $class) ) ;
- if(in_array('EventMessListener', $list_interface))
- EventsHandlerActive::Process(
+ if(in_array('EventMessInterface', $list_interface))
+ self::PutMessage(
new EventMessListener(__('success in create process', $class) , 'success')
);
@@ -207,8 +224,8 @@
tep_redirect(tep_href_link($class::FILENAME, 'cID=' . $class::$Id.'&action=edit'));
}
catch (Exception $e) {
- if(in_array('EventMessListener', $list_interface))
- EventsHandlerActive::Process(
+ if(in_array('EventMessInterface', $list_interface))
+ self::PutMessage(
new EventMessListener(__($e->getMessage(), $class) , 'error')
);
@@ -219,7 +236,6 @@
case 'update':
-error_reporting(E_ALL);
try {
if( $class::$Id <=0 )
@@ -238,8 +254,8 @@
if( is_int($res) && $res <=0)
throw new Exception(__('error in update process', $class) ) ;
- if(in_array('EventMessListener', $list_interface))
- EventsHandlerActive::Process(
+ if(in_array('EventMessInterface', $list_interface))
+ self::PutMessage(
new EventMessListener(__('success in update process', $class) , 'success')
);
@@ -264,8 +280,8 @@
exit;
}
catch (Exception $e) {
- if(in_array('EventMessListener', $list_interface))
- EventsHandlerActive::Process(
+ if(in_array('EventMessInterface', $list_interface))
+ self::PutMessage(
new EventMessListener(__($e->getMessage(), $class) , 'error')
);
@@ -295,8 +311,20 @@
if(count($res)<=1)
tep_redirect(tep_href_link($class::FILENAME, 'action=insert'));
+
+
case 'edit':
-
+ if($class::$Id > 0)
+ if(!$sqlclass::fetch(array('id'=>(int)$class::$Id), true) ) {
+ self::PutMessage(
+ new EventMessListener(__('error ressource id no found', $class) )
+ );
+ tep_redirect(tep_href_link(self::FILENAME));
+ }
+
+ if(!is_object($class::$Info))
+ $class::$Info = $class::GetDBValue();
+
global $oscss;
foreach($class::$InitInfo['edit']['listing'] as $key=>$row ){
@@ -312,9 +340,36 @@
echo $oscss->_call(BO_WISIWYG_SELECTED,'_top',$row['input_name'].'[' . $class::$languages[$i]['id'] . ']','600','400');
}
}
+
break;
-
-
+
+ case 'copy_to':
+ if($class::$Id > 0)
+ if(!$sqlclass::fetch(array('id'=>(int)$class::$Id), true) ) {
+ self::PutMessage(
+ new EventMessListener(__('error ressource id no found', $class) )
+ );
+ tep_redirect(tep_href_link(self::FILENAME));
+ }
+ break;
+
+ /**
+ @remarks pdf generate
+ */
+ case 'deletefile':
+ $ID=(int)$_REQUEST['id'];
+ $type=$_REQUEST['file_type'] ;
+
+ $datadocs=new DatasFiles;
+
+ if(( $filepath=$datadocs->GetDoc($type, $ID)) && file_exists($filepath))
+ unlink($filepath);
+
+ if(!isset($_GET['forceajax']))
+ tep_redirect(tep_href_link($class::FILENAME, 'cID='.$ID.'&action=edit'));
+ break;
+
+
default:
// trigger event
@@ -351,15 +406,10 @@
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;
@@ -375,10 +425,6 @@
$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(
@@ -412,15 +458,10 @@
);
$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:
}
@@ -655,7 +696,7 @@
elseif($key == 'image')
return (!empty($data['image']) ? tep_info_image($data['image'], $data['name'], TEMP_BO_SMALL_IMAGE_WIDTH, TEMP_BO_SMALL_IMAGE_HEIGHT) : ' N/A');
// Format Date
- elseif(in_array($key,array('added', 'modified','available','last_logon') ) )
+ elseif(in_array($key,array('added', 'modified','available','last_logon', 'last_modified') ) )
return ((isset($data[$key]) && $data[$key] !='1000-01-01 00:00:00' )? tep_date_short($data[$key]) : '' );
/// DEB Sub module add col
elseif( isset(self::$CurrentExternal[$key]) ){
Modified: trunk/catalog/admin/includes/classes/ModTwo.php
===================================================================
--- trunk/catalog/admin/includes/classes/ModTwo.php 2014-02-10 07:06:12 UTC (rev 5131)
+++ trunk/catalog/admin/includes/classes/ModTwo.php 2014-02-10 14:57:38 UTC (rev 5132)
@@ -64,8 +64,11 @@
*/
const MASTER = 'MGabCont';
-
- /**
+ /**
+ @var current class string name
+ */
+ public static $code ='';
+ /**
@var current action by GET var
*/
public static $action = '';
Modified: trunk/catalog/admin/includes/classes/drivers/sqlextrafieldsto.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlextrafieldsto.php 2014-02-10 07:06:12 UTC (rev 5131)
+++ trunk/catalog/admin/includes/classes/drivers/sqlextrafieldsto.php 2014-02-10 14:57:38 UTC (rev 5132)
@@ -175,7 +175,29 @@
*/
public static function FormatToDataId($id,$languages_id, $edit, $proprio=''){
// ne liste que les champs qui n'appartiennent pas a un modules precis
- $extra_fields_query = tep_db_query("select ce.fields_id, ce.fields_input_type,ce.fields_size, ce.fields_input_value, ce.fields_required_status, cei.fields_name,cei.fields_format as format, ce.fields_status, ce.fields_input_type from " . TABLE_EXTRA_FIELDS . " ce, " . TABLE_EXTRA_FIELDS_LABELS . " cei WHERE ce.fields_type='".self::$data."' AND ce.fields_status=1 and cei.fields_id=ce.fields_id and cei.languages_id =" . $languages_id." and fields_special_mod='".$proprio."' order by ce.fields_group_class");
+ $sql="SELECT
+ ce.fields_id,
+ ce.fields_input_type,
+ ce.fields_size,
+ ce.fields_input_value,
+ ce.fields_required_status,
+ cei.fields_name,
+ cei.fields_format as format,
+ ce.fields_status,
+ ce.fields_input_type,
+ ce.fields_active_value_language as active_value_language ,
+ ce.fields_value_list as value_list
+ FROM " . TABLE_EXTRA_FIELDS . " ce,
+ " . TABLE_EXTRA_FIELDS_LABELS . " cei
+ WHERE
+ ce.fields_type='".self::$data."'
+ AND ce.fields_status=1
+ AND cei.fields_id=ce.fields_id
+ AND cei.languages_id =" . $languages_id."
+ AND fields_special_mod='".$proprio."'
+ ORDER BY ce.fields_group_class";
+
+ $extra_fields_query = tep_db_query($sql);
$extra_fields_string = '';
if(tep_db_num_rows($extra_fields_query)>0){
@@ -208,15 +230,26 @@
$robj->input_format = $extra_fields['format'];
$robj->required_status = $extra_fields['fields_required_status'];
- $robj->active_value_language = 0;
+ $robj->active_value_language = $extra_fields['active_value_language'];
$robj->values_list = explode("\n", $extra_fields['fields_input_value']);
+
$robj->select_values = array();
- foreach($robj->values_list as $item)
- {
- $item = trim($item);
- $robj->select_values[] = array('id' => $item, 'text' => $item);
+ if( $extra_fields['value_list'] ==1 && in_array($extra_fields['fields_input_type'] , array(3,4,6,7))){
+ $list = sqlextrafieldsvalues::fetch(array('fields_id'=>$extra_fields['fields_id'], 'languages_id'=> ( ($robj->active_value_language)? $languages_id : 0 ) ), true);
+ if(is_array($list))
+ foreach($list as $item)
+ {
+ $robj->select_values[] = array('id' => $item->value_id, 'text' => $item->fields_value);
+ }
+
}
+ else
+ foreach($robj->values_list as $item)
+ {
+ $item = trim($item);
+ $robj->select_values[] = array('id' => $item, 'text' => $item);
+ }
$label = ExtraUtility::FormatLabels($robj, $edit);
$input = ExtraUtility::FormatFields($robj, $edit,''/* self::$data*/);
Modified: trunk/catalog/admin/includes/classes/oscss_cstr.php
===================================================================
--- trunk/catalog/admin/includes/classes/oscss_cstr.php 2014-02-10 07:06:12 UTC (rev 5131)
+++ trunk/catalog/admin/includes/classes/oscss_cstr.php 2014-02-10 14:57:38 UTC (rev 5132)
@@ -290,6 +290,12 @@
return DIR_WS_TEMPLATE.$element.'-1.'.$ext;
elseif (self::TestFile(DIR_WS_TEMPLATE.$element.'.'.$ext) )
return DIR_WS_TEMPLATE.$element.'.'.$ext;
+ elseif (self::TestFile(DIR_WS_INCLUDES.'template/'.DEFAULT_TEMPLATE_NAME.'/'.$element.'-'.$_SESSION['login_groups_id'].'.'.$ext) )
+ return DIR_WS_INCLUDES.'template/'.DEFAULT_TEMPLATE_NAME.'/'.$element.'-'.$_SESSION['login_groups_id'].'.'.$ext;
+ elseif (self::TestFile(DIR_WS_INCLUDES.'template/'.DEFAULT_TEMPLATE_NAME.'/'.$element.'-'.$_SESSION['login_id'].'.'.$ext) )
+ return DIR_WS_INCLUDES.'template/'.DEFAULT_TEMPLATE_NAME.'/'.$element.'-'.$_SESSION['login_id'].'.'.$ext;
+ elseif (self::TestFile(DIR_WS_INCLUDES.'template/'.DEFAULT_TEMPLATE_NAME.'/'.$element.'-1.'.$ext) )
+ return DIR_WS_INCLUDES.'template/'.DEFAULT_TEMPLATE_NAME.'/'.$element.'-1.'.$ext;
elseif (self::TestFile(DIR_WS_INCLUDES.'template/'.DEFAULT_TEMPLATE_NAME.'/'.$element.'.'.$ext) )
return DIR_WS_INCLUDES.'template/'.DEFAULT_TEMPLATE_NAME.'/'.$element.'.'.$ext;
else
Modified: trunk/catalog/admin/includes/content/aca.top.inc
===================================================================
--- trunk/catalog/admin/includes/content/aca.top.inc 2014-02-10 07:06:12 UTC (rev 5131)
+++ trunk/catalog/admin/includes/content/aca.top.inc 2014-02-10 14:57:38 UTC (rev 5132)
@@ -16,7 +16,8 @@
*/
/* */
$ID=false;
- if(isset($_GET['pID']))$ID=(int)tep_sanitize_string($_GET['pID']);
+ if(isset($_GET['cID']))
+ $ID=(int)tep_sanitize_string($_GET['cID']);
// action_class=SvnUpdate&action_method=draw_form
$actions['action'] = $action;
@@ -84,7 +85,7 @@
/**
A module has asked to privately take care of this action, check if class and method exist and run it.
*/
- if ($post_exe && (isset($aca_modules->modules[$actions['action_class']])) && ($box=$aca_modules->modules[$actions['action_class']]->check_action($actions)) !=false)
+ if ($post_exe && (isset($aca_modules->modules[$actions['action_class']])) && ($box=$aca_modules->modules[$actions['action_class']]->check_action($action)) !=false)
if (!empty($actions['action_method']) && method_exists($aca_modules->modules[$actions['action_class']],$actions['action_method'] )){
$box = array();
$box=$aca_modules->modules[$actions['action_class']]->$actions['action_method']($box,(int)$ID);
Modified: trunk/catalog/admin/includes/gabarit/orders/display_view.edit.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/orders/display_view.edit.gab 2014-02-10 07:06:12 UTC (rev 5131)
+++ trunk/catalog/admin/includes/gabarit/orders/display_view.edit.gab 2014-02-10 14:57:38 UTC (rev 5132)
@@ -27,16 +27,16 @@
</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>
- </div>
- <?php endforeach; ?>
- <div class="separator"></div>
-</div>
+ <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>
+ </div>
+ <?php endforeach; ?>
+ <div class="separator"></div>
+ </div>
@@ -81,17 +81,17 @@
<th></th>
</tr>
- <?php if(( $filepath=$datadocs->GetDoc('packingslip', $_GET['oID'])) && file_exists($filepath)): ?>
+ <?php if(( $filepath=$datadocs->GetDoc('packingslip', orders::$Id)) && file_exists($filepath)): ?>
<tr>
- <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><a href="<?php echo tep_href_link('document.php', 'mod=packingslip&id='.orders::$Id) ?>"><?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>
+ <td><?php echo sprintf(CsrtAction::getLink('row_action_right', IMAGE_DELETE, 'trash'), '', tep_href_link(orders::FILENAME, 'file_type=packingslip&action=deletefile&id='.orders::$Id.'&cID='.orders::$Id) ,'' ) ; ?></td>
</tr>
<?php elseif(_cst_bool('USE_LOCAL_GENERAT_PDF')): ?>
<tr>
<td colspan="3"> </td>
- <td><?php echo '<a class="button" href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('page_admin','action')).'action=pdf&forceview=pdf&file_type=packingslip&id='.$_GET['oID']) . '" >' . __('pdf generate') . '</a>' ; ?> </td>
+ <td><?php echo '<a class="button" href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('page_admin','action')).'action=pdf&forceview=pdf&file_type=packingslip&id='. orders::$Id) . '" >' . __('pdf generate') . '</a>' ; ?> </td>
</tr>
<?php endif; ?>
@@ -108,7 +108,7 @@
<td><a href="<?php echo tep_href_link('document.php', 'mod=delivery&id='.$ashipping->row_id) ?>"><?php echo $ashipping->shipping_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=delivery&action=deletefile&id='.$ashipping->row_id.'&oID='.$_GET['oID']) ,'' ) ; ?></td>
+ <td><?php echo sprintf(CsrtAction::getLink('row_action_right', IMAGE_DELETE, 'trash'), '', tep_href_link(orders::FILENAME, 'file_type=delivery&action=deletefile&id='.$ashipping->row_id.'&cID='.orders::$Id) ,'' ) ; ?></td>
</tr>
<?php elseif(_cst_bool('USE_LOCAL_GENERAT_PDF')): ?>
<tr>
@@ -125,17 +125,17 @@
<th> </th>
</tr>
- <?php if(( $filepath=$datadocs->GetDoc('invoices', $_GET['oID'])) && file_exists($filepath)): ?>
+ <?php if(( $filepath=$datadocs->GetDoc('invoices', orders::$Id)) && file_exists($filepath)): ?>
<tr>
- <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><a href="<?php echo tep_href_link('document.php', 'mod=invoice&id='.orders::$Id) ?>"><?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>
+ <td><?php echo sprintf(CsrtAction::getLink('row_action_right', IMAGE_DELETE, 'trash'), '', tep_href_link(orders::FILENAME, 'file_type=invoice&action=deletefile&id='.orders::$Id.'&cID='.orders::$Id) ,'' ) ; ?></td>
</tr>
<?php elseif(_cst_bool('USE_LOCAL_GENERAT_PDF')): ?>
<tr>
<td colspan="3"> </td>
- <td><?php echo '<a class="button" href="' . tep_href_link(orders::FILENAME , tep_get_all_get_params(array('page_admin','action','forceview')).'action=pdf&forceview=pdf&file_type=invoice&id='.$_GET['oID']) . '">' . __('pdf generate') . '</a>' ; ?></td>
+ <td><?php echo '<a class="button" href="' . tep_href_link(orders::FILENAME , tep_get_all_get_params(array('page_admin','action','forceview')).'action=pdf&forceview=pdf&file_type=invoice&id='.orders::$Id) . '">' . __('pdf generate') . '</a>' ; ?></td>
</tr>
<?php endif; ?>
Modified: trunk/catalog/admin/includes/gabarit/shippings/display_view.edit.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/shipping/display_view.edit.gab 2014-02-06 21:02:52 UTC (rev 5128)
+++ trunk/catalog/admin/includes/gabarit/shippings/display_view.edit.gab 2014-02-10 14:57:38 UTC (rev 5132)
@@ -1,137 +1,51 @@
<?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 04/03/2012, 11:35
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
+ @file display_view.edit.gab
+ @dir admin/includes/gabarit/shippings/
*/
global $price;
-
+$page= MGabCont::CallSt('GetClassName');
?>
-<h3><?php echo sprintf(__('@shipping heading edit num %s ref %s'),shipping::$Info->row_id , shipping::$Info->shipping_ref ) ; ?></h3>
+<h3><?php echo sprintf(__('@shipping heading edit num %s ref %s'),$page::$Info->row_id , $page::$Info->shipping_ref ) ; ?></h3>
<div class="box_uniq block_form main-shipping">
- <div id="tabs">
- <ul>
- <li><a href="#tabs-1"><?php echo __('tab shipping briefs'); ?></a></li>
- <li><a href="#tabs-2"><?php echo __('tab shipping details'); ?></a></li>
- </ul>
- <div id="tabs-1" class="tabPage">
- <br />
- <br />
-
- <ul class="fleft w_50 main-shipping block">
- <li style="font-size:13px;">
- <span class="label" style="font-weight:bold;"><?php echo __('shipping date expedition'); ?></span>
- <span class="value"><?php echo tep_date_short(shipping::$Info->date_expedition); ?></span>
- </li>
- <li style="font-size:13px;">
- <span class="label" style="font-weight:bold;"><?php echo __('shipping status'); ?></span>
- <span class="value"><?php echo shipping::$shipping_status_array[shipping::$Info->status]; ?></span>
- </li>
-
-
- </ul>
-
- <ul class="fleft w_50 main-shipping block">
- <li style="font-size:13px;">
- <span class="label" style="font-weight:bold;"><?php echo __('shipping method'); ?></span>
- <span class="value"><?php echo shipping::$Info->method; ?></span>
- </li>
-
- <li style="font-size:13px;">
- <span class="label" style="font-weight:bold;"><?php echo __('shipping tracking url'); ?></span>
- <span class="value"><a href="<?php echo shipping::$Info->tracking_url; ?>"><?php echo shipping::$Info->tracking; ?></a></span>
- </li>
- </ul>
-
- <br />
- <br />
- <br />
-
-
- <table class="dataTableBase shipping allshipping">
- <thead>
- <tr>
- <th><?php echo __('@shipping table heading id'); ?></th>
- <th><?php echo __('@shipping table heading products'); ?></th>
- <th><?php echo __('@shipping table heading qt expedie'); ?></th>
- <th><?php echo __('@shipping table heading methode'); ?></th>
- </tr>
- </thead>
- <tbody>
- <?php $i = 0; foreach(shipping::$Info->products as $item): $i++; ?>
- <tr>
- <td class="tcenter">
- <?php echo $item->shipping_id; ?>
- </td>
- <td class="tcenter">
- <a href="<?php echo tep_href_link(FILENAME_PRODUCTS,'action=edit&pID='.$item->products_id); ?>"><?php echo $item->products_name; ?></a>
- </td>
- <td class="tcenter">
- <?php echo $item->qt_expedie; ?>
- </td>
-
- <td class="tcenter">
- </td>
- </tr>
+ <div id="tabs">
+ <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>
+ </div>
<?php endforeach; ?>
- </tbody>
-
- </table>
-
-
+ <div class="separator"></div>
</div>
- <div id="tabs-2" class="tabPage">
- <div class="block_form">
- <?php echo tep_draw_form('shipping', shipping::FILENAME, tep_get_all_get_params(array('oID', 'action','forceajax','forceview')) .'action=update'); ?>
- <fieldset class="block_field">
- <p>
- <?php echo tep_draw_hidden_field('oID', '', shipping::$oID ); ?>
- </p>
- <p class="block_input">
- <label for="status"><?php echo __('@shipping entry status'); ?></label>
- <?php echo tep_draw_pull_down_menu('status', tep_get_status_array('shipping'), ''); ?>
- </p>
-
- <?php if(isset($_POST['notify']) && $_POST['notify']=='on'): ?>
- <div class="block_input">
- <label for="notify"><?php echo __('text info multi notify'); ?></label>
- <?php echo tep_draw_textarea_field('comments', '', '30', '5', '','style="width:100%"'); ?>
- </div>
- <?php endif; ?>
-
- <div class="button_nav">
- <?php echo tep_image_submit('button_delete.gif', __('image modify multi'), ' onclick="$.fancybox.close();" ') ;?>
- <?php echo tep_js_back(tep_href_link(shipping::FILENAME), IMAGE_CANCEL);?>
- </div>
- </fieldset>
- </form>
- </div>
- </div>
-
- </div>
-
-
-
-
-
-
<div class="main-shipping block fleft w_50 padd_w">
<h4><?php echo __('@shipping heading delvery address') ?></h4>
<p>
- <?php echo tep_address_format(shipping::$order->delivery['format_id'], shipping::$order->delivery, 1, '', '<br />'); ?>
+ <?php echo tep_address_format($page::$order->delivery['format_id'], $page::$order->delivery, 1, '', '<br />'); ?>
<br class="clear" />
</p>
</div>
@@ -162,10 +76,10 @@
<?php if(( $filepath=$datadocs->GetDoc('delivery', $_GET['oID'])) && file_exists($filepath)): ?>
<tr>
- <td><a href="<?php echo tep_href_link('document.php', 'mod=delivery&id='.$_GET['oID']) ?>"><?php echo shipping::$Info->shipping_ref ?></a></td>
+ <td><a href="<?php echo tep_href_link('document.php', 'mod=delivery&id='.$_GET['oID']) ?>"><?php echo $page::$Info->shipping_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(shipping::FILENAME, 'file_type=delivery&action=deletefile&id='.$_GET['oID'].'&oID='.shipping::$Info->orders_id) ,'' ) ; ?></td>
+ <td><?php echo sprintf(CsrtAction::getLink('row_action_right', IMAGE_DELETE, 'trash'), '', tep_href_link($page::FILENAME, 'file_type=delivery&action=deletefile&id='.$_GET['oID'].'&oID='.$page::$Info->orders_id) ,'' ) ; ?></td>
</tr>
<?php else: ?>
<tr>
@@ -178,7 +92,7 @@
<div class="button_nav">
- <?php echo tep_js_back(tep_href_link(shipping::FILENAME), IMAGE_CANCEL);?>
+ <?php echo tep_js_back(tep_href_link($page::FILENAME), IMAGE_CANCEL);?>
</div>
Modified: trunk/catalog/admin/includes/gabarit/shippings/display_view.multi-action.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/shipping/display_view.multi-action.gab 2014-02-06 21:02:52 UTC (rev 5128)
+++ trunk/catalog/admin/includes/gabarit/shippings/display_view.multi-action.gab 2014-02-10 14:57:38 UTC (rev 5132)
@@ -1,19 +1,18 @@
<?php
/**
- @licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
- @portion code Copyright (c) 2002 osCommerce
+ @licence GPL 2005-2014 The osCSS developers - osCSS Open Source E-commerce
@package osCSS-2 <www http://www.oscss.org>
- @version 2.1.1
+ @version 2.2.0
@date 04/03/2012, 11:35
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
*/
global $mutliactionmenu, $mutliactionchoose;
-
+$page= MGabCont::CallSt('GetClassName');
?>
<div class="box_uniq block_form main-shipping">
-<?php echo tep_draw_form('shipping', shipping::FILENAME, tep_get_all_get_params(array('oID', 'action','forceajax','forceview')) .'action=multi-confirm'); ?>
+<?php echo tep_draw_form('shipping', $page::FILENAME, tep_get_all_get_params(array('oID', 'action','forceajax','forceview')) .'action=multi-confirm'); ?>
<div>
Not implemented in this current version
@@ -51,7 +50,7 @@
<div class="button_nav">
<?php echo tep_image_submit('button_delete.gif', __('image modify multi'), ' onclick="$.fancybox.close();" ') ;?>
- <?php echo tep_js_back(tep_href_link(shipping::FILENAME), IMAGE_CANCEL);?>
+ <?php echo tep_js_back(tep_href_link($page::FILENAME), IMAGE_CANCEL);?>
</div>
</form>
Modified: trunk/catalog/admin/includes/gabarit/shippings/display_view.multi.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/shipping/display_view.multi.gab 2014-02-06 21:02:52 UTC (rev 5128)
+++ trunk/catalog/admin/includes/gabarit/shippings/display_view.multi.gab 2014-02-10 14:57:38 UTC (rev 5132)
@@ -1,18 +1,19 @@
<?php
/**
- @licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
- @portion code Copyright (c) 2002 osCommerce
+ @licence GPL 2005-2014 The osCSS developers - osCSS Open Source E-commerce
@package osCSS-2 <www http://www.oscss.org>
- @version 2.1.1
+ @version 2.2.0
@date 04/03/2012, 11:35
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
*/
global $mutliactionmenu, $mutliactionchoose;
+
+ $page= MGabCont::CallSt('GetClassName');
?>
<div class="box_uniq block_form main-shipping">
-<?php echo tep_draw_form('orders', shipping::FILENAME, tep_get_all_get_params(array('oID', 'action','forceajax','forceview')) .'action=multi-action'); ?>
+<?php echo tep_draw_form('orders', $page::FILENAME, tep_get_all_get_params(array('oID', 'action','forceajax','forceview')) .'action=multi-action'); ?>
<div>
Not implemented in this current version
@@ -43,7 +44,7 @@
<div class="button_nav">
<?php echo tep_image_submit('button_delete.gif', __('image modify multi'), ' onclick="$.fancybox.close();" ') ;?>
- <?php echo tep_js_back(tep_href_link(shipping::FILENAME), IMAGE_CANCEL);?>
+ <?php echo tep_js_back(tep_href_link($page::FILENAME), IMAGE_CANCEL);?>
</div>
</form>
Added: trunk/catalog/admin/includes/gabarit/shippings/edit.tab.generic.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/shippings/edit.tab.generic.gab (rev 0)
+++ trunk/catalog/admin/includes/gabarit/shippings/edit.tab.generic.gab 2014-02-10 14:57:38 UTC (rev 5132)
@@ -0,0 +1,77 @@
+<?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/03/2012, 11:35
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+ @file edit.tab.generic.gab
+ @dir admin/includes/gabarit/shippings/
+*/
+global $price;
+
+$page= MGabCont::CallSt('GetClassName');
+?>
+
+
+<ul class="fleft w_50 main-shipping block">
+ <li style="font-size:13px;">
+ <span class="label" style="font-weight:bold;"><?php echo __('shipping date expedition'); ?></span>
+ <span class="value"><?php echo tep_date_short($page::$Info->date_expedition); ?></span>
+ </li>
+ <li style="font-size:13px;">
+ <span class="label" style="font-weight:bold;"><?php echo __('shipping status'); ?></span>
+ <span class="value"><?php echo $page::$shipping_status_array[$page::$Info->status]; ?></span>
+ </li>
+
+
+</ul>
+
+<ul class="fleft w_50 main-shipping block">
+ <li style="font-size:13px;">
+ <span class="label" style="font-weight:bold;"><?php echo __('shipping method'); ?></span>
+ <span class="value"><?php echo $page::$Info->method; ?></span>
+ </li>
+
+ <li style="font-size:13px;">
+ <span class="label" style="font-weight:bold;"><?php echo __('shipping tracking url'); ?></span>
+ <span class="value"><a href="<?php echo $page::$Info->tracking_url; ?>"><?php echo $page::$Info->tracking; ?></a></span>
+ </li>
+</ul>
+
+<br />
+<br />
+<br />
+
+
+<table class="dataTableBase shipping allshipping">
+ <thead>
+ <tr>
+ <th><?php echo __('@shipping table heading id'); ?></th>
+ <th><?php echo __('@shipping table heading products'); ?></th>
+ <th><?php echo __('@shipping table heading qt expedie'); ?></th>
+ <th><?php echo __('@shipping table heading methode'); ?></th>
+ </tr>
+ </thead>
+ <tbody>
+ <?php $i = 0; foreach($page::$Info->products as $item): $i++; ?>
+ <tr>
+ <td class="tcenter">
+ <?php echo $item->shipping_id; ?>
+ </td>
+ <td class="tcenter">
+ <a href="<?php echo tep_href_link(FILENAME_PRODUCTS,'action=edit&pID='.$item->products_id); ?>"><?php echo $item->products_name; ?></a>
+ </td>
+ <td class="tcenter">
+ <?php echo $item->qt_expedie; ?>
+ </td>
+
+ <td class="tcenter">
+ </td>
+ </tr>
+ <?php endforeach; ?>
+</tbody>
+
+</table>
Added: trunk/catalog/admin/includes/gabarit/shippings/edit.tab.suivi.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/shippings/edit.tab.suivi.gab (rev 0)
+++ trunk/catalog/admin/includes/gabarit/shippings/edit.tab.suivi.gab 2014-02-10 14:57:38 UTC (rev 5132)
@@ -0,0 +1,47 @@
+<?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/03/2012, 11:35
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+ @file edit.tab.suivi.gab
+ @dir admin/includes/gabarit/shippings/
+*/
+global $price;
+
+$page= MGabCont::CallSt('GetClassName');
+?>
+
+
+ <div class="block_form">
+ <?php echo tep_draw_form('shipping', $page::FILENAME, tep_get_all_get_params(array('oID', 'action','forceajax','forceview')) .'action=update'); ?>
+ <fieldset class="block_field">
+
+ <p>
+ <?php echo tep_draw_hidden_field('oID', '', $page::$Info->orders_id ); ?>
+ </p>
+
+ <p class="block_input">
+ <label for="status"><?php echo __('@shipping entry status'); ?></label>
+ <?php echo tep_draw_pull_down_menu('status', tep_get_status_array('shipping'), ''); ?>
+ </p>
+
+
+ <?php if(isset($_POST['notify']) && $_POST['notify']=='on'): ?>
+ <div class="block_input">
+ <label for="notify"><?php echo __('text info multi notify'); ?></label>
+ <?php echo tep_draw_textarea_field('comments', '', '30', '5', '','style="width:100%"'); ?>
+ </div>
+ <?php endif; ?>
+
+ <div class="button_nav">
+ <?php echo tep_image_submit('button_delete.gif', __('image modify multi'), ' onclick="$.fancybox.close();" ') ;?>
+ <?php echo tep_js_back(tep_href_link($page::FILENAME), IMAGE_CANCEL);?>
+ </div>
+ </fieldset>
+ </form>
+ </div>
+</div>
Copied: trunk/catalog/admin/includes/languages/fr_FR/Shipping.txt (from rev 5128, trunk/catalog/admin/includes/languages/fr_FR/modules/pages/shipping.txt)
===================================================================
--- trunk/catalog/admin/includes/languages/fr_FR/Shipping.txt (rev 0)
+++ trunk/catalog/admin/includes/languages/fr_FR/Shipping.txt 2014-02-10 14:57:38 UTC (rev 5132)
@@ -0,0 +1,88 @@
+<?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 04/11/2012, 16:07
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+*/
+$lang['heading title shipping']="Expeditions vers les clients" ;
+
+
+$lang['@shipping filter tab clause']="Généric" ;
+
+/* Action */
+ /* Listing */
+ $lang['table heading shipping id']="n°" ;
+ $lang['@shipping table heading ref']="Réf." ;
+ $lang['@shipping table heading order id']="Cmd n°" ;
+ $lang['@shipping table heading customers']="Clients" ;
+ $lang['@shipping table heading date expedition']="Expd. le" ;
+ $lang['@shipping table heading method']="Méthode" ;
+ $lang['@shipping table heading status']="Etat" ;
+ $lang['@shipping table heading pdf']="pdf" ;
+ $lang['@shipping table heading action']="Action" ;
+
+
+ /* mutli */
+ $lang['shipping update n %s']="Appliquer à cette livraison %s" ;
+ $lang['text info multi notify']="informer le client de ce changement " ;
+ $lang['image modify multi']="Valider" ;
+
+ $lang['@shipping multi action choose'] = "Choix de l'action à appliquer ";
+ $lang['@shipping multi entry status'] = "Choix de l'etat des expeditions apres l'action à appliquer ";
+
+
+ $lang['@shipping success updated'] = "Succès de la mise à jour de l'expedition";
+ $lang['@shipping warning not updated'] = "Erreur lors de l'enregsitrement de l'expedition";
+
+ /* edit */
+ /* title */
+ $lang['@shipping heading edit num %s ref %s']="Edition fiche expedition n°%s - ref : %s" ;
+
+ /* entry */
+ $lang['tab shipping briefs']="Description" ;
+ $lang['tab shipping details']="Suivi" ;
+
+ $lang['shipping date expedition']="Expedité le : " ;
+ $lang['shipping method']="Méthode" ;
+ $lang['shipping status']="État" ;
+ $lang['shipping tracking url']="liens de tracking : " ;
+
+ $lang['@shipping table heading id']="id" ;
+ $lang['@shipping table heading products']="Produits" ;
+ $lang['@shipping table heading qt expedie']="Qté." ;
+ $lang['@shipping table heading methode']="Méthode" ;
+
+
+ $lang['@shipping entry status']="Status à appliqué" ;
+
+
+ $lang['@shipping heading delvery address']="Adrresse de livraison" ;
+
+ $lang['heading documents']="Documents" ;
+ $lang['shipping table pdf heading weight']="Poids" ;
+ $lang['shipping table pdf heading date']="Date" ;
+ $lang['shipping table pdf heading file']="Fichier" ;
+ $lang['image shipping delivery']="Bon de livraison" ;
+ $lang['pdf generate']="Generer" ;
+
+/* delete */
+ /* title */
+ $lang['heading title delete shipping']="Suppression d'une expedition" ;
+ /* text */
+ $lang['text info delete shipping']="Vous confirmer vouloir supprimer cette expedition ?!" ;
+
+
+/* Value list */
+ $lang['@shipping action txt print bl']="Generation des bons de livraisons/preparation" ;
+
+
+
+ /* status */
+ $lang['shipping opened']="Ouverte" ;
+ $lang['shipping progress']="En cours" ;
+ $lang['shipping closed']="Cloturé" ;
+?>
\ No newline at end of file
Deleted: trunk/catalog/admin/includes/languages/fr_FR/modules/pages/shipping.txt
===================================================================
--- trunk/catalog/admin/includes/languages/fr_FR/modules/pages/shipping.txt 2014-02-10 07:06:12 UTC (rev 5131)
+++ trunk/catalog/admin/includes/languages/fr_FR/modules/pages/shipping.txt 2014-02-10 14:57:38 UTC (rev 5132)
@@ -1,88 +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 04/11/2012, 16:07
- @author oscim <mail aur...@os...> <www http://www.oscim.fr>
- @encode UTF-8
-*/
-$lang['heading title shipping']="Expeditions vers les clients" ;
-
-
-$lang['@shipping filter tab clause']="Généric" ;
-
-/* Action */
- /* Listing */
- $lang['table heading shipping id']="n°" ;
- $lang['@shipping table heading ref']="Réf." ;
- $lang['@shipping table heading order id']="Cmd n°" ;
- $lang['@shipping table heading customers']="Clients" ;
- $lang['@shipping table heading date expedition']="Expd. le" ;
- $lang['@shipping table heading method']="Méthode" ;
- $lang['@shipping table heading status']="Etat" ;
- $lang['@shipping table heading pdf']="pdf" ;
- $lang['@shipping table heading action']="Action" ;
-
-
- /* mutli */
- $lang['shipping update n %s']="Appliquer à cette livraison %s" ;
- $lang['text info multi notify']="informer le client de ce changement " ;
- $lang['image modify multi']="Valider" ;
-
- $lang['@shipping multi action choose'] = "Choix de l'action à appliquer ";
- $lang['@shipping multi entry status'] = "Choix de l'etat des expeditions apres l'action à appliquer ";
-
-
- $lang['@shipping success updated'] = "Succès de la mise à jour de l'expedition";
- $lang['@shipping warning not updated'] = "Erreur lors de l'enregsitrement de l'expedition";
-
- /* edit */
- /* title */
- $lang['@shipping heading edit num %s ref %s']="Edition fiche expedition n°%s - ref : %s" ;
-
- /* entry */
- $lang['tab shipping briefs']="Description" ;
- $lang['tab shipping details']="Suivi" ;
-
- $lang['shipping date expedition']="Expedité le : " ;
- $lang['shipping method']="Méthode" ;
- $lang['shipping status']="État" ;
- $lang['shipping tracking url']="liens de tracking : " ;
-
- $lang['@shipping table heading id']="id" ;
- $lang['@shipping table heading products']="Produits" ;
- $lang['@shipping table heading qt expedie']="Qté." ;
- $lang['@shipping table heading methode']="Méthode" ;
-
-
- $lang['@shipping entry status']="Status à appliqué" ;
-
-
- $lang['@shipping heading delvery address']="Adrresse de livraison" ;
-
- $lang['heading documents']="Documents" ;
- $lang['shipping table pdf heading weight']="Poids" ;
- $lang['shipping table pdf heading date']="Date" ;
- $lang['shipping table pdf heading file']="Fichier" ;
- $lang['image shipping delivery']="Bon de livraison" ;
- $lang['pdf generate']="Generer" ;
-
-/* delete */
- /* title */
- $lang['heading title delete shipping']="Suppression d'une expedition" ;
- /* text */
- $lang['text info delete shipping']="Vous confirmer vouloir supprimer cette expedition ?!" ;
-
-
-/* Value list */
- $lang['@shipping action txt print bl']="Generation des bons de livraisons/preparation" ;
-
-
-
- /* status */
- $lang['shipping opened']="Ouverte" ;
- $lang['shipping progress']="En cours" ;
- $lang['shipping closed']="Cloturé" ;
-?>
\ No newline at end of file
Modified: trunk/catalog/admin/includes/modules/account/account_extra.php
===================================================================
--- trunk/catalog/admin/includes/modules/account/account_extra.php 2014-02-10 07:06:12 UTC (rev 5131)
+++ trunk/catalog/admin/includes/modules/account/account_extra.php 2014-02-10 14:57:38 UTC (rev 5132)
@@ -174,9 +174,9 @@
/**
@brief action methode
*/
- public function check_action($actions){
+ public function check_action($action){
global $languages_id;
- $action=$actions['action'];
+ $action=$action;
$messageStack=messageStack::getInstance();
switch($action){
@@ -203,7 +203,7 @@
break;
}
- return $actions;
+ return $action;
}
Modified: trunk/catalog/admin/includes/modules/account/address_book.php
===================================================================
--- trunk/catalog/admin/includes/modules/account/address_book.php 2014-02-10 07:06:12 UTC (rev 5131)
+++ trunk/catalog/admin/includes/modules/account/address_book.php 2014-02-10 14:57:38 UTC (rev 5132)
@@ -207,9 +207,15 @@
@brief methode for event action
@return array $actions
*/
- public function check_action($actions){
+ public function check_action($action){
- self::$action=$actions['action'];
+ // for retro-compatibilite, NOT USE
+// if(is_array($action))
+// self::$action=$action['action'];
+// else
+ self::$action=$action;
+
+
$languages = tep_get_languages();
$messageStack=messageStack::getInstance();
@@ -443,7 +449,7 @@
break;
}
- return $actions;
+ return $action;
}
Modified: trunk/catalog/admin/includes/modules/account/history.php
===================================================================
--- trunk/catalog/admin/includes/modules/account/history.php 2014-02-10 07:06:12 UTC (rev 5131)
+++ trunk/catalog/admin/includes/modules/account/history.php 2014-02-10 14:57:38 UTC (rev 5132)
@@ -124,9 +124,9 @@
return $value;
}
- public function check_action($actions){
+ public function check_action($action){
global $oscss;
- self::$action=$actions['action'];
+ self::$action=$action;
$languages = tep_get_languages();
$messageStack=messageStack::getInstance();
@@ -136,7 +136,7 @@
break;
}
- return $actions;
+ return $action;
}
public function get_header(){
Modified: trunk/catalog/admin/includes/modules/pages/customers.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/customers.php 2014-02-10 07:06:12 UTC (rev 5131)
+++ trunk/catalog/admin/includes/modules/pages/customers.php 2014-02-10 14:57:38 UTC (rev 5132)
@@ -78,6 +78,23 @@
global $oscss,$language,$lang;
$oscss->pile_file_lang(DIR_FS_ADMIN.DIR_WS_LANGUAGES.$language.'/'.ucwords('customer').'.txt');
+
+ /**
+ @remarks Call and init all class required for display, event, process
+ */
+ $DB=Database::getInstance();
+ //
+ self::$modules=new AcaFactory('account');
+ // Event
+ EventsHandlerActive::ActiveForClass(__CLASS__);
+ // instancie MLinkTo
+ MLinkTo::getInstance(self::$datatype);
+ // Set Name in MAster Gab
+ MGabCont::SetCurrentName(__CLASS__);
+ //
+ self::$languages = tep_get_languages();
+
+
/**
@remarks not load if not first init
*/
@@ -89,18 +106,13 @@
if(!defined('AJAXSTATMENTDETAIL'))define('AJAXSTATMENTDETAIL', 'mod=page&type='.self::$code);
- self::$languages = tep_get_languages();
-
self::$newsletter_array=array(array('id' => '1', 'text' => __('entry newsletter yes')),
array('id' => '0', 'text' => __('entry newsletter no'))
);
}
- self::$modules=new AcaFactory('account');
- MGabCont::SetCurrentName(__CLASS__);
-
global $languages_id;
/**
@remarks define var execution sql in GetDBValue()
@@ -150,12 +162,15 @@
'class'=>'tright',
'edit'=>array(
'input_name'=>'customers_gender',
- 'input_type'=>'radio',
- 'values_list'=>array(
+// 'input_type'=>'radio',
+ 'input_type'=>'select',
+ 'input_size'=>1,
+ 'select_values'=>array(
array('id'=>'m', 'text'=> MALE ),
array('id'=>'f', 'text'=> FEMALE ),
array('id'=>'l', 'text'=> MLLE ),
),
+ 'class'=>'tleft',
'position_grp'=>1
),
);
@@ -408,7 +423,7 @@
/// @remarks min fields and not view directly colonne fields
- $listfield = " ";
+ $listfield = " c.customers_id as id, c.customers_email_address as email_address, ";
/// @remarks Active forms filter
$mutli=array();
@@ -497,15 +512,8 @@
if(!empty($actions))
self::$action=$actions;
-// if(isset($_POST['customers_id'])) self::$Id= (int)$_POST['customers_id'];
-
- if( self::$modules !=false)
- self::$modules->check_action(self::$action);
-
-
+
switch (self::$action) {
-
-
/**
@remarks specific ajax action
*/
@@ -914,12 +922,14 @@
*/
public static function ButtonRowsActions($item){
global $SecuKey;
-
+
$action_str_left =sprintf(CsrtAction::getLink('row_action_right', __('incarner'), 'incarner'), '', tep_catalog_href_link('login.php','osCAdminDirect='.md5($SecuKey.date('d')).'&id='.$item['id'],'SSL', false ) ,'');
$action_str_left .=sprintf(CsrtAction::getLink('row_action_right', __('@customers button vcard'), 'vcard'), '', tep_href_link(self::FILENAME,'cID=' . $item['id'].'&action=vcard' ) ,'');
- $action_str = self::$modules->display_ColumnRowAction($customers['id']);
+ $action_str = self::$modules->display_ColumnRowAction($item['id']);
+ $action_str .=sprintf(CsrtAction::getLink('row_action_right', __('@customers button email'), 'email'), '', tep_mailto($item['email_address'],self::FILENAME) ,'');
+
return parent::GenericRowsActions($item, 'ned', $action_str_left, $action_str);
}
@@ -974,6 +984,8 @@
while ($item = $_query->fetchAssoc()) {
$ord =array();
+
+ $item[0]=$item['id'];
$item[1]=tep_draw_checkbox_field('action_multi['.$item['id'].']','action_mutli_'.$item['id'],$item['id']);
foreach(self::$InitInfo['modele']['listing'] as $k=>$row){
@@ -991,7 +1003,7 @@
$ord[$k]=$item[$k];
}
- $ord[0]=$item['id'];
+
$res[]=$ord;
Modified: trunk/catalog/admin/includes/modules/pages/mail.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/mail.php 2014-02-10 07:06:12 UTC (rev 5131)
+++ trunk/catalog/admin/includes/modules/pages/mail.php 2014-02-10 14:57:38 UTC (rev 5132)
@@ -17,7 +17,11 @@
*/
class mail
Extends ModOne
- implements ExtModPage, InterfaceModule {
+ implements
+ ExtModPage,
+ InterfaceModule
+
+ {
const FILENAME =FILENAME_MAIL;
@@ -118,13 +122,14 @@
$content=($_POST['p_format'] == 'HTML') ? tep_replace_for_mail($message,$subject,$html_reg,$text_reg,'HTML') : tep_replace_for_mail(strip_tags($message),$subject,$html_reg,$text_reg,'TXT');
+
$myarray = array(
- 'email_use_html'=>(($_POST['p_format'] == 'HTML')?true:false),
- 'mail_sent_to'=>$mail_sent_to,
- 'from'=>$from,
- 'subject'=>$subject,
- 'message'=>$content
- );
+ 'email_use_html'=>(($_POST['p_format'] == 'HTML')?true:false),
+ 'mail_sent_to'=>$mail_sent_to,
+ 'from'=>$from,
+ 'subject'=>$subject,
+ 'message'=>$content
+ );
$message_final=emailUtility::post_prepare_email("mail.tpl",$language,$myarray);
@@ -168,10 +173,7 @@
$id = tep_db_prepare_input($_REQUEST['id']);
switch ($_REQUEST['mod']) {
-// localhost/test/oscss/04/catalog/admin/mail.php?cus...@os...&origin=adminNotif.php&action=usemod&mod=adminNotif
case 'adminNotif':
-
-
$DB=Database::getInstance();
$query=$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)$id."' ");
@@ -184,9 +186,6 @@
self::$list->sign = '';
break;
}
-
-
-
break;
@@ -301,51 +300,6 @@
return $str;
}
- /**
- @remarks implements InterfaceModule depend
- if module twin in backoffice, report all content install in the other module
- public function check() {return true;}
- public function install() {return true;}
- public function remove() {return true;}
- public function keys() {return array(); }
- */
-
- /**
- @fn check()
- @brief test if count all var , and keys is equal
- @return boolean true/false
- */
- function check() { return true; }
-
-
- /**
- @fn keys()
- @return array all key configuration define by this module
- */
- function keys() { return array(); }
-
- /**
- @fn install()
- @brief add all configuration
- @note
- - Modules can emarquer sql installation instructions, however, in the case of transverse information, or dependen...
[truncated message content] |
|
From: <os...@us...> - 2014-02-10 07:06:14
|
Revision: 5131
http://sourceforge.net/p/oscss/svn/5131
Author: oscim
Date: 2014-02-10 07:06:12 +0000 (Mon, 10 Feb 2014)
Log Message:
-----------
Add sqlxx
Added Paths:
-----------
trunk/catalog/admin/includes/classes/drivers/sqladminnotification.php
Added: trunk/catalog/admin/includes/classes/drivers/sqladminnotification.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqladminnotification.php (rev 0)
+++ trunk/catalog/admin/includes/classes/drivers/sqladminnotification.php 2014-02-10 07:06:12 UTC (rev 5131)
@@ -0,0 +1,271 @@
+<?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 29/10/2013, 20:11
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+ @file sqladminnotification.php
+ @dir admin/includes/classes/drivers/
+*/
+
+require_once( DIR_FS_ADMIN . DIR_WS_CLASSES . 'SqlFilesDataDriverClass.php');
+
+/**
+ @class sqladminnotification
+*/
+class sqladminnotification
+ Extends SqlFilesDataDriverClass
+ implements ModSqlDataDriver{
+
+ public static $modules;
+
+ protected static $_instance;
+
+ protected function __construct(){
+ self::$modules=new AcaFactory('adminuser');
+ }
+
+
+ public static function getInstance() {
+ if(self::$_instance == null) self::$_instance = new self();
+ return self::$_instance;
+ }
+
+
+ /**
+ @brief create new ligne in table configuration
+ */
+ public static function create($option){
+ self::getInstance();
+ $DB=Database::getInstance();
+ $error = 0 ;
+ $specimen = self::Specimen();
+
+
+ $_post = (isset($option['post'])? $option['post'] : array() );
+ $sqlarray = (isset($option['sqlarray'])? $option['sqlarray'] : array() );
+
+
+ if(!isset($sqlarray['password']))
+ 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();
+
+ $DB->beginTransaction();
+
+ if(count($sql_data_array) > 0) {
+ $res = tep_db_perform(TABLE_ADMIN_NOTIFICATION, $sql_data_array) ;
+ if( !$res )
+ $error++;
+ }
+ else
+ $error++;
+
+ if( $error > 0){
+ $DB->rollbackTransaction();
+ return false;
+ }
+ else{
+ $id = $res->__get('insertId');
+ $DB->commitTransaction();
+ return $id;
+ }
+ }
+
+ /**
+ @brief update ligne in table configuration
+ */
+ public static function update($option){
+ self::getInstance();
+
+ if(!isset($option['id']) )
+ return false;
+
+ $DB=Database::getInstance();
+ $error = 0 ;
+ $specimen = self::Specimen();
+
+ $where ='';
+ if(isset($option['id'])) $where .="AND notif_id = '".(int)$option['id']."' ";
+
+
+ $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();
+
+ if(count($sql_data_array)>0 ){
+ if( !tep_db_perform(TABLE_ADMIN_NOTIFICATION, $sql_data_array, 'update' , substr($where,3) ) )
+ $error++;
+ }
+ else
+ return false;
+
+ if( $error > 0){
+ $DB->rollbackTransaction();
+ return false;
+ }
+ else{
+ $DB->commitTransaction();
+ return 1;
+ }
+ }
+
+ /**
+ @brief load ligne in table configuration
+ @param option array
+ id => row id int (configuration_id)
+ key => string key (configuration_key)
+ group_id => group_id int (configuration_group_id)
+ @param $shortkey use cleankey for return short key
+ @return
+
+ object(stdClass)[13]
+ public 'id' => string '1' (length=1)
+
+ OR
+ array(
+ object(stdClass)[13]
+ ...
+ object(stdClass)[13]
+ ..
+ )
+
+ */
+ public static function fetch($option,$shortkey=false){
+ self::getInstance();
+ $DB=Database::getInstance();
+ $error = 0 ;
+
+
+ $sql ="";
+ if(isset($option['id']))
+ $sql .="AND notif_id = '".(int)tep_db_input($option['id'])."' ";
+ elseif(isset($option['user_id']) && $option['user_id'] > 0){
+ if( (int)$option['type'] == 0 )
+ $sql .="AND (notif_type='0' AND user_id='".$option['user_id']."') ";
+ elseif( (int)$option['type'] == 1 )
+ $sql .="AND (notif_type='1' AND user_id='".$option['user_id']."') ";
+ }
+ elseif(isset($option['type']) && !isset($option['user_id']))
+ $sql .="AND notif_type = '".(int)tep_db_input($option['type'])."' ";
+ elseif(!isset($option['type']) && !isset($option['user_id']))
+ $sql .="AND ( (notif_type='0' AND user_id='".$_SESSION['login_id']."') OR (notif_type='1' AND user_id='".$_SESSION['login_groups_id']."')) ";
+
+ if(isset($option['key']))
+ $sql .="AND notif_key = '".(int)tep_db_input($option['key'])."' ";
+
+ $sql="SELECT * FROM " . TABLE_ADMIN_NOTIFICATION . " a ".
+ " WHERE 1 ".$sql;
+
+ $res=$DB->query($sql);
+
+ $num = $res->__get('numRows');
+
+ if($num == 1){
+ $result=$res->fetchAssoc();
+ return ((!$shortkey)? $result : self::CleanKey($result));
+ }
+ elseif($num > 1){
+ $array=array();
+
+ foreach($res->fetchAllAssoc() as $result)
+ $array[]= ((!$shortkey)? $result : self::CleanKey($result));
+
+ return $array;
+ }
+
+ return false;
+ }
+
+ /**
+ @brief delete row
+ */
+ public static function delete($option){
+ self::getInstance();
+ $DB=Database::getInstance();
+
+ $sql = '';
+ if(isset($option['id']))
+ $sql .="AND notif_id = '".(int)tep_db_input($option['id'])."' ";
+ elseif(isset($option['user_id']) && $option['user_id'] > 0){
+ if( (int)$option['type'] == 0 )
+ $sql .="AND (notif_type='0' AND user_id='".$option['user_id']."') ";
+ elseif( (int)$option['type'] == 1 )
+ $sql .="AND (notif_type='1' AND user_id='".$option['user_id']."') ";
+ }
+ elseif(isset($option['type']) && !isset($option['user_id']))
+ $sql .="AND notif_type = '".(int)tep_db_input($option['type'])."' ";
+ else
+ return false;
+
+ return $DB->query("delete from " . TABLE_ADMIN_NOTIFICATION . " where ".$sql);
+
+
+// return true;
+ }
+
+
+ /**
+ @brief
+ @return array product empty
+ */
+ public static function Specimen($shortkey=false){
+ $par = array(
+ 'notif_id' => -1,
+ 'notif_type' => 'user',// user/group
+ 'user_id' => -1,
+ 'notif_key' => '',
+ 'notif_data' => '',
+ 'notif_title' => '',
+ 'notif_text' => '',
+ 'notif_date' => '',
+ );
+
+ 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 CleanKey()
+ @brief Clean string name key
+ */
+ public static function CleanKey($array){
+ self::getInstance();
+ $object= new stdclass();
+
+ foreach($array as $key=>$value){
+ if( strpos($key,'notif_') ===0)
+ $key=substr($key,6);
+
+ $object->$key = $value;
+ }
+
+ return $object;
+ }
+
+}
+
+
+?>
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2014-02-08 17:05:06
|
Revision: 5130
http://sourceforge.net/p/oscss/svn/5130
Author: oscim
Date: 2014-02-08 17:05:00 +0000 (Sat, 08 Feb 2014)
Log Message:
-----------
Add file language deport based on pages/
Added Paths:
-----------
trunk/catalog/admin/includes/languages/fr_FR/Admingroup.txt
trunk/catalog/admin/includes/languages/fr_FR/Adminuser.txt
Added: trunk/catalog/admin/includes/languages/fr_FR/Admingroup.txt
===================================================================
--- trunk/catalog/admin/includes/languages/fr_FR/Admingroup.txt (rev 0)
+++ trunk/catalog/admin/includes/languages/fr_FR/Admingroup.txt 2014-02-08 17:05:00 UTC (rev 5130)
@@ -0,0 +1,75 @@
+<?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 03/04/2012, 09:32
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+*/
+$lang['heading title']="Gestion des groupes" ;
+$lang['table heading groups define']="Gestion des acces pour ce groupe" ;
+
+
+/* Define */
+$lang['@adminGroup table heading id']="Id" ;
+$lang['@adminGroup table heading name']="Nom" ;
+$lang['@adminGroup table heading status']="Etat" ;
+$lang['@adminGroup table heading action']="Etat" ;
+
+/* Listing */
+ $lang['heading title adminGroup']="Gestion des groupes" ;
+
+/* Edit */
+ $lang['@adminGroup heading title edit']="Edition d'un Groupe " ;
+
+ $lang['@adminGroup tab data']="Caractéristiques" ;
+ $lang['@adminGroup tab members']="Membres" ;
+ $lang['@adminGroup tab acl']="Permissions" ;
+
+
+ $lang['@adminGroup text status off']="Actif" ;
+ $lang['@adminGroup text status on']="Inactif" ;
+
+/* Delete */
+ $lang['heading title delete adminGroup']="Supprimer un groupe" ;
+
+ $lang['text info delete adminGroup']="ATTENTION : la suppression de ce groupe supprimera également les membres. Êtes vous sûr de vouloir supprimer ce groupe ?" ;
+
+
+
+
+$lang['text count groups']="Groupes : " ;
+$lang['TABLE_HEADING_NAME']="Nom" ;
+$lang['table heading groups']="Niveau du groupe" ;
+$lang['table heading groups status']="Etat" ;
+$lang['table heading action']="Action" ;
+$lang['table heading groups name']="Nom du groupe" ;
+$lang['TEXT_INFO_DELETE_INTRO_NOT']="Vous ne pouvez pas supprimer <nobr>%s du groupe !</nobr>" ;
+$lang['TEXT_INFO_EDIT_INTRO']="Placer le niveau de permission : " ;
+$lang['TEXT_INFO_ERROR']="<span style=\"color:red\">L'adresse Email est déjà utilisée ! Essayez avec une autre adresse.</span>" ;
+$lang['TEXT_INFO_HEADING_DEFAULT_GROUPS']="Gestion du groupe" ;
+$lang['text info heading delete groups']="Supprimer un groupe" ;
+$lang['TEXT_INFO_DEFAULT_GROUPS_INTRO']="<strong>NOTE :</strong><ul><li><strong>Éditer :</strong> Éditer le nom du groupe.</li><li><strong>Effacer :</strong> Supprimer un groupe.</li><li><strong>Permission :</strong> Définir les accès d'un groupe.</li></ul>" ;
+$lang['text info delete groups intro']="<span style=\"color:red\">ATTENTION :</span> la suppression de ce groupe supprimera également les membres. Êtes vous sûr de vouloir supprimer le groupe <nobr><strong>%s</strong> ?</nobr>" ;
+$lang['text info delete groups intro not']="Vous ne pouvez pas supprimer ce groupe !" ;
+$lang['TEXT_INFO_GROUPS_INTRO']="Donner un nom pour le groupe" ;
+$lang['text info heading edit group']="Nom du groupe" ;
+$lang['text info edit group intro']="Vous pouvez renommer le nom du groupe. <span class=\"alert\"><br />ATTENTION :</span> le nom doit comporter au minimum <strong>6 lettres.</strong>" ;
+$lang['text info heading groups']="Nouveau groupe" ;
+$lang['text info groups name']=" <strong>Nom du groupe :</strong>" ;
+$lang['TEXT_INFO_GROUPS_NAME_FALSE']="<span class=\"error\">ERREUR : Le nom du groupe doit contenir plus de 5 caractères !</span>" ;
+$lang['TEXT_INFO_GROUPS_NAME_USED']="<span class=\"error\">ERREUR : Le nom du groupe est déjà utilisé !</span>" ;
+$lang['TEXT_INFO_GROUPS_LEVEL']="Niveau du groupe : " ;
+$lang['TEXT_INFO_GROUPS_BOXES']="<strong>Permission des boîtes :</strong><br /> Donner les accès dans les boîtes." ;
+$lang['TEXT_INFO_HEADING_DEFINE']="Définir les groupes" ;
+$lang['TEXT_INFO_DEFINE_INTRO_BLOCK']="<strong>Groupe %s :</strong><br /><br />Vous ne pouvez pas changer la permission de(s) dossier(s) pour ce groupe.<br /><br />" ;
+$lang['TEXT_INFO_DEFINE_INTRO']="<strong>Groupe %s :</strong><br /><br /><li>Changez la permission pour ce groupe en choisissant les boîtes et les dossiers.</li><br /><br /><li>Cliquer sur <strong>sauver</strong> après modification.</li><br /><br />" ;
+$lang['TEXT_NOTE_DEFINE_GRP']="Cet espace est destiné à régler les autorisations d'accès au page, si vous souhaitez ajouter des éléments dans les menus, reportez vous à : Admin menu " ;
+
+$lang['image add user in this group']="Ajouter un utilisateur à ce groupe" ;
+$lang['image edit']="Editer" ;
+$lang['image define groups']="gestion des droits" ;
+
+?>
\ No newline at end of file
Added: trunk/catalog/admin/includes/languages/fr_FR/Adminuser.txt
===================================================================
--- trunk/catalog/admin/includes/languages/fr_FR/Adminuser.txt (rev 0)
+++ trunk/catalog/admin/includes/languages/fr_FR/Adminuser.txt 2014-02-08 17:05:00 UTC (rev 5130)
@@ -0,0 +1,113 @@
+<?php
+/**
+ @licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
+ @package osCSS-2 <www http://www.oscss.org>
+ @version 2.1.2
+ @date 29/10/2013, 14:43
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+*/
+
+
+
+/* Listing */
+ /* title */
+ $lang['heading title adminUsers']="Gestion des utilisateurs" ;
+
+ /* entry */
+ $lang['@adminUsers table heading id']="Id" ;
+ $lang['@adminUsers table heading lastname']="Prénom" ;
+ $lang['@adminUsers table heading firstname']="Nom" ;
+ $lang['@adminUsers table heading email']="Email" ;
+ $lang['@adminUsers table heading groups name']="Groupe" ;
+ $lang['@adminUsers table heading lognum']="Accès" ;
+ $lang['@adminUsers table heading status']="Etat" ;
+ $lang['@adminUsers table heading action']="Action" ;
+ $lang['@adminUsers table heading url openid']="openID" ;
+ $lang['@adminUsers table heading language']="Langue" ;
+
+ /* Bouton */
+ $lang['image add adminUsers']="Créer un nouvel utilisateur" ;
+
+
+/* Edit */
+ /* title */
+ $lang['@adminUsers heading title edit']="Fiche utilisateur : Edition" ;
+ /* tabs */
+ $lang['@adminUsers tab data']="Profil" ;
+
+ /* entry */
+ $lang['text info adminUsers created']="Date de création : " ;
+ $lang['text info adminUsers modified']="Date de modification : " ;
+ $lang['text info adminUsers logdate']="Dernier accès : " ;
+ $lang['text info adminUsers lognum']="Nombre d'accès : " ;
+ $lang['text info adminUsers uniqkey']="Clef unique (openid) : " ;
+
+ /* */
+ $lang['@adminUsers text status off']="Inactif" ;
+ $lang['@adminUsers text status on']="Actif" ;
+
+ /* message stack */
+ $lang['@sqladminuser error in update process']="Erreur lors de la mise à jour" ;
+ $lang['@sqladminuser success in update process']="Succès de la mise à jour" ;
+
+
+/* Delete */
+ $lang['heading title delete adminUsers']="Suppression d'un utilisateur" ;
+ $lang['text info delete adminUsers']="Vous êtes sur de vouloir supprimer cet utilisateur " ;
+
+
+
+ /* */
+
+/** message action result */
+ /* send mail */
+ $lang['send mail for %s ok']="Envoi de l'email à %s : ok" ;
+ $lang['error in process send mail for %s']="Erreur lors de l'envoi de l'email à %s" ;
+
+ /* create/update user */
+ $lang['error in process for save user']="Erreur lors de l'enregistrement de l'utilisateur" ;
+ $lang['process for save user %s ok']="L'enregistrement de l'utilisateur est terminé" ;
+
+ /* delet user */
+ $lang['error in process for delete user']="Erreur durant la suppression de l'utilisateur" ;
+ $lang['delete user %s ok']="l'utilisateur %s à était supprimé " ;
+
+
+/** Title email send notif */
+ /* internal notification */
+ /* delet user */
+ $lang['delete compte for admin']="Suppression d'un compte utilisateur" ;
+ $lang["this post is inform you in action delete user %s in you'r shop"]="Ce message vous informe de la suppression d'un compte utilisateur privé de votre boutique. Il n'a qu'un but de control de votre boutique. L'utilisateur supprimé est %s " ;
+
+ /* create user */
+ $lang['subject copy creat new compte for admin']="[Copy] création d'un nouvel utilisateur" ;
+
+ /* user notify */
+ /* create user */
+ $lang['subject email text subject create account']="Création de votre compte" ;
+
+ /* update user */
+ $lang['subject email text subject update account']="Modification de votre compte" ;
+
+
+
+
+
+
+
+$lang['text info error email used']="Cette adresse Email est déjà utilisée " ;
+$lang['js alert firstname']="Requis : Prénom " ;
+$lang['your firstname must consist of at least 3 characters']="Votre prénom doit contenir au moins 3 caractères" ;
+$lang['js alert lastname']="Requis : Nom " ;
+$lang['your lastname must consist of at least 3 characters']="Votre Nom doit contenir au moins 3 caractères" ;
+$lang['js alert email']="Requis : Adresse Email " ;
+$lang['please enter groupe id']="Préciser un groupe " ;
+
+
+$lang['js alert email format']="Email non valide ! " ;
+$lang['js alert email used']=" Adresse Email déjà utilisée ! " ;
+$lang['js alert level']=" Requis : Un niveau de groupe " ;
+$lang['this email already exists']="Cet email existe déjà " ;
+
+?>
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|