//// Merge -> revision 8290

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@8295 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
tDidierjean committed 2011-09-01 09:53:43 +00:00
1 parent d27c0b3b7d
commit c2258ae8e9
50 files changed
+431 -256

No files matched your search

@@ -272,11 +272,14 @@ class MRCreateTickets implements IMondialRelayWSMethod
*/
private function _setRequestDefaultValue()
{
$this->_fields['list']['Enseigne']['value'] = Configuration::get('MR_ENSEIGNE_WEBSERVICE');
$this->_fields['list']['Expe_Langage']['value'] = Configuration::get('MR_LANGUAGE');
var_dump(Configuration::get('MR_LANGUAGE'));
$this->_fields['list']['Expe_Ad1']['value'] = Configuration::get('PS_MR_SHOP_NAME');
$this->_fields['list']['Expe_Ad3']['value'] = Configuration::get('PS_SHOP_ADDR1');
$this->_fields['list']['Expe_Ad4']['value'] = Configuration::get('PS_SHOP_ADDR2');
// Deleted, cause to many failed for the process
// $this->_fields['list']['Expe_Ad4']['value'] = Configuration::get('PS_SHOP_ADDR2');
$this->_fields['list']['Expe_Ville']['value'] = Configuration::get('PS_SHOP_CITY');
$this->_fields['list']['Expe_CP']['value'] = Configuration::get('PS_SHOP_CODE');
$this->_fields['list']['Expe_CP']['params']['id_country'] = Configuration::get('PS_COUNTRY_DEFAULT');
@@ -286,7 +289,7 @@ class MRCreateTickets implements IMondialRelayWSMethod
else
$this->_fields['list']['Expe_Pays']['value'] = substr(Configuration::get('PS_SHOP_COUNTRY'), 0, 2);
$this->_fields['list']['Expe_Tel1']['value'] = 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;
@@ -373,7 +376,11 @@ class MRCreateTickets implements IMondialRelayWSMethod
foreach($rootCase['list'] as $paramName => &$valueDetailed)
if ($paramName != 'Texte' && $paramName != 'Security')
{
$valueDetailed['value'] = strtoupper(MRTools::replaceAccentedCharacters($valueDetailed['value']));
// Mac server make an empty string instead of a cleaned string
// TODO : test on windows and linux server
$cleanedString = MRTools::replaceAccentedCharacters($valueDetailed['value']);
$valueDetailed['value'] = !empty($cleanedString) ? strtoupper($cleanedString) : strtoupper($valueDetailed['value']);
// Call a pointer function if exist to do different test
if (isset($valueDetailed['methodValidation']) &&
method_exists('MRTools', $valueDetailed['methodValidation']) &&
@@ -420,10 +427,13 @@ class MRCreateTickets implements IMondialRelayWSMethod
$order->update();
$templateVars = array('{followup}' => $trackingURL);
$orderState = (Configuration::get('PS_OS_SHIPPING')) ?
Configuration::get('PS_OS_SHIPPING') :
_PS_OS_SHIPPING_;
$history = new OrderHistory();
$history->id_order = (int)($params['NDossier']);
$history->changeIdOrderState(Configuration::get('PS_OS_SHIPPING'), (int)($params['NDossier']));
$history->changeIdOrderState($orderState, (int)($params['NDossier']));
$history->id_employee = (int)Context::getContext()->employee->id;
$history->addWithemail(true, $templateVars);
+2 -2
View File
@@ -460,7 +460,7 @@ function PS_MRHandleSelectedRelayPoint()
$(this).children('a').text(PS_MRTranslationList['Select']);
});
// Make the Selection
$(this).text(PS_MRTranslationList['Selected']);
$(this).html(PS_MRTranslationList['Selected']);
$(this).parent().attr('class', 'PS_MRFloatRelayPointSelected');
// Get the info about the relay point (relayPoint_RelayPointNumber_IdCarrier)
@@ -775,7 +775,7 @@ $(document).ready(function()
});
$('#PS_MRDisplayPersonalizedOptions').click(function()
{
$('#PS_MRPersonalizedFields').toggle('fast');
$('#PS_MRAdvancedSettings').toggle('fast');
});
});
+30 -7
View File
@@ -161,7 +161,7 @@ class MondialRelay extends Module
else
{
// Reactive transport if database wasn't remove at the last uninstall
Db::getInstance()->ExecuteS('
Db::getInstance()->Execute('
UPDATE `'._DB_PREFIX_.'carrier` c, `'._DB_PREFIX_.'mr_method` m
SET `deleted` = 0
WHERE c.id_carrier = m.id_carrier');
@@ -368,7 +368,8 @@ class MondialRelay extends Module
self::$modulePath = _PS_MODULE_DIR_. 'mondialrelay/';
self::$MRToken = sha1('mr'._COOKIE_KEY_.'mrAgain');
$protocol = (Configuration::get('PS_SSL_ENABLED') || Tools::usingSecureMode()) ? 'https://' : 'http://';
$protocol = (Configuration::get('PS_SSL_ENABLED') || (!empty($_SERVER['HTTPS'])
&& strtolower($_SERVER['HTTPS']) != 'off')) ? 'https://' : 'http://';
$endURL = __PS_BASE_URI__.'/modules/mondialrelay/';
@@ -647,16 +648,13 @@ class MondialRelay extends Module
<img src="../modules/mondialrelay/images/logo.gif" />'.$this->l('To create a Mondial Relay carrier').
'</legend>
- '.$this->l('Enter and save your Mondial Relay account settings').'<br />
- '.$this->l('Create a Carrier').'<br />
- '.$this->l('Create a Carrier using the form "add a carrier" below').'<br />
- '.$this->l('Define a price for your carrier on').'
<a href="index.php?tab=AdminCarriers&token='.Tools::getAdminToken('AdminCarriers'.(int)(Tab::getIdFromClassName('AdminCarriers')).
(int)$this->context->employee->id).'" class="green">'.$this->l('The Carrier page').'</a><br />
- '.$this->l('To generate labels, you must have a valid and registered address of your store on your').
' <a href="index.php?tab=AdminContact&token='.Tools::getAdminToken('AdminContact'.(int)(Tab::getIdFromClassName('AdminContact')).
(int)$this->context->employee->id).'" class="green">'.$this->l('contact page').'</a><br />
<p>
'.$this->l('URL Cron Task:').' '.Tools::getHttpHost(true, true)._MODULE_DIR_.$this->name.'/cron.php?secure_key='.Configuration::get('MONDIAL_RELAY_SECURE_KEY').
'</p>
</fieldset>
<br class="clear" />
<div class="PS_MRFormType">'.
@@ -666,7 +664,7 @@ class MondialRelay extends Module
$this->settingsstateorderForm().
'</div>
<div class="PS_MRFormType">'.
$this->personalizeFormFields().
$this->advancedSettings().
'</div>
<div class="PS_MRFormType">'.
$this->addMethodForm().
@@ -893,8 +891,33 @@ class MondialRelay extends Module
return $output;
}
/*
** Display advanced settings form
*/
public function advancedSettings()
{
$form = '';
$form .= '
<fieldset class="PS_MRFormStyle">
<legend>
<img src="../modules/mondialrelay/images/logo.gif" />'.$this->l('Advanced Settings'). ' -
<a href="javascript:void(0);" id="PS_MRDisplayPersonalizedOptions"><font style="color:#00b511;">'.$this->l('Click to display / hide the options').'</font> </a>'.
'</legend>
<div id="PS_MRAdvancedSettings">
<p>
'.$this->l('URL Cron Task:').' '.Tools::getHttpHost(true, true)
._MODULE_DIR_.$this->name.'/cron.php?secure_key='.
Configuration::get('MONDIAL_RELAY_SECURE_KEY').
'</p>
</div>
</fieldset>';
return $form;
}
/*
** Form to allow personalization fields sent for MondialRelay
** Not used anymore but still present if needed
*/
public function personalizeFormFields()
{
+1 -1
View File
@@ -281,7 +281,7 @@ tr.PS_MRSelectedCarrier > td
display: block;
width: 60px;
height: 20px;
padding: 5px 20px 0px 25px;
padding: 6px 20px 0px 25px;
text-decoration: none;
margin-top: 8px;
color:#333333;