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-01-26 19:40:38
|
Revision: 5079
http://sourceforge.net/p/oscss/svn/5079
Author: oscim
Date: 2014-01-26 19:40:34 +0000 (Sun, 26 Jan 2014)
Log Message:
-----------
Deletes old modele
Removed Paths:
-------------
trunk/catalog/admin/includes/modules/configuration/cfg_xx.php
Deleted: trunk/catalog/admin/includes/modules/configuration/cfg_xx.php
===================================================================
--- trunk/catalog/admin/includes/modules/configuration/cfg_xx.php 2014-01-26 18:43:31 UTC (rev 5078)
+++ trunk/catalog/admin/includes/modules/configuration/cfg_xx.php 2014-01-26 19:40:34 UTC (rev 5079)
@@ -1,88 +0,0 @@
-<?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 06/01/2014, 11:28
- @author oscim <mail aur...@os...> <www http://www.oscim.fr>
- @encode UTF-8
-
- @class cfg_xx Gestion deporté de configuration.
- La page content/configuration.php gere les appels
-
- LE nom de la class, porte le numero du gID, celui enregister dans la table osc_configuration_group
- Ex: INSERT INTO osc_configuration_group ( configuration_group_id , configuration_group_title , configuration_group_description , sort_order , visible , configuration_group_parentid , configuration_group_group_id , configuration_group_key ) VALUES ( '45', 'TITLE Class cfg_xx', NULL , NULL , '1', '110', '', '' );
-*/
-
-Class cfg_xx{
-
- /**
- @var list , array for transport data in html gab
- */
- public static $list;
-
- /**
- @fn __construct()
- @brief construct
- @return none
- */
- function __construct(){
-
- $this->code=__CLASS__;
-
- if(!defined('FILENAME_CFG'))
- define('FILENAME_CFG',"gparentID=".$_GET['gparentID']."&gID=".$_GET['gID']);
-
- global $messageStack, $language ,$oscss;
- $oscss=oscss_cstr::getInstance();
-
- $oscss->pile_file_lang(DIR_FS_ADMIN.DIR_WS_LANGUAGES.$language.'/modules/configuration/'.$this->code.'.txt');
- }
-
-
- /**
- @fn draw_action()
- @brief action for this class
- @return none or false
- */
- public function draw_action(){
- global $action,$messageStack;
- switch ($action) {
- default:
-
- }
- }
-
- /**
- @fn load_db_values($Id)
- @return object
- */
- public function load_db_values($Id){
- global $action,$languages_id;
- }
-
- /**
- @brief Appelé dans le header de page
- */
- public static function draw_header(){
- }
-
- /**
- @fn draw()
- @brief display
- @return none
- */
- public function draw(){
- global $action;
-
- switch($action){
- default:
- self::$list = $this->load_db_values('');
-
- //return tep_get_include_contents('configuration/'.__CLASS__.'.listing');
- }
- }
-}
-
-
-?>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2014-01-26 18:43:37
|
Revision: 5078
http://sourceforge.net/p/oscss/svn/5078
Author: oscim
Date: 2014-01-26 18:43:31 +0000 (Sun, 26 Jan 2014)
Log Message:
-----------
Fix
Modified Paths:
--------------
trunk/catalog/admin/includes/classes/drivers/sqlextrafields.php
trunk/catalog/admin/includes/modules/configuration/modextra.php
Modified: trunk/catalog/admin/includes/classes/drivers/sqlextrafields.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlextrafields.php 2014-01-26 18:35:47 UTC (rev 5077)
+++ trunk/catalog/admin/includes/classes/drivers/sqlextrafields.php 2014-01-26 18:43:31 UTC (rev 5078)
@@ -116,24 +116,6 @@
$DB->beginTransaction();
-// if(isset($option['new_key'])) $sql_data_array['fields_key'] = $option['new_key'];
-//
-// if(isset($option['size'])) $sql_data_array['fields_size'] = $option['size'];
-// if(isset($option['sort'])) $sql_data_array['fields_sort'] = $option['sort'];
-// if(isset($option['input_type'])) $sql_data_array['fields_input_type'] = $option['input_type'];
-// if(isset($option['input_value'])) $sql_data_array['fields_input_value'] = $option['input_value'];
-// if(isset($option['required_status'])) $sql_data_array['fields_required_status'] = $option['required_status'];
-// // if(isset($option['name'])) $sql_data_array['fields_name'] = $option['name'];
-// if(isset($option['status'])) $sql_data_array['fields_status'] = $option['status'];
-// // if(isset($option['required_email'])) $sql_data_array['fields_required_email'] = $option['required_email'];
-// // if(isset($option['key'])) $sql_data_array['fields_key'] = $option['key'];
-// if(isset($option['admin'])) $sql_data_array['fields_admin'] = $option['admin'];
-// if(isset($option['special_mod'])) $sql_data_array['fields_special_mod'] = $option['special_mod'];
-// if(isset($option['group_class'])) $sql_data_array['fields_group_class'] = $option['group_class'];
-//
-//
-// // special for customers
-// if(isset($option['required_email'])) $sql_data_array['fields_required_email'] = $option['required_email'];
if( count($sql_data_array) > 0){
// $sql_data_array['fields_type'] = self::$fields_type;
Modified: trunk/catalog/admin/includes/modules/configuration/modextra.php
===================================================================
--- trunk/catalog/admin/includes/modules/configuration/modextra.php 2014-01-26 18:35:47 UTC (rev 5077)
+++ trunk/catalog/admin/includes/modules/configuration/modextra.php 2014-01-26 18:43:31 UTC (rev 5078)
@@ -97,6 +97,8 @@
'content'=>tep_get_include_contents('MGabCont/filter.language'),
),
);
+
+
}
@@ -291,10 +293,13 @@
*/
case 'setflag':
-
-
if(isset($_GET['flag']) )
- if( !sqlextrafieldsFactory::update(array('id'=>(int)self::$id ,'status'=>(int)tep_db_prepare_input($_GET['flag']) )) )
+ if( !sqlextrafieldsFactory::update(
+ array(
+ 'id'=>(int)self::$id ,
+ 'sqlarray'=> array('status'=>(int)tep_db_prepare_input($_GET['flag']))
+ )
+ ) )
$messageStack->add_session(__('error update for extra fields'), 'error');
if(!isset($_GET['forceajax']))
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2014-01-26 18:35:51
|
Revision: 5077
http://sourceforge.net/p/oscss/svn/5077
Author: oscim
Date: 2014-01-26 18:35:47 +0000 (Sun, 26 Jan 2014)
Log Message:
-----------
Fix call gabarit in action value_new
Modified Paths:
--------------
trunk/catalog/admin/includes/modules/configuration/modextra.php
Modified: trunk/catalog/admin/includes/modules/configuration/modextra.php
===================================================================
--- trunk/catalog/admin/includes/modules/configuration/modextra.php 2014-01-26 18:24:22 UTC (rev 5076)
+++ trunk/catalog/admin/includes/modules/configuration/modextra.php 2014-01-26 18:35:47 UTC (rev 5077)
@@ -109,6 +109,7 @@
$DB=Database::getInstance();
+
switch ($action) {
/**
@@ -217,8 +218,6 @@
$array['id']=self::$id;
$array['sqlarray'] = sqlextrafieldsFactory::ExtractForm($_POST);
-// print_r($array);
-// exit;
if( ! sqlextrafieldsFactory::update( $array ) )
$messageStack->add_session(__('error update for extra fields'), 'error');
else
@@ -472,10 +471,6 @@
public function draw(){
global $action,$gparentID,$current_theme, $EFL, $EFVL;
-
-
-
-// echo $action;
switch($action){
/**
@remarks Ajax View result
@@ -488,8 +483,9 @@
/**
@remarks Normal View Page
*/
+ case 'value_new':
+ $action='value_edit';
case 'value_delete':
- case 'value_new':
case 'value_edit':
$EFL = $this->EFL;
@@ -499,11 +495,6 @@
$gab = 'value.'.substr($action, 6);
break;
-// $EFL = $this->load_db_values();
-//
-// $gab = 'label.'.'delete';
-// break;
-
case '':
$action = 'listing';
default:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2014-01-26 18:24:28
|
Revision: 5076
http://sourceforge.net/p/oscss/svn/5076
Author: oscim
Date: 2014-01-26 18:24:22 +0000 (Sun, 26 Jan 2014)
Log Message:
-----------
Fix name table error
Modified Paths:
--------------
trunk/catalog/install/includes/sql/mysql/tables/osc_extra_fields_values.sql
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-01-25 16:58:57 UTC (rev 5075)
+++ trunk/catalog/install/includes/sql/mysql/tables/osc_extra_fields_values.sql 2014-01-26 18:24:22 UTC (rev 5076)
@@ -12,8 +12,8 @@
--+######################################################################--+
-drop table if exists osc_extra_field_values;
-CREATE TABLE osc_extra_field_values (
+drop table if exists osc_extra_fields_values;
+CREATE TABLE osc_extra_fields_values (
value_id int(10) unsigned NOT NULL AUTO_INCREMENT,
fields_id int(11) NOT NULL,
languages_id int(11) NOT NULL,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2014-01-25 16:59:01
|
Revision: 5075
http://sourceforge.net/p/oscss/svn/5075
Author: oscim
Date: 2014-01-25 16:58:57 +0000 (Sat, 25 Jan 2014)
Log Message:
-----------
Fix
Modified Paths:
--------------
trunk/catalog/admin/includes/classes/drivers/sqlcategorie.php
trunk/catalog/admin/includes/classes/drivers/sqlextrafields.php
trunk/catalog/admin/includes/modules/configuration/modextra.php
trunk/catalog/includes/languages/fr_FR/account.txt
trunk/test/phpunit/Back/modules/pages/pagecategoriesTest.php
trunk/test/phpunit/Back/modules/pages/pagecustomersTest.php
trunk/test/phpunit/Back/modules/pages/pageproductsTest.php
trunk/test/phpunit/Back/modules/pages/pagesfeaturedTest.php
trunk/test/phpunit/Back/sqlxxx/sqlfeaturedTest.php
Modified: trunk/catalog/admin/includes/classes/drivers/sqlcategorie.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlcategorie.php 2014-01-25 16:33:29 UTC (rev 5074)
+++ trunk/catalog/admin/includes/classes/drivers/sqlcategorie.php 2014-01-25 16:58:57 UTC (rev 5075)
@@ -57,6 +57,7 @@
$DB=Database::getInstance();
$error=0;
$modules = self::$modules;
+ $post = array();
if( isset($option['post']) ){
$post = $option['post'];
@@ -66,12 +67,7 @@
$list_languages=tep_get_languages();
$specimen = self::Specimen();
- // Put post value
- if(isset($option['post'])){
- $post=$option['post'];
- // Put post value
- $modules->load_post_values($post);
- }
+
$dataarray =(isset($option['sqlarray'])? $option['sqlarray'] : array() );
self::PrepaDataAfterUse( $specimen , $dataarray, $post );
Modified: trunk/catalog/admin/includes/classes/drivers/sqlextrafields.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlextrafields.php 2014-01-25 16:33:29 UTC (rev 5074)
+++ trunk/catalog/admin/includes/classes/drivers/sqlextrafields.php 2014-01-25 16:58:57 UTC (rev 5075)
@@ -54,11 +54,19 @@
$DB->beginTransaction();
if( count($sql_data_array) > 0){
+ if(!isset($sql_data_array['fields_input_type']))
+ $sql_data_array['fields_input_type'] = 0;
+
$sql_data_array['fields_value_list'] = ( in_array($sql_data_array['fields_input_type'], array(2,3,4,6,7) )? 1 : 0);
$sql_data_array['fields_type'] = self::$fields_type;
- if( ($res=tep_db_perform(TABLE_EXTRA_FIELDS, $sql_data_array) ) && !$res )
+
+ $res=tep_db_perform(TABLE_EXTRA_FIELDS, $sql_data_array);
+
+ if( ! $res )
$error++;
+ else
+ $id = $res->__get('insertId');
}
else
$error++;
@@ -69,7 +77,6 @@
return false;
}
else{
- $id = $res->__get('insertId');
$DB->commitTransaction();
return $id;
}
Modified: trunk/catalog/admin/includes/modules/configuration/modextra.php
===================================================================
--- trunk/catalog/admin/includes/modules/configuration/modextra.php 2014-01-25 16:33:29 UTC (rev 5074)
+++ trunk/catalog/admin/includes/modules/configuration/modextra.php 2014-01-25 16:58:57 UTC (rev 5075)
@@ -46,6 +46,13 @@
@var string current type data manipulate
*/
public static $data;
+
+ function __construct(){
+ $this->code= 'test';
+ self::$data = 'test';
+ $this->Init();
+ }
+
/**
*/
function Init(){
Modified: trunk/catalog/includes/languages/fr_FR/account.txt
===================================================================
--- trunk/catalog/includes/languages/fr_FR/account.txt 2014-01-25 16:33:29 UTC (rev 5074)
+++ trunk/catalog/includes/languages/fr_FR/account.txt 2014-01-25 16:58:57 UTC (rev 5075)
@@ -116,6 +116,7 @@
$lang['category extra fields'] = "Champs supplémenatires";
+
/* Action : PASSWORD */
$lang['@account my password title'] = "Mot de passe";
$lang['entry password current'] = "Actuel";
Modified: trunk/test/phpunit/Back/modules/pages/pagecategoriesTest.php
===================================================================
--- trunk/test/phpunit/Back/modules/pages/pagecategoriesTest.php 2014-01-25 16:33:29 UTC (rev 5074)
+++ trunk/test/phpunit/Back/modules/pages/pagecategoriesTest.php 2014-01-25 16:58:57 UTC (rev 5075)
@@ -14,9 +14,6 @@
global $base_path;
-// Echap test if not active
-if( ! DataTypes::is_active('categorie'))
- return false;
include_once($base_path.'includes/modules/pages/categories.php');
@@ -38,8 +35,22 @@
}
+ /**
+ @brief Check if datatype is actived
+ */
+ public function testActivedDataType(){
+ global $base_path, $path;
+
+ // Echap test if not active
+ if( ! DataTypes::is_active('categorie'))
+ $this->markTestSkipped(
+ 'datatype not actived'
+ );
+ }
+
/**
@brief test methode conf and static vars
+ @depends testActivedDataType
*/
public function testcategoriesConf(){
Modified: trunk/test/phpunit/Back/modules/pages/pagecustomersTest.php
===================================================================
--- trunk/test/phpunit/Back/modules/pages/pagecustomersTest.php 2014-01-25 16:33:29 UTC (rev 5074)
+++ trunk/test/phpunit/Back/modules/pages/pagecustomersTest.php 2014-01-25 16:58:57 UTC (rev 5075)
@@ -14,9 +14,6 @@
global $base_path;
-// Echap test if not active
-if( ! DataTypes::is_active('customers'))
- return false;
include_once($base_path.'includes/modules/pages/customers.php');
@@ -37,9 +34,23 @@
{
}
-
+
+ /**
+ @brief Check if datatype is actived
+ */
+ public function testActivedDataType(){
+ global $base_path, $path;
+
+ // Echap test if not active
+ if( ! DataTypes::is_active('customer'))
+ $this->markTestSkipped(
+ 'datatype not actived'
+ );
+ }
+
/**
@brief test methode conf and static vars
+ @depends testActivedDataType
*/
public function testcustomersConf(){
Modified: trunk/test/phpunit/Back/modules/pages/pageproductsTest.php
===================================================================
--- trunk/test/phpunit/Back/modules/pages/pageproductsTest.php 2014-01-25 16:33:29 UTC (rev 5074)
+++ trunk/test/phpunit/Back/modules/pages/pageproductsTest.php 2014-01-25 16:58:57 UTC (rev 5075)
@@ -14,9 +14,6 @@
global $base_path;
-// Echap test if not active
-if( ! DataTypes::is_active('product'))
- return false;
include_once($base_path.'includes/modules/pages/products.php');
@@ -40,19 +37,21 @@
}
/**
- @expectedException PHPUnit_Framework_Error
- */
-// public function testCheckIncludeBaseClassproducts()
-// {
-// global $base_path;
-// if( !include_once($base_path.'includes/modules/page/'.$this->forclass.'.php') )
-// $this->assertFalse(true , 'Class master file not exist');
-//
-//
-// }
+ @brief Check if datatype is actived
+ */
+ public function testActivedDataType(){
+ global $base_path, $path;
+
+ // Echap test if not active
+ if( ! DataTypes::is_active('product'))
+ $this->markTestSkipped(
+ 'datatype not actived'
+ );
+ }
/**
@brief test methode conf and static vars
+ @depends testActivedDataType
*/
public function testproductsConf(){
Modified: trunk/test/phpunit/Back/modules/pages/pagesfeaturedTest.php
===================================================================
--- trunk/test/phpunit/Back/modules/pages/pagesfeaturedTest.php 2014-01-25 16:33:29 UTC (rev 5074)
+++ trunk/test/phpunit/Back/modules/pages/pagesfeaturedTest.php 2014-01-25 16:58:57 UTC (rev 5075)
@@ -14,9 +14,8 @@
global $base_path;
-// Echap test if not active
-if( ! DataTypes::is_active('featured'))
- return false;
+
+
include_once($base_path.'includes/modules/pages/featureds.php');
@@ -36,22 +35,26 @@
function __construct()
{
-
}
- /**
- @brief test class depends childs specific module newsletters
+
+ /**
+ @brief Check if datatype is actived
*/
- public function testallmodulesgenericDepends(){
+ public function testActivedDataType(){
global $base_path, $path;
+
+ // Echap test if not active
+ if( ! DataTypes::is_active('featured'))
+ $this->markTestSkipped(
+ 'datatype not actived'
+ );
+ }
-// include_once(DIR_FS_CATALOG . DIR_WS_COMMON_CLASSES.'DatasFiles.php');
-// include_once(DIR_FS_CATALOG . DIR_WS_COMMON_CLASSES.'shippingUtility.php');
-// include_once(DIR_FS_CATALOG . DIR_WS_COMMON_CLASSES.'featured.php');
- }
/**
@brief test methode conf and static vars
+ @depends testActivedDataType
*/
public function testfeaturedsConf(){
Modified: trunk/test/phpunit/Back/sqlxxx/sqlfeaturedTest.php
===================================================================
--- trunk/test/phpunit/Back/sqlxxx/sqlfeaturedTest.php 2014-01-25 16:33:29 UTC (rev 5074)
+++ trunk/test/phpunit/Back/sqlxxx/sqlfeaturedTest.php 2014-01-25 16:58:57 UTC (rev 5075)
@@ -28,9 +28,24 @@
{
}
-
+
+ /**
+ @brief Check if datatype is actived
+ */
+ public function testActivedDataType(){
+ global $base_path, $path;
+
+ // Echap test if not active
+ if( ! DataTypes::is_active('featured'))
+ $this->markTestSkipped(
+ 'datatype featured not actived'
+ );
+ }
+
+
/**
@brief load Specimen and check result
+ @depends testActivedDataType
@return array
*/
public function testfeaturedSpecimen(){
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2014-01-25 16:33:34
|
Revision: 5074
http://sourceforge.net/p/oscss/svn/5074
Author: oscim
Date: 2014-01-25 16:33:29 +0000 (Sat, 25 Jan 2014)
Log Message:
-----------
Fix
Complet process for extra and simplify code
Fix Datatype test if is not active
Modified Paths:
--------------
trunk/catalog/admin/includes/classes/SqlFilesDataDriverClass.php
trunk/catalog/admin/includes/classes/drivers/sqlcategorie.php
trunk/catalog/admin/includes/classes/drivers/sqlextrafields.php
trunk/catalog/admin/includes/classes/drivers/sqlextrafieldsFactory.php
trunk/catalog/admin/includes/classes/drivers/sqlextrafieldsvalues.php
trunk/catalog/admin/includes/classes/listeners/ExtraFieldsListener.php
trunk/catalog/admin/includes/gabarit/configuration/modextrafields/draw.label.edit.gab
trunk/catalog/admin/includes/gabarit/configuration/modextrafields/draw.label.listing.gab
trunk/catalog/admin/includes/languages/fr_FR/ExtraFields.txt
trunk/catalog/admin/includes/modules/configuration/modextraaddressbook.php
trunk/catalog/admin/includes/modules/configuration/modextracontent.php
trunk/catalog/admin/includes/modules/configuration/modextracustomer.php
trunk/catalog/admin/includes/modules/configuration/modextraproduct.php
trunk/catalog/admin/includes/modules/pages/customers.php
trunk/catalog/admin/includes/modules/products/desc_base.php
trunk/test/phpunit/Back/modules/pages/pagecategoriesTest.php
trunk/test/phpunit/Back/modules/pages/pagecustomersTest.php
trunk/test/phpunit/Back/modules/pages/pageproductsTest.php
trunk/test/phpunit/Back/modules/pages/pagesfeaturedTest.php
Added Paths:
-----------
trunk/catalog/admin/includes/gabarit/configuration/modextrafields/draw.label.new.gab
trunk/catalog/admin/includes/gabarit/configuration/modextrafields/draw.value.delete.gab
trunk/catalog/admin/includes/gabarit/configuration/modextrafields/draw.value.edit.gab
trunk/catalog/admin/includes/modules/configuration/modextra.php
Modified: trunk/catalog/admin/includes/classes/SqlFilesDataDriverClass.php
===================================================================
--- trunk/catalog/admin/includes/classes/SqlFilesDataDriverClass.php 2014-01-25 11:02:22 UTC (rev 5073)
+++ trunk/catalog/admin/includes/classes/SqlFilesDataDriverClass.php 2014-01-25 16:33:29 UTC (rev 5074)
@@ -112,13 +112,13 @@
public static function ExtractDataForm($specimen, $data){
$sqlarray = array();
-
- if(!is_array($specimen))
+
+ if(!is_array($specimen) && !is_object($specimen) )
return $sqlarray;
foreach($specimen as $key=>$item){
if($key != self::$DataDriverType.'_id')
- if( (is_int($item) || is_bool($modele[$key])) && isset($data[$key]))
+ 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)){
// implements support for multi image in this data
Modified: trunk/catalog/admin/includes/classes/drivers/sqlcategorie.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlcategorie.php 2014-01-25 11:02:22 UTC (rev 5073)
+++ trunk/catalog/admin/includes/classes/drivers/sqlcategorie.php 2014-01-25 16:33:29 UTC (rev 5074)
@@ -13,7 +13,7 @@
require_once( DIR_FS_ADMIN . DIR_WS_CLASSES . 'SqlFilesDataDriverClass.php');
-error_reporting(E_ALL);
+
/**
@class sqlcategorie
*/
@@ -79,6 +79,8 @@
$sql_data_array = self::GetSqlArray();
+ $DB->beginTransaction();
+
if(count($sql_data_array) > 0){
if(isset($sql_data_array['categories_datatype']) && $sql_data_array['categories_datatype'] =='-1')
Modified: trunk/catalog/admin/includes/classes/drivers/sqlextrafields.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlextrafields.php 2014-01-25 11:02:22 UTC (rev 5073)
+++ trunk/catalog/admin/includes/classes/drivers/sqlextrafields.php 2014-01-25 16:33:29 UTC (rev 5074)
@@ -1,16 +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
@package osCSS-2 <www http://www.oscss.org>
- @version 2.1.2
+ @version 2.2.0
@date 13/12/2013, 15:46
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
*/
+require_once( DIR_FS_ADMIN . DIR_WS_CLASSES . 'SqlFilesDataDriverClass.php');
-
class sqlextrafields
+ extends SqlFilesDataDriverClass
implements ModSqlDataDriver{
/**
@@ -33,34 +34,45 @@
@brief create new ligne in table configuration
*/
public static function create($option){
+ $error = 0;
+ $DB=Database::getInstance();
+
- $sql_data_array['fields_type'] = self::$fields_type;
+
+ $specimen = self::Specimen(true);
+ $dataarray =(isset($option['sqlarray'])? $option['sqlarray'] : array() );
- if(isset($option['sort'])) $sql_data_array['fields_sort'] = $option['sort'];
- if(isset($option['status'])) $sql_data_array['fields_status'] = $option['status'];
- if(isset($option['value_list'])) $sql_data_array['fields_value_list'] = $option['value_list'];
- if(isset($option['active_value_language'])) $sql_data_array['fields_active_value_language'] = tep_db_prepare_input($option['active_value_language']);
+ self::PrepaDataAfterUse( $specimen , $dataarray, array() );
+ $_data_array = self::GetSqlArray();
- if(isset($option['key'])) $sql_data_array['fields_key'] = $option['key'];
- if(isset($option['admin'])) $sql_data_array['fields_admin'] = $option['admin'];
- if(isset($option['special_mod'])) $sql_data_array['fields_special_mod'] = $option['special_mod'];
- if(isset($option['group_class'])) $sql_data_array['fields_group_class'] = $option['group_class'];
+
+ $sql_data_array = array();
+ foreach($_data_array as $key=>$value)
+ $sql_data_array['fields_'.$key] = $value;
+
- if(isset($option['size'])) $sql_data_array['fields_size'] = $option['size'];
- if(isset($option['input_type'])) $sql_data_array['fields_input_type'] = $option['input_type'];
- if(isset($option['input_value'])) $sql_data_array['fields_input_value'] = $option['input_value'];
- if(isset($option['required_status'])) $sql_data_array['fields_required_status'] = $option['required_status'];
+ $DB->beginTransaction();
+
+ if( count($sql_data_array) > 0){
+ $sql_data_array['fields_value_list'] = ( in_array($sql_data_array['fields_input_type'], array(2,3,4,6,7) )? 1 : 0);
+
+ $sql_data_array['fields_type'] = self::$fields_type;
+ if( ($res=tep_db_perform(TABLE_EXTRA_FIELDS, $sql_data_array) ) && !$res )
+ $error++;
+ }
+ else
+ $error++;
+
- // special for customers
- if(isset($option['required_email'])) $sql_data_array['fields_required_email'] = $option['required_email'];
-
- $res=tep_db_perform(TABLE_EXTRA_FIELDS, $sql_data_array);
-
- if(!$res)
- return $res;
- else
- return $res->__get('insertId');
-
+ if( $error > 0){
+ $DB->rollbackTransaction();
+ return false;
+ }
+ else{
+ $id = $res->__get('insertId');
+ $DB->commitTransaction();
+ return $id;
+ }
}
@@ -83,29 +95,46 @@
$where .="AND fields_type = '".(string)self::$fields_type."' ";
- $sql_data_array = array();
+ $specimen = self::Specimen(true);
+ $dataarray =(isset($option['sqlarray'])? $option['sqlarray'] : array() );
+
+ self::PrepaDataAfterUse( $specimen , $dataarray, array() );
+ $_data_array = self::GetSqlArray();
+
+
+ $sql_data_array = array();
+ foreach($_data_array as $key=>$value)
+ $sql_data_array['fields_'.$key] = $value;
+
+
$DB->beginTransaction();
- if(isset($option['new_key'])) $sql_data_array['fields_key'] = $option['new_key'];
-
- if(isset($option['size'])) $sql_data_array['fields_size'] = $option['size'];
- if(isset($option['sort'])) $sql_data_array['fields_sort'] = $option['sort'];
- if(isset($option['input_type'])) $sql_data_array['fields_input_type'] = $option['input_type'];
- if(isset($option['input_value'])) $sql_data_array['fields_input_value'] = $option['input_value'];
- if(isset($option['required_status'])) $sql_data_array['fields_required_status'] = $option['required_status'];
-// if(isset($option['name'])) $sql_data_array['fields_name'] = $option['name'];
- if(isset($option['status'])) $sql_data_array['fields_status'] = $option['status'];
+// if(isset($option['new_key'])) $sql_data_array['fields_key'] = $option['new_key'];
+//
+// if(isset($option['size'])) $sql_data_array['fields_size'] = $option['size'];
+// if(isset($option['sort'])) $sql_data_array['fields_sort'] = $option['sort'];
+// if(isset($option['input_type'])) $sql_data_array['fields_input_type'] = $option['input_type'];
+// if(isset($option['input_value'])) $sql_data_array['fields_input_value'] = $option['input_value'];
+// if(isset($option['required_status'])) $sql_data_array['fields_required_status'] = $option['required_status'];
+// // if(isset($option['name'])) $sql_data_array['fields_name'] = $option['name'];
+// if(isset($option['status'])) $sql_data_array['fields_status'] = $option['status'];
+// // if(isset($option['required_email'])) $sql_data_array['fields_required_email'] = $option['required_email'];
+// // if(isset($option['key'])) $sql_data_array['fields_key'] = $option['key'];
+// if(isset($option['admin'])) $sql_data_array['fields_admin'] = $option['admin'];
+// if(isset($option['special_mod'])) $sql_data_array['fields_special_mod'] = $option['special_mod'];
+// if(isset($option['group_class'])) $sql_data_array['fields_group_class'] = $option['group_class'];
+//
+//
+// // special for customers
// if(isset($option['required_email'])) $sql_data_array['fields_required_email'] = $option['required_email'];
-// if(isset($option['key'])) $sql_data_array['fields_key'] = $option['key'];
- if(isset($option['admin'])) $sql_data_array['fields_admin'] = $option['admin'];
- if(isset($option['special_mod'])) $sql_data_array['fields_special_mod'] = $option['special_mod'];
- if(isset($option['group_class'])) $sql_data_array['fields_group_class'] = $option['group_class'];
-
- // special for customers
- if(isset($option['required_email'])) $sql_data_array['fields_required_email'] = $option['required_email'];
-
- if( ($res=tep_db_perform( TABLE_EXTRA_FIELDS, $sql_data_array, 'update' , substr($where,3) ) ) && !$res)
+ if( count($sql_data_array) > 0){
+// $sql_data_array['fields_type'] = self::$fields_type;
+
+ if( ($res=tep_db_perform( TABLE_EXTRA_FIELDS, $sql_data_array, 'update' , substr($where,3) ) ) && !$res)
+ $error++;
+ }
+ else
$error++;
if( $error > 0){
@@ -231,16 +260,13 @@
// champs
'fields_size' =>'',
- 'fields_input_type' =>'',
+ 'fields_input_type' =>0,
'fields_input_value' =>'',
'fields_required_status'=>0,
'fields_name' =>'',
// 'fields_required_email' =>0,
-
-
-
);
switch(self::$fields_type){
@@ -252,6 +278,18 @@
return ((!$shortkey)? $par : self::CleanKey($par));
}
+
+ /**
+ @fn ExtractForm($data)
+ @brief extract data forms for put in db
+ @param $data array
+ @return array
+ */
+ public static function ExtractForm($data){
+// new self();
+
+ return parent::ExtractDataForm(self::Specimen(true), $data);
+ }
}
Modified: trunk/catalog/admin/includes/classes/drivers/sqlextrafieldsFactory.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlextrafieldsFactory.php 2014-01-25 11:02:22 UTC (rev 5073)
+++ trunk/catalog/admin/includes/classes/drivers/sqlextrafieldsFactory.php 2014-01-25 16:33:29 UTC (rev 5074)
@@ -1,8 +1,8 @@
<?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
@package osCSS-2 <www http://www.oscss.org>
- @version 2.1.2
+ @version 2.2.0
@date 13/12/2013, 15:46
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
@@ -39,18 +39,13 @@
*/
public static function update($option){
- if(!isset($option['key']) && !isset($option['id']))
+ if(/*!isset($option['key']) &&*/ !isset($option['id']))
return false;
self::SetFieldType(self::$data);
return parent::update($option);
-
- self::SetFieldType(self::$data);
-
- return parent::update($option);
-
}
/**
Modified: trunk/catalog/admin/includes/classes/drivers/sqlextrafieldsvalues.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlextrafieldsvalues.php 2014-01-25 11:02:22 UTC (rev 5073)
+++ trunk/catalog/admin/includes/classes/drivers/sqlextrafieldsvalues.php 2014-01-25 16:33:29 UTC (rev 5074)
@@ -1,8 +1,8 @@
<?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
@package osCSS-2 <www http://www.oscss.org>
- @version 2.1.2
+ @version 2.2.0
@date 13/12/2013, 15:46
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
@@ -33,9 +33,9 @@
@brief
@return array product empty
*/
- public static function GetNewId($epf_id){
+ public static function GetNewId($fields_id){
$DB=Database::getInstance();
- $sql="SELECT MAX(value_id) as id FROM " . TABLE_EXTRA_FIELDS_VALUES . " a WHERE epf_id ='".(int)$epf_id."' GROUP BY languages_id LIMIT 1 ";
+ $sql="SELECT MAX(value_id) as id FROM " . TABLE_EXTRA_FIELDS_VALUES . " a WHERE fields_id ='".(int)$fields_id."' GROUP BY languages_id LIMIT 1 ";
$query= $DB->query($sql);
$res = $query->fetchAssoc();
@@ -49,21 +49,22 @@
public static function create($option){
self::getInstance();
- if(!isset($option['epf_id']))
- return 'epf_id';
+ if(!isset($option['fields_id']))
+ return 'fields_id';
if(!isset($option['value_id']))
- $sql_data_array['value_id'] =self::GetNewId($option['epf_id']);
+ $sql_data_array['value_id'] =self::GetNewId($option['fields_id']);
else
$sql_data_array['value_id'] = (int) tep_db_prepare_input($option['value_id']) ;
- $sql_data_array['epf_id'] = tep_db_prepare_input($option['epf_id']);
+ $sql_data_array['fields_id'] = tep_db_prepare_input($option['fields_id']);
$sql_data_array['languages_id'] =(isset($option['languages_id']))? tep_db_prepare_input($option['languages_id']) : 0;
+ $dataarray =(isset($option['sqlarray'])? $option['sqlarray'] : array() );
- $sql_data_array['epf_value'] =(isset($option['value'])) ? tep_db_prepare_input($option['value']) : '';
- $sql_data_array['parent_id'] =(isset($option['parent_id']))? tep_db_prepare_input($option['parent_id']): 0;
- $sql_data_array['sort_order'] =(isset($option['sort_order'])) ? tep_db_prepare_input($option['sort_order']) :0;
+ $sql_data_array['fields_value'] =(isset($dataarray['value'])) ? tep_db_prepare_input($dataarray['value']) : '';
+ $sql_data_array['parent_id'] =(isset($dataarray['parent_id']))? tep_db_prepare_input($dataarray['parent_id']): 0;
+ $sql_data_array['sort_order'] =(isset($dataarray['sort_order'])) ? tep_db_prepare_input($dataarray['sort_order']) :0;
$res=tep_db_perform(TABLE_EXTRA_FIELDS_VALUES, $sql_data_array);
@@ -80,23 +81,24 @@
public static function update($option){
self::getInstance();
- if(!isset($option['epf_id']))
+ if(!isset($option['fields_id']))
return false;
$sql ='';
if(isset($option['id'])) $sql .="AND value_id = '".(int)$option['id']."' ";
- if(isset($option['epf_id'])) $sql .="AND epf_id = '".(int)$option['epf_id']."' ";
+ if(isset($option['fields_id'])) $sql .="AND fields_id = '".(int)$option['fields_id']."' ";
if(isset($option['languages_id'])) $sql .="AND languages_id = '".(int)$option['languages_id']."' ";
if(isset($option['parent_id'])) $sql .="AND parent_id = '".(int)$option['parent_id']."' ";
if($sql=='')
return false;
+ $dataarray =(isset($option['sqlarray'])? $option['sqlarray'] : array() );
+
+ if(isset($dataarray['value'])) $sql_data_array['fields_value'] = tep_db_prepare_input($dataarray['value']);
+ if(isset($dataarray['sort_order'])) $sql_data_array['sort_order'] = tep_db_prepare_input($dataarray['sort_order']);
- if(isset($option['value'])) $sql_data_array['epf_value'] = tep_db_prepare_input($option['value']);
- if(isset($option['sort_order'])) $sql_data_array['sort_order'] = tep_db_prepare_input($option['sort_order']);
-
$res=tep_db_perform(TABLE_EXTRA_FIELDS_VALUES, $sql_data_array, 'update' , substr($sql,3) );
return $res;
@@ -129,7 +131,7 @@
$sql ="";
if(isset($option['id'])) $sql .="AND value_id = '".(int)$option['id']."' ";
- if(isset($option['epf_id'])) $sql .="AND epf_id = '".(int)$option['epf_id']."' ";
+ if(isset($option['fields_id'])) $sql .="AND fields_id = '".(int)$option['fields_id']."' ";
if(isset($option['languages_id'])) $sql .="AND languages_id = '".(int)$option['languages_id']."' ";
if(isset($option['parent_id'])) $sql .="AND parent_id = '".(int)$option['parent_id']."' ";
@@ -171,7 +173,7 @@
$sql ="";
if(isset($option['id'])) $sql .="AND value_id = '".(int)$option['id']."' ";
- if(isset($option['epf_id'])) $sql .="AND epf_id = '".(int)$option['epf_id']."' ";
+ if(isset($option['fields_id'])) $sql .="AND fields_id = '".(int)$option['fields_id']."' ";
if(isset($option['languages_id'])) $sql .="AND languages_id = '".(int)$option['languages_id']."' ";
if(isset($option['parent_id'])) $sql .="AND parent_id = '".(int)$option['parent_id']."' ";
@@ -189,12 +191,12 @@
*/
public static function Specimen($shortkey=false){
$par = array(
- 'value_id' => 0 ,
- 'epf_id' => 0,
- 'languages_id' => 0,
- 'parent_id' => 0,
- 'sort_order' => 0,
- 'epf_value' => '',
+ 'value_id' => (int)0 ,
+ 'fields_id' => (int)0,
+ 'languages_id' => (int)0,
+ 'parent_id' => (int)0,
+ 'sort_order' => (int)0,
+ 'fields_value' => (string)'',
);
return ((!$shortkey)? $par : self::CleanKey($par));
Modified: trunk/catalog/admin/includes/classes/listeners/ExtraFieldsListener.php
===================================================================
--- trunk/catalog/admin/includes/classes/listeners/ExtraFieldsListener.php 2014-01-25 11:02:22 UTC (rev 5073)
+++ trunk/catalog/admin/includes/classes/listeners/ExtraFieldsListener.php 2014-01-25 16:33:29 UTC (rev 5074)
@@ -1,16 +1,18 @@
<?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
@package osCSS-2 <www http://www.oscss.org>
- @version 2.1.2
+ @version 2.2.0
@date 13/12/2013, 15:46
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
- @class ExtraFieldsListener
+ @file ExtraFieldsListener.php
+ @dir admin/includes/classes/listeners/
+*/
+/**
+ @class ExtraFieldsListener
*/
-
-
class ExtraFieldsListener {
/**
@var current class call
@@ -29,10 +31,29 @@
*/
protected $id;
/**
+ @var int
+ list of possible value define in Class FieldsDisplay
+ 0 => 'input',
+ 1 => 'textarea',
+ 2 => 'radio',
+ 3 => 'checkbox',
+ 4 => 'select',
+ 5 => 'hidden',
+ 6 => 'select_multi',
+ 7 => 'checkbox_multi',
+ */
+ protected $input_type;
+ /**
@var current usesvaluelist
*/
protected $usesvaluelist;
/**
+ @var array all list values
+ */
+ protected $list_values;
+
+
+ /**
@var current activevaluelanguage
*/
protected $activevaluelanguage;
@@ -77,9 +98,9 @@
*/
protected $requiredstatus;
/**
- @var inputsize array
+ @var input_size array
*/
- protected $inputsize;
+ protected $input_size;
/**
@var groupclass array
*/
@@ -108,7 +129,49 @@
return $this->languageid;
}
+
+
+
/**
+ @fn GetListValues()
+ @brief Get Value
+ @return value
+ */
+ public function GetListValues(){
+ return $this->list_values;
+ }
+
+ /**
+ @fn SetListValues()
+ @brief Get Value
+ @param $list_values array
+ @return value
+ */
+ public function SetListValues($list_values){
+ $this->list_values = $list_values;
+ }
+
+ /**
+ @fn GetInputType()
+ @brief Get Value
+ @return value
+ @return int
+ */
+ public function GetInputType(){
+ return $this->input_type;
+ }
+
+ /**
+ @fn SetInputType($input_type)
+ @brief Get Value
+ @param $input_type int
+ @return none
+ */
+ public function SetInputType($input_type){
+ $this->input_type = $input_type;
+ }
+
+ /**
@fn SetLabel($label)
@param $label
*/
@@ -218,19 +281,19 @@
}
/**
- @fn SetInputSize($inputsize)
- @param $inputsize
+ @fn SetInputSize($input_size)
+ @param $input_size
*/
- public function SetInputSize($inputsize){
- $this->inputsize = $inputsize;
+ public function SetInputSize($input_size){
+ $this->input_size = $input_size;
}
/**
@fn GetInputSize())
- @return string $inputsize
+ @return string $input_size
*/
public function GetInputSize(){
- return $this->inputsize;
+ return $this->input_size;
}
/**
@@ -281,6 +344,7 @@
return $this->sort;
}
+
/**
@fn SetActiveValueLanguage($activevaluelanguage)
@param $activevaluelanguage
@@ -346,22 +410,22 @@
}
/**
- @fn SetFilename($filename)
- @param $filename
+ @fn SetList($list)
+ @param $list
*/
public function SetList($list){
$this->list = $list;
}
/**
- @fn GetFilename())
+ @fn GetList())
@return string $filename
*/
public function GetList(){
return $this->list;
}
/**
- @fn SetFilename($filename)
+ @fn SetGroupClass($groupclass)
@param $filename
*/
public function SetGroupClass($groupclass){
@@ -369,7 +433,7 @@
}
/**
- @fn GetFilename())
+ @fn GetGroupClass())
@return string $filename
*/
public function GetGroupClass(){
@@ -384,3 +448,164 @@
// }
}
+/**
+ @class ExtraFieldsValueListener
+*/
+class ExtraFieldsValueListener {
+ /**
+ @var int
+ */
+ protected $value_id;
+
+ /**
+ @var int fields id parent
+ */
+ protected $fields_id;
+
+ /**
+ @var int language id
+ */
+ protected $languages_id;
+
+ /**
+ @var int parent id reference is value_id
+ */
+ protected $parent_id;
+ /**
+ @var Sort array language_id=>(int)value
+ */
+ protected $sort_order = array();
+ /**
+ @var string value
+ */
+ protected $fields_value = array();
+
+ /**
+ @fn __construct($fields_id, $languages_id=0,$fields_value =array(), $sort_order=array())
+ @param $fields_id int
+ @param $languages_id int
+ @param $fields_value int
+ @param $sort_order int
+ @return none
+ */
+ public function __construct($fields_id){
+ $this->fields_id = $fields_id;
+ }
+ /**
+ @fn GetFieldsValue()
+ @brief Get Value
+ @return string value
+ */
+ public function GetFieldsValue($languages_id=0){
+ if(isset($this->fields_value[$languages_id]))
+ return $this->fields_value[$languages_id];
+
+ return '';
+ }
+
+ /**
+ @fn SetFieldsValue()
+ @brief Get Value
+ @param $fields_value string value
+ */
+ public function SetFieldsValue($fields_value,$languages_id=0){
+ $this->fields_value[$languages_id] = $fields_value;
+ }
+ /**
+ @fn GetSortOrder()
+ @brief Get Value
+ @return int value
+ */
+ public function GetSortOrder($languages_id=0){
+ if(isset($this->sort_order[$languages_id]))
+ return $this->sort_order[$languages_id];
+
+ return 0;
+ }
+
+ /**
+ @fn SetSortOrder()
+ @brief Get Value
+ @param $sort_order int Sort
+ */
+ public function SetSortOrder($sort_order,$languages_id=0){
+ $this->sort_order[$languages_id] = $sort_order;
+ }
+
+
+ /**
+ @fn GetParentId()
+ @brief Get Value
+ @return int value
+ */
+ public function GetParentId(){
+ return $this->parent_id;
+ }
+
+ /**
+ @fn SetParentId()
+ @brief Get Value
+ @param $parent_id int parent id reference is value_id
+ */
+ public function SetParentId($parent_id){
+ $this->parent_id = $parent_id;
+ }
+
+ /**
+ @fn GetLanguagesId()
+ @brief Get Value
+ @return int value
+ */
+ public function GetLanguagesId(){
+ return $this->languages_id;
+ }
+
+ /**
+ @fn SetLanguagesId()
+ @brief Get Value
+ @param $languages_id int language id
+ */
+ public function SetLanguagesId($languages_id){
+ $this->languages_id = $languages_id;
+ }
+
+ /**
+ @fn GetFieldsId()
+ @brief Get Value
+ @return int value
+ */
+ public function GetFieldsId(){
+ return $this->fieldname;
+ }
+
+ /**
+ @fn SetFieldsId()
+ @brief Get Value
+ @param $fieldname int fields id parent
+ */
+ public function SetFieldsId($fieldname){
+ $this->fieldname = $fieldname;
+ }
+ /**
+ @fn GetValueId()
+ @brief Get Value
+ @return value
+ */
+ public function GetValueId(){
+ return $this->value_id;
+ }
+
+ /**
+ @fn SetValueId()
+ @brief Get Value
+ @param $value_id
+ @return value
+ */
+ public function SetValueId($value_id){
+ $this->value_id = $value_id;
+ }
+}
+
+
+
+?>
\ No newline at end of file
Modified: trunk/catalog/admin/includes/gabarit/configuration/modextrafields/draw.label.edit.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/configuration/modextrafields/draw.label.edit.gab 2014-01-25 11:02:22 UTC (rev 5073)
+++ trunk/catalog/admin/includes/gabarit/configuration/modextrafields/draw.label.edit.gab 2014-01-25 16:33:29 UTC (rev 5074)
@@ -25,6 +25,9 @@
<ul>
<li><a href="#tabs-1"><?php echo __('tab base extra field'); ?></a></li>
<li><a href="#tabs-2"><?php echo __('tab advanced extra field'); ?></a></li>
+ <?php if((int)$EFL->GetUsesValueList()==1): ?>
+ <li><a href="#tabs-3"><?php echo __('tab list value extra field'); ?></a></li>
+ <?php endif; ?>
</ul>
@@ -51,7 +54,7 @@
<li>
<p class="block_input">
<label for="<?php echo 'label_' . $lg['id'] ?>" title="<?php echo __('entry label help') ?>"><?php echo __('entry label') ; ?></label>
- <?php echo tep_draw_input_field('fields_label[' . $lg['id'].']','label_' . $lg['id'], $EFL->GetLabel($lg['id']), "size=64 maxlength=64") ?>
+ <?php echo tep_draw_input_field('fields_label[' . $lg['id'].']','fields_label_' . $lg['id'], $EFL->GetLabel($lg['id']), "size=64 maxlength=64") ?>
</p>
</li>
<li>
@@ -64,7 +67,7 @@
<fieldset class="block_field">
<p class="block_input">
<label><?php echo __('entry sort order') ?></label>
- <?php echo tep_draw_input_field('sort_order','sort_order', /*(!empty($EFL->GetSort())?*/ $EFL->GetSort() /*: '0' )*/ ); ?>
+ <?php echo tep_draw_input_field('sort','sort', $EFL->GetSort() ); ?>
</p>
</fieldset>
@@ -75,14 +78,14 @@
<legend><?php echo __('legend check field') ?></legend>
<p class="block_input">
<label><?php echo __('text field required status') ?></label>
- <?php echo tep_draw_pull_down_menu('fields_required_status',array(array('id'=>0,'text'=>__('required status false')) ,array('id'=>1,'text'=>__('required status true')) ),(int)$EFL->GetRequiredStatus()) ?>
+ <?php echo tep_draw_pull_down_menu('required_status',array(array('id'=>0,'text'=>__('required status false')) ,array('id'=>1,'text'=>__('required status true')) ),(int)$EFL->GetRequiredStatus()) ?>
</p>
<p class="block_input">
- <label for="fields_size" title="<?php echo __('text field size help') ?>"><?php echo __('text field size min') ?></label>
- <?php echo tep_draw_input_field('fields_size','fields_size', $EFL->GetInputSize()) ?>
+ <label for="size" title="<?php echo __('text field size help') ?>"><?php echo __('text field size min') ?></label>
+ <?php echo tep_draw_input_field('size','size', $EFL->GetInputSize()) ?>
</p>
</fieldset>
<br />
@@ -104,7 +107,7 @@
<li>
<p class="block_input">
<label for="<?php echo 'format_' . $lg['id'] ?>" title="<?php echo __('entry label help') ?>"><?php echo __('entry label format') ; ?></label>
- <?php echo tep_draw_input_field('fields_format[' . $lg['id'].']','format_' . $lg['id'], $EFL->GetFormat($lg['id']), "size=64 maxlength=64") ?>
+ <?php echo tep_draw_input_field('fields_format[' . $lg['id'].']','fields_format_' . $lg['id'], $EFL->GetFormat($lg['id']), "size=64 maxlength=64") ?>
</p>
</li>
</ul>
@@ -131,8 +134,8 @@
<?php echo tep_draw_input_field('special_mod','special_mod', $EFL->GetSpecialMod()); ?>
</p>
<p class="block_input">
- <label for="fields_group_class" title="<?php echo __('text field input fields_group_class') ?>"><?php echo __('text field fields_group_class').tep_image(DIR_WS_ICONS . 'icon_help.gif') ?></label>
- <?php echo tep_draw_input_field('fields_group_class','fields_group_class', $EFL->GetGroupClass()) ?>
+ <label for="group_class" title="<?php echo __('text field input fields_group_class') ?>"><?php echo __('text field fields_group_class').tep_image(DIR_WS_ICONS . 'icon_help.gif') ?></label>
+ <?php echo tep_draw_input_field('group_class','group_class', $EFL->GetGroupClass()) ?>
</p>
<!-- <p class="block_input">
<label><?php //echo __('ENTRY_CHAIN') ?></label>
@@ -142,13 +145,51 @@
</fieldset>
</div>
+ <?php if((int)$EFL->GetUsesValueList()==1): ?>
+
+ <div id="tabs-3" class="tabPage">
+ <div class="button_nav">
+ <?php printf(CsrtAction::getLink('button_nav', __('button value add list') ), 'fancy', tep_href_link($EFL->GetFilename(), FILENAME_CFG. '&id=' . $EFL->GetId().'&action=value_new') ,'' );?>
+ </div>
+
+ <table class="dataTable" >
+ <thead>
+ <tr>
+ <th class="tcenter"><?php echo __('table heading id'); ?></th>
+ <th><?php echo __('table heading value'); ?></th>
+ <th class="tcenter"><?php echo __('table heading parent'); ?></th>
+ <th class="tcenter"><?php echo __('table heading order'); ?></th>
+ <th class="row_action"><?php echo __('table heading action'); ?></th>
+ </tr>
+ </thead>
+ <tbody>
+ <?php foreach ($EFL->GetListValues() as $k=>$value): ?>
+ <tr class="dataTableRow">
+ <td class="tcenter"><?php echo $value->value_id; ?></td>
+ <td><?php echo $value->fields_value; ?></td>
+ <td class="tcenter"><?php echo $value->parent_id; ?></td>
+ <td class="tcenter"><?php echo $value->sort_order; ?></td>
+ <td class="row_action">
+ <?php printf(
+ CsrtAction::getFormat('row_action'),
+ '' ,
+ sprintf(CsrtAction::getLink('row_action_right', IMAGE_EDIT, 'edit'), 'fancy', tep_href_link($EFL->GetFilename(), FILENAME_CFG.'&id=' . $EFL->GetId() . '&vid=' . $value->value_id . '&action=value_edit') ,'' ).
+ sprintf(CsrtAction::getLink('row_action_right', IMAGE_DELETE, 'delete'), 'fancy', tep_href_link($EFL->GetFilename(), FILENAME_CFG.'&id=' . $EFL->GetId(). '&vid=' . $value->value_id . '&action=value_delete') ,'' )
+ ) ?>
+ </tr>
+ <?php endforeach; ?>
+ </tbody>
+ </table>
+ <?php //var_dump($EFL->GetListValues() ); ?>
+ </div>
+ <?php endif; ?>
<br class="clear" />
</div>
<div class="button_nav">
- <?php echo tep_image_submit('button_save.gif', IMAGE_SAVE) . ' <a class="button" href="' . tep_href_link($EFL->GetFilename(), FILENAME_CFG. '&id=' . $EFL->GetId()) . '">' . IMAGE_BACK . "</a>\n" ?>
+ <?php echo tep_image_submit('button_save.gif', IMAGE_SAVE).tep_image_submit('', IMAGE_UPDATE_AND_CLOSE,' name="up_and_close"' ) . ' <a class="button" href="' . tep_href_link($EFL->GetFilename(), FILENAME_CFG. '&id=' . $EFL->GetId()) . '">' . IMAGE_BACK . "</a>\n" ?>
</div>
</div>
</form>
Modified: trunk/catalog/admin/includes/gabarit/configuration/modextrafields/draw.label.listing.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/configuration/modextrafields/draw.label.listing.gab 2014-01-25 11:02:22 UTC (rev 5073)
+++ trunk/catalog/admin/includes/gabarit/configuration/modextrafields/draw.label.listing.gab 2014-01-25 16:33:29 UTC (rev 5074)
@@ -62,6 +62,8 @@
<th class="tcenter"><?php echo __('table heading status'); ?></th>
<th class="tcenter"><?php echo __('table heading visibility'); ?></th>
<th class="tcenter"><?php echo __('table heading type'); ?></th>
+ <th class="tcenter"><?php echo __('table heading use list'); ?></th>
+ <th class="tcenter"><?php echo __('table heading active value language'); ?></th>
<th class="tcenter"><?php echo __('table heading spe module'); ?></th>
<th class="row_action"><?php echo __('table heading action'); ?></th>
</tr>
@@ -76,7 +78,7 @@
</td>
<td class="tcenter"><?php echo $epf['sort']; ?></td>
<td class="tcenter">
- <?php echo $epf['status']; ?>
+ <?php echo $epf['status']; ?>
</td>
<td class="tcenter">
<?php echo ExtraUtility::GetInputVisibility($epf['admin'], true); ?>
@@ -84,8 +86,13 @@
<td class="tcenter">
<?php echo ExtraUtility::GetInputType ($epf['input_type'], true ); ?>
</td>
-
<td class="tcenter">
+ <?php echo $epf['value_list']; ?>
+ </td>
+ <td class="tcenter">
+ <?php echo $epf['active_value_language']; ?>
+ </td>
+ <td class="tcenter">
<?php echo $epf['special_mod'] ?>
</td>
<td class="row_action">
Added: trunk/catalog/admin/includes/gabarit/configuration/modextrafields/draw.label.new.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/configuration/modextrafields/draw.label.new.gab (rev 0)
+++ trunk/catalog/admin/includes/gabarit/configuration/modextrafields/draw.label.new.gab 2014-01-25 16:33:29 UTC (rev 5074)
@@ -0,0 +1,55 @@
+<?php
+/**
+ @licence GPL 2005-2014 The osCSS developers - osCSS Open Source E-commerce
+ @package osCSS-2 <www http://www.oscss.org>
+ @version 2.2.0
+ @date 13/12/2013, 15:46
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+ @file draw.label.edit.gab
+ @dir /admin/includes/gabarit/configuration/modextrafiels
+*/
+global $EFL;
+?>
+
+<h3><?php echo __('heading title new label') ?></h3>
+ <?php echo tep_draw_form('field_entry',$EFL->GetFilename(), FILENAME_CFG. '&action=insert' , 'post'); ?>
+
+
+ <div class="block_form">
+
+ <fieldset class="block_field">
+ <label><?php echo __('entry type input simple') ?></label>
+ <ul class="block_input">
+ <li><?php echo tep_draw_radio_field('input_type','input_type', 0, true) . __('entry list type input') ?></li>
+ <li><?php echo tep_draw_radio_field('input_type','input_type', 1) . __('entry list type textarea') ?></li>
+ <li><?php echo tep_draw_radio_field('input_type','input_type', 2) . __('entry list type radio') ?></li>
+ <li><?php echo tep_draw_radio_field('input_type','input_type', 5) . __('entry list type hidden') ?></li>
+ </ul>
+
+
+ <ul class="block_input">
+ <li><?php echo tep_draw_radio_field('input_type','input_type', 3) . __('entry list type checkbox') ?></li>
+ <li><?php echo tep_draw_radio_field('input_type','input_type', 7) . __('entry list type checkbox multi') ?></li>
+ <li><?php echo tep_draw_radio_field('input_type','input_type', 4) . __('entry list type select') ?></li>
+ <li><?php echo tep_draw_radio_field('input_type','input_type', 6) . __('entry list type select multi') ?></li>
+ </ul>
+ </fieldset>
+
+ <fieldset class="block_field">
+ <p class="block_input">
+ <label for="active_value_language" title="<?php echo __('active value language help') ?>"><?php echo __('active value language') ?></label>
+ <?php echo tep_draw_radio_field('active_value_language' ,'active_value_language' , '1', (($EFL->GetActiveValueLanguage()==1)? true : false) ) . ' ' . __('text yes') .
+ ' ' . tep_draw_radio_field('active_value_language' ,'active_value_language', '0', (((int)$EFL->GetActiveValueLanguage()==0)? true : false) ) . ' ' . __('text no'); ?>
+ </p>
+ </fieldset>
+ <br class="clear" />
+<!-- </div> -->
+
+
+ <div class="button_nav">
+ <?php echo tep_image_submit('button_save.gif', IMAGE_SAVE) . ' <a class="button" href="' . tep_href_link($EFL->GetFilename(), FILENAME_CFG) . '">' . IMAGE_BACK . "</a>\n" ?>
+ </div>
+</div>
+</form>
+
Added: trunk/catalog/admin/includes/gabarit/configuration/modextrafields/draw.value.delete.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/configuration/modextrafields/draw.value.delete.gab (rev 0)
+++ trunk/catalog/admin/includes/gabarit/configuration/modextrafields/draw.value.delete.gab 2014-01-25 16:33:29 UTC (rev 5074)
@@ -0,0 +1,31 @@
+<?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 08/02/2012, 15:38
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+ @brief gabarit for listing extra fields products
+
+*/
+global $EFL, $EFVL;
+global $action, $languages;
+?>
+<h4><?php echo __('heading extra fields list delete value') ?></h4>
+
+
+
+<?php echo tep_draw_form('value_entry',$EFL->GetFilename(), FILENAME_CFG.'&action=value_deleteconfirm&id=' .$EFL->GetId() . '&vid=' . $EFVL->GetValueId(), 'post'); ?>
+
+
+ <div class="button_nav">
+
+ <?php echo tep_js_back(tep_href_link($EFL->GetFilename(), FILENAME_CFG.'&id='.$EFL->GetId().'&action=edit'), __('close') ); ?>
+
+ <?php echo tep_image_submit('button_save.gif', IMAGE_DELETE) ?>
+
+ </div>
+
+</form>
\ No newline at end of file
Added: trunk/catalog/admin/includes/gabarit/configuration/modextrafields/draw.value.edit.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/configuration/modextrafields/draw.value.edit.gab (rev 0)
+++ trunk/catalog/admin/includes/gabarit/configuration/modextrafields/draw.value.edit.gab 2014-01-25 16:33:29 UTC (rev 5074)
@@ -0,0 +1,80 @@
+<?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 08/02/2012, 15:38
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+ @brief gabarit for listing extra fields products
+
+*/
+global $EFL, $EFVL;
+global $action, $languages;
+?>
+<h4><?php echo __('heading extra fields list add value') ?></h4>
+
+
+
+<?php echo tep_draw_form('value_entry',$EFL->GetFilename(), FILENAME_CFG.'&action=' . (($action == 'value_new') ? 'value_insert' : 'value_update') . '&id=' .$EFL->GetId() . '&vid=' . $_GET['vid'], 'post'); ?>
+
+
+ <?php /** @remarks loop for language or mode no language and use language id = 0 */ ?>
+ <?php if( $EFL->GetActiveValueLanguage() > 0): ?>
+
+ <div class="tabs_lang">
+ <ul>
+ <?php $i = 0; foreach($languages as $row): ?>
+ <li><?php echo '<a href="#lang-' . ($i++).'" >' . tep_language_image( $row['directory'] . '/images/' . $row['image'], $row['name']) . ' ' . $row['name'] . '</a>' ?></li>
+ <?php endforeach; ?>
+ </ul>
+
+ <?php $i = 0; foreach($languages as $row): ?>
+
+ <fieldset id="<?php echo 'lang-'.($i++) ?>">
+ <p class="block_input">
+ <label for="<?php echo 'sort_order[' . $row['id'].']' ?>" title="<?php echo __('table heading order') ?>">
+ <?php echo __('table heading order'); ?>
+ </label>
+ <?php echo tep_draw_input_field('sort_order['.$row['id'].']','sort_order_'.$row['id'], $EFVL->GetSortOrder($row['id']) ) ; ?>
+ </p>
+
+ <p class="block_input">
+ <label for="<?php echo 'value[' . $row['id'].']' ?>" title="<?php echo __('table heading value') ?>">
+ <?php echo __('table heading value') ; ?>
+ </label>
+ <?php echo tep_draw_input_field('value['.$row['id'].']','value_'.$row['id'], $EFVL->GetFieldsValue($row['id']), 'size=64 maxlength=64'); ?>
+ </p>
+ </fieldset>
+
+ <?php endforeach; ?>
+
+ </div>
+
+
+ <?php else: ?>
+
+ <fieldset id="<?php echo 'lang-0' ?>">
+ <p class="block_input">
+ <label for="<?php echo 'sort_order[0]' ?>" title="<?php echo __('table heading order') ?>"><?php echo __('table heading order'); ?></label>
+ <?php echo tep_draw_input_field('sort_order[0]','sort_order_0',$EFVL->GetSortOrder(0)) ; ?>
+ </p>
+ <p class="block_input">
+ <label for="<?php echo 'value[0]' ?>" title="<?php echo __('table heading value') ?>"><?php echo __('table heading value') ; ?></label>
+ <?php echo tep_draw_input_field('value[0]','value_0', $EFVL->GetFieldsValue(0)); ?>
+ </p>
+ </fieldset>
+
+ <?php endif; ?>
+
+
+ <div class="button_nav">
+
+ <?php echo tep_js_back(tep_href_link($EFL->GetFilename(), FILENAME_CFG.'&id='.$EFL->GetId().'&action=edit'), __('close') ); ?>
+
+ <?php echo tep_image_submit('button_save.gif', IMAGE_SAVE) ?>
+
+ </div>
+
+</form>
\ 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-01-25 11:02:22 UTC (rev 5073)
+++ trunk/catalog/admin/includes/languages/fr_FR/ExtraFields.txt 2014-01-25 16:33:29 UTC (rev 5074)
@@ -1,11 +1,13 @@
<?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
@package osCSS-2 <www http://www.oscss.org>
- @version 2.1.2
+ @version 2.2.0
@date 13/12/2013, 15:46
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
+ @file ExtraFields.txt
+ @dir admin/includes/languages/fr_FR/
*/
@@ -19,6 +21,8 @@
$lang['table heading group class']="Class" ;
$lang['table heading type']="Type" ;
$lang['table heading id']="Id" ;
+ $lang['table heading use list']="Champ Fermé" ;
+ $lang['table heading active value language']="Valeur Unique" ;
$lang['table heading label']="Label" ;
$lang['table heading order']="Tri/Position" ;
$lang['table heading spe module']="Propriétaire" ;
@@ -26,12 +30,16 @@
/* Edit */
$lang['tab advanced extra field']="Réglages avancés" ;
$lang['tab base extra field']="Caractéristiques" ;
+ $lang['tab list value extra field']="Liste de valeurs" ;
$lang['legend check field']="Contrôle du formulaire" ;
$lang['entry label']="Label : " ;
$lang['entry label help']="Label : " ;
+
+ $lang['entry type input simple']="Type de champs : " ;
+ $lang['active value language']="Champs dont la(es) valeur(s) sont en plusieures langues : " ;
$lang['entry label format']="Format : " ;
$lang['entry label format help']="Exploiter le format afin d'organiser l'agencement de vos données default(%label% %input% %unit%)" ;
@@ -81,6 +89,9 @@
$lang['text display number of fields']="Afficher %s sur %s" ;
/* entry list */
+ $lang['text yes']="oui" ;
+ $lang['text no']="non" ;
+
$lang['required status true']="Actif" ;
$lang['required status false']="Inactif" ;
@@ -103,5 +114,13 @@
$lang['error create for extra fields label']=" Erreur lors de la creation du label du champ" ;
$lang['error create for extra fields label']=" Succes lors de la creation du label du champ" ;
-
+/* Values */
+ /* Listing */
+ $lang['button value add list']="Ajouter une valeur" ;
+ /* Edit */
+ $lang['heading extra fields list add value']="Ajouter / Editer une valeur" ;
+ $lang['table heading value']="Valeur" ;
+ $lang['required status true']="Actif" ;
+ /* Delete */
+ $lang['heading extra fields list delete value']="Supprimer une valeur" ;
?>
\ No newline at end of file
Added: trunk/catalog/admin/includes/modules/configuration/modextra.php
===================================================================
--- trunk/catalog/admin/includes/modules/configuration/modextra.php (rev 0)
+++ trunk/catalog/admin/includes/modules/configuration/modextra.php 2014-01-25 16:33:29 UTC (rev 5074)
@@ -0,0 +1,609 @@
+<?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 06/01/2014, 11:28
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+ @class modextracontent
+ @brief Champs supplementaire
+*/
+
+
+
+Class modextra{
+ const FILENAME = FILENAME_CONFIGURATION;
+ /**
+ @var object
+ */
+ public static $fInfo;
+ /**
+ @var object
+ */
+ public static $split;
+ /**
+ @var array
+ */
+ public static $list;
+ /**
+ @var int
+ */
+ public static $id;
+ /**
+ @var int
+ */
+ public static $fields_query_numrows;
+ /**
+ @var string current action
+ */
+ public static $action;
+ /**
+ @var object
+ */
+ public static $InitInfo;
+ /**
+ @var string current type data manipulate
+ */
+ public static $data;
+ /**
+ */
+ function Init(){
+ if(!defined('FILENAME_CFG'))
+ define('FILENAME_CFG',"gparentID=".$_GET['gparentID']."&gID=".$_GET['gID']);
+
+ global $messageStack, $language ,$oscss;
+ $oscss=oscss_cstr::getInstance();
+
+ $oscss->pile_file_lang(DIR_FS_ADMIN.DIR_WS_LANGUAGES.$language.'/ExtraFields.txt');
+ $oscss->pile_file_lang(DIR_FS_ADMIN.DIR_WS_LANGUAGES.$language.'/modules/configuration/'.$this->code.'.txt');
+
+ self::$id=(isset($_GET['id'])?$_GET['id']:'');
+ self::$action=(isset($_GET['action'])?$_GET['action']:'listing');
+
+ // instance Factory Extra
+ new sqlextrafieldsFactory(self::$data);
+
+ $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');
+
+
+ if(isset($_SESSION['filters'][__CLASS__]['language_id']))
+ $new_languages_id = $_SESSION['filters'] [__CLASS__]['language_id'];
+ else
+ $new_languages_id =$languages_id;
+
+ $_SESSION['filters']['language_id'] = $new_languages_id;
+
+ /**
+ @remarks Active forms filter
+ */
+ self::$InitInfo['tfilter']['listing']=array(
+ array(
+ 'title'=>__('@modprodextra filter tab clause'),
+ 'content'=>tep_get_include_contents('MGabCont/filter.language'),
+ ),
+ );
+ }
+
+
+ /**
+ @fn draw_action()
+ @brief Action en remplacement des action par defaut
+ */
+ public function draw_action(){
+ global $action,$messageStack;
+
+ $DB=Database::getInstance();
+
+ switch ($action) {
+
+ /**
+ @remarks specific save in session value filters
+ */
+ case 'filters':
+ $_SESSION['filters'] =array();
+
+ if(isset($_POST['filters']['language'] ) )
+ $_SESSION['filters'][__CLASS__]['language_id'] = (int)$_POST['filters']['language'];
+
+
+ tep_redirect(tep_href_link(self::FILENAME, FILENAME_CFG));
+ 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');
+
+ tep_redirect(tep_href_link(FILENAME_CONFIGURATION, FILENAME_CFG.'&action=edit&id=' . self::$id));
+ }
+
+
+ break;
+ case 'value_insert':
+ case 'value_update':
+ if (self::$id > 0) {
+
+ $ObjectEF= sqlextrafieldsFactory::fetch(array('id'=>self::$id), true);
+ $vid = (isset($_GET['vid']) ? $_GET['vid'] : 0 );
+ $array=array();
+
+ if( $ObjectEF->active_value_language > 0 ){
+ $list_languages=tep_get_languages();
+ $list = array();
+ foreach($list_languages as $lg) {
+ $marray = array(
+ 'languages_id'=>$lg['id'],
+ 'value'=>$_POST['value'][$lg['id']],
+ 'sort_order'=>$_POST['sort_order'][$lg['id']],
+ );
+ $list[] =$marray;
+ }
+ }
+ else{
+ $marray = array(
+ 'languages_id'=>0,
+ 'value'=>$_POST['value'][0],
+ 'sort_order'=>$_POST['sort_order'][0],
+ );
+
+ $list = array($marray);
+ }
+
+ foreach($list as $row) {
+ $array=array();
+ if($vid > 0)
+ $array['id']=$vid;
+
+ $array['fields_id']=self::$id;
+ $array['languages_id']=$row['languages_id'];
+ $array['sqlarray'] =array(
+ 'value'=>$row['value'],
+ 'sort_order'=>$row['sort_order'],
+ );
+
+ if ( $vid > 0 && ( $ObjectEFValue = sqlextrafieldsvalues::fetch(array('id'=>$vid, 'languages_id'=>$row['languages_id']))) && $ObjectEFValue !=false ){
+ if( ! sqlextrafieldsvalues::update( $array ) )
+ $error++;
+ }
+ else {
+ if( ! sqlextrafieldsvalues::create( $array ) )
+ $error++;
+ }
+ }
+
+ if( $error > 0)
+ $messageStack->add_session(__('error update for extra fields'), 'error');
+ else
+ $messageStack->add_session(__('succes update for extra fields'), 'success');
+
+
+ tep_redirect(tep_href_link(FILENAME_CONFIGURATION, FILENAME_CFG.'&action=edit&id=' . self::$id));
+ }
+
+ tep_redirect(tep_href_link(FILENAME_CONFIGURATION, FILENAME_CFG));
+ break;
+
+ case 'insert':
+ case 'update':
+
+ $array=array();
+ $array['sqlarray'] = sqlextrafieldsFactory::ExtractForm($_POST);
+
+ if (self::$id > 0){
+
+ if ( (bool)sqlextrafieldsFactory::fetch(array('id'=>self::$id)) ){
+ $sql_data_array['new_key']=$sql_data_array['key'];
+ unset($sql_data_array['key']);
+
+ $array=array();
+ $array['id']=self::$id;
+ $array['sqlarray'] = sqlextrafieldsFactory::ExtractForm($_POST);
+
+// print_r($array);
+// exit;
+ if( ! sqlextrafieldsFactory::update( $array ) )
+ $messageStack->add_session(__('error update for extra fields'), 'error');
+ else
+ $messageStack->add_session(__('succes update for extra fields'), 'success');
+ }
+ }
+ else{
+ if( ! $fields_id = sqlextrafieldsFactory::create( $array ) )
+ $messageStack->add_session(__('error create for extra fields'), 'error');
+ else{
+ self::$id = $fields_id;
+ $messageStack->add_session(__('succes create for extra fields'), 'success');
+ }
+ }
+
+ if(self::$id > 0) {
+ foreach( tep_get_languages() as $rows){
+ $language_id = $rows['id'];
+
+ $data_array = array(
+ 'id' => self::$id,
+ 'languages_id' => $language_id,
+ 'name' => tep_db_prepare_input($_POST['fields_label'][$language_id]),
+ 'format' => tep_db_prepare_input($_POST['fields_format'][$language_id]),
+ );
+
+ if(! sqlextrafieldslabels::fetch($data_array) ){
+ if( ! sqlextrafieldslabels::create($data_array) )
+ $messageStack->add_session(__('error create for extra fields label'), 'error');
+ else
+ $messageStack->add_session(__('succes create for extra fields label'), 'success');
+ }
+ else{
+ if (! sqlextrafieldslabels::update($data_array) )
+ $messageStack->add_session(__('error update for extra fields label'), 'error');
+ else
+ $messageStack->add_session(__('succes update for extra fields label'), 'success');
+ }
+ }
+
+
+ if(isset($_POST['up_and_close']) )
+ tep_redirect(tep_href_link(FILENAME_CONFIGURATION, FILENAME_CFG));
+ else
+ tep_redirect(tep_href_link(FILENAME_CONFIGURATION, FILENAME_CFG.'&action=edit&id=' . self::$id));
+ }
+
+ tep_redirect(tep_href_link(FILENAME_CONFIGURATION, FILENAME_CFG ));
+ break;
+
+ /**
+ @remarks quick action
+ */
+ case 'deleteconfirm':
+
+
+
+ $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 . "'");
+
+
+ sqlextrafieldsFactory::delete( array('id'=>$fields_id) );
+
+ tep_redirect(tep_href_link(FILENAME_CONFIGURATION, tep_get_all_get_params(array('action'),false) ));
+ break;
+
+ /**
+ @remarks quick action
+ */
+ case 'setflag':
+
+
+
+ if(isset($_GET['flag']) )
+ if( !sqlextrafieldsFactory::update(array('id'=>(int)self::$id ,'status'=>(int)tep_db_prepare_input($_GET['flag']) )) )
+ $messageStack->add_session(__('error update for extra fields'), 'error');
+
+ if(!isset($_GET['forceajax']))
+ tep_redirect(tep_href_link(FILENAME_CONFIGURATION, tep_get_all_get_params(array('action'),false)));
+ break;
+
+
+
+ }
+
+ }
+
+ /**
+ */
+ public function load_db_values(){
+ global $action,$languages_id,$messageStack;
+ $list = array();
+
+ $EFL = $this->EFL;
+
+
+ switch($action){
+ case 'value_delete':
+ $vid = (isset($_GET['vid']) ? $_GET['vid'] : 0 );
+ if($vid > 0){
+ $fields_value_list=sqlextrafieldsvalues::fetch(array('id'=>(int)$vid ), true);
+ $fields= sqlextrafieldsFactory::fetch(array('id'=>(int)self::$id ), true);
+
+
+ $EFVL = new ExtraFieldsValueListener(
+ (int)self::$id
+ );
+
+ $EFVL->SetValueId($vid);
+
+ $this->EFL->SetUsesValueList($fields->value_list);
+ $this->EFL->SetActiveValueLanguage($fields->active_value_language);
+
+ $Return = $EFVL;
+ }
+
+ break;
+ case 'value_new':
+ case 'value_edit':
+ $vid = (isset($_GET['vid']) ? $_GET['vid'] : 0 );
+ if($vid > 0){
+ $fields_value_list=sqlextrafieldsvalues::fetch(array('id'=>(int)$vid ), true);
+ $fields= sqlextrafieldsFactory::fetch(array('id'=>(int)self::$id ), true);
+ }
+ else{
+ $fields_value_list=sqlextrafieldsvalues::Specimen(true);
+ $fields= sqlextrafieldsFactory::fetch(array('id'=>(int)self::$id ), true);
+ }
+
+ if(is_array($fields_value_list))
+ $list = $fields_value_list;
+ else
+ $list = array ($fields_value_list) ;
+
+ $EFVL = new ExtraFieldsValueListener(
+ (int)self::$id
+ );
+ foreach($list as $row){
+ $EFVL->SetFieldsValue($row->fields_value, $row->languages_id);
+ $EFVL->SetSortOrder($row->sort_order, $row->languages_id);
+ }
+
+ if($vid > 0)
+ $EFVL->SetValueId($vid);
+
+ $this->EFL->SetUsesValueList($fields->value_list);
+ $this->EFL->SetActiveValueLanguage($fields->active_value_language);
+
+ $Return = $EFVL;
+ break;
+
+ break;
+ case 'new':
+ $fields=sqlextrafieldsFactory::Specimen(true);
+
+ foreach( tep_get_languages() as $rows){
+ $language_id = $rows['id'];
+ $fields->lg[$language_id] = new objectInfo(sqlextrafieldslabels::Specimen());
+ }
+
+ $EFL->SetInputType( (int)$fields->input_type );
+ $EFL->SetUsesValueList($fields->value_list);
+// $EFL->SetListValues($fields->list_values);
+ $EFL->SetActiveValueLanguage($fields->active_value_language);
+ $EFL->SetRequiredStatus((int)$fields->required_status );
+ $EFL->SetInputSize( (int) $fields->size );
+ $EFL->SetSort($fields->sort);
+ $EFL->SetAdmin($fields->admin);
+ $EFL->SetKey($fields->key);
+ $EFL->SetSpecialMod($fields->special_mod);
+ $EFL->SetGroupClass($fields->group_class);
+
+ $Return = $EFL;
+ break;
+
+ case 'delete':
+ case 'edit':
+ $res = sqlextrafieldsFactory::fetch(array('id'=>(int)self::$id ), true);
+
+ $r = sqlextrafieldslabels::fetch(array('id'=>(int)self::$id ));
+
+ if(!isset($r[0]))
+ $result[] = $r ;
+ else
+ $result = $r ;
+
+ foreach($result as $row)
+ $res->lg[$row['languages_id']] = new objectInfo($row);
+
+ if($res->active_value_language == 1)
+ $list = sqlextrafieldsvalues::fetch( array('fields_id'=>(int)self::$id, 'languages_id'=>$languages_id ), true );
+ else
+ $list = sqlextrafieldsvalues::fetch( array('fields_id'=>(int)self::$id ), true );
+ if( !$list )
+ $res->list_values = array();
+ else
+ if(is_object($list))
+ $res->list_values = array($list);
+ else
+ $res->list_values = $list;
+
+ $EFL->SetInputType( (int)$res->input_type );
+ $EFL->SetUsesValueList($res->value_list);
+ $EFL->SetListValues($res->list_values);
+ $EFL->SetActiveValueLanguage($res->active_value_language);
+ $EFL->SetRequiredStatus((int)$res->required_status );
+ $EFL->SetInputSize( (int) $res->size );
+ $EFL->SetSort($res->sort);
+ $EFL->SetAdmin($res->admin);
+ $EFL->SetKey($res->key);
+ $EFL->SetSpecialMod($res->special_mod);
+ $EFL->SetGroupClass($res->group_class);
+
+ $EFL->SetLabel($res->lg);
+ $EFL->SetFormat($res->lg);
+ $EFL->SetLanguageId($res->lg);
+ $EFL->SetUnityId($res->lg);
+ $EFL->SetUnityTypeId($res->lg);
+
+
+ $Return =$EFL;
+ break;
+
+ default:
+
+ self::$fields_query_numrows=0;
+ $this->fields_query_raw = "select ce.*, cei.* from " . TABLE_EXTRA_FIELDS . " ce, " . TABLE_EXTRA_FIELDS_LABELS . " cei WHERE ce.fields_type ='".self::$data."' AND cei.fields_id=ce.fields_id and cei.languages_id =" . (int)$languages_id;
+// self::$split = new splitPageResults($_GET['page'], MAX_DISPLAY_SEARCH_RESULTS, $this->fields_query_raw, self::$fields_query_numrows);
+ $this->fields_query = tep_db_query($this->fields_query_raw);
+
+ $listtmp=self::FormatDBValue($this->fields_query);
+ $EFL->SetList( $listtmp );
+
+ $Return = $EFL;
+ }
+
+ return (isset($Return)? $Return : false);
+ }
+
+ /**
+ Appelé dans le header de page
+ */
+ public static function draw_header(){
+ }
+
+ /**
+ Contenu central
+ */
+ public function draw(){
+ global $action,$gparentID,$current_theme, $EFL, $EFVL;
+
+
+
+
+// echo $action;
+ switch($action){
+ /**
+ @remarks Ajax View result
+ */
+ case 'setflag':
+ return self::get_item_status(new objectInfo(array('fields_status'=>(int)$_GET['flag'], 'fields_id'=>(int)$_GET['id'])) );
+ break;
+
+
+ /**
+ @remarks Normal View Page
+ */
+ case 'value_delete':
+ case 'value_new':
+ case 'value_edit':
+
+ $EFL = $this->EFL;
+ $EFVL = $this->load_db_values();
+
+ $languages = tep_get_languages();
+ $gab = 'value.'.substr($action, 6);
+ break;
+
+// $EFL = $this->load_db_values();
+//
+// $gab = 'label.'.'delete';
+// break;
+
+ case '':
+ $action = 'listing';
+ default:
+ $EFL = $this->load_db_values();
+ $languages = tep_get_languages();
+ $gab = 'label.'.$action;
+ }
+
+
+ /// use master gabarit
+ if(isset($gab))
+ return MGabCont::CallGab($gab,__FUNCTION__,'configuration/modextrafields');
+ else
+ return false;
+
+ }
+
+
+ /**
+ @brief format db value for display page
+ @param $_query ressource db sql
+ @return array
+ */
+ private static function FormatDBValue($_query){
+ $DB=Database::getInstance();
+ $res=array();
+
+ switch (self::$action) {
+ case 'listing':
+ ...
[truncated message content] |
|
From: <os...@us...> - 2014-01-25 11:02:26
|
Revision: 5073
http://sourceforge.net/p/oscss/svn/5073
Author: oscim
Date: 2014-01-25 11:02:22 +0000 (Sat, 25 Jan 2014)
Log Message:
-----------
Fix
Added Paths:
-----------
trunk/catalog/install/includes/sql/mysql/tables/osc_extra_fields_values.sql
Removed Paths:
-------------
trunk/catalog/install/includes/sql/mysql/tables/osc_extra_field_values.sql
Deleted: trunk/catalog/install/includes/sql/mysql/tables/osc_extra_field_values.sql
===================================================================
--- trunk/catalog/install/includes/sql/mysql/tables/osc_extra_field_values.sql 2014-01-25 09:53:10 UTC (rev 5072)
+++ trunk/catalog/install/includes/sql/mysql/tables/osc_extra_field_values.sql 2014-01-25 11:02:22 UTC (rev 5073)
@@ -1,27 +0,0 @@
---+######################################################################--+
---| osCSS Open Source E-commerce |
---+######################################################################--+
---| Copyright (c) 2005-2011 The osCSS developers |
---| |
---| http://www.oscss.org |
---| Portions Copyright (c) 2003 osCommerce |
---+######################################################################--+
---| This source file is subject to version 2.0 of the GPL license, |
---| available at the following url: |
---| http://www.oscss.org/ |
---+######################################################################--+
-
-
-drop table if exists osc_extra_field_values;
-CREATE TABLE osc_extra_field_values (
- value_id int(10) unsigned NOT NULL AUTO_INCREMENT,
- fields_id int(11) NOT NULL,
- languages_id int(11) NOT NULL,
- 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)
-) DEFAULT CHARSET=utf8 ;
-
-
Copied: trunk/catalog/install/includes/sql/mysql/tables/osc_extra_fields_values.sql (from rev 5070, trunk/catalog/install/includes/sql/mysql/tables/osc_extra_field_values.sql)
===================================================================
--- trunk/catalog/install/includes/sql/mysql/tables/osc_extra_fields_values.sql (rev 0)
+++ trunk/catalog/install/includes/sql/mysql/tables/osc_extra_fields_values.sql 2014-01-25 11:02:22 UTC (rev 5073)
@@ -0,0 +1,27 @@
+--+######################################################################--+
+--| osCSS Open Source E-commerce |
+--+######################################################################--+
+--| Copyright (c) 2005-2011 The osCSS developers |
+--| |
+--| http://www.oscss.org |
+--| Portions Copyright (c) 2003 osCommerce |
+--+######################################################################--+
+--| This source file is subject to version 2.0 of the GPL license, |
+--| available at the following url: |
+--| http://www.oscss.org/ |
+--+######################################################################--+
+
+
+drop table if exists osc_extra_field_values;
+CREATE TABLE osc_extra_field_values (
+ value_id int(10) unsigned NOT NULL AUTO_INCREMENT,
+ fields_id int(11) NOT NULL,
+ languages_id int(11) NOT NULL,
+ 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)
+) DEFAULT CHARSET=utf8 ;
+
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2014-01-25 09:53:14
|
Revision: 5072
http://sourceforge.net/p/oscss/svn/5072
Author: oscim
Date: 2014-01-25 09:53:10 +0000 (Sat, 25 Jan 2014)
Log Message:
-----------
Fix and clean code
Delete olds lignes
Add centralised methods for extrcat and display fields in listing and edit
Fix
Modified Paths:
--------------
trunk/catalog/admin/includes/classes/ModTwo.php
trunk/catalog/admin/includes/classes/SqlFilesDataDriverClass.php
trunk/catalog/admin/includes/classes/aca.php
trunk/catalog/admin/includes/classes/drivers/sqlcategorie.php
trunk/catalog/admin/includes/classes/drivers/sqlcontent.php
trunk/catalog/admin/includes/classes/drivers/sqlproduct.php
trunk/catalog/admin/includes/modules/categories/header_tags.php
trunk/catalog/admin/includes/modules/content/header_tags.php
trunk/catalog/admin/includes/modules/pages/adminUsers.php
trunk/catalog/admin/includes/modules/pages/categories.php
trunk/catalog/admin/includes/modules/pages/cms_content.php
trunk/catalog/admin/includes/modules/pages/currencies.php
trunk/catalog/admin/includes/modules/pages/products.php
trunk/catalog/admin/includes/modules/products/desc_base.php
trunk/catalog/admin/includes/modules/products/header_tags.php
trunk/catalog/common/class.interfaces.php
trunk/catalog/common/classes/AbstractHeader_tags.php
trunk/catalog/includes/classes/AbstractAcaModule.php
Modified: trunk/catalog/admin/includes/classes/ModTwo.php
===================================================================
--- trunk/catalog/admin/includes/classes/ModTwo.php 2014-01-24 12:47:29 UTC (rev 5071)
+++ trunk/catalog/admin/includes/classes/ModTwo.php 2014-01-25 09:53:10 UTC (rev 5072)
@@ -97,9 +97,13 @@
@var array $modules
*/
public static $list=array();
+ /**
+ @var array
+ is defined in GetExternalFieldsForFormat for calculate Row in submodule
+ and adjust by FormatDbValue in sub method by this submodule
+ */
+ protected static $CurrentExternal = array();
-
-
/**
@brief standart class exe action in module
If use "action" in var (POST or GET), this function is loaded
@@ -741,12 +745,143 @@
@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];
return false;
}
+
+
+ /**
+ @fn GetExternalFieldsForFormat($allfieldsexternal = array() )
+ @brief Calculate external fields and defined in submodule this data
+ @param $allfieldsexternal array list provider data
+ @return true Ok, False no subRow
+ */
+ protected static function GetExternalFieldsForFormat($allfieldsexternal = array() ){
+ $class=self::GetClassName();
+
+ $process = array();
+ foreach($allfieldsexternal as $key => $value ){
+ $clean = substr($key, (strpos($key, '.')+1));
+ $alias = (isset($value['alias'])? $value['alias'] : $clean);
+ $process[$alias] = $value['module'];
+ }
+
+ self::$CurrentExternal = $process;
+
+ if( count($process) > 0)
+ return true ;
+ else
+ return false;
+ }
+
+
+ /**
+ @fn FormatDBValueDefault($_query)
+ @brief format db value for display page
+ @param $_query ressource db sql
+ @return array
+ */
+ protected static function FormatDBValueDefault($_query){
+
+ $DB=Database::getInstance();
+ $class=self::GetClassName();
+ $res=array();
+
+ switch ($class::$action) {
+
+ case 'detail':
+ case 'new':
+ case 'delete':
+ case 'noedit':
+ case 'edit':
+ case 'copy_to':
+
+ default:
+ global $languages_id;
+
+ $ord =array();
+
+ if(is_object($_query)){
+ $res = new stdClass;
+ foreach($_query as $key=>$row) {
+ switch($key){
+ case 'lg':
+ foreach($row as $ke=>$ro){
+ foreach($ro as $k=>$r){
+ if( ($new_r = $class::GetEditFieldsDefine($k) ) && $new_r !=false ){
+ $new_r['input_value'][$ke] = $r;
+ $edit = 'edit_'.$k;
+ $res->$edit = new objectInfo($new_r);
+ }
+
+ $res->$k = $r;
+ }
+ }
+ break;
+ default:
+
+ if( ($new_r = $class::GetEditFieldsDefine($key) ) && $new_r !=false ){
+ $new_r['input_value'] = $row;
+ $edit = 'edit_'.$key;
+ $res->$edit = new objectInfo($new_r);
+ }
+
+ $res->$key = $row;
+ }
+ }
+ }
+ }
+
+ return $res;
+ }
+
+ /**
+ @fn FormatDBValueRow($key, $data)
+ @brief format generic call for specific key
+ @param $key string
+ @param $data array
+ @return false or value
+ */
+ public static function FormatDBValueRow($key, $data){
+
+ $DB=Database::getInstance();
+ $class=self::GetClassName();
+ $modules=$class::$modules;
+
+ switch ($class::$action) {
+ case 'listing':
+ // button action
+ if($key == 'action')
+ return $class::ButtonRowsActions($data);
+ // flag status
+ elseif($key == 'status')
+ return $class::RowStatus($data);
+ // flag hidden
+ elseif($key == 'hidden')
+ return $class::RowHidden($data);
+ // view ref image
+ 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') ) )
+ 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]) ){
+ $subclass = $modules->modules[self::$CurrentExternal[$key]];
+ return $subclass->formatdbvalue($key, $data);
+ }
+ break;
+
+ default:
+ return false;
+ }
+ }
+
/**
@brief return value Fields
@param $key string alias or name of field
@@ -801,6 +936,44 @@
/**
+ @fn ExtractValByName($key, $value)
+ @brief
+ @param $key string name or name[subname]
+ @param $value
+ */
+ public static function ExtractValByName($languages_id, $key, $value){
+ $finallg = $final = array();
+
+ $params = array();
+ $params['id'] = $_REQUEST['id'];
+
+ if(strpos( $key , '[' ) > 0){
+ $tab = explode('[', $key);
+ $tabs2 = array();
+ foreach($tab as $row)
+ $tabs2[] = ( (substr($row,-1)==']')?substr($row,0,-1) : $row );
+
+ $tabs3 = array_reverse($tabs2);
+ $i=0;
+ foreach($tabs3 as $row){
+ $i++;
+ if($i==1){
+ $final[$row] = (!empty($value) ? tep_db_prepare_input($value) : '');
+ $finallg[$row][$languages_id] = (!empty($value) ? tep_db_prepare_input($value) : '');
+ }
+ else{
+ $final[$row] = $final;
+ $finallg[$row] = $finallg;
+ }
+ }
+ }
+ else{
+ $final[$key] = (!empty($value) ? tep_db_prepare_input($value) : '');
+ }
+
+ return array_merge( $final, $finallg );
+ }
+ /**
@brief Display colum for all fields
@param $args array
*/
Modified: trunk/catalog/admin/includes/classes/SqlFilesDataDriverClass.php
===================================================================
--- trunk/catalog/admin/includes/classes/SqlFilesDataDriverClass.php 2014-01-24 12:47:29 UTC (rev 5071)
+++ trunk/catalog/admin/includes/classes/SqlFilesDataDriverClass.php 2014-01-25 09:53:10 UTC (rev 5072)
@@ -118,8 +118,8 @@
foreach($specimen as $key=>$item){
if($key != self::$DataDriverType.'_id')
- if(is_int($item) || is_bool($modele[$key]))
- $sqlarray[$key] = (isset($data[$key]) ? tep_db_prepare_input((int)$data[$key]) : $item);
+ if( (is_int($item) || is_bool($modele[$key])) && isset($data[$key]))
+ $sqlarray[$key] = (!empty($data[$key]) ? tep_db_prepare_input((int)$data[$key]) : $item);
elseif(is_string($item)){
// implements support for multi image in this data
// and possible delete by checkbox
@@ -148,18 +148,30 @@
else
$sqlarray[$key]='';
}
- else
+ elseif(isset($data[$key]) )
$sqlarray[$key] = (isset($data[$key]) ? tep_db_prepare_input((string)$data[$key]) : $item);
}
elseif(is_array($item)){
- foreach($item as $k=>$row)
- if(is_int($row[$k]) || is_bool($modele[$key]))
- $sqlarray[$key][$k] = (isset($data[$key][$k]) ? tep_db_prepare_input((int)$data[$key][$k]) : $row[$k]);
- elseif(is_string($row[$k]))
- $sqlarray[$key][$k] = (isset($data[$key][$k]) ? tep_db_prepare_input((string)$data[$key][$k]) : $row[$k]);
+
+ if( $key == 'lg' )
+ foreach($item as $language_id=>$arraylg)
+ foreach($arraylg as $subkey=>$value){
+ if( isset($specimen[$key][$language_id][$subkey] ) && isset($data[$key][$subkey][$language_id]) )
+ $sqlarray[$key][$subkey][$language_id] = (!empty($data[$key][$subkey][$language_id]) ? tep_db_prepare_input((string)$data[$key][$subkey][$language_id]) : $specimen[$key][1][$subkey] );
+ else
+ $sqlarray[$key][$subkey][$language_id] = $specimen[$key][$language_id][$subkey];
+ }
+ else
+ foreach($item as $k=>$row){
+ if( (is_int($row[$k]) || is_bool($specimen[$key])) && isset($data[$key][$k]) )
+ $sqlarray[$key][$k] = (!empty($data[$key][$k]) ? tep_db_prepare_input((int)$data[$key][$k]) : $row[$k]);
+ elseif(is_string($row[$k]) && isset($data[$key][$k]) )
+ $sqlarray[$key][$k] = (!empty($data[$key][$k]) ? tep_db_prepare_input((string)$data[$key][$k]) : $row[$k]);
+ }
+
}
+
}
-
return $sqlarray;
}
@@ -178,19 +190,25 @@
if(!is_array($item)){
if(isset($dataarray[$key]))
self::$sql_array[$key] = (!empty($dataarray[$key])) ? tep_db_prepare_input((string)$dataarray[$key]) : $item ;
- else{
- if(isset($post[$key]))
+ elseif(isset($post[$key]))
self::$sql_array[$key] = (!empty($post[$key])) ? tep_db_prepare_input((string)$post[$key]) : $item ;
- }
}
else{
foreach($item as $k=>$row){
- // obtain string value contain in specimen
- if(isset($dataarray[$key][$k]))
- self::$sql_array_lg[$k][$key] = (!empty($dataarray[$key][$k])) ? tep_db_prepare_input($dataarray[$key][$k]) : '' ;
- else{
- if(isset($post[$key][$key]))
- self::$sql_array_lg[$k][$key] = (!empty($post[$key][$k])) ? tep_db_prepare_input($post[$key][$k]) : '' ;
+ if($key =='lg')
+ foreach($row as $k1=>$r) {
+ if(isset($dataarray[$key][$k1][$k]))
+ self::$sql_array_lg[$key][$k1][$k] = (string)(!empty($dataarray[$key][$k1][$k])) ? tep_db_prepare_input($dataarray[$key][$k1][$k]) : '' ;
+ elseif(isset($post[$key][$k1][$k]))
+ self::$sql_array_lg[$key][$k1][$k] = (!empty($post[$key][$k1][$k])) ? tep_db_prepare_input($post[$key][$k1][$k]) : '' ;
+ }
+ else{
+ // obtain string value contain in specimen
+ if(isset($dataarray[$key][$k]))
+ self::$sql_array[$k][$key] = (!empty($dataarray[$key][$k])) ? tep_db_prepare_input($dataarray[$key][$k]) : '' ;
+ elseif(isset($post[$key][$key]))
+ self::$sql_array[$k][$key] = (!empty($post[$key][$k])) ? tep_db_prepare_input($post[$key][$k]) : '' ;
+
}
}
}
Modified: trunk/catalog/admin/includes/classes/aca.php
===================================================================
--- trunk/catalog/admin/includes/classes/aca.php 2014-01-24 12:47:29 UTC (rev 5071)
+++ trunk/catalog/admin/includes/classes/aca.php 2014-01-25 09:53:10 UTC (rev 5072)
@@ -53,7 +53,21 @@
}
}
}
+ /**
+ @brief Appel magic
+ @param $method string
+ @param $attrs array
+ */
+ public function __call($method, $attrs) {
+ $r=array();
+ foreach ($this->modules as $key=>$module) {
+ if (method_exists($module, $method )) /// control presence method
+ $r[$key]=$this->modules[$key]->$method($attrs);
+ }
+ return $r;
+ }
+
public function ret_modules ($action){ return $this->modules;}
public function display_view (&$contents){ return false;}
@@ -66,21 +80,39 @@
/**
+ @fn after_update ($generic_id)
+ @brief Process After Update for all submodule associed and activate
+ Call in submodule method
+ after_update($this->generic_id)
+
+ And for all language actiaved
+ after_update_lang($language_id, $this->generic_id)
+
+ @param $generic_id id for current data
+ @return $array result
+ if methode no return , is true
*/
public function after_update ($generic_id){
+ $result = array();
$this->generic_id=$generic_id;
foreach ($this->modules as $key=>$module) {
- if (($module->enabled) and (method_exists($module,'after_update' )))
- $this->modules[$key]->after_update($this->generic_id);
+ if (($module->enabled) and (method_exists($module,'after_update' ))){
+ $r = $this->modules[$key]->after_update($this->generic_id);
+ $result[]=(!empty($r) ? $r : true) ;
+ }
}
$languages = tep_get_languages();
for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
$language_id = $languages[$i]['id'];
foreach ($this->modules as $key=>$module) {
- if (($module->enabled) and (method_exists($module,'after_update_lang' )))
- $this->modules[$key]->after_update_lang($language_id, $this->generic_id);
+ if (($module->enabled) and (method_exists($module,'after_update_lang' ))){
+ $this->modules[$key]->after_update_lang($language_id, $this->generic_id);
+ $result[]=(!empty($r) ? $r : true) ;
+ }
}
}
+
+ return $result ;
}
@@ -149,20 +181,7 @@
protected function display_view(&$contents){}
- /**
- @brief Appel magic
- @param $method string
- @param $attrs array
- */
- public function __call($method, $attrs) {
- $r=array();
- foreach ($this->modules as $key=>$module) {
- if (method_exists($module, $method )) /// control presence method
- $r[$key]=$this->modules[$key]->$method($attrs);
- }
- return $r;
- }
/**
Modified: trunk/catalog/admin/includes/classes/drivers/sqlcategorie.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlcategorie.php 2014-01-24 12:47:29 UTC (rev 5071)
+++ trunk/catalog/admin/includes/classes/drivers/sqlcategorie.php 2014-01-25 09:53:10 UTC (rev 5072)
@@ -177,6 +177,7 @@
$sql_data_array = self::GetSqlArray();
+ $sql_data_array_lg = self::GetSqlArrayLg();
$DB->beginTransaction();
@@ -199,28 +200,19 @@
$error++;
}
-
-
- $categories_name_array = $post['categories']['categories_name'];
- $categories_desc_array = $post['categories']['categories_description'];
-// $sql_data_array = self::GetSqlArrayLg();
-
for ($i=0, $n=sizeof($list_languages); $i<$n; $i++) {
$language_id = (int)$list_languages[$i]['id'];
$sql_data_array = array();
- if(isset($categories_name_array[$language_id]) && !empty($categories_name_array[$language_id]))
- $sql_data_array['categories_name'] = tep_db_prepare_input($categories_name_array[$language_id]);
- elseif(!empty($categories_name_array) && is_string($categories_name_array))
- $sql_data_array['categories_name'] = tep_db_prepare_input($categories_name_array);
+ if(isset($sql_data_array_lg['lg']['categories_name'][$language_id]) && !empty($sql_data_array_lg['lg']['categories_name'][$language_id]))
+ $sql_data_array['categories_name'] = tep_db_prepare_input($sql_data_array_lg['lg']['categories_name'][$language_id]);
- if(isset($categories_desc_array[$language_id]) && !empty($categories_desc_array[$language_id]) )
- $sql_data_array['categories_description'] =tep_db_prepare_input($categories_desc_array[$language_id]);
- elseif(!empty($categories_desc_array) && is_string($categories_desc_array))
- $sql_data_array['categories_description'] = tep_db_prepare_input($categories_desc_array);
+ if(isset($sql_data_array_lg['lg']['categories_description'][$language_id][$language_id]) && !empty($sql_data_array_lg['lg']['categories_description'][$language_id]) )
+ $sql_data_array['categories_description'] =tep_db_prepare_input($sql_data_array_lg['lg']['categories_description'][$language_id]);
+
$tabl=$modules->get_update_table_categories_description ($list_languages[$i]['id']);
$sql_data_array = array_merge($sql_data_array, $tabl);
@@ -230,14 +222,10 @@
}
-// if ( !empty($_FILES['categories_image']['tmp_name']) ) {
-// $categories_image = new upload('categories_image', DIR_FS_CATALOG_IMAGES);
-// tep_db_query("update " . TABLE_CATEGORIES . " set categories_image = '" . tep_db_input($categories_image->filename) . "' where categories_id = '" . (int)$categories_id . "'");
-// }
-
-
/// Child module, Call After Update process
- $modules->after_update($id);
+ $res = $modules->after_update($id);
+// if(in_array(false, $res) )
+// $error++;
if( $error > 0){
@@ -308,74 +296,66 @@
$res=$DB->query($_sql);
$num = $res->__get('numRows');
+ $cInfo_array = array();
+ if($num == 1)
+ $cInfo_array[] = $res->fetchAssoc();
+ else
+ foreach($res->fetchAllAssoc() as $row)
+ $cInfo_array[] = $row;
+
- if($num == 1){
- $result = $res->fetchAssoc();
+ foreach($cInfo_array as $row) {
+
if($languages_id > 0)
- $check_q = $DB->query($sql="select * from " . TABLE_CATEGORIES_DESCRIPTION . " cd where categories_id = '" .(int) $result['categories_id'] . "' AND language_id = '".(int)$languages_id."' ");
+ $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
- $check_q = $DB->query($sql="select * from " . TABLE_CATEGORIES_DESCRIPTION . " cd where categories_id = '" .(int) $result['categories_id'] . "'");
+ $check_q = $DB->query($sql="select * from " . TABLE_CATEGORIES_DESCRIPTION . " cd where categories_id = '" .(int) $row['categories_id'] . "'");
+ $row['lg'] = array();
foreach($check_q->fetchAllAssoc() as $catlg){
- $result['categories_name'][$catlg['language_id']] = $catlg['categories_name'];
- $result['categories_description'][$catlg['language_id']] = $catlg['categories_description'];
+ $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'];
}
+
+ $datatypes = array_map('trim',explode(',',$row['categories_datatype']));
+ foreach($datatypes as $subrow)
+ if( DataTypes::is_active(trim($subrow)) ){
+ $chidlclass = 'sql'.$subrow;
+ $row['listcount'][$subrow] =$chidlclass::count_in_category((int) $row['categories_id']);
+ }
+ $row['listcount']['childs'] =categorieUtility::childs_in_category_count((int) $row['categories_id'] );
+ $row['cPath'] = categorieUtility::get_generated_category_path_ids( (int) $row['categories_id'] );
- $datatypes = array_map('trim',explode(',',$result['categories_datatype']));
- foreach($datatypes as $row)
- if( DataTypes::is_active(trim($row)) ){
- $chidlclass = 'sql'.$row;
- $result['listcount'][$row] =$chidlclass::count_in_category((int) $result['categories_id']);
- }
+ /// Childs module load
+
+ $row['mod'] = $modules->fetch(array('id'=>$row['categories_id'], 'shortkey'=>$shortkey));
+ // put all val origin module in current result
+ foreach($row['mod'] as $submod=>$array)
+ if(is_array($array))
+ foreach($array as $key=>$val)
+ $row[$key] = $val;
- $result['listcount']['childs'] =categorieUtility::childs_in_category_count((int) $result['categories_id'] );
- $result['cPath'] = categorieUtility::get_generated_category_path_ids( (int) $result['categories_id'] );
+ $result[] = $row;
+ }
- /// Childs module load
- $modules->load_db_values((int) $result['categories_id']);
-
- return ((!$shortkey)? $result : self::CleanKey($result));
+ if($num == 1){
+ return ((!$shortkey)? $result[0] : self::CleanKey($result[0])) ;
}
elseif($num > 1){
$array=array();
- foreach($res->fetchAllAssoc() as $result){
+ foreach($result as $lg)
+ $array[]= ((!$shortkey)? $lg : self::CleanKey($lg));
- if($languages_id > 0)
- $check_q = $DB->query($sql="select * from " . TABLE_CATEGORIES_DESCRIPTION . " cd where categories_id = '" .(int) $result['categories_id'] . "' AND language_id = '".(int)$languages_id."' ");
- else
- $check_q = $DB->query($sql="select * from " . TABLE_CATEGORIES_DESCRIPTION . " cd where categories_id = '" .(int) $result['categories_id'] . "'");
-
- foreach($check_q->fetchAllAssoc() as $catlg){
- $result['categories_name'][$catlg['language_id']] = $catlg['categories_name'];
- $result['categories_description'][$catlg['language_id']] = $catlg['categories_description'];
- }
-
-
- $datatypes = array_map('trim',explode(',',$result['categories_datatype']));
- foreach($datatypes as $row)
- if( DataTypes::is_active(trim($row)) ){
- $chidlclass = 'sql'.$row;
- $result['listcount'][$row] =$chidlclass::count_in_category((int) $result['categories_id']);
- }
-
-
- $result['listcount']['childs'] =categorieUtility::childs_in_category_count((int) $result['categories_id'] );
- $result['cPath'] = categorieUtility::get_generated_category_path_ids( (int) $result['categories_id'] );
-
- /// Childs module load
- $modules->load_db_values( (int) $result['categories_id'] );
-
- $array[]= ((!$shortkey)? $result : self::CleanKey($result));
- }
-
return $array;
}
-
return false;
}
@@ -536,9 +516,19 @@
@return array or object
*/
public static function Specimen($shortkey=false){
+ new self();
+ $modules = self::$modules;
+ $ListLanguages=tep_get_languages();
- $list_languages=tep_get_languages();
-
+ $tmp_lg = array();
+ for ($i=0, $n=sizeof($ListLanguages); $i<$n; $i++) {
+ $tmp_lg[$ListLanguages[$i]['id']] = array(
+ 'categories_name' => '', // depend language table
+ 'categories_description' => '', // depend language table
+ 'language_id' => $ListLanguages[$i]['id'],
+ );
+ }
+
$result = array(
'categories_id'=>0,
'categories_datatype'=>'product',
@@ -547,11 +537,16 @@
'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
);
- for ($i=0, $n=sizeof($list_languages); $i<$n; $i++) {
- $result['post']['categories_name'][$list_languages[$i]['id']]=$result['categories_name'][$list_languages[$i]['id']] = '';
- $result['post']['categories_description'][$list_languages[$i]['id']]=$result['categories_description'][$list_languages[$i]['id']] = '';
- }
return ((!$shortkey)? $result : self::CleanKey($result));
}
Modified: trunk/catalog/admin/includes/classes/drivers/sqlcontent.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlcontent.php 2014-01-24 12:47:29 UTC (rev 5071)
+++ trunk/catalog/admin/includes/classes/drivers/sqlcontent.php 2014-01-25 09:53:10 UTC (rev 5072)
@@ -140,7 +140,9 @@
$sql_data_array = self::GetSqlArray();
+ $sql_data_array_lg = self::GetSqlArrayLg();
+
$DB->beginTransaction();
@@ -161,15 +163,15 @@
$sql_data_array = array();
$language_id = $list_languages[$i]['id'];
- if(isset($post['cms_content']['content_text'][$language_id]) && !empty($post['cms_content']['content_text'][$language_id]) )
- $sql_data_array['content_text'] = tep_db_prepare_input($post['cms_content']['content_text'][$language_id]) ;
- elseif(isset($post['cms_content']['content_text']) && is_string($post['cms_content']['content_text']) )
- $sql_data_array['content_text'] = tep_db_prepare_input($post['cms_content']['content_text']) ;
+ if(isset($sql_data_array_lg['lg']['content_text'][$language_id]) && !empty($sql_data_array_lg['lg']['content_text'][$language_id]) )
+ $sql_data_array['content_text'] = tep_db_prepare_input($sql_data_array_lg['lg']['content_text'][$language_id]) ;
+// elseif(isset($post['cms_content']['content_text']) && is_string($post['cms_content']['content_text']) )
+// $sql_data_array['content_text'] = tep_db_prepare_input($post['cms_content']['content_text']) ;
- if(isset($post['cms_content']['content_title'][$language_id]) && !empty($post['cms_content']['content_title'][$language_id]) )
- $sql_data_array['content_title'] = tep_db_prepare_input($post['cms_content']['content_title'][$language_id]) ;
- elseif(isset($post['cms_content']['content_title']) && is_string($post['cms_content']['content_title']) )
- $sql_data_array['content_title'] = tep_db_prepare_input($post['cms_content']['content_title']) ;
+ if(isset($sql_data_array_lg['lg']['content_title'][$language_id]) && !empty($sql_data_array_lg['lg']['content_title'][$language_id]) )
+ $sql_data_array['content_title'] = tep_db_prepare_input($sql_data_array_lg['lg']['content_title'][$language_id]) ;
+// elseif(isset($post['cms_content']['content_title']) && is_string($post['cms_content']['content_title']) )
+// $sql_data_array['content_title'] = tep_db_prepare_input($post['cms_content']['content_title']) ;
$sql_data_array = array_merge($sql_data_array, $modules->get_update_table_content_description ($language_id));
@@ -294,7 +296,7 @@
$row = array_merge($row,$r);
- $row['mod'] = $modules->fetch(array('content_id'=>$row['content_id'], 'shortkey'=>$shortkey));
+ $row['mod'] = $modules->fetch(array('id'=>$row['content_id'], 'shortkey'=>$shortkey));
// put all val origin module in current result
foreach($row['mod'] as $submod=>$array)
@@ -377,9 +379,19 @@
@return array product empty
*/
public static function Specimen($shortkey=false){
+ new self();
+ $modules = self::$modules;
+ $ListLanguages=tep_get_languages();
- $list_languages=tep_get_languages();
-
+ $tmp_lg = array();
+ for ($i=0, $n=sizeof($ListLanguages); $i<$n; $i++) {
+ $tmp_lg[$ListLanguages[$i]['id']] = array(
+ 'content_title' => '', // depend language table
+ 'content_text' => '', // depend language table
+ 'language_id' => $ListLanguages[$i]['id'],
+ );
+ }
+
$result = array(
'content_id' => 0,
'content_name' => '',
@@ -387,12 +399,16 @@
'last_modified' => '',
'content_status' => '',
'categories' => array(),
+
+ 'lg' =>$tmp_lg,
+
+ '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']] = '';
- }
+// 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/sqlproduct.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlproduct.php 2014-01-24 12:47:29 UTC (rev 5071)
+++ trunk/catalog/admin/includes/classes/drivers/sqlproduct.php 2014-01-25 09:53:10 UTC (rev 5072)
@@ -368,7 +368,7 @@
//<!-- EOF Separate Pricing Per Customer -->
- $product['mod'] = $modules->fetch(array('products_id'=>$ID, 'shortkey'=>$shortkey));
+ $product['mod'] = $modules->fetch(array('id'=>$ID, 'shortkey'=>$shortkey));
// put all val origin module in current result
foreach($product['mod'] as $submod=>$array)
@@ -432,6 +432,20 @@
@return array product empty
*/
public static function Specimen($shortkey=false){
+ $modules = self::$modules;
+
+ $ListLanguages=tep_get_languages();
+
+ $tmp_lg = array();
+ for ($i=0, $n=sizeof($ListLanguages); $i<$n; $i++) {
+ $tmp_lg[$ListLanguages[$i]['id']] = array(
+ 'products_name' => '', // depend language table
+ 'products_description' => '', // depend language table
+ 'products_url' => '',
+ 'language_id' => $ListLanguages[$i]['id'],
+ );
+ }
+
$par = array(
'products_id' => '', // auto incremente
'products_type' => 0, // int (0 : default)
@@ -463,17 +477,13 @@
'manufacturers_id' => '',
'products_ordered' => 0,
- 'lg' =>array(
- array(
- 'products_name' => '', // depend language table
- 'products_description' => '', // depend language table
- 'products_url' => '',
- 'language_id' => 1,
- ),
- ),
+ // language table
+ 'lg' =>$tmp_lg,
- 'mod'=>array(), // other external sub module
+ 'mod'=>$modules->Specimen($shortkey), // other external sub module
);
+
+
return ((!$shortkey)? $par : self::CleanKey($par) );
}
Modified: trunk/catalog/admin/includes/modules/categories/header_tags.php
===================================================================
--- trunk/catalog/admin/includes/modules/categories/header_tags.php 2014-01-24 12:47:29 UTC (rev 5071)
+++ trunk/catalog/admin/includes/modules/categories/header_tags.php 2014-01-25 09:53:10 UTC (rev 5072)
@@ -150,12 +150,12 @@
*/
public function fetch($option){
- if(!isset($option[0]['categories_id']) ){
+ if(!isset($option[0]['id']) ){
$this->enabled = false;
return false;
}
- $id=$option[0]['categories_id'];
+ $id=$option[0]['id'];
$shortkey=$option[0]['shortkey'];
return $this->load_db_values((int)$id);
@@ -167,9 +167,12 @@
*/
function after_update($cat_id) {
+
self::$pInfo=parent::load_db_base($cat_id, 'cat');
- $myarray=array('page_type' => 'cat',
- 'page_id' => $cat_id);
+ $myarray=array(
+ 'page_type' => 'cat',
+ 'page_id' => $cat_id
+ );
if(isset(self::$pInfo->tag_id))tep_db_perform(TABLE_FULL_TAG, $myarray, 'update', " tag_id='".self::$pInfo->tag_id."'" );
else{
@@ -199,7 +202,7 @@
elseif(isset(self::$pArray->head_keywords_tag) && is_string(self::$pArray->head_keywords_tag))
$pInfo->head_keywords_tag = array($language_id=> self::$pArray->head_keywords_tag);
- parent::insert_db_values(self::$pInfo->tag_id,$action,self::$pInfo,$language_id);
+ parent::insert_db_values(self::$pInfo->tag_id,$action,$pInfo,$language_id);
}
/**
Modified: trunk/catalog/admin/includes/modules/content/header_tags.php
===================================================================
--- trunk/catalog/admin/includes/modules/content/header_tags.php 2014-01-24 12:47:29 UTC (rev 5071)
+++ trunk/catalog/admin/includes/modules/content/header_tags.php 2014-01-25 09:53:10 UTC (rev 5072)
@@ -153,7 +153,7 @@
*/
public function fetch($option){
- $id=$option[0]['content_id'];
+ $id=$option[0]['id'];
$shortkey=$option[0]['shortkey'];
return $this->load_db_values((int)$id);
Modified: trunk/catalog/admin/includes/modules/pages/adminUsers.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/adminUsers.php 2014-01-24 12:47:29 UTC (rev 5071)
+++ trunk/catalog/admin/includes/modules/pages/adminUsers.php 2014-01-25 09:53:10 UTC (rev 5072)
@@ -604,7 +604,7 @@
/**
@remarks retrun object load one inventaire
*/
- global $query_numrows, $languages_id;
+ global $languages_id;
$adjust=new objectInfo(self::$InitInfo['adjust']);
/**
@@ -699,59 +699,25 @@
switch (self::$action) {
case 'listing':
- global $query_numrows,$languages_id;
+ global $languages_id;
+
+ /* DEB Sub module add col */
+ self::GetExternalFieldsForFormat( self::$allfieldsexternal );
-
foreach($_query->fetchAllAssoc() as $item){
foreach(self::$InitInfo['modele']['listing'] as $k=>$row)
- if($k == 'action') $ord[$k]=self::ButtonRowsActions($item);
- elseif($k == 'status') $ord[$k]=self::RowStatus($item);
- else $ord[$k]=$item[$k];
+ if( ($value = self::FormatDBValueRow($k, $item)) && $value !=false )
+ $ord[$k]= $value;
+ else
+ $ord[$k]=$item[$k];
$res[]=$ord;
}
break;
- case 'new':
- case 'edit';
+
default:
- global $languages_id;
-
- $ord =array();
-
- if(is_object($_query)){
- $res = new stdClass;
- foreach($_query as $key=>$row) {
- switch($key){
- case 'lg':
- foreach($row as $ke=>$ro){
- foreach($ro as $k=>$r){
-
- if( ($new_r = self::GetEditFieldsDefine($k) ) && $new_r !=false ){
- $new_r['input_value'][$ke] = $r;
- $edit = 'edit_'.$k;
- $res->$edit = new objectInfo($new_r);
- }
-
- $res->$k = $r;
- }
- }
- break;
-
-// case 'barcode_type':
-
- default:
-
- if( ($new_r = self::GetEditFieldsDefine($key) ) && $new_r !=false ){
- $new_r['input_value'] = $row;
- $edit = 'edit_'.$key;
- $res->$edit = new objectInfo($new_r);
- }
-
- $res->$key = $row;
- }
- }
- }
+ $res = parent::FormatDBValueDefault($_query);
}
return $res;
@@ -761,7 +727,7 @@
@fn ButtonRowsActions($item)
@return string html
*/
- public static function ButtonRowsActions($item){
+ public static function ButtonRowsActions($item){
$left = '';
if(tep_action_check('new', self::FILENAME) || $_SESSION['login_id'] == $item['admin_id'])
@@ -783,7 +749,7 @@
@param $product array restuts row product
@return string html
*/
- private static function RowStatus($item){
+ public static function RowStatus($item){
$exclude=array('action','setflag','forceajax','cID','class','function','flag', 'mod');
$query_s='action=setflag&cID=' . $item['id'].'&flag=';
Modified: trunk/catalog/admin/includes/modules/pages/categories.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/categories.php 2014-01-24 12:47:29 UTC (rev 5071)
+++ trunk/catalog/admin/includes/modules/pages/categories.php 2014-01-25 09:53:10 UTC (rev 5072)
@@ -79,7 +79,11 @@
//! detail item in ajax
define('AJAXSTATMENTDETAIL', 'mod=page&type='.self::$code);
}
-
+
+
+ // instancie MLinkTo
+ MLinkTo::getInstance(self::$datatype);
+
/**
TODO : remplacer le nom de constante par un MODULE_CATEGORIES_INSTALLED_BO
*/
@@ -207,7 +211,7 @@
'default'=>true,
'width'=>'18%',
'edit'=>array(
- 'input_name'=>__CLASS__.'[categories_name]',
+ 'input_name'=>'lg[categories_name]',
// 'input_type'=>'textarea@advanced',
// 'input_size'=>'64',
// 'required_status'=>true,
@@ -221,7 +225,7 @@
// 'default'=>true,
'width'=>'18%',
'edit'=>array(
- 'input_name'=>__CLASS__.'[categories_description]',
+ 'input_name'=>'lg[categories_description]',
'input_type'=>'textarea@advanced',
// 'input_size'=>'64',
// 'required_status'=>true,
@@ -394,35 +398,12 @@
@remarks specific Ajax call
*/
case 'update_cell':
- try {
-
- $modele = array_keys(sqlcategorie::Specimen());
+ try {
$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['sqlarray'] = sqlcategorie::ExtractForm( self::ExtractValByName($languages_id, $_REQUEST['columnName'], $_REQUEST['value']) );
+
$params['action']=self::$action;
$params['language_id']= $languages_id;
@@ -485,25 +466,11 @@
*/
case 'insert':
- $params['sqlarray'] = array(
- 'sort_order' => (isset($_POST['sort_order'])) ? tep_db_prepare_input((int)$_POST['sort_order']) : 0 ,
- 'parent_id' => (isset($_POST['cPath'])) ? tep_db_prepare_input($_POST['cPath']) : 0,
- 'status' => (isset($_POST['categories_status'])) ? tep_db_prepare_input((int)$_POST['categories_status']) : 0,
- 'hidden' => (isset($_POST['categories_hidden'])) ? tep_db_prepare_input((int)$_POST['categories_hidden']) : 0 ,
- 'datatype' => (isset($_POST['categories_datatype'])&& $_POST['categories_datatype'] !='on') ? tep_db_prepare_input((string)$_POST['categories_datatype']) : '' ,
- 'cPath' => (isset($_POST['cPath'])) ? tep_db_prepare_input($_POST['cPath']) : 0,
- );
-
- if (!isset($_POST['categories_image_no']) && !empty($_POST['categories_image']) )
- $params['sqlarray']['categories_image']=sqlcategorie::AddImage(@$_POST['categories_image'], @$_POST['categories_image_no']);
- else
- $params['sqlarray']['categories_image']='';
-
-
- $params['action']=self::$action;
+ $params=array();
$params['post']=$_POST;
$params['language_id']= $languages_id;
-// $params['cPath']=(isset($_POST['cPath'])) ? tep_db_prepare_input($_POST['cPath']) : 0;
+ $params['sqlarray'] = sqlcategorie::ExtractForm($_POST);
+ $params['action']=self::$action;
$res = sqlcategorie::create($params);
@@ -531,23 +498,12 @@
case 'update':
- $params['sqlarray'] = array('sort_order' => (isset($_POST['sort_order'])) ? tep_db_prepare_input((int)$_POST['sort_order']) : 0 ,
- 'parent_id' => tep_db_prepare_input((int)@$_POST['cPath']),
- 'categories_status' => (isset($_POST['categories_status'])) ? tep_db_prepare_input((int)$_POST['categories_status']) : 0,
- 'categories_hidden' => (isset($_POST['categories_hidden'])) ? tep_db_prepare_input((int)$_POST['categories_hidden']) : 0 ,
- 'categories_datatype' => (isset($_POST['categories_datatype'])&& $_POST['categories_datatype'] !='on') ? tep_db_prepare_input((string)$_POST['categories_datatype']) : '' ,
- );
-
- if (!isset($_POST['categories_image_no']) && !empty($_POST['categories_image']) )
- $params['sqlarray']['categories_image']=sqlcategorie::AddImage(@$_POST['categories_image'], @$_POST['categories_image_no']);
- else
- $params['sqlarray']['categories_image']='';
-
-
- $params['id']=self::$Id;
- $params['action']=self::$action;
+ $params=array();
+ $params['id']= self::$Id;
$params['post']=$_POST;
$params['language_id']= $languages_id;
+ $params['sqlarray'] = sqlcategorie::ExtractForm($_POST);
+ $params['action']=self::$action;
$params['cPath']=(isset($_POST['cPath'])) ? tep_db_prepare_input($_POST['cPath']) : 0;
if (self::$action == 'insert')
@@ -698,7 +654,7 @@
/// Editeur Load
$oscss->_add_ext(BO_WISIWYG_SELECTED,'editeur/');
for ($i=0, $n=sizeof(self::$languages); $i<$n; $i++)
- echo $oscss->_call(BO_WISIWYG_SELECTED,'_top',__CLASS__.'[categories_description][' . self::$languages[$i]['id'] . ']','600','400');
+ echo $oscss->_call(BO_WISIWYG_SELECTED,'_top','lg[categories_description][' . self::$languages[$i]['id'] . ']','600','400');
break;
@@ -837,8 +793,9 @@
*/
public function display_view() {
$action=self::$action;
-
- switch(self::$action){
+ $MG= false;
+
+ switch($action){
/**
@remarks Ajax View result
*/
@@ -859,19 +816,18 @@
@remarks Normal View Page
*/
case 'new':
+ $MG = true;
$action='edit';
self::$Info=self::GetDBValue();
- /// use master gabarit
- return MGabCont::CallGab($action,__FUNCTION__,__CLASS__);
break;
+
case 'edit':
case 'noedit':
case 'new_light':
case 'delete':
case 'copy_to':
+ $MG = true;
self::$Info=self::GetDBValue();
- /// use master gabarit
- return MGabCont::CallGab(self::$action,__FUNCTION__,__CLASS__);
break;
default:
@@ -879,13 +835,16 @@
if(!empty(self::$actions['action_method']) )
$action='aca_actions';
else {
- self::$list=self::tep_get_list();
+ $MG = true;
$action='listing';
}
}
/// use master gabarit
- return MGabCont::CallGab($action,__FUNCTION__,self::MASTER);
+ if($MG)
+ return MGabCont::CallGab($action,__FUNCTION__,self::MASTER);
+ else
+ return MGabCont::CallGab($action,__FUNCTION__,__CLASS__);
}
/** public static InterfacedTJsonS */
@@ -985,21 +944,23 @@
$DB=Database::getInstance();
$res=array();
+ /* DEB Sub module add col */
+ self::GetExternalFieldsForFormat( self::$allfieldsexternal );
+
switch (self::$action) {
case 'listing':
- global $query_numrows,$languages_id;
+ global $languages_id;
while ($item = $_query->fetchAssoc()) {
$ord =array();
foreach(self::$InitInfo['modele']['listing'] as $k=>$row){
- if($k == 'action') $ord[$k]=self::ButtonRowsActions($item);
- elseif($k == 'status') $ord[$k]=self::RowStatus($item);
- elseif($k == 'hidden') $ord[$k]=self::RowHidden($item);
- elseif($k == 'image') $ord[$k]=(!empty($item['image'])) ? tep_info_image($item['image'], $item['name'], TEMP_BO_SMALL_IMAGE_WIDTH, TEMP_BO_SMALL_IMAGE_HEIGHT) : ' N/A';
- elseif($k == 'cPath') $ord[$k]=categorieUtility::get_generated_category_path_ids( $item['id']);
- elseif(in_array($k,array('added', 'modified') ) )$ord[$k]=((isset($item[$k]) && $item[$k] !='1000-01-01 00:00:00' )? tep_date_short($item[$k]) : '' );
- else $ord[$k]=$item[$k];
+ if( ($value = self::FormatDBValueRow($k, $item)) && $value !=false )
+ $ord[$k]= $value;
+ elseif($k == 'cPath')
+ $ord[$k]=categorieUtility::get_generated_category_path_ids( $item['id']);
+ else
+ $ord[$k]=$item[$k];
}
$item[1]=tep_draw_checkbox_field('action_multi['.$item['id'].']','action_mutli_'.$item['id'],$item['id']);
@@ -1009,46 +970,8 @@
}
break;
- case 'new':
- case 'edit';
default:
- global $languages_id;
-
- $ord =array();
-
- if(is_object($_query)){
- $res = new stdClass;
- foreach($_query as $key=>$row) {
- switch($key){
- case 'lg':
- foreach($row as $ke=>$ro){
- foreach($ro as $k=>$r){
-
- if( ($new_r = self::GetEditFieldsDefine($k) ) && $new_r !=false ){
- $new_r['input_value'][$ke] = $r;
- $edit = 'edit_'.$k;
- $res->$edit = new objectInfo($new_r);
- }
-
- $res->$k = $r;
- }
- }
- break;
-
-// case 'barcode_type':
-
- default:
-
- if( ($new_r = self::GetEditFieldsDefine($key) ) && $new_r !=false ){
- $new_r['input_value'] = $row;
- $edit = 'edit_'.$key;
- $res->$edit = new objectInfo($new_r);
- }
-
- $res->$key = $row;
- }
- }
- }
+ $res = parent::FormatDBValueDefault($_query);
}
return $res;
Modified: trunk/catalog/admin/includes/modules/pages/cms_content.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/cms_content.php 2014-01-24 12:47:29 UTC (rev 5071)
+++ trunk/catalog/admin/includes/modules/pages/cms_content.php 2014-01-25 09:53:10 UTC (rev 5072)
@@ -130,7 +130,7 @@
'width'=>'18%',
'edit'=>array(
// 'input_name'=>'content_title',
- 'input_name'=>__CLASS__.'[content_title]',
+ 'input_name'=>'lg[content_title]',
'input_type'=>'input',
'input_size'=>'64',
'required_status'=>true,
@@ -146,7 +146,7 @@
// 'default'=>true,
'width'=>'18%',
'edit'=>array(
- 'input_name'=>__CLASS__.'[content_text]',
+ 'input_name'=>'lg[content_text]',
'input_type'=>'textarea@advanced',
// 'input_size'=>'64',
// 'required_status'=>true,
@@ -328,7 +328,7 @@
public function check_action($actions){
- global $messageStack,$oscss;
+ global $messageStack,$oscss, $languages_id;
$DB=Database::getInstance();
self::$action=$actions;
@@ -370,33 +370,11 @@
throw new Exception(__('@cms_content ref is already used') ) ;
}
- $modele = array_keys(sqlcontent::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['sqlarray'] = sqlcontent::ExtractForm( self::ExtractValByName($languages_id, $_REQUEST['columnName'], $_REQUEST['value']) );
$params['action']=self::$action;
$params['language_id']= $languages_id;
@@ -479,6 +457,10 @@
*/
case 'insert':
try {
+ // force status si Post null after type select
+ if(!isset($_POST['content_status']))
+ $_POST['content_status'] = 0;
+
$params = array();
$params['sqlarray'] = sqlcontent::ExtractForm($_POST);
$content_id=sqlcontent::create($params);
@@ -569,12 +551,13 @@
if(count($res)==1)
tep_redirect(tep_href_link(self::FILENAME, 'action=insert&cID='));
break;
+
case 'edit':
/// Load wysiwyg
$oscss->_add_ext(BO_WISIWYG_SELECTED,'editeur/');
for ($i=0, $n=sizeof(self::$languages); $i<$n; $i++)
- echo $oscss->_call(BO_WISIWYG_SELECTED,'_top',__CLASS__.'[content_text][' . self::$languages[$i]['id'] . ']','600','400');
+ echo $oscss->_call(BO_WISIWYG_SELECTED,'_top','lg[content_text][' . self::$languages[$i]['id'] . ']','600','400');
break;
@@ -768,6 +751,7 @@
case 'delete':
$MG= true;
self::$Info=self::GetDBValue();
+
break;
case 'listing':
default:
@@ -910,8 +894,11 @@
switch (self::$action) {
case 'listing':
- global $query_numrows,$languages_id;
-
+ global $languages_id;
+ /* DEB Sub module add col */
+ self::GetExternalFieldsForFormat( self::$allfieldsexternal );
+
+
while ($item = $_query->fetchAssoc()) {
$ord =array();
@@ -929,11 +916,10 @@
$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($k == 'action') $ord[$k]=self::ButtonRowsActions($item);
- elseif($k == 'status') $ord[$k]=self::RowStatus($item);
- elseif($k == 'hidden') $ord[$k]=self::RowHidden($item);
- elseif(in_array($k,array('added', 'modified') ) )$ord[$k]=((isset($item[$k]) && $item[$k] !='1000-01-01 00:00:00' )? tep_date_short($item[$k]) : '' );
- else $ord[$k]=$item[$k];
+ if( ($value = self::FormatDBValueRow($k, $item)) && $value !=false )
+ $ord[$k]= $value;
+ else
+ $ord[$k]=$item[$k];
}
$ord[0]=$item['id'];
@@ -942,47 +928,9 @@
$res[]=$ord;
}
break;
- case 'new':
- case 'edit';
+
default:
- global $languages_id;
-
- $ord =array();
-
- if(is_object($_query)){
- $res = new stdClass;
- foreach($_query as $key=>$row) {
- switch($key){
- case 'lg':
- foreach($row as $ke=>$ro){
- foreach($ro as $k=>$r){
-
- if( ($new_r = self::GetEditFieldsDefine($k) ) && $new_r !=false ){
- $new_r['input_value'][$ke] = $r;
- $edit = 'edit_'.$k;
- $res->$edit = new objectInfo($new_r);
- }
-
- $res->$k = $r;
- }
- }
- break;
-
-// case 'barcode_type':
-
- default:
-
- if( ($new_r = self::GetEditFieldsDefine($key) ) && $new_r !=false ){
- $new_r['input_value'] = $row;
- $edit = 'edit_'.$key;
- $res->$edit = new objectInfo($new_r);
- }
-
- $res->$key = $row;
- }
- }
- }
-
+ $res = parent::FormatDBValueDefault($_query);
}
return $res;
Modified: trunk/catalog/admin/includes/modules/pages/currencies.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/currencies.php 2014-01-24 12:47:29 UTC (rev 5071)
+++ trunk/catalog/admin/includes/modules/pages/currencies.php 2014-01-25 09:53:10 UTC (rev 5072)
@@ -644,59 +644,22 @@
switch (self::$action) {
case 'listing':
- global $query_numrows,$languages_id;
+ global $languages_id;
-
foreach($_query->fetchAllAssoc() as $item){
foreach(self::$InitInfo['modele']['listing'] as $k=>$row)
- if($k == 'action') $ord[$k]=self::ButtonRowsActions($item);
- elseif($k == 'status') $ord[$k]=self::RowStatus($item);
- else $ord[$k]=$item[$k];
+ if( ($value = self::FormatDBValueRow($k, $item)) && $value !=false )
+ $ord[$k]= $value;
+ else
+ $ord[$k]=$item[$k];
$res[]=$ord;
}
break;
- case 'new':
- case 'edit';
+
default:
- global $languages_id;
-
- $ord =array();
-
- if(is_object($_query)){
- $res = new stdClass;
- foreach($_query as $key=>$row) {
- switch($key){
- case 'lg':
- foreach($row as $ke=>$ro){
- foreach($ro as $k=>$r){
-
- if( ($new_r = self::GetEditFieldsDefine($k) ) && $new_r !=false ){
- $new_r['input_value'][$ke] = $r;
- $edit = 'edit_'.$k;
- $res->$edit = new objectInfo($new_r);
- }
-
- $res->$k = $r;
- }
- }
- break;
-
-// case 'barcode_type':
-
- default:
-
- if( ($new_r = self::GetEditFieldsDefine($key) ) && $new_r !=false ){
- $new_r['input_value'] = $row;
- $edit = 'edit_'.$key;
- $res->$edit = new objectInfo($new_r);
- }
-
- $res->$key = $row;
- }
- }
- }
+ $res = parent::FormatDBValueDefault($_query);
}
return $res;
Modified: trunk/catalog/admin/includes/modules/pages/products.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/products.php 2014-01-24 12:47:29 UTC (rev 5071)
+++ trunk/catalog/admin/includes/modules/pages/products.php 2014-01-25 09:53:10 UTC (rev 5072)
@@ -846,33 +846,11 @@
throw new Exception(__('@products ref is already used') ) ;
}
- $modele = array_keys(sqlproduct::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['sqlarray'] = sqlproduct::ExtractForm( self::ExtractValByName($languages_id, $_REQUEST['columnName'], $_REQUEST['value']) );
$params['action']=self::$action;
$params['language_id']= $languages_id;
@@ -1604,65 +1582,12 @@
$action =( ($force_action !=false) ? $force_action : self::$action);
switch ($action) {
- case 'detail':
- case 'new':
- case 'delete':
- case 'noedit':
- case 'edit':
- case 'copy_to':
- global $languages_id;
-
- $ord =array();
-
- if(is_object($_query)){
- $res = new stdClass;
- foreach($_query as $key=>$row) {
- switch($key){
- case 'lg':
- foreach($row as $ke=>$ro){
- foreach($ro as $k=>$r){
-
- if( ($new_r = self::GetEditFieldsDefine($k) ) && $new_r !=false ){
- $new_r['input_value'][$ke] = $r;
- $edit = 'edit_'.$k;
- $res->$edit = new objectInfo($new_r);
- }
-
- $res->$k = $r;
- }
- }
- break;
-
-// case 'barcode_type':
-
- default:
-
- if( ($new_r = self::GetEditFieldsDefine($key) ) && $new_r !=false ){
- $new_r['input_value'] = $row;
- $edit = 'edit_'.$key;
- $res->$edit = new objectInfo($new_r);
- }
-
- $res->$key = $row;
- }
- }
- }
-
-
- break;
case 'listing':
- global $query_numrows,$languages_id, $price,$conf;
+ global $languages_id, $price,$conf;
/* DEB Sub module add col */
- $external = array();
- foreach(self::$allfieldsexternal as $key => $value ){
- $clean = substr($key, (strpos($key, '.')+1));
- $alias = (isset($value['alias'])? $value['alias'] : $clean);
- $external[] = $alias;
- $process[$alias] = $value['module'];
- }
- /* END Sub module add col */
+ self::GetExternalFieldsForFormat( self::$allfieldsexternal );
while ($item = $_query->fetchAssoc()) {
$ord =array();
@@ -1696,10 +1621,9 @@
foreach(self::$InitInfo['modele']['listing'] as $k=>$row){
-
- if($k == 'action') $ord[$k]=self::ButtonRowsActions($item);
+ if( ($value = self::FormatDBValueRow($k, $item)) && $value !=false )
+ $ord[$k]= $value;
elseif($k == 'title') $ord[$k]= '<a rel="'.tep_href_link('document.php', 'mod=img&typ=product&w=200&h=200&id='.$item['id']) .'" class="screenshot" href="#" title="" onclick="return false;">'.$item['title'].'</a>';
- elseif($k == 'status') $ord[$k]=self::RowStatus($item);
elseif($k == 'price') $ord[$k]= $price->format($item[$k], true) ;
elseif($k == 'price_gross'){
// if($conf->extends->CUSTOMERS_GROUPS->enabled && $item['customers_group_show_tax'] == 1)
@@ -1710,14 +1634,6 @@
// $ord[$k]= $price->format($item['price'] , true);
}
elseif($k == 'track_stock') $ord[$k]=status_name('track_stock' , $item['track_stock']);
-// elseif($k == 'hidden') $ord[$k]=self::RowHidden($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]) : '' );
- /* DEB Sub module add col */
- elseif( in_array($k, $external) ){
- $class = self::$modules->modules[$process[$k]];
- $ord[$k]= $class->formatdbvalue($k, $item);
- }
- /* END Sub module add col */
else $ord[$k]=$item[$k];
}
$ord[0]=$item['id'];
@@ -1727,6 +1643,9 @@
$res[]=$ord;
}
break;
+
+ default:
+ $res = parent::FormatDBValueDefault($_query);
}
return $res;
Modified: trunk/catalog/admin/includes/modules/products/desc_base.php
===================================================================
--- trunk/catalog/admin/includes/modules/products/desc_base.php 2014-01-24 12:47:29 UTC (rev 5071)
+++ trunk/catalog/admin/includes/modules/products/desc_base.php 2014-01-25 09:53:10 UTC (rev 5072)
@@ -184,7 +184,7 @@
*/
public function specimen($option){
- $id=$option[0]['products_id'];
+ $id=$option[0]['id'];
$shortkey=$option[0]['shortkey'];
return $this->load_db_values((int)$id);
Modified: trunk/catalog/admin/includes/modules/products/header_tags.php
===================================================================
--- trunk/catalog/admin/includes/modules/products/header_tags.php 2014-01-24 12:47:29 UTC (rev 5071)
+++ trunk/catalog/admin/includes/modules/products/header_tags.php 2014-01-25 09:53:10 UTC (rev 5072)
@@ -162,7 +162,7 @@
'shortkey' => boolean false
*/
public function fetch($option){
- $id=$option[0]['products_id'];
+ $id=$option[0]['id'];
$shortkey=$option[0]['shortkey'];
return $this->load_db_values((int)$id);
Modified: trunk/catalog/common/class.interfaces.php
===================================================================
--- trunk/catalog/common/class.interfaces.php 2014-01-24 12:47:29 UTC (rev 5071)
+++ trunk/catalog/common/class.interfaces.php 2014-01-25 09:53:10 UTC (rev 5072)
@@ -1,202 +1,270 @@
<?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 29/03/2012, 22:45
- @author oscim <mail aur...@os...> <www http://www.oscim.fr>
- @encode UTF-8
+ @licence GPL 2005-2014 The osCSS developers - osCSS Open Source E-commerce
+ @portion code Copyright (c) 2002 osCommerce
+ @package osCSS-2 <www http://www.oscss.org>
+ @version 2.2.0
+ @date 15/04/2012, 22:44
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
*/
+
/**
- @interface mod_aca
- @brief generic module aca
+ @Interface DataTypesData
+ @brief Base for Datatype Module
+ generic for all Datatype Module
*/
-interface mod_aca {
- public function load_db_values($Id);
- public function load_post_values($post);
+Interface DataTypesData{
+ /**
+ @brief sql for sitemap index
+ @param $mode le type de control (public)
+ @return true
+ */
+ function Sitemap($mode='public');
+
+ /**
+ @brief test si al page est du type produits
+ @param $mode le type de control (page/cpath/seo)
+ */
+ function is_type($mode='unique');
+
+ /**
+ @brief Prepare an retrun result Seo request
+ @param $mode string anchor key used
+ @param $subtype Not used
+ @param $id integer current id
+ @param $language_id integer current language id
+ @return array (
+ ID => '',
+ tName => '',
+ head_desc_tag => '',
+ head_keywords_tag =>''
+ )
+ */
+ public function SeoGetQuery($mode, $subtype, $id, $language_id);
+
+ /**
+ @fn FO_load_page($mode='unique')
+ @brief calcul du cpath specifique a ce type de donnée
+ @return
+ $mode
+ - default : none
+ - transversal : string page_content
+
+ */
+ function FO_load_page();
}
/**
- @interface ext_configuration
- @brief des modules configuration, pour en assurer la stabilité et coherance
- NOTE:: Tous les module de configuration utilisé doivent porter "implemen...
[truncated message content] |
|
From: <os...@us...> - 2014-01-24 12:47:32
|
Revision: 5071
http://sourceforge.net/p/oscss/svn/5071
Author: oscim
Date: 2014-01-24 12:47:29 +0000 (Fri, 24 Jan 2014)
Log Message:
-----------
Fix
Next dev for impleent Litener for data product
Add listener and implement for boxes and module no type
Add listener for moduletype
Modified Paths:
--------------
trunk/catalog/common/class.interfaces.php
trunk/catalog/common/classes/shoppingCart.php
trunk/catalog/includes/classes/AbstractAcaModule.php
trunk/catalog/includes/classes/core_page/account.php
trunk/catalog/includes/classes/core_page/listing.php
trunk/catalog/includes/classes/core_page/overlay/oscss_boxes.php
trunk/catalog/includes/classes/core_page/overlay/oscss_modules.php
trunk/catalog/includes/classes/drivers/DataListenerRowProduct.php
trunk/catalog/includes/classes/drivers/data/product.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/install/data/templates/appareil_photo/booststrap/template.php
trunk/catalog/templates/defaut/includes/gabarit/account/history_info.gab
trunk/catalog/templates/defaut/includes/gabarit/account/view.gab
trunk/catalog/templates/defaut/includes/js/address_book.js.php
Added Paths:
-----------
trunk/catalog/includes/classes/drivers/ModListenerRow.php
trunk/catalog/includes/classes/drivers/ModTypeListenerRow.php
Modified: trunk/catalog/common/class.interfaces.php
===================================================================
--- trunk/catalog/common/class.interfaces.php 2014-01-23 22:02:41 UTC (rev 5070)
+++ trunk/catalog/common/class.interfaces.php 2014-01-24 12:47:29 UTC (rev 5071)
@@ -1,270 +1,202 @@
<?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 15/04/2012, 22:44
- @author oscim <mail aur...@os...> <www http://www.oscim.fr>
- @encode UTF-8
+ @licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
+ @portion code Copyright (c) 2002 osCommerce
+ @package osCSS-2 <www http://www.oscss.org>
+ @version 2.1.1
+ @date 29/03/2012, 22:45
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
*/
-
/**
- @Interface DataTypesData
- @brief Base for Datatype Module
- generic for all Datatype Module
+ @interface mod_aca
+ @brief generic module aca
*/
-Interface DataTypesData{
- /**
- @brief sql for sitemap index
- @param $mode le type de control (public)
- @return true
- */
- function Sitemap($mode='public');
-
- /**
- @brief test si al page est du type produits
- @param $mode le type de control (page/cpath/seo)
- */
- function is_type($mode='unique');
-
- /**
- @brief Prepare an retrun result Seo request
- @param $mode string anchor key used
- @param $subtype Not used
- @param $id integer current id
- @param $language_id integer current language id
- @return array (
- ID => '',
- tName => '',
- head_desc_tag => '',
- head_keywords_tag =>''
- )
- */
- public function SeoGetQuery($mode, $subtype, $id, $language_id);
-
- /**
- @fn FO_load_page($mode='unique')
- @brief calcul du cpath specifique a ce type de donnée
- @return
- $mode
- - default : none
- - transversal : string page_content
-
- */
- function FO_load_page();
+interface mod_aca {
+ public function load_db_values($Id);
+ public function load_post_values($post);
}
/**
- @Interface DataTypesChildListing
- @brief Specific for childs datatype link to Rootlisting
+ @interface ext_configuration
+ @brief des modules configuration, pour en assurer la stabilité et coherance
+ NOTE:: Tous les module de configuration utilisé doivent porter "implements mod_configuration"
*/
-
-interface DataTypesChildListing {
-
-
- /**
- @brief Prepare an dgenere all cache for divers
- */
- public function SeoCacheQuery(/*$language_id*/);
+interface ext_configuration {
+ public function load_db_values($Id);
+ public function draw_action();
+ public static function draw_header();
+ public function draw();
}
-
/**
- @Interface DataTypesRootListing
- @brief Specific for Rootlisting Datatype
+ @interface ExtModPage
+ @brief Element obligatoire des module de type pages
+ Specific BO
*/
-Interface DataTypesRootListing{
- /**
- @brief calcul du cpath specifique a ce tyep de donnée
- */
- function GetcPath();
-
- /**
- @brief chargement des données transversal
- @param $listing object page driver listing
- @param $type string name childs type for listing
- @param subtype object childs DataType
- @return false KO , true OK
- */
- function FO_load_listing(listing $listing, DataTypesChildListing $subtype, $type);
+interface ExtModPage {
+ public static function load_db_values($ID);
+ public function display_view();
+ public function check_action($actions);
+ public function get_header();
}
-
-
-
/**
- @interface InterfaceModule
- @author oscim <mail aur...@os...> <www http://www.oscim.fr>
- Interface class pour tous les modules
+ @interface des module de page, utilisant l'ajax pour traiter le listing
*/
-Interface InterfaceModule {
- //! Force la classe implements à définir cette méthode
- public function check();
- public function install();
- public function remove();
- public function keys();
+Interface InterfacedTJsonS {
+ public static function tep_get_modele();
}
/**
- @interface InterfaceAcaProcess
- @author oscim <mail aur...@os...> <www http://www.oscim.fr>
- Interface class support moduel ACA specifique general
+ @interface des module de page, utilisant l'ajax afficher detail d'une ligne d'un point
*/
-Interface InterfaceAcaGene {
- //! Force la classe implements à définir cette méthode
- public function display_view($ID,$class='');
+Interface InterfacedInnerHtml {
+ public static function detail_row_page($ID);
}
-/**
- @interface InterfaceAcaProcess
- @author oscim <mail aur...@os...> <www http://www.oscim.fr>
- Interface class support moduel ACA specifique general
-*/
-Interface InterfaceAcaProcess {
-// public function get_header();
-}
-
/**
- @interface InterfaceAcaPayment
- @author oscim <mail aur...@os...> <www http://www.oscim.fr>
- Interface class support moduel ACA specifique general
+ @interface
*/
-Interface InterfaceAcaPayment {
- public function javascript_validation();
- public function selection();
- public function pre_confirmation_check();
- public function confirmation();
- public function process_button();
- public function before_process();
- public function after_process();
-// public function output_error();
- public function get_error();
+Interface InterfaceNewsletters {
+ public function get_content();
+ public function confirm();
+ public function send($max=20);
}
-/**
- @interface InterfaceAcaOrderTotal
- @author oscim <mail aur...@os...> <www http://www.oscim.fr>
- Interface class support moduel ACA specifique order total
-*/
-Interface InterfaceAcaOrderTotal {
- public function process();
-}
/**
- @interface InterfaceAcaOrderTotal
+ @interface IntModCronJob
+ @brief Interface for module type cronjob and Execution, base module ; Force function exists,
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
- Interface class support moduel ACA specifique order total
*/
-Interface InterfaceAcaShipping {
- public function quote($method = '');
- public function update_status($order);
+Interface IntModCronJob {
+ /**
+ @fn ClassExec()
+ @brief method call by cron file. this it THE METHODE CRON
+ */
+ public function ClassExec($value);
}
/**
- @interface InterfaceAccount
+ @interface IntModCronJobConfig
+ @brief Interface for module type cronjob and require extra fields configuration ; Force function exists,
+ Just for module cronjob for configuration possible
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
- @brief Interface class support module aca account, complement classic interface
- @note use in Frontend
*/
-Interface InterfaceAccount {
-// public function display_view_min_listMyAccount();
+Interface IntModCronJobConfig {
+ /**
+ @fn insert($post)
+ @brief method call by action insert in modules/page/cronjob , adjust extra for this module
+ @param $post array POST vars
+ @return $string serialise for extra db fields
+ */
+ public function insert($post);
+ /**
+ @fn update($post)
+ @brief method call by action update in modules/page/cronjob , adjust extra for this module
+ @param $post array POST vars
+ @return $string serialise for extra db fields
+ */
+ public function update($post);
+ /**
+ @brief methode return key config module
+ */
+ public function keys();
+ /**
+ @brief help for this module
+ @return string;
+ */
+ public function help();
+ /**
+ @fn Config($value)
+ @brief methode for complete config cronmodule, by use extra fields db
+ @param $value string serialized, extract in extar fields db
+ @return array for use lib.configuration.php functions
+ */
+ public function Config($value);
}
/**
- @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
+ @Interface DriversGraphs
+ @brief Force structure Drivers extends for construct img graphs
+ The module form is name: drivers_XXXX
+ depend class GraphUtility
*/
-Interface Interfacedata{
- public static function get_item($id);
- //! requete generic load db or cache
- public static function get_query($id='',$search='',$exclude='');
-
+Interface DriversGraphs {
+ /**
+ @brief load and conststrcu base call for PHPlot graphs
+ @param $Child string name grpah_stats Module type init
+ @param $option array option
+ @return path img
+ */
+ public function CallConfig($Child,$option=array());
+ /**
+ @fn $var->CallGraph();
+ @brief Call result construct graphs
+ @return path img or null
+ */
+ public function CallGraph();
}
-
/**
- @class DataStatmentFO
- @brief This class is master abstract class Data Statment FO by driverDataType
+ @interface ModGraphStatsData
+ @brief force structure of module Data type graph_stats
*/
-abstract class DataStatmentFO {
- /**
- @var $lg_id int
- */
- public static $lg_id;
- /**
- @var $obj_language query sql ressource result
- */
- public static $obj_language;
- /**
- @var $cache array cache result
- */
- public static $cache=array();
-
- // Force la classe étendue à définir cette méthode
- protected static function statment_query($content_query,$exclude='',$search=''){}
- protected static function add_where_query($add){}
- protected static function reset_query(){}
- protected static function cstr_query($orderby='', $limit='', $option=''){}
-
- // méthode commune
+Interface ModGraphStatsData{
/**
- */
- public static function start(){
- global $languages_id;
- self::$lg_id=(int)$languages_id;
- $DB=Database::getInstance();
- self::$obj_language = $DB->query("select code from " . TABLE_LANGUAGES . " where languages_id='" .self::$lg_id . "'");
- }
+ define var for use by externe call
+ @var nombre de status de order present
+ public $nbr_val;
+ @var tableau de couleur de status
+ public $les_color;
+ @var tableau de couleur de status
+ public $base_date;
+ @var calcul taille repere y
+ public $base_y;
+ @var title
+ public $title;
+ @var value array value
+ public $value;
- /**
- \brief delet item in cache
- \param $id integer id cat
+ This __construct is required !
*/
- public static function resetCacheId($id){
- foreach(self::$cache as $k=>$v)
- if($v==$id) {
- unset(self::$cache[$k]);
- }
- }
/**
- * \brief Mise en pile de toutes les element des page de cms
- * @param $id int
+ @brief construct thead table
+ return array for foreach boucle in display
*/
- public static function add_cache($id){
- self::$cache[]=$id;
- }
-
+ public function tep_get_th();
/**
- * \brief Appel et recup des element du cache
+ @brief construct array value for datatable display
+ Use by call dataTable ajax call (dataTable js module jquery)
+ return array data, for convert json
*/
- public static function in_cache(){
- return implode("," ,self::$cache);
- }
+ public function tep_get_list($page=1,$rowbyp=10,$sOrder='',$sWhere='',$options='');
+}
- /**
- Alias unique ID
- */
- public static function get_item($id,$option=array()){
- $db_list=self::get_query($id,'','',$option);
+/**
+ @interface ModSqlDataDriver
+ @brief Interface use in class/drivers/sqlxxxxx.php
+ Manipule data in table
+*/
+Interface ModSqlDataDriver {
+ public static function create($option);
+ public static function update($option);
+ public static function fetch($option,$shortkey=false);
+ public static function delete($option);
+ public static function CleanKey($array);
+}
- if(is_numeric($id) && isset($db_list[(int)$id])){
- return $db_list[$id];
- }else{
- $db_list=self::get_query('',$id);
- foreach($db_list as $item)
- if((string)$id==(string)$item->name)
- return $item;
- }
- return false;
- }
-}
+
+/**
+ @interface AbstractAccount
+ @brief Just define class for use module public configuration
+*/
+class AbstractAccount {}
?>
\ No newline at end of file
Modified: trunk/catalog/common/classes/shoppingCart.php
===================================================================
--- trunk/catalog/common/classes/shoppingCart.php 2014-01-23 22:02:41 UTC (rev 5070)
+++ trunk/catalog/common/classes/shoppingCart.php 2014-01-24 12:47:29 UTC (rev 5071)
@@ -222,13 +222,13 @@
if (!is_numeric($products_id) || !is_numeric($qty))
return;
- $product_obj=product::get_item($products_id);
+ $objectProduct=product::get_item($products_id);
- if(!$product_obj)
+ if(!$objectProduct)
return ;
- if(Stock::check_inline(array('quantity'=>$qty, 'id'=>$products_id, 'track_stock'=>$product_obj->track_stock, 'attributes'=>$attributes)) == true ){
+ if(Stock::check_inline(array('quantity'=>$qty, 'id'=>$products_id, 'track_stock'=>$objectProduct->GetTrackStock(), 'attributes'=>$attributes)) == true ){
$current = tep_get_products_stock( (int)$products_id,(array)$attributes );
//force qty if not enough stock
$qty = $current;
@@ -386,29 +386,29 @@
foreach($content as $products_id=>$product){
$pid = tep_get_prid($products_id);
- $product_obj=product::get_item($pid);
+ $objectProduct=product::get_item($pid);
- if($product_obj !=false){
- $prid = $product_obj->products_id;
+ if($objectProduct !=false){
+ $prid = $objectProduct->GetId();
$res_price=$price->get_products_price($products_id,(int)$product['qty']);
$special=( ($res_price['price_ht'] !=$res_price['sprice_ht'] && $res_price['sprice_ht']>0)? true : false);
$products_array[] = array('id' => $products_id,
- 'name' => $product_obj->products_name,
- 'type' => $product_obj->type,
- 'model' => $product_obj->products_model,
- 'image' => $product_obj->products_image,
- 'track_stock' => $product_obj->track_stock,
+ 'name' => $objectProduct->GetName(),
+ 'type' => $objectProduct->GetType(),
+ 'model' => $objectProduct->GetModel(),
+ 'image' => $objectProduct->GetImage(),
+ 'track_stock' => $objectProduct->GetTrackStock(),
'price' => (($special)? $res_price['sprice_ht'] :$res_price['price_ht']),
'quantity' => $product['qty'],
- 'weight' => $product_obj->products_weight +( isset($content[$products_id]['attributes']) ?(float)product::get_attributes_weight($products_id, $content[$products_id]['attributes']) : 0) ,
+ 'weight' => $objectProduct->GetWeight() +( isset($content[$products_id]['attributes']) ?(float)product::get_attributes_weight($products_id, $content[$products_id]['attributes']) : 0) ,
'final_price' => (($special)? $res_price['sprice_ht'] :$res_price['price_ht']),
'final_price_ttc' => (($special)? $res_price['sprice_ttc'] :$res_price['price_ttc']),
'total_line' => $res_price['total_line'],
'total_line_ttc' => $res_price['total_line_ttc'],
- 'tax_class_id' => $product_obj->products_tax_class_id,
+ 'tax_class_id' => $objectProduct->GetTaxClassId(),
'attributes' => (isset($content[$products_id]['attributes']) ? $content[$products_id]['attributes'] : ''),
'attributes_values' => (isset($content[$products_id]['attributes_values']) ? $content[$products_id]['attributes_values'] : ''),
Modified: trunk/catalog/includes/classes/AbstractAcaModule.php
===================================================================
--- trunk/catalog/includes/classes/AbstractAcaModule.php 2014-01-23 22:02:41 UTC (rev 5070)
+++ trunk/catalog/includes/classes/AbstractAcaModule.php 2014-01-24 12:47:29 UTC (rev 5071)
@@ -1,19 +1,26 @@
<?php if (!defined('HTTP_SERVER')) die('You can not access this file directly!');
/**
- @licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
+ @licence GPL 2005-2014 The osCSS developers - osCSS Open Source E-commerce
@portion code Copyright (c) 2002 osCommerce
@package osCSS-2 <www http://www.oscss.org>
@version 2.1.1
@date 14/03/2012, 18:17
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
- \file AbstractAcaModule.php
+ @file AbstractAcaModule.php
+ @dir includes/classes/
\brief
Ces classes sont les classes de base de l'appel des structure aca, elle ne sont appelé que par l'intermisiaire de class enfants
*/
require_once(DIR_FS_CATALOG . DIR_WS_COMMON . 'class.interfaces.php') ;
+
+require_once(DIR_FS_CATALOG . DIR_WS_CLASSES . 'drivers/ModTypeListenerRow.php');
+/**
+ @class DataTypeFactory
+ @brief Factory for master class data
+*/
Class DataTypeFactory{
public static $modules;
@@ -94,8 +101,8 @@
/**
- \class AbstractAcaModule
- \brief class d'appel des module aca
+ @class AbstractAcaModule
+ @brief class d'appel des module aca
*/
class AbstractAcaModule
{
@@ -132,10 +139,12 @@
if(!class_exists($class) && ( ($pathclass=page::fix_file(DIR_WS_MODULES . $folder.'/' . $file)) != false ) )
include($pathclass);
- if(!class_exists($class))
- trigger_error(sprintf(__CLASS__.' Could not load class %s', $class), E_USER_ERROR);
- else
+
+
+ if(class_exists($class))
$list_mod[]=$class;
+ elseif( OSCSS_DEBUG == true )
+ trigger_error(sprintf(__CLASS__.' Could not load class %s', $class), E_USER_ERROR);
}
}
}
@@ -330,10 +339,14 @@
*/
public function display_view($ID,$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($ID);
- return $this->modules[$class]->display_view($ID);
+
+ $array = $this->modules[$key]->display_view($ID);
+ $c= $this->FormatReturn($array);
+ return $c[0];
}
} else {
$c=array();
@@ -341,13 +354,64 @@
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($ID);
- $c[$key]=$this->modules[$key]->display_view($ID);
+
+ $array = $this->modules[$key]->display_view($ID);
+
+ $c = $this->FormatReturn($c, $array);
}
}
return $c;
}
}
+ /**
+ @param $array_return array result
+ @param $row current data for complet $array_return
+ */
+ private function FormatReturn($array_return, $row){
+ if(is_array($row))
+ foreach($row as $r){
+ if( is_object($r) ){
+ if(get_class($r) == 'ModTypeListenerRow')
+ $array_return[] = $r;
+ if(get_class($r) == 'objectInfo')
+ $array_return[] = $this->Convert($r);
+ }
+ }
+ else
+ if( is_object($row) ){
+ if(get_class($row) == 'ModTypeListenerRow')
+ $array_return[] = $row;
+ if(get_class($row) == 'objectInfo')
+ $array_return[] = $this->Convert($row);
+ }
+
+ return $array_return;
+ }
+
+ private function Convert(objectInfo $row){
+
+ if(isset($row->type)){
+ $sub = $row->conteneur[0];
+ $ModTypeRow = new ModTypeListenerRow(
+ $sub->title,
+ $sub->href
+ );
+ $ModTypeRow->SetRowType($row->type);
+ $ModTypeRow->SetContent($sub->content);
+ }
+ else{
+ $ModTypeRow = new ModTypeListenerRow(
+ $row->title,
+ ''
+ );
+
+ $ModTypeRow->SetContent($row->content);
+ }
+// var_dump($ModTypeRow);
+ return $ModTypeRow;
+ }
+
/**
* \brief Affiche module display_view mini
* @param $ID int cID le Id du customers
@@ -472,6 +536,7 @@
* @param $class string le nom de la class appelé, ou vide pour toutes les class enfants
*/
public function display_view($ID,$class=''){
+ var_dump(__file__, __function__);
global $page;
if (!empty($class)) {
if (isset($this->modules[$class]) && $this->modules[$class]->enabled and (method_exists($class, 'display_view' ))){
Modified: trunk/catalog/includes/classes/core_page/account.php
===================================================================
--- trunk/catalog/includes/classes/core_page/account.php 2014-01-23 22:02:41 UTC (rev 5070)
+++ trunk/catalog/includes/classes/core_page/account.php 2014-01-24 12:47:29 UTC (rev 5071)
@@ -84,61 +84,8 @@
}
}
- /**
- * \fn display_view($cID,$class='')
- * \brief Affiche module elemennt html
- cheche methode draw_html_xxx pour les sous modules et class enfants
- \li @a int cID le Id du customers
- \li @a string class le nom de la class appelé, ou vide pour toutes les class enfants
- */
- public function display_view($ID, $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($ID);
- return $this->modules[$class]->display_view($ID);
- }
- } else {
- $c=array();
- foreach ($this->modules as $key=>$module) {
- if (($module->enabled) and (method_exists($module, 'display_view' ))) {
- $this->modules[$key]->load_db_values($ID);
- $c[]=$this->modules[$key]->display_view($ID);
- }
- }
- return $c;
- }
- }
- /**
- * \fn display_view_min($cID,$class='')
- * \brief Affiche module display_view mini
- \li @a int cID le Id du customers
- \li @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;
- }
- }
-
-
-
-
/**
* \section Specifique Module
* */
Modified: trunk/catalog/includes/classes/core_page/listing.php
===================================================================
--- trunk/catalog/includes/classes/core_page/listing.php 2014-01-23 22:02:41 UTC (rev 5070)
+++ trunk/catalog/includes/classes/core_page/listing.php 2014-01-24 12:47:29 UTC (rev 5071)
@@ -350,31 +350,5 @@
}
- /**
- return_db_min 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 return_db_min($cID,$class=''){
- global $page;
- if (!empty($class)) {
- if (isset($this->modules[$class]) && $this->modules[$class]->enabled and (method_exists($module, 'return_db_min' ))){
- $this->modules[$class]->load_db_values($cID);
- return $this->modules[$class]->return_db_min($cID);
- }
- } else {
- $c=array();
- foreach ($this->modules as $key=>$module) {
- if (($module->enabled) and (method_exists($module, 'return_db_min' ))) {
- $this->modules[$key]->load_db_values($cID);
- $c[$key]=$this->modules[$key]->return_db_min($cID);
- }
- }
- return $c;
- }
- }
-
}
?>
\ No newline at end of file
Modified: trunk/catalog/includes/classes/core_page/overlay/oscss_boxes.php
===================================================================
--- trunk/catalog/includes/classes/core_page/overlay/oscss_boxes.php 2014-01-23 22:02:41 UTC (rev 5070)
+++ trunk/catalog/includes/classes/core_page/overlay/oscss_boxes.php 2014-01-24 12:47:29 UTC (rev 5071)
@@ -14,7 +14,7 @@
-// require_once(DIR_FS_CATALOG . DIR_WS_CLASSES . 'drivers/BoxesListenerRow.php');
+require_once(DIR_FS_CATALOG . DIR_WS_CLASSES . 'drivers/BoxesListenerRow.php');
/**
@class oscss_boxes
Modified: trunk/catalog/includes/classes/core_page/overlay/oscss_modules.php
===================================================================
--- trunk/catalog/includes/classes/core_page/overlay/oscss_modules.php 2014-01-23 22:02:41 UTC (rev 5070)
+++ trunk/catalog/includes/classes/core_page/overlay/oscss_modules.php 2014-01-24 12:47:29 UTC (rev 5071)
@@ -11,6 +11,13 @@
\note: Gestion de l'appel des modules (rep modules, noyau them plugin ou them module)
\brief load module not type
*/
+
+
+require_once(DIR_FS_CATALOG . DIR_WS_CLASSES . 'drivers/ModListenerRow.php');
+
+
+
+
class oscss_modules{
/**
Modified: trunk/catalog/includes/classes/drivers/DataListenerRowProduct.php
===================================================================
--- trunk/catalog/includes/classes/drivers/DataListenerRowProduct.php 2014-01-23 22:02:41 UTC (rev 5070)
+++ trunk/catalog/includes/classes/drivers/DataListenerRowProduct.php 2014-01-24 12:47:29 UTC (rev 5071)
@@ -63,8 +63,99 @@
*/
public $date_added;
/**
+ @var array
+ */
+ public $attrib=array();
+ /**
+ @var array
+ */
+ public $attributes=array();
+
+
+ /**
@brief define
+ @param $attrib array
*/
+ public function SetAttrib($attrib){
+ $this->attrib = $attrib;
+ }
+ /**
+ @brief Get
+ */
+ public function GetAttrib(){
+ return $this->attrib;
+ }
+
+ /**
+ @brief define
+ @param $type string
+ @param $uprid string
+ @param $value float
+ */
+ public function SetAttributes($type, $uprid, $value){
+ $this->attributes[$uprid][$type] = $value;
+ }
+ /**
+ @brief Get
+ @param $type string
+ @param $uprid string
+ */
+ public function GetAttributes($type, $uprid){
+ return @$this->attributes[$uprid][$type];
+ }
+
+ /**
+ @brief define
+ @param $uprid string
+ @param $stock float
+ */
+ public function SetAttributesStock($uprid, $stock){
+ $this->attributes[$uprid]['stock'] = $stock;
+ }
+ /**
+ @brief Get
+ @param $uprid string
+ */
+ public function GetAttributesStock($uprid){
+ return (float)@$this->attributes[$uprid]['stock'];
+ }
+
+ /**
+ @brief define
+ @param $uprid string
+ @param $weight float
+ */
+ public function SetAttributesWeight($uprid, $weight){
+ $this->attributes[$uprid]['weight'] = $weight;
+ }
+ /**
+ @brief Get
+ @param $uprid string
+ */
+ public function GetAttributesWeight($uprid){
+ return (float)@$this->attributes[$uprid]['weight'];
+ }
+
+ /**
+ @brief define
+ @param $uprid string
+ @param $price float price
+ */
+ public function SetAttributesPrice($uprid, $price){
+ $this->attributes[$uprid]['price'] = $price;
+ }
+ /**
+ @brief Get
+ @param $uprid string
+ */
+ public function GetAttributesPrice($uprid){
+ return (float)@$this->attributes[$uprid]['price'];
+ }
+
+
+ /**
+ @brief define
+ */
public function SetExternalUrl($external_url){
$this->external_url = $external_url;
}
Added: trunk/catalog/includes/classes/drivers/ModListenerRow.php
===================================================================
--- trunk/catalog/includes/classes/drivers/ModListenerRow.php (rev 0)
+++ trunk/catalog/includes/classes/drivers/ModListenerRow.php 2014-01-24 12:47:29 UTC (rev 5071)
@@ -0,0 +1,127 @@
+<?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 ModListenerRow.php
+*/
+
+
+
+/**
+ @Interface DataListenerRowInterface
+ @note used by drivers/data/xxx in frontoffice
+
+*/
+Interface ModListenerRowInterface{
+ /**
+ @fn GetHref()
+ @return string
+ */
+ public function GetHref();
+ /**
+ @fn GetTitle()
+ @return string
+ */
+ public function GetTitle();
+ /**
+ @fn GetName()
+ @return string
+ */
+ public function GetName();
+
+ public function GetContent();
+}
+
+
+
+/**
+ @class DataListenerRow
+*/
+Class ModListenerRow
+ implements
+ ModListenerRowInterface
+ {
+ /**
+ @var string
+ */
+ public $href;
+ /**
+ @var string
+ */
+ public $row_type;
+ /**
+ @var string
+ */
+ public $title;
+ /**
+ @var string
+ */
+ public $name;
+ /**
+ @var string
+ */
+ public $content;
+ /**
+ @var string / id is default image
+ */
+ public $image;
+
+ public function __construct($row_type, $title, $href){
+ $this->href = $href;
+ $this->title = $title;
+ $this->name = $title;
+ $this->row_type = $row_type;
+ }
+
+
+ public function GetRowType(){
+ return $this->row_type;
+ }
+
+ public function SetRowType($row_type){
+ return $this->row_type = $row_type;
+ }
+
+ public function SetContent($content){
+ return $this->content = $content;
+ }
+
+ public function GetContent(){
+ return $this->content;
+ }
+
+ /**
+ @fn SetHref($href)
+ */
+ public function SetHref($href){
+ return $this->href = $href;
+ }
+
+ /**
+ @fn GetHref()
+ */
+ public function GetHref(){
+ return $this->href;
+ }
+ public function GetTitle(){
+ return $this->title;
+ }
+
+ public function GetName(){
+ return $this->name;
+ }
+ /**
+ @fn GetImage()
+ @return string or id
+ */
+ public function GetImage(){
+ return $this->image;
+ }
+}
+
+?>
Added: trunk/catalog/includes/classes/drivers/ModTypeListenerRow.php
===================================================================
--- trunk/catalog/includes/classes/drivers/ModTypeListenerRow.php (rev 0)
+++ trunk/catalog/includes/classes/drivers/ModTypeListenerRow.php 2014-01-24 12:47:29 UTC (rev 5071)
@@ -0,0 +1,127 @@
+<?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 ModTypeListenerRow.php
+*/
+
+
+
+/**
+ @Interface DataListenerRowInterface
+ @note used by drivers/data/xxx in frontoffice
+
+*/
+Interface ModTypeListenerRowInterface{
+ /**
+ @fn GetHref()
+ @return string
+ */
+ public function GetHref();
+ /**
+ @fn GetTitle()
+ @return string
+ */
+ public function GetTitle();
+ /**
+ @fn GetName()
+ @return string
+ */
+ public function GetName();
+
+ public function GetContent();
+}
+
+
+
+/**
+ @class DataListenerRow
+*/
+Class ModTypeListenerRow
+ implements
+ ModTypeListenerRowInterface
+ {
+ /**
+ @var string
+ */
+ public $href;
+ /**
+ @var string
+ */
+ public $row_type;
+ /**
+ @var string
+ */
+ public $title;
+ /**
+ @var string
+ */
+ public $name;
+ /**
+ @var string
+ */
+ public $content;
+ /**
+ @var string / id is default image
+ */
+ public $image;
+
+ public function __construct($row_type, $title, $href){
+ $this->href = $href;
+ $this->title = $title;
+ $this->name = $title;
+ $this->row_type = $row_type;
+ }
+
+
+ public function GetRowType(){
+ return $this->row_type;
+ }
+
+ public function SetRowType($row_type){
+ return $this->row_type = $row_type;
+ }
+
+ public function SetContent($content){
+ return $this->content = $content;
+ }
+
+ public function GetContent(){
+ return $this->content;
+ }
+
+ /**
+ @fn SetHref($href)
+ */
+ public function SetHref($href){
+ return $this->href = $href;
+ }
+
+ /**
+ @fn GetHref()
+ */
+ public function GetHref(){
+ return $this->href;
+ }
+ public function GetTitle(){
+ return $this->title;
+ }
+
+ public function GetName(){
+ return $this->name;
+ }
+ /**
+ @fn GetImage()
+ @return string or id
+ */
+ public function GetImage(){
+ return $this->image;
+ }
+}
+
+?>
Modified: trunk/catalog/includes/classes/drivers/data/product.php
===================================================================
--- trunk/catalog/includes/classes/drivers/data/product.php 2014-01-23 22:02:41 UTC (rev 5070)
+++ trunk/catalog/includes/classes/drivers/data/product.php 2014-01-24 12:47:29 UTC (rev 5071)
@@ -266,9 +266,10 @@
if(isset($content[$namerow]))
$DataRow->SetLinkTo($row, $content[$namerow] );
}
-
+
/**
module aca
+ TODO Implement by Listener mod
*/
$product=product::get_option_data($product);
@@ -277,11 +278,15 @@
}
}
- if((count(self::$object_data)>0))
- foreach(self::$object_data as $k=>$content)
- if (isset($content->name) && !in_array($content->name,$exclude)) {
- if((!empty($search) && strstr($content->name,$search) !=false) || empty($search)) $tabl[$content->id]=$content;
- }
+ // Calculat other section but used cache
+ foreach($tabl as $id=>$DataRow) {
+
+ }
+// if((count(self::$object_data)>0))
+// foreach(self::$object_data as $k=>$content)
+// if (isset($content->name) && !in_array($content->name,$exclude)) {
+// if((!empty($search) && strstr($content->name,$search) !=false) || empty($search)) $tabl[$content->id]=$content;
+// }
return $tabl;
}
@@ -566,40 +571,51 @@
/**
* \fn get_product_attribut_info($pID)
* \brief Retourn tableau asso des element de pId precisé ou false
- * @param $pID int l'id du produits
+ * @param $products_id int l'id du produits
* @return array/false
*/
- public static function get_product_attribut_info($pID){
+ public static function get_product_attribut_info($products_id){
global $page;
- if(!isset(self::$object_data[$pID]) || !is_object(self::$object_data[$pID]) ) self::$object_data[$pID]= new objectInfo(array());
- if(isset(self::$object_data[$pID]->product_attribut_info)) return self::$object_data[$pID]->product_attribut_info ;
+ if(!is_object(self::$object_data[$products_id]))
+ self::$object_data[$products_id]=self::get_item($products_id);
+
+ $CurrObj = self::$object_data[$products_id];
+
+ if( count($CurrObj->GetAttrib() ) > 0 )
+ return $CurrObj->GetAttrib() ;
+
$language_id=$page->the_var('languages_id');
- $products_attributes_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$pID . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int) $language_id. "'");
+ $products_attributes_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$products_id . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int) $language_id. "'");
$products_attributes = tep_db_fetch_array($products_attributes_query);
$products_attributes= ($products_attributes['total'] > 0)? $products_attributes : array() ;
- return self::$object_data[$pID]->product_attribut_info = $products_attributes;
+ return self::$object_data[$products_id]->SetAttrib ( $products_attributes );
}
+
/**
- Recuperation price pour attribute
+ @fn get_product_attribut_price($products_id, $attributes=array())
+ @brief Recuperation price pour attribute
+ @param $products_id int
+ @param $attributes array
+ @return float price specific this attribute
*/
public static function get_product_attribut_price($products_id, $attributes=array()){
$attrib_price = 0;
$products_id = (int)$products_id;
$uprid=tep_get_uprid($products_id, $attributes);
- if(!isset(self::$object_data[$uprid]) || !is_object(self::$object_data[$products_id]))
- self::$object_data[$products_id]=self::get_item($products_id); //new objectInfo(array());
+ if(!is_object(self::$object_data[$products_id]))
+ self::$object_data[$products_id]=self::get_item($products_id);
+
+ $CurrObj = self::$object_data[$products_id];
- if(isset(self::$object_data[$products_id]->product_attribut_price) && isset(self::$object_data[$products_id]->product_attribut_price[$uprid]) )
- return self::$object_data[$products_id]->product_attribut_price[$uprid] ;
+ if( $CurrObj->GetAttributesPrice($uprid) != 0 )
+ return $CurrObj->GetAttributesPrice($uprid) ;
+ $price_prod = $CurrObj->GetPrice();
-
- $price_prod = self::$object_data[$products_id]->GetPrice();
-
if (is_array($attributes) && count($attributes)>0) {
reset($attributes);
while (list($option, $Mvalue) = each($attributes)) {
@@ -638,17 +654,30 @@
}
}
}
- return self::$object_data[$products_id]->product_attribut_price[$uprid] =$attrib_price;
+
+
+ return self::$object_data[$products_id]->SetAttributesPrice($uprid, $attrib_price); //[$uprid] =$attrib_price;
}
/**
- * \brief Calcul du poids
+ @fn get_attributes_weight($products_id, $attributes=array())
+ @brief Calcul du poids
+ @param $products_id int
+ @param $attributes array
+ @return float weight specific this attribute
*/
public static function get_attributes_weight($products_id, $attributes=array()) {
$attributes_weight = 0;
$uprid=tep_get_uprid($products_id, $attributes);
- if(isset(self::$object_data[$products_id]->product_attributes_weight) && isset(self::$object_data[$products_id]->product_attributes_weight[$uprid]) ) return self::$object_data[$products_id]->product_attributes_weight[$uprid] ;
+
+ if(!is_object(self::$object_data[$products_id]))
+ self::$object_data[$products_id]=self::get_item($products_id);
+
+ $CurrObj = self::$object_data[$products_id];
+
+ if( $CurrObj->GetAttributesWeight($uprid) != 0 )
+ return $CurrObj->GetAttributesWeight($uprid) ;
if (is_array($attributes) && count($attributes)>0) {
reset($attributes);
@@ -658,8 +687,8 @@
$attributes_weight += $attribute_price['options_values_weight'];
}
}
+ return self::$object_data[$products_id]->SetAttributesWeight($uprid, $attributes_weight);
- return self::$object_data[$products_id]->product_attributes_weight[$uprid] = $attributes_weight;
}
@@ -674,10 +703,15 @@
self::get_query($products_id);
$uprid=tep_get_uprid($products_id, $attributes);
- if(isset(self::$object_data[$products_id]->products_attribute_stock) && isset(self::$object_data[$products_id]->product_attribut_price[$uprid]) )
- return self::$object_data[$products_id]->products_attribute_stock[$uprid] ;
- elseif(isset(self::$object_data[$products_id]->products_attribute_stock) )
- self::$object_data[$products_id]->products_attribute_stock=array();
+ $stock = 0;
+
+ if(!is_object(self::$object_data[$products_id]))
+ self::$object_data[$products_id]=self::get_item($products_id);
+
+ $CurrObj = self::$object_data[$products_id];
+
+ if( $CurrObj->GetAttributesStock($uprid) != 0 )
+ return $CurrObj->GetAttributesStock($uprid) ;
$languages_id=$page->the_var('languages_id');
$DB=Database::getInstance();
@@ -695,13 +729,12 @@
$stock_query=$DB->query($sql="select products_stock_quantity as quantity from " . TABLE_PRODUCTS_STOCK . " where products_id='". (int)$products_id . "' and products_stock_attributes='$attr_list'");
- $stock=$stock_query->fetchAssoc();
+ $_stock=$stock_query->fetchAssoc();
unset($attr_list);
-
- @self::$object_data[$products_id]->products_attribute_stock[$uprid] = (int)$stock['quantity'];
- return $stock['quantity'];
+ $stock = (int)$_stock['quantity'];
}
- return self::$object_data[$products_id]->products_attribute_stock[$uprid] = 0;
+
+ return self::$object_data[$products_id]->SetAttributesStock($uprid, $stock);
}
/**
Modified: trunk/catalog/includes/modules/account/address_book.php
===================================================================
--- trunk/catalog/includes/modules/account/address_book.php 2014-01-23 22:02:41 UTC (rev 5070)
+++ trunk/catalog/includes/modules/account/address_book.php 2014-01-24 12:47:29 UTC (rev 5071)
@@ -21,8 +21,28 @@
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;
@@ -51,11 +71,10 @@
*/
function __construct(){
$this->code =__CLASS__;
- $this->type =self::$type;
+ @$this->type =self::$type;
$this->title = __('module aca address book text title');
$this->description = __('module aca address book text description') ;
$this->sort_order = (defined('MODULE_ACA_ADDRESS_BOOK_SORT_ORDER')) ? MODULE_ACA_ADDRESS_BOOK_SORT_ORDER : 0;
- $this->enabled = true;
$this->sql_data_array=array();
@@ -86,7 +105,7 @@
$breadcrumb=$page->return_object('breadcrumb');
$customer_id=$page->the_var('customer_id');
- if($_REQUEST['aca_mod'] == $this->code)
+ if(isset($_REQUEST['aca_mod']) && $_REQUEST['aca_mod'] == $this->code)
switch(self::$action){
case 'ab_edit':
$breadcrumb->add(__("addressbook breadcrumb"), self::href_link());
@@ -237,6 +256,7 @@
*/
public function load_db_values($cID) {
$cpt=0;
+ $addr = array();
$addresses_query = tep_db_query("select address_book_id, entry_firstname as firstname, entry_lastname as lastname, entry_company as company,entry_company_tax_id as company_tax_id, entry_street_address as street_address, entry_suburb as suburb, entry_city as city, entry_postcode as postcode, entry_state as state, entry_zone_id as zone_id, entry_country_id as country_id from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$cID . "' order by firstname, lastname");
while ($addresses = tep_db_fetch_array($addresses_query)){
$addr[$addresses['address_book_id']]=$addresses;
@@ -363,12 +383,14 @@
default:
if(isset($_GET['aca_action'])){
+
self::$account = $page->_call('customer','the_customer');
self::$adress_book=$this->cInfo->adress_book;
self::$count=$this->cInfo->the_count;
$v['title']=__("Carnet d'adresses personnel");
$v['content']=tep_output_string_protected(tep_get_include_contents('account/'.__CLASS__.'/'.__FUNCTION__.'.page'),false,true);
+
return new objectInfo( $v );
}
else {
Modified: trunk/catalog/includes/modules/account/history.php
===================================================================
--- trunk/catalog/includes/modules/account/history.php 2014-01-23 22:02:41 UTC (rev 5070)
+++ trunk/catalog/includes/modules/account/history.php 2014-01-24 12:47:29 UTC (rev 5071)
@@ -1,17 +1,21 @@
<?php
/**
- @licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
+ @licence GPL 2005-2014 The osCSS developers - osCSS Open Source E-commerce
@portion code Copyright (c) 2002 osCommerce
@package osCSS-2 <www http://www.oscss.org>
- @version 2.1.2
+ @version 2.2.0
@date 09/12/2013, 22:44
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
- *\class history
- *\group modules
- *\brief Address book for customers
+ @group modules, account
+ @file history.php
+ @dir includes/modules/account/
*/
+/**
+ @class history
+ @brief Address book for customers
+*/
class history
extends
AbstractAccount
@@ -19,8 +23,31 @@
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;
@@ -42,11 +69,10 @@
*/
function __construct(){
$this->code =__CLASS__;
- $this->type =self::$type;
+ @$this->type = self::$type;
$this->title = __('module history text title');
$this->description = __('module history text description') ;
$this->sort_order = (defined('MODULE_ACA_HISTORY_SORT_ORDER')) ? MODULE_ACA_HISTORY_SORT_ORDER : 0;
- $this->enabled = true;
$this->sql_data_array=array();
@@ -65,12 +91,13 @@
global $page;
$breadcrumb=$page->return_object('breadcrumb');
- $customer_id=$page->the_var('customer_id');
+ $customer_id=$page->GetVar('customer_id');
+ $languages_id=$page->GetVar('languages_id');
- if($_REQUEST['aca_mod'] == $this->code)
+ if(isset($_REQUEST['aca_mod']) && $_REQUEST['aca_mod'] == $this->code)
switch(self::$action){
case 'display_view':
- $breadcrumb->add(__("history breadcrumb"), self::href_link());
+ $breadcrumb->add(__("history breadcrumb"), self::href_link() );
break;
}
else
@@ -134,7 +161,7 @@
@return none
*/
public function after_check_action ($action) {
- if($action=='new') tep_redirect(tep_href_link(FILENAME_ACCOUNT, 'aca_mod='.$this->code.'&aca_type='.$this->type.'&aca_action=display_view', 'SSL'));
+ if($action=='new') tep_redirect(tep_href_link(FILENAME_ACCOUNT, 'aca_mod='.$this->code.'&aca_type='.self::$type.'&aca_action=display_view', 'SSL'));
}
@@ -235,27 +262,38 @@
public function display_view($pID=''){
global $page;
- $customer_id=$page->the_var('customer_id');
+ $customer_id=$page->GetVar('customer_id');
switch(self::$action){
case 'display_view':
self::$current = $this->load_db_values($customer_id);
-
return new objectInfo(array(
'title'=>__("history heading listing"),
- 'content'=> tep_output_string_protected(tep_get_include_contents('account/'.__CLASS__.'/'.$this->type.'.'.__FUNCTION__.'.page'),false,true)
+ 'content'=> tep_output_string_protected(tep_get_include_contents('account/'.__CLASS__.'/'.self::$type.'.'.__FUNCTION__.'.page'),false,true)
) );
+
+ $ModTypeRow = new ModTypeListenerRow(
+ '',
+ __("history heading listing") ,
+ tep_href_link(FILENAME_ACCOUNT, 'aca_mod='.$this->code.'&aca_type='.self::$type.'&aca_action=display_view', 'SSL')
+ );
+ $ModTypeRow->SetContent( tep_output_string_protected(tep_get_include_contents('account/'.__CLASS__.'/box_view'),false,true) );
+
+
break;
- default:
+ case '':
+// default:
+
self::$current = $this->load_db_values($customer_id);
- $v['title']=__("history widget view");
- $v['href']= tep_href_link(FILENAME_ACCOUNT, 'aca_mod='.$this->code.'&aca_type='.$this->type.'&aca_action=display_view', 'SSL');
- $v['content']=tep_output_string_protected(tep_get_include_contents('account/'.__CLASS__.'/box_view'),false,true);
- return new objectInfo(array(
- 'type'=>'box',
- 'conteneur'=>array(new objectInfo( $v ))
- ));
+ $ModTypeRow = new ModTypeListenerRow(
+ 'box',
+ __("history widget view") ,
+ tep_href_link(FILENAME_ACCOUNT, 'aca_mod='.$this->code.'&aca_type='.self::$type.'&aca_action=display_view', 'SSL')
+ );
+ $ModTypeRow->SetContent( tep_output_string_protected(tep_get_include_contents('account/'.__CLASS__.'/box_view'),false,true) );
+
+ return $ModTypeRow;
}
}
Modified: trunk/catalog/includes/modules/products/desc_base.php
===================================================================
--- trunk/catalog/includes/modules/products/desc_base.php 2014-01-23 22:02:41 UTC (rev 5070)
+++ trunk/catalog/includes/modules/products/desc_base.php 2014-01-24 12:47:29 UTC (rev 5071)
@@ -7,9 +7,17 @@
\date 06/01/12, 11:16
\author oscim <mail aur...@os...> <www http://www.oscim.fr>
\encode UTF-8
- \class desc_base
\brief Description product
*/
+
+
+require_once(DIR_FS_CATALOG . DIR_WS_CLASSES . 'drivers/ModTypeListenerRow.php');
+
+
+
+/**
+ @class desc_base
+*/
class desc_base
extends AbstractProduct
implements InterfaceModule {
@@ -87,11 +95,16 @@
public function display_view($pID,$class=''){
$this->load_db_values((int)$pID);
- $v=$this->content;
- $v['title']=__('tab products desc base');
- $v['content']=tep_output_string_protected(tep_get_include_contents( $this->type.'/'.__CLASS__.'.'.__FUNCTION__), false, true);
+ $ModTypeRow = new ModTypeListenerRow(
+ '',
+ __('tab products desc base') ,
+ ''
+ );
- return array(new objectInfo($v));
+ $ModTypeRow->SetContent( tep_output_string_protected(tep_get_include_contents( $this->type.'/'.__CLASS__.'.'.__FUNCTION__), false, true) );
+
+ return $ModTypeRow;
+
}
Modified: trunk/catalog/install/data/templates/appareil_photo/booststrap/template.php
===================================================================
--- trunk/catalog/install/data/templates/appareil_photo/booststrap/template.php 2014-01-23 22:02:41 UTC (rev 5070)
+++ trunk/catalog/install/data/templates/appareil_photo/booststrap/template.php 2014-01-24 12:47:29 UTC (rev 5071)
@@ -56,20 +56,19 @@
<?php endif; ?>
<?php /*endif;*/ ?>
- <?php if($page->GetPageType() !='checkout' && is_object($ACA) && $modules=$ACA->display_view($page->GetVar('current_id'))): /** Boucle des modules aca actif */ ?>
+ <?php if(!in_array( $page->GetPageType(), array('checkout', 'account') ) && is_object($ACA) && ($modules=$ACA->display_view($page->GetVar('current_id'))) && is_array($modules) && count($modules)>0 ): /** Boucle des modules aca actif */ ?>
<section class="childsmod <?php echo $page->the_type(); ?>">
<div id="in_tabs" class="in_tabs">
<ul id="tablist" class="tabNavigation">
- <?php /** ACA module */ foreach($modules as $k =>$v){ foreach($v as $kt=>$vt){ $i++; echo '<li style="display:inline"><a href="#in_tabs'.$i.$kt.'">'.$vt->title.'</a> </li>'; } } ?>
+ <?php foreach($modules as $k =>$ModTypeRow){ $i++; echo '<li style="display:inline"><a href="#in_tabs'.$i.$k.'">'.$ModTypeRow->GetTitle().'</a> </li>'; } ?>
</ul>
<?php reset($modules); $i=1;
- foreach($modules as $k=>$v)
- foreach($v as $kt=>$vt){ $i++; ?>
- <div id="in_tabs<?php echo $i.$kt ?>" class="tabcontent">
- <?php /** ACA module */ echo unhtmlentities($vt->content); ?>
- <br style="clear:both" />
- </div>
- <?php } ?>
+ foreach($modules as $k=>$ModTypeRow){ $i++; ?>
+ <div id="in_tabs<?php echo $i.$k ?>" class="tabcontent">
+ <?php echo unhtmlentities( $ModTypeRow->GetContent() ); ?>
+ <br style="clear:both" />
+ </div>
+ <?php } ?>
</div>
</section>
<?php endif; ?>
Modified: trunk/catalog/templates/defaut/includes/gabarit/account/history_info.gab
===================================================================
--- trunk/catalog/templates/defaut/includes/gabarit/account/history_info.gab 2014-01-23 22:02:41 UTC (rev 5070)
+++ trunk/catalog/templates/defaut/includes/gabarit/account/history_info.gab 2014-01-24 12:47:29 UTC (rev 5071)
@@ -8,7 +8,7 @@
@encode UTF-8
*/
-global $SectionTplPC, $ModuleAccount, $module, $cart,$account, $order,$currencies;
+global $SectionTplPC, $ModuleAccount, $module, $cart,$account, $order,$currencies, $languages_id;
?>
Modified: trunk/catalog/templates/defaut/includes/gabarit/account/view.gab
===================================================================
--- trunk/catalog/templates/defaut/includes/gabarit/account/view.gab 2014-01-23 22:02:41 UTC (rev 5070)
+++ trunk/catalog/templates/defaut/includes/gabarit/account/view.gab 2014-01-24 12:47:29 UTC (rev 5071)
@@ -32,14 +32,12 @@
</ul>
</div>
- <?php foreach($ModuleAccount->display_view($_SESSION['customer_id']) as $k=>$aca_mod) : ?>
- <?php if($aca_mod->type =='box') : ?>
- <?php foreach($aca_mod->conteneur as $row) : ?>
+ <?php foreach($ModuleAccount->display_view($_SESSION['customer_id']) as $k=>$ModTypeRow) : ?>
+ <?php if($ModTypeRow->GetRowType() =='box'): ?>
<div class="col-lg-6 box">
- <h4><a href="<?php echo $row->href; ?>"><?php echo unhtmlentities($row->title); ?></a></h4>
- <?php echo unhtmlentities($row->content); ?>
+ <h4><a href="<?php echo $ModTypeRow->GetHref(); ?>"><?php echo unhtmlentities($ModTypeRow->GetTitle()); ?></a></h4>
+ <?php echo unhtmlentities( $ModTypeRow->GetContent() ); ?>
</div>
- <?php endforeach; ?>
- <?php endif; ?>
+ <?php endif; ?>
<?php endforeach; ?>
</div>
Modified: trunk/catalog/templates/defaut/includes/js/address_book.js.php
===================================================================
--- trunk/catalog/templates/defaut/includes/js/address_book.js.php 2014-01-23 22:02:41 UTC (rev 5070)
+++ trunk/catalog/templates/defaut/includes/js/address_book.js.php 2014-01-24 12:47:29 UTC (rev 5071)
@@ -1,18 +1,21 @@
<?php
/**
- @licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
+ @licence GPL 2005-2014 The osCSS developers - osCSS Open Source E-commerce
@portion code Copyright (c) 2002 osCommerce
@package osCSS-2 <www http://www.oscss.org>
- @version 2.1.0
+ @version 2.2.0
@date 29/01/11, 11:25
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
+ @file address_book.js.php
+ @dir templates/default/includes/js/
*/
?>
<script type="text/javascript"><!--
$(function(){
// Validation de formulaire avec jquery.validate
$("#addressbook").validate({
+
rules: {
gender: "required",
firstname: {
@@ -23,6 +26,11 @@
required: true,
minlength: <?php echo ENTRY_LAST_NAME_MIN_LENGTH; ?>
},
+ email_address: {
+ required: true,
+ email: true,
+ minlength: <?php echo ENTRY_EMAIL_ADDRESS_MIN_LENGTH; ?>
+ },
street_address: {
required: true,
minlength: <?php echo ENTRY_STREET_ADDRESS_MIN_LENGTH; ?>
@@ -36,21 +44,34 @@
minlength: <?php echo ENTRY_CITY_MIN_LENGTH; ?>
},
country: "required",
- telephone: {
- required: true,
- minlength: <?php echo ENTRY_TELEPHONE_MIN_LENGTH; ?>,
- number: true
+ messages: {
+ gender: "<?php echo __('entry gender required'); ?>",
+ firstname:{
+ required: "<?php echo __('entry first name required'); ?>",
+ minlength: "<?php printf(__('entry first name error %s'), ENTRY_FIRST_NAME_MIN_LENGTH); ?>"
+ },
+ lastname:{
+ required: "<?php echo __('entry last name required'); ?>",
+ minlength: "<?php printf(__('entry last name error %s'), ENTRY_LAST_NAME_MIN_LENGTH); ?>"
+ },
+ email_address: {
+ required: "<?php echo __('entry email address required'); ?>",
+ minlength: "<?php printf(__('entry last name error %s'), ENTRY_EMAIL_ADDRESS_MIN_LENGTH); ?>"
},
+ street_address:{
+ required: "<?php echo __('entry street address required'); ?>",
+ minlength: "<?php printf(__('entry street address error %s'), ENTRY_STREET_ADDRESS_MIN_LENGTH); ?>"
+ },
+ postcode: {
+ required: "<?php echo __('entry post code required'); ?>",
+ minlength: "<?php printf(__('entry post code error %s'), ENTRY_POSTCODE_MIN_LENGTH); ?>"
+ },
+ city:{
+ required: "<?php echo __('entry city required'); ?>",
+ minlength: "<?php printf(__('entry city error %s'), ENTRY_CITY_MIN_LENGTH); ?>"
+ },
+ country: "<?php echo __('entry country required'); ?>",
},
- messages: {
- gender: "<?php echo ENTRY_GENDER_ERROR; ?>",
- firstname: "<?php echo ENTRY_FIRST_NAME_ERROR ?>",
- lastname: "<?php echo ENTRY_LAST_NAME_ERROR ?>",
- street_address: "<?php echo ENTRY_STREET_ADDRESS_ERROR; ?>",
- postcode: "<?php echo ENTRY_POST_CODE_ERROR; ?>",
- city: "<?php echo ENTRY_CITY_ERROR; ?>",
- country: "<?php echo ENTRY_COUNTRY_ERROR; ?>"
- },
errorElement: "span",
errorClass: "messageStackError",
errorPlacement: function(error, element) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2014-01-23 22:02:44
|
Revision: 5070
http://sourceforge.net/p/oscss/svn/5070
Author: oscim
Date: 2014-01-23 22:02:41 +0000 (Thu, 23 Jan 2014)
Log Message:
-----------
Fix Bug
Modified Paths:
--------------
trunk/catalog/admin/includes/modules/account/address_book.php
Modified: trunk/catalog/admin/includes/modules/account/address_book.php
===================================================================
--- trunk/catalog/admin/includes/modules/account/address_book.php 2014-01-23 21:55:41 UTC (rev 5069)
+++ trunk/catalog/admin/includes/modules/account/address_book.php 2014-01-23 22:02:41 UTC (rev 5070)
@@ -710,7 +710,7 @@
var description MODULE_TOTO_ST_L (long description)
*/
function install() {
- tep_db_query("INSERT IGNORE INTO " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added,configuration_type) values ('MODULE_ACA_ADDRESS_BOOK_SORT_ORDER_S', 'MODULE_ACA_ADDRESS_BOOK_SORT_ORDER', '5', MODULE_ACA_ADDRESS_BOOK_SORT_ORDER_L', '42', '0', now(),3)");
+ tep_db_query("INSERT IGNORE INTO " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added,configuration_type) values ('MODULE_ACA_ADDRESS_BOOK_SORT_ORDER_S', 'MODULE_ACA_ADDRESS_BOOK_SORT_ORDER', '5', 'MODULE_ACA_ADDRESS_BOOK_SORT_ORDER_L', '42', '0', now(),3)");
$this->_check = true;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2014-01-23 21:55:46
|
Revision: 5069
http://sourceforge.net/p/oscss/svn/5069
Author: oscim
Date: 2014-01-23 21:55:41 +0000 (Thu, 23 Jan 2014)
Log Message:
-----------
Clean code
Modified Paths:
--------------
trunk/catalog/admin/includes/classes/drivers/sqlcontent.php
trunk/catalog/admin/includes/classes/drivers/sqlservices.php
trunk/catalog/admin/includes/content/ajax.top.inc
trunk/catalog/admin/includes/exts/package/ci_tag.class.php
trunk/catalog/admin/includes/exts/package/tags/addfile.php
trunk/catalog/admin/includes/exts/package/tags/filesql.php
trunk/catalog/admin/includes/gabarit/adminAccount/display_view.page.gab
trunk/catalog/admin/includes/gabarit/configuration/modextrafields/draw.label.listing.gab
trunk/catalog/admin/includes/gabarit/newsletters/display_view.preview.gab
trunk/catalog/admin/includes/modules/configuration/datatypecategorie.php
trunk/catalog/admin/includes/modules/cronjob/relance_order.php
trunk/catalog/admin/includes/modules/pages/adminAccount.php
trunk/catalog/admin/includes/modules/pages/categories.php
trunk/catalog/admin/includes/modules/pages/products.php
trunk/catalog/admin/includes/modules/pages/recover_cart_sales.php
trunk/catalog/admin/includes/modules/pages/services.php
trunk/catalog/admin/includes/modules/rapport/customers_purchase.php
trunk/catalog/checkout_shipping.php
trunk/catalog/common/classes/DatasFiles.php
trunk/catalog/common/classes/datatype_drivers/Data_diver.php
trunk/catalog/common/classes/imgratio_drivers/Carre.php
trunk/catalog/common/classes/seo_url.php
trunk/catalog/common/modules/core/email/history_internal.php
trunk/catalog/create_account.php
trunk/catalog/includes/classes/checkout_process.php
trunk/catalog/includes/classes/core_page/customer.php
trunk/catalog/includes/classes/core_page/develop.php
trunk/catalog/includes/classes/discount_coupon.php
trunk/catalog/includes/classes/drivers/data/categorie.php
trunk/catalog/includes/classes/drivers/data/content.php
trunk/catalog/includes/classes/drivers/data/product.php
trunk/catalog/includes/modules/account/history.php
trunk/catalog/includes/modules/checkout/PrShipping.php
trunk/catalog/includes/modules/listing_cat.php
trunk/catalog/newsletters.php
trunk/catalog/templates/defaut/includes/gabarit/account/view.gab
trunk/catalog/templates/defaut/includes/gabarit/pages/shopping_cart.gab
trunk/catalog/templates/defaut/includes/gabarit/product/view.gab
trunk/dev/generator/datatype/Modele/catalog/admin/includes/classes/drivers/sql_DATATYPE_REPLACE_.php
trunk/dev/generator/datatype/Modele/catalog/common/classes/datatype_drivers/Data__DATATYPE_REPLACE_.php
trunk/dev/generator/datatype/Modele/catalog/includes/modules/account/ac__DATATYPE_REPLACE_.php
trunk/dev/generator/datatype/Modele/catalog/includes/modules/listing__DATATYPE_REPLACE_.php
trunk/dev/generator/datatype/Modele/catalog/templates/defaut/includes/boxes/_DATATYPE_REPLACE_.php
trunk/dev/generator/datatype/Modele/catalog/templates/defaut/includes/content/_DATATYPE_REPLACE__listing.php
trunk/dev/install/install.php
trunk/extensions/ELECTRONIX_stable/electronix/popup.php
trunk/extensions/LISTING_ORDER_stable/catalog/admin/includes/modules/categories/listing_order.php
trunk/extensions/RESTRICTACCES_stable/catalog/includes/modules/categories/RestrictAcces.php
trunk/extensions/REVIEWS_stable/catalog/admin/includes/modules/account/reviews.php
trunk/test/phpunit/Back/modules/pages/pageproductsTest.php
trunk/test/phpunit/Back/sqlxxx/sqlcustomersTest.php
trunk/test/phpunit/Front/productTest.php
Modified: trunk/catalog/admin/includes/classes/drivers/sqlcontent.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlcontent.php 2014-01-23 21:41:50 UTC (rev 5068)
+++ trunk/catalog/admin/includes/classes/drivers/sqlcontent.php 2014-01-23 21:55:41 UTC (rev 5069)
@@ -317,7 +317,7 @@
return $array;
}
-// var_dump($sql);
+
return false;
}
Modified: trunk/catalog/admin/includes/classes/drivers/sqlservices.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlservices.php 2014-01-23 21:41:50 UTC (rev 5068)
+++ trunk/catalog/admin/includes/classes/drivers/sqlservices.php 2014-01-23 21:55:41 UTC (rev 5069)
@@ -82,7 +82,7 @@
$res=tep_db_perform(TABLE_SERVICES, $sql_data_array, 'update' , substr($where,3) );
-// var_dump($res);
+
return $res;
}
Modified: trunk/catalog/admin/includes/content/ajax.top.inc
===================================================================
--- trunk/catalog/admin/includes/content/ajax.top.inc 2014-01-23 21:41:50 UTC (rev 5068)
+++ trunk/catalog/admin/includes/content/ajax.top.inc 2014-01-23 21:55:41 UTC (rev 5069)
@@ -35,14 +35,8 @@
else {
$AcaFactory=new AcaFactory($filepath/*,'MODULE_ACACAT_INSTALLED_BO'*/);
- var_dump($AcaFactory->modules[$class],$function);
-
if (method_exists($AcaFactory->modules[$class],$function)) {
- $result=$AcaFactory->modules[$class]->$function();
-
- var_dump($AcaFactory->modules[$class]);
-
-
+ $result=$AcaFactory->modules[$class]->$function();
}
}
Modified: trunk/catalog/admin/includes/exts/package/ci_tag.class.php
===================================================================
--- trunk/catalog/admin/includes/exts/package/ci_tag.class.php 2014-01-23 21:41:50 UTC (rev 5068)
+++ trunk/catalog/admin/includes/exts/package/ci_tag.class.php 2014-01-23 21:55:41 UTC (rev 5069)
@@ -349,7 +349,7 @@
// block Next process
fileUtility::CfgComport(true);
-// var_dump(fileUtility::_mkdir($path));
+
// Create dir
if( ($res= fileUtility::_mkdir($path)) && $res ==false) {
// draw error
Modified: trunk/catalog/admin/includes/exts/package/tags/addfile.php
===================================================================
--- trunk/catalog/admin/includes/exts/package/tags/addfile.php 2014-01-23 21:41:50 UTC (rev 5068)
+++ trunk/catalog/admin/includes/exts/package/tags/addfile.php 2014-01-23 21:55:41 UTC (rev 5069)
@@ -81,7 +81,7 @@
/**-----------------------------permissions--------------------------- */
public function permissions_check_for_remove() {
- var_dump($this->data['filename']);
+
for($i = 0; $i < count($this->data['filename']);$i++){
$fs_filename=replace_path_admin($this->fs_filename($i));
$path=dirname($fs_filename);
Modified: trunk/catalog/admin/includes/exts/package/tags/filesql.php
===================================================================
--- trunk/catalog/admin/includes/exts/package/tags/filesql.php 2014-01-23 21:41:50 UTC (rev 5068)
+++ trunk/catalog/admin/includes/exts/package/tags/filesql.php 2014-01-23 21:55:41 UTC (rev 5069)
@@ -27,7 +27,7 @@
@brief Constructor
*/
function Tc_filesql($contrib='', $id='', $xml_data='', $dep='') {
-// var_dump(__FUNCTION__);
+
$this->params=array(
'tables'=>array(
'sql_type'=>'text',
@@ -63,7 +63,7 @@
@brief create virtual data xml based in folder and file
*/
function get_data_from_xml_parser($xml_data='') {
-// var_dump(__FUNCTION__);
+
$dbtype = DB_MOTOR_TYPE;
$dbmotor = strtolower(DB_CONNECTOR);
if($dbmotor = 'mysqli')
Modified: trunk/catalog/admin/includes/gabarit/adminAccount/display_view.page.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/adminAccount/display_view.page.gab 2014-01-23 21:41:50 UTC (rev 5068)
+++ trunk/catalog/admin/includes/gabarit/adminAccount/display_view.page.gab 2014-01-23 21:55:41 UTC (rev 5069)
@@ -10,8 +10,6 @@
@brief content admin account detail
*/
-// var_dump(__FILE__);
-// exit;
?>
<h3><?php echo __('heading title'); ?></h3>
<div class="block_form">
Modified: trunk/catalog/admin/includes/gabarit/configuration/modextrafields/draw.label.listing.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/configuration/modextrafields/draw.label.listing.gab 2014-01-23 21:41:50 UTC (rev 5068)
+++ trunk/catalog/admin/includes/gabarit/configuration/modextrafields/draw.label.listing.gab 2014-01-23 21:55:41 UTC (rev 5069)
@@ -8,7 +8,7 @@
@encode UTF-8
*/
global $EFL;
-// var_dump($EFL->GetList());
+
?>
<div id="ssmenu">
Modified: trunk/catalog/admin/includes/gabarit/newsletters/display_view.preview.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/newsletters/display_view.preview.gab 2014-01-23 21:41:50 UTC (rev 5068)
+++ trunk/catalog/admin/includes/gabarit/newsletters/display_view.preview.gab 2014-01-23 21:55:41 UTC (rev 5069)
@@ -17,7 +17,7 @@
);
$array_email=tep_post_prepare_email(newsletters::$nInfo->module.'.tpl',$language,$myarray);
-// var_dump(newsletters::$preview);
+
?>
<h3><?php echo __('text info preview newsletters') ?></h3>
Modified: trunk/catalog/admin/includes/modules/configuration/datatypecategorie.php
===================================================================
--- trunk/catalog/admin/includes/modules/configuration/datatypecategorie.php 2014-01-23 21:41:50 UTC (rev 5068)
+++ trunk/catalog/admin/includes/modules/configuration/datatypecategorie.php 2014-01-23 21:55:41 UTC (rev 5069)
@@ -169,7 +169,7 @@
// call type module
$typeOri=modulesUtility::GetModttype('categories');
-var_dump($typeOri);
+
// get current value
$current = sqlconfiguration::fetch(array('key'=>$typeOri->key), true);
$current_bo = sqlconfiguration::fetch(array('key'=>$typeOri->key_BO), true);
Modified: trunk/catalog/admin/includes/modules/cronjob/relance_order.php
===================================================================
--- trunk/catalog/admin/includes/modules/cronjob/relance_order.php 2014-01-23 21:41:50 UTC (rev 5068)
+++ trunk/catalog/admin/includes/modules/cronjob/relance_order.php 2014-01-23 21:55:41 UTC (rev 5069)
@@ -238,7 +238,6 @@
while($bdarr = tep_db_fetch_array($bdqry)) {
$order = new order((int)$bdarr['orders_id']);
-// var_dump('email:: ',$order->customer['name']);
$bd_sub = sprintf(__('email subject relance'), $order->customer['name']);
$bd_msg = sprintf(__('email content relance'), $order->customer['name'],$order->info['payment_method'], $config->order_delay );
@@ -258,7 +257,6 @@
*/
$message_final=emailUtility::post_prepare_email("cron_update_order.tpl",$language,$myarray);
-// var_dump($message_final);
tep_mail($order->customer['name'], $order->customer['email_address'], $bd_sub, $message_final, STORE_NAME, STORE_OWNER_EMAIL_ADDRESS, '');
/**
@@ -310,8 +308,8 @@
while($bdarr = tep_db_fetch_array($bdqry)) {
$order = new order((int)$bdarr['orders_id']);
-// var_dump('upadte:: ',$order->customer['name']);
+
$bd_sub = sprintf(__('email subject update'), $order->customer['name']);
$bd_msg = sprintf(__('email content update'), $order->customer['name'],$order->info['payment_method'], $config->order_update );
Modified: trunk/catalog/admin/includes/modules/pages/adminAccount.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/adminAccount.php 2014-01-23 21:41:50 UTC (rev 5068)
+++ trunk/catalog/admin/includes/modules/pages/adminAccount.php 2014-01-23 21:55:41 UTC (rev 5069)
@@ -253,7 +253,6 @@
$liste[]= new objectInfo($array);
}
}
- //var_dump ($current_theme);
return $liste;
}
Modified: trunk/catalog/admin/includes/modules/pages/categories.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/categories.php 2014-01-23 21:41:50 UTC (rev 5068)
+++ trunk/catalog/admin/includes/modules/pages/categories.php 2014-01-23 21:55:41 UTC (rev 5069)
@@ -747,7 +747,7 @@
case 'delete';
case 'edit';
case 'noedit';
- var_dump(self::$Id);
+
$res = sqlcategorie::fetch(array('id'=> (int) self::$Id, 'language_id'=>(int)$languages_id), true);
$res->cPath= categorieUtility::get_generated_category_path_ids(self::$Id);
Modified: trunk/catalog/admin/includes/modules/pages/products.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/products.php 2014-01-23 21:41:50 UTC (rev 5068)
+++ trunk/catalog/admin/includes/modules/pages/products.php 2014-01-23 21:55:41 UTC (rev 5069)
@@ -620,9 +620,7 @@
'content'=>tep_get_include_contents(__CLASS__.'/filter.clause'),
);
-// print_r($conf);
-
/**
@remarks this define menu master module in page
@note use $boutons[action][] = array(params)
@@ -913,19 +911,18 @@
$array[] = $tmp->input_value;
echo json_encode($array);
}
-// return FieldsDisplay::DisplayRow(/*$obj->$edit*/, (( self::$action!='noedit')? false : true ), $format) ;
-// /*if( (*/$col=call_user_func(array(tep_extrac_querystring(JSONSTATMENT,'type'), 'tep_get_modele') ));// && is_array($col)
-/* $col2=call_user_func(array(tep_extrac_querystring(JSONSTATMENT,'type'), 'tep_get_modele'), array('modele2') );*/ /*print_r($col); */
-// print_r(self::$allfields);
+ // return FieldsDisplay::DisplayRow(/*$obj->$edit*/, (( self::$action!='noedit')? false : true ), $format) ;
+ // /*if( (*/$col=call_user_func(array(tep_extrac_querystring(JSONSTATMENT,'type'), 'tep_get_modele') ));// && is_array($col)
+ /* $col2=call_user_func(array(tep_extrac_querystring(JSONSTATMENT,'type'), 'tep_get_modele'), array('modele2') );*/
-// $array[] = "B";
-// $array[] ="d";
-// $array[] ="C";
-// return '';
-// var_dump($obj->$edit);
+ // $array[] = "B";
+ // $array[] ="d";
+ // $array[] ="C";
+ // return '';
+ // echo json_encode($array);
+ exit;
+ break;
-// echo json_encode($array);
-exit;
case 'setflag':
// if(!tep_action_check('setflag', self::FILENAME)){
@@ -1422,7 +1419,6 @@
// foreach($obj->$edit->select_values as $row)
// $array[$row['id']] = $row['text'];
// // return FieldsDisplay::DisplayRow(/*$obj->$edit*/, (( self::$action!='noedit')? false : true ), $format) ;
-// // print_r(self::$allfields);
// return '';
// echo json_encode($array);
Modified: trunk/catalog/admin/includes/modules/pages/recover_cart_sales.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/recover_cart_sales.php 2014-01-23 21:41:50 UTC (rev 5068)
+++ trunk/catalog/admin/includes/modules/pages/recover_cart_sales.php 2014-01-23 21:55:41 UTC (rev 5069)
@@ -229,7 +229,6 @@
// $cquery = $DB->query("select * from " . TABLE_ORDERS . " where customers_id = '".(int)$cid."'" );
// $ArrayCust=$cquery->fetchAssoc();
-// var_dump($ArrayCust);
$custname = $inrec['fname']." ".$inrec['lname'];
$outEmailAddr = '"' . $custname . '" <' . $inrec['email'] . '>';
@@ -478,7 +477,7 @@
$li['action']=self::get_item_action($item);
$res[]=$li;
}
-// print_r($res);
+
// if(count($res)==0) return array(array('base'=>' ','date'=>' ','customer'=>' ','email'=>' ','total'=>' ','status'=>' ','action'=>' '));
return $res;
}
Modified: trunk/catalog/admin/includes/modules/pages/services.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/services.php 2014-01-23 21:41:50 UTC (rev 5068)
+++ trunk/catalog/admin/includes/modules/pages/services.php 2014-01-23 21:55:41 UTC (rev 5069)
@@ -686,7 +686,6 @@
while ($item = $_query->fetchAssoc()) {
foreach(self::$InitInfo['modele']['listing'] as $k=>$row){
-// var_dump($k);
if($k == 'action') $ord[$k]=self::get_item_action($item);
elseif($k == 'status') $ord[$k]=self::GetServiceStatus($item, false);
elseif($k == 'auto_retry') $ord[$k]=self::GetServiceAutoRetry($item, false);
Modified: trunk/catalog/admin/includes/modules/rapport/customers_purchase.php
===================================================================
--- trunk/catalog/admin/includes/modules/rapport/customers_purchase.php 2014-01-23 21:41:50 UTC (rev 5068)
+++ trunk/catalog/admin/includes/modules/rapport/customers_purchase.php 2014-01-23 21:55:41 UTC (rev 5069)
@@ -181,7 +181,6 @@
),
);
-// var_dump($listfield);
global $languages_id;
Modified: trunk/catalog/checkout_shipping.php
===================================================================
--- trunk/catalog/checkout_shipping.php 2014-01-23 21:41:50 UTC (rev 5068)
+++ trunk/catalog/checkout_shipping.php 2014-01-23 21:55:41 UTC (rev 5069)
@@ -89,7 +89,7 @@
if (!tep_session_is_registered('shipping')) tep_session_register('shipping');
if ( (tep_count_shipping_modules() > 0) || ($free_shipping) ) {
-// var_dump(__line__);
+
if ( (isset($_POST['shipping'])) && (strpos($_POST['shipping'], '_')) ) {
$shipping = $_POST['shipping'];
list($module, $method) = explode('_', $shipping);
Modified: trunk/catalog/common/classes/DatasFiles.php
===================================================================
--- trunk/catalog/common/classes/DatasFiles.php 2014-01-23 21:41:50 UTC (rev 5068)
+++ trunk/catalog/common/classes/DatasFiles.php 2014-01-23 21:55:41 UTC (rev 5069)
@@ -246,10 +246,10 @@
$typeint = self::ConvertType($type);
$typeobj=self::SpecificType($typeint);
-// var_dump($typeobj);
+
$path = self::InitFolder($typeobj->folder);
self::GetPathid($type, $id);
-// var_dump($path.$pathid.sprintf($typeobj->format, $typeobj->prefix,$Id,$typeobj->ext));
+
return $path.$pathid.sprintf($typeobj->format, $typeobj->prefix,$Id,$typeobj->ext);
}
Modified: trunk/catalog/common/classes/datatype_drivers/Data_diver.php
===================================================================
--- trunk/catalog/common/classes/datatype_drivers/Data_diver.php 2014-01-23 21:41:50 UTC (rev 5068)
+++ trunk/catalog/common/classes/datatype_drivers/Data_diver.php 2014-01-23 21:55:41 UTC (rev 5069)
@@ -226,11 +226,7 @@
$breadcrumb->add( __('breadcrumb '.str_replace('_',' ',substr($p,0,-4) )), tep_href_link($p));
}
-// var_dump($page->oscss_body_id());
-
-//
-
return $page_content;
}
Modified: trunk/catalog/common/classes/imgratio_drivers/Carre.php
===================================================================
--- trunk/catalog/common/classes/imgratio_drivers/Carre.php 2014-01-23 21:41:50 UTC (rev 5068)
+++ trunk/catalog/common/classes/imgratio_drivers/Carre.php 2014-01-23 21:55:41 UTC (rev 5069)
@@ -22,8 +22,6 @@
{
function __construct(){
-
-// var_dump(__FILE__);
}
/**
Modified: trunk/catalog/common/classes/seo_url.php
===================================================================
--- trunk/catalog/common/classes/seo_url.php 2014-01-23 21:41:50 UTC (rev 5068)
+++ trunk/catalog/common/classes/seo_url.php 2014-01-23 21:55:41 UTC (rev 5069)
@@ -1197,7 +1197,6 @@
$this->cache_query = $this->DB->query($s="SELECT cache_expires FROM ". TABLE_SEO_CACHE." WHERE cache_id='".md5($name)."' AND cache_language_id='".(int)$this->languages_id."' LIMIT 1");
-// var_dump($s);
$is_cached = ( $this->cache_query->__get('NumRows') > 0 ? true : false );
if ($is_cached){
Modified: trunk/catalog/common/modules/core/email/history_internal.php
===================================================================
--- trunk/catalog/common/modules/core/email/history_internal.php 2014-01-23 21:41:50 UTC (rev 5068)
+++ trunk/catalog/common/modules/core/email/history_internal.php 2014-01-23 21:55:41 UTC (rev 5069)
@@ -119,7 +119,7 @@
$mInfo->from = $match[2];
if(preg_match('#.*Subject:(.*)#', $row, $match))
$mInfo->subject = $match[1];
-// var_dump( $row);
+
}
$mInfo->content = $tmp2[1];
Modified: trunk/catalog/create_account.php
===================================================================
--- trunk/catalog/create_account.php 2014-01-23 21:41:50 UTC (rev 5068)
+++ trunk/catalog/create_account.php 2014-01-23 21:55:41 UTC (rev 5069)
@@ -75,9 +75,7 @@
);
if(_cst_bool('ACCOUNT_FORCE_ACTIV_MAIL')){
-// var_dump($user);
-// exit;
-// }
+
$cust->the_customer($user->id);
$myarray['_oLinks']= tep_href_link(FILENAME_CREATE_ACCOUNT, 'action=confirm&hash='.$cust->creatValidHash().'&email='.$user->email_address, 'SSL');
$message_final=tep_post_prepare_email('create_account_confirm.tpl',$language,$myarray);
Modified: trunk/catalog/includes/classes/checkout_process.php
===================================================================
--- trunk/catalog/includes/classes/checkout_process.php 2014-01-23 21:41:50 UTC (rev 5068)
+++ trunk/catalog/includes/classes/checkout_process.php 2014-01-23 21:55:41 UTC (rev 5069)
@@ -272,8 +272,8 @@
$query=$DB->query($sql="Select customers_id, date_purchased from " . TABLE_ORDERS . " where orders_type = '-1' AND orders_id = '" . (int)$res[0] . "' ");
$item=$query->fetchAssoc();
// trigger_error(sprintf(__FILE__.'::'.__LINE__, $sql ) , E_USER_ERROR);
-// notification::notif('paypal_ipn', __line__ ,array( 'message'=>print_r($res, true) . print_r($item, true) ));
+
if($item['customers_id'] != (int)$res[1] ) return false;
if($item['date_purchased'] !=$res[2]) return false;
@@ -368,7 +368,7 @@
$total_tax = 0;
for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {
-// var_dump(self::$mode);
+
/**
Process class
Gestion du stock
Modified: trunk/catalog/includes/classes/core_page/customer.php
===================================================================
--- trunk/catalog/includes/classes/core_page/customer.php 2014-01-23 21:41:50 UTC (rev 5068)
+++ trunk/catalog/includes/classes/core_page/customer.php 2014-01-23 21:55:41 UTC (rev 5069)
@@ -364,7 +364,7 @@
/*$res = */$aca_account->userInsert($newcustomer);
// if(!$res)
// $error++;
-// var_dump($error);
+
if( $error > 0){
$DB->rollbackTransaction();
return false;
@@ -764,7 +764,7 @@
private static function PassmessageStack($class, $mess, $type='error'){
global $page;
$methode=self::$methodeMessage;
-// var_dump($class, $mess, $type);
+
$page->messageStack->$methode($class, $mess, $type);
}
Modified: trunk/catalog/includes/classes/core_page/develop.php
===================================================================
--- trunk/catalog/includes/classes/core_page/develop.php 2014-01-23 21:41:50 UTC (rev 5068)
+++ trunk/catalog/includes/classes/core_page/develop.php 2014-01-23 21:55:41 UTC (rev 5069)
@@ -90,8 +90,6 @@
$seo.='</ul>';
-// print_r($page->page['seo_url']);
-
/// list all boxes
reset($page->page['boxes']);
$c_li='This list load boxes in current page'.
Modified: trunk/catalog/includes/classes/discount_coupon.php
===================================================================
--- trunk/catalog/includes/classes/discount_coupon.php 2014-01-23 21:41:50 UTC (rev 5068)
+++ trunk/catalog/includes/classes/discount_coupon.php 2014-01-23 21:55:41 UTC (rev 5069)
@@ -75,8 +75,6 @@
$row = tep_db_fetch_array( $check_code_query ); //since there is one record, we have a valid code
$this->coupon = $row;
-// print_r($this->message);
-// exit;
}
}
Modified: trunk/catalog/includes/classes/drivers/data/categorie.php
===================================================================
--- trunk/catalog/includes/classes/drivers/data/categorie.php 2014-01-23 21:41:50 UTC (rev 5068)
+++ trunk/catalog/includes/classes/drivers/data/categorie.php 2014-01-23 21:55:41 UTC (rev 5069)
@@ -176,7 +176,7 @@
}
}
-// print_r($tabl);
+
// post traitement for calulate other value
foreach($tabl as $key=>$DataRow){
@@ -222,8 +222,7 @@
global $languages_id;
// $listing = DataTypes::GetListing('leftto', 'categorie');
-// var_dump($listing);
-// exit;
+
$query="SELECT ".
// $listing['col_count'] .
// $listing['rows'] .
@@ -246,25 +245,10 @@
" LEFT JOIN " . TABLE_CATEGORIES_DESCRIPTION . " catd ON (cat.categories_id = catd.categories_id AND catd.language_id = '" . self::$lg_id . "' ) ".
" WHERE 1 ";
-
-
-// $query = 'SELECT DISTINCT '.
-//
-// ' ,ggxx.goutegout_id AS id'.
-// ' ,ggxxd.goutegout_title'.
-// ' ,ggxx.goutegout_type AS type'.
-// ' ,ggxxd.goutegout_title AS name'.
-// ' ,ggxxd.goutegout_description AS text'.
-// ' ,ggxx.date_added as date_added'.
-// ' ,ggxx.goutegout_image AS images'.
-// ' '. sprintf($listing['tables'], $listing['col_count'] , 'goutegout', $languages_id ).
-// ' '. $listing['where'].
-// '';
$query .=self::$where_query ." ". DataForceStatus(" AND cat.categories_status='1' "). " " ;
$query .=' ORDER BY ' .(!tep_not_null($orderby)? ' cat.sort_order, catd.categories_name ASC ' : $orderby) ;
-// echo $query;
-// var_dump();
+
if($limit !='0')
$query .=' LIMIT '.(!tep_not_null($limit)? '50' : $limit) ;
@@ -294,8 +278,6 @@
//! soit id soit search name key
self::add_where_query((tep_not_null($id) && is_numeric($id) ? " AND cat.categories_id = '" . (int)$id . "' ": (!empty($search)?" AND ctd.categories_name LIKE '%" . tep_db_input($search) . "%' ":'') ));
$sql=self::cstr_query( (isset($option['orderby'])?(string)$option['orderby']:''),(isset($option['limit'])?(int)$option['limit']:''),(array)@$option) ;
-
-// echo $sql;
$content_query = $DB->query($sql);
self::reset_query();
@@ -380,8 +362,7 @@
self::add_where_query(" AND cat.parent_id = '" . (int)$category_id . "' ");
$db_list=self::get_query();
-// print_r($db_list);
-// exit;
+
if (($count=count($db_list)) && $count > 0)
return $count;
else
Modified: trunk/catalog/includes/classes/drivers/data/content.php
===================================================================
--- trunk/catalog/includes/classes/drivers/data/content.php 2014-01-23 21:41:50 UTC (rev 5068)
+++ trunk/catalog/includes/classes/drivers/data/content.php 2014-01-23 21:55:41 UTC (rev 5069)
@@ -124,19 +124,13 @@
if (empty($exclude))$exclude=array();
$tabl=$res=array();
-// var_dump($content_query);
+
if($content_query != false)
while ($content = $content_query->fetchAssoc()) {
-// var_dump($content_query);
+
if (!in_array($content['name'],$exclude)) {
$res=$content;
-// $res['href']=tep_href_link(FILENAME_CONTENT,'content=' . $content['id']);
-// $res['key']=$content['name'];
-// $res['original']=$content['text'];
-// $res['chapo'] = self::parse_content($content['text'],$content['id'], true);
-// $res['images']=array();
-
$DataRow = new DataListenerRowContent(
$content['id'],
$content['status'],
@@ -154,7 +148,7 @@
// unset($res['text']);
$DataRow->SetText($content['text']);
$DataRow->SetChapo( self::parse_content($content['text'],$content['id'], true) );
-// print_r($DataRow);
+
self::$object_data[$content['id']]=$tabl[$content['id']]=$DataRow; //new objectInfo($res);
// self::$object_data[$content['id']]->text=self::parse_content(@$res['text'],$content['id']);
Modified: trunk/catalog/includes/classes/drivers/data/product.php
===================================================================
--- trunk/catalog/includes/classes/drivers/data/product.php 2014-01-23 21:41:50 UTC (rev 5068)
+++ trunk/catalog/includes/classes/drivers/data/product.php 2014-01-23 21:55:41 UTC (rev 5069)
@@ -304,7 +304,7 @@
global $languages_id;
$listing = DataTypes::GetListing('leftto', 'product');
-// print_r($listing);
+
$query = 'SELECT DISTINCT '.
$listing['col_count'] .
$listing['rows'] .
Modified: trunk/catalog/includes/modules/account/history.php
===================================================================
--- trunk/catalog/includes/modules/account/history.php 2014-01-23 21:41:50 UTC (rev 5068)
+++ trunk/catalog/includes/modules/account/history.php 2014-01-23 21:55:41 UTC (rev 5069)
@@ -167,7 +167,6 @@
$order_name = $row['billing_name'];
}
-// var_dump(htmlentities($row['order_total']));
$n = new objectInfo($row);
$n->date_purchased = tep_date_short($row['date_purchased']);
$n->type = 'order';
Modified: trunk/catalog/includes/modules/checkout/PrShipping.php
===================================================================
--- trunk/catalog/includes/modules/checkout/PrShipping.php 2014-01-23 21:41:50 UTC (rev 5068)
+++ trunk/catalog/includes/modules/checkout/PrShipping.php 2014-01-23 21:55:41 UTC (rev 5069)
@@ -219,8 +219,6 @@
// get all available shipping quotes
$quotes = $shipping_modules->quote();
-// var_dump($quotes);
-
// 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();
Modified: trunk/catalog/includes/modules/listing_cat.php
===================================================================
--- trunk/catalog/includes/modules/listing_cat.php 2014-01-23 21:41:50 UTC (rev 5068)
+++ trunk/catalog/includes/modules/listing_cat.php 2014-01-23 21:55:41 UTC (rev 5069)
@@ -19,7 +19,7 @@
return false;
global $page;
-// var_dump($obj);
+
$languages_id=$page->the_var('languages_id');
$cPath=$page->the_var('cPath');
$category_links=$page->the_var('cPath_array');
Modified: trunk/catalog/newsletters.php
===================================================================
--- trunk/catalog/newsletters.php 2014-01-23 21:41:50 UTC (rev 5068)
+++ trunk/catalog/newsletters.php 2014-01-23 21:55:41 UTC (rev 5069)
@@ -19,7 +19,7 @@
// if()
// NewslettersUtility::UpNewsId($newsid,$custid, $key, $value='now()');
// }
-// print_r($_GET);
+
try {
/// compta
$mode=(!isset($_GET['mode'])? 'view' : $_GET['mode'] );
@@ -68,9 +68,7 @@
$page->post_init();
-// var_dump($module);
-
switch($mode){
/**
Modified: trunk/catalog/templates/defaut/includes/gabarit/account/view.gab
===================================================================
--- trunk/catalog/templates/defaut/includes/gabarit/account/view.gab 2014-01-23 21:41:50 UTC (rev 5068)
+++ trunk/catalog/templates/defaut/includes/gabarit/account/view.gab 2014-01-23 21:55:41 UTC (rev 5069)
@@ -32,7 +32,7 @@
</ul>
</div>
- <?php foreach($ModuleAccount->display_view($_SESSION['customer_id']) as $k=>$aca_mod) : var_dump($aca_mod)?>
+ <?php foreach($ModuleAccount->display_view($_SESSION['customer_id']) as $k=>$aca_mod) : ?>
<?php if($aca_mod->type =='box') : ?>
<?php foreach($aca_mod->conteneur as $row) : ?>
<div class="col-lg-6 box">
Modified: trunk/catalog/templates/defaut/includes/gabarit/pages/shopping_cart.gab
===================================================================
--- trunk/catalog/templates/defaut/includes/gabarit/pages/shopping_cart.gab 2014-01-23 21:41:50 UTC (rev 5068)
+++ trunk/catalog/templates/defaut/includes/gabarit/pages/shopping_cart.gab 2014-01-23 21:55:41 UTC (rev 5069)
@@ -35,7 +35,7 @@
<?php echo $DCart->hidden ; ?>
- <?php $prev=null; foreach($DCart->products as $i=>$product): /*print_r($product);*/?>
+ <?php $prev=null; foreach($DCart->products as $i=>$product): ?>
<?php if($prev != $product['group']['id'] && $product['group'] !=false) : $prev = $product['group']['id']; ?>
<tr id="cart-line-<?php echo $i; ?>" class="cart-line <?php echo ($i%2)?'pair':'impair'; ?>">
Modified: trunk/catalog/templates/defaut/includes/gabarit/product/view.gab
===================================================================
--- trunk/catalog/templates/defaut/includes/gabarit/product/view.gab 2014-01-23 21:41:50 UTC (rev 5068)
+++ trunk/catalog/templates/defaut/includes/gabarit/product/view.gab 2014-01-23 21:55:41 UTC (rev 5069)
@@ -59,7 +59,7 @@
<?php if(count($objectProduct->GetExtra() )> 0 ): ?>
<div class="ExtraFields">
<ul>
- <?php foreach($objectProduct->GetExtra() as $k=>$row): /*print_r($row);*/?>
+ <?php foreach($objectProduct->GetExtra() as $k=>$row): ?>
<li><?php echo ExtraUtility::DisplayRow($row, true, '%s'); ?></li>
<?php endforeach; ?>
</ul>
Modified: trunk/dev/generator/datatype/Modele/catalog/admin/includes/classes/drivers/sql_DATATYPE_REPLACE_.php
===================================================================
--- trunk/dev/generator/datatype/Modele/catalog/admin/includes/classes/drivers/sql_DATATYPE_REPLACE_.php 2014-01-23 21:41:50 UTC (rev 5068)
+++ trunk/dev/generator/datatype/Modele/catalog/admin/includes/classes/drivers/sql_DATATYPE_REPLACE_.php 2014-01-23 21:55:41 UTC (rev 5069)
@@ -256,8 +256,7 @@
$res = $DB->query($sql);
$num = $res->__get('numRows');
-
-// var_dump($num);
+
if($num == 1){
$tmp = $res->fetchAssoc();
Modified: trunk/dev/generator/datatype/Modele/catalog/common/classes/datatype_drivers/Data__DATATYPE_REPLACE_.php
===================================================================
--- trunk/dev/generator/datatype/Modele/catalog/common/classes/datatype_drivers/Data__DATATYPE_REPLACE_.php 2014-01-23 21:41:50 UTC (rev 5068)
+++ trunk/dev/generator/datatype/Modele/catalog/common/classes/datatype_drivers/Data__DATATYPE_REPLACE_.php 2014-01-23 21:55:41 UTC (rev 5069)
@@ -461,7 +461,7 @@
return '_DATATYPE_REPLACE__listing.php';
break;
case 'unique':
-// var_dump(__line__);
+
break;
default:
Modified: trunk/dev/generator/datatype/Modele/catalog/includes/modules/account/ac__DATATYPE_REPLACE_.php
===================================================================
--- trunk/dev/generator/datatype/Modele/catalog/includes/modules/account/ac__DATATYPE_REPLACE_.php 2014-01-23 21:41:50 UTC (rev 5068)
+++ trunk/dev/generator/datatype/Modele/catalog/includes/modules/account/ac__DATATYPE_REPLACE_.php 2014-01-23 21:55:41 UTC (rev 5069)
@@ -96,7 +96,7 @@
* @p $cID int recupere le Session[]
*/
public function check_action($action) {
-// var_dump($action);
+
if(tep_not_null($action)) self::$action = $action;
// if ($action != 'process') return false;
if (!tep_session_is_registered('customer_id')) return false;
Modified: trunk/dev/generator/datatype/Modele/catalog/includes/modules/listing__DATATYPE_REPLACE_.php
===================================================================
--- trunk/dev/generator/datatype/Modele/catalog/includes/modules/listing__DATATYPE_REPLACE_.php 2014-01-23 21:41:50 UTC (rev 5068)
+++ trunk/dev/generator/datatype/Modele/catalog/includes/modules/listing__DATATYPE_REPLACE_.php 2014-01-23 21:55:41 UTC (rev 5069)
@@ -71,7 +71,6 @@
if(get_class($resobj) == 'splitPageResults')
$resobj = $DB->query( $resobj->sql_query ) ;
-// var_dump($resobj);
// type data for process , extract in DataTypes class
// $subtype = DataTypes::GetTypePage('sub');
Modified: trunk/dev/generator/datatype/Modele/catalog/templates/defaut/includes/boxes/_DATATYPE_REPLACE_.php
===================================================================
--- trunk/dev/generator/datatype/Modele/catalog/templates/defaut/includes/boxes/_DATATYPE_REPLACE_.php 2014-01-23 21:41:50 UTC (rev 5068)
+++ trunk/dev/generator/datatype/Modele/catalog/templates/defaut/includes/boxes/_DATATYPE_REPLACE_.php 2014-01-23 21:55:41 UTC (rev 5069)
@@ -53,7 +53,6 @@
$list[] = $tmp;
}
-// var_dump($list);
/**
// @remarks Transmit var array for master construtor boxes
// */
Modified: trunk/dev/generator/datatype/Modele/catalog/templates/defaut/includes/content/_DATATYPE_REPLACE__listing.php
===================================================================
--- trunk/dev/generator/datatype/Modele/catalog/templates/defaut/includes/content/_DATATYPE_REPLACE__listing.php 2014-01-23 21:41:50 UTC (rev 5068)
+++ trunk/dev/generator/datatype/Modele/catalog/templates/defaut/includes/content/_DATATYPE_REPLACE__listing.php 2014-01-23 21:55:41 UTC (rev 5069)
@@ -23,7 +23,7 @@
@remarks Generic RootListing is detail current master , header listing
*/
$RootListing=$page->GetVar('RootListing');
-// var_dump($RootListing);
+
/**
@remarks Pre-load module no-type
*/
@@ -40,8 +40,8 @@
// else
// $page->oscss_modules->_add(FILENAME_NEW_PRODUCTS,'center');
$page->oscss_modules->_add('listing.php','center', array('listing_split'=>$listing_split,'listing_query'=>@$listing_query) );
-
-// $page->oscss_modules->_add('listing__DATATYPE_REPLACE_.php','center');
+ else
+ $page->oscss_modules->_add('listing__DATATYPE_REPLACE_.php','center');
$SectionTplPC = new SectionTpl(
tep_output_string_protected(tep_get_include_contents('pages/listing'),false,true) ,
Modified: trunk/dev/install/install.php
===================================================================
--- trunk/dev/install/install.php 2014-01-23 21:41:50 UTC (rev 5068)
+++ trunk/dev/install/install.php 2014-01-23 21:55:41 UTC (rev 5069)
@@ -144,8 +144,7 @@
$_POST['DBMOTOR_CHARSET']= 'UTF-8';
$_POST['DBMOTOR_PORT']= '3306';
$_POST['DBMOTOR_TYPE']= 'MyISAM';
-// print_r($_POST);
-// exit;
+
$_POST['DB_TEST_CONNECTION']= 'true';
$_POST['install']['modes'] = 'install';
Modified: trunk/extensions/ELECTRONIX_stable/electronix/popup.php
===================================================================
--- trunk/extensions/ELECTRONIX_stable/electronix/popup.php 2014-01-23 21:41:50 UTC (rev 5068)
+++ trunk/extensions/ELECTRONIX_stable/electronix/popup.php 2014-01-23 21:55:41 UTC (rev 5069)
@@ -21,7 +21,7 @@
</div>
<?php endwhile; ?>
</div>
-<?php /*$page->debugg('modules'); *//*print_r($box_left);*/ ?>
+<?php /*$page->debugg('modules'); */ ?>
<br style="clear:both" />
</div>
</body>
Modified: trunk/extensions/LISTING_ORDER_stable/catalog/admin/includes/modules/categories/listing_order.php
===================================================================
--- trunk/extensions/LISTING_ORDER_stable/catalog/admin/includes/modules/categories/listing_order.php 2014-01-23 21:41:50 UTC (rev 5068)
+++ trunk/extensions/LISTING_ORDER_stable/catalog/admin/includes/modules/categories/listing_order.php 2014-01-23 21:55:41 UTC (rev 5069)
@@ -142,21 +142,17 @@
$DB=Database::getInstance();
-// var_dump($cat);
-// exit;
if(is_object($cat)){
$datatype = $cat->datatype;
$cat_id = $cat->id;
}
elseif(class_exists('categories') && isset(categories::$cInfo)){
-// var_dump(categories::$cInfo);
+
$cat_id = categories::$cInfo->categories_id;
$datatype = categories::$cInfo->categories_datatype;
}
// elseif(is_int($cat) /*&& ()*/ ){
// // $catval= sqlcategorie::fetch(array('id'=>$cat), true);
-// var_dump($catval);
-// exit;
// $cat_id = $catval->id;
// $datatype = $catval->datatype; //categories::$cInfo->categories_datatype;
// }
Modified: trunk/extensions/RESTRICTACCES_stable/catalog/includes/modules/categories/RestrictAcces.php
===================================================================
--- trunk/extensions/RESTRICTACCES_stable/catalog/includes/modules/categories/RestrictAcces.php 2014-01-23 21:41:50 UTC (rev 5068)
+++ trunk/extensions/RESTRICTACCES_stable/catalog/includes/modules/categories/RestrictAcces.php 2014-01-23 21:55:41 UTC (rev 5069)
@@ -59,7 +59,6 @@
if(empty($cID))return $this->content= false;
$product_query = tep_db_query($sql="select * from " . TABLE_CATEGORIES_EXTRA . " where categories_id='".$cID."' ");
-// var_dump($sql);
foreach($product_query->fetchAllAssoc() as $item)
$this->content[$item['cat_key']]= $item['cat_value'];
Modified: trunk/extensions/REVIEWS_stable/catalog/admin/includes/modules/account/reviews.php
===================================================================
--- trunk/extensions/REVIEWS_stable/catalog/admin/includes/modules/account/reviews.php 2014-01-23 21:41:50 UTC (rev 5068)
+++ trunk/extensions/REVIEWS_stable/catalog/admin/includes/modules/account/reviews.php 2014-01-23 21:55:41 UTC (rev 5069)
@@ -33,7 +33,7 @@
global $language;
$this->language = $language;
-// var_dump(__file__);
+
require_once(DIR_FS_CATALOG . DIR_WS_COMMON_CLASSES /*. 'classes/'*/ .'common_reviews.php' );
$this->common=new common_reviews();
@@ -47,7 +47,6 @@
$languages = tep_get_languages();
$messageStack=messageStack::getInstance();
-// var_dump(__file__);
switch(self::$action){
case 'noedit':
Modified: trunk/test/phpunit/Back/modules/pages/pageproductsTest.php
===================================================================
--- trunk/test/phpunit/Back/modules/pages/pageproductsTest.php 2014-01-23 21:41:50 UTC (rev 5068)
+++ trunk/test/phpunit/Back/modules/pages/pageproductsTest.php 2014-01-23 21:55:41 UTC (rev 5069)
@@ -41,7 +41,6 @@
// public function testCheckIncludeBaseClassproducts()
// {
// global $base_path;
-// // var_dump($base_path.'includes/modules/page/'.$this->forclass.'.php');
// if( !include_once($base_path.'includes/modules/page/'.$this->forclass.'.php') )
// $this->assertFalse(true , 'Class master file not exist');
//
Modified: trunk/test/phpunit/Back/sqlxxx/sqlcustomersTest.php
===================================================================
--- trunk/test/phpunit/Back/sqlxxx/sqlcustomersTest.php 2014-01-23 21:41:50 UTC (rev 5068)
+++ trunk/test/phpunit/Back/sqlxxx/sqlcustomersTest.php 2014-01-23 21:55:41 UTC (rev 5069)
@@ -86,7 +86,7 @@
}
catch(Exception $e){
-// print_r($e);
+
var_dump( 'Error testcustomersNotExists Exception' );
}
}
Modified: trunk/test/phpunit/Front/productTest.php
===================================================================
--- trunk/test/phpunit/Front/productTest.php 2014-01-23 21:41:50 UTC (rev 5068)
+++ trunk/test/phpunit/Front/productTest.php 2014-01-23 21:55:41 UTC (rev 5069)
@@ -62,7 +62,6 @@
$this -> assertTrue ( ( is_object( $obj) ) , 'productload driver error' ) ;
// $this->assertArrayHasKey('id', $row);
-// var_dump($obj);
foreach($obj as $key=>$value){
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2014-01-23 21:41:56
|
Revision: 5068
http://sourceforge.net/p/oscss/svn/5068
Author: oscim
Date: 2014-01-23 21:41:50 +0000 (Thu, 23 Jan 2014)
Log Message:
-----------
Delete debugg code
Modified Paths:
--------------
trunk/catalog/admin/editeur/tiny_mce/plugins/tinybrowser/fns_tinybrowser.php
trunk/catalog/admin/editeur/tiny_mce/plugins/tinybrowser/tinybrowser.php
trunk/catalog/admin/includes/classes/DataFileSql.php
trunk/catalog/admin/includes/classes/drivers/sqlproductsextrafields.php
trunk/catalog/admin/includes/classes/menu.php
trunk/catalog/admin/includes/classes/osCSS_export.php
trunk/catalog/admin/includes/classes/osC_ErrorHandler.php
trunk/catalog/admin/includes/exts/package/packageInstaller.php
trunk/catalog/admin/includes/gabarit/backup/display_view.viewalldb.gab
trunk/catalog/admin/includes/gabarit/configuration/datatypeaccount.listing.gab
trunk/catalog/admin/includes/gabarit/configuration/datatypecategorie.listing.gab
trunk/catalog/admin/includes/gabarit/configuration/datatypecontent.listing.gab
trunk/catalog/admin/includes/gabarit/configuration/datatypeproduct.listing.gab
trunk/catalog/admin/includes/gabarit/configuration/modexpedition.listing.gab
trunk/catalog/admin/includes/gabarit/configuration/modorder.listing.gab
trunk/catalog/admin/includes/gabarit/configuration/modpayment.listing.gab
trunk/catalog/admin/includes/gabarit/mail/display_view.mail.view.gab
trunk/catalog/admin/includes/gabarit/newsletters/display_view.sendtest.gab
trunk/catalog/admin/includes/gabarit/orders/display_view.edit.gab
trunk/catalog/admin/includes/gabarit/products/stock.listing.gab
trunk/catalog/admin/includes/gabarit/shipping/display_view.multi-action.gab
trunk/catalog/admin/includes/gabarit/tax_classes/display_view.edit.gab
trunk/catalog/admin/includes/header.php
trunk/catalog/admin/includes/modules/configuration/modseourl.php
trunk/catalog/admin/includes/modules/pages/categories.php
trunk/catalog/admin/includes/modules/pages/products.php
trunk/catalog/admin/includes/widget/homeStock.php
trunk/catalog/checkout_confirmation.php
trunk/catalog/common/classes/DataTypes.php
trunk/catalog/common/classes/shoppingCart.php
trunk/catalog/includes/application_bottom.php
trunk/catalog/includes/classes/core_page/listing.php
trunk/catalog/includes/classes/pad_base_multi.php
trunk/catalog/includes/functions/initialize.php
trunk/catalog/includes/modules/listing_featured.php
trunk/catalog/install/includes/content/core.configuration.php
trunk/catalog/install/includes/content/core.installdb.php
trunk/catalog/templates/defaut/includes/boxes/myaccount.php
trunk/catalog/templates/defaut/includes/boxes/recently_viewed.php
trunk/catalog/templates/defaut/includes/content/index_listing.php
trunk/catalog/templates/defaut/includes/gabarit/box.generic.gab
trunk/dev/generator/datatype/Modele/catalog/admin/includes/classes/drivers/sql_DATATYPE_REPLACE_.php
trunk/dev/generator/datatype/Modele/catalog/admin/includes/classes/drivers/sql_DATATYPE_REPLACE_extrafields.php
trunk/dev/generator/datatype/Modele/catalog/common/classes/datatype_drivers/Data__DATATYPE_REPLACE_.php
trunk/dev/generator/datatype/Modele/catalog/includes/modules/_DATATYPE_REPLACE_/_DATATYPE_REPLACE_SEOTAG__criteres.php
trunk/dev/generator/datatype/Modele/catalog/includes/modules/listing__DATATYPE_REPLACE_.php
trunk/dev/generator/datatype/Modele/catalog/includes/modules/listing__DATATYPE_REPLACE__childs.php
trunk/dev/generator/datatype/Modele/catalog/templates/defaut/includes/gabarit/_DATATYPE_REPLACE_/account.display_view.page.gab
trunk/extensions/ATTRIBUTEMANAGER_stable/attributeManager/attributeManager.php
trunk/extensions/ATTRIBUTEMANAGER_stable/attributeManager/classes/attributeManager.class.php
trunk/extensions/ATTRIBUTEMANAGER_stable/attributeManager/classes/attributeManagerAtomic.class.php
trunk/extensions/ATTRIBUTEMANAGER_stable/attributeManager/classes/attributeManagerInstant.class.php
trunk/extensions/CUSTOMERS_GROUPS_stable/catalog/admin/includes/modules/account/sppc_cust_force.php
trunk/extensions/ELECTRONIX_stable/electronix/includes/modules/generic/cat_home.php
trunk/extensions/HELPDESK_stable/catalog/templates/defaut/includes/gabarit/helpdesk/account.display_view.add.gab
trunk/extensions/HELPDESK_stable/catalog/templates/defaut/includes/gabarit/helpdesk/account.display_view.page.gab
trunk/extensions/PAYPAL_IPN_stable/catalog/includes/modules/payment/paypal_ipn/paypal_ipn.php
trunk/extensions/REVIEWS_stable/catalog/includes/modules/content/reviews.php
trunk/extensions/SPECIALS_stable/catalog/admin/includes/gabarit/specials/products.display_view.inline.gab
trunk/extensions/SPECIALS_stable/catalog/admin/includes/modules/products/specials.php
trunk/test/phpunit/Back/classes/allClassSeoUrlTest.php
trunk/test/phpunit/Back/sqlxxx/sqlcategoriesTest.php
trunk/test/phpunit/Back/sqlxxx/sqlcustomersTest.php
trunk/test/phpunit/Front/paymentTest.php
trunk/test/phpunit/Front/productTest.php
Modified: trunk/catalog/admin/editeur/tiny_mce/plugins/tinybrowser/fns_tinybrowser.php
===================================================================
--- trunk/catalog/admin/editeur/tiny_mce/plugins/tinybrowser/fns_tinybrowser.php 2014-01-23 20:57:07 UTC (rev 5067)
+++ trunk/catalog/admin/editeur/tiny_mce/plugins/tinybrowser/fns_tinybrowser.php 2014-01-23 21:41:50 UTC (rev 5068)
@@ -13,7 +13,6 @@
static public function BrowseFiles($browsepath, $findnow=''){
global $tinybrowser, $typenow;
-// print_r($tinybrowser);
// Read directory contents and populate $file array
$dh = opendir($tinybrowser['docroot'].$browsepath);
@@ -21,7 +20,6 @@
$u=0;
while (($filename = readdir($dh)) !== false)
{
-
// get file extension
$nameparts = explode('.',$filename);
$ext = end($nameparts);
Modified: trunk/catalog/admin/editeur/tiny_mce/plugins/tinybrowser/tinybrowser.php
===================================================================
--- trunk/catalog/admin/editeur/tiny_mce/plugins/tinybrowser/tinybrowser.php 2014-01-23 20:57:07 UTC (rev 5067)
+++ trunk/catalog/admin/editeur/tiny_mce/plugins/tinybrowser/tinybrowser.php 2014-01-23 21:41:50 UTC (rev 5068)
@@ -127,8 +127,7 @@
// sort files by selected order
sortfileorder($sortbynow,$sortorder,$file);
}
-// print_r($file);
-// // exit;
+
// determine pagination
if($tinybrowser['pagination']>0)
{
@@ -233,8 +232,8 @@
?></div>
<?php
-// print_r($file);
+
// if image show dimensions header
if($typenow=='image')
{
Modified: trunk/catalog/admin/includes/classes/DataFileSql.php
===================================================================
--- trunk/catalog/admin/includes/classes/DataFileSql.php 2014-01-23 20:57:07 UTC (rev 5067)
+++ trunk/catalog/admin/includes/classes/DataFileSql.php 2014-01-23 21:41:50 UTC (rev 5068)
@@ -124,7 +124,7 @@
preg_match_all ('#(PRIMARY KEY[ ]{1,}[\(]([a-z_, ]*)[\)])#i' ,$buf, $match3);
$test3[] = ((count($match3[0])>0)? true : false );
-// print_r($match);
+
if(count($match3[0])>0)
$obj->primarykey = @$match3[2][0];
}
Modified: trunk/catalog/admin/includes/classes/drivers/sqlproductsextrafields.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlproductsextrafields.php 2014-01-23 20:57:07 UTC (rev 5067)
+++ trunk/catalog/admin/includes/classes/drivers/sqlproductsextrafields.php 2014-01-23 21:41:50 UTC (rev 5068)
@@ -92,7 +92,7 @@
if(isset($option['admin'])) $sql_data_array['epf_admin'] = (string)tep_db_prepare_input($option['admin']);
if(isset($option['special_mod'])) $sql_data_array['epf_special_mod'] = tep_db_prepare_input($option['special_mod']);
if(isset($option['active_value_language'])) $sql_data_array['epf_active_value_language'] = tep_db_prepare_input($option['active_value_language']);
-// print_r($option);
+
$res=tep_db_perform(TABLE_PRODUCTS_EXTRA_FIELDS, $sql_data_array, 'update' , substr($where,3) );
return $res;
Modified: trunk/catalog/admin/includes/classes/menu.php
===================================================================
--- trunk/catalog/admin/includes/classes/menu.php 2014-01-23 20:57:07 UTC (rev 5067)
+++ trunk/catalog/admin/includes/classes/menu.php 2014-01-23 21:41:50 UTC (rev 5068)
@@ -256,7 +256,7 @@
$i=0;$ssmenu=0;$link1='';
$array_s=array();
while ($r=each($array)){
-// print_r($r['value']);
+
if (isset($r['value'][0]) && $r['value'][0] == 'separateur') {
$acl_for_ctr=md5(str_replace('&','&',$r['value'][0]));
$array_s[$r['key']]=array('type'=>'separateur',
@@ -389,7 +389,6 @@
$this->add_option($option);
$this->menu_acl=$this->in_sql_for_user($this->for_user);
-// print_r($this->menu_w);
$menu= $this->cstr_tbl_rec($this->menu_w);
return $menu;
@@ -409,13 +408,8 @@
*/
public function cstr_return($option=''){
$this->add_option($option);
-
-// echo $this->for_user;
$this->menu_acl=$this->in_sql_for_user($this->for_user);
-// print_r($this->menu_acl);
-// print_r($this->menu_w);
$menu= $this->cstr_tbl_rec2($this->menu_w,false,true);
-// print_r($menu);
return $menu;
}
}
Modified: trunk/catalog/admin/includes/classes/osCSS_export.php
===================================================================
--- trunk/catalog/admin/includes/classes/osCSS_export.php 2014-01-23 20:57:07 UTC (rev 5067)
+++ trunk/catalog/admin/includes/classes/osCSS_export.php 2014-01-23 21:41:50 UTC (rev 5068)
@@ -84,9 +84,6 @@
foreach($this->content as $item)
$data[]=$exp->FormatLigneValue($item);
-// print_r($data);
-// exit;
-
header ("Content-type: application/".$this->mode."; chartset=".$this->encodage);
header ("Content-Disposition:filename=".$this->export_type."_".$this->page.".".$this->mode);
header ("Content-type:application/octetstream");
Modified: trunk/catalog/admin/includes/classes/osC_ErrorHandler.php
===================================================================
--- trunk/catalog/admin/includes/classes/osC_ErrorHandler.php 2014-01-23 20:57:07 UTC (rev 5067)
+++ trunk/catalog/admin/includes/classes/osC_ErrorHandler.php 2014-01-23 21:41:50 UTC (rev 5068)
@@ -33,7 +33,6 @@
throw new Exception();
}
catch (MyException $e) {
-// print_r($e);
echo("FATAL:: Caught MyException ('{$e->__toString()}')\n{$e}\n" );
}
catch (Exception $e) {
Modified: trunk/catalog/admin/includes/exts/package/packageInstaller.php
===================================================================
--- trunk/catalog/admin/includes/exts/package/packageInstaller.php 2014-01-23 20:57:07 UTC (rev 5067)
+++ trunk/catalog/admin/includes/exts/package/packageInstaller.php 2014-01-23 21:41:50 UTC (rev 5068)
@@ -184,14 +184,12 @@
if(!$obj)
return false;
-error_reporting(E_ALL);
$obj=$obj[0];
$cip= new CIP( (string)$obj->item->ident.'_'.(string)$obj->item->level.'.zip');
$r=$cip->install(false);
- var_dump($r);
-// print_r(ErrorAndBlockProcess::$ArrayError);
+
if (ErrorAndBlockProcess::$error) {
$messageStack->add('error in process install', 'error');
$tp = '<h4 class="error">'. __('error in process install'). '</h4>'.
@@ -207,7 +205,6 @@
$array[]=$tp;
-// parent::$Rightlist
}
else
$messageStack->add(__('msg was installed'), 'installed');
Modified: trunk/catalog/admin/includes/gabarit/backup/display_view.viewalldb.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/backup/display_view.viewalldb.gab 2014-01-23 20:57:07 UTC (rev 5067)
+++ trunk/catalog/admin/includes/gabarit/backup/display_view.viewalldb.gab 2014-01-23 21:41:50 UTC (rev 5068)
@@ -102,7 +102,7 @@
</tr>
</thead>
<tbody>
- <?php foreach($DBIndex->all['lang'] as $k=>$row): /*print_r($row);*/ ?>
+ <?php foreach($DBIndex->all['lang'] as $k=>$row): ?>
<tr>
<td><?php echo $row['name'] ; ?></td>
<td><?php echo $DBIndex->all['table'][$k]['keyPrim'] ; ?></td>
Modified: trunk/catalog/admin/includes/gabarit/configuration/datatypeaccount.listing.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/configuration/datatypeaccount.listing.gab 2014-01-23 20:57:07 UTC (rev 5067)
+++ trunk/catalog/admin/includes/gabarit/configuration/datatypeaccount.listing.gab 2014-01-23 21:41:50 UTC (rev 5068)
@@ -49,7 +49,7 @@
</tr>
</thead>
<tbody>
- <?php foreach(datatypeaccount::$module as $row): /*print_r($row)*/ ?>
+ <?php foreach(datatypeaccount::$module as $row): ?>
<tr>
<td><?php echo $row->content->code; ?></td>
<td><?php echo $row->content->title; ?></td>
Modified: trunk/catalog/admin/includes/gabarit/configuration/datatypecategorie.listing.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/configuration/datatypecategorie.listing.gab 2014-01-23 20:57:07 UTC (rev 5067)
+++ trunk/catalog/admin/includes/gabarit/configuration/datatypecategorie.listing.gab 2014-01-23 21:41:50 UTC (rev 5068)
@@ -93,7 +93,7 @@
</tr>
</thead>
<tbody>
- <?php foreach(datatypecategorie::$module as $row): /*print_r($row)*/ ?>
+ <?php foreach(datatypecategorie::$module as $row): ?>
<tr>
<td><?php echo $row->content->code; ?></td>
<td><?php echo $row->content->title; ?></td>
Modified: trunk/catalog/admin/includes/gabarit/configuration/datatypecontent.listing.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/configuration/datatypecontent.listing.gab 2014-01-23 20:57:07 UTC (rev 5067)
+++ trunk/catalog/admin/includes/gabarit/configuration/datatypecontent.listing.gab 2014-01-23 21:41:50 UTC (rev 5068)
@@ -104,7 +104,7 @@
</tr>
</thead>
<tbody>
- <?php foreach(datatypecontent::$module as $row): /*print_r($row)*/ ?>
+ <?php foreach(datatypecontent::$module as $row): ?>
<tr>
<td><?php echo $row->content->code; ?></td>
<td><?php echo $row->content->title; ?></td>
Modified: trunk/catalog/admin/includes/gabarit/configuration/datatypeproduct.listing.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/configuration/datatypeproduct.listing.gab 2014-01-23 20:57:07 UTC (rev 5067)
+++ trunk/catalog/admin/includes/gabarit/configuration/datatypeproduct.listing.gab 2014-01-23 21:41:50 UTC (rev 5068)
@@ -152,7 +152,7 @@
</tr>
</thead>
<tbody>
- <?php foreach(datatypeproduct::$module as $row): /*print_r($row)*/ ?>
+ <?php foreach(datatypeproduct::$module as $row): ?>
<tr>
<td><?php echo $row->content->code; ?></td>
<td><?php echo $row->content->title; ?></td>
Modified: trunk/catalog/admin/includes/gabarit/configuration/modexpedition.listing.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/configuration/modexpedition.listing.gab 2014-01-23 20:57:07 UTC (rev 5067)
+++ trunk/catalog/admin/includes/gabarit/configuration/modexpedition.listing.gab 2014-01-23 21:41:50 UTC (rev 5068)
@@ -173,7 +173,7 @@
</tr>
</thead>
<tbody>
- <?php foreach(modexpedition::$module as $row): /*print_r($row)*/ ?>
+ <?php foreach(modexpedition::$module as $row): ?>
<tr>
<td><?php echo $row->content->code; ?></td>
<td><?php echo $row->content->title; ?></td>
Modified: trunk/catalog/admin/includes/gabarit/configuration/modorder.listing.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/configuration/modorder.listing.gab 2014-01-23 20:57:07 UTC (rev 5067)
+++ trunk/catalog/admin/includes/gabarit/configuration/modorder.listing.gab 2014-01-23 21:41:50 UTC (rev 5068)
@@ -167,7 +167,7 @@
</tr>
</thead>
<tbody>
- <?php foreach(modorder::$module as $row): /*print_r($row)*/ ?>
+ <?php foreach(modorder::$module as $row): ?>
<tr>
<td><?php echo $row->content->code; ?></td>
<td><?php echo $row->content->title; ?></td>
Modified: trunk/catalog/admin/includes/gabarit/configuration/modpayment.listing.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/configuration/modpayment.listing.gab 2014-01-23 20:57:07 UTC (rev 5067)
+++ trunk/catalog/admin/includes/gabarit/configuration/modpayment.listing.gab 2014-01-23 21:41:50 UTC (rev 5068)
@@ -89,7 +89,7 @@
</tr>
</thead>
<tbody>
- <?php foreach(modpayment::$module as $row): /*print_r($row)*/ ?>
+ <?php foreach(modpayment::$module as $row): ?>
<tr>
<td><?php echo $row->content->code; ?></td>
<td><?php echo $row->content->title; ?></td>
Modified: trunk/catalog/admin/includes/gabarit/mail/display_view.mail.view.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/mail/display_view.mail.view.gab 2014-01-23 20:57:07 UTC (rev 5067)
+++ trunk/catalog/admin/includes/gabarit/mail/display_view.mail.view.gab 2014-01-23 21:41:50 UTC (rev 5068)
@@ -9,10 +9,6 @@
@encode UTF-8
*/
global $oscss;
-
-// $res =
-
-// print_r(mail::$mInfo->customers);
?>
<h3><?php echo __('@mail heading title view mail') ?></h3>
Modified: trunk/catalog/admin/includes/gabarit/newsletters/display_view.sendtest.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/newsletters/display_view.sendtest.gab 2014-01-23 20:57:07 UTC (rev 5067)
+++ trunk/catalog/admin/includes/gabarit/newsletters/display_view.sendtest.gab 2014-01-23 21:41:50 UTC (rev 5068)
@@ -8,7 +8,6 @@
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
*/
-// print_r($_SESSION['login_email_address']);
?>
<h3><?php echo __('text info send newsletters') ?></h3>
Modified: trunk/catalog/admin/includes/gabarit/orders/display_view.edit.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/orders/display_view.edit.gab 2014-01-23 20:57:07 UTC (rev 5067)
+++ trunk/catalog/admin/includes/gabarit/orders/display_view.edit.gab 2014-01-23 21:41:50 UTC (rev 5068)
@@ -480,7 +480,7 @@
</tr>
</thead>
<tbody>
- <?php $i = 0; foreach (orders::$order->allshipping as $ashipping): $i++; /*print_r($ashipping);*/?>
+ <?php $i = 0; foreach (orders::$order->allshipping as $ashipping): $i++; ?>
<?php if(isset($ashipping->row_id)): ?>
<tr>
<td class="tcenter">
@@ -526,7 +526,7 @@
</tr>
</thead>
<tbody>
- <?php $i = 0; foreach (orders::$order->pshipping as $pshipping): $i++;/* print_r($pshipping);*/ ?>
+ <?php $i = 0; foreach (orders::$order->pshipping as $pshipping): $i++; ?>
<tr>
<td class="tcenter">
<strong>
Modified: trunk/catalog/admin/includes/gabarit/products/stock.listing.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/products/stock.listing.gab 2014-01-23 20:57:07 UTC (rev 5067)
+++ trunk/catalog/admin/includes/gabarit/products/stock.listing.gab 2014-01-23 21:41:50 UTC (rev 5068)
@@ -34,8 +34,7 @@
</tr>
</thead>
<tbody>
- <?php foreach( stock::tep_get_list() as $row ) :
- /*print_r($tracked_stock->db_attribute_value( $row['products_id']));*/?>
+ <?php foreach( stock::tep_get_list() as $row ) :?>
<?php if( ($allattrib = stock::GetStockOneProduct( $row['products_id'])) ==false ): ?>
Modified: trunk/catalog/admin/includes/gabarit/shipping/display_view.multi-action.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/shipping/display_view.multi-action.gab 2014-01-23 20:57:07 UTC (rev 5067)
+++ trunk/catalog/admin/includes/gabarit/shipping/display_view.multi-action.gab 2014-01-23 21:41:50 UTC (rev 5068)
@@ -9,7 +9,7 @@
@encode UTF-8
*/
global $mutliactionmenu, $mutliactionchoose;
-// print_r($_POST);
+
?>
<div class="box_uniq block_form main-shipping">
Modified: trunk/catalog/admin/includes/gabarit/tax_classes/display_view.edit.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/tax_classes/display_view.edit.gab 2014-01-23 20:57:07 UTC (rev 5067)
+++ trunk/catalog/admin/includes/gabarit/tax_classes/display_view.edit.gab 2014-01-23 21:41:50 UTC (rev 5068)
@@ -68,7 +68,7 @@
</tr>
</thead>
<tbody>
- <?php foreach(tax_classes::$Info->childs as $row): /*print_r($row);*/?>
+ <?php foreach(tax_classes::$Info->childs as $row): ?>
<tr class="view parent dataTableRow">
<td><?php echo $row->description; ?></td>
<td><?php echo $row->priority; ?></td>
Modified: trunk/catalog/admin/includes/header.php
===================================================================
--- trunk/catalog/admin/includes/header.php 2014-01-23 20:57:07 UTC (rev 5067)
+++ trunk/catalog/admin/includes/header.php 2014-01-23 21:41:50 UTC (rev 5068)
@@ -173,8 +173,7 @@
"aoColumns": [
<?php ?>
<?php if( ($col=call_user_func(array(tep_extrac_querystring(JSONSTATMENT,'type'), 'tep_get_modele') )) && is_array($col)):
- $col2=call_user_func(array(tep_extrac_querystring(JSONSTATMENT,'type'), 'tep_get_modele'), array('modele2') ); /*print_r($col); print_r($col2);
-exit; */ ?>
+ $col2=call_user_func(array(tep_extrac_querystring(JSONSTATMENT,'type'), 'tep_get_modele'), array('modele2') ); ?>
<?php $i=0; foreach($col as $k=>$row):
Modified: trunk/catalog/admin/includes/modules/configuration/modseourl.php
===================================================================
--- trunk/catalog/admin/includes/modules/configuration/modseourl.php 2014-01-23 20:57:07 UTC (rev 5067)
+++ trunk/catalog/admin/includes/modules/configuration/modseourl.php 2014-01-23 21:41:50 UTC (rev 5068)
@@ -80,8 +80,7 @@
@brief save page groupe
*/
case 'save_mutli':
-// error_reporting(E_ALL);
-// print_r($_POST);
+
if(tep_not_null($gID) ){
$list=sqlconfiguration::fetch(array('group_id'=> (int)$gID), true);
Modified: trunk/catalog/admin/includes/modules/pages/categories.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/categories.php 2014-01-23 20:57:07 UTC (rev 5067)
+++ trunk/catalog/admin/includes/modules/pages/categories.php 2014-01-23 21:41:50 UTC (rev 5068)
@@ -1,55 +1,1069 @@
-<?php
+<?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 04/10/2013, 08:18
- @author oscim <mail aur...@os...> <www http://www.oscim.fr>
- @encode UTF-8
- @group boxes
- *\file includes/boxes/categories.php
- *\brief display process calcul category, and retrun array
+ @licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
+ @portion code Copyright (c) 2002 osCommerce
+ @package osCSS-2 <www http://www.oscss.org>
+ @version 2.1.2
+ @date 22/09/2013, 09:32
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+ @brief manage category and module aca for cat
*/
- //! @remarks depend Data_product active
- if( ! DataTypes::is_active('categorie'))
- return false;
-
/**
- @remarks Process Specific Boxes
+ @class categories
+ @brief master class edit and manage cat
*/
- // require_once(DIR_WS_CLASSES . 'category_tree.php'); // autoload
- $CategoryTree = new category_tree;
- $osCSS_Cache=new osCSS_Cache;
- $cPath=$page->GetVar('cPath');
- $language=$page->GetVar('language');
- $tableau='';
- global $tableau;
+class categories
+ extends ModTwo /// new abstract class for nextgen module
+ implements
+ InterfaceModule,
+ ExtModConfig,
+ InterfacedTJsonS,
+ InterfacedInnerHtml
+ {
- if(strpos($cPath,'_') > 0)
- $CCCAT = substr($cPath,0, strpos($cPath,'_'));
- else
- $CCCAT = $cPath;
+ const FILENAME = FILENAME_CATEGORIES;
+ /**
+ @var int current id
+ */
+ public static $Id;
+ /**
+ @var array $languages
+ */
+ public static $languages;
+ /**
+ @var array $cPath
+ */
+ public static $cPath;
+ /**
+ @var array $current_category_id
+ */
+ public static $current_category_id;
+ /**
+ @var array $DiversInfo transport var
+ */
+ public static $DiversInfo;
+ /**
+ @var array $actions
+ */
+ public static $actions;
- $subcat= $CategoryTree->getTree($CCCAT);
- if (($osCSS_Cache->read('categoriesBox-' . $language .'-cpath-'.$cPath.'-type', 720) === false) ) {
+ public function __construct(){
+ self::GetConf();
+ }
- $CategoryTree->setSpacerString('', 2);
- $tableau = $CategoryTree->getTree() ;
+ /**
+ @brief Load , adjust and define var environement exe for module
+ Is use in module and class abstract for init value config this module
+ */
+ public static function GetConf(){
+ global $languages_id;
- $s=tep_get_include_contents('box.categories');
+ self::$code=__CLASS__;
+ self::$datatype='categorie';
- $osCSS_Cache->writeBuffer($s);
+
+ self::$action=(isset($_REQUEST['action'])? $_REQUEST['action'] : 'listing' );
+ self::$Id=(isset($_REQUEST['cID'])? (int)$_REQUEST['cID'] : 0 );
+ self::$cPath=(isset($_GET['cPath'])? (int)$_GET['cPath'] : 0);
+
+ /**
+ @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.(isset($_GET['cPath'])?'&cPath='.$_GET['cPath']:''));
+ //! detail item in ajax
+ define('AJAXSTATMENTDETAIL', 'mod=page&type='.self::$code);
+ }
+
+ /**
+ TODO : remplacer le nom de constante par un MODULE_CATEGORIES_INSTALLED_BO
+ */
+ self::$modules=new AcaFactory('categories','MODULE_ACACAT_INSTALLED_BO');
+ self::$modules->set_image_handler();
+
+ self::$languages = tep_get_languages();
+
+
+ // construct list datatype possible
+ $DT = DataTypes::getInstance();
+ $dt = array( array('id'=>'', 'text'=>__('input datatype value none') ) );
+ foreach($DT->GetTypeForRootListing() as $k=>$row)
+ $dt[] = array('id'=>$row, 'text'=>$row );
+ // construct list cats parent
+ $list_parent= array(array('id'=>0, 'text'=>__('text categorie racine')) );
+ $echap_childs_cats = array();
+ foreach(get_cat_list(0) as $v)
+ $list_parent[] = array('id'=>$v['categories_id'], 'text'=>$v['categories_name']);
+
+
+ /**
+ @remarks define var execution sql in GetDBValue()
+ */
+ self::$InitInfo['adjust']=array(
+ 'languages_id'=>$languages_id,
+ 'page'=>1,
+ 'rowbyp'=>10,
+ 'sOrder'=>'',
+ 'sWhere'=>'',
+ );
+
+
+ MGabCont::SetCurrentName(__CLASS__);
+
+ self::$allfields = array();
+
+ self::$allfields['cat.categories_id'] = array(
+ 'sort'=>true,
+ 'alias'=>'id',
+ 'text'=>__('categories table heading id'),
+ 'default'=>true,
+ 'width'=>'5%',
+ 'class'=>'tcenter',
+ );
+
+ self::$allfields['cat.categories_image'] = array(
+ 'sort'=>true,
+ 'alias'=>'image',
+ 'text'=>__('categories table heading image'),
+ 'default'=>true,
+ 'width'=>'5%',
+ 'class'=>'tcenter',
+ 'edit'=>array(
+ 'input_name'=>'categories_image',
+ 'input_type'=>'input@image',
+// 'input_size'=>'1',
+// 'class'=>'tleft',
+// 'select_values'=>$list_parent,
+ 'position_grp'=>4,
+ 'position_col'=>'right',
+ ),
+
+ );
+ self::$allfields['cat.categories_cpath'] = array(
+ 'sort'=>true,
+ 'alias'=>'cPath',
+ 'text'=>__('categories table heading cpath'),
+// 'default'=>true,
+ 'width'=>'5%',
+ 'class'=>'tcenter',
+ );
+
+
+
+ self::$allfields['cat.parent_id'] = array(
+ 'sort'=>true,
+ 'alias'=>'parent_id',
+ 'text'=>__('categories table heading parent'),
+ 'default'=>true,
+ 'width'=>'5%',
+ 'class'=>'tcenter',
+ 'edit'=>array(
+ 'input_name'=>'parent_id',
+ 'input_type'=>'select',
+ 'input_size'=>'1',
+ 'class'=>'tleft',
+ 'select_values'=>$list_parent,
+ 'position_col'=>'right',
+ ),
+ );
+ self::$allfields['cat.sort_order'] = array(
+ 'sort'=>true,
+ 'alias'=>'sort_order',
+ 'text'=>__('categories table heading sort'),
+ 'width'=>'5%',
+ 'class'=>'tcenter',
+ 'edit'=>array(
+ 'input_name'=>'sort_order',
+ 'input_size'=>'2',
+ ),
+ );
+
+
+
+ self::$allfields['cat.categories_datatype'] = array(
+ 'sort'=>true,
+ 'alias'=>'datatype',
+ 'text'=>__('categories table heading datatype'),
+ 'width'=>'5%',
+ 'edit'=>array(
+ 'input_name'=>'categories_datatype',
+ 'input_type'=>'select',
+ 'input_size'=>'1',
+ 'required_status'=>true,
+ 'select_values'=>$dt,
+ 'position_col'=>'right',
+ ),
+ );
+
+ self::$allfields['catd.categories_name'] = array(
+ 'sort'=>true,
+ 'alias'=>'name',
+ 'text'=>__('categories table heading name'),
+ 'default'=>true,
+ 'width'=>'18%',
+ 'edit'=>array(
+ 'input_name'=>__CLASS__.'[categories_name]',
+// 'input_type'=>'textarea@advanced',
+// 'input_size'=>'64',
+// 'required_status'=>true,
+ 'active_value_language'=>true,
+ ),
+ );
+ self::$allfields['catd.categories_description'] = array(
+ 'sort'=>true,
+ 'alias'=>'description',
+ 'text'=>__('categories table heading description'),
+// 'default'=>true,
+ 'width'=>'18%',
+ 'edit'=>array(
+ 'input_name'=>__CLASS__.'[categories_description]',
+ 'input_type'=>'textarea@advanced',
+// 'input_size'=>'64',
+// 'required_status'=>true,
+ 'active_value_language'=>true,
+ ),
+ );
+ self::$allfields['cat.categories_status'] = array(
+ 'sort'=>true,
+ 'alias'=>'status',
+ 'text'=>__('categories table heading status'),
+ 'default'=>true,
+ 'width'=>'5%',
+ 'edit'=>array(
+ 'input_name'=>'categories_status',
+ 'input_type'=>'radio',
+ 'required_status'=>true,
+ 'values_list'=>array(
+ array('id'=>0, 'text'=>__('@categories text status off') ),
+ array('id'=>1, 'text'=>__('@categories text status on') ),
+ ),
+ 'position_col'=>'right',
+ 'position_grp'=>5
+ ),
+ );
+ self::$allfields['cat.categories_hidden'] = array(
+ 'sort'=>true,
+ 'alias'=>'hidden',
+ 'text'=>__('categories table heading hidden'),
+ 'default'=>true,
+ 'width'=>'5%',
+ 'edit'=>array(
+ 'input_name'=>'categories_hidden',
+ 'input_type'=>'radio',
+ 'required_status'=>true,
+ 'values_list'=>array(
+ array('id'=>0, 'text'=>__('@categories text hidden off') ),
+ array('id'=>1, 'text'=>__('@categories text hidden on') ),
+ ),
+ 'position_col'=>'right',
+ 'position_grp'=>5
+ ),
+ );
+ self::$allfields['cat.date_added'] = array(
+ 'sort'=>true,
+ 'alias'=>'added',
+ 'text'=>__('categories table heading date added'),
+// 'default'=>true,
+ 'width'=>'5%',
+ );
+ self::$allfields['cat.last_modified'] = array(
+ 'sort'=>true,
+ 'alias'=>'modified',
+ 'text'=>__('categories table heading date modified'),
+// 'default'=>true,
+ 'width'=>'5%',
+ );
+
+
+ /// @remarks min fields and not view directly colonne fields
+ $listfield = ' cat.categories_id as id, cat.categories_cpath as cPath, catd.categories_name as name, ';
+
+ /// @remarks Active forms filter
+ $mutli=array();
+// $mutli[] = sprintf(CsrtAction::getButton('button_action', IMAGE_DELETE, 'delete'), '', ' name="multi_action" ' ) ;
+
+
+
+ /**
+ @remarks Active forms filter
+ @note
+ array[
+ // For normalised filter define on method ConvertInitVar
+ generic =>
+ array (
+ 'string'
+ // , ....
+ );
+ mod =>
+ array(
+ 'title'=>__('@products filter tab manufacturer'),
+ 'content'=>tep_get_include_contents('manufacturers/filter.manufacturer'),
+ )
+ ]
+ */
+ $tab = array();
+
+// if(count(self::$languages)>1 )
+// $tab['generic'][] ='language' ;
+// if( count( tep_get_status_array(self::$datatype) ) > 1)
+// $tab['generic'][] ='subtype' ;
+
+
+ /**
+ @remarks this define menu master module in page
+ @note use $boutons[action][] = array(params)
+
+ params :
+ 'type'=>'getLink',
+ 'format'=>'button_nav',
+ 'image'=>'',
+ 'cssclass'=>'button',
+ 'title'=>__('image create new content'),
+ 'url'=>tep_href_link(self::FILENAME, 'action=new'),
+ */
+ $boutons = array();
+ $boutons['listing'][]=array(
+ 'type'=>'getLink',
+ 'format'=>'button_nav',
+ 'image'=>'',
+ 'cssclass'=>'button',
+ 'title'=>__('@categorie image create new categorie'),
+ 'url'=>tep_href_link(self::FILENAME, 'action=new'),
+ );
+
+
+ if(self::$cPath > 0)
+ self::$InitInfo['adjust']['sWhere'] .=" AND cat.parent_id = '" . (int)self::$cPath . "' ";
+
+ /**
+ Call Base Init and construct $InitInfo for process Filter
+ $listfield string list row in db
+ $mutli array action multiple
+ $filter array put list off activate tab filter
+ $boutons array
+ */
+ self::ConvertInitVar( $listfield, $mutli, $tab, $boutons);
+
}
- else $s= $osCSS_Cache->getCache();
+ public function check_action($actions){
+ global $languages_id, $oscss,$messageStack;
-/**
- @remarks Transmit var array for master construtor boxes
-*/
- $array=array('title'=>__('categories menu'),'content'=>tep_output_string_protected($s,false,true));
+
+ $DB=Database::getInstance();
+
+ self::$actions['action'] = $actions;
+ self::$actions['display_file']='';
+ self::$actions['action_class']=(isset($_GET['action_class']))? $_GET['action_class'] : '';
+ self::$actions['action_method']=(isset($_GET['action_method']))? $_GET['action_method'] : '';
+
+ // Ask categories modules if want to change the action
+ self::$actions = self::$modules->check_action(self::$actions);
+ self::$action = self::$actions['action'];
+
+
+ self::$DiversInfo['current_category_id']=((isset($_GET['cPath'])&& !empty($_GET['cPath'])) ? tep_db_prepare_input($_GET['cPath']) : 0);
+
+
+
+ /// specific SEO cache
+ if ( preg_match("/(insert|update|setflag)/i", self::$action) )
+ tep_reset_cache_data_seo_urls('reset');
+
+ switch (self::$action) {
+ /**
+ @remarks specific save in session value filters
+ */
+ case 'filters':
+ /*
+ Call Prev Process
+ */
+ self::actionFilter();
+
+
+ tep_redirect(tep_href_link(self::FILENAME));
+ break;
+
+ /**
+ @remarks specific Ajax call
+ */
+ case 'update_cell':
+ try {
+
+ $modele = array_keys(sqlcategorie::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( sqlcategorie::update( $params ) != 1 )
+ throw new Exception(__('@categories error in update process')) ;
+
+ $messageStack->add_session(__('@categories 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') ) {
+ if (isset($_GET['cID'])) {
+ if ($_GET['flag'] == '1') tep_db_query("update " . TABLE_CATEGORIES . " set categories_status = '1', last_modified = now() where categories_id = '" . (int)$_GET['cID'] . "'");
+ elseif ($_GET['flag'] == '0') tep_db_query("update " . TABLE_CATEGORIES . " set categories_status = '0', last_modified = now() where categories_id = '" . (int)$_GET['cID'] . "'");
+ }
+
+ /// clear cache for all file name based on datatype
+ osCSS_Cache::clear('categorie', true);
+
+
+ }
+
+ $messageStack->add(__('@categorie update status'), 'success');
+
+ if(!isset($_GET['forceajax']))
+ tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $_GET['cPath'] ));
+ break;
+
+ case 'viewflag':
+ if ( ($_GET['flag'] == '0') || ($_GET['flag'] == '1') ) {
+ if (isset($_GET['cID'])) {
+ if ($_GET['flag'] == '1') tep_db_query("update " . TABLE_CATEGORIES . " set categories_hidden = '1', last_modified = now() where categories_id = '" . (int)$_GET['cID'] . "'");
+ elseif ($_GET['flag'] == '0') tep_db_query("update " . TABLE_CATEGORIES . " set categories_hidden = '0', last_modified = now() where categories_id = '" . (int)$_GET['cID'] . "'");
+ }
+
+ /// clear cache for all file name based on datatype
+ osCSS_Cache::clear('categorie', true);
+
+
+ }
+
+ $messageStack->add(__('@categorie update visibility'), 'success');
+
+ if(!isset($_GET['forceajax']))
+ tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $_GET['cPath'] ));
+ break;
+
+
+
+ /**
+ CATEGORIES
+ */
+ case 'insert':
+
+ $params['sqlarray'] = array(
+ 'sort_order' => (isset($_POST['sort_order'])) ? tep_db_prepare_input((int)$_POST['sort_order']) : 0 ,
+ 'parent_id' => (isset($_POST['cPath'])) ? tep_db_prepare_input($_POST['cPath']) : 0,
+ 'status' => (isset($_POST['categories_status'])) ? tep_db_prepare_input((int)$_POST['categories_status']) : 0,
+ 'hidden' => (isset($_POST['categories_hidden'])) ? tep_db_prepare_input((int)$_POST['categories_hidden']) : 0 ,
+ 'datatype' => (isset($_POST['categories_datatype'])&& $_POST['categories_datatype'] !='on') ? tep_db_prepare_input((string)$_POST['categories_datatype']) : '' ,
+ 'cPath' => (isset($_POST['cPath'])) ? tep_db_prepare_input($_POST['cPath']) : 0,
+ );
+
+ if (!isset($_POST['categories_image_no']) && !empty($_POST['categories_image']) )
+ $params['sqlarray']['categories_image']=sqlcategorie::AddImage(@$_POST['categories_image'], @$_POST['categories_image_no']);
+ else
+ $params['sqlarray']['categories_image']='';
+
+
+ $params['action']=self::$action;
+ $params['post']=$_POST;
+ $params['language_id']= $languages_id;
+// $params['cPath']=(isset($_POST['cPath'])) ? tep_db_prepare_input($_POST['cPath']) : 0;
+
+ $res = sqlcategorie::create($params);
+
+ $function = (isset($_POST['origin'])? 'add_session' : 'add' );
+
+ if( ! $res )
+ $messageStack->$function(sprintf(__('error save categorie : %s'), sqlcategorie::$error ), 'error');
+ else
+ $messageStack->$function(sprintf(__('save categorie %s success'), $res ), 'success');
+
+
+ osCSS_Cache::clear('categorie');
+
+ $messageStack->add_session(__('@categorie create'), 'success');
+
+ if(isset($_POST['up_and_close']) )
+ // by popup ajax
+ if(isset($_POST['origin']) )
+ tep_redirect(tep_href_link($_POST['origin']));
+ else
+ tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . self::$cPath . ''));
+ else
+ tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . self::$cPath . '&cID=' . $res.'&action=edit'));
+ break;
+
+ case 'update':
+
+ $params['sqlarray'] = array('sort_order' => (isset($_POST['sort_order'])) ? tep_db_prepare_input((int)$_POST['sort_order']) : 0 ,
+ 'parent_id' => tep_db_prepare_input((int)@$_POST['cPath']),
+ 'categories_status' => (isset($_POST['categories_status'])) ? tep_db_prepare_input((int)$_POST['categories_status']) : 0,
+ 'categories_hidden' => (isset($_POST['categories_hidden'])) ? tep_db_prepare_input((int)$_POST['categories_hidden']) : 0 ,
+ 'categories_datatype' => (isset($_POST['categories_datatype'])&& $_POST['categories_datatype'] !='on') ? tep_db_prepare_input((string)$_POST['categories_datatype']) : '' ,
+ );
+
+ if (!isset($_POST['categories_image_no']) && !empty($_POST['categories_image']) )
+ $params['sqlarray']['categories_image']=sqlcategorie::AddImage(@$_POST['categories_image'], @$_POST['categories_image_no']);
+ else
+ $params['sqlarray']['categories_image']='';
+
+
+ $params['id']=self::$Id;
+ $params['action']=self::$action;
+ $params['post']=$_POST;
+ $params['language_id']= $languages_id;
+ $params['cPath']=(isset($_POST['cPath'])) ? tep_db_prepare_input($_POST['cPath']) : 0;
+
+ if (self::$action == 'insert')
+ $res = sqlcategorie::create($params);
+ elseif (self::$action == 'update')
+ $res = sqlcategorie::update($params);
+
+
+ if( ! $res )
+ $messageStack->add_session(sprintf(__('error save categorie : %s'), sqlcategorie::$error ), 'error');
+ else
+ $messageStack->add_session(sprintf(__('save categorie %s success'), self::$Id ), 'success');
+
+
+ /// clear cache for all file name based on datatype
+ osCSS_Cache::clear('categorie', true);
+
+
+ if(isset($_POST['up_and_close']) ) tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . self::$cPath . '&cID=' . self::$Id));
+ else tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . self::$cPath . '&cID=' . self::$Id.'&action=edit'));
+
+ break;
+
+
+
+ /**
+ @remarks Process delete and childs data for current categorie
+ */
+ case 'delete_confirm':
+
+ if (isset($_POST['categories_id'])) {
+ $categories_id = tep_db_prepare_input($_POST['categories_id']);
+ $categories = tep_get_category_tree($categories_id, '', '0', '', true);
+ // add current cat
+ $categories[]=array('id'=>$categories_id );
+
+ $products = array();
+ $products_delete = array();
+
+ $subcount = array();
+ $subdelete = array();
+
+ $obj = sqlcategorie::fetch(array('id'=>$categories_id), true);
+
+ $datatypes = array_map('trim',explode(',',$obj->datatype));
+ foreach($datatypes as $row){
+ $row = trim($row);
+ if( DataTypes::is_active(trim($row)) ){
+ if($row =='product'){
+ $col = $row.'s';
+ $table = constant(strtoupper('TABLE_'.$row.'S_TO_CATEGORIES'));
+ }
+ else{
+ $col = $row;
+ $table = constant(strtoupper('TABLE_'.$row.'_TO_CATEGORIES'));
+ }
+
+ for ($i=0, $n=sizeof($categories); $i<$n; $i++) {
+ /* Calcul produist et enfant herite */
+ echo $sql = "select ".$col."_id as id from " . $table . " where categories_id = '" . (int)$categories[$i]['id'] . "'";
+ $_ids_query = tep_db_query($sql);
+ while ($_ids = tep_db_fetch_array($_ids_query))
+ $subcount[$row][$_ids['id']]['categories'][] = $categories[$i]['id'];
+ }
+ }
+ }
+
+ foreach($subcount as $k=>$row){
+
+
+ if($k =='product'){
+ $col = $k.'s';
+ $table = constant(strtoupper('TABLE_'.$k.'S_TO_CATEGORIES'));
+ }
+ else{
+ $col = $k;
+ $table = constant(strtoupper('TABLE_'.$k.'_TO_CATEGORIES'));
+ }
+
+
+ while (list($key, $value) = each($row)) {
+ $category_ids = '';
+
+ for ($i=0, $n=sizeof($value['categories']); $i<$n; $i++)
+ $category_ids .= "'" . (int)$value['categories'][$i] . "', ";
+
+ $category_ids = substr($category_ids, 0, -2);
+
+ /* Ne prend que les produits dont la seul cat est celle a supp */
+ $check_query = tep_db_query("select count(*) as total from " . $table . " where ".$col."_id = '" . (int)$key . "' and categories_id not in (" . $category_ids . ")");
+ $check = tep_db_fetch_array($check_query);
+
+ if ($check['total'] < 1)
+ $subdelete[$k][$key] = $key;
+ }
+
+ }
+
+ // removing categories can be a lengthy process
+ tep_set_time_limit(0);
+
+ foreach($subdelete as $k=>$row){
+
+ if(isset($_POST['delete_in_cat'][$k]) && $_POST['delete_in_cat'][$k]=='on')
+ while (list($key) = each($row)){
+ $chidlclass = 'sql'.$k;
+
+ if($k =='product')
+ tep_remove_product($key);
+ else
+ $chidlclass::delete(array('id'=>(int)$key));
+ }
+
+ }
+
+ if(isset($_POST['delete_childs_in_cat']) && $_POST['delete_childs_in_cat']=='on') {
+ for ($i=0, $n=sizeof($categories); $i<$n; $i++) {
+ sqlcategorie::delete(array('id'=>$categories[$i]['id']));
+ }
+ }
+
+ sqlcategorie::delete(array('id'=>$categories_id));
+
+ /// clear cache for all file name based on datatype
+ osCSS_Cache::clear('categorie', true);
+
+
+ }
+
+
+ tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . self::$cPath ));
+ break;
+
+
+ /**
+ @remarks Popup Ajax QuickNew
+ */
+// case 'new_light':
+// $GLOBALS['cPath']=null;
+// break;
+
+ /**
+ @remarks Normal Form news
+ */
+ case 'new':
+ case 'edit':
+
+ /// Editeur Load
+ $oscss->_add_ext(BO_WISIWYG_SELECTED,'editeur/');
+ for ($i=0, $n=sizeof(self::$languages); $i<$n; $i++)
+ echo $oscss->_call(BO_WISIWYG_SELECTED,'_top',__CLASS__.'[categories_description][' . self::$languages[$i]['id'] . ']','600','400');
+
+ break;
+
+ default:
+
+ sqlcategorie::Maintenance();
+
+ }
+
+ }
+
+
+ /**
+ */
+ public function get_header(){
+ echo tep_get_filebroswerserveur();
+ if (self::$action == 'new_category') self::$modules->get_header_js('new_category');
+ else self::$modules->get_header_js(self::$action);
+ }
+
+ /**
+ @fn featured::GetDBValue();
+ @brief return DB value adapted for current action
+ Use self::action for determine switch
+ @return
+ */
+ public static function GetDBValue(){
+ global $languages_id;
+
+ $DB=Database::getInstance();
+
+
+ $action=self::$action;
+
+ switch ($action) {
+ case 'new';
+ case 'new_light':
+ $GLOBALS['cPath']=null;
+
+ $res = sqlcategorie::Specimen(true) ;
+ $res= self::FormatDBValue($res) ;
+
+ return $res;
+ break;
+
+ case 'delete';
+ case 'edit';
+ case 'noedit';
+ var_dump(self::$Id);
+ $res = sqlcategorie::fetch(array('id'=> (int) self::$Id, 'language_id'=>(int)$languages_id), true);
+
+ $res->cPath= categorieUtility::get_generated_category_path_ids(self::$Id);
+
+ $res= self::FormatDBValue($res) ;
+
+ return $res;
+ break;
+
+ default:
+
+ /**
+ @remarks retrun object load one inventaire
+ */
+ global $query_numrows, $languages_id;
+ $adjust=new objectInfo(self::$InitInfo['adjust']);
+
+ /**
+ @remarks replace id by name col
+ */
+ if(!empty($adjust->sWhere)) {
+
+ foreach(self::$allfields as $key=>$row){
+ if(is_array($row) && isset($row['alias']) ){
+ $k[] = '#[(]'.$row['alias'].'[)]#i';
+ $k[] = '# '.$row['alias'].' #i';
+ $k[] = '# \.'.$row['alias'].'#i';
+
+ $v[] = '('.$key.')';
+ $v[] = ' '.$key.' ';
+ $v[] = '.'.$key.' ';
+ }
+ }
+
+ if(isset($k))
+ $adjust->sWhere = preg_replace($k,$v, $adjust->sWhere);
+ }
+
+
+ $query_raw = "SELECT DISTINCT ".$adjust->listfields." ".
+ " FROM " . TABLE_CATEGORIES . " cat ".
+ " JOIN " . TABLE_CATEGORIES_DESCRIPTION . " catd ON (catd.categories_id = cat.categories_id AND catd.language_id = '" . (int)$adjust->languages_id . "') ";
+
+ /* DEB Sub module add table */
+ $r = self::$modules->__call('GetConf', array('languages_id'=>(int)$adjust->languages_id, 'type'=>'tables')) ;
+ foreach($r as $mod=>$value){
+ foreach($value as $key=>$string){
+ $query_raw .= $string;
+ }
+ }
+ /* END Sub module add col */
+
+
+ $query_raw .=((strlen($adjust->sWhere)>4) ? " WHERE ".substr($adjust->sWhere, 3) : '');
+
+
+ /* DEB Sub module add table */
+ $r = self::$modules->__call('GetConf', array('languages_id'=>(int)$adjust->languages_id, 'type'=>'group_by')) ;
+ if(is_array($r) ) {
+ $query_raw2 ='';
+ foreach($r as $mod=>$value){
+ foreach($value as $key=>$string){
+ $query_raw2 .= $string;
+ }
+ }
+ if(strlen($query_raw2) > 1 )
+ $query_raw .=" GROUP BY ".$query_raw2;
+ }
+ /* END Sub module add col */
+
+ $query_raw .=" ORDER BY ".((!empty($adjust->sOrder)) ? $adjust->sOrder : ' cat.date_added DESC ');
+
+ $_split = new splitPageResults($adjust->page, $adjust->rowbyp, $query_raw, $query_numrows);
+ $_query = $DB->query($query_raw);
+
+ $res=self::FormatDBValue($_query);
+
+ return $res;
+
+ }
+
+ }
+
+
+
+ /**
+ */
+ public function display_view() {
+ $action=self::$action;
+
+ switch(self::$action){
+ /**
+ @remarks Ajax View result
+ */
+ case 'update_cell':
+ break;
+ case 'setflag':
+ return self::RowStatus(array('status'=>(int)$_GET['flag'], 'id'=>(int)self::$Id));
+ break;
+ case 'viewflag':
+ return self::RowHidden(array('hidden'=>(int)$_GET['flag'], 'id'=>(int)self::$Id));
+ break;
+
+ /**
+ @remarks Ajax popup
+ */
+
+ /**
+ @remarks Normal View Page
+ */
+ case 'new':
+ $action='edit';
+ self::$Info=self::GetDBValue();
+ /// use master gabarit
+ return MGabCont::CallGab($action,__FUNCTION__,__CLASS__);
+ break;
+ case 'edit':
+ case 'noedit':
+ case 'new_light':
+ case 'delete':
+ case 'copy_to':
+ self::$Info=self::GetDBValue();
+ /// use master gabarit
+ return MGabCont::CallGab(self::$action,__FUNCTION__,__CLASS__);
+ break;
+
+ default:
+
+ if(!empty(self::$actions['action_method']) )
+ $action='aca_actions';
+ else {
+ self::$list=self::tep_get_list();
+ $action='listing';
+ }
+ }
+
+ /// use master gabarit
+ return MGabCont::CallGab($action,__FUNCTION__,self::MASTER);
+ }
+
+/** public static InterfacedTJsonS */
+ /**
+ @fn get_item_action($products)
+ @brief fonction qui construit l'affichage de la colonne action
+ La mise en forme est contenu dans les ressource xml du template en cours
+ @param $products array
+ @return string
+ */
+ public static function ButtonRowsActions($categories){
+ $action_str_left='';
+ $action_str ='';
+
+ $action_str_left.=sprintf(CsrtAction::getLink('row_action_right', ICON_FOLDER, 'childs'), '', tep_href_link(self::FILENAME, 'cPath=' . $categories['id'] ),'' );
+
+ $action_str.=sprintf(CsrtAction::getLink('row_action_right', __('image view public') , 'publiclink'), '', tep_catalog_href_link('index.php', 'cPath=' . $categories['cPath'],'SSL', true, 'forceview') ,' target="blank" ' );
+ $action_str.=sprintf(CsrtAction::getLink('row_action_right', IMAGE_DETAILS, 'noedit'), '', tep_href_link(self::FILENAME, 'cPath=' . self::$cPath . '&cID=' . $categories['id'] . '&action=noedit' ),'' );
+
+ if(tep_action_check('edit', self::FILENAME))
+ $action_str.=sprintf(CsrtAction::getLink('row_action_right', IMAGE_EDIT, 'edit'), '', tep_href_link(self::FILENAME, 'cPath=' . self::$cPath . '&cID=' . $categories['id'] . '&action=edit' ),'' );
+ if(tep_action_check('delete', self::FILENAME))
+ $action_str.= sprintf(CsrtAction::getLink('row_action_right', IMAGE_DELETE, 'delete'), 'fancy', tep_href_link(self::FILENAME, 'cPath=' . self::$cPath . '&cID=' . $categories['id'] . '&action=delete') ,'' );
+
+ return sprintf(
+ CsrtAction::getFormat('row_action'),
+ self::$modules->display_ColumnRowAction($categories['id']) .
+ $action_str_left
+ ,
+ $action_str
+ );
+ }
+
+
+ /**
+ @brief return format html for row status
+ @param $product array restuts row
+ @return string html
+ */
+ public static function RowStatus($categories){
+ $exclude=array('action','cID','forceajax','type','class','function','funct', 'mod');
+ $query_s='action=setflag&cID=' . $categories['id'].'&flag=';
+
+ return '<a class="ajaxinline" href="' . tep_href_link(self::FILENAME, tep_get_all_get_params($exclude).$query_s.(($categories['status'] == '1')? '0' : '1') ) . '">'.
+ sprintf(
+ CsrtAction::getFormat('row_flag'),
+ (int)$categories['status'],
+ ( ($categories['status'] == '1')? IMAGE_ICON_STATUS_GREEN : IMAGE_ICON_STATUS_RED)
+ ).
+ '</a>';
+ }
+
+ /**
+ @brief return format html for row hidden
+ @param $product array restuts row
+ @return string html
+ */
+ public static function RowHidden($categories){
+ $exclude=array('action','cID','forceajax','type','class','function','funct', 'mod');
+ $query_s='action=viewflag&cID=' . $categories['id'].'&flag=';
+
+ return '<a class="ajaxinline" href="' . tep_href_link(self::FILENAME, tep_get_all_get_params($exclude).$query_s.(($categories['hidden'] == '1')? '0' : '1') ) . '">'.
+ sprintf(
+ CsrtAction::getFormat('row_flag'),
+ (int)$categories['hidden'],
+ ( ($categories['hidden'] == '1')? IMAGE_ICON_STATUS_GREEN : IMAGE_ICON_STATUS_RED)
+ ).
+ '</a>';
+ }
+
+
+
+ /** static InterfacedInnerHtml */
+
+ public static function detail_row_page($id){
+ self::$cInfo=self::load_db_values((int)$id);
+
+ return MGabCont::CallGab('inline','display_view',__CLASS__);
+ }
+
+
+ /**
+ @brief return Filename
+ */
+ public static function GetFILENAME(){
+ return self::FILENAME;
+ }
+
+
+
+ /**
+ @brief format db value for display page
+ @param $_query ressource db sql
+ @return array
+ */
+ private static function FormatDBValue($_query){
+ $DB=Database::getInstance();
+ $res=array();
+
+ switch (self::$action) {
+ case 'listing':
+ global $query_numrows,$languages_id;
+
+ while ($item = $_query->fetchAssoc()) {
+ $ord =array();
+
+ foreach(self::$InitInfo['modele']['listing'] as $k=>$row){
+ if($k == 'action') $ord[$k]=self::ButtonRowsActions($item);
+ elseif($k == 'status') $ord[$k]=self::RowStatus($item);
+ elseif($k == 'hidden') $ord[$k]=self::RowHidden($item);
+ elseif($k == 'image') $ord[$k]=(!empty($item['image'])) ? tep_info_image($item['image'], $item['name'], TEMP_BO_SMALL_IMAGE_WIDTH, TEMP_BO_SMALL_IMAGE_HEIGHT) : ' N/A';
+ elseif($k == 'cPath') $ord[$k]=categorieUtility::get_generated_category_path_ids( $item['id']);
+ elseif(in_array($k,array('added', 'modified') ) )$ord[$k]=((isset($item[$k]) && $item[$k] !='1000-01-01 00:00:00' )? tep_date_short($item[$k]) : '' );
+ else $ord[$k]=$item[$k];
+ }
+
+ $item[1]=tep_draw_checkbox_field('action_multi['.$item['id'].']','action_mutli_'.$item['id'],$item['id']);
+ $ord[0]=$item['id'];
+
+ $res[]=$ord;
+ }
+ break;
+
+ case 'new':
+ case 'edit';
+ default:
+ global $languages_id;
+
+ $ord =array();
+
+ if(is_object($_query)){
+ $res = new stdClass;
+ foreach($_query as $key=>$row) {
+ switch($key){
+ case 'lg':
+ foreach($row as $ke=>$ro){
+ foreach($ro as $k=>$r){
+
+ if( ($new_r = self::GetEditFieldsDefine($k) ) && $new_r !=false ){
+ $new_r['input_value'][$ke] = $r;
+ $edit = 'edit_'.$k;
+ $res->$edit = new objectInfo($new_r);
+ }
+
+ $res->$k = $r;
+ }
+ }
+ break;
+
+// case 'barcode_type':
+
+ default:
+
+ if( ($new_r = self::GetEditFieldsDefine($key) ) && $new_r !=false ){
+ $new_r['input_value'] = $row;
+ $edit = 'edit_'.$key;
+ $res->$edit = new objectInfo($new_r);
+ }
+
+ $res->$key = $row;
+ }
+ }
+ }
+ }
+
+ return $res;
+ }
+
+
+
+
+/** Interface module */
+
+ function check() { return false; }
+ function install() { return false; }
+ function remove() { return false; }
+ function keys() { return false; }
+}
+
+
?>
\ No newline at end of file
Modified: trunk/catalog/admin/includes/modules/pages/products.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/products.php 2014-01-23 20:57:07 UTC (rev 5067)
+++ trunk/catalog/admin/includes/modules/pages/products.php 2014-01-23 21:41:50 UTC (rev 5068)
@@ -897,9 +897,9 @@
self::$action='edit';
self::GetConf();
$obj1=self::GetDBValue();
- /* self::$Info =*/ $obj=$obj1->list;
+ $obj=$obj1->list;
-// $array[] = self::DisplayField($_REQUEST['key'], '%s');
+
$edit = ((substr($key,0,5) !='edit_' ) ? 'edit_'.$key : $key);
$tmp = $obj->$edit;
Modified: trunk/catalog/admin/includes/widget/homeStock.php
===================================================================
--- trunk/catalog/admin/includes/widget/homeStock.php 2014-01-23 20:57:07 UTC (rev 5067)
+++ trunk/catalog/admin/includes/widget/homeStock.php 2014-01-23 21:41:50 UTC (rev 5068)
@@ -40,7 +40,7 @@
<th><?php echo __('homeStock box name'); ?></th>
<th><?php echo __('homeStock box stock'); ?></th>
</tr>
- <?php $i = 0; foreach($l as $p) : $i++; if( $i> $conf->widget_max_line) break; /*print_r($p);*/ ?>
+ <?php $i = 0; foreach($l as $p) : $i++; if( $i> $conf->widget_max_line) break; ?>
<tr>
<td class="tcenter"><strong><a href="<?php echo tep_href_link(FILENAME_PRODUCTS, 'pID='.$p['products_id'].'&action=edit') ?>"><?php echo $p['products_id'] ?></a></strong></td>
<td class="tcenter"><strong><a href="<?php echo tep_href_link(FILENAME_PRODUCTS, 'pID='.$p['products_id'].'&action=edit') ?>"><?php echo $p['ref'] ?></a></strong></td>
Modified: trunk/catalog/checkout_confirmation.php
===================================================================
--- trunk/catalog/checkout_confirma...
[truncated message content] |
|
From: <os...@us...> - 2014-01-23 20:57:11
|
Revision: 5067
http://sourceforge.net/p/oscss/svn/5067
Author: oscim
Date: 2014-01-23 20:57:07 +0000 (Thu, 23 Jan 2014)
Log Message:
-----------
Fix
Modified Paths:
--------------
trunk/catalog/admin/includes/javascript/modules/pages/orders.js.php
Modified: trunk/catalog/admin/includes/javascript/modules/pages/orders.js.php
===================================================================
--- trunk/catalog/admin/includes/javascript/modules/pages/orders.js.php 2014-01-23 20:04:14 UTC (rev 5066)
+++ trunk/catalog/admin/includes/javascript/modules/pages/orders.js.php 2014-01-23 20:57:07 UTC (rev 5067)
@@ -61,9 +61,9 @@
// trick JavaScript pour émuler le self:: en PHP : on utilise une variable locale
var self = OSCSS_JSCORE.orders.utils;
})(); // fin de scope locale
-
+ //--></script>
<?php endif; ?>
- //--></script>
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2014-01-23 20:04:17
|
Revision: 5066
http://sourceforge.net/p/oscss/svn/5066
Author: oscim
Date: 2014-01-23 20:04:14 +0000 (Thu, 23 Jan 2014)
Log Message:
-----------
Fix
Modified Paths:
--------------
trunk/catalog/install/includes/content/core.installdb.php
Modified: trunk/catalog/install/includes/content/core.installdb.php
===================================================================
--- trunk/catalog/install/includes/content/core.installdb.php 2014-01-23 17:45:50 UTC (rev 5065)
+++ trunk/catalog/install/includes/content/core.installdb.php 2014-01-23 20:04:14 UTC (rev 5066)
@@ -212,7 +212,7 @@
$this->repet_post();
echo "<p>" .core::l10n("Nouvelle installation. Supprime les données de la base si elles esistent " ).
' '.osc_draw_hidden_field('upgrade', '','install') .
- ' <input type="submit" class="submitBt" name="up_bouton_'.$version['name'].'" value="'.core::l10n("Installer" ).'" />';
+ ' <input type="submit" class="submitBt" name="up_bouton_'.@$version['name'].'" value="'.core::l10n("Installer" ).'" />';
echo "</p>\n".'</form>'."\n";
}
@@ -221,7 +221,7 @@
echo '<form id="install" action="?etape='.$this->get_current_etape(1).'" method="post">'."\n";
$this->repet_post();
if(isset($_POST['upgrade'])) {
- echo osc_draw_hidden_field('up_upgrade['.$_POST['upgrade'].']', '', $version['name']);
+ echo osc_draw_hidden_field('up_upgrade['.$_POST['upgrade'].']', '', @$version['name']);
echo $this->draw_button(true, false);
}
else
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2014-01-23 17:45:55
|
Revision: 5065
http://sourceforge.net/p/oscss/svn/5065
Author: oscim
Date: 2014-01-23 17:45:50 +0000 (Thu, 23 Jan 2014)
Log Message:
-----------
DEvelop code in frontoffice and add class lisrener for manipulate data
implement in code
Fix
Modified Paths:
--------------
trunk/catalog/admin/includes/classes/drivers/sqlproduct.php
trunk/catalog/admin/includes/exts/package/ci_tag.class.php
trunk/catalog/admin/includes/modules/pages/categories.php
trunk/catalog/common/class.interfaces.php
trunk/catalog/common/classes/DataTypes.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_diver.php
trunk/catalog/common/classes/datatype_drivers/Data_home.php
trunk/catalog/common/classes/datatype_drivers/Data_product.php
trunk/catalog/common/classes/price.php
trunk/catalog/includes/application_top.php
trunk/catalog/includes/classes/AbstractAcaModule.php
trunk/catalog/includes/classes/category_tree.php
trunk/catalog/includes/classes/core_page/account.php
trunk/catalog/includes/classes/core_page/generic.php
trunk/catalog/includes/classes/core_page/home.php
trunk/catalog/includes/classes/core_page/listing.php
trunk/catalog/includes/classes/core_page/overlay/oscss_boxes.php
trunk/catalog/includes/classes/drivers/data/categorie.php
trunk/catalog/includes/classes/drivers/data/content.php
trunk/catalog/includes/classes/drivers/data/product.php
trunk/catalog/includes/functions/html_output.php
trunk/catalog/includes/functions/template.php
trunk/catalog/index.php
trunk/catalog/templates/defaut/Childs_tpl/module.php
trunk/catalog/templates/defaut/includes/boxes/best_sellers.php
trunk/catalog/templates/defaut/includes/boxes/information.php
trunk/catalog/templates/defaut/includes/boxes/myaccount.php
trunk/catalog/templates/defaut/includes/boxes/selections.php
trunk/catalog/templates/defaut/includes/boxes/very_viewed.php
trunk/catalog/templates/defaut/includes/boxes/whats_new.php
trunk/catalog/templates/defaut/includes/content/advanced_search.php
trunk/catalog/templates/defaut/includes/content/default.php
trunk/catalog/templates/defaut/includes/content/index_listing.php
trunk/catalog/templates/defaut/includes/content/product_info.php
trunk/catalog/templates/defaut/includes/gabarit/account/view.gab
trunk/catalog/templates/defaut/includes/gabarit/box.generic.gab
trunk/catalog/templates/defaut/includes/gabarit/pages/advanced_search.gab
trunk/catalog/templates/defaut/includes/gabarit/pages/sitemap.gab
trunk/catalog/templates/defaut/includes/gabarit/product/view.gab
trunk/catalog/templates/defaut/includes/js/advanced_search.js.php
trunk/test/phpunit/Back/modules/genericmodules.php
Added Paths:
-----------
trunk/catalog/includes/classes/drivers/BoxesListenerRow.php
trunk/catalog/includes/classes/drivers/DataListenerRow.php
trunk/catalog/includes/classes/drivers/DataListenerRowCategorie.php
trunk/catalog/includes/classes/drivers/DataListenerRowContent.php
trunk/catalog/includes/classes/drivers/DataListenerRowProduct.php
Removed Paths:
-------------
trunk/catalog/templates/defaut/includes/content/content.php
Modified: trunk/catalog/admin/includes/classes/drivers/sqlproduct.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlproduct.php 2014-01-22 07:48:08 UTC (rev 5064)
+++ trunk/catalog/admin/includes/classes/drivers/sqlproduct.php 2014-01-23 17:45:50 UTC (rev 5065)
@@ -634,7 +634,7 @@
public static function count_in_category($categories_id, $include_deactivated = false) {
$products_count = 0;
- if( /* ! DataTypes::is_active(trim('product')) || */ ! DataTypes::is_active(trim('categorie')) )
+ if( ! DataTypes::is_active(trim('categorie')) )
return 0;
if ($include_deactivated) $products_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = p2c.products_id and p2c.categories_id = '" . (int)$categories_id . "'");
Modified: trunk/catalog/admin/includes/exts/package/ci_tag.class.php
===================================================================
--- trunk/catalog/admin/includes/exts/package/ci_tag.class.php 2014-01-22 07:48:08 UTC (rev 5064)
+++ trunk/catalog/admin/includes/exts/package/ci_tag.class.php 2014-01-23 17:45:50 UTC (rev 5065)
@@ -532,6 +532,7 @@
if(is_array($value)) {
$tag_data.="\r\n".$key." (Array):";
foreach($value as $ky=>$val)
+ if(is_string($val))
$tag_data.= "\r\n".$ky."=>".$this->linebreak_view($val)."\r\n";
}
elseif ($value) {
Modified: trunk/catalog/admin/includes/modules/pages/categories.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/categories.php 2014-01-22 07:48:08 UTC (rev 5064)
+++ trunk/catalog/admin/includes/modules/pages/categories.php 2014-01-23 17:45:50 UTC (rev 5065)
@@ -1,1032 +1,55 @@
-<?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.2
- @date 22/09/2013, 09:32
- @author oscim <mail aur...@os...> <www http://www.oscim.fr>
- @encode UTF-8
- @file categories.php
- @dir admin/includes/modules/pages/
+ @licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
+ @portion code Copyright (c) 2002 osCommerce
+ @package osCSS-2 <www http://www.oscss.org>
+ *\version 2.1.2
+ *\date 04/10/2013, 08:18
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+ @group boxes
+ *\file includes/boxes/categories.php
+ *\brief display process calcul category, and retrun array
*/
+ //! @remarks depend Data_product active
+ if( ! DataTypes::is_active('categorie'))
+ return false;
+
/**
- @class categories
- @brief master class edit and manage cat
+ @remarks Process Specific Boxes
*/
-class categories
- extends ModTwo /// new abstract class for nextgen module
- implements
- InterfaceModule,
- ExtModConfig,
- InterfacedTJsonS,
- InterfacedInnerHtml
- {
+ // require_once(DIR_WS_CLASSES . 'category_tree.php'); // autoload
+ $CategoryTree = new category_tree;
+ $osCSS_Cache=new osCSS_Cache;
+ $cPath=$page->GetVar('cPath');
+ $language=$page->GetVar('language');
+ $tableau='';
+ global $tableau;
- const FILENAME = FILENAME_CATEGORIES;
- /**
- @var int current id
- */
- public static $Id;
- /**
- @var array $languages
- */
- public static $languages;
- /**
- @var array $cPath
- */
- public static $cPath;
- /**
- @var array $current_category_id
- */
- public static $current_category_id;
- /**
- @var array $DiversInfo transport var
- */
- public static $DiversInfo;
- /**
- @var array $actions
- */
- public static $actions;
+ if(strpos($cPath,'_') > 0)
+ $CCCAT = substr($cPath,0, strpos($cPath,'_'));
+ else
+ $CCCAT = $cPath;
+ $subcat= $CategoryTree->getTree($CCCAT);
- public function __construct(){
- self::Clean();
- self::GetConf();
- }
+ if (($osCSS_Cache->read('categoriesBox-' . $language .'-cpath-'.$cPath.'-type', 720) === false) ) {
- /**
- @brief Load , adjust and define var environement exe for module
- Is use in module and class abstract for init value config this module
- */
- public static function GetConf(){
- global $languages_id;
+ $CategoryTree->setSpacerString('', 2);
+ $tableau = $CategoryTree->getTree() ;
- self::$code=__CLASS__;
- self::$datatype='categorie';
+ $s=tep_get_include_contents('box.categories');
-
- self::$action=(isset($_REQUEST['action'])? $_REQUEST['action'] : 'listing' );
- self::$Id=(isset($_REQUEST['cID'])? (int)$_REQUEST['cID'] : 0 );
- self::$cPath=(isset($_GET['cPath'])? (int)$_GET['cPath'] : 0);
-
- /**
- @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.(isset($_GET['cPath'])?'&cPath='.$_GET['cPath']:''));
- //! detail item in ajax
- define('AJAXSTATMENTDETAIL', 'mod=page&type='.self::$code);
- }
-
- /**
- TODO : remplacer le nom de constante par un MODULE_CATEGORIES_INSTALLED_BO
- */
-
- self::$modules=new AcaFactory('categories','MODULE_ACACAT_INSTALLED_BO');
- self::$modules->set_image_handler();
-
- self::$languages = tep_get_languages();
-
-
- // construct list datatype possible
- $DT = DataTypes::getInstance();
- $dt = array( array('id'=>'-1', 'text'=>__('input datatype value none') ) );
- foreach($DT->GetTypeForRootListing() as $k=>$row)
- $dt[] = array('id'=>$row, 'text'=>$row );
- // construct list cats parent
- $list_parent= array(array('id'=>0, 'text'=>__('text categorie racine')) );
- $echap_childs_cats = array();
- foreach(get_cat_list(0) as $v)
- $list_parent[] = array('id'=>$v['categories_id'], 'text'=>$v['categories_name']);
-
-
- /**
- @remarks define var execution sql in GetDBValue()
- */
- self::$InitInfo['adjust']=array(
- 'languages_id'=>$languages_id,
- 'page'=>1,
- 'rowbyp'=>10,
- 'sOrder'=>'',
- 'sWhere'=>'',
- );
-
-
- MGabCont::SetCurrentName(__CLASS__);
-
- self::$allfields = array();
-
- self::$allfields['cat.categories_id'] = array(
- 'sort'=>true,
- 'alias'=>'id',
- 'text'=>__('categories table heading id'),
- 'default'=>true,
- 'width'=>'5%',
- 'class'=>'tcenter',
- );
-
- self::$allfields['cat.categories_image'] = array(
- 'sort'=>true,
- 'alias'=>'image',
- 'text'=>__('categories table heading image'),
- 'default'=>true,
- 'width'=>'5%',
- 'class'=>'tcenter',
- 'edit'=>array(
- 'input_name'=>'categories_image',
- 'input_type'=>'input@image',
-// 'input_size'=>'1',
-// 'class'=>'tleft',
-// 'select_values'=>$list_parent,
- 'position_grp'=>4,
- 'position_col'=>'right',
- ),
-
- );
- self::$allfields['cat.categories_cpath'] = array(
- 'sort'=>true,
- 'alias'=>'cPath',
- 'text'=>__('categories table heading cpath'),
-// 'default'=>true,
- 'width'=>'5%',
- 'class'=>'tcenter',
- );
-
-
-
- self::$allfields['cat.parent_id'] = array(
- 'sort'=>true,
- 'alias'=>'parent_id',
- 'text'=>__('categories table heading parent'),
- 'default'=>true,
- 'width'=>'5%',
- 'class'=>'tcenter',
- 'edit'=>array(
- 'input_name'=>'parent_id',
- 'input_type'=>'select',
- 'input_size'=>'1',
- 'class'=>'tleft',
- 'select_values'=>$list_parent,
- 'position_col'=>'right',
- ),
- );
- self::$allfields['cat.sort_order'] = array(
- 'sort'=>true,
- 'alias'=>'sort_order',
- 'text'=>__('categories table heading sort'),
- 'width'=>'5%',
- 'class'=>'tcenter',
- 'edit'=>array(
- 'input_name'=>'sort_order',
- 'input_size'=>'2',
- ),
- );
-
-
-
- self::$allfields['cat.categories_datatype'] = array(
- 'sort'=>true,
- 'alias'=>'datatype',
- 'text'=>__('categories table heading datatype'),
- 'width'=>'8%',
- 'edit'=>array(
- 'input_name'=>'categories_datatype',
- 'input_type'=>'select',
- 'input_size'=>'1',
- 'required_status'=>true,
- 'select_values'=>$dt,
- 'position_col'=>'right',
- ),
- );
-
- self::$allfields['catd.categories_name'] = array(
- 'sort'=>true,
- 'alias'=>'name',
- 'text'=>__('categories table heading name'),
- 'default'=>true,
- 'width'=>'18%',
- 'edit'=>array(
- 'input_name'=>__CLASS__.'[categories_name]',
-// 'input_type'=>'textarea@advanced',
-// 'input_size'=>'64',
-// 'required_status'=>true,
- 'active_value_language'=>true,
- ),
- );
- self::$allfields['catd.categories_description'] = array(
- 'sort'=>true,
- 'alias'=>'description',
- 'text'=>__('categories table heading description'),
-// 'default'=>true,
- 'width'=>'18%',
- 'edit'=>array(
- 'input_name'=>__CLASS__.'[categories_description]',
- 'input_type'=>'textarea@advanced',
-// 'input_size'=>'64',
-// 'required_status'=>true,
- 'active_value_language'=>true,
- ),
- );
- self::$allfields['cat.categories_status'] = array(
- 'sort'=>true,
- 'alias'=>'status',
- 'text'=>__('categories table heading status'),
- 'default'=>true,
- 'width'=>'5%',
- 'edit'=>array(
- 'input_name'=>'categories_status',
- 'input_type'=>'radio',
- 'required_status'=>true,
- 'values_list'=>array(
- array('id'=>0, 'text'=>__('@categories text status off') ),
- array('id'=>1, 'text'=>__('@categories text status on') ),
- ),
- 'position_col'=>'right',
- 'position_grp'=>5
- ),
- );
- self::$allfields['cat.categories_hidden'] = array(
- 'sort'=>true,
- 'alias'=>'hidden',
- 'text'=>__('categories table heading hidden'),
- 'default'=>true,
- 'width'=>'5%',
- 'edit'=>array(
- 'input_name'=>'categories_hidden',
- 'input_type'=>'radio',
- 'required_status'=>true,
- 'values_list'=>array(
- array('id'=>0, 'text'=>__('@categories text hidden off') ),
- array('id'=>1, 'text'=>__('@categories text hidden on') ),
- ),
- 'position_col'=>'right',
- 'position_grp'=>5
- ),
- );
- self::$allfields['cat.date_added'] = array(
- 'sort'=>true,
- 'alias'=>'added',
- 'text'=>__('categories table heading date added'),
-// 'default'=>true,
- 'width'=>'5%',
- );
- self::$allfields['cat.last_modified'] = array(
- 'sort'=>true,
- 'alias'=>'modified',
- 'text'=>__('categories table heading date modified'),
-// 'default'=>true,
- 'width'=>'5%',
- );
-
-
- /// @remarks min fields and not view directly colonne fields
- $listfield = ' cat.categories_id as id, cat.categories_cpath as cPath, catd.categories_name as name, ';
-
- /// @remarks Active forms filter
- $mutli=array();
-// $mutli[] = sprintf(CsrtAction::getButton('button_action', IMAGE_DELETE, 'delete'), '', ' name="multi_action" ' ) ;
-
-
-
- /**
- @remarks Active forms filter
- @note
- array[
- // For normalised filter define on method ConvertInitVar
- generic =>
- array (
- 'string'
- // , ....
- );
- mod =>
- array(
- 'title'=>__('@products filter tab manufacturer'),
- 'content'=>tep_get_include_contents('manufacturers/filter.manufacturer'),
- )
- ]
- */
- $tab = array();
-
-// if(count(self::$languages)>1 )
-// $tab['generic'][] ='language' ;
-// if( count( tep_get_status_array(self::$datatype) ) > 1)
-// $tab['generic'][] ='subtype' ;
-
-
- /**
- @remarks this define menu master module in page
- @note use $boutons[action][] = array(params)
-
- params :
- 'type'=>'getLink',
- 'format'=>'button_nav',
- 'image'=>'',
- 'cssclass'=>'button',
- 'title'=>__('image create new content'),
- 'url'=>tep_href_link(self::FILENAME, 'action=new'),
- */
- $boutons = array();
- $boutons['listing'][]=array(
- 'type'=>'getLink',
- 'format'=>'button_nav',
- 'image'=>'',
- 'cssclass'=>'button',
- 'title'=>__('@categorie image create new categorie'),
- 'url'=>tep_href_link(self::FILENAME, 'action=new'),
- );
-
-
- if(self::$cPath > 0)
- self::$InitInfo['adjust']['sWhere'] .=" AND cat.parent_id = '" . (int)self::$cPath . "' ";
-
- /**
- Call Base Init and construct $InitInfo for process Filter
- $listfield string list row in db
- $mutli array action multiple
- $filter array put list off activate tab filter
- $boutons array
- */
- self::ConvertInitVar( $listfield, $mutli, $tab, $boutons);
-
+ $osCSS_Cache->writeBuffer($s);
}
+ else $s= $osCSS_Cache->getCache();
- public function check_action($actions){
- global $languages_id, $oscss,$messageStack;
-
- $DB=Database::getInstance();
-
- self::$actions['action'] = $actions;
- self::$actions['display_file']='';
- self::$actions['action_class']=(isset($_GET['action_class']))? $_GET['action_class'] : '';
- self::$actions['action_method']=(isset($_GET['action_method']))? $_GET['action_method'] : '';
-
- // Ask categories modules if want to change the action
- self::$actions = self::$modules->check_action(self::$actions);
- self::$action = self::$actions['action'];
-
-
- self::$DiversInfo['current_category_id']=((isset($_GET['cPath'])&& !empty($_GET['cPath'])) ? tep_db_prepare_input($_GET['cPath']) : 0);
-
-
-
- /// specific SEO cache
- if ( preg_match("/(insert|update|setflag)/i", self::$action) )
- tep_reset_cache_data_seo_urls('reset');
-
- switch (self::$action) {
- /**
- @remarks specific save in session value filters
- */
- case 'filters':
- /*
- Call Prev Process
- */
- self::actionFilter();
-
-
- tep_redirect(tep_href_link(self::FILENAME));
- break;
-
- /**
- @remarks specific Ajax call
- */
- case 'update_cell':
- try {
-
- $modele = array_keys(sqlcategorie::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( sqlcategorie::update( $params ) != 1 )
- throw new Exception(__('@categories error in update process')) ;
-
- $messageStack->add_session(__('@categories 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') ) {
- if (isset($_GET['cID'])) {
- if ($_GET['flag'] == '1') tep_db_query("update " . TABLE_CATEGORIES . " set categories_status = '1', last_modified = now() where categories_id = '" . (int)$_GET['cID'] . "'");
- elseif ($_GET['flag'] == '0') tep_db_query("update " . TABLE_CATEGORIES . " set categories_status = '0', last_modified = now() where categories_id = '" . (int)$_GET['cID'] . "'");
- }
-
- /// clear cache for all file name based on datatype
- osCSS_Cache::clear('categorie', true);
-
-
- }
-
- $messageStack->add(__('@categorie update status'), 'success');
-
- if(!isset($_GET['forceajax']))
- tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $_GET['cPath'] ));
- break;
-
- case 'viewflag':
- if ( ($_GET['flag'] == '0') || ($_GET['flag'] == '1') ) {
- if (isset($_GET['cID'])) {
- if ($_GET['flag'] == '1') tep_db_query("update " . TABLE_CATEGORIES . " set categories_hidden = '1', last_modified = now() where categories_id = '" . (int)$_GET['cID'] . "'");
- elseif ($_GET['flag'] == '0') tep_db_query("update " . TABLE_CATEGORIES . " set categories_hidden = '0', last_modified = now() where categories_id = '" . (int)$_GET['cID'] . "'");
- }
-
- /// clear cache for all file name based on datatype
- osCSS_Cache::clear('categorie', true);
-
-
- }
-
- $messageStack->add(__('@categorie update visibility'), 'success');
-
- if(!isset($_GET['forceajax']))
- tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $_GET['cPath'] ));
- break;
-
-
-
- /**
- CATEGORIES
- */
-
- case 'insert':
- case 'update':
-
- $params =array();
- if(self::$Id > 0) $params['id']=self::$Id;
- $params['action']=self::$action;
- $params['post']=$_POST;
- $params['language_id']= $languages_id;
- $params['cPath']=(isset($_POST['parent_id'])) ? tep_db_prepare_input($_POST['parent_id']) : 0;
- $params['sqlarray'] = sqlcategorie::ExtractForm($_POST);
-
- if (self::$action == 'insert'){
- $res = sqlcategorie::create($params);
- self::$Id = $res;
- }
- elseif (self::$action == 'update')
- $res = sqlcategorie::update($params);
-
- $function = (isset($_POST['origin'])? 'add_session' : 'add' );
-
- if( ! $res )
- $messageStack->$function(sprintf(__('error save categorie : %s'), sqlcategorie::$error ), 'error');
- else
- $messageStack->$function(sprintf(__('save categorie %s success'), $res ), 'success');
-
- /// clear cache for all file name based on datatype
- osCSS_Cache::clear('categorie', true);
-
-
- if(isset($_POST['up_and_close']) ){
- // by popup ajax
- if(isset($_POST['origin']) )
- tep_redirect(tep_href_link($_POST['origin']));
- else
- tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . self::$cPath . '&cID=' . self::$Id));
- }
- else
- tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . self::$cPath . '&cID=' . self::$Id.'&action=edit'));
-
- break;
-
-
-
- /**
- @remarks Process delete and childs data for current categorie
- */
- case 'delete_confirm':
-
- if (isset($_POST['categories_id'])) {
- $categories_id = tep_db_prepare_input($_POST['categories_id']);
- $categories = tep_get_category_tree($categories_id, '', '0', '', true);
- // add current cat
- $categories[]=array('id'=>$categories_id );
-
- $products = array();
- $products_delete = array();
-
- $subcount = array();
- $subdelete = array();
-
- $obj = sqlcategorie::fetch(array('id'=>$categories_id), true);
-
- $datatypes = array_map('trim',explode(',',$obj->datatype));
- foreach($datatypes as $row){
- $row = trim($row);
- if( DataTypes::is_active(trim($row)) ){
- if($row =='product'){
- $col = $row.'s';
- $table = constant(strtoupper('TABLE_'.$row.'S_TO_CATEGORIES'));
- }
- else{
- $col = $row;
- $table = constant(strtoupper('TABLE_'.$row.'_TO_CATEGORIES'));
- }
-
- for ($i=0, $n=sizeof($categories); $i<$n; $i++) {
- /* Calcul produist et enfant herite */
- echo $sql = "select ".$col."_id as id from " . $table . " where categories_id = '" . (int)$categories[$i]['id'] . "'";
- $_ids_query = tep_db_query($sql);
- while ($_ids = tep_db_fetch_array($_ids_query))
- $subcount[$row][$_ids['id']]['categories'][] = $categories[$i]['id'];
- }
- }
- }
-
- foreach($subcount as $k=>$row){
-
-
- if($k =='product'){
- $col = $k.'s';
- $table = constant(strtoupper('TABLE_'.$k.'S_TO_CATEGORIES'));
- }
- else{
- $col = $k;
- $table = constant(strtoupper('TABLE_'.$k.'_TO_CATEGORIES'));
- }
-
-
- while (list($key, $value) = each($row)) {
- $category_ids = '';
-
- for ($i=0, $n=sizeof($value['categories']); $i<$n; $i++)
- $category_ids .= "'" . (int)$value['categories'][$i] . "', ";
-
- $category_ids = substr($category_ids, 0, -2);
-
- /* Ne prend que les produits dont la seul cat est celle a supp */
- $check_query = tep_db_query("select count(*) as total from " . $table . " where ".$col."_id = '" . (int)$key . "' and categories_id not in (" . $category_ids . ")");
- $check = tep_db_fetch_array($check_query);
-
- if ($check['total'] < 1)
- $subdelete[$k][$key] = $key;
- }
-
- }
-
- // removing categories can be a lengthy process
- tep_set_time_limit(0);
-
- foreach($subdelete as $k=>$row){
-
- if(isset($_POST['delete_in_cat'][$k]) && $_POST['delete_in_cat'][$k]=='on')
- while (list($key) = each($row)){
- $chidlclass = 'sql'.$k;
-
- if($k =='product')
- tep_remove_product($key);
- else
- $chidlclass::delete(array('id'=>(int)$key));
- }
-
- }
-
- if(isset($_POST['delete_childs_in_cat']) && $_POST['delete_childs_in_cat']=='on') {
- for ($i=0, $n=sizeof($categories); $i<$n; $i++) {
- sqlcategorie::delete(array('id'=>$categories[$i]['id']));
- }
- }
-
- sqlcategorie::delete(array('id'=>$categories_id));
-
- /// clear cache for all file name based on datatype
- osCSS_Cache::clear('categorie', true);
-
-
- }
-
-
- tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . self::$cPath ));
- break;
-
-
- /**
- @remarks Popup Ajax QuickNew
- */
-// case 'new_light':
-// $GLOBALS['cPath']=null;
-// break;
-
- /**
- @remarks Normal Form news
- */
- case 'new':
- case 'edit':
-
- /// Editeur Load
- $oscss->_add_ext(BO_WISIWYG_SELECTED,'editeur/');
- for ($i=0, $n=sizeof(self::$languages); $i<$n; $i++)
- echo $oscss->_call(BO_WISIWYG_SELECTED,'_top',__CLASS__.'[categories_description][' . self::$languages[$i]['id'] . ']','600','400');
-
- break;
-
- default:
-
- sqlcategorie::Maintenance();
-
- }
-
- }
-
-
- /**
- */
- public function get_header(){
- echo tep_get_filebroswerserveur();
- if (self::$action == 'new_category') self::$modules->get_header_js('new_category');
- else self::$modules->get_header_js(self::$action);
- }
-
- /**
- @fn featured::GetDBValue();
- @brief return DB value adapted for current action
- Use self::action for determine switch
- @return
- */
- public static function GetDBValue(){
- global $languages_id;
-
- $DB=Database::getInstance();
-
-
- $action=self::$action;
-
- switch ($action) {
- case 'new';
- case 'new_light':
- $GLOBALS['cPath']=null;
-
- $res = sqlcategorie::Specimen(true) ;
- $res= self::FormatDBValue($res) ;
-
- return $res;
- break;
-
- case 'delete';
- case 'edit';
- case 'noedit';
-
- $res = sqlcategorie::fetch(array('id'=> (int) self::$Id, 'language_id'=>(int)$languages_id), true);
-
- $res->cPath= categorieUtility::get_generated_category_path_ids(self::$Id);
-
- $res= self::FormatDBValue($res) ;
-
- return $res;
- break;
-
- default:
-
- /**
- @remarks retrun object load one inventaire
- */
- global $query_numrows, $languages_id;
- $adjust=new objectInfo(self::$InitInfo['adjust']);
-
- /**
- @remarks replace id by name col
- */
- if(!empty($adjust->sWhere)) {
-
- foreach(self::$allfields as $key=>$row){
- if(is_array($row) && isset($row['alias']) ){
- $k[] = '#[(]'.$row['alias'].'[)]#i';
- $k[] = '# '.$row['alias'].' #i';
- $k[] = '# \.'.$row['alias'].'#i';
-
- $v[] = '('.$key.')';
- $v[] = ' '.$key.' ';
- $v[] = '.'.$key.' ';
- }
- }
-
- if(isset($k))
- $adjust->sWhere = preg_replace($k,$v, $adjust->sWhere);
- }
-
-
- $query_raw = "SELECT DISTINCT ".$adjust->listfields." ".
- " FROM " . TABLE_CATEGORIES . " cat ".
- " JOIN " . TABLE_CATEGORIES_DESCRIPTION . " catd ON (catd.categories_id = cat.categories_id AND catd.language_id = '" . (int)$adjust->languages_id . "') ";
-
- /* DEB Sub module add table */
- $r = self::$modules->__call('GetConf', array('languages_id'=>(int)$adjust->languages_id, 'type'=>'tables')) ;
- foreach($r as $mod=>$value){
- foreach($value as $key=>$string){
- $query_raw .= $string;
- }
- }
- /* END Sub module add col */
-
-
- $query_raw .=((strlen($adjust->sWhere)>4) ? " WHERE ".substr($adjust->sWhere, 3) : '');
-
-
- /* DEB Sub module add table */
- $r = self::$modules->__call('GetConf', array('languages_id'=>(int)$adjust->languages_id, 'type'=>'group_by')) ;
- if(is_array($r) ) {
- $query_raw2 ='';
- foreach($r as $mod=>$value){
- foreach($value as $key=>$string){
- $query_raw2 .= $string;
- }
- }
- if(strlen($query_raw2) > 1 )
- $query_raw .=" GROUP BY ".$query_raw2;
- }
- /* END Sub module add col */
-
- $query_raw .=" ORDER BY ".((!empty($adjust->sOrder)) ? $adjust->sOrder : ' cat.date_added DESC ');
-
- $_split = new splitPageResults($adjust->page, $adjust->rowbyp, $query_raw, $query_numrows);
- $_query = $DB->query($query_raw);
-
- $res=self::FormatDBValue($_query);
-
- return $res;
-
- }
-
- }
-
-
-
- /**
- */
- public function display_view() {
- $action=self::$action;
- $MG= false;
-
-
- switch($action){
- /**
- @remarks Ajax View result
- */
- case 'update_cell':
- break;
- case 'setflag':
- return self::RowStatus(array('status'=>(int)$_GET['flag'], 'id'=>(int)self::$Id));
- break;
- case 'viewflag':
- return self::RowHidden(array('hidden'=>(int)$_GET['flag'], 'id'=>(int)self::$Id));
- break;
-
- /**
- @remarks Ajax popup
- */
-
- /**
- @remarks Normal View Page
- */
- case 'new':
- $action='edit';
- self::$Info=self::GetDBValue();
- $MG= true;
- break;
-
- case 'delete':
- case 'new_light':
- case 'copy_to':
- self::$Info=self::GetDBValue();
- break;
-
- case 'edit':
- case 'noedit':
- $MG= true;
- self::$Info=self::GetDBValue();
- break;
-
- default:
-
- if(!empty(self::$actions['action_method']) )
- $action='aca_actions';
- else {
- $MG= true;
- $action='listing';
- }
- }
-
- if($MG)
- return MGabCont::CallGab($action,__FUNCTION__,self::MASTER);
- else
- return MGabCont::CallGab($action,__FUNCTION__,__CLASS__);
- }
-
-/** public static InterfacedTJsonS */
- /**
- @fn get_item_action($products)
- @brief fonction qui construit l'affichage de la colonne action
- La mise en forme est contenu dans les ressource xml du template en cours
- @param $products array
- @return string
- */
- public static function ButtonRowsActions($categories){
- $action_str_left='';
- $action_str ='';
-
- $action_str_left.=sprintf(CsrtAction::getLink('row_action_right', ICON_FOLDER, 'childs'), '', tep_href_link(self::FILENAME, 'cPath=' . $categories['id'] ),'' );
-
- $action_str.=sprintf(CsrtAction::getLink('row_action_right', __('image view public') , 'publiclink'), '', tep_catalog_href_link('index.php', 'cPath=' . $categories['cPath'],'SSL', true, 'forceview') ,' target="blank" ' );
- $action_str.=sprintf(CsrtAction::getLink('row_action_right', IMAGE_DETAILS, 'noedit'), '', tep_href_link(self::FILENAME, 'cPath=' . self::$cPath . '&cID=' . $categories['id'] . '&action=noedit' ),'' );
-
- if(tep_action_check('edit', self::FILENAME))
- $action_str.=sprintf(CsrtAction::getLink('row_action_right', IMAGE_EDIT, 'edit'), '', tep_href_link(self::FILENAME, 'cPath=' . self::$cPath . '&cID=' . $categories['id'] . '&action=edit' ),'' );
- if(tep_action_check('delete', self::FILENAME))
- $action_str.= sprintf(CsrtAction::getLink('row_action_right', IMAGE_DELETE, 'delete'), 'fancy', tep_href_link(self::FILENAME, 'cPath=' . self::$cPath . '&cID=' . $categories['id'] . '&action=delete') ,'' );
-
- return sprintf(
- CsrtAction::getFormat('row_action'),
- self::$modules->display_ColumnRowAction($categories['id']) .
- $action_str_left
- ,
- $action_str
- );
- }
-
-
- /**
- @brief return format html for row status
- @param $product array restuts row
- @return string html
- */
- public static function RowStatus($categories){
- $exclude=array('action','cID','forceajax','type','class','function','funct', 'mod');
- $query_s='action=setflag&cID=' . $categories['id'].'&flag=';
-
- return '<a class="ajaxinline" href="' . tep_href_link(self::FILENAME, tep_get_all_get_params($exclude).$query_s.(($categories['status'] == '1')? '0' : '1') ) . '">'.
- sprintf(
- CsrtAction::getFormat('row_flag'),
- (int)$categories['status'],
- ( ($categories['status'] == '1')? IMAGE_ICON_STATUS_GREEN : IMAGE_ICON_STATUS_RED)
- ).
- '</a>';
- }
-
- /**
- @brief return format html for row hidden
- @param $product array restuts row
- @return string html
- */
- public static function RowHidden($categories){
- $exclude=array('action','cID','forceajax','type','class','function','funct', 'mod');
- $query_s='action=viewflag&cID=' . $categories['id'].'&flag=';
-
- return '<a class="ajaxinline" href="' . tep_href_link(self::FILENAME, tep_get_all_get_params($exclude).$query_s.(($categories['hidden'] == '1')? '0' : '1') ) . '">'.
- sprintf(
- CsrtAction::getFormat('row_flag'),
- (int)$categories['hidden'],
- ( ($categories['hidden'] == '1')? IMAGE_ICON_STATUS_GREEN : IMAGE_ICON_STATUS_RED)
- ).
- '</a>';
- }
-
-
-
- /** static InterfacedInnerHtml */
-
- public static function detail_row_page($id){
- self::$cInfo=self::load_db_values((int)$id);
-
- return MGabCont::CallGab('inline','display_view',__CLASS__);
- }
-
-
- /**
- @brief return Filename
- */
- public static function GetFILENAME(){
- return self::FILENAME;
- }
-
-
-
- /**
- @brief format db value for display page
- @param $_query ressource db sql
- @return array
- */
- private static function FormatDBValue($_query){
- $DB=Database::getInstance();
- $res=array();
-
- switch (self::$action) {
- case 'listing':
- global $query_numrows,$languages_id;
-
- while ($item = $_query->fetchAssoc()) {
- $ord =array();
-
- foreach(self::$InitInfo['modele']['listing'] as $k=>$row){
- if($k == 'action') $ord[$k]=self::ButtonRowsActions($item);
- elseif($k == 'status') $ord[$k]=self::RowStatus($item);
- elseif($k == 'hidden') $ord[$k]=self::RowHidden($item);
- elseif($k == 'image') $ord[$k]=(!empty($item['image'])) ? tep_info_image($item['image'], $item['name'], TEMP_BO_SMALL_IMAGE_WIDTH, TEMP_BO_SMALL_IMAGE_HEIGHT) : ' N/A';
- elseif($k == 'cPath') $ord[$k]=categorieUtility::get_generated_category_path_ids( $item['id']);
- elseif(in_array($k,array('added', 'modified') ) )$ord[$k]=((isset($item[$k]) && $item[$k] !='1000-01-01 00:00:00' )? tep_date_short($item[$k]) : '' );
- else $ord[$k]=$item[$k];
- }
-
- $item[1]=tep_draw_checkbox_field('action_multi['.$item['id'].']','action_mutli_'.$item['id'],$item['id']);
- $ord[0]=$item['id'];
-
- $res[]=$ord;
- }
- break;
-
- case 'new':
- case 'edit';
- default:
- global $languages_id;
-
- $ord =array();
-
- if(is_object($_query)){
- $res = new stdClass;
- foreach($_query as $key=>$row) {
- switch($key){
- case 'lg':
- foreach($row as $ke=>$ro){
- foreach($ro as $k=>$r){
-
- if( ($new_r = self::GetEditFieldsDefine($k) ) && $new_r !=false ){
- $new_r['input_value'][$ke] = $r;
- $edit = 'edit_'.$k;
- $res->$edit = new objectInfo($new_r);
- }
-
- $res->$k = $r;
- }
- }
- break;
-
-// case 'barcode_type':
-
- default:
-
- if( ($new_r = self::GetEditFieldsDefine($key) ) && $new_r !=false ){
- $new_r['input_value'] = $row;
- $edit = 'edit_'.$key;
- $res->$edit = new objectInfo($new_r);
- }
-
- $res->$key = $row;
- }
- }
- }
- }
-
- return $res;
- }
-
-
-
-
-/** Interface module */
-
- function check() { return false; }
- function install() { return false; }
- function remove() { return false; }
- function keys() { return false; }
-}
-
-
+/**
+ @remarks Transmit var array for master construtor boxes
+*/
+ $array=array('title'=>__('categories menu'),'content'=>tep_output_string_protected($s,false,true));
?>
\ No newline at end of file
Modified: trunk/catalog/common/class.interfaces.php
===================================================================
--- trunk/catalog/common/class.interfaces.php 2014-01-22 07:48:08 UTC (rev 5064)
+++ trunk/catalog/common/class.interfaces.php 2014-01-23 17:45:50 UTC (rev 5065)
@@ -96,7 +96,6 @@
-
/**
@interface InterfaceModule
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@@ -118,7 +117,6 @@
Interface InterfaceAcaGene {
//! Force la classe implements à définir cette méthode
public function display_view($ID,$class='');
- public function display_view_min($ID,$class='');
}
/**
Modified: trunk/catalog/common/classes/DataTypes.php
===================================================================
--- trunk/catalog/common/classes/DataTypes.php 2014-01-22 07:48:08 UTC (rev 5064)
+++ trunk/catalog/common/classes/DataTypes.php 2014-01-23 17:45:50 UTC (rev 5065)
@@ -447,6 +447,8 @@
$type = self::$subDataType;
$_m_obj = self::$env->modlist['Data_'.$type];
+// var_dump($_m_obj);
+// exit;
$listing = $_m_obj->listing_sql;
if(isset(self::$env->IvRootListing[$type]))
Modified: trunk/catalog/common/classes/datatype_drivers/Data_categorie.php
===================================================================
--- trunk/catalog/common/classes/datatype_drivers/Data_categorie.php 2014-01-22 07:48:08 UTC (rev 5064)
+++ trunk/catalog/common/classes/datatype_drivers/Data_categorie.php 2014-01-23 17:45:50 UTC (rev 5065)
@@ -69,17 +69,17 @@
// public $ChildsType;
/**
- @var string query formated for listing context
+ @var array
*/
- public $listing_query = '';
+ public $listing_sql = array();
/**
@var string query sort formated for listing context
*/
- public $listing_query_sort = '';
+// public $listing_query_sort = '';
/**
@var string query col master formated for listing context
*/
- public $listing_query_col_count = '';
+// public $listing_query_col_count = '';
@@ -423,7 +423,7 @@
if (isset($cPath_array)) {
for ($i=0, $n=sizeof($cPath_array); $i<$n; $i++) {
if( ($categories=categorie::get_item((int)$cPath_array[$i])) !=false)
- $breadcrumb->add($categories->categories_name, tep_href_link(FILENAME_DEFAULT, 'cPath=' . implode('_', array_slice($cPath_array, 0, ($i+1)))));
+ $breadcrumb->add( $categories->GetTitle() , $categories->GetHref() );
else break;
}
}
@@ -432,9 +432,9 @@
$obj = new stdClass();
$obj->type = $this->DataType ;
// $obj->gabarit = $this->DataType.'/listing.detail' ;
- $obj->image = $categories->categories_image;
- $obj->name = $categories->title;
- $obj->description = $categories->categories_description;
+ $obj->image = $categories->GetImage();
+ $obj->name = $categories->GetTitle();
+ $obj->description = $categories->GetText();
$page->SetVar('RootListing',$obj);
$page->SetVar('current_id',$current_category_id);
Modified: trunk/catalog/common/classes/datatype_drivers/Data_content.php
===================================================================
--- trunk/catalog/common/classes/datatype_drivers/Data_content.php 2014-01-22 07:48:08 UTC (rev 5064)
+++ trunk/catalog/common/classes/datatype_drivers/Data_content.php 2014-01-23 17:45:50 UTC (rev 5065)
@@ -144,7 +144,7 @@
@brief calcul du cpath specifique a ce tyep de donnée
*/
function GetcPath(){
- return content::get_content_path($_GET['content']);
+ return 1; //content::get_content_path($_GET['content']);
}
/**
@@ -299,46 +299,40 @@
case 'unique':
- $page->init('content.php',$language);
+ $page->init('default.php',$language);
$breadcrumb=$page->return_object('breadcrumb');
// call transversal load in other modules
DataTypes::transversal('transversal');
- /** init aca module */
- $aca_content=$page->new_class('content',true);
+ if ( ($objectContent =content::get_item((int)$_GET['content'])) ==false )
+ tep_redirect(tep_href_link('','ServerError=404') );
- if (isset($_GET['action'])) {
- $action=(string)tep_db_prepare_input($_GET['action']);
- if ($aca_content->check_action('',$action) ) {
- $aca_content->after_check_action('',$action);
- tep_redirect(tep_href_link('content.php', tep_get_all_get_params(array('action'))));
- }
- }
+ $linkcat = $objectContent->GetLinkTo('categorie');
- $content = content::get_item((int)$_GET['content']);
+ $cPath_array = categorie::get_parent_categories(array(), $linkcat[0] );
- $cPath_array = categorie::get_parent_categories(array(), $content->categories_id);
- $cPath_array[]=$content->categories_id;
+ $cPath_array[]=$linkcat[0];
/// add category names to the breadcrumb trail
-// $cPath_array = $page->add_var_page('cPath_array', $cPath_array);
if (is_array($cPath_array)) {
for ($i=0, $n=sizeof($cPath_array); $i<$n; $i++) {
if( ($categories=categorie::get_item((int)$cPath_array[$i])) !=false)
- $breadcrumb->add($categories->categories_name, tep_href_link(FILENAME_DEFAULT, 'cPath=' . implode('_', array_slice($cPath_array, 0, ($i+1)))));
+ $breadcrumb->add( $categories->GetName(), $categories->GetHref() );
else break;
}
}
- $page->title=$content->title;
- $breadcrumb->add($content->title, $content->href);
- $page_content = $page->force_content('content.php');
+// $page->title=$objectContent->title;
+ $breadcrumb->add($objectContent->GetTitle(), $objectContent->GetHref() );
- $page->add_var_page('content',$content);
- $page->add_var_page('current_id',@$_GET['content']);
+
+ $page->SetVar('current_object', $objectContent);
+ $page->SetVar('current_type',$this->DataType);
+ $page->SetVar('current_id',(int)$objectContent->GetId());
+ $page->SetVar('type_id',(int)$objectContent->GetType());
/**
Specifique au bloite récement vu. Enregistrement désactivier si OSCSS__B_RECENTLY_VIEWED et a false
@@ -361,7 +355,7 @@
}
- return $page_content;
+ return 'default.php';
break;
default:
}
Modified: trunk/catalog/common/classes/datatype_drivers/Data_diver.php
===================================================================
--- trunk/catalog/common/classes/datatype_drivers/Data_diver.php 2014-01-22 07:48:08 UTC (rev 5064)
+++ trunk/catalog/common/classes/datatype_drivers/Data_diver.php 2014-01-23 17:45:50 UTC (rev 5065)
@@ -203,6 +203,15 @@
}
}
}
+
+ // Force put Content data for Key Page_xxx
+ elseif(( ($objectContent=content::get_item($page->oscss_body_id()) ) !=false ) ){
+
+ $page->SetVar('current_object', $objectContent);
+ $page->SetVar('current_type',$this->DataType);
+ $page->SetVar('current_id',(int)$objectContent->GetId());
+ $page->SetVar('type_id',(int)$objectContent->GetType());
+ }
else
switch ($p){
// case 'form.php':
@@ -217,7 +226,11 @@
$breadcrumb->add( __('breadcrumb '.str_replace('_',' ',substr($p,0,-4) )), tep_href_link($p));
}
+// var_dump($page->oscss_body_id());
+
+//
+
return $page_content;
}
Modified: trunk/catalog/common/classes/datatype_drivers/Data_home.php
===================================================================
--- trunk/catalog/common/classes/datatype_drivers/Data_home.php 2014-01-22 07:48:08 UTC (rev 5064)
+++ trunk/catalog/common/classes/datatype_drivers/Data_home.php 2014-01-23 17:45:50 UTC (rev 5065)
@@ -162,9 +162,21 @@
$DB=Database::getInstance();
- $page->init($this->DataType.'.php',$language);
+ $page->init('default.php',$language);
$breadcrumb=$page->return_object('breadcrumb');
+
+ // Force put Content data for Key Page_xxx
+ if(( ($objectContent=content::get_item('Page_home') ) !=false ) ){
+ $page->SetVar('current_object', $objectContent);
+ $page->SetVar('current_type',$this->DataType);
+ $page->SetVar('current_id',(int)$objectContent->GetId());
+ $page->SetVar('type_id',(int)$objectContent->GetType());
+
+ return 'default.php';
+ }
+
+ // return Classqie home in file dir
return $this->DataType.'.php';
}
Modified: trunk/catalog/common/classes/datatype_drivers/Data_product.php
===================================================================
--- trunk/catalog/common/classes/datatype_drivers/Data_product.php 2014-01-22 07:48:08 UTC (rev 5064)
+++ trunk/catalog/common/classes/datatype_drivers/Data_product.php 2014-01-23 17:45:50 UTC (rev 5065)
@@ -90,8 +90,8 @@
// $this->use_in_search = _cst_bool('DATA_PRODUCT_USEINSEARCH');
-
- if($next) {
+
+ if($next ==true) {
$this->listing_sql['tables'] = " FROM " . TABLE_PRODUCTS . " ".$this->p." ".
" LEFT JOIN " . TABLE_PRODUCTS_DESCRIPTION . " ".$this->p."d ON( ".$this->p."d.products_id = ".$this->p.".products_id AND ".$this->p."d.language_id = '%3\$s' ) ".
"";
@@ -113,10 +113,6 @@
$page->pile_file_lang($path_lg);
}
-
-
-
-
}
/**
@@ -219,10 +215,10 @@
$prod_cache = array();
- if( _test_bool('SEO_ADD_CAT_PARENT') )
+// if( _test_bool('SEO_ADD_CAT_PARENT') )
$res=$DB->query( $sql= "select ft.page_id as ID , head_title_tag as tName, head_desc_tag, head_keywords_tag from " . TABLE_FULL_TAG . " ft, " . TABLE_FULL_TAG_DESCRIPTION . " ftd where ft.tag_id=ftd.tag_id and ft.page_type='product' 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_PRODUCTS_TO_CATEGORIES." cd2 ON page_id=cd2.products_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='product' and ftd.language_id = '" . (int)$languages_id. "' GROUP BY 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_PRODUCTS_TO_CATEGORIES." cd2 ON page_id=cd2.products_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='product' and ftd.language_id = '" . (int)$languages_id. "' GROUP BY ID" );
while ($result =$res->fetchAssoc()){
@@ -231,8 +227,11 @@
if(isset($result['categories_cpath']) && !empty($result['categories_cpath'])) {
$list = explode('_',$result['categories_cpath']);
- foreach($list as $row )
+
+ 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']) ;
@@ -261,7 +260,7 @@
if (isset($_GET['pto'])) $pto = $_GET['pto'];
- if (tep_not_null($pfrom)) {
+ if (isset($pfrom) && tep_not_null($pfrom)) {
if ($currencies->is_set($currency)) {
$rate = $currencies->get_value($currency);
@@ -269,7 +268,7 @@
}
}
- if (tep_not_null($pto)) {
+ if (isset($pto) && tep_not_null($pto)) {
if (isset($rate)) {
$pto = $pto / $rate;
}
@@ -308,7 +307,7 @@
$this->listing_sql['tables'] .=" LEFT JOIN " . TABLE_FULL_TAG_DESCRIPTION . " ftd ON(ft.tag_id=ftd.tag_id AND ftd.language_id = '" . (int)$languages_id. "' ) ";
- if ( (tep_not_null($pfrom) || tep_not_null($pto)) ) {
+ if ( (isset($pfrom) && tep_not_null($pfrom) ) || ( isset($pto) && tep_not_null($pto)) ) {
if (!tep_session_is_registered('customer_country_id')) {
$customer_country_id = STORE_COUNTRY;
$customer_zone_id = STORE_ZONE;
@@ -320,7 +319,7 @@
/// Add search in Extra value
$this->listing_sql['tables'] .= " LEFT JOIN " . TABLE_EXTRA_FIELDS_TO . " p2pef ON(p2pef.data_id = p.products_id AND p2pef.data_type = 'product') ";
- if(in_array(true, (array)$use_value_list))
+ if(isset($use_value_list) && in_array(true, (array)$use_value_list))
$this->listing_sql['tables'] .= " LEFT JOIN " . TABLE_EXTRA_FIELDS_VALUES . " pefv ON(pefv.fields_id = p2pef.fields_id AND ( pefv.languages_id = '" . (int)$languages_id . "' OR pefv.languages_id = '0' ) ) ";
@@ -365,16 +364,16 @@
}
// search date
- if (tep_not_null($dfrom)) $this->listing_sql['where'] .= " and p.products_date_added >= '" . tep_date_raw($dfrom) . "'";
- if (tep_not_null($dto)) $this->listing_sql['where'] .= " and p.products_date_added <= '" . tep_date_raw($dto) . "'";
+ if (isset($dfrom) && tep_not_null($dfrom)) $this->listing_sql['where'] .= " and p.products_date_added >= '" . tep_date_raw($dfrom) . "'";
+ if (isset($dto) && tep_not_null($dto)) $this->listing_sql['where'] .= " and p.products_date_added <= '" . tep_date_raw($dto) . "'";
/// search price
- if ($pfrom > 0) {
+ if (isset($dfrom) && $pfrom > 0) {
$this->listing_sql['where'] .= " and ( (p.products_price * if(gz.geo_zone_id is null, 1, 1 + (tr.tax_rate / 100) ) >= " . (double)$pfrom . ")";
$this->listing_sql['where'] .= " OR (IF(s.status, s.specials_new_products_price, p.products_price) >= " . (double)$pfrom . ") ) ";
}
- if ($pto > 0){
+ if (isset($dto) && $pto > 0){
$this->listing_sql['where'] .= " and ( (p.products_price * if(gz.geo_zone_id is null, 1, 1 + (tr.tax_rate / 100) ) <= " . (double)$pto . ")";
$this->listing_sql['where'] .= " OR (IF(s.status, s.specials_new_products_price, p.products_price) <= " . (double)$pto . ") )";
}
@@ -442,22 +441,26 @@
//! produit nom trouvé
- if ( ($obj_product_info =product_info((int)$_GET['products_id'])) ==false )
+ if ( ($objectProduct =product::get_item((int)$_GET['products_id'])) ==false )
tep_redirect(tep_href_link('','ServerError=404') );
- $cPath_array = categorie::get_parent_categories(array(), $obj_product_info->categories_id);
- $cPath_array[]=$obj_product_info->categories_id;
+ $linkcat = $objectProduct->GetLinkTo('categorie');
+
+ $cPath_array = categorie::get_parent_categories(array(), $linkcat[0] );
+
+ $cPath_array[]=$linkcat[0];
+
/// add category names to the breadcrumb trail
if (is_array($cPath_array)) {
for ($i=0, $n=sizeof($cPath_array); $i<$n; $i++) {
if( ($categories=categorie::get_item((int)$cPath_array[$i])) !=false)
- $breadcrumb->add($categories->categories_name, $categories->href);
+ $breadcrumb->add( $categories->GetName(), $categories->GetHref() );
else break;
}
}
- $product_info=arrayInfo($obj_product_info);
+ $product_info=arrayInfo($objectProduct);
$page->add_var_page('product_info',$product_info);
$page->title=$product_info['title'];
@@ -491,13 +494,14 @@
$_SESSION['recently_viewed']['product'] = $recently_viewed;
}
- $page->product->pile_img[]=$product_info['products_image'];
+// $page->product->pile_img[]=$product_info['products_image'];
$page_content = $page->force_content('product_info.php');
+ $page->SetVar('current_object', $objectProduct);
$page->SetVar('current_type',$this->DataType);
$page->SetVar('current_id',(int)$_GET['products_id']);
- $page->SetVar('type_id',(int)$obj_product_info->type);
+ $page->SetVar('type_id',(int)$objectProduct->GetType());
return $page_content;
break;
Modified: trunk/catalog/common/classes/price.php
===================================================================
--- trunk/catalog/common/classes/price.php 2014-01-22 07:48:08 UTC (rev 5064)
+++ trunk/catalog/common/classes/price.php 2014-01-23 17:45:50 UTC (rev 5065)
@@ -144,9 +144,10 @@
if (tep_db_num_rows($price_query)) $products_price = tep_db_fetch_array($price_query);
}
if (!isset($products_price['products_price'])) { // si pas de prix pour le groupe, recup prix général
- $product_obj=product::get_item($pid);
- if(!$product_obj) return 0;
- $products_price['products_price']=(float) $product_obj->products_price;
+ $objectProduct=product::get_item($pid);
+ if(!$objectProduct)
+ return 0;
+ $products_price['products_price']=(float) $objectProduct->GetPrice();
}
$products_price['products_price'] += (float)$this->get_attributes_price($products_id, tep_get_prid_array($products_id));
@@ -215,9 +216,10 @@
*/
private function get_tax_rates_from_pid($products_id, $country_id = -1, $zone_id = -1) {
$pid = tep_get_prid($products_id);
- $product_obj=product::get_item($pid);
- if(!$product_obj)return false;
- return $this->get_tax_rate($product_obj->products_tax_class_id, $country_id, $zone_id);
+ $objectProduct=product::get_item($pid);
+ if(!$objectProduct)
+ return false;
+ return $this->get_tax_rate($objectProduct->GetTaxClassId(), $country_id, $zone_id);
}
Modified: trunk/catalog/includes/application_top.php
===================================================================
--- trunk/catalog/includes/application_top.php 2014-01-22 07:48:08 UTC (rev 5064)
+++ trunk/catalog/includes/application_top.php 2014-01-23 17:45:50 UTC (rev 5065)
@@ -81,11 +81,11 @@
/// ajout chemin template dans autoload class
autoload::getInstance();
- autoload::addPath(DIR_FS_TEMPLATES.TEMPLATE_NAME.'/'.DIR_WS_CLASSES .'%s.php',4);
- autoload::addPath(DIR_FS_TEMPLATES.TEMPLATE_NAME.'/'.DIR_WS_CLASSES .'core_page/%s.php',4);
- autoload::addPath(DIR_FS_TEMPLATES.TEMPLATE_NAME.'/'.DIR_WS_CLASSES .'core_page/overlay/%s.php',4);
- autoload::addPath(DIR_FS_TEMPLATES.TEMPLATE_NAME.'/'.DIR_WS_CLASSES .'drivers/page/%s.php',4);
- autoload::addPath(DIR_FS_TEMPLATES.TEMPLATE_NAME.'/'.DIR_WS_CLASSES .'drivers/data/%s.php',4);
+ autoload::addPath(DIR_FS_TEMPLATES.$Cfg->GetConf('TEMPLATE_NAME').'/'.DIR_WS_CLASSES .'%s.php',4);
+ autoload::addPath(DIR_FS_TEMPLATES.$Cfg->GetConf('TEMPLATE_NAME').'/'.DIR_WS_CLASSES .'core_page/%s.php',4);
+ autoload::addPath(DIR_FS_TEMPLATES.$Cfg->GetConf('TEMPLATE_NAME').'/'.DIR_WS_CLASSES .'core_page/overlay/%s.php',4);
+ autoload::addPath(DIR_FS_TEMPLATES.$Cfg->GetConf('TEMPLATE_NAME').'/'.DIR_WS_CLASSES .'drivers/page/%s.php',4);
+ autoload::addPath(DIR_FS_TEMPLATES.$Cfg->GetConf('TEMPLATE_NAME').'/'.DIR_WS_CLASSES .'drivers/data/%s.php',4);
/// include list of project class and lib permanente
include(DIR_WS_INCLUDES . 'inc_base_lib.php');
Modified: trunk/catalog/includes/classes/AbstractAcaModule.php
===================================================================
--- trunk/catalog/includes/classes/AbstractAcaModule.php 2014-01-22 07:48:08 UTC (rev 5064)
+++ trunk/catalog/includes/classes/AbstractAcaModule.php 2014-01-23 17:45:50 UTC (rev 5065)
@@ -12,6 +12,7 @@
Ces classes sont les classes de base de l'appel des structure aca, elle ne sont appelé que par l'intermisiaire de class enfants
*/
+require_once(DIR_FS_CATALOG . DIR_WS_COMMON . 'class.interfaces.php') ;
Class DataTypeFactory{
@@ -125,10 +126,16 @@
$folder .= '/' . $class;
}
if (!empty($class)) {
- if(($path=page::fix_file(DIR_WS_INCLUDES .'languages/'. $language . '/modules/'. $folder.'/' . $file,true)) !=false) $page->pile_file_lang($path);
- if(!class_exists($class) && ( ($pathclass=page::fix_file(DIR_WS_MODULES . $folder.'/' . $file)) != false ) )include($pathclass);
- if(!class_exists($class)) trigger_error(sprintf(__CLASS__.' Could not load class %s', $class), E_USER_ERROR);
- else $list_mod[]=$class;
+ if(($path=page::fix_file(DIR_WS_INCLUDES .'languages/'. $language . '/modules/'. $folder.'/' . $file,true)) !=false)
+ $page->pile_file_lang($path);
+
+ if(!class_exists($class) && ( ($pathclass=page::fix_file(DIR_WS_MODULES . $folder.'/' . $file)) != false ) )
+ include($pathclass);
+
+ if(!class_exists($class))
+ trigger_error(sprintf(__CLASS__.' Could not load class %s', $class), E_USER_ERROR);
+ else
+ $list_mod[]=$class;
}
}
}
@@ -386,7 +393,7 @@
class AcaFactory
extends AbstractAcaModule
- implements InterfaceAcaGene{
+ /*implements InterfaceAcaGene*/{
//! @p object
protected static $_instance;
@@ -464,12 +471,12 @@
* @param $pID int le Id du produits
* @param $class string le nom de la class appelé, ou vide pour toutes les class enfants
*/
- public function display_view($pID,$class=''){
+ public function display_view($ID,$class=''){
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);
- $result = $this->modules[$class]->display_view($pID);
+ $this->modules[$class]->load_db_values($ID);
+ $result = $this->modules[$class]->display_view($ID);
return $result[0];
}
} else {
@@ -477,8 +484,8 @@
if(isset($this->modules) && is_array($this->modules))
foreach ($this->modules as $key=>$module) {
if (($module->enabled) and (method_exists($module, 'display_view' ))) {
- $this->modules[$key]->load_db_values($pID);
- $result = $this->modules[$key]->display_view($pID);
+ $this->modules[$key]->load_db_values($ID);
+ $result = $this->modules[$key]->display_view($ID);
$o[] = $result;
}
}
Modified: trunk/catalog/includes/classes/category_tree.php
===================================================================
--- trunk/catalog/includes/classes/category_tree.php 2014-01-22 07:48:08 UTC (rev 5064)
+++ trunk/catalog/includes/classes/category_tree.php 2014-01-23 17:45:50 UTC (rev 5065)
@@ -63,41 +63,23 @@
}
else {
$this->data = array();
- $sql = " AND c.categories_hidden='1' ";
+ $sql = " AND cat.categories_hidden='1' ";
- $sql .= "AND categories_datatype = '".$this->datatype."' ";
+ $sql .= "AND cat.categories_datatype = '".$this->datatype."' ";
categorie::add_where_query($sql);
$list = categorie::get_query('','','',array('limit'=>0));
foreach($list as $categories)
- if( (bool)$categories->status)
+ i...
[truncated message content] |
|
From: <os...@us...> - 2014-01-22 07:48:12
|
Revision: 5064
http://sourceforge.net/p/oscss/svn/5064
Author: oscim
Date: 2014-01-22 07:48:08 +0000 (Wed, 22 Jan 2014)
Log Message:
-----------
Fix
Modified Paths:
--------------
trunk/catalog/admin/includes/classes/drivers/sqlcategorie.php
trunk/catalog/admin/includes/classes/drivers/sqlcontent.php
trunk/catalog/common/classes/DataTypes.php
trunk/catalog/common/classes/datatype_drivers/Data_categorie.php
trunk/catalog/index.php
Modified: trunk/catalog/admin/includes/classes/drivers/sqlcategorie.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlcategorie.php 2014-01-22 04:34:08 UTC (rev 5063)
+++ trunk/catalog/admin/includes/classes/drivers/sqlcategorie.php 2014-01-22 07:48:08 UTC (rev 5064)
@@ -81,6 +81,9 @@
if(count($sql_data_array) > 0){
+ if(isset($sql_data_array['categories_datatype']) && $sql_data_array['categories_datatype'] =='-1')
+ $sql_data_array['categories_datatype'] = '';
+
$modules->get_insert_table_categories($sql_data_array,'');
$res=tep_db_perform(TABLE_CATEGORIES, $sql_data_array);
Modified: trunk/catalog/admin/includes/classes/drivers/sqlcontent.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlcontent.php 2014-01-22 04:34:08 UTC (rev 5063)
+++ trunk/catalog/admin/includes/classes/drivers/sqlcontent.php 2014-01-22 07:48:08 UTC (rev 5064)
@@ -123,6 +123,7 @@
$error=0;
$languages_id = @$option['language_id'];
$where ='';
+ $post = array();
$modules = self::$modules;
if( isset($option['post']) ){
Modified: trunk/catalog/common/classes/DataTypes.php
===================================================================
--- trunk/catalog/common/classes/DataTypes.php 2014-01-22 04:34:08 UTC (rev 5063)
+++ trunk/catalog/common/classes/DataTypes.php 2014-01-22 07:48:08 UTC (rev 5064)
@@ -585,17 +585,23 @@
if(empty($type))
$type = self::$currenttype;
+ $selected = false;
+
+ foreach(self::$env->modlist as $class=>$module){
- foreach(self::$env->modlist as $class=>$module){
if(
isset(self::$env->RootListing[$class]) && self::$env->RootListing[$class] !=false // this module is RootListing (manufacturer, categories)
-// && in_array($type, $module->RootListing) // RootListing array require content current type
- && $module->is_type($mode) // is_type actif
){
- $module->FO_load_page($mode);
+ if($module->is_type($mode) === true && !is_object($selected) ){
+ $selected = $module;
+ }
}
}
+ if(is_object($selected))
+ return $selected->is_type($mode);
+
+
return false;
}
}
Modified: trunk/catalog/common/classes/datatype_drivers/Data_categorie.php
===================================================================
--- trunk/catalog/common/classes/datatype_drivers/Data_categorie.php 2014-01-22 04:34:08 UTC (rev 5063)
+++ trunk/catalog/common/classes/datatype_drivers/Data_categorie.php 2014-01-22 07:48:08 UTC (rev 5064)
@@ -141,7 +141,7 @@
-// var_dump($mode);
+
if (isset($_GET['categories_id']) && tep_not_null($_GET['categories_id'])) {
$list="'".(int)$_GET['categories_id']."' ,";
@@ -152,7 +152,7 @@
$list .= " '" . (int)$subcategories_array[$i] . "' ,";
}
}
-// var_dump(" AND ".$this->p."2c.categories_id IN(".substr($list, 0,-1) . ")");
+
$this->listing_sql['leftto']['where'] .= " AND ".$this->p."2c.categories_id IN(".substr($list, 0,-1) . ")";
}
@@ -226,7 +226,7 @@
if( empty($childs_type) )
$childs_type = DATATYPES_DEFAULT_NOSELECTED;
-
+
DataTypes::ForceChilds($this->DataType,$childs_type);
}
// elseif($current_category_id==0)$category_depth = 'top';
@@ -261,8 +261,9 @@
$category_depth = 'error';
}
}
+ $page->SetVar('category_depth',$category_depth);
- $page->SetVar('category_depth',$category_depth);
+ return true;
}
break;
Modified: trunk/catalog/index.php
===================================================================
--- trunk/catalog/index.php 2014-01-22 04:34:08 UTC (rev 5063)
+++ trunk/catalog/index.php 2014-01-22 07:48:08 UTC (rev 5064)
@@ -111,9 +111,9 @@
}
}
+// $page->init(basename(__FILE__),$language);
-
$load=$page->post_init(false);
$page->javascript->add_framework("ext/jquery/jquery.min.js");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2014-01-22 04:34:12
|
Revision: 5063
http://sourceforge.net/p/oscss/svn/5063
Author: oscim
Date: 2014-01-22 04:34:08 +0000 (Wed, 22 Jan 2014)
Log Message:
-----------
Fix
Modified Paths:
--------------
trunk/dev/generator/datatype/Modele/catalog/admin/includes/classes/drivers/sql_DATATYPE_REPLACE_.php
trunk/dev/generator/datatype/Modele/catalog/admin/includes/languages/fr_FR/_DATATYPE_REPLACE_.txt
trunk/dev/generator/datatype/Modele/catalog/common/classes/datatype_drivers/Data__DATATYPE_REPLACE_.php
trunk/dev/generator/datatype/Modele/install.xml
trunk/dev/generator/datatype/Modele/sql/mysql/install/tables/osc__DATATYPE_REPLACE_.sql
Added Paths:
-----------
trunk/dev/generator/datatype/Modele/catalog/admin/includes/gabarit/_DATATYPE_REPLACE_s/rightto.edit.gab
trunk/dev/generator/datatype/Modele/catalog/includes/languages/fr_FR/_DATATYPE_REPLACE_.txt
trunk/dev/generator/datatype/Modele/catalog/includes/modules/listing__DATATYPE_REPLACE_.php
trunk/dev/generator/datatype/Modele/catalog/includes/modules/listing__DATATYPE_REPLACE__childs.php
trunk/dev/generator/datatype/Modele/catalog/templates/defaut/includes/boxes/
trunk/dev/generator/datatype/Modele/catalog/templates/defaut/includes/boxes/_DATATYPE_REPLACE_.php
trunk/dev/generator/datatype/Modele/catalog/templates/defaut/includes/content/_DATATYPE_REPLACE__listing.php
trunk/dev/generator/datatype/Modele/sql/mysql/install/tables/osc__DATATYPE_REPLACE__data.sql
Removed Paths:
-------------
trunk/dev/generator/datatype/Modele/catalog/admin/includes/gabarit/_DATATYPE_REPLACE_s/display_view.listing.gab
Modified: trunk/dev/generator/datatype/Modele/catalog/admin/includes/classes/drivers/sql_DATATYPE_REPLACE_.php
===================================================================
--- trunk/dev/generator/datatype/Modele/catalog/admin/includes/classes/drivers/sql_DATATYPE_REPLACE_.php 2014-01-22 03:47:06 UTC (rev 5062)
+++ trunk/dev/generator/datatype/Modele/catalog/admin/includes/classes/drivers/sql_DATATYPE_REPLACE_.php 2014-01-22 04:34:08 UTC (rev 5063)
@@ -1,47 +1,44 @@
<?php if (!defined('HTTP_SERVER')) die('You can not access this file directly!');
/**
- @licence GPL 2005-_CURRENTYEAR_ 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 _CURRENTVERSION_
- @date _CURRENTDATE_
+ @version 2.1.1
+ @date 16/01/2014 ,17:08:29
@author genrated by GenerCode
@encode UTF-8
- @file sql_DATATYPE_REPLACE_.php
- @dir admin/includes/classes/drivers/
+ @class sql_DATATYPE_REPLACE_
*/
require_once( DIR_FS_ADMIN . DIR_WS_CLASSES . 'SqlFilesDataDriverClass.php');
-
-/**
- @class sql_DATATYPE_REPLACE_
-*/
class sql_DATATYPE_REPLACE_
extends SqlFilesDataDriverClass
implements ModSqlDataDriver{
+
/**
@var boolean use submodule in this class
*/
public $use_modules = true;
+
-
-
+
/**
@brief create new ligne in table configuration
@param $option array
language_id = > int $languages_id
*/
-
+ public static function create($option){
+
global $languages_id;
- self::getInstance();
+ new self();
$DB=Database::getInstance();
$error=0;
$specimen = self::Specimen();
+ $modules = self::$modules;
-
// if(!isset($option['key']))
// return 'false';
@@ -54,7 +51,7 @@
// Put post value
if(isset($option['post'])){
$post=$option['post'];
- self::$modules->load_post_values($post);
+ $modules->load_post_values($post);
}
self::PrepaDataAfterUse( $specimen , $dataarray, $post );
@@ -65,6 +62,7 @@
$DB->beginTransaction();
+
// $sql_data_array = array_merge($sql_data_array, self::$modules->get_insert_table_products());
// master table
@@ -97,6 +95,14 @@
else
$error++;
+ // linkto table
+// if( $error <= 0)
+// if( DataTypes::is_active('categorie') && tep_cst_define('TABLE__DATATYPE_REPLACE_MAJ__TO_CATEGORIES') !='false') {
+// $res = $DB->query("insert into " . TABLE__DATATYPE_REPLACE_MAJ__TO_CATEGORIES . " (_DATATYPE_REPLACE__id, categories_id) values ('" . (int)$_DATATYPE_REPLACE__id . "', '".ORPHELIN_COLLECTOR."')");
+// if(!$res)
+// $error++;
+// }
+ // linkto table
if( $error <= 0)
if(isset($post['linkto'])){
$r = MLinkTo::SqlLeftTo('_DATATYPE_REPLACE_', $_id, $post['linkto']) ;
@@ -127,6 +133,7 @@
$error = 0 ;
$list_languages=tep_get_languages();
$specimen = self::Specimen();
+ $modules = self::$modules;
if(!isset($option['id']))
return false;
@@ -136,11 +143,11 @@
if( isset($option['post']) ){
$post = $option['post'];
- self::$modules->load_post_values($post);
+ $modules->load_post_values($post);
}
-
+ else
+ $post = array();
-
$dataarray =(isset($option['sqlarray'])? $option['sqlarray'] : array() );
self::PrepaDataAfterUse( $specimen , $dataarray, $post );
@@ -164,8 +171,8 @@
// language table
if( $error <= 0)
- if(count($datalg) > 0)
- foreach($datalg as $key=>$sql_data_array){
+ if(count($sql_data_array_lg) > 0)
+ foreach($sql_data_array_lg as $key=>$sql_data_array){
$res=tep_db_perform(TABLE__DATATYPE_REPLACE_MAJ__DESCRIPTION, $sql_data_array, 'update', "_DATATYPE_REPLACE__id = '" . (int)$_id . "' and language_id = '" . (int)$key . "'");
if(!$res)
$error++;
@@ -215,97 +222,107 @@
*/
public static function fetch($option,$shortkey=false){
- self::getInstance();
+ new self();
$DB=Database::getInstance();
$result=array();
-// $languages_id = $option['language_id'];
$cat_list =array();
$list_languages=tep_get_languages();
-
+ $modules = self::$modules;
+ $error = 0;
+
$where ="";
if(isset($option['id']) && $option['id'] > 0){
$ID = (int) $option['id'];
$where .="AND c._DATATYPE_REPLACE__id = '".(int)tep_db_input($option['id'])."' ";
}
+ if(isset($option['status']) )
+ $where .="AND c._DATATYPE_REPLACE__status = '".(int)tep_db_input($option['status'])."' ";
+
+ if(isset($option['language_id'])){
+ $language_id = (int)$option['language_id'];
+ }
-// if(isset($option['language_id'])){
-// $languages_id = (int)$option['language_id'];
-// $sql .="AND pd.language_id = '".(int)tep_db_input($option['language_id'])."' ";
-// }
- if( DataTypes::is_active('categorie') && tep_cst_define('TABLE__DATATYPE_REPLACE_MAJ__TO_CATEGORIES') !='false')
- if(isset($option['catid'])){
- $languages_id = (int)$option['catid'];
- $where .="AND c2c.categories_id = '".(int)tep_db_input($option['catid'])."' ";
- }
-
$where =substr($where,3);
if(strlen($where)<4)
return false;
$sql="SELECT c.* ";
- if( DataTypes::is_active('categorie') && tep_cst_define('TABLE__DATATYPE_REPLACE_MAJ__TO_CATEGORIES') !='false')
- $sql .=", c2c.categories_id ";
-
$sql.="FROM " . TABLE__DATATYPE_REPLACE_MAJ_ . " c ";
+ $sql.=" WHERE ".$where. " ";
- if( DataTypes::is_active('categorie') && tep_cst_define('TABLE__DATATYPE_REPLACE_MAJ__TO_CATEGORIES') !='false')
- $sql .=" LEFT JOIN " . TABLE__DATATYPE_REPLACE_MAJ__TO_CATEGORIES . " c2c on(c._DATATYPE_REPLACE__id=c2c._DATATYPE_REPLACE__id) ";
-
- $sql.=" WHERE ".$where. " GROUP BY c._DATATYPE_REPLACE__id ";
-
$res = $DB->query($sql);
$num = $res->__get('numRows');
+
+// var_dump($num);
+ if($num == 1){
+ $tmp = $res->fetchAssoc();
+
+ 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 ggd.* from " . TABLE__DATATYPE_REPLACE_MAJ__DESCRIPTION . " ggd where ggd._DATATYPE_REPLACE__id = '" . (int)$tmp['_DATATYPE_REPLACE__id'] . "' AND language_id='" . $language_id . "'");
+ $content = tep_db_fetch_array($content_query);
- if($num == 1)
- $cInfo_array[] = $res->fetchAssoc();
- else
- foreach($res->fetchAllAssoc() as $row)
- $cInfo_array[] = $row;
+ $tmp['description'][$language_id] = $content['_DATATYPE_REPLACE__description'];
+ $tmp['title'][$language_id] = $content['_DATATYPE_REPLACE__title'];
- tep_db_free_result($res);
+ tep_db_free_result($content_query);
+ }
+ }
+ else{
+ $content_query = $DB->query("select ggd.* from " . TABLE__DATATYPE_REPLACE_MAJ__DESCRIPTION . " ggd where ggd._DATATYPE_REPLACE__id = '" . (int)$tmp['_DATATYPE_REPLACE__id'] . "' AND language_id='" . $language_id . "'");
+ $content = $content_query->fetchAssoc();
+ $tmp['description'][$language_id] = $content['_DATATYPE_REPLACE__description'];
+ $tmp['title'][$language_id] = $content['_DATATYPE_REPLACE__title'];
+ tep_db_free_result($content_query);
+ }
- foreach($cInfo_array as $row) {
+
+ /*
+ Use transversal Datatype Rootlisting and update in data
+ */
+ $r = MLinkTo::SqlRightTo('_DATATYPE_REPLACE_', $ID) ;
+ if($r == false)
+ $error++;
+ else
+ $tmp = array_merge($tmp,$r);
+
+
+ $tmp['mod'] = $modules->fetch(array('_DATATYPE_REPLACE__id'=>$ID, 'shortkey'=>$shortkey));
- // call all langue for this post
- for ($i=0, $n=sizeof($list_languages); $i<$n; $i++) {
- $language_id = $list_languages[$i]['id'];
- $_DATATYPE_REPLACE__query = $DB->query("select cd.* from " . TABLE__DATATYPE_REPLACE_MAJ__DESCRIPTION . " cd where cd._DATATYPE_REPLACE__id = '" . (int)$row['_DATATYPE_REPLACE__id'] . "' AND language_id='" . $language_id . "'");
- $_q_result = tep_db_fetch_array($_DATATYPE_REPLACE__query);
+ // put all val origin module in current result
+ foreach($tmp['mod'] as $submod=>$array)
+ if(is_array($array))
+ foreach($array as $key=>$val)
+ $tmp[$key] = $val;
+
+ $result[] = $tmp;
+ }
+ else
+ foreach($res->fetchAllAssoc() as $row){
+ if(isset($option['language_id'])){
+ $content_query = $DB->query($sql="select ggd.* from " . TABLE__DATATYPE_REPLACE_MAJ__DESCRIPTION . " ggd where ggd._DATATYPE_REPLACE__id = '" . (int)$row['_DATATYPE_REPLACE__id'] . "' AND language_id='" . $language_id . "'");
+ $content = $content_query->fetchAssoc();
- foreach($_q_result as $k=>$r)
- if(!in_array($k, array('_DATATYPE_REPLACE__id', 'language_id')))
- $row[$k][$language_id] =$r;
+ $row['description'][$language_id] = $content['_DATATYPE_REPLACE__description'];
+ $row['title'][$language_id] = $content['_DATATYPE_REPLACE__title'];
+ tep_db_free_result($content_query);
+ }
- tep_db_free_result($_DATATYPE_REPLACE__query);
- }
-
- if( DataTypes::is_active('categorie') && tep_cst_define('TABLE__DATATYPE_REPLACE_MAJ__TO_CATEGORIES') !='false') {
- $cat_query = $DB->query("select categories_id from " . TABLE__DATATYPE_REPLACE_MAJ__TO_CATEGORIES . " where _DATATYPE_REPLACE__id='" . (int)$row['_DATATYPE_REPLACE__id'] . "' ");
-
-
- while($cat_l = tep_db_fetch_array($cat_query)){ $cat_list[$cat_l['categories_id']]=$cat_l; }
- $row['categories']=$cat_list;
-
- tep_db_free_result($cat_query);
+ $result[] = $row;
}
+ tep_db_free_result($res);
-
-// self::$modules->load_db_values((int)$row['_DATATYPE_REPLACE__id']);
-
-
- $result[] = $row;
- }
-
-
if($num == 1){
return ((!$shortkey)? $result[0] : self::CleanKey($result[0])) ;
}
@@ -327,7 +344,7 @@
*/
public static function delete($option){
- self::getInstance();
+ new self();
$DB=Database::getInstance();
$res = false;
@@ -384,7 +401,7 @@
'_DATATYPE_REPLACE__id' => 0,
'_DATATYPE_REPLACE__type' => 1,
- '_DATATYPE_REPLACE__image' =>'',
+ '_DATATYPE_REPLACE__image' => '',
'_DATATYPE_REPLACE__status' => 0,
'_DATATYPE_REPLACE__hidden' => 0,
@@ -444,7 +461,7 @@
$type=(isset($option['type']))? $option['type'] : 'duplicate' ; // type duplicate | link
// $pid = (isset($option['id'])) ? : ;
- self::getInstance();
+ new self();
$DB=Database::getInstance();
@@ -507,7 +524,6 @@
$DB->query("insert into " . TABLE__DATATYPE_REPLACE_MAJ__TO_CATEGORIES . " (_DATATYPE_REPLACE__id, categories_id) values ('" . (int)$_DATATYPE_REPLACE_['_DATATYPE_REPLACE__id'] . "', '".ORPHELIN_COLLECTOR."')");
}
-
/**
@fn ExtractForm($data)
@brief extract data forms for put in db
@@ -517,8 +533,9 @@
public static function ExtractForm($data){
new self();
- return parent::ExtractForm(self::Specimen(), $data);
+ return parent::ExtractDataForm(self::Specimen(), $data);
}
+
/**
@@ -541,7 +558,273 @@
}
+ /**
+ @brief Function link to for contruct link featured vs datatype
+ @note normlised methode used in childs datatype
+ */
+ public static function ListLinkTo($opt){
+
+ if(!isset($opt['id']))
+ return false;
+ else
+ $id = (int)$opt['id'];
+
+ if(isset($opt['datatype']))
+ $datatype = $opt['datatype'] ;
+ else
+ $datatype = DATATYPES_DEFAULT_NOSELECTED;
+
+ $list = sql_DATATYPE_REPLACE_data::fetch(
+ array(
+ 'datatype'=> $datatype,
+ 'datatype_id'=> $id,
+ ),
+ true
+ );
+
+ if(!$list)
+ return array();
+ elseif(is_object($list))
+ $liste[]=$list;
+ else
+ $liste=$list;
+
+ return $liste;
+ }
+
+ /**
+ @brief Function link to for contruct link featued vs datatype
+ @note normlised methode used in childs datatype
+ */
+ public static function AddLinkTo($opt){
+
+ new self();
+
+ if(!isset($opt['id']))
+ return false;
+ else
+ $id = (int)$opt['id'];
+
+
+ if(isset($opt['datatype']))
+ $datatype = $opt['datatype'] ;
+ else
+ $datatype = DATATYPES_DEFAULT_NOSELECTED;
+
+
+ $value = $opt['_array'];
+
+ sql_DATATYPE_REPLACE_data::delete(array('datatype'=> $datatype , 'datatype_id'=>$id ));
+ $res = true;
+
+ if(sql_DATATYPE_REPLACE_data::fetch(
+ array(
+ '_DATATYPE_REPLACE__id'=> $value,
+ 'datatype'=> $datatype,
+ 'datatype_id'=> $id,
+ )
+ ) == false )
+ $res = sql_DATATYPE_REPLACE_data::create(
+ array(
+ '_DATATYPE_REPLACE__id'=> $value,
+ 'datatype'=> $datatype,
+ 'datatype_id'=> $id,
+ )
+ );
+
+
+ return $res;
+ }
}
+class sql_DATATYPE_REPLACE_data
+ implements ModSqlDataDriver{
+
+ public static $modules;
+
+ protected static $_instance;
+
+ protected function __construct(){
+ }
+
+
+ public static function getInstance() {
+ if(self::$_instance == null) self::$_instance = new self();
+ return self::$_instance;
+ }
+
+
+ /**
+ @brief create new ligne in table configuration
+ */
+ public static function create($option){
+ new self();
+
+ if(!isset($option['datatype']))
+ return 'datatype';
+
+// $sql_data_array['row_id'] = tep_db_prepare_input($option['id']);
+ $sql_data_array['_DATATYPE_REPLACE__id'] = tep_db_prepare_input($option['_DATATYPE_REPLACE__id']);
+ $sql_data_array['datatype'] = tep_db_prepare_input($option['datatype']);
+ $sql_data_array['datatype_id'] = tep_db_prepare_input($option['datatype_id']);
+
+// $sql_data_array['date_start'] = (isset($option['date_start'])) ? tep_db_prepare_input($option['date_start']) :'1000-01-01 00:00:00';
+// $sql_data_array['date_end'] = (isset($option['date_end'])) ? tep_db_prepare_input($option['date_end']) :'1000-01-01 00:00:00';
+
+ $sql_data_array['date_added'] = 'NOW()';
+ $sql_data_array['user_added'] = $_SESSION['login_id'];
+// print_r($sql_data_array);
+ $res=tep_db_perform(TABLE__DATATYPE_REPLACE_MAJ__DATA, $sql_data_array);
+
+ if(!$res)
+ return $res;
+ else
+ return $res->__get('insertId');
+ }
+
+ /**
+ @brief update ligne in table configuration
+ */
+ public static function update($option){
+ new self();
+
+ if(!isset($option['id']))
+ return 'id';
+
+ $where ='';
+ if(isset($option['id'])) $where .="AND _DATATYPE_REPLACE__id = '".(int)$option['id']."' ";
+ if(isset($option['datatype'])) $where .="AND datatype = '".(string)$option['datatype']."' ";
+ if(isset($option['datatype_id'])) $where .="AND datatype_id = '".(int)$option['datatype_id']."' ";
+ if(isset($option['_DATATYPE_REPLACE__id'])) $where .="AND _DATATYPE_REPLACE__id = '".(int)$option['_DATATYPE_REPLACE__id']."' ";
+
+
+
+// $sql_data_array['date_start'] = (isset($option['date_start'])) ? tep_db_prepare_input($option['date_start']) :'1000-01-01 00:00:00';
+// $sql_data_array['date_end'] = (isset($option['date_end'])) ? tep_db_prepare_input($option['date_end']) :'1000-01-01 00:00:00';
+
+ $sql_data_array['last_modified'] = 'NOW()';
+ $sql_data_array['user_modified'] = $_SESSION['login_id'];
+
+ $res=tep_db_perform(TABLE__DATATYPE_REPLACE_MAJ__DATA, $sql_data_array, 'update' , substr($where,3) );
+
+ return $res;
+ }
+
+ /**
+ @brief load ligne in table configuration
+ @param option array
+ id => row id int (configuration_id)
+ key => string key (configuration_key)
+ group_id => group_id int (configuration_group_id)
+ @param $shortkey use cleankey for return short key
+ @return
+
+ object(stdClass)[13]
+ public 'id' => string '1' (length=1)
+
+ OR
+ array(
+ object(stdClass)[13]
+ ...
+ object(stdClass)[13]
+ ..
+ )
+
+ */
+ public static function fetch($option,$shortkey=false){
+ new self();
+ $DB=Database::getInstance();
+
+ $where ="";
+ if(isset($option['id'])) $where .="AND _DATATYPE_REPLACE__id = '".(int)$option['id']."' ";
+ if(isset($option['datatype'])) $where .="AND datatype = '".(string)$option['datatype']."' ";
+ if(isset($option['datatype_id'])) $where .="AND datatype_id = '".(int)$option['datatype_id']."' ";
+ if(isset($option['_DATATYPE_REPLACE__id'])) $where .="AND _DATATYPE_REPLACE__id = '".(int)$option['_DATATYPE_REPLACE__id']."' ";
+
+ if($where=='')
+ return false;
+
+
+ $sql="SELECT * FROM " . TABLE__DATATYPE_REPLACE_MAJ__DATA . " a ".
+ " WHERE ".substr($where,3);
+
+ $res=$DB->query($sql);
+
+ $num = $res->__get('numRows');
+
+ if($num == 1){
+ $result=$res->fetchAssoc();
+ return ((!$shortkey)? $result : self::CleanKey($result));
+ }
+ elseif($num > 1){
+ $array=array();
+
+ foreach($res->fetchAllAssoc() as $result)
+ $array[]= ((!$shortkey)? $result : self::CleanKey($result));
+
+ return $array;
+ }
+
+ return false;
+ }
+
+ /**
+ @brief delete row
+ */
+ public static function delete($option){
+ new self();
+ $DB=Database::getInstance();
+
+ $where ="";
+ if(isset($option['id'])) $where .="AND _DATATYPE_REPLACE__id = '".(int)$option['id']."' ";
+ if(isset($option['datatype'])) $where .="AND datatype = '".(string)$option['datatype']."' ";
+ if(isset($option['datatype_id'])) $where .="AND datatype_id = '".(int)$option['datatype_id']."' ";
+ if(isset($option['_DATATYPE_REPLACE__id'])) $where .="AND _DATATYPE_REPLACE__id = '".(int)$option['_DATATYPE_REPLACE__id']."' ";
+
+
+ if($where=='')
+ return false;
+
+ $DB->query("DELETE FROM " . TABLE__DATATYPE_REPLACE_MAJ__DATA ." WHERE ". substr($where, 3 ) );
+
+
+ return true;
+ }
+
+
+ /**
+ @brief
+ @return array product empty
+ */
+ public static function Specimen($shortkey=false){
+ $par = array(
+ 'row_id' => '',
+ '_DATATYPE_REPLACE__id' => '',
+ 'datatype' => '',
+ 'datatype_id' => '',
+ );
+
+ return ((!$shortkey)? $par : self::CleanKey($par));
+ }
+
+
+
+ /**
+ @fn CleanKey()
+ @brief Clean string name key
+ */
+ public static function CleanKey($array){
+ new self();
+ $object= new stdclass();
+
+ foreach($array as $key=>$value){
+
+ $object->$key = $value;
+ }
+
+ return $object;
+ }
+
+}
?>
\ No newline at end of file
Deleted: trunk/dev/generator/datatype/Modele/catalog/admin/includes/gabarit/_DATATYPE_REPLACE_s/display_view.listing.gab
===================================================================
--- trunk/dev/generator/datatype/Modele/catalog/admin/includes/gabarit/_DATATYPE_REPLACE_s/display_view.listing.gab 2014-01-22 03:47:06 UTC (rev 5062)
+++ trunk/dev/generator/datatype/Modele/catalog/admin/includes/gabarit/_DATATYPE_REPLACE_s/display_view.listing.gab 2014-01-22 04:34:08 UTC (rev 5063)
@@ -1,58 +0,0 @@
-<?php
-/**
- @licence GPL 2005-_CURRENTYEAR_ The osCSS developers - osCSS Open Source E-commerce
- @portion code Copyright (c) 2002 osCommerce
- @package osCSS-2 <www http://www.oscss.org>
- @version _CURRENTVERSION_
- @date _CURRENTDATE_
- @author genrated by GenerCode
- @encode UTF-8
-*/
-global $languages_id;
-?>
- <h3 class="pageHeading"><?php echo __('heading title'); ?></h3>
-
- <div class="button_nav ">
- <?php echo '<a class="button" href="' . tep_href_link(_DATATYPE_REPLACE_s::FILENAME, 'action=new') . '">' .tep_image(DIR_WS_ICONS.'icon_add_new.png' ). __('image create new _DATATYPE_REPLACE_') . '</a>'; ?>
- <?php echo '<a class="button fancy" href="' . tep_href_link(FILENAME_CATEGORIES, '&datatype=_DATATYPE_REPLACE_&action=new_light&origin='. _DATATYPE_REPLACE_s::FILENAME) . '">' .tep_image(DIR_WS_ICONS.'icon_add_new.png' ). __('add category datatype _DATATYPE_REPLACE_') . '</a>'; ?>
- </div>
- <br style="clear:both"/>
-
- <div class="box_uniq">
-
- <div id="CurrentPathSelect" >
- <?php echo tep_draw_form('goto', _DATATYPE_REPLACE_s::FILENAME, '', 'get').'<p>'. tep_draw_pull_down_menu('cPath', categorieUtility::get_category_tree(array('datatype'=>'_DATATYPE_REPLACE_', 'language_id'=>$languages_id )), (isset($_GET['cPath'])?(int)$_GET['cPath']: 0) , 'onchange="this.form.submit();" title="'.__('heading title goto').'" ').'</p></form>'; ?>
- </div>
-
- <table class="dataTable">
- <thead>
- <tr>
- <th style="width:1%"> </th>
- <th style="width:2%"><?php print __('table heading id'); ?></th>
-<!-- <th><?php print __('table heading listings'); ?></th> -->
- <th><?php print __('table heading c title'); ?></th>
- <th><?php print __('table heading categories'); ?></th>
- <th><?php print __('table heading date added'); ?></th>
- <th class="tcenter row_status"><?php print __('table heading status'); ?></th>
- <th class="tcenter row_status"><?php print __('table heading view status'); ?></th>
- <th class="tcenter row_action"><?php print __('table heading action'); ?></th>
- </tr>
- </thead>
- <tfoot>
- <tr>
- <td style="width:1%"> </td>
-<!-- <td style="width:2%"><?php //echo tep_draw_input_field('_DATATYPE_REPLACE__id','_DATATYPE_REPLACE__id',__('table heading id'),'style="width:100%" class="search_init"'); ?></td> -->
- <td style="width:10%"><?php echo tep_draw_input_field('_DATATYPE_REPLACE__name','_DATATYPE_REPLACE__name',__('table heading listings'),'style="width:100%" class="search_init"'); ?></td>
- <td style="width:25%" class="tcenter"><?php echo tep_draw_input_field('_DATATYPE_REPLACE__title','_DATATYPE_REPLACE__title',__('table heading c title'),'style="width:100%" class="search_init"'); ?></td>
- <td style="width:12%" class="tcenter w_50"><?php echo tep_draw_input_field('categories_name','categories_name',__('table heading categories'),'style="width:100%" class="search_init"'); ?></td>
- <td style="width:3%" class="tleft"><?php echo tep_draw_input_field('date_added','date_added',__('table heading date added'),'style="width:100%" class="search_init"'); ?></td>
- <td class="tcenter row_status" style="width:2%"><?php echo tep_draw_input_field('_DATATYPE_REPLACE__status','_DATATYPE_REPLACE__status',__('table heading status'),'style="width:100%" class="search_init"'); ?></td>
- <td class="tcenter row_status" style="width:2%"><?php echo tep_draw_input_field('_DATATYPE_REPLACE__hidden','_DATATYPE_REPLACE__hidden',__('table heading view status'),'style="width:100%" class="search_init"'); ?></td>
- <td class="tcenter row_action"> </td>
- </tr>
- </tfoot>
- <tbody>
- <!-- AJAX LOAD -->
- </tbody>
- </table>
- </div>
\ No newline at end of file
Added: trunk/dev/generator/datatype/Modele/catalog/admin/includes/gabarit/_DATATYPE_REPLACE_s/rightto.edit.gab
===================================================================
--- trunk/dev/generator/datatype/Modele/catalog/admin/includes/gabarit/_DATATYPE_REPLACE_s/rightto.edit.gab (rev 0)
+++ trunk/dev/generator/datatype/Modele/catalog/admin/includes/gabarit/_DATATYPE_REPLACE_s/rightto.edit.gab 2014-01-22 04:34:08 UTC (rev 5063)
@@ -0,0 +1,50 @@
+<?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 08/10/2013, 09:32
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+*/
+global $languages_id;
+$selected = array();
+$curr = MLinkTo::$currclass;
+
+$res = sql_DATATYPE_REPLACE_::fetch(array('status'=>'1', 'language_id'=>$languages_id), true);
+
+if(is_object($res))
+ $list[] = $res;
+elseif($res !=false)
+ $list = $res;
+else
+ $list = array();
+
+if(isset($curr::$Info->_DATATYPE_REPLACE_))
+foreach($curr::$Info->_DATATYPE_REPLACE_ as $v)
+ $selected[$v->_DATATYPE_REPLACE__id] = $v->_DATATYPE_REPLACE__id;
+
+?>
+<div class="LinkToView CategoryView">
+ <label>
+ <span class="text"><?php echo __('@featureds txt link to'); ?></span>
+
+ <span class="button_nav">
+<!-- <a
+ class="buttonimg fancy"
+ href="<?php //echo tep_href_link(FILENAME_CATEGORIES, '&datatype='.MLinkTo::$current.'&action=new_light&origin='. urlencode($curr::FILENAME.'?'.MLinkTo::$origin) ) ?>"
+ title="<?php //echo sprintf(__('add category datatype %s'), MLinkTo::$current )?>"
+ >-->
+ <?php //echo tep_image(DIR_WS_ICONS.'icon_add_new.png' ) ?>
+<!-- </a> -->
+ </span>
+ </label>
+ <ul class="LinkToView">
+ <?php foreach($list as $v): ?>
+ <li class="<?php echo (isset($selected[$v->id])? 'selected' : 'noselected') ?>">
+ <?php echo tep_draw_radio_field('linkto[_DATATYPE_REPLACE_]','linkto_featured_'.$v->id, $v->id, (isset($selected[$v->id])?true : false) ).' ['.status_name('_DATATYPE_REPLACE_', $v->type ,$languages_id).'] - '. $v->title[$languages_id] ; ?>
+ </li>
+ <?php endforeach; ?>
+ </ul>
+</div>
\ No newline at end of file
Modified: trunk/dev/generator/datatype/Modele/catalog/admin/includes/languages/fr_FR/_DATATYPE_REPLACE_.txt
===================================================================
--- trunk/dev/generator/datatype/Modele/catalog/admin/includes/languages/fr_FR/_DATATYPE_REPLACE_.txt 2014-01-22 03:47:06 UTC (rev 5062)
+++ trunk/dev/generator/datatype/Modele/catalog/admin/includes/languages/fr_FR/_DATATYPE_REPLACE_.txt 2014-01-22 04:34:08 UTC (rev 5063)
@@ -8,91 +8,95 @@
@author genrated by GenerCode
@encode UTF-8
*/
-$lang['heading title']="Gestion du datatype _DATATYPE_REPLACE_" ;
+$lang['heading title']="Goute de Goût" ;
/* definition */
- $lang['@_DATATYPE_REPLACE_s table heading id']="Id" ;
+ $lang['@goutegouts table heading id']="Id" ;
- $lang['@_DATATYPE_REPLACE_s table heading type']="Type" ;
- $lang['@_DATATYPE_REPLACE_s table heading type name']="Type" ;
+ $lang['@goutegouts table heading type']="Type" ;
+ $lang['@goutegouts table heading type name']="Type" ;
- $lang['@_DATATYPE_REPLACE_s table heading status']="Etat" ;
- $lang['@_DATATYPE_REPLACE_s table heading sort order']="Tri/Position" ;
+ $lang['@goutegouts table heading status']="Etat" ;
+ $lang['@goutegouts table heading sort order']="Tri/Position" ;
- $lang['@_DATATYPE_REPLACE_s table heading title']="Titre" ;
- $lang['@_DATATYPE_REPLACE_s table heading description']="Description" ;
+ $lang['@goutegouts table heading title']="Titre" ;
+ $lang['@goutegouts table heading description']="Description" ;
- $lang['@_DATATYPE_REPLACE_s table heading date added']="Crée(s)" ;
- $lang['@_DATATYPE_REPLACE_s table heading date modified']="Modifié" ;
- $lang['@_DATATYPE_REPLACE_s table heading user added']="Créés par" ;
- $lang['@_DATATYPE_REPLACE_s table heading user modified']="Modifié par" ;
+ $lang['@goutegouts table heading date added']="Crée(s)" ;
+ $lang['@goutegouts table heading date modified']="Modifié" ;
+ $lang['@goutegouts table heading user added']="Créés par" ;
+ $lang['@goutegouts table heading user modified']="Modifié par" ;
/* List item in multiple choice */
- $lang['@_DATATYPE_REPLACE_s text status off']="Actif" ;
- $lang['@_DATATYPE_REPLACE_s text status on']="Inactif" ;
+ $lang['@goutegouts text status off']="Actif" ;
+ $lang['@goutegouts text status on']="Inactif" ;
+
+ /* rightto */
+ $lang['@goutegout txt link to'] = "Goute de Goût" ;
+ $lang['@goutegout link %s to %s'] = "Goute de Goût" ;
/* Page */
/* listing */
/* heading */
- $lang['heading title _DATATYPE_REPLACE_s']="Gestion du datatype _DATATYPE_REPLACE_" ;
+ $lang['heading title goutegouts']="Goute de Goût" ;
/* button */
- $lang['@_DATATYPE_REPLACE_s image add']="Créer" ;
+ $lang['@goutegouts image add']="Créer" ;
/* Filter */
- $lang['@_DATATYPE_REPLACE_s filter menu']="Specifique" ;
+ $lang['@goutegouts filter menu']="Specifique" ;
/* */
$lang['table heading listings']="Clef" ;
$lang['table heading categories']="Catégorie" ;
- $lang['@_DATATYPE_REPLACE_s table heading action']="Action" ;
+ $lang['@goutegouts table heading action']="Action" ;
/* Edit */
/* heading */
- $lang['@_DATATYPE_REPLACE_s heading title edit']="Édition de _DATATYPE_REPLACE_" ;
+ $lang['@goutegouts heading title edit']="Édition de goutegout" ;
/* tabs */
- $lang['@_DATATYPE_REPLACE_s tab data']="Caractéristiques" ;
+ $lang['@goutegouts tab data']="Caractéristiques" ;
/* Delete */
/* heading */
- $lang['@_DATATYPE_REPLACE_s heading title delete']="Suppression du _DATATYPE_REPLACE_" ;
+ $lang['@goutegouts heading title delete']="Suppression du goutegout" ;
/* CopyTo */
/* heading */
- $lang['@_DATATYPE_REPLACE_s heading title delete']="Suppression du _DATATYPE_REPLACE_" ;
+ $lang['@goutegouts heading title delete']="Suppression du goutegout" ;
/* other */
-// $lang['@_DATATYPE_REPLACE_s table heading title ']="Clef : " ;
-// $lang['entry _DATATYPE_REPLACE_ help']="La clef permet l'appel de cette page, elle ce doit d'être unique. Pour appeler plusieurs page, il est possible d'utiliser une racine de clef commune " ;
-// $lang['text info delete _DATATYPE_REPLACE_ intro']="Êtes-vous sûr de vouloir supprimer ces données ?" ;
+// $lang['@goutegouts table heading title ']="Clef : " ;
+// $lang['entry goutegout help']="La clef permet l'appel de cette page, elle ce doit d'être unique. Pour appeler plusieurs page, il est possible d'utiliser une racine de clef commune " ;
+// $lang['text info delete goutegout intro']="Êtes-vous sûr de vouloir supprimer ces données ?" ;
// $lang['text info date added']="Date d'ajout :" ;
// $lang['text info last modified']="Dernière modification :" ;
// $lang['text info image nonexistent']="L'IMAGE N'EXISTE PAS" ;
-// $lang['text info _DATATYPE_REPLACE_ size']="Taille :" ;
-// $lang['text info heading delete _DATATYPE_REPLACE_']="Supprimer ces données" ;
+// $lang['text info goutegout size']="Taille :" ;
+// $lang['text info heading delete goutegout']="Supprimer ces données" ;
// $lang['table heading status']="État" ;
// $lang['entry title']="Titre " ;
-// $lang['text _DATATYPE_REPLACE_ status']="Statut :" ;
+// $lang['text goutegout status']="Statut :" ;
// $lang['table heading view status']="Menu" ;
-// $lang['text _DATATYPE_REPLACE_ enabled']="Actif" ;
-// $lang['text _DATATYPE_REPLACE_ disabled']="Inactif" ;
+// $lang['text goutegout enabled']="Actif" ;
+// $lang['text goutegout disabled']="Inactif" ;
// $lang['txt info permalink']="Lien vers cette page: " ;
// $lang['txt cat all']="Toutes" ;
// $lang['heading title goto']="Lister les datatype de la catégorie" ;
// $lang['heading title search']="Chercher" ;
// $lang['txt categories']="Catégories" ;
-// $lang['tab _DATATYPE_REPLACE_ data']="Données" ;
+// $lang['tab goutegout data']="Données" ;
Modified: trunk/dev/generator/datatype/Modele/catalog/common/classes/datatype_drivers/Data__DATATYPE_REPLACE_.php
===================================================================
--- trunk/dev/generator/datatype/Modele/catalog/common/classes/datatype_drivers/Data__DATATYPE_REPLACE_.php 2014-01-22 03:47:06 UTC (rev 5062)
+++ trunk/dev/generator/datatype/Modele/catalog/common/classes/datatype_drivers/Data__DATATYPE_REPLACE_.php 2014-01-22 04:34:08 UTC (rev 5063)
@@ -11,9 +11,13 @@
@brief This class is base datatype for _DATATYPE_REPLACE_
*/
-class Data__DATATYPE_REPLACE_ {
+class Data__DATATYPE_REPLACE_
+ implements
+ DataTypesData
+ ,DataTypesChildListing
+ ,DataTypesRootListing
+ {
-
/**
@var DataType string
*/
@@ -43,6 +47,7 @@
public $db_tables = array(
## table master
'TABLE__DATATYPE_REPLACE_MAJ_' => '_DATATYPE_REPLACE_', //
+ 'TABLE__DATATYPE_REPLACE_MAJ__DATA' => '_DATATYPE_REPLACE__data', //
## table language
'TABLE__DATATYPE_REPLACE_MAJ__DESCRIPTION' => '_DATATYPE_REPLACE__description', //
@@ -78,7 +83,8 @@
global $languages_id;
-// $this->RootListing = array_map('trim',explode(',',DATATYPES_ROOTLISTING__DATATYPE_REPLACE_MAJ_));
+ if(tep_cst_define('DATATYPES_ROOTLISTING_'.strtoupper('_DATATYPE_REPLACE_')) !='false')
+ $this->RootListing = array_map('trim',explode(',',constant('DATATYPES_ROOTLISTING_'.strtoupper('_DATATYPE_REPLACE_'))));
if($next) {
$this->listing_sql['tables'] = " FROM " . TABLE__DATATYPE_REPLACE_MAJ_ . " ".$this->p." ".
@@ -89,16 +95,88 @@
$this->listing_sql['sort'] = " ".$this->p."d._DATATYPE_REPLACE__title ";
$this->listing_sql['base_key'] = "_DATATYPE_REPLACE__id ";
$this->listing_sql['col_count'] = " ".$this->p."._DATATYPE_REPLACE__id ";
+
+
+
+ global $page,$language;
+ if(is_object($page))
+ if(($path_lg=$page->fix_file(DIR_WS_INCLUDES .'languages/'. $language . '/' . $this->DataType.'.txt',true)) !=false)
+ $page->pile_file_lang($path_lg);
}
}
+
+ /**
+ @brief this methode construct sql base for link in childs data
+ this categorie use sub tables nameofdata _ to_categories
+ For history this child data product, use 's' in name of table and name of cols
+ @param $type string name of child type
+ @param $mode string anchor key used
+ @return array
+ */
+ public function GetLinkTo($type, $mode='leftto'){
+ // for letto
+ $this->listing_sql['leftto']['rows'] = array(
+ "".$this->p."data._DATATYPE_REPLACE__id"=>0,
+ );
+
+ $this->listing_sql['leftto']['tables'] = " LEFT JOIN " . TABLE__DATATYPE_REPLACE_MAJ__DATA . " ".$this->p."data ON ( ".$this->p."data.datatype_id = %1\$s AND ".$this->p."data.datatype='%2\$s' ) ";
+ $this->listing_sql['leftto']['tables'] .= " LEFT JOIN " . TABLE__DATATYPE_REPLACE_MAJ_ . " ".$this->p." ON ( ".$this->p."data._DATATYPE_REPLACE__id = ".$this->p."._DATATYPE_REPLACE__id " .DataForceStatus(" AND ".$this->p."._DATATYPE_REPLACE__status='1' ") . ") ";
+ $this->listing_sql['leftto']['tables'] .= " LEFT JOIN " . TABLE__DATATYPE_REPLACE_MAJ__DESCRIPTION . " ".$this->p."d ON( ".$this->p."d._DATATYPE_REPLACE__id = ".$this->p."._DATATYPE_REPLACE__id AND ".$this->p."d.language_id = '%s' ) ";
+
+ return $this->listing_sql['leftto'];
+ }
+
+
/**
+ @brief sql for sitemap index
+ @param $mode le type de control (public)
+ @return true
+ */
+ function Sitemap($mode='public'){
+ global $languages_id;
+
+ $this->listing_sql['tables'] = " FROM " . TABLE__DATATYPE_REPLACE_MAJ_ . " ".$this->p." ".
+ " LEFT JOIN " . TABLE__DATATYPE_REPLACE_MAJ__DATA . " ".$this->p."d ON( ".$this->p."d.featured_id = ".$this->p.".row_id ) ".
+ "";
+ // permanente contrainte
+ $this->listing_sql['where'] = " WHERE 1 ".DataForceStatus(" AND ".$this->p.".featured_status='1' ")." ";
+ // sort in sitemap
+ $this->listing_sql['sort'] = " ".$this->p.".row_id ";
+ // l id
+ $this->listing_sql['id'] = " ".$this->p.".row_id ";
+ // colone utilsie pour le ratio
+ $this->listing_sql['ratio'] = " ".$this->p.".date_update ";
+ // list normalise date
+ $this->listing_sql['dates'] = " ".$this->p.".date_added as added, ".$this->p.".date_update as modified ";
+
+ return true;
+ }
+
+ /**
@brief test si al page est du type _DATATYPE_REPLACE_
@param $mode le type de control (page/cpath/seo)
@return boolean true / false
*/
function is_type($mode='unique'){
+ static $childs_type;
+
+
switch(strtolower($mode)){
+
+ case 'preload_root':
+ $page = page::getInstance();
+
+ if ( isset($_GET['_DATATYPE_REPLACE_']) && (int)$_GET['_DATATYPE_REPLACE_'] > 0 ) {
+ $default = DATATYPES_DEFAULT_NOSELECTED;
+ $category_depth = $default;
+ $childs_type = $default;
+ DataTypes::ForceChilds($this->DataType, DATATYPES_DEFAULT_NOSELECTED);
+ $page->SetVar('category_depth',$category_depth);
+
+ }
+ break;
+
/*
Active la recherche pour ce type de donnée
*/
@@ -116,11 +194,14 @@
return true;
break;
//REMOVEEND_LINKTOCATEGORIE
- /*
- Page Feed unique
- */
+
+ case 'transversal':
+ case 'listing':
+ if( isset($_GET['_DATATYPE_REPLACE_']) && is_numeric($_GET['_DATATYPE_REPLACE_']) && count($this->RootListing ) > 0)
+ return true;
+ break;
case 'unique':
- if(isset($_GET['_DATATYPE_REPLACE_']) && ( is_int($_GET['_DATATYPE_REPLACE_']) || is_numeric($_GET['_DATATYPE_REPLACE_'])) )
+ if( isset($_GET['_DATATYPE_REPLACE_']) && is_numeric($_GET['_DATATYPE_REPLACE_']) && count($this->RootListing ) == 0)
return true;
break;
}
@@ -225,18 +306,69 @@
}
+ /**
+ @brief chargement des données transversal
+ @param $listing object page driver listing
+ @param $type string name childs type for listing
+ @param subtype object childs DataType
+ @return false KO , true OK
+ */
+ function FO_load_listing(listing $listing, DataTypesChildListing $subtype, $type){
+
+ global $current_category_id, $languages_id;
+ $page = page::getInstance();
+ $category_depth = $page->GetVar('category_depth');
+ $this->ChildsType = $type;
+ if (isset($_GET['_DATATYPE_REPLACE_'])) {
+
+ $breadcrumb=$page->return_object('breadcrumb');
+
+ $_DATATYPE_REPLACE_ = _DATATYPE_REPLACE_::get_item((int)$_GET['_DATATYPE_REPLACE_']);
+
+ if ( ! is_object($_DATATYPE_REPLACE_) )
+ return false;
+
+ $breadcrumb->add( __('@_DATATYPE_REPLACE_ breadcrumb root'), $_DATATYPE_REPLACE_->href );
+ $breadcrumb->add( $_DATATYPE_REPLACE_->title , $_DATATYPE_REPLACE_->href );
+// print_r($_DATATYPE_REPLACE_);
+// exit;
+ // var use in draw master detail listing
+ $obj = new stdClass();
+ $obj->type = $this->DataType ;
+ $obj->image = $_DATATYPE_REPLACE_->image ;
+ $obj->name = $_DATATYPE_REPLACE_->title ;
+ $obj->href = $_DATATYPE_REPLACE_->title ;
+ $obj->description = false;
+
+ $page->add_var_page('RootListing',$obj);
+ $page->add_var_page('current_id',(int)$_GET['_DATATYPE_REPLACE_']);
+ $page->add_var_page('current_type',(string)'_DATATYPE_REPLACE_');
+
+
+
+ $listing->QueryAddWhere( " AND ".$this->listing_sql['col_count']." = '".$_GET['_DATATYPE_REPLACE_']."' ");
+ }
+
+ return true;
+ }
+
+
/**
- @brief calcul du cpath specifique a ce tyep de donnée
+ @fn FO_load_page($mode='unique')
+ @brief calcul du cpath specifique a ce type de donnée
+ @return
+ $mode
+ - default : none
+ - transversal : string page_content
+
*/
function FO_load_page(){
- global $aca_product,$product_info, $page__DATATYPE_REPLACE_, $language, $cPath, $languages_id;;
+ global $aca_product, $page__DATATYPE_REPLACE_, $language, $cPath, $languages_id;;
$page = page::getInstance();
$DB=Database::getInstance();
-
-
switch(strtolower(DataTypes::$CurrentMode)){
case 'search':
global $keywords, $search_keywords, $pto, $dto, $pfrom, $dfrom;
@@ -265,39 +397,18 @@
$this->listing_sql['tables'] = " FROM " . TABLE__DATATYPE_REPLACE_MAJ_ . " ".$this->p." ";
$this->listing_sql['tables'] .=" LEFT JOIN " . TABLE__DATATYPE_REPLACE_MAJ__DESCRIPTION . " ".$this->p."d using(_DATATYPE_REPLACE__id) ";
- //REMOVEDEB_LINKTOCATEGORIE
- $this->listing_sql['tables'] .=" LEFT JOIN " . TABLE__DATATYPE_REPLACE_MAJ__TO_CATEGORIES . " ".$this->p."2c using(_DATATYPE_REPLACE__id) ";
- $this->listing_sql['tables'] .= " LEFT JOIN " . TABLE_CATEGORIES . " cat ON( ".$this->p."2c.categories_id = cat.categories_id and cat.categories_status='1' ) ";
- //REMOVEEND_LINKTOCATEGORIE
/// Add search in Extra value
- $this->listing_sql['tables'] .= " LEFT JOIN " . TABLE_EXTRA_FIELDS_TO . " p2pef ON(p2pef.data_id = p.products_id AND p2pef.data_type = '_DATATYPE_REPLACE_') ";
+ $this->listing_sql['tables'] .= " LEFT JOIN " . TABLE_EXTRA_FIELDS_TO . " ".$this->p."2pef ON( ".$this->p."2pef.data_id = ".$this->p."._DATATYPE_REPLACE__id AND ".$this->p."2pef.data_type = '_DATATYPE_REPLACE_') ";
if(in_array(true, (array)$use_value_list))
- $this->listing_sql['tables'] .= " LEFT JOIN " . TABLE_EXTRA_FIELDS_VALUES . " pefv ON(pefv.fields_id = p2pef.fields_id AND ( pefv.languages_id = '" . (int)$languages_id . "' OR pefv.languages_id = '0' ) ) ";
+ $this->listing_sql['tables'] .= " LEFT JOIN " . TABLE_EXTRA_FIELDS_VALUES . " ".$this->p."efv ON( ".$this->p."efv.fields_id = ".$this->p."2pef.fields_id AND ( ".$this->p."efv.languages_id = '" . (int)$languages_id . "' OR ".$this->p."efv.languages_id = '0' ) ) ";
$this->listing_sql['where'] = " WHERE ".$this->p."._DATATYPE_REPLACE__status > 0 AND ".$this->p."d.language_id = '" . (int)$languages_id . "' ";
- if (isset($_GET['categories_id']) && tep_not_null($_GET['categories_id'])) {
- if (isset($_GET['inc_subcat']) && ($_GET['inc_subcat'] == '1')) {
- $subcategories_array = array();
- tep_get_subcategories($subcategories_array, $_GET['categories_id']);
- $this->listing_sql['where'] .= " and ".$this->p."2c._DATATYPE_REPLACE__id = ".$this->p."._DATATYPE_REPLACE__id and ".$this->p."2c._DATATYPE_REPLACE__id = ".$this->p."d._DATATYPE_REPLACE__id and (".$this->p."2c.categories_id = '" . (int)$_GET['categories_id'] . "'";
-
- for ($i=0, $n=sizeof($subcategories_array); $i<$n; $i++ ) {
- $this->listing_sql['where'] .= " or ".$this->p."2c.categories_id = '" . (int)$subcategories_array[$i] . "'";
- }
-
- $this->listing_sql['where'] .= ")";
- } else {
- $this->listing_sql['where'] .= " and ".$this->p."2c._DATATYPE_REPLACE__id = ".$this->p."._DATATYPE_REPLACE__id and ".$this->p."2c._DATATYPE_REPLACE__id = ".$this->p."d._DATATYPE_REPLACE__id and ".$this->p."d.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$_GET['categories_id'] . "'";
- }
- }
-
-
if (isset($search_keywords) && (sizeof($search_keywords) > 0)) {
$this->listing_sql['where'] .= " and (";
for ($i=0, $n=sizeof($search_keywords); $i<$n; $i++ ) {
@@ -331,9 +442,9 @@
$tmp = '';
foreach($allextraactived as $row) {
if($row['epf_uses_value_list'] == 0)
- $tmp .= " OR ( p2pef.fields_id = '".$row['id']."' AND p2pef.value like '%" . tep_db_input($keyword) . "%' ) ";
+ $tmp .= " OR ( ".$this->p."2pef.fields_id = '".$row['id']."' AND ".$this->p."2pef.value like '%" . tep_db_input($keyword) . "%' ) ";
else
- $tmp .= " OR ( pefv.value_id= p2pef.value AND pefv.fields_id = '".$row['id']."' AND pefv.fields_value like '%" . tep_db_input($keyword) . "%' ) ";
+ $tmp .= " OR ( ".$this->p."efv.value_id= p2pef.value AND ".$this->p."efv.fields_id = '".$row['id']."' AND ".$this->p."efv.fields_value like '%" . tep_db_input($keyword) . "%' ) ";
}
$this->listing_sql['where'] .= " OR ( " . substr($tmp, 3) . " ) ";
}
@@ -342,6 +453,18 @@
return $this;
break;
+ case 'transversal':
+ case 'listing':
+ /**
+ @remarks put filename in template content/ specifi c
+ or no retrun for normal page listing
+ */
+ return '_DATATYPE_REPLACE__listing.php';
+ break;
+ case 'unique':
+// var_dump(__line__);
+ break;
+
default:
$page->init('_DATATYPE_REPLACE_.php',$language);
$breadcrumb=$page->return_object('breadcrumb');
@@ -360,24 +483,28 @@
}
}
- $_DATATYPE_REPLACE_=_DATATYPE_REPLACE_::get_item( (int)$_GET['_DATATYPE_REPLACE_'] );
+ $obj = _DATATYPE_REPLACE_::get_item((int)$_GET['_DATATYPE_REPLACE_']);
+
+ if ( $obj == false )
+ tep_redirect(tep_href_link('','ServerError=404') );
/**
Incremente nbr de vus du produits
*/
$DB->query("update " . TABLE__DATATYPE_REPLACE_MAJ__DESCRIPTION . " set _DATATYPE_REPLACE__viewed = _DATATYPE_REPLACE__viewed+1 where _DATATYPE_REPLACE__id = '" . (int)$_GET['_DATATYPE_REPLACE_'] . "' AND language_id = '" . (int)$languages_id . "'");
- $page->add_var_page('_DATATYPE_REPLACE_',$_DATATYPE_REPLACE_);
+ $page->add_var_page('_DATATYPE_REPLACE_',$obj);
- $page->title=$_DATATYPE_REPLACE_->title;
- $breadcrumb->add($_DATATYPE_REPLACE_->title, $_DATATYPE_REPLACE_->href );
+ $page->title=$obj->title;
+ $breadcrumb->add($obj->title, $obj->href );
$page_content = $page->force_content('_DATATYPE_REPLACE_.php');
$page->add_var_page('current_id',(int)$_GET['_DATATYPE_REPLACE_']);
+ $page->add_var_page('current_type',(string)'_DATATYPE_REPLACE_');
}
- return $page_content;
+// return $page_content;
}
Added: trunk/dev/generator/datatype/Modele/catalog/includes/languages/fr_FR/_DATATYPE_REPLACE_.txt
===================================================================
--- trunk/dev/generator/datatype/Modele/catalog/includes/languages/fr_FR/_DATATYPE_REPLACE_.txt (rev 0)
+++ trunk/dev/generator/datatype/Modele/catalog/includes/languages/fr_FR/_DATATYPE_REPLACE_.txt 2014-01-22 04:34:08 UTC (rev 5063)
@@ -0,0 +1,21 @@
+<?php
+/**
+ @licence GPL 2005-2010 The osCSS developers - osCSS Open Source E-commerce
+ @package osCSS-2 <www http://www.oscss.org>
+ @version 2.1.1
+ @date 20/10/11, 16:45
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+*/
+
+/* boxes */
+ $lang['@_DATATYPE_REPLACE_ heading linkto %s'] = "Goute de gout" ;
+
+/* breadcrumb */
+ $lang['@_DATATYPE_REPLACE_ breadcrumb root'] = "Goute de gout" ;
+
+/* modules */
+ $lang['@_DATATYPE_REPLACE_ heading generic module'] = "Goute de gout" ;
+
+
+?>
\ No newline at end of file
Added: trunk/dev/generator/datatype/Modele/catalog/includes/modules/listing__DATATYPE_REPLACE_.php
===================================================================
--- trunk/dev/generator/datatype/Modele/catalog/includes/modules/listing__DATATYPE_REPLACE_.php (rev 0)
+++ trunk/dev/generator/datatype/Modele/catalog/includes/modules/listing__DATATYPE_REPLACE_.php 2014-01-22 04:34:08 UTC (rev 5063)
@@ -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.1.1
+ @date 05/03/2012, 17:29
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+ @brief this generic module for call _DATATYPE_REPLACE_ datatype
+*/
+
+
+function sql_listing__DATATYPE_REPLACE_(){
+
+ //! @remarks depend Data_product active
+ if( ! DataTypes::is_active('_DATATYPE_REPLACE_'))
+ return false;
+
+ $page=page::getInstance();
+ $DB=Database::getInstance();
+
+ $languages_id=$page->the_var('languages_id');
+ $type = '_DATATYPE_REPLACE_';
+
+ if( DataTypes::is_active('categorie') ){
+ $cPath=$page->GetVar('cPath');
+ $c = ((strlen($cPath) > 0) ? explode('_', $cPath) : array() );
+ }
+
+ $current_type=$page->GetVar('current_type');
+ $current_id=$page->GetVar('current_id');
+
+ $listing = DataTypes::GetListing('leftto', $type);
+
+ $query = 'SELECT DISTINCT '.
+ $listing['col_count'] . ' as id'.
+ ' ,ggxx._DATATYPE_REPLACE__id '.
+ " ,'_DATATYPE_REPLACE_' as datatype ".
+ ' '. sprintf($listing['tables'], $listing['col_count'] , $type, $languages_id ).
+ ' '. $listing['where'].
+ '';
+
+ if( DataTypes::is_active('categorie') && count($c) > 0)
+ $query .= " AND cat.categories_id in (".implode(',',$c).") ";
+
+ if($current_type == $type)
+ $query .= " AND ggxx._DATATYPE_REPLACE__id <>'".$current_id."' ";
+
+ $query .= " GROUP BY ggxx._DATATYPE_REPLACE__id ";
+ $query .= " ORDER BY ggxx._DATATYPE_REPLACE__id desc " ;
+
+// if(!class_exists('splitPageResults')) require_once(DIR_WS_CLASSES . 'split_page_results.php');
+ $listing_split = new splitPageResults($query, $page->_conf_value('MAX_DISPLAY_PRODUCTS_NEW'), 'ggxx._DATATYPE_REPLACE__id');
+
+ $new__DATATYPE_REPLACE__query = $DB->query( $listing_split->sql_query);// $query);
+
+ if ($new__DATATYPE_REPLACE__query->__get('NumRows') > 0)
+ return $new__DATATYPE_REPLACE__query;
+
+ return false;
+}
+
+
+function in_obj_listing__DATATYPE_REPLACE_($type){
+ global $page;
+ $DB=Database::getInstance();
+
+ $resobj=$page->oscss_modules->_resultsql('listing__DATATYPE_REPLACE_');
+
+ if(get_class($resobj) == 'splitPageResults')
+ $resobj = $DB->query( $resobj->sql_query ) ;
+
+// var_dump($resobj);
+ // type data for process , extract in DataTypes class
+// $subtype = DataTypes::GetTypePage('sub');
+
+
+ if( $resobj ==false )
+ return null;
+
+ // required by products
+ $languages_id=$page->the_var('languages_id');
+ $currencies=$page->return_object('currencies');
+
+ $p=array();
+ $result_subtype = '';
+
+ // loop for extract
+// while ($listing = tep_db_fetch_array($listing_query)){
+ foreach($resobj->fetchAllAssoc() as $listing){
+// var_dump($listing);
+// print_r($listing);
+
+ $subtype = $listing['datatype'];
+
+ if(empty($result_subtype))
+ $result_subtype = $subtype;
+ elseif ($result_subtype != $subtype)
+ $result_subtype = '';
+
+
+ if(!isset($listing['id']) )
+ continue;
+
+ // result
+ $pd=$subtype::get_item($listing['id']);
+ if(!$pd )
+ continue;
+ // call loop for Aca modules
+// $pd->aca=$aca_listing->return_db_min($listing['datatype_id']);
+ // add type data in current item
+ $pd->type = $subtype;
+ $p[]=$pd;
+ }
+
+// print_r($p);
+// exit;
+ return new objectInfo(array(
+ 'title'=>__('@_DATATYPE_REPLACE_ heading generic module'),
+ 'content'=>$p, // all array result
+ 'split'=> $listing_split , // object for link split page
+ 'type'=>$subtype // type result
+ ));
+
+}
+
+?>
\ No newline at end of file
Added: trunk/dev/generator/datatype/Modele/catalog/includes/modules/listing__DATATYPE_REPLACE__childs.php
===================================================================
--- trunk/dev/generator/datatype/Modele/catalog/includes/modules/listing__DATATYPE_REPLACE__childs.php (rev 0)
+++ trunk/dev/generator/datatype/Modele/catalog/includes/modules/listing__DATATYPE_REPLACE__childs.php 2014-01-22 04:34:08 UTC (rev 5063)
@@ -0,0 +1,100 @@
+<?php
+/**
+ @licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
+ @portion code Copyright (c) 2002 osCommerce
+ @package osCSS-2 <www http://www.oscss.org>
+ @version 2.1.1
+ @date 05/03/2012, 17:29
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+ @brief this generic module for call _DATATYPE_REPLACE_ datatype
+*/
+
+
+function sql_listing__DATATYPE_REPLACE__childs(){
+ global $product_info;
+
+
+ //! @remarks depend Data_product active
+ if( ! DataTypes::is_active('_DATATYPE_REPLACE_') )
+ return false;
+
+ $page=page::getInstance();
+ $DB=Database::getInstance();
+ $languages_id=$page->the_var('languages_id');
+
+
+
+ // no limit in sql , restric based on php control
+ $sql="SELECT * ".
+ " FROM " . TABLE__DATATYPE_REPLACE_MAJ_ . " f ".
+ " LEFT JOIN " . TABLE__DATATYPE_REPLACE_MAJ__DATA. " fd ON(fd._DATATYPE_REPLACE__id = f._DATATYPE_REPLACE__id) ".
+ " WHERE 1 ".
+ " ORDER BY f._DATATYPE_REPLACE__id DESC "; //. $page->_conf_value('MAX_DISPLAY_MANUFACTURER_PRODUCTS');
+
+ echo $sql;
+
+ $_query = $DB->query( $sql );
+ if ($_query->__get('NumRows') > 0) return $_query;
+ else return false;
+}
+
+
+function in_obj_listing__DATATYPE_REPLACE__childs($type){
+ global $page;
+
+ $resobj=$page->oscss_modules->_resultsql('listing__DATATYPE_REPLACE_');
+
+ // type data for process , extract in DataTypes class
+// $subtype = DataTypes::GetTypePage('sub');
+
+
+ if( $resobj ==false )
+ return null;
+
+ // required by products
+ $languages_id=$page->the_var('languages_id');
+ $currencies=$page->return_object('currencies');
+
+ $p=array();
+ $result_subtype = '';
+
+ // loop for extract
+// while ($listing = tep_db_fetch_array($listing_query)){
+ foreach($resobj->fetchAllAssoc() as $listing){
+
+
+ $subtype = $listing['datatype'];
+
+ if(empty($result_subtype))
+ $result_subtype = $subtype;
+ elseif ($result_subtype != $subtype)
+ $result_subtype = '';
+
+
+ if(!isset($listing['datatype_id']) )
+ continue;
+
+ // result
+ $pd=$subtype::get_item($listing['datatype_id']);
+ if(!$pd )
+ continue;
+ // call loop for Aca modules
+// $pd->aca=$aca_listing->return_db_min($listing['datatype_id']);
+ // add type data in current item
+ $pd->type = $subtype;
+ $p[]=$pd;
+ }
+
+// print_r($p);
+// exit;
+ return new objectInfo(array(
+ 'title'=>'',
+ 'content'=>$p, // all array result
+ 'split'=> $listing_split , // object for link split page
+ 'type'=>$subtype // type result
+ ));
+
+}
+
+?>
\ No newline at end of file
Added: trunk/dev/generator/datatype/Modele/catalog/templates/defaut/includes/boxes/_DATATYPE_REPLACE_.php
===================================================================
--- trunk/dev/generator/datatype/Modele/catalog/templates/defaut/includes/boxes/_DATATYPE_REPLACE_.php (rev 0)
+++ trunk/dev/generator/datatype/Modele/catalog/templates/defaut/includes/boxes/_DATATYPE_REPLACE_.php 2014-01-22 04:34:08 UTC (rev 5063)
@@ -0,0 +1,66 @@
+<?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 28/11/12, 08:18
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+ @group boxes
+ *\file whats_new.php
+ *\dir includes/boxes/
+ *\brief boite nouveauté
+ *
+ * Affichage de la boite des nouveautés, qui assure l'affichage d'une seul produit.
+*/
+
+
+
+global $list, $type,$price, $page;
+ $list = array();
+ $type = '_DATATYPE_REPLACE_';
+ $max = 2;
+ $page = page::getInstance();
+ $current_id = $page->GetVar('current_id');
+ $obj_product = product::get_item((int)$current_id);
+
+/**
+ @remarks depend Data_product active
+*/
+ if( ! DataTypes::is_active($type))
+ return false;
+
+ _DATATYPE_REPLACE_::getInstance();
+
+ include_once(DIR_FS_CATALOG . DIR_WS_CLASSES . 'drivers/data/_DATATYPE_REPLACE_.php');
+
+ $li = array();
+ $list = array();
+/**
+ @remarks Process Specific Boxes
+*/
+
+ $obj = _DATATYPE_REPLACE_::get_item((int)$obj_product->_DATATYPE_REPLACE__id );
+
+ if( $obj != false){
+ $tmp = new stdClass;
+ $tmp->name = $obj->name;
+ $tmp->title = $obj->title;
+ $tmp->href = $obj->href;
+ $tmp->image = $obj->image;
+
+ $list[] = $tmp;
+ }
+
+// var_dump($list);
+/**
+// @remarks Transmit var array for master construtor boxes
+// */
+ $array=array(
+ 'title'=>sprintf(__('@_DATATYPE_REPLACE_ heading linkto %s'),$type ),
+ 'content'=>tep_output_string_protected(tep_get_include_contents('box.generic'),false,true),
+ 'class'=> $type,
+ );
+
+?>
\ No newline at end of file
Added: trunk/dev/generator/datatype/Modele/catalog/templates/defaut/includes/content/_DATATYPE_REPLACE__listing.php
===================================================================
--- trunk/dev/generator/datatype/Modele/catalog/templates/defaut/includes/content/_DATATYPE_REPLACE__listing.php (rev 0)
+++ trunk/dev/generator/datatype/Modele/catalog/templates/defaut/includes/content/_DATATYPE_REPLACE__listing.php 2014-01-22 04:34:08 UTC (rev 5063)
@@ -0,0 +1,50 @@
+<?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
+*/
+ global $SectionTplPC, $RootListing;
+
+
+/**
+ @remarks local load var
+*/
+ $cPath=$page->the_var('cPath');
+ $category_depth=$page->the_var('category_depth');
+ $_DATATYPE_REPLACE_=$page->GetVar('_DATATYPE_REPLACE_');
+
+
+/**
+ @remarks Generic RootListing is detail current master , header listing
+*/
+ $RootListing=$page->GetVar('RootListing');
+// var_dump($RootListing);
+/**
+ @remarks Pre-load module no-type
+*/
+
+ // context nested = childs cats
+// if ($category_depth == 'nested')
+// $page->oscss_modules->_add('listing_cat.php','center');
+
+
+ // listing datatype query exists
+ if (isset($listing_split) && (isset($listing_query) && tep_db_num_rows($listing_query)>0) )
+// $page->oscss_modules->_add('listing.php','center', array('listing_split'=>$listing_split,'listing_query'=>@$listing_query) );
+// // load other module if not result current listing
+// else
+// $page->oscss_modules->_add(FILENAME_NEW_PRODUCTS,'center');
+ $page->oscss_modules->_add('listing.php','center', array('listing_split'=>$listing_split,'listing_query'=>@$listing_query) );
+
+// $page->oscss_modules->_add('listing__DATATYPE_REPLACE_.php','center');
+
+ $SectionTplPC = new SectionTpl(
+ tep_output_string_protected(tep_get_include_contents('pages/listing'),false,true) ,
+ ( ($RootListing->name!=false)? $RootListing->name : '' )
+ );
+ ?>
\ No newline at end of file
Modified: trunk/dev/generator/datatype/Modele/install.xml
===================================================================
--- trunk/dev/generator/datatype/Modele/install.xml 2014-01-22 03:47:06 UTC (rev 5062)
+++ trunk/dev/generator/datatype/Modele/install.xml 2014-01-22 04:34:08 UTC (rev 5063)
@@ -22,8 +22,8 @@
<file name="admin/includes/gabarit/_DATATYPE_REPLACE_s/display_view.inline.gab" />
<file name="admin/includes/gabarit/_DATATYPE_REPLACE_s/display_view.new.gab" />
- <file name="admin/includes/gabarit/_DATATYPE_REPLACE_s/_DATATYPE_REPLACE_SEOTAG__description/display_edit.edit.gab" />
- <file name="admin/includes/gabarit/_DATATYPE_REPLACE_s/_DATATYPE_REPLACE_SEOTAG__criteres/display_edit.edit.gab" />
+<!-- <file name="admin/includes/gabarit/_DATATYPE_REPLACE_s/_DATATYPE_REPLACE_SEOTAG__description/display_edit.edit.gab" /> -->
+<!-- <file name="admin/includes/gabarit/_DATATYPE_REPLACE_s/_DATATYPE_REPLACE_SEOTAG__criteres/display_edit.edit.gab" /> -->
<file name="admin/includes/widget/_DATATYPE_REPLACE_Last.php" />
@@ -41,12 +41,15 @@
<!-- <file name="includes/modules/account/ac__DATATYPE_REPLACE_.php" /> -->
<!-- template -->
- <file name="templates/defaut/includes/content/_DATATYPE_REPLACE_.php" />
+<!-- <file name="templates/defaut/includes/content/_DATATYPE_REPLACE_.php" /> -->
+ <file name="templates/defaut/includes/content/_DATATYPE_REPLACE__listing.php" />
+
<file name="templates/defaut/includes/gabarit/_DATATYPE_REPLACE_/account.box_view.gab" />
<file name="templates/defaut/includes/gabarit/_DATATYPE_REPLACE_/account.display_view.edit.gab" />
<file name="templates/defaut/includes/gabarit/_DATATYPE_REPLACE_/account.display_view.edit.step.0.gab" />
<file name="templates/defaut/includes/gabarit/_DATATYPE_R...
[truncated message content] |
|
From: <os...@us...> - 2014-01-22 03:47:10
|
Revision: 5062
http://sourceforge.net/p/oscss/svn/5062
Author: oscim
Date: 2014-01-22 03:47:06 +0000 (Wed, 22 Jan 2014)
Log Message:
-----------
Fix
Modified Paths:
--------------
trunk/catalog/admin/includes/classes/SqlFilesDataDriverClass.php
trunk/catalog/admin/includes/classes/drivers/sqlcategorie.php
trunk/catalog/admin/includes/classes/drivers/sqlproduct.php
trunk/catalog/admin/includes/classes/fileUtility.php
Removed Paths:
-------------
trunk/dev/generator/datatype/Modele/sql/mysql/install/tables/osc__DATATYPE_REPLACE__extra_fields.sql
trunk/dev/generator/datatype/Modele/sql/mysql/install/tables/osc__DATATYPE_REPLACE__extra_fields_labels.key.sql
trunk/dev/generator/datatype/Modele/sql/mysql/install/tables/osc__DATATYPE_REPLACE__extra_fields_labels.sql
trunk/dev/generator/datatype/Modele/sql/mysql/install/tables/osc__DATATYPE_REPLACE__extra_fields_values.key.sql
trunk/dev/generator/datatype/Modele/sql/mysql/install/tables/osc__DATATYPE_REPLACE__extra_fields_values.sql
Modified: trunk/catalog/admin/includes/classes/SqlFilesDataDriverClass.php
===================================================================
--- trunk/catalog/admin/includes/classes/SqlFilesDataDriverClass.php 2014-01-22 03:20:11 UTC (rev 5061)
+++ trunk/catalog/admin/includes/classes/SqlFilesDataDriverClass.php 2014-01-22 03:47:06 UTC (rev 5062)
@@ -115,14 +115,12 @@
if(!is_array($specimen))
return $sqlarray;
-
foreach($specimen as $key=>$item){
if($key != self::$DataDriverType.'_id')
if(is_int($item) || is_bool($modele[$key]))
$sqlarray[$key] = (isset($data[$key]) ? tep_db_prepare_input((int)$data[$key]) : $item);
elseif(is_string($item)){
-
// implements support for multi image in this data
// and possible delete by checkbox
if($key == self::$DataDriverType.'_image'){
Modified: trunk/catalog/admin/includes/classes/drivers/sqlcategorie.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlcategorie.php 2014-01-22 03:20:11 UTC (rev 5061)
+++ trunk/catalog/admin/includes/classes/drivers/sqlcategorie.php 2014-01-22 03:47:06 UTC (rev 5062)
@@ -78,8 +78,8 @@
$sql_data_array = self::GetSqlArray();
-
+
if(count($sql_data_array) > 0){
$modules->get_insert_table_categories($sql_data_array,'');
@@ -541,10 +541,9 @@
'categories_datatype'=>'product',
'parent_id'=>0,
'sort_order'=>0,
- 'categories_id'=>null,
- 'categories_image'=>null,
- 'categories_status'=>null,
- 'categories_hidden'=>null,
+ 'categories_image'=>'',
+ 'categories_status'=>0,
+ 'categories_hidden'=>0,
);
for ($i=0, $n=sizeof($list_languages); $i<$n; $i++) {
$result['post']['categories_name'][$list_languages[$i]['id']]=$result['categories_name'][$list_languages[$i]['id']] = '';
Modified: trunk/catalog/admin/includes/classes/drivers/sqlproduct.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlproduct.php 2014-01-22 03:20:11 UTC (rev 5061)
+++ trunk/catalog/admin/includes/classes/drivers/sqlproduct.php 2014-01-22 03:47:06 UTC (rev 5062)
@@ -1,177 +1,685 @@
-<?php
+<?php if (!defined('HTTP_SERVER')) die('You can not access this file directly!');
/**
- * \file test/phpunit/Back/productTest.php
- * \brief test unitaire class product 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 30/09/2013, 23:13
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+ @file sqlproduct.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 productTest
- */
-class sqlproductsTest
- extends PHPUnit_Framework_TestCase
-{
- /**
- @var array
- */
- public $specimen;
+ @class sqlproduct
+*/
+class sqlproduct
+ extends SqlFilesDataDriverClass
+ implements ModSqlDataDriver{
+ /**
+ @var boolean use submodule in this class
+ */
+ public $use_modules = true;
/**
- @var int
+ @fn init()
+ @brief for init subchilds and other option
*/
- static public $Id;
+ public function init(){
+ self::$DataDriverType = 'product';
+
+ if($this->use_modules) {
+ self::$modules=new productsACA;
+ self::$modules->set_image_handler();
+ }
- function __construct()
- {
}
- /**
- * \brief test creat account user
- * @return array(
- id null
- sqlarray = result specimen (array)
- post = result specimen (array)
- )
- */
- public function testproductsSpecimen(){
- $specimen = array();
+ /**
+ @brief create new ligne in table configuration
+ @param $option array
+ language_id = > int $languages_id
+ type => int product type
+ */
+ public static function create($option){
+ global $languages_id;
+ new self();
+ $DB=Database::getInstance();
+ $error=0;
+ $modules = self::$modules;
+// if(!isset($option['key'])) return 'key';
- $tmp = sqlproduct::Specimen(true);
+ $DB->beginTransaction();
- $this->assertTrue ( ( is_object($tmp) ) , 'Error sqlproducts Specimen return object' ) ;
- foreach($tmp as $key=>$val)
- $specimen[$key] = $val;
+ $languages_id = (isset($option['language_id']) ? $option['language_id'] : $languages_id);
+ $type = (isset($option['type']))? $option['type'] : 1;
+ $sql_data_array = array(
+ 'products_type' => $type,
+ 'products_quantity' => 0,
+ 'products_price' => 0,
+ 'products_date_added' => 'now()',
+ 'manufacturers_id' => '',
+ 'track_stock' => ( ($type == 1) ? 1 : 0 )
+ );
- $this->assertTrue ( ( is_array($specimen) ) , 'Error sqlproducts Specimen convert' ) ;
+ $sql_data_array = array_merge($sql_data_array, self::$modules->get_insert_table_products());
+ $resobj=tep_db_perform(TABLE_PRODUCTS, $sql_data_array);
- $tmp = array();
- $tmp['sqlarray'] = $specimen;
- $tmp['post'] = $specimen;
- $tmp = array_merge($tmp, $specimen);
- return $tmp;
+ if(!$resobj){
+ $DB->rollbackTransaction();
+ return false;
+ }
+
+ $products_id = $resobj->__get('insertId');
+
+
+ $res = $DB->query("insert into " . TABLE_PRODUCTS_TO_CATEGORIES . " (products_id, categories_id) values ('" . (int)$products_id . "', '".ORPHELIN_COLLECTOR."')");
+ if(!$res)
+ $error++;
+
+ $list_languages=tep_get_languages();
+ for ($i=0, $n=sizeof($list_languages); $i<$n; $i++) {
+ $language_id = $list_languages[$i]['id'];
+
+ $sql_data_array = array('products_name' => '','products_id' => $products_id, 'language_id' => $language_id);
+
+ $res=tep_db_perform(TABLE_PRODUCTS_DESCRIPTION, $sql_data_array);
+ if(!$res)
+ $error++;
+ }
+
+ if( $error > 0){
+ $DB->rollbackTransaction();
+ return false;
+ }
+ else{
+ $DB->commitTransaction();
+ return $products_id;
+ }
}
- /**
- * \brief test creat account user
- * @depends testproductsSpecimen
- * @param $specimen array
- * @return array(
- id null
- sqlarray = result specimen (array)
- post = result specimen (array)
- )
+ /**
+ @brief update ligne in table configuration
+ */
+ public static function update($option){
+
+ new self();
+ $DB=Database::getInstance();
+ $error=0;
+ $modules = self::$modules;
+
+ if(!isset($option['id']))
+ return false;
+
+ $list_languages=tep_get_languages();
+ $where ='';
+ $products_id = (int)$option['id'];
+
+
+ $post =array();
+ if(isset($option['post'])){
+ $post=(array)$option['post'];
+ $post['products_id'] = $products_id;
+ }
+
+ $sql_data_array = (array)(isset($option['sqlarray'])? $option['sqlarray'] : array() );
+
+
+ if(( $origin = self::fetch($option, true) ) && !$origin )
+ $action = 'insert_product';
+ else
+ $action = 'update_product';
+
+ // recalculate price net
+ if(isset($sql_data_array['products_price_gross'])) {
+ $sql_data_array['products_price'] = ( $sql_data_array['products_price_gross'] / ((tep_get_tax_rate_value($origin->tax_class_id) / 100 ) + 1) );
+ unset( $sql_data_array['products_price_gross'] );
+ }
+
+ /// Call ACA module put post var
+ $modules->load_post_values($post);
+
+ $DB->beginTransaction();
+
+/**
+ TODO Check des clef des array pour verifier que celle ci existe dans specimen
+*/
+
+ $sql_data_array['products_last_modified'] ='now()';
+ $sql_data_array = array_merge($sql_data_array, $modules->get_update_table_products());
+
+ if( ! tep_db_perform(TABLE_PRODUCTS, $sql_data_array, 'update',"products_id = '" . (int)$products_id . "'") )
+ $error++;
+
+ /*
+ Use transversal Datatype Rootlisting and update in data
+ Not in context update one col
*/
- public function testproductsCreate($specimen){
+ if(count($sql_data_array) > 2) {
+ if(isset($post['linkto'])){
+ $r = MLinkTo::SqlLeftTo('product', $products_id, $post['linkto']) ;
+ if($r == false)
+ $error++;
+ }
+ }
- $res = sqlproduct::create( $specimen );
- $id=$res;
+ if($error ==0 ) {
+ /// Separate Pricing Per Customer
+ $customers_group_query = $DB->query("select customers_group_id, customers_group_name from " . TABLE_CUSTOMERS_GROUPS . " where customers_group_id != '0' order by customers_group_id");
+ // Gets all of the customers groups
+ while ($customers_group = tep_db_fetch_array($customers_group_query)){
- $this -> assertTrue ( ($res >=0) , 'Error product not create' ) ;
+ $attributes_query = $DB->query("select customers_group_price from " . TABLE_PRODUCTS_GROUPS . " where products_id = '" . $products_id . "' and customers_group_id = '" . $customers_group['customers_group_id'] . "'");
+ $attributes = tep_db_fetch_array($attributes_query);
- $specimen['id'] = $id;
- return $specimen;
+ if (tep_db_num_rows($attributes_query) > 0) {
+ if (isset($post['sppcoption'][$customers_group['customers_group_id']]) && isset($post['sppcprice'][$customers_group['customers_group_id']]) && $post['sppcprice'][$customers_group['customers_group_id']]!= '') {
+ // this is checking if the check box is checked and the price is not null
+ if ( $_POST['sppcprice'][$customers_group['customers_group_id']] != $attributes['customers_group_price'])
+ $DB->query("update " . TABLE_PRODUCTS_GROUPS . " set customers_group_price = '" . $post['sppcprice'][$customers_group['customers_group_id']] . "' where customers_group_id = '" . $customers_group['customers_group_id'] . "' and products_id = '" . $products_id . "'");
+ }
+ else
+ $DB->query("delete from " . TABLE_PRODUCTS_GROUPS . " where customers_group_id = '" . $customers_group['customers_group_id'] . "' and products_id = '" . $products_id . "'");
+ }
+ elseif (isset($_POST['sppcoption'][$customers_group['customers_group_id']]) && isset($post['sppcprice'][$customers_group['customers_group_id']]) && $post['sppcprice'][$customers_group['customers_group_id']] != '')
+ $DB->query("insert into " . TABLE_PRODUCTS_GROUPS . " (products_id, customers_group_id, customers_group_price) values ('" . $products_id . "', '" . $customers_group['customers_group_id'] . "', '" . $post['sppcprice'][$customers_group['customers_group_id']] . "')");
+ }
+ }
+
+
+ /// mutli-languages process
+ for ($i=0, $n=sizeof($list_languages); $i<$n; $i++) {
+
+ $language_id = $list_languages[$i]['id'];
+
+ $sql_data_array = array();
+
+ if ($action == 'insert_product') {
+ $insert_sql_data = array('products_id' => $products_id, 'language_id' => $language_id);
+
+ $sql_data_array = array_merge($sql_data_array, $insert_sql_data);
+ // ACA START INSERT IN PRODUCT_DESCRIPTION TABLE
+ $sql_data_array = array_merge($sql_data_array, self::$modules->get_insert_table_products_description ($language_id));
+
+
+ if( !tep_db_perform(TABLE_PRODUCTS_DESCRIPTION, $sql_data_array) )
+ $error++;
+ }
+
+ elseif ($action == 'update_product') {
+ // ACA START UPDATE PRODUCT_DESCRIPTION TABLE
+ $sql_data_array = array_merge($sql_data_array, (array)self::$modules->get_update_table_products_description ($language_id));
+
+ if(count($sql_data_array) > 0)
+ if( ! tep_db_perform(TABLE_PRODUCTS_DESCRIPTION, $sql_data_array, 'update', " products_id = '" . (int)$products_id . "' and language_id = '" . (int)$language_id . "' ") )
+ $error++;
+ }
+ }
+
+
+ /// Call ACA module after update
+ $modules->after_update($products_id) ;
+
+ if( $error > 0){
+ $DB->rollbackTransaction();
+ return false;
+ }
+ else{
+ $DB->commitTransaction();
+ return 1;
+ }
}
+
+
/**
- * \brief Load specific id passed in array
- * @depends testproductsCreate
- * @param $specimen array
- * @return array(
- id null
- sqlarray = result specimen (array)
- post = result specimen (array)
- )
+ @brief load ligne in table configuration
+ @param option array
+ id => row id int (configuration_id)
+ key => string key (configuration_key)
+ group_id => group_id int (configuration_group_id)
+
+ @return
+
+ object(stdClass)[13]
+ public 'id' => string '1' (length=1)
+ OR
+ array(
+ object(stdClass)[13]
+ ...
+ object(stdClass)[13]
+ ..
+ )
+
+ */
+ public static function fetch($option,$shortkey=false){
+ new self();
+
+ $DB=Database::getInstance();
+ $modules = self::$modules;
+// $price=price::getInstance();
+
+ $cat_list =array();
+ $error = 0;
+
+ $sql ="AND ";
+ if(isset($option['id'])){
+ $ID = (int) $option['id'];
+ $sql .="AND p.products_id = '".(int)tep_db_input($option['id'])."' ";
+ }
+ elseif(isset($option['ref'])){
+ if( ($ID = self::GetByRef($option['ref'])) && $ID === false)
+ return false;
+
+ $sql .="AND p.products_id = '".(int)tep_db_input($ID)."' ";
+ }
+
+// if(isset($option['language_id'])){
+// $languages_id = (int)$option['language_id'];
+// $sql .="AND pd.language_id = '".(int)tep_db_input($option['language_id'])."' ";
+// }
+
+// if(isset($option['key'])) $sql .="AND configuration_key = '".(string)tep_db_input($option['key'])."' ";
+// if(isset($option['group_id'])) $sql .="AND configuration_group_id = '".(int)(string)tep_db_input($option['group_id'])."' ";
+
+ $sql =substr($sql,3);
+
+ $sql_query = "SELECT
+ p.products_id
+ , p.products_type
+ , p.products_ref
+ , p.products_quantity
+ , p.products_quantity_alert
+ , p.products_type
+ , p.products_model
+ , p.products_image
+ , p.products_price
+ , p.products_weight
+ , p.products_weight_brut
+ , p.track_stock
+ , p.products_date_added
+ , p.products_last_modified
+ , products_date_available
+ , p.products_status
+ , p.products_tax_class_id
+ , p.manufacturers_id
+ , p.products_barcode_type
+ , p.products_barcode
+ , p.products_ordered
+ FROM " . TABLE_PRODUCTS . " p ".
+ " WHERE 1 ". $sql;
+
+ $product_query = $DB->query( $sql_query );
+
+ if( ! $product_query->__get('numRows') )
+ return false;
+
+ $product = $product_query->fetchAssoc();
+
+ tep_db_free_result($product_query);
+
+ global $price;
+ $product['products_price_gross'] = (string)tep_add_tax($product['products_price'], tep_get_tax_rate($product['products_tax_class_id']) );
+ $product['products_images'] = explode('|', $product['products_image']);
+
+ $whlg = '';
+ if(isset($option['language_id'])){
+ $languages_id = (int)$option['language_id'];
+ $whlg=" AND language_id='" . $option['language_id'] . "' ";
+ }
+
+// $_query = $DB->query("select language_id , products_name , products_description , products_url from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$product['products_id'] . "' ".$whlg);
+//
+// foreach($_query->fetchAllAssoc() as $row)
+// $product['lg'][$row['language_id']] = ((!$shortkey)? $row : self::CleanKey($row));
+//
+
+
+ /*
+ Use transversal Datatype Rootlisting and update in data
*/
- public function testproductsFetch($specimen){
- $res = sqlproduct::fetch( $specimen , true);
+ $r = MLinkTo::SqlRightTo('product', $ID) ;
+ if($r == false)
+ $error++;
+ else
+ $product = array_merge($product,$r);
- $this -> assertTrue ( (is_object($res ) ) , 'Error product not fetch' ) ;
- foreach($res as $key=>$val){
- $tmp[$key] = $val;
+ $product['products_date_available']=(isset($product['products_date_available'])? $product['products_date_available'] : '');
+
+ // <!-- BOF Separate Pricing Per Customer -->
+ $customers_group_query = $DB->query("select customers_group_id, customers_group_name from " . TABLE_CUSTOMERS_GROUPS . " where customers_group_id != '0' order by customers_group_id");
+ while ($customers_group = tep_db_fetch_array($customers_group_query)) {
+ $attributes_query = $DB->query("select customers_group_price from " . TABLE_PRODUCTS_GROUPS . " where products_id = '" . (int)tep_db_input($ID) . "' and customers_group_id = '" . $customers_group['customers_group_id']. "'");
+ $attributes = tep_db_fetch_array($attributes_query);
+ if (!isset($attributes['customers_group_price'])) $attributes['customers_group_price'] = '';
+
+ $product['products_sppc'][$customers_group['customers_group_id']] = array('sppcname' => $customers_group['customers_group_name'], 'sppcprice' => $attributes['customers_group_price']);
+ }
+ //<!-- EOF Separate Pricing Per Customer -->
+
+
+ $product['mod'] = $modules->fetch(array('products_id'=>$ID, 'shortkey'=>$shortkey));
+
+ // put all val origin module in current result
+ foreach($product['mod'] as $submod=>$array)
+ if(is_array($array))
+ foreach($array as $key=>$val)
+ $product[$key] = $val;
+
+
+ return ((!$shortkey)? $product : self::CleanKey($product) );
+
+ }
+
+ /**
+ @brief delete row
+ */
+ public static function delete($option){
+
+ new self();
+ $DB=Database::getInstance();
+ $modules = self::$modules;
+ $res = false;
+ $product_categories = array();
+
+ if(isset($option['id']))
+ $product_id = (int)tep_db_input($option['id']) ;
+ else
+ return false;
+
+
+ if(isset($option['catarray'])){
+ foreach($option['catarray'] as $k=>$v)
+ $product_categories[$k]=(int)tep_db_input($v) ;
+
+ for ($i=0, $n=sizeof($product_categories); $i<$n; $i++) {
+ $DB->query($s="DELETE FROM " . TABLE_PRODUCTS_TO_CATEGORIES . " WHERE products_id = '" . (int)$product_id . "' AND categories_id = '" . (int)$product_categories[$i] . "' LIMIT 1 ");
+ }
+ }
+ else
+ $DB->query($s="DELETE FROM " . TABLE_PRODUCTS_TO_CATEGORIES . " WHERE products_id = '" . (int)$product_id . "' ");
+
+
+
+ $product_categories_query = $DB->query("SELECT COUNT(*) AS total FROM " . TABLE_PRODUCTS_TO_CATEGORIES . " WHERE products_id = '" . (int)$product_id . "'");
+ $product_categories = tep_db_fetch_array($product_categories_query);
+
+ if ($product_categories['total'] == '0') {
+
+ $modules->delete($product_id);
+
+ $res=tep_remove_product($product_id);
+ }
+ else
+ return false;
+
+ return $res;
+ }
+
+
+ /**
+ @brief
+ @return array product empty
+ */
+ public static function Specimen($shortkey=false){
+ $par = array(
+ 'products_id' => '', // auto incremente
+ 'products_type' => 0, // int (0 : default)
+ 'products_ref' => '', // auto incremente
+
+ 'track_stock'=>0,
+ 'products_quantity' => 0,
+ 'products_quantity_alert' => 0,
+
+ 'products_model' => '',
+ 'products_image' => '',
+ 'images' => array(),
+
+ 'products_price' => '0.000000',
+ 'products_price_gross'=>'',
+ 'products_tax_class_id' => 0,
+
+ 'barcode_type' => '',
+ 'barcode' => '',
+
+ 'products_weight' => '0.00',
+ 'products_weight_brut' => '',
+
+ 'products_date_added' => '',
+ 'products_last_modified' => '',
+ 'products_date_available' => '',
+ 'products_status' => 0,
+
+ 'manufacturers_id' => '',
+ 'products_ordered' => 0,
+
+ 'lg' =>array(
+ array(
+ 'products_name' => '', // depend language table
+ 'products_description' => '', // depend language table
+ 'products_url' => '',
+ 'language_id' => 1,
+ ),
+ ),
+
+ 'mod'=>array(), // other external sub module
+ );
+
+ return ((!$shortkey)? $par : self::CleanKey($par) );
+ }
+
+
+ /**
+ @brief copy in duplicate or link
+ @param $option array
+ type => string duplicate/link
+ @return int pid new product
+ */
+ public static function copyto($option){
+
+
+ if(isset($option['id']))
+ $pid = (int) $option['id'];
+ else
+ return false;
+
+ if(isset($option['catid']))
+ $catid = (int) $option['catid'];
+ else
+ return false;
+
+
+ new self();
+ $DB=Database::getInstance();
+ $modules = self::$modules;
+
+
+ $product_query = $DB->query($sql = "select products_type, products_quantity, products_model, products_image, products_price, products_date_available, products_weight, products_tax_class_id, manufacturers_id from " . TABLE_PRODUCTS . " where products_id = '" . $pid . "'");
+ $product = $product_query->fetchAssoc();
+
+
+ $sql = "INSERT INTO " . TABLE_PRODUCTS . " (
+ products_type,
+ products_quantity,
+ products_model,
+ products_image,
+ products_price,
+ products_date_added,
+ products_date_available,
+ products_weight,
+ products_status,
+ products_tax_class_id,
+ manufacturers_id
+ ) VALUES (
+ '" . tep_db_input($product['products_type']) . "',
+ '" . tep_db_input($product['products_quantity']) . "',
+ '" . tep_db_input($product['products_model']) . "',
+ '" . tep_db_input($product['products_image']) . "',
+ '" . tep_db_input($product['products_price']) . "',
+ now(),
+ " . (empty($product['products_date_available']) ? "null" : "'" . tep_db_input($product['products_date_available']) . "'") . ",
+ '" . tep_db_input($product['products_weight']) . "', '0',
+ '" . (int)$product['products_tax_class_id'] . "',
+ '" . (int)$product['manufacturers_id'] . "')";
+
+ $resobj=$DB->query( $sql );
+
+ $dup_products_id = $resobj->__get('insertId');
+
+ $description_query = $DB->query("select language_id, products_name, products_description, products_url from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . $pid . "'");
+ while ($description =$description_query->fetchAssoc()) {
+ $DB->query("insert into " . TABLE_PRODUCTS_DESCRIPTION . " (products_id, language_id, products_name, products_description, products_url, products_viewed) values ('" . (int)$dup_products_id . "', '" . (int)$description['language_id'] . "', '" . tep_db_input($description['products_name']) . "', '" . tep_db_input($description['products_description']) . "', '" . tep_db_input($description['products_url']) . "', '0')");
}
- foreach($specimen as $key=>$val){
- if(!in_array($key, array('sqlarray', 'post', 'lg') ))
- $this->assertArrayHasKey($key, $tmp);
+ $DB->query("insert into " . TABLE_PRODUCTS_TO_CATEGORIES . " (products_id, categories_id) values ('" . (int)$dup_products_id . "', '" . $catid . "')");
+ // BOF Separate Pricing Per Customer
+ $cg_price_query = $DB->query("select customers_group_id, customers_group_price from " . TABLE_PRODUCTS_GROUPS . " where products_id = '" . $pid . "' order by customers_group_id");
+
+ // insert customer group prices in table products_groups when there are any for the copied product
+ if ($cg_price_query->__get('numRows') > 0) {
+ while ( $cg_prices = $cg_price_query->fetchAssoc()) {
+ $DB->query("insert into " . TABLE_PRODUCTS_GROUPS . " (customers_group_id, customers_group_price, products_id) values ('" . (int)$cg_prices['customers_group_id'] . "', '" . tep_db_input($cg_prices['customers_group_price']) . "', '" . (int)$dup_products_id . "')");
+ }
}
- return $tmp;
+
+ sqlproductattribute::copyto($pid, $dup_products_id);
+
+ // ACA START DUPLICATE PRODUCT
+ $modules->duplicate_product($pid,$dup_products_id);
+
+
+ return $dup_products_id;
+
}
/**
- * \brief Update
- * @depends testproductsFetch
- * @param $specimen array
- * @return array(
- id null
- sqlarray = result specimen (array)
- post = result specimen (array)
- )
- */
- public function testproductsUpdate($specimen){
+ @brief search ref and retrun id product
+ @param $ref string
+ @return products id integer
+ */
+ public static function GetByRef($ref){
+ $DB=Database::getInstance();
- $res = sqlproduct::update($specimen);
+ $sql_query = " SELECT IF( ps.products_id,ps.products_id, p.products_id ) as id
+ FROM " . TABLE_PRODUCTS . " p LEFT JOIN ".TABLE_PRODUCTS_STOCK." ps USING(products_id) ".
+ " WHERE products_ref ='".$ref."' OR products_stock_ref ='".$ref."' ";
- $this -> assertTrue ( ($res == 1) , 'Error product not update' ) ;
+ $_query = $DB->query( $sql_query );
+
+ if( ! $_query->__get('numRows') )
+ return false;
+
+ $product = $_query->fetchAssoc();
+
+ return $product['id'];
+ }
+
+
+ /**
+ @fn MaintenanceTables()
+ @brief clean and maintient link table and data
+ */
+ public static function Maintenance(){
+ $DB=Database::getInstance();
+
+ //! entretient
+ $DB->query("update " . TABLE_PRODUCTS . " set products_date_available = '1000-01-01 00:00:00' where to_days(now()) > to_days(products_date_available)");
+
+ //! Entretient liens avec description
+ $product_query = $DB->query("SELECT p.products_id FROM " . TABLE_PRODUCTS . " p LEFT OUTER JOIN " . TABLE_PRODUCTS_DESCRIPTION . " pd ON p.products_id =pd.products_id WHERE pd.products_id is null");
+ while ($product = tep_db_fetch_array($product_query)){
+ $DB->query("insert into " . TABLE_PRODUCTS_DESCRIPTION . " (products_id,language_id) values ('" . (int)$product['products_id'] . "','".(int)$languages_id."')");
+ }
+
+ self::UpdateOrphelin();
}
+
+
/**
- * @brief delete by id
- * @depends testproductsFetch
- * @param $specimen array
- */
- public function testproductsDelete($specimen){
+ @fn UpdateOrphelin()
+ @brief call method for update in cat , the products in not category
+ */
+ private static function UpdateOrphelin(){
+ $DB=Database::getInstance();
+ $product_query = $DB->query("SELECT p.products_id FROM " . TABLE_PRODUCTS . " p LEFT OUTER JOIN " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c ON p.products_id =p2c.products_id WHERE p2c.products_id is null");
+ while ($product = tep_db_fetch_array($product_query)){
+ $DB->query("insert into " . TABLE_PRODUCTS_TO_CATEGORIES . " (products_id, categories_id) values ('" . (int)$product['products_id'] . "', '".ORPHELIN_COLLECTOR."')");
+ }
+ }
- $res = sqlproduct::delete( $specimen );
- $this -> assertTrue ( ($res == true ) , 'Error product not delete' ) ;
- $res = sqlproduct::delete( array() );
+ /**
+ @fn count_in_category($categories_id, $include_deactivated = false)
+ @brief Count how many products exist in a category
+ @param $categories_id integer
+ @param $include_deactivated boolean true = status products 1 | false status products null
+ @return integer count child products in catg
+ */
+ public static function count_in_category($categories_id, $include_deactivated = false) {
+ $products_count = 0;
- $this -> assertTrue( ($res == false ) , 'Error product not delete' ) ;
+ if( /* ! DataTypes::is_active(trim('product')) || */ ! DataTypes::is_active(trim('categorie')) )
+ return 0;
+ if ($include_deactivated) $products_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = p2c.products_id and p2c.categories_id = '" . (int)$categories_id . "'");
+ else $products_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = p2c.products_id and p.products_status = '1' and p2c.categories_id = '" . (int)$categories_id . "'");
- // check
- $res = sqlproduct::fetch( $specimen );
+ $products = tep_db_fetch_array($products_query);
+ $products_count += $products['total'];
+ $childs_query = tep_db_query("select categories_id from " . TABLE_CATEGORIES . " where parent_id = '" . (int)$categories_id . "'");
+ if (tep_db_num_rows($childs_query))
+ while ($childs = tep_db_fetch_array($childs_query)) $products_count += self::count_in_category($childs['categories_id'], $include_deactivated);
- $this -> assertTrue ( (!is_array($res ) ) , 'Error product not delete processed' ) ;
+ return $products_count;
}
+ /**
+ @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){
+ $object= new stdclass();
+ foreach($array as $key=>$value){
+ if( strpos($key,'products_') ===0)
+ $key=substr($key,9);
-// public function testproductsCopyTo(){
-//
-// $this->specimen['language_id'] = 1;
-// $id = sqlproduct::create($this->specimen);
-// $this -> assertTrue ( ($id >=0) , 'Error product not create' ) ;
-//
-// $res=sqlproduct::copyto( array('id'=>$id, 'catid'=> 1 ) );
-// $this -> assertTrue ( ($res ==false) , 'copy to product, not test possible ' ) ;
-//
-// $res1 = sqlproduct::delete( array('id'=>$id) );
-// $this -> assertTrue ( ($res1 == true ) , 'Error product not delete' ) ;
-//
-// $res2 = sqlproduct::delete( array('id'=>$res) );
-// $this -> assertTrue ( ($res2 == true ) , 'Error product not delete' ) ;
-// }
+ $object->$key = $value;
+ }
+
+ return $object;
+ }
+
}
+
?>
\ No newline at end of file
Modified: trunk/catalog/admin/includes/classes/fileUtility.php
===================================================================
--- trunk/catalog/admin/includes/classes/fileUtility.php 2014-01-22 03:20:11 UTC (rev 5061)
+++ trunk/catalog/admin/includes/classes/fileUtility.php 2014-01-22 03:47:06 UTC (rev 5062)
@@ -377,7 +377,7 @@
$Iterator = $option;
foreach($Iterator as $row=>$array) {
- $res= $zip->addFile($row , substr($row, strlen(DIR_FS_CIP)) );
+ $res= $zip->addFile($row , substr($row, (strlen(DIR_FS_CIP . basename($archive) ) -4) ) );
}
if( ! $zip->close() )
Deleted: trunk/dev/generator/datatype/Modele/sql/mysql/install/tables/osc__DATATYPE_REPLACE__extra_fields.sql
===================================================================
--- trunk/dev/generator/datatype/Modele/sql/mysql/install/tables/osc__DATATYPE_REPLACE__extra_fields.sql 2014-01-22 03:20:11 UTC (rev 5061)
+++ trunk/dev/generator/datatype/Modele/sql/mysql/install/tables/osc__DATATYPE_REPLACE__extra_fields.sql 2014-01-22 03:47:06 UTC (rev 5062)
@@ -1,23 +0,0 @@
---
--- Structure de la table osc__DATATYPE_REPLACE__extra_fields
---
-
-CREATE TABLE IF NOT EXISTS osc__DATATYPE_REPLACE__extra_fields(
- epf_id int(10) unsigned NOT NULL AUTO_INCREMENT,
- epf_order int(11) NOT NULL DEFAULT '0',
- epf_input_type tinyint(1) NOT NULL DEFAULT '0',
- epf_status tinyint(1) NOT NULL DEFAULT '1',
- epf_uses_value_list tinyint(1) NOT NULL DEFAULT '0',
- epf_advanced_search tinyint(1) NOT NULL DEFAULT '1',
- epf_show_in_listing tinyint(1) NOT NULL DEFAULT '0',
- epf_size tinyint(3) unsigned NOT NULL DEFAULT '64',
- epf_use_as_meta_keyword tinyint(1) NOT NULL DEFAULT '0',
- epf_use_to_restrict_listings tinyint(1) NOT NULL DEFAULT '0',
- epf_show_parent_chain tinyint(1) NOT NULL DEFAULT '0',
- epf_active_value_language tinyint(1) NOT NULL DEFAULT '0',
- epf_key varchar(40) DEFAULT NULL COMMENT 'key de config pour plus de souplesse',
- epf_admin int(1) NOT NULL DEFAULT '1' COMMENT 'dispo uniquement admin',
- epf_special_mod varchar(30) DEFAULT NULL COMMENT 'flag module proprietaire',
- PRIMARY KEY (epf_id),
- KEY IDX_ORDER (epf_order)
-) CHARSET=utf8 ;
Deleted: trunk/dev/generator/datatype/Modele/sql/mysql/install/tables/osc__DATATYPE_REPLACE__extra_fields_labels.key.sql
===================================================================
--- trunk/dev/generator/datatype/Modele/sql/mysql/install/tables/osc__DATATYPE_REPLACE__extra_fields_labels.key.sql 2014-01-22 03:20:11 UTC (rev 5061)
+++ trunk/dev/generator/datatype/Modele/sql/mysql/install/tables/osc__DATATYPE_REPLACE__extra_fields_labels.key.sql 2014-01-22 03:47:06 UTC (rev 5062)
@@ -1,21 +0,0 @@
---+######################################################################--+
---| osCSS Open Source E-commerce |
---+######################################################################--+
---| Copyright (c) 2005-2011 The osCSS developers |
---| |
---| http://www.oscss.org |
---| Portions Copyright (c) 2003 osCommerce |
---+######################################################################--+
---| This source file is subject to version 2.0 of the GPL license, |
---| available at the following url: |
---| http://www.oscss.org/ |
---+######################################################################--+
-
-
-
-ALTER TABLE osc__DATATYPE_REPLACE__extra_fields_labels ADD INDEX idx__DATATYPE_REPLACE__extra_fields_labels_lgid (languages_id);
-ALTER TABLE osc__DATATYPE_REPLACE__extra_fields_labels ADD INDEX idx__DATATYPE_REPLACE__epf_id (epf_id);
-
-
-ALTER TABLE osc__DATATYPE_REPLACE__extra_fields_labels ADD CONSTRAINT fk_osc__DATATYPE_REPLACE__extra_fields_labels_lgid FOREIGN KEY (languages_id) REFERENCES osc_languages (languages_id);
-ALTER TABLE osc__DATATYPE_REPLACE__extra_fields_labels ADD CONSTRAINT fk_osc__DATATYPE_REPLACE__extra_fields_labels_id FOREIGN KEY (epf_id) REFERENCES osc__DATATYPE_REPLACE__extra_fields (epf_id);
\ No newline at end of file
Deleted: trunk/dev/generator/datatype/Modele/sql/mysql/install/tables/osc__DATATYPE_REPLACE__extra_fields_labels.sql
===================================================================
--- trunk/dev/generator/datatype/Modele/sql/mysql/install/tables/osc__DATATYPE_REPLACE__extra_fields_labels.sql 2014-01-22 03:20:11 UTC (rev 5061)
+++ trunk/dev/generator/datatype/Modele/sql/mysql/install/tables/osc__DATATYPE_REPLACE__extra_fields_labels.sql 2014-01-22 03:47:06 UTC (rev 5062)
@@ -1,15 +0,0 @@
---
--- Structure de la table osc__DATATYPE_REPLACE__extra_fields_labels
---
-
-CREATE TABLE IF NOT EXISTS osc__DATATYPE_REPLACE__extra_fields_labels(
- epf_id int(10) unsigned NOT NULL,
- languages_id int(11) NOT NULL,
- epf_label varchar(64) DEFAULT NULL,
- epf_label_help varchar(160) DEFAULT NULL COMMENT 'aide contextuelle',
- epf_format varchar(64) NOT NULL,
- epf_unity_type_id int(11) NOT NULL,
- epf_unity_id int(11) NOT NULL,
- PRIMARY KEY (epf_id,languages_id)
-) ;
-
Deleted: trunk/dev/generator/datatype/Modele/sql/mysql/install/tables/osc__DATATYPE_REPLACE__extra_fields_values.key.sql
===================================================================
--- trunk/dev/generator/datatype/Modele/sql/mysql/install/tables/osc__DATATYPE_REPLACE__extra_fields_values.key.sql 2014-01-22 03:20:11 UTC (rev 5061)
+++ trunk/dev/generator/datatype/Modele/sql/mysql/install/tables/osc__DATATYPE_REPLACE__extra_fields_values.key.sql 2014-01-22 03:47:06 UTC (rev 5062)
@@ -1,21 +0,0 @@
---+######################################################################--+
---| osCSS Open Source E-commerce |
---+######################################################################--+
---| Copyright (c) 2005-2011 The osCSS developers |
---| |
---| http://www.oscss.org |
---| Portions Copyright (c) 2003 osCommerce |
---+######################################################################--+
---| This source file is subject to version 2.0 of the GPL license, |
---| available at the following url: |
---| http://www.oscss.org/ |
---+######################################################################--+
-
-
-ALTER TABLE osc__DATATYPE_REPLACE__extra_fields_values ADD INDEX idx__DATATYPE_REPLACE__extra_fields_labels_lgid (languages_id);
-ALTER TABLE osc__DATATYPE_REPLACE__extra_fields_values ADD INDEX idx__DATATYPE_REPLACE__epf_id (epf_id);
-ALTER TABLE osc__DATATYPE_REPLACE__extra_fields_values ADD INDEX idx__DATATYPE_REPLACE__value_id (value_id);
-
-
-ALTER TABLE osc__DATATYPE_REPLACE__extra_fields_values ADD CONSTRAINT fk_osc__DATATYPE_REPLACE__extra_fields_values_lgid FOREIGN KEY (languages_id) REFERENCES osc_languages (languages_id);
-ALTER TABLE osc__DATATYPE_REPLACE__extra_fields_values ADD CONSTRAINT fk_osc__DATATYPE_REPLACE__extra_fields_values_epf_id FOREIGN KEY (epf_id) REFERENCES osc__DATATYPE_REPLACE__extra_fields (epf_id);
\ No newline at end of file
Deleted: trunk/dev/generator/datatype/Modele/sql/mysql/install/tables/osc__DATATYPE_REPLACE__extra_fields_values.sql
===================================================================
--- trunk/dev/generator/datatype/Modele/sql/mysql/install/tables/osc__DATATYPE_REPLACE__extra_fields_values.sql 2014-01-22 03:20:11 UTC (rev 5061)
+++ trunk/dev/generator/datatype/Modele/sql/mysql/install/tables/osc__DATATYPE_REPLACE__extra_fields_values.sql 2014-01-22 03:47:06 UTC (rev 5062)
@@ -1,14 +0,0 @@
---
--- Structure de la table osc__DATATYPE_REPLACE__extra_fields_values
---
-
-CREATE TABLE IF NOT EXISTS osc__DATATYPE_REPLACE__extra_fields_values(
- value_id int(10) unsigned NOT NULL AUTO_INCREMENT,
- epf_id int(10) unsigned NOT NULL,
- languages_id int(11) NOT NULL,
- parent_id int(10) unsigned NOT NULL DEFAULT '0',
- sort_order int(11) NOT NULL DEFAULT '0',
- epf_value varchar(64) DEFAULT NULL,
- PRIMARY KEY (value_id,epf_id,languages_id),
- KEY value_id (value_id)
-) CHARSET=utf8 ;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2014-01-22 03:20:15
|
Revision: 5061
http://sourceforge.net/p/oscss/svn/5061
Author: oscim
Date: 2014-01-22 03:20:11 +0000 (Wed, 22 Jan 2014)
Log Message:
-----------
Fix
Modified Paths:
--------------
trunk/catalog/admin/includes/exts/package/CIP.php
trunk/catalog/common/classes/Config.php
trunk/catalog/templates/defaut/includes/boxes/myaccount.php
Modified: trunk/catalog/admin/includes/exts/package/CIP.php
===================================================================
--- trunk/catalog/admin/includes/exts/package/CIP.php 2014-01-22 00:48:17 UTC (rev 5060)
+++ trunk/catalog/admin/includes/exts/package/CIP.php 2014-01-22 03:20:11 UTC (rev 5061)
@@ -254,9 +254,8 @@
// break;
default:
+ $res = fileUtility::extractto($this->full_path_to_zip() , DIR_FS_CIP . self::$cip_name.'/' ) ;
- $res = fileUtility::extractto($this->full_path_to_zip() , DIR_FS_CIP . self::$cip_name , 'zip', 'OVERWRITE') ;
-
if ( _test_bool( $res )) {
$messageStack->add_session(__('@package file is ok for install') , 'success');
}
Modified: trunk/catalog/common/classes/Config.php
===================================================================
--- trunk/catalog/common/classes/Config.php 2014-01-22 00:48:17 UTC (rev 5060)
+++ trunk/catalog/common/classes/Config.php 2014-01-22 03:20:11 UTC (rev 5061)
@@ -156,8 +156,7 @@
while ($configuration = $res->fetchAssoc()){
$KEY = strtoupper($configuration['cfgKey']);
-
- if(!defined($KEY))
+ if(!empty($KEY) && !defined($KEY))
$this->conf->$KEY = $configuration['cfgValue'];
}
}
Modified: trunk/catalog/templates/defaut/includes/boxes/myaccount.php
===================================================================
--- trunk/catalog/templates/defaut/includes/boxes/myaccount.php 2014-01-22 00:48:17 UTC (rev 5060)
+++ trunk/catalog/templates/defaut/includes/boxes/myaccount.php 2014-01-22 03:20:11 UTC (rev 5061)
@@ -15,7 +15,6 @@
/**
@remarks Process Specific Boxes
*/
- var_dump(__file__);
global $language,$customer_id,$account, $page ;
global $list, $type;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2014-01-22 00:48:20
|
Revision: 5060
http://sourceforge.net/p/oscss/svn/5060
Author: oscim
Date: 2014-01-22 00:48:17 +0000 (Wed, 22 Jan 2014)
Log Message:
-----------
Fix
Fix regeression fileutilty
Modified Paths:
--------------
trunk/catalog/admin/includes/classes/drivers/productsACA.php
trunk/catalog/admin/includes/classes/drivers/sqlproduct.php
trunk/catalog/admin/includes/classes/fileUtility.php
trunk/catalog/common/classes/datatype_drivers/Data_product.php
Modified: trunk/catalog/admin/includes/classes/drivers/productsACA.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/productsACA.php 2014-01-22 00:17:12 UTC (rev 5059)
+++ trunk/catalog/admin/includes/classes/drivers/productsACA.php 2014-01-22 00:48:17 UTC (rev 5060)
@@ -188,9 +188,7 @@
/**
*/
public function after_update ($Id){
- var_dump($products_id);
foreach ($this->modules as $key=>$module) {
- echo $key;
if (($module->enabled) and (method_exists($module,'after_update' )))
$this->modules[$key]->after_update($Id);
}
Modified: trunk/catalog/admin/includes/classes/drivers/sqlproduct.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlproduct.php 2014-01-22 00:17:12 UTC (rev 5059)
+++ trunk/catalog/admin/includes/classes/drivers/sqlproduct.php 2014-01-22 00:48:17 UTC (rev 5060)
@@ -1,685 +1,177 @@
-<?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 30/09/2013, 23:13
- @author oscim <mail aur...@os...> <www http://www.oscim.fr>
- @encode UTF-8
- @file sqlproduct.php
- @dir admin/includes/classes/drivers/
-*/
+ * \file test/phpunit/Back/productTest.php
+ * \brief test unitaire class product 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');
-require_once( DIR_FS_ADMIN . DIR_WS_CLASSES . 'SqlFilesDataDriverClass.php');
+global $base_path;
+
+
/**
- @class sqlproduct
-*/
-class sqlproduct
- extends SqlFilesDataDriverClass
- implements ModSqlDataDriver{
- /**
- @var boolean use submodule in this class
- */
- public $use_modules = true;
+ * \class productTest
+ */
+class sqlproductsTest
+ extends PHPUnit_Framework_TestCase
+{
+ /**
+ @var array
+ */
+ public $specimen;
/**
- @fn init()
- @brief for init subchilds and other option
+ @var int
*/
- public function init(){
- self::$DataDriverType = 'product';
-
- if($this->use_modules) {
- self::$modules=new productsACA;
- self::$modules->set_image_handler();
- }
+ static public $Id;
+ function __construct()
+ {
}
- /**
- @brief create new ligne in table configuration
- @param $option array
- language_id = > int $languages_id
- type => int product type
- */
- public static function create($option){
- global $languages_id;
- new self();
- $DB=Database::getInstance();
- $error=0;
- $modules = self::$modules;
-// if(!isset($option['key'])) return 'key';
+ /**
+ * \brief test creat account user
+ * @return array(
+ id null
+ sqlarray = result specimen (array)
+ post = result specimen (array)
+ )
+ */
+ public function testproductsSpecimen(){
+ $specimen = array();
- $DB->beginTransaction();
+ $tmp = sqlproduct::Specimen(true);
+ $this->assertTrue ( ( is_object($tmp) ) , 'Error sqlproducts Specimen return object' ) ;
- $languages_id = (isset($option['language_id']) ? $option['language_id'] : $languages_id);
- $type = (isset($option['type']))? $option['type'] : 1;
+ foreach($tmp as $key=>$val)
+ $specimen[$key] = $val;
- $sql_data_array = array(
- 'products_type' => $type,
- 'products_quantity' => 0,
- 'products_price' => 0,
- 'products_date_added' => 'now()',
- 'manufacturers_id' => '',
- 'track_stock' => ( ($type == 1) ? 1 : 0 )
- );
- $sql_data_array = array_merge($sql_data_array, self::$modules->get_insert_table_products());
+ $this->assertTrue ( ( is_array($specimen) ) , 'Error sqlproducts Specimen convert' ) ;
- $resobj=tep_db_perform(TABLE_PRODUCTS, $sql_data_array);
- if(!$resobj){
- $DB->rollbackTransaction();
- return false;
- }
-
- $products_id = $resobj->__get('insertId');
-
-
- $res = $DB->query("insert into " . TABLE_PRODUCTS_TO_CATEGORIES . " (products_id, categories_id) values ('" . (int)$products_id . "', '".ORPHELIN_COLLECTOR."')");
- if(!$res)
- $error++;
-
- $list_languages=tep_get_languages();
- for ($i=0, $n=sizeof($list_languages); $i<$n; $i++) {
- $language_id = $list_languages[$i]['id'];
-
- $sql_data_array = array('products_name' => '','products_id' => $products_id, 'language_id' => $language_id);
-
- $res=tep_db_perform(TABLE_PRODUCTS_DESCRIPTION, $sql_data_array);
- if(!$res)
- $error++;
- }
-
- if( $error > 0){
- $DB->rollbackTransaction();
- return false;
- }
- else{
- $DB->commitTransaction();
- return $products_id;
- }
+ $tmp = array();
+ $tmp['sqlarray'] = $specimen;
+ $tmp['post'] = $specimen;
+ $tmp = array_merge($tmp, $specimen);
+ return $tmp;
}
- /**
- @brief update ligne in table configuration
- */
- public static function update($option){
-
- new self();
- $DB=Database::getInstance();
- $error=0;
- $modules = self::$modules;
-
- if(!isset($option['id']))
- return false;
-
- $list_languages=tep_get_languages();
- $where ='';
- $products_id = (int)$option['id'];
-
-
- $post =array();
- if(isset($option['post'])){
- $post=(array)$option['post'];
- $post['products_id'] = $products_id;
- }
-
- $sql_data_array = (array)(isset($option['sqlarray'])? $option['sqlarray'] : array() );
-
-
- if(( $origin = self::fetch($option, true) ) && !$origin )
- $action = 'insert_product';
- else
- $action = 'update_product';
-
- // recalculate price net
- if(isset($sql_data_array['products_price_gross'])) {
- $sql_data_array['products_price'] = ( $sql_data_array['products_price_gross'] / ((tep_get_tax_rate_value($origin->tax_class_id) / 100 ) + 1) );
- unset( $sql_data_array['products_price_gross'] );
- }
-
- /// Call ACA module put post var
- $modules->load_post_values($post);
-
- $DB->beginTransaction();
-
-/**
- TODO Check des clef des array pour verifier que celle ci existe dans specimen
-*/
-
- $sql_data_array['products_last_modified'] ='now()';
- $sql_data_array = array_merge($sql_data_array, $modules->get_update_table_products());
-
- if( ! tep_db_perform(TABLE_PRODUCTS, $sql_data_array, 'update',"products_id = '" . (int)$products_id . "'") )
- $error++;
-
- /*
- Use transversal Datatype Rootlisting and update in data
- Not in context update one col
+ /**
+ * \brief test creat account user
+ * @depends testproductsSpecimen
+ * @param $specimen array
+ * @return array(
+ id null
+ sqlarray = result specimen (array)
+ post = result specimen (array)
+ )
*/
- if(count($sql_data_array) > 2) {
- if(isset($post['linkto'])){
- $r = MLinkTo::SqlLeftTo('product', $products_id, $post['linkto']) ;
- if($r == false)
- $error++;
- }
- }
+ public function testproductsCreate($specimen){
+ $res = sqlproduct::create( $specimen );
- if($error ==0 ) {
- /// Separate Pricing Per Customer
- $customers_group_query = $DB->query("select customers_group_id, customers_group_name from " . TABLE_CUSTOMERS_GROUPS . " where customers_group_id != '0' order by customers_group_id");
- // Gets all of the customers groups
- while ($customers_group = tep_db_fetch_array($customers_group_query)){
+ $id=$res;
- $attributes_query = $DB->query("select customers_group_price from " . TABLE_PRODUCTS_GROUPS . " where products_id = '" . $products_id . "' and customers_group_id = '" . $customers_group['customers_group_id'] . "'");
- $attributes = tep_db_fetch_array($attributes_query);
+ $this -> assertTrue ( ($res >=0) , 'Error product not create' ) ;
- if (tep_db_num_rows($attributes_query) > 0) {
- if (isset($post['sppcoption'][$customers_group['customers_group_id']]) && isset($post['sppcprice'][$customers_group['customers_group_id']]) && $post['sppcprice'][$customers_group['customers_group_id']]!= '') {
- // this is checking if the check box is checked and the price is not null
- if ( $_POST['sppcprice'][$customers_group['customers_group_id']] != $attributes['customers_group_price'])
- $DB->query("update " . TABLE_PRODUCTS_GROUPS . " set customers_group_price = '" . $post['sppcprice'][$customers_group['customers_group_id']] . "' where customers_group_id = '" . $customers_group['customers_group_id'] . "' and products_id = '" . $products_id . "'");
- }
- else
- $DB->query("delete from " . TABLE_PRODUCTS_GROUPS . " where customers_group_id = '" . $customers_group['customers_group_id'] . "' and products_id = '" . $products_id . "'");
- }
- elseif (isset($_POST['sppcoption'][$customers_group['customers_group_id']]) && isset($post['sppcprice'][$customers_group['customers_group_id']]) && $post['sppcprice'][$customers_group['customers_group_id']] != '')
- $DB->query("insert into " . TABLE_PRODUCTS_GROUPS . " (products_id, customers_group_id, customers_group_price) values ('" . $products_id . "', '" . $customers_group['customers_group_id'] . "', '" . $post['sppcprice'][$customers_group['customers_group_id']] . "')");
- }
- }
-
-
- /// mutli-languages process
- for ($i=0, $n=sizeof($list_languages); $i<$n; $i++) {
-
- $language_id = $list_languages[$i]['id'];
-
- $sql_data_array = array();
-
- if ($action == 'insert_product') {
- $insert_sql_data = array('products_id' => $products_id, 'language_id' => $language_id);
-
- $sql_data_array = array_merge($sql_data_array, $insert_sql_data);
- // ACA START INSERT IN PRODUCT_DESCRIPTION TABLE
- $sql_data_array = array_merge($sql_data_array, self::$modules->get_insert_table_products_description ($language_id));
-
-
- if( !tep_db_perform(TABLE_PRODUCTS_DESCRIPTION, $sql_data_array) )
- $error++;
- }
-
- elseif ($action == 'update_product') {
- // ACA START UPDATE PRODUCT_DESCRIPTION TABLE
- $sql_data_array = array_merge($sql_data_array, (array)self::$modules->get_update_table_products_description ($language_id));
-
- if(count($sql_data_array) > 0)
- if( ! tep_db_perform(TABLE_PRODUCTS_DESCRIPTION, $sql_data_array, 'update', " products_id = '" . (int)$products_id . "' and language_id = '" . (int)$language_id . "' ") )
- $error++;
- }
- }
-
-
- /// Call ACA module after update
- $modules->after_update($products_id) ;
-
- 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)
-
- @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){
- new self();
-
- $DB=Database::getInstance();
- $modules = self::$modules;
-// $price=price::getInstance();
-
- $cat_list =array();
- $error = 0;
-
- $sql ="AND ";
- if(isset($option['id'])){
- $ID = (int) $option['id'];
- $sql .="AND p.products_id = '".(int)tep_db_input($option['id'])."' ";
- }
- elseif(isset($option['ref'])){
- if( ($ID = self::GetByRef($option['ref'])) && $ID === false)
- return false;
-
- $sql .="AND p.products_id = '".(int)tep_db_input($ID)."' ";
- }
-
-// if(isset($option['language_id'])){
-// $languages_id = (int)$option['language_id'];
-// $sql .="AND pd.language_id = '".(int)tep_db_input($option['language_id'])."' ";
-// }
-
-// if(isset($option['key'])) $sql .="AND configuration_key = '".(string)tep_db_input($option['key'])."' ";
-// if(isset($option['group_id'])) $sql .="AND configuration_group_id = '".(int)(string)tep_db_input($option['group_id'])."' ";
-
- $sql =substr($sql,3);
-
- $sql_query = "SELECT
- p.products_id
- , p.products_type
- , p.products_ref
- , p.products_quantity
- , p.products_quantity_alert
- , p.products_type
- , p.products_model
- , p.products_image
- , p.products_price
- , p.products_weight
- , p.products_weight_brut
- , p.track_stock
- , p.products_date_added
- , p.products_last_modified
- , products_date_available
- , p.products_status
- , p.products_tax_class_id
- , p.manufacturers_id
- , p.products_barcode_type
- , p.products_barcode
- , p.products_ordered
- FROM " . TABLE_PRODUCTS . " p ".
- " WHERE 1 ". $sql;
-
- $product_query = $DB->query( $sql_query );
-
- if( ! $product_query->__get('numRows') )
- return false;
-
- $product = $product_query->fetchAssoc();
-
- tep_db_free_result($product_query);
-
- global $price;
- $product['products_price_gross'] = (string)tep_add_tax($product['products_price'], tep_get_tax_rate($product['products_tax_class_id']) );
- $product['products_images'] = explode('|', $product['products_image']);
-
- $whlg = '';
- if(isset($option['language_id'])){
- $languages_id = (int)$option['language_id'];
- $whlg=" AND language_id='" . $option['language_id'] . "' ";
- }
-
-// $_query = $DB->query("select language_id , products_name , products_description , products_url from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$product['products_id'] . "' ".$whlg);
-//
-// foreach($_query->fetchAllAssoc() as $row)
-// $product['lg'][$row['language_id']] = ((!$shortkey)? $row : self::CleanKey($row));
-//
-
-
- /*
- Use transversal Datatype Rootlisting and update in data
+ * \brief Load specific id passed in array
+ * @depends testproductsCreate
+ * @param $specimen array
+ * @return array(
+ id null
+ sqlarray = result specimen (array)
+ post = result specimen (array)
+ )
*/
- $r = MLinkTo::SqlRightTo('product', $ID) ;
- if($r == false)
- $error++;
- else
- $product = array_merge($product,$r);
+ public function testproductsFetch($specimen){
+ $res = sqlproduct::fetch( $specimen , true);
+ $this -> assertTrue ( (is_object($res ) ) , 'Error product not fetch' ) ;
- $product['products_date_available']=(isset($product['products_date_available'])? $product['products_date_available'] : '');
-
- // <!-- BOF Separate Pricing Per Customer -->
- $customers_group_query = $DB->query("select customers_group_id, customers_group_name from " . TABLE_CUSTOMERS_GROUPS . " where customers_group_id != '0' order by customers_group_id");
- while ($customers_group = tep_db_fetch_array($customers_group_query)) {
- $attributes_query = $DB->query("select customers_group_price from " . TABLE_PRODUCTS_GROUPS . " where products_id = '" . (int)tep_db_input($ID) . "' and customers_group_id = '" . $customers_group['customers_group_id']. "'");
- $attributes = tep_db_fetch_array($attributes_query);
- if (!isset($attributes['customers_group_price'])) $attributes['customers_group_price'] = '';
-
- $product['products_sppc'][$customers_group['customers_group_id']] = array('sppcname' => $customers_group['customers_group_name'], 'sppcprice' => $attributes['customers_group_price']);
- }
- //<!-- EOF Separate Pricing Per Customer -->
-
-
- $product['mod'] = $modules->fetch(array('products_id'=>$ID, 'shortkey'=>$shortkey));
-
- // put all val origin module in current result
- foreach($product['mod'] as $submod=>$array)
- if(is_array($array))
- foreach($array as $key=>$val)
- $product[$key] = $val;
-
-
- return ((!$shortkey)? $product : self::CleanKey($product) );
-
- }
-
- /**
- @brief delete row
- */
- public static function delete($option){
-
- new self();
- $DB=Database::getInstance();
- $modules = self::$modules;
- $res = false;
- $product_categories = array();
-
- if(isset($option['id']))
- $product_id = (int)tep_db_input($option['id']) ;
- else
- return false;
-
-
- if(isset($option['catarray'])){
- foreach($option['catarray'] as $k=>$v)
- $product_categories[$k]=(int)tep_db_input($v) ;
-
- for ($i=0, $n=sizeof($product_categories); $i<$n; $i++) {
- $DB->query($s="DELETE FROM " . TABLE_PRODUCTS_TO_CATEGORIES . " WHERE products_id = '" . (int)$product_id . "' AND categories_id = '" . (int)$product_categories[$i] . "' LIMIT 1 ");
- }
- }
- else
- $DB->query($s="DELETE FROM " . TABLE_PRODUCTS_TO_CATEGORIES . " WHERE products_id = '" . (int)$product_id . "' ");
-
-
-
- $product_categories_query = $DB->query("SELECT COUNT(*) AS total FROM " . TABLE_PRODUCTS_TO_CATEGORIES . " WHERE products_id = '" . (int)$product_id . "'");
- $product_categories = tep_db_fetch_array($product_categories_query);
-
- if ($product_categories['total'] == '0') {
-
- $modules->delete($product_id);
-
- $res=tep_remove_product($product_id);
- }
- else
- return false;
-
- return $res;
- }
-
-
- /**
- @brief
- @return array product empty
- */
- public static function Specimen($shortkey=false){
- $par = array(
- 'products_id' => '', // auto incremente
- 'products_type' => 0, // int (0 : default)
- 'products_ref' => '', // auto incremente
-
- 'track_stock'=>0,
- 'products_quantity' => 0,
- 'products_quantity_alert' => 0,
-
- 'products_model' => '',
- 'products_image' => '',
- 'images' => array(),
-
- 'products_price' => '0.000000',
- 'products_price_gross'=>'',
- 'products_tax_class_id' => 0,
-
- 'barcode_type' => '',
- 'barcode' => '',
-
- 'products_weight' => '0.00',
- 'products_weight_brut' => '',
-
- 'products_date_added' => '',
- 'products_last_modified' => '',
- 'products_date_available' => '',
- 'products_status' => 0,
-
- 'manufacturers_id' => '',
- 'products_ordered' => 0,
-
- 'lg' =>array(
- array(
- 'products_name' => '', // depend language table
- 'products_description' => '', // depend language table
- 'products_url' => '',
- 'language_id' => 1,
- ),
- ),
-
- 'mod'=>array(), // other external sub module
- );
-
- return ((!$shortkey)? $par : self::CleanKey($par) );
- }
-
-
- /**
- @brief copy in duplicate or link
- @param $option array
- type => string duplicate/link
- @return int pid new product
- */
- public static function copyto($option){
-
-
- if(isset($option['id']))
- $pid = (int) $option['id'];
- else
- return false;
-
- if(isset($option['catid']))
- $catid = (int) $option['catid'];
- else
- return false;
-
-
- new self();
- $DB=Database::getInstance();
- $modules = self::$modules;
-
-
- $product_query = $DB->query($sql = "select products_type, products_quantity, products_model, products_image, products_price, products_date_available, products_weight, products_tax_class_id, manufacturers_id from " . TABLE_PRODUCTS . " where products_id = '" . $pid . "'");
- $product = $product_query->fetchAssoc();
-
-
- $sql = "INSERT INTO " . TABLE_PRODUCTS . " (
- products_type,
- products_quantity,
- products_model,
- products_image,
- products_price,
- products_date_added,
- products_date_available,
- products_weight,
- products_status,
- products_tax_class_id,
- manufacturers_id
- ) VALUES (
- '" . tep_db_input($product['products_type']) . "',
- '" . tep_db_input($product['products_quantity']) . "',
- '" . tep_db_input($product['products_model']) . "',
- '" . tep_db_input($product['products_image']) . "',
- '" . tep_db_input($product['products_price']) . "',
- now(),
- " . (empty($product['products_date_available']) ? "null" : "'" . tep_db_input($product['products_date_available']) . "'") . ",
- '" . tep_db_input($product['products_weight']) . "', '0',
- '" . (int)$product['products_tax_class_id'] . "',
- '" . (int)$product['manufacturers_id'] . "')";
-
- $resobj=$DB->query( $sql );
-
- $dup_products_id = $resobj->__get('insertId');
-
- $description_query = $DB->query("select language_id, products_name, products_description, products_url from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . $pid . "'");
- while ($description =$description_query->fetchAssoc()) {
- $DB->query("insert into " . TABLE_PRODUCTS_DESCRIPTION . " (products_id, language_id, products_name, products_description, products_url, products_viewed) values ('" . (int)$dup_products_id . "', '" . (int)$description['language_id'] . "', '" . tep_db_input($description['products_name']) . "', '" . tep_db_input($description['products_description']) . "', '" . tep_db_input($description['products_url']) . "', '0')");
+ foreach($res as $key=>$val){
+ $tmp[$key] = $val;
}
- $DB->query("insert into " . TABLE_PRODUCTS_TO_CATEGORIES . " (products_id, categories_id) values ('" . (int)$dup_products_id . "', '" . $catid . "')");
+ foreach($specimen as $key=>$val){
+ if(!in_array($key, array('sqlarray', 'post', 'lg') ))
+ $this->assertArrayHasKey($key, $tmp);
- // BOF Separate Pricing Per Customer
- $cg_price_query = $DB->query("select customers_group_id, customers_group_price from " . TABLE_PRODUCTS_GROUPS . " where products_id = '" . $pid . "' order by customers_group_id");
-
- // insert customer group prices in table products_groups when there are any for the copied product
- if ($cg_price_query->__get('numRows') > 0) {
- while ( $cg_prices = $cg_price_query->fetchAssoc()) {
- $DB->query("insert into " . TABLE_PRODUCTS_GROUPS . " (customers_group_id, customers_group_price, products_id) values ('" . (int)$cg_prices['customers_group_id'] . "', '" . tep_db_input($cg_prices['customers_group_price']) . "', '" . (int)$dup_products_id . "')");
- }
}
-
- sqlproductattribute::copyto($pid, $dup_products_id);
-
- // ACA START DUPLICATE PRODUCT
- $modules->duplicate_product($pid,$dup_products_id);
-
-
- return $dup_products_id;
-
+ return $tmp;
}
/**
- @brief search ref and retrun id product
- @param $ref string
- @return products id integer
- */
- public static function GetByRef($ref){
- $DB=Database::getInstance();
+ * \brief Update
+ * @depends testproductsFetch
+ * @param $specimen array
+ * @return array(
+ id null
+ sqlarray = result specimen (array)
+ post = result specimen (array)
+ )
+ */
+ public function testproductsUpdate($specimen){
- $sql_query = " SELECT IF( ps.products_id,ps.products_id, p.products_id ) as id
- FROM " . TABLE_PRODUCTS . " p LEFT JOIN ".TABLE_PRODUCTS_STOCK." ps USING(products_id) ".
- " WHERE products_ref ='".$ref."' OR products_stock_ref ='".$ref."' ";
+ $res = sqlproduct::update($specimen);
- $_query = $DB->query( $sql_query );
-
- if( ! $_query->__get('numRows') )
- return false;
-
- $product = $_query->fetchAssoc();
-
- return $product['id'];
- }
-
-
- /**
- @fn MaintenanceTables()
- @brief clean and maintient link table and data
- */
- public static function Maintenance(){
- $DB=Database::getInstance();
-
- //! entretient
- $DB->query("update " . TABLE_PRODUCTS . " set products_date_available = '1000-01-01 00:00:00' where to_days(now()) > to_days(products_date_available)");
-
- //! Entretient liens avec description
- $product_query = $DB->query("SELECT p.products_id FROM " . TABLE_PRODUCTS . " p LEFT OUTER JOIN " . TABLE_PRODUCTS_DESCRIPTION . " pd ON p.products_id =pd.products_id WHERE pd.products_id is null");
- while ($product = tep_db_fetch_array($product_query)){
- $DB->query("insert into " . TABLE_PRODUCTS_DESCRIPTION . " (products_id,language_id) values ('" . (int)$product['products_id'] . "','".(int)$languages_id."')");
- }
-
- self::UpdateOrphelin();
+ $this -> assertTrue ( ($res == 1) , 'Error product not update' ) ;
}
-
-
/**
- @fn UpdateOrphelin()
- @brief call method for update in cat , the products in not category
- */
- private static function UpdateOrphelin(){
- $DB=Database::getInstance();
- $product_query = $DB->query("SELECT p.products_id FROM " . TABLE_PRODUCTS . " p LEFT OUTER JOIN " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c ON p.products_id =p2c.products_id WHERE p2c.products_id is null");
- while ($product = tep_db_fetch_array($product_query)){
- $DB->query("insert into " . TABLE_PRODUCTS_TO_CATEGORIES . " (products_id, categories_id) values ('" . (int)$product['products_id'] . "', '".ORPHELIN_COLLECTOR."')");
- }
- }
+ * @brief delete by id
+ * @depends testproductsFetch
+ * @param $specimen array
+ */
+ public function testproductsDelete($specimen){
+ $res = sqlproduct::delete( $specimen );
+ $this -> assertTrue ( ($res == true ) , 'Error product not delete' ) ;
- /**
- @fn count_in_category($categories_id, $include_deactivated = false)
- @brief Count how many products exist in a category
- @param $categories_id integer
- @param $include_deactivated boolean true = status products 1 | false status products null
- @return integer count child products in catg
- */
- public static function count_in_category($categories_id, $include_deactivated = false) {
- $products_count = 0;
+ $res = sqlproduct::delete( array() );
- if( /* ! DataTypes::is_active(trim('product')) || */ ! DataTypes::is_active(trim('categorie')) )
- return 0;
+ $this -> assertTrue( ($res == false ) , 'Error product not delete' ) ;
- if ($include_deactivated) $products_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = p2c.products_id and p2c.categories_id = '" . (int)$categories_id . "'");
- else $products_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = p2c.products_id and p.products_status = '1' and p2c.categories_id = '" . (int)$categories_id . "'");
- $products = tep_db_fetch_array($products_query);
- $products_count += $products['total'];
- $childs_query = tep_db_query("select categories_id from " . TABLE_CATEGORIES . " where parent_id = '" . (int)$categories_id . "'");
- if (tep_db_num_rows($childs_query))
- while ($childs = tep_db_fetch_array($childs_query)) $products_count += self::count_in_category($childs['categories_id'], $include_deactivated);
+ // check
+ $res = sqlproduct::fetch( $specimen );
- return $products_count;
+ $this -> assertTrue ( (!is_array($res ) ) , 'Error product not delete processed' ) ;
}
- /**
- @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){
- $object= new stdclass();
- foreach($array as $key=>$value){
- if( strpos($key,'products_') ===0)
- $key=substr($key,9);
- $object->$key = $value;
- }
-
- return $object;
- }
-
+// public function testproductsCopyTo(){
+//
+// $this->specimen['language_id'] = 1;
+// $id = sqlproduct::create($this->specimen);
+// $this -> assertTrue ( ($id >=0) , 'Error product not create' ) ;
+//
+// $res=sqlproduct::copyto( array('id'=>$id, 'catid'=> 1 ) );
+// $this -> assertTrue ( ($res ==false) , 'copy to product, not test possible ' ) ;
+//
+// $res1 = sqlproduct::delete( array('id'=>$id) );
+// $this -> assertTrue ( ($res1 == true ) , 'Error product not delete' ) ;
+//
+// $res2 = sqlproduct::delete( array('id'=>$res) );
+// $this -> assertTrue ( ($res2 == true ) , 'Error product not delete' ) ;
+// }
}
-
?>
\ No newline at end of file
Modified: trunk/catalog/admin/includes/classes/fileUtility.php
===================================================================
--- trunk/catalog/admin/includes/classes/fileUtility.php 2014-01-22 00:17:12 UTC (rev 5059)
+++ trunk/catalog/admin/includes/classes/fileUtility.php 2014-01-22 00:48:17 UTC (rev 5060)
@@ -394,17 +394,17 @@
/**
@fn extractto($archive, $destination,$ext='zip', $optionnal='')
- @brief Extract and move to
- @param $archive String path file for extract
- @param $destination String path destination extract to
- @param $ext string type of extension
- @param $optionnal string
- List of possiblity value
- - For Zip/empty type
- empty : for extract zip
- OVERWRITE : for extract and rewrite file
- @return boolean true, else false
- @note use language file Core.txt
+ @brief Extract and move to
+ @param $archive String path file for extract
+ @param $destination String path destination extract to
+ @param $ext string type of extension
+ @param $optionnal string
+ List of possiblity value
+ - For Zip/empty type
+ empty : for extract zip
+ OVERWRITE : for extract and rewrite file
+ @return boolean true, else false
+ @note use language file Core.txt
*/
public static function extractto($archive, $destination, $ext='zip', $optionnal=null) {
global $messageStack;
@@ -423,26 +423,25 @@
case 'zip':
default:
- if($optionnal !=null)
- $optionnal = ' '.constant('ZipArchive::'.$optionnal);
-
- if(substr($archive, 0, 1) == '/')
- $archive = substr($archive, 1);
-
- $zip = new ZipArchive;
-
- $res = $zip->open($archive, $optionnal ); //$optionnal);
-
- $res = $zip->extractTo($destination);
-
- if ($res === TRUE) {
- $messageStack->add(__('@system extract success') , 'success');
-
- $zip->close();
-
- } else {
- $messageStack->add(__('@system extract error'). ' '.$res, 'error' );
+ if($optionnal !=null)
+ $optionnal = ' '.constant('ZipArchive::'.$optionnal);
+ // if(substr($archive, 0, 1) == '/')
+ // $archive = substr($archive, 1);
+ try {
+ $zip = new ZipArchive;
+ if(!$zip)
+ throw new Exception('Unknown ZipArchive :: '. $zip );
+ if(! $zip->open($archive, $optionnal ) )
+ throw new Exception('ZipArchive :: not open '. $archive );
+ if(! $zip->extractTo($destination) )
+ throw new Exception('ZipArchive :: not extract '. $archive );
+ if( ! $zip->close() )
+ throw new Exception('ZipArchive :: not save ('. $archive.')' );
}
+ catch (Exception $e) {
+ print( 'Exception : ' . $e. "\n" );
+ return false;
+ }
}
return true;
Modified: trunk/catalog/common/classes/datatype_drivers/Data_product.php
===================================================================
--- trunk/catalog/common/classes/datatype_drivers/Data_product.php 2014-01-22 00:17:12 UTC (rev 5059)
+++ trunk/catalog/common/classes/datatype_drivers/Data_product.php 2014-01-22 00:48:17 UTC (rev 5060)
@@ -90,7 +90,8 @@
// $this->use_in_search = _cst_bool('DATA_PRODUCT_USEINSEARCH');
-
+
+ if($next) {
$this->listing_sql['tables'] = " FROM " . TABLE_PRODUCTS . " ".$this->p." ".
" LEFT JOIN " . TABLE_PRODUCTS_DESCRIPTION . " ".$this->p."d ON( ".$this->p."d.products_id = ".$this->p.".products_id AND ".$this->p."d.language_id = '%3\$s' ) ".
"";
@@ -105,8 +106,7 @@
// list normalise date
$this->listing_sql['dates'] = " ".$this->p.".products_date_added as added, ".$this->p.".products_last_modified as modified, ".$this->p.".products_date_available as available ";
-
- if($next) {
+
global $page,$language;
if(is_object($page))
if(($path_lg=$page->fix_file(DIR_WS_INCLUDES .'languages/'. $language . '/' . $this->DataType.'.txt',true)) !=false)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2014-01-22 00:17:16
|
Revision: 5059
http://sourceforge.net/p/oscss/svn/5059
Author: oscim
Date: 2014-01-22 00:17:12 +0000 (Wed, 22 Jan 2014)
Log Message:
-----------
Fix last commit delete by error
Added Paths:
-----------
trunk/catalog/includes/modules/product_listing.php
Added: trunk/catalog/includes/modules/product_listing.php
===================================================================
--- trunk/catalog/includes/modules/product_listing.php (rev 0)
+++ trunk/catalog/includes/modules/product_listing.php 2014-01-22 00:17:12 UTC (rev 5059)
@@ -0,0 +1,40 @@
+<?php
+/**
+ @licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
+ @portion code Copyright (c) 2002 osCommerce
+ @package osCSS-2 <www http://www.oscss.org>
+ @version 2.1.1
+ @date 28/11/12, 08:18
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+*/
+function in_obj_product_listing(){
+
+ //! @remarks depend Data_product active
+ if( ! DataTypes::is_active('product'))
+ return false;
+
+ global $page;
+ $mod=$page->oscss_modules->_return('product_listing');
+ $listing_split=$mod['listing_split'];
+ $listing_query=$mod['listing_split']->sql_query;
+ $languages_id=$page->the_var('languages_id');
+ $currencies=$page->return_object('currencies');
+ $p=array();
+ /** init aca module */
+ $aca_listing=$page->new_class('listing');
+ if(is_string($listing_query))$listing_query=tep_db_query($listing_query);
+
+ while ($listing = tep_db_fetch_array($listing_query)){
+ $pd=product::get_item($listing['products_id']);
+ $pd->aca=$aca_listing->return_db_min($listing['products_id']);
+ $pd->type = 'product';
+ $p[]=$pd;
+ }
+
+
+ return new objectInfo(array('title'=>((isset($mod['title']))? $mod['title']:''), 'content'=>$p, 'split'=> $listing_split , 'type'=>'product' ));
+
+}
+
+?>
\ 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-01-22 00:15:40
|
Revision: 5058
http://sourceforge.net/p/oscss/svn/5058
Author: oscim
Date: 2014-01-22 00:15:28 +0000 (Wed, 22 Jan 2014)
Log Message:
-----------
All change for complet simplify listing construct in requets sql
Adjust files
Fix
Modified Paths:
--------------
trunk/catalog/admin/includes/classes/SqlFilesDataDriverClass.php
trunk/catalog/admin/includes/classes/aca.php
trunk/catalog/admin/includes/classes/drivers/productsACA.php
trunk/catalog/admin/includes/classes/drivers/sqlcategorie.php
trunk/catalog/admin/includes/classes/drivers/sqlcontent.php
trunk/catalog/admin/includes/classes/drivers/sqlproduct.php
trunk/catalog/admin/includes/classes/modulesUtility.php
trunk/catalog/admin/includes/modules/configuration/datatypecategorie.php
trunk/catalog/admin/includes/modules/pages/categories.php
trunk/catalog/admin/includes/modules/pages/products.php
trunk/catalog/admin/includes/modules/products/header_tags.php
trunk/catalog/advanced_search.php
trunk/catalog/common/class.interfaces.php
trunk/catalog/common/classes/DataTypes.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_diver.php
trunk/catalog/common/classes/datatype_drivers/Data_featured.php
trunk/catalog/common/classes/datatype_drivers/Data_home.php
trunk/catalog/common/classes/datatype_drivers/Data_product.php
trunk/catalog/common/classes/shoppingCart.php
trunk/catalog/includes/application_top.php
trunk/catalog/includes/classes/AbstractAcaModule.php
trunk/catalog/includes/classes/core_page/listing.php
trunk/catalog/includes/classes/drivers/data/categorie.php
trunk/catalog/includes/classes/drivers/data/content.php
trunk/catalog/includes/classes/drivers/data/product.php
trunk/catalog/includes/functions/general.php
trunk/catalog/includes/modules/also_purchased_products.php
trunk/catalog/includes/modules/listing.php
trunk/catalog/includes/modules/listing_cat.php
trunk/catalog/includes/modules/new_products.php
trunk/catalog/index.php
trunk/catalog/templates/defaut/cfg/init.php
trunk/catalog/templates/defaut/includes/boxes/best_sellers.php
trunk/catalog/templates/defaut/includes/boxes/myaccount.php
trunk/catalog/templates/defaut/includes/boxes/shopping_cart_short.php
trunk/catalog/templates/defaut/includes/boxes/very_viewed.php
trunk/catalog/templates/defaut/includes/boxes/whats_new.php
trunk/catalog/templates/defaut/includes/js/advanced_search.js.php
Removed Paths:
-------------
trunk/catalog/includes/modules/product_listing.php
Modified: trunk/catalog/admin/includes/classes/SqlFilesDataDriverClass.php
===================================================================
--- trunk/catalog/admin/includes/classes/SqlFilesDataDriverClass.php 2014-01-21 09:17:22 UTC (rev 5057)
+++ trunk/catalog/admin/includes/classes/SqlFilesDataDriverClass.php 2014-01-22 00:15:28 UTC (rev 5058)
@@ -58,7 +58,7 @@
public function init(){
self::$DataDriverType = substr(get_class($this), 3);
-
+
if($this->use_modules) {
self::$modules=new AcaFactory(self::$DataDriverType);
self::$modules->set_image_handler();
@@ -75,7 +75,10 @@
return self::$_instance;
}
-
+ public static function ResetInstance() {
+ self::$_instance = new self();
+ return self::$_instance;
+ }
/**
@brief Check image cat and add or /delete
@@ -166,9 +169,7 @@
/**
@fn SetsqlArray($sql_array)
@brief
- @param $specimen array obtain, by method specimen
- @param $dataarray array is selected by ExtractDataForm, result of $_POST/$_GET and existed in specimen
- @param $post array result all GET/POST posted in form for exploit by another modules
+ @param $specimen array obtain, by method specimen
@return none
*/
public static function PrepaDataAfterUse( $specimen , $dataarray, $post ){
@@ -202,7 +203,7 @@
/**
@fn GetSqlArray()
- @brief Get current array data Master table
+ @brief
@return array
*/
public static function GetSqlArray() {
@@ -211,7 +212,7 @@
/**
@fn GetSqlArrayLg()
- @brief Get current array data Master table and depend of language
+ @brief
@return array
*/
public static function GetSqlArrayLg() {
Modified: trunk/catalog/admin/includes/classes/aca.php
===================================================================
--- trunk/catalog/admin/includes/classes/aca.php 2014-01-21 09:17:22 UTC (rev 5057)
+++ trunk/catalog/admin/includes/classes/aca.php 2014-01-22 00:15:28 UTC (rev 5058)
@@ -88,7 +88,7 @@
/**
Load each module parameters from database
*/
- public function load_db_values ($Id) {
+ public function load_db_values($Id) {
global $language, $languages_id;
$this->generic_id=$Id;
$return = array();
@@ -117,11 +117,6 @@
}
- public function display_image_preview (){
- // Returns the image path and name to show in the product preview
- return $this->modules[$this->image_handler]->display_image_preview ();
- }
-
}
Modified: trunk/catalog/admin/includes/classes/drivers/productsACA.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/productsACA.php 2014-01-21 09:17:22 UTC (rev 5057)
+++ trunk/catalog/admin/includes/classes/drivers/productsACA.php 2014-01-22 00:15:28 UTC (rev 5058)
@@ -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.1
+ @version 2.2.2
@date 01/01/2012, 18:17
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
@@ -18,9 +18,9 @@
@class productsACA
*/
class productsACA
- extends aca
- implements mod_aca{
- public $modules=array();
+ extends AcaFactory
+ /*implements mod_aca*/{
+
public $products_id;
public $image_handler;
@@ -71,7 +71,6 @@
unset($list_mod);
}
unset($cl);
-
}
@@ -189,9 +188,11 @@
/**
*/
public function after_update ($Id){
+ var_dump($products_id);
foreach ($this->modules as $key=>$module) {
+ echo $key;
if (($module->enabled) and (method_exists($module,'after_update' )))
- $this->modules[$key]->after_update($Id);
+ $this->modules[$key]->after_update($Id);
}
$languages = tep_get_languages();
for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
Modified: trunk/catalog/admin/includes/classes/drivers/sqlcategorie.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlcategorie.php 2014-01-21 09:17:22 UTC (rev 5057)
+++ trunk/catalog/admin/includes/classes/drivers/sqlcategorie.php 2014-01-22 00:15:28 UTC (rev 5058)
@@ -38,7 +38,7 @@
*/
public function init(){
self::$DataDriverType = 'categories';
-
+
if($this->use_modules) {
self::$modules=new AcaFactory(self::$DataDriverType,'MODULE_ACACAT_INSTALLED_BO');
self::$modules->set_image_handler();
@@ -56,10 +56,11 @@
new self();
$DB=Database::getInstance();
$error=0;
+ $modules = self::$modules;
if( isset($option['post']) ){
$post = $option['post'];
- self::$modules->load_post_values($post);
+ $modules->load_post_values($post);
}
$list_languages=tep_get_languages();
@@ -69,7 +70,7 @@
if(isset($option['post'])){
$post=$option['post'];
// Put post value
- self::$modules->load_post_values($post);
+ $modules->load_post_values($post);
}
$dataarray =(isset($option['sqlarray'])? $option['sqlarray'] : array() );
@@ -80,7 +81,7 @@
if(count($sql_data_array) > 0){
- self::$modules->get_insert_table_categories($sql_data_array,'');
+ $modules->get_insert_table_categories($sql_data_array,'');
$res=tep_db_perform(TABLE_CATEGORIES, $sql_data_array);
@@ -119,13 +120,13 @@
$insert_sql_data = array('categories_id' => $categories_id,
'language_id' => $list_languages[$i]['id']);
$sql_data_array = array_merge($sql_data_array, $insert_sql_data);
- $sql_data_array = array_merge($sql_data_array,self::$modules->get_insert_table_categories_description (array(),$list_languages[$i]['id']));
+ $sql_data_array = array_merge($sql_data_array,$modules->get_insert_table_categories_description (array(),$list_languages[$i]['id']));
$res=tep_db_perform(TABLE_CATEGORIES_DESCRIPTION, $sql_data_array);
}
/// Child module, Call After Update process
- self::$modules->after_update($categories_id);
+ $modules->after_update($categories_id);
if( $error > 0){
@@ -147,7 +148,8 @@
new self();
$DB=Database::getInstance();
$error= 0;
-
+ $modules = self::$modules;
+
if( ! isset($option['id']) )
return false;
else
@@ -164,7 +166,7 @@
if(isset($option['post'])){
$post=$option['post'];
// Put post value
- self::$modules->load_post_values($post);
+ $modules->load_post_values($post);
}
$dataarray =(isset($option['sqlarray'])? $option['sqlarray'] : array() );
@@ -172,16 +174,19 @@
$sql_data_array = self::GetSqlArray();
-
-
+
$DB->beginTransaction();
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['categories_cpath'] = categorieUtility::get_generated_category_path_ids($id,'category');
$sql_data_array['last_modified'] = 'now()';
// $sql_data_array['user_modified'] = (int)@$_SESSION['login_id'];
-
- foreach((array)self::$modules->get_update_table_categories($id, $sql_data_array) as $module=>$value)
+
+ foreach((array)$modules->get_update_table_categories($id, $sql_data_array) as $module=>$value)
if(is_array($value))
foreach($value as $key=>$row)
$sql_data_array[$key] = $row;
@@ -213,7 +218,7 @@
elseif(!empty($categories_desc_array) && is_string($categories_desc_array))
$sql_data_array['categories_description'] = tep_db_prepare_input($categories_desc_array);
- $tabl=self::$modules->get_update_table_categories_description ($list_languages[$i]['id']);
+ $tabl=$modules->get_update_table_categories_description ($list_languages[$i]['id']);
$sql_data_array = array_merge($sql_data_array, $tabl);
if(count($sql_data_array) > 0)
@@ -229,7 +234,7 @@
/// Child module, Call After Update process
- self::$modules->after_update($id);
+ $modules->after_update($id);
if( $error > 0){
@@ -272,8 +277,8 @@
$DB=Database::getInstance();
$languages_id = 0;
+ $modules = self::$modules;
-
$sql ="";
$sort="";
@@ -327,7 +332,7 @@
$result['cPath'] = categorieUtility::get_generated_category_path_ids( (int) $result['categories_id'] );
/// Childs module load
- self::$modules->load_db_values((int) $result['categories_id']);
+ $modules->load_db_values((int) $result['categories_id']);
return ((!$shortkey)? $result : self::CleanKey($result));
}
@@ -359,7 +364,7 @@
$result['cPath'] = categorieUtility::get_generated_category_path_ids( (int) $result['categories_id'] );
/// Childs module load
- self::$modules->load_db_values( (int) $result['categories_id'] );
+ $modules->load_db_values( (int) $result['categories_id'] );
$array[]= ((!$shortkey)? $result : self::CleanKey($result));
}
Modified: trunk/catalog/admin/includes/classes/drivers/sqlcontent.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlcontent.php 2014-01-21 09:17:22 UTC (rev 5057)
+++ trunk/catalog/admin/includes/classes/drivers/sqlcontent.php 2014-01-22 00:15:28 UTC (rev 5058)
@@ -38,10 +38,11 @@
$DB=Database::getInstance();
$error=0;
$post = array();
+ $modules = self::$modules;
if( isset($option['post']) ){
$post = $option['post'];
- self::$modules->load_post_values($post);
+ $modules->load_post_values($post);
}
$list_languages=tep_get_languages();
@@ -94,7 +95,7 @@
}
- self::$modules->create($content_id);
+ $modules->create($content_id);
if( $error > 0){
$DB->rollbackTransaction();
@@ -122,11 +123,11 @@
$error=0;
$languages_id = @$option['language_id'];
$where ='';
-
+ $modules = self::$modules;
if( isset($option['post']) ){
$post = $option['post'];
- self::$modules->load_post_values($post);
+ $modules->load_post_values($post);
}
$list_languages=tep_get_languages();
@@ -143,7 +144,7 @@
- $sql_data_array = array_merge($sql_data_array, self::$modules->get_update_table_content());
+ $sql_data_array = array_merge($sql_data_array, $modules->get_update_table_content());
if(count($sql_data_array) > 0 )
if ( ! tep_db_perform(TABLE_CONTENT, $sql_data_array, 'update', "content_id = '" . (int)$content_id . "'") )
$error++;
@@ -170,14 +171,14 @@
$sql_data_array['content_title'] = tep_db_prepare_input($post['cms_content']['content_title']) ;
- $sql_data_array = array_merge($sql_data_array, self::$modules->get_update_table_content_description ($language_id));
+ $sql_data_array = array_merge($sql_data_array, $modules->get_update_table_content_description ($language_id));
if(count($sql_data_array) > 0)
if( ! tep_db_perform(TABLE_CONTENT_DESCRIPTION, $sql_data_array, 'update', "content_id = '" . (int)$content_id . "' and language_id = '" . (int)$language_id . "'") )
$error++;
}
- self::$modules->after_update ($content_id);
+ $modules->after_update ($content_id);
if( $error > 0){
$DB->rollbackTransaction();
@@ -218,6 +219,7 @@
$error= 0;
$result=array();
+ $modules = self::$modules;
// $languages_id = $option['language_id'];
$cat_list =array();
@@ -291,7 +293,7 @@
$row = array_merge($row,$r);
- $row['mod'] = self::$modules->fetch(array('content_id'=>$row['content_id'], 'shortkey'=>$shortkey));
+ $row['mod'] = $modules->fetch(array('content_id'=>$row['content_id'], 'shortkey'=>$shortkey));
// put all val origin module in current result
foreach($row['mod'] as $submod=>$array)
@@ -326,7 +328,7 @@
new self();
$DB=Database::getInstance();
-
+ $modules = self::$modules;
$res = false;
$product_categories = array();
@@ -352,7 +354,7 @@
if ($product_categories['total'] == '0') {
- self::$modules->delete($cms_id);
+ $modules->delete($cms_id);
// childs tables
$DB->query("delete from " . TABLE_CONTENT_DESCRIPTION . " where content_id = '" . (int)$cms_id . "'");
Modified: trunk/catalog/admin/includes/classes/drivers/sqlproduct.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlproduct.php 2014-01-21 09:17:22 UTC (rev 5057)
+++ trunk/catalog/admin/includes/classes/drivers/sqlproduct.php 2014-01-22 00:15:28 UTC (rev 5058)
@@ -30,14 +30,13 @@
@brief for init subchilds and other option
*/
public function init(){
- self::$DataDriverType = 'products';
+ self::$DataDriverType = 'product';
if($this->use_modules) {
self::$modules=new productsACA;
self::$modules->set_image_handler();
}
-
-// print_r(self::$modules);
+
}
/**
@@ -51,6 +50,7 @@
new self();
$DB=Database::getInstance();
$error=0;
+ $modules = self::$modules;
// if(!isset($option['key'])) return 'key';
$DB->beginTransaction();
@@ -113,6 +113,7 @@
new self();
$DB=Database::getInstance();
$error=0;
+ $modules = self::$modules;
if(!isset($option['id']))
return false;
@@ -143,7 +144,7 @@
}
/// Call ACA module put post var
- self::$modules->load_post_values($post);
+ $modules->load_post_values($post);
$DB->beginTransaction();
@@ -152,7 +153,7 @@
*/
$sql_data_array['products_last_modified'] ='now()';
- $sql_data_array = array_merge($sql_data_array, self::$modules->get_update_table_products());
+ $sql_data_array = array_merge($sql_data_array, $modules->get_update_table_products());
if( ! tep_db_perform(TABLE_PRODUCTS, $sql_data_array, 'update',"products_id = '" . (int)$products_id . "'") )
$error++;
@@ -170,28 +171,30 @@
}
- /// Separate Pricing Per Customer
- $customers_group_query = $DB->query("select customers_group_id, customers_group_name from " . TABLE_CUSTOMERS_GROUPS . " where customers_group_id != '0' order by customers_group_id");
- // Gets all of the customers groups
- while ($customers_group = tep_db_fetch_array($customers_group_query)){
+ if($error ==0 ) {
+ /// Separate Pricing Per Customer
+ $customers_group_query = $DB->query("select customers_group_id, customers_group_name from " . TABLE_CUSTOMERS_GROUPS . " where customers_group_id != '0' order by customers_group_id");
+ // Gets all of the customers groups
+ while ($customers_group = tep_db_fetch_array($customers_group_query)){
- $attributes_query = $DB->query("select customers_group_price from " . TABLE_PRODUCTS_GROUPS . " where products_id = '" . $products_id . "' and customers_group_id = '" . $customers_group['customers_group_id'] . "'");
- $attributes = tep_db_fetch_array($attributes_query);
+ $attributes_query = $DB->query("select customers_group_price from " . TABLE_PRODUCTS_GROUPS . " where products_id = '" . $products_id . "' and customers_group_id = '" . $customers_group['customers_group_id'] . "'");
+ $attributes = tep_db_fetch_array($attributes_query);
- if (tep_db_num_rows($attributes_query) > 0) {
- if (isset($post['sppcoption'][$customers_group['customers_group_id']]) && isset($post['sppcprice'][$customers_group['customers_group_id']]) && $post['sppcprice'][$customers_group['customers_group_id']]!= '') {
- // this is checking if the check box is checked and the price is not null
- if ( $_POST['sppcprice'][$customers_group['customers_group_id']] != $attributes['customers_group_price'])
- $DB->query("update " . TABLE_PRODUCTS_GROUPS . " set customers_group_price = '" . $post['sppcprice'][$customers_group['customers_group_id']] . "' where customers_group_id = '" . $customers_group['customers_group_id'] . "' and products_id = '" . $products_id . "'");
+ if (tep_db_num_rows($attributes_query) > 0) {
+ if (isset($post['sppcoption'][$customers_group['customers_group_id']]) && isset($post['sppcprice'][$customers_group['customers_group_id']]) && $post['sppcprice'][$customers_group['customers_group_id']]!= '') {
+ // this is checking if the check box is checked and the price is not null
+ if ( $_POST['sppcprice'][$customers_group['customers_group_id']] != $attributes['customers_group_price'])
+ $DB->query("update " . TABLE_PRODUCTS_GROUPS . " set customers_group_price = '" . $post['sppcprice'][$customers_group['customers_group_id']] . "' where customers_group_id = '" . $customers_group['customers_group_id'] . "' and products_id = '" . $products_id . "'");
+ }
+ else
+ $DB->query("delete from " . TABLE_PRODUCTS_GROUPS . " where customers_group_id = '" . $customers_group['customers_group_id'] . "' and products_id = '" . $products_id . "'");
}
- else
- $DB->query("delete from " . TABLE_PRODUCTS_GROUPS . " where customers_group_id = '" . $customers_group['customers_group_id'] . "' and products_id = '" . $products_id . "'");
- }
- elseif (isset($_POST['sppcoption'][$customers_group['customers_group_id']]) && isset($post['sppcprice'][$customers_group['customers_group_id']]) && $post['sppcprice'][$customers_group['customers_group_id']] != '')
- $DB->query("insert into " . TABLE_PRODUCTS_GROUPS . " (products_id, customers_group_id, customers_group_price) values ('" . $products_id . "', '" . $customers_group['customers_group_id'] . "', '" . $post['sppcprice'][$customers_group['customers_group_id']] . "')");
- }
+ elseif (isset($_POST['sppcoption'][$customers_group['customers_group_id']]) && isset($post['sppcprice'][$customers_group['customers_group_id']]) && $post['sppcprice'][$customers_group['customers_group_id']] != '')
+ $DB->query("insert into " . TABLE_PRODUCTS_GROUPS . " (products_id, customers_group_id, customers_group_price) values ('" . $products_id . "', '" . $customers_group['customers_group_id'] . "', '" . $post['sppcprice'][$customers_group['customers_group_id']] . "')");
+ }
+ }
+
-
/// mutli-languages process
for ($i=0, $n=sizeof($list_languages); $i<$n; $i++) {
@@ -221,10 +224,10 @@
}
}
+
/// Call ACA module after update
- self::$modules->after_update ($products_id);
+ $modules->after_update($products_id) ;
-
if( $error > 0){
$DB->rollbackTransaction();
return false;
@@ -262,6 +265,7 @@
new self();
$DB=Database::getInstance();
+ $modules = self::$modules;
// $price=price::getInstance();
$cat_list =array();
@@ -364,7 +368,7 @@
//<!-- EOF Separate Pricing Per Customer -->
- $product['mod'] = self::$modules->fetch(array('products_id'=>$ID, 'shortkey'=>$shortkey));
+ $product['mod'] = $modules->fetch(array('products_id'=>$ID, 'shortkey'=>$shortkey));
// put all val origin module in current result
foreach($product['mod'] as $submod=>$array)
@@ -384,7 +388,7 @@
new self();
$DB=Database::getInstance();
-
+ $modules = self::$modules;
$res = false;
$product_categories = array();
@@ -412,7 +416,7 @@
if ($product_categories['total'] == '0') {
- self::$modules->delete($product_id);
+ $modules->delete($product_id);
$res=tep_remove_product($product_id);
}
@@ -497,9 +501,9 @@
new self();
$DB=Database::getInstance();
+ $modules = self::$modules;
-
$product_query = $DB->query($sql = "select products_type, products_quantity, products_model, products_image, products_price, products_date_available, products_weight, products_tax_class_id, manufacturers_id from " . TABLE_PRODUCTS . " where products_id = '" . $pid . "'");
$product = $product_query->fetchAssoc();
@@ -553,7 +557,7 @@
sqlproductattribute::copyto($pid, $dup_products_id);
// ACA START DUPLICATE PRODUCT
- self::$modules->duplicate_product($pid,$dup_products_id);
+ $modules->duplicate_product($pid,$dup_products_id);
return $dup_products_id;
Modified: trunk/catalog/admin/includes/classes/modulesUtility.php
===================================================================
--- trunk/catalog/admin/includes/classes/modulesUtility.php 2014-01-21 09:17:22 UTC (rev 5057)
+++ trunk/catalog/admin/includes/classes/modulesUtility.php 2014-01-22 00:15:28 UTC (rev 5058)
@@ -22,6 +22,7 @@
// retor compatibilite
self::$pathType['products']=array('key'=>'MODULE_ACAPRO_INSTALLED', 'value'=>MODULE_ACAPRO_INSTALLED,'key_BO'=>'MODULE_ACAPRO_INSTALLED_BO', 'value_BO'=>MODULE_ACAPRO_INSTALLED_BO,'module_directory'=> 'products/','module_language'=>DIR_FS_ADMIN.DIR_WS_LANGUAGES, 'prefix'=>'' );
+ self::$pathType['categories']=array('key'=>'MODULE_ACACAT_INSTALLED', 'value'=>MODULE_ACACAT_INSTALLED,'key_BO'=>'MODULE_ACACAT_INSTALLED_BO', 'value_BO'=>MODULE_ACACAT_INSTALLED_BO,'module_directory'=> 'categories/','module_language'=>DIR_FS_ADMIN.DIR_WS_LANGUAGES, 'prefix'=>'' );
self::$pathType['product']=self::$pathType['products'];
}
@@ -108,7 +109,6 @@
$oscss->pile_file_lang(DIR_FS_ADMIN.DIR_WS_LANGUAGES.$language.'/modules/'.$type . '/' .$r->detail->filelg.'.txt');
$oscss->pile_file_lang(DIR_FS_CATALOG.DIR_WS_LANGUAGES.$language.'/modules/'.$type . '/' .$r->detail->filelg.'.txt');
-
if(isset($r->detail->path_BO) && file_exists($r->detail->path_BO.$r->detail->filemod))
include_once($r->detail->path_BO.$r->detail->filemod);
else
@@ -162,7 +162,7 @@
$class=$fil;
$code=strtoupper($class);
-
+
if (file_exists($ref_admin.$file))
$_obj->path_BO=$ref_admin;
if(file_exists($ref_shop.$file))
Modified: trunk/catalog/admin/includes/modules/configuration/datatypecategorie.php
===================================================================
--- trunk/catalog/admin/includes/modules/configuration/datatypecategorie.php 2014-01-21 09:17:22 UTC (rev 5057)
+++ trunk/catalog/admin/includes/modules/configuration/datatypecategorie.php 2014-01-22 00:15:28 UTC (rev 5058)
@@ -107,12 +107,12 @@
// mise a jour
if(isset($_POST['types']) && is_array($_POST['types']) ){
$new_flag_virtual = '';
- $status = sqlstatus::fetch(array('type'=>'categorie'), true);
+ $status = sqlstatus::fetch(array('type'=>'categories'), true);
foreach($status as $key=>$rows ) {
$data_array = array(
- 'type'=>'categorie',
+ 'type'=>'categories',
'id'=>$rows->id,
'status'=>(isset($_POST['types']['active'][$rows->id])? 1 : 0 ),
);
@@ -141,7 +141,7 @@
// ajout d'un type de produits
// if(isset($_POST['name_0']) && tep_not_null($_POST['name_0']) ){
// $sql_data = array(
-// 'type'=>'categorie',
+// 'type'=>'categories',
// 'name'=>(string)tep_db_prepare_input($_POST['name_0']),
// 'status'=>0,
// );
@@ -162,20 +162,21 @@
if(isset($_GET['flag'])){
-
+// sqlcategorie::getInstance();
+
$mod=tep_db_prepare_input($_GET['mod']);
$flag=(int)tep_db_prepare_input($_GET['flag']);
// call type module
- $typeOri=modulesUtility::GetModttype('categorie');
-
+ $typeOri=modulesUtility::GetModttype('categories');
+var_dump($typeOri);
// get current value
$current = sqlconfiguration::fetch(array('key'=>$typeOri->key), true);
$current_bo = sqlconfiguration::fetch(array('key'=>$typeOri->key_BO), true);
// call
- $type=modulesUtility::LoadModule('categorie',$mod.'.php');
+ $type=modulesUtility::LoadModule('categories',$mod.'.php');
// force install
if( $flag ==1 && !$type->content->check()){
$type->content->remove();
@@ -214,7 +215,7 @@
$mod=tep_db_prepare_input($_GET['mod']);
// call
- $Mod=modulesUtility::LoadModule('categorie',$mod.'.php');
+ $Mod=modulesUtility::LoadModule('categories',$mod.'.php');
$ModCurr = $Mod->content;
$i=0;
foreach($ModCurr->keys() as $value){
@@ -287,7 +288,7 @@
- $li = sqlstatus::fetch(array('type'=>'categorie', 'language_id'=>$languages_id), true);
+ $li = sqlstatus::fetch(array('type'=>'categories', 'language_id'=>$languages_id), true);
if(is_object($li))
$li = array($li);
@@ -375,7 +376,7 @@
CsrtAction::getFormat('row_action'),
'',
(($row->status)
- ? sprintf(CsrtAction::getLink('row_action_right', __('image config'), 'config'), '', tep_href_link(FILENAME_CONFIGURATION, 'FILENAME_CFG_45'.'action=modules-edit&mod='.$row->content->code ),'' )
+ ? sprintf(CsrtAction::getLink('row_action_right', __('image config'), 'config'), '', tep_href_link(FILENAME_CONFIGURATION, FILENAME_CFG_45.'action=modules-edit&mod='.$row->content->code ),'' )
: ''
)
);
@@ -388,7 +389,7 @@
*/
public static function GetStatusMod($row){
$exclude=array('action','mod','forceajax','type','class','function','funct', 'mod');
- $query_s='FILENAME_CFG_45'.'action=modules&mod=' . $row->content->code.'&flag=';
+ $query_s=FILENAME_CFG_45.'action=modules&mod=' . $row->content->code.'&flag=';
return '<a class="ajaxinline" href="' . tep_href_link(FILENAME_CONFIGURATION, tep_get_all_get_params($exclude).$query_s.(($row->status == '1')? '0' : '1') ) . '">'.
sprintf(
Modified: trunk/catalog/admin/includes/modules/pages/categories.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/categories.php 2014-01-21 09:17:22 UTC (rev 5057)
+++ trunk/catalog/admin/includes/modules/pages/categories.php 2014-01-22 00:15:28 UTC (rev 5058)
@@ -85,6 +85,7 @@
/**
TODO : remplacer le nom de constante par un MODULE_CATEGORIES_INSTALLED_BO
*/
+
self::$modules=new AcaFactory('categories','MODULE_ACACAT_INSTALLED_BO');
self::$modules->set_image_handler();
@@ -93,7 +94,7 @@
// construct list datatype possible
$DT = DataTypes::getInstance();
- $dt = array( array('id'=>'', 'text'=>__('input datatype value none') ) );
+ $dt = array( array('id'=>'-1', 'text'=>__('input datatype value none') ) );
foreach($DT->GetTypeForRootListing() as $k=>$row)
$dt[] = array('id'=>$row, 'text'=>$row );
// construct list cats parent
@@ -191,7 +192,7 @@
'sort'=>true,
'alias'=>'datatype',
'text'=>__('categories table heading datatype'),
- 'width'=>'5%',
+ 'width'=>'8%',
'edit'=>array(
'input_name'=>'categories_datatype',
'input_type'=>'select',
Modified: trunk/catalog/admin/includes/modules/pages/products.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/products.php 2014-01-21 09:17:22 UTC (rev 5057)
+++ trunk/catalog/admin/includes/modules/pages/products.php 2014-01-22 00:15:28 UTC (rev 5058)
@@ -1357,6 +1357,9 @@
$_query = $DB->query($query_raw);
+
+ if(!$_query)
+ return false;
$query_numrows = $_query->__get('numRows');
$_split = new splitPageResults($adjust->page, $adjust->rowbyp, $query_raw, $query_numrows);
Modified: trunk/catalog/admin/includes/modules/products/header_tags.php
===================================================================
--- trunk/catalog/admin/includes/modules/products/header_tags.php 2014-01-21 09:17:22 UTC (rev 5057)
+++ trunk/catalog/admin/includes/modules/products/header_tags.php 2014-01-22 00:15:28 UTC (rev 5058)
@@ -162,7 +162,6 @@
'shortkey' => boolean false
*/
public function fetch($option){
-
$id=$option[0]['products_id'];
$shortkey=$option[0]['shortkey'];
@@ -240,7 +239,7 @@
$arr['products_id'] = $Id;
$arr=array_merge(array('products_id'=>$Id) ,parent::load_db($Id, 'product') );
-// var_dump($arr);
+
self::$pInfo->objectInfo($arr);
return $arr;
Modified: trunk/catalog/advanced_search.php
===================================================================
--- trunk/catalog/advanced_search.php 2014-01-21 09:17:22 UTC (rev 5057)
+++ trunk/catalog/advanced_search.php 2014-01-22 00:15:28 UTC (rev 5058)
@@ -1,13 +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
* \package osCSS-2 <www http://www.oscss.org>
-* \version 2.1.1
+* \version 2.2.0
* \date 09/02/2012, 22:16
* \author oscim <mail aur...@os...> <www http://www.oscim.fr>
* \encode UTF-8
* \brief Page de Recherche avancé
-*
+* \file advanced_search.php
+
*/
require('includes/application_top.php');
@@ -45,10 +46,10 @@
global $keywords, $search_keywords;
$list = $dyntype->FO_load_page('search');
+//
+ $mast = DataTypes::GetLeftRoot($dyntype->DataType );
- $mast = DataTypes::GetLeftRoot($dyntype->DataType);
-
$tmp = array();
foreach($mast as $row)
$tmp[] = $row.'/advanced_search.other.input';
@@ -56,13 +57,17 @@
$tmp[]=$dyntype->DataType.'/advanced_search.other.input';
$page->add_var_page('childs_gab',$tmp);
+ $listing = DataTypes::GetListing('leftto', $dyntype->DataType);
- $listing_sql = 'SELECT DISTINCT '.$dyntype->listing_sql['col_count'] .
- ' '. $dyntype->listing_sql['tables'] .
- ' '. $dyntype->listing_sql['where'] .
- ' GROUP BY '. $dyntype->listing_sql['col_count'].
- ' ORDER BY '. $dyntype->listing_sql['sort'];
+ $listing_sql = 'SELECT DISTINCT '.
+ $listing['col_count'] . ' as id'.
+ ' '. sprintf($listing['tables'], $listing['col_count'] , $dyntype->DataType, $languages_id ).
+ ' '.$listing['where'];
+// ' '. sprintf($listing['where'], $listing['col_count'] , $dyntype->DataType, $languages_id ).
+ ' GROUP BY '. $listing['col_count'].
+ ' ORDER BY '. $listing['sort'];
+
$listing_split = new splitPageResults($listing_sql, $page->_conf_value('MAX_DISPLAY_SEARCH_RESULTS'), $dyntype->listing_sql['col_count'] );
$listing_query = $DB->query($listing_split->sql_query);
@@ -72,7 +77,8 @@
$page->post_init();
-
+ $page->javascript->add_framework("ext/jquery/jquery.min.js");
+
require($page->path_gabarit());
require(DIR_WS_INCLUDES . 'application_bottom.php');
Modified: trunk/catalog/common/class.interfaces.php
===================================================================
--- trunk/catalog/common/class.interfaces.php 2014-01-21 09:17:22 UTC (rev 5057)
+++ trunk/catalog/common/class.interfaces.php 2014-01-22 00:15:28 UTC (rev 5058)
@@ -1,9 +1,9 @@
<?php
/**
- @licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
+ @licence GPL 2005-2014 The osCSS developers - osCSS Open Source E-commerce
@portion code Copyright (c) 2002 osCommerce
@package osCSS-2 <www http://www.oscss.org>
- @version 2.1.1
+ @version 2.2.0
@date 15/04/2012, 22:44
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
@@ -12,6 +12,92 @@
/**
+ @Interface DataTypesData
+ @brief Base for Datatype Module
+ generic for all Datatype Module
+*/
+Interface DataTypesData{
+ /**
+ @brief sql for sitemap index
+ @param $mode le type de control (public)
+ @return true
+ */
+ function Sitemap($mode='public');
+
+ /**
+ @brief test si al page est du type produits
+ @param $mode le type de control (page/cpath/seo)
+ */
+ function is_type($mode='unique');
+
+ /**
+ @brief Prepare an retrun result Seo request
+ @param $mode string anchor key used
+ @param $subtype Not used
+ @param $id integer current id
+ @param $language_id integer current language id
+ @return array (
+ ID => '',
+ tName => '',
+ head_desc_tag => '',
+ head_keywords_tag =>''
+ )
+ */
+ public function SeoGetQuery($mode, $subtype, $id, $language_id);
+
+ /**
+ @fn FO_load_page($mode='unique')
+ @brief calcul du cpath specifique a ce type de donnée
+ @return
+ $mode
+ - default : none
+ - transversal : string page_content
+
+ */
+ function FO_load_page();
+}
+
+
+/**
+ @Interface DataTypesChildListing
+ @brief Specific for childs datatype link to Rootlisting
+*/
+
+interface DataTypesChildListing {
+
+
+ /**
+ @brief Prepare an dgenere all cache for divers
+ */
+ public function SeoCacheQuery(/*$language_id*/);
+}
+
+
+/**
+ @Interface DataTypesRootListing
+ @brief Specific for Rootlisting Datatype
+*/
+Interface DataTypesRootListing{
+ /**
+ @brief calcul du cpath specifique a ce tyep de donnée
+ */
+ function GetcPath();
+
+ /**
+ @brief chargement des données transversal
+ @param $listing object page driver listing
+ @param $type string name childs type for listing
+ @param subtype object childs DataType
+ @return false KO , true OK
+ */
+ function FO_load_listing(listing $listing, DataTypesChildListing $subtype, $type);
+}
+
+
+
+
+
+/**
@interface InterfaceModule
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
Interface class pour tous les modules
Modified: trunk/catalog/common/classes/DataTypes.php
===================================================================
--- trunk/catalog/common/classes/DataTypes.php 2014-01-21 09:17:22 UTC (rev 5057)
+++ trunk/catalog/common/classes/DataTypes.php 2014-01-22 00:15:28 UTC (rev 5058)
@@ -8,7 +8,6 @@
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
@dir /common/classes
- @file DataTypes.php
@section AA Modifications made:
@li 2012 - Created by oscim
@@ -61,8 +60,14 @@
@var all type actived in conf stocked in array value
*/
public static $type_actived = array();
-
+
/**
+ @var array stock listing requet sql
+ */
+ public static $listing= array();
+
+
+ /**
@brief constructor
*/
protected function __construct($Cfg){
@@ -111,6 +116,7 @@
/**
@remarks add define TABLES_XXX for tables detailled in Datatype drivers
*/
+
foreach($define_table as $bydatatype){
foreach($bydatatype as $key=>$row)
if(!defined($key))
@@ -191,7 +197,6 @@
/**
- @fn GetTypeForRootListing()
@brief Get regle anchors in childs module for seo class
@note backoffice use
@return array all type datatypeDynamic for manage and adjust in BO
@@ -215,7 +220,6 @@
}
/**
- @fn GetRegHtaccess()
@brief Get all reg for htaccess based on datatype active
@note backoffice use
@return array for all contraint
@@ -352,6 +356,17 @@
return self::$_instance;
}
+ /**
+ @fn
+ @param
+ @return object or false
+ */
+ public static function GetDataType($class){
+ if(isset(self::$env->modlist['Data_'.$class] ))
+ return self::$env->modlist['Data_'.$class];
+
+ return false;
+ }
/**
@brief Return currenttype datatype
@note frontoffice use
@@ -418,11 +433,116 @@
return false;
}
+ /**
+ @fn CompletRequest
+ @brief
+ @note frontoffice use
+ @param $mode string leftto/
+ @return none
+ */
+ public static function CompletRequest($mode='leftto', $type=''){
+ self::getInstance();
+ if(empty($type))
+ $type = self::$subDataType;
+
+ $_m_obj = self::$env->modlist['Data_'.$type];
+ $listing = $_m_obj->listing_sql;
+
+ if(isset(self::$env->IvRootListing[$type]))
+ foreach(self::$env->IvRootListing[$type] as $class){
+
+ $class ='Data_'.$class;
+
+ if(
+ ( isset(self::$env->RootListing[$class]) && is_array(self::$env->RootListing[$class]) && count(self::$env->RootListing[$class])>0 )// this module is RootListing (manufacturer, categories)
+ ){
+ switch($mode){
+ case 'leftto':
+ $_obj = self::$env->modlist[$class];
+
+ if(method_exists($_obj, 'GetLinkTo')) {
+ $listi = $_obj->GetLinkTo( $type , $mode);
+
+// print_r($listi);
+ // if()
+ // $query
+// $listing['rows'] ='';
+ foreach(@$listi['rows'] as $key=>$array)
+ @$listing['rows'] .= ', '.$key . (isset($array['alias'])? ' as '.$array['alias']: '' ) ;
+
+ @$listing['tables'] .= @$listi['tables'];
+
+ @$listing['where'] .= @$listi['where'];
+ }
+ break;
+ }
+ }
+ }
+
+ if(count($listing) > 0 )
+ self::SetListing($listing,$mode, $type);
+
+ else
+ self::SetListing('error',$mode, $type);
+
+
+ }
+
/**
+ @brief Adjust data for construct linking in Data RootListing and childs Data
+ @param $listing array data listing_sql provider by Data->listing_sql
+ @param $mode string name of mode for exec linking
+ @param $type $type string name data or current data
+ */
+ protected static function SetListing($listing, $mode='leftto',$type=''){
+
+ if(empty($type))
+ $type = self::$subDataType;
+
+ self::$listing[$type][$mode] = $listing;
+
+ }
+
+ /**
+ @brief for construct new request use this methode
+ @param $mode string name of mode for exec linking
+ @param $type $type string name data or current data
+ @return $listing array
+ @example
+ $listing = DataTypes::GetListing('leftto', $type);
+
+ $query = 'SELECT DISTINCT '.
+ $listing['col_count'] . ' as id'.
+ ' , p.products_id '.
+ ' ' . sprintf($listing['tables'], $listing['col_count'] , $type, $languages_id ).
+ ' ' . $listing['where'].
+ '';
+
+ $query .= " GROUP BY p.products_id ";
+ $query .= " ORDER BY p.products_date_added desc limit " . $page->_conf_value('MAX_RANDOM_SELECT_NEW');
+
+ */
+ public static function GetListing( $mode='leftto',$type=''){
+
+ if(empty($type))
+ $type = self::$subDataType;
+
+ if(!isset(self::$listing[$type]) || !isset(self::$listing[$type][$mode]) )
+ DataTypes::CompletRequest( $mode, $type);
+
+ if(is_string(self::$listing[$type][$mode]) && self::$listing[$type][$mode] =='error')
+ return false ;
+
+ return self::$listing[$type][$mode];
+ }
+
+ /**
@brief call transversal load in other modules
@note frontoffice use
+ @param $listing object listing
@param $mode le type de control (page/cpath/seo)
+ @param $type string for forced type
@return false or object
*/
public static function transversal($mode='transversal', $type=''){
@@ -430,23 +550,23 @@
if(empty($type))
$type = self::$subDataType;
+
+ $listing=listing::getInstance();
foreach(self::$env->modlist as $class=>$module){
-
-
- if(isset(self::$env->RootListing[$class]) && is_array(self::$env->RootListing[$class]))
-
if(
( isset(self::$env->RootListing[$class]) && is_array(self::$env->RootListing[$class]) && count(self::$env->RootListing[$class])>0 )// this module is RootListing (manufacturer, categories)
&& in_array($type, $module->RootListing) // RootListing array require content current type
&& $module->is_type($mode) // is_type actif
-// && ( $module->DataType == $type )
){
- /*if( ! */$module->FO_load_listing($type, self::$env->modlist['Data_'.$type]);/* )*/
-// return false;
+ // Call context in load
+ if( ! $module->FO_load_listing($listing, self::$env->modlist['Data_'.$type], $type) )
+ tep_redirect(tep_href_link('','ServerError=404') );
- $module->FO_load_page($mode);
+
+ // call master load_page
+ return $module->FO_load_page($mode);
}
}
Modified: trunk/catalog/common/classes/datatype_drivers/Data_categorie.php
===================================================================
--- trunk/catalog/common/classes/datatype_drivers/Data_categorie.php 2014-01-21 09:17:22 UTC (rev 5057)
+++ trunk/catalog/common/classes/datatype_drivers/Data_categorie.php 2014-01-22 00:15:28 UTC (rev 5058)
@@ -10,7 +10,11 @@
@class Data_categorie
*/
-class Data_categorie {
+class Data_categorie
+ implements
+ DataTypesData,
+ DataTypesRootListing
+ {
/**
@var DataType string
@@ -64,7 +68,21 @@
*/
// public $ChildsType;
+ /**
+ @var string query formated for listing context
+ */
+ public $listing_query = '';
+ /**
+ @var string query sort formated for listing context
+ */
+ public $listing_query_sort = '';
+ /**
+ @var string query col master formated for listing context
+ */
+ public $listing_query_col_count = '';
+
+
/**
@brief constructor
@param next bool true for complete load , but use 2 call
@@ -74,6 +92,9 @@
+
+// $this->listing_sql['col_count'] = " ".$this->p.".categories_id ";
+
global $page,$language, $languages_id;
if(is_object($page))
if(($path_lg=$page->fix_file(DIR_WS_INCLUDES .'languages/'. $language . '/' . $this->DataType.'.txt',true)) !=false)
@@ -81,21 +102,66 @@
- /*
- @remarks Construct requet sql in /includes/class/drivers/data/ by sub chidls class
- this requet is dynamical construct
- */
- $this->listing_sql['leftto']['rows'] = array(
- "".$this->p."2c.categories_id"=>0,
- );
-
- $this->listing_sql['leftto']['tables'] = " LEFT JOIN ".DB_TABLE_PREFIX."%2\$s_to_categories ".$this->p."2c ON ( ".$this->p."2c.%2\$s_id = %1\$s ) ";
- $this->listing_sql['leftto']['tables'] .= " LEFT JOIN " . TABLE_CATEGORIES . " ".$this->p." ON ( ".$this->p."2c.categories_id = ".$this->p.".categories_id " .DataForceStatus(" AND ".$this->p.".categories_status='1' ") . ") ";
- $this->listing_sql['leftto']['tables'] .= " LEFT JOIN " . TABLE_CATEGORIES_DESCRIPTION . " ".$this->p."d ON( ".$this->p."d.categories_id = ".$this->p.".categories_id AND ".$this->p."d.language_id = '%3\$s' ) ";
+
}
/**
+ @brief this methode construct sql base for link in childs data
+ this categorie use sub tables nameofdata _ to_categories
+ For history this child data product, use 's' in name of table and name of cols
+ @param $type string name of child type
+ @param $mode string anchor key used
+ @return array
+ */
+ public function GetLinkTo($type, $mode='leftto'){
+
+ $type = DataTypes::GetDataType( $type );
+
+ $col = $type->listing_sql['col_count'];
+ $array_table= $type->db_tables;
+
+ foreach($array_table as $cst=>$table)
+ if(substr($cst, -14) == '_TO_CATEGORIES' )
+ $table_to_categories = $cst;
+
+
+
+ /*
+ @remarks Construct requet sql in /includes/class/drivers/data/ by sub chidls class
+ this requet is dynamical construct
+ */
+ $this->listing_sql['leftto']['rows'] = array(
+ "".$this->p."2c.categories_id"=>0,
+ );
+
+ $this->listing_sql['leftto']['tables'] = " LEFT JOIN ".constant($table_to_categories)." ".$this->p."2c ON ( ".$this->p."2c.".substr($col, strpos($col, '.')+1 )." = %1\$s ) ";
+ $this->listing_sql['leftto']['tables'] .= " LEFT JOIN " . TABLE_CATEGORIES . " ".$this->p." ON ( ".$this->p."2c.categories_id = ".$this->p.".categories_id " .DataForceStatus(" AND ".$this->p.".categories_status='1' ") . ") ";
+ $this->listing_sql['leftto']['tables'] .= " LEFT JOIN " . TABLE_CATEGORIES_DESCRIPTION . " ".$this->p."d ON( ".$this->p."d.categories_id = ".$this->p.".categories_id AND ".$this->p."d.language_id = '%3\$s' ) ";
+
+
+
+// var_dump($mode);
+ if (isset($_GET['categories_id']) && tep_not_null($_GET['categories_id'])) {
+ $list="'".(int)$_GET['categories_id']."' ,";
+
+ if (isset($_GET['inc_subcat']) && ($_GET['inc_subcat'] == '1')) {
+ $subcategories_array = array();
+ tep_get_subcategories($subcategories_array, $_GET['categories_id']);
+ for ($i=0, $n=sizeof($subcategories_array); $i<$n; $i++ ) {
+ $list .= " '" . (int)$subcategories_array[$i] . "' ,";
+ }
+ }
+// var_dump(" AND ".$this->p."2c.categories_id IN(".substr($list, 0,-1) . ")");
+ $this->listing_sql['leftto']['where'] .= " AND ".$this->p."2c.categories_id IN(".substr($list, 0,-1) . ")";
+ }
+
+ return $this->listing_sql['leftto'];
+ }
+
+
+
+ /**
@brief sql for sitemap index
@param $mode le type de control (public)
@return true
@@ -152,9 +218,15 @@
}
if ( ($count_cat=categorie::get_has_category_subcategories((int)$current_category_id)) && $count_cat > 0){
+
$category_depth = 'nested'; // navigate through the categories
$dd= explode(',', $categories->datatype);
+
$childs_type = $dd[0];
+
+ if( empty($childs_type) )
+ $childs_type = DATATYPES_DEFAULT_NOSELECTED;
+
DataTypes::ForceChilds($this->DataType,$childs_type);
}
// elseif($current_category_id==0)$category_depth = 'top';
@@ -190,7 +262,7 @@
}
}
- $page->add_var_page('category_depth',$category_depth);
+ $page->SetVar('category_depth',$category_depth);
}
break;
@@ -292,10 +364,12 @@
/**
@brief chargement des données transversal
+ @param $listing object page driver listing
@param $type string name childs type for listing
@param subtype object childs DataType
+ @return false KO , true OK
*/
- public function FO_load_listing($type, $subtype){
+ function FO_load_listing(listing $listing, DataTypesChildListing $subtype, $type){
global $current_category_id, $languages_id, $list;
$page = page::getInstance();
@@ -303,9 +377,15 @@
$category_depth = $page->GetVar('category_depth');
$current_category_id = $page->GetVar('current_category_id');
+ $breadcrumb=$page->return_object('breadcrumb');
+ //! Recup des element cat en cours
+ categorie::resetCacheId((int)$current_category_id);
$categories=categorie::get_item((int)$current_category_id);
+ if( ! is_object($categories) )
+ return false;
+
//! List des categorie enfant
$categories_query = $DB->query($sql="select c.categories_id from " . TABLE_CATEGORIES . " c where c.parent_id = '" . (int)$current_category_id . "' ".DataForceStatus(" AND c.categories_status='1' ")." ");
$lis="";
@@ -324,83 +404,17 @@
$this->listing_col_count
*/
- $sql_tmp = $subtype->listing_sql;
- if(!is_array($sql_tmp))
- return 'empty';
-
- $this->listing_sql =
- "SELECT DISTINCT ". $sql_tmp['col_count'] ." ".
- $sql_tmp['tables'] .
- " LEFT JOIN " . constant(strtoupper('TABLE_'.$type.'_TO_CATEGORIES')) . " ".$subtype->p."2c ON(".$subtype->p.".". $sql_tmp['base_key'] ." = ".$subtype->p."2c.". $sql_tmp['base_key'] ." ) ".
- " LEFT JOIN " . TABLE_CATEGORIES . " cat ON(cat.categories_id=".$subtype->p."2c.categories_id ".DataForceStatus(" AND cat.categories_status='1' ")." ) ".
- $sql_tmp['where'] .
- "";
- $this->listing_sort = $sql_tmp['sort'] ;
- $this->listing_col_count = $sql_tmp['col_count'] ;
-
- if($category_depth == 'nested'){
- $this->listing_sql .= (tep_not_null($list)? " AND ".$subtype->p."2c.categories_id IN (" . $list . ")" : '');
- $this->listing_sort = " cat.sort_order, ". $this->listing_sort ;
-
- // put dynamical sort for curent cat
- if(tep_not_null($categories->sortchids))
- $this->listing_sort = $categories->sortchids;
- }
- else{
- // put dynamical sort for childs curent datatype for this cat
- if(isset($categories->sortchids_datatype) && tep_not_null($categories->sortchids_datatype))
- $this->listing_sort = $categories->sortchids_datatype;
-
- $this->listing_sql .= " AND cat.categories_id = '" . (int)$current_category_id . "' ";
- }
- }
-
- /**
- @fn FO_load_page($mode='unique')
- @brief calcul du cpath specifique a ce type de donnée
- */
- public function FO_load_page($mode='unique'){
- global $page_content, $language, $cPath;
-
- $page = page::getInstance();
- $DB=Database::getInstance();
-
- switch(strtolower(DataTypes::$CurrentMode)){
- case 'transversal':
- case 'listing':
-
- $category_depth = $page->GetVar('category_depth');
- $current_category_id = $page->GetVar('current_category_id');
- $breadcrumb=$page->return_object('breadcrumb');
-
- //! Recup des element cat en cours
- categorie::resetCacheId((int)$current_category_id);
- if( ($categories=categorie::get_item((int)$current_category_id)) ==false){
- if($current_category_id !=0) $category_depth='nofound' ;
-
- $categories=new objectInfo(array());
- }
-
- //! List des categorie enfant
- $categories_query = $DB->query($sql="select c.categories_id from " . TABLE_CATEGORIES . " c where c.parent_id = '" . (int)$current_category_id . "' ".DataForceStatus(" AND c.categories_status='1' ")." ");
- $lis="'" . (int)$current_category_id . "', ";
- while ($cat= $categories_query->fetchAssoc() )
- $lis .="'".$cat['categories_id']."',";
-
- $categories->list=$list= $current_category_id;
-
+ $categories->list=$list;
$categories->products_total=(isset($count_p)? $count_p : 0 );
$categories->contents_total=(isset($count_c)?$count_c:0);
$categories->categories_total=(isset($count_cat)?$count_cat:0);
-
- unset($count_p,$count_c,$count_cat);
/**
Stock la categories en cours
@param array (categories_name, categories_description, categories_image, list,products_total,contents_total,categories_total )
*/
- $page->add_var_page('categories',$categories);
- $page->add_var_page('category_depth',$category_depth);
+ $page->SetVar('categorie',$categories);
+ $page->SetVar('category_depth',$category_depth);
/// add category names to the breadcrumb trail
$cPath_array = $page->GetVar('cPath_array');
@@ -418,17 +432,60 @@
$obj->type = $this->DataType ;
// $obj->gabarit = $this->DataType.'/listing.detail' ;
$obj->image = $categories->categories_image;
- $obj->name = $categories->categories_name;
+ $obj->name = $categories->title;
$obj->description = $categories->categories_description;
- $page->add_var_page('RootListing',$obj);
- $page->add_var_page('current_id',$current_category_id);
+ $page->SetVar('RootListing',$obj);
+ $page->SetVar('current_id',$current_category_id);
+ $page->SetVar('current_type','categorie');
+
+
+ if($category_depth == 'nested'){
+ if(tep_not_null($list))
+ $listing->QueryAddWhere( " AND ".$this->p."2c.categories_id IN (" . $list. ")");
+
+// $this->listing_query_sort = " cat.sort_order, ". $this->listing_sort ;
+
+ // put dynamical sort for curent cat
+// if(tep_not_null($categories->sortchids))
+// $this->listing_query_sort = $categories->sortchids;
+ }
+ else{
+
+ // put dynamical sort for childs curent datatype for this cat
+// if(isset($categories->sortchids_datatype) && tep_not_null($categories->sortchids_datatype))
+// $this->listing_query_sort = $categories->sortchids_datatype;
+
+ $listing->QueryAddWhere( " AND ".$this->p."2c.categories_id = '" . (int)$categories->id . "'");
+ }
+
+ return true;
+ }
+
+ /**
+ @fn FO_load_page($mode='unique')
+ @brief calcul du cpath specifique a ce type de donnée
+ @return
+ $mode
+ - default : none
+ - transversal : string page_content
+
+ */
+ public function FO_load_page($mode='unique'){
+ global $page_content, $language, $cPath;
+
+ $page = page::getInstance();
+ $DB=Database::getInstance();
+
+ switch(strtolower(DataTypes::$CurrentMode)){
+ case 'transversal':
+ case 'listing':
+// return 'default.php';
break;
case 'unique':
-
break;
}
Modified: trunk/catalog/common/classes/datatype_drivers/Data_content.php
===================================================================
--- trunk/catalog/common/classes/datatype_drivers/Data_content.php 2014-01-21 09:17:22 UTC (rev 5057)
+++ trunk/catalog/common/classes/datatype_drivers/Data_content.php 2014-01-22 00:15:28 UTC (rev 5058)
@@ -11,7 +11,11 @@
@brief This class is base datatype for content
*/
-class Data_content {
+class Data_content
+ implements
+ DataTypesData,
+ DataTypesChildListing
+ {
/**
@@ -67,7 +71,7 @@
*/
function __construct($next=false){
global $languages_id;
-
+ if($next) {
$this->listing_sql['tables'] = " FROM " . TABLE_CONTENT . " ".$this->p." ".
" LEFT JOIN " . TABLE_CONTENT_DESCRIPTION . " ".$this->p."d ON( ".$this->p."d.content_id = ".$this->p.".content_id AND ".$this->p."d.language_id = '" . (int)$languages_id . "' ) ".
"";
@@ -88,6 +92,7 @@
if(is_object($page))
if(($path_lg=$page->fix_file(DIR_WS_INCLUDES .'languages/'. $language . '/' . $this->DataType.'.txt',true)) !=false)
$page->pile_file_lang($path_lg);
+ }
}
@@ -237,38 +242,16 @@
$this->listing_sql['tables'] = " FROM " . TABLE_CONTENT . " ".$this->p." ";
$this->listing_sql['tables'] .=" LEFT JOIN " . TABLE_CONTENT_DESCRIPTION . " ".$this->p."d ON(".$this->p.".content_id = ".$this->p."d.content_id AND ".$this->p."d.language_id = '" . (int)$languages_id . "' ) ";
- $this->listing_sql['tables'] .=" LEFT JOIN " . TABLE_CONTENT_TO_CATEGORIES . " ".$this->p."2c ON(".$this->p."2c.content_id = ".$this->p.".content_id) ";
- $this->listing_sql['tables'] .= " LEFT JOIN " . TABLE_CATEGORIES . " cat ON( ".$this->p."2c.categories_id = cat.categories_id and cat.categories_status='1' ) ";
-
-
/// Add search in Extra value
- $this->listing_sql['tables'] .= " LEFT JOIN " . TABLE_EXTRA_FIELDS_TO . " p2pef ON(p2pef.data_id = p.products_id AND p2pef.data_type = 'content') ";
-
+ $this->listing_sql['tables'] .= " LEFT JOIN " . TABLE_EXTRA_FIELDS_TO . " ".$this->p."2pef ON(".$this->p."2pef.data_id = ".$this->p.".content_id AND ".$this->p."2pef.data_type = 'content') ";
+
if(in_array(true, (array)$use_value_list))
- $this->listing_sql['tables'] .= " LEFT JOIN " . TABLE_EXTRA_FIELDS_VALUES . " pefv ON(pefv.fields_id = p2pef.fields_id AND ( pefv.languages_id = '" . (int)$languages_id . "' OR pefv.languages_id = '0' ) ) ";
+ $this->listing_sql['tables'] .= " LEFT JOIN " . TABLE_EXTRA_FIELDS_VALUES . " ".$this->p."efv ON(pefv.fields_id = ".$this->p."2pef.fields_id AND ( ".$this->p."efv.languages_id = '" . (int)$languages_id . "' OR ".$this->p."efv.languages_id = '0' ) ) ";
-
$this->listing_sql['where'] = " WHERE ".DataForceStatus(" ".$this->p.".content_status='1' ")." AND ".$this->p.".content_type = '" . (isset($_REQUEST['subtype'])? (int)$_REQUEST['subtype'] : 1) . "' AND ".$this->p."d.content_title <>'' ";
- if (isset($_GET['categories_id']) && tep_not_null($_GET['categories_id'])) {
- if (isset($_GET['inc_subcat']) && ($_GET['inc_subcat'] == '1')) {
- $subcategories_array = array();
- tep_get_subcategories($subcategories_array, $_GET['categories_id']);
- $this->listing_sql['where'] .= " and ".$this->p."2c.content_id = ".$this->p.".content_id and ".$this->p."2c.content_id = ".$this->p."d.content_id and (".$this->p."2c.categories_id = '" . (int)$_GET['categories_id'] . "'";
-
- for ($i=0, $n=sizeof($subcategories_array); $i<$n; $i++ ) {
- $this->listing_sql['where'] .= " or ".$this->p."2c.categories_id = '" . (int)$subcategories_array[$i] . "'";
- }
-
- $this->listing_sql['where'] .= ")";
- } else {
- $this->listing_sql['where'] .= " and ".$this->p."2c.content_id = ".$this->p.".content_id and ".$this->p."2c.content_id = ".$this->p."d.content_id and ".$this->p."d.language_id = '" . (int)$languages_id . "' and ".$this->p."2c.categories_id = '" . (int)$_GET['categories_id'] . "'";
- }
- }
-
-
if (isset($search_keywords) && (sizeof($search_keywords) > 0)) {
$this->listing_sql['where'] .= " and (";
for ($i=0, $n=sizeof($search_keywords); $i<$n; $i++ ) {
@@ -300,9 +283,9 @@
$tmp = '';
foreach($allextraactived as $row) {
if($row['epf_uses_value_list'] == 0)
- $tmp .= " OR ( p2pef.fields_id = '".$row['id']."' AND p2pef.value like '%" . tep_db_input($keyword) . "%' ) ";
+ $tmp .= " OR ( ".$this->p."2pef.fields_id = '".$row['id']."' AND ".$this->p."2pef.value like '%" . tep_db_input($keyword) . "%' ) ";
else
- $tmp .= " OR ( pefv.value_id= p2pef.value AND pefv.fields_id = '".$row['id']."' AND pefv.fields_value like '%" . tep_db_input($keyword) . "%' ) ";
+ $tmp .= " OR ( ".$this->p."efv.value_id= p2pef.value AND ".$this->p."efv.fields_id = '".$row['id']."' AND ".$this->p."efv.fields_value like '%" . tep_db_input($keyword) . "%' ) ";
}
$this->listing_sql['where'] .= " OR ( " . substr($tmp, 3) . " ) ";
}
Modified: trunk/catalog/common/classes/datatype_drivers/Data_diver.php
===================================================================
--- trunk/catalog/common/classes/datatype_drivers/Data_diver.php 2014-01-21 09:17:22 UTC (rev 5057)
+++ trunk/catalog/common/classes/datatype_drivers/Data_diver.php 2014-01-22 00:15:28 UTC (rev 5058)
@@ -12,7 +12,10 @@
OR module aca action and exec
*/
-class Data_diver {
+class Data_diver
+ implements
+ DataTypesData
+ {
/**
@@ -103,7 +106,17 @@
return '';
}
+
/**
+ @brief sql for sitemap index
+ @param $mode le type de control (public)
+ @return true
+ */
+ function Sitemap($mode='public'){
+
+ }
+
+ /**
@brief Prepare an retrun result Seo request
@param $mode string anchor key used
@param $subtype Not used
Modified: trunk/catalog/common/classes/datatype_drivers/Data_featured.php
===================================================================
--- trunk/catalog/common/classes/datatype_drivers/Data_featured.php 2014-01-21 09:17:22 UTC (rev 5057)
+++ trunk/catalog/common/classes/datatype_drivers/Data_featured.php 2014-01-22 00:15:28 UTC (rev 5058)
@@ -9,8 +9,13 @@
@encode UTF-8
*/
-class Data_featured {
+class Data_featured
+ implements
+ DataTypesData,
+ DataTypesRootListing
+ {
+
/**
@var DataType string
*/
@@ -95,6 +100,28 @@
}
/**
+ @brief this methode construct sql base for link in childs data
+ this categorie use sub tables nameofdata _ to_categories
+ For histo...
[truncated message content] |
|
From: <os...@us...> - 2014-01-21 09:17:26
|
Revision: 5057
http://sourceforge.net/p/oscss/svn/5057
Author: oscim
Date: 2014-01-21 09:17:22 +0000 (Tue, 21 Jan 2014)
Log Message:
-----------
Next dev for frontoffice dinamical request sql by rootlisting parent
adjust code
fix
Modified Paths:
--------------
trunk/catalog/admin/includes/classes/MLinkTo.php
trunk/catalog/admin/includes/classes/fileUtility.php
trunk/catalog/admin/includes/exts/package/CIP.php
trunk/catalog/admin/includes/exts/package/packageInstaller.php
trunk/catalog/admin/includes/exts/package/tags/addfile.php
trunk/catalog/admin/includes/modules/pages/package.php
trunk/catalog/common/classes/cart/CartStockage.class.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_product.php
trunk/catalog/common/classes/shoppingCart.php
trunk/catalog/includes/classes/drivers/data/content.php
trunk/catalog/includes/classes/drivers/data/product.php
trunk/catalog/includes/modules/shipping/mzmt.php
trunk/dev/package/package.php
trunk/test/phpunit/Front/shippingTest.php
Added Paths:
-----------
trunk/test/phpunit/Front/productTest.php
Modified: trunk/catalog/admin/includes/classes/MLinkTo.php
===================================================================
--- trunk/catalog/admin/includes/classes/MLinkTo.php 2014-01-20 07:52:43 UTC (rev 5056)
+++ trunk/catalog/admin/includes/classes/MLinkTo.php 2014-01-21 09:17:22 UTC (rev 5057)
@@ -55,7 +55,13 @@
// search current in type for rootlisting
if(in_array(self::$current, explode(',',$row->value))) {
//! @remarks Force load language centralised
- $oscss->pile_file_lang(DIR_FS_ADMIN.DIR_WS_LANGUAGES.$language.'/pages/'.$key.'s.txt');
+ if( !$oscss->pile_file_lang(DIR_FS_ADMIN.DIR_WS_LANGUAGES.$language.'/'.ucwords($mkey).'.txt') ){
+ $oscss->pile_file_lang(DIR_FS_ADMIN.DIR_WS_LANGUAGES.$language. '/modules/pages/'.$mkey.'s.txt') ; // olds calls , not use !!
+ }
+// if( !$oscss->pile_file_lang(DIR_FS_ADMIN.DIR_WS_LANGUAGES.$language.'/'.ucwords($key).'.txt') ){
+// $oscss->pile_file_lang(DIR_FS_ADMIN.DIR_WS_LANGUAGES.$language. '/pages/'.$key.'s.txt') ; // olds calls , not use !!
+// }
+// $oscss->pile_file_lang(DIR_FS_ADMIN.DIR_WS_LANGUAGES.$language.'/pages/'.$key.'s.txt');
self::$RL[$key] = $key;
}
}
@@ -155,8 +161,10 @@
$oscss = oscss_cstr::getInstance();
//! @remarks Force load language centralised
- $oscss->pile_file_lang(DIR_FS_ADMIN.DIR_WS_LANGUAGES.$language.'/modules/pages/'.$mkey.'s.txt');
-
+// $oscss->pile_file_lang(DIR_FS_ADMIN.DIR_WS_LANGUAGES.$language.'/modules/pages/'.$mkey.'s.txt');
+ if( !$oscss->pile_file_lang(DIR_FS_ADMIN.DIR_WS_LANGUAGES.$language.'/'.ucwords($mkey).'.txt') ){
+ $oscss->pile_file_lang(DIR_FS_ADMIN.DIR_WS_LANGUAGES.$language. '/modules/pages/'.$mkey.'s.txt') ; // olds calls , not use !!
+ }
/**
Contruct html if file.gab extists
*/
Modified: trunk/catalog/admin/includes/classes/fileUtility.php
===================================================================
--- trunk/catalog/admin/includes/classes/fileUtility.php 2014-01-20 07:52:43 UTC (rev 5056)
+++ trunk/catalog/admin/includes/classes/fileUtility.php 2014-01-21 09:17:22 UTC (rev 5057)
@@ -426,28 +426,22 @@
if($optionnal !=null)
$optionnal = ' '.constant('ZipArchive::'.$optionnal);
-// if(substr($archive, 0, 1) == '/')
-// $archive = substr($archive, 1);
-
- try {
- $zip = new ZipArchive;
- if(!$zip)
- throw new Exception('Unknown ZipArchive :: '. $zip );
-
- if(! $zip->open($archive, $optionnal ) )
- throw new Exception('ZipArchive :: not open '. $archive );
+ if(substr($archive, 0, 1) == '/')
+ $archive = substr($archive, 1);
+ $zip = new ZipArchive;
+
+ $res = $zip->open($archive, $optionnal ); //$optionnal);
- if(! $zip->extractTo($destination) )
- throw new Exception('ZipArchive :: not extract '. $archive );
+ $res = $zip->extractTo($destination);
+
+ if ($res === TRUE) {
+ $messageStack->add(__('@system extract success') , 'success');
+
+ $zip->close();
- if( ! $zip->close() )
- throw new Exception('ZipArchive :: not save ('. $archive.')' );
-
- }
- catch (Exception $e) {
- print( 'Exception reçue : ' . $e. "\n" );
- return false;
+ } else {
+ $messageStack->add(__('@system extract error'). ' '.$res, 'error' );
}
}
Modified: trunk/catalog/admin/includes/exts/package/CIP.php
===================================================================
--- trunk/catalog/admin/includes/exts/package/CIP.php 2014-01-20 07:52:43 UTC (rev 5056)
+++ trunk/catalog/admin/includes/exts/package/CIP.php 2014-01-21 09:17:22 UTC (rev 5057)
@@ -133,7 +133,7 @@
// define('DIR_FS_ADMIN_BACKUP',DIR_FS_ADMIN.self::PATH_BACKUP) ;
// }
- if (substr($cip_name_arg, -4)=='.zip') {
+ if (substr($cip_name_arg, -4)=='.zip' ) {
$this->is_cip_in_zip=true;
$this->zip_name=$cip_name_arg;
self::$cip_name=substr($cip_name_arg, 0, -4); //name without extention
@@ -556,18 +556,13 @@
}
/**
- @brief Construct Zip File based on install.xml
-
+ @fn repack()
+ @brief repack for rewrite exts.zip based on dir contrib/exts
+ @return true
*/
- function repack() {
+ public function repack() {
$this->read_xml();
-
- if ($this->is_cip_in_zip ) {
- //We unzip only if we get a zip-filename as a and do not have a unpacked version of CIP.
- fileUtility::_unlink($this->full_path_to_zip());
-
- }
$this->pack_cip();
@@ -576,6 +571,28 @@
/**
+ @fn rebuild()
+ @brief Rebuild: copy core in contrib/exts
+ Use repack for rewrite exts.zip
+ @return true id ok , none if false
+ */
+ public function rebuild() {
+
+ $this->read_xml();
+
+ //! We passed by all checks. So if an error appears
+ foreach ($this->contrib_data as $id=>$tag) {
+ if ( method_exists($tag, 'do_rebuild') && $tag->do_rebuild() ===false){
+ self::InProcess(__("Erreur durant traitement de cette fonction "),'tag_xml-['.$id.']'. $tag->tag_name.'->do_rebuild()','block');
+ break;
+ }
+ }
+
+ return true;
+ }
+
+
+ /**
@fn remove($cleaning=false)
@param $cleaning boolean if true, delete all files
*/
Modified: trunk/catalog/admin/includes/exts/package/packageInstaller.php
===================================================================
--- trunk/catalog/admin/includes/exts/package/packageInstaller.php 2014-01-20 07:52:43 UTC (rev 5056)
+++ trunk/catalog/admin/includes/exts/package/packageInstaller.php 2014-01-21 09:17:22 UTC (rev 5057)
@@ -77,6 +77,26 @@
}
/**
+ @brief Recup du package distant
+ @param $pkgID int internal id
+ @return int OK > 0; KO < 0
+ */
+ public function rebuild_exts($pkgID){
+ global $messageStack;
+
+ $obj=parent::load_db_values($pkgID);
+ $obj=$obj[0];
+
+ $cip= new CIP( (string)$obj->item->ident.'_'.(string)$obj->item->level.'.zip');
+
+
+ if( $cip->rebuild() > 0)
+ return 5;
+
+ return -1;
+ }
+
+ /**
@brief View et check package
*/
public function view_exts($pkgID){
Modified: trunk/catalog/admin/includes/exts/package/tags/addfile.php
===================================================================
--- trunk/catalog/admin/includes/exts/package/tags/addfile.php 2014-01-20 07:52:43 UTC (rev 5056)
+++ trunk/catalog/admin/includes/exts/package/tags/addfile.php 2014-01-21 09:17:22 UTC (rev 5057)
@@ -14,10 +14,11 @@
NOTE:
Class Description operates with description-tag from install.xml.
- <addfile>
- <file name="admin/includes/modules/products/attributeManager.php" />
- <file name="includes/modules/products/attributeManager.php" />
- </addfile>
+ @example
+ <addfile> \
+ <file name="admin/includes/modules/products/attributeManager.php" /> \
+ <file name="includes/modules/products/attributeManager.php" /> \
+ </addfile> \
*/
@@ -71,14 +72,16 @@
public function write_to_xml() {
$tag = '<'.$this->tag_name.'>';
for($i = 0; $i < count($this->data['filename']);$i++){
- $tag .='<file name="'.$this->data['filename'][$i].'" srcdir="'.$this->data['srcdir'][$i].'"/>';
+ $tag .='<file name="'.$this->data['filename'][$i].'" srcdir="'.$this->data['srcdir'][$i].'"/>';
}
$tag.='</'.$this->tag_name.'>';
}
-
+
+
/**-----------------------------permissions--------------------------- */
public function permissions_check_for_remove() {
+ var_dump($this->data['filename']);
for($i = 0; $i < count($this->data['filename']);$i++){
$fs_filename=replace_path_admin($this->fs_filename($i));
$path=dirname($fs_filename);
@@ -201,7 +204,48 @@
/**-----------------------------EXE--------------------------- */
+ /**
+ @fn do_install()
+ @brief Insert all info about requirements of this CIP
+ @return none
+ */
+ public function do_rebuild() {
+ if (!CIP::check_bylevel(1)) return false;
+ for($i = 0; $i < count($this->data['filename']);$i++){
+ $cip_file=DIR_FS_CIP.$this->contrib.'/'.$this->data['srcdir'][$i].'/'.$this->data['filename'][$i];
+
+ /**
+ @brief add in db table for list modules
+ */
+ cip_modfiles::AdjustModFiles($this->fs_filename($i));
+
+
+ $fs_filename=replace_path_admin($this->fs_filename($i));
+
+
+
+ $path=dirname($cip_file);
+
+ if(!file_exists($path) || !is_dir($path))
+ parent::recursive_mkdir($path);
+
+ //! We copy file to right location:
+ if(fileUtility::_copy($fs_filename, $cip_file) ===false) {
+ CIP::InProcess("Run time error: ".__('couldnt copy to text')."<br /> <pre> original:: ".$fs_filename."<br /> copy:: ".$cip_file."</pre>", __CLASS__.'->'.__FUNCTION__.'::'.__LINE__,'block');
+ return false;
+ }
+ else
+ CIP::InProcess("Run time : ".__('copy effectue')."<pre> copy:: ".$fs_filename."</pre>", __CLASS__.'->'.__FUNCTION__.'::'.__LINE__,'info');
+
+ if (file_exists($cip_file))
+ fileUtility::_chmod($cip_file, 0777);
+
+ }
+
+ return true;
+ }
+
/**
@fn do_install()
@brief Insert all info about requirements of this CIP
Modified: trunk/catalog/admin/includes/modules/pages/package.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/package.php 2014-01-20 07:52:43 UTC (rev 5056)
+++ trunk/catalog/admin/includes/modules/pages/package.php 2014-01-21 09:17:22 UTC (rev 5057)
@@ -345,6 +345,16 @@
break;
+ case 'rebuild':
+ $class=self::$code.'Installer';
+
+ if(!tep_class_exists('exts_'.self::$code.'_'.$class)) return false;
+ $obj=new $class;
+
+ $res = $obj->rebuild_exts((string)$_GET['pkgID']);
+
+ break;
+
/**
@remarks
*/
Modified: trunk/catalog/common/classes/cart/CartStockage.class.php
===================================================================
--- trunk/catalog/common/classes/cart/CartStockage.class.php 2014-01-20 07:52:43 UTC (rev 5056)
+++ trunk/catalog/common/classes/cart/CartStockage.class.php 2014-01-21 09:17:22 UTC (rev 5057)
@@ -37,9 +37,6 @@
$_SESSION[$this->_namespace] = array();
}
$this->content = &$_SESSION[$this->_namespace];
-
-// var_dump($this->content);
-// exit;
}
/**
@@ -63,9 +60,6 @@
$args = func_get_args();
$list = $args[0];
-
-// var_dump(__file__);
-
if( count($list) > 0 ) {
$products_id_string = @$list[0];
$option = @$list[1];
Modified: trunk/catalog/common/classes/datatype_drivers/Data_categorie.php
===================================================================
--- trunk/catalog/common/classes/datatype_drivers/Data_categorie.php 2014-01-20 07:52:43 UTC (rev 5056)
+++ trunk/catalog/common/classes/datatype_drivers/Data_categorie.php 2014-01-21 09:17:22 UTC (rev 5057)
@@ -74,10 +74,25 @@
- global $page,$language;
+ global $page,$language, $languages_id;
if(is_object($page))
if(($path_lg=$page->fix_file(DIR_WS_INCLUDES .'languages/'. $language . '/' . $this->DataType.'.txt',true)) !=false)
$page->pile_file_lang($path_lg);
+
+
+
+ /*
+ @remarks Construct requet sql in /includes/class/drivers/data/ by sub chidls class
+ this requet is dynamical construct
+ */
+ $this->listing_sql['leftto']['rows'] = array(
+ "".$this->p."2c.categories_id"=>0,
+ );
+
+ $this->listing_sql['leftto']['tables'] = " LEFT JOIN ".DB_TABLE_PREFIX."%2\$s_to_categories ".$this->p."2c ON ( ".$this->p."2c.%2\$s_id = %1\$s ) ";
+ $this->listing_sql['leftto']['tables'] .= " LEFT JOIN " . TABLE_CATEGORIES . " ".$this->p." ON ( ".$this->p."2c.categories_id = ".$this->p.".categories_id " .DataForceStatus(" AND ".$this->p.".categories_status='1' ") . ") ";
+ $this->listing_sql['leftto']['tables'] .= " LEFT JOIN " . TABLE_CATEGORIES_DESCRIPTION . " ".$this->p."d ON( ".$this->p."d.categories_id = ".$this->p.".categories_id AND ".$this->p."d.language_id = '%3\$s' ) ";
+
}
/**
@@ -102,6 +117,9 @@
// list normalise date
$this->listing_sql['dates'] = " ".$this->p.".date_added as added, ".$this->p.".last_modified as modified ";
+
+
+
return true;
}
Modified: trunk/catalog/common/classes/datatype_drivers/Data_content.php
===================================================================
--- trunk/catalog/common/classes/datatype_drivers/Data_content.php 2014-01-20 07:52:43 UTC (rev 5056)
+++ trunk/catalog/common/classes/datatype_drivers/Data_content.php 2014-01-21 09:17:22 UTC (rev 5057)
@@ -68,19 +68,22 @@
function __construct($next=false){
global $languages_id;
- if($next) {
- $this->listing_sql['tables'] = " FROM " . TABLE_CONTENT . " ".$this->p." ".
- " LEFT JOIN " . TABLE_CONTENT_DESCRIPTION . " ".$this->p."d ON( ".$this->p."d.content_id = ".$this->p.".content_id AND ".$this->p."d.language_id = '" . (int)$languages_id . "' ) ".
- "";
+ $this->listing_sql['tables'] = " FROM " . TABLE_CONTENT . " ".$this->p." ".
+ " LEFT JOIN " . TABLE_CONTENT_DESCRIPTION . " ".$this->p."d ON( ".$this->p."d.content_id = ".$this->p.".content_id AND ".$this->p."d.language_id = '" . (int)$languages_id . "' ) ".
+ "";
- $this->listing_sql['where'] = " WHERE ".DataForceStatus(" ".$this->p.".content_status='1' ")." AND ".$this->p."d.content_title <>'' ";
+ $this->listing_sql['where'] = " WHERE ".DataForceStatus(" ".$this->p.".content_status='1' ")." AND ".$this->p."d.content_title <>'' ";
+
+ // defaut sort listing
$this->listing_sql['sort'] = " ".$this->p."d.content_title ";
- $this->listing_sql['base_key'] = "content_id ";
- $this->listing_sql['col_count'] = " ".$this->p.".content_id ";
- // list normalise date
- $this->listing_sql['dates'] = " ".$this->p.".date_added as added, ".$this->p.".last_modified as modified ";
- }
+ // sort in sitemap
+ $this->listing_sql['sort_in_sitemap'] =" ".$this->p."d.content_title ";
+ $this->listing_sql['base_key'] = "content_id ";
+ $this->listing_sql['col_count'] = " ".$this->p.".content_id ";
+ // list normalise date
+ $this->listing_sql['dates'] = " ".$this->p.".date_added as added, ".$this->p.".last_modified as modified ";
+
global $page,$language;
if(is_object($page))
if(($path_lg=$page->fix_file(DIR_WS_INCLUDES .'languages/'. $language . '/' . $this->DataType.'.txt',true)) !=false)
Modified: trunk/catalog/common/classes/datatype_drivers/Data_product.php
===================================================================
--- trunk/catalog/common/classes/datatype_drivers/Data_product.php 2014-01-20 07:52:43 UTC (rev 5056)
+++ trunk/catalog/common/classes/datatype_drivers/Data_product.php 2014-01-21 09:17:22 UTC (rev 5057)
@@ -84,11 +84,11 @@
global $languages_id;
- if($next) {
+// if($next) {
// $this->use_in_search = _cst_bool('DATA_PRODUCT_USEINSEARCH');
$this->listing_sql['tables'] = " FROM " . TABLE_PRODUCTS . " ".$this->p." ".
- " LEFT JOIN " . TABLE_PRODUCTS_DESCRIPTION . " ".$this->p."d ON( ".$this->p."d.products_id = ".$this->p.".products_id AND ".$this->p."d.language_id = '" . (int)$languages_id . "' ) ".
+ " LEFT JOIN " . TABLE_PRODUCTS_DESCRIPTION . " ".$this->p."d ON( ".$this->p."d.products_id = ".$this->p.".products_id AND ".$this->p."d.language_id = '%3\$s' ) ".
"";
// permanente contrainte
$this->listing_sql['where'] = " WHERE 1 ".DataForceStatus(" AND ".$this->p.".products_status='1' ")." ";
@@ -100,7 +100,7 @@
$this->listing_sql['col_count'] = " ".$this->p.".products_id ";
// list normalise date
$this->listing_sql['dates'] = " ".$this->p.".products_date_added as added, ".$this->p.".products_last_modified as modified, ".$this->p.".products_date_available as available ";
- }
+// }
global $page,$language;
@@ -435,6 +435,7 @@
$page->init('product_info.php',$language);
$breadcrumb=$page->return_object('breadcrumb');
+
// call transversal load in other modules
DataTypes::transversal('transversal');
@@ -449,6 +450,7 @@
}
}
+
//! produit nom trouvé
if ( ($obj_product_info =product_info((int)$_GET['products_id'])) ==false )
tep_redirect(tep_href_link('','ServerError=404') );
Modified: trunk/catalog/common/classes/shoppingCart.php
===================================================================
--- trunk/catalog/common/classes/shoppingCart.php 2014-01-20 07:52:43 UTC (rev 5056)
+++ trunk/catalog/common/classes/shoppingCart.php 2014-01-21 09:17:22 UTC (rev 5057)
@@ -93,7 +93,6 @@
@return result of method
*/
protected function CallerStockageExe(CartSession $obj, $method, $args){
-// var_dump( $obj , $method );
return $obj->$method($args);
}
@@ -659,7 +658,6 @@
\brief Init base module actif pour la page shopping_cart
*/
public function draw_cart($product){
-// var_dump('toto');
$this->init_ot();
return $this->otm->draw_cart('',$product);
}
Modified: trunk/catalog/includes/classes/drivers/data/content.php
===================================================================
--- trunk/catalog/includes/classes/drivers/data/content.php 2014-01-20 07:52:43 UTC (rev 5056)
+++ trunk/catalog/includes/classes/drivers/data/content.php 2014-01-21 09:17:22 UTC (rev 5057)
@@ -29,6 +29,9 @@
*/
protected function __construct($full) {
global $languages_id;
+
+ DataTypes::CompletRequest('leftto', 'content');
+
// productData::start();
if($full) self::start_module();
}
@@ -59,19 +62,19 @@
Data function
*/
- public static function get_query($id='',$search='',$exclude='',$option=array()){ global $languages_id; return contentData::get_query($id,$search,$exclude,$option); }
- public static function get_item($id,$option=array()){ return contentData::get_item($id,$option); }
- public static function get_content_cat($id){ return contentData::get_content_cat($id); }
- public static function get_content_path($id){ return contentData::get_content_path($id); }
- public static function get_content_in_cat($current_category_id=0, $exclude=''){ return contentData::get_content_in_cat($current_category_id=0, $exclude=''); }
- public static function get_cms_liste_byDate($max, $exclude){ return contentData::get_cms_liste_byDate($max, $exclude); }
+ public static function get_query($id='',$search='',$exclude='',$option=array()){ global $languages_id; new self(); return contentData::get_query($id,$search,$exclude,$option); }
+ public static function get_item($id,$option=array()){ new self(); return contentData::get_item($id,$option); }
+ public static function get_content_cat($id){ new self(); return contentData::get_content_cat($id); }
+ public static function get_content_path($id){ new self(); return contentData::get_content_path($id); }
+ public static function get_content_in_cat($current_category_id=0, $exclude=''){ new self(); return contentData::get_content_in_cat($current_category_id=0, $exclude=''); }
+ public static function get_cms_liste_byDate($max, $exclude){ new self(); return contentData::get_cms_liste_byDate($max, $exclude); }
- public static function get_img($id, $img_num=0){ return contentData::get_img($id, $img_num); }
+ public static function get_img($id, $img_num=0){ new self(); return contentData::get_img($id, $img_num); }
/**
* \fn get_count_contents_in_category($category_id, $include_inactive = false)
*/
- public static function get_count_in_category($category_id, $include_inactive = false) {return contentData::count_in_category($category_id, $include_inactive); }
+ public static function get_count_in_category($category_id, $include_inactive = false) { new self(); return contentData::count_in_category($category_id, $include_inactive); }
}
@@ -119,6 +122,9 @@
$display_lang=self::$obj_language->fetchAssoc();
if (empty($exclude))$exclude=array();
$tabl=$res=array();
+
+
+ if($content_query != false)
while ($content = $content_query->fetchAssoc()) {
if (!in_array($content['name'],$exclude)) {
$res=$content;
@@ -129,11 +135,11 @@
$res['chapo'] = self::parse_content($content['text'],$content['id'], true);
$res['images']=array();
- unset($res['text']);
+// unset($res['text']);
- self::$array_data[$content['id']]=$tabl[$content['id']]=new objectInfo($res);
-
+ self::$object_data[$content['id']]=$tabl[$content['id']]=new objectInfo($res);
self::$array_data[$content['id']]->text=self::parse_content(@$res['text'],$content['id']);
+
self::add_cache($content['id']);
}
}
@@ -141,7 +147,7 @@
if((count(self::$array_data)>0))
foreach(self::$array_data as $k=>$content)
if (!in_array($content->name,$exclude)) {
- if((!empty($search) && strstr($content->name,$search) !=false) || empty($search)) $tabl[$content->id]=$content;
+ if((!empty($search) && strstr($content->name,$search) !=false) || empty($search)) $tabl[$content->id]=$content;
}
return $tabl;
@@ -160,11 +166,24 @@
Requeteur
*/
protected static function cstr_query($orderby='', $limit='', $option=''){
- $query="SELECT content_title AS title, c.content_id AS id, c.content_type AS type, c.content_name AS name, content_text AS text, c.date_added as date_added, ctc.categories_id
- FROM " . TABLE_CONTENT_DESCRIPTION . " cd, " . TABLE_CONTENT . " c, " . TABLE_CONTENT_TO_CATEGORIES . " ctc, " . TABLE_CATEGORIES . " cat
- WHERE cat.categories_id=ctc.categories_id " . DataForceStatus(" AND cat.categories_status='1' ") . " " . DataForceStatus(" AND c.content_status = '1' ") . " AND c.content_id = ctc.content_id AND cd.content_id = ctc.content_id AND cd.language_id = '" . self::$lg_id . "' " ;
- $query .=self::$where_query;
+ global $languages_id;
+
+ $listing = DataTypes::GetListing('leftto', 'content');
+
+ $query = 'SELECT DISTINCT '.
+ $listing['col_count'] .
+ $listing['rows'] .
+ ' ,c.content_id AS id'.
+ ' ,content_title AS title'.
+ ' ,c.content_type AS type'.
+ ' ,c.content_name AS name'.
+ ' ,content_text AS text'.
+ ' ,c.date_added as date_added'.
+ ' '. sprintf($listing['tables'], $listing['col_count'] , 'content', $languages_id ).
+ ' '. $listing['where'].
+ '';
+ $query .=self::$where_query;
$query .=' ORDER BY ' .(!tep_not_null($orderby)? ' c.sort_order, c.content_name ASC ' : $orderby) ;
$query .=' LIMIT '.(!tep_not_null($limit)? '1' : $limit) ;
@@ -274,9 +293,10 @@
if (count(self::$cache)>0) self::add_where_query(' AND c.content_id NOT IN ('.self::in_cache().') ');
//! soit id soit sherach name key
self::add_where_query((tep_not_null($id) && is_numeric($id) ? " AND c.content_id = '" . $id . "' ": (!empty($search)?" AND content_name LIKE '%" . tep_db_input($search) . "%' ":'') ));
+ $sql=self::cstr_query((string)@$option['orderby'],@$option['limit'],(array)@$option);
- $content_query = $DB->query($sql=self::cstr_query((string)@$option['orderby'],@$option['limit'],(array)@$option) );
-
+ $content_query = $DB->query( $sql );
+
return self::statment_query($content_query,$exclude,$search);
}
@@ -285,16 +305,17 @@
*/
public static function get_item($id,$option=array()){
- $db_list=self::get_query($id,'','',$option);
-
- if(is_numeric($id) && isset($db_list[(int)$id])){
- return $db_list[$id];
- }else{
+ 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;
+ if((string)$id==(string)$item->name)return $item;
}
+
return false;
}
Modified: trunk/catalog/includes/classes/drivers/data/product.php
===================================================================
--- trunk/catalog/includes/classes/drivers/data/product.php 2014-01-20 07:52:43 UTC (rev 5056)
+++ trunk/catalog/includes/classes/drivers/data/product.php 2014-01-21 09:17:22 UTC (rev 5057)
@@ -52,6 +52,9 @@
*/
protected function __construct($full) {
global $languages_id;
+
+ DataTypes::CompletRequest('leftto', 'product');
+
// productData::start();
if($full) self::start_module();
}
@@ -110,27 +113,27 @@
* @param $option array option passé par couple key/values
* @return object
*/
- public static function get_query($id='',$search='',$exclude='',$option=''){ global $languages_id; return productData::get_query($id,$search,$exclude,$option); }
+ public static function get_query($id='',$search='',$exclude='',$option=''){ global $languages_id;new self(); return productData::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){ return productData::get_item($id); }
+ public static function get_item($id){ new self(); return productData::get_item($id); }
/**
* \fn get_product_path($id)
* \brief generation du cPath d'un produits
* @param $id int
* @return string cPath
*/
- public static function get_product_path($id){ return productData::get_product_path($id); }
+ public static function get_product_path($id){ new self(); return productData::get_product_path($id); }
/**
* \fn get_product_attribut_info($id)
* \brief appel info attribute product , renvoi tableau d'information
* @param $id int products id
*/
- public static function get_product_attribut_info($id){ return productData::get_product_attribut_info($id); }
+ public static function get_product_attribut_info($id){ new self(); return productData::get_product_attribut_info($id); }
/**
* \fn get_product_attribut_info($id)
* \brief retourne le nombre de produits en stock, en fonction de ces caratèristiques,
@@ -139,13 +142,13 @@
* @param $id int id produit
* @return int
*/
- public static function get_products_stock($id,$attributes=array()){ return productData::get_products_stock($id, $attributes); }
+ public static function get_products_stock($id,$attributes=array()){ new self(); return productData::get_products_stock($id, $attributes); }
/**
* \fn get_has_product_attributes($id)
* \brief true/false si attribut associé a ce produits
* @param $id int
*/
- public static function get_has_product_attributes($id){ return productData::get_has_product_attributes($id); }
+ public static function get_has_product_attributes($id){ new self(); return productData::get_has_product_attributes($id); }
/**
* \fn get_product_attribut_price($products_id, $attributes=array())
* \brief calcul prix produit avec attribute
@@ -153,7 +156,7 @@
* @param $attributes array
* @return float
*/
- public static function get_product_attribut_price($products_id, $attributes=array()) {return productData::get_product_attribut_price($products_id, $attributes); }
+ public static function get_product_attribut_price($products_id, $attributes=array()) { new self(); return productData::get_product_attribut_price($products_id, $attributes); }
/**
* \fn get_attributes_weight($products_id, $attributes=array())
* \brief calcul du poids avec attribute
@@ -161,16 +164,16 @@
* @param $attributes array
* @return float
*/
- public static function get_attributes_weight($products_id, $attributes=array()) {return productData::get_attributes_weight($products_id, $attributes); }
+ public static function get_attributes_weight($products_id, $attributes=array()) { new self();return productData::get_attributes_weight($products_id, $attributes); }
// public static function get_product_path($id){ return productData::get_product_path($id); }
/**
* \fn get_extra_product($products_id, $key='')
*/
- public static function get_extra_product($products_id, $key='') {return productData::GetExtraFields($products_id, $key); }
+ public static function get_extra_product($products_id, $key='') { new self(); return productData::GetExtraFields($products_id, $key); }
/**
* \fn get_count_products_in_category($category_id, $include_inactive = false)
*/
- public static function get_count_in_category($category_id, $include_inactive = false) {return productData::count_in_category($category_id, $include_inactive); }
+ public static function get_count_in_category($category_id, $include_inactive = false) { new self();return productData::count_in_category($category_id, $include_inactive); }
}
@@ -207,6 +210,10 @@
$display_lang=self::$obj_language->fetchAssoc();
if (empty($exclude))$exclude=array();
$tabl=$product=array();
+
+ if(!$content_query)
+ return false;
+
while ($content = $content_query->fetchAssoc()) {
if (!in_array($content['products_name'],$exclude)) {
$product=$content;
@@ -255,13 +262,35 @@
Requeteur
*/
protected static function cstr_query($orderby='', $limit='', $option=''){
+ global $languages_id;
+
+ $listing = DataTypes::GetListing('leftto', 'product');
- $query="SELECT distinct p.products_id,p.products_ref, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url,p.products_price as price_original, p.products_price,p.track_stock, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id, pd.products_viewed, p2c.categories_id, p.products_weight, products_type as type
- FROM " . TABLE_PRODUCTS . " p , " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c
- WHERE " . DataForceStatus(" p.products_status = '1' AND ") . " pd.products_id = p.products_id and pd.language_id = '" . self::$lg_id . "' and p2c.products_id=p.products_id and c.categories_id=p2c.categories_id " . DataForceStatus(" AND c.categories_status='1' ") . " " ;
-
-
- $query .=self::$where_query;
+ $query = 'SELECT DISTINCT '.
+ $listing['col_count'] .
+ $listing['rows'] .
+ ' ,p.products_id'.
+ ' ,p.products_ref'.
+ ' ,pd.products_name'.
+ ' ,pd.products_description'.
+ ' ,p.products_model'.
+ ' ,p.products_quantity'.
+ ' ,p.products_image'.
+ ' ,pd.products_url'.
+ ' ,p.products_price as price_original'.
+ ' ,p.products_price'.
+ ' ,p.track_stock'.
+ ' ,p.products_tax_class_id'.
+ ' ,p.products_date_added'.
+ ' ,p.products_date_available'.
+ ' ,p.manufacturers_id'.
+ ' ,pd.products_viewed'.
+ ' ,p.products_weight'.
+ ' , products_type as type'.
+ ' '. sprintf($listing['tables'], $listing['col_count'] , 'products', $languages_id ).
+ ' '. $listing['where'].
+ '';
+ $query .=self::$where_query;
$query .=' ORDER BY ' .(!tep_not_null($orderby)? ' p.products_date_added DESC ' : $orderby) ;
$query .=' LIMIT '.(!tep_not_null($limit)? '1' : $limit) ;
@@ -293,6 +322,9 @@
$content_query = $DB->query($sql);
+ if( !$content_query )
+ return false;
+
return self::statment_query($content_query,$exclude,$search);
}
@@ -300,14 +332,15 @@
Alias unique ID
*/
public static function get_item($id){
- $db_list=self::get_query($id);
-
- if(is_numeric($id) && isset($db_list[(int)$id])){
- return $db_list[$id];
- }else{
+ 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;
+ if((string)$id==(string)$item->name)return $item;
}
return false;
}
@@ -317,6 +350,8 @@
// Check if product has attributes
public static function get_has_product_attributes($products_id) {
$DB=Database::getInstance();
+
+ self::get_item($products_id);
$attributes_query = $DB->query("select count(*) as count from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . (int)$products_id . "'");
$attributes = $attributes_query->fetchAssoc();
@@ -744,18 +779,6 @@
return self::getInstance();
}
- /**
- Get data modified/add by module
- */
-// public function get_option_data($product_array){
-// if(isset($this->modules) && is_array($this->modules))
-// foreach ($this->modules as $key=>$module) {
-// if ( $module->enabled && (method_exists($module, 'get_option_data' ))) {
-// $product_array=$this->modules[$key]->get_option_data($product_array);
-// }
-// }
-// return $product_array;
-// }
/**
Get price modified by module
@@ -773,59 +796,8 @@
}
- /**
- * \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;
-// }
-// }
/**
- @brief Affiche module display_view mini
- @param cID int le Id du customers
- @param class string 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;
-// }
-// }
-
- /**
* \fn display_titre($cID,$format='$s')
* \brief Affiche bock titre client notifié
* @param $cID
Modified: trunk/catalog/includes/modules/shipping/mzmt.php
===================================================================
--- trunk/catalog/includes/modules/shipping/mzmt.php 2014-01-20 07:52:43 UTC (rev 5056)
+++ trunk/catalog/includes/modules/shipping/mzmt.php 2014-01-21 09:17:22 UTC (rev 5057)
@@ -37,9 +37,8 @@
global $order;
//! block suite si BO
- if(!is_object($order))
- return false;
- else
+
+ if(is_object($order))
$this->update_status($order);
}
@@ -136,8 +135,6 @@
// }
}
}
-
- var_dump($this->enabled );
}
/** Interface InterfaceModule */
Modified: trunk/dev/package/package.php
===================================================================
--- trunk/dev/package/package.php 2014-01-20 07:52:43 UTC (rev 5056)
+++ trunk/dev/package/package.php 2014-01-21 09:17:22 UTC (rev 5057)
@@ -28,8 +28,14 @@
if(count($argv) <=2 || $argv[2] =='-h'){
$ob =" This script use core oscss for installer/remove extentions in core\n".
"You'r use args for correct process\n".
- // " * -fileconfig path/configfile.xml use configuration file \n".
- " * action (install/remove/update)\n".
+ " * action (install/remove/update/repack/rebuild)\n".
+ " -- detail action -- \n".
+ " repack : for create new zipfile based on contrib dir \n".
+ " rebuild: for rewrite file in contrib dir by core dir \n".
+ " remove : delete all file in core dir \n".
+ " install for install in core dir \n".
+
+ " -- package -- \n".
" * -p nameofpackage\n".
" * -v int 1-9 verbose \n".
" * -d int 1-9 debug \n".
@@ -150,6 +156,7 @@
// search id for package
$r= package::load_repository();
$list = package::$FeedItem;
+
foreach($list as $key=>$row)
if( (string)$row->ident == strtoupper($this->config->p) ){
$pkgID = (int)$row->internalID;
@@ -185,10 +192,82 @@
$list=$obj->remove_exts((int)$pkgID);
break;
+
+ case 'rebuild':
+ // search id for package
+ $r= package::load_repository();
+ $list = package::$FeedItem;
+ foreach($list as $key=>$row)
+ if( (string)$row->ident == strtoupper($this->config->p) ){
+ $pkgID = (int)$row->internalID;
+ break;
+ }
+ if(!isset($pkgID) || (int)$pkgID<=0)
+ die('no found in local db package'."\n");
+ echo "\n\nAre you sure you want to do this? Type 'yes' to continue: ";
+ $handle = fopen ("php://stdin","r");
+ $line = fgets($handle);
+ if(trim($line) != 'yes'){
+ echo "ABORTING!\n";
+ exit;
+ }
+ echo "\n";
+ echo "Thank you, continuing ?!!\n";
+
+
+ $action='rebuild';
+ $code = 'package';
+ $class=$code.'Installer';
+ require_once($this->path_base.'includes/exts/package/'.$class.'.php');
+
+ $obj=new $class;
+
+
+ $list=$obj->rebuild_exts((int)$pkgID);
+
+ break;
+
+ case 'repack':
+
+ // search id for package
+ $r= package::load_repository();
+ $list = package::$FeedItem;
+ foreach($list as $key=>$row)
+ if( (string)$row->ident == strtoupper($this->config->p) ){
+ $pkgID = (int)$row->internalID;
+ break;
+ }
+ if(!isset($pkgID) || (int)$pkgID<=0)
+ die('no found in local db package'."\n");
+
+
+ echo "\n\nAre you sure you want to do this? Type 'yes' to continue: ";
+ $handle = fopen ("php://stdin","r");
+ $line = fgets($handle);
+ if(trim($line) != 'yes'){
+ echo "ABORTING!\n";
+ exit;
+ }
+ echo "\n";
+ echo "Thank you, continuing ?!!\n";
+
+
+ $action='repack';
+ $code = 'package';
+ $class=$code.'Installer';
+ require_once($this->path_base.'includes/exts/package/'.$class.'.php');
+
+ $obj=new $class;
+
+
+ $list=$obj->repack_exts((int)$pkgID);
+
+ break;
+
case 'update':
$action='remove';
Added: trunk/test/phpunit/Front/productTest.php
===================================================================
--- trunk/test/phpunit/Front/productTest.php (rev 0)
+++ trunk/test/phpunit/Front/productTest.php 2014-01-21 09:17:22 UTC (rev 5057)
@@ -0,0 +1,126 @@
+<?php
+/**
+ @licence GPL 2005-2011 The osCSS developers - osCSS Open Source E-commerce
+ @portion code Copyright (c) 2002 osCommerce
+ @package osCSS-2 <www http://www.oscss.org>
+ @version 2.1.1
+ @date 22/08/11, 20:42
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+ @file test/phpunit/Front/productTest.php
+ @brief test unitaire class product public
+ @remarks To run this script as CLI: phpunit filename.php
+*/
+// specific for test
+require('_top.php');
+
+// load init language
+$page->init('account.php',$language);
+
+// load class
+include_once($base_path.'includes/classes/drivers/data/product.php');
+include_once($base_path.'includes/classes/Stock.php');
+
+/**
+ * \class productTest
+ */
+class productTest
+ extends PHPUnit_Framework_TestCase
+{
+
+
+ function __construct()
+ {
+ $obj=product::getInstance();
+
+ // force retrun error immediatly
+// product::definePostMess(0);
+ }
+
+ protected function setUp()
+ {
+
+
+ }
+
+ /**
+ * \brief test if not exist user for email in db
+ */
+ public function testproductNotExist(){
+ global $page;
+
+
+ $obj=product::getInstance();
+
+ $this -> assertTrue ( ( is_object( $obj) ) , 'productload driver error' ) ;
+
+
+// $_GET['products_id'] = 7;
+
+ $obj=product::get_item(7);
+
+ $this -> assertTrue ( ( is_object( $obj) ) , 'productload driver error' ) ;
+
+// $this->assertArrayHasKey('id', $row);
+// var_dump($obj);
+
+ foreach($obj as $key=>$value){
+
+ if($key =='products_id')
+ $this -> assertTrue ( ( $value > 0 ) , 'productload driver products_id !! ' ) ;
+
+ }
+// $this->assertClassHasAttribute('products_id', 'objectInfo');
+
+// print_r($obj);
+// exit;
+//
+
+// i)
+// $res=$obj->userTestNotExist($this->user['email_address']);
+
+
+// $this -> assertTrue ( ($res == false) , 'user exists, delete after test ' ) ;
+//
+// if($res == true){
+//
+// $id = product::search('products_email_address', $email, true);
+// $this -> assertTrue ( ($id >0) , 'erreur recup products id exist ' ) ;
+//
+//
+// $obj=product::getInstance($id);
+// $res=$obj->userDelete();
+//
+// $this -> assertTrue ( ($res == false) , 'user delete ' ) ;
+// }
+
+ }
+
+
+ /**
+ * \brief test load user
+ * @param $userId int id product created
+ * @depends testproductNotExist
+ */
+ public function testproductFetch($userId){
+/*
+ $obj=product::getInstance();
+
+ $res=$obj->the_product($userId, true);
+
+ $this -> assertTrue ( (is_array($res) ) , 'load data user not ok' ) ;
+
+ $result = array();
+ foreach($res as $key=>$row)
+ $result[$key] = $row;
+
+ return $result;*/
+ }
+
+
+
+
+}
+
+
+?>
\ No newline at end of file
Modified: trunk/test/phpunit/Front/shippingTest.php
===================================================================
--- trunk/test/phpunit/Front/shippingTest.php 2014-01-20 07:52:43 UTC (rev 5056)
+++ trunk/test/phpunit/Front/shippingTest.php 2014-01-21 09:17:22 UTC (rev 5057)
@@ -135,7 +135,7 @@
$this -> assertTrue ( (count($quote) > 0) , 'error shipping loadclass quote' ) ;
-// print_r($quote);
+
foreach($quote as $row){
@@ -174,7 +174,7 @@
$this -> assertTrue ( ($cheapest !=false) , 'error shipping loadclass cheapest' ) ;
-// print_r($cheapest);
+
$this->checkarraymethod($cheapest);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2014-01-20 07:52:48
|
Revision: 5056
http://sourceforge.net/p/oscss/svn/5056
Author: oscim
Date: 2014-01-20 07:52:43 +0000 (Mon, 20 Jan 2014)
Log Message:
-----------
Fix error next modified process in last commit
Fix and develop test sql_content
Fix test
Modified Paths:
--------------
trunk/catalog/admin/includes/classes/SqlFilesDataDriverClass.php
trunk/catalog/admin/includes/classes/drivers/sqlcategorie.php
trunk/catalog/admin/includes/classes/drivers/sqlcontent.php
trunk/test/phpunit/Back/modules/pages/pagescountrieTest.php
trunk/test/phpunit/Back/sqlxxx/sqlcontentTest.php
Modified: trunk/catalog/admin/includes/classes/SqlFilesDataDriverClass.php
===================================================================
--- trunk/catalog/admin/includes/classes/SqlFilesDataDriverClass.php 2014-01-18 17:28:30 UTC (rev 5055)
+++ trunk/catalog/admin/includes/classes/SqlFilesDataDriverClass.php 2014-01-20 07:52:43 UTC (rev 5056)
@@ -166,7 +166,9 @@
/**
@fn SetsqlArray($sql_array)
@brief
- @param $specimen array obtain, by method specimen
+ @param $specimen array obtain, by method specimen
+ @param $dataarray array is selected by ExtractDataForm, result of $_POST/$_GET and existed in specimen
+ @param $post array result all GET/POST posted in form for exploit by another modules
@return none
*/
public static function PrepaDataAfterUse( $specimen , $dataarray, $post ){
@@ -186,10 +188,10 @@
foreach($item as $k=>$row){
// obtain string value contain in specimen
if(isset($dataarray[$key][$k]))
- self::$sql_array_lg[$k][$key] = (!empty($dataarray[$key][$k])) ? tep_db_prepare_input((string)$dataarray[$key][(int)$k]) : '' ;
+ self::$sql_array_lg[$k][$key] = (!empty($dataarray[$key][$k])) ? tep_db_prepare_input($dataarray[$key][$k]) : '' ;
else{
if(isset($post[$key][$key]))
- self::$sql_array_lg[$k][$key] = (!empty($post[$key][$k])) ? tep_db_prepare_input((string)$post[$key][$k]) : '' ;
+ self::$sql_array_lg[$k][$key] = (!empty($post[$key][$k])) ? tep_db_prepare_input($post[$key][$k]) : '' ;
}
}
}
@@ -200,7 +202,7 @@
/**
@fn GetSqlArray()
- @brief
+ @brief Get current array data Master table
@return array
*/
public static function GetSqlArray() {
@@ -209,7 +211,7 @@
/**
@fn GetSqlArrayLg()
- @brief
+ @brief Get current array data Master table and depend of language
@return array
*/
public static function GetSqlArrayLg() {
Modified: trunk/catalog/admin/includes/classes/drivers/sqlcategorie.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlcategorie.php 2014-01-18 17:28:30 UTC (rev 5055)
+++ trunk/catalog/admin/includes/classes/drivers/sqlcategorie.php 2014-01-20 07:52:43 UTC (rev 5056)
@@ -53,7 +53,7 @@
@return (bool)false Or (Int) id create
*/
public static function create($option){
-
+ new self();
$DB=Database::getInstance();
$error=0;
@@ -87,10 +87,12 @@
if(!$res)
$error++;
}
-
+ else
+ $error++;
+
if( $error > 0){
$DB->rollbackTransaction();
- return $res;
+ return false;
}
else
$categories_id = $res->__get('insertId');
@@ -142,7 +144,7 @@
@brief update record
*/
public static function update($option){
-
+ new self();
$DB=Database::getInstance();
$error= 0;
@@ -374,7 +376,7 @@
@brief delete row
*/
public static function delete($option){
- self::getInstance();
+ new self();
$DB=Database::getInstance();
if(isset($option['id']))
Modified: trunk/catalog/admin/includes/classes/drivers/sqlcontent.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlcontent.php 2014-01-18 17:28:30 UTC (rev 5055)
+++ trunk/catalog/admin/includes/classes/drivers/sqlcontent.php 2014-01-20 07:52:43 UTC (rev 5056)
@@ -37,6 +37,7 @@
$DB=Database::getInstance();
$error=0;
+ $post = array();
if( isset($option['post']) ){
$post = $option['post'];
@@ -45,40 +46,31 @@
$list_languages=tep_get_languages();
$specimen = self::Specimen();
-
- // Put post value
- if(isset($option['post'])){
- $post=$option['post'];
- // Put post value
- self::$modules->load_post_values($post);
- }
+
$dataarray =(isset($option['sqlarray'])? $option['sqlarray'] : array() );
-
+
self::PrepaDataAfterUse( $specimen , $dataarray, $post );
+ $sql_data_array = self::GetSqlArray();
+
+ $DB->beginTransaction();
- $sql_data_array = self::GetSqlArray();
-
if(count($sql_data_array) > 0) {
$sql_data_array['date_added'] = 'now()';
-// $insert_sql_data = array('date_added' => 'now()');
-//
-// $sql_data_array = array_merge($sql_data_array, $insert_sql_data);
+// $sql_data_array = array_merge($sql_data_array, self::$modules->get_insert_table_content());
- // $sql_data_array = array_merge($sql_data_array, self::$modules->get_insert_table_content());
-
$res=tep_db_perform(TABLE_CONTENT, $sql_data_array);
if(!$res)
$error++;
-
-// $content_id =$res->__get('insertId');
}
+ else
+ $error++;
if( $error > 0){
$DB->rollbackTransaction();
- return $res;
+ return false;
}
else
$content_id = $res->__get('insertId');
@@ -128,7 +120,7 @@
$DB=Database::getInstance();
$error=0;
- $languages_id = $option['language_id'];
+ $languages_id = @$option['language_id'];
$where ='';
@@ -139,13 +131,7 @@
$list_languages=tep_get_languages();
$specimen = self::Specimen();
-
- // Put post value
- if(isset($option['post'])){
- $post=$option['post'];
- // Put post value
- self::$modules->load_post_values($post);
- }
+
$dataarray =(isset($option['sqlarray'])? $option['sqlarray'] : array() );
self::PrepaDataAfterUse( $specimen , $dataarray, $post );
@@ -391,7 +377,8 @@
$list_languages=tep_get_languages();
- $result = array('content_id' => '',
+ $result = array(
+ 'content_id' => 0,
'content_name' => '',
'date_added' => '',
'last_modified' => '',
@@ -516,10 +503,10 @@
$object= new stdclass();
foreach($array as $key=>$value){
- if( strpos($key,'content_') ===0)
- $key=substr($key,8);
+ if( strpos($key,'content_') ===0)
+ $key=substr($key,8);
- $object->$key = $value;
+ $object->$key = $value;
}
return $object;
Modified: trunk/test/phpunit/Back/modules/pages/pagescountrieTest.php
===================================================================
--- trunk/test/phpunit/Back/modules/pages/pagescountrieTest.php 2014-01-18 17:28:30 UTC (rev 5055)
+++ trunk/test/phpunit/Back/modules/pages/pagescountrieTest.php 2014-01-20 07:52:43 UTC (rev 5056)
@@ -58,7 +58,7 @@
@brief test methode GetDBValue
@depends testcountrieConf
*/
- public function testadminsuersGetDBValue($objtmp){
+ public function testcountriesGetDBValue($objtmp){
// action default : listing
$res = countries::tep_get_list();
@@ -75,7 +75,7 @@
@brief test display flag action
@depends testcountrieConf
*/
- public function testadminsuersPrintFlag($objtmp){
+ public function testcountriesPrintFlag($objtmp){
$action = 'setflag';
$get = array();
@@ -83,15 +83,16 @@
$get['cID'] = 1;
$res = $this->CheckAction($objtmp,$action, $get);
- $this->assertTrue ( ( strlen($res) ==352) , 'Error retrun action::'.$action) ;
+ $this->assertTrue ( ( strlen($res) >300) , 'Error retrun action::'.$action) ;
+
}
/**
@brief test display form new customers
@depends testcountrieConf
*/
- public function testadminsuersPrintNew($objtmp){
+ public function testcountriesPrintNew($objtmp){
$action = 'new';
$get = array();
@@ -105,7 +106,7 @@
@brief test display form edit
@depends testcountrieConf
*/
- public function testadminsuersPrintEdit($objtmp){
+ public function testcountriesPrintEdit($objtmp){
$action = 'edit';
@@ -121,7 +122,7 @@
@brief test display form edit
@depends testcountrieConf
*/
- public function testadminsuersPrintDelete($objtmp){
+ public function testcountriesPrintDelete($objtmp){
$action = 'delete';
Modified: trunk/test/phpunit/Back/sqlxxx/sqlcontentTest.php
===================================================================
--- trunk/test/phpunit/Back/sqlxxx/sqlcontentTest.php 2014-01-18 17:28:30 UTC (rev 5055)
+++ trunk/test/phpunit/Back/sqlxxx/sqlcontentTest.php 2014-01-20 07:52:43 UTC (rev 5056)
@@ -33,50 +33,81 @@
}
+ /**
+ @brief load Specimen and check result
+ @return array
+ */
+ public function testsqlcontentSpecimen(){
+ $specimen = array();
+ $tmp = sqlcontent::Specimen(true);
+
+ $this->assertTrue ( ( is_object($tmp) ) , 'Error sqlcontent Specimen return object' ) ;
+
+
+ foreach($tmp as $key=>$val)
+ $specimen[$key] = $val;
+
+
+ $this->assertTrue ( ( is_array($specimen) ) , 'Error sqlcontent Specimen convert' ) ;
+
+
+ return array(
+// 'id'=>$id,
+ 'sqlarray'=>$specimen,
+ 'post'=>$specimen,
+ );
+ }
/**
* \brief test creat account user
+ @depends testsqlcontentSpecimen
*/
- public function testcontentCreat(){
+ public function testcontentCreat($array){
- $this->specimen['language_id'] = 1;
- $this->specimen['sql_data_array'] = $this->specimen;
- $res = sqlcontent::create($this->specimen);
+ $res = sqlcontent::create($array);
- self::$Id=$res;
+ $array['id']=$res;
sqlcontent::Maintenance();
- $this -> assertTrue ( ($res >=0) , 'Error content not create' ) ;
+ $this -> assertTrue ( ($res >0) , 'Error content not create' ) ;
+
+ return $array;
}
/**
*
+ @depends testcontentCreat
*/
- public function testcontentUpdate(){
+ public function testcontentUpdate($array){
- $res=sqlcontent::fetch( array('id'=>self::$Id) );
+ $res=sqlcontent::fetch( array('id'=>$array['id']) );
$this -> assertTrue ( (is_array($res ) ) , 'content not exists, not test possible ' ) ;
- $this->specimen['id'] = self::$Id;
- $this->specimen['sql_data_array'] = $this->specimen;
+ $array['content_status'] = 0;
+ $res = sqlcontent::update($array);
- $res = sqlcontent::update($this->specimen);
+ $this -> assertTrue ( ($res == 1) , 'Error content not update' ) ;
+
+ $array['content_status'] = 1;
+ $res = sqlcontent::update($array);
+
$this -> assertTrue ( ($res == 1) , 'Error content not update' ) ;
-
}
/**
- *
+ @fn testcontentDelete($array)
+ @param array content all current rows manipulate
+ @depends testcontentCreat
*/
- public function testcontentDelete(){
+ public function testcontentDelete($array){
- $res = sqlcontent::delete( array('id'=>self::$Id) );
+ $res = sqlcontent::delete( array('id'=>$array['id'] ) );
$this -> assertTrue ( ($res == true ) , 'Error content not delete' ) ;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2014-01-18 17:28:33
|
Revision: 5055
http://sourceforge.net/p/oscss/svn/5055
Author: oscim
Date: 2014-01-18 17:28:30 +0000 (Sat, 18 Jan 2014)
Log Message:
-----------
Progess in dev and rationnalize data in sqlxx files
Fix and impelment in products, categorie, content
Adjust modele in dev generator
add Unittest
Fix other bug minor
Modified Paths:
--------------
trunk/catalog/admin/includes/classes/drivers/sqlcategorie.php
trunk/catalog/admin/includes/classes/drivers/sqlcontent.php
trunk/catalog/admin/includes/classes/drivers/sqlproduct.php
trunk/catalog/admin/includes/classes/fileUtility.php
trunk/catalog/admin/includes/modules/account/account_extra.php
trunk/catalog/admin/includes/modules/pages/categories.php
trunk/catalog/admin/includes/modules/pages/cms_content.php
trunk/catalog/common/classes/ExtraUtility.php
trunk/catalog/common/classes/FieldsDisplay.php
trunk/catalog/install/includes/classes/core.php
trunk/dev/generator/datatype/Modele/catalog/admin/includes/classes/drivers/sql_DATATYPE_REPLACE_.php
trunk/dev/generator/datatype/Modele/catalog/admin/includes/modules/pages/_DATATYPE_REPLACE_s.php
trunk/dev/generator/datatype/Modele/sql/mysql/install/tables/osc__DATATYPE_REPLACE_.sql
trunk/test/phpunit/Back/modules/pages/pagesbackupTest.php
Added Paths:
-----------
trunk/catalog/admin/includes/classes/SqlFilesDataDriverClass.php
trunk/test/phpunit/Back/sqlxxx/sqlautomaticTest.php
Added: trunk/catalog/admin/includes/classes/SqlFilesDataDriverClass.php
===================================================================
--- trunk/catalog/admin/includes/classes/SqlFilesDataDriverClass.php (rev 0)
+++ trunk/catalog/admin/includes/classes/SqlFilesDataDriverClass.php 2014-01-18 17:28:30 UTC (rev 5055)
@@ -0,0 +1,222 @@
+<?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 18/01/2014, 18:17
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+ @file SqlFilesDataDriverClass.php
+ @dir admin/includes/classes/
+*/
+
+/**
+ @class SqlFilesDataDriverClass
+ @brief is class master for subclass sqlxxx
+ This class implements base of methode for manipulate and create/update/delete/fetch by simple class sqlxxx
+*/
+Class SqlFilesDataDriverClass
+ {
+ /**
+ @var boolean use submodule in this class
+ */
+ public $use_modules = false;
+ /**
+ @var string Type of current data
+ */
+ public static $DataDriverType;
+ /**
+ @var array list of submodule for this type and instance value
+ */
+ public static $modules;
+ /**
+ @var ressource current instance class for call in singletown
+ */
+ protected static $_instance;
+ /**
+ @var array result after PrepaDataAfterUse for master class
+ */
+ protected static $sql_array = array();
+ /**
+ @var array result after method PrepaDataAfterUse for language tables
+ */
+ protected static $sql_array_lg = array();
+
+ /**
+ @fn __construct()
+ @brief constructor
+ */
+ protected function __construct(){
+ $this->init();
+ }
+
+ /**
+ @fn init()
+ @brief for init subchilds and other option
+ */
+ public function init(){
+
+ self::$DataDriverType = substr(get_class($this), 3);
+
+ if($this->use_modules) {
+ self::$modules=new AcaFactory(self::$DataDriverType);
+ self::$modules->set_image_handler();
+ }
+ }
+
+ /**
+ @fn getInstance()
+ @brief singletown class
+ @return $instance ressource
+ */
+ public static function getInstance() {
+ if(self::$_instance == null) self::$_instance = new self();
+ return self::$_instance;
+ }
+
+
+
+ /**
+ @brief Check image cat and add or /delete
+ Adjust process, return path img if ok
+ @param $image string path img input
+ @param $no_img (null or string "on") chekbox no image
+ @return (string) path or empty
+ */
+ public static function AddImage($image='', $no_img='off'){
+
+ if (tep_not_null($image) && ($image != 'none')){
+ if( strpos($image,DIR_WS_CATALOG_IMAGES) ===0 )
+ $image = tep_db_prepare_input(substr($image, strlen( DIR_WS_CATALOG_IMAGES) ) );
+ else
+ $image = tep_db_prepare_input($image);
+ }
+
+ $image =(empty($image) || ( $no_img=='on') ) ? '' : tep_db_prepare_input($image) ;
+
+ return $image;
+ }
+
+
+ /**
+ @fn ExtractDataForm($data)
+ @brief extract data forms for put in db
+ @param $specimen array modele
+ @param $data array receveid by GET/POST
+ @return array
+ */
+ public static function ExtractDataForm($specimen, $data){
+
+ $sqlarray = array();
+
+ if(!is_array($specimen))
+ return $sqlarray;
+
+
+ foreach($specimen as $key=>$item){
+ if($key != self::$DataDriverType.'_id')
+ if(is_int($item) || is_bool($modele[$key]))
+ $sqlarray[$key] = (isset($data[$key]) ? tep_db_prepare_input((int)$data[$key]) : $item);
+ elseif(is_string($item)){
+
+ // implements support for multi image in this data
+ // and possible delete by checkbox
+ if($key == self::$DataDriverType.'_image'){
+ 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) );
+
+ if (isset($data[$key.'_add']) && !empty($data[$key.'_add']) )
+ $img[] = (string)self::AddImage($data[$key.'_add']);
+
+ if (is_array($img) && count($img) > 0 ){
+ $list_img = array();
+ foreach($img as $row){
+ if( is_string($row)) {
+ $sqli=sqlimage::fetch(array('pathkey'=>md5(DIR_WS_IMAGES.$row) ), true);
+
+ if($sqli->rowid > 0)
+ $list_img[] = $sqli->rowid;
+ }
+ elseif( (int)$row > 0)
+ $list_img[] = $row;
+ }
+ $sqlarray[$key]=implode('|', $list_img);
+ }
+ else
+ $sqlarray[$key]='';
+ }
+ else
+ $sqlarray[$key] = (isset($data[$key]) ? tep_db_prepare_input((string)$data[$key]) : $item);
+ }
+ elseif(is_array($item)){
+ foreach($item as $k=>$row)
+ if(is_int($row[$k]) || is_bool($modele[$key]))
+ $sqlarray[$key][$k] = (isset($data[$key][$k]) ? tep_db_prepare_input((int)$data[$key][$k]) : $row[$k]);
+ elseif(is_string($row[$k]))
+ $sqlarray[$key][$k] = (isset($data[$key][$k]) ? tep_db_prepare_input((string)$data[$key][$k]) : $row[$k]);
+ }
+ }
+
+ return $sqlarray;
+ }
+
+
+ /**
+ @fn SetsqlArray($sql_array)
+ @brief
+ @param $specimen array obtain, by method specimen
+ @return none
+ */
+ public static function PrepaDataAfterUse( $specimen , $dataarray, $post ){
+
+ // call specimen and report value for defined key
+ foreach($specimen as $key=>$item) {
+ // obtain string value contain in specimen
+ if(!is_array($item)){
+ if(isset($dataarray[$key]))
+ self::$sql_array[$key] = (!empty($dataarray[$key])) ? tep_db_prepare_input((string)$dataarray[$key]) : $item ;
+ else{
+ if(isset($post[$key]))
+ self::$sql_array[$key] = (!empty($post[$key])) ? tep_db_prepare_input((string)$post[$key]) : $item ;
+ }
+ }
+ else{
+ foreach($item as $k=>$row){
+ // obtain string value contain in specimen
+ if(isset($dataarray[$key][$k]))
+ self::$sql_array_lg[$k][$key] = (!empty($dataarray[$key][$k])) ? tep_db_prepare_input((string)$dataarray[$key][(int)$k]) : '' ;
+ else{
+ if(isset($post[$key][$key]))
+ self::$sql_array_lg[$k][$key] = (!empty($post[$key][$k])) ? tep_db_prepare_input((string)$post[$key][$k]) : '' ;
+ }
+ }
+ }
+ }
+
+ }
+
+
+ /**
+ @fn GetSqlArray()
+ @brief
+ @return array
+ */
+ public static function GetSqlArray() {
+ return self::$sql_array;
+ }
+
+ /**
+ @fn GetSqlArrayLg()
+ @brief
+ @return array
+ */
+ public static function GetSqlArrayLg() {
+ return self::$sql_array_lg;
+ }
+
+}
+
+
+?>
\ No newline at end of file
Modified: trunk/catalog/admin/includes/classes/drivers/sqlcategorie.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlcategorie.php 2014-01-18 07:44:42 UTC (rev 5054)
+++ trunk/catalog/admin/includes/classes/drivers/sqlcategorie.php 2014-01-18 17:28:30 UTC (rev 5055)
@@ -1,51 +1,48 @@
<?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 30/03/2012, 09:32
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
- @class sqlcategorie
+ @file sqlcategorie.php
+ @dir admin/includes/classes/drivers/
*/
+require_once( DIR_FS_ADMIN . DIR_WS_CLASSES . 'SqlFilesDataDriverClass.php');
+error_reporting(E_ALL);
+/**
+ @class sqlcategorie
+*/
class sqlcategorie
+ extends SqlFilesDataDriverClass
implements ModSqlDataDriver{
+
/**
- @var object childs module class
+ @var boolean use submodule in this class
*/
- public static $modules;
+ public $use_modules = true;
+
/**
- @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(){
- /**
- TODO : remplacer le nom de constante par un MODULE_CATEGORIES_INSTALLED_BO
- */
- self::$modules=new AcaFactory('categories','MODULE_ACACAT_INSTALLED_BO');
- self::$modules->set_image_handler();
- }
- /**
- @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;
+ /**
+ @fn init()
+ @brief for init subchilds and other option
+ */
+ public function init(){
+ self::$DataDriverType = 'categories';
+
+ if($this->use_modules) {
+ self::$modules=new AcaFactory(self::$DataDriverType,'MODULE_ACACAT_INSTALLED_BO');
+ self::$modules->set_image_handler();
+ }
}
@@ -57,36 +54,44 @@
*/
public static function create($option){
- self::getInstance();
-
- if( ! isset($option['sqlarray']) )
- return false;
- else
- $sqlarray = (array)$option['sqlarray'];
-
-
- $post = ( isset($option['post'])? $option['post'] : array() );
-
+ $DB=Database::getInstance();
+ $error=0;
+
+ if( isset($option['post']) ){
+ $post = $option['post'];
+ self::$modules->load_post_values($post);
+ }
+
$list_languages=tep_get_languages();
-
- $sql_data_array['date_added'] = 'now()';
- $sql_data_array['sort_order'] = (!empty($sqlarray['sort_order']) ? tep_db_prepare_input((int)$sqlarray['sort_order']) : 0 );
- $sql_data_array['parent_id'] = (!empty($sqlarray['parent_id']) ? tep_db_prepare_input((int)$sqlarray['parent_id']) : 0 );
-
- $sql_data_array['categories_status'] = (!empty($sqlarray['status'])) ? tep_db_prepare_input((int)$sqlarray['status']) : 0 ;
- $sql_data_array['categories_hidden'] = (!empty($sqlarray['hidden'])) ? tep_db_prepare_input((int)$sqlarray['hidden']) : 0 ;
- $sql_data_array['categories_datatype'] = (!empty($sqlarray['datatype'])) ? tep_db_prepare_input($sqlarray['datatype']) : '' ;
-
+ $specimen = self::Specimen();
+
// Put post value
- self::$modules->load_post_values($post);
+ if(isset($option['post'])){
+ $post=$option['post'];
+ // Put post value
+ self::$modules->load_post_values($post);
+ }
+ $dataarray =(isset($option['sqlarray'])? $option['sqlarray'] : array() );
+
+ self::PrepaDataAfterUse( $specimen , $dataarray, $post );
+
+
+ $sql_data_array = self::GetSqlArray();
+
- self::$modules->get_insert_table_categories($sql_data_array,'');
+ if(count($sql_data_array) > 0){
+ self::$modules->get_insert_table_categories($sql_data_array,'');
- $res=tep_db_perform(TABLE_CATEGORIES, $sql_data_array);
+ $res=tep_db_perform(TABLE_CATEGORIES, $sql_data_array);
+
+ if(!$res)
+ $error++;
+ }
-
- if(!$res)
+ if( $error > 0){
+ $DB->rollbackTransaction();
return $res;
+ }
else
$categories_id = $res->__get('insertId');
@@ -120,7 +125,16 @@
/// Child module, Call After Update process
self::$modules->after_update($categories_id);
- return $categories_id;
+
+ if( $error > 0){
+ $DB->rollbackTransaction();
+ return false;
+ }
+ else{
+ $DB->commitTransaction();
+ return $categories_id;
+ }
+
}
@@ -128,8 +142,7 @@
@brief update record
*/
public static function update($option){
-
- self::getInstance();
+
$DB=Database::getInstance();
$error= 0;
@@ -143,40 +156,45 @@
$post = $option['post'];
$list_languages=tep_get_languages();
-
+ $specimen = self::Specimen();
+
+ // Put post value
+ if(isset($option['post'])){
+ $post=$option['post'];
+ // Put post value
+ self::$modules->load_post_values($post);
+ }
+ $dataarray =(isset($option['sqlarray'])? $option['sqlarray'] : array() );
+
+ self::PrepaDataAfterUse( $specimen , $dataarray, $post );
+
+
+ $sql_data_array = self::GetSqlArray();
+
+
$DB->beginTransaction();
- $sql_data_array = $option['sqlarray'];
-
- $sql_data_array['last_modified'] = 'now()';
- if(isset($sql_data_array['sort_order']))
- $sql_data_array['sort_order'] = (!empty($sql_data_array['sort_order'])) ? tep_db_prepare_input((int)$sql_data_array['sort_order']) : 0 ;
- if(isset($sql_data_array['parent_id']))
- $sql_data_array['parent_id'] = (!empty($sql_data_array['parent_id'])) ? tep_db_prepare_input((int)$sql_data_array['parent_id']) : 0 ;
- if(isset($sql_data_array['categories_cpath']))
+ if(count($sql_data_array) > 0){
$sql_data_array['categories_cpath'] = categorieUtility::get_generated_category_path_ids($id,'category');
- if(isset($sql_data_array['categories_status']))
- $sql_data_array['categories_status'] = (!empty($sql_data_array['categories_status'])) ? tep_db_prepare_input((int)$sql_data_array['categories_status']) : 0 ;
- if(isset($sql_data_array['categories_hidden']))
- $sql_data_array['categories_hidden'] = (!empty($sql_data_array['categories_hidden'])) ? tep_db_prepare_input((int)$sql_data_array['categories_hidden']) : 0 ;
- if(!empty($sql_data_array['categories_datatype']))
- $sql_data_array['categories_datatype'] = tep_db_prepare_input($sql_data_array['categories_datatype']) ;
-
- // Put post value
- self::$modules->load_post_values($post);
-
+ $sql_data_array['last_modified'] = 'now()';
+// $sql_data_array['user_modified'] = (int)@$_SESSION['login_id'];
+
foreach((array)self::$modules->get_update_table_categories($id, $sql_data_array) as $module=>$value)
if(is_array($value))
foreach($value as $key=>$row)
$sql_data_array[$key] = $row;
- if(count($sql_data_array) > 0 )
- if( ! tep_db_perform(TABLE_CATEGORIES, $sql_data_array, 'update', "categories_id = '" . $id . "'") )
- $error++;
-
+ if(count($sql_data_array) > 0 )
+ if( ! tep_db_perform(TABLE_CATEGORIES, $sql_data_array, 'update', "categories_id = '" . $id . "'") )
+ $error++;
+ }
+
+
+
$categories_name_array = $post['categories']['categories_name'];
$categories_desc_array = $post['categories']['categories_description'];
+// $sql_data_array = self::GetSqlArrayLg();
for ($i=0, $n=sizeof($list_languages); $i<$n; $i++) {
@@ -247,7 +265,9 @@
*/
public static function fetch($option,$shortkey=false){
- self::getInstance();
+
+ new self();
+
$DB=Database::getInstance();
$languages_id = 0;
@@ -515,7 +535,7 @@
'parent_id'=>0,
'sort_order'=>0,
'categories_id'=>null,
- 'categories_image'=>DIR_WS_CATALOG_IMAGES.IMAGE_NONEXISTENT,
+ 'categories_image'=>null,
'categories_status'=>null,
'categories_hidden'=>null,
);
@@ -527,30 +547,20 @@
return ((!$shortkey)? $result : self::CleanKey($result));
}
+ /**
+ @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);
+ }
- /**
- @brief Check image cat and add or /delete
- Adjust process, return path img if ok
- @param $cat_image string path img input
- @param $no_img (null or string "on") chekbox no image
- @return (string) path or empty
- */
- public static function AddImage($cat_image='', $no_img='off'){
- if (tep_not_null($cat_image) && ($cat_image != 'none')){
- if( strpos($cat_image,DIR_WS_CATALOG_IMAGES) ===0 )
- $cat_image = tep_db_prepare_input(substr($cat_image, strlen( DIR_WS_CATALOG_IMAGES) ) );
- else
- $cat_image = tep_db_prepare_input($cat_image);
- }
-
- $cat_image =(empty($cat_image) || (/*$no_img=='' &&*/ $no_img=='on') ) ? '' : tep_db_prepare_input($cat_image) ;
-
- return $cat_image;
- }
-
-
/**
@fn MaintenanceTables()
@brief clean and maintient link table and data
Modified: trunk/catalog/admin/includes/classes/drivers/sqlcontent.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlcontent.php 2014-01-18 07:44:42 UTC (rev 5054)
+++ trunk/catalog/admin/includes/classes/drivers/sqlcontent.php 2014-01-18 17:28:30 UTC (rev 5055)
@@ -1,33 +1,30 @@
<?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 12/02/2013, 20:11
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
+ @file sqlcontent.php
+ @dir admin/includes/classes/drivers/
+*/
+require_once( DIR_FS_ADMIN . DIR_WS_CLASSES . 'SqlFilesDataDriverClass.php');
+
+/**
+ @class sqlcontent
*/
-
class sqlcontent
+ extends SqlFilesDataDriverClass
implements ModSqlDataDriver{
+ /**
+ @var boolean use submodule in this class
+ */
+ public $use_modules = true;
- public static $modules;
- protected static $_instance;
-
- protected function __construct(){
- self::$modules=new AcaFactory('content'/*,'MODULE_CONTENT_INSTALLED_BO'*/);
- self::$modules->set_image_handler();
- }
-
- public static function getInstance() {
- if(self::$_instance == null) self::$_instance = new self();
- return self::$_instance;
- }
-
-
/**
@brief create new ligne in table configuration
@param $option array
@@ -35,31 +32,58 @@
*/
public static function create($option){
- self::getInstance();
- $DB=Database::getInstance();
+ new self();
+
+ $DB=Database::getInstance();
+ $error=0;
+
+ if( isset($option['post']) ){
+ $post = $option['post'];
+ self::$modules->load_post_values($post);
+ }
+
$list_languages=tep_get_languages();
-
+ $specimen = self::Specimen();
+
// Put post value
if(isset($option['post'])){
$post=$option['post'];
- self::$modules->load_post_values($post);
+ // Put post value
+ self::$modules->load_post_values($post);
}
+ $dataarray =(isset($option['sqlarray'])? $option['sqlarray'] : array() );
+
+ self::PrepaDataAfterUse( $specimen , $dataarray, $post );
+
+
+ $sql_data_array = self::GetSqlArray();
- $sql_data_array = (isset($option['sqlarray'])? $option['sqlarray'] : array() );
+ if(count($sql_data_array) > 0) {
+ $sql_data_array['date_added'] = 'now()';
+// $insert_sql_data = array('date_added' => 'now()');
+//
+// $sql_data_array = array_merge($sql_data_array, $insert_sql_data);
- $insert_sql_data = array('date_added' => 'now()');
- $sql_data_array = array_merge($sql_data_array, $insert_sql_data);
+ // $sql_data_array = array_merge($sql_data_array, self::$modules->get_insert_table_content());
+ $res=tep_db_perform(TABLE_CONTENT, $sql_data_array);
-// $sql_data_array = array_merge($sql_data_array, self::$modules->get_insert_table_content());
-
- $resobj=tep_db_perform(TABLE_CONTENT, $sql_data_array);
-
- $content_id =$resobj->__get('insertId');
-
-
+ if(!$res)
+ $error++;
+
+// $content_id =$res->__get('insertId');
+ }
+
+ if( $error > 0){
+ $DB->rollbackTransaction();
+ return $res;
+ }
+ else
+ $content_id = $res->__get('insertId');
+
+
for ($i=0, $n=sizeof($list_languages); $i<$n; $i++) {
$language_id = $list_languages[$i]['id'];
@@ -80,7 +104,14 @@
self::$modules->create($content_id);
- return $content_id;
+ if( $error > 0){
+ $DB->rollbackTransaction();
+ return false;
+ }
+ else{
+ $DB->commitTransaction();
+ return $content_id;
+ }
}
/**
@@ -88,37 +119,45 @@
*/
public static function update($option){
- self::getInstance();
- $DB=Database::getInstance();
+ new self();
+ if(!isset($option['id']))
+ return false;
+ else
+ $content_id = (int)$option['id'];
+
+ $DB=Database::getInstance();
+ $error=0;
+ $languages_id = $option['language_id'];
+ $where ='';
+
+
+ if( isset($option['post']) ){
+ $post = $option['post'];
+ self::$modules->load_post_values($post);
+ }
+
$list_languages=tep_get_languages();
- $where ='';
- $error = 0 ;
-// $languages_id = $option['language_id'];
-
- if(isset($option['id'])){
- $content_id = (int)$option['id'];
- $post['content_id'] = $content_id;
- }
-
+ $specimen = self::Specimen();
+
// Put post value
if(isset($option['post'])){
$post=$option['post'];
- self::$modules->load_post_values($post);
+ // Put post value
+ self::$modules->load_post_values($post);
}
+ $dataarray =(isset($option['sqlarray'])? $option['sqlarray'] : array() );
+
+ self::PrepaDataAfterUse( $specimen , $dataarray, $post );
+
+
+ $sql_data_array = self::GetSqlArray();
+
+ $DB->beginTransaction();
- $sql_data_array =(isset($option['sqlarray'])? $option['sqlarray'] : array() );
- $update_sql_data = array('last_modified' => 'now()');
- $sql_data_array = array_merge($sql_data_array, $update_sql_data);
- self::$modules->load_post_values($post);
-
- $DB->beginTransaction();
-
-
$sql_data_array = array_merge($sql_data_array, self::$modules->get_update_table_content());
-
if(count($sql_data_array) > 0 )
if ( ! tep_db_perform(TABLE_CONTENT, $sql_data_array, 'update', "content_id = '" . (int)$content_id . "'") )
$error++;
@@ -187,7 +226,8 @@
*/
public static function fetch($option,$shortkey=false){
- self::getInstance();
+ new self();
+
$DB=Database::getInstance();
$error= 0;
@@ -298,7 +338,7 @@
*/
public static function delete($option){
- self::getInstance();
+ new self();
$DB=Database::getInstance();
$res = false;
@@ -400,38 +440,6 @@
case 'duplicate':
default:
-// $product_query = $DB->query("select products_type, products_quantity, products_model, products_image, products_price, products_date_available, products_weight, products_tax_class_id, manufacturers_id from " . TABLE_PRODUCTS . " where products_id = '" . $pid . "'");
-// $product = $product_query->fetchAssoc();
-//
-// $resobj=$DB->query("insert into " . TABLE_PRODUCTS . " (products_type, products_quantity, products_model,products_image, products_price, products_date_added, products_date_available, products_weight, products_status, products_tax_class_id, manufacturers_id) values ('" . tep_db_input($product['products_type']) . "','" . tep_db_input($product['products_quantity']) . "', '" . tep_db_input($product['products_model']) . "', '" . tep_db_input($product['products_image']) . "', '" . tep_db_input($product['products_price']) . "', now(), " . (empty($product['products_date_available']) ? "null" : "'" . tep_db_input($product['products_date_available']) . "'") . ", '" . tep_db_input($product['products_weight']) . "', '0', '" . (int)$product['products_tax_class_id'] . "', '" . (int)$product['manufacturers_id'] . "')");
-//
-// $dup_products_id = tep_db_insert_id($resobj);
-//
-//
-// $description_query = $DB->query("select language_id, products_name, products_description, products_url from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . $pid . "'");
-// while ($description =$description_query->fetchAssoc()) {
-// $DB->query("insert into " . TABLE_PRODUCTS_DESCRIPTION . " (products_id, language_id, products_name, products_description, products_url, products_viewed) values ('" . (int)$dup_products_id . "', '" . (int)$description['language_id'] . "', '" . tep_db_input($description['products_name']) . "', '" . tep_db_input($description['products_description']) . "', '" . tep_db_input($description['products_url']) . "', '0')");
-// }
-//
-// $DB->query("insert into " . TABLE_PRODUCTS_TO_CATEGORIES . " (products_id, categories_id) values ('" . (int)$dup_products_id . "', '" . $catid . "')");
-//
-// // BOF Separate Pricing Per Customer
-// $cg_price_query = $DB->query("select customers_group_id, customers_group_price from " . TABLE_PRODUCTS_GROUPS . " where products_id = '" . $pid . "' order by customers_group_id");
-//
-// // insert customer group prices in table products_groups when there are any for the copied product
-// if ($cg_price_query->__get('numRows') > 0) {
-// while ( $cg_prices = $cg_price_query->fetchAssoc()) {
-// $DB->query("insert into " . TABLE_PRODUCTS_GROUPS . " (customers_group_id, customers_group_price, products_id) values ('" . (int)$cg_prices['customers_group_id'] . "', '" . tep_db_input($cg_prices['customers_group_price']) . "', '" . (int)$dup_products_id . "')");
-// }
-// }
-//
-// // ACA START DUPLICATE PRODUCT
-// self::$modules->duplicate_product($products_id,$dup_products_id);
-//
-//
-// $products_id = $dup_products_id;
-
-
}
@@ -487,6 +495,17 @@
}
+ /**
+ @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()
Modified: trunk/catalog/admin/includes/classes/drivers/sqlproduct.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlproduct.php 2014-01-18 07:44:42 UTC (rev 5054)
+++ trunk/catalog/admin/includes/classes/drivers/sqlproduct.php 2014-01-18 17:28:30 UTC (rev 5055)
@@ -1,36 +1,45 @@
<?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 30/09/2013, 23:13
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
- @class manage link table products
+ @file sqlproduct.php
+ @dir admin/includes/classes/drivers/
*/
+require_once( DIR_FS_ADMIN . DIR_WS_CLASSES . 'SqlFilesDataDriverClass.php');
-
+/**
+ @class sqlproduct
+*/
class sqlproduct
+ extends SqlFilesDataDriverClass
implements ModSqlDataDriver{
+ /**
+ @var boolean use submodule in this class
+ */
+ public $use_modules = true;
- public static $modules;
-
- protected static $_instance;
-
- protected function __construct(){
- self::$modules=new productsACA;
- self::$modules->set_image_handler();
+ /**
+ @fn init()
+ @brief for init subchilds and other option
+ */
+ public function init(){
+ self::$DataDriverType = 'products';
+
+ if($this->use_modules) {
+ self::$modules=new productsACA;
+ self::$modules->set_image_handler();
+ }
+
+// print_r(self::$modules);
}
- public static function getInstance() {
- if(self::$_instance == null) self::$_instance = new self();
- return self::$_instance;
- }
-
-
/**
@brief create new ligne in table configuration
@param $option array
@@ -39,7 +48,7 @@
*/
public static function create($option){
global $languages_id;
- self::getInstance();
+ new self();
$DB=Database::getInstance();
$error=0;
// if(!isset($option['key'])) return 'key';
@@ -101,7 +110,7 @@
*/
public static function update($option){
- self::getInstance();
+ new self();
$DB=Database::getInstance();
$error=0;
@@ -250,8 +259,8 @@
*/
public static function fetch($option,$shortkey=false){
+ new self();
- self::getInstance();
$DB=Database::getInstance();
// $price=price::getInstance();
@@ -373,7 +382,7 @@
*/
public static function delete($option){
- self::getInstance();
+ new self();
$DB=Database::getInstance();
$res = false;
@@ -486,7 +495,7 @@
return false;
- self::getInstance();
+ new self();
$DB=Database::getInstance();
@@ -636,7 +645,18 @@
return $products_count;
}
-
+ /**
+ @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
@@ -646,10 +666,10 @@
$object= new stdclass();
foreach($array as $key=>$value){
- if( strpos($key,'products_') ===0)
- $key=substr($key,9);
+ if( strpos($key,'products_') ===0)
+ $key=substr($key,9);
- $object->$key = $value;
+ $object->$key = $value;
}
return $object;
Modified: trunk/catalog/admin/includes/classes/fileUtility.php
===================================================================
--- trunk/catalog/admin/includes/classes/fileUtility.php 2014-01-18 07:44:42 UTC (rev 5054)
+++ trunk/catalog/admin/includes/classes/fileUtility.php 2014-01-18 17:28:30 UTC (rev 5055)
@@ -426,8 +426,8 @@
if($optionnal !=null)
$optionnal = ' '.constant('ZipArchive::'.$optionnal);
- if(substr($archive, 0, 1) == '/')
- $archive = substr($archive, 1);
+// if(substr($archive, 0, 1) == '/')
+// $archive = substr($archive, 1);
try {
$zip = new ZipArchive;
Modified: trunk/catalog/admin/includes/modules/account/account_extra.php
===================================================================
--- trunk/catalog/admin/includes/modules/account/account_extra.php 2014-01-18 07:44:42 UTC (rev 5054)
+++ trunk/catalog/admin/includes/modules/account/account_extra.php 2014-01-18 17:28:30 UTC (rev 5055)
@@ -6,14 +6,18 @@
@date 05/01/2014, 12:45
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
- @class account_extra
- @brief This module is use generic fields, not use for fields content one owner (for fields_special_mod is null )
+ @file account_extra.php
+ @dir admin/includes/modules/account/
*/
-// var_dump( include_once( DIR_FS_CATALOG . DIR_WS_COMMON_CLASSES . 'ExtraUtility.php') );
-// exit;
-include_once( DIR_FS_CATALOG . DIR_WS_COMMON_CLASSES . 'ExtraUtility.php');
+
+require_once( DIR_FS_CATALOG . DIR_WS_COMMON_CLASSES . 'ExtraUtility.php');
+
+/**
+ @class account_extra
+ @brief This module is use generic fields, not use for fields content one owner (for fields_special_mod is null )
+*/
class account_extra
implements InterfaceModule{
/**
Modified: trunk/catalog/admin/includes/modules/pages/categories.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/categories.php 2014-01-18 07:44:42 UTC (rev 5054)
+++ trunk/catalog/admin/includes/modules/pages/categories.php 2014-01-18 17:28:30 UTC (rev 5055)
@@ -7,7 +7,8 @@
@date 22/09/2013, 09:32
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
- @brief manage category and module aca for cat
+ @file categories.php
+ @dir admin/includes/modules/pages/
*/
@@ -484,41 +485,24 @@
/**
CATEGORIES
*/
+
case 'insert':
+ case 'update':
- $params['sqlarray'] = array(
- 'sort_order' => (isset($_POST['sort_order'])) ? tep_db_prepare_input((int)$_POST['sort_order']) : 0 ,
- 'parent_id' => (isset($_POST['cPath'])) ? tep_db_prepare_input($_POST['cPath']) : 0,
- 'status' => (isset($_POST['categories_status'])) ? tep_db_prepare_input((int)$_POST['categories_status']) : 0,
- 'hidden' => (isset($_POST['categories_hidden'])) ? tep_db_prepare_input((int)$_POST['categories_hidden']) : 0 ,
- 'datatype' => (isset($_POST['categories_datatype'])&& $_POST['categories_datatype'] !='on') ? tep_db_prepare_input((string)$_POST['categories_datatype']) : '' ,
- 'cPath' => (isset($_POST['cPath'])) ? tep_db_prepare_input($_POST['cPath']) : 0,
- );
-
- if (!isset($_POST['categories_image_no']) && !empty($_POST['categories_image']) )
- $params['sqlarray']['categories_image']=sqlcategorie::AddImage(@$_POST['categories_image'], @$_POST['categories_image_no']);
- else
- $params['sqlarray']['categories_image']='';
-
- $img = array();
- if (!isset($_POST['categories_image_add']) && !empty($_POST['categories_image_add']) )
- $img[] = sqlcategorie::AddImage(@$_POST['categories_image_add']);
-
-// if (!isset($_POST['categories_image_'])
-// foreach()
-
- if (is_array($img) && count($img) > 0 )
- $params['sqlarray']['categories_image']=implode('|', $img);
- else
- $params['sqlarray']['categories_image']='';
-print_r($params);
-exit;
+ $params =array();
+ if(self::$Id > 0) $params['id']=self::$Id;
$params['action']=self::$action;
$params['post']=$_POST;
$params['language_id']= $languages_id;
-// $params['cPath']=(isset($_POST['cPath'])) ? tep_db_prepare_input($_POST['cPath']) : 0;
+ $params['cPath']=(isset($_POST['parent_id'])) ? tep_db_prepare_input($_POST['parent_id']) : 0;
+ $params['sqlarray'] = sqlcategorie::ExtractForm($_POST);
- $res = sqlcategorie::create($params);
+ if (self::$action == 'insert'){
+ $res = sqlcategorie::create($params);
+ self::$Id = $res;
+ }
+ elseif (self::$action == 'update')
+ $res = sqlcategorie::update($params);
$function = (isset($_POST['origin'])? 'add_session' : 'add' );
@@ -527,83 +511,20 @@
else
$messageStack->$function(sprintf(__('save categorie %s success'), $res ), 'success');
+ /// clear cache for all file name based on datatype
+ osCSS_Cache::clear('categorie', true);
- osCSS_Cache::clear('categorie');
- $messageStack->add_session(__('@categorie create'), 'success');
-
- if(isset($_POST['up_and_close']) )
- // by popup ajax
+ if(isset($_POST['up_and_close']) ){
+ // by popup ajax
if(isset($_POST['origin']) )
tep_redirect(tep_href_link($_POST['origin']));
else
- tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . self::$cPath . ''));
- else
- tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . self::$cPath . '&cID=' . $res.'&action=edit'));
- break;
-
- case 'update':
-
- $params['sqlarray'] = array('sort_order' => (isset($_POST['sort_order'])) ? tep_db_prepare_input((int)$_POST['sort_order']) : 0 ,
- 'parent_id' => tep_db_prepare_input((int)$_POST['parent_id']),
- 'categories_status' => (isset($_POST['categories_status'])) ? tep_db_prepare_input((int)$_POST['categories_status']) : 0,
- 'categories_hidden' => (isset($_POST['categories_hidden'])) ? tep_db_prepare_input((int)$_POST['categories_hidden']) : 0 ,
- 'categories_datatype' => (isset($_POST['categories_datatype'])&& $_POST['categories_datatype'] !='on') ? tep_db_prepare_input((string)$_POST['categories_datatype']) : '' ,
- );
-
-
- $img = array();
- if (isset($_POST['categories_image_checkbox']) && is_array($_POST['categories_image_checkbox']) )
-
- foreach((array)$_POST['categories_image_checkbox'] as $row)
- $img[] = (preg_match('#[0-9]*#',$row)? (int)$row: (string)sqlcategorie::AddImage($row) );
-
- if (isset($_POST['categories_image_add']) && !empty($_POST['categories_image_add']) )
- $img[] = (string)sqlcategorie::AddImage(@$_POST['categories_image_add']);
-
- if (is_array($img) && count($img) > 0 ){
- $list_img = array();
- foreach($img as $row){
- if(is_string($row)) {
- $sqli=sqlimage::fetch(array('pathkey'=>md5(DIR_WS_IMAGES.$row) ), true);
-
- if($sqli->rowid > 0)
- $list_img[] = $sqli->rowid;
- }
- else
- $list_img[] = $row;
- }
- $params['sqlarray']['categories_image']=implode('|', $list_img);
+ tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . self::$cPath . '&cID=' . self::$Id));
}
- else
- $params['sqlarray']['categories_image']='';
+ else
+ tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . self::$cPath . '&cID=' . self::$Id.'&action=edit'));
-
- $params['id']=self::$Id;
- $params['action']=self::$action;
- $params['post']=$_POST;
- $params['language_id']= $languages_id;
- $params['cPath']=(isset($_POST['parent_id'])) ? tep_db_prepare_input($_POST['parent_id']) : 0;
-
- if (self::$action == 'insert')
- $res = sqlcategorie::create($params);
- elseif (self::$action == 'update')
- $res = sqlcategorie::update($params);
-
-
- if( ! $res )
- $messageStack->add_session(sprintf(__('error save categorie : %s'), sqlcategorie::$error ), 'error');
- else
- $messageStack->add_session(sprintf(__('save categorie %s success'), self::$Id ), 'success');
-
-
- /// clear cache for all file name based on datatype
- osCSS_Cache::clear('categorie', true);
-
-
- if(isset($_POST['up_and_close']) ) tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . self::$cPath . '&cID=' . self::$Id));
- else tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . self::$cPath . '&cID=' . self::$Id.'&action=edit'));
-
break;
Modified: trunk/catalog/admin/includes/modules/pages/cms_content.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/cms_content.php 2014-01-18 07:44:42 UTC (rev 5054)
+++ trunk/catalog/admin/includes/modules/pages/cms_content.php 2014-01-18 17:28:30 UTC (rev 5055)
@@ -1,17 +1,19 @@
<?php if (!defined('HTTP_SERVER')) die('You can not access this file directly!');
/**
- @licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
+ @licence GPL 2005-2014 The osCSS developers - osCSS Open Source E-commerce
@package osCSS-2 <www http://www.oscss.org>
- @version 2.1.2
+ @version 2.2.0
@date 18/09/13, 09:44
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
- @brief multiple class for content
+ @file cms_content.php
+ @dir admin/includes/modules/pages/
*/
/**
@class cms_content
+ @brief multiple class for content
*/
class cms_content
extends ModTwo /// new abstract class for nextgen module
@@ -72,7 +74,7 @@
MLinkTo::getInstance(self::$datatype);
// Use factory class aca
- self::$modules=new AcaFactory(self::$datatype/*,'MODULE_CONTENT_INSTALLED_BO'*/);
+ self::$modules=new AcaFactory(self::$datatype);
self::$modules->set_image_handler();
self::$languages = tep_get_languages();
@@ -477,53 +479,52 @@
*/
case 'insert':
try {
- $type = ( isset($_POST['content_name']) ? tep_db_prepare_input($_POST['content_name']) : 1 );
$params = array();
- $params['sqlarray'] = array(
- 'content_type' => $type,
- 'content_name' => '',
- 'content_status' => '',
- );
-
+ $params['sqlarray'] = sqlcontent::ExtractForm($_POST);
$content_id=sqlcontent::create($params);
tep_redirect(tep_href_link(self::FILENAME, 'cID=' . $content_id.'&action=edit'));
}
catch (Exception $e) {
$messageStack->add_session($e->getMessage() , 'error');
+
+ tep_redirect(tep_href_link(self::FILENAME));
}
break;
+
case 'update':
try {
- if(self::$Id <=0 )
+ if( self::$Id <=0 )
throw new Exception(__('@cms_content error load data')) ;
- $params['sqlarray'] = array(
- 'content_status' => tep_db_prepare_input($_POST['content_status']),
- 'content_hidden' => tep_db_prepare_input($_POST['content_hidden']),
- );
-
- if (isset($_POST['content_name']))
- $params['sqlarray']['content_name'] = tep_db_prepare_input($_POST['content_name']);
-
-
$params['id']= self::$Id;
$params['action']=self::$action;
$params['post']=$_POST;
$params['language_id']= $languages_id;
+ $params['sqlarray'] = sqlcontent::ExtractForm($_POST);
- if( ! sqlcontent::update($params) )
- throw new Exception(__('@cms_content error in update process')) ;
+ $res =sqlcontent::update($params);
- $messageStack->add_session(__('@cms_content success in update process'), 'success');
+ $function = (isset($_POST['origin'])? 'add_session' : 'add' );
+
+ if( is_int($res) && $res <=0)
+ throw new Exception(__('@cms_content error in update process') ) ;
+ else
+ $messageStack->$function(__('@cms_content success in update process') , 'success');
+
if(!isset($_POST['up_and_close']) )
tep_redirect(tep_href_link(self::FILENAME, 'cID=' . self::$Id.'&action=edit'));
}
catch (Exception $e) {
$messageStack->add_session($e->getMessage() , 'error');
+
+ if(self::$Id >0 )
+ tep_redirect(tep_href_link(self::FILENAME, 'cID=' . self::$Id.'&action=edit'));
+ else
+ tep_redirect(tep_href_link(self::FILENAME));
}
// generic redirect if error
Modified: trunk/catalog/common/classes/ExtraUtility.php
===================================================================
--- trunk/catalog/common/classes/ExtraUtility.php 2014-01-18 07:44:42 UTC (rev 5054)
+++ trunk/catalog/common/classes/ExtraUtility.php 2014-01-18 17:28:30 UTC (rev 5055)
@@ -10,6 +10,7 @@
@dir /common/classes/
*/
+require_once( DIR_FS_CATALOG . DIR_WS_COMMON_CLASSES . 'FieldsDisplay.php');
/**
@class ExtraUtility
Modified: trunk/catalog/common/classes/FieldsDisplay.php
===================================================================
--- trunk/catalog/common/classes/FieldsDisplay.php 2014-01-18 07:44:42 UTC (rev 5054)
+++ trunk/catalog/common/classes/FieldsDisplay.php 2014-01-18 17:28:30 UTC (rev 5055)
@@ -6,10 +6,16 @@
@date 12/07/2013, 20:14
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
+ @file FieldsDisplay
+ @dir common/classes/
+*/
+
+require_once( DIR_FS_CATALOG . DIR_WS_COMMON_CLASSES . 'formUtility.php');
+
+/**
@class FieldsDisplay
@brief Centralised display fields extract by db in module display process
*/
-
Class FieldsDisplay
extends formUtility
{
Modified: trunk/catalog/install/includes/classes/core.php
===================================================================
--- trunk/catalog/install/includes/classes/core.php 2014-01-18 07:44:42 UTC (rev 5054)
+++ trunk/catalog/install/includes/classes/core.php 2014-01-18 17:28:30 UTC (rev 5055)
@@ -170,8 +170,9 @@
*/
function zip_extractto($archive, $destination) {
$base = substr(dirname(__FILE__), 0, -(strlen('install/includes/classes/') ) );
+
require( $base . '/'. $this->ws_admin_rand .'/'. 'includes/classes/fileUtility.php' );
- return fileUtility::extractto($archive, $destination, 'zip', 'OVERWRITE');
+ return fileUtility::extractto($archive, $destination, 'zip'/*, 'OVERWRITE'*/) ;
}
/**
Modified: trunk/dev/generator/datatype/Modele/catalog/admin/includes/classes/drivers/sql_DATATYPE_REPLACE_.php
===================================================================
--- trunk/dev/generator/datatype/Modele/catalog/admin/includes/classes/drivers/sql_DATATYPE_REPLACE_.php 2014-01-18 07:44:42 UTC (rev 5054)
+++ trunk/dev/generator/datatype/Modele/catalog/admin/includes/classes/drivers/sql_DATATYPE_REPLACE_.php 2014-01-18 17:28:30 UTC (rev 5055)
@@ -7,35 +7,33 @@
@date _CURRENTDATE_
@author genrated by GenerCode
@encode UTF-8
- @class sql_DATATYPE_REPLACE_
+ @file sql_DATATYPE_REPLACE_.php
+ @dir admin/includes/classes/drivers/
*/
-error_reporting(E_ALL);
-class sql_DATATYPE_REPLACE_
- implements ModSqlDataDriver{
- public static $modules;
+require_once( DIR_FS_ADMIN . DIR_WS_CLASSES . 'SqlFilesDataDriverClass.php');
- protected static $_instance;
- protected function __construct(){
- self::$modules=new AcaFactory('_DATATYPE_REPLACE_'/*,'MODULE__DATATYPE_REPLACE_MAJ__INSTALLED_BO'*/);
- self::$modules->set_image_handler();
- }
+/**
+ @class sql_DATATYPE_REPLACE_
+*/
+class sql_DATATYPE_REPLACE_
+ extends SqlFilesDataDriverClass
+ implements ModSqlDataDriver{
+ /**
+ @var boolean use submodule in this class
+ */
+ public $use_modules = true;
+
- public static function getInstance() {
- if(self::$_instance == null) self::$_instance = new self();
- return self::$_instance;
- }
-
/**
@brief create new ligne in table configuration
@param $option array
language_id = > int $languages_id
*/
- public static function create($option){
-
+
global $languages_id;
self::getInstance();
$DB=Database::getInstance();
@@ -44,55 +42,29 @@
- // if(!isset($option['key'])) return 'key';
+// if(!isset($option['key']))
+// return 'false';
- $DB->beginTransaction();
-
if( ! isset($option['sqlarray']) )
return false;
else
$dataarray = (array)$option['sqlarray'];
-
- $list_languages=tep_get_languages();
-
// Put post value
if(isset($option['post'])){
$post=$option['post'];
-// self::$modules->load_post_values($post);
+ self::$modules->load_post_values($post);
}
- $sql_data_array = array(); // insert in db master table
- $datalg = array(); // for language table
- // call specimen and report value for defined key
- foreach($specimen as $key=>$item) {
- // obtain string value contain in specimen
- if(!is_array($item)){
- if(isset($dataarray[$key]))
- $sql_data_array[$key] = (!empty($dataarray[$key])) ? tep_db_prepare_input((string)$dataarray[$key]) : $item ;
- else{
- if(isset($post[$key]))
- $sql_data_array[$key] = (!empty($post[$key])) ? tep_db_prepare_input((string)$post[$key]) : $item ;
- }
- }
- else{
- foreach($item as $k=>$row){
- // obtain string value contain in specimen
- if(isset($dataarray[$key][$k]))
- $datalg[$k][$key] = (!empty($dataarray[$key][$k])) ? tep_db_prepare_input((string)$dataarray[$key][(int)$k]) : '' ;
- else{
- if(isset($post[$key][$key]))
- $datalg[$k][$key] = (!empty($post[$key][$k])) ? tep_db_prepare_input((string)$post[$key][$k]) : '' ;
- }
- }
- }
- }
+ self::PrepaDataAfterUse( $specimen , $dataarray, $post );
+ $sql_data_array = self::GetSqlArray();
+ $sql_data_array_lg = self::GetSqlArrayLg();
+
$DB->beginTransaction();
-
// $sql_data_array = array_merge($sql_data_array, self::$modules->get_insert_table_products());
// master table
@@ -107,7 +79,7 @@
if(!$resobj)
$error++;
- $_DATATYPE_REPLACE__id = $resobj->__get('insertId');
+ $_id = $resobj->__get('insertId');
}
else
$error++;
@@ -116,7 +88,7 @@
if( $error <= 0)
if(count($datalg) > 0)
foreach($datalg as $key=>$sql_data_array){
- $sql_data_array['_DATATYPE_REPLACE__id'] = $_DATATYPE_REPLACE__id;
+ $sql_data_array['_DATATYPE_REPLACE__id'] = $_id;
$sql_data_array['language_id'] = $key;
$res=tep_db_perform(TABLE__DATATYPE_REPLACE_MAJ__DESCRIPTION, $sql_data_array);
if(!$res)
@@ -125,11 +97,10 @@
else
$error++;
- // linkto table
if( $error <= 0)
- if( DataTypes::is_active('categorie') && tep_cst_define('TABLE__DATATYPE_REPLACE_MAJ__TO_CATEGORIES') !='false') {
- $res = $DB->query("insert into " . TABLE__DATATYPE_REPLACE_MAJ__TO_CATEGORIES . " (_DATATYPE_REPLACE__id, categories_id) values ('" . (int)$_DATATYPE_REPLACE__id . "', '".ORPHELIN_COLLECTOR."')");
- if(!$res)
+ if(isset($post['linkto'])){
+ $r = MLinkTo::SqlLeftTo('_DATATYPE_REPLACE_', $_id, $post['linkto']) ;
+ if($r == false)
$error++;
}
@@ -140,7 +111,7 @@
}
else{
$DB->commitTransaction();
- return $_DATATYPE_REPLACE__id;
+ return $_id;
}
}
@@ -149,52 +120,33 @@
*/
public static function update($option){
- self::getInstance();
+
$DB=Database::getInstance();
- $list_languages=tep_get_languages();
$where ='';
$error = 0 ;
+ $list_languages=tep_get_languages();
$specimen = self::Specimen();
+
+ if(!isset($option['id']))
+ return false;
+ else
+ $_id = (int)$option['id'];
- if(isset($option['id'])){
- $_DATATYPE_REPLACE__id = (int)$option['id'];
- $post['_DATATYPE_REPLACE__id'] = $_DATATYPE_REPLACE__id;
- }
- // Put post value
- if(isset($option['post'])){
- $post=$option['post'];
-// self::$modules->load_post_values($post);
- }
+ if( isset($option['post']) ){
+ $post = $option['post'];
+ self::$modules->load_post_values($post);
+ }
+
+
$dataarray =(isset($option['sqlarray'])? $option['sqlarray'] : array() );
+
+ self::PrepaDataAfterUse( $specimen , $dataarray, $post );
- $sql_data_array = array(); // insert in db master table
- $datalg = array(); // for language table
- // call specimen and report value for defined key
- foreach($specimen as $key=>$item) {
- // obtain string value contain in specimen
- if(!is_array($item)){
- if(isset($dataarray[$key]))
- $sql_data_array[$key] = (!empty($dataarray[$key])) ? tep_db_prepare_input((string)$dataarray[$key]) : $item ;
- else{
- if(isset($post[$key]))
- $sql_data_array[$key] = (!empty($post[$key])) ? tep_db_prepare_input((string)$post[$key]) : $item ;
- }
- }
- else{
- foreach($item as $k=>$row){
- // obtain string value contain in specimen
- if(isset($dataarray[$key][$k]))
- $datalg[$k][$key] = (!empty($dataarray[$key][$k])) ? tep_db_prepare_input((string)$dataarray[$key][(int)$k]) : '' ;
- else{
- if(isset($post[$key][$key]))
- $datalg[$k][$key] = (!empty($post[$key][$k])) ? tep_db_prepare_input((string)$post[$key][$k]) : '' ;
- }
- }
- }
- }
+ $sql_data_array = self::GetSqlArray();
+ $sql_data_array_lg = self::GetSqlArrayLg();
$DB->beginTransaction();
@@ -206,7 +158,7 @@
$sql_data_array['last_modified'] = 'now()';
$sql_data_array['user_modified'] = (int)@$_SESSION['login_id'];
- if( ! tep_db_perform(TABLE__DATATYPE_REPLACE_MAJ_, $sql_data_array, 'update', "_DATATYPE_REPLACE__id = '" . (int)$_DATATYPE_REPLACE__id . "'") )
+ if( ! tep_db_perform(TABLE__DATATYPE_REPLACE_MAJ_, $sql_data_array, 'update', "_DATATYPE_REPLACE__id = '" . (int)$_id . "'") )
$error++;
}
@@ -214,7 +166,7 @@
if( $error <= 0)
if(count($datalg) > 0)
foreach($datalg as $key=>$sql_data_array){
- $res=tep_db_perform(TABLE__DATATYPE_REPLACE_MAJ__DESCRIPTION, $sql_data_array, 'update', "_DATATYPE_REPLACE__id = '" . (int)$_DATATYPE_REPLACE__id . "' and language_id = '" . (int)$key . "'");
+ $res=tep_db_perform(TABLE__DATATYPE_REPLACE_MAJ__DESCRIPTION, $sql_data_array, 'update', "_DATATYPE_REPLACE__id = '" . (int)$_id . "' and language_id = '" . (int)$key . "'");
if(!$res)
$error++;
}
@@ -223,7 +175,7 @@
// linkto table
if( $error <= 0)
if(isset($post['linkto'])){
- $r = MLinkTo::SqlLeftTo('content', $content_id, $post['linkto']) ;
+ $r = MLinkTo::SqlLeftTo('_DATATYPE_REPLACE_', $_id, $post['linkto']) ;
if($r == false)
$error++;
}
@@ -431,6 +383,8 @@
$par = array(
'_DATATYPE_REPLACE__id' => 0,
'_DATATYPE_REPLACE__type' => 1,
+
+ '_DATATYPE_REPLACE__image' =>'',
'_DATATYPE_REPLACE__status' => 0,
'_DATATYPE_REPLACE__hidden' => 0,
@@ -561,25 +515,9 @@
@return array
*/
public static function ExtractForm($data){
- $specimen = self::Specimen();
-
- $sqlarray = array();
- foreach($specimen as $key=>$item){
- if($key != 'DATATYPE_REPLACE__id')
- if(is_int($item) || is_bool($modele[$key]))
- $sqlarray[$key] = (isset($data[$key]) ? tep_db_prepare_input((int)$data[$key]) : $item);
- elseif(is_string($item))
- $sqlarray[$key] = (isset($data[$key]) ? tep_db_prepare_input((string)$data[$key]) : $item);
- elseif(is_array($item)){
- foreach($item as $k=>$row)
- if(is_int($row[$k]) || is_bool($modele[$key]))
- $sqlarray[$key][$k] = (isset($data[$key][$k]) ? tep_db_prepare_input((int)$data[$key][$k]) : $row[$k]);
- elseif(is_string($row[$k]))
- $sqlarray[$key][$k] = (isset($data[$key][$k]) ? tep_db_prepare_input((string)$data[$key][$k]) : $row[$k]);
- }
- }
-
- return $sqlarray;
+ new self();
+
+ return parent::ExtractForm(self::Specimen(), $data);
}
Modified: trunk/dev/generator/datatype/Modele/catalog/admin/includes/modules/pages/_DATATYPE_REPLACE_s.php
===================================================================
--- trunk/dev/generator/datatype/Modele/catalog/admin/includes/modules/pages/_DATATYPE_REPLACE_s.php 2014-01-18 07:44:42 UTC (rev 5054)
+++ trunk/dev/generator/datatype/Modele/catalog/admin/includes/modules/pages/_DATATYPE_REPLACE_s.php 2014-01-18 17:28:30 UTC (rev 5055)
@@ -47,7 +47,7 @@
Is use in module and class abstract for init value config this module
*/
public static function GetConf(){
- global $languages_id;
+ global $languages_id, $language;
self::$code=__CLASS__;
self::$datatype='_DATATYPE_REPLACE_';
@@ -56,9 +56,12 @@
self::$Id=(isset($_REQUEST['cID'])? (int)$_REQUEST['cID'] : 0 );
// force file language uniq
- global $oscss,$language,$lang;
+ $oscss = oscss_cstr::getInstance();
$oscss->pile_file_lang(DIR_FS_ADMIN.DIR_WS_LANGUAGES.$language.'/'.ucwords('_DATATYPE_REPLACE_').'.txt');
+ // Use factory class aca
+ self::$modules=new AcaFactory(self::$datatype);
+
/**
@remarks define var execution sql in GetDBValue()
*/
@@ -474,14 +477,14 @@
case 'setflag':
if ( ($_GET['flag'] == '0') || ($_GET['flag'] == '1') ) {
- if ($c_id > 0){
- $myarray = array('id'=>self::$id, 'status'=>$_GET['flag'] );
+ if (self::$Id > 0){
+ $myarray = array('id'=>self::$Id, 'status'=>$_GET['flag'] );
sql_DATATYPE_REPLACE_::update($myarray);
}
}
if(!isset($_GET['forceajax']))
- tep_redirect(tep_href_link(self::FILENAME, 'cID=' . self::$id));
+ tep_redirect(tep_href_link(self::FILENAME, 'cID=' . self::$Id));
break;
case 'insert':
@@ -653,7 +656,7 @@
case 'update_cell':
break;
case 'setflag':
- return self::RowStatus(array('status'=>(int)$_GET['flag'], 'id'=>(int)self::$id));
+ return self::RowStatus(array('status'=>(int)$_GET['flag'], 'id'=>(int)self::$Id));
break;
Modified: trunk/dev/generator/datatype/Modele/sql/mysql/install/tables/osc__DATATYPE_REPLACE_.sql
===================================================================
--- trunk/dev/generator/datatype/Modele/sql/mysql/install/tables/osc__DATATYPE_REPLACE_.sql 2014-01-18 07:44:42 UTC (rev 5054)
+++ trunk/dev/generator/datatype/Modele/sql/mysql/install/tables/osc__DATATYPE_REPLACE_.sql 2014-01-18 17:28:30 UTC (rev 5055)
@@ -5,6 +5,7 @@
CREATE TABLE IF NOT EXISTS osc__DATATYPE_REPLACE_(
_DATATYPE_REPLACE__id int(11) NOT NULL AUTO_INCREMENT,
_DATATYPE_REPLACE__type int(11) NOT NULL DEFAULT '1',
+ _DATATYPE_REPLACE__imagee varchar(64) NULL DEFAULT '',
_DATATYPE_REPLACE__status int(1) NOT NULL,
_DATATYPE_REPLACE__hidden int(1) NOT NULL,
date_added datetime DEFAULT '1000-01-01 00:00:00',
Modified: trunk/test/phpunit/Back/modules/pages/pagesbackupTest.php
===================================================================
--- trunk/test/phpunit/Back/modules/pages/pagesbackupTest.php 2014-01-18 07:44:42 UTC (rev 5054)
+++ trunk/test/phpunit/Back/modules/pages/pagesbackupTest.php 2014-01-18 17:28:30 UTC (rev 5055)
@@ -54,28 +54,11 @@
}
- /**
- @brief test display form new customers
- @depends testbackupConf
- */
- public function testadminsuerscreateBackup($objtmp){
-
- $action = 'backupnow';
- $get = array();
- $get['compress'] = 'gzip';
- $get['backup_structure'] = 'yes';
-
- $res = $this->CheckAction($objtmp,$action, $get);
-
- $this->assertTrue ( ( strlen($res) > 900) , 'Error retrun action::'.$action ) ;
-
- }
-
/**
@brief test methode GetDBValue
@depends testbackupConf
*/
- public function testadminsuersGetDBValue($objtmp){
+ public function testbackupGetDBValue($objtmp){
// action default : listing
$res = backup::tep_get_list();
@@ -93,7 +76,7 @@
@brief test display form new customers
@depends testbackupConf
*/
- public function testadminsuersPrintBackup($objtmp){
+ public function testbackupPrintBackup($objtmp){
$action = 'backup';
$get = array();
@@ -107,7 +90,7 @@
@brief test display form edit
@depends testbackupConf
*/
-// public function testadminsuersPrintRestore($objtmp){
+// public function testbackupPrintRestore($objtmp){
//
//
// $action = 'restore';
@@ -123,7 +106,7 @@
@brief test display form edit
@depends testbackupConf
*/
-// public function testadminsuersPrintDelete($objtmp){
+// public function testbackupPrintDelete($objtmp){
//
//
// $action = 'delete';
@@ -147,7 +130,6 @@
$get['action'] = $action;
foreach($get as $k=>$v){
$_REQUEST[$k] = $v;
- $_POST[$k] = $v;
$_GET[$k] = $v;
}
Added: trunk/test/phpunit/Back/sqlxxx/sqlautomaticTest.php
===================================================================
--- trunk/test/phpunit/Back/sqlxxx/sqlautomaticTest.php (rev 0)
+++ trunk/test/phpunit/Back/sqlxxx/sqlautomaticTest.php 2014-01-18 17:28:30 UTC (rev 5055)
@@ -0,0 +1,154 @@
+<?php
+/**
+ * \file test/phpunit/Back/adminuserTest.php
+ * \brief test unitaire class adminuser 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;
+
+
+
+/**
+ * \class adminuserTest
+ * \brief this test check sqlxxx extends SqlFilesDataDriverClass
+ */
+class sqlautomaticTest
+ extends PHPUnit_Framework_TestCase
+{
+ /**
+ @var array
+ */
+ public $specimen;
+
+ /**
+ @var int
+ */
+ static public $Id;
+
+ function __construct()
+ {
+// $this->specimen = sqladminuser::Specimen( );
+ }
+
+ /**
+ @brief test class depends childs specific module newsletters
+ */
+ public function testallmodulesgenericDepends(){
+ global $base_path, $path;
+
+ include_once(DIR_FS_CATALOG . DIR_WS_COMMON_CLASSES.'DatasFiles.php');
+ include_once(DIR_FS_CATALOG . DIR_WS_COMMON_CLASSES.'shippingUtility.php');
+// include_once(DIR_FS_CATALOG . DIR_WS_COMMON_CLASSES.'featured.php');
+ }
+
+ /**
+ @fn testloadalldir()
+ @brief load all module of precised type
+ @param $key string type of module
+ @param $base_path path for access folder modules/
+ @return array list key =>object sub module
+ @depends testallmodulesgenericDepends
+ */
+ public function testloadalldir(){
+
+ $path = DIR_FS_ADMIN.DIR_WS_CLASSES .'drivers/' ;
+ $arrtmp = array();
+
+ foreach(scan($path) as $row) {
+...
[truncated message content] |