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-08-12 07:38:36
|
Revision: 4804
http://sourceforge.net/p/oscss/svn/4804
Author: oscim
Date: 2013-08-12 07:38:32 +0000 (Mon, 12 Aug 2013)
Log Message:
-----------
Fix and adjust process
Modified Paths:
--------------
trunk/extensions/HELPDESK_stable/catalog/includes/languages/fr_FR/modules/account/helpdesk/helpdesk.txt
trunk/extensions/HELPDESK_stable/catalog/includes/modules/account/helpdesk/helpdesk.php
trunk/extensions/HELPDESK_stable/catalog/includes/modules/account/helpdesk/helpdesk.soap.php
trunk/extensions/HELPDESK_stable/catalog/templates/defaut/includes/gabarit/helpdesk/account.display_view.add.gab
trunk/extensions/HELPDESK_stable/catalog/templates/defaut/includes/gabarit/helpdesk/account.display_view.view.gab
Modified: trunk/extensions/HELPDESK_stable/catalog/includes/languages/fr_FR/modules/account/helpdesk/helpdesk.txt
===================================================================
--- trunk/extensions/HELPDESK_stable/catalog/includes/languages/fr_FR/modules/account/helpdesk/helpdesk.txt 2013-08-11 15:56:34 UTC (rev 4803)
+++ trunk/extensions/HELPDESK_stable/catalog/includes/languages/fr_FR/modules/account/helpdesk/helpdesk.txt 2013-08-12 07:38:32 UTC (rev 4804)
@@ -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 16/04/2012, 22:44
+ @version 2.1.2
+ @date 12/08/2013, 22:44
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
*/
@@ -12,13 +12,15 @@
/* Bouton/liens */
$lang['helpdesk small image button view']="Afficher" ;
$lang['helpdesk pdf link']="Pdf" ;
+ $lang['helpdesk valid comment']="Envoyer ce commentaire" ;
+ $lang['helpdesk valid new ticket']="Créer ce ticket" ;
$lang['helpdesk breadcrumb']="Support" ;
$lang['helpdesk breadcrumb view']="ticket" ;
$lang['helpdesk breadcrumb add']="Nouveau ticket" ;
/* Widget */
- $lang['helpdesk widget view']="Touts les ticket" ;
+ $lang['helpdesk widget view']="Touts les tickets" ;
$lang['helpdesk widget add ticket']="Ouvrir un ticket" ;
$lang['helpdesk add new ticket']="Nouveau ticket" ;
@@ -63,6 +65,8 @@
$lang['helpdesk your author'] = "Vous";
$lang['helpdesk add comment in current ticket'] = "Repondre";
+ $lang['helpdesk entry status'] = "Changer l'etat";
+ $lang['helpdesk status close'] = "Fermer ce ticket";
$lang['helpdesk status 0'] = "Nouveau";
$lang['helpdesk status 1'] = "Réponse en attente";
Modified: trunk/extensions/HELPDESK_stable/catalog/includes/modules/account/helpdesk/helpdesk.php
===================================================================
--- trunk/extensions/HELPDESK_stable/catalog/includes/modules/account/helpdesk/helpdesk.php 2013-08-11 15:56:34 UTC (rev 4803)
+++ trunk/extensions/HELPDESK_stable/catalog/includes/modules/account/helpdesk/helpdesk.php 2013-08-12 07:38:32 UTC (rev 4804)
@@ -4,12 +4,12 @@
@portion code Copyright (c) 2002 osCommerce
@package osCSS-2 <www http://www.oscss.org>
@version 2.1.2
- @date 10/08/2013, 22:44
+ @date 12/08/2013, 22:44
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
*\class helpdesk
*\group modules
- *\brief helpdesk SOAP Link For customers
+ *\brief Address book for customers
*/
class helpdesk
@@ -60,10 +60,16 @@
self::$action = tep_db_prepare_input($_GET['aca_action']);
- require_once(dirname(__FILE__).'/helpdesk.soap.php');
+ define('HELPDESK_URL_SOAP', 'http://support.devzeweb.net/soap');
+ define('HELPDESK_OWNER_LOGIN', 'auto_oscss');
+ define('HELPDESK_OWNER_PASS', 'auto_oscss');
- $res = self::$hdSoap = new soap();
+// $conf->global->ticketfree_HESK_BASE
+ require_once(dirname(__FILE__).'/helpdesk.soap.php');
+
+ $res = self::$hdSoap = new soap();
+// var_dump(self::$hdSoap);
}
public function get_header($action=''){
@@ -122,20 +128,25 @@
''
);
+ tep_redirect(self::href_link());
break;
case 'ab_insert_reply':
- $custo=customer::getInstance();
+ $custo=customer::getInstance();
- $res= self::$hdSoap->set_replies(
- tep_db_input($_REQUEST['enquiry']), //$message,
- tep_db_input($_REQUEST['id']),
- $custo->customer['customers_lastname'],
- 0//$staffid,
- );
+ if(strlen($_REQUEST['enquiry']) > 5)
+ $res= self::$hdSoap->set_replies(
+ tep_db_input($_REQUEST['enquiry']), //$message,
+ tep_db_input($_REQUEST['id']),
+ $custo->customer['customers_lastname'],
+ 0//$staffid,
+ );
+ if($_REQUEST['status'] == 3 )
+ $res= self::$hdSoap->change_status_ticket(tep_db_input($_REQUEST['id']), 3, 'Closed by customers '.date('Y/m/d H:i:s'));
+ tep_redirect(self::href_link('view', 'id='.(int)$_REQUEST['id']));
break;
}
@@ -189,6 +200,9 @@
$ticket['allreply'][] = new objectInfo($row);
}
+ // force classed read reply
+ $res = self::$hdSoap->set_read_replies($_GET['id']);
+
self::$hdSoap->logout();
$result = new objectInfo($ticket);
@@ -197,7 +211,9 @@
$custo=customer::getInstance();
$allticket = self::$hdSoap->search_ticket($custo->customer['customers_email_address']);
- foreach($allticket['TICKETS'] as $key=>$row){
+
+
+ foreach($allticket->TICKETS as $key=>$row){
$row->linkView = self::href_link('view', 'id='.$row->id);
$result[] = $row;
}
@@ -322,13 +338,7 @@
@brief test if count all var , and keys is equal
@return boolean true/false
*/
- function check() {
- if (!isset($this->_check)) {
- $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'HELPDESK_URL_SOAP'");
- $this->_check = tep_db_num_rows($check_query);
- }
- return $this->_check;
- }
+ function check() { return false; }
/**
@@ -336,7 +346,7 @@
@return array all key configuration define by this module
*/
function keys() {
- return array( 'HELPDESK_URL_SOAP', 'HELPDESK_OWNER_LOGIN', 'HELPDESK_OWNER_PASS' );
+ return array();
}
/**
@@ -351,11 +361,7 @@
var title MODULE_TOTO_ST_S (small description)
var description MODULE_TOTO_ST_L (long description)
*/
- function install() {
- tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added,configuration_type) values ('".addslashes(__("helpdesk soap serveur"))."', 'HELPDESK_URL_SOAP', 'http://yoursupport.net/soap', '".addslashes(__("helpdesk soap serveur"))."', '1', '0', now(),1)");
- tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added,configuration_type) values ('".addslashes(__("helpdesk soap login"))."', 'HELPDESK_OWNER_LOGIN', 'admin', '".addslashes(__("helpdesk soap login"))."', '1', '0', now(),1)");
- tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added,configuration_type) values ('".addslashes(__("helpdesk soap pass"))."', 'HELPDESK_OWNER_PASS', 'admin', '".addslashes(__("helpdesk soap pass"))."', '1', '0', now(),1)");
- }
+ function install() { return false; }
/**
@fn remove()
@@ -364,10 +370,7 @@
- please, pefix all var configuration by 'MODULE_PAYMENT__MODTYPENAME_MAJ_'
- if module twin in backoffice, report all content remove in the other module
*/
- function remove() {
- foreach($this->keys as $key)
- tep_db_query(" delete from" . TABLE_CONFIGURATION . " WHERE configuration_key='".$key."' limit 1");
- }
+ function remove() { return false; }
}
?>
\ No newline at end of file
Modified: trunk/extensions/HELPDESK_stable/catalog/includes/modules/account/helpdesk/helpdesk.soap.php
===================================================================
--- trunk/extensions/HELPDESK_stable/catalog/includes/modules/account/helpdesk/helpdesk.soap.php 2013-08-11 15:56:34 UTC (rev 4803)
+++ trunk/extensions/HELPDESK_stable/catalog/includes/modules/account/helpdesk/helpdesk.soap.php 2013-08-12 07:38:32 UTC (rev 4804)
@@ -1,22 +1,15 @@
<?php
+/**
+ @licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
+ @licence GNU General Public License version 2
+ @Copyright (C) 2012 jacquel jerome <icf...@fr...>
+ @package osCSS-2 <www http://www.oscss.org>
+ @version 2.1.2
+ @date 12/08/2013, 22:44
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+*/
-/*
- * Copyright (C) 2012 jacquel jerome <icf...@fr...>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program 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. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
class soap {
var $session;
@@ -572,8 +565,8 @@
// $response = $client->search_ticket($value, $what = 'subject', $archive = 0, $limit = 0, $sort = 'status', $asc = 0, $this->session);
$response = $client->search_ticket($value_email, 'email', 0, 0, 'status', 0, $this->session);
// $response = $client->search_ticket('oscim', 'name', 0, 0, 'status', 0, $this->session);
-
- return $response;
+// var_dump($response);
+ return json_decode($response);
} catch (SoapFault $e) {
//return $e->getMessage() ;
@@ -587,7 +580,9 @@
}
}
- function submit_ticket($name, $email, $category, $priority, $owner, $subject, $message, $send_email, $custom_fields = array(), $attachments = array(), $question_ans = '') {
+
+
+ function get_note($id) {
global $conf;
try {
@@ -613,7 +608,7 @@
$client->__setCookie('session_id', session_id());
try {
- $response = $client->submit_ticket($name, $email, $category, $priority, $owner, $subject, $message, $send_email, $custom_fields, $attachments , $question_ans , $this->session) ;
+ $response = $client->get_note($id);
return $response;
} catch (SoapFault $e) {
@@ -623,14 +618,14 @@
// echo $client->__getLastResponse();
} catch (Exception $e) {
- return 'submit_ticket :' . $e->getMessage();
+ return 'Get note :' . $e->getMessage();
}
}
- function set_replies($message, $idticket, $hesk_username, $id) {
+
+ function get_replies($id) {
global $conf;
-
try {
if (!defined('IN_SCRIPT')) {
/**
@@ -653,23 +648,66 @@
// required to store authentication to the service.
$client->__setCookie('session_id', session_id());
try {
-
- $response = $client-> set_replies($message, $idticket, $hesk_username, $id,$this->session) ;
- return $response;
+ if($this->session ==null)
+ $this->login($this->user, $this->pass, $this->hash);
+ $response = $client->get_replies($id, $this->session);
} catch (SoapFault $e) {
- return $e->getMessage();
+ return 'Get replies :' . $e->getMessage();
}
// echo $client->__getLastResponse();
} catch (Exception $e) {
- return 'set_replies :' . $e->getMessage();
+ return 'Get replies :' . $e->getMessage();
}
+
+ return $response;
}
- function get_note($id) {
+ private function check_permission($permission) {
+
+ if (!$this->session['isadmin'] && (strpos($this->session['heskprivileges'], $permission) === false)) {
+ return FALSE;
+ } else {
+ return TRUE;
+ }
+ }
+
+ function check_categorie($idcat) {
+ global $soap;
+ if (($this->session['isadmin']) || (in_array($idcat, $this->session['categories'])))
+ return TRUE;
+ }
+
+ /* check if ticket is visible for user
+ *
+ * @return true if visible
+ *
+ */
+
+ function check_view_ticket($ticket) {
+
+ $view = $view_other = $view_unassigned = true;
+
+ $view = $this->check_permission(self::PERM_CAN_VIEW_TICKETS);
+
+ if ($ticket['owner'] == 0)
+ $view_unassigned = $this->check_permission(self::PERM_CAN_VIEW_UNASSIGNED);
+
+ if ($ticket['owner'] != $this->session['id'] && $ticket['owner'] != 0)
+ $view_other = $this->check_permission(self::PERM_CAN_VIEW_ASS_OTHERS);
+
+ $cat = $this->check_categorie($ticket['category']);
+
+
+ if ($this->session['isadmin'] || ($view && $view_other && $view_unassigned && $cat))
+ return TRUE;
+ }
+
+
+ function submit_ticket($name, $email, $category, $priority, $owner, $subject, $message, $send_email, $custom_fields = array(), $attachments = array(), $question_ans = '') {
global $conf;
try {
@@ -695,7 +733,7 @@
$client->__setCookie('session_id', session_id());
try {
- $response = $client->get_note($id);
+ $response = $client->submit_ticket($name, $email, $category, $priority, $owner, $subject, $message, $send_email, $custom_fields, $attachments , $question_ans , $this->session) ;
return $response;
} catch (SoapFault $e) {
@@ -705,14 +743,14 @@
// echo $client->__getLastResponse();
} catch (Exception $e) {
- return 'Get note :' . $e->getMessage();
+ return 'submit_ticket :' . $e->getMessage();
}
}
+ function set_replies($message, $idticket, $hesk_username, $id) {
+ global $conf;
- function get_replies($id) {
- global $conf;
try {
if (!defined('IN_SCRIPT')) {
/**
@@ -735,64 +773,100 @@
// required to store authentication to the service.
$client->__setCookie('session_id', session_id());
try {
- if($this->session ==null)
- $this->login($this->user, $this->pass, $this->hash);
- $response = $client->get_replies($id, $this->session);
+
+ $response = $client-> set_replies($message, $idticket, $hesk_username, $id,$this->session) ;
+ return $response;
} catch (SoapFault $e) {
- return 'Get replies :' . $e->getMessage();
+ return $e->getMessage();
}
// echo $client->__getLastResponse();
} catch (Exception $e) {
- return 'Get replies :' . $e->getMessage();
+ return 'set_replies :' . $e->getMessage();
}
-
- return $response;
}
+ function set_read_replies($idticket, $id=0) {
+ global $conf;
- private function check_permission($permission) {
+ try {
+ if (!defined('IN_SCRIPT')) {
+ /**
+ * required by Hesk
+ */
+ define('IN_SCRIPT', 1);
+ }
+ //todo dinamic location
+ // configuration.
+ $ConfigSoap = array(
+ 'soap_version' => SOAP_1_2,
+ 'encoding' => 'UTF-8',
+ 'location' => HELPDESK_URL_SOAP,
+ 'uri' => HELPDESK_URL_SOAP,
+ 'wsdl_cache' => 0,
+ 'trace' => 1
+ );
+ // create SOAP client.
+ $client = new SoapClient(null, $ConfigSoap);
+ // required to store authentication to the service.
+ $client->__setCookie('session_id', session_id());
+ try {
+ $response = $client->set_read_replies($idticket, $id, $this->session) ;
- if (!$this->session['isadmin'] && (strpos($this->session['heskprivileges'], $permission) === false)) {
- return FALSE;
- } else {
- return TRUE;
- }
- }
+ return $response;
+ } catch (SoapFault $e) {
- function check_categorie($idcat) {
- global $soap;
- if (($this->session['isadmin']) || (in_array($idcat, $this->session['categories'])))
- return TRUE;
- }
+ return $e->getMessage();
+ }
- /* check if ticket is visible for user
- *
- * @return true if visible
- *
- */
- function check_view_ticket($ticket) {
+ // echo $client->__getLastResponse();
+ } catch (Exception $e) {
+ return 'set_replies :' . $e->getMessage();
+ }
+ }
- $view = $view_other = $view_unassigned = true;
+ function change_status_ticket($ID, $status = 0, $history) {
+ global $conf;
- $view = $this->check_permission(self::PERM_CAN_VIEW_TICKETS);
+ try {
+ if (!defined('IN_SCRIPT')) {
+ /**
+ * required by Hesk
+ */
+ define('IN_SCRIPT', 1);
+ }
+ //todo dinamic location
+ // configuration.
+ $ConfigSoap = array(
+ 'soap_version' => SOAP_1_2,
+ 'encoding' => 'UTF-8',
+ 'location' => HELPDESK_URL_SOAP,
+ 'uri' => HELPDESK_URL_SOAP,
+ 'wsdl_cache' => 0,
+ 'trace' => 1
+ );
+ // create SOAP client.
+ $client = new SoapClient(null, $ConfigSoap);
+ // required to store authentication to the service.
+ $client->__setCookie('session_id', session_id());
+ try {
- if ($ticket['owner'] == 0)
- $view_unassigned = $this->check_permission(self::PERM_CAN_VIEW_UNASSIGNED);
+ $response = $client->change_status_ticket($ID, $status , $history,$this->session) ;
+ return $response;
+ } catch (SoapFault $e) {
- if ($ticket['owner'] != $this->session['id'] && $ticket['owner'] != 0)
- $view_other = $this->check_permission(self::PERM_CAN_VIEW_ASS_OTHERS);
+ return $e->getMessage();
+ }
- $cat = $this->check_categorie($ticket['category']);
-
- if ($this->session['isadmin'] || ($view && $view_other && $view_unassigned && $cat))
- return TRUE;
+ // echo $client->__getLastResponse();
+ } catch (Exception $e) {
+ return 'set_replies :' . $e->getMessage();
+ }
}
-
}
?>
Modified: trunk/extensions/HELPDESK_stable/catalog/templates/defaut/includes/gabarit/helpdesk/account.display_view.add.gab
===================================================================
--- trunk/extensions/HELPDESK_stable/catalog/templates/defaut/includes/gabarit/helpdesk/account.display_view.add.gab 2013-08-11 15:56:34 UTC (rev 4803)
+++ trunk/extensions/HELPDESK_stable/catalog/templates/defaut/includes/gabarit/helpdesk/account.display_view.add.gab 2013-08-12 07:38:32 UTC (rev 4804)
@@ -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/07/2013, 22:44
+ @version 2.1.2
+ @date 12/08/2013, 22:44
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
@brief This listing orders for module account/helpdesk
@@ -39,15 +39,15 @@
<li>
<label for="name"><?php echo __('helpdesk entry subject'); ?></label>
- <?php echo tep_draw_input_field('subject','subject'); ?>
+ <?php echo tep_draw_input_field('subject','subject','', '', true); ?>
</li>
<li>
<label for="name"><?php echo __('helpdesk entry enquiry'); ?></label>
- <?php echo tep_draw_textarea_field('enquiry', 'enquiry', '48', '15'); ?>
+ <?php echo tep_draw_textarea_field('enquiry', 'enquiry', '48', '15','', '', '',true); ?>
</li>
<li>
- <?php echo tep_image_submit('submit', 'submit'); ?>
+ <?php echo tep_image_submit('submit', __('helpdesk valid new ticket')); ?>
</li>
</ul>
Modified: trunk/extensions/HELPDESK_stable/catalog/templates/defaut/includes/gabarit/helpdesk/account.display_view.view.gab
===================================================================
--- trunk/extensions/HELPDESK_stable/catalog/templates/defaut/includes/gabarit/helpdesk/account.display_view.view.gab 2013-08-11 15:56:34 UTC (rev 4803)
+++ trunk/extensions/HELPDESK_stable/catalog/templates/defaut/includes/gabarit/helpdesk/account.display_view.view.gab 2013-08-12 07:38:32 UTC (rev 4804)
@@ -3,17 +3,13 @@
@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/07/2013, 22:44
+ @version 2.1.2
+ @date 12/08/2013, 22:44
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
@brief This listing orders for module account/helpdesk
*/
global $language,$customer_id;
-
-// print_r(helpdesk::$current);
-
-
?>
<div class="main-helpdesk">
<table>
@@ -71,14 +67,17 @@
<h3><?php echo __('helpdesk add comment in current ticket') ?></h3>
<?php echo tep_draw_form('contact_us', helpdesk::href_link('insert_reply&id='.helpdesk::$current->id)); ?>
<ul>
-
<li>
+ <label for="name"><?php echo __('helpdesk entry status'); ?></label>
+ <?php echo tep_draw_pull_down_menu('status','status',array(array('id'=>-1,'text'=>'' ),array('id'=>3,'text'=>__('helpdesk status close') ) )); ?>
+ </li>
+ <li>
<label for="name"><?php echo __('helpdesk entry enquiry'); ?></label>
<?php echo tep_draw_textarea_field('enquiry', 'enquiry', '48', '15'); ?>
</li>
<li>
- <?php echo tep_image_submit('submit', 'submit'); ?>
+ <?php echo tep_image_submit('submit', __('helpdesk valid comment')); ?>
</li>
</ul>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2013-08-11 15:56:36
|
Revision: 4803
http://sourceforge.net/p/oscss/svn/4803
Author: oscim
Date: 2013-08-11 15:56:34 +0000 (Sun, 11 Aug 2013)
Log Message:
-----------
Fix bug in helpdesk
Fix manufacturers
Modified Paths:
--------------
trunk/extensions/HELPDESK_stable/catalog/includes/modules/account/helpdesk/helpdesk.php
trunk/extensions/MANUFACTURERS_stable/catalog/admin/includes/classes/drivers/sqlmanufacturer.php
Added Paths:
-----------
trunk/extensions/MANUFACTURERS_stable/catalog/includes/classes/
trunk/extensions/MANUFACTURERS_stable/catalog/includes/classes/drivers/
trunk/extensions/MANUFACTURERS_stable/catalog/includes/classes/drivers/data/
trunk/extensions/MANUFACTURERS_stable/catalog/includes/classes/drivers/data/manufacturer.php
Modified: trunk/extensions/HELPDESK_stable/catalog/includes/modules/account/helpdesk/helpdesk.php
===================================================================
--- trunk/extensions/HELPDESK_stable/catalog/includes/modules/account/helpdesk/helpdesk.php 2013-08-11 15:50:52 UTC (rev 4802)
+++ trunk/extensions/HELPDESK_stable/catalog/includes/modules/account/helpdesk/helpdesk.php 2013-08-11 15:56:34 UTC (rev 4803)
@@ -3,13 +3,13 @@
@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 15/04/2012, 22:44
+ @version 2.1.2
+ @date 10/08/2013, 22:44
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
*\class helpdesk
*\group modules
- *\brief Address book for customers
+ *\brief helpdesk SOAP Link For customers
*/
class helpdesk
@@ -60,16 +60,10 @@
self::$action = tep_db_prepare_input($_GET['aca_action']);
- define('HELPDESK_URL_SOAP', 'http://support.devzeweb.net/soap');
- define('HELPDESK_OWNER_LOGIN', 'auto_oscss');
- define('HELPDESK_OWNER_PASS', 'auto_oscss');
+ require_once(dirname(__FILE__).'/helpdesk.soap.php');
-// $conf->global->ticketfree_HESK_BASE
+ $res = self::$hdSoap = new soap();
- require_once(dirname(__FILE__).'/helpdesk.soap.php');
-
- $res = self::$hdSoap = new soap();
-// var_dump(self::$hdSoap);
}
public function get_header($action=''){
@@ -328,7 +322,13 @@
@brief test if count all var , and keys is equal
@return boolean true/false
*/
- function check() { return false; }
+ function check() {
+ if (!isset($this->_check)) {
+ $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'HELPDESK_URL_SOAP'");
+ $this->_check = tep_db_num_rows($check_query);
+ }
+ return $this->_check;
+ }
/**
@@ -336,7 +336,7 @@
@return array all key configuration define by this module
*/
function keys() {
- return array();
+ return array( 'HELPDESK_URL_SOAP', 'HELPDESK_OWNER_LOGIN', 'HELPDESK_OWNER_PASS' );
}
/**
@@ -351,7 +351,11 @@
var title MODULE_TOTO_ST_S (small description)
var description MODULE_TOTO_ST_L (long description)
*/
- function install() { return false; }
+ function install() {
+ tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added,configuration_type) values ('".addslashes(__("helpdesk soap serveur"))."', 'HELPDESK_URL_SOAP', 'http://yoursupport.net/soap', '".addslashes(__("helpdesk soap serveur"))."', '1', '0', now(),1)");
+ tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added,configuration_type) values ('".addslashes(__("helpdesk soap login"))."', 'HELPDESK_OWNER_LOGIN', 'admin', '".addslashes(__("helpdesk soap login"))."', '1', '0', now(),1)");
+ tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added,configuration_type) values ('".addslashes(__("helpdesk soap pass"))."', 'HELPDESK_OWNER_PASS', 'admin', '".addslashes(__("helpdesk soap pass"))."', '1', '0', now(),1)");
+ }
/**
@fn remove()
@@ -360,7 +364,10 @@
- please, pefix all var configuration by 'MODULE_PAYMENT__MODTYPENAME_MAJ_'
- if module twin in backoffice, report all content remove in the other module
*/
- function remove() { return false; }
+ function remove() {
+ foreach($this->keys as $key)
+ tep_db_query(" delete from" . TABLE_CONFIGURATION . " WHERE configuration_key='".$key."' limit 1");
+ }
}
?>
\ No newline at end of file
Modified: trunk/extensions/MANUFACTURERS_stable/catalog/admin/includes/classes/drivers/sqlmanufacturer.php
===================================================================
--- trunk/extensions/MANUFACTURERS_stable/catalog/admin/includes/classes/drivers/sqlmanufacturer.php 2013-08-11 15:50:52 UTC (rev 4802)
+++ trunk/extensions/MANUFACTURERS_stable/catalog/admin/includes/classes/drivers/sqlmanufacturer.php 2013-08-11 15:56:34 UTC (rev 4803)
@@ -3,8 +3,8 @@
@licence GPL 2005-2012 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 11/05/2012 ,15:04:13
+ @version 2.1.2
+ @date 31/07/2013 ,15:04:13
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
@class sqlmanufacturers
@@ -149,7 +149,7 @@
$_query = $DB->query("select * from " . TABLE_MANUFACTURERS_INFO . " fd where fd.manufacturers_id = '" . (int)$result['manufacturers_id'] . "' ");
- foreach($_query->fetchAllAssoc() as $row)
+ foreach($_query->fetchAllAssoc() as $row)
$result['lg'][$row['languages_id']] = ((!$shortkey)? $row : self::CleanKey($row));
return ((!$shortkey)? $result : self::CleanKey($result));
@@ -165,7 +165,7 @@
$_query = $DB->query("select * from " . TABLE_MANUFACTURERS_INFO . " fd where fd.manufacturers_id = '" . (int)$result['manufacturers_id'] . "' ");
- foreach($_query->fetchAllAssoc() as $row)
+ foreach($_query->fetchAllAssoc() as $row)
$result['lg'][$row['languages_id']] = ((!$shortkey)? $row : self::CleanKey($row));
@@ -197,14 +197,14 @@
$res = $DB->query("SELECT manufacturers_id as id FROM " . TABLE_MANUFACTURERS ." WHERE ". substr($sql, 3 ).' LIMIT 1' );
$result = $res->fetchAssoc();
-
+
// childs tables
- $DB->query("DELETE FROM " . TABLE_MANUFACTURERS_INFO ." WHERE ". (int)$result['id'] );
+ $DB->query("DELETE FROM " . TABLE_MANUFACTURERS_INFO ." WHERE manufacturers_id = ". (int)$result['id']."' " );
-/// TODO link update tablke product for delete id manuf
+/// TODO link update tablke product for delete id manuf
- $DB->query("DELETE FROM " . TABLE_MANUFACTURERS ." WHERE ". (int)$result['id'] );
+ $DB->query("DELETE FROM " . TABLE_MANUFACTURERS ." WHERE manufacturers_id = '". (int)$result['id']."' " );
return true;
Added: trunk/extensions/MANUFACTURERS_stable/catalog/includes/classes/drivers/data/manufacturer.php
===================================================================
--- trunk/extensions/MANUFACTURERS_stable/catalog/includes/classes/drivers/data/manufacturer.php (rev 0)
+++ trunk/extensions/MANUFACTURERS_stable/catalog/includes/classes/drivers/data/manufacturer.php 2013-08-11 15:56:34 UTC (rev 4803)
@@ -0,0 +1,536 @@
+<?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.2
+ \date 25/07/2013, 11:33
+ \author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ \encode UTF-8
+
+*/
+
+
+/**
+ \class manufacturer
+ \brief Control init et gestion des data product
+*/
+class manufacturer {
+
+ //! @p object
+ protected static $_instance;
+
+ public static $modules;
+
+ /**
+ */
+ protected function __construct($full) {
+ global $languages_id;
+// productData::start();
+ if($full) self::start_module();
+ }
+
+ protected static function start_module(){
+ $pdm=manufacturerModule::getInstance();
+ self::$modules=$pdm->ret_modules();
+ return $pdm;
+ }
+
+ public static function getInstance($full=true) {
+ if(self::$_instance == null) self::$_instance = new self($full);
+ return self::$_instance;
+ }
+
+ public static function resetInstance(){
+ self::$_instance = null;
+ return self::getInstance();
+ }
+
+ /**
+ Module configuration
+ */
+// public function ret_modules(){ self::start_module(); return self::$modules;}
+
+
+ /**
+ Data function
+ */
+ public static function get_path($current_manufacturer_id = '',$value=false){ return manufacturerData::get_path($current_manufacturer_id,$value); }
+ public static function get_count_products_in_manufacturer($manufacturer_id, $include_inactive = false){ return manufacturerData::get_count_products_in_manufacturer($manufacturer_id,$include_inactive); }
+ public static function get_count_content_in_manufacturer($manufacturer_id){ return manufacturerData::get_count_content_in_manufacturer($manufacturer_id); }
+// public static function get_has_manufacturer_submanufacturers($manufacturer_id){ return manufacturerData::get_has_manufacturer_submanufacturers($manufacturer_id); }
+// public static function get_parent_manufacturers(&$manufacturers, $manufacturers_id) { return manufacturerData::get_parent_manufacturers($manufacturers, $manufacturers_id); }
+// public static function get_submanufacturers(&$submanufacturers_array, $parent_id = 0){ return manufacturerData::get_submanufacturers($submanufacturers_array, $parent_id); }
+ public static function get_manufacturers($manufacturers_array = '', $parent_id = '0', $indent = '') { return manufacturerData::get_manufacturers($manufacturers_array , $parent_id, $indent); }
+
+ public static function get_query($id='',$search='',$exclude='',$option=''){ global $languages_id; return manufacturerData::get_query($id,$search,$exclude,$option); }
+ public static function get_item($id){ return manufacturerData::get_item($id); }
+ public static function add_where_query($where){ return manufacturerData::add_where_query($where); }
+
+ /**
+ \fn manufacturer::resetCacheId($id);
+ \brief delet item in cache
+ \param $id integer id cat
+ */
+ public static function resetCacheId($id){ /*return manufacturerData::resetCacheId($id);*/ }
+
+ /**
+ * \fn ret_modules()
+ * \brief Retour tableau des modules type products actif
+ * @return plusieurs modules via array(object)
+ */
+ public function ret_modules(){ /*self::start_module(); return self::$modules;*/}
+ /**
+ * \fn get_option_data($product_array)
+ * \brief adjust products, depend class price, execute by productData
+ * @param $product_array array
+ */
+ public static function get_option_data($_array){ /*$pdm=self::start_module();return $pdm->get_option_data($_array);*/}
+
+}
+
+
+
+
+/**
+ @class productData
+ Traitement sql des cat
+*/
+class manufacturerData
+ extends DataStatmentFO
+ implements Interfacedata{
+ /**
+ @var $cache array cache result
+ */
+ public static $cache=array();
+
+ //! @p object cache
+ public static $object_data;
+ //! @p array cache
+ public static $array_data=array();
+
+ //! @p string
+ private static $where_query='';
+
+
+
+
+ /**
+ * \brief Prepa donnée sortie
+ * @param $content_query
+ * @param $exclude array
+ * @param $search string
+ */
+ protected static function statment_query($content_query,$exclude='',$search=''){
+
+ $display_lang=self::$obj_language->fetchAssoc();
+ if (empty($exclude))$exclude=array();
+ $tabl=$res=array();
+ while ($content = $content_query->fetchAssoc()) {
+ if(count(self::$cache)>0 && in_array($content['manufacturers_id'],self::$cache) ) $tabl[$content['manufacturers_id']]=self::$object_data[$content['manufacturers_id']];
+ elseif (!in_array($content['manufacturers_name'],$exclude)) {
+ $res=$content;
+ $res['href']=tep_href_link(FILENAME_DEFAULT,'manufacturers_id=' . $content['manufacturers_id'] );
+ $res['key']=$content['manufacturers_id'];
+ $res['id']=$content['manufacturers_id'];
+ $res['title']=$content['manufacturers_name'];
+ $res['name']=$content['manufacturers_name'];
+
+ // $res=manufacturer::get_option_data($res);
+
+ self::$object_data[$content['manufacturers_id']]=$tabl[$content['manufacturers_id']]=new objectInfo($res);
+ self::add_cache($content['manufacturers_id']);
+ }
+ }
+ return $tabl;
+ }
+
+ /**
+ * \brief Ajout constrainte clause where
+ * @param $add
+ */
+ public static function add_where_query($add){ self::$where_query .=' '.$add.' '; }
+
+ /**
+ * \fn reset_query()
+ */
+ protected static function reset_query() { self::$where_query=''; }
+
+
+
+ /**
+ * \fn cstr_query($orderby='', $limit='', $option='')
+ * \brief Requeteur
+ * @param $orderby
+ * @param $limit
+ * @param $option
+ */
+ protected static function cstr_query($orderby='', $limit='', $option=''){
+ $query="SELECT c.manufacturers_id, c.manufacturers_image, c.manufacturers_name FROM " . TABLE_MANUFACTURERS . " c, " . TABLE_MANUFACTURERS_INFO . " cd WHERE c.manufacturers_id = cd.manufacturers_id AND cd.languages_id = '" . self::$lg_id . "' ";
+
+ $query .=self::$where_query;
+ $query .=' ORDER BY ' .(!tep_not_null($orderby)? ' c.manufacturers_name ASC ' : $orderby) ;
+ if($limit!='0')
+ $query .=' LIMIT '.(!tep_not_null($limit)? '50' : $limit) ;
+
+ return $query;
+ }
+
+
+
+
+
+ /**
+ * \brief Appel item
+
+ * @param $id int l'Id
+ * @param $search string content_name le nom du titre
+ * @param $exclude array tableau d'exclusion de nom
+ * @param $option array option
+ */
+ public static function get_query($id='',$search='', $exclude='',$option=''){
+ global $languages_id;
+
+ self::start();
+ $DB=Database::getInstance();
+ self::$lg_id=(int)$languages_id;
+ $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.manufacturers_id = '" . (int)$id . "' ": (!empty($search)?" AND c.manufacturers_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);
+ self::reset_query();
+ return self::statment_query($content_query,$exclude,$search);
+ }
+
+ /**
+ * \brief Alias unique ID
+ * @param $id int
+ */
+ public static function get_item($id){
+ self::reset_query();
+ $db_list=self::get_query($id);
+
+ if(is_numeric($id) && isset($db_list[(int)$id])){
+ return $db_list[$id];
+ }else{
+ $db_list=self::get_query('',$id);
+ foreach($db_list as $item)
+ if((string)$id==(string)$item->name)return $item;
+ }
+ return false;
+ }
+
+ /**
+ * \fn get_path($current_manufacturer_id = '',$value=false)
+ * \brief Generate a path to manufacturers
+ * @param $current_manufacturer_id int cat ID
+ * @param $value bool si false, sortie string "cPath=1_3" si true, sortie string "1_3"
+ */
+ public static function get_path($current_manufacturer_id = '',$value=false) {
+ global $cPath_array;
+
+ if (tep_not_null($current_manufacturer_id)) {
+ $cp_size = sizeof($cPath_array);
+ if ($cp_size == 0) {
+ $cPath_new = $current_manufacturer_id;
+ } else {
+ $cPath_new = '';
+ $last_manufacturer_query = tep_db_query("select parent_id from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . (int)$cPath_array[($cp_size-1)] . "'");
+ $last_manufacturer = tep_db_fetch_array($last_manufacturer_query);
+
+ $current_manufacturer_query = tep_db_query("select parent_id from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . (int)$current_manufacturer_id . "'");
+ $current_manufacturer = tep_db_fetch_array($current_manufacturer_query);
+
+ if ($last_manufacturer['parent_id'] == $current_manufacturer['parent_id']) {
+ for ($i=0; $i<($cp_size-1); $i++) {
+ $cPath_new .= '_' . $cPath_array[$i];
+ }
+ } else {
+ for ($i=0; $i<$cp_size; $i++) {
+ $cPath_new .= '_' . $cPath_array[$i];
+ }
+ }
+ $cPath_new .= '_' . $current_manufacturer_id;
+
+ if (substr($cPath_new, 0, 1) == '_') {
+ $cPath_new = substr($cPath_new, 1);
+ }
+ }
+ } else {
+ $cPath_new = implode('_', $cPath_array);
+ }
+
+ if ($value) return 'cPath=' . $cPath_new;
+ else return $cPath_new;
+ }
+
+
+ /**
+ * \brief Return the number of products and manufacturer child in a manufacturer
+ // TABLES: products, products_to_manufacturers, manufacturers
+ */
+ public static function get_count_products_in_manufacturer($manufacturer_id, $include_inactive = false) {
+
+// if(isset(self::$object_data[$manufacturer_id]->count_products)) return self::$object_data[$manufacturer_id]->count_products;
+
+ $products_count = 0;
+// $DB=Database::getInstance();
+// if ($include_inactive == true) {
+// $products_query = $DB->query("select count(p.products_id) as total from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = p2c.products_id and p2c.manufacturers_id = '" . (int)$manufacturer_id . "'");
+// } else {
+// $products_query = $DB->query("select count(p.products_id) as total from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = p2c.products_id and p.products_status = '1' and p2c.manufacturers_id = '" .(int) $manufacturer_id . "' ");
+// }
+// if($products_query->__get('numRows')>0 ) $products = $products_query->fetchAssoc();
+// else $products['total']= 0;
+// $products_count += $products['total'];
+//
+// if(!isset(self::$object_data[$manufacturer_id]) || !self::get_item($manufacturer_id)) return false;
+// self::$object_data[$manufacturer_id]->count_products=(int)$products_count;
+//
+// self::add_where_query(" AND parent_id = '" . (int)$manufacturer_id . "' ");
+// $db_list=self::get_query('','','',array('limit'=>'30'));
+//
+// foreach($db_list as $cat)
+// if($cat->key !=(int)$manufacturer_id && (int)$manufacturer_id ==$cat->parent_id) {
+// $products_count +=(isset($cat->count_products) ? $cat->count_products : self::get_count_products_in_manufacturer($cat->manufacturers_id) );
+// }
+
+ return $products_count;
+ }
+
+ /**
+ * \brief Return the number of products and manufacturer child in a manufacturer
+ // TABLES: products, products_to_manufacturers, manufacturers
+ */
+ public static function get_count_content_in_manufacturer($manufacturer_id) {
+ $products_count = 0;
+// $DB=Database::getInstance();
+//
+// $products_query = $DB->query("select count(c.content_id) as total from " . TABLE_CONTENT . " c , " . TABLE_CONTENT_TO_CATEGORIES . " c2c where c.content_id = c2c.content_id and c2c.manufacturers_id = '" . (int)$manufacturer_id . "' and c.content_status='1' ");
+//
+// if($products_query->__get('numRows')>0 ) $products = $products_query->fetchAssoc();
+// else $products['total']= 0;
+// $products_count += $products['total'];
+//
+// if(!isset(self::$object_data[$manufacturer_id]) || !self::get_item($manufacturer_id)) return false;
+// self::$object_data[$manufacturer_id]->count_products=(int)$products_count;
+//
+// self::add_where_query(" AND parent_id = '" . (int)$manufacturer_id . "' ");
+// $db_list=self::get_query('','','',array('limit'=>'30'));
+//
+// foreach($db_list as $cat)
+// if($cat->key !=(int)$manufacturer_id && (int)$manufacturer_id ==$cat->parent_id) {
+// $products_count +=(isset($cat->count_products) ? $cat->count_products : self::get_count_products_in_manufacturer($cat->manufacturers_id) );
+// }
+
+ return $products_count;
+ }
+
+ /**
+ * \brief Return false if not the manufacturer has submanufacturers or nbr manufacturer
+ */
+ public static function get_has_manufacturer_submanufacturers($manufacturer_id) {
+/*
+ self::add_where_query(" AND parent_id = '" . (int)$manufacturer_id . "' ");
+ $db_list=self::get_query();
+
+ if (($count=count($db_list)) && $count > 0) return $count;
+ else return 0;*/
+
+ }
+
+ /**
+ * \brief Recursively go through the manufacturers and retreive all parent manufacturers IDs
+ // TABLES: manufacturers
+ */
+// public static function get_parent_manufacturers(&$manufacturers, $manufacturers_id) {
+//
+// if(!isset(self::$object_data[$manufacturers_id]->parent_array)) {
+// $db_list=self::get_query((int)$manufacturers_id);
+// foreach($db_list as $cats) {
+// if ($cats->parent_id == 0) return true;
+// $manufacturers[sizeof($manufacturers)] = $cats->parent_id;
+// if ($cats->parent_id != $manufacturers_id) {
+// self::get_parent_manufacturers($manufacturers, $cats->parent_id);
+// }
+// }
+// // self::$object_data[$manufacturers_id]->parent_array=$manufacturers;
+// } else $manufacturers=self::$object_data[$manufacturers_id]->parent_array;
+//
+//
+// // $parent_manufacturers_query = tep_db_query("select parent_id from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . (int)$manufacturers_id . "' ");
+// // while ($parent_manufacturers = tep_db_fetch_array($parent_manufacturers_query)) {
+// // if ($parent_manufacturers['parent_id'] == 0) return true;
+// // $manufacturers[sizeof($manufacturers)] = $parent_manufacturers['parent_id'];
+// // if ($parent_manufacturers['parent_id'] != $manufacturers_id) {
+// // self::tep_get_parent_manufacturers($manufacturers, $parent_manufacturers['parent_id']);
+// // }
+// // }
+//
+// }
+
+/**
+ * \brief
+ Return all submanufacturer IDs. Recursivite
+ TABLES: manufacturers
+*/
+// public static function get_submanufacturers(&$submanufacturers_array, $parent_id = 0) {
+// $submanufacturers_query = tep_db_query("select manufacturers_id from " . TABLE_MANUFACTURERS . " where parent_id = '" . (int)$parent_id . "' and manufacturers_status='1' ");
+// while ($submanufacturers = tep_db_fetch_array($submanufacturers_query)) {
+// $submanufacturers_array[sizeof($submanufacturers_array)] = $submanufacturers['manufacturers_id'];
+// if ($submanufacturers['manufacturers_id'] != $parent_id)
+// tep_get_submanufacturers($submanufacturers_array, $submanufacturers['manufacturers_id']);
+// }
+// }
+
+ /**
+ * \brief Construction d'un select sur les catégories actives
+ */
+ public static function get_manufacturers($manufacturers_array = '', $parent_id = '0', $indent = '') {
+ // global $languages_id;
+ // if (!is_array($manufacturers_array)) $manufacturers_array = array();
+ // $manufacturers_query = tep_db_query("select c.manufacturers_id, cd.manufacturers_name from " . TABLE_MANUFACTURERS . " c, " . TABLE_MANUFACTURERS_DESCRIPTION . " cd where parent_id = '" . (int)$parent_id . "' and c.manufacturers_status='1' and c.manufacturers_id = cd.manufacturers_id and cd.language_id = '" . (int)$languages_id . "' order by sort_order, cd.manufacturers_name");
+ // while ($manufacturers = tep_db_fetch_array($manufacturers_query)) {
+ // $manufacturers_array[] = array('id' => $manufacturers['manufacturers_id'], 'text' => $indent . $manufacturers['manufacturers_name']);
+ //
+ // if ($manufacturers['manufacturers_id'] != $parent_id) $manufacturers_array = tep_get_manufacturers($manufacturers_array, $manufacturers['manufacturers_id'], $indent . ' ');
+ // }
+ //
+ // return $manufacturers_array;
+ }
+
+}
+
+
+
+
+/**
+ * \class productModule
+ * \brief Traitement des modules associé
+*/
+class manufacturerModule
+ extends AbstractAcaModule
+ implements InterfaceAcaGene{
+
+ /**
+ flag de la class
+ @param string
+ */
+ var $name;
+ /**
+ Les modules actif
+ @param string
+ */
+ var $modules;
+ /**
+ Pile des images du porduit
+ @param array
+ */
+ var $pile_img;
+
+
+ protected static $_instance;
+
+ /**
+ */
+ protected function __construct() {
+ global $language, $page;
+ $this-> name=__CLASS__;
+ $this->type_flag=1;
+ $this-> products_id='';
+ $this-> image_handler='';
+
+ $this->modules=array();
+ $this->pile_img=array();
+ $list_mod=array();
+
+ foreach(parent::initialise_type('MODULE_ACAMANUF_INSTALLED','manufacturers') as $class){
+ $cl[$class]=new $class ();
+ $list_mod[$class] = $cl[$class]->sort_order;
+ }
+ asort($list_mod);
+ foreach($list_mod as $class=>$s){
+ $this->modules[$class] =$cl[$class];
+ }
+ unset($cl);unset($list_mod);
+ return $this->modules;
+ }
+
+
+ public static function getInstance() {
+ if(self::$_instance == null) self::$_instance = new self();
+ return self::$_instance;
+ }
+
+ public static function resetInstance(){
+ self::$_instance = null;
+ return self::getInstance();
+ }
+
+ public function get_option_data($_array){
+ if(isset($this->modules) && is_array($this->modules))
+ foreach ($this->modules as $key=>$module) {
+ if ( $module->enabled && (method_exists($module, 'get_option_data' ))) {
+ $_array=$this->modules[$key]->get_option_data($_array);
+ }
+ }
+ return $_array;
+ }
+
+ /**
+ * \brief Affiche module elemennt html
+ * Block principal d'affichage, liste ou vue des élément. Block principal de page
+ * @param $pID int $pID le Id du produits
+ * @param @classe string le nom de la class appelé, ou vide pour toutes les class enfants
+ */
+ public function display_view($pID,$classe=''){
+ global $page;
+ if (!empty($classe)) {
+ if (isset($this->modules[$classe]) && $this->modules[$classe]->enabled and (method_exists($classe, 'display_view' ))){
+ $this->modules[$classe]->load_db_values($pID);
+ return $this->modules[$classe]->display_view($pID);
+ }
+ } else {
+ $c='';
+ if(isset($this->modules) && is_array($this->modules))
+ foreach ($this->modules as $key=>$module) {
+ if (($module->enabled) and (method_exists($module, 'display_view' ))) {
+ $this->modules[$key]->load_db_values($pID);
+ $c .=$this->modules[$key]->display_view($pID);
+ }
+ }
+ return $c;
+ }
+ }
+
+ /**
+ * \brief Affiche module display_view mini
+ * @param $cID int cID le Id du customers
+ * @param $class string class le nom de la class appelé, ou vide pour toutes les class enfants
+ */
+ public function display_view_min($cID,$class=''){
+ global $page;
+ if (!empty($class)) {
+ if (isset($this->modules[$class]) && $this->modules[$class]->enabled and (method_exists($module, 'display_view_min' ))){
+ $this->modules[$class]->load_db_values($cID);
+ return $this->modules[$class]->display_view_min($cID);
+ }
+ } else {
+ $c='';
+ foreach ($this->modules as $key=>$module) {
+ if (($module->enabled) and (method_exists($module, 'display_view_min' ))) {
+ $this->modules[$key]->load_db_values($cID);
+ $c .=$this->modules[$key]->display_view_min($cID);
+ }
+ }
+ return $c;
+ }
+ }
+
+
+}
+
+?>
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2013-08-11 15:50:55
|
Revision: 4802
http://sourceforge.net/p/oscss/svn/4802
Author: oscim
Date: 2013-08-11 15:50:52 +0000 (Sun, 11 Aug 2013)
Log Message:
-----------
Add module for helpdesk external tools and manage ticket for user in myaccount page , use soap
Added Paths:
-----------
trunk/extensions/HELPDESK_stable/
trunk/extensions/HELPDESK_stable/catalog/
trunk/extensions/HELPDESK_stable/catalog/includes/
trunk/extensions/HELPDESK_stable/catalog/includes/languages/
trunk/extensions/HELPDESK_stable/catalog/includes/languages/fr_FR/
trunk/extensions/HELPDESK_stable/catalog/includes/languages/fr_FR/modules/
trunk/extensions/HELPDESK_stable/catalog/includes/languages/fr_FR/modules/account/
trunk/extensions/HELPDESK_stable/catalog/includes/languages/fr_FR/modules/account/helpdesk/
trunk/extensions/HELPDESK_stable/catalog/includes/languages/fr_FR/modules/account/helpdesk/helpdesk.txt
trunk/extensions/HELPDESK_stable/catalog/includes/modules/
trunk/extensions/HELPDESK_stable/catalog/includes/modules/account/
trunk/extensions/HELPDESK_stable/catalog/includes/modules/account/helpdesk/
trunk/extensions/HELPDESK_stable/catalog/includes/modules/account/helpdesk/helpdesk.php
trunk/extensions/HELPDESK_stable/catalog/includes/modules/account/helpdesk/helpdesk.soap.php
trunk/extensions/HELPDESK_stable/catalog/templates/
trunk/extensions/HELPDESK_stable/catalog/templates/defaut/
trunk/extensions/HELPDESK_stable/catalog/templates/defaut/includes/
trunk/extensions/HELPDESK_stable/catalog/templates/defaut/includes/gabarit/
trunk/extensions/HELPDESK_stable/catalog/templates/defaut/includes/gabarit/helpdesk/
trunk/extensions/HELPDESK_stable/catalog/templates/defaut/includes/gabarit/helpdesk/account.display_view.add.gab
trunk/extensions/HELPDESK_stable/catalog/templates/defaut/includes/gabarit/helpdesk/account.display_view.page.gab
trunk/extensions/HELPDESK_stable/catalog/templates/defaut/includes/gabarit/helpdesk/account.display_view.view.gab
trunk/extensions/HELPDESK_stable/catalog/templates/defaut/includes/gabarit/helpdesk/box_view.gab
trunk/extensions/HELPDESK_stable/install.xml
trunk/extensions/HELPDESK_stable/readme
Added: trunk/extensions/HELPDESK_stable/catalog/includes/languages/fr_FR/modules/account/helpdesk/helpdesk.txt
===================================================================
--- trunk/extensions/HELPDESK_stable/catalog/includes/languages/fr_FR/modules/account/helpdesk/helpdesk.txt (rev 0)
+++ trunk/extensions/HELPDESK_stable/catalog/includes/languages/fr_FR/modules/account/helpdesk/helpdesk.txt 2013-08-11 15:50:52 UTC (rev 4802)
@@ -0,0 +1,73 @@
+<?php
+/**
+ @licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
+ @portion code Copyright (c) 2002 osCommerce
+ @package osCSS-2 <www http://www.oscss.org>
+ @version 2.1.1
+ @date 16/04/2012, 22:44
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+*/
+
+ /* Bouton/liens */
+ $lang['helpdesk small image button view']="Afficher" ;
+ $lang['helpdesk pdf link']="Pdf" ;
+
+ $lang['helpdesk breadcrumb']="Support" ;
+ $lang['helpdesk breadcrumb view']="ticket" ;
+ $lang['helpdesk breadcrumb add']="Nouveau ticket" ;
+
+ /* Widget */
+ $lang['helpdesk widget view']="Touts les ticket" ;
+ $lang['helpdesk widget add ticket']="Ouvrir un ticket" ;
+ $lang['helpdesk add new ticket']="Nouveau ticket" ;
+
+
+
+ /* Pleine page */
+ $lang['helpdesk heading listing']="Historique des Tickets" ;
+
+ $lang['helpdesk table heading number']="Numéro" ;
+ $lang['helpdesk table heading status']="Etat" ;
+ $lang['helpdesk table heading subject']="Sujet" ;
+ $lang['helpdesk table heading date']="Ouvert le" ;
+ $lang['helpdesk table heading date update']="Modifié le" ;
+ $lang['helpdesk table heading action']="" ;
+
+
+ $lang['helpdesk text display number of orders %s']="Affichage de la page %s" ;
+ $lang['helpdesk text result page']="Nombre de pages " ;
+
+ $lang['helpdesk no resultat orders']="Aucunes commandes " ;
+
+ /* Add one*/
+ $lang['helpdesk heading add']="Ouverture d'un ticket" ;
+ $lang['helpdesk entry category']="Catégorie" ;
+ $lang['helpdesk entry subject']="Sujet" ;
+ $lang['helpdesk entry enquiry']="Message" ;
+
+ /* View one*/
+ $lang['helpdesk heading view %s'] = "Ticket n° %s";
+ $lang['helpdesk table heading date opened']="Ouvert le" ;
+ $lang['helpdesk table heading last update']="Modifié le" ;
+ $lang['helpdesk table heading category']="Catégorie" ;
+ $lang['helpdesk table heading text']="Message" ;
+ $lang['helpdesk table heading history']="Historique" ;
+
+
+
+ $lang['helpdesk table heading history date']="Ouvert le" ;
+ $lang['helpdesk table heading history name']="Autheur" ;
+ $lang['helpdesk table heading history text']="Message" ;
+
+ $lang['helpdesk your author'] = "Vous";
+
+ $lang['helpdesk add comment in current ticket'] = "Repondre";
+
+ $lang['helpdesk status 0'] = "Nouveau";
+ $lang['helpdesk status 1'] = "Réponse en attente";
+ $lang['helpdesk status 2'] = "Répondu";
+ $lang['helpdesk status 3'] = "Résolu";
+ $lang['helpdesk status 4'] = "En traitement";
+ $lang['helpdesk status 5'] = "en attente";
+?>
\ No newline at end of file
Added: trunk/extensions/HELPDESK_stable/catalog/includes/modules/account/helpdesk/helpdesk.php
===================================================================
--- trunk/extensions/HELPDESK_stable/catalog/includes/modules/account/helpdesk/helpdesk.php (rev 0)
+++ trunk/extensions/HELPDESK_stable/catalog/includes/modules/account/helpdesk/helpdesk.php 2013-08-11 15:50:52 UTC (rev 4802)
@@ -0,0 +1,366 @@
+<?php
+/**
+ @licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
+ @portion code Copyright (c) 2002 osCommerce
+ @package osCSS-2 <www http://www.oscss.org>
+ @version 2.1.1
+ @date 15/04/2012, 22:44
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+ *\class helpdesk
+ *\group modules
+ *\brief Address book for customers
+*/
+
+class helpdesk
+ extends
+ AbstractAccount
+ implements
+ InterfaceModule
+ ,InterfaceAccount
+ {
+
+ /**
+ @var array
+ */
+ public static $current;
+ /**
+ @var array
+ */
+ public static $helpdesk_split;
+ /**
+ @var string action
+ */
+ public static $action ='';
+ /**
+ @var string
+ */
+ public static $type ='account';
+
+ public static $hdSoap ;
+ /**
+ @brief constructor
+ */
+ function __construct(){
+ $this->code =__CLASS__;
+ $this->type =self::$type;
+ $this->title = __('module helpdesk text title');
+ $this->description = __('module helpdesk text description') ;
+ $this->sort_order = (defined('MODULE_ACA_HISTORY_SORT_ORDER')) ? MODULE_ACA_HISTORY_SORT_ORDER : 0;
+ $this->enabled = true;
+
+
+ $this->sql_data_array=array();
+ $this->cInfo = new objectInfo(array());
+
+ // adjust action
+ if(isset($_GET['action']))
+ self::$action = tep_db_prepare_input($_GET['action']);
+ elseif(isset($_GET['aca_action']))
+ self::$action = tep_db_prepare_input($_GET['aca_action']);
+
+
+ define('HELPDESK_URL_SOAP', 'http://support.devzeweb.net/soap');
+ define('HELPDESK_OWNER_LOGIN', 'auto_oscss');
+ define('HELPDESK_OWNER_PASS', 'auto_oscss');
+
+// $conf->global->ticketfree_HESK_BASE
+
+ require_once(dirname(__FILE__).'/helpdesk.soap.php');
+
+ $res = self::$hdSoap = new soap();
+// var_dump(self::$hdSoap);
+ }
+
+ public function get_header($action=''){
+ global $page;
+
+ $breadcrumb=$page->return_object('breadcrumb');
+ $customer_id=$page->the_var('customer_id');
+
+ if($_REQUEST['aca_mod'] == $this->code)
+ switch(self::$action){
+ case 'ab_add':
+ $breadcrumb->add(__("helpdesk breadcrumb"), self::href_link());
+ $breadcrumb->add(__("helpdesk breadcrumb add"), self::href_link('add'));
+ break;
+ case 'ab_view':
+ $breadcrumb->add(__("helpdesk breadcrumb"), self::href_link());
+ $breadcrumb->add(__("helpdesk breadcrumb view"), self::href_link('view', 'id='.$_GET['id']));
+ break;
+ case 'display_view':
+ $breadcrumb->add(__("helpdesk breadcrumb"), self::href_link());
+ break;
+ }
+
+ }
+
+ /**
+ * \fn check_action($action)
+ * \brief Action exe
+ * @param $action string la var d'action
+ * @p $cID int recupere le Session[]
+ */
+ public function check_action($action) {
+
+ if (!tep_session_is_registered('customer_id')) return false;
+
+ global $page;
+ $customer_id=$page->the_var('customer_id');
+
+
+ switch(self::$action){
+ case 'ab_insert':
+
+ $custo=customer::getInstance();
+
+ $res= self::$hdSoap->submit_ticket(
+ $custo->customer['customers_lastname'],
+ $custo->customer['customers_email_address'],
+ tep_db_input($_REQUEST['category']), //$category,
+ 3,//$priority,
+ 0,//$owner,
+ tep_db_input($_REQUEST['subject']), //$subject,
+ tep_db_input($_REQUEST['enquiry']), //$message,
+ false, //$send_email,
+ $_REQUEST['custom'],
+ array(),
+ ''
+ );
+
+ break;
+
+ case 'ab_insert_reply':
+
+ $custo=customer::getInstance();
+
+ $res= self::$hdSoap->set_replies(
+ tep_db_input($_REQUEST['enquiry']), //$message,
+ tep_db_input($_REQUEST['id']),
+ $custo->customer['customers_lastname'],
+ 0//$staffid,
+ );
+
+
+ break;
+ }
+
+ return true;
+ }
+
+ /**
+ @fn after_check_action ($action)
+ @brief call after check_action incurrent module
+ @return none
+ */
+ public function after_check_action ($action) {
+ if($action=='new') tep_redirect(tep_href_link(FILENAME_ACCOUNT, 'aca_mod='.$this->code.'&aca_type='.$this->type.'&aca_action=display_view', 'SSL'));
+ }
+
+
+
+ /**
+ */
+ public function load_db_values($cID) {
+ global $languages_id;
+
+ $DB=Database::getInstance();
+
+
+
+
+ switch(self::$action){
+ case 'ab_view':
+
+// $userlist = self::$hdSoap->GetUsers();
+// foreach($userlist as $row)
+// $users[$row['id']]= new objectInfo($row);
+
+ $ticket = self::$hdSoap->get_ticket_id($_GET['id']);
+
+ $cats=self::$hdSoap->get_categories();
+ foreach($cats['CATEGORIES'] as $row)
+ if($ticket['category'] == $row['id'])
+ $ticket['category_name'] = $row['name'];
+
+// $prio=self::$hdSoap->get_priorities();
+// foreach($prio as $k=>$row)
+// if($ticket['status'] == $k)
+ $ticket['status_name'] = __('helpdesk status '.$ticket['status']);
+
+ $note = self::$hdSoap->get_note($_GET['id']);
+
+
+ foreach(self::$hdSoap->Get_replies($_GET['id']) as $row){
+ $ticket['allreply'][] = new objectInfo($row);
+ }
+
+ self::$hdSoap->logout();
+ $result = new objectInfo($ticket);
+
+ break;
+ case 'display_view':
+ $custo=customer::getInstance();
+
+ $allticket = self::$hdSoap->search_ticket($custo->customer['customers_email_address']);
+ foreach($allticket['TICKETS'] as $key=>$row){
+ $row->linkView = self::href_link('view', 'id='.$row->id);
+ $result[] = $row;
+ }
+
+
+ krsort($result);
+ break;
+
+ default:
+
+ $orders_query = tep_db_query("select o.orders_id,o.orders_ref, o.date_purchased, o.delivery_name, o.delivery_country, o.billing_name, o.billing_country, ot.text as order_total, s.status_name as orders_status_name from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_TOTAL . " ot, " . TABLE_STATUS . " s where o.customers_id = '" . (int)$cID . "' and o.orders_id = ot.orders_id and ot.class = 'ot_total' and o.orders_status = s.status_id and s.language_id = '" . (int)$languages_id . "' AND status_type='orders' ORDER BY orders_id desc limit 1");
+
+ $result = $orders_query->fetchAssoc();
+ }
+
+ return ($result);
+ }
+
+
+
+
+ /**
+ List des element du block my account
+ */
+// public function display_view_min_listMyOrders($cID){
+// global $page;
+//
+// $v['title']=__("helpdesk tab");
+// $v['href_link']= tep_href_link(FILENAME_ACCOUNT, 'aca_mod='.$this->code.'&aca_type='.$this->type.'&aca_action=display_view', 'SSL');
+// return array(new objectInfo($v));
+// }
+
+ /**
+ * \fn display_view($pID='')
+ * \brief Affiche Block edit/modif reviews
+ * @param $pID int id products
+ * @p $customer_id int current
+ */
+ public function display_view($pID=''){
+ global $page;
+
+ $customer_id=$page->the_var('customer_id');
+
+ switch(self::$action){
+ case 'ab_view':
+ self::$current = $this->load_db_values($customer_id);
+
+ return new objectInfo(array(
+ 'title'=>sprintf(__("helpdesk heading view %s") , self::$current->trackid),
+ 'content'=> tep_output_string_protected(tep_get_include_contents(__CLASS__.'/'.$this->type.'.'.__FUNCTION__.'.view'),false,true)
+ ) );
+ break;
+ case 'ab_add':
+
+ return new objectInfo(array(
+ 'title'=>__("helpdesk heading add"),
+ 'content'=> tep_output_string_protected(tep_get_include_contents(__CLASS__.'/'.$this->type.'.'.__FUNCTION__.'.add'),false,true)
+ ) );
+ break;
+ case 'display_view':
+
+ self::$current = $this->load_db_values($customer_id);
+
+ return new objectInfo(array(
+ 'title'=>__("helpdesk heading listing"),
+ 'content'=> tep_output_string_protected(tep_get_include_contents(__CLASS__.'/'.$this->type.'.'.__FUNCTION__.'.page'),false,true)
+ ) );
+ break;
+ default:
+ self::$current = $this->load_db_values($customer_id);
+
+ $v['title']=__("helpdesk widget view");
+ $v['href']= tep_href_link(FILENAME_ACCOUNT, 'aca_mod='.$this->code.'&aca_type='.$this->type.'&aca_action=display_view', 'SSL');
+ $v['content']=tep_output_string_protected(tep_get_include_contents(__CLASS__.'/box_view'),false,true);
+ return new objectInfo(array(
+ 'type'=>'box',
+ 'conteneur'=>array(new objectInfo( $v ))
+ ));
+ }
+ }
+
+
+ /**
+ @brief internal link
+ @param classic action
+ @param other paams by strign GET format
+ @return href
+ */
+ static function href_link($action='', $params=''){
+ $base = 'aca_mod='.__CLASS__.'&aca_type='.self::$type.'&aca_action=';
+ switch ($action) {
+ case 'add':
+ $base .='display_view&action=ab_'.$action.'&'.$params;
+ break;
+ case 'view':
+ case 'delete':
+ case 'edit':
+ $base .='display_view&action=ab_'.$action.'&'.$params;
+ break;
+ case 'page':
+ $base .='display_view';
+ break;
+ default:
+ $base .='display_view'. ((!empty($action))?'&action=ab_'.$action : '');
+ }
+
+
+ return tep_href_link(FILENAME_ACCOUNT, $base, 'SSL');
+ }
+
+ /**
+ @remarks implements InterfaceModule depend
+ if module twin in backoffice, report all content install in the other module
+ public function check() {return true;}
+ public function install() {return true;}
+ public function remove() {return true;}
+ public function keys() {return array(); }
+ */
+
+ /**
+ @fn check()
+ @brief test if count all var , and keys is equal
+ @return boolean true/false
+ */
+ function check() { return false; }
+
+
+ /**
+ @fn keys()
+ @return array all key configuration define by this module
+ */
+ function keys() {
+ return array();
+ }
+
+ /**
+ @fn install()
+ @brief add all configuration
+ @note
+ - Modules can emarquer sql installation instructions, however, in the case of transverse information, or dependent of an extension, preferring the implementation of an extension, file with sql independent
+ - please, pefix all var configuration by 'MODULE_OT__MODTYPENAME_MAJ_'
+ - if module twin in backoffice, report all content install in the other module
+ - Not use language in DB , but function :__()
+ for MODULE_TOTO_ST
+ var title MODULE_TOTO_ST_S (small description)
+ var description MODULE_TOTO_ST_L (long description)
+ */
+ function install() { return false; }
+
+ /**
+ @fn remove()
+ @brief delete all configuration
+ @note
+ - please, pefix all var configuration by 'MODULE_PAYMENT__MODTYPENAME_MAJ_'
+ - if module twin in backoffice, report all content remove in the other module
+ */
+ function remove() { return false; }
+}
+
+?>
\ No newline at end of file
Added: trunk/extensions/HELPDESK_stable/catalog/includes/modules/account/helpdesk/helpdesk.soap.php
===================================================================
--- trunk/extensions/HELPDESK_stable/catalog/includes/modules/account/helpdesk/helpdesk.soap.php (rev 0)
+++ trunk/extensions/HELPDESK_stable/catalog/includes/modules/account/helpdesk/helpdesk.soap.php 2013-08-11 15:50:52 UTC (rev 4802)
@@ -0,0 +1,798 @@
+<?php
+
+/*
+ * Copyright (C) 2012 jacquel jerome <icf...@fr...>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+class soap {
+
+ var $session;
+ var $user;
+ var $pass;
+ var $hash;
+
+ // list permission.
+ /* manage users */
+
+ const PERM_CAN_MAN_USERS = 'can_man_users';
+ /* manage kb */
+ const PERM_CAN_MAN_KB = 'can_man_kb';
+ /* manage categories */
+ const PERM_CAN_MAN_CAT = 'can_man_cat';
+ /* reply tickets */
+ const PERM_CAN_REPLY_TICKETS = 'can_reply_tickets';
+ /* delete tickets */
+ const PERM_CAN_DEL_TICKETS = 'can_del_tickets';
+ /* edit tickets */
+ const PERM_CAN_EDIT_TICKETS = 'can_edit_tickets';
+ /* view tickets */
+ const PERM_CAN_VIEW_TICKETS = 'can_view_tickets';
+ /* delete notes */
+ const PERM_CAN_DEL_NOTES = 'can_del_notes';
+ // reply ticket
+ // merge ticket
+ const PERM_CAN_MERGE_TICKETS = 'can_merge_tickets';
+ // CHANGE CATEGORIE
+ const PERM_CAN_CHANGE_CAT = 'can_change_cat';
+ // MANAGE CANNED
+ const PERM_CAN_MAN_CANNED = 'can_man_canned';
+ const PERM_CAN_ADD_ARCHIVE = 'can_add_archive';
+ const PERM_CAN_ASSIGN_SELF = 'can_assign_self';
+ const PERM_CAN_ASSIGN_OTHERS = 'can_assign_others';
+ const PERM_CAN_VIEW_UNASSIGNED = 'can_view_unassigned';
+ const PERM_CAN_VIEW_ASS_OTHERS = 'can_view_ass_others';
+ const PERM_CAN_VIEW_ONLINE = 'can_view_online';
+
+ function soap(/*$DB, $idhesk*/) {
+ global $conf;
+// $this->db = $DB;
+ $this->user = HELPDESK_OWNER_LOGIN; //$conf->global->ticketfree_login_admin;
+ $this->pass = HELPDESK_OWNER_PASS; //$conf->global->ticketfree_pass_admin;
+ $this->hash = FALSE; //$conf->global->ticketfree_pass_hash;
+// $userhesk = $this->GetUsers();
+// $this->user = '';
+// $this->pass = '';
+// $this->hash = '';
+// if (is_array($userhesk)){
+// foreach ($userhesk as $v) {
+//
+//
+// if ($v['id'] == $idhesk) {
+// $this->user = $v['user'];
+// $this->pass = $v['pass'];
+// $this->hash = TRUE;
+// }
+// }
+
+ $this->login($this->user, $this->pass, $this->hash);
+// } else {
+// print $userhesk;
+// }
+ }
+
+
+ function GetUsers() {
+ global $conf;
+ try {
+ if (!defined('IN_SCRIPT')) {
+ /**
+ * required by Hesk
+ */
+ define('IN_SCRIPT', 1);
+ }
+ //todo dinamic location
+ // configuration.
+ $ConfigSoap = array(
+ 'soap_version' => SOAP_1_2,
+ 'encoding' => 'UTF-8',
+ 'location' => HELPDESK_URL_SOAP,
+ 'uri' => HELPDESK_URL_SOAP,
+ 'wsdl_cache' => 0,
+ 'trace' => 1
+ );
+ // create SOAP client.
+
+ $client = new SoapClient(null, $ConfigSoap);
+ // required to store authentication to the service.
+ $client->__setCookie('session_id', session_id());
+ try {
+ //$session = $client->login('administrator','admin');
+ if($this->session ==null)
+ $this->login($this->user, $this->pass, $this->hash);
+
+ $response = $client->get_users($this->session);
+ } catch (SoapFault $e) {
+
+ $response = 'get user: ' . $e->getMessage();
+ //$response = $client->__getLastResponse(); //=
+ }
+
+
+ // echo $client->__getLastResponse();
+ } catch (Exception $e) {
+ $response = 'Get user Error: ' . $e->getMessage();
+ }
+
+ return $response;
+ }
+
+ function get_service_version() {
+ global $conf;
+ try {
+ if (!defined('IN_SCRIPT')) {
+ /**
+ * required by Hesk
+ */
+ define('IN_SCRIPT', 1);
+ }
+ //todo dinamic location
+ // configuration.
+ $ConfigSoap = array(
+ 'soap_version' => SOAP_1_2,
+ 'encoding' => 'UTF-8',
+ 'location' => HELPDESK_URL_SOAP,
+ 'uri' => HELPDESK_URL_SOAP,
+ 'wsdl_cache' => 0,
+ 'trace' => 1
+ );
+ // create SOAP client.
+ $client = new SoapClient(null, $ConfigSoap);
+ // required to store authentication to the service.
+ $client->__setCookie('session_id', session_id());
+ try {
+
+ $response = $client->get_service_version();
+ } catch (SoapFault $e) {
+
+ throw new SoapFault(__METHOD__, $e);
+ }
+
+
+ // echo $client->__getLastResponse();
+ } catch (Exception $e) {
+ throw new SoapFault(__METHOD__, $e);
+ }
+
+ return $response;
+ }
+
+
+ function get_question_use() {
+ global $conf;
+ try {
+ if (!defined('IN_SCRIPT')) {
+ /**
+ * required by Hesk
+ */
+ define('IN_SCRIPT', 1);
+ }
+ //todo dinamic location
+ // configuration.
+ $ConfigSoap = array(
+ 'soap_version' => SOAP_1_2,
+ 'encoding' => 'UTF-8',
+ 'location' => HELPDESK_URL_SOAP,
+ 'uri' => HELPDESK_URL_SOAP,
+ 'wsdl_cache' => 0,
+ 'trace' => 1
+ );
+ // create SOAP client.
+ $client = new SoapClient(null, $ConfigSoap);
+ // required to store authentication to the service.
+ $client->__setCookie('session_id', session_id());
+ try {
+
+ $response = $client->get_question_use();
+ } catch (SoapFault $e) {
+
+ $response = 'get_question_use Error: ' . $e->getMessage();
+ }
+
+
+ // echo $client->__getLastResponse();
+ } catch (Exception $e) {
+ $reponse = 'get_question_use Error: ' . $e->getMessage();
+ }
+
+ return $response;
+ }
+
+
+ function get_custom_fields() {
+ global $conf;
+ try {
+ if (!defined('IN_SCRIPT')) {
+ /**
+ * required by Hesk
+ */
+ define('IN_SCRIPT', 1);
+ }
+ //todo dinamic location
+ // configuration.
+ $ConfigSoap = array(
+ 'soap_version' => SOAP_1_2,
+ 'encoding' => 'UTF-8',
+ 'location' => HELPDESK_URL_SOAP,
+ 'uri' => HELPDESK_URL_SOAP,
+ 'wsdl_cache' => 0,
+ 'trace' => 1
+ );
+ // create SOAP client.
+ $client = new SoapClient(null, $ConfigSoap);
+ // required to store authentication to the service.
+ $client->__setCookie('session_id', session_id());
+ try {
+
+ $response = $client->get_custom_fields();
+ return json_decode($response);
+ } catch (SoapFault $e) {
+
+ return 'get_custom_fields :' . $e->getMessage();
+ }
+
+
+ //echo $client->__getLastResponse();
+ } catch (Exception $e) {
+ return 'get_custom_fields :' . $e->getMessage();
+ }
+ }
+
+
+
+ function get_priorities() {
+ global $conf;
+ try {
+ if (!defined('IN_SCRIPT')) {
+ /**
+ * required by Hesk
+ */
+ define('IN_SCRIPT', 1);
+ }
+ //todo dinamic location
+ // configuration.
+ $ConfigSoap = array(
+ 'soap_version' => SOAP_1_2,
+ 'encoding' => 'UTF-8',
+ 'location' => HELPDESK_URL_SOAP,
+ 'uri' => HELPDESK_URL_SOAP,
+ 'wsdl_cache' => 0,
+ 'trace' => 1
+ );
+ // create SOAP client.
+ $client = new SoapClient(null, $ConfigSoap);
+ // required to store authentication to the service.
+ $client->__setCookie('session_id', session_id());
+ try {
+
+ $response = $client->get_priorities();
+
+ return $response;
+ } catch (SoapFault $e) {
+
+ return 'get priorité :' . $e->getMessage();
+ }
+
+
+ //echo $client->__getLastResponse();
+ } catch (Exception $e) {
+ return 'get priorité :' . $e->getMessage();
+ }
+ }
+
+
+
+ function get_categories($iduser = 0) {
+ global $conf;
+ try {
+ if (!defined('IN_SCRIPT')) {
+ /**
+ * required by Hesk
+ */
+ define('IN_SCRIPT', 1);
+ }
+ //todo dinamic location
+ // configuration.
+ $ConfigSoap = array(
+ 'soap_version' => SOAP_1_2,
+ 'encoding' => 'UTF-8',
+ 'location' => HELPDESK_URL_SOAP,
+ 'uri' => HELPDESK_URL_SOAP,
+ 'wsdl_cache' => 0,
+ 'trace' => 1
+ );
+ // create SOAP client.
+ $client = new SoapClient(null, $ConfigSoap);
+ // required to store authentication to the service.
+ $client->__setCookie('session_id', session_id());
+ try {
+ if($this->session ==null)
+ $this->login($this->user, $this->pass, $this->hash);
+
+ $response = $client->get_categories($this->session, $iduser);
+ return $response;
+ } catch (SoapFault $e) {
+
+ return 'Get gategories :' . $e->getMessage();
+ }
+
+
+ //echo $client->__getLastResponse();
+ } catch (Exception $e) {
+ return 'Get gategories :' . $e->getMessage();
+ }
+ }
+
+ function login($userhesk, $passhesk, $hash) {
+ global $conf;
+ try {
+ if (!defined('IN_SCRIPT')) {
+ /**
+ * required by Hesk
+ */
+ define('IN_SCRIPT', 1);
+ }
+ //todo dinamic location
+ // configuration.
+ $ConfigSoap = array(
+ 'soap_version' => SOAP_1_2,
+ 'encoding' => 'UTF-8',
+ 'location' => HELPDESK_URL_SOAP,
+ 'uri' => HELPDESK_URL_SOAP,
+ 'wsdl_cache' => 0,
+ 'trace' => 1
+ );
+ // create SOAP client.
+ $client = new SoapClient(null, $ConfigSoap);
+ // required to store authentication to the service.
+ $client->__setCookie('session_id', session_id());
+ try {
+
+ $response = $client->login($userhesk, $passhesk, $hash);
+ $this->session = $response;
+ return $response;
+ } catch (SoapFault $e) {
+
+ return 'Login :' . $e->getMessage();
+ }
+
+
+ //echo $client->__getLastResponse();
+ } catch (Exception $e) {
+ return 'Login :' . $e->getMessage();
+ }
+ }
+
+
+ public function logout() {
+ global $conf;
+ try {
+ if (!defined('IN_SCRIPT')) {
+ /**
+ * required by Hesk
+ */
+ define('IN_SCRIPT', 1);
+ }
+ //todo dinamic location
+ // configuration.
+ $ConfigSoap = array(
+ 'soap_version' => SOAP_1_2,
+ 'encoding' => 'UTF-8',
+ 'location' => HELPDESK_URL_SOAP,
+ 'uri' => HELPDESK_URL_SOAP,
+ 'wsdl_cache' => 0,
+ 'trace' => 1
+ );
+ // create SOAP client.
+ $client = new SoapClient(null, $ConfigSoap);
+ // required to store authentication to the service.
+ $client->__setCookie('session_id', session_id());
+ try {
+
+ $response = $client->logout();
+ return $response;
+ } catch (SoapFault $e) {
+
+ return 'logout :' . $e->getMessage();
+ }
+
+
+ //echo $client->__getLastResponse();
+ } catch (Exception $e) {
+ return 'logout :' . $e->getMessage();
+ }
+ }
+
+
+ function get_ticket_id($id) {
+ global $conf;
+ try {
+ if (!defined('IN_SCRIPT')) {
+ /**
+ * required by Hesk
+ */
+ define('IN_SCRIPT', 1);
+ }
+ //todo dinamic location
+ // configuration.
+ $ConfigSoap = array(
+ 'soap_version' => SOAP_1_2,
+ 'encoding' => 'ISO-8859-1',
+ 'location' => HELPDESK_URL_SOAP,
+ 'uri' => HELPDESK_URL_SOAP,
+ 'wsdl_cache' => 0,
+ 'trace' => 1
+ );
+ // create SOAP client.
+ $client = new SoapClient(null, $ConfigSoap);
+ // required to store authentication to the service.
+ $client->__setCookie('session_id', session_id());
+
+ try {
+ if($this->session ==null)
+ $this->login($this->user, $this->pass, $this->hash);
+ $response = $client->get_ticket_id($id, $this->session);
+ } catch (SoapFault $e) {
+
+ $response = $e->getMessage();
+ //return $client->__getLastResponse();
+ }
+
+
+ //echo $client->__getLastResponse();
+ } catch (Exception $e) {
+ $response = $e->getMessage();
+ }
+
+ return $response;
+ }
+
+ function get_all_ticket($idowner = 0, $sortfield = 0, $sortorder = 0) {
+ global $conf;
+ try {
+ if (!defined('IN_SCRIPT')) {
+ /**
+ * required by Hesk
+ */
+ define('IN_SCRIPT', 1);
+ }
+ //todo dinamic location
+ // configuration.
+ $ConfigSoap = array(
+ 'soap_version' => SOAP_1_2,
+ 'encoding' => 'UTF-8',
+ 'location' => HELPDESK_URL_SOAP,
+ 'uri' => HELPDESK_URL_SOAP,
+ 'wsdl_cache' => 0,
+ 'trace' => 1
+ );
+ // create SOAP client.
+ $client = new SoapClient(null, $ConfigSoap);
+ // required to store authentication to the service.
+ $client->__setCookie('session_id', session_id());
+ try {
+ if($this->session ==null)
+ $this->login($this->user, $this->pass, $this->hash);
+ $response = $client->get_all_ticket($idowner, $sortfield, $sortorder, $this->session);
+
+ return $response;
+ } catch (SoapFault $e) {
+
+ //return $e->getMessage() ;
+ return 'Get all ticket: ' . $client->__getLastResponse();
+ }
+
+
+ // echo $client->__getLastResponse();
+ } catch (Exception $e) {
+ return 'Get all ticket :' . $e->getMessage();
+ }
+ }
+
+ function get_ticket($trackingID) {
+ global $conf;
+ try {
+ if (!defined('IN_SCRIPT')) {
+ /**
+ * required by Hesk
+ */
+ define('IN_SCRIPT', 1);
+ }
+ //todo dinamic location
+ // configuration.
+ $ConfigSoap = array(
+ 'soap_version' => SOAP_1_2,
+ 'encoding' => 'UTF-8',
+ 'location' => HELPDESK_URL_SOAP,
+ 'uri' => HELPDESK_URL_SOAP,
+ 'wsdl_cache' => 0,
+ 'trace' => 1
+ );
+ // create SOAP client.
+ $client = new SoapClient(null, $ConfigSoap);
+ // required to store authentication to the service.
+ $client->__setCookie('session_id', session_id());
+ try {
+ if($this->session ==null)
+ $this->login($this->user, $this->pass, $this->hash);
+ $response = $client->get_ticket($trackingID, $this->session);
+ } catch (SoapFault $e) {
+
+ //$response = $e->getMessage();
+ return 'Get ticket ' . $client->__getLastResponse();
+ }
+
+
+ // echo $client->__getLastResponse();
+ } catch (Exception $e) {
+ $response = 'Get ticket :' . $e->getMessage();
+ }
+
+ return $response;
+ }
+
+ function search_ticket($value_email) {
+ global $conf;
+ try {
+ if (!defined('IN_SCRIPT')) {
+ /**
+ * required by Hesk
+ */
+ define('IN_SCRIPT', 1);
+ }
+ //todo dinamic location
+ // configuration.
+ $ConfigSoap = array(
+ 'soap_version' => SOAP_1_2,
+ 'encoding' => 'UTF-8',
+ 'location' => HELPDESK_URL_SOAP,
+ 'uri' => HELPDESK_URL_SOAP,
+ 'wsdl_cache' => 0,
+ 'trace' => 1
+ );
+ // create SOAP client.
+ $client = new SoapClient(null, $ConfigSoap);
+ // required to store authentication to the service.
+ $client->__setCookie('session_id', session_id());
+ try {
+ if($this->session ==null)
+ $this->login($this->user, $this->pass, $this->hash);
+// $response = $client->search_ticket($value, $what = 'subject', $archive = 0, $limit = 0, $sort = 'status', $asc = 0, $this->session);
+ $response = $client->search_ticket($value_email, 'email', 0, 0, 'status', 0, $this->session);
+// $response = $client->search_ticket('oscim', 'name', 0, 0, 'status', 0, $this->session);
+
+ return $response;
+ } catch (SoapFault $e) {
+
+ //return $e->getMessage() ;
+ return 'search_ticket: ' . $client->__getLastResponse();
+ }
+
+
+ // echo $client->__getLastResponse();
+ } catch (Exception $e) {
+ return 'search_ticket :' . $e->getMessage();
+ }
+ }
+
+ function submit_ticket($name, $email, $category, $priority, $owner, $subject, $message, $send_email, $custom_fields = array(), $attachments = array(), $question_ans = '') {
+ global $conf;
+
+ try {
+ if (!defined('IN_SCRIPT')) {
+ /**
+ * required by Hesk
+ */
+ define('IN_SCRIPT', 1);
+ }
+ //todo dinamic location
+ // configuration.
+ $ConfigSoap = array(
+ 'soap_version' => SOAP_1_2,
+ 'encoding' => 'UTF-8',
+ 'location' => HELPDESK_URL_SOAP,
+ 'uri' => HELPDESK_URL_SOAP,
+ 'wsdl_cache' => 0,
+ 'trace' => 1
+ );
+ // create SOAP client.
+ $client = new SoapClient(null, $ConfigSoap);
+ // required to store authentication to the service.
+ $client->__setCookie('session_id', session_id());
+ try {
+
+ $response = $client->submit_ticket($name, $email, $category, $priority, $owner, $subject, $message, $send_email, $custom_fields, $attachments , $question_ans , $this->session) ;
+ return $response;
+ } catch (SoapFault $e) {
+
+ return $e->getMessage();
+ }
+
+
+ // echo $client->__getLastResponse();
+ } catch (Exception $e) {
+ return 'submit_ticket :' . $e->getMessage();
+ }
+ }
+
+
+ function set_replies($message, $idticket, $hesk_username, $id) {
+ global $conf;
+
+ try {
+ if (!defined('IN_SCRIPT')) {
+ /**
+ * required by Hesk
+ */
+ define('IN_SCRIPT', 1);
+ }
+ //todo dinamic location
+ // configuration.
+ $ConfigSoap = array(
+ 'soap_version' => SOAP_1_2,
+ 'encoding' => 'UTF-8',
+ 'location' => HELPDESK_URL_SOAP,
+ 'uri' => HELPDESK_URL_SOAP,
+ 'wsdl_cache' => 0,
+ 'trace' => 1
+ );
+ // create SOAP client.
+ $client = new SoapClient(null, $ConfigSoap);
+ // required to store authentication to the service.
+ $client->__setCookie('session_id', session_id());
+ try {
+
+ $response = $client-> set_replies($message, $idticket, $hesk_username, $id,$this->session) ;
+ return $response;
+ } catch (SoapFault $e) {
+
+ return $e->getMessage();
+ }
+
+
+ // echo $client->__getLastResponse();
+ } catch (Exception $e) {
+ return 'set_replies :' . $e->getMessage();
+ }
+ }
+
+
+ function get_note($id) {
+ global $conf;
+
+ try {
+ if (!defined('IN_SCRIPT')) {
+ /**
+ * required by Hesk
+ */
+ define('IN_SCRIPT', 1);
+ }
+ //todo dinamic location
+ // configuration.
+ $ConfigSoap = array(
+ 'soap_version' => SOAP_1_2,
+ 'encoding' => 'UTF-8',
+ 'location' => HELPDESK_URL_SOAP,
+ 'uri' => HELPDESK_URL_SOAP,
+ 'wsdl_cache' => 0,
+ 'trace' => 1
+ );
+ // create SOAP client.
+ $client = new SoapClient(null, $ConfigSoap);
+ // required to store authentication to the service.
+ $client->__setCookie('session_id', session_id());
+ try {
+
+ $response = $client->get_note($id);
+ return $response;
+ } catch (SoapFault $e) {
+
+ return $e->getMessage();
+ }
+
+
+ // echo $client->__getLastResponse();
+ } catch (Exception $e) {
+ return 'Get note :' . $e->getMessage();
+ }
+ }
+
+
+
+ function get_replies($id) {
+ global $conf;
+ try {
+ if (!defined('IN_SCRIPT')) {
+ /**
+ * required by Hesk
+ */
+ define('IN_SCRIPT', 1);
+ }
+ //todo dinamic location
+ // configuration.
+ $ConfigSoap = array(
+ 'soap_version' => SOAP_1_2,
+ 'encoding' => 'UTF-8',
+ 'location' => HELPDESK_URL_SOAP,
+ 'uri' => HELPDESK_URL_SOAP,
+ 'wsdl_cache' => 0,
+ 'trace' => 1
+ );
+ // create SOAP client.
+ $client = new SoapClient(null, $ConfigSoap);
+ // required to store authentication to the service.
+ $client->__setCookie('session_id', session_id());
+ try {
+ if($this->session ==null)
+ $this->login($this->user, $this->pass, $this->hash);
+ $response = $client->get_replies($id, $this->session);
+ } catch (SoapFault $e) {
+
+ return 'Get replies :' . $e->getMessage();
+ }
+
+
+ // echo $client->__getLastResponse();
+ } catch (Exception $e) {
+ return 'Get replies :' . $e->getMessage();
+ }
+
+ return $response;
+ }
+
+
+ private function check_permission($permission) {
+
+ if (!$this->session['isadmin'] && (strpos($this->session['heskprivileges'], $permission) === false)) {
+ return FALSE;
+ } else {
+ return TRUE;
+ }
+ }
+
+ function check_categorie($idcat) {
+ global $soap;
+ if (($this->session['isadmin']) || (in_array($idcat, $this->session['categories'])))
+ return TRUE;
+ }
+
+ /* check if ticket is visible for user
+ *
+ * @return true if visible
+ *
+ */
+
+ function check_view_ticket($ticket) {
+
+ $view = $view_other = $view_unassigned = true;
+
+ $view = $this->check_permission(self::PERM_CAN_VIEW_TICKETS);
+
+ if ($ticket['owner'] == 0)
+ $view_unassigned = $this->check_permission(self::PERM_CAN_VIEW_UNASSIGNED);
+
+ if ($ticket['owner'] != $this->session['id'] && $ticket['owner'] != 0)
+ $view_other = $this->check_permission(self::PERM_CAN_VIEW_ASS_OTHERS);
+
+ $cat = $this->check_categorie($ticket['category']);
+
+
+ if ($this->session['isadmin'] || ($view && $view_other && $view_unassigned && $cat))
+ return TRUE;
+ }
+
+}
+
+?>
Added: trunk/extensions/HELPDESK_stable/catalog/templates/defaut/includes/gabarit/helpdesk/account.display_view.add.gab
===================================================================
--- trunk/extensions/HELPDESK_stable/catalog/templates/defaut/includes/gabarit/helpdesk/account.display_view.add.gab (rev 0)
+++ trunk/extensions/HELPDESK_stable/catalog/templates/defaut/includes/gabarit/helpdesk/account.display_view.add.gab 2013-08-11 15:50:52 UTC (rev 4802)
@@ -0,0 +1,61 @@
+<?php
+/**
+ @licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
+ @portion code Copyright (c) 2002 osCommerce
+ @package osCSS-2 <www http://www.oscss.org>
+ @version 2.1.1
+ @date 04/07/2013, 22:44
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+ @brief This listing orders for module account/helpdesk
+*/
+global $language,$customer_id;
+
+// print_r();
+$cats=helpdesk::$hdSoap->get_categories();
+foreach($cats['CATEGORIES'] as $row)
+$list_cat[] = array('id'=>$row['id'], 'text'=>$row['name']);
+
+?>
+<div class="main-helpdesk">
+
+ <?php echo tep_draw_form('contact_us', helpdesk::href_link('insert')); ?>
+ <ul>
+ <li>
+ <label for="name"><?php echo __('helpdesk entry category'); ?></label>
+ <?php echo tep_draw_pull_down_menu('category','category',$list_cat); ?>
+ </li>
+ <?php foreach(helpdesk::$hdSoap->get_custom_fields() as $k=>$row):
+ if($row->use == 1):
+ echo '<label for="custom'.$k.'">'.$row->name.'</label>';
+
+ switch($row->type){
+ case 'text':
+ default:
+ echo tep_draw_input_field('custom['.$k/*substr($k,6)*/.']',''.$k, $row->value,( ($row->maxlen)? ' maxlength="'.$row->maxlen.'" ' : false ).'', ( ($row->req)? true : false ) );
+ }
+ ?>
+ <?php endif; endforeach; ?>
+
+ <li>
+ <label for="name"><?php echo __('helpdesk entry subject'); ?></label>
+ <?php echo tep_draw_input_field('subject','subject'); ?>
+ </li>
+ <li>
+ <label for="name"><?php echo __('helpdesk entry enquiry'); ?></label>
+ <?php echo tep_draw_textarea_field('enquiry', 'enquiry', '48', '15'); ?>
+ </li>
+
+ <li>
+ <?php echo tep_image_submit('submit', 'submit'); ?>
+ </li>
+ </ul>
+
+ </form>
+
+
+ <div class="navBt">
+ <?php echo '<a class="navBt" href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . IMAGE_BUTTON_BACK . '</a>'; ?>
+ </div>
+
+</div>
\ No newline at end of file
Added: trunk/extensions/HELPDESK_stable/catalog/templates/defaut/includes/gabarit/helpdesk/account.display_view.page.gab
===================================================================
--- trunk/extensions/HELPDESK_stable/catalog/templates/defaut/includes/gabarit/helpdesk/account.display_view.page.gab (rev 0)
+++ trunk/extensions/HELPDESK_stable/catalog/templates/defaut/includes/gabarit/helpdesk/account.display_view.page.gab 2013-08-11 15:50:52 UTC (rev 4802)
@@ -0,0 +1,76 @@
+<?php
+/**
+ @licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
+ @portion code Copyright (c) 2002 osCommerce
+ @package osCSS-2 <www http://www.oscss.org>
+ @version 2.1.1
+ @date 04/07/2013, 22:44
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+ @brief This listing orders for module account/helpdesk
+*/
+global $language,$customer_id;
+
+
+?>
+<div class="main-helpdesk">
+
+ <?php if (count(helpdesk::$current) > 0): ?>
+
+
+ <table>
+ <thead>
+ <tr>
+ <th><?php echo __('helpdesk table heading number'); ?></th>
+ <th><?php echo __('helpdesk table heading status'); ?></th>
+ <th><?php echo __('helpdesk table heading subject'); ?></th>
+ <th><?php echo __('helpdesk table heading date'); ?></th>
+ <th><?php echo __('helpdesk table heading date update'); ?></th>
+ <th><?php echo __('helpdesk table heading action'); ?></th>
+ </tr>
+ </thead>
+ <tbody>
+ <?php foreach(helpdesk::$current as $row): /*print_r($row);*/ ?>
+ <tr>
+ <td class="tcenter"><?php echo $row->trackid; ?></td>
+ <td class="tleft"><?php echo $row->status; ?></td>
+ <td class="tleft"><?php echo $row->subject ; ?></td>
+ <td class="tcenter"><?php echo tep_date_short($row->dt); ?></td>
+ <td class="tcenter"><?php echo tep_date_short($row->lastchange); ?></td>
+
+ <td>
+ <span class="linkView">
+ <a class="navBtMini" href="<?php echo $row->linkView ?>" >
+ <?php echo __('helpdesk small image button view'); ?>
+ </a>
+ </span>
+ <?php if($row->linkPdf !=false): ?>
+ <!-- pdf link -->
+ <span class="linkPdf">
+ <a class="linkPdf" href="<?php echo $row->linkPdf ?>">
+ <?php echo __('helpdesk pdf link') ?>
+ </a>
+ </span>
+ <?php endif ?>
+ </td>
+ </tr>
+ <?php endforeach; ?>
+ </tbody>
+ </table>
+
+ <? /*
+ <div id="splitPageBottom" class="split">
+ <p class="sP1"><?php echo helpdesk::$helpdesk_split->display_count(__('helpdesk text display number of orders %s')); ?></p>
+ <p class="sP2"><?php echo __('helpdesk text result page') . ' ' . helpdesk::$helpdesk_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></p>
+ </div>
+*/ ?>
+ <?php else : ?>
+ <p class="infoText"><?php echo __('helpdesk no resultat orders'); ?></p>
+ <?php endif; ?>
+
+
+ <div class="navBt">
+ <?php echo '<a class="navBt" href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . IMAGE_BUTTON_BACK . '</a>'; ?>
+ </div>
+
+</div>
\ No newline at end of file
Added: trunk/extensions/HELPDESK_stable/catalog/templates/defaut/includes/gabarit/helpdesk/account.display_view.view.gab
===================================================================
--- trunk/extensions/HELPDESK_stable/catalog/templates/defaut/includes/gabarit/helpdesk/account.display_view.view.gab (rev 0)
+++ trunk/extensions/HELPDESK_stable/catalog/templates/defaut/includes/gabarit/helpdesk/account.display_view.view.gab 2013-08-11 15:50:52 UTC (rev 4802)
@@ -0,0 +1,92 @@
+<?php
+/**
+ @licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
+ @portion code Copyright (c) 2002 osCommerce
+ @package osCSS-2 <www http://www.oscss.org>
+ @version 2.1.1
+ @date 04/07/2013, 22:44
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+ @brief This listing orders for module account/helpdesk
+*/
+global $language,$customer_id;
+
+// print_r(helpdesk::$current);
+
+
+?>
+<div class="main-helpdesk">
+ <table>
+ <tbody>
+ <tr>
+ <th><?php echo __('helpdesk table heading number'); ?></th>
+ <td><?php echo helpdesk::$current->trackid ?></td>
+ <th><?php echo __('helpdesk table heading status'); ?></th>
+ <td><?php echo helpdesk::$current->status_name ?></td>
+ <th><?php echo __('helpdesk table heading history'); ?></th>
+ </tr>
+ <tr>
+ <th><?php echo __('helpdesk table heading date opened'); ?></th>
+ <td><?php echo helpdesk::$current->dt ?></td>
+ <th><?php echo __('helpdesk table heading last update'); ?></th>
+ <td><?php echo helpdesk::$current->lastchange ?></td>
+ <td rowspan="3"><?php echo helpdesk::$current->history; ?></td>
+ </tr>
+ <tr>
+ <th><?php echo __('helpdesk table heading subject'); ?></th>
+ <td><?php echo helpdesk::$current->subject ?></td>
+ <th><?php echo __('helpdesk table heading category'); ?></th>
+ <td><?php echo helpdesk::$current->category_name ?></td>
+ </tr>
+ <?php foreach(helpdesk::$hdSoap->get_custom_fields() as $k=>$row):
+ if($row->use == 1):
+ echo '<tr><th>'.$row->name.'</th><td>'.helpdesk::$current->$k.'</td></tr>';
+ ?>
+ <?php endif; endforeach; ?>
+
+ <tr>
+ <th><?php echo __('helpdesk table heading text'); ?></th>
+ <td colspan="4"><?php echo helpdesk::$current->message ?></td>
+ </tr>
+
+ <tr>
+ <th colspan="5"><?php echo __('helpdesk table heading history date'); ?></th>
+ </tr>
+ <tr>
+ <th><?php echo __('helpdesk table heading history date'); ?></th>
+ <th><?php echo __('helpdesk table heading history name'); ?></th>
+ <th colspan="3"><?php echo __('helpdesk table heading history text'); ?></th>
+ </tr>
+
+ <?php foreach(helpdesk::$current->allreply as $k=>$row):
+ echo '<tr><td>'.$row->dt.'</td><td>'.(($row->staffid)?$row->name : __('helpdesk your author') ).'</td><td colspan="3">'.$row->message.'</td></tr>';
+ ?>
+ <?php endforeach; ?>
+ </tbody>
+ </table>
+
+
+ <?php if(helpdesk::$current->status !=3 ): ?>
+ <br />
+ <h3><?php echo __('helpdesk add comment in current ticket') ?></h3>
+ <?php echo tep_draw_form('contact_us', helpdesk::href_link('insert_reply&id='.helpdesk::$current->id)); ?>
+ <ul>
+
+ <li>
+ <label for="name"><?php echo __('helpdesk entry enquiry'); ?></label>
+ <?php echo tep_draw_textarea_field('enquiry', 'enquiry', '48', '15'); ?>
+ </li>
+
+ <li>
+ <?php echo tep_image_submit('submit', 'submit'); ?>
+ </li>
+ </ul>
+
+ </form>
+ <?php endif; ?>
+
+ <div class="navBt">
+ <?php echo '<a class="navBt" href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . IMAGE_BUTTON_BACK . '</a>'; ?>
+ </div>
+
+</div>
\ No newline at end of file
Added: trunk/extensions/HELPDESK_stable/catalog/templates/defaut/includes/gabarit/helpdesk/box_view.gab
===================================================================
--- trunk/extensions/HELPDESK_stable/catalog/templates/defaut/includes/gabarit/helpdesk/box_view.gab (rev 0)
+++ trunk/extensions/HELPDESK_stable/catalog/templates/defaut/includes/gabarit/helpdesk/box_view.gab 2013-08-11 15:50:52 UTC (rev 4802)
@@ -0,0 +1,24 @@
+<?php
+/**
+ @licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
+ @portion code Copyright (c) 2002 osCommerce
+ @package osCSS-2 <www http://www.oscss.org>
+ @version 2.1.2
+ @date 10/08/2013, 22:44
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+ *\dir includes/gabarit/
+ *\file
+*/
+global $language,$customer_id;
+?>
+
+<?php if(helpdesk::$current !=false): ?>
+ <div class="contentBox helpdesk">
+
+ <div class="contentBox overview">
+ <h4><?php echo __('helpdesk widget add ticket') ; ?></h4>
+ <p><a href="<?php echo helpdesk::href_link('add') ?>"><?php echo __('helpdesk add new ticket') ?></a></p>
+ </div>
+ </div>
+<?php endif ?>
\ No newline at end of file
Added: trunk/extensions/HELPDESK_stable/install.xml
===================================================================
--- trunk/extensions/HELPDESK_stable/install.xml (rev 0)
+++ trunk/extensions/HELPDESK_stable/install.xml 2013-08-11 15:50:52 UTC (rev 4802)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<contrib>
+ <description>
+ <details contrib_ref="" forum_ref="" contrib_type="helpdesk, support" status="0" last_update="2013-08-10" />
+ <author_pkg>www.oscss.org</author_pkg>
+ <comments><![CDATA[]]> </comments>
+ <credits>oscim</credits>
+ <version>1.0</version>
+ <post_install><![CDATA[]]> </post_install>
+ </description>
+
+ <addfile>
+ <file name="includes/modules/account/helpdesk/helpdesk.php" />
+ <file name="includes/modules/account/helpdesk/helpdesk.soap.php" />
+
+ <file name="templates/defaut/includes/gabarit/helpdesk/box_view.gab" />
+ <file name="templates/defaut/includes/gabarit/helpdesk/account.display_view.view.gab" />
+ <file name="templates/defaut/includes/gabarit/helpdesk/account.display_view.page.gab" />
+ <file name="templates/defaut/includes/gabarit/helpdesk/account.display_view.add.gab" />
+ </addfile>
+
+ <addfilelg>
+ <file name="includes/languages/%LANGUAGE%/modules/account/helpdesk/helpdesk.txt" lgref="fr_FR"/>
+ </addfilelg>
+
+
+</contrib>
\ No newline at end of file
Property changes on: trunk/extensions/HELPDESK_stable/install.xml
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: trunk/extensions/HELPDESK_stable/readme
===================================================================
--- trunk/extensions/HELPDESK_stable/readme (rev 0)
+++ trunk/extensions/HELPDESK_stable/readme 2013-08-11 15:50:52 UTC (rev 4802)
@@ -0,0 +1,8 @@
+
+This module use helpdesk in SOAP
+Install helpdesk ; download in http://www.hesk.com/
+
+Install SOAP http://hesk-soap.soft112.com/
+
+
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2013-08-11 14:57:01
|
Revision: 4801
http://sourceforge.net/p/oscss/svn/4801
Author: oscim
Date: 2013-08-11 14:56:57 +0000 (Sun, 11 Aug 2013)
Log Message:
-----------
Fix public breadcrumb in history module
Modified Paths:
--------------
trunk/catalog/account.php
trunk/catalog/includes/languages/fr_FR/account.php
trunk/catalog/includes/languages/fr_FR/modules/account/history.txt
trunk/catalog/includes/modules/account/history.php
trunk/catalog/templates/defaut/includes/content/account_history_info.php
Modified: trunk/catalog/account.php
===================================================================
--- trunk/catalog/account.php 2013-08-06 09:52:50 UTC (rev 4800)
+++ trunk/catalog/account.php 2013-08-11 14:56:57 UTC (rev 4801)
@@ -249,18 +249,12 @@
case 'edit':
$page->breadcrumb->add(NAVBAR_TITLE_2, tep_href_link(FILENAME_ACCOUNT, 'action=edit', 'SSL'));
break;
- case 'history':
- $page->breadcrumb->add(NAVBAR_TITLE_3, tep_href_link(FILENAME_ACCOUNT, 'action=history', 'SSL'));
- break;
case 'newsletters':
$page->breadcrumb->add(NAVBAR_TITLE_4, tep_href_link(FILENAME_ACCOUNT, 'action=newsletters', 'SSL'));
break;
case 'password':
$page->breadcrumb->add(NAVBAR_TITLE_5, tep_href_link(FILENAME_ACCOUNT, 'action=password', 'SSL'));
break;
- case 'history_info':
- $page->breadcrumb->add(NAVBAR_TITLE_6, tep_href_link(FILENAME_ACCOUNT, 'action=history_info&order_id='.$_GET['order_id'], 'SSL'));
- break;
}
require($page->path_gabarit());
Modified: trunk/catalog/includes/languages/fr_FR/account.php
===================================================================
--- trunk/catalog/includes/languages/fr_FR/account.php 2013-08-06 09:52:50 UTC (rev 4800)
+++ trunk/catalog/includes/languages/fr_FR/account.php 2013-08-11 14:56:57 UTC (rev 4801)
@@ -10,13 +10,11 @@
*/
define('NAVBAR_TITLE',"Mon compte" );
define('NAVBAR_TITLE_2',"Éditer le compte" );
-define('NAVBAR_TITLE_3',"Historique" );
define('NAVBAR_TITLE_4',"Souscriptions aux bulletins d'information" );
define('NAVBAR_TITLE_5',"Changer mon mot de passe" );
-define('NAVBAR_TITLE_6',"Historique" );
define('HEADING_TITLE',"Information sur mon compte" );
-define('HEADING_TITLE_3',"Historique de mes commandes" );
+// define('HEADING_TITLE_3',"Historique de mes commandes" );
define('HEADING_TITLE_4',"Souscriptions aux bulletins d'information" );
define('HEADING_TITLE_5',"Mon mot de passe" );
define('HEADING_TITLE_6',"Information commande" );
Modified: trunk/catalog/includes/languages/fr_FR/modules/account/history.txt
===================================================================
--- trunk/catalog/includes/languages/fr_FR/modules/account/history.txt 2013-08-06 09:52:50 UTC (rev 4800)
+++ trunk/catalog/includes/languages/fr_FR/modules/account/history.txt 2013-08-11 14:56:57 UTC (rev 4801)
@@ -4,16 +4,18 @@
@portion code Copyright (c) 2002 osCommerce
@package osCSS-2 <www http://www.oscss.org>
@version 2.1.2
- @date 31/07/2013, 22:44
+ @date 10/08/2013, 22:44
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
*/
/* Bouton/liens */
$lang['history small image button view']="Afficher" ;
- $lang['history small image button duplicate']="Re-commander" ;
$lang['history pdf link']="Pdf" ;
+ $lang['history breadcrumb']="Liste commandes" ;
+ $lang['history breadcrumb view']="Information commande" ;
+
/* Widget */
$lang['history widget view']="Toutes mes commandes" ;
Modified: trunk/catalog/includes/modules/account/history.php
===================================================================
--- trunk/catalog/includes/modules/account/history.php 2013-08-06 09:52:50 UTC (rev 4800)
+++ trunk/catalog/includes/modules/account/history.php 2013-08-11 14:56:57 UTC (rev 4801)
@@ -61,8 +61,27 @@
}
- public function get_header($action=''){}
+ public function get_header($action=''){
+ global $page;
+ $breadcrumb=$page->return_object('breadcrumb');
+ $customer_id=$page->the_var('customer_id');
+
+ if($_REQUEST['aca_mod'] == $this->code)
+ switch(self::$action){
+ case 'display_view':
+ $breadcrumb->add(__("history breadcrumb"), self::href_link());
+ break;
+ }
+ else
+ switch(self::$action){
+ case 'history_info':
+ $breadcrumb->add(__("history breadcrumb"), self::href_link());
+ $breadcrumb->add(__("history breadcrumb view"), tep_href_link(FILENAME_ACCOUNT, 'action=history_info&order_id='.$_GET['order_id'], 'SSL') );
+ break;
+ }
+ }
+
/**
* \fn check_action($action)
* \brief Action exe
Modified: trunk/catalog/templates/defaut/includes/content/account_history_info.php
===================================================================
--- trunk/catalog/templates/defaut/includes/content/account_history_info.php 2013-08-06 09:52:50 UTC (rev 4800)
+++ trunk/catalog/templates/defaut/includes/content/account_history_info.php 2013-08-11 14:56:57 UTC (rev 4801)
@@ -13,7 +13,7 @@
?>
<div id="accountHistoryInfo">
- <h2 class="content title <?php echo $language ;?>"><?php echo HEADING_TITLE; ?></h2>
+ <h2 class="content title <?php echo $language ;?>"><?php echo HEADING_TITLE_6; ?></h2>
<h3><?php echo '#'.(!empty($order->info['orders_ref'])? $order->info['orders_ref'] :$order->info['orders_id'] ) . ' <small>(' . $order->info['orders_status'] . ')</small>'; ?></h3>
<h4><?php echo HEADING_ORDER_DATE . ' ' . tep_date_long($order->info['date_purchased']); ?></h4>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2013-08-06 09:52:53
|
Revision: 4800
http://sourceforge.net/p/oscss/svn/4800
Author: oscim
Date: 2013-08-06 09:52:50 +0000 (Tue, 06 Aug 2013)
Log Message:
-----------
Replace process holding_order by type in normal orders tables ; Fix and adjust process ; Delete item not used
Modified Paths:
--------------
trunk/catalog/admin/includes/classes/drivers/sqlorder.php
trunk/catalog/admin/includes/modules/pages/held_orders.php
trunk/catalog/includes/classes/checkout_process.php
trunk/catalog/install/includes/sql/mysql/tables/osc_orders.sql
trunk/catalog/install/includes/sql/mysql/upgrade/2.1.1rc_2.1.2/tables/osc_orders.sql
Removed Paths:
-------------
trunk/catalog/admin/includes/functions/lib.held_orders.php
trunk/catalog/install/includes/sql/mysql/tables/osc_holding_orders.sql
trunk/catalog/install/includes/sql/mysql/tables/osc_holding_orders_products.sql
trunk/catalog/install/includes/sql/mysql/tables/osc_holding_orders_products_attributes.sql
trunk/catalog/install/includes/sql/mysql/tables/osc_holding_orders_products_download.sql
trunk/catalog/install/includes/sql/mysql/tables/osc_holding_orders_status_history.sql
trunk/catalog/install/includes/sql/mysql/tables/osc_holding_orders_total.sql
trunk/catalog/install/includes/sql/mysql/upgrade/1.2.1_1.2.2/tables/osc_holding_orders.sql
trunk/catalog/install/includes/sql/mysql/upgrade/1.2.1_1.2.2/tables/osc_holding_orders_products.sql
trunk/catalog/install/includes/sql/mysql/upgrade/1.2.1_1.2.2/tables/osc_holding_orders_products_attributes.sql
trunk/catalog/install/includes/sql/mysql/upgrade/1.2.1_1.2.2/tables/osc_holding_orders_products_download.sql
trunk/catalog/install/includes/sql/mysql/upgrade/1.2.1_1.2.2/tables/osc_holding_orders_status_history.sql
trunk/catalog/install/includes/sql/mysql/upgrade/1.2.1_1.2.2/tables/osc_holding_orders_total.sql
trunk/catalog/install/includes/sql/mysql/upgrade/1.2.2_2.1.0/tables/osc_holding_orders.sql
trunk/catalog/install/includes/sql/mysql/upgrade/1.2.2_2.1.0/tables/osc_holding_orders_products.sql
trunk/catalog/install/includes/sql/mysql/upgrade/1.2.2_2.1.0/tables/osc_holding_orders_products_attributes.sql
trunk/catalog/install/includes/sql/mysql/upgrade/1.2.2_2.1.0/tables/osc_holding_orders_products_download.sql
trunk/catalog/install/includes/sql/mysql/upgrade/1.2.2_2.1.0/tables/osc_holding_orders_status_history.sql
trunk/catalog/install/includes/sql/mysql/upgrade/1.2.2_2.1.0/tables/osc_holding_orders_total.sql
trunk/catalog/install/includes/sql/mysql/upgrade/2.0.6_2.0.9/tables/osc_holding_orders.sql
trunk/catalog/install/includes/sql/mysql/upgrade/2.0.9_2.1.0/tables/osc_holding_orders.sql
trunk/catalog/install/includes/sql/mysql/upgrade/2.0.9_2.1.0/tables/osc_holding_orders_products.sql
trunk/catalog/install/includes/sql/mysql/upgrade/2.1.1_2.1.1rc/tables/osc_holding_orders_products_attributes.sql
Modified: trunk/catalog/admin/includes/classes/drivers/sqlorder.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlorder.php 2013-08-05 06:44:18 UTC (rev 4799)
+++ trunk/catalog/admin/includes/classes/drivers/sqlorder.php 2013-08-06 09:52:50 UTC (rev 4800)
@@ -79,10 +79,10 @@
self::getInstance();
- if( ! isset($option['id']) )
- self::$error = __('no id');
- else
- $id = (int)$option['id'];
+// if( ! isset($option['id']) )
+// self::$error = __('no id');
+// else
+// $id = (int)$option['id'];
if( ! isset($option['post']) )
self::$error = __('no post');
@@ -124,9 +124,7 @@
else
$id = (int)$option['id'];
- if( ! isset($option['status']) )
- return __('no status');
- else
+ if( isset($option['status']) )
$status = (int)$option['status'];
if( ($order = self::fetch(array('id'=>$option['id']))) && $order == false )
@@ -148,6 +146,9 @@
$sql_data_array['facture_id'] = self::GetNumberInvoice();
}
+ if( isset($option['type']) )
+ $sql_data_array['orders_type'] = $option['orders_type'];
+
// specific for soap event
$sql_data_array['synchro_event'] = ( isset($option['synchro_event'])? (int)$option['synchro_event'] : '0');
@@ -264,56 +265,60 @@
}
- /// Adjust process for status
- if($status>0)
- $new_st = substr((int)$status,0,1);
- else
- $new_st = $status;
+ if( isset($status) ) {
+ /// Adjust process for status
+ if($status>0)
+ $new_st = substr((int)$status,0,1);
+ else
+ $new_st = $status;
- switch($new_st){
- case DEFAULT_ORDERS_STATUS_PAYED:
- if( !isset($sql_data_array['facture_id']) || empty($sql_data_array['facture_id']) )
- $sql_data_array['facture_id'] = self::GetNumberInvoice();
+ switch($new_st){
+ case DEFAULT_ORDERS_STATUS_PAYED:
+ if( !isset($sql_data_array['facture_id']) || empty($sql_data_array['facture_id']) )
+ $sql_data_array['facture_id'] = self::GetNumberInvoice();
- if( isset($sql_data_array['facture_ref']) && !empty($sql_data_array['facture_ref']) )
- $sql_data_array['facture_ref'] = trim($sql_data_array['facture_ref']);
- // New Ref
- elseif( _cst_bool('USE_LOCAT_GENERAT_PDF') ) {
- $numref= new NumRef('bills');
- $ref = $numref->GetNewNumRef();
- $sql_data_array['facture_ref'] =$ref ;
- }
+ if( isset($sql_data_array['facture_ref']) && !empty($sql_data_array['facture_ref']) )
+ $sql_data_array['facture_ref'] = trim($sql_data_array['facture_ref']);
+ // New Ref
+ elseif( _cst_bool('USE_LOCAT_GENERAT_PDF') ) {
+ $numref= new NumRef('bills');
+ $ref = $numref->GetNewNumRef();
+ $sql_data_array['facture_ref'] =$ref ;
+ }
- self::$comment[] = __('orders update and factured');
- break;
- case DEFAULT_ORDERS_STATUS_ANNULATE:
- $sql_data_array['orders_date_finished']= 'NOW()';
+ self::$comment[] = __('orders update and factured');
+ break;
+ case DEFAULT_ORDERS_STATUS_ANNULATE:
+ $sql_data_array['orders_date_finished']= 'NOW()';
- if(isset($option['cid']))
- $cid = $option['cid'];
- else {
- $check_status_query = tep_db_query("select customers_id from " . TABLE_ORDERS . " where orders_id = '" . (int)$id . "'");
- $check = tep_db_fetch_array($check_status_query);
- $cid = $check['customers_id'];
- }
+ if(isset($option['cid']))
+ $cid = $option['cid'];
+ else {
+ $check_status_query = tep_db_query("select customers_id from " . TABLE_ORDERS . " where orders_id = '" . (int)$id . "'");
+ $check = tep_db_fetch_array($check_status_query);
+ $cid = $check['customers_id'];
+ }
-// if(isset($option['restock']))
- tep_products_restock($id,$cid);
+ // if(isset($option['restock']))
+ tep_products_restock($id,$cid);
- self::$comment[] = __('orders annulate and products restocked');
+ self::$comment[] = __('orders annulate and products restocked');
- break;
- case DEFAULT_ORDERS_STATUS_COMPLETED:
- //! cloture commande
- $sql_data_array['orders_date_finished']= 'NOW()';
- break;
- case DEFAULT_ORDERS_STATUS_ID:
- default:
- $sql_data_array['last_modified'] = 'NOW()';
- }
+ break;
+ case DEFAULT_ORDERS_STATUS_COMPLETED:
+ //! cloture commande
+ $sql_data_array['orders_date_finished']= 'NOW()';
+ break;
+ case DEFAULT_ORDERS_STATUS_ID:
+ default:
+ $sql_data_array['last_modified'] = 'NOW()';
+ }
+ }
if(count($sql_data_array) > 0){
- $sql_data_array['orders_status'] = $new_st;
+ if( isset($status) )
+ $sql_data_array['orders_status'] = $status;
+
$sql_data_array['last_modified'] = 'NOW()';
tep_db_perform(TABLE_ORDERS, $sql_data_array, 'update', "orders_id = '" . $id . "'");
@@ -329,6 +334,7 @@
self::AddOrderHistory($id, $status , $notif, implode("\n\r", self::$comment) );
// if ($notify)
+ require_once(DIR_WS_FUNCTIONS. 'lib.orders.php');
OrdersNotify($id,$order->info, $order->customer, $status, $comments);
if($error !=false)
@@ -457,8 +463,8 @@
$sql = substr($sql,3);
+ $DB->query("delete from " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " where ".$sql);
$DB->query("delete from " . TABLE_ORDERS_PRODUCTS . " where ".$sql);
- $DB->query("delete from " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " where ".$sql);
$DB->query("delete from " . TABLE_ORDERS_STATUS_HISTORY . " where ".$sql);
$DB->query("delete from " . TABLE_ORDERS_TOTAL . " where ".$sql);
Deleted: trunk/catalog/admin/includes/functions/lib.held_orders.php
===================================================================
--- trunk/catalog/admin/includes/functions/lib.held_orders.php 2013-08-05 06:44:18 UTC (rev 4799)
+++ trunk/catalog/admin/includes/functions/lib.held_orders.php 2013-08-06 09:52:50 UTC (rev 4800)
@@ -1,136 +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.0
- @date 19/12/10, 19:49
- @author oscim <mail aur...@os...> <www http://www.oscim.fr>
- @encode UTF-8
-
- TODO: a centraliser avec la class ckeckout_process public , qui contient une methode equivalent
-*/
-
-/**
- Traitement de la recup commande, et bascule dans les commande de la held_commande en cours
-*/
-function tep_confirm_held_order($oID){
-
- $order_query = tep_db_query("select customers_id, customers_name, customers_company, customers_street_address, customers_suburb, customers_city, customers_postcode, customers_state, customers_country, customers_telephone, customers_email_address, customers_address_format_id, delivery_name, delivery_company, delivery_street_address, delivery_suburb, delivery_city, delivery_postcode, delivery_state, delivery_country, delivery_address_format_id, billing_name, billing_company, billing_street_address, billing_suburb, billing_city, billing_postcode, billing_state, billing_country, billing_address_format_id, payment_method, cc_type, cc_owner, cc_number, cc_expires, currency, currency_value, date_purchased, orders_status, last_modified, ip_address from " . TABLE_HOLDING_ORDERS . " where orders_id = '" . $oID . "'");
- $order = tep_db_fetch_array($order_query);
-
- //$this->info = array
- $sql_data_array = array('currency' => $order['currency'],
- 'customers_id' => $order['customers_id'],
- 'currency_value' => $order['currency_value'],
- 'payment_method' => $order['payment_method'],
- 'cc_type' => $order['cc_type'],
- 'cc_owner' => $order['cc_owner'],
- 'cc_number' => $order['cc_number'],
- 'cc_expires' => $order['cc_expires'],
- 'date_purchased' => $order['date_purchased'],
- 'orders_status' => $order['orders_status'],
- 'ip_address' => $order['ip_address'],
- 'last_modified' => $order['last_modified'],
- 'customers_name' => $order['customers_name'],
- 'customers_company' => $order['customers_company'],
- 'customers_street_address' => $order['customers_street_address'],
- 'customers_suburb' => $order['customers_suburb'],
- 'customers_city' => $order['customers_city'],
- 'customers_postcode' => $order['customers_postcode'],
- 'customers_state' => $order['customers_state'],
- 'customers_country' => $order['customers_country'],
- 'customers_address_format_id' => $order['customers_address_format_id'],
- 'customers_telephone' => $order['customers_telephone'],
- 'customers_email_address' => $order['customers_email_address'],
- 'delivery_name' => $order['delivery_name'],
- 'delivery_company' => $order['delivery_company'],
- 'delivery_street_address' => $order['delivery_street_address'],
- 'delivery_suburb' => $order['delivery_suburb'],
- 'delivery_city' => $order['delivery_city'],
- 'delivery_postcode' => $order['delivery_postcode'],
- 'delivery_state' => $order['delivery_state'],
- 'delivery_country' => $order['delivery_country'],
- 'delivery_address_format_id' => $order['delivery_address_format_id'],
- 'billing_name' => $order['billing_name'],
- 'billing_company' => $order['billing_company'],
- 'billing_street_address' => $order['billing_street_address'],
- 'billing_suburb' => $order['billing_suburb'],
- 'billing_city' => $order['billing_city'],
- 'billing_postcode' => $order['billing_postcode'],
- 'billing_state' => $order['billing_state'],
- 'billing_country' => $order['billing_country'],
- 'billing_address_format_id' => $order['billing_address_format_id'],
- 'holding_origin_id'=>$oID);
-
- tep_db_perform(TABLE_ORDERS, $sql_data_array);
-
- $cs_s=tep_db_query("select orders_id from " . TABLE_ORDERS . " where customers_id='".$order['customers_id']."' and ip_address='".$order['ip_address']."' order by orders_id DESC");
- $cs=tep_db_fetch_array($cs_s);
- $insert_id=$cs['orders_id'];
-
-// $insert_id = tep_db_insert_id();
-
- $orders_products_query = tep_db_query("select orders_products_id, products_id,products_name, products_model, products_price, products_tax, products_quantity, final_price from " . TABLE_HOLDING_ORDERS_PRODUCTS . " where orders_id = '" . $oID . "'");
- while ($orders_products = tep_db_fetch_array($orders_products_query)) {
-
- $sql_data_array2 = array('orders_id' => $insert_id,
- 'products_id' => $orders_products['products_id'],
- 'products_quantity' => $orders_products['products_quantity'],
- 'products_name' => $orders_products['products_name'],
- 'products_model' => $orders_products['products_model'],
- 'products_tax' => $orders_products['products_tax'],
- 'products_price' => $orders_products['products_price'],
- 'final_price' => $orders_products['final_price']);
-
- tep_db_perform(TABLE_ORDERS_PRODUCTS, $sql_data_array2);
-
- $cs_s=tep_db_query("select orders_products_id from " . TABLE_ORDERS_PRODUCTS . " where orders_id='".$insert_id."' and products_id='".$orders_products['products_id']."' ");
- $cs=tep_db_fetch_array($cs_s);
- $order_products_id=$cs['orders_products_id'];
-// $order_products_id = tep_db_insert_id();
-
-
- $attributes_query = tep_db_query("select products_options, products_options_values, options_values_price, price_prefix from " . TABLE_HOLDING_ORDERS_PRODUCTS_ATTRIBUTES . " where orders_id = '" . $oID . "' and orders_products_id = '" . $orders_products['orders_products_id'] . "'");
- if (tep_db_num_rows($attributes_query)) {
- while ($attributes = tep_db_fetch_array($attributes_query)) {
- $sql_data_array1 = array('orders_id' => $insert_id,
- 'orders_products_id' => $order_products_id,
- 'products_options' => $attributes['products_options'],
- 'products_options_values' => $attributes['products_options_values'],
- 'price_prefix' => $attributes['price_prefix'],
- 'options_values_price' => $attributes['options_values_price']);
-
- tep_db_perform(TABLE_ORDERS_PRODUCTS_ATTRIBUTES, $sql_data_array1);
- }
- }
- }
- $totals_query = tep_db_query("select title, text, value, class, sort_order from " . TABLE_HOLDING_ORDERS_TOTAL . " where orders_id = '" . $oID . "' order by sort_order");
- while ($totals = tep_db_fetch_array($totals_query)) {
- $sql_data_array3 = array('orders_id' => $insert_id,
- 'title' => $totals['title'],
- 'text' => $totals['text'],
- 'value' => $totals['value'],
- 'class' => $totals['class'],
- 'sort_order' => $totals['sort_order']);
- tep_db_perform(TABLE_ORDERS_TOTAL, $sql_data_array3);
- }
-
- $status_query = tep_db_query("select orders_status_id, date_added, customer_notified, comments from " . TABLE_HOLDING_ORDERS_STATUS_HISTORY . " where orders_id = '" . $oID . "'");
- while ($status = tep_db_fetch_array($status_query)) {
- $sql_data_array4 = array('orders_id' => $insert_id,
- 'orders_status_id' => $status['orders_status_id'],
- 'date_added' => $status['date_added'],
- 'customer_notified' => $status['customer_notified'],
- 'comments' => $status['comments']);
- tep_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array4);
- }
-
- tep_db_query("delete from " . TABLE_HOLDING_ORDERS . " where orders_id = '" . $oID . "'");
- tep_db_query("delete from " . TABLE_HOLDING_ORDERS_PRODUCTS . " where orders_id = '" . $oID . "'");
- tep_db_query("delete from " . TABLE_HOLDING_ORDERS_PRODUCTS_ATTRIBUTES . " where orders_id = '" . $oID . "'");
- tep_db_query("delete from " . TABLE_HOLDING_ORDERS_STATUS_HISTORY . " where orders_id = '" . $oID . "'");
- tep_db_query("delete from " . TABLE_HOLDING_ORDERS_TOTAL . " where orders_id = '" . $oID . "'");
-}
-
-?>
\ No newline at end of file
Modified: trunk/catalog/admin/includes/modules/pages/held_orders.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/held_orders.php 2013-08-05 06:44:18 UTC (rev 4799)
+++ trunk/catalog/admin/includes/modules/pages/held_orders.php 2013-08-06 09:52:50 UTC (rev 4800)
@@ -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 08/03/2012, 22:33
+ @version 2.1.2
+ @date 06/08/2013, 22:33
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
@class held_orders
@@ -129,11 +129,13 @@
$comments = tep_db_prepare_input($_POST['comments']);
$order_updated = false;
- $check_status_query = $DB->query("select customers_name, customers_email_address, orders_status, date_purchased, ip_address from " . TABLE_HOLDING_ORDERS . " where orders_id = '" . (int)$oID . "'");
+ $check_status_query = $DB->query("select customers_name, customers_email_address, orders_status, date_purchased, ip_address from " . TABLE_ORDERS . " where orders_type='-1' AND orders_id = '" . (int)$oID . "'");
$check_status = $check_status_query->fetchAssoc();
if ($check_status['orders_status'] != $status || tep_not_null($comments)) {
- $DB->query("update " . TABLE_HOLDING_ORDERS . " set orders_status = '" . tep_db_input($status) . "', last_modified = now() where orders_id = '" . (int)$oID . "'");
+// $DB->query("update " . TABLE_ORDERS . " set orders_status = '" . tep_db_input($status) . "', last_modified = now() where orders_id = '" . (int)$oID . "'");
+ sqlorder::update(array('id'=>$oID,'status'=>tep_db_input($status) ));
+
$customer_notified = '0';
if (isset($_POST['notify']) && ($_POST['notify'] == 'on')) {
$notify_comments = '';
@@ -145,11 +147,11 @@
'email_use_html'=>(($_POST['p_format'] == 'HTML')?true:false),
'mail_sent_to'=>$mail_sent_to,
'from'=>$from,
- '_oID'=>$oID,
- '_oLinks'=>tep_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $oID, 'SSL') ,
- 'date_purchased'=>tep_date_long($check_status['date_purchased']),
- 'notify_comments'=>$notify_comments,
- '_ostatus'=>$orders_status_array[$status],
+ '_oID'=>$oID,
+ '_oLinks'=>tep_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $oID, 'SSL') ,
+ 'date_purchased'=>tep_date_long($check_status['date_purchased']),
+ 'notify_comments'=>$notify_comments,
+ '_ostatus'=>$orders_status_array[$status],
'subject'=>$subject,
'message'=>$content
);
@@ -160,7 +162,7 @@
else $err=false;
}
- if(!$err) $DB->query("insert into " . TABLE_HOLDING_ORDERS_STATUS_HISTORY . " (orders_id, orders_status_id, date_added, customer_notified, comments) values ('" . (int)$oID . "', '" . tep_db_input($status) . "', now(), '" . $customer_notified . "', '" . tep_db_input($comments) . "')");
+ if(!$err) $DB->query("insert into " . TABLE_ORDERS_STATUS_HISTORY . " (orders_id, orders_status_id, date_added, customer_notified, comments) values ('" . (int)$oID . "', '" . tep_db_input($status) . "', now(), '" . $customer_notified . "', '" . tep_db_input($comments) . "')");
$order_updated = true;
}
@@ -176,12 +178,12 @@
/**
- @remarks transforme held_order to order
+ @remarks transforme held_order to order
*/
case 'confirm_order':
$oID = tep_db_prepare_input($_GET['oID']);
- tep_confirm_held_order($oID);
+ sqlorder::update(array('id'=>$oID,'type'=>'0')) ;
$messageStack->add_session(__('success held order updated'), 'success');
@@ -189,16 +191,12 @@
break;
/**
- @remarks suppression de la pre-commande
+ @remarks suppression de la pre-commande
*/
case 'deleteconfirm':
$oID = tep_db_prepare_input($_GET['oID']);
- $DB->query("delete from " . TABLE_HOLDING_ORDERS . " where orders_id = '" . $oID . "'");
- $DB->query("delete from " . TABLE_HOLDING_ORDERS_PRODUCTS . " where orders_id = '" . $oID . "'");
- $DB->query("delete from " . TABLE_HOLDING_ORDERS_PRODUCTS_ATTRIBUTES . " where orders_id = '" . $oID . "'");
- $DB->query("delete from " . TABLE_HOLDING_ORDERS_STATUS_HISTORY . " where orders_id = '" . $oID . "'");
- $DB->query("delete from " . TABLE_HOLDING_ORDERS_TOTAL . " where orders_id = '" . $oID . "'");
+ sqlorder::delete(array('id'=>$oID));
tep_redirect(tep_href_link(self::FILENAME, tep_get_all_get_params(array('oID', 'action'))));
break;
@@ -214,7 +212,7 @@
global $languages_id;
$DB=Database::getInstance();
$ID = tep_db_prepare_input(self::$Id);
- $orders_query_raw = "select distinct o.orders_id, o.customers_id,o.customers_name, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.status_name as orders_status_name, s.status_color as orders_status_color,ot.text as order_total from " . TABLE_HOLDING_ORDERS . " o left join " . TABLE_HOLDING_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id), " . TABLE_STATUS . " s where o.orders_status = s.status_id and s.status_type='orders' and s.language_id = '" . (int)$languages_id . "' and ot.class = 'ot_total' and o.orders_id='".$ID."' ";
+ $orders_query_raw = "select distinct o.orders_id, o.customers_id,o.customers_name, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.status_name as orders_status_name, s.status_color as orders_status_color,ot.text as order_total from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id), " . TABLE_STATUS . " s where o.orders_status = s.status_id and s.status_type='orders' and s.language_id = '" . (int)$languages_id . "' and ot.class = 'ot_total' and o.orders_id='".$ID."' ";
$currency_query = $DB->query($orders_query_raw);
@@ -293,7 +291,7 @@
$sWhere=str_replace(array('orders_id'),array('o.orders_id'), $sWhere);
}
- $query_raw = "select distinct o.ip_address, o.orders_id, o.customers_id,o.customers_name, o.customers_id, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.status_name as orders_status_name, s.status_color as orders_status_color,ot.text as order_total from " . TABLE_HOLDING_ORDERS . " o left join " . TABLE_HOLDING_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id), " . TABLE_STATUS . " s where o.orders_status = s.status_id and status_type='orders' and s.language_id = '" . $languages_id . "' and ot.class = 'ot_total' ".$sWhere." order by ".((!empty($sOrder)) ? $sOrder : 'o.orders_id DESC');
+ $query_raw = "select distinct o.ip_address, o.orders_id, o.customers_id,o.customers_name, o.customers_id, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.status_name as orders_status_name, s.status_color as orders_status_color,ot.text as order_total from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id), " . TABLE_STATUS . " s where o.orders_type='-1' AND o.orders_status = s.status_id and status_type='orders' and s.language_id = '" . $languages_id . "' and ot.class = 'ot_total' ".$sWhere." order by ".((!empty($sOrder)) ? $sOrder : 'o.orders_id DESC');
$orders_split = new splitPageResults($page, $rowbyp, $query_raw, $query_numrows);
$orders_query = $DB->query($query_raw);
@@ -327,7 +325,7 @@
public static function detail_row_page($id){
include(DIR_WS_FUNCTIONS.'lib.orders.php');
- self::$order=new order((int)$id, 'HOLDING');
+ self::$order=new order((int)$id, '');
return MGabCont::CallGab('inline','display_view',__CLASS__);
}
Modified: trunk/catalog/includes/classes/checkout_process.php
===================================================================
--- trunk/catalog/includes/classes/checkout_process.php 2013-08-05 06:44:18 UTC (rev 4799)
+++ trunk/catalog/includes/classes/checkout_process.php 2013-08-06 09:52:50 UTC (rev 4800)
@@ -64,8 +64,9 @@
*/
self::$mode=((strlen($table)>0)?false:true);
- $table=((!self::$mode)? '_'.strtoupper($table) : '');
+// $table=((!self::$mode)? '_'.strtoupper($table) : '');
+ $table='';
self::$tables=array( 'ORDERS'=>constant('TABLE'.$table.'_ORDERS'),
'TOTAL'=>constant('TABLE'.$table.'_ORDERS_TOTAL'),
'PRODUCTS'=>constant('TABLE'.$table.'_ORDERS_PRODUCTS'),
@@ -245,7 +246,7 @@
private static function test_pre_order_id($pre_order_id){
$DB=Database::getInstance();
- $res=$DB->query("Select orders_id from " . TABLE_HOLDING_ORDERS . " where orders_id = '" . (int)$pre_order_id . "' ");
+ $res=$DB->query("Select orders_id from " . TABLE_ORDERS . " where orders_type = '-1' AND orders_id = '" . (int)$pre_order_id . "' ");
if($res->__get('numRows') ==0) return false;
$res=$DB->query("Select orders_id from " . TABLE_ORDERS . " where holding_origin_id = '" . (int)$pre_order_id . "' ");
@@ -268,7 +269,7 @@
public static function check_string_return($string){
$res=explode('|',$string);
$DB=Database::getInstance();
- $query=$DB->query($sql="Select customers_id, date_purchased from " . TABLE_HOLDING_ORDERS . " where orders_id = '" . (int)$res[0] . "' ");
+ $query=$DB->query($sql="Select customers_id, date_purchased from " . TABLE_ORDERS . " where orders_type = '-1' AND orders_id = '" . (int)$res[0] . "' ");
// trigger_error(sprintf(__FILE__.'::'.__LINE__, $sql ) , E_USER_ERROR);
@@ -276,7 +277,7 @@
if($item['customers_id'] != (int)$res[1] ) return false;
if($item['date_purchased'] !=$res[2]) return false;
- $query=$DB->query("Select value, class from ".TABLE_HOLDING_ORDERS_TOTAL." Where orders_id='".(int)$res[0]."' and class='ot_total' ");
+ $query=$DB->query("Select value, class from ".TABLE_ORDERS_TOTAL." Where orders_id='".(int)$res[0]."' and class='ot_total' ");
$item=$query->fetchAssoc();
if($item['value'] !=$res[3]) return false;
@@ -296,12 +297,12 @@
$generat=$pre_order_id.'|'.$customer_id.'|';
- $res=$DB->query("Select date_purchased from " . TABLE_HOLDING_ORDERS . " where orders_id = '" . (int)$pre_order_id . "' ");
+ $res=$DB->query("Select date_purchased from " . TABLE_ORDERS . " where orders_type = '-1' AND orders_id = '" . (int)$pre_order_id . "' ");
$item=$res->fetchAssoc();
$generat .=$item['date_purchased'].'|';
/// table orders_total
- $res=$DB->query("Select value, class from ".TABLE_HOLDING_ORDERS_TOTAL." Where orders_id='".(int)$pre_order_id."' and class='ot_total' ");
+ $res=$DB->query("Select value, class from ".TABLE_ORDERS_TOTAL." Where orders_id='".(int)$pre_order_id."' and class='ot_total' ");
$item=$res->fetchAssoc();
$generat .=$item['value'];
@@ -477,7 +478,7 @@
$DB=Database::getInstance();
/// table order
- $order_query = $DB->query("select orders_prefix, customers_id, customers_name, customers_company, customers_street_address, customers_suburb, customers_city, customers_postcode, customers_state, customers_country, customers_telephone, customers_email_address, customers_address_format_id, delivery_name, delivery_company, delivery_street_address, delivery_suburb, delivery_city, delivery_postcode, delivery_state, delivery_country, delivery_address_format_id, billing_name, billing_company, billing_street_address, billing_suburb, billing_city, billing_postcode, billing_state, billing_country, billing_address_format_id, payment_method, cc_type, cc_owner, cc_number, cc_expires, currency, currency_value, date_purchased, orders_status, last_modified, ip_address, class_payment, class_shipping from " . TABLE_HOLDING_ORDERS . " where orders_id = '" . (int)$pre_order_id . "'");
+ $order_query = $DB->query("select orders_prefix,orders_type, customers_id, customers_name, customers_company, customers_street_address, customers_suburb, customers_city, customers_postcode, customers_state, customers_country, customers_telephone, customers_email_address, customers_address_format_id, delivery_name, delivery_company, delivery_street_address, delivery_suburb, delivery_city, delivery_postcode, delivery_state, delivery_country, delivery_address_format_id, billing_name, billing_company, billing_street_address, billing_suburb, billing_city, billing_postcode, billing_state, billing_country, billing_address_format_id, payment_method, cc_type, cc_owner, cc_number, cc_expires, currency, currency_value, date_purchased, orders_status, last_modified, ip_address, class_payment, class_shipping from " . TABLE_ORDERS . " where orders_id = '" . (int)$pre_order_id . "'");
$order = $order_query->fetchAssoc();
// New Ref
@@ -488,7 +489,7 @@
$sql_data_array = array(
'holding_origin_id'=>(int)$pre_order_id,
- 'orders_type' => 0,
+ 'orders_type' => $order['orders_type'],
'orders_ref' => tep_db_input($ref),
'orders_prefix' => tep_db_input($order['orders_prefix']), // obsolete
'currency' => tep_db_input($order['currency']),
@@ -542,14 +543,14 @@
self::$Id= $this->the_order_id=$order_id=$query->__get('insertId');
/// table orders_total
- $res=$DB->query("Select title, text, value, class, sort_order from ".TABLE_HOLDING_ORDERS_TOTAL." Where orders_id='".(int)$pre_order_id."' ");
+ $res=$DB->query("Select title, text, value, class, sort_order from ".TABLE_ORDERS_TOTAL." Where orders_id='".(int)$pre_order_id."' ");
while ($item = $res->fetchAssoc())
$DB->query("Insert into ".TABLE_ORDERS_TOTAL." (orders_id,title,text,value,class,sort_order) values ('".(int)$order_id."','".tep_db_input($item['title'])."','".tep_db_input($item['text'])."','".tep_db_input($item['value'])."','".tep_db_input($item['class'])."','".tep_db_input($item['sort_order'])."') ");
//! product / products_attributes / products_download
- $orders_products_query = tep_db_query("select orders_products_id, products_id as id ,products_type,products_name, products_model, products_price, products_tax, products_quantity as qty, final_price from " . TABLE_HOLDING_ORDERS_PRODUCTS . " where orders_id = '" . (int)$pre_order_id . "'");
+ $orders_products_query = tep_db_query("select orders_products_id, products_id as id ,products_type,products_name, products_model, products_price, products_tax, products_quantity as qty, final_price from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . (int)$pre_order_id . "'");
while ($orders_products = tep_db_fetch_array($orders_products_query)) {
$sql_data_array2 = array('orders_id' => (int)$order_id,
@@ -566,7 +567,7 @@
$order_products_id = $res2->__get('insertId');
- $attributes_query = tep_db_query("select products_options_id, products_options_values_id, products_options, products_options_values, options_values_price, price_prefix from " . TABLE_HOLDING_ORDERS_PRODUCTS_ATTRIBUTES . " where orders_id = '" . (int)$pre_order_id . "' and orders_products_id = '" . (int)$orders_products['orders_products_id'] . "'");
+ $attributes_query = tep_db_query("select products_options_id, products_options_values_id, products_options, products_options_values, options_values_price, price_prefix from " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " where orders_id = '" . (int)$pre_order_id . "' and orders_products_id = '" . (int)$orders_products['orders_products_id'] . "'");
if (tep_db_num_rows($attributes_query)) {
while ($attributes = tep_db_fetch_array($attributes_query)) {
$sql_data_array1 = array('orders_id' => (int)$order_id,
@@ -590,7 +591,7 @@
/// table orders_status_history
- $res=$DB->query("Select * from ".TABLE_HOLDING_ORDERS_STATUS_HISTORY." Where orders_id='".(int)$pre_order_id."' ");
+ $res=$DB->query("Select * from ".TABLE_ORDERS_STATUS_HISTORY." Where orders_id='".(int)$pre_order_id."' ");
while ($item = $res->fetchAssoc())
$DB->query("Insert into ".TABLE_ORDERS_STATUS_HISTORY." ( orders_id , orders_status_id , date_added , customer_notified , comments) values ('".$order_id."','".$item['orders_status_id']."','".$item['date_added']."','".$item['customer_notified']."','".$item['comments']."') ");
@@ -709,6 +710,7 @@
$sql_data_array = array(
'customers_id' => $customer_id,
+ 'orders_type' => ((!self::$mode)? '-1' : '0'),
'orders_prefix' => '', // obsolete
'customers_name' => $order->customer['firstname'] . ' ' . $order->customer['lastname'],
'customers_company' => (string)$order->customer['company'],
@@ -1025,12 +1027,13 @@
public static function purgeHolding($held_order=''){
$held_order=(!tep_not_null($held_order))? (int)@$_SESSION['pre_order_id']:(int)$held_order;
if($held_order==0) return false;
- tep_db_query("delete from " . TABLE_HOLDING_ORDERS . " where orders_id = '" . (int)$held_order . "'");
- tep_db_query("delete from " . TABLE_HOLDING_ORDERS_PRODUCTS . " where orders_id = '" . (int)$held_order . "'");
- tep_db_query("delete from " . TABLE_HOLDING_ORDERS_PRODUCTS_ATTRIBUTES . " where orders_id = '" . (int)$held_order . "'");
- tep_db_query("delete from " . TABLE_HOLDING_ORDERS_STATUS_HISTORY . " where orders_id = '" . (int)$held_order . "'");
- tep_db_query("delete from " . TABLE_HOLDING_ORDERS_TOTAL . " where orders_id = '" . (int)$held_order . "'");
+ tep_db_query("delete from " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " where orders_id = '" . (int)$held_order . "'");
+ tep_db_query("delete from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . (int)$held_order . "'");
+ tep_db_query("delete from " . TABLE_ORDERS_STATUS_HISTORY . " where orders_id = '" . (int)$held_order . "'");
+ tep_db_query("delete from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (int)$held_order . "'");
+
+ tep_db_query("delete from " . TABLE_ORDERS . " where orders_type = '-1' AND orders_id = '" . (int)$held_order . "'");
if (tep_session_is_registered('pre_order_id')) tep_session_unregister('pre_order_id');
}
Deleted: trunk/catalog/install/includes/sql/mysql/tables/osc_holding_orders.sql
===================================================================
--- trunk/catalog/install/includes/sql/mysql/tables/osc_holding_orders.sql 2013-08-05 06:44:18 UTC (rev 4799)
+++ trunk/catalog/install/includes/sql/mysql/tables/osc_holding_orders.sql 2013-08-06 09:52:50 UTC (rev 4800)
@@ -1,67 +0,0 @@
---+######################################################################--+
---| osCSS Open Source E-commerce |
---+######################################################################--+
---| Copyright (c) 2005-2011 The osCSS developers |
---| |
---| http://www.oscss.org |
---| Portions Copyright (c) 2003 osCommerce |
---+######################################################################--+
---| This source file is subject to version 2.0 of the GPL license, |
---| available at the following url: |
---| http://www.oscss.org/ |
---+######################################################################--+
-
-
-drop table if exists osc_holding_orders;
-CREATE TABLE osc_holding_orders (
- orders_id int(11) NOT NULL auto_increment,
- orders_prefix varchar(32) default NULL,
- customers_id int(11) NOT NULL default '0',
- customers_name varchar(64) NOT NULL,
- customers_company varchar(32) default NULL,
- customers_street_address varchar(64) NOT NULL,
- customers_suburb varchar(32) default NULL,
- customers_city varchar(32) NOT NULL,
- customers_postcode varchar(10) NOT NULL,
- customers_state varchar(32) default NULL,
- customers_country varchar(32) NOT NULL,
- customers_telephone varchar(32) NOT NULL,
- customers_email_address varchar(96) NOT NULL,
- customers_address_format_id int(5) NOT NULL default '0',
- delivery_name varchar(64) NOT NULL,
- delivery_company varchar(32) default NULL,
- delivery_street_address varchar(64) NOT NULL,
- delivery_suburb varchar(32) default NULL,
- delivery_city varchar(32) NOT NULL,
- delivery_postcode varchar(10) NOT NULL,
- delivery_state varchar(32) default NULL,
- delivery_country varchar(32) NOT NULL,
- delivery_address_format_id int(5) NOT NULL default '0',
- billing_name varchar(64) NOT NULL,
- billing_company varchar(32) default NULL,
- billing_street_address varchar(64) NOT NULL,
- billing_suburb varchar(32) default NULL,
- billing_city varchar(32) NOT NULL,
- billing_postcode varchar(10) NOT NULL,
- billing_state varchar(32) default NULL,
- billing_country varchar(32) NOT NULL,
- billing_address_format_id int(5) NOT NULL default '0',
- payment_method varchar(32) NOT NULL,
- cc_type varchar(20) default NULL,
- cc_owner varchar(64) default NULL,
- cc_number varchar(32) default NULL,
- cc_expires varchar(4) default NULL,
- last_modified datetime default NULL,
- date_purchased datetime default NULL,
- orders_status int(5) NOT NULL default '1',
- orders_date_finished datetime default NULL,
- currency char(3) default NULL,
- currency_value decimal(14,6) default NULL,
- ip_address varchar(50) NOT NULL,
- total_weight varchar(5) default NULL,
- class_payment VARCHAR( 30 ) NULL ,
- class_shipping VARCHAR( 30 ) NULL ,
- PRIMARY KEY (orders_id)
-) DEFAULT CHARSET=utf8 ;
-
-
Deleted: trunk/catalog/install/includes/sql/mysql/tables/osc_holding_orders_products.sql
===================================================================
--- trunk/catalog/install/includes/sql/mysql/tables/osc_holding_orders_products.sql 2013-08-05 06:44:18 UTC (rev 4799)
+++ trunk/catalog/install/includes/sql/mysql/tables/osc_holding_orders_products.sql 2013-08-06 09:52:50 UTC (rev 4800)
@@ -1,35 +0,0 @@
---+######################################################################--+
---| osCSS Open Source E-commerce |
---+######################################################################--+
---| Copyright (c) 2005-2011 The osCSS developers |
---| |
---| http://www.oscss.org |
---| Portions Copyright (c) 2003 osCommerce |
---+######################################################################--+
---| This source file is subject to version 2.0 of the GPL license, |
---| available at the following url: |
---| http://www.oscss.org/ |
---+######################################################################--+
-
-
-drop table if exists osc_holding_orders_products;
-create table osc_holding_orders_products (
- orders_products_id int(11) not null auto_increment,
- orders_id int(11) default '0' not null ,
- products_id int(11) default '0' not null ,
- products_type int(1) NOT NULL DEFAULT '1',
- products_model varchar(12) ,
- products_name varchar(64) not null ,
- products_price decimal(15,4) default '0.0000' not null ,
- final_price decimal(15,4) default '0.0000' not null ,
- products_tax decimal(7,4) default '0.0000' not null ,
- products_quantity int(2) default '0' not null ,
- products_stock_attributes varchar(255) default NULL,
- products_stock_extra varchar(255) default NULL,
- products_returned tinyint(2) unsigned default '0' ,
- products_exchanged tinyint(2) default '0' not null ,
- products_exchanged_id int(11) default '0' not null ,
- PRIMARY KEY (orders_products_id)
-) DEFAULT CHARSET=utf8;
-
-
Deleted: trunk/catalog/install/includes/sql/mysql/tables/osc_holding_orders_products_attributes.sql
===================================================================
--- trunk/catalog/install/includes/sql/mysql/tables/osc_holding_orders_products_attributes.sql 2013-08-05 06:44:18 UTC (rev 4799)
+++ trunk/catalog/install/includes/sql/mysql/tables/osc_holding_orders_products_attributes.sql 2013-08-06 09:52:50 UTC (rev 4800)
@@ -1,28 +0,0 @@
---+######################################################################--+
---| osCSS Open Source E-commerce |
---+######################################################################--+
---| Copyright (c) 2005-2011 The osCSS developers |
---| |
---| http://www.oscss.org |
---| Portions Copyright (c) 2003 osCommerce |
---+######################################################################--+
---| This source file is subject to version 2.0 of the GPL license, |
---| available at the following url: |
---| http://www.oscss.org/ |
---+######################################################################--+
-
-
-drop table if exists osc_holding_orders_products_attributes;
-create table osc_holding_orders_products_attributes (
- orders_products_attributes_id int(11) not null auto_increment,
- orders_id int(11) default '0' not null ,
- orders_products_id int(11) default '0' not null ,
- products_options_id int(11) NOT NULL,
- products_options_values_id int(11) NOT NULL,
- products_options varchar(32) not null ,
- products_options_values varchar(32) not null ,
- options_values_price decimal(15,4) default '0.0000' not null ,
- price_prefix char(1) not null ,
- PRIMARY KEY (orders_products_attributes_id)
-) DEFAULT CHARSET=utf8;
-
Deleted: trunk/catalog/install/includes/sql/mysql/tables/osc_holding_orders_products_download.sql
===================================================================
--- trunk/catalog/install/includes/sql/mysql/tables/osc_holding_orders_products_download.sql 2013-08-05 06:44:18 UTC (rev 4799)
+++ trunk/catalog/install/includes/sql/mysql/tables/osc_holding_orders_products_download.sql 2013-08-06 09:52:50 UTC (rev 4800)
@@ -1,25 +0,0 @@
---+######################################################################--+
---| osCSS Open Source E-commerce |
---+######################################################################--+
---| Copyright (c) 2005-2011 The osCSS developers |
---| |
---| http://www.oscss.org |
---| Portions Copyright (c) 2003 osCommerce |
---+######################################################################--+
---| This source file is subject to version 2.0 of the GPL license, |
---| available at the following url: |
---| http://www.oscss.org/ |
---+######################################################################--+
-
-
-drop table if exists osc_holding_orders_products_download;
-create table osc_holding_orders_products_download (
- orders_products_download_id int(11) not null auto_increment,
- orders_id int(11) default '0' not null ,
- orders_products_id int(11) default '0' not null ,
- orders_products_filename varchar(255) not null ,
- download_maxdays int(2) default '0' not null ,
- download_count int(2) default '0' not null ,
- PRIMARY KEY (orders_products_download_id)
-) DEFAULT CHARSET=utf8;
-
Deleted: trunk/catalog/install/includes/sql/mysql/tables/osc_holding_orders_status_history.sql
===================================================================
--- trunk/catalog/install/includes/sql/mysql/tables/osc_holding_orders_status_history.sql 2013-08-05 06:44:18 UTC (rev 4799)
+++ trunk/catalog/install/includes/sql/mysql/tables/osc_holding_orders_status_history.sql 2013-08-06 09:52:50 UTC (rev 4800)
@@ -1,24 +0,0 @@
---+######################################################################--+
---| osCSS Open Source E-commerce |
---+######################################################################--+
---| Copyright (c) 2005-2011 The osCSS developers |
---| |
---| http://www.oscss.org |
---| Portions Copyright (c) 2003 osCommerce |
---+######################################################################--+
---| This source file is subject to version 2.0 of the GPL license, |
---| available at the following url: |
---| http://www.oscss.org/ |
---+######################################################################--+
-
-
-drop table if exists osc_holding_orders_status_history;
-create table osc_holding_orders_status_history (
- orders_status_history_id int(11) not null auto_increment,
- orders_id int(11) default '0' not null ,
- orders_status_id int(5) default '0' not null ,
- date_added datetime default '1000-01-01 00:00:00' not null ,
- customer_notified int(1) default '0' ,
- comments text ,
- PRIMARY KEY (orders_status_history_id)
-) DEFAULT CHARSET=utf8;
Deleted: trunk/catalog/install/includes/sql/mysql/tables/osc_holding_orders_total.sql
===================================================================
--- trunk/catalog/install/includes/sql/mysql/tables/osc_holding_orders_total.sql 2013-08-05 06:44:18 UTC (rev 4799)
+++ trunk/catalog/install/includes/sql/mysql/tables/osc_holding_orders_total.sql 2013-08-06 09:52:50 UTC (rev 4800)
@@ -1,28 +0,0 @@
---+######################################################################--+
---| osCSS Open Source E-commerce |
---+######################################################################--+
---| Copyright (c) 2005-2011 The osCSS developers |
---| |
---| http://www.oscss.org |
---| Portions Copyright (c) 2003 osCommerce |
---+######################################################################--+
---| This source file is subject to version 2.0 of the GPL license, |
---| available at the following url: |
---| http://www.oscss.org/ |
---+######################################################################--+
-
-
-
-drop table if exists osc_holding_orders_total;
-create table osc_holding_orders_total (
- orders_total_id int(10) unsigned not null auto_increment,
- orders_id int(11) default '0' not null ,
- title varchar(255) not null ,
- text varchar(255) not null ,
- value decimal(15,4) default '0.0000' not null ,
- class varchar(32) not null ,
- sort_order int(11) default '0' not null ,
- PRIMARY KEY (orders_total_id),
- KEY idx_orders_total_orders_id (orders_id)
-) DEFAULT CHARSET=utf8;
-
Modified: trunk/catalog/install/includes/sql/mysql/tables/osc_orders.sql
===================================================================
--- trunk/catalog/install/includes/sql/mysql/tables/osc_orders.sql 2013-08-05 06:44:18 UTC (rev 4799)
+++ trunk/catalog/install/includes/sql/mysql/tables/osc_orders.sql 2013-08-06 09:52:50 UTC (rev 4800)
@@ -66,6 +66,7 @@
holding_origin_id INT( 11 ) NULL ,
class_payment VARCHAR( 30 ) NULL ,
class_shipping VARCHAR( 30 ) NULL ,
+ synchro_event INT( 1 ) NOT NULL DEFAULT '0',
PRIMARY KEY (orders_id)
) DEFAULT CHARSET=utf8;
Deleted: trunk/catalog/install/includes/sql/mysql/upgrade/1.2.1_1.2.2/tables/osc_holding_orders.sql
===================================================================
--- trunk/catalog/install/includes/sql/mysql/upgrade/1.2.1_1.2.2/tables/osc_holding_orders.sql 2013-08-05 06:44:18 UTC (rev 4799)
+++ trunk/catalog/install/includes/sql/mysql/upgrade/1.2.1_1.2.2/tables/osc_holding_orders.sql 2013-08-06 09:52:50 UTC (rev 4800)
@@ -1,81 +0,0 @@
---+######################################################################--+
---| osCSS Open Source E-commerce |
---+######################################################################--+
---| Copyright (c) 2005-2012 The osCSS developers |
---| |
---| http://www.oscss.org |
---| Portions Copyright (c) 2003 osCommerce |
---+######################################################################--+
---| This source file is subject to version 2.0 of the GPL license, |
---| available at the following url: |
---| http://www.oscss.org/ |
---+######################################################################--+
-
-
-
-
-CREATE TABLE IF NOT EXISTS osc_holding_orders (
- orders_id int(11) NOT NULL auto_increment,
- customers_id int(11) NOT NULL default '0',
- customers_name varchar(64) NOT NULL default '',
- customers_company varchar(32) default NULL,
- customers_street_address varchar(64) NOT NULL default '',
- customers_suburb varchar(32) default NULL,
- customers_city varchar(32) NOT NULL default '',
- customers_postcode varchar(10) NOT NULL default '',
- customers_state varchar(32) default NULL,
- customers_country varchar(32) NOT NULL default '',
- customers_telephone varchar(32) NOT NULL default '',
- customers_email_address varchar(96) NOT NULL default '',
- customers_address_format_id int(5) NOT NULL default '0',
- delivery_name varchar(64) NOT NULL default '',
- delivery_company varchar(32) default NULL,
- delivery_street_address varchar(64) NOT NULL default '',
- delivery_suburb varchar(32) default NULL,
- delivery_city varchar(32) NOT NULL default '',
- delivery_postcode varchar(10) NOT NULL default '',
- delivery_state varchar(32) default NULL,
- delivery_country varchar(32) NOT NULL default '',
- delivery_address_format_id int(5) NOT NULL default '0',
- billing_name varchar(64) NOT NULL default '',
- billing_company varchar(32) default NULL,
- billing_street_address varchar(64) NOT NULL default '',
- billing_suburb varchar(32) default NULL,
- billing_city varchar(32) NOT NULL default '',
- billing_postcode varchar(10) NOT NULL default '',
- billing_state varchar(32) default NULL,
- billing_country varchar(32) NOT NULL default '',
- billing_address_format_id int(5) NOT NULL default '0',
- payment_method varchar(32) NOT NULL default '',
- cc_type varchar(20) default NULL,
- cc_owner varchar(64) default NULL,
- cc_number varchar(32) default NULL,
- cc_expires varchar(4) default NULL,
- last_modified datetime default NULL,
- date_purchased datetime default NULL,
- orders_status int(5) NOT NULL default '1',
- orders_date_finished datetime default NULL,
- currency char(3) default NULL,
- currency_value decimal(14,6) default NULL,
- ip_address varchar(50) NOT NULL default '',
- PRIMARY KEY (orders_id)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 ;
-
-ALTER TABLE osc_holding_orders MODIFY COLUMN customers_name varchar(64) NOT NULL;
-ALTER TABLE osc_holding_orders MODIFY COLUMN customers_street_address varchar(64) NOT NULL;
-ALTER TABLE osc_holding_orders MODIFY COLUMN customers_city varchar(32) NOT NULL;
-ALTER TABLE osc_holding_orders MODIFY COLUMN customers_postcode varchar(10) NOT NULL;
-ALTER TABLE osc_holding_orders MODIFY COLUMN customers_country varchar(32) NOT NULL;
-ALTER TABLE osc_holding_orders MODIFY COLUMN customers_telephone varchar(32) NOT NULL;
-ALTER TABLE osc_holding_orders MODIFY COLUMN customers_email_address varchar(96) NOT NULL;
-ALTER TABLE osc_holding_orders MODIFY COLUMN delivery_name varchar(64) NOT NULL;
-ALTER TABLE osc_holding_orders MODIFY COLUMN delivery_street_address varchar(64) NOT NULL;
-ALTER TABLE osc_holding_orders MODIFY COLUMN delivery_city varchar(32) NOT NULL;
-ALTER TABLE osc_holding_orders MODIFY COLUMN delivery_postcode varchar(10) NOT NULL;
-ALTER TABLE osc_holding_orders MODIFY COLUMN delivery_country varchar(32) NOT NULL;
-ALTER TABLE osc_holding_orders MODIFY COLUMN billing_name varchar(64) NOT NULL;
-ALTER TABLE osc_holding_orders MODIFY COLUMN billing_street_address varchar(64) NOT NULL;
-ALTER TABLE osc_holding_orders MODIFY COLUMN billing_city varchar(32) NOT NULL;
-ALTER TABLE osc_holding_orders MODIFY COLUMN billing_postcode varchar(10) NOT NULL;
-ALTER TABLE osc_holding_orders MODIFY COLUMN billing_country varchar(32) NOT NULL;
-ALTER TABLE osc_holding_orders MODIFY COLUMN payment_method varchar(32) NOT NULL;
Deleted: trunk/catalog/install/includes/sql/mysql/upgrade/1.2.1_1.2.2/tables/osc_holding_orders_products.sql
===================================================================
--- trunk/catalog/install/includes/sql/mysql/upgrade/1.2.1_1.2.2/tables/osc_holding_orders_products.sql 2013-08-05 06:44:18 UTC (rev 4799)
+++ trunk/catalog/install/includes/sql/mysql/upgrade/1.2.1_1.2.2/tables/osc_holding_orders_products.sql 2013-08-06 09:52:50 UTC (rev 4800)
@@ -1,33 +0,0 @@
---+######################################################################--+
---| osCSS Open Source E-commerce |
---+######################################################################--+
---| Copyright (c) 2005-2012 The osCSS developers |
---| |
---| http://www.oscss.org |
---| Portions Copyright (c) 2003 osCommerce |
---+######################################################################--+
---| This source file is subject to version 2.0 of the GPL license, |
---| available at the following url: |
---| http://www.oscss.org/ |
---+######################################################################--+
-
-
-
-
-CREATE TABLE IF NOT EXISTS osc_holding_orders_products (
- orders_products_id int(11) NOT NULL auto_increment,
- orders_id int(11) NOT NULL default '0',
- products_id int(11) NOT NULL default '0',
- products_model varchar(12) default NULL,
- products_name varchar(64) NOT NULL default '',
- products_price decimal(15,4) NOT NULL default '0.0000',
- final_price decimal(15,4) NOT NULL default '0.0000',
- products_tax decimal(7,4) NOT NULL default '0.0000',
- products_quantity int(2) NOT NULL default '0',
- products_returned tinyint(2) unsigned default '0',
- products_exchanged tinyint(2) NOT NULL default '0',
- products_exchanged_id int(11) NOT NULL default '0',
- PRIMARY KEY (orders_products_id)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 ;
-
-ALTER TABLE osc_holding_orders_products MODIFY COLUMN products_name varchar(64) NOT NULL;
Deleted: trunk/catalog/install/includes/sql/mysql/upgrade/1.2.1_1.2.2/tables/osc_holding_orders_products_attributes.sql
===================================================================
--- trunk/catalog/install/includes/sql/mysql/upgrade/1.2.1_1.2.2/tables/osc_holding_orders_products_attributes.sql 2013-08-05 06:44:18 UTC (rev 4799)
+++ trunk/catalog/install/includes/sql/mysql/upgrade/1.2.1_1.2.2/tables/osc_holding_orders_products_attributes.sql 2013-08-06 09:52:50 UTC (rev 4800)
@@ -1,30 +0,0 @@
---+######################################################################--+
---| osCSS Open Source E-commerce |
---+######################################################################--+
---| Copyright (c) 2005-2012 The osCSS developers |
---| |
---| http://www.oscss.org |
---| Portions Copyright (c) 2003 osCommerce |
---+######################################################################--+
---| This source file is subject to version 2.0 of the GPL license, |
---| available at the following url: |
---| http://www.oscss.org/ |
---+######################################################################--+
-
-
-
-
-CREATE TABLE IF NOT EXISTS osc_holding_orders_products_attributes (
- orders_products_attributes_id int(11) NOT NULL auto_increment,
- orders_id int(11) NOT NULL default '0',
- orders_products_id int(11) NOT NULL default '0',
- products_options varchar(32) NOT NULL default '',
- products_options_values varchar(32) NOT NULL default '',
- options_values_price decimal(15,4) NOT NULL default '0.0000',
- price_prefix char(1) NOT NULL default '',
- PRIMARY KEY (orders_products_attributes_id)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 ;
-
-ALTER TABLE osc_holding_orders_products_attributes MODIFY COLUMN products_options varchar(32) NOT NULL;
-ALTER TABLE osc_holding_orders_products_attributes MODIFY COLUMN products_options_values varchar(32) NOT NULL;
-ALTER TABLE osc_holding_orders_products_attributes MODIFY COLUMN price_prefix char(1) NOT NULL;
Deleted: trunk/catalog/install/includes/sql/mysql/upgrade/1.2.1_1.2.2/tables/osc_holding_orders_products_download.sql
===================================================================
--- trunk/catalog/install/includes/sql/mysql/upgrade/1.2.1_1.2.2/tables/osc_holding_orders_products_download.sql 2013-08-05 06:44:18 UTC (rev 4799)
+++ trunk/catalog/install/includes/sql/mysql/upgrade/1.2.1_1.2.2/tables/osc_holding_orders_products_download.sql 2013-08-06 09:52:50 UTC (rev 4800)
@@ -1,27 +0,0 @@
---+######################################################################--+
---| osCSS Open Source E-commerce |
---+######################################################################--+
---| Copyright (c) 2005-2012 The osCSS developers |
---| |
---| http://www.oscss.org |
---| Portions Copyright (c...
[truncated message content] |
|
From: <os...@us...> - 2013-08-05 06:44:20
|
Revision: 4799
http://sourceforge.net/p/oscss/svn/4799
Author: oscim
Date: 2013-08-05 06:44:18 +0000 (Mon, 05 Aug 2013)
Log Message:
-----------
Fix bug in delete and link contraint ext table
deport function generate random password
Modified Paths:
--------------
trunk/catalog/admin/includes/classes/drivers/sqlcustomer.php
trunk/catalog/admin/includes/languages/fr_FR/modules/pages/customers.txt
trunk/catalog/admin/includes/modules/pages/customers.php
trunk/catalog/includes/classes/drivers/data/categorie.php
Modified: trunk/catalog/admin/includes/classes/drivers/sqlcustomer.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlcustomer.php 2013-08-03 14:48:28 UTC (rev 4798)
+++ trunk/catalog/admin/includes/classes/drivers/sqlcustomer.php 2013-08-05 06:44:18 UTC (rev 4799)
@@ -256,21 +256,45 @@
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($_id);
-// self::$modules->delete($_id);
+// self::$modules->deleteconfirm_account( array('id'=>$_id) );
+ self::$modules->__call('deleteconfirm_account', $_id );
- $DB->query("delete from " . TABLE_CUSTOMERS_INFO . " where customers_info_id = '" . (int)$_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/languages/fr_FR/modules/pages/customers.txt
===================================================================
--- trunk/catalog/admin/includes/languages/fr_FR/modules/pages/customers.txt 2013-08-03 14:48:28 UTC (rev 4798)
+++ trunk/catalog/admin/includes/languages/fr_FR/modules/pages/customers.txt 2013-08-05 06:44:18 UTC (rev 4799)
@@ -89,7 +89,7 @@
$lang['category options']="Options" ;
$lang['entry email address']="Email" ;
$lang['entry customers group name']="Groupe :" ;
- $lang['entry customers group request authentication']="Compte " ;
+ $lang['entry customers group request authentication']="Compte " ;
$lang['entry gender']="Genre :" ;
$lang['entry gender error']="<span class=\"errorText\">requis</span>" ;
$lang['entry first name']="Prénom :" ;
@@ -128,8 +128,8 @@
$lang['send mail for %s ok'] = "Envoi email reussie à %s";
$lang['customers save success']="Enregistrement du client reussie" ;
$lang['error save in process']="Erreur lors de l'enregistrement du client" ;
- $lang['action delete for %s ok']="Erreur lors de la suppresion du client %s" ;
- $lang['error delete for %s']="Suppression du client %s effectué" ;
+ $lang['action delete for %s ok']="Suppression du client %s effectué" ;
+ $lang['error delete for %s']="Erreur lors de la suppresion du client %s; Un client ayant déjà passé commande ne peut etre supprimé si la commande existe" ;
/* MessageStack */
$lang['@customers update confirm status customers']="Mise à jour de l'état de 'confirmé' " ;
Modified: trunk/catalog/admin/includes/modules/pages/customers.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/customers.php 2013-08-03 14:48:28 UTC (rev 4798)
+++ trunk/catalog/admin/includes/modules/pages/customers.php 2013-08-05 06:44:18 UTC (rev 4799)
@@ -495,7 +495,7 @@
}
if(self::$action =='insert'){
- $array['password']=$mdp=self::randomize();
+ $array['password']=$mdp=sqlcustomer::randomize();
$array['email']=$array['sqlarray']['customers_email_address'];
$_id=sqlcustomer::create($array);
$result=sqlcustomer::fetch(array('id'=>$_id), false );
@@ -995,21 +995,7 @@
/** Private specific module */
- private 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 test forme email
* @param $email string
Modified: trunk/catalog/includes/classes/drivers/data/categorie.php
===================================================================
--- trunk/catalog/includes/classes/drivers/data/categorie.php 2013-08-03 14:48:28 UTC (rev 4798)
+++ trunk/catalog/includes/classes/drivers/data/categorie.php 2013-08-05 06:44:18 UTC (rev 4799)
@@ -241,8 +241,9 @@
@param $category_id int current id
@param $datatype string name childs class datatype
@param $status int value status current categorie
+ @param $subcat bool if active by count sub cats
*/
- private static function countChidlsAll($category_id, $datatype, $status=1){
+ private static function countChidlsAll($category_id, $datatype, $status=1, $subcat=false){
$count_c = 0;
if($status ==0)
@@ -252,6 +253,10 @@
if(class_exists($datatype) && DataTypes::is_active($datatype) )
$count_c=$datatype::get_count_in_category((int)$category_id);
+ // check if no data but has sub cat
+ if($subcat && $count_c<=0)
+ $count_c = self::get_has_category_subcategories($category_id);
+
return (($count_c >0 )? 1 : 0);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2013-08-03 14:48:31
|
Revision: 4798
http://sourceforge.net/p/oscss/svn/4798
Author: oscim
Date: 2013-08-03 14:48:28 +0000 (Sat, 03 Aug 2013)
Log Message:
-----------
Fix check stock for optionid in text
Modified Paths:
--------------
trunk/catalog/includes/classes/Stock.php
Modified: trunk/catalog/includes/classes/Stock.php
===================================================================
--- trunk/catalog/includes/classes/Stock.php 2013-07-31 15:18:19 UTC (rev 4797)
+++ trunk/catalog/includes/classes/Stock.php 2013-08-03 14:48:28 UTC (rev 4798)
@@ -44,9 +44,15 @@
self::$marck=0;
if(isset($product['current_quantity']) )
$current = $product['current_quantity'];
- else
- $current = tep_get_products_stock( (int)$product['id'],$attributes);
+ else{
+ // check if id option is int
+ // if not int, is specifical text option
+ foreach($attributes as $k=>$v)
+ if(is_int($k)) $attrib[$k]=$v;
+ $current = tep_get_products_stock( (int)$product['id'],$attrib);
+ }
+
$reel = ($current - $product['quantity'] );
switch( (int)$product['track_stock']) {
case 0: /// no check stock
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2013-07-31 15:18:22
|
Revision: 4797
http://sourceforge.net/p/oscss/svn/4797
Author: oscim
Date: 2013-07-31 15:18:19 +0000 (Wed, 31 Jul 2013)
Log Message:
-----------
add duplicate orders for customers in public account and put in cart
fix link product in box cart
Modified Paths:
--------------
trunk/catalog/templates/defaut/includes/boxes/shopping_cart.php
trunk/catalog/templates/defaut/includes/gabarit/history/account.display_view.page.gab
Modified: trunk/catalog/templates/defaut/includes/boxes/shopping_cart.php
===================================================================
--- trunk/catalog/templates/defaut/includes/boxes/shopping_cart.php 2013-07-31 09:42:33 UTC (rev 4796)
+++ trunk/catalog/templates/defaut/includes/boxes/shopping_cart.php 2013-07-31 15:18:19 UTC (rev 4797)
@@ -28,7 +28,7 @@
if (($new_products_id_in_cart == $products[$i]['id'])) $cart_contents_string = '<span class="newItemInCart">';
else $cart_contents_string = '<span class="infoBoxContents">';
- $cart_contents_string .= $products[$i]['quantity'] . ' x </span>'."\n".'<span><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id']) . '">';
+ $cart_contents_string .= $products[$i]['quantity'] . ' x </span>'."\n".'<span><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . tep_get_prid($products[$i]['id'])) . '">';
if ( ($new_products_id_in_cart == $products[$i]['id'])) $cart_contents_string .= "\n".'<span class="newItemInCart">';
else $cart_contents_string .= "\n".'<span class="infoBoxContents">';
Modified: trunk/catalog/templates/defaut/includes/gabarit/history/account.display_view.page.gab
===================================================================
--- trunk/catalog/templates/defaut/includes/gabarit/history/account.display_view.page.gab 2013-07-31 09:42:33 UTC (rev 4796)
+++ trunk/catalog/templates/defaut/includes/gabarit/history/account.display_view.page.gab 2013-07-31 15:18:19 UTC (rev 4797)
@@ -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/07/2013, 22:44
+ @version 2.1.2
+ @date 31/07/2013, 22:44
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
@brief This listing orders for module account/history
@@ -36,6 +36,11 @@
<td><?php echo $row->count_products; ?></td>
<td><?php echo strip_tags($row->order_total); ?></td>
<td>
+ <span class="linkDuplicate">
+ <a class="navBtMini" href="<?php echo $row->linkDuplicate ?>" >
+ <?php echo __('history small image button duplicate'); ?>
+ </a>
+ </span>
<span class="linkView">
<a class="navBtMini" href="<?php echo $row->linkView ?>" >
<?php echo __('history small image button view'); ?>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2013-07-31 09:42:36
|
Revision: 4796
http://sourceforge.net/p/oscss/svn/4796
Author: oscim
Date: 2013-07-31 09:42:33 +0000 (Wed, 31 Jul 2013)
Log Message:
-----------
add duplicate orders for customers in public account and put in cart
Modified Paths:
--------------
trunk/catalog/admin/includes/modules/account/history.php
trunk/catalog/includes/languages/fr_FR/modules/account/history.txt
trunk/catalog/includes/modules/account/history.php
Modified: trunk/catalog/admin/includes/modules/account/history.php
===================================================================
--- trunk/catalog/admin/includes/modules/account/history.php 2013-07-31 09:35:07 UTC (rev 4795)
+++ trunk/catalog/admin/includes/modules/account/history.php 2013-07-31 09:42:33 UTC (rev 4796)
@@ -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/03/2012, 20:02
+ @version 2.1.2
+ @date 31/07/2013, 20:02
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
@class history
@@ -230,7 +230,10 @@
function remove() {return false; }
function keys() {
- return array( 'MODULE_ACA_ORDERS_HISTORY_SORT_ORDER' );
+ return array(
+ 'MODULE_ACA_ORDERS_HISTORY_SORT_ORDER',
+// 'MODULE_ACA_ORDERS_HISTORY_DUPLICATE_ORDERS'
+ );
}
}
Modified: trunk/catalog/includes/languages/fr_FR/modules/account/history.txt
===================================================================
--- trunk/catalog/includes/languages/fr_FR/modules/account/history.txt 2013-07-31 09:35:07 UTC (rev 4795)
+++ trunk/catalog/includes/languages/fr_FR/modules/account/history.txt 2013-07-31 09:42:33 UTC (rev 4796)
@@ -3,14 +3,15 @@
@licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
@portion code Copyright (c) 2002 osCommerce
@package osCSS-2 <www http://www.oscss.org>
- @version 2.1.1
- @date 16/04/2012, 22:44
+ @version 2.1.2
+ @date 31/07/2013, 22:44
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
*/
/* Bouton/liens */
$lang['history small image button view']="Afficher" ;
+ $lang['history small image button duplicate']="Re-commander" ;
$lang['history pdf link']="Pdf" ;
/* Widget */
Modified: trunk/catalog/includes/modules/account/history.php
===================================================================
--- trunk/catalog/includes/modules/account/history.php 2013-07-31 09:35:07 UTC (rev 4795)
+++ trunk/catalog/includes/modules/account/history.php 2013-07-31 09:42:33 UTC (rev 4796)
@@ -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 15/04/2012, 22:44
+ @version 2.1.2
+ @date 31/07/2013, 22:44
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
*\class history
@@ -32,14 +32,17 @@
@var string action
*/
public static $action ='';
+ /**
+ @var string
+ */
+ public static $type ='account';
-
/**
@brief constructor
*/
function __construct(){
$this->code =__CLASS__;
- $this->type ='account';
+ $this->type =self::$type;
$this->title = __('module history text title');
$this->description = __('module history text description') ;
$this->sort_order = (defined('MODULE_ACA_HISTORY_SORT_ORDER')) ? MODULE_ACA_HISTORY_SORT_ORDER : 0;
@@ -74,9 +77,35 @@
$customer_id=$page->the_var('customer_id');
-// switch ($action) {
-// }
+ switch ($action) {
+ /*
+ Duplicate order, reset cart and add all product in order
+ */
+ case 'ab_duplicate';
+ global $cart;
+ $cart->reset();
+
+ // define for block redirect
+ $_GET['noredirect'] = false;
+
+ $order = new order((int)$_GET['order_id']);
+
+ foreach($order->products as $prdct){
+
+ $tmp_attrib = array();
+ if ( (isset($prdct['attributes'])) && (sizeof($prdct['attributes']) > 0) )
+ foreach($prdct['attributes'] as $attrib)
+ $tmp_attrib[$attrib['option_id'] ] = $attrib['value_id'];
+
+
+
+ $cart->add_cart($prdct['id'], $prdct['qty'] , $tmp_attrib);
+ }
+ tep_redirect(tep_href_link(FILENAME_SHOPPING_CART,'', 'SSL'));
+ break;
+ }
+
return true;
}
@@ -126,8 +155,11 @@
$n->count_products = $products['count'];
$n->destinataire = $order_type.' '.$order_name;
// $n->linkView = tep_href_link(FILENAME_ACCOUNT, 'aca_mod='.$this->code.'&aca_type='.$this->type.'&aca_action=display_info&oID='. (int)$row['orders_id'], 'SSL');
- $n->linkView = tep_href_link(FILENAME_ACCOUNT, 'action=history_info&order_id=' . (int)$row['orders_id'], 'SSL');
+ $n->linkView =tep_href_link(FILENAME_ACCOUNT, 'action=history_info&order_id=' . (int)$row['orders_id'], 'SSL');
+ // self::href_link('history_info', 'order_id=' . (int)$row['orders_id'], 'SSL');
+ $n->linkDuplicate = self::href_link('duplicate', 'order_id=' . (int)$row['orders_id'], 'SSL');
+
/**
@remarks Adjust link pdf if Exist. Use config process
Link exist if file pdf exists.
@@ -203,22 +235,35 @@
}
- /**
- * \brief select function for display
- */
-// public function display_info(){
-// global $page;
-//
-// $customer_id=$page->the_var('customer_id');
-//
-// self::$current = $this->load_db_values($customer_id);
-//
-// return new objectInfo(array('title'=>__("history heading listing"),'content'=> tep_output_string_protected(tep_get_include_contents(__CLASS__.'.'.__FUNCTION__),false,true) ) );
-// }
+ /**
+ @brief internal link
+ @param classic action
+ @param other paams by strign GET format
+ @return href
+ */
+ static function href_link($action='', $params=''){
+ $base = 'aca_mod='.__CLASS__.'&aca_type='.self::$type.'&aca_action=';
+ switch ($action) {
+ case 'duplicate':
+ $base .='display_view&action=ab_'.$action.'&'.$params;
+ break;
+ case 'delete':
+ case 'edit':
+ $base .='display_view&action=ab_'.$action.'&'.$params;
+ break;
+ case 'page':
+ $base .='display_view';
+ break;
+ default:
+ $base .='display_view'. ((!empty($action))?'&action=ab_'.$action : '');
+ }
+ return tep_href_link(FILENAME_ACCOUNT, $base, 'SSL');
+ }
+
/**
@remarks implements InterfaceModule depend
if module twin in backoffice, report all content install in the other module
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2013-07-31 09:35:10
|
Revision: 4795
http://sourceforge.net/p/oscss/svn/4795
Author: oscim
Date: 2013-07-31 09:35:07 +0000 (Wed, 31 Jul 2013)
Log Message:
-----------
Fix add product but no stock and limited edition
Modified Paths:
--------------
trunk/catalog/common/classes/shoppingCart.php
Modified: trunk/catalog/common/classes/shoppingCart.php
===================================================================
--- trunk/catalog/common/classes/shoppingCart.php 2013-07-25 06:24:52 UTC (rev 4794)
+++ trunk/catalog/common/classes/shoppingCart.php 2013-07-31 09:35:07 UTC (rev 4795)
@@ -206,6 +206,8 @@
$current = tep_get_products_stock( (int)$products_id,(array)$attributes );
//force qty if not enough stock
$qty = $current;
+ if($qty == 0)
+ return ;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2013-07-25 06:24:55
|
Revision: 4794
http://sourceforge.net/p/oscss/svn/4794
Author: oscim
Date: 2013-07-25 06:24:52 +0000 (Thu, 25 Jul 2013)
Log Message:
-----------
Fix sort submodule
Modified Paths:
--------------
trunk/catalog/includes/classes/order_total.php
Modified: trunk/catalog/includes/classes/order_total.php
===================================================================
--- trunk/catalog/includes/classes/order_total.php 2013-07-24 07:33:55 UTC (rev 4793)
+++ trunk/catalog/includes/classes/order_total.php 2013-07-25 06:24:52 UTC (rev 4794)
@@ -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 29/04/13, 11:33
+ \version 2.1.2
+ \date 25/07/2013, 11:33
\author oscim <mail aur...@os...> <www http://www.oscim.fr>
\encode UTF-8
\class order_total
@@ -16,7 +16,7 @@
class order_total
extends AbstractAcaModule{
- var $modules;
+ public $modules;
/**
Constructor
@@ -29,7 +29,7 @@
foreach(parent::initialise_type('MODULE_ORDER_TOTAL_INSTALLED','order_total') as $class){
$cl[$class]=new $class ();
- $list_mod[] = $class ;
+ $list_mod[$class] = $cl[$class]->sort_order;
}
if (isset($_SESSION['sppc_customer_group_id']) && $_SESSION['sppc_customer_group_id'] != '0') $customer_group_id = $_SESSION['sppc_customer_group_id'];
@@ -40,10 +40,10 @@
$temp_ot_array= (tep_not_null($customer_ot['order_total_allowed']) ) ? explode(';', $customer_ot['order_total_allowed']) : array() ;
if(!isset($list_mod) ||!is_array($list_mod) || count($list_mod)==0) return false;
- ksort($list_mod);
+ asort($list_mod);
- foreach($list_mod as $s=>$class){
- if ( count($temp_ot_array)==0 || in_array($class.'.php', $temp_ot_array ) ) $GLOBALS[$class]=$this->modules[$class] =$cl[$class];
+ foreach($list_mod as $class=>$sort){
+ $GLOBALS[$class]= $this->modules[$class] =$cl[$class];
}
unset($cl);unset($list_mod);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2013-07-24 07:34:02
|
Revision: 4793
http://sourceforge.net/p/oscss/svn/4793
Author: oscim
Date: 2013-07-24 07:33:55 +0000 (Wed, 24 Jul 2013)
Log Message:
-----------
Fix bug for update extra
fix css
fix manipulate and path for file .pdf in tinybrowser
add ref in public class product
fix extra for customer in create account
add module no type
add method in datatype for obtain specific datatype
Modified Paths:
--------------
trunk/catalog/admin/editeur/tiny_mce/plugins/tinybrowser/tinybrowser.php
trunk/catalog/admin/editeur/tiny_mce/plugins/tinybrowser/upload_process.php
trunk/catalog/admin/includes/classes/drivers/sqlcustomersextrafields.php
trunk/catalog/admin/includes/modules/configuration/modcustextra.php
trunk/catalog/admin/includes/template/defaut/css/less/datatable.less
trunk/catalog/common/classes/DataTypes.php
trunk/catalog/includes/classes/core_page/customer.php
trunk/catalog/includes/classes/drivers/data/product.php
Added Paths:
-----------
trunk/catalog/includes/modules/listing_catchild_and_product.php
Modified: trunk/catalog/admin/editeur/tiny_mce/plugins/tinybrowser/tinybrowser.php
===================================================================
--- trunk/catalog/admin/editeur/tiny_mce/plugins/tinybrowser/tinybrowser.php 2013-07-22 07:46:40 UTC (rev 4792)
+++ trunk/catalog/admin/editeur/tiny_mce/plugins/tinybrowser/tinybrowser.php 2013-07-24 07:33:55 UTC (rev 4793)
@@ -183,7 +183,7 @@
?><li id="folders_tab"><span><a href="folders.php?type=<?php echo $typenow.$passfolder.$passfeid; ?>"><?php echo TB_FOLDERS; ?></a></span></li><?php
}
// Display folder select, if multiple exist
-if(count($browsedirs)>1)
+if(count($browsedirs)>0)
{
?><li id="folder_tab" class="right"><span><?php
form_select($browsedirs,'folder',TB_FOLDERCURR,urlencode($foldernow),true);
Modified: trunk/catalog/admin/editeur/tiny_mce/plugins/tinybrowser/upload_process.php
===================================================================
--- trunk/catalog/admin/editeur/tiny_mce/plugins/tinybrowser/upload_process.php 2013-07-22 07:46:40 UTC (rev 4792)
+++ trunk/catalog/admin/editeur/tiny_mce/plugins/tinybrowser/upload_process.php 2013-07-24 07:33:55 UTC (rev 4793)
@@ -35,8 +35,12 @@
{
//-- File Naming
$tmp_filename = DIR_FS_WORK.$file;
- $dest_filename = DIR_FS_ROOT_DOCS.DIR_WS_IMAGES.$folder.rtrim($file,'_');
+ if($_GET['type'] =='file')
+ $dest_filename = DIR_FS_ROOT_DOCS.DIR_WS_DOWNLOAD.$folder.rtrim($file,'_');
+ else
+ $dest_filename = DIR_FS_ROOT_DOCS.DIR_WS_IMAGES.$folder.clean_filename(rtrim($file,'_'));
+
//-- Duplicate Files
if(file_exists($dest_filename)) { unlink($tmp_filename.'_'); $dup++; continue; }
@@ -61,7 +65,7 @@
// indexation of file
$Dbfilename = rtrim($file,'_');
$sql = array(
- 'path'=>DIR_WS_IMAGES.$folder.$Dbfilename,
+ 'path'=>DIR_WS_IMAGES.$folder.$Dbfilename,
'file'=>$Dbfilename,
'width'=>$imginfo['0'],
'height'=>$imginfo['1'],
@@ -69,7 +73,7 @@
);
$id = sqlimage::create($sql);
-
+
// resize image to maximum height and width, if set
if($tinybrowser['imageresize']['width'] > 0 || $tinybrowser['imageresize']['height'] > 0)
{
Modified: trunk/catalog/admin/includes/classes/drivers/sqlcustomersextrafields.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlcustomersextrafields.php 2013-07-22 07:46:40 UTC (rev 4792)
+++ trunk/catalog/admin/includes/classes/drivers/sqlcustomersextrafields.php 2013-07-24 07:33:55 UTC (rev 4793)
@@ -60,6 +60,9 @@
if(isset($option['key'])) $where .="AND fields_key = '".(string)tep_db_input($option['key'])."' ";
// if(isset($option['id'])) $sql_data_array['fields_id'] = $option['id'];
+
+ if(isset($option['new_key'])) $sql_data_array['fields_key'] = $option['new_key'];
+
if(isset($option['size'])) $sql_data_array['fields_size'] = $option['size'];
if(isset($option['sort'])) $sql_data_array['fields_sort'] = $option['sort'];
if(isset($option['input_type'])) $sql_data_array['fields_input_type'] = $option['input_type'];
@@ -74,9 +77,6 @@
if(isset($option['group_class'])) $sql_data_array['fields_group_class'] = $option['group_class'];
-
-
-
$res=tep_db_perform(TABLE_EXTRA_FIELDS, $sql_data_array, 'update' , substr($where,3) );
return $res;
Modified: trunk/catalog/admin/includes/modules/configuration/modcustextra.php
===================================================================
--- trunk/catalog/admin/includes/modules/configuration/modcustextra.php 2013-07-22 07:46:40 UTC (rev 4792)
+++ trunk/catalog/admin/includes/modules/configuration/modcustextra.php 2013-07-24 07:33:55 UTC (rev 4793)
@@ -70,7 +70,7 @@
'size' => tep_db_prepare_input($_POST['fields_size']),
'sort' => tep_db_prepare_input($_POST['fields_sort']),
'required_email' => tep_db_prepare_input($_POST['fields_required_email']),
- 'key' => tep_db_prepare_input($_POST['fields_key']),
+ 'new_key' => tep_db_prepare_input($_POST['fields_key']),
'admin' => tep_db_prepare_input($_POST['fields_admin']),
'special_mod' => tep_db_prepare_input($_POST['fields_special_mod']),
'group_class' => tep_db_prepare_input($_POST['fields_group_class'])
@@ -79,13 +79,14 @@
if (isset(self::$cID)){
$fields_id = tep_db_prepare_input(self::$cID);
$sql_data_array['id']=$fields_id;
+
+ if ( sqlcustomersextrafields::fetch(array('id'=>$fields_id)) )
+ sqlcustomersextrafields::update( $sql_data_array );
}
-
- if (! sqlcustomersextrafields::fetch($sql_data_array) )
+ else
$fields_id = sqlcustomersextrafields::create($sql_data_array);
- else
- sqlcustomersextrafields::update( $sql_data_array );
+
foreach( tep_get_languages() as $rows){
$language_id = $rows['id'];
Modified: trunk/catalog/admin/includes/template/defaut/css/less/datatable.less
===================================================================
--- trunk/catalog/admin/includes/template/defaut/css/less/datatable.less 2013-07-22 07:46:40 UTC (rev 4792)
+++ trunk/catalog/admin/includes/template/defaut/css/less/datatable.less 2013-07-24 07:33:55 UTC (rev 4793)
@@ -128,7 +128,7 @@
.edit-input-value .Flag-0.txt,
.edit-input-value .Val-0.txt { display:none}
.edit-input-value .Flag-0.img{background:transparent url("../../../images/icons/icon_status_red.gif") left top no-repeat}
- .edit-input-value .Val-0.img { width: 10px; background:transparent url("../../../../../images/icons/icon_view_red.gif") left top no-repeat}
+ .edit-input-value .Val-0.img { width: 10px; background:transparent url("../../../images/icons/icon_view_red.gif") left top no-repeat}
.edit-input-value .Flag-1.txt,
.edit-input-value .Val-1.txt { display:none}
@@ -192,25 +192,7 @@
}
}
- 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;}
- }
+ tfoot tr td input {width:80%;text-align:left;}
}
Modified: trunk/catalog/common/classes/DataTypes.php
===================================================================
--- trunk/catalog/common/classes/DataTypes.php 2013-07-22 07:46:40 UTC (rev 4792)
+++ trunk/catalog/common/classes/DataTypes.php 2013-07-24 07:33:55 UTC (rev 4793)
@@ -3,12 +3,12 @@
@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/03/2012, 17:29
+ @version 2.1.2
+ @date 24/07/2013, 17:29
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
@class DataTypes
- @brief Cette class assure l'ordre de chargement et la prise en charge des datatype actif du core.
+ @brief Cette class assure l'ordre de chargement et la prise en charge des datatype actif du core.
ajouter un datatype permet d'ajouter la prise en charge d'un nouveau type de donnée (product, content, ...)
*/
@@ -50,7 +50,7 @@
*/
public static $CurrentMode = '';
/**
- @var all type actived in conf stocked in array value
+ @var all type actived in conf stocked in array value
*/
public static $type_actived = array();
@@ -92,20 +92,20 @@
}
/**
- @remarks add define TABLES_XXX for tables detailled in Datatype drivers
+ @remarks add define TABLES_XXX for tables detailled in Datatype drivers
*/
foreach($define_table as $bydatatype){
foreach($bydatatype as $key=>$row)
- if(!defined($key))
+ if(!defined($key))
define($key , DB_TABLE_PREFIX . $row);
}
/**
- @remarks add define FILENAME_XXX detailled in Datatype drivers
+ @remarks add define FILENAME_XXX detailled in Datatype drivers
*/
foreach($reg_filename as $bydatatype){
foreach($bydatatype as $key=>$row)
- if(!defined($key))
+ if(!defined($key))
define($key , $row);
}
@@ -126,7 +126,7 @@
/**
@brief Get all datatype
@note backoffice used
- @return array
+ @return array
*/
public function GetAllDataType(){
return self::$env->modlist;
@@ -136,7 +136,7 @@
@fn is_active($test)
@brief check if test is actived in datatype
@note frontoffice used
- @return boolean
+ @return boolean
*/
public static function is_active($test){
if(empty($test))
@@ -145,9 +145,22 @@
}
/**
- @brief Get regle anchors in childs module for seo class
+ @brief Get object class for specififc type
+ @return object
+ */
+ public function GetTypeData($type){
+ foreach(self::$env->modlist as $class=>$obj){
+ if('Data_'.$type == $class)
+ return $obj;
+ }
+
+ return false;
+ }
+
+ /**
+ @brief Get regle anchors in childs module for seo class
@note backoffice use
- @return array all type datatypeDynamic for manage and adjust in BO
+ @return array all type datatypeDynamic for manage and adjust in BO
*/
public function GetTypeForRootListing(){
$list = array();
@@ -157,8 +170,8 @@
//no datatype RootListing type (categroie/manufacturer)
if(!isset(self::$env->RootListing[$class])){
- //no datatype static page or error
- if($obj->DataTypeDynamic == true){
+ //no datatype static page or error
+ if($obj->DataTypeDynamic == true){
$list[] = $obj->DataType ;
}
}
@@ -181,12 +194,12 @@
$obj[$class]['name'] = substr($class, 5);
- if(isset($module->reg_static))
+ if(isset($module->reg_static))
$obj[$class]['_static'] = $module->reg_static;
-
+
foreach($module->reg_anchors as $key=>$row)
$obj[$class]['anchor'][$key] = $row;
-
+
foreach($module->reg_check as $key=>$row)
$obj[$class]['check'][] = $row;
@@ -216,8 +229,8 @@
/**
- @brief Get regle anchors in childs module for seo class
- @note fontoffice use
+ @brief Get regle anchors in childs module for seo class
+ @note frontoffice use
*/
public static function GetRegAnchor($reg_anchors){
self::getInstance();
@@ -232,8 +245,8 @@
/**
@brief return type based on anchors
- @note fontoffice use
- @param $anchors string anchor used in seo and url
+ @note frontoffice use
+ @param $anchors string anchor used in seo and url
*/
public static function GetTypeForAnchor($anchors){
self::getInstance();
@@ -248,11 +261,11 @@
/**
- @brief Get regle anchors in childs module for seo class
- @note fontoffice use
+ @brief Get regle anchors in childs module for seo class
+ @note frontoffice use
@param $anchor string
- @param $substype string
- @param $id int
+ @param $substype string
+ @param $id int
@param $language_id int
*/
public static function Getseoquery($anchor, $substype='', $id, $language_id){
@@ -260,7 +273,7 @@
foreach(self::$env->modlist as $class=>$module){
- if(in_array($anchor, $module->reg_anchors) && method_exists($module,'SeoGetQuery') )
+ if(in_array($anchor, $module->reg_anchors) && method_exists($module,'SeoGetQuery') )
return $module->SeoGetQuery($anchor, $substype, $id, $language_id);
}
@@ -268,8 +281,8 @@
}
/**
- @brief Get regle anchors in childs module for seo class
- @note fontoffice use
+ @brief Get regle anchors in childs module for seo class
+ @note frontoffice use
@param $anchor
@param $substype
@param $id
@@ -283,10 +296,10 @@
foreach(self::$env->modlist as $class=>$module){
$type = substr($class, strlen(self::PREFIX));
- //no datatype static page or error
-// if($obj->DataTypeDynamic == true){
+ //no datatype static page or error
+// if($obj->DataTypeDynamic == true){
- if($module->DataTypeDynamic == true && method_exists($module,'SeoCacheQuery') )
+ if($module->DataTypeDynamic == true && method_exists($module,'SeoCacheQuery') )
$result[$type] = $module->SeoCacheQuery($language_id);
}
return $result;
@@ -304,16 +317,16 @@
/**
@brief Return currenttype datatype
- @note fontoffice use
+ @note frontoffice use
@param $type string (current/sub) for return current or sub type data
@return string
*/
public static function GetTypePage($type = 'current'){
self::getInstance();
- if($type == 'sub' && !empty(self::$subDataType) )
+ if($type == 'sub' && !empty(self::$subDataType) )
return self::$subDataType;
- if($type == 'root' && !empty(self::$rootDataType) )
+ if($type == 'root' && !empty(self::$rootDataType) )
return self::$rootDataType;
return self::$currenttype;
}
@@ -321,7 +334,7 @@
/**
@brief active required childs module datatype used in Rootlisting
- @note fontoffice use
+ @note frontoffice use
*/
public static function ForceChilds($type = '', $subtype=''){
self::getInstance();
@@ -335,7 +348,7 @@
/**
@brief Get ForceChilds statut
- @note fontoffice use
+ @note frontoffice use
*/
public static function GetForceChilds(){
self::getInstance();
@@ -345,7 +358,7 @@
/**
@fn DataTypes::is_type($mode='page');
@brief execute le control du type, et renvoi l'objet correspondant, sinon renvoi false
- @note fontoffice use
+ @note frontoffice use
@param $mode le type de control (page/cpath/seo)
@return false or object
*/
@@ -371,7 +384,7 @@
/**
@brief call transversal load in other modules
- @note fontoffice use
+ @note frontoffice use
@param $mode le type de control (page/cpath/seo)
@return false or object
*/
@@ -405,7 +418,7 @@
/**
@brief call transversal load in other modules
- @note fontoffice use
+ @note frontoffice use
@param $mode le type de control (page/cpath/seo)
@return false or object
*/
Modified: trunk/catalog/includes/classes/core_page/customer.php
===================================================================
--- trunk/catalog/includes/classes/core_page/customer.php 2013-07-22 07:46:40 UTC (rev 4792)
+++ trunk/catalog/includes/classes/core_page/customer.php 2013-07-24 07:33:55 UTC (rev 4793)
@@ -229,7 +229,7 @@
/**
@brief extra fields sauf specifique admin
*/
- $extra_fields_query = tep_db_query($s="select ce.fields_id, fields_key, fields_required_email from " . TABLE_EXTRA_FIELDS . " ce where ce.fields_status=1 and fields_admin =3 AND fields_special_mod ='' ");
+ $extra_fields_query = tep_db_query($s="select ce.fields_id, fields_key, fields_required_email from " . TABLE_EXTRA_FIELDS . " ce where ce.fields_status=1 and fields_admin IN(0,3) AND fields_special_mod ='' ");
while($extra_fields = tep_db_fetch_array($extra_fields_query)) {
@@ -372,7 +372,7 @@
while ($extra_fields = tep_db_fetch_array($bas_user)) {
$res[]=$extra_fields['fields_id'];
}
- $extra_fields_query = tep_db_query($sql="select ce.fields_id from " . TABLE_EXTRA_FIELDS . " ce where ce.fields_status=1 and fields_admin =0 " );
+ $extra_fields_query = tep_db_query($sql="select ce.fields_id from " . TABLE_EXTRA_FIELDS . " ce where ce.fields_status=1 and fields_admin IN(0,3) " );
while ($extra_fields = tep_db_fetch_array($extra_fields_query)) {
if(isset($resul['fields_' . $extra_fields['fields_id']])){
@@ -910,7 +910,7 @@
// else $error = true;
//BOF Customers extra fields
- $extra_fields_query = tep_db_query("select ce.fields_id, ce.fields_input_type, ce.fields_required_status, cei.fields_name, ce.fields_status, ce.fields_input_type, ce.fields_size from " . TABLE_EXTRA_FIELDS . " ce, " . TABLE_EXTRA_FIELDS_INFO . " cei where ce.fields_status=1 and ce.fields_admin=0 and cei.fields_id=ce.fields_id and cei.languages_id =" . $this->languages_id);
+ $extra_fields_query = tep_db_query("select ce.fields_id, ce.fields_input_type, ce.fields_required_status, cei.fields_name, ce.fields_status, ce.fields_input_type, ce.fields_size from " . TABLE_EXTRA_FIELDS . " ce, " . TABLE_EXTRA_FIELDS_INFO . " cei where ce.fields_status=1 and ce.fields_admin IN(0,3) and cei.fields_id=ce.fields_id and cei.languages_id =" . $this->languages_id);
while($extra_fields = tep_db_fetch_array($extra_fields_query)){
if(strlen($_post['fields_' . $extra_fields['fields_id']])<$extra_fields['fields_size']){
$error = true;
Modified: trunk/catalog/includes/classes/drivers/data/product.php
===================================================================
--- trunk/catalog/includes/classes/drivers/data/product.php 2013-07-22 07:46:40 UTC (rev 4792)
+++ trunk/catalog/includes/classes/drivers/data/product.php 2013-07-24 07:33:55 UTC (rev 4793)
@@ -256,7 +256,7 @@
*/
protected static function cstr_query($orderby='', $limit='', $option=''){
- $query="SELECT distinct p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price,p.track_stock, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id, pd.products_viewed, p2c.categories_id, p.products_weight, products_type as type
+ $query="SELECT distinct p.products_id,p.products_ref, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url,p.products_price as price_original, p.products_price,p.track_stock, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id, pd.products_viewed, p2c.categories_id, p.products_weight, products_type as type
FROM " . TABLE_PRODUCTS . " p , " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c
WHERE " . DataForceStatus(" p.products_status = '1' AND ") . " pd.products_id = p.products_id and pd.language_id = '" . self::$lg_id . "' and p2c.products_id=p.products_id and c.categories_id=p2c.categories_id " . DataForceStatus(" AND c.categories_status='1' ") . " " ;
Added: trunk/catalog/includes/modules/listing_catchild_and_product.php
===================================================================
--- trunk/catalog/includes/modules/listing_catchild_and_product.php (rev 0)
+++ trunk/catalog/includes/modules/listing_catchild_and_product.php 2013-07-24 07:33:55 UTC (rev 4793)
@@ -0,0 +1,112 @@
+<?php
+/**
+ @licence GPL 2005-2011 The osCSS developers - osCSS Open Source E-commerce
+ @portion code Copyright (c) 2002 osCommerce
+ @package osCSS-2 <www http://www.oscss.org>
+ @version 2.1.2
+ @date 24/07/2013, 10:00
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+ @note
+ Config
+ MAX_DISPLAY_CATSCHILDS_CATS : int for number of categorie
+ MAX_DISPLAY_CATSCHILDS_PRODUCTS : int for number of product by categorie
+*/
+
+
+function sql_listing_catchild_and_product(){
+ global $page;
+
+ $languages_id=$page->the_var('languages_id');
+ $cPath=$page->the_var('cPath');
+ $category_links=$page->the_var('cPath_array');
+ $current_category_id=$page->the_var('current_category_id');
+ $currencies=$page->currencies;
+
+ if($page->_conf_value('MAX_DISPLAY_CATSCHILDS_CATS') <=0)
+ $page->add_var_page('MAX_DISPLAY_CATSCHILDS_CATS','10');
+
+ if (tep_not_null($cPath) ) {
+ $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . (int)$current_category_id . "' and c.categories_id = cd.categories_id and c.categories_status='1' and cd.language_id = '" . (int)$languages_id . "' order by sort_order, cd.categories_name ". $page->_conf_value('MAX_DISPLAY_CATSCHILDS_CATS') );
+ }
+ elseif ($current_category_id ==0) {
+ $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$current_category_id . "' and c.categories_id = cd.categories_id and c.categories_status='1' and cd.language_id = '" . (int)$languages_id . "' order by sort_order, cd.categories_name LIMIT ". $page->_conf_value('MAX_DISPLAY_CATSCHILDS_CATS') );
+ }
+
+ if ( tep_db_num_rows($categories_query) > 0) return $categories_query;
+ else return false;
+}
+
+
+
+
+/**
+ Prepa et passage en object du module, affichage au seins boxe des modules
+*/
+function in_obj_listing_catchild_and_product(){
+ global $page;
+ $languages_id=$page->the_var('languages_id');
+ $currencies=$page->return_object('currencies');
+
+ if($page->_conf_value('MAX_DISPLAY_CATSCHILDS_PRODUCTS') <=0)
+ $page->add_var_page('MAX_DISPLAY_CATSCHILDS_PRODUCTS','3');
+
+ /** init aca module */
+ $aca_listing=$page->new_class('listing');
+ $c=array();
+
+ if( ($res=$page->oscss_modules->_resultsql('listing_catchild_and_product')) ==false ) return null;
+
+
+ // call datatype product
+ $sub = DataTypes::GetTypeData('product');
+ // call datatype categorie
+ $cat = DataTypes::GetTypeData('categorie');
+
+ while ($ele_db = tep_db_fetch_array($res)){
+ // call detail this categorie
+ $cd = categorie::get_item($ele_db['categories_id']);
+ // add type for template process
+ $cd->type = 'categorie';
+
+ // reset current listing
+ $listing=listing::getInstance();
+ $listing->_reset();
+
+ // force current cat id
+ $page->add_var_page('current_category_id',(int)$ele_db['categories_id']);
+
+ // construct listing_sql
+ $cat->FO_load_listing('product', $sub);
+
+ // add limit for nbr product
+ $listing->limit(' limit '. $page->_conf_value('MAX_DISPLAY_CATSCHILDS_PRODUCTS') );
+ $listing_query = $listing->listing($cat,$ele_db['categories_id']);
+
+ $p=array();
+ /** init aca module */
+ $aca_listing=$page->new_class('listing');
+ if(is_string($listing_query))$listing_query=tep_db_query($listing_query);
+
+ while ($listing = tep_db_fetch_array($listing_query)){
+ $pd=product::get_item($listing['products_id']);
+ $pd->type = 'product';
+ $p[]=$pd;
+ }
+
+ if(count($p)>0){
+ $cd->products = $p;
+ /// adjust result global
+ $c[]=$cd;
+ }
+ }
+
+ //reset
+ $page->add_var_page('current_category_id',0);
+
+ return new objectInfo(array('title'=>HEADING_CHILD_CAT, 'content'=>$c ));
+
+}
+
+
+?>
\ 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-07-22 07:46:44
|
Revision: 4792
http://sourceforge.net/p/oscss/svn/4792
Author: oscim
Date: 2013-07-22 07:46:40 +0000 (Mon, 22 Jul 2013)
Log Message:
-----------
Fix process for type 2 in create account public shop
Modified Paths:
--------------
trunk/catalog/includes/classes/core_page/customer.php
Modified: trunk/catalog/includes/classes/core_page/customer.php
===================================================================
--- trunk/catalog/includes/classes/core_page/customer.php 2013-07-22 07:16:20 UTC (rev 4791)
+++ trunk/catalog/includes/classes/core_page/customer.php 2013-07-22 07:46:40 UTC (rev 4792)
@@ -84,7 +84,7 @@
* @return array
*/
private function detail_cust(){
- $account_query = tep_db_query("select customers_id, customers_gender, customers_firstname, customers_lastname, customers_dob, customers_email_address, customers_telephone, customers_fax, customers_newsletter,customers_default_address_id, c.customers_group_id, c.customers_group_ra, c.customers_payment_allowed, c.customers_shipment_allowed, c.customers_order_total_allowed, c.customers_specific_taxes_exempt , customers_status, customers_shopping_points from " . TABLE_CUSTOMERS . " c where customers_id = '" . $this->customer_id . "'");
+ $account_query = tep_db_query("select customers_id, customers_type, customers_gender, customers_firstname, customers_lastname, customers_dob, customers_email_address, customers_telephone, customers_fax, customers_newsletter,customers_default_address_id, c.customers_group_id, c.customers_group_ra, c.customers_payment_allowed, c.customers_shipment_allowed, c.customers_order_total_allowed, c.customers_specific_taxes_exempt , customers_status, customers_shopping_points from " . TABLE_CUSTOMERS . " c where customers_id = '" . $this->customer_id . "'");
$account = tep_db_fetch_array($account_query);
$value_query = tep_db_query("select fields_name,fields_key, value from " . TABLE_EXTRA_FIELDS . " ce, " . TABLE_CUSTOMERS_TO_EXTRA_FIELDS . " cef, " . TABLE_EXTRA_FIELDS_INFO . " cei where cef.customers_id= '" . $this->customer_id . "' and cei.fields_id=ce.fields_id and cef.fields_id= cei.fields_id and languages_id='".$this->languages_id."' and ce.fields_admin !=1 " );
@@ -182,44 +182,48 @@
$newcustomer=array();
if ( ( ($resul=$this->CheckData($_post)) && $resul !=false && is_array($resul))
- && ( ($pass=$this->CheckDataPassword($_post)) && $pass !=false && is_array($pass) ) ){
+ && ( ($pass=$this->CheckDataPassword($_post)) && $pass !=false && is_array($pass) ) ){
- $resul=array_merge($pass,$resul);
+ $resul=array_merge($pass,$resul);
- /// include the password crypto functions
- // require_once(DIR_WS_FUNCTIONS . 'password_funcs.php');
+ /// include the password crypto functions
+// require_once(DIR_WS_FUNCTIONS . 'password_funcs.php');
- if (_cst_bool('CUSTOMER_FORCE_UCWORDS')) {
- $resul['lastname']=ucwords($resul['lastname']);
- $resul['firstname']=ucwords($resul['firstname']);
- }
- if (_cst_bool('CUSTOMER_FORCE_STRTOUPPER')) {
- $resul['lastname']=strtoupper($resul['lastname']);
- }
+ if (_cst_bool('CUSTOMER_FORCE_UCWORDS')) {
+ $resul['lastname']=ucwords($resul['lastname']);
+ $resul['firstname']=ucwords($resul['firstname']);
+ }
+ if (_cst_bool('CUSTOMER_FORCE_STRTOUPPER')) {
+ $resul['lastname']=strtoupper($resul['lastname']);
+ }
- $check_customer['customers_group_id']=( (_cst_bool('ACCOUNT_COMPANY') && isset($resul['company_tax_id']))? 0 : 1 );
+ $check_customer['customers_group_id']=(!isset($resul['type'])? 0 : 1 );
- $sql_data_array = array('customers_firstname' => $resul['firstname'],
- 'customers_lastname' => $resul['lastname'],
- 'customers_email_address' => $resul['email_address'],
- 'customers_telephone' => $resul['telephone'],
- 'customers_fax' => $resul['fax'],
- 'customers_newsletter' => $resul['newsletter'],
- 'customers_password' =>PasswordUtility::encrypt_password($resul['password']),
- 'customers_group_ra'=> $check_customer['customers_group_id'],
- 'customers_language'=> $this->languages_id,
- 'customers_status'=> (_cst_bool('ACCOUNT_FORCE_ACTIV_MAIL')? 2 : 1)
- );
+ $sql_data_array = array(
+ 'customers_type' => (int)$resul['type'],
+ 'customers_firstname' => $resul['firstname'],
+ 'customers_lastname' => $resul['lastname'],
+ 'customers_email_address' => $resul['email_address'],
+ 'customers_telephone' => $resul['telephone'],
+ 'customers_fax' => $resul['fax'],
+ 'customers_newsletter' => $resul['newsletter'],
+ 'customers_password' =>PasswordUtility::encrypt_password($resul['password']),
+ 'customers_group_id'=> $check_customer['customers_group_id'],
+ // not activ if group ip > 0
+ 'customers_group_ra'=> (($check_customer['customers_group_id'] > 0 )? 0 : 1 ),
+ 'customers_language'=> $this->languages_id,
+ 'customers_status'=> (_cst_bool('ACCOUNT_FORCE_ACTIV_MAIL')? 2 : 1)
+ );
- if (_cst_bool('ACCOUNT_GENDER')) $sql_data_array['customers_gender'] = $resul['gender'];
- if (_cst_bool('ACCOUNT_DOB')) $sql_data_array['customers_dob'] = tep_date_raw($resul['dob']);
+ if (_cst_bool('ACCOUNT_GENDER')) $sql_data_array['customers_gender'] = $resul['gender'];
+ if (_cst_bool('ACCOUNT_DOB')) $sql_data_array['customers_dob'] = tep_date_raw($resul['dob']);
- $res=tep_db_perform(TABLE_CUSTOMERS, $sql_data_array);
- $newcustomer = $sql_data_array;
+ $res=tep_db_perform(TABLE_CUSTOMERS, $sql_data_array);
+ $newcustomer = $sql_data_array;
- $newcustomer['customers_id']=$customer_id=tep_db_insert_id($res);
+ $newcustomer['customers_id']=$customer_id=tep_db_insert_id($res);
- tep_db_query("insert into " . TABLE_CUSTOMERS_INFO . " (customers_info_id, customers_info_number_of_logons, customers_info_date_account_created,customers_info_date_account_last_modified) values ('" . (int)$customer_id . "', '0', now(), now())");
+ tep_db_query("insert into " . TABLE_CUSTOMERS_INFO . " (customers_info_id, customers_info_number_of_logons, customers_info_date_account_created,customers_info_date_account_last_modified) values ('" . (int)$customer_id . "', '0', now(), now())");
/**
@@ -263,65 +267,65 @@
if ( ($resul=$this->CheckDataAddressBook($_post)) && $resul !=false && is_array($resul)) {
- if (_cst_bool('CUSTOMER_CITY_FORCE_STRTOUPPER')) {
- $resul['city']=strtoupper($resul['city']);
- }
+ if (_cst_bool('CUSTOMER_CITY_FORCE_STRTOUPPER')) {
+ $resul['city']=strtoupper($resul['city']);
+ }
- $sql_data_array = array('customers_id' => $customer_id,
- 'entry_firstname' => $resul['firstname'],
- 'entry_lastname' => $resul['lastname'],
- 'entry_street_address' => $resul['street_address'],
- 'entry_postcode' => $resul['postcode'],
- 'entry_city' => $resul['city'],
- 'entry_country_id' => $resul['country']);
+ $sql_data_array = array('customers_id' => $customer_id,
+ 'entry_firstname' => $resul['firstname'],
+ 'entry_lastname' => $resul['lastname'],
+ 'entry_street_address' => $resul['street_address'],
+ 'entry_postcode' => $resul['postcode'],
+ 'entry_city' => $resul['city'],
+ 'entry_country_id' => $resul['country']);
- if (_cst_bool('ACCOUNT_GENDER')) $sql_data_array['entry_gender'] = $resul['gender'];
- if (_cst_bool('ACCOUNT_COMPANY')){
- $sql_data_array['entry_company'] = $resul['company'];
- $sql_data_array['entry_company_tax_id'] = $resul['company_tax_id'];
- }
- if (_cst_bool('ACCOUNT_SUBURB')) $sql_data_array['entry_suburb'] = $resul['suburb'];
- if (_cst_bool('ACCOUNT_STATE')) {
- if (isset($resul['zone_id']) && $resul['zone_id'] > 0) {
- $sql_data_array['entry_zone_id'] = @$resul['zone_id'];
- $sql_data_array['entry_state'] = '';
- } else {
- $sql_data_array['entry_zone_id'] = '0';
- $sql_data_array['entry_state'] = @$resul['state'];
- }
- }
+ if (_cst_bool('ACCOUNT_GENDER')) $sql_data_array['entry_gender'] = $resul['gender'];
+ if (_cst_bool('ACCOUNT_COMPANY')){
+ $sql_data_array['entry_company'] = $resul['company'];
+ $sql_data_array['entry_company_tax_id'] = $resul['company_tax_id'];
+ }
+ if (_cst_bool('ACCOUNT_SUBURB')) $sql_data_array['entry_suburb'] = $resul['suburb'];
+ if (_cst_bool('ACCOUNT_STATE')) {
+ if (isset($resul['zone_id']) && $resul['zone_id'] > 0) {
+ $sql_data_array['entry_zone_id'] = @$resul['zone_id'];
+ $sql_data_array['entry_state'] = '';
+ } else {
+ $sql_data_array['entry_zone_id'] = '0';
+ $sql_data_array['entry_state'] = @$resul['state'];
+ }
+ }
- tep_db_perform(TABLE_ADDRESS_BOOK, $sql_data_array);
+ tep_db_perform(TABLE_ADDRESS_BOOK, $sql_data_array);
- $newcustomer=array_merge($newcustomer,$sql_data_array);
+ $newcustomer=array_merge($newcustomer,$sql_data_array);
- $cs_s=tep_db_query("select address_book_id from " . TABLE_ADDRESS_BOOK . " where customers_id='".$customer_id."' ORDER BY address_book_id DESC");
- $cs=tep_db_fetch_array($cs_s);
- $address_id=$cs['address_book_id'];
+ $cs_s=tep_db_query("select address_book_id from " . TABLE_ADDRESS_BOOK . " where customers_id='".$customer_id."' ORDER BY address_book_id DESC");
+ $cs=tep_db_fetch_array($cs_s);
+ $address_id=$cs['address_book_id'];
- $newcustomer['address_book_id']= $address_id;
+ $newcustomer['address_book_id']= $address_id;
- tep_db_query("update " . TABLE_CUSTOMERS . " set customers_default_address_id = '" . (int)$address_id . "' where customers_id = '" . (int)$customer_id . "'");
- }
- else {
- $resul=$this->CheckData($_post);
- $sql_data_array = array('customers_id' => $customer_id,
- 'entry_firstname' => $resul['firstname'],
- 'entry_lastname' => $resul['lastname']);
+ tep_db_query("update " . TABLE_CUSTOMERS . " set customers_default_address_id = '" . (int)$address_id . "' where customers_id = '" . (int)$customer_id . "'");
+ }
+ else {
+ $resul=$this->CheckData($_post);
+ $sql_data_array = array('customers_id' => $customer_id,
+ 'entry_firstname' => $resul['firstname'],
+ 'entry_lastname' => $resul['lastname']);
- tep_db_perform(TABLE_ADDRESS_BOOK, $sql_data_array);
+ tep_db_perform(TABLE_ADDRESS_BOOK, $sql_data_array);
- $cs_s=tep_db_query("select address_book_id from " . TABLE_ADDRESS_BOOK . " where customers_id='".$customer_id."' ORDER BY address_book_id DESC");
- $cs=tep_db_fetch_array($cs_s);
- $address_id=$cs['address_book_id'];
+ $cs_s=tep_db_query("select address_book_id from " . TABLE_ADDRESS_BOOK . " where customers_id='".$customer_id."' ORDER BY address_book_id DESC");
+ $cs=tep_db_fetch_array($cs_s);
+ $address_id=$cs['address_book_id'];
- $newcustomer['address_book_id']= $address_id;
+ $newcustomer['address_book_id']= $address_id;
- tep_db_query("update " . TABLE_CUSTOMERS . " set customers_default_address_id = '" . (int)$address_id . "' where customers_id = '" . (int)$customer_id . "'");
+ tep_db_query("update " . TABLE_CUSTOMERS . " set customers_default_address_id = '" . (int)$address_id . "' where customers_id = '" . (int)$customer_id . "'");
}
/**
- @brief call method module account
+ @brief call method module account
*/
$page=page::getInstance();
$aca_account=$page->new_class('account',$customer_id);
@@ -819,12 +823,13 @@
if (_cst_bool('ACCOUNT_GENDER')) {
if (isset($_post['gender'])) {
- $sortie['gender'] = tep_db_prepare_input($_post['gender']);
+ $sortie['gender'] = tep_db_prepare_input($_post['gender']);
} else {
- $sortie['gender'] = false;
+ $sortie['gender'] = false;
}
}
+ $sortie['type'] = (isset($_post['customers_type']))?tep_db_prepare_input($_post['customers_type']): 1 ;
$sortie['firstname'] = (isset($_post['firstname']))?tep_db_prepare_input($_post['firstname']) : '';
$sortie['lastname'] = (isset($_post['lastname']))?tep_db_prepare_input($_post['lastname']): '';
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2013-07-22 07:16:23
|
Revision: 4791
http://sourceforge.net/p/oscss/svn/4791
Author: oscim
Date: 2013-07-22 07:16:20 +0000 (Mon, 22 Jul 2013)
Log Message:
-----------
Fix bug delete customers
Modified Paths:
--------------
trunk/catalog/admin/includes/classes/drivers/sqlcustomer.php
trunk/catalog/admin/includes/modules/pages/customers.php
Modified: trunk/catalog/admin/includes/classes/drivers/sqlcustomer.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlcustomer.php 2013-07-22 06:36:22 UTC (rev 4790)
+++ trunk/catalog/admin/includes/classes/drivers/sqlcustomer.php 2013-07-22 07:16:20 UTC (rev 4791)
@@ -264,7 +264,7 @@
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 . "'");
Modified: trunk/catalog/admin/includes/modules/pages/customers.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/customers.php 2013-07-22 06:36:22 UTC (rev 4790)
+++ trunk/catalog/admin/includes/modules/pages/customers.php 2013-07-22 07:16:20 UTC (rev 4791)
@@ -262,10 +262,10 @@
array[
// For normalised filter define on method ConvertInitVar
generic =>
- array (
- 'string'
+ array (
+ 'string'
// , ....
- );
+ );
mod =>
array(
'title'=>__('@products filter tab manufacturer'),
@@ -281,7 +281,7 @@
@remarks this define menu master module in page
@note use $boutons[action][] = array(params)
- params :
+ params :
'type'=>'getLink',
'format'=>'button_nav',
'image'=>'',
@@ -310,9 +310,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);
@@ -389,7 +389,7 @@
if(!isset($_GET['forceajax']))
tep_redirect(tep_href_link(self::FILENAME, 'cID=' . $_GET['cID']));
-
+
break;
case 'setflagda':
@@ -413,10 +413,10 @@
$result=sqlcustomer::fetch(array('id'=> tep_db_prepare_input(self::$Id) ), true );
$vt="HOME";
-
+
if($result->gender)
$gender='Mr' ;
- else
+ else
$gender='Ms' ;
$vcard_content = "BEGIN:VCARD\r\n";
@@ -564,14 +564,14 @@
break;
case 'deleteconfirm':
$customers_id = tep_db_prepare_input(self::$Id);
- $result=sqlcustomer::fetch(array('id'=>$_id), false );
-
+ $result=sqlcustomer::fetch(array('id'=>$customers_id), false );
+
if($result ==false)
tep_redirect(tep_href_link(self::FILENAME));
if( sqlcustomer::delete(array('id'=>$customers_id)) !=false )
$messageStack->add_session(sprintf(__('action delete for %s ok'), $result['customers_firstname'] .' '. $result['customers_email_address']), 'success');
- else
+ else
$messageStack->add_session(sprintf(__('error delete for %s'), $result['customers_firstname'] .' '. $result['customers_email_address'] ), 'error');
tep_redirect(tep_href_link(self::FILENAME));
@@ -706,7 +706,7 @@
/* END Sub module add col */
$query_raw .= " ORDER BY ".((!empty($adjust->sOrder)) ? $adjust->sOrder : ' ci.customers_info_date_account_created DESC ');
-
+
$_query = $DB->query($query_raw);
$query_numrows = $_query->__get('numRows');
$_split = new splitPageResults($adjust->page, $adjust->rowbyp, $query_raw, $query_numrows);
@@ -813,7 +813,7 @@
/** static InterfacedInnerHtml */
public static function detail_row_page($id){
- // force rattribution id
+ // force rattribution id
$_REQUEST['cID'] = (int)$id;
self::GetConf();
self::load_db_values((int)$id);
@@ -944,7 +944,7 @@
/* DEB Sub module add col */
$external = array();
foreach(self::$allfieldsexternal as $key => $value ){
- $clean = substr($key, (strpos($key, '.')+1));
+ $clean = substr($key, (strpos($key, '.')+1));
$alias = (isset($value['alias'])? $value['alias'] : $clean);
$external[] = $alias;
$process[$alias] = $value['module'];
@@ -954,11 +954,18 @@
while ($item = $_query->fetchAssoc()) {
$ord =array();
-
$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 == 'entry_gender'){
+ if($row == 'm')
+ $ord[$k]=MALE;
+ elseif($row == 'f')
+ $ord[$k]=FEMALE;
+ elseif($row == 'l')
+ $ord[$k]=MLLE;
+ }
elseif($k == 'status') $ord[$k]=self::RowStatus($item);
elseif($k == 'group_ra') $ord[$k]=self::RowStatusDa($item);
elseif(in_array($k, array('added','modified','last_logon')) ) $ord[$k]=tep_date_short($item[$k]);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2013-07-22 06:36:27
|
Revision: 4790
http://sourceforge.net/p/oscss/svn/4790
Author: oscim
Date: 2013-07-22 06:36:22 +0000 (Mon, 22 Jul 2013)
Log Message:
-----------
Fix bug if one childs data in featured
Modified Paths:
--------------
trunk/catalog/admin/includes/classes/drivers/sqlfeatured.php
Modified: trunk/catalog/admin/includes/classes/drivers/sqlfeatured.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlfeatured.php 2013-07-21 07:03:29 UTC (rev 4789)
+++ trunk/catalog/admin/includes/classes/drivers/sqlfeatured.php 2013-07-22 06:36:22 UTC (rev 4790)
@@ -7,551 +7,605 @@
@date 22/04/2012 ,22:50:08
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
- @class sqlfeatured
- @file sqlfeatured.php
- @brief manage db update/insert/delete for featured
+ @class featureds
*/
+class featureds
+ extends ModTwo /// new abstract class for nextgen module
+ implements
+ InterfaceModule,
+ /*IntModTwo, */ /// new interface module for nextgen module
+ ExtModConfig {
+ const FILENAME = FILENAME_FEATURED;
-class sqlfeatured
- implements ModSqlDataDriver{
+ /**
+ @var string file
+ */
+ public static $Id;
+ /**
+ @var array list code action module
+ */
+ public static $list=array();
+ /**
+ @var current object
+ */
+ public static $Info;
- public static $modules;
- protected static $_instance;
- protected function __construct(){
+ /**
+ @brief class constructor
+ */
+ public function __construct() {
+ self::GetConf();
}
- public static function getInstance() {
- if(self::$_instance == null) self::$_instance = new self();
- return self::$_instance;
- }
-
-
/**
- @brief create new ligne in table configuration
+ @brief Load , adjust and define var environement exe for module
+ Is use in module and class abstract for init value config this module
*/
- public static function create($option){
- self::getInstance();
+ public static function GetConf(){
+ global $languages_id;
- if(!isset($option['type']))
- return 'type';
+ self::$code=__CLASS__;
+ self::$datatype = 'featured';
-// $sql_data_array['row_id'] = tep_db_prepare_input($option['id']);
- $sql_data_array['k_status_type'] = tep_db_prepare_input($option['type']);
- $sql_data_array['featured_uniqkey'] = ((isset($option['key']) && strlen($option['key'])>5) ? tep_db_prepare_input($option['key']) :'uniqkey'.rand() );
- $sql_data_array['featured_min'] = (isset($option['min'])) ? tep_db_prepare_input($option['min']) :1;
- $sql_data_array['featured_max'] = (isset($option['max'])) ? tep_db_prepare_input($option['max']) :5;
- $sql_data_array['featured_status'] = (isset($option['status'])) ? tep_db_prepare_input($option['status']) :0;
+ self::$action=(isset($_REQUEST['action'])? (string)$_REQUEST['action'] : 'listing' );
+ self::$Id=(isset($_REQUEST['cID'])? (int)$_REQUEST['cID'] : 0 );
- $sql_data_array['date_added'] = 'NOW()';
- $sql_data_array['user_added'] = $_SESSION['login_id'];
+ /**
+ @remarks define var execution sql in GetDBValue()
+ */
+ self::$InitInfo['adjust']=array(
+ 'languages_id'=>$languages_id,
+ 'page'=>1,
+ 'rowbyp'=>10,
+ 'sOrder'=>'',
+ 'sWhere'=>'',
+ );
- $res=tep_db_perform(TABLE_FEATURED, $sql_data_array);
- $id = $res->__get('insertId');
+ /**
+ @remarks not load if not first init
+ */
+ if(!defined('JSONSTATMENT')) {
- foreach(tep_get_languages() as $lg) {
+ if(self::$action =='' || self::$action =='listing')
+ //! active datatable in ajax, precise les GET necessaire
+ define('JSONSTATMENT', 'ModTwo=true&mod=page&type='.self::$code.
+ (isset(parent::$action)?'&action='.parent::$action : '' ).
+ (isset(self::$Id)?'&file='.self::$Id : '' )
+ );
- $row = $option['langue'];
-
- $sql_data_array_lg = array(
- 'featured_id'=>(int)$id,
- 'languages_id'=>(int)$lg['id'],
- 'featured_title'=> ((isset($row['title'][$lg['id']])) ? tep_db_prepare_input($row['title'][$lg['id']]) : '' ),
- );
- $res=tep_db_perform(TABLE_FEATURED_DESCRIPTION, $sql_data_array_lg);
}
+ /**
+ @remarks this define col theader title, and ajust html code
+ Just for Edit listing
+ */
+ self::$allfields = array(
+ 'c.row_id' => array(
+ 'sort'=>true,
+ 'alias'=>'id',
+ 'text'=>__('@featureds table heading id'),
+ 'width'=>'2%',
+ 'class'=>'tcenter',
+ 'default'=>true,
+ ),
+ 'c.featured_uniqkey' => array(
+ 'sort'=>true,
+// 'alias'=>'key',
+ 'text'=>__('@featureds table heading key'),
+ 'class'=>'tcenter',
+ 'default'=>true,
+ ),
+ 'fd.featured_title' => array(
+ 'sort'=>true,
+ 'alias'=>'title',
+ 'text'=>__('@featureds table heading title'),
+ 'class'=>'tleft',
+ 'width'=>'40%',
+ 'default'=>true,
+ ),
- if(!$res)
- return $res;
- else
- return $id;
- }
+ 'c.k_status_type' => array(
+ 'sort'=>true,
+ 'alias'=>'type',
+ 'text'=>__('@featureds table heading status type id'),
+ 'width'=>'8%',
+ 'class'=>'tcenter',
+ ),
+ 's.status_name' => array(
+ 'sort'=>true,
+ 'alias'=>'type_name',
+ 'text'=>__('@featureds table heading status type name'),
+ 'width'=>'10%',
+ 'class'=>'tcenter',
+ 'default'=>true,
+ ),
- /**
- @brief update ligne in table configuration
- */
- public static function update($option){
- self::getInstance();
+ 'c.featured_min' => array(
+ 'sort'=>true,
+ 'alias'=>'min',
+ 'text'=>__('@featureds table heading min'),
+ 'width'=>'2%',
+ 'class'=>'tcenter',
+ ),
+ 'c.featured_max' => array(
+ 'sort'=>true,
+ 'alias'=>'max',
+ 'text'=>__('@featureds table heading max'),
+ 'width'=>'2%',
+ 'class'=>'tcenter',
+ ),
+ 'c.date_added' => array(
+ 'sort'=>true,
+ 'alias'=>'date_added',
+ 'text'=>__('@featureds table heading date_added'),
+ 'width'=>'10%',
+ ),
+ 'c.date_update' => array(
+ 'sort'=>true,
+ 'alias'=>'date_update',
+ 'text'=>__('@featureds table heading date_update'),
+ 'width'=>'10%',
+ ),
+ 'c.user_added' => array(
+ 'sort'=>true,
+ 'alias'=>'user_added',
+ 'text'=>__('@featureds table heading user_added'),
+ 'width'=>'10%',
+ ),
+ 'c.user_update' => array(
+ 'sort'=>true,
+ 'alias'=>'user_update',
+ 'text'=>__('@featureds table heading user_update'),
+ 'width'=>'10%',
+ ),
+ 'c.featured_status' => array(
+ 'sort'=>true,
+ 'alias'=>'status',
+ 'text'=>__('@featureds table heading status'),
+ 'width'=>'2%',
+ 'class'=>'tcenter',
+ 'default'=>true,
+ ),
+ );
- if(!isset($option['id']))
- return 'id';
+// , k_status_type as type , featured_status
- $where ='';
- $where_lg ='';
- if(isset($option['id'])){
- $where_lg .= "AND featured_id = '".(int)$option['id']."' ";
- $where .= "AND row_id = '".(int)$option['id']."' ";
- }
- if(isset($option['type'])) $where .="AND k_status_type = '".(int)$option['type']."' ";
- if(isset($option['key'])) $where .="AND featured_uniqkey = '".(int)$option['key']."' ";
+ /// @remarks min fields and not view directly colonne fields
+ $listfield = 'k_status_type as type , featured_status,';
-// if(isset($option['status'])) $where .="AND featured_status = '".(int)$option['status']."' ";
+ /// @remarks Active forms filter
+ $mutli=array();
+ /**
+ @remarks Active forms filter
+ @note
+ array[
+ // For normalised filter define on method ConvertInitVar
+ generic =>
+ array (
+ 'string'
+ // , ....
+ );
+ mod =>
+ array(
+ 'title'=>__('@products filter tab manufacturer'),
+ 'content'=>tep_get_include_contents('manufacturers/filter.manufacturer'),
+ )
+ ]
+ */
+ $tab = array();
+ /**
+ @remarks this define menu master module in page
+ @note use $boutons[action][] = array(params)
- if(isset($option['new_type']))$sql_data_array['k_status_type'] = tep_db_prepare_input($option['new_type']);
+ params :
+ 'type'=>'getLink',
+ 'format'=>'button_nav',
+ 'image'=>'',
+ 'cssclass'=>'button',
+ 'title'=>__('image create new content'),
+ 'url'=>tep_href_link(self::FILENAME, 'action=new'),
+ */
+ $boutons = array();
- 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']);
+ $boutons['listing'][] =array(
+ 'type'=>'getLink',
+ 'format'=>'button_nav',
+ 'image'=>'',
+ 'cssclass'=>'',
+ '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
+ $mutli array action multiple
+ $filter array put list off activate tab filter
+ $boutons array
+ */
+ self::ConvertInitVar( $listfield, $mutli, $tab, $boutons);
- $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) );
-
-
-
- foreach(tep_get_languages() as $lg) {
-
- $row = $option['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']]) : '' ),
- );
-
- $res=tep_db_perform(TABLE_FEATURED_DESCRIPTION, $sql_data_array_lg, 'update' , substr($where_lg,3));
- }
- }
-
- return $res;
+ return true;
}
- /**
- @brief load ligne in table configuration
- @param option array
- id => row id int (configuration_id)
- key => string key (configuration_key)
- group_id => group_id int (configuration_group_id)
- @param $shortkey use cleankey for return short key
- @return
- object(stdClass)[13]
- public 'id' => string '1' (length=1)
+ /**
+ @fn check_action($actions)
+ @brief Process action
+ @param $actions string
+ @return $actions string
+ */
+ public function check_action($actions){
+ global $messageStack;
- OR
- array(
- object(stdClass)[13]
- ...
- object(stdClass)[13]
- ..
- )
+ self::$action=$actions;
- */
- public static function fetch($option,$shortkey=false){
- self::getInstance();
- $DB=Database::getInstance();
+ switch (self::$action) {
- $where ="";
- if(isset($option['id'])) $where .="AND row_id = '".(int)$option['id']."' ";
- if(isset($option['type'])) $where .="AND k_status_type = '".(int)$option['type']."' ";
- if(isset($option['status'])) $where .="AND featured_status = '".(int)$option['status']."' ";
- if(isset($option['key'])) $where .="AND featured_uniqkey = '".(int)$option['key']."' ";
+ /**
+ @remarks specific save in session value filters
+ */
+ case 'filters':
+ /*
+ Call Prev Process
+ */
+ self::actionFilter();
- if($where !='')
- $where = " WHERE ".substr($where,3);
+ tep_redirect(tep_href_link(self::FILENAME));
+ break;
+ case 'setflag':
+ if ( ($_GET['flag'] == '0') || ($_GET['flag'] == '1') ) {
+ $c_id =(int) tep_db_prepare_input($_GET['cID']);
- $sql="SELECT * FROM " . TABLE_FEATURED . " a ".$where ;
+ if ($c_id > 0){
+ $myarray = array('id'=>$c_id, 'status'=>$_GET['flag'] );
+ sqlfeatured::update($myarray);
+ }
+ }
- $res=$DB->query($sql);
+ $messageStack->add(__('@featureds update status'), 'success');
- $num = $res->__get('numRows');
+ if(!isset($_GET['forceajax']))
+ tep_redirect(tep_href_link(self::FILENAME, 'cID=' . $_GET['cID']));
+ break;
- if($num == 1){
- $result=$res->fetchAssoc();
+ 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']),
+ );
+ foreach(tep_get_languages() as $row) {
+ $myarray['langue']['title'][$row['id']] = tep_db_prepare_input($_POST['title'][$row['id']]);
+ }
- // call all langue for this post
- $whlg = '';
- if(isset($option['language_id']))
- $whlg=" AND languages_id='" . $option['language_id'] . "' ";
+ $res = sqlfeatured::create($myarray);
- $_query = $DB->query("select languages_id , fd.featured_title from " . TABLE_FEATURED_DESCRIPTION . " fd where fd.featured_id = '" . (int)$result['row_id'] . "' ");
+ tep_redirect(tep_href_link(self::FILENAME ));
+ break;
- foreach($_query->fetchAllAssoc() as $row)
- $result['lg'][$row['languages_id']] = ((!$shortkey)? $row : self::CleanKey($row));
+ case 'update':
+ $c_id =(int) tep_db_prepare_input($_GET['cID']);
+ 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']),
+ );
+ foreach(tep_get_languages() as $row) {
+ $myarray['langue']['title'][$row['id']] = tep_db_prepare_input($_POST['title'][$row['id']]);
+ }
- return ((!$shortkey)? $result : self::CleanKey($result));
- }
- elseif($num > 1){
- $array=array();
- global $languages_id;
- foreach($res->fetchAllAssoc() as $result) {
- // call all langue for this post
- $whlg = '';
- if(isset($option['language_id']))
- $whlg=" AND languages_id='" . $option['language_id'] . "' ";
+ $res =sqlfeatured::update($myarray);
+ }
- $_query = $DB->query("select languages_id , fd.featured_title from " . TABLE_FEATURED_DESCRIPTION . " fd where fd.featured_id = '" . (int)$result['row_id'] . "' ");
+ tep_redirect(tep_href_link(self::FILENAME, 'action=edit&cID=' . $c_id ));
+ break;
- foreach($_query->fetchAllAssoc() as $row)
- $result['lg'][$row['languages_id']] = ((!$shortkey)? $row : self::CleanKey($row));
+ case 'delete_confirm':
+ $c_id =(int) tep_db_prepare_input($_POST['cID']);
+ if ($c_id > 0){
+ $myarray = array(
+ 'id'=>$c_id,
+ );
+ $res=sqlfeatured::delete($myarray);
+ }
-
- $array[]= ((!$shortkey)? $result : self::CleanKey($result));
- }
- return $array;
+ tep_redirect(tep_href_link(self::FILENAME));
+ break;
}
- return false;
+ return self::$action;
}
- /**
- @brief delete row
- */
- public static function delete($option){
- self::getInstance();
- $DB=Database::getInstance();
-
- $where ="";
- if(isset($option['id'])) $where .="AND row_id = '".(int)$option['id']."' ";
- if(isset($option['type'])) $where .="AND k_status_type = '".(int)$option['type']."' ";
- if(isset($option['status'])) $where .="AND featured_status = '".(int)$option['status']."' ";
-
-
- if($where=='')
- return false;
-
- $res = $DB->query("SELECT row_id as id FROM " . TABLE_FEATURED ." WHERE ". substr($where, 3 ).' LIMIT 1' );
- $result = $res->fetchAssoc();
-
-
- // childs tables
- $DB->query("delete from " . TABLE_FEATURED_DATA . " where featured_id = '" . (int)$result['id'] . "'");
- $DB->query("delete from " . TABLE_FEATURED_DESCRIPTION . " where featured_id = '" . (int)$result['id'] . "'");
-
- $DB->query("delete from " . TABLE_FEATURED . " where row_id = '" . (int)$result['id'] . "'");
-
-
- return true;
+ public function get_header(){
}
/**
- @brief
- @return array product empty
+ @fn featureds::GetDBValue();
+ @brief return DB value adapted for current action
+ Use self::action for determine switch
+ @return
*/
- public static function Specimen($shortkey=false){
- $par = array(
- 'row_id' => '',
- 'k_status_type' => '',
- 'featured_min' => '',
- 'featured_max' => '',
- 'featured_status' => '',
- );
+ public static function GetDBValue(){
- foreach(tep_get_languages() as $lg)
- $par['lg'][$lg['id']] = array(
- 'featured_title'=>'',
- );
+ $DB= Database::getInstance();
- return ((!$shortkey)? $par : self::CleanKey($par));
- }
+ switch (self::$action) {
+ case 'delete':
+ case 'edit':
+ case 'new':
+ if( (int)self::$Id > 0) {
+ self::$Info = sqlfeatured::fetch(array('id'=>self::$Id ), true);
- /**
- @fn CleanKey()
- @brief Clean string name key
- */
- private static function CleanKey($array){
- self::getInstance();
- $object= new stdclass();
+ $res = sqlfeatureddata::fetch(array('featured_id'=>self::$Id), true);
- foreach($array as $key=>$value){
- if( strpos($key,'row_') ===0)
- $key=substr($key,strlen('row_'));
- elseif( strpos($key,'featured_') ===0)
- $key=substr($key,strlen('featured_'));
- elseif( strpos($key,'k_status_') ===0)
- $key=substr($key,strlen('k_status_'));
+ if(is_object($res))
+ $list = array( $res );
+ else
+ $list = $res;
- $object->$key = $value;
- }
+ self::$Info->listchilds = $list;
- return $object;
- }
+ }
- /**
- @brief Function link to for contruct link featured vs datatype
- @note normlised methode used in childs datatype
- */
- public static function ListLinkTo($opt){
- if(!isset($opt['id']))
- return false;
- else
- $id = (int)$opt['id'];
+ else{
+ self::$Info = sqlfeatured::Specimen(true);
+ }
+ break;
- if(isset($opt['datatype']))
- $datatype = $opt['datatype'] ;
- else
- $datatype = DATATYPES_DEFAULT_NOSELECTED;
- $list = sqlfeatureddata::fetch(
- array(
- 'datatype'=> $datatype,
- 'datatype_id'=> $id,
- ),
- true
- );
+ case 'listing':
+ default:
+ /**
+ @remarks retrun object load one inventaire
+ */
+ global $query_numrows, $languages_id;
+ $adjust=new objectInfo(self::$InitInfo['adjust']);
- if(is_object($list))
- $liste[]=$list;
- else
- $liste=$list;
- return $liste;
- }
+ $query_raw = "select ".$adjust->listfields.", row_id as id from " . TABLE_FEATURED . " c ".
+ " LEFT JOIN ".TABLE_FEATURED_DESCRIPTION. " fd ON(fd.featured_id = c.row_id AND fd.languages_id = '".$adjust->languages_id."' ) ".
+ " LEFT JOIN ".TABLE_STATUS." s ON(status_id = k_status_type AND s.language_id = '".$adjust->languages_id."' AND status_type='".self::$datatype."') " .
+ ((!empty($adjust->sWhere)) ? " WHERE ".substr($adjust->sWhere, 3) : '').
+ " ORDER BY ".((!empty($adjust->sOrder)) ? $adjust->sOrder : ' row_id ASC ');
- /**
- @brief Function link to for contruct link featued vs datatype
- @note normlised methode used in childs datatype
- */
- public static function AddLinkTo($opt){
- self::getInstance();
+ $_split = new splitPageResults($adjust->page, $adjust->rowbyp, $query_raw, $query_numrows);
+ $_query = $DB->query($query_raw);
- if(!isset($opt['id']))
- return false;
- else
- $id = (int)$opt['id'];
+ $res=self::FormatDBValue($_query);
-
- if(isset($opt['datatype']))
- $datatype = $opt['datatype'] ;
- else
- $datatype = DATATYPES_DEFAULT_NOSELECTED;
-
-
- $data_array_link = $opt['featured_array'];
-
- sqlfeatureddata::delete(array('datatype'=> $datatype , 'datatype_id'=>$id ));
-
- foreach($data_array_link as $value)
- if(sqlfeatureddata::fetch(
- array(
- 'featured_id'=> $value,
- 'datatype'=> $datatype,
- 'datatype_id'=> $id,
- )
- ) == false )
- $res = sqlfeatureddata::create(
- array(
- 'featured_id'=> $value,
- 'datatype'=> $datatype,
- 'datatype_id'=> $id,
- )
- );
- return $res;
- }
-
-}
-
-
-
-class sqlfeatureddata
- implements ModSqlDataDriver{
-
- public static $modules;
-
- protected static $_instance;
-
- protected function __construct(){
+ return $res;
+ }
}
- public static function getInstance() {
- if(self::$_instance == null) self::$_instance = new self();
- return self::$_instance;
- }
-
/**
- @brief create new ligne in table configuration
+ @fn display_view()
+ @brief this methode is switch for call gabarit action
*/
- public static function create($option){
- self::getInstance();
+ public function display_view(){
+ switch (parent::$action) {
+ /**
+ @remarks Ajax View result
+ */
+ case 'setflag':
+ return self::RowStatus(array('status'=>(int)$_GET['flag'], 'id'=>(int)$_GET['cID']));
+ break;
- if(!isset($option['datatype']))
- return 'datatype';
-// $sql_data_array['row_id'] = tep_db_prepare_input($option['id']);
- $sql_data_array['featured_id'] = tep_db_prepare_input($option['featured_id']);
- $sql_data_array['datatype'] = tep_db_prepare_input($option['datatype']);
- $sql_data_array['datatype_id'] = tep_db_prepare_input($option['datatype_id']);
+ /**
+ @remarks Normal View Page
+ */
+ case 'new':
+ self::load_db_values(0);
+ return MGabCont::CallGab('edit',__FUNCTION__,__CLASS__);
+ break;
+ case 'edit':
+ self::load_db_values(self::$Id);
+ return MGabCont::CallGab(parent::$action,__FUNCTION__,__CLASS__);
+ break;
+ case 'delete':
+ self::load_db_values(self::$Id);
+ return MGabCont::CallGab(parent::$action,__FUNCTION__,__CLASS__);
+ break;
+ case 'listing':
+ default:
+ self::$list=self::tep_get_list();
+ /// use master gabarit
+ MGabCont::SetCurrentName(__CLASS__);
+ return MGabCont::CallGab('listing',__FUNCTION__,self::MASTER);
+ }
+ }
- $sql_data_array['date_start'] = (isset($option['date_start'])) ? tep_db_prepare_input($option['date_start']) :'1000-01-01 00:00:00';
- $sql_data_array['date_end'] = (isset($option['date_end'])) ? tep_db_prepare_input($option['date_end']) :'1000-01-01 00:00:00';
- $sql_data_array['date_added'] = 'NOW()';
- $sql_data_array['user_added'] = $_SESSION['login_id'];
- $res=tep_db_perform(TABLE_FEATURED_DATA, $sql_data_array);
-
- if(!$res)
- return $res;
- else
- return $res->__get('insertId');
- }
-
/**
- @brief update ligne in table configuration
+ @fn tep_get_list($page=1,$rowbyp=10,$sOrder='',$sWhere='',$options='')
+ @brief Constructeur listing element cms _DATATYPE_REPLACE_
+ @param $page integer default(1) split page
+ @param $rowbyp integer default(10) nbr line in page
+ @param $sOrder string | null
+ @param $sWhere string | null
+ @param $options array
+ @return Array
*/
- public static function update($option){
- self::getInstance();
+ public static function tep_get_list($page=1,$rowbyp=10,$sOrder='',$sWhere='',$options=''){
+ global $query_numrows;
- if(!isset($option['id']))
- return 'id';
+ /// @remarks force load conf
+ self::GetConf();
- $where ='';
- if(isset($option['id'])) $where .="AND featured_id = '".(int)$option['id']."' ";
- if(isset($option['datatype'])) $where .="AND datatype = '".(string)$option['datatype']."' ";
- if(isset($option['datatype_id'])) $where .="AND datatype_id = '".(int)$option['datatype_id']."' ";
- if(isset($option['featured_id'])) $where .="AND featured_id = '".(int)$option['featured_id']."' ";
+ $res=array();
+ /**
+ @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;
+ $res = self::GetDBValue();
- $sql_data_array['date_start'] = (isset($option['date_start'])) ? tep_db_prepare_input($option['date_start']) :'1000-01-01 00:00:00';
- $sql_data_array['date_end'] = (isset($option['date_end'])) ? tep_db_prepare_input($option['date_end']) :'1000-01-01 00:00:00';
+ self::$list= $query_numrows ; //= count($res);
- $sql_data_array['last_modified'] = 'NOW()';
- $sql_data_array['user_modified'] = $_SESSION['login_id'];
-
- $res=tep_db_perform(TABLE_FEATURED_DATA, $sql_data_array, 'update' , substr($where,3) );
-
return $res;
}
- /**
- @brief load ligne in table configuration
- @param option array
- id => row id int (configuration_id)
- key => string key (configuration_key)
- group_id => group_id int (configuration_group_id)
- @param $shortkey use cleankey for return short key
- @return
- object(stdClass)[13]
- public 'id' => string '1' (length=1)
+ /** public static InterfacedTJsonS */
- OR
- array(
- object(stdClass)[13]
- ...
- object(stdClass)[13]
- ..
- )
-
+ /**
+ @brief format db value for display page
+ @param $_query ressource db sql
+ @return array
*/
- public static function fetch($option,$shortkey=false){
- self::getInstance();
+ private static function FormatDBValue($_query){
$DB=Database::getInstance();
+ $res=array();
- $where ="";
- if(isset($option['id'])) $where .="AND featured_id = '".(int)$option['id']."' ";
- if(isset($option['datatype'])) $where .="AND datatype = '".(string)$option['datatype']."' ";
- if(isset($option['datatype_id'])) $where .="AND datatype_id = '".(int)$option['datatype_id']."' ";
- if(isset($option['featured_id'])) $where .="AND featured_id = '".(int)$option['featured_id']."' ";
+ switch (parent::$action) {
+ case 'edit';
+ global $query_numrows,$languages_id;
- if($where=='')
- return false;
+ break;
+ case 'listing':
+ global $query_numrows,$languages_id;
+ while ($item = $_query->fetchAssoc()) {
+ $ord = array();
- $sql="SELECT * FROM " . TABLE_FEATURED_DATA . " a ".
- " WHERE ".substr($where,3);
+ $item[0]=$item['id'];
+ $item[1]=tep_draw_checkbox_field('action_multi['.$item['id'].']','action_mutli_'.$item['id'],$item['id']);
- $res=$DB->query($sql);
+ 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 == 'date_added') $ord[$k]=tep_datetime_short($item[$k]);
+ elseif($k == 'date_update') $ord[$k]=tep_datetime_short($item[$k]);
+ else $ord[$k]=$item[$k];
- $num = $res->__get('numRows');
- if($num == 1){
- $result=$res->fetchAssoc();
- return ((!$shortkey)? $result : self::CleanKey($result));
- }
- elseif($num > 1){
- $array=array();
- foreach($res->fetchAllAssoc() as $result)
- $array[]= ((!$shortkey)? $result : self::CleanKey($result));
- return $array;
+ $res[]=$ord;
+ }
+ break;
}
- return false;
+ return $res;
}
/**
- @brief delete row
+ @fn ButtonRowsActions($item)
+ @return string html
*/
- public static function delete($option){
- self::getInstance();
- $DB=Database::getInstance();
+ public static function ButtonRowsActions($item){
+ return sprintf(
+ CsrtAction::getFormat('row_action'),
+''
+ ,
+ sprintf(CsrtAction::getLink('row_action_right', IMAGE_DELETE, 'edit'), '', tep_href_link(self::FILENAME, 'cID=' . $item['id'] . '&action=edit') ,'' ).
+ sprintf(CsrtAction::getLink('row_action_right', IMAGE_DELETE, 'delete'), 'fancy', tep_href_link(self::FILENAME, 'cID=' . $item['id'] . '&action=delete') ,'' )
+ );
+ }
- $where ="";
- if(isset($option['id'])) $where .="AND featured_id = '".(int)$option['id']."' ";
- if(isset($option['datatype'])) $where .="AND datatype = '".(string)$option['datatype']."' ";
- if(isset($option['datatype_id'])) $where .="AND datatype_id = '".(int)$option['datatype_id']."' ";
- if(isset($option['featured_id'])) $where .="AND featured_id = '".(int)$option['featured_id']."' ";
+ /**
+ @brief return format html for row status
+ @param $product array restuts row product
+ @return string html
+ */
+ private static function RowStatus($item){
+ $exclude=array('action','flag','file','setflag','forceajax');
+ $query_s='action=setflag&cID=' . $item['id'].'&flag=';
-
- if($where=='')
- return false;
-
- $DB->query("DELETE FROM " . TABLE_FEATURED_DATA ." WHERE ". substr($where, 3 ) );
-
-
- return true;
+ return '<a class="ajaxinline" href="' . tep_href_link(self::FILENAME, $query_s.(($item['status'] == '1')? '0' : '1') ) . '">'.
+ sprintf(
+ CsrtAction::getFormat('row_flag'),
+ (int)$item['status'],
+ ( ($item['status'] == '1')? IMAGE_ICON_STATUS_GREEN : IMAGE_ICON_STATUS_RED)
+ ).
+ '</a>';
}
/**
- @brief
- @return array product empty
+ @brief return Filename
*/
- public static function Specimen($shortkey=false){
- $par = array(
- 'row_id' => '',
- 'featured_id' => '',
- 'datatype' => '',
- 'datatype_id' => '',
- 'date_start' => '',
- 'date_end' => '',
- );
-
- return ((!$shortkey)? $par : self::CleanKey($par));
+ public static function GetFILENAME(){
+ return self::FILENAME;
}
+ /**
+ @remarks implements InterfaceModule depend
+ if module twin in backoffice, report all content install in the other module
+ public function check() {return true;}
+ public function install() {return true;}
+ public function remove() {return true;}
+ public function keys() {return array(); }
+ */
- /**
- @fn CleanKey()
- @brief Clean string name key
- */
- private static function CleanKey($array){
- self::getInstance();
- $object= new stdclass();
+ /**
+ @fn check()
+ @brief test if count all var , and keys is equal
+ @return boolean true/false
+ */
+ function check() { return false; }
- foreach($array as $key=>$value){
- $object->$key = $value;
- }
+ /**
+ @fn keys()
+ @return array all key configuration define by this module
+ */
+ function keys() { return false; }
- return $object;
- }
+ /**
+ @fn install()
+ @brief add all configuration
+ @note
+ - Modules can emarquer sql installation instructions, however, in the case of transverse information, or dependent of an extension, preferring the implementation of an extension, file with sql independent
+ - please, pefix all var configuration by 'MODULE_OT__MODTYPENAME_MAJ_'
+ - if module twin in backoffice, report all content install in the other module
+ - Not use language in DB , but function :__()
+ for MODULE_TOTO_ST
+ var title MODULE_TOTO_ST_S (small description)
+ var description MODULE_TOTO_ST_L (long description)
+ */
+ function install() { return false; }
+ /**
+ @fn remove()
+ @brief delete all configuration
+ @note
+ - please, pefix all var configuration by 'MODULE_PAYMENT__MODTYPENAME_MAJ_'
+ - if module twin in backoffice, report all content remove in the other module
+ */
+ function remove() { return false; }
}
+
?>
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2013-07-21 07:03:34
|
Revision: 4789
http://sourceforge.net/p/oscss/svn/4789
Author: oscim
Date: 2013-07-21 07:03:29 +0000 (Sun, 21 Jul 2013)
Log Message:
-----------
Fix report ref for product
Modified Paths:
--------------
trunk/catalog/admin/includes/classes/tracked_stock.php
trunk/catalog/admin/includes/languages/fr_FR/widget/homeStock.txt
trunk/catalog/admin/includes/widget/homeStock.php
Modified: trunk/catalog/admin/includes/classes/tracked_stock.php
===================================================================
--- trunk/catalog/admin/includes/classes/tracked_stock.php 2013-07-12 14:21:23 UTC (rev 4788)
+++ trunk/catalog/admin/includes/classes/tracked_stock.php 2013-07-21 07:03:29 UTC (rev 4789)
@@ -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.0
- @date 21/03/11, 14:22
+ @version 2.1.2
+ @date 20/07/2013, 14:22
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
@class tracked_stock
@@ -35,7 +35,7 @@
function db_low_stock(){
global $languages_id;
- $products_query_raw = "select p.products_id, pd.products_name, p.products_model, p.products_quantity as stock, s.products_stock_quantity as option_stock, s.products_stock_attributes, p.products_price, l.name from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_LANGUAGES . " l, " . TABLE_PRODUCTS . " p LEFT JOIN " . TABLE_PRODUCTS_STOCK . " s on p.products_id = s.products_id
+ $products_query_raw = "select p.products_id,if(s.products_stock_ref, s.products_stock_ref, p.products_ref ) as ref , pd.products_name, p.products_model, p.products_quantity as stock, s.products_stock_quantity as option_stock, s.products_stock_attributes, p.products_price, l.name from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_LANGUAGES . " l, " . TABLE_PRODUCTS . " p LEFT JOIN " . TABLE_PRODUCTS_STOCK . " s on p.products_id = s.products_id
WHERE
p.products_id = pd.products_id and l.languages_id = pd.language_id
and pd.language_id = '" . (int)$languages_id . "' AND pd.products_name <>''
Modified: trunk/catalog/admin/includes/languages/fr_FR/widget/homeStock.txt
===================================================================
--- trunk/catalog/admin/includes/languages/fr_FR/widget/homeStock.txt 2013-07-12 14:21:23 UTC (rev 4788)
+++ trunk/catalog/admin/includes/languages/fr_FR/widget/homeStock.txt 2013-07-21 07:03:29 UTC (rev 4789)
@@ -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 0203/2012, 20:02
+ @version 2.1.2
+ @date 20/07/2013, 20:02
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
*/
$lang['heading stock %s']="Suivi de stock d'alerte (x %s)" ;
+$lang['homeStock box id']="Id" ;
$lang['homeStock box reference']="Réf." ;
$lang['homeStock box name']="Produits" ;
$lang['homeStock box stock']="Stock" ;
Modified: trunk/catalog/admin/includes/widget/homeStock.php
===================================================================
--- trunk/catalog/admin/includes/widget/homeStock.php 2013-07-12 14:21:23 UTC (rev 4788)
+++ trunk/catalog/admin/includes/widget/homeStock.php 2013-07-21 07:03:29 UTC (rev 4789)
@@ -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 0203/2012, 20:02
+ @version 2.1.2
+ @date 20/07/2013, 20:02
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
*/
@@ -35,13 +35,15 @@
<table class="dataTableBase">
<tr>
+ <th><?php echo __('homeStock box id'); ?></th>
<th><?php echo __('homeStock box reference'); ?></th>
<th><?php echo __('homeStock box name'); ?></th>
<th><?php echo __('homeStock box stock'); ?></th>
</tr>
- <?php $i = 0; foreach($l as $p) : $i++; if( $i> $conf->widget_max_line) break; ?>
+ <?php $i = 0; foreach($l as $p) : $i++; if( $i> $conf->widget_max_line) break; /*print_r($p);*/ ?>
<tr>
<td class="tcenter"><strong><a href="<?php echo tep_href_link(FILENAME_PRODUCTS, 'pID='.$p['products_id'].'&action=edit') ?>"><?php echo $p['products_id'] ?></a></strong></td>
+ <td class="tcenter"><strong><a href="<?php echo tep_href_link(FILENAME_PRODUCTS, 'pID='.$p['products_id'].'&action=edit') ?>"><?php echo $p['ref'] ?></a></strong></td>
<?php if(isset($p['option']) && is_array($p['option'])) : ?>
<td style="width:200px;"><?php echo htmlspecialchars($p['products_name']).' <i>'.htmlspecialchars(implode(' ,',$p['option'])).'</i>' ?></td>
<td class="tcenter">
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2013-07-12 14:21:26
|
Revision: 4788
http://sourceforge.net/p/oscss/svn/4788
Author: oscim
Date: 2013-07-12 14:21:23 +0000 (Fri, 12 Jul 2013)
Log Message:
-----------
Impements multi action base dev for products pages
Fix css in less for button in tfoot datatabel table
Modified Paths:
--------------
trunk/catalog/admin/includes/classes/ModTwo.php
trunk/catalog/admin/includes/header.php
trunk/catalog/admin/includes/languages/fr_FR/modules/pages/products.txt
trunk/catalog/admin/includes/modules/pages/products.php
trunk/catalog/admin/includes/template/defaut/css/less/datatable.less
trunk/catalog/admin/includes/template/oscss/data/icon_set.xml
Added Paths:
-----------
trunk/catalog/admin/includes/gabarit/products/display_view.multi.gab
Modified: trunk/catalog/admin/includes/classes/ModTwo.php
===================================================================
--- trunk/catalog/admin/includes/classes/ModTwo.php 2013-07-11 14:05:38 UTC (rev 4787)
+++ trunk/catalog/admin/includes/classes/ModTwo.php 2013-07-12 14:21:23 UTC (rev 4788)
@@ -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 12/02/2013, 09:17
+ @version 2.1.2
+ @date 12/07/2013, 09:17
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
*/
@@ -619,6 +619,12 @@
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);
}
self::$InitInfo['allfields']['listing'] = self::$allfields ;
@@ -716,6 +722,39 @@
+ /**
+ @brief normalize extract action by name button in html img submit
+ in post or get, var name_x and name_y for position image in html page
+ @note button multi named :
+ @param $array ($_POST OR $_GET )
+ @return string action name
+ */
+ public static function CleanMultiActionButton($array){
+
+ $action_mutli = '';
+ // extract action based on POST data and button on type image
+ foreach($array as $key=>$row) {
+ if(!empty($row) && preg_match('#MultiButton_(.*)#i', $key)) {
+ if( ($val=strpos($key, '_x')) && $val > 0) {
+ $k = substr($key, 12, ( $val - 12 ) );
+ if(empty($action_mutli))
+ $action_mutli = $k;
+ elseif($action_mutli == $k)
+ $action_mutli = $k;
+ }
+ elseif( ($val=strpos($key, '_y')) && $val > 0) {
+ $k = substr($key, 12, ( $val - 12 ) );
+
+ if(empty($action_mutli))
+ $action_mutli = $k;
+ elseif($action_mutli == $k)
+ $action_mutli = $k;
+ }
+ }
+ }
+ return $action_mutli;
+
+ }
}
Added: trunk/catalog/admin/includes/gabarit/products/display_view.multi.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/products/display_view.multi.gab (rev 0)
+++ trunk/catalog/admin/includes/gabarit/products/display_view.multi.gab 2013-07-12 14:21:23 UTC (rev 4788)
@@ -0,0 +1,73 @@
+<?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 12/07/2012, 09:48
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+*/
+global $languages_id;
+?>
+ <h3><?php print(__('@products text info heading multi') ); ?></h3>
+
+ <?php echo tep_draw_form('orders', products::FILENAME, tep_get_all_get_params(array('oID', 'action','forceajax','forceview')) .'action=multi_confirm'); ?>
+
+ <h4>
+ <?php switch(products::$Info->action){
+ case 'active':
+ print __('@products multi action active products');
+ break;
+ case 'inactive':
+ print __('@products multi action inactive products');
+ break;
+ case 'delete':
+ print __('@products multi action delete products');
+ break;
+ }
+ ?>
+ </h4>
+
+ <p><?php echo tep_draw_hidden_field('action_multi_action', 'action_multi_action', products::$Info->action); ?> </p>
+
+ <br />
+ <ul class="clear">
+ <?php foreach($_POST['action_multi'] as $row): ?>
+ <li><?php echo tep_draw_checkbox_field('action_multi['.$row.']','action_mutli_'.$row,$row,true, '','class="multi"') .' '. tep_get_products_name($row, $languages_id) ?></li>
+ <?php endforeach; ?>
+ </ul>
+
+ <?php switch(products::$Info->action){
+// case 'edit':
+// $col=call_user_func(array('products', 'tep_get_modele'), array('edit') );
+// foreach($col as $row){
+// print tep_draw_input_field('products_model','', );
+// }
+// break;
+
+ case 'move':
+ print __('@products multi move to categories').'<br />';
+ print tep_draw_pull_down_menu('categories_id', tep_get_category_tree(0,'','0'), 0).'<br />';
+ break;
+ }
+ ?>
+
+
+ <div class="button_nav">
+ <?php switch(products::$Info->action){
+ case 'active':
+ printf(CsrtAction::getSubmit('button_action', __('@products multi action active'), 'status_green'), '', ' name="active" ' );
+ break;
+ case 'inactive':
+ printf(CsrtAction::getSubmit('button_action', __('@products multi action inactive'), 'status_red'), '', ' name="inactive" ' );
+ break;
+ case 'delete':
+ printf(CsrtAction::getSubmit('button_action', IMAGE_DELETE, 'delete'), '', ' name="delete" ' );
+ break;
+ }
+ ?>
+ <?php print tep_js_back(tep_href_link(products::FILENAME), IMAGE_CANCEL) ; ?>
+ </div>
+
+ </form>
\ No newline at end of file
Modified: trunk/catalog/admin/includes/header.php
===================================================================
--- trunk/catalog/admin/includes/header.php 2013-07-11 14:05:38 UTC (rev 4787)
+++ trunk/catalog/admin/includes/header.php 2013-07-12 14:21:23 UTC (rev 4788)
@@ -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/03/2012, 18:17
+ @version 2.1.2
+ @date 12/07/2013, 18:17
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
@brief block in balise html head.
@@ -41,8 +41,7 @@
tep_include_file (DIR_WS_JS."dataTables.TableTools/ZeroClipboard/ZeroClipboard.js",true);
tep_include_file (DIR_WS_JS."dataTables.TableTools/js/TableTools.min.js",true);
}
-// print_r(call_user_func(array(tep_extrac_querystring(JSONSTATMENT,'type'), 'tep_get_modele'), array('listing') ) );
-// exit;
+
?>
Modified: trunk/catalog/admin/includes/languages/fr_FR/modules/pages/products.txt
===================================================================
--- trunk/catalog/admin/includes/languages/fr_FR/modules/pages/products.txt 2013-07-11 14:05:38 UTC (rev 4787)
+++ trunk/catalog/admin/includes/languages/fr_FR/modules/pages/products.txt 2013-07-12 14:21:23 UTC (rev 4788)
@@ -250,8 +250,18 @@
/* mutliple choose */
+ $lang['@products text info heading multi']="Action multiples sur les produits" ;
+ $lang['@products multi action active products']="Activation des produits" ;
+ $lang['@products multi action inactive products']="Desactivation des produits" ;
+ $lang['@products multi action delete products']="Suppression des produits !! Attentions aucune autre confirmations ne vous sera demandé" ;
+ /* button */
+ $lang['@products multi action active']="Activation" ;
+ $lang['@products multi action inactive']="Desactivation" ;
+ $lang['@products multi action delete']="Suppression" ;
+
+
/* Linkto */
$lang['link products to featured'] = "Mise en avant" ;
$lang['link products to categorie'] = "Catégorie" ;
Modified: trunk/catalog/admin/includes/modules/pages/products.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/products.php 2013-07-11 14:05:38 UTC (rev 4787)
+++ trunk/catalog/admin/includes/modules/pages/products.php 2013-07-12 14:21:23 UTC (rev 4788)
@@ -202,11 +202,13 @@
'text'=>__('products table heading name'),
'default'=>true,
'width'=>'18%',
+ 'edit'=>true,
),
'p.products_model' => array(
'sort'=>true,
'alias'=>'model',
'text'=>__('products table heading modele'),
+
),
);
@@ -431,7 +433,7 @@
'sort'=>true,
'alias'=>'available',
'text'=>__('products table heading available'),
- 'class'=>'tcenter',
+ 'class'=>'tcenter',
);
@@ -451,7 +453,10 @@
/// @remarks Active forms filter
$mutli=array();
- $mutli[] = sprintf(CsrtAction::getButton('button_action', IMAGE_DELETE, 'delete'), '', ' name="multi_action" ' ) ;
+ $mutli[] = sprintf(CsrtAction::getButton('button_action', __('@products active'), 'status_green'), '', ' name="MultiButton_active" ' ) ;
+ $mutli[] = sprintf(CsrtAction::getButton('button_action', __('@products inactive'), 'status_red'), '', ' name="MultiButton_inactive" ' ) ;
+// $mutli[] = sprintf(CsrtAction::getButton('button_action', IMAGE_EDIT, 'edit'), '', ' name="MultiButton_edit" ' ) ;
+ $mutli[] = sprintf(CsrtAction::getButton('button_action', IMAGE_DELETE, 'delete'), '', ' name="MultiButton_delete" ' ) ;
/**
@@ -762,8 +767,27 @@
/**
@remarks specific multi action
*/
- case 'multi':
- tep_redirect(tep_href_link(self::FILENAME) );
+ case 'multi_confirm':
+ $all_pid = $_POST['action_multi'];
+
+ if(isset($_POST['action_multi_action']))
+ switch(tep_db_prepare_input($_POST['action_multi_action'])){
+ case 'active':
+ foreach($all_pid as $pid){
+ sqlproduct::update(array('id'=>$pid, 'sqlarray'=>array('products_status'=>1)));
+ }
+ break;
+ case 'inactive':
+ foreach($all_pid as $pid){
+ sqlproduct::update(array('id'=>$pid, 'sqlarray'=>array('products_status'=>0)));
+ }
+ break;
+ case 'delete':
+ break;
+ }
+ osCSS_Cache::clear('product');
+
+ tep_redirect(tep_href_link(self::FILENAME));
break;
@@ -1003,6 +1027,12 @@
$action=self::$action;
switch ($action) {
+
+ case 'multi':
+ self::$Info = new stdClass;
+ self::$Info->action = parent::CleanMultiActionButton($_POST);
+ break;
+
case 'detail':
case 'new':
case 'delete':
@@ -1163,6 +1193,13 @@
/**
@remarks Normal View Page
*/
+
+ case 'multi':
+ self::GetDBValue();
+ return MGabCont::CallGab(parent::$action,__FUNCTION__,__CLASS__);
+ break;
+
+
case 'noedit':
$action = 'edit';
case 'copy_to':
Modified: trunk/catalog/admin/includes/template/defaut/css/less/datatable.less
===================================================================
--- trunk/catalog/admin/includes/template/defaut/css/less/datatable.less 2013-07-11 14:05:38 UTC (rev 4787)
+++ trunk/catalog/admin/includes/template/defaut/css/less/datatable.less 2013-07-12 14:21:23 UTC (rev 4788)
@@ -71,17 +71,17 @@
.sorting_asc {
- background: @color_datatable_tr_th url("../../../../../includes/javascript/jquery.dataTables/sort_asc.png") no-repeat center right;
+ background: @color_datatable_tr_th url("../../../includes/javascript/jquery.dataTables/sort_asc.png") no-repeat center right;
padding-right: 20px;
}
.sorting_desc {
- background: @color_datatable_tr_th url("../../../../../includes/javascript/jquery.dataTables/sort_desc.png") no-repeat center right;
+ background: @color_datatable_tr_th url("../../../includes/javascript/jquery.dataTables/sort_desc.png") no-repeat center right;
padding-right: 20px;
}
.sorting {
- background: @color_datatable_tr_th url("../../../../../includes/javascript/jquery.dataTables/sort_both.png") no-repeat center right;
+ background: @color_datatable_tr_th url("../../../includes/javascript/jquery.dataTables/sort_both.png") no-repeat center right;
padding-right: 20px;
}
}
@@ -127,13 +127,13 @@
.edit-input-value .Flag-0.txt,
.edit-input-value .Val-0.txt { display:none}
- .edit-input-value .Flag-0.img{background:transparent url("../../../../../images/icons/icon_status_red.gif") left top no-repeat}
+ .edit-input-value .Flag-0.img{background:transparent url("../../../images/icons/icon_status_red.gif") left top no-repeat}
.edit-input-value .Val-0.img { width: 10px; background:transparent url("../../../../../images/icons/icon_view_red.gif") left top no-repeat}
.edit-input-value .Flag-1.txt,
.edit-input-value .Val-1.txt { display:none}
- .edit-input-value .Flag-1.img{background:transparent url("../../../../../images/icons/icon_status_green.gif") left top no-repeat}
- .edit-input-value .Val-1.img {width: 10px; background:transparent url("../../../../../images/icons/icon_view_green.gif") left top no-repeat}
+ .edit-input-value .Flag-1.img{background:transparent url("../../../images/icons/icon_status_green.gif") left top no-repeat}
+ .edit-input-value .Val-1.img {width: 10px; background:transparent url("../../../images/icons/icon_view_green.gif") left top no-repeat}
}
.row_action {
min-width:100px;
@@ -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;}
+ }
}
Modified: trunk/catalog/admin/includes/template/oscss/data/icon_set.xml
===================================================================
--- trunk/catalog/admin/includes/template/oscss/data/icon_set.xml 2013-07-11 14:05:38 UTC (rev 4787)
+++ trunk/catalog/admin/includes/template/oscss/data/icon_set.xml 2013-07-12 14:21:23 UTC (rev 4788)
@@ -37,6 +37,9 @@
<config>settings.png</config>
<heldorder>arrow_switch.png</heldorder>
<childs>icon_plus.gif</childs>
+
+ <status_green>icon_status_green.gif</status_green>
+ <status_red>icon_status_red.gif</status_red>
<!-- <recup_order>
</recup_order> -->
<remove>remove.gif</remove>
@@ -102,38 +105,39 @@
</button>
<submit>
<icon width="18" height="18" src="true">
- <![CDATA[<input type="submit" class="button %s" src="%_SRC_%" title="%_TEXT_%" value="%_TEXT_%" %s>]]>
+ <![CDATA[<input type="submit" class="button %s" src="%_SRC_%" title="%_TEXT_%" value="%_TEXT_%" %s />]]>
</icon>
<text>
- <![CDATA[<input type="submit" class="button %s" title="%_TEXT_%" value=" %s" %s>]]>
+ <![CDATA[<input type="submit" class="button %s" title="%_TEXT_%" value=" %s" %s />]]>
</text>
</submit>
</button_nav>
-<button_action>
- <link>
- <icon width="18" height="18">
- <![CDATA[<a class="buttonimg %s" href="%s" %s>%_TEXT_%</a>]]>
- </icon>
- <text>
- <![CDATA[<a class="button %s" href="%s" %s>%_TEXT_%</a>]]>
- </text>
-</link>
-<button>
-<icon width="18" height="18" src="true">
- <![CDATA[<input type="image" class="button %s" src="%_SRC_%" title="%_TEXT_%" value="%_TEXT_%" %s>]]>
-</icon>
-<text>
- <![CDATA[<input type="submit" class="button %s" title="%_TEXT_%" value=" %s" %s>]]>
-</text>
- </button>
- <submit>
- <icon width="18" height="18" src="true">
- <![CDATA[<input type="submit" class="button %s" src="%_SRC_%" title="%_TEXT_%" value="%_TEXT_%" %s>]]>
- </icon>
- <text>
- <![CDATA[<input type="submit" class="button %s" title="%_TEXT_%" value=" %s" %s>]]>
- </text>
-</submit>
+ <button_action>
+ <link>
+ <icon width="18" height="18">
+ <![CDATA[<a class="buttonimg %s" href="%s" %s>%_TEXT_%</a>]]>
+ </icon>
+ <text>
+ <![CDATA[<a class="button %s" href="%s" %s>%_TEXT_%</a>]]>
+ </text>
+ </link>
+ <button>
+ <icon width="18" height="18" src="true">
+ <![CDATA[<input type="image" class="button %s" src="%_SRC_%" title="%_TEXT_%" value="%_TEXT_%" %s />]]>
+<!-- <![CDATA[<button type="button"><img class="button %s" src="%_SRC_%" title="%_TEXT_%" /><input type="hidden" value="%_TEXT_%" %s /></button>]]> -->
+ </icon>
+ <text>
+ <![CDATA[<input type="submit" class="button %s" title="%_TEXT_%" value=" %s" %s />]]>
+ </text>
+ </button>
+ <submit>
+ <icon width="18" height="18" src="true">
+ <![CDATA[<input type="submit" class="button %s" src="%_SRC_%" title="%_TEXT_%" value="%_TEXT_%" %s />]]>
+ </icon>
+ <text>
+ <![CDATA[<input type="submit" class="button %s" title="%_TEXT_%" value=" %s" %s />]]>
+ </text>
+ </submit>
</button_action>
</gabarit>
@@ -168,7 +172,7 @@
</row_flag>
<type_color>
<![CDATA[
- <span class="color_type" style=" border-left: 15px solid%1$s;">
+ <span class="color_type" style="%1$s;">
<span class="Val txt">%2$s</span>
</span>
]]>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2013-07-11 14:05:41
|
Revision: 4787
http://sourceforge.net/p/oscss/svn/4787
Author: oscim
Date: 2013-07-11 14:05:38 +0000 (Thu, 11 Jul 2013)
Log Message:
-----------
Fix description in order total lines
Modified Paths:
--------------
trunk/extensions/ECOTAX_stable/catalog/includes/modules/order_total/ot_ecotax.php
Modified: trunk/extensions/ECOTAX_stable/catalog/includes/modules/order_total/ot_ecotax.php
===================================================================
--- trunk/extensions/ECOTAX_stable/catalog/includes/modules/order_total/ot_ecotax.php 2013-07-11 14:04:47 UTC (rev 4786)
+++ trunk/extensions/ECOTAX_stable/catalog/includes/modules/order_total/ot_ecotax.php 2013-07-11 14:05:38 UTC (rev 4787)
@@ -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 15/07/10, 20:01
+ @version 2.1.2
+ @date 10/07/2013, 20:01
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
*/
@@ -14,13 +14,14 @@
public $title;
public $output;
+ public static $products_cache = array();
function __construct() {
$this->code = __CLASS__;
$this->title = __('module order total ecotax title');
$this->description = __('module order total ecotax description');
$this->enabled = true ;
- $this->sort_order = (defined('MODULE_ORDER_TOTAL_ECOTAX_SORT_ORDER')) ? MODULE_ORDER_TOTAL_ECOTAX_SORT_ORDER : 0 ;
+ $this->sort_order = (defined('MODULE_ORDER_TOTAL_ECOTAX_SORT_ORDER')) ? MODULE_ORDER_TOTAL_ECOTAX_SORT_ORDER : 5 ;
$this->output = array();
}
@@ -31,12 +32,12 @@
$value = 0;
$value_ht = 0;
foreach($order->products as $prdct){
- $value += (isset(ecotax::$products_cache[$prdct['id']]['tax'])? ecotax::$products_cache[$prdct['id']]['tax'] : 0);
- $value_ht+= (isset(ecotax::$products_cache[$prdct['id']]['tax_ht'])? ecotax::$products_cache[$prdct['id']]['tax_ht'] : 0);
- if(isset(ecotax::$products_cache[$prdct['id']]['tax_description']))$txt = ecotax::$products_cache[$prdct['id']]['tax_description'];
+ $value += (isset(self::$products_cache[$prdct['id']]['tax'])? self::$products_cache[$prdct['id']]['tax'] : 0);
+ $value_ht+= (isset(self::$products_cache[$prdct['id']]['tax_ht'])? self::$products_cache[$prdct['id']]['tax_ht'] : 0);
+ if(isset(self::$products_cache[$prdct['id']]['tax_description']))$txt = self::$products_cache[$prdct['id']]['tax_description'];
}
- $this->output[] = array('title' => $txt.' :',
+ $this->output[] = array('title' => __('module ecotax total title line').' :',
'text_ht' => $currencies->format($value_ht, true, $order->info['currency'], $order->info['currency_value']) ,
'text' => $currencies->format($value, true, $order->info['currency'], $order->info['currency_value']),
'value_ht' => $value_ht,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2013-07-11 14:04:50
|
Revision: 4786
http://sourceforge.net/p/oscss/svn/4786
Author: oscim
Date: 2013-07-11 14:04:47 +0000 (Thu, 11 Jul 2013)
Log Message:
-----------
Add file
Modified Paths:
--------------
trunk/extensions/PAYBOX_stable/catalog/includes/modules/payment/paybox.php
Modified: trunk/extensions/PAYBOX_stable/catalog/includes/modules/payment/paybox.php
===================================================================
--- trunk/extensions/PAYBOX_stable/catalog/includes/modules/payment/paybox.php 2013-07-11 14:04:28 UTC (rev 4785)
+++ trunk/extensions/PAYBOX_stable/catalog/includes/modules/payment/paybox.php 2013-07-11 14:04:47 UTC (rev 4786)
@@ -12,7 +12,8 @@
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
*/
-class paybox implements InterfaceModule,InterfaceAcaPayment{
+class paybox
+ implements InterfaceModule,InterfaceAcaPayment{
public $code,
$title,
$description,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2013-07-11 14:04:31
|
Revision: 4785
http://sourceforge.net/p/oscss/svn/4785
Author: oscim
Date: 2013-07-11 14:04:28 +0000 (Thu, 11 Jul 2013)
Log Message:
-----------
Fix
Fix bug destock in orders process
Modified Paths:
--------------
trunk/catalog/admin/includes/modules/account/account_extra.php
trunk/catalog/admin/includes/modules/account/address_book.php
trunk/catalog/admin/includes/modules/account/history.php
trunk/catalog/admin/includes/modules/products/products_extra.php
trunk/catalog/includes/classes/checkout_process.php
Modified: trunk/catalog/admin/includes/modules/account/account_extra.php
===================================================================
--- trunk/catalog/admin/includes/modules/account/account_extra.php 2013-07-11 12:30:17 UTC (rev 4784)
+++ trunk/catalog/admin/includes/modules/account/account_extra.php 2013-07-11 14:04:28 UTC (rev 4785)
@@ -36,6 +36,111 @@
}
/**
+ @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();
+
+ global $languages_id;
+
+ /// create cache for speed load page
+ $osCSS_Cache = new osCSS_Cache();
+ if ($osCSS_Cache->read('product-'.MGabCont::CallSt('GetClassDatatype').'-'.__CLASS__.'-' . $languages_id.'-type', 720))
+ $epf = $osCSS_Cache->getCache();
+ else {
+ $languages = tep_get_languages();
+// $epf_query = tep_db_query($sql="select e.fields_id, e.epf_uses_value_list, e.epf_show_parent_chain, e.fields_size ,e.epf_key, l.fields_name, l.languages_id, l.epf_label_help from " . TABLE_EXTRA_FIELDS . " e join " . TABLE_EXTRA_FIELDS_LABELS . " l where e.epf_status and e.epf_special_mod='' and l.languages_id='".(int)$languages_id."' and (e.epf_id = l.epf_id) order by e.epf_order");
+ $epf_query = tep_db_query($sql="select e.fields_id, e.fields_size ,e.fields_key, l.fields_name, l.languages_id from " . TABLE_EXTRA_FIELDS . " e join " . TABLE_EXTRA_FIELDS_LABELS . " l where e.fields_status and e.fields_special_mod='' and l.languages_id='".(int)$languages_id."' and (e.fields_id = l.fields_id) order by e.fields_sort");
+ $epf = $epf_query->fetchAllAssoc();
+ $res= $osCSS_Cache->writeBuffer($epf);
+ }
+
+
+
+ switch ($opt['type']) {
+ case 'allfields':
+
+ foreach($epf as $e){
+ $array['epf2pp'.$e['fields_id'].'.value'] = array(
+ 'sort'=>true,
+ 'alias'=>'extra_'.(!empty($e['fields_key'])? $e['fields_key'] : $e['fields_id'] ),
+ 'text'=>$e['fields_name'],
+// 'width'=>'8%',
+ 'class'=>'tleft',
+// 'default'=>true,
+ );
+
+// $array['epf2pp'.$e['fields_id'].'.value'] = array(
+// 'sort'=>true,
+// 'alias'=>(!empty($e['fields_key'])? $e['fields_key'] : 'extra_'.$e['fields_id'] ),
+// 'text'=>'key '.$e['fields_name'],
+// // 'width'=>'8%',
+// 'class'=>'tleft',
+// // 'default'=>true,
+// );
+ }
+
+ break;
+
+ case 'tables':
+
+ global $languages_id;
+
+
+ foreach($epf as $e){
+ $array['epf2pp'.$e['fields_id']] = " LEFT JOIN " . TABLE_CUSTOMERS_TO_EXTRA_FIELDS . " epf2pp".$e['fields_id']." ON( epf2pp".$e['fields_id'].".customers_id=c.customers_id AND epf2pp".$e['fields_id'].".fields_id = '".$e['fields_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){
+ // extra
+ default:
+ $value = $item[$key];//print_r($item, true); //$key; //tep_get_product_extra_value((string)$key , (int)$item['id'] , $languages_id);
+ }
+
+ return $value;
+ }
+
+ /**
+ @brief Call by fetch sqlcustomers
+ @param $option array
+ @param $item array
+ array
+ 0 =>
+ array
+ 'customers_id' => string '2' (length=1)
+ 'shortkey' => boolean false
+ */
+ public function fetch($option){
+
+ $customers_id=$option[0]['customers_id'];
+ $shortkey=$option[0]['shortkey'];
+
+
+ return $this->load_db_values((int)$customers_id);
+ }
+
+ /**
@brief action methode
*/
public function check_action($actions){
@@ -125,8 +230,26 @@
return array();
}
- public function load_db_values($cID) {
-// self::$cInfo->objectInfo($customers);
+ public function load_db_values($customer_id) {
+ global $languages_id;
+ // ne liste que les champs qui n'appartiennent pas a un modules precis
+ $extra_fields_query = tep_db_query($sql = "select ce.fields_id, ce.fields_input_type, ce.fields_key, cef.value, ce.fields_required_status, cei.fields_name as text,cei.fields_format as format, ce.fields_status, ce.fields_input_type from " . TABLE_EXTRA_FIELDS . " ce LEFT JOIN " . TABLE_CUSTOMERS_TO_EXTRA_FIELDS . " cef on (cef.customers_id='" . $customer_id . "' and cef.fields_id=ce.fields_id ), " . TABLE_EXTRA_FIELDS_LABELS . " cei where ce.fields_status=1 and cei.fields_id=ce.fields_id and cei.languages_id =" . $languages_id." order by ce.fields_sort");
+ $extra_fields_string = '';
+
+ if(tep_db_num_rows($extra_fields_query)>0){
+ $customers = array();
+ while($extra_fields = tep_db_fetch_array($extra_fields_query)){
+
+ $value='';
+ $input ='';
+
+ $customers[(!empty($extra_fields['fields_key']) ? $extra_fields['fields_key'] : $extra_fields['fields_id'])] =new objectInfo($extra_fields);
+ }
+ }
+
+ self::$cInfo= $customers;
+
+ return self::$cInfo;
}
public function load_post_values ($post) {
Modified: trunk/catalog/admin/includes/modules/account/address_book.php
===================================================================
--- trunk/catalog/admin/includes/modules/account/address_book.php 2013-07-11 12:30:17 UTC (rev 4784)
+++ trunk/catalog/admin/includes/modules/account/address_book.php 2013-07-11 14:04:28 UTC (rev 4785)
@@ -160,8 +160,25 @@
return $value;
}
+ /**
+ @brief Call by fetch sqlcustomers
+ @param $option array
+ @param $item array
+ array
+ 0 =>
+ array
+ 'customers_id' => string '2' (length=1)
+ 'shortkey' => boolean false
+ */
+ public function fetch($option){
+ $customers_id=$option[0]['customers_id'];
+ $shortkey=$option[0]['shortkey'];
+
+ return $this->load_db_values((int)$customers_id);
+ }
+
/**
@brief methode for event action
@return array $actions
@@ -290,14 +307,8 @@
$cID = (int)self::$cInfo->customers_id;
/// update db data
- $r = self:: SQLCreate();
+ self:: SQLCreate();
- if($r>0)
- $messageStack->add(__('@address_book create success'), 'success');
- else
- $messageStack->add(__('@address_book not create error'), 'error');
-
-
tep_redirect(tep_href_link(customers::FILENAME, 'cID=' .$cID.'&action=edit'));
}
@@ -357,13 +368,8 @@
/// update db data
- $r = self:: SQLUpdate();
+ self:: SQLUpdate();
- if($r>0)
- $messageStack->add(__('@address_book save success'), 'success');
- else
- $messageStack->add(__('@address_book not save error'), 'error');
-
tep_redirect(tep_href_link(customers::FILENAME, 'cID=' .$cID.'&action=edit'));
}
break;
@@ -517,6 +523,8 @@
}
self::$cInfo= new objectInfo($customers);
+
+ return self::$cInfo;
}
/**
Modified: trunk/catalog/admin/includes/modules/account/history.php
===================================================================
--- trunk/catalog/admin/includes/modules/account/history.php 2013-07-11 12:30:17 UTC (rev 4784)
+++ trunk/catalog/admin/includes/modules/account/history.php 2013-07-11 14:04:28 UTC (rev 4785)
@@ -46,7 +46,7 @@
switch ($opt['type']) {
case 'allfields':
$array['COUNT(orders_id)'] = array(
- 'sort'=>true,
+ 'sort'=>false,
'alias'=>'orders_count',
'text'=>__('@history table heading orders count'),
'width'=>'8%',
@@ -64,7 +64,24 @@
return $array;
}
+ /**
+ @brief Call by fetch sqlcustomers
+ @param $option array
+ @param $item array
+ array
+ 0 =>
+ array
+ 'customers_id' => string '2' (length=1)
+ 'shortkey' => boolean false
+ */
+ public function fetch($option){
+ $customers_id=$option[0]['customers_id'];
+ $shortkey=$option[0]['shortkey'];
+
+ return $this->load_db_values((int)$customers_id);
+ }
+
/**
@brief format db value for this allfields
@param $key string name key
Modified: trunk/catalog/admin/includes/modules/products/products_extra.php
===================================================================
--- trunk/catalog/admin/includes/modules/products/products_extra.php 2013-07-11 12:30:17 UTC (rev 4784)
+++ trunk/catalog/admin/includes/modules/products/products_extra.php 2013-07-11 14:04:28 UTC (rev 4785)
@@ -75,7 +75,7 @@
foreach($epf as $e){
$array['epf2pp'.$e['epf_id'].'.products_extra_fields_id'] = array(
'sort'=>false,
- 'alias'=>$e['epf_key'],
+ 'alias'=>'extra_'.(!empty($e['epf_key'])? $e['epf_key'] : $e['epf_id'] ),
'text'=>$e['epf_label'],
// 'width'=>'8%',
'class'=>'tleft',
Modified: trunk/catalog/includes/classes/checkout_process.php
===================================================================
--- trunk/catalog/includes/classes/checkout_process.php 2013-07-11 12:30:17 UTC (rev 4784)
+++ trunk/catalog/includes/classes/checkout_process.php 2013-07-11 14:04:28 UTC (rev 4785)
@@ -367,14 +367,13 @@
$total_tax = 0;
for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {
-
+// var_dump(self::$mode);
/**
Process class
Gestion du stock
*/
if(self::$mode){
- $products_stock_attributes= $this->order_destock_product($i,$order) ;
-
+ $products_stock_attributes= $this->order_destock_product($i,$order->products[$i]) ;
}
else
$products_stock_attributes= '';
@@ -431,8 +430,8 @@
// $products_ordered .= $order->products[$i]['qty'] . ' x ' . $order->products[$i]['name'] . ' (' . $order->products[$i]['model'] . ') = ' . $currencies->display_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']) . $products_ordered_attributes . "\n";
}
-
-
+// if(self::$mode)
+// exit;
/*
Force reload order for obtain rowid line
*/
@@ -550,13 +549,13 @@
//! product / products_attributes / products_download
- $orders_products_query = tep_db_query("select orders_products_id, products_id,products_type,products_name, products_model, products_price, products_tax, products_quantity, final_price from " . TABLE_HOLDING_ORDERS_PRODUCTS . " where orders_id = '" . (int)$pre_order_id . "'");
+ $orders_products_query = tep_db_query("select orders_products_id, products_id as id ,products_type,products_name, products_model, products_price, products_tax, products_quantity as qty, final_price from " . TABLE_HOLDING_ORDERS_PRODUCTS . " where orders_id = '" . (int)$pre_order_id . "'");
while ($orders_products = tep_db_fetch_array($orders_products_query)) {
$sql_data_array2 = array('orders_id' => (int)$order_id,
- 'products_id' => (int)$orders_products['products_id'],
+ 'products_id' => (int)$orders_products['id'],
'products_type' => (int)$orders_products['products_type'],
- 'products_quantity' => tep_db_input($orders_products['products_quantity']),
+ 'products_quantity' => tep_db_input($orders_products['qty']),
'products_name' => tep_db_input($orders_products['products_name']),
'products_model' => tep_db_input($orders_products['products_model']),
'products_tax' => tep_db_input($orders_products['products_tax']),
@@ -580,8 +579,13 @@
'options_values_price' => tep_db_input($attributes['options_values_price']) );
tep_db_perform(TABLE_ORDERS_PRODUCTS_ATTRIBUTES, $sql_data_array1);
+
+ $orders_products['attributes'] = $attributes;
}
}
+
+
+ $this->order_destock_product($i,$orders_products) ;
}
@@ -913,14 +917,14 @@
* @param $order object
* @return $products_stock_attributes
*/
- private function order_destock_product($i,$order){
+ private function order_destock_product($i,$row_product){
$products_stock_attributes=null;
-//
if (_cst_bool('STOCK_CHECK') ) {
- $products_attributes =(isset($order->products[$i]['attributes'])) ? $order->products[$i]['attributes'] : array();
+ $products_attributes =(isset($row_product['attributes'])) ? $row_product['attributes'] : array();
+
if (_cst_bool('DOWNLOAD_ENABLED') ) {
$stock_query_raw = "SELECT products_quantity, pad.products_attributes_filename
FROM " . TABLE_PRODUCTS . " p
@@ -928,7 +932,7 @@
ON p.products_id=pa.products_id
LEFT JOIN " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad
ON pa.products_attributes_id=pad.products_attributes_id
- WHERE p.products_id = '" .tep_db_input( tep_get_prid($order->products[$i]['id']) ). "'";
+ WHERE p.products_id = '" .tep_db_input( tep_get_prid($row_product['id']) ). "'";
// Will work with only one option for downloadable products
// otherwise, we have to build the query dynamically with a loop
if (is_array($products_attributes) && isset($products_attributes[0]))
@@ -936,78 +940,79 @@
$stock_query = tep_db_query($stock_query_raw);
}
else {
- $stock_query = tep_db_query("select products_quantity, track_stock from " . TABLE_PRODUCTS . " where products_id = '" .tep_db_input( tep_get_prid($order->products[$i]['id']) ). "'");
+ $stock_query = tep_db_query("select products_quantity, track_stock from " . TABLE_PRODUCTS . " where products_id = '" .tep_db_input( tep_get_prid($row_product['id']) ). "'");
}
if (tep_db_num_rows($stock_query) > 0) {
- $stock_values = tep_db_fetch_array($stock_query);
- $actual_stock_bought = $order->products[$i]['qty'];
- $download_selected = false;
+ $stock_values = tep_db_fetch_array($stock_query);
- if ((!_cst_bool('DOWNLOAD_ENABLED')) && isset($stock_values['products_attributes_filename']) && tep_not_null($stock_values['products_attributes_filename'])) {
- $download_selected = true;
- $products_stock_attributes='$$DOWNLOAD$$';
- }
+ $actual_stock_bought = $row_product['qty'];
+ $download_selected = false;
- //! Gestion stock et attribut
- //! If not downloadable and attributes present, adjust attribute stock
- if (!$download_selected && is_array($products_attributes) && count($products_attributes)>0) {
- $all_nonstocked = true;
- $products_stock_attributes_array = array();
- foreach ($products_attributes as $attribute) {
- $products_stock_attributes_array[] = $attribute['option_id'] . "-" . $attribute['value_id'];
- if ($attribute['track_stock'] == 1) $all_nonstocked = false;
- }
- if ($all_nonstocked) {
- $actual_stock_bought = $order->products[$i]['qty'];
+ if ((!_cst_bool('DOWNLOAD_ENABLED')) && isset($stock_values['products_attributes_filename']) && tep_not_null($stock_values['products_attributes_filename'])) {
+ $download_selected = true;
+ $products_stock_attributes='$$DOWNLOAD$$';
+ }
- asort($products_stock_attributes_array, SORT_NUMERIC);
- $products_stock_attributes = implode(",", $products_stock_attributes_array);
+ //! Gestion stock et attribut
+ //! If not downloadable and attributes present, adjust attribute stock
+ if (!$download_selected && is_array($products_attributes) && count($products_attributes)>0) {
+ $all_nonstocked = true;
+ $products_stock_attributes_array = array();
+ foreach ($products_attributes as $attribute) {
+ $products_stock_attributes_array[] = $attribute['option_id'] . "-" . $attribute['value_id'];
+ if ($attribute['track_stock'] == 1) $all_nonstocked = false;
+ }
+ if ($all_nonstocked) {
+ $actual_stock_bought = $row_product['qty'];
- } else {
- asort($products_stock_attributes_array, SORT_NUMERIC);
- $products_stock_attributes = implode(",", $products_stock_attributes_array);
- $attributes_stock_query = tep_db_query("select products_stock_quantity from " . TABLE_PRODUCTS_STOCK . " where products_stock_attributes = '".tep_db_input($products_stock_attributes)."' AND products_id = '" .tep_db_input( tep_get_prid($order->products[$i]['id']) ). "'");
+ asort($products_stock_attributes_array, SORT_NUMERIC);
+ $products_stock_attributes = implode(",", $products_stock_attributes_array);
- if (tep_db_num_rows($attributes_stock_query) > 0) {
- $attributes_stock_values = tep_db_fetch_array($attributes_stock_query);
- $attributes_stock_left = $attributes_stock_values['products_stock_quantity'] - $order->products[$i]['qty'];
+ } else {
+ asort($products_stock_attributes_array, SORT_NUMERIC);
+ $products_stock_attributes = implode(",", $products_stock_attributes_array);
+ $attributes_stock_query = tep_db_query("select products_stock_quantity from " . TABLE_PRODUCTS_STOCK . " where products_stock_attributes = '".tep_db_input($products_stock_attributes)."' AND products_id = '" .tep_db_input( tep_get_prid($row_product['id']) ). "'");
- tep_db_query("update " . TABLE_PRODUCTS_STOCK . " set products_stock_quantity = '" .tep_db_input( $attributes_stock_left) . "' where products_stock_attributes = '$products_stock_attributes' AND products_id = '" . tep_db_input(tep_get_prid($order->products[$i]['id'])) . "'");
+ if (tep_db_num_rows($attributes_stock_query) > 0) {
+ $attributes_stock_values = tep_db_fetch_array($attributes_stock_query);
+ $attributes_stock_left = $attributes_stock_values['products_stock_quantity'] - $row_product['qty'];
- $actual_stock_bought = ($attributes_stock_left < 1) ? $attributes_stock_values['products_stock_quantity'] : $order->products[$i]['qty'];
- } else {
- $attributes_stock_left = 0 - $order->products[$i]['qty'];
+ tep_db_query("update " . TABLE_PRODUCTS_STOCK . " set products_stock_quantity = '" .tep_db_input( $attributes_stock_left) . "' where products_stock_attributes = '$products_stock_attributes' AND products_id = '" . tep_db_input(tep_get_prid($row_product['id'])) . "'");
- tep_db_query("insert into " . TABLE_PRODUCTS_STOCK . " (products_id, products_stock_attributes, products_stock_quantity) values ('" . tep_db_input(tep_get_prid($order->products[$i]['id'])) . "', '" .tep_db_input($products_stock_attributes) . "', '" . tep_db_input($attributes_stock_left ). "')");
+ $actual_stock_bought = ($attributes_stock_left < 1) ? $attributes_stock_values['products_stock_quantity'] : $row_product['qty'];
+ } else {
+ $attributes_stock_left = 0 - $row_product['qty'];
- $actual_stock_bought = 0;
- }
- }
- }
+ tep_db_query("insert into " . TABLE_PRODUCTS_STOCK . " (products_id, products_stock_attributes, products_stock_quantity) values ('" . tep_db_input(tep_get_prid($row_product['id'])) . "', '" .tep_db_input($products_stock_attributes) . "', '" . tep_db_input($attributes_stock_left ). "')");
- //! stock produit sans attribut et non downloadable
- elseif (!$download_selected && $stock_values['track_stock']>0) {
+ $actual_stock_bought = 0;
+ }
+ }
+ }
+ //! stock produit sans attribut et non downloadable
+ elseif (!$download_selected && $stock_values['track_stock']>0) {
- $stock_left = $stock_values['products_quantity'] - $actual_stock_bought;
- tep_db_query($sql="update " . TABLE_PRODUCTS . " set products_quantity = '" .tep_db_input( $stock_left ). "' where products_id = '" . tep_db_input( tep_get_prid($order->products[$i]['id']) ). "'");
+ $stock_left = $stock_values['products_quantity'] - $actual_stock_bought;
- //! descative les produit qu ne sont plus en stock, si l'achat hors stock nest pas autorise
- /// TODO Notification admin
- if ( ($stock_left <= 0) && (!_cst_bool('STOCK_ALLOW_CHECKOUT')) && @$stock_values['track_stock'] ==3 )
- tep_db_query("update " . TABLE_PRODUCTS . " set products_status = '0' where products_id = '" .tep_db_input( tep_get_prid($order->products[$i]['id']) ). "'");
+ tep_db_query($sql="update " . TABLE_PRODUCTS . " set products_quantity = '" .tep_db_input( $stock_left ). "' where products_id = '" . tep_db_input( tep_get_prid($row_product['id']) ). "'");
- }
+ //! descative les produit qu ne sont plus en stock, si l'achat hors stock nest pas autorise
+ /// TODO Notification admin
+ // if ( ($stock_left <= 0) && (!_cst_bool('STOCK_ALLOW_CHECKOUT')) && @$stock_values['track_stock'] ==3 )
+ // tep_db_query("update " . TABLE_PRODUCTS . " set products_status = '0' where products_id = '" .tep_db_input( tep_get_prid($row_product['id']) ). "'");
- }
- }
+ }
+ }
+ }
+
return $products_stock_attributes;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2013-07-11 12:30:20
|
Revision: 4784
http://sourceforge.net/p/oscss/svn/4784
Author: oscim
Date: 2013-07-11 12:30:17 +0000 (Thu, 11 Jul 2013)
Log Message:
-----------
Fix
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-07-11 12:29:25 UTC (rev 4783)
+++ trunk/catalog/admin/includes/appli_top_Test.php 2013-07-11 12:30:17 UTC (rev 4784)
@@ -51,9 +51,7 @@
/// include list of project class and lib permanente
include($rpa.DIR_WS_INCLUDES . 'inc_base_lib_min.php');
- include($rpa.DIR_WS_CLASSES.'tableBlock.php');
- include(DIR_FS_CATALOG.DIR_WS_COMMON_CLASSES . 'osCSS_Cache.php');
- include(DIR_FS_ADMIN.DIR_WS_CLASSES . 'navigationHistory.php');
+
include(DIR_FS_ADMIN.DIR_WS_CLASSES . 'objectInfo.php');
include(DIR_FS_ADMIN.DIR_WS_CLASSES . 'emailUtility.php');
@@ -171,9 +169,10 @@
$oscss->pile_file_lang($rpa.DIR_WS_LANGUAGES . $language . '/'.$page_admin.'.txt');
}
- /// Init Dynamic DataType
- DataTypes::getInstance();
+/// Init Dynamic DataType
+ DataTypes::getInstance();
+
/// lib specifique a la page
if (oscss_cstr::TestFile(DIR_WS_FUNCTIONS . 'lib.' . $current_page)) require(DIR_WS_FUNCTIONS . 'lib.' . $current_page );
Modified: trunk/catalog/admin/includes/header.php
===================================================================
--- trunk/catalog/admin/includes/header.php 2013-07-11 12:29:25 UTC (rev 4783)
+++ trunk/catalog/admin/includes/header.php 2013-07-11 12:30:17 UTC (rev 4784)
@@ -20,13 +20,13 @@
tep_include_file (DIR_WS_JS."jquery.fancybox/jquery.fancybox.css",true);
if( ($css=tep_test_gab_ele("jquery-ui",'css')) !=false ) tep_include_file ($css,true);
- // lasted
+ // lasted
tep_include_file (DIR_WS_JS."jquery.min.js",true);
- // specifique lib for core osCSS
+ // specifique lib for core osCSS
tep_include_file (DIR_WS_JS."oscss.js",true);
- // ui plugin jquery
+ // ui plugin jquery
tep_include_file ("includes/javascript/jquery-ui.min.js",true);
tep_include_file ("includes/javascript/jquery.cookie.js",true);
if ( ($lng=language::LangueSelected()) && $lng != 'en') tep_include_file ("includes/javascript/jquery-ui-i18n.min.js",true);
@@ -46,7 +46,7 @@
?>
-<?php
+<?php
/**
Section for use , and all manipluate listing by plugi jquery dataTable
*/
@@ -141,13 +141,13 @@
<?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') ); ?>
<?php $i=0; foreach($col as $k=>$row):
- echo ' { ';
+ echo ' { ';
echo ' "bSortable": '.((isset($col2[$k]['sort']) && $col2[$k]['sort'] !=false) ? 'true' : 'false' ).' '."\n";
-// if(isset($col2[$k]['class']))
-// echo ', "sClass": "'.$col2[$k]['class'].'" ';
+ if(isset($col2[$k]['class']))
+ echo ', "sClass": "'.$col2[$k]['class'].'" ';
echo ' },'."\n";
- $i++; endforeach;
+ $i++; endforeach;
?>
<?php endif; ?>
<?php ?>
@@ -240,7 +240,7 @@
// }
});
- //init and reload after process in datatable
+ //init and reload after process in datatable
post_load_page();
<?php endif; ?>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2013-07-11 12:29:28
|
Revision: 4783
http://sourceforge.net/p/oscss/svn/4783
Author: oscim
Date: 2013-07-11 12:29:25 +0000 (Thu, 11 Jul 2013)
Log Message:
-----------
Fix call pdf in frontoffice
Fix
Add col in order for link to external synchro
upgrade lib.order for factorise function notifiy
Fix aca link to module in front office Root dir
Adjust oscss.version
Modified Paths:
--------------
trunk/catalog/Documents/oscss.version.xml
trunk/catalog/account.php
trunk/catalog/admin/includes/classes/ModTwo.php
trunk/catalog/admin/includes/classes/aca.php
trunk/catalog/admin/includes/classes/drivers/sqlorder.php
trunk/catalog/admin/includes/functions/lib.orders.php
trunk/catalog/admin/includes/gabarit/orders/display_view.edit.gab
trunk/catalog/admin/includes/languages/fr_FR/modules/pages/orders.txt
trunk/catalog/admin/includes/modules/pages/orders.php
trunk/catalog/admin/includes/modules/pages/usersNotif.php
trunk/catalog/common/classes/order.php
trunk/catalog/document.php
Modified: trunk/catalog/Documents/oscss.version.xml
===================================================================
--- trunk/catalog/Documents/oscss.version.xml 2013-07-10 15:36:54 UTC (rev 4782)
+++ trunk/catalog/Documents/oscss.version.xml 2013-07-11 12:29:25 UTC (rev 4783)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<core>
- <version>2.1.1 (beta)</version>
- <svn>4405</svn>
+ <version>2.1.2</version>
+ <svn>4478</svn>
<level>unstable</level>
<template_admin>oscss</template_admin>
Modified: trunk/catalog/account.php
===================================================================
--- trunk/catalog/account.php 2013-07-10 15:36:54 UTC (rev 4782)
+++ trunk/catalog/account.php 2013-07-11 12:29:25 UTC (rev 4783)
@@ -152,7 +152,7 @@
/* Modele dans include/module/template_pdf */
if (!isset($_GET['order_id']) || (isset($_GET['order_id']) && !is_numeric($_GET['order_id']))) tep_redirect(tep_href_link(FILENAME_ACCOUNT, 'action=history', 'SSL'));
// Begin RMA Returns System - added order status ID to query
- $customer_info_query = tep_db_query("select customers_id, orders_status from " . TABLE_ORDERS . " where orders_id = '". (int)$_GET['order_id'] . "'");
+ $customer_info_query = tep_db_query("select customers_id, orders_status, facture_id from " . TABLE_ORDERS . " where orders_id = '". (int)$_GET['order_id'] . "'");
$customer_info = tep_db_fetch_array($customer_info_query);
// $orders_status = $customer_info['orders_status'];
@@ -204,22 +204,12 @@
/// Load file pdf
else {
- $type=($customer_info['orders_status']==DEFAULT_ORDERS_STATUS_COMPLETED)?'invoice' : 'packingslip';
+ $type=($customer_info['facture_id'] > 0)?'invoices' : 'packingslip';
- if(( $filepath=$DF->GetDoc('packingslip', $_GET['order_id'])) && file_exists($filepath)){
-
- tep_redirect('document.php?mod=packingslip&id='.$_GET['order_id'] );
+ if(( $filepath=$DF->GetDoc($type, $_GET['order_id'])) && file_exists($filepath)){
+ tep_redirect('document.php?mod='.$type.'&id='.$_GET['order_id'] );
}
-
- if(( $filepath=$DF->GetDoc('invoices', $_GET['order_id'])) && file_exists($filepath)){
- tep_redirect('document.php?mod=invoice&id='.$_GET['order_id'] );
- }
-
-
}
-
-
-
break;
/**
* \section execution module aca complementaire
Modified: trunk/catalog/admin/includes/classes/ModTwo.php
===================================================================
--- trunk/catalog/admin/includes/classes/ModTwo.php 2013-07-10 15:36:54 UTC (rev 4782)
+++ trunk/catalog/admin/includes/classes/ModTwo.php 2013-07-11 12:29:25 UTC (rev 4783)
@@ -635,7 +635,7 @@
/**
@note use $boutons[action][] = array(params)
- params :
+ params :
'type'=>'getLink',
'format'=>'button_nav',
'image'=>'',
Modified: trunk/catalog/admin/includes/classes/aca.php
===================================================================
--- trunk/catalog/admin/includes/classes/aca.php 2013-07-10 15:36:54 UTC (rev 4782)
+++ trunk/catalog/admin/includes/classes/aca.php 2013-07-11 12:29:25 UTC (rev 4783)
@@ -208,6 +208,10 @@
include(DIR_WS_MODULES . $folder_final.'/' . $file);
$list_mod[]=$class;
}
+ elseif(!class_exists($class) && oscss_cstr::TestFile(DIR_FS_CATALOG.DIR_WS_MODULES . $folder_final.'/' . $file)){
+ include(DIR_FS_CATALOG.DIR_WS_MODULES . $folder_final.'/' . $file);
+ $list_mod[]=$class;
+ }
elseif(!class_exists($class) ) {
$messageStack->add(sprintf(__('ACA class type "%s" no found for ::%s '),__CLASS__,$class), 'error');
continue;
Modified: trunk/catalog/admin/includes/classes/drivers/sqlorder.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlorder.php 2013-07-10 15:36:54 UTC (rev 4782)
+++ trunk/catalog/admin/includes/classes/drivers/sqlorder.php 2013-07-11 12:29:25 UTC (rev 4783)
@@ -129,22 +129,34 @@
else
$status = (int)$option['status'];
+ if( ($order = self::fetch(array('id'=>$option['id']))) && $order == false )
+ return false;
+
if( isset($option['post']) )
$post = $option['post'];
if( isset($option['orders_ref']) )
$sql_data_array['orders_ref'] = trim($option['orders_ref']);
- if( isset($option['facture_ref']) )
+
+ if( isset($option['facture_ref']) ) {
$sql_data_array['facture_ref'] = trim($option['facture_ref']);
+ if( isset($option['facture_id']) && $option['facture_id'] > 0)
+ $sql_data_array['facture_id'] = $option['facture_id'];
+ else
+ $sql_data_array['facture_id'] = self::GetNumberInvoice();
+ }
+ // specific for soap event
+ $sql_data_array['synchro_event'] = ( isset($option['synchro_event'])? (int)$option['synchro_event'] : '0');
if(isset($option['comments']))
self::$comment[] = $option['comments'];
$notif = (( isset($option['notify']) && $option['notify'] )? true : false );
-
+// var_dump($notif);
+// exit;
/// update billing address
if(isset($option['billing'])) {
@@ -260,12 +272,13 @@
switch($new_st){
case DEFAULT_ORDERS_STATUS_PAYED:
- $_query = tep_db_query("select count(*) as _id from " . TABLE_ORDERS . " where facture_id IS NOT NULL ");
- $res_id=tep_db_fetch_array($_query);
- $sql_data_array['facture_id'] = ((int)$res_id['_id'] +1) ;
+ if( !isset($sql_data_array['facture_id']) || empty($sql_data_array['facture_id']) )
+ $sql_data_array['facture_id'] = self::GetNumberInvoice();
+ if( isset($sql_data_array['facture_ref']) && !empty($sql_data_array['facture_ref']) )
+ $sql_data_array['facture_ref'] = trim($sql_data_array['facture_ref']);
// New Ref
- if( _cst_bool('USE_LOCAT_GENERAT_PDF') ) {
+ elseif( _cst_bool('USE_LOCAT_GENERAT_PDF') ) {
$numref= new NumRef('bills');
$ref = $numref->GetNewNumRef();
$sql_data_array['facture_ref'] =$ref ;
@@ -315,12 +328,18 @@
self::AddOrderHistory($id, $status , $notif, implode("\n\r", self::$comment) );
+// if ($notify)
+ OrdersNotify($id,$order->info, $order->customer, $status, $comments);
+
if($error !=false)
return false;
else
return true;
}
+
+
+
/**
@brief load ligne in table configuration
@param option array
@@ -652,7 +671,17 @@
}
+ /**
+ @brief classed Invoice
+ @param $invoice_ref string default is null and ref generated by local generating
+ @return
+ */
+ public static function GetNumberInvoice(){
+ $_query = tep_db_query("select count(*) as _id from " . TABLE_ORDERS . " where facture_id IS NOT NULL ");
+ $res_id=tep_db_fetch_array($_query);
+ return ((int)$res_id['_id'] +1);
+ }
}
Modified: trunk/catalog/admin/includes/functions/lib.orders.php
===================================================================
--- trunk/catalog/admin/includes/functions/lib.orders.php 2013-07-10 15:36:54 UTC (rev 4782)
+++ trunk/catalog/admin/includes/functions/lib.orders.php 2013-07-11 12:29:25 UTC (rev 4783)
@@ -39,62 +39,77 @@
$_oID = tep_db_prepare_input($oID);
$status = tep_db_prepare_input($post['status']);
$comments = tep_db_prepare_input($post['comments']);
- $notify = (isset($_POST['notify']) && ($post['notify'] == 'on')) ? true : false ;
+// $notify = (isset($post['notify']) && ($post['notify'] == 'on')) ? true : false ;
- $DB=Database::getInstance();
- $orders_statuses=array();
- $orders_status_query = $DB->query("select status_id, status_name from " . TABLE_STATUS . " where status_type='orders' and language_id = '" . (int)$languages_id . "'");
- while ($orders_status = $orders_status_query->fetchAssoc()) {
- $orders_statuses[] = array('id' => $orders_status['status_id'], 'text' => $orders_status['status_name']);
- $orders_status_array[$orders_status['status_id']] = $orders_status['status_name'];
- }
- $check_status_query = tep_db_query("select orders_ref, customers_id, customers_name, customers_email_address, orders_status, date_purchased, ip_address from " . TABLE_ORDERS . " where orders_id = '" . (int)$_oID . "'");
+ $check_status_query = tep_db_query("select customers_id as id, customers_name as name, customers_email_address as email_address, orders_status, date_purchased from " . TABLE_ORDERS . " where orders_id = '" . (int)$_oID . "'");
$check_status = tep_db_fetch_array($check_status_query);
if ( ($check_status['orders_status'] != $status) || tep_not_null($comments)) {
- $update = sqlorder::update(array('id'=> (int)$_oID, 'status'=> tep_db_input($status), 'notify'=>$notify , 'comments'=>$comments ));
+ $update = sqlorder::update(array('id'=> (int)$_oID, 'status'=> tep_db_input($status), 'notify'=>$post['notify'] , 'comments'=>$comments ));
if(!$update)
$messageStack->add_session(__('error order not update status'), 'warning');
else
$messageStack->add_session(__('success order update status'), 'success');
- if ($notify) {
+// if ($notify)
+// OrdersNotify($oID,$check_status, $check_status, $status, $comments);
+ return true;
+ }
+ else
+ return false;
+}
- $myarray = array(
- 'mail_sent_to'=>$check_status['customers_email_address'],
- 'from'=>STORE_OWNER,
- 'subject'=>'',
- '_oID'=>$check_status['orders_ref'],
- 'date_purchased'=>tep_date_long($check_status['date_purchased']),
- 'notify_comments'=>$comments,
- '_ostatus'=>$orders_status_array[$status],
- '_oLinks'=>tep_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $_oID, 'SSL'),
- 'email_use_html'=>_cst_bool('EMAIL_USE_HTML'),
- 'message'=>'',
- );
+/**
+ @brief email specific for callback orders
+ @param $oID int
+ @param $array_order_info array
+ @param $array_customer array
+ @param $status int
+ @param $status_name string
+ @param $comments string
+*/
+function OrdersNotify($oID,$array_order_info, $array_customer, $status, $comments){
- $message_final=tep_post_prepare_email('orders.tpl',$language,$myarray);
+ // TODO Prise en charge language client
+ global $language, $messageStack;
- if( tep_mail($check_status['customers_name'], $check_status['customers_email_address'], EMAIL_TEXT_SUBJECT, $message_final) !=false) {
+ $DB=Database::getInstance();
+ $orders_status_array=array();
+ $orders_status_query = $DB->query("select status_id, status_name from " . TABLE_STATUS . " where status_type='orders' and language_id = '" . (int)$languages_id . "'");
+ while ($orders_status = $orders_status_query->fetchAssoc()) {
+ $orders_status_array[$orders_status['status_id']] = $orders_status['status_name'];
+ }
- $HM=HistoryMail::getInstance();
- $HM->AddMail($check_status['customers_id'], EMAIL_TEXT_SUBJECT, $check_status['customers_name'], $check_status['customers_email_address'], STORE_OWNER, EMAIL_FROM , $message_final['html']);
+ $myarray = array(
+ 'mail_sent_to'=>$array_customer['email_address'],
+ 'from'=>STORE_OWNER,
+ 'subject'=>'',
+ '_oID'=>$oID,
+ 'date_purchased'=>tep_date_long($array_order_info['date_purchased']),
+ 'notify_comments'=>$comments,
+ '_ostatus'=>$orders_status_array[$status],
+ '_oLinks'=>tep_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $oID, 'SSL'),
+ 'email_use_html'=>_cst_bool('EMAIL_USE_HTML'),
+ 'message'=>'',
+ );
- $messageStack->add_session(sprintf(__('success email notify customers %'), $check_status['customers_email_address']) , 'success');
- }
- else
- sqlorder::AddOrderHistory($oID, tep_db_input($status) , 0, __('error process notify customers'));
- }
+ $message_final=tep_post_prepare_email('orders.tpl',$language,$myarray);
- return true;
- }
- else
- return false;
+ if( tep_mail($array_customer['name'], $array_customer['email_address'], EMAIL_TEXT_SUBJECT, $message_final) !=false) {
+
+ $HM=HistoryMail::getInstance();
+ $r = $HM->AddMail($array_customer['id'], EMAIL_TEXT_SUBJECT, $array_customer['name'], $array_customer['email_address'], STORE_OWNER, EMAIL_FROM , $message_final['html']);
+
+ if(is_object($messageStack))
+ $messageStack->add_session(sprintf(__('success email notify customers %'), $array_customer['email_address']) , 'success');
+ }
+ else
+ sqlorder::AddOrderHistory($oID, tep_db_input($status) , 0, __('error process notify customers'));
+
}
-
?>
\ No newline at end of file
Modified: trunk/catalog/admin/includes/gabarit/orders/display_view.edit.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/orders/display_view.edit.gab 2013-07-10 15:36:54 UTC (rev 4782)
+++ trunk/catalog/admin/includes/gabarit/orders/display_view.edit.gab 2013-07-11 12:29:25 UTC (rev 4783)
@@ -362,7 +362,11 @@
echo $return_link; ?>
</td>
<?php endif; ?>
- <td class="tcenter"><?php echo orders::$order->products[$i]['id'] ?></td>
+ <td class="tcenter">
+ <strong>
+ <a href="<?php echo tep_href_link(FILENAME_PRODUCTS, 'action=edit&pID='.orders::$order->products[$i]['id']) ?>"><?php echo orders::$order->products[$i]['id'] ?></a>
+ </strong>
+ </td>
<td class="tleft">
<span class="fleft">
<a href="#" class="screenshot" rel="<?php echo tep_href_link('document.php', 'mod=img&typ=product&w=200&h=200&id='.orders::$order->products[$i]['id']) ?>">
@@ -472,6 +476,7 @@
<th><?php echo __('table heading date expedition'); ?></th>
<th><?php echo __('table heading tracking number'); ?></th>
<th><?php echo __('table heading methode'); ?></th>
+ <th><?php echo __('table heading status'); ?></th>
</tr>
</thead>
<tbody>
@@ -479,7 +484,9 @@
<?php if(isset($ashipping->row_id)): ?>
<tr>
<td class="tcenter">
- <a href="<?php echo tep_href_link(FILENAME_SHIPPING,'action=edit&oID='.$ashipping->row_id); ?>"><?php echo (!empty($ashipping->shipping_ref)?$ashipping->shipping_ref:$ashipping->row_id); ?></a>
+ <strong>
+ <a href="<?php echo tep_href_link(FILENAME_SHIPPING,'action=edit&oID='.$ashipping->row_id); ?>"><?php echo (!empty($ashipping->shipping_ref)?$ashipping->shipping_ref:$ashipping->row_id); ?></a>
+ </strong>
</td>
<td class="tcenter">
<?php echo tep_datetime_short($ashipping->date_expedition); ?>
@@ -492,6 +499,9 @@
<td class="tcenter">
<?php echo $ashipping->method; ?>
</td>
+ <td class="tcenter">
+ <?php echo $ashipping->status; ?>
+ </td>
</tr>
<?php endif; ?>
<?php endforeach; ?>
@@ -516,9 +526,13 @@
</tr>
</thead>
<tbody>
- <?php $i = 0; foreach (orders::$order->pshipping as $pshipping): $i++; /*print_r($pshipping);*/?>
+ <?php $i = 0; foreach (orders::$order->pshipping as $pshipping): $i++;/* print_r($pshipping);*/ ?>
<tr>
- <td class="tcenter"><?php echo $pshipping->id ?></td>
+ <td class="tcenter">
+ <strong>
+ <a href="<?php echo tep_href_link(FILENAME_PRODUCTS, 'action=edit&pID='.$pshipping->id) ?>"><?php echo $pshipping->id ?></a>
+ </strong>
+ </td>
<td class="tleft">
<span class="fleft">
<a href="#" class="screenshot" rel="<?php echo tep_href_link('document.php', 'mod=img&typ=product&w=200&h=200&id='.$pshipping->id) ?>">
@@ -535,7 +549,7 @@
</td>
<td class="tcenter">
- <?php if( ($pshipping->qty - $pshipping->qt_expedie) > 0 ): ?>
+ <?php if( ($pshipping->qty - $pshipping->qt_expedie) >= 0 ): ?>
<?php echo tep_draw_input_field('shipping_qt['.tep_get_uprid($pshipping->id, $pshipping->attrib) .']','', ($pshipping->qty - $pshipping->qt_expedie) ) .tep_draw_hidden_field('shipping_qt_max['.tep_get_uprid($pshipping->id, $pshipping->attrib).']','', ($pshipping->qty - $pshipping->qt_expedie) ) ; ?>
<?php else: ?>
<?php echo ($pshipping->qty - $pshipping->qt_expedie); ?>
@@ -549,7 +563,7 @@
</table>
- <?php if( orders::$order->display_shipping_add ) : ?>
+ <?php if( (bool)orders::$order->display_shipping_add ) : ?>
<fieldset class="block_field fleft w_50" >
<legend><?php echo __('entry shipping new expedition details'); ?></legend>
@@ -666,7 +680,7 @@
<strong><?php echo __('entry telephone number'); ?></strong><?php echo orders::$order->customer['telephone']; ?>
<br />
- <strong><?php echo __('entry email address'); ?></strong><?php echo '<a href="mailto:' . orders::$order->customer['email_address'] . '">' . orders::$order->customer['email_address'] . '</a>'; ?>
+ <strong><?php echo __('entry email address'); ?></strong><?php echo '<a href="' .tep_href_link( FILENAME_MAIL , 'cus...@os...'.orders::$order->customer['email_address'].'&origin='. orders::FILENAME .'&origin_id='.orders::$order->info['orders_id']). '">' . orders::$order->customer['email_address']. '</a>'; ?>
<br />
<strong><?php echo __('entry ip'); ?></strong><?php echo orders::$order->info['ip_address']; ?>
Modified: trunk/catalog/admin/includes/languages/fr_FR/modules/pages/orders.txt
===================================================================
--- trunk/catalog/admin/includes/languages/fr_FR/modules/pages/orders.txt 2013-07-10 15:36:54 UTC (rev 4782)
+++ trunk/catalog/admin/includes/languages/fr_FR/modules/pages/orders.txt 2013-07-11 12:29:25 UTC (rev 4783)
@@ -46,8 +46,8 @@
$lang['orders table heading class_shipping']="Class. ship" ;
$lang['orders table heading order ref']="Réf." ;
$lang['orders table heading facture ref']="Fact.Réf." ;
+ $lang['orders table heading synchro_event']="Synchro.Ext." ;
-
/* Edit */
/* heading tabs */
$lang['@orders heading edit num %s ref %s']="Edition Commande n°%s - ref:%s" ;
Modified: trunk/catalog/admin/includes/modules/pages/orders.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/orders.php 2013-07-10 15:36:54 UTC (rev 4782)
+++ trunk/catalog/admin/includes/modules/pages/orders.php 2013-07-11 12:29:25 UTC (rev 4783)
@@ -284,6 +284,14 @@
'class'=>'tcenter',
'default'=>true,
),
+ 'o.synchro_event' => array(
+ 'sort'=>true,
+ 'alias'=>'synchro_event',
+ 'text'=> __('orders table heading synchro_event'),
+ 'width'=>'10%',
+ 'class'=>'tcenter',
+ 'default'=>true,
+ ),
// 'p.products_ordered' => __('orders table heading purchased'),
);
@@ -301,10 +309,10 @@
array[
// For normalised filter define on method ConvertInitVar
generic =>
- array (
- 'string'
+ array (
+ 'string'
// , ....
- );
+ );
mod =>
array(
'title'=>__('@products filter tab manufacturer'),
@@ -325,7 +333,7 @@
@remarks this define menu master module in page
@note use $boutons[action][] = array(params)
- params :
+ params :
'type'=>'getLink',
'format'=>'button_nav',
'image'=>'',
@@ -335,8 +343,8 @@
*/
$boutons = array();
-
+
/**
@remarks filter based on status orders
*/
@@ -408,9 +416,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);
@@ -993,7 +1001,7 @@
$sql="SELECT cp.orders_products_id as products_id , cp.orders_products_attributes as key_attrib ,SUM(cp.qt_expedie) as qt , cc.status ".
" FROM ".TABLE_SHIPPING." cc ".
" LEFT JOIN ".TABLE_SHIPPING_PRODUCTS." cp ON (cc.row_id = cp.shipping_id) ".
- " WHERE cc.orders_id = '".(int)self::$oID ."' AND cp.orders_products_id = '".$rows['id']."' AND cp.orders_products_attributes ='".$key_attrib."' ".
+ " WHERE cc.orders_id = '".(int)self::$oID ."' AND cp.orders_products_id = '".$rows['rowid']."' AND cp.orders_products_attributes ='".$key_attrib."' ".
" GROUP BY orders_products_id ";
" ORDER BY row_id DESC";
@@ -1406,7 +1414,7 @@
if(isset($orders['date_purchased'])) $ord['date_purchased']=tep_datetime_short($orders['date_purchased']);
if(isset($orders['last_modified'])) $ord['last_modified']=tep_datetime_short($orders['last_modified']);
if(isset($orders['payment_method'])) $ord['payment_method']=$orders['payment_method'];
- if(isset($orders['orders_status_name'])) $ord['orders_status_name']=sprintf( CsrtAction::getFormat('type_color'), $orders['orders_status_color'], $orders['orders_status_name'] );
+ if(isset($orders['orders_status_name'])) $ord['orders_status_name']=sprintf( CsrtAction::getFormat('type_color'), " border-left: 15px solid ".$orders['orders_status_color'], $orders['orders_status_name'] );
$ord[0]=$orders['orders_id'];
$ord[1]=tep_draw_checkbox_field('action_multi['.$orders['orders_id'].']','action_mutli_'.$orders['orders_id'],$orders['orders_id'], '','',' class="multi" ');
Modified: trunk/catalog/admin/includes/modules/pages/usersNotif.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/usersNotif.php 2013-07-10 15:36:54 UTC (rev 4782)
+++ trunk/catalog/admin/includes/modules/pages/usersNotif.php 2013-07-11 12:29:25 UTC (rev 4783)
@@ -153,10 +153,10 @@
array[
// For normalised filter define on method ConvertInitVar
generic =>
- array (
- 'string'
+ array (
+ 'string'
// , ....
- );
+ );
mod =>
array(
'title'=>__('@products filter tab manufacturer'),
@@ -170,7 +170,7 @@
@remarks this define menu master module in page
@note use $boutons[action][] = array(params)
- params :
+ params :
'type'=>'getLink',
'format'=>'button_nav',
'image'=>'',
@@ -183,9 +183,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);
@@ -525,13 +525,13 @@
else $ord[$k]=$item[$k];
}
-
+
// $item[1]=$ord[0];
-//
+//
// if(defined('AJAXSTATMENTDETAIL'))
// $ord[0]=$item['id'];
+ $ord[0]=tep_draw_checkbox_field('action_multi['.$item['id'].']','action_mutli_'.$item['id'],$item['id'],false, '','class="multi"');
-
$res[]=$ord;
}
break;
Modified: trunk/catalog/common/classes/order.php
===================================================================
--- trunk/catalog/common/classes/order.php 2013-07-10 15:36:54 UTC (rev 4782)
+++ trunk/catalog/common/classes/order.php 2013-07-11 12:29:25 UTC (rev 4783)
@@ -171,7 +171,8 @@
if(self::$mode)
$sql.=" , facture_id
, facture_ref
- , holding_origin_id";
+ , holding_origin_id
+ , synchro_event ";
$sql.=" FROM " . self::$tables['ORDERS'] . " o ".
" LEFT JOIN " . TABLE_CUSTOMERS . " USING(customers_id) ".
@@ -224,6 +225,7 @@
$this->info['orders_ref']=$order['orders_ref'];
$this->info['facture_id']=$order['facture_id'];
$this->info['holding_origin_id']=$order['holding_origin_id'];
+ $this->info['synchro_event']=$order['synchro_event'];
}
Modified: trunk/catalog/document.php
===================================================================
--- trunk/catalog/document.php 2013-07-10 15:36:54 UTC (rev 4782)
+++ trunk/catalog/document.php 2013-07-11 12:29:25 UTC (rev 4783)
@@ -101,7 +101,27 @@
break;
+ case 'invoices':
case 'invoice':
+ //! force login
+ if (!tep_session_is_registered('customer_first_name') || !tep_session_is_registered('customer_id'))
+ tep_redirect(FILENAME_DEFAULT);
+
+ new DatasFiles();
+
+ if(( $filepath=DatasFiles::GetDoc('invoice', $_REQUEST['id'])) && file_exists($filepath)) {
+ //We send to a browser
+ header('Content-Type: application/pdf');
+ // header('Content-Length: '.strlen($this->buffer));
+ header('Content-Disposition: inline; filename="'.basename($filepath).'"');
+ header('Cache-Control: private, max-age=0, must-revalidate');
+ header('Pragma: public');
+ ini_set('zlib.output_compression','0');
+
+ readfile($filepath);
+ }
+ break;
+
case 'packingslip':
//! force login
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2013-07-10 15:36:59
|
Revision: 4782
http://sourceforge.net/p/oscss/svn/4782
Author: oscim
Date: 2013-07-10 15:36:54 +0000 (Wed, 10 Jul 2013)
Log Message:
-----------
Fix bug call .gab in loop process rightto
Modified Paths:
--------------
trunk/catalog/admin/includes/classes/MLinkTo.php
Modified: trunk/catalog/admin/includes/classes/MLinkTo.php
===================================================================
--- trunk/catalog/admin/includes/classes/MLinkTo.php 2013-07-10 14:24:08 UTC (rev 4781)
+++ trunk/catalog/admin/includes/classes/MLinkTo.php 2013-07-10 15:36:54 UTC (rev 4782)
@@ -97,9 +97,13 @@
//! @remarks Force load language centralised
$oscss->pile_file_lang(DIR_FS_ADMIN.DIR_WS_LANGUAGES.$language.'/modules/pages/'.$mkey.'s.txt');
+ /**
+ Contruct html if file.gab extists
+ */
+ if( ($tpl_html = tep_get_include_contents($mkey.'s/rightto.'.$action)) && strlen($tpl_html) > 10 )
$result[] = array(
'title'=> sprintf(__('@'.$mkey.' link %s to %s') , self::$current , $mkey ),
- 'text'=> tep_get_include_contents($mkey.'s/rightto.'.$action),
+ 'text'=> $tpl_html,
);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2013-07-10 14:24:18
|
Revision: 4781
http://sourceforge.net/p/oscss/svn/4781
Author: oscim
Date: 2013-07-10 14:24:08 +0000 (Wed, 10 Jul 2013)
Log Message:
-----------
Fix display col type in listing
Modified Paths:
--------------
trunk/catalog/admin/includes/languages/fr_FR/modules/pages/products.txt
trunk/catalog/admin/includes/modules/pages/products.php
Modified: trunk/catalog/admin/includes/languages/fr_FR/modules/pages/products.txt
===================================================================
--- trunk/catalog/admin/includes/languages/fr_FR/modules/pages/products.txt 2013-07-08 09:55:14 UTC (rev 4780)
+++ trunk/catalog/admin/includes/languages/fr_FR/modules/pages/products.txt 2013-07-10 14:24:08 UTC (rev 4781)
@@ -87,7 +87,9 @@
$lang['products table heading option value id']="Opt Valeur Id" ;
$lang['products table heading options name']="Option Name" ;
$lang['products table heading values name']="Opt Valeur Nom" ;
-
+ $lang['products table heading type']="Type" ;
+ $lang['products table heading type id']="Type Id" ;
+ $lang['products table heading type name']="Type" ;
$lang['products table heading date_added']="Créer" ;
$lang['products table heading last modified']="Modifiés" ;
$lang['products table heading available']="Dispo." ;
Modified: trunk/catalog/admin/includes/modules/pages/products.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/products.php 2013-07-08 09:55:14 UTC (rev 4780)
+++ trunk/catalog/admin/includes/modules/pages/products.php 2013-07-10 14:24:08 UTC (rev 4781)
@@ -209,6 +209,26 @@
'text'=>__('products table heading modele'),
),
);
+
+ self::$allfields['p.products_type']= array(
+ 'sort'=>true,
+ 'search'=>true,
+ 'alias'=>'type_id',
+ 'text'=>__('products table heading type id'),
+ 'width'=>'5%',
+ 'class'=>'tleft',
+ 'default'=>true,
+ );
+ self::$allfields['s.status_name']= array(
+ 'sort'=>true,
+ 'search'=>true,
+ 'alias'=>'type_name',
+ 'text'=>__('products table heading type name'),
+ 'width'=>'5%',
+ 'class'=>'tleft',
+ 'default'=>true,
+ );
+
if(isset($_SESSION['filters'][__CLASS__]['bystock']) && ($_SESSION['filters'][__CLASS__]['bystock'] > 0) ) {
self::$allfields['if(ps.products_stock_ref, ps.products_stock_ref , p.products_ref)']= array(
'sort'=>true,
@@ -440,10 +460,10 @@
array[
// For normalised filter define on method ConvertInitVar
generic =>
- array (
- 'string'
+ array (
+ 'string'
// , ....
- );
+ );
mod =>
array(
'title'=>__('@products filter tab manufacturer'),
@@ -462,7 +482,7 @@
// $tab['generic'][] ='devise' ;
if(count(self::$languages)>1 )
$tab['generic'][] ='language' ;
- if( count( tep_get_status_array(__CLASS__) ) > 1)
+// if( count( tep_get_status_array(__CLASS__) ) > 1)
$tab['generic'][] ='subtype' ;
if( DataTypes::is_active('manufacturer'))
@@ -481,7 +501,7 @@
@remarks this define menu master module in page
@note use $boutons[action][] = array(params)
- params :
+ params :
'type'=>'getLink',
'format'=>'button_nav',
'image'=>'',
@@ -606,9 +626,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);
@@ -806,7 +826,7 @@
);
// block if no check ref product Or attribute
- if( isset($_POST['products_ref']) ){
+ if( isset($_POST['products_ref']) && tep_not_null($_POST['products_ref']) ){
if(sqlproduct::GetByRef(tep_db_prepare_input(trim($_POST['products_ref']))) != false)
tep_redirect(tep_href_link(self::FILENAME, 'pID=' . $products_id.'&action=edit' ));
@@ -837,7 +857,6 @@
$params['post']=$_POST;
$params['language_id']= $languages_id;
-// unset($_GET['forceajax']); // = true;
if( ! sqlproduct::update( $params ) )
$messageStack->add(__('@product error in update process'), 'error');
else
@@ -1040,7 +1059,8 @@
$query_raw = "select ".$adjust->listfields;
$query_raw .=", p.products_id as id FROM " . TABLE_PRODUCTS . " p ".
- " JOIN " . TABLE_PRODUCTS_DESCRIPTION . " pd ON(p.products_id = pd.products_id and pd.language_id = '" . (int)$adjust->languages_id . "') ";
+ " JOIN " . TABLE_PRODUCTS_DESCRIPTION . " pd ON(p.products_id = pd.products_id and pd.language_id = '" . (int)$adjust->languages_id . "') ".
+ " LEFT JOIN ".TABLE_STATUS." s on(p.products_type = s.status_id and s.status_type='product' and s.language_id='" . (int)$adjust->languages_id . "') ";
if(isset($_SESSION['filters'][__CLASS__]['bystock']) && $_SESSION['filters'][__CLASS__]['bystock'] > 0 ) {
$query_raw .=" LEFT JOIN " . TABLE_PRODUCTS_STOCK . " ps ON(p.products_id = ps.products_id ) ";
@@ -1397,8 +1417,8 @@
}
-
+ $item[1]=tep_draw_checkbox_field('action_multi['.$item['id'].']','action_mutli_'.$item['id'],$item['id'],false, '','class="multi"');
foreach(self::$InitInfo['modele']['listing'] as $k=>$row){
@@ -1418,12 +1438,10 @@
/* END Sub module add col */
else $ord[$k]=$item[$k];
}
+ $ord[0]=$item['id'];
- $ord[0]=$item['id'];
- $item[1]=tep_draw_checkbox_field('action_multi['.$item['id'].']','action_mutli_'.$item['id'],$item['id'],false, '','class="multi"');
-
$res[]=$ord;
}
break;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2013-07-08 09:55:18
|
Revision: 4780
http://sourceforge.net/p/oscss/svn/4780
Author: oscim
Date: 2013-07-08 09:55:14 +0000 (Mon, 08 Jul 2013)
Log Message:
-----------
Fix module report in fetch sqlxxx
fix bug
Modified Paths:
--------------
trunk/catalog/admin/includes/classes/aca.php
trunk/catalog/admin/includes/classes/drivers/productsACA.php
trunk/catalog/admin/includes/classes/drivers/sqlcustomer.php
trunk/catalog/admin/includes/classes/drivers/sqlproduct.php
trunk/catalog/common/classes/order.php
trunk/extensions/ECOTAX_stable/catalog/admin/includes/languages/fr_FR/modules/products/ecotax.txt
trunk/extensions/ECOTAX_stable/catalog/admin/includes/modules/products/ecotax.php
trunk/extensions/ECOTAX_stable/install.xml
trunk/extensions/SPECIALS_stable/catalog/admin/includes/modules/products/specials.php
trunk/extensions/SPECIALS_stable/install.xml
Modified: trunk/catalog/admin/includes/classes/aca.php
===================================================================
--- trunk/catalog/admin/includes/classes/aca.php 2013-07-07 18:52:24 UTC (rev 4779)
+++ trunk/catalog/admin/includes/classes/aca.php 2013-07-08 09:55:14 UTC (rev 4780)
@@ -91,10 +91,12 @@
public function load_db_values ($Id) {
global $language, $languages_id;
$this->generic_id=$Id;
+ $return = array();
foreach ( $this->modules as $key=>$module) {
- if (($module->enabled) and method_exists($module, 'load_db_values' )) $this->modules[$key]->load_db_values($Id);
+ if (($module->enabled) and method_exists($module, 'load_db_values' ))
+ $return[$key] = $this->modules[$key]->load_db_values($Id);
}
- return true;
+ return $return;
}
/**
Modified: trunk/catalog/admin/includes/classes/drivers/productsACA.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/productsACA.php 2013-07-07 18:52:24 UTC (rev 4779)
+++ trunk/catalog/admin/includes/classes/drivers/productsACA.php 2013-07-08 09:55:14 UTC (rev 4780)
@@ -252,10 +252,13 @@
*/
public function load_db_values ($Id) {
global $language, $languages_id;
+ $return = array();
$this->products_id=$Id;
foreach ( $this->modules as $key=>$module) {
- if (($module->enabled) and method_exists($module, 'load_db_values' )) $this->modules[$key]->load_db_values($Id);
+ if (($module->enabled) and method_exists($module, 'load_db_values' ))
+ $return[$key] = $this->modules[$key]->load_db_values($Id);
}
+ return $return;
}
/**
Modified: trunk/catalog/admin/includes/classes/drivers/sqlcustomer.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlcustomer.php 2013-07-07 18:52:24 UTC (rev 4779)
+++ trunk/catalog/admin/includes/classes/drivers/sqlcustomer.php 2013-07-08 09:55:14 UTC (rev 4780)
@@ -33,26 +33,10 @@
/**
@brief create new ligne in table configuration
- @param $option array
- password
- email
- customers_firstname
- customers_lastname
- customers_email_address
- customers_telephone
- customers_fax
- customers_newsletter
- customers_group_ra
- [customers_gender]
- [customers_dob]
- global_product_notifications
*/
public static function create($option){
self::getInstance();
- $DB=Database::getInstance();
- $error=0;
-
if(!isset($option['password']))
return 'password';
if(!isset($option['email']))
@@ -62,60 +46,57 @@
$sqlarray = $option['sqlarray'];
- $sql_data_array = array();
- $sql_data_array['customers_firstname'] = $sqlarray['customers_firstname'];
- $sql_data_array['customers_lastname'] = $sqlarray['customers_lastname'];
- $sql_data_array['customers_email_address'] = $sqlarray['customers_email_address'];
- $sql_data_array['customers_telephone'] = $sqlarray['customers_telephone'];
- $sql_data_array['customers_fax'] = $sqlarray['customers_fax'];
- if(isset($sqlarray['password']))$sql_data_array['customers_password'] = $sqlarray['password'];
- $sql_data_array['customers_newsletter'] = $sqlarray['customers_newsletter'];
- $sql_data_array['customers_group_ra'] = $sqlarray['customers_group_ra'];
+ $sql_data_array = array();
+ $sql_data_array['customers_firstname'] = $sqlarray['customers_firstname'];
+ $sql_data_array['customers_lastname'] = $sqlarray['customers_lastname'];
+ $sql_data_array['customers_email_address'] = $option['email']; //$sqlarray['customers_email_address'];
+ $sql_data_array['customers_telephone'] = $sqlarray['customers_telephone'];
+ $sql_data_array['customers_fax'] = $sqlarray['customers_fax'];
+ if(isset($sqlarray['password']))$sql_data_array['customers_password'] = $sqlarray['password'];
+ $sql_data_array['customers_newsletter'] = $sqlarray['customers_newsletter'];
+ $sql_data_array['customers_group_ra'] = $sqlarray['customers_group_ra'];
- if (_cst_bool('ACCOUNT_GENDER'))
- $sql_data_array['customers_gender'] = $sqlarray['customers_gender'];
+ if (_cst_bool('ACCOUNT_GENDER'))
+ $sql_data_array['customers_gender'] = $sqlarray['customers_gender'];
- if (_cst_bool('ACCOUNT_DOB'))
- $sql_data_array['customers_dob'] = tep_date_raw($sqlarray['customers_dob']);
+ if (_cst_bool('ACCOUNT_DOB'))
+ $sql_data_array['customers_dob'] = tep_date_raw($sqlarray['customers_dob']);
- self::$modules->load_post_values($_post);
- $sql_data_array = array_merge($sql_data_array, self::$modules->insert_table_prim () );
+ self::$modules->load_post_values($_post);
+ $sql_data_array = array_merge($sql_data_array, self::$modules->insert_table_prim () );
- $_return= $sql_data_array;
+ $_return= $sql_data_array;
- $resobj=tep_db_perform(TABLE_CUSTOMERS, $sql_data_array);
+ $resobj=tep_db_perform(TABLE_CUSTOMERS, $sql_data_array);
- if(!$resobj){
- $DB->rollbackTransaction();
- return false;
- }
+ $lastid=$resobj->__get('insertId');
- $lastid=$resobj->__get('insertId');
+ $sql_data_array = array(
+ 'customers_info_id' => $lastid,
+ 'customers_info_date_account_created' => 'now()',
+ 'global_product_notifications' => $sqlarray['global_product_notifications']
+ );
- $sql_data_array = array(
- 'customers_info_id' => $lastid,
- 'customers_info_date_account_created' => 'now()',
- 'global_product_notifications' => $sqlarray['global_product_notifications']
- );
+ tep_db_perform(TABLE_CUSTOMERS_INFO, $sql_data_array);
- tep_db_perform(TABLE_CUSTOMERS_INFO, $sql_data_array);
+ self::$modules->load_post_values(array_merge(array('customers_id'=>$lastid),$_post) );
+ $sql_data_array = array_merge($sql_data_array, self::$modules->insert_table_second() );
- self::$modules->load_post_values(array_merge(array('customers_id'=>$lastid),$_post) );
- $sql_data_array = array_merge($sql_data_array, self::$modules->insert_table_second() );
+// $_return=array_merge($_return,$sql_data_array,array('customers_id'=>$lastid));
+ return $lastid;
+// }
+// else
+// return false;
- if( $error > 0){
- $DB->rollbackTransaction();
- return false;
- }
- else{
- $DB->commitTransaction();
- return $lastid;
- }
+// if(!$res)
+// return $res;
+// else
+// return $res->__get('insertId');
}
/**
@@ -123,8 +104,6 @@
*/
public static function update($option){
self::getInstance();
- $DB=Database::getInstance();
- $error=0;
if(!isset($option['id']) ) return 'id';
@@ -155,7 +134,6 @@
if (_cst_bool('ACCOUNT_DOB'))
$sql_data_array['customers_dob'] = tep_date_raw($sqlarray['customers_dob']);
- $DB->beginTransaction();
self::$modules->load_post_values($_post);
@@ -171,8 +149,7 @@
);
- if( !tep_db_perform(TABLE_CUSTOMERS_INFO, $sql_data_array, 'update' , " customers_info_id = '".(int)$option['id']."' " ) )
- $error++;
+ $res=tep_db_perform(TABLE_CUSTOMERS_INFO, $sql_data_array, 'update' , " customers_info_id = '".(int)$option['id']."' " );
self::$modules->load_post_values($_post);
@@ -181,16 +158,7 @@
self::$modules->after_update((int)$option['id']);
-
- if( $error > 0){
- $DB->rollbackTransaction();
- return false;
- }
- else{
- $DB->commitTransaction();
- return 1;
- }
-
+ return $res;
}
@@ -255,6 +223,7 @@
$result['mod'] = self::$modules->fetch(array('customers_id'=>$result['customers_id'], 'shortkey'=>$shortkey));
+
return ((!$shortkey)? $result : self::CleanKey($result));
}
elseif($num > 1){
Modified: trunk/catalog/admin/includes/classes/drivers/sqlproduct.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlproduct.php 2013-07-07 18:52:24 UTC (rev 4779)
+++ trunk/catalog/admin/includes/classes/drivers/sqlproduct.php 2013-07-08 09:55:14 UTC (rev 4780)
@@ -68,9 +68,9 @@
$products_id = $resobj->__get('insertId');
- $res = $DB->query("insert into " . TABLE_PRODUCTS_TO_CATEGORIES . " (products_id, categories_id) values ('" . (int)$products_id . "', '".ORPHELIN_COLLECTOR."')");
- if(!$res)
- $error++;
+ $res = $DB->query("insert into " . TABLE_PRODUCTS_TO_CATEGORIES . " (products_id, categories_id) values ('" . (int)$products_id . "', '".ORPHELIN_COLLECTOR."')");
+ if(!$res)
+ $error++;
$list_languages=tep_get_languages();
for ($i=0, $n=sizeof($list_languages); $i<$n; $i++) {
@@ -82,14 +82,14 @@
$error++;
}
- if( $error > 0){
- $DB->rollbackTransaction();
- return false;
- }
- else{
- $DB->commitTransaction();
- return $products_id;
- }
+ if( $error > 0){
+ $DB->rollbackTransaction();
+ return false;
+ }
+ else{
+ $DB->commitTransaction();
+ return $products_id;
+ }
}
/**
@@ -357,7 +357,7 @@
'id'=> $ID,
), true
);
- if(count($res)>0)
+ if(is_array($res) && count($res)>0)
foreach($res as $row)
$product['featureds'][$row->featured_id]=$row;
}
@@ -375,10 +375,10 @@
}
//<!-- EOF Separate Pricing Per Customer -->
- self::$modules->load_db_values($ID);
+ $res = self::$modules->load_db_values($ID);
+ $product['mod'] = $res;
-
return ((!$shortkey)? $product : self::CleanKey($product));
// if($num == 1){
// $result=$res->fetchAssoc();
Modified: trunk/catalog/common/classes/order.php
===================================================================
--- trunk/catalog/common/classes/order.php 2013-07-07 18:52:24 UTC (rev 4779)
+++ trunk/catalog/common/classes/order.php 2013-07-08 09:55:14 UTC (rev 4780)
@@ -292,7 +292,7 @@
'exchange_id' => $orders_products['products_exchanged_id'] );
$this->products[$index]['attributes'] = array();
-
+
$subindex = 0;
$attributes_query = tep_db_query("select pa.products_options_id, pa.products_options_values_id, pa.products_options, pa.products_options_values, pa.options_values_price, pa.price_prefix, po.products_options_type as type from " .self::$tables['ATTRIBUTES'] . " pa LEFT JOIN ".TABLE_PRODUCTS_OPTIONS." po ON(pa.products_options_id = po.products_options_id) where orders_id = '" . (int)$order_id . "' and orders_products_id = '" . (int)$orders_products['orders_products_id'] . "'");
// $attributes_query = tep_db_query("select products_options, products_options_values, options_values_price, price_prefix from " .self::$tables['ATTRIBUTES'] . " where orders_id = '" . (int)$order_id . "' and orders_products_id = '" . (int)$orders_products['orders_products_id'] . "'");
Modified: trunk/extensions/ECOTAX_stable/catalog/admin/includes/languages/fr_FR/modules/products/ecotax.txt
===================================================================
--- trunk/extensions/ECOTAX_stable/catalog/admin/includes/languages/fr_FR/modules/products/ecotax.txt 2013-07-07 18:52:24 UTC (rev 4779)
+++ trunk/extensions/ECOTAX_stable/catalog/admin/includes/languages/fr_FR/modules/products/ecotax.txt 2013-07-08 09:55:14 UTC (rev 4780)
@@ -2,12 +2,15 @@
/**
@licence GPL 2005-2010 The osCSS developers - osCSS Open Source E-commerce
@package osCSS-2 <www http://www.oscss.org>
- @version 2.1.0
- @date 16/11/10, 12:04
+ @version 2.1.2
+ @date 08/07/2013, 12:04
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
*/
$lang['heading ecotax']= 'eco-taxe';
$lang['text products eco taxe']= 'eco-taxe valeur';
$lang['text products eco taxe tax class']= 'eco-taxe taxe';
+
+$lang['@ecotax table heading ecotax']= 'eco-taxe';
+$lang['@ecotax table heading ecotax tax class id']= 'eco-taxe taxe';
?>
\ No newline at end of file
Modified: trunk/extensions/ECOTAX_stable/catalog/admin/includes/modules/products/ecotax.php
===================================================================
--- trunk/extensions/ECOTAX_stable/catalog/admin/includes/modules/products/ecotax.php 2013-07-07 18:52:24 UTC (rev 4779)
+++ trunk/extensions/ECOTAX_stable/catalog/admin/includes/modules/products/ecotax.php 2013-07-08 09:55:14 UTC (rev 4780)
@@ -45,6 +45,65 @@
if(!defined('TABLE_PRODUCTS_ECOTAX'))define('TABLE_PRODUCTS_ECOTAX', DB_TABLE_PREFIX.'products_ecotax');
}
+
+ /**
+ @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['pet.ecotax_value'] = array(
+ 'sort'=>true,
+ 'alias'=>'ecotax',
+ 'text'=>__('@ecotax table heading ecotax'),
+ 'width'=>'8%',
+ 'class'=>'tcenter',
+ 'default'=>true,
+ );
+ $array['pet.ecotax_tax_class_id'] = array(
+ 'sort'=>true,
+ 'alias'=>'ecotax_tax_class_id',
+ 'text'=>__('@ecotax table heading ecotax tax class id'),
+ 'width'=>'8%',
+ 'class'=>'tcenter',
+// 'default'=>true,
+ );
+ break;
+
+ case 'tables':
+
+ $array['ps'] = " LEFT JOIN " . TABLE_PRODUCTS_ECOTAX . " pet ON( pet.products_id=p.products_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, $price;
+
+ switch($key){
+ case 'ecotax':
+ $value = $price->format($item[$key], true) ;
+ break;
+ default:
+ $value = $item[$key] ;
+ }
+
+ return $value;
+ }
+
public function get_header_js(){
?>
<script type="text/javascript">//<!--
@@ -118,6 +177,8 @@
self::$pInfo->objectInfo($product);
+ /// @remarks Force retrun for sqlproduct obtain result
+// return self::$pInfo;
}
@@ -133,7 +194,7 @@
self::$tax_class_array[] = array('id' => $tax_class['tax_class_id'],'text' => $tax_class['tax_class_title']);
}
- $this->load_db_values (products::$pInfo->products_id);
+ $this->load_db_values (products::$Info->products_id);
return array('title'=> __('heading ecotax') ,'text'=> tep_get_include_contents('products.'.__CLASS__.'.'.__FUNCTION__));
}
Modified: trunk/extensions/ECOTAX_stable/install.xml
===================================================================
--- trunk/extensions/ECOTAX_stable/install.xml 2013-07-07 18:52:24 UTC (rev 4779)
+++ trunk/extensions/ECOTAX_stable/install.xml 2013-07-08 09:55:14 UTC (rev 4780)
@@ -26,7 +26,7 @@
<sql>
<query><![CDATA[
- INSERT INTO %DB_PREFIX%status VALUES (3, 'geo_zone_type', 1, 'EEE','');
+ INSERT INTO %DB_PREFIX%status (status_id, status_type, language_id, status_name, status_color) VALUES (3, 'geo_zone_type', 1, 'EEE','');
]]></query>
<remove_query>DELETE FROM %DB_PREFIX%status WHERE status_type='geo_zone_type' and status_id=3;</remove_query>
</sql>
Modified: trunk/extensions/SPECIALS_stable/catalog/admin/includes/modules/products/specials.php
===================================================================
--- trunk/extensions/SPECIALS_stable/catalog/admin/includes/modules/products/specials.php 2013-07-07 18:52:24 UTC (rev 4779)
+++ trunk/extensions/SPECIALS_stable/catalog/admin/includes/modules/products/specials.php 2013-07-08 09:55:14 UTC (rev 4780)
@@ -68,8 +68,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){
@@ -77,12 +77,12 @@
switch ($opt['type']) {
case 'allfields':
- $array['ps.special_id'] = array(
+ $array['ps.specials_id'] = array(
'sort'=>true,
'alias'=>'specials_id',
'text'=>__('@specials table heading special_id'),
'width'=>'8%',
- 'class'=>'tleft',
+ 'class'=>'tcenter',
// 'default'=>true,
);
$array['ps.specials_new_products_price'] = array(
@@ -90,15 +90,15 @@
'alias'=>'specials_new_products_price',
'text'=>__('@specials table heading specials_new_products_price'),
'width'=>'8%',
- 'class'=>'tleft',
-// 'default'=>true,
+ 'class'=>'tright',
+ 'default'=>true,
);
$array['ps.specials_date_added'] = array(
'sort'=>true,
'alias'=>'specials_date_added',
'text'=>__('@specials table heading specials_date_added'),
'width'=>'8%',
- 'class'=>'tleft',
+ 'class'=>'tcenter',
// 'default'=>true,
);
$array['ps.specials_last_modified'] = array(
@@ -106,7 +106,7 @@
'alias'=>'specials_last_modified',
'text'=>__('@specials table heading specials_last_modified'),
'width'=>'8%',
- 'class'=>'tleft',
+ 'class'=>'tcenter',
// 'default'=>true,
);
$array['ps.expires_date'] = array(
@@ -114,7 +114,7 @@
'alias'=>'expires_date',
'text'=>__('@specials table heading expires_date'),
'width'=>'8%',
- 'class'=>'tleft',
+ 'class'=>'tcenter',
// 'default'=>true,
);
$array['ps.date_status_change'] = array(
@@ -122,7 +122,7 @@
'alias'=>'date_status_change',
'text'=>__('@specials table heading date_status_change'),
'width'=>'8%',
- 'class'=>'tleft',
+ 'class'=>'tcenter',
// 'default'=>true,
);
$array['ps.status'] = array(
@@ -130,7 +130,7 @@
'alias'=>'specials_status',
'text'=>__('@specials table heading status'),
'width'=>'8%',
- 'class'=>'tleft',
+ 'class'=>'tcenter',
// 'default'=>true,
);
$array['ps.specials_begin_date'] = array(
@@ -138,7 +138,7 @@
'alias'=>'specials_begin_date',
'text'=>__('@specials table heading specials_begin_date'),
'width'=>'8%',
- 'class'=>'tleft',
+ 'class'=>'tcenter',
// 'default'=>true,
);
$array['ps.customers_group_id'] = array(
@@ -153,9 +153,16 @@
case 'tables':
- $array['ps'] = " LEFT JOIN " . TABLE_SPECIALS . " ps ON( ps.products_id=p.products_id AND customers_group_id = 0 ) ";
+ $array['ps'] = " LEFT JOIN " . TABLE_SPECIALS . " ps ON( ps.products_id=p.products_id ) ";
break;
+
+ case 'group_by':
+
+ $array['ps'] = " , customers_group_id ";
+
+ break;
+
}
return $array;
}
@@ -164,10 +171,10 @@
/**
@brief format db value for this allfields
@param $key string name key
- @param $item array
+ @param $item array
*/
public function formatdbvalue($key,$item){
- global $languages_id;
+ global $languages_id, $price;
switch($key){
case 'specials_date_added':
@@ -177,6 +184,9 @@
case 'expires_date':
$value = (( !empty($item[$key]) && $item[$key] !='1000-01-01 00:00:00' )? tep_date_short($item[$key]) : '');
break;
+ case 'specials_new_products_price':
+ $value = $price->format($item[$key], true) ;
+ break;
/**
TODO remplacer l'id du groupe par son nom
*/
@@ -229,7 +239,7 @@
float:none;
}
</style>
- <?php
+ <?php
tep_include_file(DIR_WS_JS . "modules/products/".__CLASS__.".js.php",true);
@@ -274,7 +284,7 @@
$all_adjust[$key]['specials_begin_date'] = $date_available;
}
- else
+ else
$all_adjust[$key]['specials_begin_date'] = '1000-01-01 00:00:00';
if(isset($_POST['expires_date'][$key]) && (float)$_POST['expires_date'][$key] > 0){
@@ -284,13 +294,13 @@
$all_adjust[$key]['expires_date'] = $date_expire;
}
- else
+ else
$all_adjust[$key]['expires_date'] = '1000-01-01 00:00:00';
- if(isset($_POST['special_status'][$key]) && (float)$_POST['special_status'][$key] == 'on')
+ if(isset($_POST['special_status'][$key]) && $_POST['special_status'][$key] == 'on')
$all_adjust[$key]['status'] = 1;
- else
+ else
$all_adjust[$key]['status'] = 0;
}
@@ -298,8 +308,6 @@
tep_db_query("DELETE FROM ".TABLE_SPECIALS." WHERE products_id = '".(int)$products_id."' AND customers_group_id = '".$key."' " );
}
-// print_r($all_adjust);
-// exit;
foreach($all_adjust as $group=>$array){
@@ -319,7 +327,7 @@
}
/**
- @brief action delete product
+ @brief action delete product
*/
public function delete_product($products_id){
return tep_db_query("DELETE FROM ".TABLE_SPECIALS." WHERE products_id = '".(int)$products_id."' " );
@@ -344,12 +352,16 @@
Recup element stocké dans db
*/
public function load_db_values($products_id) {
+
global $languages_id;
$product_query = tep_db_query($sql="select s.products_id, s.specials_id, s.specials_new_products_price, s.expires_date, s.specials_begin_date , s.status from ". TABLE_SPECIALS . " s where s.products_id = '" . (int)$products_id . "'");
$product = $product_query->fetchAssoc();
self::$sInfo = ( (tep_db_num_rows($product_query)>0) ? new objectInfo($product) : array() );
+ /// @remarks Force retrun for sqlproduct obtain result
+// return self::$sInfo;
+
return (tep_db_num_rows($product_query)>0)? true : false;
}
@@ -362,7 +374,7 @@
public function display_inline($array) {
self::$sInfo = array();
/**
- TODO Couplage avec groupe client
+ TODO Couplage avec groupe client
*/
$product_query = tep_db_query($sql="select s.products_id, s.specials_id, s.specials_new_products_price, s.expires_date, s.status, s.specials_begin_date , customers_group_id, special_apply_mode from ". TABLE_SPECIALS . " s where s.products_id = '" . (int)products::$Info->products_id . "' ORDER BY customers_group_id ASC");
$product = $product_query->fetchAllAssoc();
@@ -370,7 +382,7 @@
if( (tep_db_num_rows($product_query)>0) ){
foreach($product as $row){
- self::$sInfo[$row['customers_group_id']] = $row;
+ self::$sInfo[$row['customers_group_id']] = $row;
}
}
// print_r(self::$sInfo);
@@ -385,7 +397,7 @@
'customers_group_id'=> 0,
'customers_group_name'=> __('@specials customer groupe base'),
'special_apply_mode'=> 0,
- 'status'=> 0,
+ 'status'=> 0,
);
if(!isset(self::$sInfo[0]['customers_group_name']))
@@ -422,7 +434,7 @@
// 'customers_group_id'=> 0,
// 'customers_group_name'=> __('@specials customer groupe base'),
// 'special_apply_mode'=> 0,
-// 'status'=> 0,
+// 'status'=> 0,
// );
// print_r(self::$sInfo);
Modified: trunk/extensions/SPECIALS_stable/install.xml
===================================================================
--- trunk/extensions/SPECIALS_stable/install.xml 2013-07-07 18:52:24 UTC (rev 4779)
+++ trunk/extensions/SPECIALS_stable/install.xml 2013-07-08 09:55:14 UTC (rev 4780)
@@ -16,9 +16,9 @@
<!-- <file name="admin/includes/gabarit/specials/display_view.listing.gab" /> -->
<!-- <file name="admin/includes/gabarit/specials/display_view.edit.gab" /> -->
<!-- <file name="admin/includes/gabarit/specials/display_view.delete.gab" /> -->
-
- <file name="admin/includes/gabarit/specials/products/specials/display_inline.edit.gab" />
-
+
+ <file name="admin/includes/gabarit/products/specials/display_inline.edit.gab" />
+
<!-- <file name="admin/includes/javascript/modules/pages/specials.js.php" /> -->
<file name="admin/includes/javascript/modules/products/specials.js.php" />
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|