Merge branch 'develop' of gitlab.antadis.net:dev-antadis/bebeboutik into develop

This commit is contained in:
root 2017-05-17 17:25:27 +02:00
commit 237d078671

View File

@ -633,18 +633,16 @@ class AdminAntReturnprocess extends AdminTab
<div class="clearfix"></div>
</div>
<div class="panel-content">
<div class="row">
<div class=col-md-6>';
$return_link = Db::getInstance()->getRow('
SELECT `return_number`, `link`
FROM `'._DB_PREFIX_.'order_return_link`
WHERE `id_order_return` = '.(int) $id_order_return.'
');
$html .= '<p class="text-purple-dark" style="font-weight:bold;"><span class="anticon anticon-qrcode"></span> Lien retour Etiquette MR : '.($return_link? '<a style="color:#444;" href="'.$return_link['link'].'" onclick="window.open(this.href); return false;">'.$return_link['return_number'].'</a> <a class="text-purple-dark" title="Renvoyer les instructions retour" href="'.$currentIndex.'&send_return_instruction=1&updateorder_return&id_order_return='.$id_order_return.'&id_order='.(int)$order->id.'&token='.$this->token.'"><i class="glyphicon glyphicon-send"></i></a>':'Pas de lien retour').'<p>';
$html .='</div>
</div>
<div class="row">
<div class="col-md-6">
<div>';
$return_link = Db::getInstance()->getRow('
SELECT `return_number`, `link`
FROM `'._DB_PREFIX_.'order_return_link`
WHERE `id_order_return` = '.(int) $id_order_return.'
');
$html .= '<p class="text-purple-dark" style="font-weight:bold;"><span class="anticon anticon-qrcode"></span> Lien retour Etiquette MR : '.($return_link? '<a style="color:#444;" href="'.$return_link['link'].'" onclick="window.open(this.href); return false;">'.$return_link['return_number'].'</a> <a class="text-purple-dark" title="Renvoyer les instructions retour" href="'.$currentIndex.'&send_return_instruction=1&updateorder_return&id_order_return='.$id_order_return.'&id_order='.(int)$order->id.'&token='.$this->token.'"><i class="glyphicon glyphicon-send"></i></a>':'Pas de lien retour').'<p>';
$html .= '</div>
<table class="table">
<thead>
<tr>
@ -686,13 +684,12 @@ class AdminAntReturnprocess extends AdminTab
</table>
</div>
<div class="col-md-offset-2 col-md-4">
<form action="'.$currentIndex.'&submitAddorder_return=1&updateorder_return&id_order_return='.(int)$orderReturn->id.'&token='.$this->token.'" method="post">
'.($orderReturn->id ? '<input type="hidden" name="id_'.$this->table.'" value="'.$orderReturn->id.'" />' : '').'
<h5 style="background:#504D8B;color:#fff;padding:5px; text-align:center;">'.$this->l('Changer le statut du retour').'</h5>
<form style="padding:10px 20px;background:#efefef;" action="'.$currentIndex.'&submitAddorder_return=1&updateorder_return&id_order_return='.(int)$orderReturn->id.'&token='.$this->token.'" method="post">
<input type="hidden" name="id_order" value="'.$orderReturn->id_order.'" />
<input type="hidden" name="id_order_return" value="'.$orderReturn->id.'" />
<input type="hidden" name="id_customer" value="'.$orderReturn->id_customer.'" />
<div class="form-group">
<label>'.$this->l('Statut').'</label>
<select class="form-control" name="state">';
$states = OrderReturnState::getOrderReturnStates($cookie->id_lang);
foreach ($states as $state) {
@ -700,8 +697,8 @@ class AdminAntReturnprocess extends AdminTab
}
$html .= '</select>
</div>
<div class="form-group text-right">
<input type="submit" class="btn btn-primary" name="submitAddorder_return" value="Mettre à jour">
<div class="form-group">
<input type="submit" class="btn btn-primary btn-block" name="submitAddorder_return" value="Mettre à jour">
</div>
</form>
</div>
@ -922,127 +919,124 @@ class AdminAntReturnprocess extends AdminTab
<input type="submit" name="submitOrderState" value="'.$this->l('Change').'" class="btn btn-primary btn-block" />
</form>
</div>
<!--div class="col-md-6">
<h5 style="background:#504D8B;color:#fff;padding:5px; text-align:center;">'.$this->l('Remboursement de la commande').'</h5>
<form style="padding:10px 20px;background:#efefef;" class="text-center center" action="'.$currentIndex.'&submitRefund=1&token='.$this->token.'" method="post">
<div class="form-group">
<select class="form-control" name="refund_type">
<option value="1">Paypal</option>
<option value="2">CB</option>
</select>
</div>
<input type="hidden" name="id_order" value="'.$order->id.'" />
<input type="hidden" name="id_order_return" value="'.$orderReturn->id.'" />
<input type="submit" name="submitRefund" value="'.$this->l('Rembourser').'" class="btn btn-primary btn-block" />
</form>
</div-->
</div>
</div>
</div>
</div>
</div>
<div class="panel">
<div class="panel-title">
<h2><span class="anticon anticon-box-remove"></span> Renvoyer un colis</h2>
<div class="clearfix"></div>
</div>
<div class="panel-content">
<div class="row">
<div class="col-md-12">
EN COURS DE DEVELOPPEMENT !
</div>
</div>
</div>
</div>
</div>
<div class="col-md-4">
<div class="row">
<div class="panel col-md-12">
<div class="panel-title">
<h2><span class="anticon anticon-bubbles2"></span> SAV '.(isset($thread)?'<a href="index.php?tab=AdminCustomerThreads&id_customer_thread='.(int)($thread->id).'&viewcustomer_thread&token='.Tools::getAdminTokenLite('AdminCustomerThreads').'" title=Voir la conversation"> Conversation #'.(int)($thread->id).'</a>':'').'</h2>
<div class="clearfix"></div>
</div>
<div class="panel-content">
<div class="row">
<div class="col-md-12">';
if(isset($thread)){
if($thread->id_order == $orderReturn->id_order) {
$products = Db::getInstance()->ExecuteS('
SELECT spc.*, pl.`name`
FROM `'._DB_PREFIX_.'support_product_customerthread` spc
LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (pl.`id_product` = spc.`id_product`)
WHERE spc.`id_customer_thread` = '.(int)$thread->id.'
AND pl.`id_lang` = 2'
);
if($products && !empty($products)) {
$html .='<h5 style="background:#504D8B;color:#fff;padding:5px; text-align:center;">Produit(s) Concerné(s)</h5>';
foreach ($products as $product) {
$img_path = '';
$img = Db::getInstance()->getRow('
SELECT id_image
FROM `'._DB_PREFIX_.'image` i
WHERE i.`id_product` = '.(int)$product['id_product'].'
AND i.`cover` = 1'
);
if (isset($img['id_image']) && !empty($img['id_image'])) {
$image_obj = new Image((int)$img['id_image']);
$img_path = (isset($image_obj)?$image_obj->getExistingImgPath():'');
}
$html .='
<a style="background:#EFEFEF;padding:5px;display: block;color:#444;" target="_blank" href="index.php?tab=AdminCatalog&id_product='.(int)($product['id_product']).'&updateproduct&token='.Tools::getAdminToken('AdminCatalog'.(int)(Tab::getIdFromClassName('AdminCatalog')).(int)($cookie->id_employee)).'" title="'.$this->l('View product').'">
<img style="display:inline-block;" width="62" src="'.(isset($img_path)?_THEME_PROD_DIR_.$img_path.'-small.jpg':'').'"/><span style="font-weight:bold;display:inline-block;margin-left:5px;width:210px;vertical-align:middle;">'.mb_strimwidth($product['name'], 0, 55, "...").'</span>
<div class="clearfix"></div>
</a>';
<div class="panel">
<div class="panel-title">
<h2><span class="anticon anticon-bubbles2"></span> SAV '.(isset($thread)?'<a href="index.php?tab=AdminCustomerThreads&id_customer_thread='.(int)($thread->id).'&viewcustomer_thread&token='.Tools::getAdminTokenLite('AdminCustomerThreads').'" title=Voir la conversation"> Conversation #'.(int)($thread->id).'</a>':'').'</h2>
<div class="clearfix"></div>
</div>
<div class="panel-content">
<div class="row">
<div class="col-md-12">';
if(isset($thread)){
if($thread->id_order == $orderReturn->id_order) {
$products = Db::getInstance()->ExecuteS('
SELECT spc.*, pl.`name`
FROM `'._DB_PREFIX_.'support_product_customerthread` spc
LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (pl.`id_product` = spc.`id_product`)
WHERE spc.`id_customer_thread` = '.(int)$thread->id.'
AND pl.`id_lang` = 2'
);
if($products && !empty($products)) {
$html .='<h5 style="background:#504D8B;color:#fff;padding:5px; text-align:center;">Produit(s) Concerné(s)</h5>';
foreach ($products as $product) {
$img_path = '';
$img = Db::getInstance()->getRow('
SELECT id_image
FROM `'._DB_PREFIX_.'image` i
WHERE i.`id_product` = '.(int)$product['id_product'].'
AND i.`cover` = 1'
);
if (isset($img['id_image']) && !empty($img['id_image'])) {
$image_obj = new Image((int)$img['id_image']);
$img_path = (isset($image_obj)?$image_obj->getExistingImgPath():'');
}
$html .='
<a style="background:#EFEFEF;padding:5px;display: block;color:#444;" target="_blank" href="index.php?tab=AdminCatalog&id_product='.(int)($product['id_product']).'&updateproduct&token='.Tools::getAdminToken('AdminCatalog'.(int)(Tab::getIdFromClassName('AdminCatalog')).(int)($cookie->id_employee)).'" title="'.$this->l('View product').'">
<img style="display:inline-block;" width="62" src="'.(isset($img_path)?_THEME_PROD_DIR_.$img_path.'-small.jpg':'').'"/><span style="font-weight:bold;display:inline-block;margin-left:5px;width:210px;vertical-align:middle;">'.mb_strimwidth($product['name'], 0, 55, "...").'</span>
<div class="clearfix"></div>
</a>';
}
}
if($last_message){
$html .='<h5 style="background:#504D8B;color:#fff;padding:5px; text-align:center;">Dernier Message '.($thread->id_order != $orderReturn->id_order?'<br/><i>(Ne concerne pas cette commande)</i>':'').'</h5>';
$last_message['message'] = preg_replace('/(https?:\/\/[a-z0-9#%&_=\(\)\.\? \+\-@\/]{6,1000})([\s\n<])/Uui', '<a href="\1">\1</a>\2', html_entity_decode($last_message['message'], ENT_NOQUOTES, 'UTF-8'));
}
if($last_message){
$html .='<h5 style="background:#504D8B;color:#fff;padding:5px; text-align:center;">Dernier Message '.($thread->id_order != $orderReturn->id_order?'<br/><i>(Ne concerne pas cette commande)</i>':'').'</h5>';
$last_message['message'] = preg_replace('/(https?:\/\/[a-z0-9#%&_=\(\)\.\? \+\-@\/]{6,1000})([\s\n<])/Uui', '<a href="\1">\1</a>\2', html_entity_decode($last_message['message'], ENT_NOQUOTES, 'UTF-8'));
if(!empty($last_message['employee_name'])) {
$html .='
<div>
<p class="text-center"><span class="anticon anticon-user-tie"></span> Bébé Boutik - ('.Tools::displayDate($last_message['date_add'], (int)($cookie->id_lang), true).')</p>
<p style="padding:5px 20px;background:#efefef;">
"'.$last_message['message'].'"
</p>
</div>';
} else {
$html .='
<div>
<p class="text-center"><span class="anticon anticon-user"></span> '.$customer->firstname.' '.$customer->lastname.' - ('.Tools::displayDate($last_message['date_add'], (int)($cookie->id_lang), true).')</p>
<p style="padding:5px 20px;background:#efefef;">
"'.$last_message['message'].'"
</p>
</div>';
}
$orderMessages = OrderMessage::getOrderMessages((int)($last_message['id_lang']));
if(!empty($last_message['employee_name'])) {
$html .='
<div>
<h5 style="background:#504D8B;color:#fff;padding:5px; text-align:center;">Envoyer un message</h5>
<form action="'.Tools::htmlentitiesutf8($_SERVER['REQUEST_URI']).'" method="post" enctype="multipart/form-data">
<div class="form-group">
<select class="form-control" name="order_message" id="order_message" onchange="savOverwriteMessage(this, \''.$this->l('Do you want to overwrite your existing message?').'\', \''.(int)($last_message['id_customer_message']).'\')">
<option value="0" selected="selected">-- '.$this->l('Choose a standard message').' --</option>';
foreach ($orderMessages AS $orderMessage) {
$html .= '<option value="'.htmlentities($orderMessage['message'], ENT_COMPAT, 'UTF-8').'">'.$orderMessage['name'].'</option>';
}
$html .= '
</select>
</div>
<div class="form-group">
<input class="form-control" type="file" name="joinFile"/>
</div>
<div class="form-group">
<textarea rows="5" class="form-control" id="txt_msg_'.(int)($last_message['id_customer_message']).'" name="reply_message">'.str_replace('\r\n', "\n", Configuration::get('PS_CUSTOMER_SERVICE_SIGNATURE', $last_message['id_lang'])).'</textarea>
</div>
<div style="text-align: right;">
<input type="hidden" name="id_customer_thread" value="'.(int)($last_message['id_customer_thread']).'" />
<input type="hidden" name="msg_email" value="'.$last_message['email'].'" />
<input type="hidden" name="id_order_return" value="'.$orderReturn->id.'" />
<input type="submit" class="btn btn-primary" name="submitReply" value="'.$this->l('Envoyer').'" style="margin-top:20px;" />
</div>
</form>
<p class="text-center"><span class="anticon anticon-user-tie"></span> Bébé Boutik - ('.Tools::displayDate($last_message['date_add'], (int)($cookie->id_lang), true).')</p>
<p style="padding:5px 20px;background:#efefef;">
"'.$last_message['message'].'"
</p>
</div>';
} else {
$html .='
<div>
<p class="text-center"><span class="anticon anticon-user"></span> '.$customer->firstname.' '.$customer->lastname.' - ('.Tools::displayDate($last_message['date_add'], (int)($cookie->id_lang), true).')</p>
<p style="padding:5px 20px;background:#efefef;">
"'.$last_message['message'].'"
</p>
</div>';
}
} else {
$html .='<p>Pas de conversation en rapport avec cette commande !</p>';
$orderMessages = OrderMessage::getOrderMessages((int)($last_message['id_lang']));
$html .='
<div>
<h5 style="background:#504D8B;color:#fff;padding:5px; text-align:center;">Envoyer un message</h5>
<form action="'.Tools::htmlentitiesutf8($_SERVER['REQUEST_URI']).'" method="post" enctype="multipart/form-data">
<div class="form-group">
<select class="form-control" name="order_message" id="order_message" onchange="savOverwriteMessage(this, \''.$this->l('Do you want to overwrite your existing message?').'\', \''.(int)($last_message['id_customer_message']).'\')">
<option value="0" selected="selected">-- '.$this->l('Choose a standard message').' --</option>';
foreach ($orderMessages AS $orderMessage) {
$html .= '<option value="'.htmlentities($orderMessage['message'], ENT_COMPAT, 'UTF-8').'">'.$orderMessage['name'].'</option>';
}
$html .= '
</select>
</div>
<div class="form-group">
<input class="form-control" type="file" name="joinFile"/>
</div>
<div class="form-group">
<textarea rows="5" class="form-control" id="txt_msg_'.(int)($last_message['id_customer_message']).'" name="reply_message">'.str_replace('\r\n', "\n", Configuration::get('PS_CUSTOMER_SERVICE_SIGNATURE', $last_message['id_lang'])).'</textarea>
</div>
<div style="text-align: right;">
<input type="hidden" name="id_customer_thread" value="'.(int)($last_message['id_customer_thread']).'" />
<input type="hidden" name="msg_email" value="'.$last_message['email'].'" />
<input type="hidden" name="id_order_return" value="'.$orderReturn->id.'" />
<input type="submit" class="btn btn-primary" name="submitReply" value="'.$this->l('Envoyer').'" style="margin-top:20px;" />
</div>
</form>
</div>';
}
$html .='</div>
</div>
} else {
$html .='<p>Pas de conversation en rapport avec cette commande !</p>';
}
$html .='</div>
</div>
</div>
</div>
</div>
</div>';
$html .= $helper->renderScript();