|
From: <os...@us...> - 2015-04-07 08:18:55
|
Revision: 5265
http://sourceforge.net/p/oscss/svn/5265
Author: oscim
Date: 2015-04-07 08:18:53 +0000 (Tue, 07 Apr 2015)
Log Message:
-----------
Next (Add support of quotation in process orders)
Added Paths:
-----------
trunk/extensions/QUOTATION_stable/catalog/admin/includes/gabarit/quotation/display_view.edit.gab
trunk/extensions/QUOTATION_stable/catalog/admin/includes/gabarit/quotation/edit.tab.generic.gab
trunk/extensions/QUOTATION_stable/catalog/admin/includes/gabarit/quotation/edit.tab.product.gab
trunk/extensions/QUOTATION_stable/catalog/admin/includes/languages/fr_FR/modules/
trunk/extensions/QUOTATION_stable/catalog/admin/includes/modules/pages/quotation.php
Added: trunk/extensions/QUOTATION_stable/catalog/admin/includes/gabarit/quotation/display_view.edit.gab
===================================================================
--- trunk/extensions/QUOTATION_stable/catalog/admin/includes/gabarit/quotation/display_view.edit.gab (rev 0)
+++ trunk/extensions/QUOTATION_stable/catalog/admin/includes/gabarit/quotation/display_view.edit.gab 2015-04-07 08:18:53 UTC (rev 5265)
@@ -0,0 +1,152 @@
+<?php
+/**
+ @licence GPL 2005-2014 The osCSS developers - osCSS Open Source E-commerce
+ @portion code Copyright (c) 2002 osCommerce
+ @package osCSS-2 <www http://www.oscss.org>
+ @version 2.2.0
+ @date 05/11/2013, 11:35
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+ @file display_view.edit.gab
+ @dir admin/includes/gabarit/orders/
+*/
+global $price, $current_theme;
+$page= MGabCont::CallSt('GetClassName');
+
+?>
+
+<h3><?php echo sprintf(__('@orders heading edit num %s ref %s'),quotation::$Info->info['orders_id'] , quotation::$Info->info['orders_ref'] ) ; ?></h3>
+
+<div class="box_uniq main-orders">
+
+ <div id="tabs">
+ <ul>
+ <?php $g = 0; foreach($page::GetListTabs() as $objTabs ): $g++; ?>
+ <li><a href="#tabs-<?php echo $g ?>"><?php echo $objTabs->GetTitle(); ?></a></li>
+ <?php endforeach; ?>
+ </ul>
+
+
+ <div class="box_uniq">
+ <?php $g = 0; foreach($page::GetListTabs() as $objTabs ): $g++; ?>
+ <div id="tabs-<?php echo $g ?>" class="tabPage">
+ <div class="block_form">
+ <?php echo $objTabs->GetContent(); ?>
+ </div>
+ </div>
+ <?php endforeach; ?>
+ <div class="separator"></div>
+ </div>
+
+
+
+ <div class="main-orders master">
+ <div class="main-orders block fleft w_50 padd_w">
+
+ <div class="block_field fleft w_50" >
+ <h4><?php echo __('legend contact customers'); ?></h4>
+ <p class="clear block_input">
+ <strong><?php echo __('entry telephone number'); ?></strong><?php echo quotation::$Info->customer['telephone']; ?>
+ <br />
+
+ <strong><?php echo __('entry email address'); ?></strong><?php echo '<a href="' .tep_href_link( FILENAME_MAIL , 'cus...@os...'.quotation::$Info->customer['email_address'].'&origin='. quotation::FILENAME .'&origin_id='.quotation::$Info->info['orders_id']). '">' . quotation::$Info->customer['email_address']. '</a>'; ?>
+ <br />
+
+ <strong><?php echo __('entry ip'); ?></strong><?php echo quotation::$Info->info['ip_address']; ?>
+ </p>
+ </div>
+ </div>
+
+ <?php
+ /**
+ DRAW BLOCK DOCS EXISTS OR LINK PDF CREATE
+ */
+ $datadocs=new DatasFiles; ?>
+ <div class="main-orders block fleft w_50 padd_w">
+ <h4><?php echo __('heading documents') ?></h4>
+
+ <table class="main-orders docs">
+ <thead>
+ <tr>
+ <th><?php echo __('order table pdf heading file') ?></th>
+ <th><?php echo __('order table pdf heading weight') ?></th>
+ <th><?php echo __('order table pdf heading date') ?></th>
+ <th> </th>
+ </tr>
+ </thead>
+
+
+ <tr>
+ <th colspan="3"><?php echo IMAGE_ORDERS_PACKINGSLIP ?></th>
+ <th></th>
+ </tr>
+
+ <?php if(( $filepath=$datadocs->GetDoc('packingslip', quotation::$Id)) && file_exists($filepath)): ?>
+ <tr>
+ <td><a href="<?php echo tep_href_link('document.php', 'mod=packingslip&id='.quotation::$Id) ?>"><?php echo quotation::$Info->info['orders_ref'] ?></a></td>
+ <td><?php echo round((filesize($filepath)/1000),1).' Ko' ; ?></td>
+ <td><?php echo tep_datetime_short(date('Y-m-d H:i:s',filemtime($filepath))) ; ?></td>
+ <td><?php echo sprintf(CsrtAction::getLink('row_action_right', IMAGE_DELETE, 'trash'), '', tep_href_link(quotation::FILENAME, 'file_type=packingslip&action=deletefile&id='.quotation::$Id.'&cID='.quotation::$Id) ,'' ) ; ?></td>
+ </tr>
+ <?php elseif(_cst_bool('USE_LOCAL_GENERAT_PDF')): ?>
+ <tr>
+ <td colspan="3"> </td>
+ <td><?php echo '<a class="button" href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('page_admin','action')).'action=pdf&forceview=pdf&file_type=packingslip&id='. quotation::$Id) . '" >' . __('pdf generate') . '</a>' ; ?> </td>
+ </tr>
+ <?php endif; ?>
+
+
+ <tr>
+ <th colspan="3"><?php echo __('image orders delivery') ?></th>
+ <th></th>
+ </tr>
+
+ <?php $i = 0; if(quotation::$Info->allshipping !=false) foreach (quotation::$Info->allshipping as $ashipping): $i++; ?>
+ <?php if(isset($ashipping->row_id)): ?>
+ <?php if(( $filepath=$datadocs->GetDoc('delivery', $ashipping->row_id)) && file_exists($filepath)): ?>
+ <tr>
+ <td><a href="<?php echo tep_href_link('document.php', 'mod=delivery&id='.$ashipping->row_id) ?>"><?php echo $ashipping->shipping_ref ?></a></td>
+ <td><?php echo round((filesize($filepath)/1000),1).' Ko' ; ?></td>
+ <td><?php echo tep_datetime_short(date('Y-m-d H:i:s',filemtime($filepath))) ; ?></td>
+ <td><?php echo sprintf(CsrtAction::getLink('row_action_right', IMAGE_DELETE, 'trash'), '', tep_href_link(quotation::FILENAME, 'file_type=delivery&action=deletefile&id='.$ashipping->row_id.'&cID='.quotation::$Id) ,'' ) ; ?></td>
+ </tr>
+ <?php elseif(_cst_bool('USE_LOCAL_GENERAT_PDF')): ?>
+ <tr>
+ <td colspan="3"> </td>
+ <td><?php echo '<a class="button" href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('page_admin','action')).'action=pdf&forceview=pdf&file_type=delivery&id='.$ashipping->row_id) . '" >' . __('pdf generate') . '</a>' ; ?> </td>
+ </tr>
+ <?php endif; ?>
+ <?php endif; ?>
+ <?php endforeach ?>
+
+
+ <tr>
+ <th colspan="3"><?php echo IMAGE_ORDERS_INVOICE ?></th>
+ <th> </th>
+ </tr>
+
+ <?php if(( $filepath=$datadocs->GetDoc('invoices', quotation::$Id)) && file_exists($filepath)): ?>
+ <tr>
+ <td><a href="<?php echo tep_href_link('document.php', 'mod=invoice&id='.quotation::$Id) ?>"><?php echo quotation::$Info->info['facture_ref'] ?></a></td>
+ <td><?php echo round((filesize($filepath)/1000),1).' Ko' ; ?></td>
+ <td><?php echo tep_datetime_short(date('Y-m-d H:i:s',filemtime($filepath))) ; ?></td>
+ <td><?php echo sprintf(CsrtAction::getLink('row_action_right', IMAGE_DELETE, 'trash'), '', tep_href_link(quotation::FILENAME, 'file_type=invoice&action=deletefile&id='.quotation::$Id.'&cID='.quotation::$Id) ,'' ) ; ?></td>
+ </tr>
+ <?php elseif(_cst_bool('USE_LOCAL_GENERAT_PDF')): ?>
+ <tr>
+ <td colspan="3"> </td>
+ <td><?php echo '<a class="button" href="' . tep_href_link(quotation::FILENAME , tep_get_all_get_params(array('page_admin','action','forceview')).'action=pdf&forceview=pdf&file_type=invoice&id='.quotation::$Id) . '">' . __('pdf generate') . '</a>' ; ?></td>
+ </tr>
+ <?php endif; ?>
+
+ </table>
+ </div>
+
+
+
+ <div class="button_nav">
+ <?php echo tep_js_back(tep_href_link(quotation::FILENAME), IMAGE_CANCEL);?>
+ </div>
+
+
+</div>
Added: trunk/extensions/QUOTATION_stable/catalog/admin/includes/gabarit/quotation/edit.tab.generic.gab
===================================================================
--- trunk/extensions/QUOTATION_stable/catalog/admin/includes/gabarit/quotation/edit.tab.generic.gab (rev 0)
+++ trunk/extensions/QUOTATION_stable/catalog/admin/includes/gabarit/quotation/edit.tab.generic.gab 2015-04-07 08:18:53 UTC (rev 5265)
@@ -0,0 +1,299 @@
+<?php
+/**
+ @licence GPL 2005-2014 The osCSS developers - osCSS Open Source E-commerce
+ @portion code Copyright (c) 2002 osCommerce
+ @package osCSS-2 <www http://www.oscss.org>
+ @version 2.2.0
+ @date 05/11/2013, 11:35
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+ @file edit.tab.generic.gab
+ @dir admin/includes/gabarit/quotation/
+*/
+global $price, $current_theme;
+
+
+?>
+
+<!-- DRAW DETAIL CUSTOMERS -->
+ <div class="box_uniq block_form">
+ <fieldset class="block_field fleft w_50" >
+ <legend class="Ctrtirroir"><?php echo __('entry customer'); ?></legend>
+ <p class="block_input tirroir">
+ <?php echo tep_address_format(quotation::$Info->customer['format_id'], quotation::$Info->customer, 1, '', '<br />'); ?><br />
+ </p>
+ </fieldset>
+
+ <fieldset class="block_field fleft w_50" >
+ <legend class="Ctrtirroir"><?php echo __('legend contact customers'); ?></legend>
+ <p class="block_input tirroir">
+ <strong><?php echo __('entry telephone number'); ?></strong><?php echo quotation::$Info->customer['telephone']; ?>
+ <br />
+
+ <strong><?php echo __('entry email address'); ?></strong><?php echo '<a href="mailto:' . quotation::$Info->customer['email_address'] . '">' . quotation::$Info->customer['email_address'] . '</a>'; ?>
+ <br />
+
+ <strong><?php echo __('entry ip'); ?></strong><?php echo quotation::$Info->info['ip_address']; ?>
+ </p>
+ </fieldset>
+
+ </div>
+
+<!-- DRAW ADRESS SHIPING / BILLING -->
+
+ <?php /** Billing Address */ ?>
+ <div class="box_uniq block_form">
+
+ <fieldset class="block_field fleft w_50" >
+
+ <legend>
+ <?php echo __('entry billing address'); ?>
+ <?php if( !in_array(quotation::$Info->info['quotation_status_id'], array(DEFAULT_ORDERS_STATUS_COMPLETED, DEFAULT_ORDERS_STATUS_ANNULATE ) ) ): ?>
+ <span class="row_action">
+ <?php echo sprintf(CsrtAction::getLink('row_action_right', IMAGE_EDIT, 'edit'), '', tep_href_link(quotation::FILENAME, 'action=edit&cID='.quotation::$Id. '&address=billing') ,'' ) ?>
+ </span>
+ <?php endif; ?>
+ </legend>
+
+ <div class="block_input">
+ <?php if(!isset($_REQUEST['address']) || ( isset($_REQUEST['address']) && $_REQUEST['address'] !='billing' ) ): ?>
+ <?php echo tep_address_format(quotation::$Info->billing['format_id'], quotation::$Info->billing, 1, '', '<br />'); ?>
+ <?php else: ?>
+
+
+ <?php echo tep_draw_form('add_deliv', quotation::FILENAME,'cID='.quotation::$Id.'&action=address&address=billing', 'post', ' class="block_form"'); ?>
+
+ <?php if(_cst_bool('ACCOUNT_COMPANY')): ?>
+ <?php echo tep_draw_input_field('address[company]','company', quotation::$Info->billing['company']) ; ?>
+ <?php endif; ?>
+
+ <?php echo tep_draw_input_field('address[name]','name', quotation::$Info->billing['name'] ); ?>
+
+ <?php echo tep_draw_input_field('address[street_address]','street_address', quotation::$Info->billing['street_address']) ; ?>
+
+ <?php echo tep_draw_input_field('address[suburb]','suburb', quotation::$Info->billing['suburb']) ; ?>
+
+ <?php echo tep_draw_input_field('address[postcode]','postcode', quotation::$Info->billing['postcode']) ; ?>
+
+ <?php echo tep_draw_input_field('address[city]','city', quotation::$Info->billing['city']) ; ?>
+
+ <?php echo tep_draw_pull_down_menu('address[country]', worldUtility::get_countries(), worldUtility::GetCountryIdByName(quotation::$Info->billing['country']) ) ; ?>
+
+ <?php if(_cst_bool('ACCOUNT_STATE')): ?>
+ <?php echo tep_draw_input_field('address[state]','state', quotation::$Info->billing['state']) ; ?>
+ <?php endif; ?>
+
+
+ <div class="button_nav">
+ <?php echo tep_js_back(tep_href_link(quotation::FILENAME, tep_get_all_get_params(array('address')) ), IMAGE_CANCEL);?>
+ <?php echo tep_image_submit('button_update.gif', IMAGE_UPDATE); ?>
+ </div>
+
+ </form>
+ <?php endif; ?>
+ </div>
+ </fieldset>
+
+ <?php /** Shipping address */ ?>
+ <fieldset class="block_field fleft w_50 " >
+ <legend>
+ <?php echo __('entry shipping address'); ?>
+
+ <?php if( !in_array(quotation::$Info->info['quotation_status_id'], array(DEFAULT_ORDERS_STATUS_COMPLETED, DEFAULT_ORDERS_STATUS_ANNULATE ) ) ): ?>
+ <?php if(isset(quotation::$Info->delivery['street_address'])): ?>
+ <span class="row_action">
+ <?php echo sprintf(CsrtAction::getLink('row_action_right', IMAGE_EDIT, 'edit'), '', tep_href_link(quotation::FILENAME, 'action=edit&cID='.quotation::$Id . '&address=delivery') ,'' ) ?>
+ </span>
+ <?php endif; ?>
+ <?php endif; ?>
+ </legend>
+
+ <?php if(isset(quotation::$Info->delivery['street_address'])): ?>
+ <div class="block_input">
+ <?php if(!isset($_REQUEST['address']) || ( isset($_REQUEST['address']) && $_REQUEST['address'] !='delivery' ) ): ?>
+ <?php echo tep_address_format(quotation::$Info->delivery['format_id'], quotation::$Info->delivery, 1, '', '<br />'); ?>
+ <?php else: ?>
+
+
+ <?php echo tep_draw_form('add_ship', quotation::FILENAME,'cID='.quotation::$Id.'&action=address&address=delivery', 'post', ' class="block_form"'); ?>
+ <ul>
+ <li>
+ <label for ="notify"><?php echo __('entry shipping address actived'); ?></label>
+ <?php echo tep_draw_checkbox_field('address[activate]', '', '', (!empty(quotation::$Info->delivery['name']) ? true :false) ); ?>
+ </li>
+
+ <?php if(_cst_bool('ACCOUNT_COMPANY')): ?>
+ <li><?php echo tep_draw_input_field('address[company]','company', quotation::$Info->delivery['company']) ; ?></li>
+ <?php endif; ?>
+
+ <li><?php echo tep_draw_input_field('address[name]','name', quotation::$Info->delivery['name'] ); ?></li>
+
+ <li><?php echo tep_draw_input_field('address[street_address]','street_address', quotation::$Info->delivery['street_address']) ; ?></li>
+
+ <li><?php echo tep_draw_input_field('address[suburb]','suburb', quotation::$Info->delivery['suburb']) ; ?></li>
+
+ <li><?php echo tep_draw_input_field('address[postcode]','postcode', quotation::$Info->delivery['postcode']) ; ?></li>
+
+ <li><?php echo tep_draw_input_field('address[city]','city', quotation::$Info->delivery['city']) ; ?></li>
+
+ <li><?php echo tep_draw_pull_down_menu('address[country]', worldUtility::get_countries(), worldUtility::GetCountryIdByName(quotation::$Info->delivery['country']) ) ; ?></li>
+
+ <?php if(_cst_bool('ACCOUNT_STATE')): ?>
+ <li><?php echo tep_draw_input_field('address[state]','state', quotation::$Info->delivery['state']) ; ?></li>
+ <?php endif; ?>
+
+ </ul>
+
+ <div class="button_nav">
+ <?php echo tep_js_back(tep_href_link(quotation::FILENAME, tep_get_all_get_params(array('address')) ), IMAGE_CANCEL);?>
+ <?php echo tep_image_submit('button_update.gif', IMAGE_UPDATE); ?>
+ </div>
+
+ </form>
+ <?php endif; ?>
+ </div>
+ <?php endif; ?>
+
+ </fieldset>
+ </div>
+
+<!-- DRAW METHOD SHIPING / BILLING -->
+
+
+ <?php /** Payment Methode */ ?>
+ <div class="box_uniq block_form">
+ <fieldset class="block_field fleft w_50 ">
+ <legend><?php echo __('entry payment method'); ?>
+ <?php if( !in_array(quotation::$Info->info['quotation_status_id'], array(DEFAULT_ORDERS_STATUS_COMPLETED, DEFAULT_ORDERS_STATUS_ANNULATE ) ) ): ?>
+ <span class="row_action">
+ <?php echo sprintf(CsrtAction::getLink('row_action_right', IMAGE_EDIT, 'edit'), '', tep_href_link(quotation::FILENAME, 'action=edit&cID='.quotation::$Id . '&mod=payment') ,'' ) ?>
+ </span>
+ <?php endif; ?>
+ </legend>
+ <div class="block_input">
+
+ <?php if(!isset($_REQUEST['mod']) || ( isset($_REQUEST['mod']) && $_REQUEST['mod'] !='payment' ) ): ?>
+ <?php echo quotation::$Info->info['payment_method'] ; ?>
+ <?php /*echo quotation::$Info->mod['class_payment'] ;*/ ?>
+
+ <div id="modPay">
+ <?php echo quotation::ViewMod('payment', quotation::$Info->mod['class_payment']) ?>
+ </div>
+
+ <?php else: ?>
+ <?php echo tep_draw_form('mod_pay', quotation::FILENAME,'cID='.quotation::$Id.'&action=mod&mod=payment', 'post', ' class="block_form"'); ?>
+
+ <?php echo tep_draw_pull_down_menu('mod[payment]', quotation::PrepaPullDownType('payment'), quotation::$Info->mod['class_payment'] , '') ; ?>
+
+ <div id="modPay">
+ <?php echo quotation::EditMod('payment', quotation::$Info->mod['class_payment']) ?>
+ </div>
+
+ <div class="button_nav">
+ <?php echo tep_js_back(tep_href_link(quotation::FILENAME, tep_get_all_get_params(array('mod')) ), IMAGE_CANCEL);?>
+ <?php echo tep_image_submit('button_update.gif', IMAGE_UPDATE); ?>
+ </div>
+ </form>
+ <?php endif; ?>
+ </div>
+ </fieldset>
+
+
+ <?php /** Shipping Methode */ ?>
+ <?php if(isset(quotation::$Info->delivery['street_address'])): ?>
+ <fieldset class="block_field fleft w_50 ">
+ <legend><?php echo __('entry shipping method'); ?>
+ <?php if( !in_array(quotation::$Info->info['quotation_status_id'], array(DEFAULT_ORDERS_STATUS_COMPLETED, DEFAULT_ORDERS_STATUS_ANNULATE ) ) ): ?>
+ <span class="row_action">
+ <?php echo sprintf(CsrtAction::getLink('row_action_right', IMAGE_EDIT, 'edit'), '', tep_href_link(quotation::FILENAME, 'action=edit&cID='.quotation::$Id . '&mod=shipping') ,'' ) ?>
+ </span>
+ <?php endif; ?>
+ </legend>
+ <div class="block_input">
+ <?php if(!isset($_REQUEST['mod']) || ( isset($_REQUEST['mod']) && $_REQUEST['mod'] !='shipping' ) ): ?>
+ <?php //echo quotation::GetTitle('shipping',quotation::$Info->mod['class_shipping']) ; ?>
+
+ <div id="modPay">
+ <?php echo quotation::ViewMod('shipping', quotation::$Info->mod['class_shipping']) ?>
+ </div>
+
+ <?php else: ?>
+ <?php echo tep_draw_form('mod_pay', quotation::FILENAME,'cID='.quotation::$Id.'&action=mod&mod=shipping', 'post', ' class="block_form"'); ?>
+
+ <?php echo tep_draw_pull_down_menu('mod[shipping]', quotation::PrepaPullDownType('shipping'), quotation::$Info->mod['class_shipping'] , '') ; ?>
+
+ <div id="modShip">
+ <?php echo quotation::EditMod('shipping', quotation::$Info->mod['class_shipping']) ?>
+ </div>
+
+ <div class="button_nav">
+ <?php echo tep_js_back(tep_href_link(quotation::FILENAME, tep_get_all_get_params(array('mod')) ), IMAGE_CANCEL);?>
+ <?php echo tep_image_submit('button_update.gif', IMAGE_UPDATE); ?>
+ </div>
+ </form>
+ <?php endif; ?>
+ </div>
+ </fieldset>
+ <?php endif; ?>
+ </div>
+
+
+ <div class="box_uniq block_form">
+
+ <table class="main-quotation history padd_w">
+ <thead>
+ <tr>
+ <th width="15%"><?php echo __('table heading date added'); ?></th>
+ <th class="tcenter" width="10%"><?php echo __('table heading customer notified'); ?></th>
+ <th class="tcenter" width="10%"><?php echo __('table heading status'); ?></th>
+ <th><?php echo __('table heading comments'); ?></th>
+ </tr>
+ </thead>
+ <tbody>
+ <?php
+ if( !is_array(quotation::$Info->lasthistory)): echo '<tr>' . "\n" . '<td colspan="5">' . __('text no order history') . '</td>' . "\n" . '</tr>' . "\n";
+ else : ?>
+ <tr>
+ <td class="tcenter"><?php echo quotation::$Info->lasthistory['date_added']; ?></td>
+ <td class="tcenter"><?php echo quotation::$Info->lasthistory['customer_notified']; ?></td>
+ <td class="tcenter" style="width:40px; background:<?php echo quotation::$Info->lasthistory['color'] ?> url('includes/template/<?php echo $current_theme ?>/img/<?php echo $_SESSION['login_groups_id'] ?>/bg_graph.png') bottom left repeat-y;"><?php echo quotation::$Info->lasthistory['quotation_status']; ?></td>
+ <td><?php echo unhtmlentities(quotation::$Info->lasthistory['comments']); ?></td>
+ </tr>
+ <?php endif; ?>
+ </tbody>
+ </table>
+ </div>
+
+ <?php if( !in_array(quotation::$Info->info['quotation_status_id'], array(DEFAULT_ORDERS_STATUS_COMPLETED, DEFAULT_ORDERS_STATUS_ANNULATE ) ) ): ?>
+ <?php /*if(quotation::$update) :*/?>
+<!-- DRAW FORM UPDATE BLOCK -->
+ <?php echo tep_draw_form('status_form', quotation::FILENAME,'cID='.quotation::$Id.'&action=update_order', 'post', ' class="block_form"'); ?>
+ <fieldset class="block_field">
+ <legend><?php echo __('legend update order history'); ?></legend>
+
+ <p class="block_input">
+ <label for="status"><?php echo __('entry status'); ?></label>
+ <?php echo tep_draw_pull_down_menu('status', quotation::$quotation_statuses, quotation::$Info->info['orders_status']); ?>
+ </p>
+
+ <p class="block_input inline">
+ <label for ="notify"><?php echo __('entry notify customer'); ?></label>
+ <?php echo tep_draw_checkbox_field('notify', '', '', true); ?>
+ </p>
+
+ <fieldset id="cont_comments" class="block_field">
+ <legend class="Ctrtirroir" ><?php echo __('table heading comments'); ?></legend>
+ <div class="block_input tirroir">
+ <?php echo tep_draw_textarea_field('comments', '', '30', '5', '','style="width:100%"'); ?>
+ </div>
+ <br /><br />
+ </fieldset>
+
+ <div class="button_nav">
+ <?php echo tep_image_submit('button_update.gif', IMAGE_UPDATE); ?>
+ </div>
+ </fieldset>
+ </form>
+ <?php /*endif;*/ ?>
+ <?php endif; ?>
+ </div>
Added: trunk/extensions/QUOTATION_stable/catalog/admin/includes/gabarit/quotation/edit.tab.product.gab
===================================================================
--- trunk/extensions/QUOTATION_stable/catalog/admin/includes/gabarit/quotation/edit.tab.product.gab (rev 0)
+++ trunk/extensions/QUOTATION_stable/catalog/admin/includes/gabarit/quotation/edit.tab.product.gab 2015-04-07 08:18:53 UTC (rev 5265)
@@ -0,0 +1,150 @@
+<?php
+/**
+ @licence GPL 2005-2014 The osCSS developers - osCSS Open Source E-commerce
+ @portion code Copyright (c) 2002 osCommerce
+ @package osCSS-2 <www http://www.oscss.org>
+ @version 2.2.0
+ @date 05/11/2013, 11:35
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+ @file edit.tab.detail.gab
+ @dir admin/includes/gabarit/quotation/
+*/
+global $price, $current_theme;
+
+
+?>
+
+ <?php echo tep_draw_form('status_form', quotation::FILENAME,'cID='.quotation::$Id.'&action=update_product', 'post', ' class="block_form"'); ?>
+ <div class="edit">
+ <table class="dataTableBase quotation">
+ <thead>
+ <tr>
+ <?php if(_cst_bool('MODULE_ACCOUNT_RETURN_PRODUCTS_STATUS')): ?>
+ <th><?php echo __('table heading return'); ?></th>
+ <?php endif; ?>
+ <th></th>
+ <th><?php echo __('table heading id'); ?></th>
+ <th><?php echo __('table heading products'); ?></th>
+ <th><?php echo __('table heading products model'); ?></th>
+
+
+ <th><?php echo __('table heading price excluding tax'); ?></th>
+ <th><?php echo __('table heading price including tax'); ?></th>
+ <th><?php echo __('table heading tax'); ?></th>
+ <th><?php echo __('table heading quantity'); ?></th>
+ <th><?php echo __('table heading total excluding tax'); ?></th>
+ <th><?php echo __('table heading total including tax'); ?></th>
+ </tr>
+ </thead>
+ <tbody>
+
+ <?php for ($i=0, $n=sizeof(quotation::$Info->products); $i<$n; $i++): $prod = quotation::$Info->products[$i] ; ?>
+ <tr>
+
+ <td class="tcenter"><?php echo (($prod['parent_id'] =='0' )? '' : $prod['parent_id'] ) ?></td>
+
+ <?php if(_cst_bool('MODULE_ACCOUNT_RETURN_PRODUCTS_STATUS')): ?>
+ <td><?php
+ //BEGIN RMA MODULE
+ $returns_check_query = tep_db_query("SELECT r.rma_value, rp.products_id FROM " . TABLE_RETURNS . " r, " . TABLE_RETURNS_PRODUCTS_DATA . " rp where r.returns_id = rp.returns_id and r.order_id = '" . quotation::$Id . "' and rp.products_id = '" . $prod['id'] . "' ");
+ if (!tep_db_num_rows($returns_check_query)){
+
+ if ($prod['return'] != '1') {
+ $return_link = '<a href="' . tep_href_link(FILENAME_RETURN_PRODUCT, 'order_id=' . quotation::$Id . '&products_id=' . ($prod['id']), 'NONSSL') . '">' . tep_image(DIR_WS_ICONS .'icon_rma_return.png', TEXT_SHEDULE_RETURN ).'</a>';
+ }
+ // if (quotation::$Infos_status !=DEFAULT_ORDERS_STATUS_COMPLETED ) $return_link = '';
+ } else {
+ $returns = tep_db_fetch_array($returns_check_query);
+ $return_link = '<a href=' . tep_href_link(FILENAME_RETURNS, 'cID=' . $returns['rma_value']) . '><font color=red><b><i>Returns</b></i></font></a>';
+ }
+ echo $return_link; ?>
+ </td>
+ <?php endif; ?>
+ <td class="tcenter">
+ <?php echo tep_draw_hidden_field('productId['.$i.']','productId_'.$i, $prod['id'], ' data-rowid="'.$i.'" class="cartOrder" ') ; ?>
+ <strong>
+ <a href="<?php echo tep_href_link(FILENAME_PRODUCTS, 'action=edit&pID='.$prod['id']) ?>"><?php echo (($prod['parent_id'] =='0' )? '' : ' ' ).$prod['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='.$prod['id']) ?>">
+ <?php echo (($prod['parent_id'] =='0' )? '' : ' ' ).$prod['name'] ?>
+ </a>
+ </span>
+ <span><?php echo tep_draw_attribute_products($prod['attributes'],$prod['qty'], quotation::$Info->info['currency'], quotation::$Info->info['currency_value']); ?></span>
+ </td>
+ <td class="tcenter"><?php echo $prod['model'] ?></td>
+ <td class="tright">
+ <?php if($prod['parent_id'] =='0' ) :?>
+ <?php echo $price->format($prod['final_price'], true, quotation::$Info->info['currency'], quotation::$Info->info['currency_value']) ?>
+ <?php else: ?>
+
+ <?php endif; ?>
+ </td>
+
+<!-- <td class="tright"><?php echo tep_draw_input_field('productFinalPrice['.$i.']','productFinalPrice_'.$i, $prod['final_price'], ' data-rowid="'.$i.'" class="cartOrder" ') ; ?></td> -->
+
+ <td class="tright">
+ <?php if($prod['parent_id'] =='0' ) :?>
+ <?php echo $price->format(tep_add_tax($prod['final_price'], $prod['tax']), true, quotation::$Info->info['currency'], quotation::$Info->info['currency_value']) ?>
+ <?php else: ?>
+
+ <?php endif; ?>
+ </td>
+ <td class="tcenter">
+ <?php if($prod['parent_id'] =='0' ) :?>
+ <?php echo tep_display_tax_value($prod['tax']) . '%' ?>
+ <?php else: ?>
+
+ <?php endif; ?>
+ </td>
+ <td class="tcenter">
+ <?php if($prod['parent_id'] =='0' ) :?>
+ <?php echo $prod['qty'] ?>
+ <?php else: ?>
+
+ <?php endif; ?>
+ </td>
+ <td class="tright">
+ <?php if($prod['parent_id'] =='0' ) :?>
+ <?php echo $price->format($prod['final_price'] * $prod['qty'], true, quotation::$Info->info['currency'], quotation::$Info->info['currency_value']) ?>
+ <?php else: ?>
+
+ <?php endif; ?>
+ </td>
+ <td class="tright">
+ <?php if($prod['parent_id'] =='0' ) :?>
+ <?php echo $price->format(tep_add_tax($prod['final_price'], $prod['tax']) * $prod['qty'], true, quotation::$Info->info['currency'], quotation::$Info->info['currency_value']) ?>
+ <?php else: ?>
+
+ <?php endif; ?>
+ </td>
+ </tr>
+ <?php endfor; ?>
+
+ <!-- Block Total -->
+ <?php for ($i = 0, $n = sizeof(quotation::$Info->totals); $i < $n; $i++) { ?>
+ <tr>
+ <?php if(_cst_bool('MODULE_ACCOUNT_RETURN_PRODUCTS_STATUS')): ?>
+ <td> </td>
+ <?php endif; ?>
+ <td colspan="9" class="tright"><?php echo quotation::$Info->totals[$i]['title'] ?></td>
+ <td class="tright"><?php echo quotation::$Info->totals[$i]['text'] ?></td>
+ </tr>
+ <?php } ?>
+ <!-- Block Total eof-->
+
+ </tbody>
+ </table>
+ <?php if( !in_array(quotation::$Info->info['quotation_status_id'], array(DEFAULT_ORDERS_STATUS_COMPLETED, DEFAULT_ORDERS_STATUS_ANNULATE ) ) ): ?>
+ <div class="button_nav">
+ <?php echo tep_image_submit('button_update.gif', IMAGE_UPDATE); ?>
+ </div>
+ <?php endif; ?>
+ </fieldset>
+ <br class="clear" />
+ </div>
+ </form>
+
Added: trunk/extensions/QUOTATION_stable/catalog/admin/includes/modules/pages/quotation.php
===================================================================
--- trunk/extensions/QUOTATION_stable/catalog/admin/includes/modules/pages/quotation.php (rev 0)
+++ trunk/extensions/QUOTATION_stable/catalog/admin/includes/modules/pages/quotation.php 2015-04-07 08:18:53 UTC (rev 5265)
@@ -0,0 +1,843 @@
+<?php if (!defined('HTTP_SERVER')) die('You can not access this file directly!');
+/**
+ @licence GPL 2005-2014 The osCSS developers - osCSS Open Source E-commerce
+ @package osCSS-2 <www http://www.oscss.org>
+ @version 2.2.0
+ @date 06/11/2013, 22:33
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+ @file adminAccount.php
+ @dir admin/includes/modules/pages/
+*/
+
+require_once(dirname(__FILE__).'/orders.php');
+
+/**
+ @class quotation
+ @extends orders
+*/
+class quotation
+ extends orders
+ {
+
+ const FILENAME = FILENAME_QUOTATION;
+
+ /**
+ @var Type of order
+ col type in table order
+ */
+ const TYPEOFORDER = 2;
+ /**
+ @var object detail commande , retour object class order
+ */
+ public static $order;
+ /**
+ @var array $quotation_status_array
+ */
+ public static $quotation_status_array=array();
+ /**
+ @var array $quotation_statuses
+ */
+ public static $quotation_statuses=array();
+
+ /**
+ @var integre current id
+ */
+ public static $Id;
+
+ /**
+ class constructor
+ */
+ public function __construct() {
+
+ global $language;
+ $oscss=oscss_cstr::getInstance();
+ $oscss->pile_file_lang(DIR_FS_ADMIN.DIR_WS_LANGUAGES.'/'.$language.'/Order.txt');
+
+
+ self::GetConf();
+ }
+ /**
+ @brief Load , adjust and define var environement exe for module
+ Is use in module and class abstract for init value config this module
+ */
+ public static function GetConf(){
+ global $languages_id;
+
+ self::$code=__CLASS__;
+ self::$datatype=__CLASS__;
+
+ self::$action=(isset($_REQUEST['action'])? (string)$_REQUEST['action'] : 'listing' );
+ self::$Id=(isset($_REQUEST['cID'])? $_REQUEST['cID'] : '' );
+ if(empty(self::$Id))
+ self::$Id=(isset($_REQUEST['oID'])? $_REQUEST['oID'] : '' );
+
+
+ /**
+ @remarks define var execution sql in GetDBValue()
+ */
+ if( !isset(self::$InitInfo['adjust']) )
+ self::$InitInfo['adjust']=array(
+ 'languages_id'=>$languages_id,
+ 'page'=>1,
+ 'rowbyp'=>10,
+ 'sOrder'=>'',
+ 'sWhere'=>'',
+ );
+
+ MGabCont::SetCurrentName(__CLASS__);
+
+ /**
+ @remarks not load if not first init
+ */
+ if(!defined('JSONSTATMENT')){
+ //! active datatable in ajax, precise les GET necessaire
+ define('JSONSTATMENT', 'ModTwo=true&mod=page&type='.self::$code.
+ (isset(parent::$action)?'&action='.parent::$action : '' ).
+ (isset(self::$Id)?'&oID='.self::$Id : '' )
+ );
+
+ //! detail item in ajax
+ define('AJAXSTATMENTDETAIL', 'mod=page&type='.self::$code);
+ }
+
+
+
+ $DB=Database::getInstance();
+ self::$quotation_statuses=array();
+ $quotation_status_query = $DB->query("select status_id, status_name from " . TABLE_STATUS . " where status_type='quotation' and language_id = '" . (int)$languages_id . "'");
+ while ($quotation_status = $quotation_status_query->fetchAssoc()) {
+ self::$quotation_statuses[] = array('id' => $quotation_status['status_id'], 'text' => $quotation_status['status_name']);
+ self::$quotation_status_array[$quotation_status['status_id']] = $quotation_status['status_name'];
+ }
+
+
+ /**
+ @remarks this define col theader title, and ajust html code
+ Just for Edit listing
+ */
+ self::$allfields = array(
+ 'o.orders_id' => array(
+ 'sort'=>true,
+ 'alias'=>'id',
+ 'text'=>__('orders table heading order id'),
+ 'width'=>'2%',
+ 'class'=>'tcenter',
+ 'default'=>true,
+ ),
+ 'o.customers_id' => array(
+ 'sort'=>true,
+ 'text'=> __('orders table heading customers'),
+ 'width'=>'20%',
+ 'class'=>'tleft',
+ 'default'=>true,
+ ),
+
+ 'ot.text' => array(
+ 'sort'=>true,
+ 'alias'=>'order_total',
+ 'text'=>__('orders table heading order total'),
+ 'default'=>true,
+ 'class'=>'tright',
+ ),
+ 'o.currency' => array(
+ 'sort'=>true,
+ 'text'=>__('orders table heading currency'),
+ 'default'=>true,
+ 'class'=>'tcenter',
+ ),
+ 's.status_name' =>array(
+ 'sort'=>true,
+ 'alias'=>'orders_status_name',
+ 'text'=> __('orders table heading status'),
+ 'width'=>'10%',
+ 'class'=>'tleft',
+ 'default'=>true,
+ ),
+ 'o.date_purchased' => array(
+ 'sort'=>true,
+ 'text'=>__('@quotation table heading date purchased'),
+ 'width'=>'10%',
+ 'class'=>'tcenter',
+ 'default'=>true,
+ ),
+ 'o.last_modified' => array(
+ 'sort'=>true,
+ 'text'=>__('orders table heading last modified'),
+ 'width'=>'10%',
+ 'class'=>'tcenter',
+ ),
+ 'o.payment_method' => array(
+ 'sort'=>true,
+ 'text'=>__('orders table heading payment'),
+ 'width'=>'12%',
+ 'class'=>'tcenter',
+ ),
+ 'o.ip_address' => array(
+ 'sort'=>true,
+ 'text'=> __('orders table heading ip_address'),
+ 'width'=>'10%',
+ 'class'=>'tcenter',
+ 'default'=>true,
+ ),
+ 'o.total_weight' => array(
+ 'sort'=>true,
+ 'text'=> __('orders table heading total_weight'),
+ 'width'=>'10%',
+ 'class'=>'tright',
+ 'default'=>true,
+ ),
+ 'o.class_payment' => array(
+ 'sort'=>true,
+ 'text'=> __('orders table heading class_payment'),
+ 'width'=>'10%',
+ 'class'=>'tcenter',
+ 'default'=>true,
+ ),
+ 'o.class_shipping' => array(
+ 'sort'=>true,
+ 'text'=> __('orders table heading class_shipping'),
+ 'width'=>'10%',
+ 'class'=>'tcenter',
+ 'default'=>true,
+ ),
+ );
+
+
+ /// @remarks min fields and not view directly colonne fields
+ $listfield = 'o.orders_id , o.orders_ref, o.orders_prefix, o.facture_id, o.facture_ref, s.status_color as orders_status_color,';
+
+ /// @remarks Active forms filter
+ $mutli=array();
+// $mutli[] = '<span class="fleft">'.__('action multiple') . ' ' . tep_draw_pull_down_menu('status_multi', array_merge(array(array('id' => '', 'text' => __('text action multiple orders'))), orders::$quotation_statuses) ) . __('export: ') . tep_draw_pull_down_menu('modeexport', orders::$export->mode ).'</span> <span class="fleft" style="margin-left:50px;"> '. tep_image_submit('button_confirm.gif', IMAGE_CONFIRM, '' ).'</span>' ;
+
+ /**
+ @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();
+ $tab['mod'][]=array(
+ 'title'=>__('orders filter tab clause'),
+ 'content'=>tep_get_include_contents('orders/filter.clause'),
+ );
+ $tab['mod'][]=array(
+ 'title'=>__('orders filter products tab clause'),
+ 'content'=>tep_get_include_contents(__CLASS__.'/filter.products'),
+ );
+ /**
+ @remarks this define menu master module in page
+ @note use $boutons[action][] = array(params)
+
+ params :
+ 'type'=>'getLink',
+ 'format'=>'button_nav',
+ 'image'=>'',
+ 'cssclass'=>'button',
+ 'title'=>__('image create new content'),
+ 'url'=>tep_href_link(self::FILENAME, 'action=new'),
+ */
+ $boutons = array();
+
+
+
+ /**
+ @remarks filter based on date_purchased orders
+ */
+ if(self::$view =='thisday'){
+ $_SESSION['filters'][__CLASS__]['dates']['start'] = date('Y-m-d');
+ $_SESSION['filters'][__CLASS__]['dates']['end'] = date('Y-m-d');
+ }
+ elseif(self::$view =='thisweek'){
+ $_SESSION['filters'][__CLASS__]['dates']['start'] = date('Y-m-d', time() - (7 * 24 * 3600));
+ $_SESSION['filters'][__CLASS__]['dates']['end'] = date('Y-m-d');
+ }
+
+ if(isset($_SESSION['filters'][__CLASS__]['dates']['start']))
+ $_SESSION['filters']['dates']['start'] = $_SESSION['filters'][__CLASS__]['dates']['start'].' 00:00:00';
+ else
+ $_SESSION['filters']['dates']['start'] = date('Y-m-d', time() - 7 * 24 * 60).' 00:00:00';
+
+ if(isset($_SESSION['filters'][__CLASS__]['dates']['end']))
+ $_SESSION['filters']['dates']['end'] = $_SESSION['filters'][__CLASS__]['dates']['end'].' 23:59:59';
+ else
+ $_SESSION['filters']['dates']['end'] = date('Y-m-d').' 23:59:59';
+
+ if(tep_not_null($_SESSION['filters']['dates']['start']))
+ self::$InitInfo['adjust']['sWhere'] .=" AND date_purchased >= '".tep_db_input($_SESSION['filters']['dates']['start'])."'";
+ if(tep_not_null($_SESSION['filters']['dates']['end']))
+ self::$InitInfo['adjust']['sWhere'] .=" AND date_purchased <= '".tep_db_input($_SESSION['filters']['dates']['end'])."'";
+
+
+
+ if(isset($_SESSION['filters'][__CLASS__]['products']))
+ self::$InitInfo['adjust']['sWhere'] .=" AND op.products_id= '".tep_db_input($_SESSION['filters'][__CLASS__]['products'])."'";
+
+
+
+ /**
+ 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);
+
+
+ global $oscss;
+ $oscss->_add_ext(BO_WISIWYG_SELECTED,'editeur/');
+ echo $oscss->_call(BO_WISIWYG_SELECTED,'_top','comments','800','400');
+
+ return true;
+ }
+
+
+
+
+ public function check_action($actions){
+ global $messageStack;
+ self::$action=$actions;
+ $DB=Database::getInstance();
+ switch (self::$action) {
+
+ /**
+ @remarks specific save in session value filters
+ */
+ case 'filters':
+ /*
+ Call Prev Process
+ */
+ self::actionFilter();
+
+
+ // date order
+ if(isset($_POST['filters']['dates']) ){
+ if( tep_not_null($_POST['filters']['dates']['start']))
+ $_SESSION['filters'][__CLASS__]['dates']['start'] = tep_date_raw(tep_db_prepare_input($_POST['filters']['dates']['start']));
+ if(tep_not_null($_POST['filters']['dates']['end']))
+ $_SESSION['filters'][__CLASS__]['dates']['end'] = tep_date_raw(tep_db_prepare_input($_POST['filters']['dates']['end']));
+ }
+
+
+ if(isset($_POST['filters']['products']) && $_POST['filters']['products'] > 0)
+ $_SESSION['filters'][__CLASS__]['products'] = tep_db_prepare_input($_POST['filters']['products']);
+ else
+ unset($_SESSION['filters'][__CLASS__]['products']);
+
+ tep_redirect(tep_href_link(self::FILENAME));
+ break;
+
+
+ case 'multi':
+ $res=array();
+ /**
+ Action mutliple
+ */
+ $status = tep_db_prepare_input(@$_POST['status_multi']);
+ $notify_comments = (isset($_POST['notify_comments'])) ? tep_db_prepare_input($_POST['notify_comments']) : '';
+ $notify =(isset($_POST['notify'])) ? tep_db_prepare_input($_POST['notify']): '';
+ $comments= (isset($_POST['comments'])) ? tep_db_prepare_input($_POST['comments']) :'';
+ if(isset($_POST['action_multi']) && is_array($_POST['action_multi']) ) {
+ if(isset($_POST['status_multi'])){
+ foreach($_POST['action_multi'] as $Id )
+ if (up_status_order($Id, array('status'=>$status,'comments'=>'', 'notify'=>$notify, 'notify_comments'=>$notify_comments , 'comments'=> $comments) ) ) $res[]=true;
+ else $res[]=false;
+ }
+ }
+
+ if (in_array(false,$res)) $messageStack->add_session(__('success order updated'), 'success');
+ else $messageStack->add_session(__('warning order not updated'), 'warning');
+
+ tep_redirect(tep_href_link(self::FILENAME));
+ break;
+
+ case 'update_product':
+ $Id = tep_db_prepare_input(self::$Id);
+
+
+ $res= sqlorder::fetch(array('id'=>self::$Id));
+// print_r($res);
+ foreach($_POST['productId'] as $linerow => $row) {
+//
+// $px_ht = $_POST['productFinalPrice'][$linerow];
+// $qty = $_POST['productTotHt'][$linerow];
+// $qty = $_POST['productQty'][$linerow];
+//
+// var_dump($linerow);
+ print_r($res->products[$linerow] );
+ $tmp = $res->products[$linerow];
+
+ $tmp['final_price'] = $_POST['productTotHt'][$linerow];
+ $tmp['qty'] = $_POST['productQty'][$linerow];
+ $res->products[$linerow] = $tmp;
+//
+
+// print_r($res->products[$linerow] );
+ }
+
+ sqlorder::update(array('id'=>$Id, 'products'=>$res->products ));
+// exit;
+
+ tep_redirect(tep_href_link(self::FILENAME, 'action=edit&cID='.$Id));
+ break;
+
+ case 'update_order':
+ $Id = tep_db_prepare_input(self::$Id);
+ $status = tep_db_prepare_input($_POST['status']);
+ $comments = tep_db_prepare_input($_POST['comments']);
+
+ $order_updated = false;
+ $check_status_query = $DB->query($sql ="select customers_name, customers_email_address, orders_status, date_purchased, ip_address from " . TABLE_ORDERS . " where orders_type='".TYPEOFORDER."' AND orders_id = '" . (int)$Id . "'");
+// echo $sql;
+ $check_status = $check_status_query->fetchAssoc();
+ if ($check_status['orders_status'] != $status || tep_not_null($comments)) {
+// $DB->query("update " . TABLE_ORDERS . " set orders_status = '" . tep_db_input($status) . "', last_modified = now() where orders_id = '" . (int)$Id . "'");
+
+ sqlorder::update(array('id'=>$Id,'status'=>tep_db_input($status),'type'=>'2' ));
+// var_dump(__file__);
+// exit;
+ $customer_notified = '0';
+ if (isset($_POST['notify']) && ($_POST['notify'] == 'on')) {
+ $notify_comments = '';
+ if (isset($_POST['notify_comments']) && ($_POST['notify_comments'] == 'on')) {
+ $notify_comments = sprintf(EMAIL_TEXT_COMMENTS_UPDATE, $comments) . "\n\n";
+ }
+
+ $myarray = array(
+ 'email_use_html'=>(($_POST['p_format'] == 'HTML')?true:false),
+ 'mail_sent_to'=>$mail_sent_to,
+ 'from'=>$from,
+ '_oID'=>$Id,
+ '_oLinks'=>tep_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $Id, 'SSL') ,
+ 'date_purchased'=>tep_date_long($check_status['date_purchased']),
+ 'notify_comments'=>$notify_comments,
+ '_ostatus'=>$quotation_status_array[$status],
+ 'subject'=>$subject,
+ 'message'=>$content
+ );
+
+ $message_final=tep_post_prepare_email("quotation.tpl",$language,$myarray);
+
+ if ( tep_mail($check_status['customers_name'], $check_status['customers_email_address'], EMAIL_TEXT_SUBJECT, $message_final, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS) !=false) $err=true;
+ else $err=false;
+ }
+
+ if(!$err) $DB->query("insert into " . TABLE_ORDERS_STATUS_HISTORY . " (orders_id, orders_status_id, date_added, customer_notified, comments) values ('" . (int)$Id . "', '" . tep_db_input($status) . "', now(), '" . $customer_notified . "', '" . tep_db_input($comments) . "')");
+
+ $order_updated = true;
+ }
+
+ if ($order_updated) {
+ $messageStack->add_session(SUCCESS_ORDER_UPDATED, 'success');
+ } else {
+ $messageStack->add_session(WARNING_ORDER_NOT_UPDATED, 'warning');
+ }
+
+ tep_redirect(tep_href_link(self::FILENAME) );
+ break;
+
+
+ /**
+ @remarks transforme held_order to order
+ */
+ case 'confirm_order':
+ if( (int)self::$Id > 0){
+ if( sqlorder::update(array('id'=>self::$Id,'type'=>'0')) )
+ $messageStack->add_session(__('success held order updated'), 'success');
+ }
+
+ tep_redirect(tep_href_link(self::FILENAME));
+ break;
+
+ /**
+ @remarks suppression de la pre-commande
+ */
+ case 'deleteconfirm':
+ $Id = tep_db_prepare_input($_GET['oID']);
+
+ if( (int)self::$Id > 0){
+ sqlorder::delete(array('id'=>$Id));
+ }
+ tep_redirect(tep_href_link(self::FILENAME));
+ break;
+
+ }
+
+ return self::$action;
+ }
+
+// public function get_header(){ return false; }
+
+ /**
+ @fn adminUsers::GetDBValue();
+ @brief return DB value adapted for current action
+ Use self::action for determine switch
+ @return
+ */
+ public static function GetDBValue(){
+
+ $DB= Database::getInstance();
+
+ switch (self::$action) {
+
+ case 'delete':
+// case 'recup_order':
+ if( (int)self::$Id > 0) {
+ $res = sqlorder::fetch(array('id'=>self::$Id ), true);
+ }
+ else{
+ $res = sqlorder::Specimen(true);
+ }
+
+ $res= self::FormatDBValue($res);
+
+ return $res;
+ break;
+
+
+// case 'delete';
+ case 'edit':
+
+// $cart = new shoppingCart();
+// print_r($cart);
+// exit;
+
+ $activ_add = array();
+// if(!$res)
+
+ $res= sqlorder::fetch(array('id'=>self::$Id));
+
+ if(!$res)
+ die('no load');
+
+ $res->history= self::load_status_history((int)self::$Id);
+ $res->lasthistory=$res->history[0];
+
+ $res->service = array();
+ $res->pshipping = array();
+ $pdt_db_arr = array();
+
+ /**
+ @brief loop for adjust rows products No physical (contract/abonnement/service) And physical product for shipping
+ */
+ foreach($res->products as $rows){
+ $pdt_db_arr[$rows['rowid']] = $rows;
+
+ $key_attrib='';
+ $light_attrib = array();
+
+ if(isset($rows['attributes']) && is_array($rows['attributes']))
+ foreach($rows['attributes'] as $attrib){
+ $key_attrib .= $attrib['option_id'].'-'.$attrib['value_id'].',';
+ $light_attrib[$attrib['option_id']] = $attrib['value_id'];
+ }
+
+ if(strlen($key_attrib)> 0)
+ $key_attrib = substr($key_attrib,0,-1);
+
+ /// No physical
+ if(in_array($rows['type'], explode(',', TYPE_VIRTUAL_PRODUCTS)) ){
+
+ $sql="SELECT cc.* ".
+ " FROM ".TABLE_SERVICES." cc ".
+ " WHERE cc.customers_id = '" . (int)$res->customer['id'] . "' AND cc.orders_id = '".(int)self::$Id ."' AND cc.orders_products_id = '".$rows['id']."' ".
+ " ORDER BY row_id DESC";
+
+ $_query2 = $DB->query($sql);
+
+ foreach($_query2->fetchAllAssoc() as $result){
+ $result['status_html']= self::GetServiceStatus($result, false);
+ $result['auto_retry_html']= self::GetServiceAutoRetry($result, false);
+ $res->service[]=new objectInfo(array_merge($rows,$result));
+ }
+ }
+
+ /// physical
+ else {
+
+ $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::$Id ."' AND cp.orders_products_id = '".$rows['rowid']."' AND cp.orders_products_attributes ='".$key_attrib."' ".
+ " GROUP BY orders_products_id ";
+ " ORDER BY row_id DESC";
+
+ $_query2 = $DB->query($sql);
+
+ $qt = 0;
+ if($_query2->__get('numRows')){
+ foreach($_query2->fetchAllAssoc() as $result){
+ $qt = (int)$result['qt'];
+ $result['qt_expedie'] = $qt;
+ $result['qt_orders'] = $rows['qty'];
+ $result['attrib'] = $light_attrib;
+ $robj = new objectInfo(array_merge($rows,$result));
+ $activ_add[] = ( ( (int)$rows['qty'] <= $qt) ? false : true );
+ $res->pshipping[]=$robj;
+ }
+ }
+ else{
+ $rows['qt_expedie'] = 0;
+ $result['qt_orders'] = $rows['qty'];
+ $result['key_attrib'] = $key_attrib;
+ $result['attrib'] = $light_attrib;
+ $res->pshipping[]=new objectInfo(array_merge($rows,$result));
+ $activ_add[] = true;
+ }
+ }
+ }
+
+ $result4 = sqlshipping::fetch(array('orders_id'=>(int)self::$Id ), true);
+
+ if(!$result4)
+ $res->allshipping = false;
+ elseif(is_array($result4))
+ $res->allshipping = $result4;
+ else
+ $res->allshipping[] = $result4;
+
+ /*
+ Display block in html content
+ */
+ $res->display_service = (count($res->service) <= 0 )? false : true;
+ $res->display_shipping = (count($res->pshipping) <= 0 )? false : true;
+ $res->display_shipping_add = (in_array(true, $activ_add))? true : false;
+
+ $res->prd_db_byid = $pdt_db_arr;
+
+// die('no load');
+ return $res;
+ break;
+
+ case 'listing':
+ default:
+
+ /**
+ @remarks retrun object load one inventaire
+ */
+ global $query_numrows, $languages_id;
+ $adjust=new objectInfo(self::$InitInfo['adjust']);
+
+
+ /**
+ @remarks replace id by name col
+ */
+ if(!empty($adjust->sWhere)) {
+
+ foreach(self::$allfields as $key=>$row){
+ if(is_array($row) && isset($row['alias']) ){
+ $k[] = '#[(]'.$row['alias'].'[)]#i';
+ $k[] = '# '.$row['alias'].' #i';
+ $k[] = '# \.'.$row['alias'].'#i';
+
+ $v[] = '('.$key.')';
+ $v[] = ' '.$key.' ';
+ $v[] = '.'.$key.' ';
+ }
+ }
+
+ if(isset($k))
+ $adjust->sWhere = preg_replace($k,$v, $adjust->sWhere);
+ }
+
+ $query_raw = "SELECT DISTINCT ".$adjust->listfields.
+ " FROM " . TABLE_ORDERS . " o ".
+ " LEFT JOIN " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id) ".
+ " LEFT JOIN " . TABLE_ORDERS_PRODUCTS . " op on (op.orders_id = o.orders_id) ".
+ " LEFT JOIN " . TABLE_STATUS . " s ON(o.orders_status = s.status_id and s.status_type='quotation' and s.language_id = '" . (int)$adjust->languages_id . "') ".
+ " WHERE o.orders_type ='".self::TYPEOFORDER."' AND ot.class = 'ot_total' ".$adjust->sWhere.
+ " ORDER BY ".((!empty($adjust->sOrder)) ? $adjust->sOrder : 'o.orders_id DESC');
+// echo $query_raw;
+// exit ;
+ $_split = new splitPageResults($adjust->page, $adjust->rowbyp, $query_raw, $query_numrows);
+
+ $_query = $DB->query($query_raw);
+
+ $res=self::FormatDBValue($_query);
+
+ return $res;
+ }
+ }
+
+
+
+ public function display_view(){
+ $action=self::$action;
+ $MG = false;
+// echo self::$action;
+ switch (self::$action) {
+// case 'delete':
+// $MG = true;
+// case 'recup_order':
+// self::$Info=self::GetDBValue();
+// break;
+//
+// case 'confirm_order':
+// tep_confirm_held_order(self::$Id);
+// return ;
+// break;
+
+ case 'delete':
+ case 'copy_to':
+ $MG= false;
+// if(!self::test_cID((int)self::$Id))
+ break;
+
+
+ case 'edit':
+ $MG= false;
+
+ self::$Info=self::GetDBValue();
+
+
+
+ self::AddTabs( new TabsListeners(
+ __('@'.__CLASS__.' tab data') ,
+ MGabCont::CallGab('generic','edit.tab',__CLASS__)
+ ) );
+
+
+ self::AddTabs( new TabsListeners(
+ __('@'.__CLASS__.' tab details') ,
+ MGabCont::CallGab('product','edit.tab',__CLASS__)
+ ) );
+
+
+// $tab = new TabsListeners(
+// __('@'.__CLASS__.' tab history') ,
+// MGabCont::CallGab('history','edit.tab',__CLASS__)
+// );
+//
+// self::AddTabs( $tab );
+
+// if(orders::$Info->display_shipping ){
+// $tab = new TabsListeners(
+// __('@'.__CLASS__.' tab shipping') ,
+// MGabCont::CallGab('shipping','edit.tab',__CLASS__)
+// );
+//
+// self::AddTabs( $tab );
+// }
+
+// if(orders::$Info->display_service) {
+// $tab = new TabsListeners(
+// __('@'.__CLASS__.' tab service') ,
+// MGabCont::CallGab('service','edit.tab',__CLASS__)
+// );
+//
+// self::AddTabs( $tab );
+// }
+
+ ModTreePage::GenericDisplay($action);
+
+// break;
+ break;
+
+ default:
+ $MG = true;
+ self::$list=self::tep_get_list();
+
+// if(empty(self::$action))
+ $action='listing';
+ }
+// var_dump($MG);
+ /// use master gabarit
+ if($MG)
+ return MGabCont::CallGab($action,__FUNCTION__,self::MASTER);
+ else
+ return MGabCont::CallGab($action,__FUNCTION__,__CLASS__);
+
+// die('no load');
+ }
+
+
+
+/** Iterne public module */
+
+
+
+ public static function ButtonRowsActions($orders){
+ return parent::GenericRowsActions($orders, 'ed', '', '');
+// }
+// return sprintf(
+// CsrtAction::getFormat('row_action'),
+// '' ,
+// sprintf(CsrtAction::getLink('row_action_right', __('image recup help order'), 'heldorder'), 'fancy', tep_href_link(self::FILENAME, 'oID=' . $orders['oID'] . '&action=recup_order') ,'' ).
+// sprintf(CsrtAction::getLink('row_action_right', IMAGE_DELETE, 'delete'), 'fancy', tep_href_link(self::FILENAME, 'oID=' . $orders['oID'] . '&action=delete') ,'' )
+// );
+ }
+
+ /**
+ @brief format db value for display page
+ @param $_query ressource db sql
+ @return array
+ */
+ protected static function FormatDBValue($_query){
+ $DB=Database::getInstance();
+ $datadocs=new DatasFiles;
+ $res=array();
+
+ switch (self::$action) {
+ case 'listing':
+ while ($orders = $_query->fetchAssoc()) {
+
+ $orders['oID']=$orders['orders_id'];
+ $orders[1]=tep_draw_checkbox_field('action_multi['.$orders['orders_id'].']','action_mutli_'.$orders['orders_id'],$orders['orders_id'], '','',' class="multi" ');
+
+ foreach(self::$InitInfo['modele']['listing'] as $k=>$row){
+ if( ($value = self::FormatDBValueRow($k, $orders)) && $value !=false )
+ $ord[$k]= $value;
+ elseif($k == 'order_total') $ord[$k]=strip_tags($orders['order_total']);
+ elseif($k == 'customers_id') $ord[$k]=tep_customers_row_action($orders['customers_id'], array('origin'=>self::FILENAME));
+ elseif($k == 'date_purchased') $ord[$k]=tep_datetime_short($orders['date_purchased']);
+ elseif($k == 'last_modified') $ord[$k]=tep_datetime_short($orders['last_modified']);
+ elseif($k == 'orders_status_name')
+ $ord[$k]=sprintf( CsrtAction::getFormat('type_color'), " border-left: 15px solid ".$orders['orders_status_color'], $orders['orders_status_name'] );
+ else $ord[$k]=$orders[$k];
+ }
+
+ $ord[0]=$orders['orders_id'];
+ $res[]=$ord;
+ }
+ break;
+
+ default:
+ $res = parent::FormatDBValueDefault($_query);
+ }
+
+ return $res;
+ }
+
+ /** static InterfacedInnerHtml */
+
+ public static function detail_row_page($id){
+ include(DIR_WS_FUNCTIONS.'lib.orders.php');
+ self::$order=new order((int)$id, '');
+
+ return MGabCont::CallGab('inline','display_view',__CLASS__);
+ }
+
+ /**
+ @brief return Filename
+ */
+ public static function GetFILENAME(){
+ return self::FILENAME;
+ }
+
+
+}
+
+?>
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|