[-] MO : Mondialrelay, merge 1.4 => 1.5
This commit is contained in:
@@ -286,8 +286,7 @@ class MRCreateTickets implements IMondialRelayWSMethod
|
||||
$this->_fields['list']['Expe_Pays']['value'] = Country::getIsoById(Configuration::get('PS_SHOP_COUNTRY_ID'));
|
||||
else
|
||||
$this->_fields['list']['Expe_Pays']['value'] = substr(Configuration::get('PS_SHOP_COUNTRY'), 0, 2);
|
||||
|
||||
$this->_fields['list']['Expe_Tel1']['value'] = str_replace(array('.', ' ', '-'), '', Configuration::get('PS_SHOP_PHONE'));
|
||||
$this->_fields['list']['Expe_Tel1']['value'] = str_replace(array('.', ' ', '-', '_'), '', Configuration::get('PS_SHOP_PHONE'));
|
||||
$this->_fields['list']['Expe_Mail']['value'] = Configuration::get('PS_SHOP_EMAIL');
|
||||
$this->_fields['list']['NbColis']['value'] = 1;
|
||||
$this->_fields['list']['CRT_Valeur']['value'] = 0;
|
||||
@@ -331,15 +330,15 @@ class MRCreateTickets implements IMondialRelayWSMethod
|
||||
$tmp['NDossier']['value'] = $orderDetail['id_order'];
|
||||
$tmp['NClient']['value'] = $orderDetail['id_customer'];
|
||||
$tmp['Dest_Langage']['value'] = 'FR'; //Language::getIsoById($orderDetail['id_lang']);
|
||||
$tmp['Dest_Ad1']['value'] = $deliveriesAddress->firstname.' '.$deliveriesAddress->lastname;
|
||||
$tmp['Dest_Ad2']['value'] = $deliveriesAddress->address2;
|
||||
$tmp['Dest_Ad3']['value'] = $deliveriesAddress->address1;
|
||||
$tmp['Dest_Ad1']['value'] = substr($deliveriesAddress->firstname.' '.$deliveriesAddress->lastname, 0, 32);;
|
||||
$tmp['Dest_Ad2']['value'] = substr($deliveriesAddress->address2, 0, 32);
|
||||
$tmp['Dest_Ad3']['value'] = substr($deliveriesAddress->address1, 0, 32);
|
||||
$tmp['Dest_Ville']['value'] = $deliveriesAddress->city;
|
||||
$tmp['Dest_CP']['value'] = $deliveriesAddress->postcode;
|
||||
$tmp['Dest_CP']['params']['id_country'] = $deliveriesAddress->id_country;
|
||||
$tmp['Dest_Pays']['value'] = $destIsoCode;
|
||||
$tmp['Dest_Tel1']['value'] = $deliveriesAddress->phone;
|
||||
$tmp['Dest_Tel2']['value'] = $deliveriesAddress->phone_mobile;
|
||||
$tmp['Dest_Tel1']['value'] = str_replace(array('.', ' ', '-', '_'), '', $deliveriesAddress->phone);
|
||||
$tmp['Dest_Tel2']['value'] = str_replace(array('.', ' ', '-', '_'), '', $deliveriesAddress->phone_mobile);
|
||||
$tmp['Dest_Mail']['value'] = $customer->email;
|
||||
$tmp['Assurance']['value'] = $orderDetail['mr_ModeAss'];
|
||||
if ($orderDetail['MR_Selected_Num'] != 'LD1' && $orderDetail['MR_Selected_Num'] != 'LDS')
|
||||
|
||||
@@ -151,7 +151,7 @@ class MRGetRelayPoint implements IMondialRelayWSMethod
|
||||
}
|
||||
}
|
||||
$concatenationValue .= $this->_webServiceKey;
|
||||
$this->_fields['list']['Security']['value' ] = strtoupper(md5($concatenationValue));
|
||||
$this->_fields['list']['Security']['value'] = strtoupper(md5($concatenationValue));
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -238,7 +238,7 @@ class MRGetRelayPoint implements IMondialRelayWSMethod
|
||||
}
|
||||
if ($totalEmptyFields == count($relayPoint))
|
||||
unset($result[$num]);
|
||||
}
|
||||
}
|
||||
if (!count($result))
|
||||
$errors[] = $this->_mondialRelay->l('MondialRelay can\'t find any relay point near your address. Maybe your address isn\'t properly filled ?');
|
||||
else
|
||||
|
||||
@@ -37,10 +37,10 @@ class MRTools
|
||||
{
|
||||
if (function_exists('iconv'))
|
||||
{
|
||||
$currentLocale = setlocale(LC_ALL, NULL);
|
||||
setlocale(LC_ALL, 'en_US.UTF8');
|
||||
$cleanedString = iconv('UTF-8','ASCII//TRANSLIT', $string);
|
||||
setLocale(LC_ALL, $currentLocale);
|
||||
$currentLocale = setlocale(LC_ALL, NULL);
|
||||
setlocale(LC_ALL, 'en_US.UTF8');
|
||||
$cleanedString = iconv('UTF-8','ASCII//TRANSLIT', $string);
|
||||
setLocale(LC_ALL, $currentLocale);
|
||||
}
|
||||
else
|
||||
$cleanedString = strtr($string,
|
||||
|
||||
+289
-218
File diff suppressed because it is too large
Load Diff
@@ -59,7 +59,7 @@ function getTickets(detailedExpeditionList)
|
||||
},
|
||||
error: function(xhr, ajaxOptions, thrownError)
|
||||
{
|
||||
displayBackGenerateSubmitButton();
|
||||
displayBackGenerateSubmitButton();
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -192,7 +192,7 @@ function generateTicketsAjax()
|
||||
error: function(xhr, ajaxOptions, thrownError)
|
||||
{
|
||||
display_generate_button = true;
|
||||
displayBackGenerateSubmitButton();
|
||||
displayBackGenerateSubmitButton();
|
||||
}
|
||||
});
|
||||
delete(order_id_list);
|
||||
@@ -440,7 +440,7 @@ function PS_MRCarrierSelectedProcess(carrierSelected, id_carrier, MRLivraisonTyp
|
||||
|
||||
// Won't have any relay points
|
||||
PS_MRSelectedRelayPoint['relayPointNum'] = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -512,8 +512,8 @@ function PS_MRDisplayRelayPoint(json, blockContent, carrier_id)
|
||||
numberDisplayed = 0;
|
||||
|
||||
// Disable Gmap for IE user
|
||||
if (!$.browser.msie)
|
||||
PS_MRCreateGmap(carrier_id);
|
||||
// if (!$.browser.msie)
|
||||
PS_MRCreateGmap(carrier_id);
|
||||
blockContent.fadeOut('fast', function()
|
||||
{
|
||||
$(this).children('td').html('');
|
||||
@@ -530,26 +530,26 @@ function PS_MRDisplayRelayPoint(json, blockContent, carrier_id)
|
||||
var classSelection = (PS_MRPreSelectedRelay == json.success[relayPoint].Num) ?
|
||||
'PS_MRFloatRelayPointSelected' : 'PS_MRFloatRelayPointSelecteIt';
|
||||
|
||||
$('<div class="PS_MRRelayPointInfo clearfix" id="' + contentBlockid + '"> \
|
||||
<img src="' + _PS_MR_MODULE_DIR_ + 'logo_hd.png" /> \
|
||||
<p><b>' + json.success[relayPoint].LgAdr1 + '</b><br /> ' + json.success[relayPoint].LgAdr3
|
||||
$('<div class="PS_MRRelayPointInfo clearfix" id="' + contentBlockid + '">'
|
||||
+ '<img src="' + _PS_MR_MODULE_DIR_ + 'logo_hd.png" />'
|
||||
+ '<p><b>' + json.success[relayPoint].LgAdr1 + '</b><br /> ' + json.success[relayPoint].LgAdr3
|
||||
+ ' - ' + json.success[relayPoint].CP + ' - ' + json.success[relayPoint].Ville
|
||||
+ ' ' + json.success[relayPoint].Pays + '</p> \
|
||||
<div class="' + classSelection + '"> \
|
||||
<a class="PS_MRSelectRelayPointButton">' + BtTranslation + '</a> \
|
||||
</div> \
|
||||
+ ' ' + json.success[relayPoint].Pays + '</p>'
|
||||
+ '<div class="' + classSelection + '">'
|
||||
+ '<a class="PS_MRSelectRelayPointButton">' + BtTranslation + '</a>'
|
||||
+ '</div> \
|
||||
</div>').appendTo($(this).children('td'));
|
||||
|
||||
// Store all the object content to prevent an ajax request
|
||||
relayPointDataContainers[json.success[relayPoint].Num] = json.success[relayPoint];
|
||||
++numberDisplayed;
|
||||
// Display popup for IE user
|
||||
if (!$.browser.msie)
|
||||
PS_MRAddGMapMarker(carrier_id, json.success[relayPoint].Num, contentBlockid);
|
||||
else
|
||||
//if (!$.browser.msie)
|
||||
PS_MRAddGMapMarker(carrier_id, json.success[relayPoint].Num, contentBlockid);
|
||||
/* else
|
||||
$('#' + contentBlockid).children('p').click(function() {
|
||||
PS_MROpenPopupDetail(json.success[relayPoint].permaLinkDetail);
|
||||
});
|
||||
});*/
|
||||
}
|
||||
}
|
||||
PS_MRHandleSelectedRelayPoint();
|
||||
@@ -693,15 +693,15 @@ function PS_MRGmapPlaceViewOnMarker($map, marker, relayNum)
|
||||
{
|
||||
PS_MRDisplayClickedGmapWindow(marker, relayNum, $map);
|
||||
|
||||
// Make dancing markers in Firefox will use the CPU to 100 %
|
||||
if (!$.browser.mozilla)
|
||||
(function(m)
|
||||
{
|
||||
setTimeout(function()
|
||||
{
|
||||
m.setAnimation(google.maps.Animation.BOUNCE);
|
||||
}, 200);
|
||||
})(marker);
|
||||
// Make dancing markers in Firefox / IE will use the CPU to 50 to 100 % about
|
||||
if (!$.browser.msie && !$.browser.mozilla)
|
||||
(function(m)
|
||||
{
|
||||
setTimeout(function()
|
||||
{
|
||||
m.setAnimation(google.maps.Animation.BOUNCE);
|
||||
}, 200);
|
||||
})(marker);
|
||||
// marker.setAnimation(google.maps.Animation.BOUNCE);
|
||||
}
|
||||
});
|
||||
@@ -722,11 +722,11 @@ function PS_MRStopDancingMarkers(currentMarkerList)
|
||||
** Display the Gmap of the selected relay point
|
||||
*/
|
||||
function PS_MRDisplayGmap(contentBlockid, $map)
|
||||
{
|
||||
tab = contentBlockid.split('_');
|
||||
relayPointNumber = tab[1];
|
||||
id_carrier = tab[2];
|
||||
|
||||
{
|
||||
var tab = contentBlockid.split('_');
|
||||
var relayPointNumber = tab[1];
|
||||
var id_carrier = tab[2];
|
||||
|
||||
// Stop the dancing marker of the current carrier
|
||||
PS_MRStopDancingMarkers(markerList[id_carrier]);
|
||||
if ($('#PS_MRGmap_' + id_carrier).css('display') == 'none')
|
||||
@@ -903,7 +903,7 @@ $(document).ready(function()
|
||||
$('#PS_MRDisplayPersonalizedOptions').click(function()
|
||||
{
|
||||
$('#PS_MRAdvancedSettings').toggle('fast');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
@@ -194,7 +194,7 @@ class MondialRelay extends Module
|
||||
!$this->registerHook('updateCarrier') ||
|
||||
!$this->registerHook('newOrder') ||
|
||||
!$this->registerHook('BackOfficeHeader') ||
|
||||
!$this->registerHook('paymentTop')))
|
||||
!$this->registerHook('header')))
|
||||
return false;
|
||||
|
||||
if (_PS_VERSION_ >= '1.4' &&
|
||||
@@ -438,7 +438,6 @@ class MondialRelay extends Module
|
||||
var mrtoken = "'.self::$MRBackToken.'";
|
||||
</script>';
|
||||
return $ret;
|
||||
return $ret;
|
||||
}
|
||||
|
||||
private function _postValidation()
|
||||
@@ -486,7 +485,7 @@ class MondialRelay extends Module
|
||||
if (!preg_match('#^[0-9A-Z_\-\'., /]{2,32}$#', strtoupper($addr1), $match))
|
||||
$this->_postErrors[] = $this->l('The Main address submited hasn\'t a good format');
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
private function _postProcess()
|
||||
{
|
||||
@@ -543,13 +542,6 @@ class MondialRelay extends Module
|
||||
return $this->display(__FILE__, 'orderDetail.tpl');
|
||||
}
|
||||
|
||||
/*
|
||||
** No need anymore
|
||||
*/
|
||||
public function hookProcessCarrier($params)
|
||||
{
|
||||
}
|
||||
|
||||
/*
|
||||
** Update the carrier id to use the new one if changed
|
||||
*/
|
||||
@@ -599,7 +591,24 @@ class MondialRelay extends Module
|
||||
$carriers = array();
|
||||
return $carriers;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
** Added to be used properly with OPC
|
||||
*/
|
||||
public function hookHeader($params)
|
||||
{
|
||||
if (in_array(basename($_SERVER['SCRIPT_NAME']), array('order-opc.php', 'order.php')))
|
||||
{
|
||||
$$this->context->smarty->assign(array(
|
||||
'one_page_checkout' => (Configuration::get('PS_ORDER_PROCESS_TYPE') ? Configuration::get('PS_ORDER_PROCESS_TYPE') : 0),
|
||||
'new_base_dir' => self::$moduleURL,
|
||||
'MRToken' => self::$MRFrontToken,
|
||||
'jQueryOverload' => self::getJqueryCompatibility(false)));
|
||||
return $this->display(__FILE__, 'header.tpl');
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
public function hookextraCarrier($params)
|
||||
{
|
||||
global $nbcarriers;
|
||||
@@ -634,15 +643,10 @@ class MondialRelay extends Module
|
||||
}
|
||||
|
||||
$preSelectedRelay = $this->getRelayPointSelected($params['cart']->id);
|
||||
$this->context->smarty->assign(array(
|
||||
'one_page_checkout' => (Configuration::get('PS_ORDER_PROCESS_TYPE') ? Configuration::get('PS_ORDER_PROCESS_TYPE') : 0),
|
||||
'new_base_dir' => self::$moduleURL,
|
||||
'MRToken' => self::$MRFrontToken,
|
||||
$smarty->assign(array(
|
||||
'carriersextra' => $carriersList,
|
||||
'preSelectedRelay' => isset($preSelectedRelay['MR_selected_num']) ? $preSelectedRelay['MR_selected_num'] : '',
|
||||
'jQueryOverload' => self::getJqueryCompatibility(false)
|
||||
));
|
||||
|
||||
'preSelectedRelay' => isset($preSelectedRelay['MR_selected_num']) ? $preSelectedRelay['MR_selected_num'] : ''));
|
||||
|
||||
return $this->display(__FILE__, 'mondialrelay.tpl');
|
||||
}
|
||||
|
||||
@@ -1131,9 +1135,10 @@ class MondialRelay extends Module
|
||||
$query = 'SELECT url_suivi
|
||||
FROM '._DB_PREFIX_ .'mr_selected
|
||||
WHERE id_mr_selected=\''.(int)($shipping_number).'\';';
|
||||
|
||||
|
||||
$settings = Db::getInstance()->executeS($query);
|
||||
|
||||
if(!isset($settings[0]['url_suivi']))
|
||||
return null;
|
||||
return $settings[0]['url_suivi'];
|
||||
}
|
||||
|
||||
@@ -1180,10 +1185,11 @@ class MondialRelay extends Module
|
||||
LEFT JOIN `'._DB_PREFIX_.'customer` c
|
||||
ON (c.`id_customer` = o.`id_customer`)
|
||||
WHERE (
|
||||
SELECT moh.`id_order_state`
|
||||
FROM `'._DB_PREFIX_.'order_history` moh
|
||||
WHERE moh.`id_order` = o.`id_order`
|
||||
ORDER BY moh.`date_add` DESC LIMIT 1) = '.(int)($id_order_state);
|
||||
SELECT moh.`id_order_state`
|
||||
FROM `'._DB_PREFIX_.'order_history` moh
|
||||
WHERE moh.`id_order` = o.`id_order`
|
||||
ORDER BY moh.`date_add` DESC LIMIT 1) = '.(int)($id_order_state).'
|
||||
AND ca.`external_module_name` = "mondialrelay"';
|
||||
}
|
||||
|
||||
public static function ordersSQLQuery1_3($id_order_state)
|
||||
@@ -1211,10 +1217,11 @@ class MondialRelay extends Module
|
||||
LEFT JOIN `'._DB_PREFIX_.'customer` c
|
||||
ON (c.`id_customer` = o.`id_customer`)
|
||||
WHERE (
|
||||
SELECT moh.`id_order_state`
|
||||
FROM `'._DB_PREFIX_.'order_history` moh
|
||||
WHERE moh.`id_order` = o.`id_order`
|
||||
ORDER BY moh.`date_add` DESC LIMIT 1) = '.(int)($id_order_state);
|
||||
SELECT moh.`id_order_state`
|
||||
FROM `'._DB_PREFIX_.'order_history` moh
|
||||
WHERE moh.`id_order` = o.`id_order`
|
||||
ORDER BY moh.`date_add` DESC LIMIT 1) = '.(int)($id_order_state).'
|
||||
AND ca.`name` = "mondialrelay"';
|
||||
}
|
||||
|
||||
public static function getBaseOrdersSQLQuery($id_order_state)
|
||||
|
||||
@@ -26,28 +26,11 @@
|
||||
|
||||
{$jQueryOverload}
|
||||
|
||||
<link href="{$new_base_dir}/style.css" rel="stylesheet" type="text/css" media="all" />
|
||||
<script type="text/javascript">
|
||||
// Global JS Value
|
||||
var _PS_MR_MODULE_DIR_ = "{$new_base_dir}";
|
||||
var mrtoken = "{$MRToken}";
|
||||
var PS_MROPC = {$one_page_checkout};
|
||||
var PS_MRTranslationList = new Array();
|
||||
var PS_MRCarrierMethodList = new Array();
|
||||
var PS_MRSelectedRelayPoint = {literal}{{/literal}'carrier_id': 0, 'relayPointNum': 0{literal}}{/literal};
|
||||
var PS_MRPreSelectedRelay = '{$preSelectedRelay}';
|
||||
|
||||
PS_MRTranslationList['Select'] = "{l s='Select' mod='mondialrelay'}";
|
||||
PS_MRTranslationList['Selected'] = "{l s='Selected' mod='mondialrelay'}";
|
||||
PS_MRTranslationList['errorSelection'] = "{l s='Please choose a relay point' mod='mondialrelay'}";
|
||||
PS_MRTranslationList['openingRelay'] = "{l s='Opening hours' mod='mondialrelay'}";
|
||||
PS_MRTranslationList['moreDetails'] = "{l s='More details' mod='mondialrelay'}";
|
||||
</script>
|
||||
|
||||
<script type="text/javascript" src="{$new_base_dir}mondialrelay.js"></script>
|
||||
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
|
||||
<script type="text/javascript" src="{$new_base_dir}js/gmap.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
$(document).ready(function()
|
||||
|
||||
@@ -371,4 +371,4 @@ div#PS_MRPersonalizedFields
|
||||
color: #383838;
|
||||
background: #F1F9FF url(images/help.png) no-repeat 6px 5px;
|
||||
border-radius: 3px;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user