fix conflicts

This commit is contained in:
Marion Muszynski 2016-11-24 16:05:44 +01:00
commit 3ecf54cfcc
4 changed files with 179 additions and 16 deletions

View File

@ -110,6 +110,7 @@ class AdminCustomerThreads extends AdminTab
{
$statusArray = array(1 => 'open', 2 => 'closed', 3 => 'pending1', 4 => 'pending2');
Db::getInstance()->Execute('UPDATE '._DB_PREFIX_.'customer_thread SET status = "'.$statusArray[$id_status].'" WHERE id_customer_thread = '.(int)$id_customer_thread.' LIMIT 1');
Tools::redirectAdmin($currentIndex.'&token='.Tools::getValue('token'));
}
if (isset($_POST['id_employee_forward']))
{
@ -1047,14 +1048,14 @@ class AdminCustomerThreads extends AdminTab
<h2>'.$this->l('Messages').'</h2>
<div class="btn-action">';
if ($nextThread)
echo $this->displayButton('
<a href="'.$currentIndex.'&id_customer_thread='.(int)$nextThread.'&viewcustomer_thread&token='.$this->token.'">
'.$this->l('Answer to the next unanswered message in this category').' &gt;
</a>');
else
echo $this->displayButton('
<span class="non-action"><span class="anticon anticon-tick">&#xea10;</span> '.$this->l('The other messages in this category have been answered').'</span>');
// if ($nextThread)
// echo $this->displayButton('
// <a href="'.$currentIndex.'&id_customer_thread='.(int)$nextThread.'&viewcustomer_thread&token='.$this->token.'">
// '.$this->l('Answer to the next unanswered message in this category').' &gt;
// </a>');
// else
// echo $this->displayButton('
// <span class="non-action"><span class="anticon anticon-tick">&#xea10;</span> '.$this->l('The other messages in this category have been answered').'</span>');
if ($thread->status != "closed")
echo $this->displayButton('

View File

@ -3449,9 +3449,9 @@ form.form-forward-message .button:focus{
display: block;
width: auto;
height: 100%;
line-height: 48px;
line-height: 35px;
padding-left: 10px;
padding-right: 55px;
padding-right: 40px;
text-align: left;
}
.btn-action-message p a.active,
@ -3467,7 +3467,7 @@ form.form-forward-message .button:focus{
position: absolute;
top: 6px;
right: 10px;
font-size: 35px;
font-size: 25px;
opacity: 0.5;
}
.panel-message{

View File

@ -0,0 +1,124 @@
<?php
include(dirname(__FILE__).'/../../config/config.inc.php');
require_once(dirname(__FILE__).'../../../init.php');
include_once(dirname(__FILE__).'/../../modules/blockordersummary/blockordersummary.php');
global $cookie;
global $smarty;
if(isset($_GET['id_order']) && isset($_GET['tokenAddress']) && isset($_GET['tokenOrder'])) {
$module = new BlockOrderSummary();
$order = new Order((int)$_GET['id_order']);
$cart = new Cart((int)$order->id_cart);
$data = $module->getOrderDetail($cart,(int)$cart->id_lang,$order);
$status = array(
2 => array('anticon-credit-card','text-green-light'),
4 => array('anticon-truck','text-purple-light'),
5 => array('anticon-home3','text-purple'),
6 => array('anticon-blocked','text-rose'),
7 => array('anticon-blocked','text-rose'),
8 => array('anticon-blocked','text-rose'),
17 => array('anticon-truck','text-orange'),
18 => array('anticon-warning','text-orange'),
19 => array('anticon-pause','text-orange'),
);
$currency = new Currency((int)(Configuration::get('PS_CURRENCY_DEFAULT')));
$currentState = OrderHistory::getLastOrderState((int)$order->id);
$addressDelivery = new Address($order->id_address_delivery, (int)($cart->id_lang));
$addressInvoice = new Address($order->id_address_invoice, (int)($cookie->id_lang));
$shipping_numbers = Db::getInstance()->ExecuteS('
SELECT DISTINCT lpws.`shipping_number`, lpws.`date_add`
FROM `'._DB_PREFIX_.'lapostews` lpws
LEFT JOIN `'._DB_PREFIX_.'order_detail` od ON (od.`id_order_detail` = lpws.`id_order_detail`)
WHERE `id_order` ='. (int)$order->id
);
$shipping_numbers2 = Db::getInstance()->ExecuteS('
SELECT DISTINCT ppp.`shipping_number`, ppp.`date_add`
FROM `'._DB_PREFIX_.'philea_parcel` ppp
LEFT JOIN `'._DB_PREFIX_.'order_detail` od ON (od.`id_order_detail` = ppp.`id_order_detail`)
WHERE od.`id_order` ='. (int)$order->id
);
//$carrier_socol = array(38,40,45);// local
//$carrier_socol = array(45,47,48);// dev
$carrier_socol = array(87,88,89);// prod
$html = '<h4>Récapitulatif <a target="_blank" href="?tab=AdminOrders&id_order='.(int)$order->id.'&vieworder&token='.$_GET['tokenOrder'].'">(#'.(int)$order->id.')</a></h4>
<div class="order-info">
<h5>Statut de la commande</h5>
<p class="'.$status[$currentState->id][1].'"><span class="anticon '.$status[$currentState->id][0].'"></span> <b>'.$currentState->name.'</b></p>';
if(count($shipping_numbers) > 0 || count($shipping_numbers2) > 0) {
$html .= '<h5>Numéros de suivi</h5>';
if(count($shipping_numbers) > 0){
foreach ($shipping_numbers as $key => $number) {
$date = new DateTime($number['date_add']);
$html .= '<p>'. $number['shipping_number'] .' ajouté le '. $date->format('d/m/Y') .'</p>';
}
}
if(count($shipping_numbers2) > 0){
foreach ($shipping_numbers2 as $key => $number) {
$date = new DateTime($number['date_add']);
$html .= '<p>'. $number['shipping_number'] .' ajouté le '. $date->format('d/m/Y') .'</p>';
}
}
}
$html .= '</div>
<div class="my-cart">
<h5>Produits</h5>
<ul>';
foreach ($cart->getProducts() as $key => $product) {
$html .= '<li>'.$product['quantity'].' x '.mb_strimwidth($product['name'], 0, 35, "...").' <span class="price">'.Tools::displayPrice($product['total_wt'],$currency).'</span></li>';
}
$html .= '</ul>
<p>Total produits <span class="price price_total">'.Tools::displayPrice($cart->getOrderTotal(TRUE,1),$currency).'</span></p>';
if ($cart->getOrderTotal(TRUE, 2) != 0){
$html .= '<p>Total réduction <span class="price price_total">'.Tools::displayPrice($cart->getOrderTotal(TRUE,2),$currency).'</span></p>';
}
$html .= '</div>
<div>
<h5>Transport</h5>
<p class="carrier-info"><span class="carrier-name">'.$data['carrier_name'].'</span> <span class="price price_total">'.Tools::displayPrice($cart->getOrderTotal(TRUE, 5),$currency).'</span></p>
</div>
<div>
<h5>Délai de livraison </h5>
<p class="delivery-delay">'.$data['delay_name'].'</p>';
if(isset($data['delivery_date'])){
foreach($data['delivery_date'] as $k => $date) {
if($k == 1) {
$html .= '<p class="delivery-date">
Date de réception prévue entre le <strong>'.$date['date_start']->format('d/m/Y').'</strong> et le <strong>'.$date['date_end']->format('d/m/Y').'</strong>
</p>';
} elseif ($k == 5){
$html .= '<p class="delivery-date">Livraison prévue avant le <strong>24/12</strong></p>';
}
}
}
$html .= '</div>
<div>
<h5>Adresse de livraison '.
(
($currentState->id != 8 && $currentState->id != 18 && in_array((int)$cart->id_carrier, $carrier_socol))
?'<a id="modif_address" data-url="scaddressedit.php?id_cart='.(int)$order->id_cart.'"><span class="anticon anticon-pencil" style="font-size: 16px; vertical-align: baseline;cursor:pointer;"></span></a>'
:(
($currentState->id != 8 && $currentState->id != 18 && !in_array((int)$cart->id_carrier, $carrier_socol))
?'<a href="?tab=AdminAddresses&id_address='.$addressDelivery->id.'&addaddress&realedit=1&id_order='.$order->id.($addressDelivery->id == $addressInvoice->id ? '&address_type=1' : '').'&token='.$_GET['tokenAddress'].'&back='.urlencode($_SERVER['REQUEST_URI']).'"><span class="anticon anticon-pencil" style="font-size: 16px; vertical-align: baseline;cursor:pointer;"></span></a>'
:''
)
).
'</h5>
<p class="address">'.$data['order_address'].'</p>
</div>
<div>
<h5>Paiement</h5>
<p class="order_total">Total à régler <span class="price price_total">'.Tools::displayPrice($cart->getOrderTotal(TRUE),$currency).'</span></p>
</div>';
if(!empty($html)) {
echo $html;
die();
} else {
echo '<p>Order not found</p>';
die();
}
} else {
echo '<p>An error occured, order not found.</p>';
die();
}
die();

View File

@ -71,7 +71,14 @@ class BlockOrderSummary extends Module {
public function hookRightColumnSav($params) {
global $cookie;
if(isset($params['order'])) {
if(isset($params['customer'])) {
$orders = Order::getCustomerOrders($params['customer']->id);
}
if(!empty($orders)) {
if(!isset($params['order'])) {
$params['order'] = new Order((int)$orders[0]['id_order']);
}
$cart = new Cart((int)$params['order']->id_cart);
$data = $this->getOrderDetail($cart,(int)$cart->id_lang,$params['order']);
@ -80,6 +87,7 @@ class BlockOrderSummary extends Module {
width: 300px;
background: #fff;
padding-bottom: 5px;
padding-top: 5px;
margin-bottom: 20px;
-moz-box-shadow: 1px 1px 2px 2px #cccccc;
-webkit-box-shadow: 1px 1px 2px 2px #ccc;
@ -171,6 +179,7 @@ class BlockOrderSummary extends Module {
4 => array('anticon-truck','text-purple-light'),
5 => array('anticon-home3','text-purple'),
6 => array('anticon-blocked','text-rose'),
7 => array('anticon-blocked','text-rose'),
8 => array('anticon-blocked','text-rose'),
17 => array('anticon-truck','text-orange'),
18 => array('anticon-warning','text-orange'),
@ -198,6 +207,13 @@ class BlockOrderSummary extends Module {
//$carrier_socol = array(87,88,89);// prod
echo '<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<div id="blockordersummary">
<div style="margin:10px auto;" class="styled-select semi-square bg-purple-light">
<select name="summary_id_order" id="summary_id_order" class="">';
foreach ($orders as $key => $order) {
echo '<option value="'.$order['id_order'].' '.((int)$order['id_order'] == (int)$params['order']->id ? 'selected="selected"' : '').'">Commande #'.$order['id_order'].'</option>';
}
echo '</select>
</div>
<div class="content">
<h4>'.$this->l('Summary of my order' ).' <a target="_blank" href="?tab=AdminOrders&id_order='.(int)$params['order']->id.'&vieworder&token='.$tokenOrders.'">(#'.(int)$params['order']->id.')</a></h4>
<div class="order-info">
@ -277,6 +293,21 @@ class BlockOrderSummary extends Module {
var p = window.open(url, "Modification SoColissimo", "width=720, height=360, resizable=1, scrollbars=1");
return false;
});
$(\'#summary_id_order\').change(function() {
$.ajax({
url: \''._MODULE_DIR_.'blockordersummary/ajax.php'.'\',
type: \'GET\',
data: \'id_order=\' + $(this).val() + \'&tokenOrder='.$tokenOrders.'&tokenAddress='.Tools::getAdminToken('AdminAddresses'.(int)(Tab::getIdFromClassName('AdminAddresses')).(int)($cookie->id_employee)).'\',
success: function(html) {
$(\'#blockordersummary .content\').empty();
$(\'#blockordersummary .content\').html(html);
},
error: function(xhr) {
console.log(JSON.parse(xhr.responseText));
}
});
});
});
</script>';
}
@ -293,6 +324,7 @@ class BlockOrderSummary extends Module {
SELECT *
FROM `'._DB_PREFIX_.'socolissimo_delivery_info`
WHERE `id_cart` = '.(int) $cart->id.'
AND `cecountry` = "FR"
');
if($order == null && (int) $cart->id_carrier == 87) {
$DOM_front = true;
@ -318,12 +350,18 @@ class BlockOrderSummary extends Module {
))));
$is_socol = true;
} else {
$is_socol = false;
$order_address = nl2br(AddressFormat::generateAddress(new Address((int) $cart->id_address_delivery)));
if($order) {
$order_address = nl2br(AddressFormat::generateAddress(new Address((int) $order->id_address_delivery)));
} else {
$order_address = nl2br(AddressFormat::generateAddress(new Address((int) $cart->id_address_delivery)));
}
}
} else {
$is_socol = false;
$order_address = nl2br(AddressFormat::generateAddress(new Address((int) $cart->id_address_delivery)));
if($order) {
$order_address = nl2br(AddressFormat::generateAddress(new Address((int) $order->id_address_delivery)));
} else {
$order_address = nl2br(AddressFormat::generateAddress(new Address((int) $cart->id_address_delivery)));
}
}
if ($id_lang == 3 && (int)$cart->id_carrier == 87) {