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...> - 2013-10-01 07:17:37
|
Revision: 4854
http://sourceforge.net/p/oscss/svn/4854
Author: oscim
Date: 2013-10-01 07:17:32 +0000 (Tue, 01 Oct 2013)
Log Message:
-----------
Fix upgrade code for header_tags and simplicity call in html files
Fix loop categorie in sqlcategorie
Modified Paths:
--------------
trunk/catalog/admin/includes/classes/ModTwo.php
trunk/catalog/admin/includes/classes/drivers/sqlcategorie.php
trunk/catalog/admin/includes/classes/drivers/sqlcontent.php
trunk/catalog/admin/includes/modules/content/header_tags.php
Added Paths:
-----------
trunk/catalog/admin/includes/gabarit/cms_content/header_tags/
trunk/catalog/admin/includes/gabarit/cms_content/header_tags/display_edit.edit.gab
Modified: trunk/catalog/admin/includes/classes/ModTwo.php
===================================================================
--- trunk/catalog/admin/includes/classes/ModTwo.php 2013-10-01 06:48:32 UTC (rev 4853)
+++ trunk/catalog/admin/includes/classes/ModTwo.php 2013-10-01 07:17:32 UTC (rev 4854)
@@ -278,9 +278,8 @@
@return array
*/
public static function tep_get_modele(){
- $params = func_get_args();
-// print_r(self::$InitInfo);
-// exit;
+ $params = @func_get_args();
+
$action=(empty(self::$action)? 'listing' :self::$action);
$param=(!isset($params[0][0])? 'modele' :$params[0][0]);
@@ -292,7 +291,6 @@
*/
// public static function tep_get_list($page=1,$rowbyp=10,$sOrder='',$sWhere='',$options=''){
-// // var_dump(__FUNCTION__,$rowbyp);
// return self::ListingArray( $page,$rowbyp,$sOrder,$sWhere,$options); // call_user_func(array(self::$code, 'ListingArray'), $page,$rowbyp,$sOrder,$sWhere,$options);
// // var_dump(call_user_func_array(array(self::$code, 'ListingArray'),array( $page,$rowbyp,$sOrder,$sWhere,$options) ));
// }
@@ -364,13 +362,13 @@
$_SESSION['filters'][self::$code]['featured'][$key] = 'on';
}
- if(in_array('language' , self::$generictfilter))
+// if(in_array('language' , self::$generictfilter))
foreach($_POST['filters']['language'] as $key=>$row){
if( $row =='on' )
$_SESSION['filters'][self::$code]['language'][$key] = 'on';
}
- if(in_array('subtype' , self::$generictfilter))
+ if(true/*in_array('subtype' , self::$generictfilter)*/)
foreach($_POST['filters']['subtype'] as $key=>$row){
if( $row =='on' )
$_SESSION['filters'][self::$code]['subtype'][$key] = 'on';
@@ -533,7 +531,7 @@
}
// filter based on subtype products
- if(in_array('subtype' , self::$generictfilter)){
+ if(true/*in_array('subtype' , self::$generictfilter)*/){
if(isset($_SESSION['filters'][self::$code]['subtype']))
$_SESSION['filters']['subtype'] = $_SESSION['filters'] [self::$code]['subtype'];
else
@@ -555,12 +553,11 @@
else
$child_type = self::$code;
- if(strlen($list_type)>2)
+ if(strlen($list_type)>0)
self::$InitInfo['adjust']['sWhere'] .=" AND ".$child_type."_type IN (".substr($list_type, 0,-1).") ";
}
-
$i=0;
// check and appli
foreach(self::$allfields as $key=>$row){
@@ -570,7 +567,7 @@
$txt = (isset($row['text_short'])? $row['text_short'] : $row['text']) ;
$alias = (isset($row['alias'])? $row['alias'] : $clean);
$css = (isset($row['class'])? $row['class'] : 'tleft')
- // add css class for jseditable
+ // add css class for jseditable
.(isset($row['edit'])? ' edit_dbclick': '' );
$width = (isset($row['width'])? $row['width'] : '5%');
@@ -667,9 +664,6 @@
self::$InitInfo['adjust']['listfields'] = substr($listfield, 0,-1);
-
-
-
/**
@note use $boutons[action][] = array(params)
@@ -691,7 +685,6 @@
}
-
return $listfield;
}
@@ -739,6 +732,9 @@
if(is_array($obj))
$obj = new arrayInfo($obj);
+
+// print_r($obj);
+
$edit = ((substr($key,0,5) !='edit_' ) ? 'edit_'.$key : $key);
if(isset($obj->$edit))
Modified: trunk/catalog/admin/includes/classes/drivers/sqlcategorie.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlcategorie.php 2013-10-01 06:48:32 UTC (rev 4853)
+++ trunk/catalog/admin/includes/classes/drivers/sqlcategorie.php 2013-10-01 07:17:32 UTC (rev 4854)
@@ -356,16 +356,16 @@
$result['cPath'] = categorieUtility::get_generated_category_path_ids( (int) $result['categories_id'] );
/// Childs module load
-// self::$modules->load_db_values( (int) $result['categories_id'] );
- $result['mod'] = self::$modules->fetch(array('categories_id'=>$result['categories_id'], 'shortkey'=>$shortkey));
+ self::$modules->load_db_values( (int) $result['categories_id'] );
+// $result['mod'] = self::$modules->fetch(array('categories_id'=>$result['categories_id'], 'shortkey'=>$shortkey));
+//
+// // put all val origin module in current result
+// foreach($result['mod'] as $submod=>$array)
+// if(is_array($array))
+// foreach($array as $key=>$val)
+// $result[$key] = $val;
- // put all val origin module in current result
- foreach($result['mod'] as $submod=>$array)
- if(is_array($array))
- foreach($array as $key=>$val)
- $result[$key] = $val;
-
$array[]= ((!$shortkey)? $result : self::CleanKey($result));
}
Modified: trunk/catalog/admin/includes/classes/drivers/sqlcontent.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlcontent.php 2013-10-01 06:48:32 UTC (rev 4853)
+++ trunk/catalog/admin/includes/classes/drivers/sqlcontent.php 2013-10-01 07:17:32 UTC (rev 4854)
@@ -28,7 +28,7 @@
}
- /**
+ /**
@brief create new ligne in table configuration
@param $option array
language_id = > int $languages_id
@@ -131,7 +131,7 @@
// no touch if just update one rows
if(count($sql_data_array) >= 3 ) {
/**
- TODO Couplage avec MLinkto + datatype actif
+ TODO Couplage avec MLinkto + datatype actif
*/
if(DataTypes::is_active('categorie')) {
/// Clean link posts to categorie and save new link
@@ -160,27 +160,24 @@
}
}
-// print_r($post['cms_content']);
-// exit;
+
for ($i=0, $n=sizeof($list_languages); $i<$n; $i++) {
$sql_data_array = array();
$language_id = $list_languages[$i]['id'];
- if(isset($post['cms_content']['content_text'][$language_id]) && is_array($post['cms_content']['content_text']) )
+ if(isset($post['cms_content']['content_text'][$language_id]) && is_array($post['cms_content']['content_text']) )
$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']) )
+ 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]) && is_array($post['content_title']['content_title']) )
+ if(isset($post['cms_content']['content_title'][$language_id]) && is_array($post['content_title']['content_title']) )
$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']) )
+ 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, self::$modules->get_update_table_content_description ($language_id));
-print_r($sql_data_array);
-exit;
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++;
@@ -296,7 +293,7 @@
}
/**
- TODO Couplage avec MLinkto + datatype actif
+ TODO Couplage avec MLinkto + datatype actif
*/
if(DataTypes::is_active('categorie')) {
$cat_query = $DB->query("select categories_id from " . TABLE_CONTENT_TO_CATEGORIES . " where content_id='" . (int)$row['content_id'] . "' ");
@@ -319,9 +316,17 @@
- self::$modules->load_db_values((int)$row['content_id']);
+// self::$modules->load_db_values((int)$row['content_id']);
+ $row['mod'] = self::$modules->fetch(array('content_id'=>$row['content_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[] = $row;
}
@@ -450,33 +455,33 @@
// $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;
Added: trunk/catalog/admin/includes/gabarit/cms_content/header_tags/display_edit.edit.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/cms_content/header_tags/display_edit.edit.gab (rev 0)
+++ trunk/catalog/admin/includes/gabarit/cms_content/header_tags/display_edit.edit.gab 2013-10-01 07:17:32 UTC (rev 4854)
@@ -0,0 +1,20 @@
+<?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 01/10/2013, 19:18
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+*/
+?>
+<div class="header_tags">
+
+ <?php echo cms_content::DisplayField('head_title_tag', '%s'); ?>
+
+
+ <?php echo cms_content::DisplayField('head_desc_tag'); ?>
+
+ <?php echo cms_content::DisplayField('head_keywords_tag'); ?>
+</div>
\ No newline at end of file
Modified: trunk/catalog/admin/includes/modules/content/header_tags.php
===================================================================
--- trunk/catalog/admin/includes/modules/content/header_tags.php 2013-10-01 06:48:32 UTC (rev 4853)
+++ trunk/catalog/admin/includes/modules/content/header_tags.php 2013-10-01 07:17:32 UTC (rev 4854)
@@ -102,9 +102,9 @@
// 'default'=>true,
'edit'=>array(
'input_name'=>__CLASS__.'[head_desc_tag]',
- 'input_type'=>'text',
- 'input_size'=>'64',
- 'required_status'=>true,
+ 'input_type'=>'textarea',
+// 'input_size'=>'64',
+// 'required_status'=>true,
'active_value_language'=>true,
),
);
@@ -117,9 +117,9 @@
// 'default'=>true,
'edit'=>array(
'input_name'=>__CLASS__.'[head_keywords_tag]',
- 'input_type'=>'text',
- 'input_size'=>'64',
- 'required_status'=>true,
+ 'input_type'=>'textarea',
+// 'input_size'=>'64',
+// 'required_status'=>true,
'active_value_language'=>true,
),
);
@@ -135,8 +135,24 @@
return $array;
}
+ /**
+ @brief Call by fetch sqlxxx
+ @param $option array
+ @param $item array
+ array
+ 0 =>
+ array
+ 'customers_id' => string '2' (length=1)
+ 'shortkey' => boolean false
+ */
+ public function fetch($option){
+ $id=$option[0]['content_id'];
+ $shortkey=$option[0]['shortkey'];
+ return $this->load_db_values((int)$id);
+ }
+
/**
Edition produit
UP db
@@ -184,10 +200,12 @@
UP db
*/
public static function load_db_values ($content_id) {
- $arr ['content_id'] = $content_id;
+ $arr['content_id'] = $content_id;
$arr=array_merge(array('content_id'=>$content_id) ,parent::load_db($content_id, 'content') );
self::$pInfo->objectInfo($arr);
+
+ return $arr;
}
/**
@brief The $post contains only post values for this module pInfo is an array: [field name][language id]=value
@@ -199,14 +217,11 @@
/**
Draw
*/
- public function display_edit(&$contents) {
+ public function display_edit(&$contents, $id) {
$this->load_db_values (cms_content::$Id);
- $contents []=array('title'=> __('tab meta'),'text'=>tep_get_include_contents(__CLASS__.'.form'));
+ $contents[]=array('title'=> __('tab meta'),'text'=>tep_get_include_contents('cms_content/'.__CLASS__.'/'.__FUNCTION__.'.edit'));
}
- public static function DisplayField($arg1, $args2=''){
- return cms_content::DisplayField($arg1, $args2);
- }
/** Force implements InterfaceModule class to define this method */
public function check() { return true; }
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2013-10-01 06:48:34
|
Revision: 4853
http://sourceforge.net/p/oscss/svn/4853
Author: oscim
Date: 2013-10-01 06:48:32 +0000 (Tue, 01 Oct 2013)
Log Message:
-----------
Fix upgrade code for header_tags and simplicity call in html files
Modified Paths:
--------------
trunk/catalog/common/classes/AbstractHeader_tags.php
Modified: trunk/catalog/common/classes/AbstractHeader_tags.php
===================================================================
--- trunk/catalog/common/classes/AbstractHeader_tags.php 2013-10-01 06:47:36 UTC (rev 4852)
+++ trunk/catalog/common/classes/AbstractHeader_tags.php 2013-10-01 06:48:32 UTC (rev 4853)
@@ -3,8 +3,8 @@
@licence GPL 2005-2010 The osCSS developers - osCSS Open Source E-commerce
@portion code Copyright (c) 2002 osCommerce
@package osCSS-2 <www http://www.oscss.org>
- @version 2.1.0
- @date 16/11/10, 14:33
+ @version 2.1.2
+ @date 30/09/2013, 14:33
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
@class common_header_tags
@@ -28,7 +28,7 @@
public static $test_cache = array();
/** Force Extending class to define this method */
- abstract protected function display_edit(&$contents);
+ abstract protected function display_edit(&$contents, $id);
abstract protected function after_update($id);
abstract protected function after_update_lang($language_id,$id);
@@ -73,7 +73,93 @@
}
+
/**
+ @brief Load , adjust and define var environement GetConf master module
+ @param $opt array
+ type => '' string name type for define return
+ languages_id => '' int
+ */
+ public function MasterGetConf($type, $opt){
+ $array = array();
+
+ switch ($opt['type']) {
+ case 'allfields':
+ $array['fhtd.head_title_tag'] = array(
+ 'sort'=>true,
+ 'alias'=>'head_title_tag',
+ 'text'=>__('@header_tags table heading title'),
+ 'width'=>'8%',
+ 'class'=>'tleft',
+// 'default'=>true,
+ 'edit'=>array(
+ 'input_name'=>__CLASS__.'[head_title_tag]',
+ 'input_type'=>'input',
+ 'input_size'=>'64',
+ 'required_status'=>true,
+ 'active_value_language'=>true,
+ ),
+ );
+ $array['fhtd.head_desc_tag'] = array(
+ 'sort'=>true,
+ 'alias'=>'head_desc_tag',
+ 'text'=>__('@header_tags table heading description'),
+ 'width'=>'14%',
+ 'class'=>'tleft',
+// 'default'=>true,
+ 'edit'=>array(
+ 'input_name'=>__CLASS__.'[head_desc_tag]',
+ 'input_type'=>'text',
+ 'input_size'=>'64',
+ 'required_status'=>true,
+ 'active_value_language'=>true,
+ ),
+ );
+ $array['fhtd.head_keywords_tag'] = array(
+ 'sort'=>true,
+ 'alias'=>'head_keywords_tag',
+ 'text'=>__('@header_tags table heading tags'),
+ 'width'=>'10%',
+ 'class'=>'tleft',
+// 'default'=>true,
+ 'edit'=>array(
+ 'input_name'=>__CLASS__.'[head_keywords_tag]',
+ 'input_type'=>'text',
+ 'input_size'=>'64',
+ 'required_status'=>true,
+ 'active_value_language'=>true,
+ ),
+ );
+ break;
+
+ case 'tables':
+
+ $array['fht'] = " LEFT JOIN " . TABLE_FULL_TAG . " fht ON( fht.page_id=p.products_id AND fht.page_type='product' ) ";
+ $array['fhtd'] = " LEFT JOIN " . TABLE_FULL_TAG_DESCRIPTION . " fhtd ON( fht.tag_id=fhtd.tag_id AND fhtd.language_id = '".(int)$opt['languages_id']."' ) ";
+
+ break;
+ }
+ return $array;
+ }
+
+
+ /**
+ @brief format db value for this allfields
+ @param $key string name key
+ @param $item array
+ */
+ public function formatdbvalue($key,$item){
+ global $languages_id;
+
+ switch($key){
+ default:
+ $value = $item[$key] ;
+ }
+
+ return $value;
+ }
+
+ /**
@package oscss-2 <www http://www.oscss.org>
@author oscim <mail os...@os...> <www http://www.oscim.fr>
Recup db base
@@ -106,7 +192,7 @@
@author oscim <mail os...@os...> <www http://www.oscim.fr>
Recup db global
*/
- public static function load_db_values ($id, $type) {
+ public static function load_db($id, $type) {
$languages = tep_get_languages();
for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
@@ -133,10 +219,17 @@
@a int (int)$tag_id
*/
public static function insert_db_values ($tag_id,$action,$pInfo,$language_id) {
- $myarray=array( 'head_title_tag' => $pInfo->header_tags['head_title_tag'][$language_id],
- 'head_desc_tag' => strip_tags(@$pInfo->header_tags['head_desc_tag'][$language_id]),
- 'head_keywords_tag' =>strip_tags(@$pInfo->header_tags['head_keywords_tag'][$language_id]));
+
+ $myarray=array();
+ if(isset($pInfo->head_title_tag[$language_id]))
+ $myarray['head_title_tag'] = $pInfo->head_title_tag[$language_id];
+ if(isset($pInfo->head_desc_tag[$language_id]))
+ $myarray['head_desc_tag'] = $pInfo->head_desc_tag[$language_id];
+ if(isset($pInfo->head_keywords_tag[$language_id]))
+ $myarray['head_keywords_tag'] = $pInfo->head_keywords_tag[$language_id];
+
+
if($action=='update')
tep_db_perform(TABLE_FULL_TAG_DESCRIPTION, $myarray, 'update', " tag_id='".(int)$tag_id."' and language_id='".$language_id."' " );
else{
@@ -146,10 +239,10 @@
}
}
- public static function load_post_values ($post) {
+ public static function load_post($post) {
// The $post contains only post values for this module
// pInfo is an array: [field name][language id]=value
- return new objectInfo ($post);
+ return new objectInfo($post);
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2013-10-01 06:47:39
|
Revision: 4852
http://sourceforge.net/p/oscss/svn/4852
Author: oscim
Date: 2013-10-01 06:47:36 +0000 (Tue, 01 Oct 2013)
Log Message:
-----------
Fix upgrade code for header_tags and simplicity call in html files
normalise code in sql driver and Aca module
Modified Paths:
--------------
trunk/catalog/admin/includes/classes/drivers/sqlcategorie.php
trunk/catalog/admin/includes/modules/categories/header_tags.php
trunk/catalog/admin/includes/modules/products/header_tags.php
Added Paths:
-----------
trunk/catalog/admin/includes/gabarit/categories/header_tags/
trunk/catalog/admin/includes/gabarit/categories/header_tags/display_edit.edit.gab
trunk/catalog/admin/includes/gabarit/products/header_tags/
trunk/catalog/admin/includes/gabarit/products/header_tags/display_edit.edit.gab
Modified: trunk/catalog/admin/includes/classes/drivers/sqlcategorie.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlcategorie.php 2013-09-30 16:31:30 UTC (rev 4851)
+++ trunk/catalog/admin/includes/classes/drivers/sqlcategorie.php 2013-10-01 06:47:36 UTC (rev 4852)
@@ -3,8 +3,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 30/03/2012, 09:32
+ @version 2.1.2
+ @date 01/10/2013, 09:32
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
@class sqlcategorie
@@ -315,8 +315,17 @@
$result['cPath'] = categorieUtility::get_generated_category_path_ids( (int) $result['categories_id'] );
/// Childs module load
- self::$modules->load_db_values((int) $result['categories_id']);
+// self::$modules->load_db_values((int) $result['categories_id']);
+ $result['mod'] = self::$modules->fetch(array('categories_id'=>$result['categories_id'], 'shortkey'=>$shortkey));
+
+ // put all val origin module in current result
+ foreach($result['mod'] as $submod=>$array)
+ if(is_array($array))
+ foreach($array as $key=>$val)
+ $result[$key] = $val;
+
+
return ((!$shortkey)? $result : self::CleanKey($result));
}
elseif($num > 1){
@@ -347,8 +356,16 @@
$result['cPath'] = categorieUtility::get_generated_category_path_ids( (int) $result['categories_id'] );
/// Childs module load
- self::$modules->load_db_values( (int) $result['categories_id'] );
+// self::$modules->load_db_values( (int) $result['categories_id'] );
+ $result['mod'] = self::$modules->fetch(array('categories_id'=>$result['categories_id'], 'shortkey'=>$shortkey));
+ // put all val origin module in current result
+ foreach($result['mod'] as $submod=>$array)
+ if(is_array($array))
+ foreach($array as $key=>$val)
+ $result[$key] = $val;
+
+
$array[]= ((!$shortkey)? $result : self::CleanKey($result));
}
Added: trunk/catalog/admin/includes/gabarit/categories/header_tags/display_edit.edit.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/categories/header_tags/display_edit.edit.gab (rev 0)
+++ trunk/catalog/admin/includes/gabarit/categories/header_tags/display_edit.edit.gab 2013-10-01 06:47:36 UTC (rev 4852)
@@ -0,0 +1,19 @@
+<?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 01/10/2013, 19:18
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+*/
+?>
+<div class="header_tags">
+ <?php echo categories::DisplayField('head_title_tag'); ?>
+
+
+ <?php echo categories::DisplayField('head_desc_tag'); ?>
+
+ <?php echo categories::DisplayField('head_keywords_tag'); ?>
+</div>
Added: trunk/catalog/admin/includes/gabarit/products/header_tags/display_edit.edit.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/products/header_tags/display_edit.edit.gab (rev 0)
+++ trunk/catalog/admin/includes/gabarit/products/header_tags/display_edit.edit.gab 2013-10-01 06:47:36 UTC (rev 4852)
@@ -0,0 +1,19 @@
+<?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 01/10/2013, 19:18
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+*/
+?>
+<div class="header_tags">
+ <?php echo products::DisplayField('head_title_tag'); ?>
+
+
+ <?php echo products::DisplayField('head_desc_tag'); ?>
+
+ <?php echo products::DisplayField('head_keywords_tag'); ?>
+</div>
Modified: trunk/catalog/admin/includes/modules/categories/header_tags.php
===================================================================
--- trunk/catalog/admin/includes/modules/categories/header_tags.php 2013-09-30 16:31:30 UTC (rev 4851)
+++ trunk/catalog/admin/includes/modules/categories/header_tags.php 2013-10-01 06:47:36 UTC (rev 4852)
@@ -100,7 +100,7 @@
// 'default'=>true,
'edit'=>array(
'input_name'=>__CLASS__.'[head_desc_tag]',
- 'input_type'=>'text',
+ 'input_type'=>'textarea',
'input_size'=>'64',
'required_status'=>true,
'active_value_language'=>true,
@@ -115,7 +115,7 @@
// 'default'=>true,
'edit'=>array(
'input_name'=>__CLASS__.'[head_keywords_tag]',
- 'input_type'=>'text',
+ 'input_type'=>'textarea',
'input_size'=>'64',
'required_status'=>true,
'active_value_language'=>true,
@@ -133,6 +133,24 @@
return $array;
}
+ /**
+ @brief Call by fetch sqlxxx
+ @param $option array
+ @param $item array
+ array
+ 0 =>
+ array
+ 'customers_id' => string '2' (length=1)
+ 'shortkey' => boolean false
+ */
+ public function fetch($option){
+
+ $id=$option[0]['categories_id'];
+ $shortkey=$option[0]['shortkey'];
+
+ return $this->load_db_values((int)$id);
+ }
+
/**
Edition produit
UP db
@@ -179,9 +197,11 @@
UP db
*/
public static function load_db_values ($cat_id) {
- $arr ['cat_id'] = $cat_id;
+ $arr['cat_id'] = $cat_id;
$arr=array_merge(array('cat_id'=>$cat_id) ,parent::load_db($cat_id, 'cat') );
self::$pInfo->objectInfo($arr);
+
+ return $arr;
}
/**
@brief The $post contains only post values for this module pInfo is an array: [field name][language id]=value
@@ -192,8 +212,8 @@
/**
Draw
*/
- public function display_edit(&$contents) {
- $contents []=array('title'=> __('tab meta'),'text'=>tep_get_include_contents(__CLASS__.'.form'));
+ public function display_edit(&$contents, $id) {
+ $contents []=array('title'=> __('tab meta'),'text'=>tep_get_include_contents('categories/'.__CLASS__.'/'.__FUNCTION__.'.edit'));
}
public static function DisplayField($arg1, $args2){
Modified: trunk/catalog/admin/includes/modules/products/header_tags.php
===================================================================
--- trunk/catalog/admin/includes/modules/products/header_tags.php 2013-09-30 16:31:30 UTC (rev 4851)
+++ trunk/catalog/admin/includes/modules/products/header_tags.php 2013-10-01 06:47:36 UTC (rev 4852)
@@ -111,9 +111,9 @@
// 'default'=>true,
'edit'=>array(
'input_name'=>__CLASS__.'[head_desc_tag]',
- 'input_type'=>'text',
- 'input_size'=>'64',
- 'required_status'=>true,
+ 'input_type'=>'textarea',
+// 'input_size'=>'64',
+// 'required_status'=>false,
'active_value_language'=>true,
),
);
@@ -126,9 +126,9 @@
// 'default'=>true,
'edit'=>array(
'input_name'=>__CLASS__.'[head_keywords_tag]',
- 'input_type'=>'text',
- 'input_size'=>'64',
- 'required_status'=>true,
+ 'input_type'=>'textarea',
+// 'input_size'=>'64',
+// 'required_status'=>true,
'active_value_language'=>true,
),
);
@@ -146,8 +146,24 @@
+ /**
+ @brief Call by fetch sqlxxx
+ @param $option array
+ @param $item array
+ array
+ 0 =>
+ array
+ 'customers_id' => string '2' (length=1)
+ 'shortkey' => boolean false
+ */
+ public function fetch($option){
+ $id=$option[0]['products_id'];
+ $shortkey=$option[0]['shortkey'];
+ return $this->load_db_values((int)$id);
+ }
+
/**
Edition produit
UP db
@@ -216,6 +232,8 @@
$arr['products_id'] = $Id;
$arr=array_merge(array('products_id'=>$Id) ,parent::load_db($Id, 'product') );
self::$pInfo->objectInfo($arr);
+
+ return $arr;
}
/**
@@ -228,14 +246,11 @@
/**
Draw
*/
- public function display_edit(&$contents) {
- $contents[]=array('title'=> __('tab meta'),'text'=>tep_get_include_contents(__CLASS__.'.form'));
+ public function display_edit(&$contents, $product_id) {
+ $contents[]=array('title'=> __('tab meta'),'text'=>tep_get_include_contents('products/'.__CLASS__.'/'.__FUNCTION__.'.edit'));
}
- public static function DisplayField($arg1, $args2){
- return products::DisplayField($arg1, $args2);
- }
/** Force implements InterfaceModule class to define this method */
public function check() { return true; }
public function install() { return false; }
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2013-09-30 16:31:34
|
Revision: 4851
http://sourceforge.net/p/oscss/svn/4851
Author: oscim
Date: 2013-09-30 16:31:30 +0000 (Mon, 30 Sep 2013)
Log Message:
-----------
Fix upgrade code
Modified Paths:
--------------
trunk/catalog/admin/includes/appli_top_Test.php
trunk/catalog/admin/includes/header.php
Modified: trunk/catalog/admin/includes/appli_top_Test.php
===================================================================
--- trunk/catalog/admin/includes/appli_top_Test.php 2013-09-30 16:31:14 UTC (rev 4850)
+++ trunk/catalog/admin/includes/appli_top_Test.php 2013-09-30 16:31:30 UTC (rev 4851)
@@ -29,7 +29,7 @@
//! Set the local configuration parameters - mainly for developers
if (file_exists($rpa.'includes/local/configure.php')) include($rpa.'includes/local/configure.php');
- else require($rpa.'includes/configure.php');
+ else require(dirname(__FILE__).'/configure.php');
//force current directory
@chdir(DIR_FS_ADMIN);
Modified: trunk/catalog/admin/includes/header.php
===================================================================
--- trunk/catalog/admin/includes/header.php 2013-09-30 16:31:14 UTC (rev 4850)
+++ trunk/catalog/admin/includes/header.php 2013-09-30 16:31:30 UTC (rev 4851)
@@ -9,7 +9,7 @@
@encode UTF-8
@brief block in balise html head.
*/
- global $languages_id;
+ global $languages_id;
/**
* Placer ici les codes necessitant un chargement entre les balise head de chacune des pages. Ces codes seront chargée systématqiuement, et quelque soit le template
*/
@@ -198,7 +198,7 @@
}
} )
.makeEditable({
- sUpdateURL: '<?php echo tep_href_link(MGabCont::CallSt('GetFILENAME'), 'forceajax=true&action=update_cell&key='.$k) ?>',
+ sUpdateURL: '<?php echo tep_href_link(MGabCont::CallSt('GetFILENAME'), 'forceajax=true&action=update_cell') ?>',
fnShowError: function (message, action) {
},
fnEndProcessingMode: function () {
@@ -221,7 +221,7 @@
if( (isset($col2[$k]['edit']['input_type']) && (in_array($col2[$k]['edit']['input_type'], array('select', 'radio') ) )) ){
-
+
echo "type: 'select',\n";
echo "data: \"{ ";
if(isset($col2[$k]['edit']['select_values']) )
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2013-09-30 16:31:17
|
Revision: 4850
http://sourceforge.net/p/oscss/svn/4850
Author: oscim
Date: 2013-09-30 16:31:14 +0000 (Mon, 30 Sep 2013)
Log Message:
-----------
Fix upgrade code
Modified Paths:
--------------
trunk/catalog/admin/includes/gabarit/cms_content/display_view.edit.gab
Modified: trunk/catalog/admin/includes/gabarit/cms_content/display_view.edit.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/cms_content/display_view.edit.gab 2013-09-30 16:30:52 UTC (rev 4849)
+++ trunk/catalog/admin/includes/gabarit/cms_content/display_view.edit.gab 2013-09-30 16:31:14 UTC (rev 4850)
@@ -3,8 +3,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 04/04/2012, 09:48
+ @version 2.1.2
+ @date 30/09/2013, 09:48
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
*/
@@ -33,27 +33,10 @@
<div class="edit box_left w_70" >
<div id="tabs-1" class="tabPage">
- <div class="tabs_lang">
- <ul>
- <?php for ($i=0, $n=sizeof(cms_content::$languages); $i<$n; $i++) { ?>
- <li><a href="#fieldset_<?php echo $i ?>"><?php echo tep_language_image(cms_content::$languages[$i]['directory'] . '/images/' . cms_content::$languages[$i]['image'], cms_content::$languages[$i]['name']); ?></a></li>
+ <?php echo cms_content::DisplayField('title', '%s'); ?>
- <?php } ?>
- </ul>
- <?php for ($i=0, $n=sizeof(cms_content::$languages); $i<$n; $i++) { ?>
- <fieldset id="fieldset_<?php echo $i ?>" class="block_field">
- <p class="block_input">
- <label for="<?php echo 'content_title' . cms_content::$languages[$i]['id']; ?>"><?php echo __('entry title'); ?></label>
- <?php echo tep_draw_input_field('content_title[' . cms_content::$languages[$i]['id'] . ']', 'content_title' . $i, cms_content::$Info->title[ cms_content::$languages[$i]['id']], 'size="70"', true) ; ?>
- </p>
- <p class="block_input" >
- <?php echo __('txt info permalink').tep_catalog_href_link('content.php','content=' . cms_content::$Info->id.'&language='.cms_content::$languages[$i]['code'] , 'NONSSL', false); ?>
- </p>
- <br style="clear:both" />
- <?php echo $oscss->_call(BO_WISIWYG_SELECTED,'_draw','content_text[' . cms_content::$languages[$i]['id'] . ']','1000','800',cms_content::$Info->text[cms_content::$languages[$i]['id']]); ?>
- </fieldset>
- <?php } ?>
- </div>
+ <?php echo cms_content::DisplayField('text', '%s'); ?>
+
</div>
<?php
$g=6;
@@ -83,11 +66,10 @@
</dt>
<dt class="block_input">
- <label><?php echo __('text content status'); ?></label>
- <?php echo tep_draw_radio_field('content_status', 'content_status_1', '1', cms_content::$enabled_status) . __('text content enabled') . tep_draw_radio_field('content_status', 'content_status_0', '0', cms_content::$disabled_status) . __('text content disabled'); ?>
+ <?php echo cms_content::DisplayField('status', '%s'); ?>
</dt>
-
+
<!-- All LinkTo -->
<?php foreach(MLinkTo::LoadRightTo( 'content', 'edit' , 'action='.cms_content::$action.'&cID='.@$_GET['cID'] ) as $row): ?>
<dt class="block_input">
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2013-09-30 16:30:57
|
Revision: 4849
http://sourceforge.net/p/oscss/svn/4849
Author: oscim
Date: 2013-09-30 16:30:52 +0000 (Mon, 30 Sep 2013)
Log Message:
-----------
Fix upgrade code
Modified Paths:
--------------
trunk/catalog/admin/includes/modules/categories/header_tags.php
trunk/catalog/admin/includes/modules/content/header_tags.php
trunk/catalog/admin/includes/modules/pages/categories.php
trunk/catalog/admin/includes/modules/pages/cms_content.php
trunk/catalog/admin/includes/modules/products/header_tags.php
Modified: trunk/catalog/admin/includes/modules/categories/header_tags.php
===================================================================
--- trunk/catalog/admin/includes/modules/categories/header_tags.php 2013-09-30 16:30:32 UTC (rev 4848)
+++ trunk/catalog/admin/includes/modules/categories/header_tags.php 2013-09-30 16:30:52 UTC (rev 4849)
@@ -3,8 +3,8 @@
@licence GPL 2005-2010 The osCSS developers - osCSS Open Source E-commerce
@portion code Copyright (c) 2002 osCommerce
@package osCSS-2 <www http://www.oscss.org>
- @version 2.0.9
- @date 29/08/10, 21:47
+ @version 2.1.2
+ @date 30/09/2013, 21:47
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
@class header_tags
@@ -13,21 +13,40 @@
class header_tags
extends AbstractHeader_tags
implements InterfaceModule{
+
/**
- @param array
+ @var array
*/
public static $languages = array();
/**
- @param object
+ @var object
*/
public static $pInfo;
+ /**
+ @var string
+ */
+ public $code;
+ /**
+ @var string
+ */
+ public $title;
+ /**
+ @var string
+ */
+ public $description;
+ /**
+ @var int
+ */
+ public $sort_order;
+ /**
+ @var bool
+ */
+ public $enabled = true ;
+ /**
+ @var array info post data
+ */
+ public static $pArray;
- var $code;
- var $title;
- var $description;
- var $sort_order;
- var $enabled;
-
/**
class constructor
*/
@@ -39,7 +58,6 @@
$this->title = __('module acapro headertags text title');
$this->description = __('module acapro headertags text description');
$this->sort_order = (defined('MODULE_ACACAT_HTC_SORT_ORDER'))?MODULE_ACACAT_HTC_SORT_ORDER : 0;
- $this->enabled = true;
self::$pInfo= new objectInfo (array());
@@ -48,10 +66,78 @@
/**
+ @brief Load , adjust and define var environement GetConf master module
+ @param $opt array
+ type => '' string name type for define return
+ languages_id => '' int
+ */
+ public function GetConf($opt){
+ $array = array();
+
+ switch ($opt['type']) {
+ case 'allfields':
+ $array['fhtd.head_title_tag'] = array(
+ 'sort'=>true,
+ 'alias'=>'head_title_tag',
+ 'text'=>__('@header_tags table heading title'),
+ 'width'=>'8%',
+ 'class'=>'tleft',
+// 'default'=>true,
+ 'edit'=>array(
+ 'input_name'=>__CLASS__.'[head_title_tag]',
+ 'input_type'=>'input',
+ 'input_size'=>'64',
+ 'required_status'=>true,
+ 'active_value_language'=>true,
+ ),
+ );
+ $array['fhtd.head_desc_tag'] = array(
+ 'sort'=>true,
+ 'alias'=>'head_desc_tag',
+ 'text'=>__('@header_tags table heading description'),
+ 'width'=>'14%',
+ 'class'=>'tleft',
+// 'default'=>true,
+ 'edit'=>array(
+ 'input_name'=>__CLASS__.'[head_desc_tag]',
+ 'input_type'=>'text',
+ 'input_size'=>'64',
+ 'required_status'=>true,
+ 'active_value_language'=>true,
+ ),
+ );
+ $array['fhtd.head_keywords_tag'] = array(
+ 'sort'=>true,
+ 'alias'=>'head_keywords_tag',
+ 'text'=>__('@header_tags table heading tags'),
+ 'width'=>'10%',
+ 'class'=>'tleft',
+// 'default'=>true,
+ 'edit'=>array(
+ 'input_name'=>__CLASS__.'[head_keywords_tag]',
+ 'input_type'=>'text',
+ 'input_size'=>'64',
+ 'required_status'=>true,
+ 'active_value_language'=>true,
+ ),
+ );
+ break;
+
+ case 'tables':
+
+ $array['fht'] = " LEFT JOIN " . TABLE_FULL_TAG . " fht ON( fht.page_id=c.categories_id AND fht.page_type='cat' ) ";
+ $array['fhtd'] = " LEFT JOIN " . TABLE_FULL_TAG_DESCRIPTION . " fhtd ON( fht.tag_id=fhtd.tag_id AND fhtd.language_id = '".(int)$opt['languages_id']."' ) ";
+
+ break;
+ }
+ return $array;
+ }
+
+ /**
Edition produit
UP db
*/
- function after_update ($cat_id) {
+ function after_update($cat_id) {
self::$pInfo=parent::load_db_base($cat_id, 'cat');
$myarray=array('page_type' => 'cat',
@@ -69,14 +155,22 @@
/**
Update table langue
*/
- function after_update_lang ($language_id,$cat_id) {
+ function after_update_lang($language_id,$cat_id) {
$this->load_db_values($cat_id);
if(parent::load_db_descr_check(self::$pInfo->tag_id,$language_id)) $action='update';
else $action='insert';
- $pInfo=parent::load_post_values($_POST);
- $pInfo->header_tags['head_title_tag'][$language_id]=(tep_not_null($pInfo->header_tags['head_title_tag'][$language_id]) ? $pInfo->header_tags['head_title_tag'][$language_id] : $pInfo->categories_name[$language_id]) ;
+ $pInfo = new stdClass;
+ if(isset(self::$pArray->head_title_tag) && is_array(self::$pArray->head_title_tag))
+ $pInfo = self::$pArray;
+ elseif(isset(self::$pArray->head_title_tag) && is_string(self::$pArray->head_title_tag))
+ $pInfo->head_title_tag = array($language_id=> self::$pArray->head_title_tag);
+ elseif(isset(self::$pArray->head_desc_tag) && is_string(self::$pArray->head_desc_tag))
+ $pInfo->head_desc_tag = array($language_id=> self::$pArray->head_desc_tag);
+ 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,$pInfo,$language_id);
}
@@ -86,18 +180,25 @@
*/
public static function load_db_values ($cat_id) {
$arr ['cat_id'] = $cat_id;
- $arr=array_merge(array('cat_id'=>$cat_id) ,parent::load_db_values ($cat_id, 'cat') );
+ $arr=array_merge(array('cat_id'=>$cat_id) ,parent::load_db($cat_id, 'cat') );
self::$pInfo->objectInfo($arr);
}
-
/**
+ @brief The $post contains only post values for this module pInfo is an array: [field name][language id]=value
+ */
+ public function load_post_values($post) {
+ self::$pArray=parent::load_post($post);
+ }
+ /**
Draw
*/
public function display_edit(&$contents) {
$contents []=array('title'=> __('tab meta'),'text'=>tep_get_include_contents(__CLASS__.'.form'));
}
-
+ public static function DisplayField($arg1, $args2){
+ return categories::DisplayField($arg1, $args2);
+ }
/** Force implements InterfaceModule class to define this method */
function check() { return true; }
function install() { return false; }
Modified: trunk/catalog/admin/includes/modules/content/header_tags.php
===================================================================
--- trunk/catalog/admin/includes/modules/content/header_tags.php 2013-09-30 16:30:32 UTC (rev 4848)
+++ trunk/catalog/admin/includes/modules/content/header_tags.php 2013-09-30 16:30:52 UTC (rev 4849)
@@ -3,8 +3,8 @@
@licence GPL 2005-2010 The osCSS developers - osCSS Open Source E-commerce
@portion code Copyright (c) 2002 osCommerce
@package osCSS-2 <www http://www.oscss.org>
- @version 2.0.9
- @date 29/08/10, 21:47
+ @version 2.1.2
+ @date 30/09/2013, 21:47
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
@class header_tags
@@ -13,23 +13,42 @@
class header_tags
extends AbstractHeader_tags
implements InterfaceModule{
-
/**
- @param array
+ @var array
*/
public static $languages = array();
/**
- @param object
+ @var object
*/
public static $pInfo;
-
+ /**
+ @var string
+ */
public $code;
+ /**
+ @var string
+ */
public $title;
+ /**
+ @var string
+ */
public $description;
+ /**
+ @var int
+ */
public $sort_order;
- public $enabled;
+ /**
+ @var bool
+ */
+ public $enabled = true ;
+
/**
+ @var array info post data
+ */
+ public static $pArray;
+
+ /**
class constructor
*/
public function __construct() {
@@ -40,8 +59,8 @@
$this->title = __('module acapro headertags text title');
$this->description = __('module acapro headertags text description');
$this->sort_order = (defined('MODULE_ACACAT_HTC_SORT_ORDER'))?MODULE_ACACAT_HTC_SORT_ORDER : 0;
- $this->enabled = true;
+
self::$pInfo= new objectInfo (array());
self::$languages= tep_get_languages();
@@ -50,8 +69,8 @@
/**
@brief Load , adjust and define var environement GetConf master module
- @param $opt array
- type => '' string name type for define return
+ @param $opt array
+ type => '' string name type for define return
languages_id => '' int
*/
public function GetConf($opt){
@@ -66,6 +85,13 @@
'width'=>'8%',
'class'=>'tleft',
// 'default'=>true,
+ 'edit'=>array(
+ 'input_name'=>__CLASS__.'[head_title_tag]',
+ 'input_type'=>'input',
+ 'input_size'=>'64',
+ 'required_status'=>true,
+ 'active_value_language'=>true,
+ ),
);
$array['fhtd.head_desc_tag'] = array(
'sort'=>true,
@@ -74,6 +100,13 @@
'width'=>'14%',
'class'=>'tleft',
// 'default'=>true,
+ 'edit'=>array(
+ 'input_name'=>__CLASS__.'[head_desc_tag]',
+ 'input_type'=>'text',
+ 'input_size'=>'64',
+ 'required_status'=>true,
+ 'active_value_language'=>true,
+ ),
);
$array['fhtd.head_keywords_tag'] = array(
'sort'=>true,
@@ -82,6 +115,13 @@
'width'=>'10%',
'class'=>'tleft',
// 'default'=>true,
+ 'edit'=>array(
+ 'input_name'=>__CLASS__.'[head_keywords_tag]',
+ 'input_type'=>'text',
+ 'input_size'=>'64',
+ 'required_status'=>true,
+ 'active_value_language'=>true,
+ ),
);
break;
@@ -95,23 +135,8 @@
return $array;
}
- /**
- @brief format db value for this allfields
- @param $key string name key
- @param $item array
- */
- public function formatdbvalue($key,$item){
- global $languages_id;
- switch($key){
- default:
- $value = $item[$key] ;
- }
- return $value;
- }
-
-
/**
Edition produit
UP db
@@ -139,8 +164,16 @@
if(parent::load_db_descr_check(self::$pInfo->tag_id,$language_id)) $action='update';
else $action='insert';
- $pInfo=parent::load_post_values($_POST);
- $pInfo->header_tags['head_title_tag'][$language_id]=(tep_not_null($pInfo->header_tags['head_title_tag'][$language_id]) ? $pInfo->header_tags['head_title_tag'][$language_id] : $pInfo->content_title[$language_id]) ;
+ $pInfo = new stdClass;
+ if(isset(self::$pArray->head_title_tag) && is_array(self::$pArray->head_title_tag))
+ $pInfo = self::$pArray;
+ elseif(isset(self::$pArray->head_title_tag) && is_string(self::$pArray->head_title_tag))
+ $pInfo->head_title_tag = array($language_id=> self::$pArray->head_title_tag);
+ elseif(isset(self::$pArray->head_desc_tag) && is_string(self::$pArray->head_desc_tag))
+ $pInfo->head_desc_tag = array($language_id=> self::$pArray->head_desc_tag);
+ 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,$pInfo,$language_id);
}
@@ -153,11 +186,16 @@
public static function load_db_values ($content_id) {
$arr ['content_id'] = $content_id;
- $arr=array_merge(array('content_id'=>$content_id) ,parent::load_db_values ($content_id, 'content') );
+ $arr=array_merge(array('content_id'=>$content_id) ,parent::load_db($content_id, 'content') );
self::$pInfo->objectInfo($arr);
}
+ /**
+ @brief The $post contains only post values for this module pInfo is an array: [field name][language id]=value
+ */
+ public function load_post_values($post) {
+ self::$pArray=parent::load_post($post);
+ }
-
/**
Draw
*/
@@ -166,6 +204,10 @@
$contents []=array('title'=> __('tab meta'),'text'=>tep_get_include_contents(__CLASS__.'.form'));
}
+ public static function DisplayField($arg1, $args2=''){
+ return cms_content::DisplayField($arg1, $args2);
+ }
+
/** Force implements InterfaceModule class to define this method */
public function check() { return true; }
public function install() { return false; }
Modified: trunk/catalog/admin/includes/modules/pages/categories.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/categories.php 2013-09-30 16:30:32 UTC (rev 4848)
+++ trunk/catalog/admin/includes/modules/pages/categories.php 2013-09-30 16:30:52 UTC (rev 4849)
@@ -684,7 +684,7 @@
$GLOBALS['cPath']=null;
self::$Info = new objectInfo( sqlcategorie::Specimen() );
-//
+//
// if(isset($_GET['datatype']))
// self::$cInfo->categories_datatype = tep_db_prepare_input( $_GET['datatype']);
@@ -793,23 +793,35 @@
}
- $query_raw = "SELECT DISTINCT ".$adjust->listfields.", c.categories_id as id ".
+ $query_raw = "SELECT DISTINCT ".$adjust->listfields." ".
" FROM " . TABLE_CATEGORIES . " c ".
" JOIN " . TABLE_CATEGORIES_DESCRIPTION . " cd ON (cd.categories_id = c.categories_id AND cd.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) : '');
-// " GROUP BY c.content_id ";
+
/* 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_raw .=" GROUP BY ";
-// foreach($r as $mod=>$value){
-// foreach($value as $key=>$string){
-// $query_raw .= $string;
-// }
-// }
-// }
+ $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 : ' c.date_added DESC ');
Modified: trunk/catalog/admin/includes/modules/pages/cms_content.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/cms_content.php 2013-09-30 16:30:32 UTC (rev 4848)
+++ trunk/catalog/admin/includes/modules/pages/cms_content.php 2013-09-30 16:30:52 UTC (rev 4849)
@@ -260,10 +260,10 @@
array[
// For normalised filter define on method ConvertInitVar
generic =>
- array (
- 'string'
+ array (
+ 'string'
// , ....
- );
+ );
mod =>
array(
'title'=>__('@products filter tab manufacturer'),
@@ -287,7 +287,7 @@
@remarks this define menu master module in page
@note use $boutons[action][] = array(params)
- params :
+ params :
'type'=>'getLink',
'format'=>'button_nav',
'image'=>'',
@@ -316,9 +316,9 @@
/**
Call Base Init and construct $InitInfo for process Filter
- $listfield string list row in db
+ $listfield string list row in db
$mutli array action multiple
- $filter array put list off activate tab filter
+ $filter array put list off activate tab filter
$boutons array
*/
self::ConvertInitVar( $listfield, $mutli, $tab, $boutons);
@@ -339,16 +339,11 @@
self::$modules-> set_image_handler();
self::$languages = tep_get_languages();
-// $actions['action'] = self::$action;
-// $actions['display_file']='';
-// $actions['action_class']=(isset($_GET['action_class']))? $_GET['action_class'] : '';
-// $actions['action_method']=(isset($_GET['action_method']))? $_GET['action_method'] : '';
-
// Ask categories modules if want to change the action
- /*$action =*/ self::$modules->check_action(self::$action);
-// $action = $actions['action'];
+ self::$modules->check_action(self::$action);
+
switch (self::$action) {
/**
@@ -503,12 +498,10 @@
$content_id = tep_db_prepare_input($_GET['cID']);
$params['sqlarray'] = array(
+ 'content_name' => tep_db_prepare_input($_POST['content_name']),
'content_status' => tep_db_prepare_input($_POST['content_status']),
);
- if (isset($_POST['content_name']))
- $params['sqlarray']['content_name'] = tep_db_prepare_input($_POST['content_name']);
-
if (isset($content_id))
$params['id']=$content_id;
@@ -518,7 +511,7 @@
$params['cPath']=(isset($_POST['cPath'])) ? tep_db_prepare_input($_POST['cPath']) : 0;
sqlcontent::update($params);
-exit;
+
if(isset($_POST['up_and_close']) ) tep_redirect(tep_href_link(self::FILENAME, tep_get_all_get_params(array( 'cID','flag','action'),false)) );
else tep_redirect(tep_href_link(self::FILENAME, 'page=' . $_GET['page'] . '&cID=' . $content_id.'&action=edit'));
break;
@@ -614,21 +607,14 @@
global $language_id;
if( (int)self::$Id > 0) {
- $res = /*self::$Info = */ sqlcontent::fetch(array('id'=>self::$Id,'language_id'=>$language_id), true);
+ $res = sqlcontent::fetch(array('id'=>self::$Id,'language_id'=>$language_id), true);
}
else{
- $res = /*self::$Info = */sqlcontent::Specimen(true);
+ $res = sqlcontent::Specimen(true);
}
- $res= /*new objectInfo(*/self::FormatDBValue($res) /*)*/;
+ $res= self::FormatDBValue($res);
-// if (!isset(self::$Info->status)) self::$Info->status = '1';
-// switch (self::$Info->status) {
-// case '0': self::$enabled_status = false; self::$disabled_status = true; break;
-// case '1':
-// default: self::$enabled_status = true; self::$disabled_status = false;
-// }
-
return $res;
break;
@@ -750,9 +736,6 @@
*/
case 'delete':
- self::$Info=self::GetDBValue(self::$Id);
- return MGabCont::CallGab(self::$action,__FUNCTION__,__CLASS__);
- break;
case 'edit':
self::$Info=self::GetDBValue(self::$Id);
/// use master gabarit
@@ -925,8 +908,42 @@
$res=array();
switch (self::$action) {
- case 'new':
+ case 'listing':
+ global $query_numrows,$languages_id;
+
+ while ($item = $_query->fetchAssoc()) {
+ $ord =array();
+
+ if( DataTypes::is_active('categorie')) {
+ /// complete cats list
+ $objres=$DB->query("SELECT categories_name FROM " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd , " . TABLE_CONTENT_TO_CATEGORIES . " p2c WHERE c.categories_id=cd.categories_id AND cd.language_id = '" . (int)$languages_id . "' AND c.categories_id=p2c.categories_id and content_id='".$item['id']."' AND c.categories_id <> '".$item['categories_id']."' ");
+ $rescat=$objres->fetchAllAssoc();
+
+ foreach($rescat as $cat)
+ $item['cat_title'] .=','.$cat['categories_name'];
+
+ if(strlen($item['cat_title'])>25)$item['cat_title']= substr($item['cat_title'],0 ,20).'...';
+ }
+
+ $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];
+ }
+
+ $ord[0]=$item['id'];
+
+
+ $res[]=$ord;
+ }
+ break;
+ case 'new':
case 'edit';
+ default:
global $languages_id;
$ord =array();
@@ -965,41 +982,6 @@
}
}
-
- break;
- case 'listing':
- global $query_numrows,$languages_id;
-
- while ($item = $_query->fetchAssoc()) {
- $ord =array();
-
- if( DataTypes::is_active('categorie')) {
- /// complete cats list
- $objres=$DB->query("SELECT categories_name FROM " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd , " . TABLE_CONTENT_TO_CATEGORIES . " p2c WHERE c.categories_id=cd.categories_id AND cd.language_id = '" . (int)$languages_id . "' AND c.categories_id=p2c.categories_id and content_id='".$item['id']."' AND c.categories_id <> '".$item['categories_id']."' ");
- $rescat=$objres->fetchAllAssoc();
-
- foreach($rescat as $cat)
- $item['cat_title'] .=','.$cat['categories_name'];
-
- if(strlen($item['cat_title'])>25)$item['cat_title']= substr($item['cat_title'],0 ,20).'...';
- }
-
- $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];
- }
-
- $ord[0]=$item['id'];
-
-
- $res[]=$ord;
- }
- break;
}
return $res;
Modified: trunk/catalog/admin/includes/modules/products/header_tags.php
===================================================================
--- trunk/catalog/admin/includes/modules/products/header_tags.php 2013-09-30 16:30:32 UTC (rev 4848)
+++ trunk/catalog/admin/includes/modules/products/header_tags.php 2013-09-30 16:30:52 UTC (rev 4849)
@@ -3,8 +3,8 @@
@licence GPL 2005-2010 The osCSS developers - osCSS Open Source E-commerce
@portion code Copyright (c) 2002 osCommerce
@package osCSS-2 <www http://www.oscss.org>
- @version 2.1.1
- @date 14/12/11, 21:47
+ @version 2.1.2
+ @date 30/09/2013, 21:47
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
@class header_tags
@@ -15,20 +15,39 @@
implements InterfaceModule{
/**
- @param array
+ @var array
*/
public static $languages = array();
/**
- @param object
+ @var object
*/
public static $pInfo;
-
+ /**
+ @var string
+ */
public $code;
+ /**
+ @var string
+ */
public $title;
+ /**
+ @var string
+ */
public $description;
+ /**
+ @var int
+ */
public $sort_order;
- public $enabled;
+ /**
+ @var bool
+ */
+ public $enabled = true ;
+ /**
+ @var array info post data
+ */
+ public static $pArray;
+
/**
class constructor
*/
@@ -44,8 +63,7 @@
$this->description = __('module acapro headertags text description');
/* sort this module relative to other module actived */
$this->sort_order = (defined('MODULE_ACACAT_HTC_SORT_ORDER'))?MODULE_ACACAT_HTC_SORT_ORDER : 0;
- /* Active module */
- $this->enabled = true;
+
/* Flag precise type product for activate this module.
if this flag no found, this module is already active
0 for all , or precise int */
@@ -76,6 +94,13 @@
'width'=>'8%',
'class'=>'tleft',
// 'default'=>true,
+ 'edit'=>array(
+ 'input_name'=>__CLASS__.'[head_title_tag]',
+ 'input_type'=>'input',
+ 'input_size'=>'64',
+ 'required_status'=>true,
+ 'active_value_language'=>true,
+ ),
);
$array['fhtd.head_desc_tag'] = array(
'sort'=>true,
@@ -84,6 +109,13 @@
'width'=>'14%',
'class'=>'tleft',
// 'default'=>true,
+ 'edit'=>array(
+ 'input_name'=>__CLASS__.'[head_desc_tag]',
+ 'input_type'=>'text',
+ 'input_size'=>'64',
+ 'required_status'=>true,
+ 'active_value_language'=>true,
+ ),
);
$array['fhtd.head_keywords_tag'] = array(
'sort'=>true,
@@ -92,6 +124,13 @@
'width'=>'10%',
'class'=>'tleft',
// 'default'=>true,
+ 'edit'=>array(
+ 'input_name'=>__CLASS__.'[head_keywords_tag]',
+ 'input_type'=>'text',
+ 'input_size'=>'64',
+ 'required_status'=>true,
+ 'active_value_language'=>true,
+ ),
);
break;
@@ -106,24 +145,9 @@
}
- /**
- @brief format db value for this allfields
- @param $key string name key
- @param $item array
- */
- public function formatdbvalue($key,$item){
- global $languages_id;
- switch($key){
- default:
- $value = $item[$key] ;
- }
- return $value;
- }
-
-
/**
Edition produit
UP db
@@ -141,7 +165,6 @@
self::$pInfo->tag_id=$products['tag_id'];
}
- $this->load_post_values($_POST);
}
/**
@@ -153,9 +176,16 @@
if(parent::load_db_descr_check(self::$pInfo->tag_id,$language_id)) $action='update';
else $action='insert';
- $pInfo=parent::load_post_values($_POST);
+ $pInfo = new stdClass;
+ if(isset(self::$pArray->head_title_tag) && is_array(self::$pArray->head_title_tag))
+ $pInfo = self::$pArray;
+ elseif(isset(self::$pArray->head_title_tag) && is_string(self::$pArray->head_title_tag))
+ $pInfo->head_title_tag = array($language_id=> self::$pArray->head_title_tag);
+ elseif(isset(self::$pArray->head_desc_tag) && is_string(self::$pArray->head_desc_tag))
+ $pInfo->head_desc_tag = array($language_id=> self::$pArray->head_desc_tag);
+ 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);
- $pInfo->header_tags['head_title_tag'][$language_id]=(!empty($pInfo->header_tags['head_title_tag'][$language_id]) ?$pInfo->header_tags['head_title_tag'][$language_id] : $pInfo->products_name[$language_id]) ;
parent::insert_db_values(self::$pInfo->tag_id,$action,$pInfo,$language_id);
}
@@ -166,11 +196,8 @@
public function delete_product($products_id){
$products_query = tep_db_query($sql = "SELECT tag_id FROM " . TABLE_FULL_TAG . " ft WHERE ft.page_type='product' and ft.page_id = '" . (int)$products_id . "' ");
-
if($products_query->__get('numRows')) {
$products = tep_db_fetch_array($products_query);
-
-
tep_db_query("DELETE FROM ".TABLE_FULL_TAG_DESCRIPTION." WHERE tag_id ='".(int)$products['tag_id']."' " );
$res = tep_db_query("DELETE FROM ".TABLE_FULL_TAG." WHERE tag_id ='".(int)$products['tag_id']."' " );
@@ -186,18 +213,29 @@
UP db
*/
public static function load_db_values ($Id) {
- $arr ['products_id'] = $Id;
- $arr=array_merge(array('products_id'=>$Id) ,parent::load_db_values ($Id, 'product') );
+ $arr['products_id'] = $Id;
+ $arr=array_merge(array('products_id'=>$Id) ,parent::load_db($Id, 'product') );
self::$pInfo->objectInfo($arr);
}
/**
+ @brief The $post contains only post values for this module pInfo is an array: [field name][language id]=value
+ */
+ public function load_post_values($post) {
+ self::$pArray=parent::load_post($post);
+ }
+
+ /**
Draw
*/
public function display_edit(&$contents) {
- $contents []=array('title'=> __('tab meta'),'text'=>tep_get_include_contents(__CLASS__.'.form'));
+ $contents[]=array('title'=> __('tab meta'),'text'=>tep_get_include_contents(__CLASS__.'.form'));
}
+
+ public static function DisplayField($arg1, $args2){
+ return products::DisplayField($arg1, $args2);
+ }
/** Force implements InterfaceModule class to define this method */
public function check() { return true; }
public function install() { return false; }
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2013-09-30 16:30:36
|
Revision: 4848
http://sourceforge.net/p/oscss/svn/4848
Author: oscim
Date: 2013-09-30 16:30:32 +0000 (Mon, 30 Sep 2013)
Log Message:
-----------
Fix upgrade code
Modified Paths:
--------------
trunk/catalog/admin/includes/gabarit/products/desc_base/display_edit.edit.gab
Modified: trunk/catalog/admin/includes/gabarit/products/desc_base/display_edit.edit.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/products/desc_base/display_edit.edit.gab 2013-09-30 14:58:50 UTC (rev 4847)
+++ trunk/catalog/admin/includes/gabarit/products/desc_base/display_edit.edit.gab 2013-09-30 16:30:32 UTC (rev 4848)
@@ -3,50 +3,21 @@
@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 13/03/2012, 17:37
+ @version 2.1.2
+ @date 30/09/2013, 17:37
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
*/
global $oscss, $languages;
?>
-<div class="tabs_lang">
- <ul>
- <?php for ($i=0, $n=sizeof($languages); $i<$n; $i++): ?>
- <li>
- <a href="#products_desc-<?php echo ($i+1) ?>" ><?php echo tep_language_image( $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . ' ' . $languages[$i]['name'] ?></a>
- </li>
- <?php endfor; ?>
- </ul>
+<div class="desc_base">
- <?php for ($i=0, $n=sizeof($languages); $i<$n; $i++): ?>
- <div id="products_desc-<?php echo ($i+1) ?>">
- <fieldset>
- <legend><?php echo tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . ' ' . $languages[$i]['name'] ?></legend>
+ <?php echo products::DisplayField('url'); ?>
+ <?php echo products::DisplayField('chapo'); ?>
- <p class="block_input">
- <label for="<?php echo 'products_url_' . $languages[$i]['id']; ?>" ><?php echo __('text products url'); ?></label>
- <?php echo tep_draw_input_field('desc_base' .'[products_url][' . $languages[$i]['id'] . ']', 'products_url_' . $languages[$i]['id'], (isset($products_url[$languages[$i]['id']]) ? stripslashes($products_url[$languages[$i]['id']]) : tep_get_products_url(desc_base::$pInfo->products_id, $languages[$i]['id']))); ?>
- <?php echo tep_image(DIR_WS_ICONS.'icon_help.gif', sprintf(__('text products url desc'), $languages[$i]['name'])) ?>
- </p>
- <p class="block_input large">
- <label for="<?php echo 'desc_base'.'_products_chapo_' . $languages[$i]['id'] ?>">
- <?php echo __('Chapeaux').tep_image(DIR_WS_ICONS.'icon_help.gif', __('description rapide, utilisé dans les listing') ) ?>
- </label>
- <br />
- <?php echo $oscss->_call(BO_WISIWYG_SELECTED,'_draw','desc_base' .'[products_chapo][' . $languages[$i]['id'] . ']','400','100',(isset(desc_base::$pInfo->products_chapo[$languages[$i]['id']]) ? unhtmlentities(desc_base::$pInfo->products_chapo[$languages[$i]['id']]) : '') ) ?>
- </p>
- <p class="block_input large">
- <label for="<?php echo 'desc_base' .'_products_description_' . $languages[$i]['id'] ?>">
- <?php echo __('Description principale ').tep_image(DIR_WS_ICONS.'icon_help.gif', __('Description longue affiché uniquement sur la page produit')) ?>
- </label>
- <br />
- <?php echo $oscss->_call(BO_WISIWYG_SELECTED,'_draw','desc_base' .'[products_description][' . $languages[$i]['id'] . ']','400','100',(isset(desc_base::$pInfo->products_description[$languages[$i]['id']]) ? unhtmlentities(desc_base::$pInfo->products_description[$languages[$i]['id']]) : '') ) ?>
- </p>
- </fieldset>
- </div>
- <?php endfor; ?>
+ <?php echo products::DisplayField('description'); ?>
+
</div>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2013-09-30 14:58:54
|
Revision: 4847
http://sourceforge.net/p/oscss/svn/4847
Author: oscim
Date: 2013-09-30 14:58:50 +0000 (Mon, 30 Sep 2013)
Log Message:
-----------
minor bug Fix
Modified Paths:
--------------
trunk/catalog/admin/includes/classes/drivers/sqlfeatured.php
trunk/catalog/admin/includes/classes/drivers/sqlproduct.php
trunk/catalog/admin/includes/modules/pages/cronjob.php
Modified: trunk/catalog/admin/includes/classes/drivers/sqlfeatured.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlfeatured.php 2013-09-30 11:52:26 UTC (rev 4846)
+++ trunk/catalog/admin/includes/classes/drivers/sqlfeatured.php 2013-09-30 14:58:50 UTC (rev 4847)
@@ -360,6 +360,7 @@
else
$datatype = DATATYPES_DEFAULT_NOSELECTED;
+ $res = false;
$data_array_link = $opt['featured_array'];
Modified: trunk/catalog/admin/includes/classes/drivers/sqlproduct.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlproduct.php 2013-09-30 11:52:26 UTC (rev 4846)
+++ trunk/catalog/admin/includes/classes/drivers/sqlproduct.php 2013-09-30 14:58:50 UTC (rev 4847)
@@ -3,8 +3,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 21/02/2012, 23:13
+ @version 2.1.2
+ @date 30/09/2013, 23:13
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
@class manage link table products
@@ -139,7 +139,6 @@
elseif ($action == 'update_product') {
$sql_data_array['products_last_modified'] ='now()';
-// var_dump(self::$modules->get_update_table_products());
$sql_data_array = array_merge($sql_data_array, self::$modules->get_update_table_products());
if( ! tep_db_perform(TABLE_PRODUCTS, $sql_data_array, 'update',"products_id = '" . (int)$products_id . "'") )
@@ -156,11 +155,11 @@
$post['categories'][] = $option['cPath'];
sqlcategorie::DataInCat('products', $products_id, $post['categories']);
}
- elseif(count($post['categories']) > 0)
+ elseif(isset($post['categories']) && count($post['categories']) > 0)
sqlcategorie::DataInCat('products', $products_id, $post['categories']);
}
if( DataTypes::is_active('featured')) {
- if(count($post['linkto']['featured']) > 0)
+ if(isset($post['linkto']['featured']) && count($post['linkto']['featured']) > 0)
$r = sqlfeatured::AddLinkTo(
array(
'datatype'=> 'product',
@@ -328,13 +327,15 @@
, p.products_ordered
FROM " . TABLE_PRODUCTS . " p ".
" WHERE 1 ". $sql;
-
+// echo($sql_query);
$product_query = $DB->query( $sql_query );
if( ! $product_query->__get('numRows') )
return false;
$product = $product_query->fetchAssoc();
+// var_dump($product);
+// exit;
tep_db_free_result($product_query);
@@ -391,13 +392,14 @@
}
//<!-- EOF Separate Pricing Per Customer -->
+
$product['mod'] = self::$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;
+ foreach($array as $key=>$val)
+ $product[$key] = $val;
return ((!$shortkey)? $product : self::CleanKey($product) );
Modified: trunk/catalog/admin/includes/modules/pages/cronjob.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/cronjob.php 2013-09-30 11:52:26 UTC (rev 4846)
+++ trunk/catalog/admin/includes/modules/pages/cronjob.php 2013-09-30 14:58:50 UTC (rev 4847)
@@ -3,8 +3,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 26/04/2012, 21:45
+ @version 2.1.2
+ @date 30/09/2013, 21:45
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
@class cronjob
@@ -378,7 +378,7 @@
static public function ExeCron(){
$DB=Database::getInstance();
- $_query_raw = "select * from " . TABLE_CRONJOB . " WHERE fire_time <= NOW() AND status=1 ";
+ $_query_raw = "select * from " . TABLE_CRONJOB . " WHERE fire_time <='".date('Y-m-d H:i:s')."' AND status=1 ";
$_query = $DB->query($_query_raw);
while($cron_module = $_query->fetchAssoc() ){
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2013-09-30 11:52:30
|
Revision: 4846
http://sourceforge.net/p/oscss/svn/4846
Author: oscim
Date: 2013-09-30 11:52:26 +0000 (Mon, 30 Sep 2013)
Log Message:
-----------
Fix minor php notice
Modified Paths:
--------------
trunk/catalog/admin/includes/gabarit/featureds/display_view.edit.gab
Modified: trunk/catalog/admin/includes/gabarit/featureds/display_view.edit.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/featureds/display_view.edit.gab 2013-09-30 11:50:58 UTC (rev 4845)
+++ trunk/catalog/admin/includes/gabarit/featureds/display_view.edit.gab 2013-09-30 11:52:26 UTC (rev 4846)
@@ -68,7 +68,7 @@
</tr>
</thead>
<tbody>
- <?php foreach(featureds::$Info->listchilds as $row): ?>
+ <?php if(is_array(featureds::$Info->listchilds)) foreach(featureds::$Info->listchilds as $row): ?>
<tr>
<td class="tcenter"><?php echo $row->datatype ?></td>
<td class="tcenter">
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2013-09-30 11:51:02
|
Revision: 4845
http://sourceforge.net/p/oscss/svn/4845
Author: oscim
Date: 2013-09-30 11:50:58 +0000 (Mon, 30 Sep 2013)
Log Message:
-----------
Fix
Modified Paths:
--------------
trunk/catalog/admin/includes/gabarit/categories/display_view.new_light.gab
trunk/catalog/admin/includes/modules/pages/categories.php
Modified: trunk/catalog/admin/includes/gabarit/categories/display_view.new_light.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/categories/display_view.new_light.gab 2013-09-28 09:13:49 UTC (rev 4844)
+++ trunk/catalog/admin/includes/gabarit/categories/display_view.new_light.gab 2013-09-30 11:50:58 UTC (rev 4845)
@@ -3,13 +3,14 @@
@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 30/03/2012, 09:32
+ @version 2.1.2
+ @date 30/09/2013, 09:32
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
*/
global $oscss;
+
$DT = DataTypes::getInstance();
?>
@@ -34,7 +35,7 @@
<legend><?php echo tep_image(DIR_WS_CATALOG_LANGUAGES . categories::$languages[$i]['directory'] . '/images/' . categories::$languages[$i]['image'], categories::$languages[$i]['name'], TEMP_BO_HEADING_IMAGE_WIDTH, TEMP_BO_HEADING_IMAGE_HEIGHT); ?></legend>
<p class="block_input" style="width:90%;">
<label for="<?php echo 'content_title' . categories::$languages[$i]['id']; ?>"><?php echo __('text edit categories name'); ?></label>
- <?php echo tep_draw_input_field('categories_name[' . categories::$languages[$i]['id'] . ']', '', categories::$cInfo->categories_name[categories::$languages[$i]['id']]) ; ?>
+ <?php echo tep_draw_input_field('categories_name[' . categories::$languages[$i]['id'] . ']', '', categories::$Info->categories_name[categories::$languages[$i]['id']]) ; ?>
</p>
</fieldset>
<?php } ?>
@@ -47,8 +48,8 @@
<?php echo tep_draw_hidden_field('categories_datatype','', @$_GET['datatype']).
-tep_draw_hidden_field('categories_status','', categories::$cInfo->categories_status).
-tep_draw_hidden_field('categories_hidden','', categories::$cInfo->categories_hidden).
+tep_draw_hidden_field('categories_status','', categories::$Info->categories_status).
+tep_draw_hidden_field('categories_hidden','', categories::$Info->categories_hidden).
tep_draw_hidden_field('origin', '',@$_GET['origin']);
// tep_draw_hidden_field();
?>
@@ -64,10 +65,10 @@
<dd class="block_input w_90 CategoryView ">
<label for="products_date_available"><?php echo __('txt categories'); ?></label>
<ul id="cat_list_in_edit" class="ChooseSelect">
- <li class="<?php echo (((int)categories::$cInfo->parent_id == '0')? 'selected' : 'noselected') ?>"><?php echo tep_draw_radio_field('cPath','cat_0', '0', ((int)categories::$cInfo->parent_id == '0') ).' '.__('text categorie racine') ?></li>
- <?php foreach(categorieUtility::get_cat_list(array('root'=>0,'incre'=>false, 'datatype'=>categories::$cInfo->categories_datatype)) as $v)
- if(categories::$cInfo->categories_id != $v['categories_id']){
- $etat = ((categories::$cInfo->parent_id > 0 && categories::$cInfo->parent_id == $v['categories_id']) ? true :false );
+ <li class="<?php echo (((int)categories::$Info->parent_id == '0')? 'selected' : 'noselected') ?>"><?php echo tep_draw_radio_field('cPath','cat_0', '0', ((int)categories::$Info->parent_id == '0') ).' '.__('text categorie racine') ?></li>
+ <?php foreach(categorieUtility::get_cat_list(array('root'=>0,'incre'=>false, 'datatype'=>categories::$Info->categories_datatype)) as $v)
+ if(categories::$Info->categories_id != $v['categories_id']){
+ $etat = ((categories::$Info->parent_id > 0 && categories::$Info->parent_id == $v['categories_id']) ? true :false );
echo '<li class="'.(($etat)? 'selected' : 'noselected').'">'.
tep_decal(($v['niveau']+1)).
' '. tep_draw_radio_field('cPath','cat_'.$v['categories_id'], (string)$v['categories_id'],(bool)$etat).
Modified: trunk/catalog/admin/includes/modules/pages/categories.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/categories.php 2013-09-28 09:13:49 UTC (rev 4844)
+++ trunk/catalog/admin/includes/modules/pages/categories.php 2013-09-30 11:50:58 UTC (rev 4845)
@@ -194,7 +194,7 @@
'sort'=>true,
'alias'=>'name',
'text'=>__('categories table heading name'),
-// 'default'=>true,
+ 'default'=>true,
'width'=>'18%',
'edit'=>array(
'input_name'=>__CLASS__.'[categories_name]',
@@ -238,7 +238,7 @@
'sort'=>true,
'alias'=>'hidden',
'text'=>__('categories table heading hidden'),
-// 'default'=>true,
+ 'default'=>true,
'width'=>'5%',
'edit'=>array(
'input_name'=>'categories_hidden',
@@ -683,16 +683,16 @@
case 'new_light':
$GLOBALS['cPath']=null;
- self::$cInfo = new objectInfo( sqlcategorie::Specimen() );
+ self::$Info = new objectInfo( sqlcategorie::Specimen() );
+//
+// if(isset($_GET['datatype']))
+// self::$cInfo->categories_datatype = tep_db_prepare_input( $_GET['datatype']);
- if(isset($_GET['datatype']))
- self::$cInfo->categories_datatype = tep_db_prepare_input( $_GET['datatype']);
+// $oscss->_add_ext(BO_WISIWYG_SELECTED,'editeur/');
+// for ($i=0, $n=sizeof(self::$languages); $i<$n; $i++) {
+// echo $oscss->_call(BO_WISIWYG_SELECTED,'_top','categories_description[' . self::$languages[$i]['id'] . ']','600','400');
+// }
- $oscss->_add_ext(BO_WISIWYG_SELECTED,'editeur/');
- for ($i=0, $n=sizeof(self::$languages); $i<$n; $i++) {
- echo $oscss->_call(BO_WISIWYG_SELECTED,'_top','categories_description[' . self::$languages[$i]['id'] . ']','600','400');
- }
-
break;
/**
@@ -846,30 +846,28 @@
/**
@remarks Ajax popup
*/
- case 'new_light':
- $action='new_light';
- break;
+// break;
+
/**
@remarks Normal View Page
*/
- case 'edit':
- case 'new':
- $action='edit';
+ case 'new_light':
+ $action='new_light';
self::$Info=self::GetDBValue(self::$Id);
/// use master gabarit
return MGabCont::CallGab(self::$action,__FUNCTION__,__CLASS__);
break;
+ case 'edit':
+ case 'new':
case 'delete':
- self::$Info=self::GetDBValue(self::$Id);
- /// use master gabarit
- return MGabCont::CallGab(self::$action,__FUNCTION__,__CLASS__);
- break;
case 'copy_to':
+ $action='edit';
self::$Info=self::GetDBValue(self::$Id);
/// use master gabarit
return MGabCont::CallGab(self::$action,__FUNCTION__,__CLASS__);
break;
+
default:
if(!empty(self::$actions['action_method']) )
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2013-09-28 09:13:53
|
Revision: 4844
http://sourceforge.net/p/oscss/svn/4844
Author: oscim
Date: 2013-09-28 09:13:49 +0000 (Sat, 28 Sep 2013)
Log Message:
-----------
Clean database dir
Fix
Modified Paths:
--------------
trunk/catalog/admin/includes/gabarit/configuration/modprodextra/draw.label.edit.gab
trunk/catalog/admin/includes/modules/configuration/modprodextra.php
Removed Paths:
-------------
trunk/catalog/admin/includes/javascript/dataTables.TableTools/images/psd/
Modified: trunk/catalog/admin/includes/gabarit/configuration/modprodextra/draw.label.edit.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/configuration/modprodextra/draw.label.edit.gab 2013-09-24 14:35:31 UTC (rev 4843)
+++ trunk/catalog/admin/includes/gabarit/configuration/modprodextra/draw.label.edit.gab 2013-09-28 09:13:49 UTC (rev 4844)
@@ -116,7 +116,7 @@
<div class="button_nav">
- <?php echo tep_image_submit('button_save.gif', IMAGE_SAVE) . ' <a class="button" href="' . tep_href_link(FILENAME_CONFIGURATION, FILENAME_CFG_34. '&eid=' . modprodextra::$eid) . '">' . IMAGE_CLOSE . "</a>\n" ?>
+ <?php echo tep_image_submit('button_save.gif', IMAGE_SAVE) . ' <a class="button" href="' . tep_href_link(FILENAME_CONFIGURATION, FILENAME_CFG_34. '&eid=' . modprodextra::$eid) . '">' . IMAGE_BACK . "</a>\n" ?>
</div>
<br class="clear" />
Modified: trunk/catalog/admin/includes/modules/configuration/modprodextra.php
===================================================================
--- trunk/catalog/admin/includes/modules/configuration/modprodextra.php 2013-09-24 14:35:31 UTC (rev 4843)
+++ trunk/catalog/admin/includes/modules/configuration/modprodextra.php 2013-09-28 09:13:49 UTC (rev 4844)
@@ -3,8 +3,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 03/01/2013, 15:38
+ @version 2.1.2
+ @date 27/09/2013, 15:38
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
@class modprodextra
@@ -17,7 +17,7 @@
Class modprodextra{
/**
- @def FILENAME le filename courant
+ @def FILENAME le filename courant
*/
const FILENAME = FILENAME_CONFIGURATION;
/**
@@ -79,7 +79,7 @@
- //! @remarks Force load language centralised
+ //! @remarks Force load language centralised
global $oscss,$language, $languages_id;
$oscss->pile_file_lang(DIR_FS_ADMIN.DIR_WS_LANGUAGES.$language.'/modules/filters.txt');
@@ -162,8 +162,7 @@
case 'update': // validate form
-// $query = tep_db_query("select epf_size, epf_input_type from " . TABLE_PRODUCTS_EXTRA_FIELDS . " where epf_id = " . (int)self::$eid);
-// $field_info = tep_db_fetch_array($query); // retrieve original field information
+ // retrieve original field information
$field_info = sqlproductsextrafields::fetch(array('id'=>(int)self::$eid));
try{
@@ -190,7 +189,7 @@
$size = tep_db_prepare_input($_POST['size']);
if (!is_numeric($size) || ($size < 1) || ($size > 255)) throw new Exception(ERROR_ENTRY_REQUIRED . ERROR_OUTOFRANGE);
}
- if ($uses_list == 1) {
+ if ( in_array( $uses_list , array(2,3,4,6,7) )) {
$size = 64;
if (!isset($_POST['chain']))throw new Exception(ERROR_ENTRY_REQUIRED . TEXT_SHOW_PARENTS);
$chain = ($_POST['chain'] == '0') ? 0 : 1;
@@ -361,7 +360,7 @@
$r=sqlproductsextrafieldsvalues::update($data_array);
}
-
+
tep_redirect(tep_href_link(self::FILENAME, FILENAME_CFG_34 . '&eid=' . self::$eid.'&action=value_listing'));
break;
@@ -408,7 +407,7 @@
case 'value_delete_confirm':
case 'delete_value_confirm':
sqlproductsextrafields::fetch(array('id'=> (int)self::$eid ));
-
+
$r=sqlproductsextrafieldsvalues::delete(array('epf_id'=>(int)self::$eid, 'id'=>(int)$_GET['vid']));
tep_redirect(tep_href_link(self::FILENAME, FILENAME_CFG_34. '&action=value_listing&eid=' . (int)self::$eid));
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2013-09-24 14:35:34
|
Revision: 4843
http://sourceforge.net/p/oscss/svn/4843
Author: oscim
Date: 2013-09-24 14:35:31 +0000 (Tue, 24 Sep 2013)
Log Message:
-----------
Fix product html .gab file
Modified Paths:
--------------
trunk/catalog/admin/includes/gabarit/products/display_view.delete.gab
trunk/catalog/admin/includes/gabarit/products/display_view.edit.gab
Modified: trunk/catalog/admin/includes/gabarit/products/display_view.delete.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/products/display_view.delete.gab 2013-09-24 13:05:56 UTC (rev 4842)
+++ trunk/catalog/admin/includes/gabarit/products/display_view.delete.gab 2013-09-24 14:35:31 UTC (rev 4843)
@@ -3,8 +3,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 04/04/2012, 09:48
+ @version 2.1.2
+ @date 23/09/2013, 09:48
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
*/
@@ -12,10 +12,10 @@
<h3><?php printf(__('text info heading delete product'),''); ?></h3>
<?php print tep_draw_form('products', products::FILENAME, 'action=delete_product_confirm') ; ?>
<fieldset class="block_input">
- <p><?php print __('text delete product intro'). tep_draw_hidden_field('products_id', '', products::$Info->products_id) ; ?></p>
+ <p><?php print __('text delete product intro'). tep_draw_hidden_field('products_id', '', products::$Info->id) ; ?></p>
<p><?php print '<strong>' . products::$Info->products_name . '</strong>' ; ?></p>
- <?php $product_categories = tep_generate_category_path(products::$Info->products_id, 'product');
+ <?php $product_categories = tep_generate_category_path(products::$Info->id, 'product');
$so='';
for ($i = 0, $n = sizeof($product_categories); $i < $n; $i++) {
$category_path = '';
@@ -30,13 +30,13 @@
</ul>
<?php
/* aca sortie */
- $contents=products::$modules->display_right_delete_confirm(array(), products::$Info->products_id);
+ $contents=products::$modules->display_right_delete_confirm(array(), products::$Info->id);
$box = new box;
echo $box->infoBox(array(), $contents);
?>
</fieldset>
<fieldset class="block_input button_nav">
- <?php print tep_image_submit('button_delete.gif', IMAGE_DELETE) . tep_js_back(tep_href_link(products::FILENAME, 'pID=' . products::$Info->products_id), IMAGE_CANCEL) ; ?>
+ <?php print tep_image_submit('button_delete.gif', IMAGE_DELETE) . tep_js_back(tep_href_link(products::FILENAME, 'pID=' . products::$Info->id), IMAGE_CANCEL) ; ?>
</fieldset>
</form>
\ No newline at end of file
Modified: trunk/catalog/admin/includes/gabarit/products/display_view.edit.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/products/display_view.edit.gab 2013-09-24 13:05:56 UTC (rev 4842)
+++ trunk/catalog/admin/includes/gabarit/products/display_view.edit.gab 2013-09-24 14:35:31 UTC (rev 4843)
@@ -3,8 +3,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 04/04/2012, 09:48
+ @version 2.1.2
+ @date 20/09/2013, 09:48
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
*/
@@ -39,7 +39,7 @@
<fieldset class="block_field">
<ul>
<li class="block_input">
- <?php echo products::DisplayField('ref', '%s'); ?>
+ <?php echo products::DisplayField('ref', '%s')/* )*/; ?>
</li>
<?php if(products::CheckClassProduct('CLASS_MODELE')): ?>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2013-09-24 13:05:59
|
Revision: 4842
http://sourceforge.net/p/oscss/svn/4842
Author: oscim
Date: 2013-09-24 13:05:56 +0000 (Tue, 24 Sep 2013)
Log Message:
-----------
Fix
Modified Paths:
--------------
trunk/catalog/admin/includes/modules/products/desc_base.php
trunk/catalog/includes/classes/page.php
Modified: trunk/catalog/admin/includes/modules/products/desc_base.php
===================================================================
--- trunk/catalog/admin/includes/modules/products/desc_base.php 2013-09-24 07:53:10 UTC (rev 4841)
+++ trunk/catalog/admin/includes/modules/products/desc_base.php 2013-09-24 13:05:56 UTC (rev 4842)
@@ -123,9 +123,9 @@
break;
// case 'tables':
-//
+//
// $array['ps'] = " LEFT JOIN " . TABLE_PRODUCTS_ECOTAX . " pet ON( pet.products_id=p.products_id ) ";
-//
+//
// break;
}
@@ -191,27 +191,27 @@
*/
function insert_table_products_description ($language_id) {
$myarray = array();
- if(isset( self::$pArray['products_name'][$language_id] ) && count(self::$pArray['products_name'])>1)
- $myarray=array(
+ if(isset( self::$pArray['products_name'][$language_id] ) && is_array(self::$pArray['products_name']))
+ $myarray=array(
'products_name' => self::$pArray['products_name'][$language_id],
'products_description' => self::$pArray['products_description'][$language_id],
'products_chapo' => self::$pArray['products_chapo'][$language_id],
'products_url' => self::$pArray['products_url'][$language_id]
);
elseif(isset( self::$pArray['products_name']))
- $myarray=array(
+ $myarray=array(
'products_name' => self::$pArray['products_name'],
);
elseif(isset( self::$pArray['products_description']))
- $myarray=array(
+ $myarray=array(
'products_description' => self::$pArray['products_description'],
);
elseif(isset( self::$pArray['products_chapo']))
- $myarray=array(
+ $myarray=array(
'products_chapo' => self::$pArray['products_chapo'],
);
elseif(isset( self::$pArray['products_url']))
- $myarray=array(
+ $myarray=array(
'products_url' => self::$pArray['products_url']
);
else
@@ -251,7 +251,7 @@
self::$pInfo->objectInfo($arr);
- return $arr;
+ return $arr;
}
/**
Modified: trunk/catalog/includes/classes/page.php
===================================================================
--- trunk/catalog/includes/classes/page.php 2013-09-24 07:53:10 UTC (rev 4841)
+++ trunk/catalog/includes/classes/page.php 2013-09-24 13:05:56 UTC (rev 4842)
@@ -310,24 +310,22 @@
@return none
*/
private function LoadInitTheme(){
-
$page=$this;
- $language=$this->page['languages'];
+ $language=$this->GetVar('language');
$PHP_SELF=$this->page['content'];
$template=$this->page['template'];
$current_category_id=$this->ret_var_page('current_category_id');
$languages_id=$this->ret_var_page('languages_id');
$load = self::$load_theme ;
-
/**
\brief Langue specifique au template
\note specifique text __()
*/
- if(($path=self::fix_file(DIR_WS_LANGUAGES . $language.'.php' ,true, false)) !=false) $this->pile_file_lang($path);
- elseif(($path=self::fix_file(DIR_WS_LANGUAGES . $language.'/'.$language.'.php' ,true, false)) !=false) $this->pile_file_lang($path);
- elseif(($path=self::fix_file(DIR_WS_LANGUAGES . 'fr_FR.php' ,true, false)) !=false) $this->pile_file_lang($path);
- elseif(($path=self::fix_file(DIR_WS_LANGUAGES . 'fr_FR/fr_FR.php' ,true, false)) !=false) $this->pile_file_lang($path);
+ if(($path=self::fix_file(DIR_WS_LANGUAGES . $language.'.txt' ,true)) !=false) $this->pile_file_lang($path);
+ elseif(($path=self::fix_file(DIR_WS_LANGUAGES . $language.'/'.$language.'.txt' ,true)) !=false) $this->pile_file_lang($path);
+ elseif(($path=self::fix_file(DIR_WS_LANGUAGES . 'fr_FR.txt' ,true)) !=false) $this->pile_file_lang($path);
+ elseif(($path=self::fix_file(DIR_WS_LANGUAGES . 'fr_FR/fr_FR.txt' ,true)) !=false) $this->pile_file_lang($path);
$init_theme=call_user_func(array(PUBLIC_DRIVERS_PAGE,'GetInit'));
if(self::TestFile($init_theme)) include($init_theme);
@@ -344,7 +342,7 @@
private function draw_file_header($StringGet=''){
$page=$this;
- $language=$this->page['language'];
+ $language=$this->GetVar('language');
$PHP_SELF=$this->page['content'];
$template=$this->page['template'];
$current_category_id=$this->ret_var_page('current_category_id');
@@ -939,7 +937,7 @@
global $lang;
$page=$this;
- $language=$this->page['language'];
+ $language=$this->GetVar('language');
$PHP_SELF=$this->page['content'];
$template=$this->page['template'];
$current_category_id=$this->ret_var_page('current_category_id');
@@ -1005,7 +1003,7 @@
// report des var d'enviroennement
$page=$this;
- $language=$this->page['language'];
+ $language=$this->GetVar('language');
$PHP_SELF=$this->page['content'];
$template=$this->page['template'];
$current_category_id=$this->ret_var_page('current_category_id');
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2013-09-24 07:53:17
|
Revision: 4841
http://sourceforge.net/p/oscss/svn/4841
Author: oscim
Date: 2013-09-24 07:53:10 +0000 (Tue, 24 Sep 2013)
Log Message:
-----------
Fix bug in load content by contructor page
Fix auto generate code
Modified Paths:
--------------
trunk/catalog/includes/application_top.php
trunk/catalog/includes/classes/drivers/page/GabaritTemplate.php
trunk/catalog/includes/classes/page.php
trunk/dev/GenerCode/datatype/Modele/catalog/common/classes/datatype_drivers/Data__DATATYPE_REPLACE_.php
trunk/dev/GenerCode/datatype/Modele/catalog/common/classes/datatype_drivers/Data__DATATYPE_REPLACE_.php.modele2
Modified: trunk/catalog/includes/application_top.php
===================================================================
--- trunk/catalog/includes/application_top.php 2013-09-23 11:59:18 UTC (rev 4840)
+++ trunk/catalog/includes/application_top.php 2013-09-24 07:53:10 UTC (rev 4841)
@@ -309,8 +309,11 @@
if (isset($_GET['language']))
tep_redirect(tep_href_link());
}
- else
- $lng = new language($language);
+ else{
+ $lng = new language();
+ $language = $lng->language['directory'];
+ $languages_id = $lng->language['id'];
+ }
$page->add_var_page('language',$language);
$page->add_var_page('languages_id',$languages_id);
Modified: trunk/catalog/includes/classes/drivers/page/GabaritTemplate.php
===================================================================
--- trunk/catalog/includes/classes/drivers/page/GabaritTemplate.php 2013-09-23 11:59:18 UTC (rev 4840)
+++ trunk/catalog/includes/classes/drivers/page/GabaritTemplate.php 2013-09-24 07:53:10 UTC (rev 4841)
@@ -3,7 +3,7 @@
@licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
@portion code Copyright (c) 2002 osCommerce
@package osCSS-2 <www http://www.oscss.org>
- @version 2.1.1
+ @version 2.1.2
@date 20/03/2012, 00:44
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
@@ -14,7 +14,8 @@
*/
class GabaritTemplate
- extends page{
+ extends page
+ {
/**
@@ -43,7 +44,7 @@
$basepath = array($page->getPathTemplate()/*, DIR_WS_TEMPLATES . DEFAULT_TEMPLATE_NAME. '/'*/);
$suffixe = array();
- // add cpath or tag_id for specifical template
+ // add cpath or tag_id for specifical template
if ( ($dyntype = DataTypes::is_type('cpath')) && $dyntype != false ){
$cPath = $dyntype->GetcPath('cpath');
@@ -53,20 +54,20 @@
$prev = array();
if(strpos($cPath,'_')>0){
foreach(explode('_', $cPath) as $cpath)
- $prev[]='c_'.$cpath .'.';
+ $prev[]='c_'.$cpath .'.';
}
else
$prev[]='c_'.$cPath.'.';
- foreach($prev as $p)
- // cpath link
+ foreach($prev as $p)
+ // cpath link
$suffixe[]=$p . $suf.'_'.$page->GetVar('current_id');
- // normal link
+ // normal link
$suffixe[]=$suf.'_'.$page->GetVar('current_id');
}
-
+
if(strpos($cPath,'_')!=false)
$suffixe[]='c_'.substr($cPath, 0, strpos($cPath,'_')).'.childs';
else
@@ -81,30 +82,28 @@
// $suffixe[]='c_'.substr($cPath, 0, strpos($cPath,'_')).'.childs';
foreach(explode('_', $cPath) as $cpath)
- $prev[]='c_'.$cpath ;
+ $prev[]='c_'.$cpath ;
}
else
$prev[]='c_'.$cPath;
- foreach($prev as $p)
- // cpath link
+ foreach($prev as $p)
+ // cpath link
$suffixe[]=$p ;
-
}
- // reel normal page
+ // reel normal page
$reel = substr($page->page['content'],0,-4);
$basename = array(
- $reel,
+ $reel,
$reel.'.template' ,
- 'template',
+ 'template',
);
$page->page['gabarit']= '';
-// print_r($basename);
// array path template
foreach($basepath as $path){
@@ -113,15 +112,15 @@
// array suffixe name
foreach($suffixe as $suf){
- $test = str_replace(array('%1%.','%2%.','%3%'), array('',$suf.'.',$name), $format_file);
+ $test = str_replace(array('%1%.','%2%.','%3%'), array('',$suf.'.',$name), $format_file);
if( parent::TestFile($path . $test) ){
$page->page['gabarit']= $test ;
return parent::$GlobalCache['gabarit']=$page->page['gabarit'];
}
}
-
- // no suffixe
- $test = str_replace(array('%1%.','%2%.','%3%'), array('','',$name), $format_file);
+
+ // no suffixe
+ $test = str_replace(array('%1%.','%2%.','%3%'), array('','',$name), $format_file);
if( parent::TestFile($path . $test) ){
$page->page['gabarit']= $test ;
return parent::$GlobalCache['gabarit']=$page->page['gabarit'];
@@ -129,10 +128,6 @@
}
}
-// var_dump($page->page['gabarit']);
-
-// return ;/**/
-
return ;
}
@@ -145,8 +140,7 @@
protected static function GetTypeContent(){
global $page;
-
- // use data in master cache file
+ //use data in master cache file
if(isset(parent::$GlobalCache['gabarit'])){
$page->page['class']=parent::$GlobalCache['class_content'];
return $page->page['type']=parent::$GlobalCache['type_content'];
@@ -156,10 +150,10 @@
$page->page['type']='none';
/// obtain type pre-selected by index.php page (Childs datatype_drivers)
- if( ($type = DataTypes::GetTypePage()) && $type !=NULL)
+ if( ($type = DataTypes::GetTypePage()) && $type !=NULL)
$page->page['type']=$type;
- /// determine type by GET/POST key data
+ /// determine type by GET/POST key data
else{
if (isset($_GET['popup'])){
$page->page['type']='popup';
@@ -210,7 +204,6 @@
*/
protected static function GetHeader($path='header'){
global $page;
-
return $page->getPathTemplate().$path.'.php';
}
@@ -220,6 +213,8 @@
*/
protected static function GetInit(){
global $page;
+
+
return $page->getPathTemplate().'cfg/init.php';
}
Modified: trunk/catalog/includes/classes/page.php
===================================================================
--- trunk/catalog/includes/classes/page.php 2013-09-23 11:59:18 UTC (rev 4840)
+++ trunk/catalog/includes/classes/page.php 2013-09-24 07:53:10 UTC (rev 4841)
@@ -3,8 +3,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 19/04/2012, 21:44
+ @version 2.1.2
+ @date 24/09/2013, 21:44
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
\class page
@@ -21,7 +21,7 @@
/**
@var path for drivers module
*/
-// const PATH_DRIVERS_PAGE = 'drivers/page/';
+ const PATH_DRIVERS_PAGE = 'drivers/page/';
/**
@var generic var for call constructeur
*/
@@ -139,7 +139,7 @@
/**
@remarks call drivers modules
*/
-// require_once(self::PATH_DRIVERS_PAGE.PUBLIC_DRIVERS_PAGE.'.php');
+ require_once(self::PATH_DRIVERS_PAGE.PUBLIC_DRIVERS_PAGE.'.php');
}
public static function getInstance($FileRegistered=array()) {
@@ -190,7 +190,7 @@
Use drivers/page/
*/
private function type_content(){
- return call_user_func(array(PUBLIC_DRIVERS_PAGE,'GetTypeContent'));
+ return call_user_func(array(PUBLIC_DRIVERS_PAGE,'GetTypeContent'));
}
@@ -208,6 +208,7 @@
$doublon=array();
static $doublon;
$sortie=NULL;
+
$file=basename($path);
$path=dirname($path);
$path.=(!preg_match("#.*/$#",$path))?'/':'';
@@ -215,6 +216,7 @@
$file_path=(substr($file_path,0,strlen( tep_get_http())) == tep_get_http())? substr($file_path,strlen( tep_get_http())) : $file_path;
$path_template=DIR_WS_TEMPLATES . (isset($page->page['template'])? $page->page['template'] : TEMPLATE_NAME ) .'/';
+
if($lg && $file=substr($file,0,-4) ) {
if($core==NULL || $core==false)
foreach( array('txt','php') as $ext_lg)
@@ -310,7 +312,7 @@
private function LoadInitTheme(){
$page=$this;
- $language=$this->page['language'];
+ $language=$this->page['languages'];
$PHP_SELF=$this->page['content'];
$template=$this->page['template'];
$current_category_id=$this->ret_var_page('current_category_id');
@@ -322,13 +324,15 @@
\brief Langue specifique au template
\note specifique text __()
*/
- if(($path=self::fix_file(DIR_WS_LANGUAGES . $language.'.php' ,true)) !=false) $this->pile_file_lang($path);
- elseif(($path=self::fix_file(DIR_WS_LANGUAGES . 'fr_FR.php' ,true)) !=false) $this->pile_file_lang($path);
+ if(($path=self::fix_file(DIR_WS_LANGUAGES . $language.'.php' ,true, false)) !=false) $this->pile_file_lang($path);
+ elseif(($path=self::fix_file(DIR_WS_LANGUAGES . $language.'/'.$language.'.php' ,true, false)) !=false) $this->pile_file_lang($path);
+ elseif(($path=self::fix_file(DIR_WS_LANGUAGES . 'fr_FR.php' ,true, false)) !=false) $this->pile_file_lang($path);
+ elseif(($path=self::fix_file(DIR_WS_LANGUAGES . 'fr_FR/fr_FR.php' ,true, false)) !=false) $this->pile_file_lang($path);
$init_theme=call_user_func(array(PUBLIC_DRIVERS_PAGE,'GetInit'));
if(self::TestFile($init_theme)) include($init_theme);
- self::$load_theme = $load;
+ self::$load_theme = $load;
}
/**
@@ -475,7 +479,7 @@
$this->page['content']=trim($p_content);
$this->page['language']=$language;
- $this->type_content();
+ $this->type_content() ;
$page=$this;
@@ -526,6 +530,7 @@
$this->new_class('oscss_plugins');
$this->new_class('categorie');
+
//! Class specifique type de page
if (in_array($this->the_type(),explode(',',str_replace(' ','',PUBLIC_PAGE_TYPE)))){
global $ACA;
@@ -549,7 +554,7 @@
}
//! Init du theme
- $this->oscss_get_gabarit_template();
+ $this->oscss_get_gabarit_template();
///! recup elements des plugins
$this->page['plugins']['present']=$this->oscss_plugins->plugins_active('generic');
$this->page['plugins']['type']=$this->oscss_plugins->plugins_active($this->the_type());
@@ -802,15 +807,16 @@
@param $key string nom de la variable
@return value/false
*/
- public function the_var($key){ return $this->ret_var_page($key); }
- public function GetVar($key){ return $this->ret_var_page($key); }
+ public function GetVar($key){ return $this->ret_var_page($key); }
+ public function the_var($key){ return $this->GetVar($key); }
+
/**
@fn the_template()
\brief Nom du template
*/
- public function the_template(){ return $this->page['template']; }
public function GetTemplate(){ return $this->page['template']; }
+ public function the_template(){ return $this->GetTemplate(); }
/**
@fn the_content($court=false)
@@ -818,19 +824,17 @@
*/
public function the_content($court=false){ return (!$court) ? $this->page['content'] : substr($this->page['content'],0, -strlen($this->ext) ) ; }
+ /**
+ @fn GetPageType()
+ \brief retourne le type de page
+ */
+ public function GetPageType(){ return (isset($this->page['type'])? $this->page['type'] : 'none') ; }
/**
- \fn ret_page_type()
\brief alias the_type()
- @p string page['type'] type page (account, checkout, adresse, product);
*/
- public function ret_page_type(){ return $this->the_type() ;}
+ public function ret_page_type(){ return $this->GetPageType() ;}
+ public function the_type(){ return $this->GetPageType() ; }
- /**
- @fn the_type()
- \brief retourne le type de page
- */
- public function the_type(){ return (isset($this->page['type'])? $this->page['type'] : 'none') ; }
- public function GetPageType(){ return (isset($this->page['type'])? $this->page['type'] : 'none') ; }
/**
@fn GetThemeLoad()
@@ -945,7 +949,6 @@
// foreach( tep_extrac_querystring($StringGet) as $k =>$v)
// $load->$k = $v;
-
/**
@brief Chargement des module actifs
*/
@@ -985,15 +988,11 @@
$this->javascript->add_multi($fct());
}
}
-
$file=call_user_func(array(PUBLIC_DRIVERS_PAGE,'GetHeader'),$bar);
if(self::TestFile($file)) include($file);
// report file in liste
$load->lists_file[__FUNCTION__][] = $bar;
-
- self::$load_theme = $load;
-
}
Modified: trunk/dev/GenerCode/datatype/Modele/catalog/common/classes/datatype_drivers/Data__DATATYPE_REPLACE_.php
===================================================================
--- trunk/dev/GenerCode/datatype/Modele/catalog/common/classes/datatype_drivers/Data__DATATYPE_REPLACE_.php 2013-09-23 11:59:18 UTC (rev 4840)
+++ trunk/dev/GenerCode/datatype/Modele/catalog/common/classes/datatype_drivers/Data__DATATYPE_REPLACE_.php 2013-09-24 07:53:10 UTC (rev 4841)
@@ -8,7 +8,7 @@
@author genrated by dev/datatype/generat
@encode UTF-8
@class Data__DATATYPE_REPLACE_
- @brief This class is base datatype for _DATATYPE_REPLACE_
+ @brief This class is base datatype for _DATATYPE_REPLACE_
*/
class Data__DATATYPE_REPLACE_ {
@@ -20,46 +20,46 @@
public $DataType = '_DATATYPE_REPLACE_';
/**
- @var DataType array reg for seo class
+ @var DataType array reg for seo class
*/
public $reg_anchors = array(
- '_DATATYPE_REPLACE_' => '_DATATYPE_REPLACE_SEOTAG_'
+ '_DATATYPE_REPLACE_' => '_DATATYPE_REPLACE_SEOTAG_'
);
/**
@var DataType array reg check for control get params , please respect order $reg_anchors
*/
public $reg_check = array(
- '([0-9]*)' // unique page
+ '([0-9]*)' // unique page
);
/**
- @var DataType files for folder /_DATATYPE_REPLACE_
+ @var DataType files for folder /_DATATYPE_REPLACE_
*/
public $reg_filenames = array(
- 'FILENAME__DATATYPE_REPLACE_MAJ_' => FILENAME_DEFAULT // unique page
+ 'FILENAME__DATATYPE_REPLACE_MAJ_' => FILENAME_DEFAULT // unique page
);
/**
@var DataType Tables define
*/
public $db_tables = array(
## table master
- 'TABLE__DATATYPE_REPLACE_MAJ_' => '_DATATYPE_REPLACE_', //
+ 'TABLE__DATATYPE_REPLACE_MAJ_' => '_DATATYPE_REPLACE_', //
## table language
- 'TABLE__DATATYPE_REPLACE_MAJ__DESCRIPTION' => '_DATATYPE_REPLACE__description', //
+ 'TABLE__DATATYPE_REPLACE_MAJ__DESCRIPTION' => '_DATATYPE_REPLACE__description', //
## table extra
-// 'TABLE__DATATYPE_REPLACE_MAJ__EXTRA' => '_DATATYPE_REPLACE__extra', //
- 'TABLE__DATATYPE_REPLACE_MAJ__EXTRA_FIELDS' => '_DATATYPE_REPLACE__extra_fields', //
- 'TABLE__DATATYPE_REPLACE_MAJ__EXTRA_FIELDS_LABELS' => '_DATATYPE_REPLACE__extra_fields_labels', //
- 'TABLE__DATATYPE_REPLACE_MAJ__EXTRA_FIELDS_VALUES' => '_DATATYPE_REPLACE__extra_fields_values', //
- 'TABLE__DATATYPE_REPLACE_MAJ__TO__DATATYPE_REPLACE_MAJ__EXTRA_FIELDS' => '_DATATYPE_REPLACE__to__DATATYPE_REPLACE__extra_fields', //
+// 'TABLE__DATATYPE_REPLACE_MAJ__EXTRA' => '_DATATYPE_REPLACE__extra', //
+ 'TABLE__DATATYPE_REPLACE_MAJ__EXTRA_FIELDS' => '_DATATYPE_REPLACE__extra_fields', //
+ 'TABLE__DATATYPE_REPLACE_MAJ__EXTRA_FIELDS_LABELS' => '_DATATYPE_REPLACE__extra_fields_labels', //
+ 'TABLE__DATATYPE_REPLACE_MAJ__EXTRA_FIELDS_VALUES' => '_DATATYPE_REPLACE__extra_fields_values', //
+ 'TABLE__DATATYPE_REPLACE_MAJ__TO__DATATYPE_REPLACE_MAJ__EXTRA_FIELDS' => '_DATATYPE_REPLACE__to__DATATYPE_REPLACE__extra_fields', //
## table link datatype categorie
- 'TABLE__DATATYPE_REPLACE_MAJ__TO_CATEGORIES' => '_DATATYPE_REPLACE__to_categories' //
+ 'TABLE__DATATYPE_REPLACE_MAJ__TO_CATEGORIES' => '_DATATYPE_REPLACE__to_categories' //
);
/**
@var DataType dynamic
*/
public $DataTypeDynamic = true;
/**
- @var prefix alias a utilise systematiquement dans les requete sql
+ @var prefix alias a utilise systematiquement dans les requete sql
*/
public $p = '_DATATYPE_REPLACE_SEOTAG_xx';
/**
@@ -75,7 +75,7 @@
/**
@brief constructor
- @param next bool true for complete load , but use 2 call
+ @param next bool true for complete load , but use 2 call
*/
function __construct($next=false){
global $languages_id;
@@ -98,7 +98,7 @@
/**
@brief test si al page est du type _DATATYPE_REPLACE_
@param $mode le type de control (page/cpath/seo)
- @return boolean true / false
+ @return boolean true / false
*/
function is_type($mode='unique'){
switch(strtolower($mode)){
@@ -136,10 +136,10 @@
}
/**
- @brief Prepare an retrun result Seo request
- @param $mode string anchor key used
+ @brief Prepare an retrun result Seo request
+ @param $mode string anchor key used
@param $subtype Not used
- @param $id integer current id
+ @param $id integer current id
@param $language_id integer current language id
@return array (
ID => '',
@@ -157,7 +157,7 @@
TODO le flag doit utiliser le $reg_anchors
*/
- case 't':
+ case '_DATATYPE_REPLACE_SEOTAG_':
default:
$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='".$this->DataType."' and ftd.language_id = '" . (int)$language_id. "' Limit 1";
$rsql = $DB->query($sql);
@@ -226,7 +226,7 @@
- // calcul extra actived for search
+ // calcul extra actived for search
$allextraactived = array();
$query = $DB->query("SELECT epf_id, epf_uses_value_list, epf_active_value_language FROM " . TABLE__DATATYPE_REPLACE_MAJ__EXTRA_FIELDS . " WHERE epf_status = '1' AND epf_advanced_search = '1' ");
$allextraactived = $query->fetchAllAssoc();
@@ -241,7 +241,7 @@
$this->listing_sql['col_count'] = " ".$this->p."._DATATYPE_REPLACE__id ";
$this->listing_sql['sort'] = " ".$this->p."d._DATATYPE_REPLACE__title ";
- /// add input entry in advanced search page forms
+ /// add input entry in advanced search page forms
$this->listing_sql['gab'] = $this->DataType.'/advanced_search.other.input';
@@ -290,7 +290,7 @@
default:
$keyword = tep_db_prepare_input($search_keywords[$i]);
$this->listing_sql['where'] .= "(".$this->p."d._DATATYPE_REPLACE__title like '%" . tep_db_input($keyword) . "%' ";
-// if (isset($_GET['search_in_description']) && ($_GET['search_in_description'] == '1'))
+// if (isset($_GET['search_in_description']) && ($_GET['search_in_description'] == '1'))
$this->listing_sql['where'] .= " or ".$this->p."d._DATATYPE_REPLACE__description like '%" . tep_db_input($keyword) . "%'";
$this->listing_sql['where'] .= ')';
break;
Modified: trunk/dev/GenerCode/datatype/Modele/catalog/common/classes/datatype_drivers/Data__DATATYPE_REPLACE_.php.modele2
===================================================================
--- trunk/dev/GenerCode/datatype/Modele/catalog/common/classes/datatype_drivers/Data__DATATYPE_REPLACE_.php.modele2 2013-09-23 11:59:18 UTC (rev 4840)
+++ trunk/dev/GenerCode/datatype/Modele/catalog/common/classes/datatype_drivers/Data__DATATYPE_REPLACE_.php.modele2 2013-09-24 07:53:10 UTC (rev 4841)
@@ -8,7 +8,7 @@
@author genrated by dev/datatype/generat
@encode UTF-8
@class Data__DATATYPE_REPLACE_
- @brief This class is base datatype for _DATATYPE_REPLACE_
+ @brief This class is base datatype for _DATATYPE_REPLACE_
*/
class Data__DATATYPE_REPLACE_ {
@@ -20,39 +20,39 @@
public $DataType = '_DATATYPE_REPLACE_';
/**
- @var DataType array reg for seo class
+ @var DataType array reg for seo class
*/
public $reg_anchors = array(
- '_DATATYPE_REPLACE_' => '_DATATYPE_REPLACE_SEOTAG_'
+ '_DATATYPE_REPLACE_' => '_DATATYPE_REPLACE_SEOTAG_'
);
/**
@var DataType array reg check for control get params , please respect order $reg_anchors
*/
public $reg_check = array(
- '([0-9]*)' // unique page
+ '([0-9]*)' // unique page
);
/**
- @var DataType files for folder /_DATATYPE_REPLACE_
+ @var DataType files for folder /_DATATYPE_REPLACE_
*/
public $reg_filenames = array(
- 'FILENAME__DATATYPE_REPLACE_MAJ_' => FILENAME_DEFAULT // unique page
+ 'FILENAME__DATATYPE_REPLACE_MAJ_' => FILENAME_DEFAULT // unique page
);
/**
@var DataType Tables define
*/
public $db_tables = array(
## table master
- 'TABLE__DATATYPE_REPLACE_MAJ_' => '_DATATYPE_REPLACE_', //
+ 'TABLE__DATATYPE_REPLACE_MAJ_' => '_DATATYPE_REPLACE_', //
## table language
- 'TABLE__DATATYPE_REPLACE_MAJ__INFO' => '_DATATYPE_REPLACE__info', //
+ 'TABLE__DATATYPE_REPLACE_MAJ__INFO' => '_DATATYPE_REPLACE__info', //
## table extra
-// 'TABLE__DATATYPE_REPLACE_MAJ__EXTRA' => '_DATATYPE_REPLACE__extra', //
- 'TABLE__DATATYPE_REPLACE_MAJ__EXTRA_FIELDS' => '_DATATYPE_REPLACE__extra_fields', //
- 'TABLE__DATATYPE_REPLACE_MAJ__EXTRA_FIELDS_LABELS' => '_DATATYPE_REPLACE__extra_fields_labels', //
- 'TABLE__DATATYPE_REPLACE_MAJ__EXTRA_FIELDS_VALUES' => '_DATATYPE_REPLACE__extra_fields_values', //
- 'TABLE__DATATYPE_REPLACE_MAJ__TO__DATATYPE_REPLACE_MAJ__EXTRA_FIELDS' => '_DATATYPE_REPLACE__to__DATATYPE_REPLACE__extra_fields', //
+// 'TABLE__DATATYPE_REPLACE_MAJ__EXTRA' => '_DATATYPE_REPLACE__extra', //
+ 'TABLE__DATATYPE_REPLACE_MAJ__EXTRA_FIELDS' => '_DATATYPE_REPLACE__extra_fields', //
+ 'TABLE__DATATYPE_REPLACE_MAJ__EXTRA_FIELDS_LABELS' => '_DATATYPE_REPLACE__extra_fields_labels', //
+ 'TABLE__DATATYPE_REPLACE_MAJ__EXTRA_FIELDS_VALUES' => '_DATATYPE_REPLACE__extra_fields_values', //
+ 'TABLE__DATATYPE_REPLACE_MAJ__TO__DATATYPE_REPLACE_MAJ__EXTRA_FIELDS' => '_DATATYPE_REPLACE__to__DATATYPE_REPLACE__extra_fields', //
## table link datatype categorie
- 'TABLE__DATATYPE_REPLACE_MAJ__TO_CATEGORIES' => '_DATATYPE_REPLACE__to_categories' //
+ 'TABLE__DATATYPE_REPLACE_MAJ__TO_CATEGORIES' => '_DATATYPE_REPLACE__to_categories' //
);
/**
@var DataType dynamic
@@ -65,7 +65,7 @@
*/
public $RootListing = array();
/**
- @var prefix alias a utilise systematiquement dans les requete sql
+ @var prefix alias a utilise systematiquement dans les requete sql
*/
public $p = '_DATATYPE_REPLACE_SEOTAG_xx';
/**
@@ -75,7 +75,7 @@
/**
@brief constructor
- @param next bool true for complete load , but use 2 call
+ @param next bool true for complete load , but use 2 call
*/
function __construct($next=false){
global $languages_id;
@@ -149,10 +149,10 @@
}
/**
- @brief Prepare an retrun result Seo request
- @param $mode string anchor key used
+ @brief Prepare an retrun result Seo request
+ @param $mode string anchor key used
@param $subtype Not used
- @param $id integer current id
+ @param $id integer current id
@param $language_id integer current language id
@return array (
ID => '',
@@ -260,7 +260,7 @@
- // calcul extra actived for search
+ // calcul extra actived for search
$allextraactived = array();
$query = $DB->query("SELECT epf_id, epf_uses_value_list, epf_active_value_language FROM " . TABLE_PRODUCTS_EXTRA_FIELDS . " WHERE epf_status = '1' AND epf_advanced_search = '1' ");
$allextraactived = $query->fetchAllAssoc();
@@ -275,7 +275,7 @@
$this->listing_sql['col_count'] = " ".$this->p."._DATATYPE_REPLACE__id ";
$this->listing_sql['sort'] = " ".$this->p."d._DATATYPE_REPLACE__title ";
- /// add input entry in advanced search page forms
+ /// add input entry in advanced search page forms
$this->listing_sql['gab'] = $this->DataType.'/advanced_search.other.input';
@@ -324,7 +324,7 @@
default:
$keyword = tep_db_prepare_input($search_keywords[$i]);
$this->listing_sql['where'] .= "(".$this->p."d._DATATYPE_REPLACE__title like '%" . tep_db_input($keyword) . "%' ";
-// if (isset($_GET['search_in_description']) && ($_GET['search_in_description'] == '1'))
+// if (isset($_GET['search_in_description']) && ($_GET['search_in_description'] == '1'))
$this->listing_sql['where'] .= " or ".$this->p."d._DATATYPE_REPLACE__description like '%" . tep_db_input($keyword) . "%'";
$this->listing_sql['where'] .= ')';
break;
@@ -390,7 +390,7 @@
$page->title=$_DATATYPE_REPLACE_->title;
$breadcrumb->add($_DATATYPE_REPLACE_->title, $_DATATYPE_REPLACE_->href );
-//
+//
// $page_content = $page->force_content('_DATATYPE_REPLACE_.php');
// $page->add_var_page('current_id',(int)$_GET['_DATATYPE_REPLACE_']);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2013-09-23 11:59:21
|
Revision: 4840
http://sourceforge.net/p/oscss/svn/4840
Author: oscim
Date: 2013-09-23 11:59:18 +0000 (Mon, 23 Sep 2013)
Log Message:
-----------
Fix
Modified Paths:
--------------
trunk/catalog/admin/includes/classes/drivers/sqlcontent.php
trunk/catalog/admin/includes/modules/pages/cms_content.php
Modified: trunk/catalog/admin/includes/classes/drivers/sqlcontent.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlcontent.php 2013-09-23 07:17:41 UTC (rev 4839)
+++ trunk/catalog/admin/includes/classes/drivers/sqlcontent.php 2013-09-23 11:59:18 UTC (rev 4840)
@@ -160,7 +160,8 @@
}
}
-
+// print_r($post['cms_content']);
+// exit;
for ($i=0, $n=sizeof($list_languages); $i<$n; $i++) {
$sql_data_array = array();
$language_id = $list_languages[$i]['id'];
@@ -178,6 +179,8 @@
$sql_data_array = array_merge($sql_data_array, self::$modules->get_update_table_content_description ($language_id));
+print_r($sql_data_array);
+exit;
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++;
Modified: trunk/catalog/admin/includes/modules/pages/cms_content.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/cms_content.php 2013-09-23 07:17:41 UTC (rev 4839)
+++ trunk/catalog/admin/includes/modules/pages/cms_content.php 2013-09-23 11:59:18 UTC (rev 4840)
@@ -503,10 +503,12 @@
$content_id = tep_db_prepare_input($_GET['cID']);
$params['sqlarray'] = array(
- 'content_name' => tep_db_prepare_input($_POST['content_name']),
'content_status' => tep_db_prepare_input($_POST['content_status']),
);
+ if (isset($_POST['content_name']))
+ $params['sqlarray']['content_name'] = tep_db_prepare_input($_POST['content_name']);
+
if (isset($content_id))
$params['id']=$content_id;
@@ -516,7 +518,7 @@
$params['cPath']=(isset($_POST['cPath'])) ? tep_db_prepare_input($_POST['cPath']) : 0;
sqlcontent::update($params);
-
+exit;
if(isset($_POST['up_and_close']) ) tep_redirect(tep_href_link(self::FILENAME, tep_get_all_get_params(array( 'cID','flag','action'),false)) );
else tep_redirect(tep_href_link(self::FILENAME, 'page=' . $_GET['page'] . '&cID=' . $content_id.'&action=edit'));
break;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2013-09-23 07:17:44
|
Revision: 4839
http://sourceforge.net/p/oscss/svn/4839
Author: oscim
Date: 2013-09-23 07:17:41 +0000 (Mon, 23 Sep 2013)
Log Message:
-----------
Fix
Modified Paths:
--------------
trunk/catalog/admin/includes/classes/drivers/sqlproduct.php
trunk/catalog/admin/includes/languages/fr_FR/boxes/05_customers.php
Modified: trunk/catalog/admin/includes/classes/drivers/sqlproduct.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlproduct.php 2013-09-21 14:22:49 UTC (rev 4838)
+++ trunk/catalog/admin/includes/classes/drivers/sqlproduct.php 2013-09-23 07:17:41 UTC (rev 4839)
@@ -220,7 +220,7 @@
// 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++;
}
@@ -349,10 +349,10 @@
}
// $_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));
-//
+//
/**
@@ -391,16 +391,13 @@
}
//<!-- EOF Separate Pricing Per Customer -->
-// $res = self::$modules->load_db_values($ID);
-//
-// $product['mod'] = $res;
-
$product['mod'] = self::$modules->fetch(array('products_id'=>$ID, 'shortkey'=>$shortkey));
// put all val origin module in current result
foreach($product['mod'] as $submod=>$array)
- foreach($array as $key=>$val)
- $product[$key] = $val;
+ if(is_array($array))
+ foreach($array as $key=>$val)
+ $product[$key] = $val;
return ((!$shortkey)? $product : self::CleanKey($product) );
Modified: trunk/catalog/admin/includes/languages/fr_FR/boxes/05_customers.php
===================================================================
--- trunk/catalog/admin/includes/languages/fr_FR/boxes/05_customers.php 2013-09-21 14:22:49 UTC (rev 4838)
+++ trunk/catalog/admin/includes/languages/fr_FR/boxes/05_customers.php 2013-09-23 07:17:41 UTC (rev 4839)
@@ -2,8 +2,8 @@
/**
@licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
@package osCSS-2 <www http://www.oscss.org>
- @version 2.1.1
- @date 03/03/2012, 17:23
+ @version 2.1.2
+ @date 23/09/2013, 17:23
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
@brief file languages for boxes menu
@@ -11,6 +11,6 @@
define('BOX_HEADING_CONF_CUSTOMERS',"Tiers" );
define('BOX_CUSTOMERS_CUSTOMERS',"Clients/Membres" );
define('BOX_CUSTOMERS_CUSTOMERS_ADD_NEW',"Ajouter un Client" );
-define('BOX_COMMERCIAL_VENDORS',"Fournisseurs" );
+
?>
\ 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...> - 2013-09-21 14:22:52
|
Revision: 4838
http://sourceforge.net/p/oscss/svn/4838
Author: oscim
Date: 2013-09-21 14:22:49 +0000 (Sat, 21 Sep 2013)
Log Message:
-----------
Fix
Modified Paths:
--------------
trunk/catalog/admin/includes/application_top.php
Modified: trunk/catalog/admin/includes/application_top.php
===================================================================
--- trunk/catalog/admin/includes/application_top.php 2013-09-21 13:02:16 UTC (rev 4837)
+++ trunk/catalog/admin/includes/application_top.php 2013-09-21 14:22:49 UTC (rev 4838)
@@ -22,7 +22,7 @@
if (file_exists($rpa.'includes/local/configure.php')) include($rpa.'includes/local/configure.php');
else require($rpa.'includes/configure.php');
- //force current directory
+ //force current directory
@chdir(DIR_FS_ADMIN);
// force config in object, by stdclass
@@ -64,6 +64,15 @@
//! element optionnel
if (file_exists($rpa.DIR_WS_INCLUDES . 'tables_files_modules.php')) require($rpa.DIR_WS_INCLUDES . 'tables_files_modules.php');
+ // load all extends installed adn put in $conf
+ $conf->extends = new stdClass();
+ $res=$DB->query('select cip_ident as cfgKey from ' . TABLE_CIP .' where cip_installed = 1 ');
+ while ($configuration = $res->fetchAssoc()){
+ $etat = new stdClass();
+ $etat->enabled = 1;
+ $conf->extends->$configuration['cfgKey'] = $etat;
+ }
+
//! set application wide parameters
$res=$DB->query('select configuration_key as cfgKey, configuration_value as cfgValue from ' . TABLE_CONFIGURATION .' where configuration_type IN ("1","2") ');
while ($configuration = $res->fetchAssoc())
@@ -177,7 +186,7 @@
$oscss->pile_file_lang($rpa.DIR_WS_LANGUAGES . $language . '/'.$page_admin.'.txt');
}
-/// Init Dynamic DataType
+/// Init Dynamic DataType
DataTypes::getInstance();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2013-09-21 13:02:21
|
Revision: 4837
http://sourceforge.net/p/oscss/svn/4837
Author: oscim
Date: 2013-09-21 13:02:16 +0000 (Sat, 21 Sep 2013)
Log Message:
-----------
upgrade code in Bo featureds page and childs files
Modified Paths:
--------------
trunk/catalog/admin/includes/classes/drivers/sqlfeatured.php
trunk/catalog/admin/includes/gabarit/featureds/display_view.edit.gab
trunk/catalog/admin/includes/languages/fr_FR/modules/pages/categories.txt
trunk/catalog/admin/includes/languages/fr_FR/modules/pages/cms_content.txt
trunk/catalog/admin/includes/languages/fr_FR/modules/pages/featureds.txt
trunk/catalog/admin/includes/modules/pages/featureds.php
trunk/catalog/common/classes/seo_url.php
Modified: trunk/catalog/admin/includes/classes/drivers/sqlfeatured.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlfeatured.php 2013-09-21 09:37:53 UTC (rev 4836)
+++ trunk/catalog/admin/includes/classes/drivers/sqlfeatured.php 2013-09-21 13:02:16 UTC (rev 4837)
@@ -3,8 +3,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 22/04/2012 ,22:50:08
+ @version 2.1.2
+ @date 22/09/2013 ,22:50:08
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
@class sqlfeatured
@@ -80,10 +80,15 @@
*/
public static function update($option){
self::getInstance();
+ $DB=Database::getInstance();
+ $error = 0;
+
if(!isset($option['id']))
return 'id';
+ $DB->beginTransaction();
+
$where ='';
$where_lg ='';
if(isset($option['id'])){
@@ -95,36 +100,53 @@
// if(isset($option['status'])) $where .="AND featured_status = '".(int)$option['status']."' ";
+ if(isset($option['post'])){
+ $post=$option['post'];
+ }
- if(isset($option['new_type']))$sql_data_array['k_status_type'] = tep_db_prepare_input($option['new_type']);
+ if(isset($post['new_type']))$sql_data_array['k_status_type'] = tep_db_prepare_input($post['new_type']);
+ if(isset($post['featured_uniqkey']) && !empty($post['featured_uniqkey'])) $sql_data_array['featured_uniqkey'] = tep_db_prepare_input($post['featured_uniqkey']);
+ if(isset($post['min']))$sql_data_array['featured_min'] = tep_db_prepare_input($post['min']);
+ if(isset($post['max'])) $sql_data_array['featured_max'] = (int)tep_db_prepare_input($post['max']);
+ if(isset($post['status'])) $sql_data_array['featured_status'] = (int)tep_db_prepare_input($post['status']);
- if(isset($option['min']))$sql_data_array['featured_min'] = tep_db_prepare_input($option['min']);
- if(isset($option['max'])) $sql_data_array['featured_max'] = (int)tep_db_prepare_input($option['max']);
- if(isset($option['status'])) $sql_data_array['featured_status'] = (int)tep_db_prepare_input($option['status']);
-
$sql_data_array['date_update'] = 'NOW()';
$sql_data_array['user_update'] = $_SESSION['login_id'];
- $res=tep_db_perform(TABLE_FEATURED, $sql_data_array, 'update' , substr($where,3) );
+ if( ! tep_db_perform(TABLE_FEATURED, $sql_data_array, 'update' , substr($where,3) ) )
+ $error++;
foreach(tep_get_languages() as $lg) {
- $row = $option['langue'];
+ $row = $post['langue'];
$where_lg .= "AND languages_id = '".(int)$lg['id']."' ";
- if(isset($row['title'][$lg['id']]) ) {
- $sql_data_array_lg = array(
- 'featured_title'=> ((!empty($row['title'][$lg['id']])) ? tep_db_prepare_input($row['title'][$lg['id']]) : '' ),
- );
+ $sql_data_array_lg = array();
- $res=tep_db_perform(TABLE_FEATURED_DESCRIPTION, $sql_data_array_lg, 'update' , substr($where_lg,3));
- }
+ if(isset($row['title'][$lg['id']]) && is_array($row['title']) )
+ $sql_data_array_lg['featured_title'] = ((!empty($row['title'][$lg['id']])) ? tep_db_prepare_input($row['title'][$lg['id']]) : '' );
+ elseif(isset($post['featured_title']) && is_string($post['featured_title']) )
+ $sql_data_array_lg['featured_title'] = ((!empty($post['featured_title'])) ? tep_db_prepare_input($post['featured_title']) : '' );
+
+ if( count($sql_data_array_lg) > 0)
+ if( ! tep_db_perform(TABLE_FEATURED_DESCRIPTION, $sql_data_array_lg, 'update' , substr($where_lg,3)) )
+ $error++;
+
}
- return $res;
+ if( $error > 0){
+ $DB->rollbackTransaction();
+ return false;
+ }
+ else{
+ $DB->commitTransaction();
+ return 1;
+ }
+
+// return $res;
}
/**
@@ -248,16 +270,18 @@
public static function Specimen($shortkey=false){
$par = array(
'row_id' => '',
+ 'featured_uniqkey' => '',
'k_status_type' => '',
- 'featured_min' => '',
- 'featured_max' => '',
+ 'featured_min' => 1,
+ 'featured_max' => 10,
'featured_status' => '',
);
foreach(tep_get_languages() as $lg)
- $par['lg'][$lg['id']] = array(
- 'featured_title'=>'',
- );
+ $par['lg'][$lg['id']] = ((!$shortkey)? array('featured_title'=>'') : self::CleanKey(array('featured_title'=>'')));
+// $par['lg'][$lg['id']] = array(
+// 'featured_title'=>'',
+// );
return ((!$shortkey)? $par : self::CleanKey($par));
}
Modified: trunk/catalog/admin/includes/gabarit/featureds/display_view.edit.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/featureds/display_view.edit.gab 2013-09-21 09:37:53 UTC (rev 4836)
+++ trunk/catalog/admin/includes/gabarit/featureds/display_view.edit.gab 2013-09-21 13:02:16 UTC (rev 4837)
@@ -3,8 +3,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 22/04/2012 ,22:50:08
+ @version 2.1.2
+ @date 22/09/2013 ,22:50:08
@author genrated by GenerCode
@encode UTF-8
*/
@@ -22,46 +22,22 @@
<div class="edit">
<div id="tabs-1" class="tabPage">
+ <?php echo featureds::DisplayField('title', '%s'); ?>
- <div class="tabs_lang">
- <ul>
- <?php foreach(tep_get_languages() as $lg): ?>
- <li>
- <a href="#fieldset_<?php echo $lg['id'] ?>">
- <?php echo tep_language_image($lg['directory'] . '/images/' .$lg['image'], $lg['name']); ?>
- </a>
- </li>
- <?php endforeach; ?>
- </ul>
- <?php foreach(tep_get_languages() as $lg): ?>
- <fieldset id="fieldset_<?php echo $lg['id'] ?>" class="block_field">
- <p class="block_input">
- <label for="<?php echo 'title' . $lg['id']; ?>"><?php echo __('@featureds entry title'); ?></label>
- <?php echo tep_draw_input_field('title[' . $lg['id'] . ']', 'title_' . $lg['id'], @featureds::$Info->lg[ $lg['id']]->title, 'size="70"', true) ; ?>
- </p>
- </fieldset>
- <?php endforeach; ?>
- </div>
-
-
<p class="block_input">
- <Label><?php echo __('@featureds text info featureds keys') ?></label>
- <?php echo tep_draw_input_field('featureds_key', '', @featureds::$Info->uniqkey) ?>
+ <?php echo featureds::DisplayField('uniqkey', '%s'); ?>
</p>
<p class="block_input">
- <label ><?php echo __('@featureds text info type'); ?></label>
- <?php echo tep_draw_pull_down_menu('featureds_type', tep_get_status_array('featured',0,'status_name'),featureds::$Info->type); ?>
+ <?php echo featureds::DisplayField('type', '%s'); ?>
</p>
<p class="block_input">
- <Label><?php echo __('@featureds text info featureds min') ?></label>
- <?php echo tep_draw_input_field('featureds_min', '', featureds::$Info->min) ?>
+ <?php echo featureds::DisplayField('min', '%s'); ?>
</p>
<p class="block_input">
- <Label><?php echo __('@featureds text info featureds max') ?></label>
- <?php echo tep_draw_input_field('featureds_max', '', featureds::$Info->max) ?>
+ <?php echo featureds::DisplayField('max', '%s'); ?>
</p>
<!-- <p class="block_input">
@@ -82,36 +58,31 @@
<div id="tabs-2" class="tabPage">
-<?php
+ <table class="dataTable">
+ <thead>
+ <tr>
+ <th><?php echo __('@featureds table heading datatype') ?></th>
+ <th><?php echo __('@featureds table heading datatype id') ?></th>
+ <th><?php echo __('@featureds table heading date added') ?></th>
+ <th><?php echo __('@featureds table heading user added') ?></th>
+ </tr>
+ </thead>
+ <tbody>
+ <?php foreach(featureds::$Info->listchilds as $row): ?>
+ <tr>
+ <td class="tcenter"><?php echo $row->datatype ?></td>
+ <td class="tcenter">
+ <strong>
+ <a href="<?php //echo featureds::HrefLink($row->datatype_id, 'edit', $row->datatype) ?>" ><?php echo $row->datatype_id ?></a>
+ </strong>
+ </td>
+ <td class="tcenter"><?php echo tep_date_short($row->date_added) ?></td>
+ <td class="tcenter"><?php echo $row->user_added ?></td>
+ </tr>
+ <?php endforeach; ?>
+ </tbody>
+ </table>
-// print_r(featureds::$Info->listchilds);
-?>
-
- <table class="dataTable">
- <thead>
- <tr>
- <th><?php echo __('@featureds table heading datatype') ?></th>
- <th><?php echo __('@featureds table heading datatype id') ?></th>
- <th><?php echo __('@featureds table heading date added') ?></th>
- <th><?php echo __('@featureds table heading user added') ?></th>
- </tr>
- </thead>
- <tbody>
- <?php foreach(featureds::$Info->listchilds as $row): ?>
- <tr>
- <td class="tcenter"><?php echo $row->datatype ?></td>
- <td class="tcenter">
- <strong>
- <a href="<?php echo featureds::HrefLink($row->datatype_id, 'edit', $row->datatype) ?>" ><?php echo $row->datatype_id ?></a>
- </strong>
- </td>
- <td class="tcenter"><?php echo tep_date_short($row->date_added) ?></td>
- <td class="tcenter"><?php echo $row->user_added ?></td>
- </tr>
- <?php endforeach; ?>
- </tbody>
- </table>
-
<br class="clear" />
</div>
Modified: trunk/catalog/admin/includes/languages/fr_FR/modules/pages/categories.txt
===================================================================
--- trunk/catalog/admin/includes/languages/fr_FR/modules/pages/categories.txt 2013-09-21 09:37:53 UTC (rev 4836)
+++ trunk/catalog/admin/includes/languages/fr_FR/modules/pages/categories.txt 2013-09-21 13:02:16 UTC (rev 4837)
@@ -8,21 +8,29 @@
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
*/
-$lang['heading title']="Catégories" ;
+$lang['heading title categories']="Catégories" ;
$lang['heading title search']="Rechercher :" ;
$lang['heading title goto']="Aller à :" ;
/* listing */
- $lang['table heading id']="ID" ;
- $lang['table heading categories images']="img" ;
- $lang['table heading categories']="Catégories" ;
- $lang['table heading action']="Action" ;
- $lang['table heading status']="Statut" ;
- $lang['table heading categories id']="ID" ;
- $lang['table heading view status']="Menu" ;
- $lang['table heading view datatype']="Données" ;
+ $lang['categories table heading id']="ID" ;
+ $lang['categories table heading image']="Image" ;
+ $lang['categories table heading parent']="Parent" ;
+ $lang['categories table heading cpath']="cPath" ;
+ $lang['categories table heading sort']="Tri" ;
+ $lang['categories table heading datatype']="Données" ;
+ $lang['categories table heading name']="Nom" ;
+ $lang['categories table heading description']="Description" ;
+ $lang['@categories table heading action']="Action" ;
+ $lang['categories table heading status']="Statut" ;
+ $lang['categories table heading hidden']="Menu" ;
+ $lang['categories table heading date added']="Ajouté le" ;
+ $lang['categories table heading date modified']="Modifié le" ;
- /* alert */
+ /* Bouton */
+ $lang['@categorie image create new categorie']="Créer une catégorie" ;
+
+ /* MessageStack */
$lang['@categorie update status']="Changement de l'état de la catégorie" ;
$lang['@categorie update visibility']="Changement de la visibilité de la catégorie" ;
@@ -38,6 +46,12 @@
$lang['input datatype value none']="aucun datatype specifique" ;
$lang['view in menu']="Voir dans le menu" ;
+
+ $lang['@categories text status off']=" Active " ;
+ $lang['@categories text status on']=" Inactive" ;
+ $lang['@categories text hidden off']="Non-Visible " ;
+ $lang['@categories text hidden on']=" Visible" ;
+
/* New light */
$lang['image add cat and edit']="Créer et editer" ;
@@ -55,6 +69,9 @@
/* message */
$lang['@categorie create'] = "Catégorie crée" ;
+ $lang['@categories error in update process'] = "Erreur lors de l'enregsitrement de la catégorie" ;
+ $lang['@categories success in update process'] = "Mise à jour reussie" ;
+
$lang['save categorie %s success'] = "Catégorie n°%s enregsitrée" ;
$lang['error catalog image directory not writeable %s']="Erreur : Impossible d'écrire dans le répertoire d'images : %s " ;
$lang['error catalog image directory does not exist %s']="Erreur : Le répertoire d'images n'existe pas : %s " ;
@@ -98,10 +115,7 @@
$lang['image preview public']="Prévisualiser page public" ;
$lang['image view public']="Voir page public" ;
$lang['text categories status']="Status " ;
-$lang['text categories available']=" Active " ;
-$lang['text categories not available']=" Inactive" ;
-$lang['text categories hidden']="Menu " ;
-$lang['text categories not hidden']=" Voir" ;
+
$lang['text categories hidden']=" Caché " ;
$lang['text categorie racine']=" Catégorie mêre (racine) " ;
?>
\ No newline at end of file
Modified: trunk/catalog/admin/includes/languages/fr_FR/modules/pages/cms_content.txt
===================================================================
--- trunk/catalog/admin/includes/languages/fr_FR/modules/pages/cms_content.txt 2013-09-21 09:37:53 UTC (rev 4836)
+++ trunk/catalog/admin/includes/languages/fr_FR/modules/pages/cms_content.txt 2013-09-21 13:02:16 UTC (rev 4837)
@@ -33,7 +33,7 @@
$lang['cms_content table heading last modified']="Modifié(s)" ;
$lang['cms_content table heading status']="État" ;
$lang['cms_content table heading hidden']="Menu" ;
- $lang['table heading action']="Action" ;
+ $lang['@cms_content table heading action']="Action" ;
/* MessageStack */
$lang['@cms_content error in update process']="Erreur lors de l'enregsitrement de la page" ;
@@ -57,7 +57,11 @@
$lang['heading title edit']="Édition d'une page" ;
$lang['entry content']="Clef : " ;
$lang['entry content 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['@cms_content text status off']="Non publié" ;
+ $lang['@cms_content text status on']="Publié" ;
+
+ /* MessageStack */
$lang['@cms_content key is valid']="Cette clef est disponible " ;
$lang['@cms_content key is already used']="Cette clef est déjà utilisé " ;
Modified: trunk/catalog/admin/includes/languages/fr_FR/modules/pages/featureds.txt
===================================================================
--- trunk/catalog/admin/includes/languages/fr_FR/modules/pages/featureds.txt 2013-09-21 09:37:53 UTC (rev 4836)
+++ trunk/catalog/admin/includes/languages/fr_FR/modules/pages/featureds.txt 2013-09-21 13:02:16 UTC (rev 4837)
@@ -29,8 +29,10 @@
$lang['@featureds table heading key'] = "Clef" ;
$lang['@featureds table heading action'] = "Action" ;
- /* alert */
+ /* MessageStack */
$lang['@featureds update status']="Changement de l'état de cette mise en avant" ;
+ $lang['@featureds error in update process']="Erreur lors de l'enregsitrement de la mise en avant" ;
+ $lang['@featureds success in update process']="Mise à jour reussie" ;
/* bouton */
$lang['@featureds image add featureds'] = "Ajouter une entrée" ;
Modified: trunk/catalog/admin/includes/modules/pages/featureds.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/featureds.php 2013-09-21 09:37:53 UTC (rev 4836)
+++ trunk/catalog/admin/includes/modules/pages/featureds.php 2013-09-21 13:02:16 UTC (rev 4837)
@@ -3,19 +3,22 @@
@licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
@portion code Copyright (c) 2002 osCommerce
@package osCSS-2 <www http://www.oscss.org>
- @version 2.1.1
- @date 22/04/2012 ,22:50:08
+ @version 2.1.2
+ @date 22/09/2013 ,22:50:08
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
@class featureds
*/
class featureds
+
extends ModTwo /// new abstract class for nextgen module
implements
InterfaceModule,
/*IntModTwo, */ /// new interface module for nextgen module
- ExtModConfig {
+ InterfacedTJsonS,
+ ExtModConfig
+ {
const FILENAME = FILENAME_FEATURED;
@@ -27,10 +30,6 @@
@var array list code action module
*/
public static $list=array();
- /**
- @var current object
- */
- public static $Info;
@@ -66,8 +65,8 @@
'sWhere'=>'',
);
+ MGabCont::SetCurrentName(__CLASS__);
-
/**
@remarks not load if not first init
*/
@@ -98,10 +97,16 @@
),
'c.featured_uniqkey' => array(
'sort'=>true,
-// 'alias'=>'key',
+ 'alias'=>'uniqkey',
'text'=>__('@featureds table heading key'),
'class'=>'tcenter',
'default'=>true,
+ 'edit'=>array(
+ 'input_name'=>'featured_uniqkey',
+ 'required_status'=>true,
+ 'input_size'=>'64',
+ 'class'=>'tleft',
+ ),
),
'fd.featured_title' => array(
'sort'=>true,
@@ -110,6 +115,14 @@
'class'=>'tleft',
'width'=>'40%',
'default'=>true,
+ 'edit'=>array(
+// 'input_name'=>'content_title',
+ 'input_name'=>__CLASS__.'[featured_title]',
+ 'input_type'=>'input',
+ 'input_size'=>'64',
+ 'required_status'=>true,
+ 'active_value_language'=>true,
+ ),
),
'c.k_status_type' => array(
@@ -118,6 +131,14 @@
'text'=>__('@featureds table heading status type id'),
'width'=>'8%',
'class'=>'tcenter',
+ 'edit'=>array(
+ 'input_name'=>'k_status_type',
+ 'required_status'=>true,
+ 'input_type'=>'select',
+ 'input_size'=>'1',
+ 'class'=>'tleft',
+ 'select_values'=>tep_get_status_array('featured',0,'status_name'),
+ ),
),
's.status_name' => array(
'sort'=>true,
@@ -134,6 +155,11 @@
'text'=>__('@featureds table heading min'),
'width'=>'2%',
'class'=>'tcenter',
+ 'edit'=>array(
+ 'input_name'=>'min',
+ 'input_size'=>'5',
+ 'class'=>'tleft',
+ ),
),
'c.featured_max' => array(
'sort'=>true,
@@ -141,6 +167,11 @@
'text'=>__('@featureds table heading max'),
'width'=>'2%',
'class'=>'tcenter',
+ 'edit'=>array(
+ 'input_name'=>'max',
+ 'input_size'=>'5',
+ 'class'=>'tleft',
+ ),
),
'c.date_added' => array(
'sort'=>true,
@@ -176,7 +207,6 @@
),
);
-// , k_status_type as type , featured_status
/// @remarks min fields and not view directly colonne fields
$listfield = 'k_status_type as type , featured_status,';
@@ -189,10 +219,10 @@
array[
// For normalised filter define on method ConvertInitVar
generic =>
- array (
- 'string'
+ array (
+ 'string'
// , ....
- );
+ );
mod =>
array(
'title'=>__('@products filter tab manufacturer'),
@@ -206,7 +236,7 @@
@remarks this define menu master module in page
@note use $boutons[action][] = array(params)
- params :
+ params :
'type'=>'getLink',
'format'=>'button_nav',
'image'=>'',
@@ -216,7 +246,7 @@
*/
$boutons = array();
- $boutons[] =array(
+ $boutons['listing'][] =array(
'type'=>'getLink',
'format'=>'button_nav',
'image'=>'',
@@ -224,17 +254,15 @@
'title'=>__('@featureds image add featureds'),
'url'=>tep_href_link(self::FILENAME, 'action=new'),
);
+
/**
Call Base Init and construct $InitInfo for process Filter
- $listfield string list row in db
+ $listfield string list row in db
$mutli array action multiple
- $filter array put list off activate tab filter
+ $filter array put list off activate tab filter
$boutons array
*/
self::ConvertInitVar( $listfield, $mutli, $tab, $boutons);
-
-
- return true;
}
@@ -245,7 +273,7 @@
@return $actions string
*/
public function check_action($actions){
- global $messageStack;
+ global $messageStack, $languages_id;
self::$action=$actions;
@@ -262,13 +290,66 @@
tep_redirect(tep_href_link(self::FILENAME));
break;
+ /**
+ @remarks specific Ajax call
+ */
+ case 'update_cell':
+ try {
+ if($_REQUEST['columnName'] == 'featured_uniqkey'){
+ if( sqlcontent::fetch(array('ref'=>$_REQUEST['value'])) != false)
+ throw new Exception(__('@featureds uniqkey is already used') ) ;
+ }
+ $modele = array_keys(sqlfeatured::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( sqlfeatured::update( $params ) != 1 )
+ throw new Exception(__('@featureds error in update process')) ;
+
+ $messageStack->add_session(__('@featureds 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') ) {
$c_id =(int) tep_db_prepare_input($_GET['cID']);
if ($c_id > 0){
- $myarray = array('id'=>$c_id, 'status'=>$_GET['flag'] );
+ $myarray = array('id'=>$c_id,'post'=>array('status'=>$_GET['flag'] ) );
sqlfeatured::update($myarray);
}
}
@@ -280,19 +361,22 @@
break;
case 'insert':
+
+
$myarray = array(
- 'type'=>tep_db_prepare_input($_POST['featureds_type']),
- 'min'=>tep_db_prepare_input($_POST['featureds_min']),
- 'max'=>tep_db_prepare_input($_POST['featureds_max']),
- 'key'=>tep_db_prepare_input($_POST['featureds_key']),
+ 'type'=>tep_db_prepare_input($_POST['k_status_type']),
+ 'min'=>tep_db_prepare_input($_POST['min']),
+ 'max'=>tep_db_prepare_input($_POST['max']),
+ 'key'=>tep_db_prepare_input($_POST['featured_uniqkey']),
);
foreach(tep_get_languages() as $row) {
- $myarray['langue']['title'][$row['id']] = tep_db_prepare_input($_POST['title'][$row['id']]);
+ $myarray['langue']['title'][$row['id']] = tep_db_prepare_input($_POST[__CLASS__]['featured_title'][$row['id']]);
}
$res = sqlfeatured::create($myarray);
+
tep_redirect(tep_href_link(self::FILENAME ));
break;
@@ -302,18 +386,24 @@
if ($c_id > 0){
$myarray = array(
'id'=>$c_id,
-// 'new_type'=>tep_db_prepare_input($_POST['featureds_type']),
- 'min'=>tep_db_prepare_input($_POST['featureds_min']),
- 'max'=>tep_db_prepare_input($_POST['featureds_max']),
-// 'key'=>tep_db_prepare_input($_POST['featureds_key']),
+ 'post'=>array(
+ 'new_type'=>tep_db_prepare_input($_POST['k_status_type']),
+ 'min'=>tep_db_prepare_input($_POST['min']),
+ 'max'=>tep_db_prepare_input($_POST['max']),
+ 'featured_uniqkey'=>tep_db_prepare_input($_POST['featured_uniqkey']),
+ )
);
foreach(tep_get_languages() as $row) {
- $myarray['langue']['title'][$row['id']] = tep_db_prepare_input($_POST['title'][$row['id']]);
+ if(isset($_POST['featureds']['featured_title'][$row['id']]))
+ $myarray['post']['langue']['title'][$row['id']] = tep_db_prepare_input($_POST['featureds']['featured_title'][$row['id']]);
}
- $res =sqlfeatured::update($myarray);
+ if( ! sqlfeatured::update($myarray) )
+ $messageStack->add_session(__('@featureds error in update process'), 'error');
+ else
+ $messageStack->add_session(__('@featureds success in update process'), 'success');
}
tep_redirect(tep_href_link(self::FILENAME, 'action=edit&cID=' . $c_id ));
@@ -355,16 +445,24 @@
case 'edit':
case 'new':
if( (int)self::$Id > 0) {
- self::$Info = sqlfeatured::fetch(array('id'=>self::$Id ), true);
+ $result= sqlfeatured::fetch(array('id'=>self::$Id ), true);
- self::$Info->listchilds = sqlfeatureddata::fetch(array('featured_id'=>self::$Id), true);
+ $res = sqlfeatureddata::fetch(array('featured_id'=>self::$Id), true);
+
+ if(is_object($res))
+ $result->listchilds = array($res);
+ else
+ $result->listchilds = $res;
}
else{
- self::$Info = sqlfeatured::Specimen(true);
+ $result = sqlfeatured::Specimen(true);
+ $result->listchilds = array();
}
+
+ return self::FormatDBValue($result);
break;
@@ -412,15 +510,16 @@
@remarks Normal View Page
*/
case 'new':
- self::load_db_values(0);
+// self::load_db_values(0);
+ self::$Info=self::GetDBValue(-1);
return MGabCont::CallGab('edit',__FUNCTION__,__CLASS__);
break;
case 'edit':
- self::load_db_values(self::$Id);
+ self::$Info=self::GetDBValue(self::$Id);
return MGabCont::CallGab(parent::$action,__FUNCTION__,__CLASS__);
break;
case 'delete':
- self::load_db_values(self::$Id);
+ self::$Info=self::GetDBValue(self::$Id);
return MGabCont::CallGab(parent::$action,__FUNCTION__,__CLASS__);
break;
case 'listing':
@@ -481,9 +580,47 @@
$res=array();
switch (parent::$action) {
+ case 'new':
case 'edit';
- global $query_numrows,$languages_id;
+ 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;
Modified: trunk/catalog/common/classes/seo_url.php
===================================================================
--- trunk/catalog/common/classes/seo_url.php 2013-09-21 09:37:53 UTC (rev 4836)
+++ trunk/catalog/common/classes/seo_url.php 2013-09-21 13:02:16 UTC (rev 4837)
@@ -214,7 +214,7 @@
$this->reg_anchors = DataTypes::GetRegAnchor(array());
$this->reg_anchors['type_object'] = 'to';
- // load config module
+ // load config module
$this->loadMod(self::$SEO_REWRITE_TYPE);
@@ -235,10 +235,10 @@
/**
- TODO
- Prendre en charge un calcul de seuil , au dela duquel le cache se desactive
- Rendre ces option de configuration en non editable
- Lancer la genertaion du cache de de maniere systematique
+ TODO
+ Prendre en charge un calcul de seuil , au dela duquel le cache se desactive
+ Rendre ces option de configuration en non editable
+ Lancer la genertaion du cache de de maniere systematique
*/
$this->GenerateCache_generic();
@@ -248,7 +248,7 @@
/**
TODO A revoir
*/
-// if (_test_bool( self::$USE_SEO_REDIRECT))
+// if (_test_bool( self::$USE_SEO_REDIRECT))
// $this->check_redirect();
@@ -264,7 +264,7 @@
}
/**
- @brief singelton
+ @brief singelton
*/
public static function getInstance($languages_id='') {
if(empty($languages_id)) global $languages_id;
@@ -446,7 +446,7 @@
if(!empty($valuepair)/* || $index !=0*/) {
$p2 = @explode('=', $valuepair);
- // specific static page diver, value is file name static
+ // specific static page diver, value is file name static
if($p2[0] =='d' && substr($p2[1],-3) =='php'){
$value = substr($p2[1],0,-4);
$p2[1] = $value;
@@ -474,7 +474,7 @@
case (in_array($key, $check)):
$resultarray = $this->GetName_generic($key, $value);
- $resultarray['tName'] = $this->strip($resultarray['tName']);
+ $resultarray['tName'] = $this->strip(@$resultarray['tName']);
if(self::$htexe)
$this->transph_header_tag($resultarray);
@@ -514,9 +514,9 @@
if(self::$SEO_REWRITE_TYPE =='no'){
- if(file_exists(DIR_FS_CATALOG .$page ))
+ if(file_exists(DIR_FS_CATALOG .$page ))
$new_page = $page;
- else
+ else
$new_page = FILENAME_DEFAULT;
$url = $new_page . $separator . (isset($url) && !empty($url) ? $url : '');
@@ -584,7 +584,7 @@
return $this->obj_mode->makeurl(
$page,
- $language,
+ $language,
$key,
$id,
$cpath.$string,
@@ -647,7 +647,7 @@
$type = DataTypes::GetTypeForAnchor($anchor);
$TYPE = strtoupper($type);
-
+
switch(true){
case (_test_bool(self::$USE_SEO_CACHE_GLOBAL) && isset(self::$cache[$TYPE][$id])):
$this->performance['CACHE_QUERY_SAVINGS']++;
@@ -673,7 +673,7 @@
/**
@fn loadMod($mod = 'no')
@brief chargement sous module de reecriture
- @param $mod string name module , defaut is no for no rewrite and retrun normal path, but all class seo active,
+ @param $mod string name module , defaut is no for no rewrite and retrun normal path, but all class seo active,
@note use no for test or debugg AND retrun canonical url
@return none
*/
@@ -683,7 +683,7 @@
$this->mod = $mod;
- // Load Childs mod for create rules
+ // Load Childs mod for create rules
$mode= 'SeoR_'.$mod;
if(!include_once( DIR_FS_CATALOG . DIR_WS_COMMON. 'modules/core/seo_modrewrite/'. $mode. '.php' ))
die ( __('error in seo class, childs drivers mode no founds') );
@@ -698,7 +698,7 @@
@brief genere all cache for Datatype data
*/
private function GenerateCache_generic(){
-
+
$result = DataTypes::Getseocache($this->languages_id);
foreach($result as $row){
@@ -734,9 +734,9 @@
if(!isset(self::$cache[$type][$id]))
return self::$cache[$type][$id]= $result;
- elseif(is_array($result))
+ elseif(is_array($result))
return self::$cache[$type][$id]= array_merge(self::$cache[$type][$id], $result);
- else
+ else
return self::$cache[$type][$id];
}
@@ -1285,7 +1285,7 @@
switch($tmp[0]){
/**
- TODO a REVOIR
+ TODO a REVOIR
Les clause semble desuetes
*/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2013-09-21 09:37:58
|
Revision: 4836
http://sourceforge.net/p/oscss/svn/4836
Author: oscim
Date: 2013-09-21 09:37:53 +0000 (Sat, 21 Sep 2013)
Log Message:
-----------
Fix class missing
upgrade code in Bo categorie page and childs files
Modified Paths:
--------------
trunk/catalog/admin/includes/classes/drivers/sqlcategorie.php
trunk/catalog/admin/includes/gabarit/categories/display_view.edit.gab
trunk/catalog/admin/includes/gabarit/products/filter.clause.gab
trunk/catalog/admin/includes/languages/fr_FR/modules/pages/products.txt
trunk/catalog/admin/includes/modules/pages/categories.php
trunk/catalog/admin/includes/modules/pages/products.php
Added Paths:
-----------
trunk/catalog/common/classes/arrayInfo.php
Removed Paths:
-------------
trunk/catalog/admin/includes/gabarit/categories/display_view.listing.gab
Modified: trunk/catalog/admin/includes/classes/drivers/sqlcategorie.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlcategorie.php 2013-09-20 07:52:16 UTC (rev 4835)
+++ trunk/catalog/admin/includes/classes/drivers/sqlcategorie.php 2013-09-21 09:37:53 UTC (rev 4836)
@@ -103,8 +103,8 @@
// table language adjust
- $categories_name_array = $post['categories_name'];
- $categories_desc_array = $post['categories_description'];
+ $categories_name_array = $post['categories']['categories_name'];
+ $categories_desc_array = $post['categories']['categories_description'];
for ($i=0, $n=sizeof($list_languages); $i<$n; $i++) {
@@ -138,55 +138,77 @@
public static function update($option){
self::getInstance();
+ $DB=Database::getInstance();
+ $error= 0;
if( ! isset($option['id']) )
- self::$error = __('no id');
+ return __('no id');
else
$id = (int)$option['id'];
- if( ! isset($option['post']) )
- self::$error = __('no post');
- else
+// if( ! isset($option['post']) )
+// self::$error = __('no post');
+// else
+ if( isset($option['post']) )
$post = $option['post'];
$list_languages=tep_get_languages();
+ $DB->beginTransaction();
+
$sql_data_array = $option['sqlarray'];
$sql_data_array['last_modified'] = 'now()';
- $sql_data_array['sort_order'] = (!empty($sql_data_array['sort_order'])) ? tep_db_prepare_input((int)$sql_data_array['sort_order']) : 0 ;
- $sql_data_array['parent_id'] = (!empty($sql_data_array['parent_id'])) ? tep_db_prepare_input((int)$sql_data_array['parent_id']) : 0 ;
- $sql_data_array['categories_cpath'] = categorieUtility::get_generated_category_path_ids($id,'category');
- $sql_data_array['categories_status'] = (!empty($sql_data_array['categories_status'])) ? tep_db_prepare_input((int)$sql_data_array['categories_status']) : 0 ;
- $sql_data_array['categories_hidden'] = (!empty($sql_data_array['categories_hidden'])) ? tep_db_prepare_input((int)$sql_data_array['categories_hidden']) : 0 ;
+ 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']))
+ $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']) ;
- 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);
- foreach((array)self::$modules->get_update_table_categories($id, $sql_data_array) as $module=>$value)
+ 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++;
- tep_db_perform(TABLE_CATEGORIES, $sql_data_array, 'update', "categories_id = '" . $id . "'");
+ $categories_name_array = $post['categories']['categories_name'];
+ $categories_desc_array = $post['categories']['categories_description'];
- $categories_name_array = $post['categories_name'];
- $categories_desc_array = $post['categories_description'];
-
for ($i=0, $n=sizeof($list_languages); $i<$n; $i++) {
$language_id = (int)$list_languages[$i]['id'];
- $sql_data_array = array('categories_name' => tep_db_prepare_input($categories_name_array[$language_id]),
- 'categories_description'=>tep_db_prepare_input($categories_desc_array[$language_id]));
+ $sql_data_array = array();
+ if(!empty($categories_name_array[$language_id]) && is_array($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(!empty($categories_desc_array[$language_id]) && is_array($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);
+
$tabl=self::$modules->get_update_table_categories_description ($list_languages[$i]['id']);
$sql_data_array = array_merge($sql_data_array, $tabl);
- tep_db_perform(TABLE_CATEGORIES_DESCRIPTION, $sql_data_array, 'update', "categories_id = '" . $id . "' and language_id = '" . $language_id . "'");
+ if(count($sql_data_array) > 0)
+ if( ! tep_db_perform(TABLE_CATEGORIES_DESCRIPTION, $sql_data_array, 'update', "categories_id = '" . $id . "' and language_id = '" . $language_id . "'"))
+ $error++;
}
@@ -200,10 +222,14 @@
self::$modules->after_update($id);
- if(self::$error !=false)
- return false;
- else
- return true;
+ if( $error > 0){
+ $DB->rollbackTransaction();
+ return false;
+ }
+ else{
+ $DB->commitTransaction();
+ return 1;
+ }
}
/**
@@ -211,11 +237,11 @@
@note if language_id
@param option array
id => row id int (categories_id)
- datatype => string key dadatype
+ datatype => string key dadatype
status => status int flag on/off
hidden => hidden int visibility
language_id => language_id int if defined retrun One language else retrun all language
-
+
@return
object(stdClass)[13]
@@ -409,7 +435,7 @@
/**
@brief Speciemen
- @return array or object
+ @return array or object
*/
public static function Specimen($shortkey=false){
Modified: trunk/catalog/admin/includes/gabarit/categories/display_view.edit.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/categories/display_view.edit.gab 2013-09-20 07:52:16 UTC (rev 4835)
+++ trunk/catalog/admin/includes/gabarit/categories/display_view.edit.gab 2013-09-21 09:37:53 UTC (rev 4836)
@@ -3,8 +3,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 04/04/2012, 09:48
+ @version 2.1.2
+ @date 22/09/2013, 09:48
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
*/
@@ -36,52 +36,19 @@
<div class="edit box_left w_70">
<div id="tabs-1" class="tabPage">
+ <?php echo categories::DisplayField('name', '%s'); ?>
- <!-- <p class="block_input"> -->
+ <?php echo categories::DisplayField('description', '%s'); ?>
- <div class="tabs_lang">
- <ul>
- <?php for ($i=0, $n=sizeof(categories::$languages); $i<$n; $i++) { ?>
- <li><a href="#fieldset_<?php echo $i ?>"><?php echo tep_language_image( categories::$languages[$i]['directory'] . '/images/' . categories::$languages[$i]['image'], categories::$languages[$i]['name']); ?></a></li>
-
- <?php } ?>
- </ul>
- <?php for ($i=0, $n=sizeof(categories::$languages); $i<$n; $i++) { ?>
- <fieldset id="fieldset_<?php echo $i ?>">
- <legend><?php echo tep_image(DIR_WS_CATALOG_LANGUAGES . categories::$languages[$i]['directory'] . '/images/' . categories::$languages[$i]['image'], categories::$languages[$i]['name'], TEMP_BO_HEADING_IMAGE_WIDTH, TEMP_BO_HEADING_IMAGE_HEIGHT); ?></legend>
- <p class="block_input" style="width:90%;">
- <label for="<?php echo 'content_title' . categories::$languages[$i]['id']; ?>"><?php echo __('text edit categories name'); ?></label>
- <?php echo tep_draw_input_field('categories_name[' . categories::$languages[$i]['id'] . ']', '', categories::$cInfo->categories_name[categories::$languages[$i]['id']]) ; ?>
- </p>
- <br style="clear:both" />
- <label for="<?php echo 'categories_description_' . categories::$languages[$i]['id'] . ''; ?>"><?php echo __('text edit categories description'); ?></label>
- <?php echo $oscss->_call(BO_WISIWYG_SELECTED,'_draw','categories_description[' . categories::$languages[$i]['id'] . ']','1000','800',categories::$cInfo->categories_description[categories::$languages[$i]['id']]); ?>
- </fieldset>
- <?php } ?>
- </div>
-
-
-
-
<p class="block_input">
- <Label><?php echo __('text edit sort order') ?></label>
- <?php echo tep_draw_input_field('sort_order', '', categories::$cInfo->sort_order, 'size="2"') ?>
+ <?php echo categories::DisplayField('sort_order', '%s'); ?>
- <?php /** Hidden Inputs */ if(categories::$action == 'edit') echo tep_draw_hidden_field('categories_id', '', categories::$cInfo->categories_id); ?>
-
+ <?php /** Hidden Inputs */ if(categories::$action == 'edit') echo tep_draw_hidden_field('categories_id', '', categories::$Info->id); ?>
</p>
<div class="block_input">
- <Label><?php echo __('text edit datatype categorie') ?></label>
- <ul>
- <?php foreach($DT->GetTypeForRootListing() as $k=>$row): ?>
- <li><?php echo tep_draw_radio_field('categories_datatype', 'categories_datatype' , $row , (in_array($row, explode(',', categories::$cInfo->categories_datatype))? true : false) ) . ' '. $row ?></li>
- <?php endforeach; ?>
-
- <li><hr />
- <?php echo tep_draw_radio_field('categories_datatype', 'categories_datatype' , 'NULL' , ((categories::$cInfo->categories_datatype == '')? true : false) ) . ' '. __('input datatype value none') ?></li>
- </ul>
+ <?php echo categories::DisplayField('datatype', '%s'); ?>
</div>
</div>
@@ -105,30 +72,29 @@
<fieldset class="block_field">
<dl>
- <dt class="block_input tcenter" style=" text-align:center;">
- <?php echo tep_info_image( categories::$cInfo->categories_image, 'image', TEMP_BO_HEADING_IMAGE_WIDTH, TEMP_BO_HEADING_IMAGE_HEIGHT) ?>
- <?php if(tep_not_null(categories::$cInfo->categories_image)) echo tep_draw_checkbox_field('categories_image_no', 'categories_image_no', 'on'). ' '.__('text delete image cat'); ?>
- </dt>
- <dt class="block_input" >
- <Label><?php echo __('text choose img') ?></label>
- <?php echo '<a class="button" href="#" onclick="'.tep_get_filebroswerserveur("categories_image", "image", '').'">'.tep_draw_input_field('categories_image','', categories::$cInfo->categories_image ).' '.tep_image(DIR_WS_ICONS . 'icon_browser.png', PARCOURIR_SERVER).'</a>' ?>
- </dt>
- <dt class="block_input">
- <label><?php echo __('text categories status'); ?></label>
- <?php echo tep_draw_radio_field('categories_status', 'categories_status_1', '1', (((bool)categories::$cInfo->categories_status)?true:false),'','class="radio"') . __('text categories available') .' '. tep_draw_radio_field('categories_status', 'categories_status_0', '0', ((!(bool)categories::$cInfo->categories_status)?true:false),'','class="radio"') . __('text categories not available'); ?>
- </dt>
- <dt class="block_input">
- <label><?php echo __('text categories hidden'); ?></label>
- <?php echo tep_draw_radio_field('categories_hidden', 'categories_hidden_1', '1', (((bool)categories::$cInfo->categories_hidden)?true:false),'','class="radio"') . __('text categories not hidden') .' '. tep_draw_radio_field('categories_hidden', 'categories_hidden_0', '0', ((!(bool)categories::$cInfo->categories_hidden)?true:false),'','class="radio"') . __('text categories hidden'); ?>
- </dt>
+ <dt class="block_input tcenter" style=" text-align:center;">
+ <?php echo tep_info_image( categories::$Info->image, 'image', TEMP_BO_HEADING_IMAGE_WIDTH, TEMP_BO_HEADING_IMAGE_HEIGHT) ?>
+ <?php if(tep_not_null(categories::$Info->image)) echo tep_draw_checkbox_field('categories_image_no', 'categories_image_no', 'on'). ' '.__('text delete image cat'); ?>
+ </dt>
+ <dt class="block_input" >
+ <Label><?php echo __('text choose img') ?></label>
+ <?php echo '<a class="button" href="#" onclick="'.tep_get_filebroswerserveur("categories_image", "image", '').'">'.tep_draw_input_field('categories_image','', categories::$Info->image ).' '.tep_image(DIR_WS_ICONS . 'icon_browser.png', PARCOURIR_SERVER).'</a>' ?>
+ </dt>
+ <dt class="block_input">
+ <?php echo categories::DisplayField('status', '%s'); ?>
+ </dt>
+ <dt class="block_input">
+ <?php echo categories::DisplayField('hidden', '%s'); ?>
+ </dt>
<dd class="block_input w_90 CategoryView ">
<label for="products_date_available"><?php echo __('txt categories'); ?></label>
<ul class="LinkToView ChooseSelect">
- <li class="<?php echo (((int)categories::$cInfo->parent_id == '0')? 'selected' : 'noselected') ?>"><?php echo tep_draw_radio_field('cPath','cat_0', '0', ((int)categories::$cInfo->parent_id == '0') ).' '.__('text categorie racine') ?></li>
+ <li class="<?php echo (((int)categories::$Info->parent_id == '0')? 'selected' : 'noselected') ?>"><?php echo tep_draw_radio_field('cPath','cat_0', '0', ((int)categories::$Info->parent_id == '0') ).' '.__('text categorie racine') ?></li>
<?php foreach(get_cat_list(0) as $v)
- if(categories::$cInfo->categories_id != $v['categories_id']){
- $etat = ((categories::$cInfo->parent_id > 0 && categories::$cInfo->parent_id == $v['categories_id']) ? true :false );
+ if(categories::$Info->id != $v['categories_id']){
+
+ $etat = ((categories::$Info->parent_id > 0 && categories::$Info->parent_id == $v['categories_id']) ? true :false );
echo '<li class="'.(($etat)? 'selected' : 'noselected').'">'.
tep_decal(($v['niveau']+1)).
' '. tep_draw_radio_field('cPath','cat_'.$v['categories_id'], (string)$v['categories_id'],(bool)$etat).
@@ -138,12 +104,12 @@
</ul>
</dd>
- <dt class="button_nav block_input" style="width:95%;">
- <?php
- echo tep_image_submit('', IMAGE_UPDATE) . tep_image_submit('', IMAGE_UPDATE_AND_CLOSE,' name="up_and_close"' );
- echo tep_js_back(tep_href_link(categories::FILENAME, 'cPath=' . categories::$cPath . (isset($_GET['cID']) ? '&cID=' . $_GET['cID'] : '') ), IMAGE_CANCEL) ;
- ?>
- </dt>
+ <dt class="button_nav block_input" style="width:95%;">
+ <?php
+ echo tep_image_submit('', IMAGE_UPDATE) . tep_image_submit('', IMAGE_UPDATE_AND_CLOSE,' name="up_and_close"' );
+ echo tep_js_back(tep_href_link(categories::FILENAME, 'cPath=' . categories::$cPath . (isset($_GET['cID']) ? '&cID=' . $_GET['cID'] : '') ), IMAGE_CANCEL) ;
+ ?>
+ </dt>
</dl>
</fieldset>
</div>
Deleted: trunk/catalog/admin/includes/gabarit/categories/display_view.listing.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/categories/display_view.listing.gab 2013-09-20 07:52:16 UTC (rev 4835)
+++ trunk/catalog/admin/includes/gabarit/categories/display_view.listing.gab 2013-09-21 09:37:53 UTC (rev 4836)
@@ -1,62 +0,0 @@
-<?php
-/**
- @licence GPL 2005-2010 The osCSS developers - osCSS Open Source E-commerce
- @portion code Copyright (c) 2002 osCommerce
- @package osCSS-2 <www http://www.oscss.org>
- @version 2.1.1
- @date 17/12/11, 09:32
- @author oscim <mail aur...@os...> <www http://www.oscim.fr>
- @encode UTF-8
-*/
-global $languages_id;
-?>
-
-<h3><?php echo __('heading title'); ?></h3>
-
- <div class="fright smallText" >
- <div class="navButtons">
- <?php echo '<a class="button" href="' . tep_href_link(categories::FILENAME, 'cPath=' . categories::$cPath . '&action=new') . '">' . tep_image(DIR_WS_ICONS.'icon_add_new.png' , IMAGE_NEW_CATEGORY) . IMAGE_NEW_CATEGORY . '</a>'; ?>
- </div>
- </div>
-
- <br style="clear:both;" />
-
-
- <div class="box_uniq">
-
- <div id="CurrentPathSelect" >
- <?php echo tep_draw_form('goto', categories::FILENAME, '', 'get').'<p>'. tep_draw_pull_down_menu('cPath', categorieUtility::get_category_tree(array('language_id'=>$languages_id )), categories::$current_category_id, 'onchange="this.form.submit();" title="'.__('heading title goto').'" ').'</p></form>'; ?>
- </div>
-
-
- <table class="dataTable">
- <thead>
- <tr>
- <th> </th>
- <th><?php echo __('table heading categories id'); ?></th>
- <th style="width:<?php echo TEMP_BO_SMALL_IMAGE_WIDTH ?>px"><?php echo __('table heading categories images'); ?></th>
- <th><?php echo __('table heading categories'); ?></th>
- <th class="tcenter row_status"><?php echo __('table heading view datatype'); ?></th>
- <th class="tcenter row_status"><?php echo __('table heading status'); ?></th>
- <th class="tcenter row_status"><?php echo __('table heading view status'); ?></th>
- <th class="tcenter row_action"><?php echo __('table heading action'); ?></th>
- </tr>
- </thead>
- <tfoot>
- <tr>
- <td style="width:2%"> </td>
- <td style="width:2%"> </td>
- <td style="width:<?php echo TEMP_BO_SMALL_IMAGE_WIDTH ?>px"> </td>
- <td class="w_60"> </td>
- <td class="tcenter "> </td>
- <td class="tcenter row_status"> </td>
- <td class="tcenter row_status"> </td>
- <td class="tcenter row_action"> </td>
- </tr>
- </tfoot>
-
- <tbody>
- <!-- BLOCK AJAX -->
- </tbody>
- </table>
-</div>
\ No newline at end of file
Modified: trunk/catalog/admin/includes/gabarit/products/filter.clause.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/products/filter.clause.gab 2013-09-20 07:52:16 UTC (rev 4835)
+++ trunk/catalog/admin/includes/gabarit/products/filter.clause.gab 2013-09-21 09:37:53 UTC (rev 4836)
@@ -3,48 +3,34 @@
@licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
@portion code Copyright (c) 2002 osCommerce
@package osCSS-2 <www http://www.oscss.org>
- @version 2.1.1
- @date 22/04/2012 ,22:50:08
+ @version 2.1.2
+ @date 221/09/2013 ,22:50:08
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
+*/
- NOTE: in DEV Not used
-*/
?>
-<!-- <fieldset> -->
-<!-- <legend><?php echo __('orders filter legend choose status'); ?></legend>
- <ul class="inline">
- <li>
- <label class="inline" for="products_date_available"><?php echo __('text products date available'); ?></label>
- <?php echo tep_draw_input_field('products_date_available', '', '', ' maxlength="10" size="10"') . tep_draw_hidden_field('bt_products_date_available') . ' ' . __('text products date format'); ?>
- </li>
- <li>
- <label class="inline" for="products_date_available"><?php echo __('text products date available'); ?></label>
- <?php echo tep_draw_input_field('products_date_available', '', '', ' maxlength="10" size="10"') . tep_draw_hidden_field('bt_products_date_available') . ' ' . __('text products date format'); ?>
- </li>
- </ul>-->
-<!-- </fieldset> -->
<fieldset>
<legend><?php echo __('@products filter legend products by stock'); ?></legend>
<ul class="inline">
<li>
<label class="inline" for="filters_bystock_stock"><?php echo __('@products label text bystock view'); ?></label>
- <?php echo tep_draw_radio_field('filters[bystock]', 'filters_bystock', '0', (int)(!isset($_SESSION['filters']['bystock']) || @$_SESSION['filters']['bystock'] == '0') ); ?>
+ <?php echo tep_draw_radio_field('filters[bystock]', 'filters_bystock', '1', (int) ( (int)$_SESSION['filters']['products']['bystock'] == 1) ); ?>
</li>
<li>
<label class="inline" for="filters_bystock_stock"><?php echo __('@products label text bystock all'); ?></label>
- <?php echo tep_draw_radio_field('filters[bystock]', 'filters_bystock', '1', (int)(@$_SESSION['filters']['bystock'] == '1') ); ?>
+ <?php echo tep_draw_radio_field('filters[bystock]', 'filters_bystock', '2', (int)( (int)$_SESSION['filters']['products']['bystock'] == 2 ) ); ?>
</li>
</ul>
</fieldset>
-<?php if(!isset($_SESSION['filters']['bystock']) || (int)$_SESSION['filters']['bystock'] == 0): ?>
+<?php if(!isset($_SESSION['filters']['products']['bystock']) || (int)$_SESSION['filters']['products']['bystock'] == 1): ?>
<fieldset>
<legend><?php echo __('@products filter legend products by attribut'); ?></legend>
<ul class="inline">
<li>
<label class="inline" for="filters_byattribute_all"><?php echo __('@products label text byattribute all'); ?></label>
- <?php echo tep_draw_checkbox_field('filters[byattribute][all]', 'filters_byattribute_all', 'on', (bool)(@$_SESSION['filters']['byattribute']['all'] == 'on') ); ?>
+ <?php echo tep_draw_checkbox_field('filters[byattribute][all]', 'filters_byattribute_all', 'on', (bool)(@$_SESSION['filters']['products']['byattribute']['all'] == 'on') ); ?>
</li>
</ul>
</fieldset>
@@ -54,11 +40,11 @@
<ul class="inline">
<li>
<label class="inline" for="products_date_available"><?php echo __('@products label text expected publied'); ?></label>
- <?php echo tep_draw_checkbox_field('filters[expected][publied]', 'filters_publied', 'on', (bool)(@$_SESSION['filters']['expected']['publied'] == 'on') ); ?>
+ <?php echo tep_draw_checkbox_field('filters[expected][publied]', 'filters_publied', 'on', (bool)(@$_SESSION['filters']['products']['expected']['publied'] == 'on') ); ?>
</li>
<li>
<label class="inline" for="products_date_available"><?php echo __('@products label text expected no publied'); ?></label>
- <?php echo tep_draw_checkbox_field('filters[expected][nopublied]', 'filters_publied', 'on', (bool)(@$_SESSION['filters']['expected']['nopublied'] == 'on') ); ?>
+ <?php echo tep_draw_checkbox_field('filters[expected][nopublied]', 'filters_publied', 'on', (bool)(@$_SESSION['filters']['products']['expected']['nopublied'] == 'on') ); ?>
</li>
</ul>
</fieldset>
@@ -68,11 +54,11 @@
<ul class="inline">
<li>
<label class="inline" for="products_date_available"><?php echo __('@products label text status publied'); ?></label>
- <?php echo tep_draw_checkbox_field('filters[status][publied]', 'filters_publied', 'on', (bool)(@$_SESSION['filters']['status']['publied'] == 'on') ); ?>
+ <?php echo tep_draw_checkbox_field('filters[status][publied]', 'filters_publied', 'on', (bool)(@$_SESSION['filters']['products']['status']['publied'] == 'on') ); ?>
</li>
<li>
<label class="inline" for="products_date_available"><?php echo __('@products label text status no publied'); ?></label>
- <?php echo tep_draw_checkbox_field('filters[status][nopublied]', 'filters_publied', 'on', (bool)(@$_SESSION['filters']['status']['nopublied'] == 'on') ); ?>
+ <?php echo tep_draw_checkbox_field('filters[status][nopublied]', 'filters_publied', 'on', (bool)(@$_SESSION['filters']['products']['status']['nopublied'] == 'on') ); ?>
</li>
</ul>
</fieldset>
Modified: trunk/catalog/admin/includes/languages/fr_FR/modules/pages/products.txt
===================================================================
--- trunk/catalog/admin/includes/languages/fr_FR/modules/pages/products.txt 2013-09-20 07:52:16 UTC (rev 4835)
+++ trunk/catalog/admin/includes/languages/fr_FR/modules/pages/products.txt 2013-09-21 09:37:53 UTC (rev 4836)
@@ -64,7 +64,7 @@
$lang['@products filter legend products by stock']="Les stocks " ;
$lang['@products label text bystock view']="Afficher avec les stocks des produits maitres (cumuls des attributs)" ;
- $lang['@products label text bystock all']="Afficher avec les stocks avec plusieures lignes d'un même produit par declinaisons d'attributs " ;
+ $lang['@products label text bystock all']="Afficher avec les stocks avec plusieurs lignes d'un même produit par declinaisons d'attributs " ;
/* All fields used on listign and filters */
@@ -73,6 +73,7 @@
$lang['products table heading modele']="Modèle" ;
$lang['products table heading image']="Image" ;
$lang['products table heading quantity']="Qté." ;
+ $lang['products table heading stock rowid']="Stock rowid" ;
$lang['products table heading status']="Etat" ;
$lang['products table heading stock']="Stock" ;
$lang['products table heading price']="Prix" ;
Modified: trunk/catalog/admin/includes/modules/pages/categories.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/categories.php 2013-09-20 07:52:16 UTC (rev 4835)
+++ trunk/catalog/admin/includes/modules/pages/categories.php 2013-09-21 09:37:53 UTC (rev 4836)
@@ -3,8 +3,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 30/03/2012, 09:32
+ @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
@@ -16,56 +16,45 @@
@brief master class edit and manage cat
*/
class categories
- implements ExtModPage, InterfacedTJsonS{
+ extends ModTwo /// new abstract class for nextgen module
+ implements
+ InterfaceModule,
+ ExtModConfig,
+ InterfacedTJsonS,
+ InterfacedInnerHtml
+ {
const FILENAME = FILENAME_CATEGORIES;
/**
- @p string $code
+ @var int current id
*/
- public static $code;
+ public static $Id;
/**
- @p string $action
+ @var array $modules
*/
- public static $action;
- /**
- @p array $modules
- */
public static $list=array();
/**
- @p array $modules
+ @var array $languages
*/
- public static $modules;
- /**
- @p array $languages
- */
public static $languages;
/**
- @p objet $cInfo
+ @var array $cPath
*/
- public static $cInfo;
- /**
- @p array $cPath
- */
public static $cPath;
/**
- @p array $current_category_id
+ @var array $current_category_id
*/
public static $current_category_id;
/**
- @p array $DiversInfo transport var
+ @var array $DiversInfo transport var
*/
public static $DiversInfo;
/**
- @p array $actions
+ @var array $actions
*/
public static $actions;
- /**
- @p obj $box
- */
- public static $box;
-
public function __construct(){
self::GetConf();
}
@@ -78,10 +67,13 @@
global $languages_id;
self::$code=__CLASS__;
+ self::$datatype='categorie';
+
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
*/
@@ -98,27 +90,261 @@
self::$modules=new AcaFactory('categories','MODULE_ACACAT_INSTALLED_BO');
self::$modules->set_image_handler();
- self::$cPath=(isset($_GET['cPath'])? (int)$_GET['cPath'] : 0);
+ self::$languages = tep_get_languages();
- // check if the catalog image directory exists
- global $messageStack;
- if (is_dir(DIR_FS_CATALOG_IMAGES)) {
- if (!is_writeable(DIR_FS_CATALOG_IMAGES)) $messageStack->add(sprintf(__('error catalog image directory not writeable %s'), DIR_FS_CATALOG_IMAGES ), 'error');
- }
- else $messageStack->add(__(sprintf('error catalog image directory does not exist %s'), DIR_FS_CATALOG_IMAGES ), 'error');
- 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['c.categories_id'] = array(
+ 'sort'=>true,
+ 'alias'=>'id',
+ 'text'=>__('categories table heading id'),
+ 'default'=>true,
+ 'width'=>'5%',
+ 'class'=>'tcenter',
+ );
+
+ self::$allfields['c.categories_image'] = array(
+ 'sort'=>true,
+ 'alias'=>'image',
+ 'text'=>__('categories table heading image'),
+ 'default'=>true,
+ 'width'=>'5%',
+ 'class'=>'tcenter',
+ );
+ self::$allfields['c.categories_cpath'] = array(
+ 'sort'=>true,
+ 'alias'=>'cPath',
+ 'text'=>__('categories table heading cpath'),
+// 'default'=>true,
+ 'width'=>'5%',
+ 'class'=>'tcenter',
+ );
+
+
+
+ self::$allfields['c.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',
+ 'select_values'=>$list_parent,
+ ),
+ );
+ self::$allfields['c.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['c.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,
+ ),
+ );
+
+ self::$allfields['cd.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['cd.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['c.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') ),
+ ),
+ ),
+ );
+ self::$allfields['c.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') ),
+ ),
+ ),
+ );
+ self::$allfields['c.date_added'] = array(
+ 'sort'=>true,
+ 'alias'=>'added',
+ 'text'=>__('categories table heading date added'),
+// 'default'=>true,
+ 'width'=>'5%',
+ );
+ self::$allfields['c.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 = ' c.categories_id as id, c.categories_cpath as cPath, cd.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 c.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);
+
}
-/** public static ExtModPage */
- public function check_action($actionss){
+ public function check_action($actions){
global $languages_id, $oscss,$messageStack;
$DB=Database::getInstance();
- self::$actions['action'] = self::$action;
+ 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'] : '';
@@ -130,24 +356,80 @@
self::$DiversInfo['current_category_id']=((isset($_GET['cPath'])&& !empty($_GET['cPath'])) ? tep_db_prepare_input($_GET['cPath']) : 0);
-// if ( empty(self::$actions['action_class']) ) {
- /**
- A module has asked to privately take care of this action, check if class and method exist and run it.
- */
- if (!empty(self::$actions['action_method']) && method_exists(self::$modules->modules[self::$actions['action_class']],self::$actions['action_method'] )){
- $metho=self::$actions['action_method'];
- self::$box = new box;
- self::$box=self::$modules->modules[self::$actions['action_class']]->$metho(self::$box,(int)$_GET['cID']);
- }
- else {
/// 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 {
+ if($_REQUEST['columnName'] == 'products_ref'){
+ if( sqlcontent::fetch(array('ref'=>$_REQUEST['value'])) != false)
+ throw new Exception(__('@cms_content ref is already used') ) ;
+ }
+
+ $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'])) {
@@ -228,10 +510,10 @@
$messageStack->add_session(__('@categorie create'), 'success');
if(isset($_POST['up_and_close']) )
- // by popup ajax
+ // by popup ajax
if(isset($_POST['origin']) )
tep_redirect(tep_href_link($_POST['origin']));
- else
+ 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'));
@@ -420,30 +702,21 @@
/// reliquat oscom Reset Global For use tep_input_radio
$GLOBALS['cPath']=null;
- self::$cInfo = new objectInfo( sqlcategorie::Specimen() );
+ self::$Info = new objectInfo( sqlcategorie::Specimen() );
- $oscss->_add_ext(BO_WISIWYG_SELECTED,'editeur/');
- for ($i=0, $n=sizeof(self::$languages); $i<$n; $i++) {
- echo $oscss->_call(BO_WISIWYG_SELECTED,'_top','categories_description[' . self::$languages[$i]['id'] . ']','600','400');
- }
+// $oscss->_add_ext(BO_WISIWYG_SELECTED,'editeur/');
+// for ($i=0, $n=sizeof(self::$languages); $i<$n; $i++) {
+// echo $oscss->_call(BO_WISIWYG_SELECTED,'_top','categories_description[' . self::$languages[$i]['id'] . ']','600','400');
+// }
break;
case 'edit':
- /// reliquat oscom Reset Global For use tep_input_radio
- $GLOBALS['cPath']=null;
- $categories_id = tep_db_prepare_input( (int)$_GET['cID']);
-
- $cInfo_array=sqlcategorie::fetch(array('id'=>$categories_id));
-
- self::$cInfo = new objectInfo($cInfo_array);
-
/// 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','categories_description[' . self::$languages[$i]['id'] . ']','600','400');
- }
+ 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;
@@ -451,7 +724,7 @@
sqlcategorie::Maintenance();
}
- }
+
}
@@ -463,19 +736,97 @@
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 load_db_values($ID){
- global $languages_id;
+ public static function GetDBValue(){
+ global $languages_id;
- $myarray = sqlcategorie::fetch(array('id'=> (int) $ID, 'language_id'=>(int)$languages_id));
+ $DB=Database::getInstance();
- $myarray['cPath']= categorieUtility::get_generated_category_path_ids($ID);
- return new objectInfo($myarray);
+ $action=self::$action;
+
+ switch ($action) {
+ case 'edit';
+
+ $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.", c.categories_id as id ".
+ " FROM " . TABLE_CATEGORIES . " c ".
+ " JOIN " . TABLE_CATEGORIES_DESCRIPTION . " cd ON (cd.categories_id = c.categories_id AND cd.language_id = '" . (int)$adjust->languages_id . "') ";
+
+ $query_raw .=((strlen($adjust->sWhere)>4) ? " WHERE ".substr($adjust->sWhere, 3) : '');
+// " GROUP BY c.content_id ";
+
+ /* 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_raw .=" GROUP BY ";
+// foreach($r as $mod=>$value){
+// foreach($value as $key=>$string){
+// $query_raw .= $string;
+// }
+// }
+// }
+ /* END Sub module add col */
+
+ $query_raw .=" ORDER BY ".((!empty($adjust->sOrder)) ? $adjust->sOrder : ' c.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() {
@@ -486,10 +837,10 @@
@remarks Ajax View result
*/
case 'setflag':
- return self::get_status_categories(array('categories_status'=>(int)$_GET['flag'], 'categories_id'=>(int)$_GET['cID']));
+ return self::RowStatus(array('status'=>(int)$_GET['flag'], 'id'=>(int)self::$Id));
break;
case 'viewflag':
- return self::get_status_menu(array('categories_hidden'=>(int)$_GET['flag'], 'categories_id'=>(int)$_GET['cID']));
+ return self::RowHidden(array('hidden'=>(int)$_GET['flag'], 'id'=>(int)self::$Id));
break;
/**
@@ -505,24 +856,32 @@
case 'edit':
case 'new':
$action='edit';
+ self::$Info=self::GetDBValue(self::$Id);
+ /// use master gabarit
+ return MGabCont::CallGab(self::$action,__FUNCTION__,__CLASS__);
break;
case 'delete':
- self::$cInfo=self::load_db_values((int)$_GET['cID']);
+ self::$Info=self::GetDBValue(self::$Id);
+ /// use master gabarit
+ return MGabCont::CallGab(self::$action,__FUNCTION__,__CLASS__);
break;
case 'copy_to':
- self::$cInfo=self::load_db_values((int)$_GET['cID']);
+ self::$Info=self::GetDBValue(self::$Id);
+ /// use master gabarit
+ return MGabCont::CallGab(self::$action,__FUNCTION__,__CLASS__);
break;
default:
if(!empty(self::$actions['action_method']) )
$action='aca_actions';
else {
- self::tep_get_list();
+ self::$list=self::tep_get_list();
$action='listing';
}
}
+
/// use master gabarit
- return MGabCont::CallGab($action,__FUNCTION__,__CLASS__);
+ return MGabCont::CallGab($action,__FUNCTION__,self::MASTER);
}
/** public static InterfacedTJsonS */
@@ -533,13 +892,13 @@
@param $products array
@return string
*/
- private static function get_item_action($categories){
+ public static function ButtonRowsActions($categories){
return sprintf(
CsrtAction::getFormat('row_action'),
- sprintf(CsrtAction::getLink('row_action_right', IMAGE_EDIT, 'edit'), '', tep_href_link(self::FILENAME, 'cPath=' . self::$cPath . '&cID=' . $categories['categories_id'] . '&action=edit' ),'' ).
- sprintf(CsrtAction::getLink('row_action_right', IMAGE_DELETE, 'delete'), 'fancy', tep_href_link(self::FILENAME, 'cPath=' . self::$cPath . '&cID=' . $categories['categories_id'] . '&action=delete') ,'' ),
+ sprintf(CsrtAction::getLink('row_action_right', IMAGE_EDIT, 'edit'), '', tep_href_link(self::FILENAME, 'cPath=' . self::$cPath . '&cID=' . $categories['id'] . '&action=edit' ),'' ).
+ sprintf(CsrtAction::getLink('row_action_right', IMAGE_DELETE, 'delete'), 'fancy', tep_href_link(self::FILENAME, 'cPath=' . self::$cPath . '&cID=' . $categories['id'] . '&action=delete') ,'' ),
- sprintf(CsrtAction::getLink('row_action_right', ICON_FOLDER, 'childs'), '', tep_href_link(self::FILENAME, 'cPath=' . $categories['categories_id'] ),'' ).
+ sprintf(CsrtAction::getLink('row_action_right', ICON_FOLDER, 'childs'), '', tep_href_link(self::FILENAME, 'cPath=' . $categories['id'] ),'' ).
sprintf(CsrtAction::getLink('row_action_right', __('image view public') , 'publiclink'), '', tep_catalog_href_link('index.php', 'cPath=' . $categories['cPath'],'SSL', true, 'forceview') ,' target="blank" ' )
);
@@ -551,15 +910,15 @@
@param $product array restuts row
@return string html
*/
- private static function get_status_categories($categories){
+ public static function RowStatus($categories){
$exclude=array('action','cID','forceajax','type','class','function','funct', 'mod');
- $query_s='action=setflag&cID=' . $categories['categories_id'].'&flag=';
+ $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['categories_status'] == '1')? '0' : '1') ) . '">'.
+ 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['categories_status'],
- ( ($categories['categories_status'] == '1')? IMAGE_ICON_STATUS_GREEN : IMAGE_ICON_STATUS_RED)
+ (int)$categories['status'],
+ ( ($categories['status'] == '1')? IMAGE_ICON_STATUS_GREEN : IMAGE_ICON_STATUS_RED)
).
'</a>';
}
@@ -569,88 +928,111 @@
@param $product array restuts row
@return string html
*/
- private static function get_status_menu($categories){
+ public static function RowHidden($categories){
$exclude=array('action','cID','forceajax','type','class','function','funct', 'mod');
- $query_s='action=viewflag&cID=' . $categories['categories_id'].'&flag=';
+ $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['categories_hidden'] == '1')? '0' : '1') ) . '">'.
+ 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['categories_hidden'],
- ( ($categories['categories_hidden'] == '1')? IMAGE_ICON_STATUS_GREEN : IMAGE_ICON_STATUS_RED)
+ (int)$categories['hidden'],
+ ( ($categories['hidden'] == '1')? IMAGE_ICON_STATUS_GREEN : IMAGE_ICON_STATUS_RED)
).
'</a>';
}
- public static function tep_get_modele(){
- return array( 0 =>false,
- 'c.categories_id'=>true,
- 'categories_image'=>true,
- 'categories_name'=>true,
- 'categories_datatype'=>true,
- 'categories_status'=>true,
- 'categories_hidden'=>true,
- 'action'=>false
- );
- }
+// public static function tep_get_modele(){
+// return array( 0 =>false,
+// 'c.categories_id'=>true,
+// 'categories_image'=>true,
+// 'categories_name'=>true,
+// 'categories_datatype'=>true,
+// 'categories_status'=>true,
+// 'categories_hidden'=>true,
+// 'action'=>false
+// );
+// }
- private static function emptyResult(){
- return array( 'null'=>'',
- 'c.categories_id'=>'',
- 'categories_name'=>'',
- 'categories_image'=>'',
-// 'parent_id',
- 'categories_datatype',
- 'categories_status'=>'',
- 'categories_hidden'=>'',
-// 'p.categories_status',
- 'action'=>''
- );
- }
+// private static function emptyResult(){
+// return array( 'null'=>'',
+// 'c.categories_id'=>'',
+// 'categories_name'=>'',
+// 'categories_image'=>'',
+// // 'parent_id',
+// 'categories_datatype',
+// 'categories_status'=>'',
+// 'categories_hidden'=>'',
+// // 'p.categories_status',
+// 'action'=>''
+// );
+// }
public static function tep_get_list($page=1,$rowbyp=10,$sOrder='',$sWhere='',$options=''){
global $languages_id,$query_numrows;
- self::$cPath=$cID=(isset($_GET['cPath'])? (int)$_GET['cPath'] : 0);
+// self::$cPath=$cID=(isset($_GET['cPath'])? (int)$_GET['cPath'] : 0);
+//
+// $DB=Database::getInstance();
+//
+// $categories_query = "SELECT DISTINCT c.categories_id, cd.categories_name, c.categories_image, c.parent_id, c.sort_order,categories_datatype, c.date_added, c.last_modified,c.categories_status,c.categories_hidden, cd.categories_description, cd.categories_head_keywords_tag ".
+// " FROM " . TABLE_CATEGORIES . " c ".
+// " JOIN " . TABLE_CATEGORIES_DESCRIPTION . " cd ON (cd.categories_id = c.categories_id AND cd.language_id = '" . (int)$languages_id . "') ".
+// "WHERE c.parent_id = '" . (int)$cID . "' ".$sWhere.
+// " ORDER BY ".(
+// (!empty($sOrder))
+// ? $sOrder
+// : (($cID !=0)?" c.parent_id ASC , ": "" ) . " c.sort_order ASC, cd.categories_name ASC").
+// "";
+//
+// $categories_split = new splitPageResults($page, $rowbyp, $categories_query,$query_numrows);
+//
+// $pq=$DB->query($categories_query);
+//
+// foreach($pq->fetchAllAssoc() as $categories){
+//
+// $categories['c.categories_id']=$categories['categories_id'];
+// $categories['categories_image']=(!empty($categories['categories_image'])) ? tep_info_image($categories['categories_image'], $categories['categories_name'], TEMP_BO_SMALL_IMAGE_WIDTH, TEMP_BO_SMALL_IMAGE_HEIGHT) : ' N/A';
+// $categories['categories_status']=self::get_status_categories($categories);
+// $categories['categories_hidden']=self::get_status_menu($categories);
+// $categories['cPath']=categorieUtility::get_generated_category_path_ids( $categories['categories_id']);
+// self::$list[]=$categories;
+// }
+//
+//
+// $li=$res=array();
+// foreach(self::$list as $item){
+// foreach(self::tep_get_modele() as $k=>$v) $li[$k]=(isset($item[$k]) && !empty($item[$k]))? $item[$k] : ' ';
+// $li[0]=$item['categories_id'];
+// $li['action']=self::get_item_action($item);
+// $res[]=$li;
+// }
+//
+//
+// if(count($res)==0) $res[]= self::emptyResult();
+// return $res;
- $DB=Database::getInstance();
+ global $query_numrows;
- $categories_query = "SELECT DISTINCT c.categories_id, cd.categories_name, c.categories_image, c.parent_id, c.sort_order,categories_datatype, c.date_added, c.last_modified,c.categories_status,c.categories_hidden, cd.categories_description, cd.categories_head_keywords_tag ".
- " FROM " . TABLE_CATEGORIES . " c ".
- " JOIN " . TABLE_CATEGORIES_DESCRIPTION . " cd ON (cd.categories_id = c.categories_id AND cd.language_id = '" . (int)$languages_id . "') ".
- "WHERE c.parent_id = '" . (int)$cID . "' ".$sWhere.
- " ORDER BY ".(
- (!empty($sOrder))
- ? $sOrder
- : (($cID !=0)?" c.parent_id ASC , ": "" ) . " c.sort_order ASC, cd.categories_name ASC").
- "";
+ /// @remarks force load conf
+ self::GetConf();
- $categories_split = new splitPageResults($page, $rowbyp, $categories_query,$query_numrows);
+ $res=array();
- $pq=$DB->query($categories_query);
+ /**
+ @remarks adjust param for sql requete
+ */
+ self::$InitInfo['adjust']['page']=$page;
+ self::$InitInfo['adjust']['rowbyp']=$rowbyp;
+ self::$InitInfo['adjust']['sOrder'].=$sOrder;
+ self::$InitInfo['adjust']['sWhere'].=$sWhere;
+ self::$InitInfo['adjust']['options']=$options;
- foreach($pq->fetchAllAssoc() as $categories){
+ $res = self::GetDBValue();
- $categories['c.categories_id']=$categories['categories_id'];
- $categories['categories_image']=(!empty($categories['categories_image'])) ? tep_info_image($categories['categories_image'], $categories['categories_name'], TEMP_BO_SMALL_IMAGE_WIDTH, TEMP_BO_SMALL_IMAGE_HEIGHT) : ' N/A';
- $categories['categories_status']=self::get_status_categories($categories);
- $categories['categories_hidden']=self::get_status_menu($categories);
- $categories['cPath']=categorieUtility::get_generated_category_path_ids( $categories['categories_id']);
- self::$list[]=$categories;
- }
+ self::$list= $query_numrows ; //= count($res);
+ return $res;
- $li=$res=array();
- foreach(self::$list as $item){
- foreach(self::tep_get_modele() as $k=>$v) $li[$k]=(isset($item[$k]) && !empty($item[$k]))? $item[$k] : ' ';
- $li[0]=$item['categories_id'];
- $li['action']=self::get_item_action($item);
- $res[]=$li;
- }
-
-
- if(count($res)==0) $res[]= self::emptyResult();
- return $res;
}
/** static InterfacedInnerHtml */
@@ -661,6 +1043,104 @@
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 'new':
+ case 'edit';
+ 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;
+
+ 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;
+ }
+
+ return $res;
+ }
+
+
+
+
+/** Interface module */
+
+ function check() { return false; }
+ function install() { return false; }
+ function remove() { return false; }
+ function keys() { return false; }
}
Modified: trunk/catalog/admin/includes/modules/pages/products.php
=========================================...
[truncated message content] |
|
From: <os...@us...> - 2013-09-20 07:52:19
|
Revision: 4835
http://sourceforge.net/p/oscss/svn/4835
Author: oscim
Date: 2013-09-20 07:52:16 +0000 (Fri, 20 Sep 2013)
Log Message:
-----------
Fix error
Modified Paths:
--------------
trunk/catalog/includes/classes/drivers/data/categorie.php
Modified: trunk/catalog/includes/classes/drivers/data/categorie.php
===================================================================
--- trunk/catalog/includes/classes/drivers/data/categorie.php 2013-09-20 07:25:35 UTC (rev 4834)
+++ trunk/catalog/includes/classes/drivers/data/categorie.php 2013-09-20 07:52:16 UTC (rev 4835)
@@ -155,9 +155,9 @@
* @param $option
*/
protected static function cstr_query($orderby='', $limit='', $option=''){
- $query="SELECT c.categories_id, parent_id, cd.categories_description, c.categories_image, cd.categories_name,c.categories_cpath,c.categories_datatype, sortchids , sortchids_datatype, categories_status, categories_hidden FROM " . TABLE_CATEGORIES . " c LEFT JOIN " . TABLE_CATEGORIES_DESCRIPTION . " cd ON (c.categories_id = cd.categories_id AND cd.language_id = '" . self::$lg_id . "' ) WHERE " . DataForceStatus(" c.categories_status='1' ") . " ";
+ $query="SELECT c.categories_id, parent_id, cd.categories_description, c.categories_image, cd.categories_name,c.categories_cpath,c.categories_datatype, sortchids , sortchids_datatype, categories_status, categories_hidden FROM " . TABLE_CATEGORIES . " c LEFT JOIN " . TABLE_CATEGORIES_DESCRIPTION . " cd ON (c.categories_id = cd.categories_id AND cd.language_id = '" . self::$lg_id . "' ) WHERE 1 ";
- $query .=self::$where_query;
+ $query .=self::$where_query ." ". DataForceStatus(" AND c.categories_status='1' "). " " ;
$query .=' ORDER BY ' .(!tep_not_null($orderby)? ' c.sort_order, cd.categories_name ASC ' : $orderby) ;
if($limit!='0')
$query .=' LIMIT '.(!tep_not_null($limit)? '50' : $limit) ;
@@ -186,7 +186,7 @@
$search=tep_db_prepare_input($search);
//! soit id soit sherach name key
- self::add_where_query((tep_not_null($id) && is_numeric($id) ? " AND c.categories_id = '" . (int)$id . "' ": (!empty($search)?" AND cd.categories_name LIKE '%" . tep_db_input($search) . "%' ":'') ));
+ self::add_where_query((tep_not_null($id) && is_numeric($id) ? " AND c.categories_id = '" . (int)$id . "' ": (!empty($search)?" AND cd.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) ;
$content_query = $DB->query($sql);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2013-09-20 07:25:39
|
Revision: 4834
http://sourceforge.net/p/oscss/svn/4834
Author: oscim
Date: 2013-09-20 07:25:35 +0000 (Fri, 20 Sep 2013)
Log Message:
-----------
Fix after upgrade
Modified Paths:
--------------
trunk/catalog/admin/includes/classes/drivers/sqlcontent.php
trunk/catalog/admin/includes/classes/drivers/sqlcustomer.php
trunk/catalog/admin/includes/classes/drivers/sqlproduct.php
trunk/catalog/admin/includes/gabarit/products/display_view.edit.gab
trunk/catalog/admin/includes/languages/fr_FR/modules/pages/cms_content.txt
trunk/catalog/admin/includes/languages/fr_FR/modules/pages/customers.txt
trunk/catalog/admin/includes/languages/fr_FR/modules/pages/products.txt
trunk/catalog/admin/includes/languages/fr_FR/modules/products/desc_base.txt
trunk/catalog/admin/includes/template/defaut/css/less/datatable.less
Modified: trunk/catalog/admin/includes/classes/drivers/sqlcontent.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlcontent.php 2013-09-19 16:46:15 UTC (rev 4833)
+++ trunk/catalog/admin/includes/classes/drivers/sqlcontent.php 2013-09-20 07:25:35 UTC (rev 4834)
@@ -3,8 +3,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.2
- @date 17/08/2013, 20:11
+ @version 2.1.1
+ @date 12/02/2013, 20:11
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
@@ -28,7 +28,7 @@
}
- /**
+ /**
@brief create new ligne in table configuration
@param $option array
language_id = > int $languages_id
@@ -95,6 +95,7 @@
$list_languages=tep_get_languages();
$where ='';
+ $error = 0 ;
// $languages_id = $option['language_id'];
if(isset($option['id'])){
@@ -115,18 +116,22 @@
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 )
- tep_db_perform(TABLE_CONTENT, $sql_data_array, 'update', "content_id = '" . (int)$content_id . "'");
+ if ( ! tep_db_perform(TABLE_CONTENT, $sql_data_array, 'update', "content_id = '" . (int)$content_id . "'") )
+ $error++;
// no touch if just update one rows
if(count($sql_data_array) >= 3 ) {
/**
- TODO Couplage avec MLinkto + datatype actif
+ TODO Couplage avec MLinkto + datatype actif
*/
if(DataTypes::is_active('categorie')) {
/// Clean link posts to categorie and save new link
@@ -160,20 +165,37 @@
$sql_data_array = array();
$language_id = $list_languages[$i]['id'];
- if(isset($post['content_text'][$language_id])) $sql_data_array['content_text'] = tep_db_prepare_input($post['content_text'][$language_id]) ;
- if(isset($post['content_title'][$language_id])) $sql_data_array['content_title'] =tep_db_prepare_input($post['content_title'][$language_id]);
+ if(isset($post['cms_content']['content_text'][$language_id]) && is_array($post['cms_content']['content_text']) )
+ $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($post['cms_content']['content_title'][$language_id]) && is_array($post['content_title']['content_title']) )
+ $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']) ;
+
$sql_data_array = array_merge($sql_data_array, self::$modules->get_update_table_content_description ($language_id));
if(count($sql_data_array) > 0)
- tep_db_perform(TABLE_CONTENT_DESCRIPTION, $sql_data_array, 'update', "content_id = '" . (int)$content_id . "' and language_id = '" . (int)$language_id . "'");
+ 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);
- return $content_id;
+ if( $error > 0){
+ $DB->rollbackTransaction();
+ return false;
+ }
+ else{
+ $DB->commitTransaction();
+ return 1;
+ }
+
+// return $content_id;
}
@@ -235,14 +257,8 @@
$num = $res->__get('numRows');
$cInfo_array = array();
- if($num == 1){
- $tmp = $res->fetchAssoc();
-
- if(!isset($ID))
- $ID = $tmp['content_id'];
-
- $cInfo_array[] = $tmp;
- }
+ if($num == 1)
+ $cInfo_array[] = $res->fetchAssoc();
else
foreach($res->fetchAllAssoc() as $row)
$cInfo_array[] = $row;
@@ -277,9 +293,8 @@
}
/**
- TODO Couplage avec MLinkto + datatype actif
+ TODO Couplage avec MLinkto + datatype actif
*/
- if($num == 1)
if(DataTypes::is_active('categorie')) {
$cat_query = $DB->query("select categories_id from " . TABLE_CONTENT_TO_CATEGORIES . " where content_id='" . (int)$row['content_id'] . "' ");
while($cat_l = tep_db_fetch_array($cat_query)){ $cat_list[$cat_l['categories_id']]=$cat_l; }
@@ -432,33 +447,33 @@
// $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;
Modified: trunk/catalog/admin/includes/classes/drivers/sqlcustomer.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlcustomer.php 2013-09-19 16:46:15 UTC (rev 4833)
+++ trunk/catalog/admin/includes/classes/drivers/sqlcustomer.php 2013-09-20 07:25:35 UTC (rev 4834)
@@ -256,45 +256,21 @@
return false;
- $_query = $DB->query($sql="SELECT o.orders_id from " . TABLE_ORDERS . " o WHERE o.customers_id = '" . (int)$_id . "' ");
- if($_query->__get("numRows")>=0)
- return false;
-
-
$DB->query("delete from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . (int)$_id . "'");
$DB->query("delete from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . (int)$_id . "'");
$DB->query("delete from " . TABLE_WHOS_ONLINE . " where customer_id = '" . (int)$_id . "'");
-// self::$modules->deleteconfirm_account( array('id'=>$_id) );
- self::$modules->__call('deleteconfirm_account', $_id );
+ self::$modules->deleteconfirm_account($_id);
+// self::$modules->delete($_id);
- $DB->query("delete from " . TABLE_CUSTOMERS_INFO . " where customers_info_id = '" . (int)$_id . "'");
+
$DB->query("delete from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$_id . "'");
return true;
}
-
- /**
- @fn randomize()
- @brief Generate password
- */
- public static function randomize() {
- $salt = "abchefghjkmnpqrstuvwxyz0123456789";
- srand((double)microtime()*1000000);
- $i = 0;
- $pass='';
- while ($i <= 7) {
- $num = rand() % 33;
- $tmp = substr($salt, $num, 1);
- $pass = $pass . $tmp;
- $i++;
- }
- return $pass;
- }
-
/**
@brief
@return array product empty
Modified: trunk/catalog/admin/includes/classes/drivers/sqlproduct.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlproduct.php 2013-09-19 16:46:15 UTC (rev 4833)
+++ trunk/catalog/admin/includes/classes/drivers/sqlproduct.php 2013-09-20 07:25:35 UTC (rev 4834)
@@ -110,11 +110,11 @@
if(isset($option['id'])) $products_id = (int)$option['id'];
// if(isset($option['action'])) $action=$option['action'];
- if(isset($option['post'])) $post=$option['post'];
+ if(isset($option['post'])) $post=(array)$option['post'];
$post['products_id'] = $products_id;
- $sql_data_array = $option['sqlarray'];
+ $sql_data_array = (array)$option['sqlarray'];
if(! self::fetch($option) )
$action = 'insert_product';
@@ -137,7 +137,9 @@
$error++;
}
elseif ($action == 'update_product') {
+
$sql_data_array['products_last_modified'] ='now()';
+// var_dump(self::$modules->get_update_table_products());
$sql_data_array = array_merge($sql_data_array, self::$modules->get_update_table_products());
if( ! tep_db_perform(TABLE_PRODUCTS, $sql_data_array, 'update',"products_id = '" . (int)$products_id . "'") )
@@ -209,7 +211,7 @@
$language_id = $list_languages[$i]['id'];
- $sql_data_array = array('products_name' => tep_db_prepare_input($post['products_name'][$language_id]) );
+ $sql_data_array = array(); //'products_name' => tep_db_prepare_input($post['products_name'][$language_id]) );
if ($action == 'insert_product') {
$insert_sql_data = array('products_id' => $products_id, 'language_id' => $language_id);
@@ -218,18 +220,20 @@
// 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') {
- if(isset($post['products_name'][$language_id]) && strlen($post['products_name'][$language_id])> 0) {
+// if(isset($post['products_name'][$language_id]) && strlen($post['products_name'][$language_id])> 0) {
// ACA START UPDATE PRODUCT_DESCRIPTION TABLE
$sql_data_array = array_merge($sql_data_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++;
- }
+// }
}
}
@@ -274,8 +278,8 @@
self::getInstance();
$DB=Database::getInstance();
+// $price=price::getInstance();
-
$cat_list =array();
$sql ="AND ";
@@ -290,10 +294,10 @@
$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['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'])."' ";
@@ -301,10 +305,9 @@
$sql =substr($sql,3);
$sql_query = "SELECT
- pd.products_name
- , pd.products_description
- , pd.products_url
- , p.products_id
+ p.products_id
+ , p.products_type
+ , p.products_ref
, p.products_quantity
, p.products_quantity_alert
, p.products_type , p.products_type as products_virtual_typeID
@@ -320,13 +323,11 @@
, p.products_status
, p.products_tax_class_id
, p.manufacturers_id
- , p.products_ref
, p.products_barcode_type
, p.products_barcode
, p.products_ordered
- FROM " . TABLE_PRODUCTS . " p, ".
- " " . TABLE_PRODUCTS_DESCRIPTION . " pd ".
- " WHERE p.products_id = pd.products_id ". $sql;
+ FROM " . TABLE_PRODUCTS . " p ".
+ " WHERE 1 ". $sql;
$product_query = $DB->query( $sql_query );
@@ -337,8 +338,23 @@
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));
+//
+
+
/**
TODO Couplage avec MLinkto + datatype actif
*/
@@ -375,11 +391,19 @@
}
//<!-- EOF Separate Pricing Per Customer -->
- $res = self::$modules->load_db_values($ID);
+// $res = self::$modules->load_db_values($ID);
+//
+// $product['mod'] = $res;
- $product['mod'] = $res;
+ $product['mod'] = self::$modules->fetch(array('products_id'=>$ID, 'shortkey'=>$shortkey));
- return ((!$shortkey)? $product : self::CleanKey($product));
+ // put all val origin module in current result
+ foreach($product['mod'] as $submod=>$array)
+ foreach($array as $key=>$val)
+ $product[$key] = $val;
+
+
+ return ((!$shortkey)? $product : self::CleanKey($product) );
// if($num == 1){
// $result=$res->fetchAssoc();
// return self::CleanKey($result);
@@ -446,15 +470,12 @@
@brief
@return array product empty
*/
- public static function Specimen(){
+ public static function Specimen($shortkey=false){
$par = array(
'products_id' => '', // auto incremente
'products_type' => '', // int (0 : default)
+ 'products_ref' => '', // auto incremente
- 'products_name' => '', // depend language table
- 'products_description' => '', // depend language table
- 'products_url' => '',
-
'products_quantity' => '',
'products_quantity_alert' => '',
@@ -462,6 +483,7 @@
'products_image' => array(),
'products_price' => '',
+ 'products_price_gross'=>'',
'products_tax_class_id' => '',
'products_weight' => '',
@@ -473,10 +495,17 @@
'products_status' => 0,
'manufacturers_id' => '',
- 'products_ordered' => 0
+ 'products_ordered' => 0,
+
+ 'lg' =>array(
+ array(
+ 'products_name' => '', // depend language table
+ 'products_description' => '', // depend language table
+ 'products_url' => '',
+ ),
+ ),
);
-
- return self::CleanKey($par);
+ return ((!$shortkey)? $par : self::CleanKey($par) );
}
Modified: trunk/catalog/admin/includes/gabarit/products/display_view.edit.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/products/display_view.edit.gab 2013-09-19 16:46:15 UTC (rev 4833)
+++ trunk/catalog/admin/includes/gabarit/products/display_view.edit.gab 2013-09-20 07:25:35 UTC (rev 4834)
@@ -39,7 +39,7 @@
<fieldset class="block_field">
<ul>
<li class="block_input">
- <?php echo products::DisplayField('ref', '%s')/* )*/; ?>
+ <?php echo products::DisplayField('ref', '%s'); ?>
</li>
<?php if(products::CheckClassProduct('CLASS_MODELE')): ?>
Modified: trunk/catalog/admin/includes/languages/fr_FR/modules/pages/cms_content.txt
===================================================================
--- trunk/catalog/admin/includes/languages/fr_FR/modules/pages/cms_content.txt 2013-09-19 16:46:15 UTC (rev 4833)
+++ trunk/catalog/admin/includes/languages/fr_FR/modules/pages/cms_content.txt 2013-09-20 07:25:35 UTC (rev 4834)
@@ -3,8 +3,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 30/03/2012, 09:32
+ @version 2.1.2
+ @date 20/09/2013, 09:32
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
*/
@@ -26,6 +26,7 @@
$lang['cms_content table heading categories']="Catégorie" ;
$lang['cms_content table heading categories id']="Cat. id" ;
$lang['cms_content table heading title']="Titre" ;
+ $lang['cms_content table heading text']="Texte" ;
$lang['cms_content table heading featured']="Mise en avant" ;
$lang['cms_content table heading featured id']="Mea.id" ;
$lang['cms_content table heading date_added']="Crée(s)" ;
@@ -34,9 +35,11 @@
$lang['cms_content table heading hidden']="Menu" ;
$lang['table heading action']="Action" ;
- /* alert */
- $lang['@cms_content update status']="Changement de l'état de la catégorie" ;
- $lang['@cms_content update visibility']="Changement de la visibilité de la catégorie" ;
+ /* MessageStack */
+ $lang['@cms_content error in update process']="Erreur lors de l'enregsitrement de la page" ;
+ $lang['@cms_content success in update process']="Mise à jour reussie" ;
+ $lang['@cms_content update status']="Changement de l'état de la page" ;
+ $lang['@cms_content update visibility']="Changement de la visibilité de la page" ;
/* Bouton */
$lang['add category datatype content']="Ajouter une catégorie" ;
Modified: trunk/catalog/admin/includes/languages/fr_FR/modules/pages/customers.txt
===================================================================
--- trunk/catalog/admin/includes/languages/fr_FR/modules/pages/customers.txt 2013-09-19 16:46:15 UTC (rev 4833)
+++ trunk/catalog/admin/includes/languages/fr_FR/modules/pages/customers.txt 2013-09-20 07:25:35 UTC (rev 4834)
@@ -3,8 +3,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 06/04/2012, 22:00
+ @version 2.1.2
+ @date 20/09/2013, 09:32
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
*/
@@ -134,9 +134,10 @@
/* MessageStack */
$lang['@customers update confirm status customers']="Mise à jour de l'état de 'confirmé' " ;
$lang['@customers update status customers']="Mise à jour de l'état " ;
+ $lang['@customers error in update process']="Erreur lors de l'enregsitrement du client/membre" ;
+ $lang['@customers success in update process']="Mise à jour reussie" ;
-
/* js alert */
$lang['js gender']="* La valeur de 'Genre' doit être choisie." ;
$lang['js first_name']="* L'entrée 'Prénom' doit avoir au moins %s caractères." ;
Modified: trunk/catalog/admin/includes/languages/fr_FR/modules/pages/products.txt
===================================================================
--- trunk/catalog/admin/includes/languages/fr_FR/modules/pages/products.txt 2013-09-19 16:46:15 UTC (rev 4833)
+++ trunk/catalog/admin/includes/languages/fr_FR/modules/pages/products.txt 2013-09-20 07:25:35 UTC (rev 4834)
@@ -3,8 +3,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 30/03/2012, 09:32
+ @version 2.1.2
+ @date 20/09/2013, 09:32
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
*/
@@ -76,6 +76,7 @@
$lang['products table heading status']="Etat" ;
$lang['products table heading stock']="Stock" ;
$lang['products table heading price']="Prix" ;
+ $lang['products table heading price gross']="Prix TTC" ;
$lang['products table heading price ttx']="Prix TTC" ;
$lang['products table heading type']="Type" ;
$lang['products table heading weight']="Poids" ;
@@ -95,6 +96,7 @@
$lang['products table heading available']="Dispo." ;
$lang['products table heading taxe id']="Tax.id" ;
$lang['products table heading track_stock']="Mode stock" ;
+ $lang['products table heading ordered']="Nbr. Cmd." ;
$lang['products table heading categories']="Catégories" ;
$lang['products table heading categories id']="Cat.id" ;
Modified: trunk/catalog/admin/includes/languages/fr_FR/modules/products/desc_base.txt
===================================================================
--- trunk/catalog/admin/includes/languages/fr_FR/modules/products/desc_base.txt 2013-09-19 16:46:15 UTC (rev 4833)
+++ trunk/catalog/admin/includes/languages/fr_FR/modules/products/desc_base.txt 2013-09-20 07:25:35 UTC (rev 4834)
@@ -3,8 +3,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 21/02/2012, 23:13
+ @version 2.1.2
+ @date 20/09/2013, 09:32
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
@sub-package desc_base
@@ -19,4 +19,8 @@
$lang['Description principale ']="Description principale " ;
$lang['text products url']="URL :" ;
$lang['text products url desc']="précisez un lien plus detaillé vers un site, un fabricants, un blog ... pour la langue %s" ;
+
+$lang['products table heading chapo']="Chapeau" ;
+$lang['products table heading description']="Desc." ;
+$lang['products table heading url']="URL" ;
?>
\ No newline at end of file
Modified: trunk/catalog/admin/includes/template/defaut/css/less/datatable.less
===================================================================
--- trunk/catalog/admin/includes/template/defaut/css/less/datatable.less 2013-09-19 16:46:15 UTC (rev 4833)
+++ trunk/catalog/admin/includes/template/defaut/css/less/datatable.less 2013-09-20 07:25:35 UTC (rev 4834)
@@ -192,7 +192,25 @@
}
}
- tfoot tr td input {width:80%;text-align:left;}
+ tfoot{
+
+ a.button,
+ select.button,
+ input.button,
+ button.button {
+ background:none;
+ border:none;
+ .box-shadow(0 0 0 rgba(0,0,0,0));
+ .rounded(0);
+
+ &:hover{
+ background:none;
+ border:none;
+ }
+ }
+
+ tr td input {width:80%;text-align:left;}
+ }
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2013-09-19 16:46:18
|
Revision: 4833
http://sourceforge.net/p/oscss/svn/4833
Author: oscim
Date: 2013-09-19 16:46:15 +0000 (Thu, 19 Sep 2013)
Log Message:
-----------
clean process for construct and manage fields in modules/page
Add class for centralise editing and display forms
implement jeditable in datatable listing
adjust sub module porduct
Modified Paths:
--------------
trunk/catalog/admin/includes/classes/ModTwo.php
trunk/catalog/admin/includes/gabarit/configuration/modprodextra/draw.label.edit.gab
trunk/catalog/admin/includes/gabarit/products/display_view.edit.gab
trunk/catalog/admin/includes/header.php
trunk/catalog/admin/includes/modules/pages/cms_content.php
trunk/catalog/admin/includes/modules/pages/customers.php
trunk/catalog/admin/includes/modules/pages/products.php
trunk/catalog/admin/includes/modules/products/desc_base.php
trunk/catalog/admin/includes/modules/products/products_extra.php
trunk/catalog/common/classes/ExtraUtility.php
trunk/catalog/common/classes/formUtility.php
trunk/catalog/install/includes/sql/mysql/tables/osc_products_extra_fields_values.key.sql
trunk/extensions/ECOTAX_stable/catalog/admin/includes/modules/products/ecotax.php
Added Paths:
-----------
trunk/catalog/admin/includes/javascript/jquery.dataTables.editable.js
trunk/catalog/admin/includes/javascript/jquery.jeditable.mini.js
trunk/catalog/common/classes/FieldsDisplay.php
Modified: trunk/catalog/admin/includes/classes/ModTwo.php
===================================================================
--- trunk/catalog/admin/includes/classes/ModTwo.php 2013-09-16 06:39:43 UTC (rev 4832)
+++ trunk/catalog/admin/includes/classes/ModTwo.php 2013-09-19 16:46:15 UTC (rev 4833)
@@ -89,8 +89,11 @@
@var array for stock generic filter activate
*/
protected static $generictfilter = array();
+ /**
+ @var objet $Info
+ */
+ public static $Info;
-
/**
@brief standart class exe action in module
If use "action" in var (POST or GET), this function is loaded
@@ -276,7 +279,8 @@
*/
public static function tep_get_modele(){
$params = func_get_args();
-
+// print_r(self::$InitInfo);
+// exit;
$action=(empty(self::$action)? 'listing' :self::$action);
$param=(!isset($params[0][0])? 'modele' :$params[0][0]);
@@ -372,6 +376,8 @@
$_SESSION['filters'][self::$code]['subtype'][$key] = 'on';
}
+
+ self::$modules->__call('check_action', array('action'=>'ModTwofilters'));
}
/**
@brief Construct base transversal data object
@@ -410,6 +416,9 @@
}
+
+ self::$InitInfo['edit']['listing'] = array();
+
/**
@remarks Active forms filter
*/
@@ -558,10 +567,29 @@
$clean = substr($key, (strpos($key, '.')+1));
if(is_array($row)){
- $txt = $row['text'];
+ $txt = (isset($row['text_short'])? $row['text_short'] : $row['text']) ;
$alias = (isset($row['alias'])? $row['alias'] : $clean);
- $css = (isset($row['class'])? $row['class'] : 'tcenter');
+ $css = (isset($row['class'])? $row['class'] : 'tleft')
+ // add css class for jseditable
+ .(isset($row['edit'])? ' edit_dbclick': '' );
$width = (isset($row['width'])? $row['width'] : '5%');
+
+ // construct array base define container edited fields
+ if(isset($row['edit']) ){
+ $row['edit']['col_name'] = $key;
+ $row['edit']['alias'] = $alias;
+ if(!isset($row['edit']['class'])) $row['edit']['class'] = $css;
+ $row['edit']['text'] = (isset($row['text'])? $row['text'] : $row['text_short']) ;
+
+
+ // put for all other context
+ self::$InitInfo['edit']['listing']['edit_'.$alias] = $row['edit'];
+ self::$InitInfo['edit']['multi']['edit_'.$alias] = $row['edit'];
+ self::$InitInfo['edit']['listing_edit']['edit_'.$alias] = $row['edit'];
+
+// unset($row['edit']);
+ }
+
}
else{
$txt = $row;
@@ -588,13 +616,14 @@
self::$InitInfo['modele2']['listing'][$alias]=$row; //((isset($row['sort']) && $row['sort'] == true) ? true : false );
if($clean !=$alias)
- $listfield .=$key.' as '.$alias.',';
+ $listfield .=(!is_int($key)? $key : "''").' as '.$alias.',';
else
$listfield .=$key.',';
$i++;
}
}
+
self::$InitInfo['modele']['listing']['action']=false;
self::$InitInfo['theader']['listing']['action']= array( 'class'=>'row_action', 'txt'=>__('@'.self::$code.' table heading action') );
self::$InitInfo['tfooter']['listing']['action']= array( 'class'=>'row_action', 'txt'=>__('@'.self::$code.' table heading action') );
@@ -620,11 +649,14 @@
if($am !=false)
self::$InitInfo['tfooter']['listing_multi'][] = array( 'colspan' => ($i+1), 'class'=>'row_action', 'txt'=> $am);
- foreach(self::$allfields as $row)
- if(isset($row['edit']) )
- self::$InitInfo['edit']['listing'][] = $row;
-
- reset(self::$allfields);
+ // construct array base define container edited fields
+// foreach(self::$allfields as $key=>$row)
+// if(isset($row['edit']) ){
+// $row['col_name'] = $key;
+// self::$InitInfo['edit']['listing'][$key] = $row;
+// }
+//
+// reset(self::$allfields);
}
self::$InitInfo['allfields']['listing'] = self::$allfields ;
@@ -663,7 +695,59 @@
return $listfield;
}
+
/**
+ @brief return define container for Fields
+ @param $key string alias or name of field
+ @return bool flase or array
+ */
+ public static function GetEditFieldsDefine($key){
+ if(isset(self::$InitInfo['edit']['listing']['edit_'.$key] ) )
+ return self::$InitInfo['edit']['listing']['edit_'.$key];
+
+ return false;
+ }
+
+ /**
+ @brief return value Fields
+ @param $key string alias or name of field
+ @return bool flase or array
+ */
+ public static function GetValue($key, $obj=false){
+ if(!$obj)
+ $obj = self::$Info;
+
+ if(is_array($obj))
+ $obj = new arrayInfo($obj);
+
+ $edit = 'edit_'.$key;
+ if(isset($obj->$edit))
+ return @$obj->$edit->input_value ;
+ else
+ return @$obj->$key ;
+ }
+
+ /**
+ @brief return Fields
+ @param $key string alias or name of field
+ @return bool flase or array
+ */
+ public static function DisplayField($key, $format = '<p class="block_input input-one">%s</p>', $obj=false){
+ if(!$obj)
+ $obj = self::$Info;
+
+ if(is_array($obj))
+ $obj = new arrayInfo($obj);
+
+ $edit = ((substr($key,0,5) !='edit_' ) ? 'edit_'.$key : $key);
+
+ if(isset($obj->$edit))
+ return FieldsDisplay::DisplayRow($obj->$edit, (( self::$action!='noedit')? false : true ), $format) ;
+ else
+ return '';
+ }
+
+ /**
@brief return classs name
*/
public static function GetClassName(){
Modified: trunk/catalog/admin/includes/gabarit/configuration/modprodextra/draw.label.edit.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/configuration/modprodextra/draw.label.edit.gab 2013-09-16 06:39:43 UTC (rev 4832)
+++ trunk/catalog/admin/includes/gabarit/configuration/modprodextra/draw.label.edit.gab 2013-09-19 16:46:15 UTC (rev 4833)
@@ -116,7 +116,7 @@
<div class="button_nav">
- <?php echo tep_image_submit('button_save.gif', IMAGE_SAVE) . ' <a class="button" href="' . tep_href_link(FILENAME_CONFIGURATION, FILENAME_CFG_34. '&eid=' . modprodextra::$eid) . '">' . IMAGE_CANCEL . "</a>\n" ?>
+ <?php echo tep_image_submit('button_save.gif', IMAGE_SAVE) . ' <a class="button" href="' . tep_href_link(FILENAME_CONFIGURATION, FILENAME_CFG_34. '&eid=' . modprodextra::$eid) . '">' . IMAGE_CLOSE . "</a>\n" ?>
</div>
<br class="clear" />
Modified: trunk/catalog/admin/includes/gabarit/products/display_view.edit.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/products/display_view.edit.gab 2013-09-16 06:39:43 UTC (rev 4832)
+++ trunk/catalog/admin/includes/gabarit/products/display_view.edit.gab 2013-09-19 16:46:15 UTC (rev 4833)
@@ -9,7 +9,9 @@
@encode UTF-8
*/
global $currencies;
+
?>
+
<h3><?php echo __('heading title edit'); ?></h3>
@@ -31,52 +33,38 @@
<div class="edit box_left w_70">
<div id="tabs-1" class="tabPage">
+ <?php echo products::DisplayField('name'); ?>
- <fieldset class="tabs_lang block_field">
- <ul>
- <?php for ($i=0, $n=sizeof(products::$languages); $i<$n; $i++) { ?>
- <li><?php echo '<a href="#products_name-' . ($i+1).'" title="'.products::$languages[$i]['name'].'">' . tep_language_image( products::$languages[$i]['directory'] . '/images/' . products::$languages[$i]['image'], products::$languages[$i]['name']). '</a>' ?></li>
- <?php } ?>
- </ul>
- <?php for ($i=0, $n=sizeof(products::$languages); $i<$n; $i++) {?>
- <ul id="<?php echo 'products_name-'.($i+1) ?>">
- <li class="block_input">
- <label for="<?php echo 'products_name_' . products::$languages[$i]['id']; ?>"><?php echo __('text products name'); ?></label>
- <?php echo tep_draw_input_field('products_name[' . products::$languages[$i]['id'] . ']', 'products_name_' . products::$languages[$i]['id'], (isset($products_name[products::$languages[$i]['id']]) ? stripslashes($products_name[products::$languages[$i]['id']]) : tep_get_products_name(products::$Info->products_id, products::$languages[$i]['id']))).'<span class="required">*</span>'; ?>
- </li>
- </ul>
- <?php } ?>
- </fieldset>
<fieldset class="block_field">
<ul>
<li class="block_input">
- <label class="inline" for="products_ref" title="<?php echo __('@products text ref help'); ?>"><?php echo __('@products text ref'); ?></label>
- <?php echo (tep_not_null(products::$Info->products_ref)? products::$Info->products_ref : tep_draw_input_field('products_ref','', products::$Info->products_ref,'',true) ); ?>
+ <?php echo products::DisplayField('ref', '%s')/* )*/; ?>
+
</li>
<?php if(products::CheckClassProduct('CLASS_MODELE')): ?>
<li class="block_input">
- <label class="inline" for="products_model" title="<?php echo __('@products text model help'); ?>"><?php echo __('@products text model'); ?></label>
- <?php echo tep_draw_input_field('products_model','', products::$Info->products_model); ?>
+ <?php echo products::DisplayField('model', '%s'); ?>
</li>
<?php endif; ?>
<?php if(products::CheckClassProduct('CLASS_SORTORDER')): ?>
<li class="block_input">
+<?php /*
<label class="inline" for="products_ordered"><?php echo __('text products ordered'); ?></label>
<?php echo tep_draw_input_field('products_ordered','', products::$Info->products_ordered); ?>
+ */ ?>
+ <?php //echo products::DisplayField('ordered', '%s'); ?>
</li>
<?php endif; ?>
<li class="block_input">
- <label class="inline" for="products_barcode_type"><?php echo __('@products text codebarre type'); ?></label>
- <?php echo tep_draw_pull_down_menu('products_barcode_type', products::$barcode_type_array, products::$Info->products_barcode_type, ''); ?>
+ <?php echo products::DisplayField('barcode_type', '%s'); ?>
</li>
<li class="block_input">
- <label class="inline" for="products_barcode"><?php echo __('@products text codebarre'); ?></label>
- <?php echo tep_draw_input_field('products_barcode','', products::$Info->products_barcode); ?>
+ <?php echo products::DisplayField('barcode', '%s'); ?>
</li>
- <?php foreach (products::$modules->__call('display_inline',array('flag'=>'general','pid'=> products::$Info->products_id)) as $value){ $title[]=$value['title']; $text[]=$value['text']; } ?>
+ <?php foreach (products::$modules->__call('display_inline',array('flag'=>'general','pid'=> products::$Info->id)) as $value){ $title[]=$value['title']; $text[]=$value['text']; } ?>
<?php if(isset($title) && is_array($title)): ?>
<?php $i=0; foreach ($text as $item): ?>
<li><?php echo $item; ?></li>
@@ -93,18 +81,15 @@
<ul>
<li style="clear:both"></li>
<li class="block_input">
- <label class="inline" for="products_tax_class_id"><?php echo __('text products tax class'); ?></label>
- <?php echo tep_draw_pull_down_menu('products_tax_class_id', products::$tax_class_array, products::$Info->products_tax_class_id, '', true); ?>
+ <?php echo products::DisplayField('tax_class_id', '%s'); ?>
</li>
<li class="block_input">
<div class="fleft w_50">
- <label class="inline" for="products_price"><?php echo __('text products price net'); ?></label>
- <?php echo tep_draw_input_field('products_price','', products::$Info->products_price, ' class="price" style=" " size="16" ', true); ?>
+ <?php echo products::DisplayField('price', '%s'); ?>
</div>
<div class="fleft w_50">
- <label class="inline" for="products_price_gross"><?php echo __('text products price gross'); ?></label>
- <?php echo tep_draw_input_field('products_price_gross','', (string)tep_add_tax(products::$Info->products_price, tep_get_tax_rate(products::$Info->products_tax_class_id)) , ' class="price" style=" " size="16" '); ?>
+ <?php echo products::DisplayField('price_gross', '%s'); ?>
</div>
</li>
@@ -113,9 +98,9 @@
@brief Call variation price for products
*/
?>
- <?php foreach (products::$modules->__call('display_inline',array('flag'=>'price','pid'=> products::$Info->products_id)) as $value){ $title[]=$value['title']; $text[]=$value['text']; } ?>
+ <?php foreach (products::$modules->__call('display_inline',array('flag'=>'price','pid'=> products::$Info->id)) as $value){ $title[]=$value['title']; $text[]=$value['text']; } ?>
- <?php if( (isset($title) && is_array($title)) || isset(products::$Info->products_sppc) ): ?>
+ <?php if( (isset($title) && is_array($title)) || isset(products::$Info->sppc) ): ?>
<li class="block_input">
<fieldset class="block_field">
@@ -123,9 +108,8 @@
<div class="tirroir tabs">
<ul class="w_100">
-
<?php if(isset($title) && is_array($title)): ?>
- <?php if (isset(products::$Info->products_sppc)): ?>
+ <?php if (isset(products::$Info->sppc)): ?>
<li><a href="#products_price-<?php echo 0; ?>"><?php echo __('text customers groups note').tep_image(DIR_WS_ICONS.'icon_help.gif', __('text customers groups note detail')) ?></a></li>
<?php endif; ?>
@@ -133,24 +117,20 @@
<li><a href="#products_price-<?php echo $i++; ?>"><?php echo $item; ?></a></li>
<?php endforeach ; ?>
<?php endif; ?>
-
-
-
</ul>
<ul class="w_100">
-
<?php if(isset($title) && is_array($title)): ?>
<?php $i=1; foreach ($text as $item): ?>
<li id="products_price-<?php echo $i++; ?>"><?php echo $item; ?></li>
<?php endforeach ; ?>
<?php endif; ?>
- <?php if (isset(products::$Info->products_sppc)): ?>
+ <?php if (isset(products::$Info->sppc)): ?>
<li id="products_price-0" class="w_100">
<ul class="clear w_100">
- <?php foreach (products::$Info->products_sppc as $sppcGpId => $sppcInfos): ?>
+ <?php foreach (products::$Info->sppc as $sppcGpId => $sppcInfos): ?>
<li class="block_input price">
<label class="inline" for="<?php echo 'sppcprice_' . $sppcGpId; ?>">
<?php echo $sppcInfos['sppcname']; ?>
@@ -184,28 +164,22 @@
</fieldset>
<?php endif; ?>
-<?php
+ <?php if( ! in_array( products::GetValue('type'), explode(',',TYPE_VIRTUAL_PRODUCTS)) ) : // physical product ?>
-// print_r(products::$Info->products_images);
-
-?>
- <?php if( ! in_array(products::$Info->products_type , explode(',',TYPE_VIRTUAL_PRODUCTS)) ) : // physical product ?>
-
<?php if( _cst_bool('STOCK_CHECK') && products::CheckClassProduct('CLASS_STOCK')): /** Si Class de stock defini, les prix sont pris en charge par un onglet */ ?>
<fieldset class="block_field">
<legend><?php echo __('@products text legend stock'); ?></legend>
<div class="block_input">
<p>
- <label class="inline"><?php echo __('@products text label stock'); ?></label>
- <?php echo tep_draw_pull_down_menu('track_stock', products::$track_stock , products::$Info->track_stock); ?>
+ <?php echo products::DisplayField('track_stock', '%s'); ?>
</p>
<div id="products_quantity_block">
<?php if(products::$product_investigation['has_tracked_options'] or products::$product_investigation['stock_entries_count'] > 0) :?>
- <a class="button fancyView iframe" href="<?php echo tep_href_link(FILENAME_STOCK, 'product_id=' . products::$Info->products_id.'&origin='.tep_href_link(products::FILENAME))?>"><?php echo __('txt stock') ?></a>
+ <a class="button fancyView iframe" href="<?php echo tep_href_link(FILENAME_STOCK, 'product_id=' . products::$Info->id.'&origin='.tep_href_link(products::FILENAME))?>"><?php echo __('txt stock') ?></a>
<?php else: ?>
<p>
<label class="inline" for="products_quantity"><?php echo __('text products quantity'); ?></label>
- <?php echo tep_draw_input_field('products_quantity','', products::$Info->products_quantity, ((products::$Info->track_stock==0)? 'disabled="disabled"' :'') ) ; ?>
+ <?php echo tep_draw_input_field('products_quantity','', products::$Info->quantity, ((products::$Info->track_stock==0)? 'disabled="disabled"' :'') ) ; ?>
</p>
<?php endif; ?>
</div>
@@ -221,8 +195,7 @@
<legend><?php echo __('@products text legend shipping'); ?></legend>
<ul>
<li class="block_input">
- <label class="inline" for="products_weight" title="<?php echo __('@products text weight help'); ?><"><?php echo __('@products text weight'); ?></label>
- <?php echo tep_draw_input_field('products_weight','', products::$Info->products_weight).' '.UNIT_WEIGHT_NAME; ?>
+ <?php echo products::DisplayField('weight', '%s'); ?>
</li>
</ul>
</fieldset>
@@ -232,10 +205,12 @@
<fieldset class="block_field">
<legend><?php echo __('@products text legend shipping'); ?></legend>
<ul>
+ <?php /*
<li class="block_input">
<label class="inline" for="products_weight" title="<?php echo __('@products text weight help'); ?><"><?php echo __('@products text weight'); ?></label>
<?php echo tep_draw_input_field('products_weight','', products::$Info->products_weight).' '.UNIT_WEIGHT_NAME; ?>
</li>
+ */ ?>
</ul>
</fieldset>
<?php endif; ?>
@@ -264,6 +239,7 @@
<fieldset class="block_field">
<legend>
<?php echo __('text legend image'); ?>
+<?php /*
<span class="button_nav">
<a
class="buttonimg browser"
@@ -273,18 +249,20 @@
><?php echo tep_image(DIR_WS_ICONS.'icon_add_new.png' ) ?>
</a>
</span>
+*/ ?>
</legend>
<dl>
- <?php /*if(count(products::$Info->products_images) <=1) :?>
+ <?php if(count(products::$Info->images) <=1) :?>
<dt class="block_input">
- <p class="new_product_img" ><?php echo tep_info_image(products::$Info->products_image, products::$Info->products_image, TEMP_BO_HEADING_IMAGE_WIDTH, TEMP_BO_HEADING_IMAGE_HEIGHT, 'class="new_product_img" id="products_imageimg"'); ?></p>
+ <p class="new_product_img" ><?php echo tep_info_image(products::$Info->image, products::$Info->image, TEMP_BO_HEADING_IMAGE_WIDTH, TEMP_BO_HEADING_IMAGE_HEIGHT, 'class="new_product_img" id="products_imageimg"'); ?></p>
</dt>
<?php if(products::CheckClassProduct('CLASS_IMAGE')): ?>
<dt class="block_input">
- <?php echo '<a class="button browser" href="#" onclick="'.tep_get_filebroswerserveur("products_image", "image", '').'return false;">'.tep_draw_input_field('products_image','', products::$Info->products_image ).' '.tep_image(DIR_WS_ICONS . 'icon_browser.png', PARCOURIR_SERVER) .'</a>'; ?>
+ <?php echo '<a class="button browser" href="#" onclick="'.tep_get_filebroswerserveur("products_image", "image", '').'return false;">'.tep_draw_input_field('products_image','', products::$Info->image ).' '.tep_image(DIR_WS_ICONS . 'icon_browser.png', PARCOURIR_SERVER) .'</a>'; ?>
</dt>
<?php endif; ?>
- <?php else:*/ ?>
+ <?php else: ?>
+<?php /*
<dt class="block_input">
<?php foreach(products::$Info->products_images as $i=>$row_img): ?>
<p class="new_product_img multi" >
@@ -308,10 +286,11 @@
</p>
<?php endforeach; ?>
</dt>
+*/ ?>
<dt class="block_input">
- <?php echo /*'<a class="button browser" href="#" onclick="'.tep_get_filebroswerserveur("products_image", "image", '').'return false;">'.*/tep_draw_input_field('products_image','', products::$Info->products_image )/*.' '.tep_image(DIR_WS_ICONS . 'icon_browser.png', PARCOURIR_SERVER) .'</a>'*/; ?>
+ <?php echo '<a class="button browser" href="#" onclick="'.tep_get_filebroswerserveur("products_image", "image", '').'return false;">'.tep_draw_input_field('products_image','', products::$Info->products_image ).' '.tep_image(DIR_WS_ICONS . 'icon_browser.png', PARCOURIR_SERVER) .'</a>'; ?>
</dt>
- <?php /*endif;*/ ?>
+ <?php endif; ?>
</dl>
</fieldset>
@@ -320,14 +299,13 @@
<dd class="block_input">
<p>
- <label><?php echo __('@products text status'); ?></label>
- <?php echo tep_draw_radio_field('products_status', 'products_status_1', '1', products::$in_status,'','class="radio"') . __('@products text status on') . tep_draw_radio_field('products_status', 'products_status_0', '0', products::$out_status,'','class="radio"') . __('@products text status off'); ?>
+ <?php echo products::DisplayField('status', '%s'); ?>
</p>
<?php if(products::CheckClassProduct('CLASS_DATE_AVAIBLE')): ?>
<p>
<label class="inline" for="products_date_available" title="<?php echo __('@products text date available help') ?>"><?php echo __('@products text date available'); ?></label>
- <?php echo tep_draw_input_field('products_date_available', '',( (tep_not_null(products::$Info->products_date_available) && !in_array(products::$Info->products_date_available, array('0000-00-00 00:00:00', '1000-01-01 00:00:00') ) ) ? tep_date_short(products::$Info->products_date_available) : ''), ' maxlength="10" size="10" style="min-width:30px;" ') . tep_draw_hidden_field('bt_products_date_available') . ' ' . __('@products display date format'); ?>
+ <?php echo tep_draw_input_field('products_date_available', '',( (tep_not_null(products::$Info->date_available) && !in_array(products::$Info->date_available, array('0000-00-00 00:00:00', '1000-01-01 00:00:00') ) ) ? tep_date_short(products::$Info->date_available) : ''), ' maxlength="10" size="10" style="min-width:30px;" ') . tep_draw_hidden_field('bt_products_date_available') . ' ' . __('@products display date format'); ?>
</p>
<?php endif; ?>
</dd>
Modified: trunk/catalog/admin/includes/header.php
===================================================================
--- trunk/catalog/admin/includes/header.php 2013-09-16 06:39:43 UTC (rev 4832)
+++ trunk/catalog/admin/includes/header.php 2013-09-19 16:46:15 UTC (rev 4833)
@@ -9,7 +9,7 @@
@encode UTF-8
@brief block in balise html head.
*/
-
+ global $languages_id;
/**
* Placer ici les codes necessitant un chargement entre les balise head de chacune des pages. Ces codes seront chargée systématqiuement, et quelque soit le template
*/
@@ -36,6 +36,10 @@
tep_include_file (DIR_WS_JS."jquery.dataTables.min.js",true);
+ tep_include_file (DIR_WS_JS."jquery.jeditable.mini.js",true);
+
+ tep_include_file (DIR_WS_JS."jquery.dataTables.editable.js",true);
+
if(defined('JSONSTATMENT')){
//! plugin add tools table
tep_include_file (DIR_WS_JS."dataTables.TableTools/ZeroClipboard/ZeroClipboard.js",true);
@@ -138,9 +142,15 @@
"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') ); ?>
+ $col2=call_user_func(array(tep_extrac_querystring(JSONSTATMENT,'type'), 'tep_get_modele'), array('modele2') ); /*print_r($col); print_r($col2);
+exit; */ ?>
+
<?php $i=0; foreach($col as $k=>$row):
+
+
echo ' { ';
+ if(isset($col2[$k]['edit']['input_name']) ) echo "sName: '".trim($col2[$k]['edit']['input_name'])."',\n";
+// if(is_string($k) )echo ' "mData": "'.$k.'", '."\n";
echo ' "bSortable": '.((isset($col2[$k]['sort']) && $col2[$k]['sort'] !=false) ? 'true' : 'false' ).' '."\n";
if(isset($col2[$k]['class']))
echo ', "sClass": "'.$col2[$k]['class'].'" ';
@@ -153,15 +163,19 @@
],
<?php if(defined('AJAXSTATMENTDETAIL')) : ?>
- "fnDrawCallback": fnOpenClose,
+ "fnDrawCallback": function () {
+ fnOpenClose();
+ },
"fnRowCallback": function( nRow, aData, iDisplayIndex ) {
+
/* Append img in row */
$('td:eq(0)', nRow).html( '<img class="imgDetail" src="<?php echo tep_get_http().DIR_WS_ADMIN.DIR_WS_ICONS ?>details_open.png">' );
return nRow;
},
<?php else: ?>
// "fnInitComplete":post_load_page(),
- "fnDrawCallback": post_load_page,
+ "fnDrawCallback": function () {
+ },
<?php endif; ?>
"sAjaxSource": "<?php echo tep_get_http().DIR_WS_ADMIN ?>ajax.php?class=dataTableJsonStatment&funct=listItem&forceajax=true<?php echo '&'.JSONSTATMENT ?>",
@@ -182,9 +196,70 @@
"success": fnCallback
} );
}
- } );
+ } )
+ .makeEditable({
+ sUpdateURL: '<?php echo tep_href_link(MGabCont::CallSt('GetFILENAME'), 'forceajax=true&action=update_cell&key='.$k) ?>',
+ fnShowError: function (message, action) {
+ },
+ fnEndProcessingMode: function () {
+ },
+ "aoColumns": [
+ <?php ?>
+ <?php if($col): ?>
+ <?php $i=0; foreach($col as $k=>$row):
+ if(isset($col2[$k]['edit']) ){
+ echo ' { '
+ ." event: 'click', \n"
+ ."loadtype: 'POST',\n"
+// ."tooltip: 'Click to select engine version',\n"
+ ."loadtext: 'loading...',\n";
+// if (isset($col2[$k]['edit']['active_value_language']) /*&& $col2[$k]['edit']['active_value_language']*/ )
+// echo "columnName: '".trim($col2[$k]['edit']['input_name'])."[".$languages_id."]',\n";
+// else
+ echo "columnName: '".trim($col2[$k]['edit']['input_name'])."',\n";
+ if( (isset($col2[$k]['edit']['input_type']) && (in_array($col2[$k]['edit']['input_type'], array('select', 'radio') ) )) ){
+
+
+ echo "type: 'select',\n";
+ echo "data: \"{ ";
+ if(isset($col2[$k]['edit']['select_values']) )
+ $vals = $col2[$k]['edit']['select_values'];
+ if(isset($col2[$k]['edit']['values_list']) )
+ $vals = $col2[$k]['edit']['values_list'];
+
+ $nb = count($vals );
+ $i=1;
+ foreach($vals as $l_v){
+ echo "'".$l_v['id']."' : '".$l_v['text']."' ";
+ if($i < $nb)
+ echo ", ";
+
+ $i++;
+ }
+
+
+ echo " }\", \n";
+
+ }
+
+ echo " onblur: 'cancel',
+ submit: 'Ok',\n";
+ echo ' },'."\n";
+ }
+ else
+ echo 'null,'."\n";
+ $i++; endforeach;
+ ?>
+ <?php endif; ?>
+ <?php ?>
+ ]
+ });
+
+
+
+
$('tfoot input').keyup( function () {
/* Filter on the column (the index) of this element */
oTable.fnFilter( this.value, $('tfoot input').index(this) );
Added: trunk/catalog/admin/includes/javascript/jquery.dataTables.editable.js
===================================================================
--- trunk/catalog/admin/includes/javascript/jquery.dataTables.editable.js (rev 0)
+++ trunk/catalog/admin/includes/javascript/jquery.dataTables.editable.js 2013-09-19 16:46:15 UTC (rev 4833)
@@ -0,0 +1,1382 @@
+/*
+* File: jquery.dataTables.editable.js
+* Version: 2.3.3.
+* Author: Jovan Popovic
+*
+* Copyright 2010-2012 Jovan Popovic, all rights reserved.
+*
+* This source file is free software, under either the GPL v2 license or a
+* BSD style license, as supplied with this software.
+*
+* This source file is distributed in the hope that it will be useful, but
+* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+* or FITNESS FOR A PARTICULAR PURPOSE.
+*
+* Parameters:
+* @sUpdateURL String URL of the server-side page used for updating cell. Default value is "UpdateData".
+* @sAddURL String URL of the server-side page used for adding new row. Default value is "AddData".
+* @sDeleteURL String URL of the server-side page used to delete row by id. Default value is "DeleteData".
+* @fnShowError Function function(message, action){...} used to show error message. Action value can be "update", "add" or "delete".
+* @sAddNewRowFormId String Id of the form for adding new row. Default id is "formAddNewRow".
+* @oAddNewRowFormOptions Object Options that will be set to the "Add new row" dialog
+* @sAddNewRowButtonId String Id of the button for adding new row. Default id is "btnAddNewRow".
+* @oAddNewRowButtonOptions Object Options that will be set to the "Add new" button
+* @sAddNewRowOkButtonId String Id of the OK button placed in add new row dialog. Default value is "btnAddNewRowOk".
+* @oAddNewRowOkButtonOptions Object Options that will be set to the Ok button in the "Add new row" form
+* @sAddNewRowCancelButtonId String Id of the Cancel button placed in add new row dialog. Default value is "btnAddNewRowCancel".
+* @oAddNewRowCancelButtonOptions Object Options that will be set to the Cancel button in the "Add new row" form
+* @sDeleteRowButtonId String Id of the button for adding new row. Default id is "btnDeleteRow".
+* @oDeleteRowButtonOptions Object Options that will be set to the Delete button
+* @sSelectedRowClass String Class that will be associated to the selected row. Default class is "row_selected".
+* @sReadOnlyCellClass String Class of the cells that should not be editable. Default value is "read_only".
+* @sAddDeleteToolbarSelector String Selector used to identify place where add and delete buttons should be placed. Default value is ".add_delete_toolbar".
+* @fnStartProcessingMode Function function(){...} called when AJAX call is started. Use this function to add "Please wait..." message when some button is pressed.
+* @fnEndProcessingMode Function function(){...} called when AJAX call is ended. Use this function to close "Please wait..." message.
+* @aoColumns Array Array of the JEditable settings that will be applied on the columns
+* @sAddHttpMethod String Method used for the Add AJAX request (default is 'POST')
+* @sAddDataType String Data type expected from the server when adding a row; allowed values are the same as those accepted by JQuery's "datatype" parameter, e.g. 'text' and 'json'. The default is 'text'.
+* @sDeleteHttpMethod String Method used for the Delete AJAX request (default is 'POST')
+* @sDeleteDataType String Data type expected from the server when deleting a row; allowed values are the same as those accepted by JQuery's "datatype" parameter, e.g. 'text' and 'json'. The default is 'text'.
+* @fnOnDeleting Function function(tr, id, fnDeleteRow){...} Function called before row is deleted.
+tr isJQuery object encapsulating row that will be deleted
+id is an id of the record that will be deleted.
+fnDeleteRow(id) callback function that should be called to delete row with id
+returns true if plugin should continue with deleting row, false will abort delete.
+* @fnOnDeleted Function function(status){...} Function called after delete action. Status can be "success" or "failure"
+* @fnOnAdding Function function(){...} Function called before row is added.
+returns true if plugin should continue with adding row, false will abort add.
+* @fnOnNewRowPosted Function function(data) Function that can override default function that is called when server-side sAddURL returns result
+You can use this function to add different behaviour when server-side page returns result
+* @fnOnAdded Function function(status){...} Function called after add action. Status can be "success" or "failure"
+* @fnOnEditing Function function(input){...} Function called before cell is updated.
+input JQuery object wrapping the input element used for editing value in the cell.
+returns true if plugin should continue with sending AJAX request, false will abort update.
+* @fnOnEdited Function function(status){...} Function called after edit action. Status can be "success" or "failure"
+* @sEditorHeight String Default height of the cell editors
+* @sEditorWidth String Default width of the cell editors
+* @oDeleteParameters Object Additonal objects added to the DELETE Ajax request
+* @oUpdateParameters Object Additonal objects added to the UPDATE Ajax request
+* @sIDToken String Token in the add new row dialog that will be replaced with a returned id of the record that is created eg DT_RowId
+* @sSuccessResponse String Text returned from the server if record is successfully deleted or edited. Default "ok"
+* @sFailureResponsePrefix String Prefix of the error message returned form the server during edit action
+*/
+(function ($) {
+
+ $.fn.makeEditable = function (options) {
+
+ var iDisplayStart = 0;
+
+ function fnGetCellID(cell) {
+ ///<summary>
+ ///Utility function used to determine id of the cell
+ ///By default it is assumed that id is placed as an id attribute of <tr> that that surround the cell (<td> tag). E.g.:
+ ///<tr id="17">
+ /// <td>...</td><td>...</td><td>...</td><td>...</td>
+ ///</tr>
+ ///</summary>
+ ///<param name="cell" type="DOM" domElement="true">TD cell refference</param>
+
+ return properties.fnGetRowID($(cell.parentNode));
+ }
+
+ function _fnSetRowIDInAttribute(row, id, overwrite) {
+ ///<summary>
+ ///Utility function used to set id of the row. Usually when a new record is created, added to the table,
+ ///and when id of the record is retrieved from the server-side.
+ ///It is assumed that id is placed as an id attribute of <tr> that that surround the cell (<td> tag). E.g.:
+ ///<tr id="17">
+ /// <td>...</td><td>...</td><td>...</td><td>...</td>
+ ///</tr>
+ ///This function is used when a datatable is configured in the server side processing mode or ajax source mode
+ ///</summary>
+ ///<param name="row" type="DOM" domElement="true">TR row where record is placed</param>
+
+ if (overwrite) {
+ row.attr("id", id);
+ } else {
+ if (row.attr("id") == null || row.attr("id") == "")
+ row.attr("id", id);
+ }
+ }
+
+ function _fnGetRowIDFromAttribute(row) {
+ ///<summary>
+ ///Utility function used to get id of the row.
+ ///It is assumed that id is placed as an id attribute of <tr> that that surround the cell (<td> tag). E.g.:
+ ///<tr id="17">
+ /// <td>...</td><td>...</td><td>...</td><td>...</td>
+ ///</tr>
+ ///This function is used when a datatable is configured in the standard client side mode
+ ///</summary>
+ ///<param name="row" type="DOM" domElement="true">TR row where record is placed</param>
+ ///<returns type="Number">Id of the row - by default id attribute placed in the TR tag</returns>
+
+ return row.attr("id");
+ }
+
+ function _fnSetRowIDInFirstCell(row, id) {
+ ///<summary>
+ ///Utility function used to set id of the row. Usually when a new record is created, added to the table,
+ ///and when id of the record is retrieved from the server-side).
+ ///It is assumed that id is placed as a value of the first <TD> cell in the <TR>. As example:
+ ///<tr>
+ /// <td>17</td><td>...</td><td>...</td><td>...</td>
+ ///</tr>
+ ///This function is used when a datatable is configured in the server side processing mode or ajax source mode
+ ///</summary>
+ ///<param name="row" type="DOM" domElement="true">TR row where record is placed</param>
+
+ $("td:first", row).html(id);
+ }
+
+
+ function _fnGetRowIDFromFirstCell(row) {
+ ///<summary>
+ ///Utility function used to get id of the row.
+ ///It is assumed that id is placed as a value of the first <TD> cell in the <TR>. As example:
+ ///<tr>
+ /// <td>17</td><td>...</td><td>...</td><td>...</td>
+ ///</tr>
+ ///This function is used when a datatable is configured in the server side processing mode or ajax source mode
+ ///</summary>
+ ///<param name="row" type="DOM" domElement="true">TR row where record is placed</param>
+ ///<returns type="Number">Id of the row - by default id attribute placed in the TR tag</returns>
+
+ return $("td:first", row).html();
+
+ }
+
+ //Reference to the DataTable object
+ var oTable;
+ //Refences to the buttons used for manipulating table data
+ var oAddNewRowButton, oDeleteRowButton, oConfirmRowAddingButton, oCancelRowAddingButton;
+ //Reference to the form used for adding new data
+ var oAddNewRowForm;
+
+ //Plugin options
+ var properties;
+
+ function _fnShowError(errorText, action) {
+ ///<summary>
+ ///Shows an error message (Default function)
+ ///</summary>
+ ///<param name="errorText" type="String">text that should be shown</param>
+ ///<param name="action" type="String"> action that was executed when error occured e.g. "update", "delete", or "add"</param>
+
+ alert(errorText);
+ }
+
+ function _fnStartProcessingMode() {
+ ///<summary>
+ ///Function that starts "Processing" mode i.e. shows "Processing..." dialog while some action is executing(Default function)
+ ///</summary>
+
+ if (oTable.fnSettings().oFeatures.bProcessing) {
+ $(".dataTables_processing").css('visibility', 'visible');
+ }
+ }
+
+ function _fnEndProcessingMode() {
+ ///<summary>
+ ///Function that ends the "Processing" mode and returns the table in the normal state(Default function)
+ ///It shows processing message only if bProcessing setting is set to true
+ ///</summary>
+
+ if (oTable.fnSettings().oFeatures.bProcessing) {
+ $(".dataTables_processing").css('visibility', 'hidden');
+ }
+ }
+
+ var sOldValue, sNewCellValue, sNewCellDislayValue;
+
+ function fnApplyEditable(aoNodes) {
+ ///<summary>
+ ///Function that applies editable plugin to the array of table rows
+ ///</summary>
+ ///<param name="aoNodes" type="Array[TR]">Aray of table rows <TR> that should be initialized with editable plugin</param>
+
+ if (properties.bDisableEditing)
+ return;
+ var oDefaultEditableSettings = {
+ event: 'dblclick',
+
+ "onsubmit": function (settings, original) {
+ sOldValue = original.revert;
+ sNewCellValue = null;
+ sNewCellDisplayValue = null;
+ iDisplayStart = fnGetDisplayStart();
+
+ if(settings.type == "text" || settings.type == "select" || settings.type == "textarea" )
+ {
+ var input = $("input,select,textarea", this);
+ sNewCellValue = $("input,select,textarea", $(this)).val();
+ if (input.length == 1) {
+ var oEditElement = input[0];
+ if (oEditElement.nodeName.toLowerCase() == "select" || oEditElement.tagName.toLowerCase() == "select")
+ sNewCellDisplayValue = $("option:selected", oEditElement).text(); //For select list use selected text instead of value for displaying in table
+ else
+ sNewCellDisplayValue = sNewCellValue;
+ }
+
+ if (!properties.fnOnEditing(input, settings, original.revert, fnGetCellID(original)))
+ return false;
+ var x = settings;
+
+ //2.2.2 INLINE VALIDATION
+ if (settings.oValidationOptions != null) {
+ input.parents("form").validate(settings.oValidationOptions);
+ }
+ if (settings.cssclass != null) {
+ input.addClass(settings.cssclass);
+ }
+ if(settings.cssclass == null && settings.oValidationOptions == null){
+ return true;
+ }else{
+ if (!input.valid() || 0 == input.valid())
+ return false;
+ else
+ return true;
+ }
+
+ }
+
+ properties.fnStartProcessingMode();
+ },
+ "submitdata": function (value, settings) {
+ //iDisplayStart = fnGetDisplayStart();
+ //properties.fnStartProcessingMode();
+ var id = fnGetCellID(this);
+ var rowId = oTable.fnGetPosition(this)[0];
+ var columnPosition = oTable.fnGetPosition(this)[1];
+ var columnId = oTable.fnGetPosition(this)[2];
+ var sColumnName = oTable.fnSettings().aoColumns[columnId].sName;
+ if (sColumnName == null || sColumnName == "")
+ sColumnName = oTable.fnSettings().aoColumns[columnId].sTitle;
+ var updateData = null;
+ if (properties.aoColumns == null || properties.aoColumns[columnId] == null) {
+ updateData = $.extend({},
+ properties.oUpdateParameters,
+ {
+ "id": id,
+ "rowId": rowId,
+ "columnPosition": columnPosition,
+ "columnId": columnId,
+ "columnName": sColumnName
+ });
+ }
+ else {
+ updateData = $.extend({},
+ properties.oUpdateParameters,
+ properties.aoColumns[columnId].oUpdateParameters,
+ {
+ "id": id,
+ "rowId": rowId,
+ "columnPosition": columnPosition,
+ "columnId": columnId,
+ "columnName": sColumnName
+ });
+ }
+ return updateData;
+ },
+ "callback": function (sValue, settings) {
+ properties.fnEndProcessingMode();
+ var status = "";
+ var aPos = oTable.fnGetPosition(this);
+
+ var bRefreshTable = !oSettings.oFeatures.bServerSide;
+ $("td.last-updated-cell", oTable.fnGetNodes( )).removeClass("last-updated-cell");
+ if(sValue.indexOf(properties.sFailureResponsePrefix)>-1)
+ {
+ oTable.fnUpdate(sOldValue, aPos[0], aPos[2], bRefreshTable);
+ $("td.last-updated-cell", oTable).removeClass("last-updated-cell");
+ $(this).addClass("last-updated-cell");
+ properties.fnShowError(sValue.replace(properties.sFailureResponsePrefix, "").trim(), "update");
+ status = "failure";
+ } else {
+
+ if (properties.sSuccessResponse == "IGNORE" ||
+ ( properties.aoColumns != null
+ && properties.aoColumns[aPos[2]] != null
+ && properties.aoColumns[aPos[2]].sSuccessResponse == "IGNORE") ||
+ (sNewCellValue == null) || (sNewCellValue == sValue) ||
+ properties.sSuccessResponse == sValue) {
+ if(sNewCellDisplayValue == null)
+ {
+ //sNewCellDisplayValue = sValue;
+ oTable.fnUpdate(sValue, aPos[0], aPos[2], bRefreshTable);
+ }else{
+ oTable.fnUpdate(sNewCellDisplayValue, aPos[0], aPos[2], bRefreshTable);
+ }
+ $("td.last-updated-cell", oTable).removeClass("last-updated-cell");
+ $(this).addClass("last-updated-cell");
+ status = "success";
+ } else {
+ oTable.fnUpdate(sOldValue, aPos[0], aPos[2], bRefreshTable);
+ properties.fnShowError(sValue, "update");
+ status = "failure";
+ }
+ }
+
+ properties.fnOnEdited(status, sOldValue, sNewCellDisplayValue, aPos[0], aPos[1], aPos[2]);
+ if (settings.fnOnCellUpdated != null) {
+ settings.fnOnCellUpdated(status, sValue, aPos[0], aPos[2], settings);
+ }
+
+ fnSetDisplayStart();
+ if (properties.bUseKeyTable) {
+ var keys = oTable.keys;
+ /* Unblock KeyTable, but only after this 'esc' key event has finished. Otherwise
+ * it will 'esc' KeyTable as well
+ */
+ setTimeout(function () { keys.block = false; }, 0);
+ }
+ },
+ "onerror": function () {
+ properties.fnEndProcessingMode();
+ properties.fnShowError("Cell cannot be updated", "update");
+ properties.fnOnEdited("failure");
+ },
+
+ "onreset": function(){
+ if (properties.bUseKeyTable) {
+ var keys = oTable.keys;
+ /* Unblock KeyTable, but only after this 'esc' key event has finished. Otherwise
+ * it will 'esc' KeyTable as well
+ */
+ setTimeout(function () { keys.block = false; }, 0);
+ }
+
+ },
+ "height": properties.sEditorHeight,
+ "width": properties.sEditorWidth
+ };
+
+ var cells = null;
+
+ if (properties.aoColumns != null) {
+
+ for (var iDTindex = 0, iDTEindex = 0; iDTindex < oSettings.aoColumns.length; iDTindex++) {
+ if (oSettings.aoColumns[iDTindex].bVisible) {//if DataTables column is visible
+ if (properties.aoColumns[iDTEindex] == null) {
+ //If editor for the column is not defined go to the next column
+ iDTEindex++;
+ continue;
+ }
+ //Get all cells in the iDTEindex column (nth child is 1-indexed array)
+ cells = $("td:nth-child(" + (iDTEindex + 1) + ")", aoNodes);
+
+ var oColumnSettings = oDefaultEditableSettings;
+ oColumnSettings = $.extend({}, oDefaultEditableSettings, properties.oEditableSettings, properties.aoColumns[iDTEindex]);
+ iDTEindex++;
+ var sUpdateURL = properties.sUpdateURL;
+ try {
+ if (oColumnSettings.sUpdateURL != null)
+ sUpdateURL = oColumnSettings.sUpdateURL;
+ } catch (ex) {
+ }
+ //cells.editable(sUpdateURL, oColumnSettings);
+ cells.each(function () {
+ if (!$(this).hasClass(properties.sReadOnlyCellClass)) {
+ $(this).editable(sUpdateURL, oColumnSettings);
+ }
+ });
+ }
+
+ } //end for
+ } else {
+ cells = $('td:not(.' + properties.sReadOnlyCellClass + ')', aoNodes);
+ cells.editable(properties.sUpdateURL, $.extend({}, oDefaultEditableSettings, properties.oEditableSettings));
+ }
+ }
+
+ function fnOnRowAdding(event) {
+ ///<summary>
+ ///Event handler called when a user click on the submit button in the "Add new row" form.
+ ///</summary>
+ ///<param name="event">Event that caused the action</param>
+
+ if (properties.fnOnAdding()) {
+ if (oAddNewRowForm.valid()) {
+ iDisplayStart = fnGetDisplayStart();
+ properties.fnStartProcessingMode();
+
+ if (properties.bUseFormsPlugin) {
+ //Still in beta(development)
+ $(oAddNewRowForm).ajaxSubmit({
+ dataType: 'xml',
+ success: function (response, statusString, xhr) {
+ if (xhr.responseText.toLowerCase().indexOf("error") != -1) {
+ properties.fnEndProcessingMode();
+ properties.fnShowError(xhr.responseText.replace("Error",""), "add");
+ properties.fnOnAdded("failure");
+ } else {
+ fnOnRowAdded(xhr.responseText);
+ }
+
+ },
+ error: function (response) {
+ properties.fnEndProcessingMode();
+ properties.fnShowError(response.responseText, "add");
+ properties.fnOnAdded("failure");
+ }
+ }
+ );
+
+ } else {
+
+ var params = oAddNewRowForm.serialize();
+ $.ajax({ 'url': properties.sAddURL,
+ 'data': params,
+ 'type': properties.sAddHttpMethod,
+ 'dataType': properties.sAddDataType,
+ success: fnOnRowAdded,
+ error: function (response) {
+ properties.fnEndProcessingMode();
+ properties.fnShowError(response.responseText, "add");
+ properties.fnOnAdded("failure");
+ }
+ });
+ }
+ }
+ }
+ event.stopPropagation();
+ event.preventDefault();
+ }
+
+ function _fnOnNewRowPosted(data) {
+ ///<summary>Callback function called BEFORE a new record is posted to the server</summary>
+ ///TODO: Check this
+
+ return true;
+ }
+
+
+ function fnOnRowAdded(data) {
+ ///<summary>
+ ///Function that is called when a new row is added, and Ajax response is returned from server
+ /// This function takes data from the add form and adds them into the table.
+ ///</summary>
+ ///<param name="data" type="int">Id of the new row that is returned from the server</param>
+
+ properties.fnEndProcessingMode();
+
+ if (properties.fnOnNewRowPosted(data)) {
+
+ var oSettings = oTable.fnSettings();
+ if (!oSettings.oFeatures.bServerSide) {
+ jQuery.data(oAddNewRowForm, 'DT_RowId', data);
+ var values = fnTakeRowDataFromFormElements(oAddNewRowForm);
+
+
+ var rtn;
+ //Add values from the form into the table
+ if (oSettings.aoColumns != null && isNaN(parseInt(oSettings.aoColumns[0].mDataProp))) {
+ rtn = oTable.fnAddData(rowData);
+ }
+ else {
+ rtn = oTable.fnAddData(values);
+ }
+
+ var oTRAdded = oTable.fnGetNodes(rtn);
+ //add id returned by server page as an TR id attribute
+ properties.fnSetRowID($(oTRAdded), data, true);
+ //Apply editable plugin on the cells of the table
+ fnApplyEditable(oTRAdded);
+
+ $("tr.last-added-row", oTable).removeClass("last-added-row");
+ $(oTRAdded).addClass("last-added-row");
+ } /*else {
+ oTable.fnDraw(false);
+ }*/
+ //Close the dialog
+ oAddNewRowForm.dialog('close');
+ $(oAddNewRowForm)[0].reset();
+ $(".error", $(oAddNewRowForm)).html("");
+
+ fnSetDisplayStart();
+ properties.fnOnAdded("success");
+ if (properties.bUseKeyTable) {
+ var keys = oTable.keys;
+ /* Unblock KeyTable, but only after this 'esc' key event has finished. Otherwise
+ * it will 'esc' KeyTable as well
+ */
+ setTimeout(function () { keys.block = false; }, 0);
+ }
+ }
+ }
+
+ function fnOnCancelRowAdding(event) {
+ ///<summary>
+ ///Event handler function that is executed when a user press cancel button in the add new row form
+ ///This function clean the add form and error messages if some of them are shown
+ ///</summary>
+ ///<param name="event" type="int">DOM event that caused an error</param>
+
+ //Clear the validation messages and reset form
+ $(oAddNewRowForm).validate().resetForm(); // Clears the validation errors
+ $(oAddNewRowForm)[0].reset();
+
+ $(".error", $(oAddNewRowForm)).html("");
+ $(".error", $(oAddNewRowForm)).hide(); // Hides the error element
+
+ //Close the dialog
+ oAddNewRowForm.dialog('close');
+ event.stopPropagation();
+ event.preventDefault();
+ }
+
+
+ function fnDisableDeleteButton() {
+ ///<summary>
+ ///Function that disables delete button
+ ///</summary>
+
+ if (properties.bUseKeyTable) {
+ return;
+ }
+ if (properties.oDeleteRowButtonOptions != null) {
+ //oDeleteRowButton.disable();
+ oDeleteRowButton.button("option", "disabled", true);
+ } else {
+ oDeleteRowButton.attr("disabled", "true");
+ }
+ }
+
+ function fnEnableDeleteButton() {
+ ///<summary>
+ ///Function that enables delete button
+ ///</summary>
+
+ if (properties.oDeleteRowButtonOptions != null) {
+ //oDeleteRowButton.enable();
+ oDeleteRowButton.button("option", "disabled", false);
+ } else {
+ oDeleteRowButton.removeAttr("disabled");
+ }
+ }
+
+ var nSelectedRow, nSelectedCell;
+ var oKeyTablePosition;
+
+
+ function _fnOnRowDeleteInline(e) {
+
+ var sURL = $(this).attr("href");
+ if (sURL == null || sURL == "")
+ sURL = properties.sDeleteURL;
+
+ e.preventDefault();
+ e.stopPropagation();
+
+ iDisplayStart = fnGetDisplayStart();
+
+ nSelectedCell = ($(this).parents('td'))[0];
+ jSelectedRow = ($(this).parents('tr'));
+ nSelectedRow = jSelectedRow[0];
+
+ jSelectedRow.addClass(properties.sSelectedRowClass);
+
+ var id = fnGetCellID(nSelectedCell);
+ if (properties.fnOnDeleting(jSelectedRow, id, fnDeleteRow)) {
+ fnDeleteRow(id, sURL);
+ }
+ }
+
+
+ function _fnOnRowDelete(event) {
+ ///<summary>
+ ///Event handler for the delete button
+ ///</summary>
+ ///<param name="event" type="Event">DOM event</param>
+
+ event.preventDefault();
+ event.stopPropagation();
+
+ iDisplayStart = fnGetDisplayStart();
+
+ nSelectedRow = null;
+ nSelectedCell = null;
+
+ if (!properties.bUseKeyTable) {
+ if ($('tr.' + properties.sSelectedRowClass + ' td', oTable).length == 0) {
+ //oDeleteRowButton.attr("disabled", "true");
+ _fnDisableDeleteButton();
+ return;
+ }
+ nSelectedCell = $('tr.' + properties.sSelectedRowClass + ' td', oTable)[0];
+ } else {
+ nSelectedCell = $('td.focus', oTable)[0];
+
+ }
+ if (nSelectedCell == null) {
+ fnDisableDeleteButton();
+ return;
+ }
+ if (properties.bUseKeyTable) {
+ oKeyTablePosition = oTable.keys.fnGetCurrentPosition();
+ }
+ var id = fnGetCellID(nSelectedCell);
+ var jSelectedRow = $(nSelectedCell).parent("tr");
+ nSelectedRow = jSelectedRow[0...
[truncated message content] |
|
From: <os...@us...> - 2013-09-16 06:39:48
|
Revision: 4832
http://sourceforge.net/p/oscss/svn/4832
Author: oscim
Date: 2013-09-16 06:39:43 +0000 (Mon, 16 Sep 2013)
Log Message:
-----------
Fix
Modified Paths:
--------------
branches/2.1.1/catalog/includes/classes/page.php
branches/2.1.1/catalog/includes/languages/fr_FR/fr_FR.php
Modified: branches/2.1.1/catalog/includes/classes/page.php
===================================================================
--- branches/2.1.1/catalog/includes/classes/page.php 2013-09-16 06:39:12 UTC (rev 4831)
+++ branches/2.1.1/catalog/includes/classes/page.php 2013-09-16 06:39:43 UTC (rev 4832)
@@ -428,6 +428,7 @@
if(count($meta)<=3)
$this->page['seo_url']['error'] = true;
+ $meta['description']=$meta['desc'];
$this->page['meta'] = $meta;
// log
$this->page['seo_url']['result'] = $this->page['meta'];
Modified: branches/2.1.1/catalog/includes/languages/fr_FR/fr_FR.php
===================================================================
--- branches/2.1.1/catalog/includes/languages/fr_FR/fr_FR.php 2013-09-16 06:39:12 UTC (rev 4831)
+++ branches/2.1.1/catalog/includes/languages/fr_FR/fr_FR.php 2013-09-16 06:39:43 UTC (rev 4832)
@@ -97,7 +97,7 @@
define('NOTAX_SYMBOL',"HT" );
// Define your email address to appear on all pages
-define('HEAD_REPLY_TAG_ALL',"TORE_OWNER_EMAIL_ADDRES" );
+define('HEAD_REPLY_TAG_ALL',STORE_OWNER_EMAIL_ADDRESS );
// header text in includes/header.php
define('HEADER_TITLE_CREATE_ACCOUNT',"Créer un compte" );
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2013-09-16 06:39:15
|
Revision: 4831
http://sourceforge.net/p/oscss/svn/4831
Author: oscim
Date: 2013-09-16 06:39:12 +0000 (Mon, 16 Sep 2013)
Log Message:
-----------
Fix
Modified Paths:
--------------
trunk/catalog/includes/classes/page.php
trunk/catalog/includes/languages/fr_FR/fr_FR.php
Modified: trunk/catalog/includes/classes/page.php
===================================================================
--- trunk/catalog/includes/classes/page.php 2013-09-14 08:39:55 UTC (rev 4830)
+++ trunk/catalog/includes/classes/page.php 2013-09-16 06:39:12 UTC (rev 4831)
@@ -428,6 +428,7 @@
if(count($meta)<=3)
$this->page['seo_url']['error'] = true;
+ $meta['description']=$meta['desc'];
$this->page['meta'] = $meta;
// log
$this->page['seo_url']['result'] = $this->page['meta'];
Modified: trunk/catalog/includes/languages/fr_FR/fr_FR.php
===================================================================
--- trunk/catalog/includes/languages/fr_FR/fr_FR.php 2013-09-14 08:39:55 UTC (rev 4830)
+++ trunk/catalog/includes/languages/fr_FR/fr_FR.php 2013-09-16 06:39:12 UTC (rev 4831)
@@ -97,7 +97,7 @@
define('NOTAX_SYMBOL',"HT" );
// Define your email address to appear on all pages
-define('HEAD_REPLY_TAG_ALL',"TORE_OWNER_EMAIL_ADDRES" );
+define('HEAD_REPLY_TAG_ALL',STORE_OWNER_EMAIL_ADDRESS );
// header text in includes/header.php
define('HEADER_TITLE_CREATE_ACCOUNT',"Créer un compte" );
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2013-09-14 08:39:58
|
Revision: 4830
http://sourceforge.net/p/oscss/svn/4830
Author: oscim
Date: 2013-09-14 08:39:55 +0000 (Sat, 14 Sep 2013)
Log Message:
-----------
Fix
Modified Paths:
--------------
branches/2.1.1/catalog/includes/js/shopping_cart.js.php
branches/2.1.1/catalog/templates/defaut/includes/content/shopping_cart.php
Modified: branches/2.1.1/catalog/includes/js/shopping_cart.js.php
===================================================================
--- branches/2.1.1/catalog/includes/js/shopping_cart.js.php 2013-09-14 08:29:36 UTC (rev 4829)
+++ branches/2.1.1/catalog/includes/js/shopping_cart.js.php 2013-09-14 08:39:55 UTC (rev 4830)
@@ -27,7 +27,7 @@
- $(this).prev().click(function() {
+ $(this).next().click(function() {
var cartQty = updateQuantity(field, 1);
var cart_id = field.attr("id");
@@ -45,7 +45,7 @@
- $(this).next().click(function() {
+ $(this).prev().click(function() {
var cartQty = updateQuantity(field, -1);
var cart_id = field.attr("id");
@@ -57,7 +57,7 @@
writebox();
writeqty(update, data.substring(8) );
-
+
field.val(update[4]);
}
Modified: branches/2.1.1/catalog/templates/defaut/includes/content/shopping_cart.php
===================================================================
--- branches/2.1.1/catalog/templates/defaut/includes/content/shopping_cart.php 2013-09-14 08:29:36 UTC (rev 4829)
+++ branches/2.1.1/catalog/templates/defaut/includes/content/shopping_cart.php 2013-09-14 08:39:55 UTC (rev 4830)
@@ -50,9 +50,9 @@
<?php echo $currencies->format($product['price']) ;?>
</td>
<td class="cart-line qty tcenter">
+ <input class="Bt button cart-line" type="button" value="-" >
+ <?php echo tep_draw_input_field('cart_quantity['.$i.']','cartQty_'.$i, $product['quantity'], 'class="CartQty" ');?>
<input class="Bt button cart-line" type="button" value="+" >
- <?php echo tep_draw_input_field('cart_quantity['.$i.']','cartQty_'.$i, $product['quantity'], 'class="CartQty" ');?>
- <input class="Bt button cart-line" type="button" value="-" >
<?php echo tep_draw_hidden_field('products_id['.$i.']', $product['id']) ; ?>
</td>
<td class="cart-line taxe tcenter">
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|