// Merge -> 10309
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@10333 b9a71923-0436-4b27-9f14-aed3839534dd
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2011 PrestaShop
|
||||
* 2007-2011 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
if (!defined('_PS_VERSION_'))
|
||||
exit;
|
||||
|
||||
|
||||
class authorizeAIM extends PaymentModule
|
||||
{
|
||||
public function __construct()
|
||||
@@ -46,19 +46,19 @@ class authorizeAIM extends PaymentModule
|
||||
|
||||
/* For 1.4.3 and less compatibility */
|
||||
$updateConfig = array(
|
||||
'PS_OS_CHEQUE' => 1,
|
||||
'PS_OS_PAYMENT' => 2,
|
||||
'PS_OS_PREPARATION' => 3,
|
||||
'PS_OS_SHIPPING' => 4,
|
||||
'PS_OS_DELIVERED' => 5,
|
||||
'PS_OS_CHEQUE' => 1,
|
||||
'PS_OS_PAYMENT' => 2,
|
||||
'PS_OS_PREPARATION' => 3,
|
||||
'PS_OS_SHIPPING' => 4,
|
||||
'PS_OS_DELIVERED' => 5,
|
||||
'PS_OS_CANCELED' => 6,
|
||||
'PS_OS_REFUND' => 7,
|
||||
'PS_OS_ERROR' => 8,
|
||||
'PS_OS_OUTOFSTOCK' => 9,
|
||||
'PS_OS_BANKWIRE' => 10,
|
||||
'PS_OS_PAYPAL' => 11,
|
||||
'PS_OS_REFUND' => 7,
|
||||
'PS_OS_ERROR' => 8,
|
||||
'PS_OS_OUTOFSTOCK' => 9,
|
||||
'PS_OS_BANKWIRE' => 10,
|
||||
'PS_OS_PAYPAL' => 11,
|
||||
'PS_OS_WS_PAYMENT' => 12);
|
||||
|
||||
|
||||
foreach ($updateConfig as $u => $v)
|
||||
if (!Configuration::get($u) || (int)Configuration::get($u) < 1)
|
||||
{
|
||||
@@ -75,8 +75,8 @@ class authorizeAIM extends PaymentModule
|
||||
|
||||
public function install()
|
||||
{
|
||||
return (parent::install() AND $this->registerHook('orderConfirmation') AND
|
||||
$this->registerHook('payment') AND Configuration::updateValue('AUTHORIZE_AIM_DEMO', 1));
|
||||
return (parent::install() && $this->registerHook('orderConfirmation') && $this->registerHook('payment')
|
||||
AND $this->registerHook('header') && Configuration::updateValue('AUTHORIZE_AIM_DEMO', 1));
|
||||
}
|
||||
|
||||
public function uninstall()
|
||||
@@ -94,15 +94,15 @@ class authorizeAIM extends PaymentModule
|
||||
|
||||
public function hookOrderConfirmation($params)
|
||||
{
|
||||
if ($params['objOrder']->module != $this->name)
|
||||
if ($params['objOrder']->module != $this->name)
|
||||
return;
|
||||
|
||||
if ($params['objOrder']->getCurrentState() != Configuration::get('PS_OS_ERROR'))
|
||||
if ($params['objOrder']->getCurrentState() != Configuration::get('PS_OS_ERROR'))
|
||||
$this->context->smarty->assign(array('status' => 'ok', 'id_order' => intval($params['objOrder']->id)));
|
||||
else
|
||||
$this->context->smarty->assign('status', 'failed');
|
||||
|
||||
return $this->display(__FILE__, 'hookorderconfirmation.tpl');
|
||||
return $this->display(__FILE__, 'hookorderconfirmation.tpl');
|
||||
}
|
||||
|
||||
public function getContent()
|
||||
@@ -165,7 +165,7 @@ class authorizeAIM extends PaymentModule
|
||||
if (Configuration::get('PS_SSL_ENABLED') || (!empty($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) != 'off'))
|
||||
{
|
||||
$invoiceAddress = new Address((int)$params['cart']->id_address_invoice);
|
||||
|
||||
|
||||
$authorizeAIMParams = array();
|
||||
$authorizeAIMParams['x_login'] = Configuration::get('AUTHORIZE_AIM_LOGIN_ID');
|
||||
$authorizeAIMParams['x_tran_key'] = Configuration::get('AUTHORIZE_AIM_KEY');
|
||||
@@ -182,7 +182,7 @@ class authorizeAIM extends PaymentModule
|
||||
$authorizeAIMParams['x_zip'] = $invoiceAddress->postcode;
|
||||
$authorizeAIMParams['x_first_name'] = $this->context->customer->firstname;
|
||||
$authorizeAIMParams['x_last_name'] = $this->context->customer->lastname;
|
||||
|
||||
|
||||
$isFailed = Tools::getValue('aimerror');
|
||||
|
||||
$cards = array();
|
||||
@@ -198,31 +198,35 @@ class authorizeAIM extends PaymentModule
|
||||
return $this->display(__FILE__, 'authorizeaim.tpl');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the detail of a payment - Call before the validate order init
|
||||
* correctly the pcc object
|
||||
* See Authorize documentation to know the associated key => value
|
||||
* @param array fields
|
||||
*/
|
||||
public function setTransactionDetail($response)
|
||||
{
|
||||
// If Exist we can store the details
|
||||
if (isset($this->pcc))
|
||||
{
|
||||
$this->pcc->transaction_id = (string)$response[6];
|
||||
|
||||
|
||||
public function hookHeader()
|
||||
{
|
||||
Tools::addJS(_PS_JS_DIR_.'jquery/jquery.validate.creditcard2-1.0.1.js');
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the detail of a payment - Call before the validate order init
|
||||
* correctly the pcc object
|
||||
* See Authorize documentation to know the associated key => value
|
||||
* @param array fields
|
||||
*/
|
||||
public function setTransactionDetail($response)
|
||||
{
|
||||
// If Exist we can store the details
|
||||
if (isset($this->pcc))
|
||||
{
|
||||
$this->pcc->transaction_id = (string)$response[6];
|
||||
|
||||
// 50 => Card number (XXXX0000)
|
||||
$this->pcc->card_number = (string)substr($response[50], -4);
|
||||
|
||||
|
||||
// 51 => Card Mark (Visa, Master card)
|
||||
$this->pcc->card_brand = (string)$response[51];
|
||||
|
||||
|
||||
$this->pcc->card_expiration = (string)Tools::getValue('x_exp_date');
|
||||
|
||||
|
||||
// 68 => Owner name
|
||||
$this->pcc->card_holder = (string)$response[68];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
@@ -30,22 +30,14 @@
|
||||
<p style="color: red;">{l s='Error, please verify the card information' mod='authorizeaim'}</p>
|
||||
{/if}
|
||||
|
||||
<form id="aut" name="authorizeaim_form" action="{$module_dir}validation.php" method="post">
|
||||
<form id="aut" name="authorizeaim_form" id="authorizeaim_form" action="{$module_dir}validation.php" method="post">
|
||||
<span style="border: 1px solid #595A5E;display: block;padding: 0.6em;text-decoration: none;margin-left: 0.7em;">
|
||||
<a id="click_authorizeaim" href="#" title="{l s='Pay with authorizeaim' mod='authorizeaim'}" style="display: block;text-decoration: none;">
|
||||
{if $cards.visa == 1}
|
||||
<img src="{$module_dir}cards/visa.gif" alt="{l s='visa logo' mod='authorizeaim'}" />
|
||||
{/if}
|
||||
{if $cards.mastercard == 1}
|
||||
<img src="{$module_dir}cards/mastercard.gif" alt="{l s='mastercard logo' mod='authorizeaim'}" />
|
||||
{/if}
|
||||
{if $cards.discover == 1}
|
||||
<img src="{$module_dir}cards/discover.gif" alt="{l s='discover logo' mod='authorizeaim'}" />
|
||||
{/if}
|
||||
{if $cards.ax == 1}
|
||||
<img src="{$module_dir}cards/ax.gif" alt="{l s='american express logo' mod='authorizeaim'}" />
|
||||
{/if}
|
||||
{l s='Secured credit card payment with Authorize.net' mod='authorizeaim'}
|
||||
<a id="click_authorizeaim" href="#" title="{l s='Pay with authorizeaim' mod='authorizeaim'}" style="display: block;text-decoration: none; font-weight: bold;">
|
||||
{if $cards.visa == 1}<img src="{$module_dir}cards/visa.gif" alt="{l s='visa logo' mod='authorizeaim'}" style="vertical-align: middle;" />{/if}
|
||||
{if $cards.mastercard == 1}<img src="{$module_dir}cards/mastercard.gif" alt="{l s='mastercard logo' mod='authorizeaim'}" style="vertical-align: middle;" />{/if}
|
||||
{if $cards.discover == 1}<img src="{$module_dir}cards/discover.gif" alt="{l s='discover logo' mod='authorizeaim'}" style="vertical-align: middle;" />{/if}
|
||||
{if $cards.ax == 1}<img src="{$module_dir}cards/ax.gif" alt="{l s='american express logo' mod='authorizeaim'}" style="vertical-align: middle;" />{/if}
|
||||
{l s='Secured credit card payment with Authorize.net' mod='authorizeaim'}
|
||||
</a>
|
||||
|
||||
{if $isFailed == 0}
|
||||
@@ -53,16 +45,28 @@
|
||||
{else}
|
||||
<div id="aut2">
|
||||
{/if}
|
||||
<br />
|
||||
<br /><br />
|
||||
|
||||
<img src="{$module_dir}logoa.gif" alt="secure payment" style="float: left;margin-top:40px;"/>
|
||||
<div style="width: 136px; height: 165px; float: left; padding-top:40px; padding-right: 20px; border-right: 1px solid #DDD;">
|
||||
<img src="{$module_dir}logoa.gif" alt="secure payment" />
|
||||
</div>
|
||||
{foreach from=$p key=k item=v}
|
||||
<input type="hidden" name="{$k}" value="{$v}" />
|
||||
{/foreach}
|
||||
|
||||
<label style="margin-left: 50px;display: block;width: 85px;float: left;">{l s='Full name' mod='authorizeaim'}</label> <input type="text" name="name" size="20" maxlength="25S" /><img src="{$module_dir}secure.png" alt="" style="margin-left: 5px;" /><br /><br />
|
||||
<label style="margin-left: 50px;display: block;width: 85px;float: left;">{l s='Card number' mod='authorizeaim'}</label> <input type="text" id="ccn" name="x_card_num" size="16" maxlength="16" autocomplete="Off"/><img src="{$module_dir}secure.png" alt="" style="margin-left: 5px;" /><br /><br />
|
||||
<label style="margin-left: 50px;display: block;width: 85px;float: left;">{l s='Expiration date' mod='authorizeaim'}</label>
|
||||
<label style="margin-top: 4px; margin-left: 40px;display: block;width: 90px;float: left;">{l s='Full name' mod='authorizeaim'}</label> <input type="text" name="name" id="fullname" size="30" maxlength="25S" /><img src="{$module_dir}secure.png" alt="" style="margin-left: 5px;" /><br /><br />
|
||||
|
||||
<label style="margin-top: 4px; margin-left: 40px;display: block;width: 90px;float: left;">{l s='Card Type' mod='authorizeaim'}</label>
|
||||
<select id="cardType">
|
||||
{if $cards.ax == 1}<option value="AmEx">American Express</option>{/if}
|
||||
{if $cards.visa == 1}<option value="Visa">Visa</option>{/if}
|
||||
{if $cards.mastercard == 1}<option value="MasterCard">MasterCard</option>{/if}
|
||||
{if $cards.discover == 1}<option value="Discover">Discover</option>{/if}
|
||||
</select>
|
||||
<img src="{$module_dir}secure.png" alt="" style="margin-left: 5px;" /><br /><br />
|
||||
|
||||
<label style="margin-top: 4px; margin-left: 40px;display: block;width: 90px;float: left;">{l s='Card number' mod='authorizeaim'}</label> <input type="text" name="x_card_num" id="cardnum" size="30" maxlength="16" autocomplete="Off" /><img src="{$module_dir}secure.png" alt="" style="margin-left: 5px;" /><br /><br />
|
||||
<label style="margin-top: 4px; margin-left: 40px;display: block;width: 90px;float: left;">{l s='Expiration date' mod='authorizeaim'}</label>
|
||||
<select id="x_exp_date_m" name="x_exp_date_m" style="width:60px;">{section name=date_m start=01 loop=13}
|
||||
<option value="{$smarty.section.date_m.index}">{$smarty.section.date_m.index}</option>{/section}
|
||||
</select>
|
||||
@@ -71,15 +75,16 @@
|
||||
<option value="{$smarty.section.date_y.index}">20{$smarty.section.date_y.index}</option>{/section}
|
||||
</select>
|
||||
<img src="{$module_dir}secure.png" alt="" style="margin-left: 5px;" /><br /><br />
|
||||
<label style="margin-left: 186px;display: block;width: 85px;float: left;">{l s='CVV' mod='authorizeaim'}</label> <input type="text" name="x_card_code" size="4" maxlength="4" /><img src="{$module_dir}secure.png" alt="" style="margin-left: 5px;"/> <img src="{$module_dir}help.png" id="cvv_help" title="{l s='the 3 last digits on the back of your credit card' mod='authorizeaim'}" alt="" /><br /><br />
|
||||
<label style="margin-top: 4px; margin-left: 40px;display: block;width: 90px;float: left;">{l s='CVV' mod='authorizeaim'}</label> <input type="text" name="x_card_code" id="x_card_code" size="4" maxlength="4" /><img src="{$module_dir}secure.png" alt="" style="margin-left: 5px;"/> <img src="{$module_dir}help.png" id="cvv_help" title="{l s='the 3 last digits on the back of your credit card' mod='authorizeaim'}" alt="" /><br /><br />
|
||||
<img src="{$module_dir}cvv.png" id="cvv_help_img" alt=""style="display: none;margin-left: 211px;" />
|
||||
<input type="button" id="asubmit" value="{l s='Validate order' mod='authorizeaim'}" style="margin-left: 236px;" class="button"/>
|
||||
<input type="button" id="asubmit" value="{l s='Validate order' mod='authorizeaim'}" style="margin-left: 129px; padding-left: 25px; padding-right: 25px;" class="button" />
|
||||
</div>
|
||||
</span>
|
||||
</form>
|
||||
</p>
|
||||
<script type="text/javascript">
|
||||
var mess_error = "{l s='Your card number is false' mod='authorizeaim' js=1}";
|
||||
var mess_error = "{l s='Please check your credit card information (Credit card type, number and expiration date)' mod='authorizeaim' js=1}";
|
||||
var mess_error2 = "{l s='Please specify your Full Name' mod='authorizeaim' js=1}";
|
||||
{literal}
|
||||
$(document).ready(function(){
|
||||
$('#x_exp_date_m').children('option').each(function()
|
||||
@@ -107,9 +112,14 @@
|
||||
$('#cvv_help').unbind();
|
||||
});
|
||||
|
||||
$('#asubmit').click(function(){
|
||||
if ($('#ccn').val() < 13)
|
||||
$('#asubmit').click(function()
|
||||
{
|
||||
if ($('#fullname').val() == '')
|
||||
{
|
||||
alert(mess_error2);
|
||||
}
|
||||
else if (!validateCC($('#cardnum').val(), $('#cardType').val()) || $('#x_card_code').val() == '')
|
||||
{
|
||||
alert(mess_error);
|
||||
}
|
||||
else
|
||||
@@ -118,5 +128,6 @@
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
{/literal}
|
||||
</script>
|
||||
</script>
|
||||
@@ -49,7 +49,7 @@ if(empty($_POST['action']) OR !in_array($_POST['action'],array('upgradeDb')))
|
||||
// Add Upgrader class : if > 1.4.5.0 , uses core class
|
||||
// otherwise, use Upgrader.php in modules.
|
||||
// in both cases, use override if files exists
|
||||
if (!version_compare(_PS_VERSION_,'1.4.5.0','<') && file_exists(_PS_ROOT_DIR_.'/classes/Upgrader.php'))
|
||||
if (!version_compare(_PS_VERSION_,'1.4.6.0','<') && file_exists(_PS_ROOT_DIR_.'/classes/Upgrader.php'))
|
||||
require_once(_PS_ROOT_DIR_.'/classes/Upgrader.php');
|
||||
else
|
||||
require_once(dirname(__FILE__).'/Upgrader.php');
|
||||
@@ -118,6 +118,8 @@ class AdminSelfUpgrade extends AdminSelfTab
|
||||
public $prodRootDir = '';
|
||||
public $adminDir = '';
|
||||
public $rootWritable = false;
|
||||
|
||||
public $lastAutoupgradeVersion = '';
|
||||
public $svnDir = 'svn';
|
||||
public $destDownloadFilename = 'prestashop.zip';
|
||||
public $toUpgradeFileList = 'filesToUpgrade.list';
|
||||
@@ -156,7 +158,7 @@ class AdminSelfUpgrade extends AdminSelfTab
|
||||
* value = the next step you want instead
|
||||
* example : public static $skipAction = array('download' => 'upgradeFiles');
|
||||
*/
|
||||
public static $skipAction;
|
||||
public static $skipAction = array();
|
||||
public $useSvn;
|
||||
|
||||
protected $_includeContainer = false;
|
||||
@@ -276,14 +278,42 @@ class AdminSelfUpgrade extends AdminSelfTab
|
||||
|
||||
public function configOk()
|
||||
{
|
||||
$allowed = (ConfigurationTest::test_fopen() && $this->rootWritable);
|
||||
$allowed &= !Configuration::get('PS_SHOP_ENABLE');
|
||||
$allowed &= $this->upgrader->autoupgrade;
|
||||
$allowed &= (Configuration::get('PS_AUTOUP_KEEP_TRAD') !== false);
|
||||
|
||||
$allowed_array = $this->getCheckCurrentConfig();
|
||||
$allowed = array_product($allowed_array);
|
||||
return $allowed;
|
||||
}
|
||||
|
||||
public function getcheckCurrentConfig()
|
||||
{
|
||||
static $allowed_array;
|
||||
|
||||
if(empty($allowed_array))
|
||||
{
|
||||
$allowed_array = array();
|
||||
$allowed_array['fopen'] = ConfigurationTest::test_fopen();
|
||||
$allowed_array['root_writable'] = $this->rootWritable;
|
||||
$allowed_array['shop_enabled'] = !Configuration::get('PS_SHOP_ENABLE');
|
||||
$allowed_array['autoupgrade_allowed'] = $this->upgrader->autoupgrade;
|
||||
$module_version = '0.1';
|
||||
if ($module_version = simplexml_load_file(dirname(__FILE__).'/config.xml'))
|
||||
$module_version = (string)$module_version->version;
|
||||
$allowed_array['module_version_ok'] = version_compare($module_version, $this->upgrader->autoupgrade_last_version, '>=');
|
||||
// if one option has been defined, all options are.
|
||||
$allowed_array['module_configured'] = (Configuration::get('PS_AUTOUP_KEEP_TRAD') !== false);
|
||||
}
|
||||
return $allowed_array;
|
||||
}
|
||||
|
||||
|
||||
public function checkAutoupgradeLastVersion(){
|
||||
if ($module_version = simplexml_load_file(_PS_MODULE_DIR_.'autoupgrade'.'/config.xml'))
|
||||
$module_version = (string)$module_version['version'];
|
||||
else
|
||||
$module_version = '';
|
||||
|
||||
return version_compare($this->upgrader->autoupgrade_last_version, $module_version, '==');
|
||||
}
|
||||
|
||||
/**
|
||||
* isUpgradeAllowed checks if all server configuration is valid for upgrade
|
||||
*
|
||||
@@ -315,7 +345,7 @@ class AdminSelfUpgrade extends AdminSelfTab
|
||||
$this->action = empty($_REQUEST['action'])?null:$_REQUEST['action'];
|
||||
$this->currentParams = empty($_REQUEST['params'])?null:$_REQUEST['params'];
|
||||
// test writable recursively
|
||||
if(version_compare(_PS_VERSION_,'1.4.5.0','<'))
|
||||
if(version_compare(_PS_VERSION_,'1.4.6.0','<') || !class_exists('ConfigurationTest', false))
|
||||
{
|
||||
require_once('ConfigurationTest.php');
|
||||
if(!class_exists('ConfigurationTest', false) AND class_exists('ConfigurationTestCore'))
|
||||
@@ -324,8 +354,9 @@ class AdminSelfUpgrade extends AdminSelfTab
|
||||
if (ConfigurationTest::test_dir($this->prodRootDir,true))
|
||||
$this->rootWritable = true;
|
||||
|
||||
if (!in_array($this->action,array('upgradeFile', 'upgradeDb', 'upgradeComplete','rollback','restoreFiles','restoreDb')))
|
||||
if (!in_array($this->action, array('upgradeFile', 'upgradeDb', 'upgradeComplete','rollback','restoreFiles','restoreDb', 'checkFilesVersion')))
|
||||
{
|
||||
|
||||
$this->upgrader = new Upgrader();
|
||||
$this->upgrader->checkPSVersion();
|
||||
$this->nextParams['install_version'] = $this->upgrader->version_num;
|
||||
@@ -464,8 +495,21 @@ class AdminSelfUpgrade extends AdminSelfTab
|
||||
}
|
||||
public function ajaxProcessCheckFilesVersion()
|
||||
{
|
||||
if ($this->upgrader->isAuthenticPrestashopVersion() !== false)
|
||||
$this->_loadDbRelatedClasses();
|
||||
$this->upgrader = new Upgrader();
|
||||
|
||||
$changedFileList = $this->upgrader->getChangedFilesList();
|
||||
if ($this->upgrader->isAuthenticPrestashopVersion() == true
|
||||
&& !is_array($changedFileList) )
|
||||
{
|
||||
$this->nextParams['status'] = 'error';
|
||||
$this->nextParams['msg'] = '[TECHNICAL ERROR] Unable to check files';
|
||||
$testOrigCore = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($this->upgrader->isAuthenticPrestashopVersion() != false)
|
||||
{
|
||||
$this->nextParams['status'] = 'ok';
|
||||
$testOrigCore = true;
|
||||
}
|
||||
@@ -475,7 +519,6 @@ class AdminSelfUpgrade extends AdminSelfTab
|
||||
$this->nextParams['status'] = 'warn';
|
||||
}
|
||||
|
||||
$changedFileList = $this->upgrader->getChangedFilesList();
|
||||
if (!isset($changedFileList['core']))
|
||||
$changedFileList['core'] = array();
|
||||
if (!isset($changedFileList['translation']))
|
||||
@@ -495,6 +538,7 @@ class AdminSelfUpgrade extends AdminSelfTab
|
||||
}
|
||||
$this->nextParams['result'] = $changedFileList;
|
||||
}
|
||||
}
|
||||
|
||||
public function ajaxProcessUpgradeNow()
|
||||
{
|
||||
@@ -551,7 +595,7 @@ class AdminSelfUpgrade extends AdminSelfTab
|
||||
|
||||
/**
|
||||
* extract last version into admin/autoupgrade/latest directory
|
||||
*
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function ajaxProcessUnzip(){
|
||||
@@ -938,7 +982,7 @@ class AdminSelfUpgrade extends AdminSelfTab
|
||||
}
|
||||
|
||||
/**
|
||||
* ajaxProcessRestoreFiles restore the previously saved files,
|
||||
* ajaxProcessRestoreFiles restore the previously saved files,
|
||||
* and delete files that weren't archived
|
||||
*
|
||||
* @return boolean true if succeed
|
||||
@@ -947,13 +991,13 @@ class AdminSelfUpgrade extends AdminSelfTab
|
||||
{
|
||||
$this->next = 'restoreFiles';
|
||||
// @TODO : workaround max_execution_time / ajax batch unzip
|
||||
// very first restoreFiles step : extract backup
|
||||
// very first restoreFiles step : extract backup
|
||||
if (!empty($this->backupFilesFilename) AND file_exists($this->backupFilesFilename))
|
||||
{
|
||||
// cleanup current PS tree
|
||||
$fromArchive = $this->_listArchivedFiles();
|
||||
file_put_contents($this->autoupgradePath.DIRECTORY_SEPARATOR.$this->fromArchiveFileList, serialize($fromArchive));
|
||||
|
||||
|
||||
//$this->_cleanUp($this->prodRootDir.'/');
|
||||
$this->nextQuickInfo[] = $this->l('root directory cleaned.');
|
||||
|
||||
@@ -963,7 +1007,7 @@ class AdminSelfUpgrade extends AdminSelfTab
|
||||
if (self::ZipExtract($filepath, $destExtract))
|
||||
{
|
||||
$this->next = 'restoreFiles';
|
||||
// get new file list
|
||||
// get new file list
|
||||
$this->nextDesc = $this->l('Files restored. Removing files added by upgrade ...');
|
||||
// once it's restored, do not delete the archive file. This has to be done manually
|
||||
// but we can empty the var, to avoid loop.
|
||||
@@ -977,9 +1021,9 @@ class AdminSelfUpgrade extends AdminSelfTab
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// very second restoreFiles step : remove new files that shouldn't be there
|
||||
// for that, we will make a diff between the current filelist in root dir
|
||||
// for that, we will make a diff between the current filelist in root dir
|
||||
// and the archive file list we previously saved
|
||||
// files to remove : differences between complete list and archive list
|
||||
if (!file_exists($this->autoupgradePath.DIRECTORY_SEPARATOR.$this->toRemoveFileList))
|
||||
@@ -989,7 +1033,7 @@ class AdminSelfUpgrade extends AdminSelfTab
|
||||
$toRemove = array_diff($this->_listFilesInDir($this->prodRootDir), $fromArchive);
|
||||
file_put_contents($this->autoupgradePath.DIRECTORY_SEPARATOR.$this->toRemoveFileList,serialize($toRemove));
|
||||
}
|
||||
|
||||
|
||||
if (!isset($toRemove))
|
||||
$toRemove = unserialize(file_get_contents($this->toRemoveFileList));
|
||||
|
||||
@@ -1007,8 +1051,8 @@ class AdminSelfUpgrade extends AdminSelfTab
|
||||
else
|
||||
{
|
||||
$checkFile = array_shift($toRemove);
|
||||
//
|
||||
if (in_array($checkFile, $toRemove)
|
||||
//
|
||||
if (in_array($checkFile, $toRemove)
|
||||
&& !$this->_skipFile('', $path.$file, 'backup')
|
||||
&& !$this->_skipFile('', $path.$file, 'upgrade')
|
||||
)
|
||||
@@ -1461,8 +1505,7 @@ class AdminSelfUpgrade extends AdminSelfTab
|
||||
*/
|
||||
public function displayConf()
|
||||
{
|
||||
|
||||
if (version_compare(_PS_VERSION_,'1.4.6.0','<') AND false)
|
||||
if (version_compare(_PS_VERSION_,'1.4.5.0','<') AND false)
|
||||
$this->_errors[] = Tools::displayError('This class depends of several files modified in 1.4.5.0 version and should not be used in an older version');
|
||||
parent::displayConf();
|
||||
}
|
||||
@@ -1470,10 +1513,10 @@ class AdminSelfUpgrade extends AdminSelfTab
|
||||
public function ajaxPreProcess()
|
||||
{
|
||||
/* PrestaShop demo mode */
|
||||
if (_PS_MODE_DEMO_)
|
||||
if (defined('_PS_MODE_DEMO_') && _PS_MODE_DEMO_)
|
||||
return;
|
||||
/* PrestaShop demo mode*/
|
||||
|
||||
|
||||
if (!empty($_POST['responseType']) AND $_POST['responseType'] == 'json')
|
||||
header('Content-Type: application/json');
|
||||
|
||||
@@ -1587,7 +1630,7 @@ txtError[37] = "'.$this->l('The config/defines.inc.php file was not found. Where
|
||||
}
|
||||
|
||||
/** this returns fieldset containing the configuration points you need to use autoupgrade
|
||||
* @return string
|
||||
* @return string
|
||||
*/
|
||||
private function getCurrentConfiguration()
|
||||
{
|
||||
@@ -1597,6 +1640,19 @@ txtError[37] = "'.$this->l('The config/defines.inc.php file was not found. Where
|
||||
<p>'.$this->l('All the following points must be ok in order to allow the upgrade.').'</p>
|
||||
<b>'.$this->l('Root directory').' : </b>'.$this->prodRootDir.'<br/><br/>';
|
||||
|
||||
if ($this->checkAutoupgradeLastVersion())
|
||||
$srcModuleVersion = '../img/admin/enabled.gif';
|
||||
else
|
||||
$srcModuleVersion = '../img/admin/disabled.gif';
|
||||
|
||||
if ($module_version = simplexml_load_file(dirname(__FILE__).'/config.xml'))
|
||||
$module_version = (string)$module_version->version;
|
||||
|
||||
$content .= '<b>'.$this->l('Module version').' : </b>'
|
||||
.'<img src="'.$srcModuleVersion.'" /> '
|
||||
.sprintf($this->lastAutoupgradeVersion?
|
||||
$this->l('You have the last version (%s)'):$this->l('You currently use the version %1$s of the autoupgrade module. Please install the last version (%2$s)'), $module_version, $this->upgrader->autoupgrade_last_version).'<br/><br/>';
|
||||
|
||||
if ($this->rootWritable)
|
||||
$srcRootWritable = '../img/admin/enabled.gif';
|
||||
else
|
||||
@@ -1645,7 +1701,7 @@ txtError[37] = "'.$this->l('The config/defines.inc.php file was not found. Where
|
||||
$configurationDone = '../img/admin/enabled.gif';
|
||||
else
|
||||
$configurationDone = '../img/admin/disabled.gif';
|
||||
$content .= '<b>'.$this->l('Options chosen').' : </b>'.'<img src="'.$configurationDone.'" />
|
||||
$content .= '<b>'.$this->l('Options chosen').' : </b>'.'<img src="'.$configurationDone.'" />
|
||||
<a class="button" id="scrollToOptions" href="#options">'
|
||||
.($testConfigDone
|
||||
?$this->l('autoupgrade configuration ok').' - '.$this->l('Modify your options')
|
||||
@@ -1673,7 +1729,7 @@ txtError[37] = "'.$this->l('The config/defines.inc.php file was not found. Where
|
||||
$content .= '<script type="text/javascript">
|
||||
$("#currentConfigurationToggle").click(function(e){e.preventDefault();$("#currentConfiguration").toggle()});'
|
||||
.($this->configOk()?'$("#currentConfiguration").hide();$("#currentConfigurationToggle").after("<img src=\"../img/admin/enabled.gif\" />");':'').'</script>';
|
||||
$content .= '<div style="float:left">
|
||||
$content .= '<div style="clear:left"> </div><div style="float:left">
|
||||
<h1>'.sprintf($this->l('Your current prestashop version : %s '),_PS_VERSION_).'</h1>';
|
||||
$content .= '<p>'.sprintf($this->l('Last version is %1$s (%2$s) '), $this->upgrader->version_name, $this->upgrader->version_num).'</p>';
|
||||
|
||||
@@ -1700,10 +1756,10 @@ txtError[37] = "'.$this->l('The config/defines.inc.php file was not found. Where
|
||||
{
|
||||
$content .= '<span class="button-autoupgrade upgradestep" >'.$this->l('Your shop is already up to date.').'</span> ';
|
||||
}
|
||||
$content .= '<br/><br/><small>'.sprintf($this->l('last datetime check : %s '),date('Y-m-d H:i:s',Configuration::get('PS_LAST_VERSION_CHECK'))).'</span>
|
||||
$content .= '<br/><br/><small>'.sprintf($this->l('last datetime check : %s '),date('Y-m-d H:i:s',Configuration::get('PS_LAST_VERSION_CHECK'))).'</span>
|
||||
<a class="button" href="index.php?tab=AdminSelfUpgrade&token='.Tools::getAdminToken('AdminSelfUpgrade'.(int)(Tab::getIdFromClassName(get_class($this))).(int)$cookie->id_employee).'&refreshCurrentVersion=1">'.$this->l('Please click to refresh').'</a>
|
||||
</small>';
|
||||
|
||||
|
||||
$content .= '</div>
|
||||
<div id="currentlyProcessing" style="display:none;float:right"><h4>Currently processing <img id="pleaseWait" src="'.__PS_BASE_URI__.'img/loader.gif"/></h4>
|
||||
|
||||
@@ -1747,7 +1803,7 @@ txtError[37] = "'.$this->l('The config/defines.inc.php file was not found. Where
|
||||
else
|
||||
$content .= '<p>'.$this->l('Your current configuration does not allow upgrade.').'</p>';
|
||||
|
||||
$content .= '<br/><br/><small>'.sprintf($this->l('last datetime check : %s '),date('Y-m-d H:i:s',Configuration::get('PS_LAST_VERSION_CHECK'))).'</span>
|
||||
$content .= '<br/><br/><small>'.sprintf($this->l('last datetime check : %s '),date('Y-m-d H:i:s',Configuration::get('PS_LAST_VERSION_CHECK'))).'</span>
|
||||
<a class="button" href="index.php?tab=AdminSelfUpgrade&token='.Tools::getAdminToken('AdminSelfUpgrade'.(int)(Tab::getIdFromClassName(get_class($this))).(int)$cookie->id_employee).'&refreshCurrentVersion=1">'.$this->l('Please click to refresh').'</a>
|
||||
</small>';
|
||||
|
||||
@@ -1773,14 +1829,13 @@ txtError[37] = "'.$this->l('The config/defines.inc.php file was not found. Where
|
||||
public function display()
|
||||
{
|
||||
/* PrestaShop demo mode */
|
||||
if (_PS_MODE_DEMO_)
|
||||
if (defined('_PS_MODE_DEMO_') && _PS_MODE_DEMO_)
|
||||
{
|
||||
echo '<div class="error">'.Tools::displayError('This functionnality has been disabled.').'</div>';
|
||||
return;
|
||||
}
|
||||
/* PrestaShop demo mode*/
|
||||
|
||||
|
||||
if(isset($_GET['refreshCurrentVersion']))
|
||||
{
|
||||
$upgrader = new Upgrader();
|
||||
@@ -1823,7 +1878,7 @@ txtError[37] = "'.$this->l('The config/defines.inc.php file was not found. Where
|
||||
$this->_displayForm('autoUpgradeOptions',$this->_fieldsAutoUpgrade,'<a href="" name="options" id="options">'.$this->l('Options').'</a>', '','prefs');
|
||||
// @todo manual upload with a form
|
||||
|
||||
// We need jquery 1.6 for json
|
||||
// We need jquery 1.6 for json
|
||||
echo '<script type="text/javascript">
|
||||
jq13 = jQuery.noConflict(true);
|
||||
</script>
|
||||
@@ -2225,7 +2280,7 @@ function handleError(res)
|
||||
$("#cchangedList").append("<br/>");
|
||||
|
||||
}';
|
||||
|
||||
|
||||
$js.= '$(document).ready(function(){
|
||||
$.ajax({
|
||||
type:"POST",
|
||||
@@ -2264,6 +2319,7 @@ function handleError(res)
|
||||
,
|
||||
error: function(res,textStatus,jqXHR)
|
||||
{
|
||||
//$("#checkPrestaShopFilesVersion").html("<img src=\"../img/admin/warning.gif\" /> "+textStatus);
|
||||
if (textStatus == "timeout" && action == "download")
|
||||
{
|
||||
updateInfoStep("'.$this->l('Your server can\'t download the file. Please upload it first by ftp in your admin/autoupgrade directory').'");
|
||||
@@ -2299,7 +2355,7 @@ function handleError(res)
|
||||
$zip = new ZipArchive();
|
||||
if ($zip->open($fromFile) === true)
|
||||
{
|
||||
if (@$zip->extractTo($toDir.'/')
|
||||
if (@$zip->extractTo($toDir.'/')
|
||||
&& $zip->close()
|
||||
)
|
||||
{
|
||||
|
||||
@@ -39,15 +39,26 @@ class UpgraderCore
|
||||
|
||||
public $version_name;
|
||||
public $version_num;
|
||||
public $version_is_modified = null;
|
||||
/**
|
||||
* @var string contains hte url where to download the file
|
||||
*/
|
||||
public $link;
|
||||
public $autoupgrade;
|
||||
public $autoupgrade_module;
|
||||
public $autoupgrade_last_version;
|
||||
public $changelog;
|
||||
public $md5;
|
||||
|
||||
public function __construct($autoload = false)
|
||||
{
|
||||
if ($autoload)
|
||||
{
|
||||
$this->loadFromConfig();
|
||||
// checkPSVersion to get need_upgrade
|
||||
$this->checkPSVersion();
|
||||
}
|
||||
}
|
||||
public function __get($var)
|
||||
{
|
||||
if ($var == 'need_upgrade')
|
||||
@@ -90,8 +101,7 @@ class UpgraderCore
|
||||
*/
|
||||
public function checkPSVersion($force = false)
|
||||
{
|
||||
if (empty($this->link))
|
||||
{
|
||||
|
||||
if (class_exists('Configuration'))
|
||||
$last_check = Configuration::get('PS_LAST_VERSION_CHECK');
|
||||
else
|
||||
@@ -103,7 +113,6 @@ class UpgraderCore
|
||||
libxml_set_streams_context(@stream_context_create(array('http' => array('timeout' => 3))));
|
||||
if ($feed = @simplexml_load_file($this->rss_version_link))
|
||||
{
|
||||
|
||||
$this->version_name = (string)$feed->version->name;
|
||||
$this->version_num = (string)$feed->version->num;
|
||||
$this->link = (string)$feed->download->link;
|
||||
@@ -111,6 +120,7 @@ class UpgraderCore
|
||||
$this->changelog = (string)$feed->download->changelog;
|
||||
$this->autoupgrade = (int)$feed->autoupgrade;
|
||||
$this->autoupgrade_module = (int)$feed->autoupgrade_module;
|
||||
$this->autoupgrade_last_version = (string)$feed->autoupgrade_last_version;
|
||||
$this->desc = (string)$feed->desc ;
|
||||
$config_last_version = array(
|
||||
'name' => $this->version_name,
|
||||
@@ -119,6 +129,7 @@ class UpgraderCore
|
||||
'md5' => $this->md5,
|
||||
'autoupgrade' => $this->autoupgrade,
|
||||
'autoupgrade_module' => $this->autoupgrade_module,
|
||||
'autoupgrade_last_version' => $this->autoupgrade_last_version,
|
||||
'changelog' => $this->changelog,
|
||||
'desc' => $this->desc
|
||||
);
|
||||
@@ -130,8 +141,29 @@ class UpgraderCore
|
||||
}
|
||||
}
|
||||
else
|
||||
$this->loadFromConfig();
|
||||
// retro-compatibility :
|
||||
// return array(name,link) if you don't use the last version
|
||||
// false otherwise
|
||||
if (version_compare(_PS_VERSION_, $this->version_num, '<'))
|
||||
{
|
||||
$this->need_upgrade = true;
|
||||
return array('name' => $this->version_name, 'link' => $this->link);
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* load the last version informations stocked in base
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function loadFromConfig()
|
||||
{
|
||||
$last_version_check = @unserialize(Configuration::get('PS_LAST_VERSION'));
|
||||
if($last_version_check)
|
||||
{
|
||||
if (isset($last_version_check['name']))
|
||||
$this->version_name = $last_version_check['name'];
|
||||
if (isset($last_version_check['num']))
|
||||
@@ -142,6 +174,8 @@ class UpgraderCore
|
||||
$this->autoupgrade = $last_version_check['autoupgrade'];
|
||||
if (isset($last_version_check['autoupgrade_module']))
|
||||
$this->autoupgrade_module = $last_version_check['autoupgrade_module'];
|
||||
if (isset($last_version_check['autoupgrade_last_version']))
|
||||
$this->autoupgrade_last_version = $last_version_check['autoupgrade_last_version'];
|
||||
if (isset($last_version_check['md5']))
|
||||
$this->md5 = $last_version_check['md5'];
|
||||
if (isset($last_version_check['desc']))
|
||||
@@ -149,26 +183,23 @@ class UpgraderCore
|
||||
if (isset($last_version_check['changelog']))
|
||||
$this->changelog = $last_version_check['changelog'];
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
// retro-compatibility :
|
||||
// return array(name,link) if you don't use the last version
|
||||
// false otherwise
|
||||
if (version_compare(_PS_VERSION_, $this->version_num, '<'))
|
||||
{
|
||||
$this->need_upgrade = true;
|
||||
return array('name' => $this->version_name, 'link' => $this->link);
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* return an array of files
|
||||
* that the md5file does not match to the original md5file (provided by $rss_md5file_link_dir )
|
||||
* @return void
|
||||
*/
|
||||
public function getChangedFilesList()
|
||||
{
|
||||
if (count($this->changed_files) == 0)
|
||||
if (is_array($this->changed_files) && count($this->changed_files) == 0)
|
||||
{
|
||||
$checksum = @simplexml_load_file($this->rss_md5file_link_dir._PS_VERSION_.'.xml');
|
||||
if ($checksum === false)
|
||||
return false;
|
||||
if ($checksum == false)
|
||||
{
|
||||
$this->changed_files = false;
|
||||
}
|
||||
else
|
||||
$this->browseXmlAndCompare($checksum->ps_root_dir[0]);
|
||||
}
|
||||
@@ -248,6 +279,7 @@ class UpgraderCore
|
||||
|
||||
public function isAuthenticPrestashopVersion()
|
||||
{
|
||||
|
||||
$this->getChangedFilesList();
|
||||
return !$this->version_is_modified;
|
||||
}
|
||||
|
||||
@@ -31,7 +31,10 @@ class Autoupgrade extends Module
|
||||
{
|
||||
$this->name = 'autoupgrade';
|
||||
$this->tab = 'administration';
|
||||
$this->version = 0.1;
|
||||
// version number x.y.z
|
||||
// y+1 means a major bugfix or improvement
|
||||
// z+1 means a bugfix
|
||||
$this->version = '0.2.1';
|
||||
|
||||
if (!defined('_PS_ADMIN_DIR_'))
|
||||
{
|
||||
@@ -53,7 +56,6 @@ class Autoupgrade extends Module
|
||||
|
||||
public function install()
|
||||
{
|
||||
|
||||
$res = true;
|
||||
// before adding AdminSelfUpgrade, we should remove AdminUpgrade
|
||||
$idTab = Tab::getIdFromClassName('AdminUpgrade');
|
||||
@@ -72,7 +74,9 @@ class Autoupgrade extends Module
|
||||
$tab->class_name = 'AdminSelfUpgrade';
|
||||
$tab->module = 'autoupgrade';
|
||||
$tab->id_parent = 9;
|
||||
$tab->name = array_fill(1, sizeof(Language::getLanguages(false)), 'Upgrade');
|
||||
$languages = Language::getLanguages(false);
|
||||
foreach ($languages as $lang)
|
||||
$tab->name[$lang['id_lang']] = 'Upgrade';
|
||||
$res &= $tab->save();
|
||||
}
|
||||
else
|
||||
@@ -103,12 +107,18 @@ class Autoupgrade extends Module
|
||||
|
||||
public function uninstall()
|
||||
{
|
||||
$idtab = Configuration::get('PS_AUTOUPDATE_MODULE_IDTAB');
|
||||
$tab = new Tab($idtab,1);
|
||||
$id_tab = Configuration::get('PS_AUTOUPDATE_MODULE_IDTAB');
|
||||
if ($id_tab)
|
||||
{
|
||||
$tab = new Tab($id_tab,1);
|
||||
$res = $tab->delete();
|
||||
}
|
||||
else
|
||||
$res = true;
|
||||
// for people in 1.4.4.0 or 1.4.4.1, we have to remove that file
|
||||
// and of course delete it in the database.
|
||||
if (file_exists(_PS_ADMIN_DIR_.DIRECTORY_SEPARATOR.'tabs'.'AdminUpgrade.php'))
|
||||
{
|
||||
// Should we create the correct AdminUpgrade tab (not the module)
|
||||
if($idOldTab = Tab::getIdFromClassName('AdminUpgrade'))
|
||||
{
|
||||
$tab = new Tab($idOldTab);
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<module>
|
||||
<name>autoupgrade</name>
|
||||
<displayName><![CDATA[Autoupgrade module]]></displayName>
|
||||
<version><![CDATA[0.1]]></version>
|
||||
<version><![CDATA[0.2.1]]></version>
|
||||
<description><![CDATA[Provides an automated method to upgrade your shop to the last PrestaShop version. Caution : custom theme are not updated.]]></description>
|
||||
<author><![CDATA[]]></author>
|
||||
<tab><![CDATA[administration]]></tab>
|
||||
|
||||
@@ -21,7 +21,7 @@ $_MODULE['<{autoupgrade}prestashop>adminselfupgrade_8d8e0207549d32c6f86424640303
|
||||
$_MODULE['<{autoupgrade}prestashop>adminselfupgrade_c62f82b25de72c3b0bb07225c49fe9d0'] = '%1$s fichier(s) du coeur a été modifié (sur %2$s au total)';
|
||||
$_MODULE['<{autoupgrade}prestashop>adminselfupgrade_7b2f224649ef2ad10a2d73595d67a876'] = 'Démarrage mise à niveau ...';
|
||||
$_MODULE['<{autoupgrade}prestashop>adminselfupgrade_6b2d0404b7faba0e791e15a52586a149'] = 'Basculer vers svn checkout (useSvn activé)';
|
||||
$_MODULE['<{autoupgrade}prestashop>adminselfupgrade_f0e38ac0c558a7f216ae98382b9e58f5'] = 'Site désactivé. Téléchargement en cours (peut prendre ';
|
||||
$_MODULE['<{autoupgrade}prestashop>adminselfupgrade_13b35313a987313838f0105902bb6742'] = 'Boutique désactivée. Téléchargement en cours... (ce qui peut prendre un certain temps) ...';
|
||||
$_MODULE['<{autoupgrade}prestashop>adminselfupgrade_6824d57b7af37f605bd97d34defc3761'] = 'Exportation svn terminée. Suppression des fichiers exemples...';
|
||||
$_MODULE['<{autoupgrade}prestashop>adminselfupgrade_f70307d8297e48a8783d41e6f3313d51'] = 'Erreur lors de l\'export SVN';
|
||||
$_MODULE['<{autoupgrade}prestashop>adminselfupgrade_4eecd9c195e46c054ef7da6d9d1a738b'] = 'Extraction terminée. Suppression des fichiers exemples...';
|
||||
@@ -144,7 +144,7 @@ $_MODULE['<{autoupgrade}prestashop>adminselfupgrade_af566be1636d11ecc8ddb728a155
|
||||
$_MODULE['<{autoupgrade}prestashop>adminselfupgrade_ea4d3af79ad2392b7c0cca4b8ddd7028'] = 'Vous avez déjà la dernière version disponible.';
|
||||
$_MODULE['<{autoupgrade}prestashop>adminselfupgrade_bafd7322c6e97d25b6299b5d6fe8920b'] = 'Non';
|
||||
$_MODULE['<{autoupgrade}prestashop>adminselfupgrade_93cba07454f06a4a960172bbd6e2a435'] = 'Oui';
|
||||
$_MODULE['<{autoupgrade}prestashop>adminselfupgrade_3d9f7f5927158b5a7dac0d65b4537265'] = 'Boutique désactivée';
|
||||
$_MODULE['<{autoupgrade}prestashop>adminselfupgrade_69af703e1b0af65d0eb16b85e3ebd738'] = 'Boutique désactivée';
|
||||
$_MODULE['<{autoupgrade}prestashop>adminselfupgrade_94af5df6182efd3591d0ccccaa04bd5c'] = 'Limite de temps PHP';
|
||||
$_MODULE['<{autoupgrade}prestashop>adminselfupgrade_075ae3d2fc31640504f814f60e5ef713'] = 'désactivée';
|
||||
$_MODULE['<{autoupgrade}prestashop>adminselfupgrade_783e8e29e6a8c3e22baa58a19420eb4f'] = 'secondes';
|
||||
|
||||
@@ -274,7 +274,8 @@ return;
|
||||
var removedProductData = null;
|
||||
var removedProductDomId = null;
|
||||
//look for a product to delete...
|
||||
$('#'+parentId+' #cart_block_list dl.products dt').each(function(){
|
||||
$('#'+parentId+' #cart_block_list dl.products dt').each(function()
|
||||
{
|
||||
//retrieve idProduct and idCombination from the displayed product in the block cart
|
||||
var domIdProduct = $(this).attr('id');
|
||||
var firstCut = domIdProduct.replace('cart_block_product_', '');
|
||||
@@ -299,7 +300,6 @@ return;
|
||||
removedProductId = $(this).attr('id');
|
||||
//return false; // Regarding that the customer can only remove products one by one, we break the loop
|
||||
}
|
||||
});
|
||||
|
||||
//if there is a removed product, delete it from the displayed block cart
|
||||
if (removedProductId != null)
|
||||
@@ -324,6 +324,7 @@ return;
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
@@ -24,5 +24,5 @@
|
||||
* International Registred Trademark & Property of PrestaShop SA
|
||||
*}
|
||||
<div id="product_list" class="clear">
|
||||
<p class="warning">{l s='There are no products.'}</p>
|
||||
<p class="warning">{l s='There are no products.' mod='blocklayered'}</p>
|
||||
</div>
|
||||
|
||||
@@ -97,7 +97,7 @@ param_product_url = '#{$param_product_url}';
|
||||
</li>
|
||||
{/foreach}
|
||||
{else}
|
||||
<label for="{$filter.type}">{l s='Range:'}</label> <span id="layered_{$filter.type}_range"></span>
|
||||
<label for="{$filter.type}">{l s='Range:' mod='blocklayered'}</label> <span id="layered_{$filter.type}_range"></span>
|
||||
<div style="margin: 6px 0 6px 6px; width: 93%;">
|
||||
<div style="margin-top:5px;" class="layered_slider" id="layered_{$filter.type}_slider"></div>
|
||||
</div>
|
||||
|
||||
@@ -46,11 +46,21 @@ class BlockSearch extends Module
|
||||
|
||||
public function install()
|
||||
{
|
||||
if (!parent::install() || !$this->registerHook('top'))
|
||||
if (!parent::install() || !$this->registerHook('top') || !$this->registerHook('header'))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
public function hookHeader($params)
|
||||
{
|
||||
if (Configuration::get('PS_SEARCH_AJAX'))
|
||||
{
|
||||
Tools::addCSS(_PS_CSS_DIR_.'jquery.autocomplete.css');
|
||||
Tools::addJS(_PS_JS_DIR_.'jquery/jquery.autocomplete.js');
|
||||
}
|
||||
Tools::addCSS(_THEME_CSS_DIR_.'product_list.css');
|
||||
Tools::addCSS(($this->_path).'blocksearch.css', 'all');
|
||||
}
|
||||
|
||||
public function hookLeftColumn($params)
|
||||
{
|
||||
@@ -79,15 +89,9 @@ class BlockSearch extends Module
|
||||
{
|
||||
$this->context->smarty->assign('ENT_QUOTES', ENT_QUOTES);
|
||||
$this->context->smarty->assign('search_ssl', Tools::usingSecureMode());
|
||||
$this->context->smarty->assign('ajaxsearch', Configuration::get('PS_SEARCH_AJAX'));
|
||||
$this->context->smarty->assign('instantsearch', Configuration::get('PS_INSTANT_SEARCH'));
|
||||
|
||||
$ajax_search = (int)Configuration::get('PS_SEARCH_AJAX');
|
||||
$this->context->smarty->assign('ajaxsearch', $ajax_search);
|
||||
|
||||
$instant_search = (int)(Configuration::get('PS_INSTANT_SEARCH'));
|
||||
$this->context->smarty->assign('instantsearch', $instant_search);
|
||||
if ($ajax_search)
|
||||
$this->context->controller->addJqueryPlugin('autocomplete');
|
||||
$this->context->controller->addCSS(_THEME_CSS_DIR_.'product_list.css');
|
||||
$this->context->controller->addCSS(($this->_path).'blocksearch.css', 'all');
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
<?php
|
||||
|
||||
global $_MODULE;
|
||||
$_MODULE = array();
|
||||
@@ -60,8 +60,10 @@
|
||||
</span>
|
||||
<a href="javascript:;" class="clear button" onclick="WishlistProductManage('wlp_bought', 'delete', '{$id_wishlist}', '{$product.id_product}', '{$product.id_product_attribute}', $('#quantity_{$product.id_product}_{$product.id_product_attribute}').val(), $('#priority_{$product.id_product}_{$product.id_product_attribute}').val());" title="{l s='Delete' mod='blockwishlist'}">{l s='Delete' mod='blockwishlist'}</a>
|
||||
<a href="javascript:;" class="exclusive" onclick="WishlistProductManage('wlp_bought_{$product.id_product_attribute}', 'update', '{$id_wishlist}', '{$product.id_product}', '{$product.id_product_attribute}', $('#quantity_{$product.id_product}_{$product.id_product_attribute}').val(), $('#priority_{$product.id_product}_{$product.id_product_attribute}').val());" title="{l s='Save' mod='blockwishlist'}">{l s='Save' mod='blockwishlist'}</a>
|
||||
<br />
|
||||
</li>
|
||||
</ul>
|
||||
<div class="clear"> </div>
|
||||
{/foreach}
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
|
||||
@@ -87,6 +87,7 @@
|
||||
</li>
|
||||
</div>
|
||||
</ul>
|
||||
<div class="clear"> </div>
|
||||
{/foreach}
|
||||
<p class="clear" />
|
||||
</div>
|
||||
|
||||
@@ -35,21 +35,21 @@ class dibs extends PaymentModule
|
||||
* @staticvar
|
||||
*/
|
||||
public static $ID_MERCHANT;
|
||||
|
||||
|
||||
/**
|
||||
* The URL of the page to be displayed if the purchase is approved.
|
||||
* @var string
|
||||
* @staticvar
|
||||
*/
|
||||
private static $ACCEPTED_URL = '';
|
||||
|
||||
|
||||
/**
|
||||
* The URL of the page to be displayed if the customer cancels the payment.
|
||||
* @var string
|
||||
* @staticvar
|
||||
*/
|
||||
private static $CANCELLED_URL = '';
|
||||
|
||||
|
||||
/**
|
||||
* Set the testing mode.
|
||||
* @var string
|
||||
@@ -61,19 +61,19 @@ class dibs extends PaymentModule
|
||||
* @var array
|
||||
*/
|
||||
public static $MORE_SETTINGS;
|
||||
|
||||
|
||||
/**
|
||||
* @var string
|
||||
* @staticvar
|
||||
*/
|
||||
private static $site_url;
|
||||
|
||||
|
||||
/**
|
||||
* Only this langs array are allowed in DIBS API
|
||||
* @var array
|
||||
*/
|
||||
private static $accepted_lang = array('da','en','es','fi','fo','fr','it','nl','no','pl','sv');
|
||||
|
||||
|
||||
/**
|
||||
* Formular link to DIBS subscription
|
||||
* @var array
|
||||
@@ -97,7 +97,7 @@ class dibs extends PaymentModule
|
||||
|
||||
$this->displayName = $this->l('DIBS');
|
||||
$this->description = $this->l('DIBS payment API');
|
||||
|
||||
|
||||
if (self::$site_url === NULL)
|
||||
{
|
||||
if(method_exists('Tools', 'getProtocol'))
|
||||
@@ -105,13 +105,13 @@ class dibs extends PaymentModule
|
||||
else
|
||||
self::$site_url = Tools::htmlentitiesutf8((!is_null($use_ssl) && $use_ssl ? 'https://' : 'http://').$_SERVER['HTTP_HOST'].__PS_BASE_URI__);
|
||||
}
|
||||
|
||||
|
||||
self::$ID_MERCHANT = Configuration::get('DIBS_ID_MERCHANT');
|
||||
self::$ACCEPTED_URL = Configuration::get('DIBS_ACCEPTED_URL');
|
||||
self::$CANCELLED_URL = Configuration::get('DIBS_CANCELLED_URL');
|
||||
self::$TESTING = (int)Configuration::get('DIBS_TESTING');
|
||||
self::$MORE_SETTINGS = Configuration::get('DIBS_MORE_SETTINGS') != '' ? unserialize(Tools::htmlentitiesDecodeUTF8(Configuration::get('DIBS_MORE_SETTINGS'))) : array();
|
||||
|
||||
|
||||
if (!isset(self::$MORE_SETTINGS['k1'])
|
||||
OR (isset(self::$MORE_SETTINGS['k1']) AND (self::$MORE_SETTINGS['k1'] === '' OR self::$MORE_SETTINGS['k2'] === '') ))
|
||||
$this->warning = $this->l('For security reasons, you must set key #1 and key #2 used by MD5 control of DIBS API.');
|
||||
@@ -128,9 +128,9 @@ class dibs extends PaymentModule
|
||||
|
||||
public function install()
|
||||
{
|
||||
return (parent::install()
|
||||
AND $this->registerHook('orderConfirmation')
|
||||
AND $this->registerHook('payment')
|
||||
return (parent::install()
|
||||
AND $this->registerHook('orderConfirmation')
|
||||
AND $this->registerHook('payment')
|
||||
AND Configuration::updateValue('DIBS_ACCEPTED_URL', self::$site_url.(substr(trim(self::$site_url), -1, 1) === '/' ? '' : '/').'order-confirmation.php')
|
||||
AND Configuration::updateValue('DIBS_CANCELLED_URL', self::$site_url)
|
||||
AND Configuration::updateValue('DIBS_TESTING', 1)
|
||||
@@ -153,7 +153,7 @@ class dibs extends PaymentModule
|
||||
return;
|
||||
if ($params['objOrder']->module != $this->name)
|
||||
return;
|
||||
|
||||
|
||||
if ($params['objOrder']->valid)
|
||||
$this->context->smarty->assign(array('status' => 'ok', 'id_order' => $params['objOrder']->id));
|
||||
else
|
||||
@@ -173,17 +173,17 @@ class dibs extends PaymentModule
|
||||
self::$MORE_SETTINGS['logo_color'] = Tools::getValue('logo_color');
|
||||
self::$MORE_SETTINGS['k1'] = Tools::getValue('k1');
|
||||
self::$MORE_SETTINGS['k2'] = Tools::getValue('k2');
|
||||
|
||||
|
||||
Configuration::updateValue('DIBS_ID_MERCHANT', self::$ID_MERCHANT);
|
||||
Configuration::updateValue('DIBS_ACCEPTED_URL', self::$ACCEPTED_URL);
|
||||
Configuration::updateValue('DIBS_CANCELLED_URL', self::$CANCELLED_URL);
|
||||
Configuration::updateValue('DIBS_TESTING', self::$TESTING);
|
||||
Configuration::updateValue('DIBS_MORE_SETTINGS', Tools::htmlentitiesUTF8(serialize(self::$MORE_SETTINGS)));
|
||||
|
||||
|
||||
$data_sync = '';
|
||||
if(self::$ID_MERCHANT !== '' AND self::$TESTING !== 1 AND self::$MORE_SETTINGS['k1'] !== '' AND self::$MORE_SETTINGS['k2'] !== '')
|
||||
$data_sync = '<img src="http://www.prestashop.com/modules/dibs.png?site_id='.urlencode(self::$ID_MERCHANT).'" style="float:right" />';
|
||||
|
||||
|
||||
echo '<div class="conf confirm"><img src="../img/admin/ok.gif"/>'.$this->l('Configuration updated').$data_sync.'</div>';
|
||||
}
|
||||
}
|
||||
@@ -219,7 +219,7 @@ class dibs extends PaymentModule
|
||||
public function getContent()
|
||||
{
|
||||
$this->preProcess();
|
||||
|
||||
|
||||
$flexwin_colors = array('sand', 'grey', 'blue');
|
||||
$logo_colors = array('yellow', 'grey', 'blue', 'black', 'purple', 'green');
|
||||
$str = '<h2>'.$this->displayName.'</h2>'
|
||||
@@ -282,7 +282,7 @@ class dibs extends PaymentModule
|
||||
|
||||
public function hookPayment($params)
|
||||
{
|
||||
if ((self::$ID_MERCHANT === false || self::$ID_MERCHANT === '' || self::$ID_MERCHANT === NULL)
|
||||
if ((self::$ID_MERCHANT === false || self::$ID_MERCHANT === '' || self::$ID_MERCHANT === NULL)
|
||||
|| (self::$ACCEPTED_URL === false || self::$ACCEPTED_URL === '' || self::$ACCEPTED_URL === NULL))
|
||||
return '';
|
||||
|
||||
@@ -298,7 +298,7 @@ class dibs extends PaymentModule
|
||||
// Required
|
||||
$dibsParams['merchant'] = self::$ID_MERCHANT; // id merchant send from DIBS e-mail
|
||||
|
||||
// don't cast to int !! It has strange behaviour (really strange)
|
||||
// don't cast to int !! It has strange behaviour (really strange)
|
||||
// for example : When calculate a total amount of 557.05, the result is 55704 after casting !!
|
||||
$dibsParams['amount'] = $params['cart']->getOrderTotal(true, Cart::BOTH) * 100; // The smallest unit of an amount, cent for EUR
|
||||
$dibsParams['accepturl'] = self::$ACCEPTED_URL.'?id_cart='.(int)($params['cart']->id).'&id_module='.(int)($this->id).'&key='.$customer->secure_key; // The URL of the page to be displayed if the purchase is approved.
|
||||
@@ -333,12 +333,12 @@ class dibs extends PaymentModule
|
||||
if(self::$TESTING === 1)
|
||||
$dibsParams['test'] = 'yes'; // optional - This field is used when tests are being conducted on the shop (e.g. test=yes). When this field is declared, the transaction is not dispatched to the card issuer, but is instead handled by the DIBS test module. See also Step 5 of the 10 Step Guide for more information. During your initial integration with DIBS, there is no need to insert this parameter, since all default transactions will hit the DIBS test system until DIBS has approved integration. Should the test system be used at a later date, this will be activated at DIBS (contact DIBS support for reactivating the test mode of your shop).
|
||||
$dibsParams['lang'] = in_array(strtolower($lang->iso_code), self::$accepted_lang) ? $lang->iso_code : ''; // optional - This parameter determines the language in which the page will be opened. The following values are accepted: da=Danish en=English es=Spanish fi=Finnish fo=Faroese fr=French it=Italian nl=Dutch no=Norwegian pl=Polish (simplified) sv=Swedish Default language is Danish.
|
||||
$dibsParams['color'] = self::$MORE_SETTINGS['flexwin_color']; // optional - The basic color theme of FlexWin. There is currently a choice of "sand", "grey" and "blue". The default value is "blue".
|
||||
$dibsParams['color'] = self::$MORE_SETTINGS['flexwin_color']; // optional - The basic color theme of FlexWin. There is currently a choice of "sand", "grey" and "blue". The default value is "blue".
|
||||
$dibsParams['cancelurl'] = self::$CANCELLED_URL; // optional - The URL of the page to be displayed if the customer cancels the payment.
|
||||
$dibsParams['uniqueoid'] = (int)($params['cart']->id).'_'.date('YmdHis').'_'.$params['cart']->secure_key; // optional - If this field exists, the orderid-field must be unique, i.e. there is no existing transaction with DIBS with the same order number. If such a transaction already exists, payment will be rejected with reason=7. Unless you are unable to generate unique order numbers, we strongly urge you to utilize this field.Note: Order numbers can be composed of a maximum of 50 characters (DIBS automatically removes surplus characters) and that uniqueoid is therefore unable to work as intended if order numbers consisting of more than 50 characters are used.
|
||||
$dibsParams['callbackurl'] = self::$site_url.'modules/'.$this->name.'/validation.php'; // optional - An optional �server-to-server� call which tells the shop�s server that payment was a success. Can be used for many purposes, the most important of these being the ability to register the order in your own system without depending on the customer�s browser hitting a specific page of the shop. See also HTTP_COOKIE.
|
||||
$md5_params = 'merchant='.self::$ID_MERCHANT.'&orderid='.$dibsParams['orderid'].'¤cy='.$dibsParams['currency'].'&amount='.$dibsParams['amount'];
|
||||
$dibsParams['md5key'] = md5(self::$MORE_SETTINGS['k2'].md5(self::$MORE_SETTINGS['k1'].$md5_params)); // optional - This variable enables a MD5 key control of the values received by DIBS. This control confirms that the values sent to DIBS has not been tampered with during the transfer. The MD5 key is calculated as: MD5(key2 + MD5(key1 + "merchant=&orderid=&transact=")) Where key1 and key2 are shop specific keys available through the DIBS administration interface, and + is the concatenation operator. NB! MD5 key check must also be enabled through the DIBS administration interface in order to work. Further details on MD5-key control.
|
||||
$dibsParams['md5key'] = md5(self::$MORE_SETTINGS['k2'].md5(self::$MORE_SETTINGS['k1'].$md5_params)); // optional - This variable enables a MD5 key control of the values received by DIBS. This control confirms that the values sent to DIBS has not been tampered with during the transfer. The MD5 key is calculated as: MD5(key2 + MD5(key1 + "merchant=&orderid=&transact=")) Where key1 and key2 are shop specific keys available through the DIBS administration interface, and + is the concatenation operator. NB! MD5 key check must also be enabled through the DIBS administration interface in order to work. Further details on MD5-key control.
|
||||
|
||||
// @todo need more infos.
|
||||
$dibsParams['account'] = ''; // optional - If multiple departments utilize the company's acquirer agreement with PBS, it may prove practical to keep the transactions separate at DIBS. An "account number" may be inserted in this field, so as to separate transactions at DIBS.
|
||||
@@ -346,12 +346,12 @@ class dibs extends PaymentModule
|
||||
$dibsParams['capturenow'] = ''; // optional - If this field exists, an "instant capture" is carried out, i.e. the amount is immediately transferred from the customer's account to the shop's account. This function can only be utilized in the event that there is no actual physical delivery of any items. Contact DIBS when using this function. (Note that instant capture requires unique order numbers - also see the description of uniqueoid above).
|
||||
$dibsParams['ip'] = ''; // optional - DIBS retains the IP-number from which a card transaction is carried out. The IP-number is used for �fraud control�, etc. Some implementations may send the IP number of the shop to DIBS rather than that of the customer's machine. In order to provide the same services to shops which utilize such a program for their DIBS hookup, we offer the option of sending the "ip" parameter.
|
||||
$dibsParams['paytype'] = ''; // optional - Regarding the start-up of the DIBS FlexWin, the user can be limited to the use of just one particular payment form. This is accomplished by using the parameter "paytype". This function can be used if you wish for example to use integration method 3 for payment cards and method 1 for eDankort. Furthermore, this function can be used if you wish to control the user's selections of method of payment from your own website. You can also specify a list of payment methods that will be shown in the Flexwin. This list should be a comma separated with no spaces in between. Example: See our list of possible paytypes.
|
||||
$dibsParams['maketicket'] = ''; // optional - This parameter is intended for FlexWin, and actually performs two transactions. First it performs a regular authorisation. If, and only if, it is accepted, it is followed by a ticket registration. Both a transaction and a ticket value are returned to "accepturl" if it is specified. If "callbackurl" is specified, DIBS will perform two separate calls, corresponding to performing two transactions - one call to the regular authorisation, and another to the ticket registration. Both cases return a "transact" parameter value (e.g. transact="78901234"). In calls to "callbackurl" containing "preauth", the ticket value is composed of the "transact" parameter value. "maketicket" implicitly sets the "preauth" parameter - however, you should avoid to explicitly specify any "preauth" parameter. You cannot use "uniqueoid", "capturenow" or "md5key" along with "maketicket". Currently "maketicket" does not work with 3Dsecure.
|
||||
$dibsParams['maketicket'] = ''; // optional - This parameter is intended for FlexWin, and actually performs two transactions. First it performs a regular authorisation. If, and only if, it is accepted, it is followed by a ticket registration. Both a transaction and a ticket value are returned to "accepturl" if it is specified. If "callbackurl" is specified, DIBS will perform two separate calls, corresponding to performing two transactions - one call to the regular authorisation, and another to the ticket registration. Both cases return a "transact" parameter value (e.g. transact="78901234"). In calls to "callbackurl" containing "preauth", the ticket value is composed of the "transact" parameter value. "maketicket" implicitly sets the "preauth" parameter - however, you should avoid to explicitly specify any "preauth" parameter. You cannot use "uniqueoid", "capturenow" or "md5key" along with "maketicket". Currently "maketicket" does not work with 3Dsecure.
|
||||
$dibsParams['postype'] = ''; // optional - "postype" (one 't') is used when one wishes to register the transaction origin. For normal internet transaction it is not required to include "postype", as it is automatically set to SSL. Possible values are: ssl = internet transactions, magnetic = magnetic stripe read, and signature is available, magnosig = magnetic stripe read, and no signature is available, mail = mail order, manual = manually entered, phone = phone order, signature = card and signature available, manually entered.
|
||||
$dibsParams['ticketrule'] = ''; // optional - Set the value of this parameter to the same as defined by you in DIBS Admin.
|
||||
$dibsParams['preauth'] = ''; // optional - When preauth=true is sent as part of the request to auth.cgi the DIBS server identifies the authorisation as a ticket authorisation rather than a normal transaction. Please note that the pre-authorised transaction is NOT available among the transactions in the DIBS administration interface. When using MD5 the Authkey must be calculated from the string transact=12345678&preauth=true¤cy=123
|
||||
|
||||
// @todo Since Prestashop manage vouchers, ask if necessary to use this params
|
||||
// @todo Since Prestashop manage vouchers, ask if necessary to use this params
|
||||
$dibsParams['voucher'] = ''; // optional - If set to "yes", then the list of payment types on the first page of FlexWin will contain vouchers, too. If FlexWin is called with a paytype, which would lead directly to the payment form, the customer is given the choice of entering a voucher code first.
|
||||
$dibsParams['split'] = ''; // optional - "split" is used for splitting up a transaction into two or more sub-transactions. This enables part of an order to be paid for when shipped in part. It requires that the amount and currency of the part payments are known at the time of the order, and are posted to the DIBS server as: split=2&amount1=&amount2=
|
||||
|
||||
@@ -404,9 +404,9 @@ class dibs extends PaymentModule
|
||||
$this->context->smarty->assign('logo_color', self::$MORE_SETTINGS['logo_color']);
|
||||
return $this->display(__FILE__, 'dibs.tpl');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set the detail of a payment to prepare the validate order
|
||||
* Set the detail of a payment - Call after un validateOrder
|
||||
* See Authorize documentation to know the associated key => value
|
||||
* @param array fields
|
||||
* @return bool success state
|
||||
@@ -417,18 +417,17 @@ class dibs extends PaymentModule
|
||||
if (isset($this->pcc))
|
||||
{
|
||||
$this->pcc->transaction_id = (string)$response['transact'];
|
||||
|
||||
|
||||
// 50 => Card number (XXXX0000)
|
||||
$this->pcc->card_number = (string)substr($response['cardnomask'], -4);
|
||||
|
||||
|
||||
// 51 => Card Mark (Visa, Master card)
|
||||
$this->pcc->card_brand = (string)$response['paytype'];
|
||||
|
||||
|
||||
$this->pcc->card_expiration = '0000';
|
||||
|
||||
|
||||
// 68 => Owner name
|
||||
$this->pcc->card_holder = '';
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
|
||||
|
||||
include(dirname(__FILE__). '/../../config/config.inc.php');
|
||||
include(dirname(__FILE__).'/dibs.php');
|
||||
|
||||
@@ -19,7 +19,7 @@ if (count($_POST))
|
||||
$secure_cart = explode('_', $posted_values['uniqueoid']);
|
||||
$arr_order_id = explode('_',$posted_values['orderid']);
|
||||
$posted_values['orderid'] = $arr_order_id[0];
|
||||
|
||||
|
||||
if ((string)$posted_values['merchant'] !== (string)dibs::$ID_MERCHANT)
|
||||
$errors[] = Tools::displayError('You did not use the correct merchant ID.');
|
||||
|
||||
@@ -42,11 +42,10 @@ if (count($_POST))
|
||||
$message = nl2br(strip_tags($message));
|
||||
if ($valid_order === true)
|
||||
{
|
||||
$obj_dibs->setTransactionDetail($posted_values);
|
||||
$obj_dibs->validateOrder((int)$posted_values['orderid'], Configuration::get('PS_OS_PAYMENT'),
|
||||
$obj_dibs->setTransactionDetail($posted_values);
|
||||
$obj_dibs->validateOrder((int)$posted_values['orderid'], Configuration::get('PS_OS_PAYMENT'),
|
||||
(float)((int)$posted_values['amount'] / 100), $obj_dibs->displayName, $message, array(), NULL, false, $secure_cart[2]);
|
||||
}
|
||||
else if ($valid_order === false)
|
||||
$obj_dibs->validateOrder((int)$posted_values['orderid'], Configuration::get('PS_OS_ERROR'), 0, $obj_dibs->displayName,
|
||||
$message, array(), NULL, false, $secure_cart[2]);
|
||||
}
|
||||
$obj_dibs->validateOrder((int)$posted_values['orderid'], Configuration::get('PS_OS_ERROR'), 0, $obj_dibs->displayName, $message, array(), NULL, false, $secure_cart[2]);
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<module>
|
||||
<name>ebay</name>
|
||||
<displayName><![CDATA[eBay]]></displayName>
|
||||
<version><![CDATA[1.3.1]]></version>
|
||||
<version><![CDATA[1.3.5]]></version>
|
||||
<description><![CDATA[Open your shop on the eBay market place !]]></description>
|
||||
<author><![CDATA[PrestaShop]]></author>
|
||||
<tab><![CDATA[market_place]]></tab>
|
||||
|
||||
@@ -1140,7 +1140,9 @@ class eBayRequest
|
||||
else $reference = $skuItem;
|
||||
}
|
||||
|
||||
|
||||
$reference = trim($reference);
|
||||
if (!empty($reference))
|
||||
{
|
||||
$id_product = Db::getInstance()->getValue('
|
||||
SELECT `id_product` FROM `'._DB_PREFIX_.'product`
|
||||
WHERE `reference` = \''.pSQL($reference).'\'');
|
||||
@@ -1156,6 +1158,7 @@ class eBayRequest
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$orderList[] = array(
|
||||
'id_order_ref' => (string)$order->OrderID,
|
||||
|
||||
@@ -59,7 +59,7 @@ class Ebay extends Module
|
||||
{
|
||||
$this->name = 'ebay';
|
||||
$this->tab = 'market_place';
|
||||
$this->version = '1.3.1';
|
||||
$this->version = '1.3.5';
|
||||
$this->author = 'PrestaShop';
|
||||
parent::__construct ();
|
||||
$this->displayName = $this->l('eBay');
|
||||
@@ -93,12 +93,17 @@ class Ebay extends Module
|
||||
if (!Configuration::get('EBAY_SECURITY_TOKEN'))
|
||||
Configuration::updateValue('EBAY_SECURITY_TOKEN', Tools::passwdGen(30));
|
||||
|
||||
/* For 1.4.3 and less compatibility */
|
||||
$updateConfig = array('PS_OS_CHEQUE', 'PS_OS_PAYMENT', 'PS_OS_PREPARATION', 'PS_OS_SHIPPING', 'PS_OS_CANCELED', 'PS_OS_REFUND', 'PS_OS_ERROR', 'PS_OS_OUTOFSTOCK', 'PS_OS_BANKWIRE', 'PS_OS_PAYPAL', 'PS_OS_WS_PAYMENT');
|
||||
if (!Configuration::get('PS_OS_PAYMENT'))
|
||||
foreach ($updateConfig as $u)
|
||||
if (!Configuration::get($u) && defined('_'.$u.'_'))
|
||||
// For 1.4.3 and less compatibility
|
||||
$updateConfig = array('PS_OS_CHEQUE' => 1, 'PS_OS_PAYMENT' => 2, 'PS_OS_PREPARATION' => 3, 'PS_OS_SHIPPING' => 4, 'PS_OS_DELIVERED' => 5, 'PS_OS_CANCELED' => 6,
|
||||
'PS_OS_REFUND' => 7, 'PS_OS_ERROR' => 8, 'PS_OS_OUTOFSTOCK' => 9, 'PS_OS_BANKWIRE' => 10, 'PS_OS_PAYPAL' => 11, 'PS_OS_WS_PAYMENT' => 12);
|
||||
foreach ($updateConfig as $u => $v)
|
||||
if (!Configuration::get($u) || (int)Configuration::get($u) < 1)
|
||||
{
|
||||
if (defined('_'.$u.'_') && (int)constant('_'.$u.'_') > 0)
|
||||
Configuration::updateValue($u, constant('_'.$u.'_'));
|
||||
else
|
||||
Configuration::updateValue($u, $v);
|
||||
}
|
||||
|
||||
// Check if installed
|
||||
if (self::isInstalled($this->name))
|
||||
@@ -326,6 +331,9 @@ class Ebay extends Module
|
||||
if (!Configuration::get('EBAY_PAYPAL_EMAIL'))
|
||||
return false;
|
||||
|
||||
// Fix hook update product attribute
|
||||
$this->hookupdateProductAttributeEbay();
|
||||
|
||||
// If no update yet
|
||||
if (!Configuration::get('EBAY_ORDER_LAST_UPDATE'))
|
||||
Configuration::updateValue('EBAY_ORDER_LAST_UPDATE', date('Y-m-d').'T'.date('H:i:s').'.000Z');
|
||||
@@ -361,8 +369,6 @@ class Ebay extends Module
|
||||
{
|
||||
if (!Db::getInstance()->getValue('SELECT `id_ebay_order` FROM `'._DB_PREFIX_.'ebay_order` WHERE `id_order_ref` = \''.pSQL($order['id_order_ref']).'\''))
|
||||
{
|
||||
$id_customer = (int)Db::getInstance()->getValue('SELECT `id_customer` FROM `'._DB_PREFIX_.'customer` WHERE `active` = 1 AND `email` = \''.pSQL($order['email']).'\' AND `deleted` = 0'.(substr(_PS_VERSION_, 0, 3) == '1.3' ? '' : ' AND `is_guest` = 0'));
|
||||
|
||||
// Check for empty name
|
||||
$order['firstname'] = trim($order['firstname']);
|
||||
$order['familyname'] = trim($order['familyname']);
|
||||
@@ -375,6 +381,9 @@ class Ebay extends Module
|
||||
|
||||
if (Validate::isEmail($order['email']) && !empty($order['firstname']) && !empty($order['familyname']))
|
||||
{
|
||||
// Getting the customer
|
||||
$id_customer = (int)Db::getInstance()->getValue('SELECT `id_customer` FROM `'._DB_PREFIX_.'customer` WHERE `active` = 1 AND `email` = \''.pSQL($order['email']).'\' AND `deleted` = 0'.(substr(_PS_VERSION_, 0, 3) == '1.3' ? '' : ' AND `is_guest` = 0'));
|
||||
|
||||
// Add customer if he doesn't exist
|
||||
if ($id_customer < 1)
|
||||
{
|
||||
@@ -434,7 +443,7 @@ class Ebay extends Module
|
||||
$cartAdd->id_customer = $id_customer;
|
||||
$cartAdd->id_address_invoice = $id_address;
|
||||
$cartAdd->id_address_delivery = $id_address;
|
||||
$cartAdd->id_carrier = 1;
|
||||
$cartAdd->id_carrier = 0;
|
||||
$cartAdd->id_lang = $this->id_lang;
|
||||
$cartAdd->id_currency = Currency::getIdByIsoCode('EUR');
|
||||
$cartAdd->recyclable = 0;
|
||||
@@ -446,7 +455,7 @@ class Ebay extends Module
|
||||
$cartAdd->update();
|
||||
|
||||
// Check number of products in the cart
|
||||
if ($cartNbProducts > 0)
|
||||
if ($cartNbProducts > 0 && !Db::getInstance()->getValue('SELECT `id_ebay_order` FROM `'._DB_PREFIX_.'ebay_order` WHERE `id_order_ref` = \''.pSQL($order['id_order_ref']).'\''))
|
||||
{
|
||||
// Fix on sending e-mail
|
||||
Db::getInstance()->autoExecute(_DB_PREFIX_.'customer', array('email' => 'NOSEND-EBAY'), 'UPDATE', '`id_customer` = '.(int)$id_customer);
|
||||
@@ -466,16 +475,19 @@ class Ebay extends Module
|
||||
Db::getInstance()->autoExecute(_DB_PREFIX_.'customer', array('email' => pSQL($order['email'])), 'UPDATE', '`id_customer` = '.(int)$id_customer);
|
||||
|
||||
// Update price (because of possibility of price impact)
|
||||
foreach ($order['product_list'] as $product)
|
||||
{
|
||||
$tax_rate = Db::getInstance()->getValue('SELECT `tax_rate` FROM `'._DB_PREFIX_.'order_detail` WHERE `id_order` = '.(int)$id_order.' AND `product_id` = '.(int)$product['id_product'].' AND `product_attribute_id` = '.(int)$product['id_product_attribute']);
|
||||
Db::getInstance()->autoExecute(_DB_PREFIX_.'order_detail', array('product_price' => floatval($product['price'] / (1 + ($tax_rate / 100))), 'reduction_percent' => 0), 'UPDATE', '`id_order` = '.(int)$id_order.' AND `product_id` = '.(int)$product['id_product'].' AND `product_attribute_id` = '.(int)$product['id_product_attribute']);
|
||||
}
|
||||
$updateOrder = array(
|
||||
'total_paid' => floatval($order['amount']),
|
||||
'total_paid_real' => floatval($order['amount']),
|
||||
'total_products' => floatval($order['amount']),
|
||||
'total_products_wt' => floatval($order['amount']),
|
||||
'total_products' => floatval(Db::getInstance()->getValue('SELECT SUM(`product_price`) FROM `'._DB_PREFIX_.'order_detail` WHERE `id_order` = '.(int)$id_order)),
|
||||
'total_products_wt' => floatval($order['amount'] - $order['shippingServiceCost']),
|
||||
'total_shipping' => floatval($order['shippingServiceCost']),
|
||||
);
|
||||
Db::getInstance()->autoExecute(_DB_PREFIX_.'orders', $updateOrder, 'UPDATE', '`id_order` = '.(int)$id_order);
|
||||
foreach ($order['product_list'] as $product)
|
||||
Db::getInstance()->autoExecute(_DB_PREFIX_.'order_detail', array('product_price' => floatval($product['price']), 'tax_rate' => 0, 'reduction_percent' => 0), 'UPDATE', '`id_order` = '.(int)$id_order.' AND `product_id` = '.(int)$product['id_product'].' AND `product_attribute_id` = '.(int)$product['id_product_attribute']);
|
||||
|
||||
// Register the ebay order ref
|
||||
Db::getInstance()->autoExecute(_DB_PREFIX_.'ebay_order', array('id_order_ref' => pSQL($order['id_order_ref']), 'id_order' => (int)$id_order), 'INSERT');
|
||||
@@ -511,11 +523,20 @@ class Ebay extends Module
|
||||
|
||||
// Alias
|
||||
public function hookupdateproduct($params) { $this->hookaddproduct($params); }
|
||||
public function hookupdateProductAttribute($params)
|
||||
public function hookupdateProductAttribute($params) { }
|
||||
public function hookupdateProductAttributeEbay()
|
||||
{
|
||||
if (isset($_POST['submitProductAttribute']) && isset($_POST['id_product_attribute']))
|
||||
{
|
||||
$params = array();
|
||||
$params['id_product_attribute'] = (int)$_POST['id_product_attribute'];
|
||||
if ($params['id_product_attribute'] > 0)
|
||||
{
|
||||
$id_product = Db::getInstance()->getValue('SELECT `id_product` FROM `'._DB_PREFIX_.'product_attribute` WHERE `id_product_attribute` = '.(int)$params['id_product_attribute']);
|
||||
$params['product'] = new Product($id_product);
|
||||
$this->hookaddproduct($params);
|
||||
}
|
||||
}
|
||||
}
|
||||
public function hookdeleteproduct($params) { $this->hookaddproduct($params); }
|
||||
public function hookheader($params) { $this->hookbackOfficeTop($params); }
|
||||
@@ -1633,6 +1654,31 @@ class Ebay extends Module
|
||||
'picturesLarge' => $picturesLarge,
|
||||
);
|
||||
|
||||
// Fix hook update product
|
||||
if (isset($this->context->employee) && $this->context->employee->id > 0 && isset($_POST['submitProductAttribute']) && isset($_POST['id_product_attribute']) && isset($_POST['attribute_mvt_quantity']) && isset($_POST['id_mvt_reason']))
|
||||
{
|
||||
if (substr(_PS_VERSION_, 0, 3) == '1.3')
|
||||
{
|
||||
$id_product_attribute_fix = (int)$_POST['id_product_attribute'];
|
||||
$quantity_fix = (int)$_POST['attribute_quantity'];
|
||||
if ($id_product_attribute_fix > 0 && $quantity_fix > 0 && isset($datas['variations'][$product->id.'-'.$id_product_attribute_fix]['quantity']))
|
||||
$datas['variations'][$product->id.'-'.$id_product_attribute_fix]['quantity'] = (int)$quantity_fix;
|
||||
}
|
||||
else
|
||||
{
|
||||
$action = Db::getInstance()->getValue('SELECT `sign` FROM `'._DB_PREFIX_.'stock_mvt_reason` WHERE `id_stock_mvt_reason` = '.(int)$_POST['id_mvt_reason']);
|
||||
$id_product_attribute_fix = (int)$_POST['id_product_attribute'];
|
||||
$quantity_fix = (int)$_POST['attribute_mvt_quantity'];
|
||||
if ($id_product_attribute_fix > 0 && $quantity_fix > 0 && isset($datas['variations'][$product->id.'-'.$id_product_attribute_fix]['quantity']))
|
||||
{
|
||||
if ($action > 0)
|
||||
$datas['variations'][$product->id.'-'.$id_product_attribute_fix]['quantity'] += (int)$quantity_fix;
|
||||
if ($action < 0)
|
||||
$datas['variations'][$product->id.'-'.$id_product_attribute_fix]['quantity'] -= (int)$quantity_fix;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Price Update
|
||||
if (isset($p['noPriceUpdate']))
|
||||
$datas['noPriceUpdate'] = $p['noPriceUpdate'];
|
||||
@@ -1646,9 +1692,14 @@ class Ebay extends Module
|
||||
|
||||
|
||||
// Load eBay Description
|
||||
$features = $product->getFrontFeatures((int)($this->id_lang));
|
||||
$featuresHtml = '';
|
||||
if (isset($features))
|
||||
foreach ($features as $f)
|
||||
$featuresHtml .= '<b>'.$f['name'].'</b> : '.$f['value'].'<br/>';
|
||||
$datas['description'] = str_replace(
|
||||
array('{DESCRIPTION_SHORT}', '{DESCRIPTION}', '{EBAY_IDENTIFIER}', '{EBAY_SHOP}', '{SLOGAN}', '{PRODUCT_NAME}'),
|
||||
array($datas['description_short'], $datas['description'], Configuration::get('EBAY_IDENTIFIER'), Configuration::get('EBAY_SHOP'), '', $product->name),
|
||||
array('{DESCRIPTION_SHORT}', '{DESCRIPTION}', '{FEATURES}', '{EBAY_IDENTIFIER}', '{EBAY_SHOP}', '{SLOGAN}', '{PRODUCT_NAME}'),
|
||||
array($datas['description_short'], $datas['description'], $featuresHtml, Configuration::get('EBAY_IDENTIFIER'), Configuration::get('EBAY_SHOP'), '', $product->name),
|
||||
Configuration::get('EBAY_PRODUCT_TEMPLATE')
|
||||
);
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
<module>
|
||||
<name>ekomi</name>
|
||||
<displayName><![CDATA[eKomi]]></displayName>
|
||||
<version><![CDATA[1.1]]></version>
|
||||
<version><![CDATA[1.2]]></version>
|
||||
<description><![CDATA[Adds an eKomi block]]></description>
|
||||
<author><![CDATA[]]></author>
|
||||
<author><![CDATA[PrestaShop]]></author>
|
||||
<tab><![CDATA[advertising_marketing]]></tab>
|
||||
<is_configurable>1</is_configurable>
|
||||
<need_instance>0</need_instance>
|
||||
|
||||
@@ -33,17 +33,31 @@ class Ekomi extends Module
|
||||
private $_html = '';
|
||||
private $_postErrors = array();
|
||||
|
||||
public $id_lang;
|
||||
public $iso_lang;
|
||||
|
||||
function __construct()
|
||||
{
|
||||
$this->name = 'ekomi';
|
||||
$this->tab = 'advertising_marketing';
|
||||
$this->version = 1.1;
|
||||
$this->author = 'PrestaShop';
|
||||
$this->version = 1.2;
|
||||
$this->need_instance = 0;
|
||||
|
||||
parent::__construct();
|
||||
|
||||
$this->displayName = $this->l('eKomi');
|
||||
$this->description = $this->l('Adds an eKomi block');
|
||||
|
||||
if (self::isInstalled($this->name))
|
||||
{
|
||||
$this->id_lang = (int)Configuration::get('PS_LANG_DEFAULT');
|
||||
$this->iso_lang = pSQL(Language::getIsoById($this->id_lang));
|
||||
|
||||
/* Check Mail Directory */
|
||||
if (!file_exists(dirname(__FILE__.'/'.$this->iso_lang.'/')))
|
||||
$this->warning .= $this->l('directory').' "'.$this->iso_lang.'" does not exist ';
|
||||
}
|
||||
}
|
||||
|
||||
public function install()
|
||||
@@ -115,6 +129,10 @@ class Ekomi extends Module
|
||||
if (!Configuration::get('PS_EKOMI_EMAIL'))
|
||||
return true;
|
||||
|
||||
/* Check Mail Directory */
|
||||
if (!file_exists(dirname(__FILE__.'/'.$this->iso_lang.'/')))
|
||||
return true;
|
||||
|
||||
/* Email generation */
|
||||
$subject = '[Ekomi-Prestashop] '.Configuration::get('PS_SHOP_NAME');
|
||||
$templateVars = array(
|
||||
@@ -125,8 +143,9 @@ class Ekomi extends Module
|
||||
);
|
||||
|
||||
/* Email sending */
|
||||
if (!Mail::Send(1, 'ekomi', $subject, $templateVars, Configuration::get('PS_EKOMI_EMAIL'), NULL, $params['customer']->email, Configuration::get('PS_SHOP_NAME'), NULL, NULL, dirname(__FILE__).'/mails/'))
|
||||
if (!Mail::Send((int)$this->id_lang, 'ekomi', $subject, $templateVars, Configuration::get('PS_EKOMI_EMAIL'), NULL, $params['customer']->email, Configuration::get('PS_SHOP_NAME'), NULL, NULL, dirname(__FILE__).'/mails/'))
|
||||
return true;
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ global $_MODULE;
|
||||
$_MODULE = array();
|
||||
$_MODULE['<{ekomi}prestashop>ekomi_c0858307dfd3d91768c79ec116820b60'] = 'eKomi';
|
||||
$_MODULE['<{ekomi}prestashop>ekomi_d245187b3591f5f6f723ece2217bb637'] = 'Ajouter un bloc eKomi';
|
||||
$_MODULE['<{ekomi}prestashop>ekomi_5f8f22b8cdbaeee8cf857673a9b6ba20'] = 'répertoire';
|
||||
$_MODULE['<{ekomi}prestashop>ekomi_f4d1ea475eaa85102e2b4e6d95da84bd'] = 'Confirmation';
|
||||
$_MODULE['<{ekomi}prestashop>ekomi_c888438d14855d7d96a2724ee9c306bd'] = 'Configuration mise à jour';
|
||||
$_MODULE['<{ekomi}prestashop>ekomi_f4f70727dc34561dfde1a3c529b6205c'] = 'Configuration';
|
||||
|
||||
@@ -112,6 +112,7 @@ class AdminEnvoiMoinsCher extends AdminTab
|
||||
|
||||
private function displayOrders($orders)
|
||||
{
|
||||
$emc = new Envoimoinscher();
|
||||
echo '<table cellspacing="0" cellpadding="0" class="table" align="center" style="margin:10px 0px 0px 25px;">
|
||||
<tr>
|
||||
<th><input type="checkbox" name="checkme" class="noborder" onclick="checkDelBoxes(this.form, \'ordersBox[]\', this.checked)" /></th>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<module>
|
||||
<name>fedexcarrier</name>
|
||||
<displayName><![CDATA[Fedex Carrier]]></displayName>
|
||||
<version><![CDATA[1.2.4]]></version>
|
||||
<version><![CDATA[1.2.5]]></version>
|
||||
<description><![CDATA[Offer your customers, different delivery methods with Fedex]]></description>
|
||||
<author><![CDATA[PrestaShop]]></author>
|
||||
<tab><![CDATA[shipping_logistics]]></tab>
|
||||
|
||||
@@ -56,7 +56,7 @@ class FedexCarrier extends CarrierModule
|
||||
{
|
||||
$this->name = 'fedexcarrier';
|
||||
$this->tab = 'shipping_logistics';
|
||||
$this->version = '1.2.4';
|
||||
$this->version = '1.2.5';
|
||||
$this->author = 'PrestaShop';
|
||||
$this->limited_countries = array('us');
|
||||
|
||||
@@ -349,6 +349,10 @@ class FedexCarrier extends CarrierModule
|
||||
$alert['webserviceTest'] = 1;
|
||||
if (!extension_loaded('soap'))
|
||||
$alert['soap'] = 1;
|
||||
if (!ini_get('allow_url_fopen'))
|
||||
$alert['url_fopen'] = 1;
|
||||
if (!extension_loaded('openssl'))
|
||||
$alert['openssl'] = 1;
|
||||
|
||||
|
||||
if (!count($alert))
|
||||
@@ -360,6 +364,8 @@ class FedexCarrier extends CarrierModule
|
||||
$this->_html .= '<br />'.(isset($alert['deliveryServices']) ? '<img src="'._PS_IMG_.'admin/warn2.png" />' : '<img src="'._PS_IMG_.'admin/module_install.png" />').' 2) '.$this->l('Select your available delivery service');
|
||||
$this->_html .= '<br />'.(isset($alert['webserviceTest']) ? '<img src="'._PS_IMG_.'admin/warn2.png" />' : '<img src="'._PS_IMG_.'admin/module_install.png" />').' 3) '.$this->l('Webservice test connection').($this->_webserviceError ? ' : '.$this->_webserviceError : '');
|
||||
$this->_html .= '<br />'.(isset($alert['soap']) ? '<img src="'._PS_IMG_.'admin/warn2.png" />' : '<img src="'._PS_IMG_.'admin/module_install.png" />').' 4) '.$this->l('Soap is enabled');
|
||||
$this->_html .= '<br />'.(isset($alert['url_fopen']) ? '<img src="'._PS_IMG_.'admin/warn2.png" />' : '<img src="'._PS_IMG_.'admin/module_install.png" />').' 5) '.$this->l('Url fopen is enabled');
|
||||
$this->_html .= '<br />'.(isset($alert['openssl']) ? '<img src="'._PS_IMG_.'admin/warn2.png" />' : '<img src="'._PS_IMG_.'admin/module_install.png" />').' 6) '.$this->l('OpenSSL is enabled');
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<module>
|
||||
<name>gsitemap</name>
|
||||
<displayName><![CDATA[Google sitemap]]></displayName>
|
||||
<version><![CDATA[1.7]]></version>
|
||||
<version><![CDATA[1.8]]></version>
|
||||
<description><![CDATA[Generate your Google sitemap file]]></description>
|
||||
<author><![CDATA[PrestaShop]]></author>
|
||||
<tab><![CDATA[seo]]></tab>
|
||||
|
||||
@@ -156,73 +156,13 @@ XML;
|
||||
|
||||
$xml = new SimpleXMLElement($xmlString);
|
||||
|
||||
if (Configuration::get('PS_REWRITING_SETTINGS') AND sizeof($langs) > 1)
|
||||
if (Configuration::get('PS_REWRITING_SETTINGS') && count($langs) > 1)
|
||||
foreach($langs as $lang)
|
||||
$this->_addSitemapNode($xml, Tools::getShopDomain(true, true).__PS_BASE_URI__.$lang['iso_code'].'/', '1.00', 'daily', date('Y-m-d'));
|
||||
else
|
||||
$this->_addSitemapNode($xml, Tools::getShopDomain(true, true).__PS_BASE_URI__, '1.00', 'daily', date('Y-m-d'));
|
||||
|
||||
/* CMS Generator */
|
||||
if (Configuration::get('GSITEMAP_ALL_CMS') OR !Module::isInstalled('blockcms'))
|
||||
$sql = 'SELECT DISTINCT '.(Configuration::get('PS_REWRITING_SETTINGS') ? 'cl.id_cms, cl.link_rewrite, cl.id_lang' : 'cl.id_cms').'
|
||||
FROM '._DB_PREFIX_.'cms_lang cl
|
||||
LEFT JOIN '._DB_PREFIX_.'lang l ON (cl.id_lang = l.id_lang)
|
||||
LEFT JOIN '._DB_PREFIX_.'cms_shop cs ON cs.id_cms = cl.id_cms
|
||||
WHERE l.`active` = 1
|
||||
AND cs.id_shop = '.$shopID.'
|
||||
ORDER BY cl.id_cms, cl.id_lang ASC';
|
||||
else if (Module::isInstalled('blockcms'))
|
||||
$sql = 'SELECT DISTINCT '.(Configuration::get('PS_REWRITING_SETTINGS') ? 'cl.id_cms, cl.link_rewrite, cl.id_lang' : 'cl.id_cms').'
|
||||
FROM '._DB_PREFIX_.'cms_block_page b
|
||||
LEFT JOIN '._DB_PREFIX_.'cms_lang cl ON (b.id_cms = cl.id_cms)
|
||||
LEFT JOIN '._DB_PREFIX_.'lang l ON (cl.id_lang = l.id_lang)
|
||||
LEFT JOIN '._DB_PREFIX_.'cms_shop cs ON cs.id_cms = cl.id_cms
|
||||
WHERE l.`active` = 1
|
||||
AND cs.id_shop = '.$shopID.'
|
||||
ORDER BY cl.id_cms, cl.id_lang ASC';
|
||||
|
||||
$cmss = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql);
|
||||
foreach ($cmss AS $cms)
|
||||
{
|
||||
$tmpLink = Configuration::get('PS_REWRITING_SETTINGS') ? $this->context->link->getCMSLink((int)$cms['id_cms'], $cms['link_rewrite'], false, (int)$cms['id_lang']) : $this->context->link->getCMSLink((int)$cms['id_cms']);
|
||||
$this->_addSitemapNode($xml, $tmpLink, '0.8', 'daily');
|
||||
}
|
||||
|
||||
/* Categories Generator */
|
||||
$limits = Category::getInterval($shop->getCategory());
|
||||
if (Configuration::get('PS_REWRITING_SETTINGS'))
|
||||
{
|
||||
$sql = 'SELECT c.id_category, c.level_depth, link_rewrite, DATE_FORMAT(IF(date_upd,date_upd,date_add), \'%Y-%m-%d\') AS date_upd, cl.id_lang
|
||||
FROM '._DB_PREFIX_.'category c
|
||||
LEFT JOIN '._DB_PREFIX_.'category_lang cl ON c.id_category = cl.id_category AND cl.id_shop = '.$shopID.'
|
||||
LEFT JOIN '._DB_PREFIX_.'lang l ON cl.id_lang = l.id_lang
|
||||
WHERE l.`active` = 1
|
||||
AND c.`active` = 1
|
||||
AND c.id_category != 1
|
||||
AND nleft >= '.$limits['nleft'].'
|
||||
AND nright <= '.$limits['nright'].'
|
||||
ORDER BY cl.id_category, cl.id_lang ASC';
|
||||
$categories = Db::getInstance()->executeS($sql);
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql = 'SELECT c.id_category, c.level_depth, DATE_FORMAT(IF(date_upd,date_upd,date_add), \'%Y-%m-%d\') AS date_upd
|
||||
FROM '._DB_PREFIX_.'category c
|
||||
WHERE nleft >= '.$limits['nleft'].'
|
||||
AND nright <= '.$limits['nright'].'
|
||||
ORDER BY c.id_category ASC';
|
||||
$categories = Db::getInstance()->executeS($sql);
|
||||
}
|
||||
|
||||
foreach($categories as $category)
|
||||
{
|
||||
if (($priority = 0.9 - ($category['level_depth'] / 10)) < 0.1)
|
||||
$priority = 0.1;
|
||||
|
||||
$tmpLink = Configuration::get('PS_REWRITING_SETTINGS') ? $this->context->link->getCategoryLink((int)$category['id_category'], $category['link_rewrite'], (int)$category['id_lang']) : $this->context->link->getCategoryLink((int)$category['id_category']);
|
||||
$this->_addSitemapNode($xml, $tmpLink, $priority, 'weekly', substr($category['date_upd'], 0, 10));
|
||||
}
|
||||
|
||||
/* Product Generator */
|
||||
$sql = 'SELECT p.id_product, pl.link_rewrite, DATE_FORMAT(IF(date_upd,date_upd,date_add), \'%Y-%m-%d\') date_upd, pl.id_lang, cl.`link_rewrite` category, ean13, i.id_image, il.legend legend_image, (
|
||||
SELECT MIN(level_depth)
|
||||
FROM '._DB_PREFIX_.'product p2
|
||||
@@ -245,7 +185,7 @@ XML;
|
||||
|
||||
$tmp = null;
|
||||
$res = null;
|
||||
foreach($products AS $product)
|
||||
foreach ($products as $product)
|
||||
{
|
||||
if ($tmp == $product['id_product'])
|
||||
$res[$tmp]['images'] []= array('id_image' => $product['id_image'], 'legend_image' => $product['legend_image']);
|
||||
@@ -268,18 +208,65 @@ XML;
|
||||
$sitemap = $this->_addSitemapNodeImage($sitemap, $product);
|
||||
}
|
||||
|
||||
/* Categories Generator */
|
||||
if (Configuration::get('PS_REWRITING_SETTINGS'))
|
||||
$categories = Db::getInstance()->ExecuteS('
|
||||
SELECT c.id_category, c.level_depth, link_rewrite, DATE_FORMAT(IF(date_upd,date_upd,date_add), \'%Y-%m-%d\') AS date_upd, cl.id_lang
|
||||
FROM '._DB_PREFIX_.'category c
|
||||
LEFT JOIN '._DB_PREFIX_.'category_lang cl ON c.id_category = cl.id_category
|
||||
LEFT JOIN '._DB_PREFIX_.'lang l ON cl.id_lang = l.id_lang
|
||||
WHERE l.`active` = 1 AND c.`active` = 1 AND c.id_category != 1
|
||||
ORDER BY cl.id_category, cl.id_lang ASC');
|
||||
else
|
||||
$categories = Db::getInstance()->ExecuteS(
|
||||
'SELECT c.id_category, c.level_depth, DATE_FORMAT(IF(date_upd,date_upd,date_add), \'%Y-%m-%d\') AS date_upd
|
||||
FROM '._DB_PREFIX_.'category c
|
||||
ORDER BY c.id_category ASC');
|
||||
|
||||
|
||||
foreach($categories as $category)
|
||||
{
|
||||
if (($priority = 0.9 - ($category['level_depth'] / 10)) < 0.1)
|
||||
$priority = 0.1;
|
||||
|
||||
$tmpLink = Configuration::get('PS_REWRITING_SETTINGS') ? $link->getCategoryLink((int)$category['id_category'], $category['link_rewrite'], (int)$category['id_lang']) : $link->getCategoryLink((int)$category['id_category']);
|
||||
$this->_addSitemapNode($xml, htmlspecialchars($tmpLink), $priority, 'weekly', substr($category['date_upd'], 0, 10));
|
||||
}
|
||||
|
||||
/* CMS Generator */
|
||||
if (Configuration::get('GSITEMAP_ALL_CMS') || !Module::isInstalled('blockcms'))
|
||||
$sql_cms = '
|
||||
SELECT DISTINCT '.(Configuration::get('PS_REWRITING_SETTINGS') ? 'cl.id_cms, cl.link_rewrite, cl.id_lang' : 'cl.id_cms').
|
||||
' FROM '._DB_PREFIX_.'cms_lang cl
|
||||
LEFT JOIN '._DB_PREFIX_.'lang l ON (cl.id_lang = l.id_lang)
|
||||
WHERE l.`active` = 1
|
||||
ORDER BY cl.id_cms, cl.id_lang ASC';
|
||||
else if (Module::isInstalled('blockcms'))
|
||||
$sql_cms = '
|
||||
SELECT DISTINCT '.(Configuration::get('PS_REWRITING_SETTINGS') ? 'cl.id_cms, cl.link_rewrite, cl.id_lang' : 'cl.id_cms').
|
||||
' FROM '._DB_PREFIX_.'cms_block_page b
|
||||
LEFT JOIN '._DB_PREFIX_.'cms_lang cl ON (b.id_cms = cl.id_cms)
|
||||
LEFT JOIN '._DB_PREFIX_.'lang l ON (cl.id_lang = l.id_lang)
|
||||
WHERE l.`active` = 1
|
||||
ORDER BY cl.id_cms, cl.id_lang ASC';
|
||||
|
||||
$cmss = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS($sql_cms);
|
||||
foreach($cmss as $cms)
|
||||
{
|
||||
$tmpLink = Configuration::get('PS_REWRITING_SETTINGS') ? $link->getCMSLink((int)$cms['id_cms'], $cms['link_rewrite'], false, (int)$cms['id_lang']) : $link->getCMSLink((int)$cms['id_cms']);
|
||||
$this->_addSitemapNode($xml, $tmpLink, '0.8', 'daily');
|
||||
}
|
||||
|
||||
/* Add classic pages (contact, best sales, new products...) */
|
||||
$pages = array(
|
||||
'authentication' => true,
|
||||
'best-sales' => false,
|
||||
'contact' => true,
|
||||
'discount' => false,
|
||||
'index' => false,
|
||||
'supplier' => false,
|
||||
'manufacturer' => false,
|
||||
'new-products' => false,
|
||||
'prices-drop' => false,
|
||||
'supplier' => false,
|
||||
'store' => false);
|
||||
'stores' => false,
|
||||
'authentication' => true,
|
||||
'best-sales' => false,
|
||||
'contact-form' => true);
|
||||
|
||||
// Don't show suppliers and manufacturers if they are disallowed
|
||||
if (!Module::getInstanceByName('blockmanufacturer')->id && !Configuration::get('PS_DISPLAY_SUPPLIERS'))
|
||||
@@ -290,11 +277,11 @@ XML;
|
||||
|
||||
// Generate nodes for pages
|
||||
if(Configuration::get('PS_REWRITING_SETTINGS'))
|
||||
foreach ($pages AS $page => $ssl)
|
||||
foreach ($pages as $page => $ssl)
|
||||
foreach($langs as $lang)
|
||||
$this->_addSitemapNode($xml, $this->context->link->getPageLink($page, $ssl, $lang['id_lang']), '0.5', 'monthly');
|
||||
else
|
||||
foreach($pages AS $page => $ssl)
|
||||
foreach($pages as $page => $ssl)
|
||||
$this->_addSitemapNode($xml, $this->context->link->getPageLink($page, $ssl), '0.5', 'monthly');
|
||||
|
||||
$xmlString = $xml->asXML();
|
||||
@@ -344,14 +331,14 @@ XML;
|
||||
|
||||
private function _displaySitemap()
|
||||
{
|
||||
if (file_exists(GSITEMAP_FILE) AND filesize(GSITEMAP_FILE))
|
||||
if (file_exists(GSITEMAP_FILE) && filesize(GSITEMAP_FILE))
|
||||
{
|
||||
$fp = fopen(GSITEMAP_FILE, 'r');
|
||||
$fstat = fstat($fp);
|
||||
fclose($fp);
|
||||
$xml = simplexml_load_file(GSITEMAP_FILE);
|
||||
|
||||
$nbPages = sizeof($xml->url);
|
||||
$nbPages = count($xml->url);
|
||||
|
||||
$this->_html .= '<p>'.$this->l('Your Google sitemap file is online at the following address:').'<br />
|
||||
<a href="'.Tools::getShopDomain(true, true).__PS_BASE_URI__.'sitemap.xml" target="_blank"><b>'.Tools::getShopDomain(true, true).__PS_BASE_URI__.'sitemap.xml</b></a></p><br />';
|
||||
@@ -380,15 +367,15 @@ XML;
|
||||
public function getContent()
|
||||
{
|
||||
$this->_html .= '<h2>'.$this->l('Search Engine Optimization').'</h2>
|
||||
'.$this->l('See').' <a href="https://www.google.com/webmasters/tools/docs/en/about.html" style="font-weight:bold;text-decoration:underline;" target="_blank">
|
||||
'.$this->l('See').' <a href="http://www.google.com/support/webmasters/bin/answer.py?hl=en&answer=156184&from=40318&rd=1" style="font-weight:bold;text-decoration:underline;" target="_blank">
|
||||
'.$this->l('this page').'</a> '.$this->l('for more information').'<br /><br />';
|
||||
if (Tools::isSubmit('btnSubmit'))
|
||||
{
|
||||
$this->_postValidation();
|
||||
if (!sizeof($this->_postErrors))
|
||||
if (!count($this->_postErrors))
|
||||
$this->_postProcess();
|
||||
else
|
||||
foreach ($this->_postErrors AS $err)
|
||||
foreach ($this->_postErrors as $err)
|
||||
$this->_html .= '<div class="alert error">'.$err.'</div>';
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
include_once('../../config/config.inc.php');
|
||||
include_once('../../init.php');
|
||||
include_once('../../modules/importerosc/importerosc.php');
|
||||
|
||||
|
||||
if (!Tools::getValue('ajax') || Tools::getValue('token') != sha1(_COOKIE_KEY_.'importosc'))
|
||||
die('INVALID TOKEN');
|
||||
|
||||
$importOsc = new importerosc();
|
||||
$importOsc->server = Tools::getValue('server');
|
||||
$importOsc->user = Tools::getValue('user');
|
||||
$importOsc->passwd = Tools::getValue('password');
|
||||
$importOsc->database = Tools::getValue('database');
|
||||
$importOsc->prefix = Tools::getValue('prefix');
|
||||
|
||||
die($importOsc->createLevelAndCalculate());
|
||||
@@ -20,3 +20,8 @@ $_MODULE['<{importerosc}prestashop>importerosc_14ae0ea02f571a833786d13d9ca6a897'
|
||||
$_MODULE['<{importerosc}prestashop>importerosc_e307db07b3975fef922a80d07455ee5e'] = 'Base de données';
|
||||
$_MODULE['<{importerosc}prestashop>importerosc_dac130bdd2c5492a8108a4145bd9f04a'] = 'Préfixe base de données';
|
||||
$_MODULE['<{importerosc}prestashop>importerosc_6bdc02625540b5264cffe801c37a82dd'] = '(Le préfixe est optionnel. Si toute votre base de données commence par \"pref_\", votre préfixe est \"pref_\")';
|
||||
$_MODULE['<{importerosc}prestashop>importerosc_4685343b5e2e0f0fbee63dddafde693f'] = 'Vous essayez d\'importer des catégories et nous avons détecté que votre base de données osCommerce n\'ont pas le champs \"niveau\" dans la table catégorie. Vous devez avoir ce champs pour continuer l\'importation de catégories.';
|
||||
$_MODULE['<{importerosc}prestashop>importerosc_16f35420186575c2a1d9c0b59edf6ad3'] = 'Cliquez ici pour ajouter et de calculer le champs niveau';
|
||||
$_MODULE['<{importerosc}prestashop>importerosc_fced104d747e0855ceff3020653104ab'] = 'Le champ \"niveau\" a été créé et calculé, vous pouvez continuer';
|
||||
$_MODULE['<{importerosc}prestashop>importerosc_b405d0bebeedbdc1773a44ac36b8ffc4'] = 'Il est fortement recommandé de sauvegarder votre base de données avant de continuer. Avez-vous fait une sauvegarde?';
|
||||
$_MODULE['<{importerosc}prestashop>importerosc_9f95fc55011203d91d50a0ed512f805f'] = 'Impossible de \"ALTER TABLE\"';
|
||||
|
||||
@@ -61,10 +61,14 @@ class importerosc extends ImportModule
|
||||
|
||||
public function displaySpecificOptions()
|
||||
{
|
||||
$html = '';
|
||||
if (!$this->checkCategoriesLevel())
|
||||
$html .= $this->displayCategoriesLevelConf();
|
||||
|
||||
$langagues = $this->executeS('SELECT * FROM `'.bqSQL($this->prefix).'languages`');
|
||||
$curencies = $this->executeS('SELECT * FROM `'.bqSQL($this->prefix).'currencies`');
|
||||
|
||||
$html = '<label style=\'width:220px\'>'.$this->l('Default osCommerce language : ').'</label>
|
||||
$html .= '<label style=\'width:220px\'>'.$this->l('Default osCommerce language : ').'</label>
|
||||
<div class="margin-form">
|
||||
<select name=\'defaultOscLang\'><option value=\'0\'>------</option>';
|
||||
foreach($langagues AS $lang)
|
||||
@@ -148,9 +152,10 @@ class importerosc extends ImportModule
|
||||
$identifier = 'id_country';
|
||||
$defaultIdLang = $this->getDefaultIdLang();
|
||||
$countries = $this->executeS('
|
||||
SELECT countries_id as id_country, countries_name as name, countries_iso_code_2 as iso_code, `'.bqSQL($defaultIdLang).'̀ as id_lang,
|
||||
SELECT countries_id as id_country, countries_name as name, countries_iso_code_2 as iso_code, '.(int)$defaultIdLang.' as id_lang,
|
||||
1 as id_zone, 0 as id_currency, 1 as contains_states, 1 as need_identification_number, 1 as active, 1 as display_tax_label
|
||||
FROM `'.bqSQL($this->prefix).'countries` as c LIMIT '.(int)($limit).' , '.(int)$nrb_import);
|
||||
|
||||
return $this->autoFormat($countries, $identifier, $keyLanguage, $multiLangFields);
|
||||
}
|
||||
|
||||
@@ -219,19 +224,19 @@ class importerosc extends ImportModule
|
||||
$multiLangFields = array('name', 'link_rewrite');
|
||||
$keyLanguage = 'id_lang';
|
||||
$identifier = 'id_category';
|
||||
|
||||
$categories = $this->executeS('
|
||||
SELECT c.categories_id as id_category, c.parent_id as id_parent, 0 as level_depth, cd.language_id as id_lang, cd.categories_name as name , 1 as active, categories_image as images
|
||||
SELECT c.categories_id as id_category, c.parent_id as id_parent, level as level_depth, cd.language_id as id_lang, cd.categories_name as name , 1 as active, categories_image as images
|
||||
FROM `'.bqSQL($this->prefix).'categories` c
|
||||
LEFT JOIN `'.bqSQL($this->prefix).'categories_description` cd ON (c.categories_id = cd.categories_id)
|
||||
WHERE cd.categories_name IS NOT NULL AND cd.language_id IS NOT NULL
|
||||
ORDER BY c.categories_id, cd.language_id
|
||||
ORDER BY c.level ASC , c.`categories_id`
|
||||
LIMIT '.(int)($limit).' , '.(int)$nrb_import);
|
||||
foreach($categories as& $cat)
|
||||
{
|
||||
$cat['link_rewrite'] = Tools::link_rewrite($cat['name']);
|
||||
$cat['images'] = array(Tools::getProtocol().Tools::getValue('shop_url').'/images/'.$cat['images']);
|
||||
}
|
||||
|
||||
return $this->autoFormat($categories, $identifier, $keyLanguage, $multiLangFields);
|
||||
}
|
||||
|
||||
@@ -256,6 +261,7 @@ class importerosc extends ImportModule
|
||||
SELECT p.`products_options_values_id` as id_attribute, p.`products_options_values_name` as name, p.`language_id` as id_lang , po.`products_options_id` as id_attribute_group
|
||||
FROM `'.bqSQL($this->prefix).'products_options_values` p
|
||||
LEFT JOIN `'.bqSQL($this->prefix).'products_options_values_to_products_options` po ON (po.products_options_values_id = p.products_options_values_id)
|
||||
ORDER BY p.`products_options_values_id`
|
||||
LIMIT '.(int)($limit).' , '.(int)$nrb_import);
|
||||
return $this->autoFormat($countries, $identifier, $keyLanguage, $multiLangFields);
|
||||
}
|
||||
@@ -274,6 +280,7 @@ class importerosc extends ImportModule
|
||||
FROM `'.bqSQL($this->prefix).'products` p
|
||||
LEFT JOIN `'.bqSQL($this->prefix).'products_description` pd ON (p.products_id = pd.products_id)
|
||||
WHERE pd.products_name IS NOT NULL AND pd.language_id IS NOT NULL
|
||||
ORDER BY p.`products_id`
|
||||
LIMIT '.(int)($limit).' , '.(int)$nrb_import);
|
||||
|
||||
$this->Execute('CREATE TABLE IF NOT EXISTS`products_images` (
|
||||
@@ -293,8 +300,8 @@ class importerosc extends ImportModule
|
||||
$images[] = Tools::getProtocol().Tools::getValue('shop_url').'/images/'.$res['image'];
|
||||
$product['images'] = array_merge(array($product['images']), $images);
|
||||
$product['link_rewrite'] = Tools::link_rewrite($product['name']);
|
||||
|
||||
|
||||
|
||||
|
||||
$result = $this->ExecuteS('SELECT `categories_id` FROM `'.bqSQL($this->prefix).'products_to_categories` WHERE products_id = '.(int)$product['id_product']);
|
||||
$category_product = array('category_product' => array($product['id_category_default'] => $product['id_product']));
|
||||
foreach($result as $res)
|
||||
@@ -462,7 +469,8 @@ class importerosc extends ImportModule
|
||||
|
||||
public function displayConfigConnector()
|
||||
{
|
||||
$content = '<label>'.$this->l('Server').' : </label>
|
||||
$content = '<script>var type_connector = "db";</script>
|
||||
<label>'.$this->l('Server').' : </label>
|
||||
<div class="margin-form">
|
||||
<input type="text" name="server" id="server" value="">
|
||||
<p>'.$this->l('(eg : mysql.mydomain.com)').'</p>
|
||||
@@ -488,6 +496,137 @@ class importerosc extends ImportModule
|
||||
return $content;
|
||||
}
|
||||
|
||||
public function checkCategoriesLevel()
|
||||
{
|
||||
$columns = $this->ExecuteS('SHOW COLUMNS FROM `'.bqSQL($this->prefix).'categories` ');
|
||||
foreach($columns as $field)
|
||||
if ($field['Field'] == 'level')
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
public function displayCategoriesLevelConf()
|
||||
{
|
||||
$html = '<div class="warn" id="warn_category_level" style="width:450px;display:none">
|
||||
<img src="../img/admin/warn2.png">
|
||||
'.$this->l('You are trying to import categories and we\'ve detected, that your oscommerce database don\'t have the field "level" in the table categorie. You must have this field to continue the import of categories.');
|
||||
|
||||
$html .= '<button class="button" onclick="addAndCalculateLevel();" style="padding:10px;font-size:13px;text:align:center">'.$this->l('Click to add and calculate the filed "level" .').'</button> <span id="loading" style="display:none"><img src="../img/loader.gif"></span></div>
|
||||
<div class="conf" id="conf_category_level" style="width:450px;display:none"><img src="../img/admin/ok2.png">'.$this->l('Level field\'s has been created and calculated, You can continue').'</div>';
|
||||
|
||||
$html .= '
|
||||
<script>
|
||||
$(document).ready(function (){
|
||||
|
||||
function checkCategorySelected()
|
||||
{
|
||||
if ($(\'#id_category_on:radio\').attr(\'checked\'))
|
||||
{
|
||||
$(\'#warn_category_level\').show();
|
||||
$(\'#checkAndSaveConfig\').attr(\'disabled\', \'disabled\');
|
||||
$(\'#checkAndSaveConfig\').hide();
|
||||
}
|
||||
else
|
||||
{
|
||||
$(\'#warn_category_level\').hide();
|
||||
$(\'#checkAndSaveConfig\').removeAttr(\'disabled\');
|
||||
$(\'#checkAndSaveConfig\').show();
|
||||
}
|
||||
|
||||
}
|
||||
checkCategorySelected();
|
||||
$(\'input[name="getCategories"]\').change( function () {
|
||||
checkCategorySelected();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function addAndCalculateLevel()
|
||||
{
|
||||
if (confirm(\''.$this->l('It is highly recommended to backup your database before proceeding. Did you make a backup?').'\'))
|
||||
{
|
||||
$(\'#loading\').show();
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: "../modules/importerosc/ajax.php",
|
||||
async: false,
|
||||
cache: false,
|
||||
dataType : "json",
|
||||
data: "ajax=true&token='.sha1(_COOKIE_KEY_.'importosc').'&server="+$(\'#server\').val()+"&user="+$(\'#user\').val()+"&password="+$(\'#password\').val()+"&database="+$(\'#database\').val()+"&prefix="+$(\'#prefix\').val() ,
|
||||
success: function (jsonData)
|
||||
{
|
||||
if (jsonData.hasError)
|
||||
alert(jsonData.error);
|
||||
else
|
||||
{
|
||||
$(\'#warn_category_level\').remove();
|
||||
$(\'#checkAndSaveConfig\').removeAttr(\'disabled\');
|
||||
$(\'#checkAndSaveConfig\').show();
|
||||
$(\'#conf_category_level\').show();
|
||||
}
|
||||
},
|
||||
error: function (XMLHttpRequest, textStatus, errorThrown)
|
||||
{
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
return false;
|
||||
}
|
||||
</script>';
|
||||
|
||||
return $html;
|
||||
}
|
||||
|
||||
public function createLevelAndCalculate()
|
||||
{
|
||||
if ($this->checkCategoriesLevel())
|
||||
die('{"hasError" : false}');
|
||||
|
||||
if ($this->createLevel())
|
||||
$this->calculateLevel();
|
||||
else
|
||||
die('{"hasError" : true, "error" : "'.$this->l('Can not ALTER TABLE').'"}');
|
||||
}
|
||||
|
||||
public function createLevel()
|
||||
{
|
||||
return $this->Execute('ALTER TABLE `'.bqSQL($this->prefix).'categories` ADD `level` INT NOT NULL');
|
||||
}
|
||||
|
||||
public function calculateLevel()
|
||||
{
|
||||
$this->updateLevel($this->getSubCat(0), 1);
|
||||
die('{"hasError" : false}');
|
||||
}
|
||||
|
||||
public function updateLevel($ids_cat, $level = 1)
|
||||
{
|
||||
$this->Execute('
|
||||
UPDATE `'.bqSQL($this->prefix).'categories`
|
||||
SET level = '.(int)$level.'
|
||||
WHERE categories_id IN ('.implode(',', $ids_cat).')');
|
||||
foreach($ids_cat as $id)
|
||||
if ($sub_cat = $this->getSubCat($id))
|
||||
$this->updateLevel($sub_cat, $level + 1);
|
||||
|
||||
}
|
||||
|
||||
public function getSubCat($id_parent)
|
||||
{
|
||||
$result = $this->ExecuteS('SELECT `categories_id` FROM `'.bqSQL($this->prefix).'categories` WHERE `parent_id`='.(int)$id_parent);
|
||||
if (!is_array($result) OR empty($result))
|
||||
return false;
|
||||
return $this->formatCategoriesIds($result);
|
||||
}
|
||||
|
||||
public function formatCategoriesIds($result)
|
||||
{
|
||||
$return = array();
|
||||
foreach($result as $key => $val)
|
||||
$return[] = $val['categories_id'];
|
||||
return $return;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@@ -544,7 +544,7 @@ class Loyalty extends Module
|
||||
$loyalty->id_customer = (int)$params['customer']->id;
|
||||
$loyalty->id_order = (int)$params['order']->id;
|
||||
$loyalty->points = LoyaltyModule::getOrderNbPoints($params['order']);
|
||||
if ((int)(Configuration::get('PS_LOYALTY_NONE_AWARD')) AND (int)($loyalty->points) == 0)
|
||||
if (!Configuration::get('PS_LOYALTY_NONE_AWARD') AND (int)$loyalty->points == 0)
|
||||
$loyalty->id_loyalty_state = LoyaltyStateModule::getNoneAwardId();
|
||||
else
|
||||
$loyalty->id_loyalty_state = LoyaltyStateModule::getDefaultId();
|
||||
@@ -569,7 +569,7 @@ class Loyalty extends Module
|
||||
{
|
||||
if (!Validate::isLoadedObject($loyalty = new LoyaltyModule(LoyaltyModule::getByOrderId($order->id))))
|
||||
return false;
|
||||
if ((int)(Configuration::get('PS_LOYALTY_NONE_AWARD')) AND $loyalty->id_loyalty_state == LoyaltyStateModule::getNoneAwardId())
|
||||
if ((int)Configuration::get('PS_LOYALTY_NONE_AWARD') AND $loyalty->id_loyalty_state == LoyaltyStateModule::getNoneAwardId())
|
||||
return true;
|
||||
|
||||
if ($newOrder->id == $this->loyaltyStateValidation->id_order_state)
|
||||
|
||||
|
After Width: | Height: | Size: 673 B |
@@ -0,0 +1,47 @@
|
||||
// JavaScript Document
|
||||
$(document).ready(function() {
|
||||
|
||||
$('#button_test_mailjet').click(function() {
|
||||
$("#mailjet_test_ok").hide();
|
||||
$("#mailjet_test_ko").hide();
|
||||
$("#div_email_test").show(500);
|
||||
});
|
||||
|
||||
$('#button_send_mailjet').click(function() {
|
||||
var token = $(this).attr('rel');
|
||||
$("#button_test_mailjet").hide();
|
||||
$("#image_ajax_mailjet").show();
|
||||
$("#div_email_test").hide();
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
url: "../modules/mailjet/ajax.php",
|
||||
async: true,
|
||||
cache: false,
|
||||
dataType : "html",
|
||||
data: 'token=' + token + '&mailjet_api_key=' + $("#mailjet_api_key").val() + '&mailjet_secret_key=' + $("#mailjet_secret_key").val() + '&email_from=' + escape($("#email_from").val()),
|
||||
success: function(html)
|
||||
{
|
||||
$("#button_test_mailjet").show();
|
||||
$("#image_ajax_mailjet").hide();
|
||||
var retour = html.split("|");
|
||||
|
||||
if (retour[0] == "true")
|
||||
{
|
||||
$("#mailjet_test_ok").show(500);
|
||||
} else {
|
||||
$("#mailjet_activation_no").attr('checked', true);
|
||||
$("#mailjet_error_message").html(retour[1]);
|
||||
$("#mailjet_test_ko").show(500);
|
||||
|
||||
}
|
||||
},
|
||||
error: function(jqxhr, status, errorThrown)
|
||||
{
|
||||
$("#mailjet_activation_no").attr('checked', true);
|
||||
$("#mailjet_error_message").html(errorThrown);
|
||||
$("#mailjet_test_ko").show(500);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright (c) 2011 Mailjet SAS
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
* @author Dream me up
|
||||
* @copyright 2011 Mailjet SAS
|
||||
* @version Release: $Revision: 1.4 $
|
||||
* @license hhttp://opensource.org/licenses/mit-license MIT License
|
||||
* International Registred Trademark & Property of Mailjet SAS
|
||||
*/
|
||||
|
||||
require('../../config/config.inc.php');
|
||||
require('mailjet.php');
|
||||
|
||||
if (Tools::getValue('token') == '' || Tools::getValue('token') != Configuration::get('MAILJET_TOKEN'))
|
||||
die('Invalid Token');
|
||||
|
||||
$obj_mailjet = new Mailjet();
|
||||
$email_from = urldecode($_GET['email_from']);
|
||||
try {
|
||||
$sujet = $obj_mailjet->l('Mailjet Test E-mail');
|
||||
$message = $obj_mailjet->l('Hello').",\r\n\r\n".$obj_mailjet->l('This E-mail confirms you that Mailjet has successfully been installed on your shop.');
|
||||
$result = Mail::sendMailTest(true, "in.mailjet.com", $message, $sujet, "text/plain", $email_from, $email_from, $_GET['mailjet_api_key'], $_GET['mailjet_secret_key'], $smtpPort = 465, "tls");
|
||||
|
||||
if ($result === true)
|
||||
echo "true";
|
||||
else
|
||||
{
|
||||
if ($result == 999)
|
||||
$result = $obj_mailjet->l('The E-mail was not successfully sent');
|
||||
echo "false|".$result;
|
||||
reset_config_mailjet();
|
||||
}
|
||||
} catch(Exception $e) {
|
||||
echo "false|".$e->getMessage();
|
||||
reset_config_mailjet();
|
||||
}
|
||||
|
||||
function reset_config_mailjet()
|
||||
{
|
||||
Configuration::updateValue('MAILJET_ACTIVATE', 0);
|
||||
Configuration::updateValue('PS_MAIL_METHOD', 1);
|
||||
Configuration::updateValue('PS_MAIL_SERVER', "");
|
||||
Configuration::updateValue('PS_MAIL_USER', "");
|
||||
Configuration::updateValue('PS_MAIL_PASSWD', "");
|
||||
Configuration::updateValue('PS_MAIL_SMTP_ENCRYPTION', "");
|
||||
Configuration::updateValue('PS_MAIL_SMTP_PORT', 25);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<module>
|
||||
<name>mailjet</name>
|
||||
<displayName><![CDATA[Mailjet]]></displayName>
|
||||
<version><![CDATA[1.0]]></version>
|
||||
<description><![CDATA[This modules sends through Mailjet all email coming from your Prestashop installation]]></description>
|
||||
<author><![CDATA[]]></author>
|
||||
<tab><![CDATA[front_office_features]]></tab>
|
||||
<is_configurable>1</is_configurable>
|
||||
<need_instance>1</need_instance>
|
||||
<limited_countries></limited_countries>
|
||||
</module>
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
global $_MODULE;
|
||||
$_MODULE = array();
|
||||
$_MODULE['<{mailjet}prestashop>ajax_64b88c69849c8b362e7f97c6eaab574d'] = 'E-mail de test';
|
||||
$_MODULE['<{mailjet}prestashop>ajax_8b1a9953c4611296a827abf8c47804d7'] = 'Bonjour';
|
||||
$_MODULE['<{mailjet}prestashop>ajax_c38b28d6adf75b2b2936de1f2168b6e6'] = 'Cet e-mail vous confirme que Mailjet a été correctement installé sur votre boutique.';
|
||||
$_MODULE['<{mailjet}prestashop>ajax_cfc9dca01a0503813a5f9585ba6780d1'] = 'L\'e-mail n\'a pas pu être envoyé';
|
||||
$_MODULE['<{mailjet}prestashop>mailjet_c127c5641733ecedcce7c33ed849401e'] = 'Ce module vous permet d\'envoyer vos e-mail PrestaShop via Mailjet';
|
||||
$_MODULE['<{mailjet}prestashop>mailjet_9ccb2eaeed6c7e95ecaf108373619300'] = 'Ce module est activé mais la clé API ou la clé secrète ne sont pas correctement remplies.';
|
||||
$_MODULE['<{mailjet}prestashop>mailjet_64b88c69849c8b362e7f97c6eaab574d'] = 'E-mail de test';
|
||||
$_MODULE['<{mailjet}prestashop>mailjet_8b1a9953c4611296a827abf8c47804d7'] = 'Bonjour';
|
||||
$_MODULE['<{mailjet}prestashop>mailjet_c38b28d6adf75b2b2936de1f2168b6e6'] = 'Cet e-mail vous confirme que Mailjet a été correctement installé sur votre boutique.';
|
||||
$_MODULE['<{mailjet}prestashop>mailjet_cfc9dca01a0503813a5f9585ba6780d1'] = 'L\'e-mail n\'a pas pu être envoyé';
|
||||
$_MODULE['<{mailjet}prestashop>mailjet_c888438d14855d7d96a2724ee9c306bd'] = 'Configuraiton mise à jour';
|
||||
$_MODULE['<{mailjet}prestashop>mailjet_9e3f29ea93d121e237085def4ee29f74'] = 'Ce module vous permet d\'envoyer vos e-mail PrestaShop (et ceux de la plupart de vos modules) via Mailjet';
|
||||
$_MODULE['<{mailjet}prestashop>mailjet_f4f70727dc34561dfde1a3c529b6205c'] = 'Configuration';
|
||||
$_MODULE['<{mailjet}prestashop>mailjet_6ad7efc596f5720291e748ff2185733f'] = 'Clé API Mailjet';
|
||||
$_MODULE['<{mailjet}prestashop>mailjet_a02496bddaea8e6616bf285fc37973be'] = 'Clé secrète Mailjet';
|
||||
$_MODULE['<{mailjet}prestashop>mailjet_ed1d12d25d1a1ec139c84015ae766a7f'] = 'Envoyer vos e-mails via Mailjet';
|
||||
$_MODULE['<{mailjet}prestashop>mailjet_93cba07454f06a4a960172bbd6e2a435'] = 'Oui';
|
||||
$_MODULE['<{mailjet}prestashop>mailjet_bafd7322c6e97d25b6299b5d6fe8920b'] = 'Non';
|
||||
$_MODULE['<{mailjet}prestashop>mailjet_63ade95d66cda885393aab6f5f5e4e76'] = 'Authentification réussie ! Votre configuration est correcte.';
|
||||
$_MODULE['<{mailjet}prestashop>mailjet_424ab525513861737da68b0700b5cd20'] = 'Une erreur est survenue :';
|
||||
$_MODULE['<{mailjet}prestashop>mailjet_79dfc1f365ed194bb9fc0da20f1a3857'] = 'Si vous ne comprenez pas cette erreur, veuillez contacter';
|
||||
$_MODULE['<{mailjet}prestashop>mailjet_d496cec7c628e4438ee719315942e2d6'] = ' E-mail de / à :';
|
||||
$_MODULE['<{mailjet}prestashop>mailjet_94966d90747b97d1f0f206c98a8b1ac3'] = 'Envoyer';
|
||||
$_MODULE['<{mailjet}prestashop>mailjet_540caa299a719ee320cf416ffae7adca'] = 'Test de configuration';
|
||||
$_MODULE['<{mailjet}prestashop>mailjet_d4dccb8ca2dac4e53c01bd9954755332'] = 'Sauvegarder la configuration';
|
||||
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
@@ -0,0 +1,213 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright (c) 2011 Mailjet SAS
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
* @author Dream me up
|
||||
* @copyright 2011 Mailjet SAS
|
||||
* @version Release: $Revision: 1.4 $
|
||||
* @license hhttp://opensource.org/licenses/mit-license MIT License
|
||||
* International Registred Trademark & Property of Mailjet SAS
|
||||
*/
|
||||
|
||||
|
||||
// Security
|
||||
if (!defined('_PS_VERSION_'))
|
||||
exit;
|
||||
|
||||
class Mailjet extends Module
|
||||
{
|
||||
|
||||
/*
|
||||
** Construct Method
|
||||
**
|
||||
*/
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->name = 'mailjet';
|
||||
$this->tab = 'front_office_features';
|
||||
$this->version = '1.0';
|
||||
$this->displayName = 'Mailjet';
|
||||
|
||||
parent::__construct();
|
||||
|
||||
$this->description = $this->l('This modules sends through Mailjet all email coming from your Prestashop installation');
|
||||
|
||||
if (Configuration::get('MAILJET_ACTIVATE') == 1 && (strlen(Configuration::get('MAILJET_API_KEY')) < 3 || strlen(Configuration::get('MAILJET_SECRET_KEY')) < 3))
|
||||
$this->warning = $this->l('The module is activated but api key or secret key are not correctly set.');
|
||||
|
||||
// Defines ajax lang variables in way to translate them
|
||||
$this->l('Mailjet Test E-mail');
|
||||
$this->l('Hello');
|
||||
$this->l('This E-mail confirms you that Mailjet has successfully been installed on your shop.');
|
||||
$this->l('The E-mail was not successfully sent');
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
** Install / Uninstall Methods
|
||||
**
|
||||
*/
|
||||
|
||||
public function install()
|
||||
{
|
||||
// Can't do anything else for retrocompatibility
|
||||
if (md5_file(dirname(__FILE__).'/override/Message.php') != md5_file(dirname(__FILE__).'/../../tools/swift/Swift/Message.php'))
|
||||
return false;
|
||||
if (!@copy(dirname(__FILE__).'/override/Message-mailjet.php', dirname(__FILE__).'/../../tools/swift/Swift/Message.php'))
|
||||
return false;
|
||||
|
||||
// Create Token
|
||||
Configuration::updateValue('MAILJET_TOKEN', md5(rand()));
|
||||
|
||||
// Install module
|
||||
if (!parent::install())
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public function uninstall()
|
||||
{
|
||||
// Can't do anything else for retrocompatibility
|
||||
if (md5_file(dirname(__FILE__).'/override/Message-mailjet.php') != md5_file(dirname(__FILE__).'/../../tools/swift/Swift/Message.php'))
|
||||
return false;
|
||||
if (!@copy(dirname(__FILE__).'/override/Message.php', dirname(__FILE__).'/../../tools/swift/Swift/Message.php'))
|
||||
return false;
|
||||
|
||||
// Uninstall module
|
||||
Configuration::updateValue('PS_MAIL_METHOD', 1);
|
||||
Configuration::updateValue('PS_MAIL_SERVER', "");
|
||||
Configuration::updateValue('PS_MAIL_USER', "");
|
||||
Configuration::updateValue('PS_MAIL_PASSWD', "");
|
||||
Configuration::updateValue('PS_MAIL_SMTP_ENCRYPTION', "");
|
||||
Configuration::updateValue('PS_MAIL_SMTP_PORT', 25);
|
||||
if (!Configuration::deleteByName('MAILJET_TOKEN') OR !Configuration::deleteByName('MAILJET_SECRET_KEY') OR !Configuration::deleteByName('MAILJET_API_KEY') OR !parent::uninstall())
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
** Form Config Methods
|
||||
**
|
||||
*/
|
||||
|
||||
public function getContent()
|
||||
{
|
||||
global $cookie;
|
||||
|
||||
$lang = new Language((int)($cookie->id_lang));
|
||||
if (!in_array($lang->iso_code, array('fr', 'en', 'es')))
|
||||
$lang->iso_code = 'en';
|
||||
|
||||
$output = '<script type="text/javascript" src="'.__PS_BASE_URI__.'modules/'.$this->name.'/ajax.js"></script>
|
||||
<p style="margin-bottom: 5px;"><img src="'.__PS_BASE_URI__.'modules/'.$this->name.'/logo-mailjet.jpg" alt="" /></p>';
|
||||
|
||||
if (Tools::isSubmit('submitMailjet'))
|
||||
{
|
||||
Configuration::updateValue('MAILJET_API_KEY', pSQL(Tools::getValue('mailjet_api_key')));
|
||||
Configuration::updateValue('MAILJET_SECRET_KEY', pSQL(Tools::getValue('mailjet_secret_key')));
|
||||
Configuration::updateValue('MAILJET_ACTIVATE', (int)(Tools::getValue('mailjet_activation')));
|
||||
|
||||
// If mailjet activation, let's configure
|
||||
if ((int)Tools::getValue('mailjet_activation') == 1)
|
||||
{
|
||||
Configuration::updateValue('PS_MAIL_METHOD', 2);
|
||||
Configuration::updateValue('PS_MAIL_SERVER', "in.mailjet.com");
|
||||
Configuration::updateValue('PS_MAIL_USER', pSQL(Configuration::get('MAILJET_API_KEY')));
|
||||
Configuration::updateValue('PS_MAIL_PASSWD', pSQL(Configuration::get('MAILJET_SECRET_KEY')));
|
||||
Configuration::updateValue('PS_MAIL_SMTP_ENCRYPTION', "tls");
|
||||
Configuration::updateValue('PS_MAIL_SMTP_PORT', 465);
|
||||
}
|
||||
else
|
||||
{
|
||||
Configuration::updateValue('PS_MAIL_METHOD', 1);
|
||||
Configuration::updateValue('PS_MAIL_SERVER', "");
|
||||
Configuration::updateValue('PS_MAIL_USER', "");
|
||||
Configuration::updateValue('PS_MAIL_PASSWD', "");
|
||||
Configuration::updateValue('PS_MAIL_SMTP_ENCRYPTION', "");
|
||||
Configuration::updateValue('PS_MAIL_SMTP_PORT', 25);
|
||||
}
|
||||
|
||||
$output .= '
|
||||
<div class="conf confirm">
|
||||
<img src="../img/admin/ok.gif" alt="" title="" />
|
||||
'.$this->l('Settings updated').'
|
||||
</div>';
|
||||
}
|
||||
|
||||
$chk_yes = "";
|
||||
$chk_no = " checked=\"checked\"";
|
||||
|
||||
if ((int)(Tools::getValue('mailjet_activation', Configuration::get('MAILJET_ACTIVATE'))) == 1)
|
||||
{
|
||||
$chk_yes = ' checked="checked"';
|
||||
$chk_no = '';
|
||||
}
|
||||
|
||||
$output .= '
|
||||
<div>
|
||||
<p style="margin-bottom:10px;">
|
||||
<b>'.$this->l('This module sends through Mailjet all email coming from your Prestashop installation (and most third party modules)').'.</b>
|
||||
</p>
|
||||
<form action="'.htmlentities($_SERVER['REQUEST_URI']).'" method="post">
|
||||
<fieldset>
|
||||
<legend><img src="../img/admin/cog.gif" alt="" class="middle" />'.$this->l('Settings').'</legend>
|
||||
<label>'.$this->l('Mailjet API Key:').'</label>
|
||||
<div class="margin-form">
|
||||
<input type="text" name="mailjet_api_key" id="mailjet_api_key" size="30" value="'.htmlentities(Tools::getValue('mailjet_api_key', Configuration::get('MAILJET_API_KEY'))).'" />
|
||||
</div>
|
||||
<hr size="1" style="margin-bottom: 20px;" noshade />
|
||||
<label>'.$this->l('Mailjet Secret Key').'</label>
|
||||
<div class="margin-form">
|
||||
<input type="text" name="mailjet_secret_key" id="mailjet_secret_key" size="30" value="'.htmlentities(Tools::getValue('mailjet_secret_key', Configuration::get('MAILJET_SECRET_KEY'))).'" />
|
||||
</div>
|
||||
<hr size="1" style="margin-bottom: 20px;" noshade />
|
||||
<label style="vertical-align: middle;">'.$this->l('Send Email through Mailjet:').'</label>
|
||||
<div class="margin-form" style="margin-top: 5px;">
|
||||
<input type="radio" name="mailjet_activation" value="1" style="vertical-align: middle;" '.$chk_yes.' /> '.$this->l('Yes').'
|
||||
<input type="radio" name="mailjet_activation" id="mailjet_activation_no" value="0" style="vertical-align: middle;" '.$chk_no.' /> '.$this->l('No').'
|
||||
</div>
|
||||
<hr size="1" style="margin-bottom: 20px;" noshade />
|
||||
<div class="conf confirm" id="mailjet_test_ok" style="display:none">
|
||||
<img src="../img/admin/ok.gif" alt="" title="" />
|
||||
'.$this->l('Authentication successful ! Your configuration is correct.').'
|
||||
</div>
|
||||
<div class="conf error" id="mailjet_test_ko" style="display:none">
|
||||
<img src="../img/admin/forbbiden.gif" alt="" title="" />
|
||||
'.$this->l('An Error has occured : ').'<span id="mailjet_error_message"></span>
|
||||
<p>'.$this->l('If you don\'t understand this error please contact').' <a href="http://fr.mailjet.com/support" target="_blank">Mailjet Support</a></p>
|
||||
</div>
|
||||
<div id="div_email_test" style="display:none">
|
||||
<p style="text-align:center">'.$this->l('E-mail From / to :').' <input type="text" id="email_from" value="'.htmlentities(Configuration::get('PS_SHOP_EMAIL')).'" size="40" /> <input type="button" name="sendTestMailjet" value="'.$this->l('Send').'" class="button" rel="'.htmlentities(Configuration::get('MAILJET_TOKEN')).'" id="button_send_mailjet" /></p>
|
||||
<hr size="1" style="margin-bottom: 20px;" noshade />
|
||||
</div>
|
||||
<center><input type="button" name="testMailjet" value="'.$this->l('Test Configuration').'" class="button" id="button_test_mailjet" /><img src="'.__PS_BASE_URI__.'modules/'.$this->name.'/ajax-mailjet.gif" id="image_ajax_mailjet" style="display:none" /> <input type="submit" name="submitMailjet" value="'.$this->l('Save settings').'" class="button" /></center>
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>';
|
||||
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,798 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Swift Mailer Message Component
|
||||
* Composes MIME 1.0 messages meeting various RFC standards
|
||||
* Deals with attachments, embedded images, multipart bodies, forwarded messages...
|
||||
* Please read the LICENSE file
|
||||
* @copyright Chris Corbyn <chris@w3style.co.uk>
|
||||
* @author Chris Corbyn <chris@w3style.co.uk>
|
||||
* @package Swift_Message
|
||||
* @license GNU Lesser General Public License
|
||||
*/
|
||||
|
||||
require_once dirname(__FILE__) . "/ClassLoader.php";
|
||||
Swift_ClassLoader::load("Swift_Address");
|
||||
Swift_ClassLoader::load("Swift_Message_Mime");
|
||||
Swift_ClassLoader::load("Swift_Message_Image");
|
||||
Swift_ClassLoader::load("Swift_Message_Part");
|
||||
|
||||
|
||||
/**
|
||||
* Swift Message class
|
||||
* @package Swift_Message
|
||||
* @author Chris Corbyn <chris@w3style.co.uk>
|
||||
*/
|
||||
class Swift_Message extends Swift_Message_Mime
|
||||
{
|
||||
/**
|
||||
* Constant from a high priority message (pretty meaningless)
|
||||
*/
|
||||
const PRIORITY_HIGH = 1;
|
||||
/**
|
||||
* Constant for a low priority message
|
||||
*/
|
||||
const PRIORITY_LOW = 5;
|
||||
/**
|
||||
* Constant for a normal priority message
|
||||
*/
|
||||
const PRIORITY_NORMAL = 3;
|
||||
/**
|
||||
* The MIME warning for client not supporting multipart content
|
||||
* @var string
|
||||
*/
|
||||
protected $mimeWarning = null;
|
||||
/**
|
||||
* The version of the library (Swift) if known.
|
||||
* @var string
|
||||
*/
|
||||
protected $libVersion = "";
|
||||
/**
|
||||
* A container for references to other objects.
|
||||
* This is used in some very complex logic when sub-parts get shifted around.
|
||||
* @var array
|
||||
*/
|
||||
protected $references = array(
|
||||
"parent" => array("alternative" => null, "mixed" => null, "related" => null),
|
||||
"alternative" => array(),
|
||||
"mixed" => array(),
|
||||
"related" => array()
|
||||
);
|
||||
|
||||
/**
|
||||
* Ctor.
|
||||
* @param string Message subject
|
||||
* @param string Body
|
||||
* @param string Content-type
|
||||
* @param string Encoding
|
||||
* @param string Charset
|
||||
*/
|
||||
public function __construct($subject="", $body=null, $type="text/plain", $encoding=null, $charset=null)
|
||||
{
|
||||
parent::__construct();
|
||||
if (function_exists("date_default_timezone_set") && function_exists("date_default_timezone_get"))
|
||||
{
|
||||
date_default_timezone_set(@date_default_timezone_get());
|
||||
}
|
||||
$this->setReturnPath(null);
|
||||
$this->setTo("");
|
||||
$this->setFrom("");
|
||||
$this->setCc(null);
|
||||
$this->setBcc(null);
|
||||
$this->setReplyTo(null);
|
||||
$this->setSubject($subject);
|
||||
$this->setDate(time());
|
||||
if (defined("Swift::VERSION"))
|
||||
{
|
||||
$this->libVersion = Swift::VERSION;
|
||||
$this->headers->set("X-LibVersion", $this->libVersion);
|
||||
}
|
||||
$this->headers->set("MIME-Version", "1.0");
|
||||
$this->headers->set("X-Mailjet-Partner", "prestashop");
|
||||
$this->setContentType($type);
|
||||
$this->setCharset($charset);
|
||||
$this->setFlowed(true);
|
||||
$this->setEncoding($encoding);
|
||||
|
||||
foreach (array_keys($this->references["parent"]) as $key)
|
||||
{
|
||||
$this->setReference("parent", $key, $this);
|
||||
}
|
||||
|
||||
$this->setMimeWarning(
|
||||
"This is a message in multipart MIME format. Your mail client should not be displaying this. " .
|
||||
"Consider upgrading your mail client to view this message correctly."
|
||||
);
|
||||
|
||||
if ($body !== null)
|
||||
{
|
||||
$this->setData($body);
|
||||
if ($charset === null)
|
||||
{
|
||||
Swift_ClassLoader::load("Swift_Message_Encoder");
|
||||
if (Swift_Message_Encoder::instance()->isUTF8($body)) $this->setCharset("utf-8");
|
||||
else $this->setCharset("iso-8859-1");
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Sets a reference so when nodes are nested, operations can be redirected.
|
||||
* This really should be refactored to use just one array rather than dynamic variables.
|
||||
* @param string Key 1
|
||||
* @param string Key 2
|
||||
* @param Object Reference
|
||||
*/
|
||||
protected function setReference($where, $key, $ref)
|
||||
{
|
||||
if ($ref === $this) $this->references[$where][$key] = false;
|
||||
else $this->references[$where][$key] = $ref;
|
||||
}
|
||||
/**
|
||||
* Get a reference to an object (for complex reasons).
|
||||
* @param string Key 1
|
||||
* @param string Key 2
|
||||
* @return Object
|
||||
*/
|
||||
protected function getReference($where, $key)
|
||||
{
|
||||
if (!$this->references[$where][$key]) return $this;
|
||||
else return $this->references[$where][$key];
|
||||
}
|
||||
/**
|
||||
* Get the level in the MIME hierarchy at which this section should appear.
|
||||
* @return string
|
||||
*/
|
||||
public function getLevel()
|
||||
{
|
||||
return Swift_Message_Mime::LEVEL_TOP;
|
||||
}
|
||||
/**
|
||||
* Set the message id literally.
|
||||
* Unless you know what you are doing you should be using generateId() rather than this method,
|
||||
* otherwise you may break compliancy with RFC 2822.
|
||||
* @param string The message ID string.
|
||||
*/
|
||||
public function setId($id)
|
||||
{
|
||||
$this->headers->set("Message-ID", $id);
|
||||
}
|
||||
/**
|
||||
* Create a RFC 2822 compliant message id, optionally based upon $idstring.
|
||||
* The message ID includes information about the current time, the server and some random characters.
|
||||
* @param string An optional string the base the ID on
|
||||
* @return string The generated message ID, including the <> quotes.
|
||||
* @author Cristian Rodriguez <judas.iscariote@flyspray.org>
|
||||
*/
|
||||
public function generateId($idstring=null)
|
||||
{
|
||||
$midparams = array(
|
||||
"utctime" => gmstrftime("%Y%m%d%H%M%S"),
|
||||
"pid" => getmypid(),
|
||||
"randint" => mt_rand(),
|
||||
"customstr" => (preg_match("/^(?<!\\.)[a-z0-9\\.]+(?!\\.)\$/iD", $idstring) ? $idstring : "swift") ,
|
||||
"hostname" => (isset($_SERVER["SERVER_NAME"]) ? $_SERVER["SERVER_NAME"] : php_uname("n")),
|
||||
);
|
||||
$this->setId(vsprintf("<%s.%d.%d.%s@%s>", $midparams));
|
||||
return $this->getId();
|
||||
}
|
||||
/**
|
||||
* Get the generated message ID for this message, including the <> quotes.
|
||||
* If generated automatically, or using generateId() this method returns a RFC2822 compliant Message-ID.
|
||||
* @return string
|
||||
* @author Cristian Rodriguez <judas.iscariote@flyspray.org>
|
||||
*/
|
||||
public function getId()
|
||||
{
|
||||
return $this->headers->has("Message-ID") ? $this->headers->get("Message-ID") : null;
|
||||
}
|
||||
/**
|
||||
* Set the address in the Return-Path: header
|
||||
* @param string The bounce-detect address
|
||||
*/
|
||||
public function setReturnPath($address)
|
||||
{
|
||||
if ($address instanceof Swift_Address) $address = $address->build(true);
|
||||
$this->headers->set("Return-Path", $address);
|
||||
}
|
||||
/**
|
||||
* Return the address used in the Return-Path: header
|
||||
* @return string
|
||||
* @param boolean Return the address for SMTP command
|
||||
*/
|
||||
public function getReturnPath($smtp=false)
|
||||
{
|
||||
if ($this->headers->has("Return-Path"))
|
||||
{
|
||||
if (!$smtp) return $this->headers->get("Return-Path");
|
||||
else
|
||||
{
|
||||
$path = $this->headers->get("Return-Path");
|
||||
if (strpos($path, ">") > strpos($path, "<")) return substr($path, ($start = strpos($path, "<")), ($start + strrpos($path, ">") + 1));
|
||||
else return "<" . $path . ">";
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Set the address in the From: header
|
||||
* @param string The address to set as From
|
||||
*/
|
||||
public function setFrom($from)
|
||||
{
|
||||
if ($from instanceof Swift_Address) $from = $from->build();
|
||||
$this->headers->set("From", $from);
|
||||
}
|
||||
/**
|
||||
* Get the address used in the From: header
|
||||
* @return string
|
||||
*/
|
||||
public function getFrom()
|
||||
{
|
||||
if ($this->headers->has("From")) return $this->headers->get("From");
|
||||
}
|
||||
/**
|
||||
* Set the list of recipients in the To: header
|
||||
* @param mixed An array or a string
|
||||
*/
|
||||
public function setTo($to)
|
||||
{
|
||||
if ($to)
|
||||
{
|
||||
if (!is_array($to)) $to = array($to);
|
||||
foreach ($to as $key => $value)
|
||||
{
|
||||
if ($value instanceof Swift_Address) $to[$key] = $value->build();
|
||||
}
|
||||
}
|
||||
$this->headers->set("To", $to);
|
||||
}
|
||||
/**
|
||||
* Return the list of recipients in the To: header
|
||||
* @return array
|
||||
*/
|
||||
public function getTo()
|
||||
{
|
||||
if ($this->headers->has("To"))
|
||||
{
|
||||
$to = $this->headers->get("To");
|
||||
if ($to == "") return array();
|
||||
else return (array) $to;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Set the list of recipients in the Reply-To: header
|
||||
* @param mixed An array or a string
|
||||
*/
|
||||
public function setReplyTo($replyto)
|
||||
{
|
||||
if ($replyto)
|
||||
{
|
||||
if (!is_array($replyto)) $replyto = array($replyto);
|
||||
foreach ($replyto as $key => $value)
|
||||
{
|
||||
if ($value instanceof Swift_Address) $replyto[$key] = $value->build();
|
||||
}
|
||||
}
|
||||
$this->headers->set("Reply-To", $replyto);
|
||||
}
|
||||
/**
|
||||
* Return the list of recipients in the Reply-To: header
|
||||
* @return array
|
||||
*/
|
||||
public function getReplyTo()
|
||||
{
|
||||
if ($this->headers->has("Reply-To"))
|
||||
{
|
||||
$reply_to = $this->headers->get("Reply-To");
|
||||
if ($reply_to == "") return array();
|
||||
else return (array) $reply_to;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Set the list of recipients in the Cc: header
|
||||
* @param mixed An array or a string
|
||||
*/
|
||||
public function setCc($cc)
|
||||
{
|
||||
if ($cc)
|
||||
{
|
||||
if (!is_array($cc)) $cc = array($cc);
|
||||
foreach ($cc as $key => $value)
|
||||
{
|
||||
if ($value instanceof Swift_Address) $cc[$key] = $value->build();
|
||||
}
|
||||
}
|
||||
$this->headers->set("Cc", $cc);
|
||||
}
|
||||
/**
|
||||
* Return the list of recipients in the Cc: header
|
||||
* @return array
|
||||
*/
|
||||
public function getCc()
|
||||
{
|
||||
if ($this->headers->has("Cc"))
|
||||
{
|
||||
$cc = $this->headers->get("Cc");
|
||||
if ($cc == "") return array();
|
||||
else return (array) $cc;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Set the list of recipients in the Bcc: header
|
||||
* @param mixed An array or a string
|
||||
*/
|
||||
public function setBcc($bcc)
|
||||
{
|
||||
if ($bcc)
|
||||
{
|
||||
if (!is_array($bcc)) $bcc = array($bcc);
|
||||
foreach ($bcc as $key => $value)
|
||||
{
|
||||
if ($value instanceof Swift_Address) $bcc[$key] = $value->build();
|
||||
}
|
||||
}
|
||||
$this->headers->set("Bcc", $bcc);
|
||||
}
|
||||
/**
|
||||
* Return the list of recipients in the Bcc: header
|
||||
* @return array
|
||||
*/
|
||||
public function getBcc()
|
||||
{
|
||||
if ($this->headers->has("Bcc"))
|
||||
{
|
||||
$bcc = $this->headers->get("Bcc");
|
||||
if ($bcc == "") return array();
|
||||
else return (array) $bcc;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Set the subject in the headers
|
||||
* @param string The subject of the email
|
||||
*/
|
||||
public function setSubject($subject)
|
||||
{
|
||||
$this->headers->set("Subject", $subject);
|
||||
}
|
||||
/**
|
||||
* Get the current subject used in the headers
|
||||
* @return string
|
||||
*/
|
||||
public function getSubject()
|
||||
{
|
||||
return $this->headers->get("Subject");
|
||||
}
|
||||
/**
|
||||
* Set the date in the headers in RFC 2822 format
|
||||
* @param int The time as a UNIX timestamp
|
||||
*/
|
||||
public function setDate($date)
|
||||
{
|
||||
$this->headers->set("Date", date("r", $date));
|
||||
}
|
||||
/**
|
||||
* Get the date as it looks in the headers
|
||||
* @return string
|
||||
*/
|
||||
public function getDate()
|
||||
{
|
||||
return strtotime($this->headers->get("Date"));
|
||||
}
|
||||
/**
|
||||
* Set the charset of the document
|
||||
* @param string The charset used
|
||||
*/
|
||||
public function setCharset($charset)
|
||||
{
|
||||
$this->headers->setAttribute("Content-Type", "charset", $charset);
|
||||
if (($this->getEncoding() == "7bit") && (strtolower($charset) == "utf-8" || strtolower($charset) == "utf8")) $this->setEncoding("8bit");
|
||||
}
|
||||
/**
|
||||
* Get the charset used in the document
|
||||
* Returns null if none is set
|
||||
* @return string
|
||||
*/
|
||||
public function getCharset()
|
||||
{
|
||||
if ($this->headers->hasAttribute("Content-Type", "charset"))
|
||||
{
|
||||
return $this->headers->getAttribute("Content-Type", "charset");
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Set the "format" attribute to flowed
|
||||
* @param boolean On or Off
|
||||
*/
|
||||
public function setFlowed($flowed=true)
|
||||
{
|
||||
$value = null;
|
||||
if ($flowed) $value = "flowed";
|
||||
$this->headers->setAttribute("Content-Type", "format", $value);
|
||||
}
|
||||
/**
|
||||
* Check if the message format is set as flowed
|
||||
* @return boolean
|
||||
*/
|
||||
public function isFlowed()
|
||||
{
|
||||
if ($this->headers->hasAttribute("Content-Type", "format")
|
||||
&& $this->headers->getAttribute("Content-Type", "format") == "flowed")
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else return false;
|
||||
}
|
||||
/**
|
||||
* Set the message prioirty in the mail client (don't rely on this)
|
||||
* @param int The priority as a value between 1 (high) and 5 (low)
|
||||
*/
|
||||
public function setPriority($priority)
|
||||
{
|
||||
$priority = (int) $priority;
|
||||
if ($priority > self::PRIORITY_LOW) $priority = self::PRIORITY_LOW;
|
||||
if ($priority < self::PRIORITY_HIGH) $priority = self::PRIORITY_HIGH;
|
||||
$label = array(1 => "High", 2 => "High", 3 => "Normal", 4 => "Low", 5 => "Low");
|
||||
$this->headers->set("X-Priority", $priority);
|
||||
$this->headers->set("X-MSMail-Priority", $label[$priority]);
|
||||
$this->headers->set("X-MimeOLE", "Produced by SwiftMailer " . $this->libVersion);
|
||||
}
|
||||
/**
|
||||
* Request that the client send back a read-receipt (don't rely on this!)
|
||||
* @param string Request address
|
||||
*/
|
||||
public function requestReadReceipt($request)
|
||||
{
|
||||
if ($request instanceof Swift_Address) $request = $request->build();
|
||||
if (!$request)
|
||||
{
|
||||
$this->headers->set("Disposition-Notification-To", null);
|
||||
$this->headers->set("X-Confirm-Reading-To", null);
|
||||
$this->headers->set("Return-Receipt-To", null);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->headers->set("Disposition-Notification-To", $request);
|
||||
$this->headers->set("X-Confirm-Reading-To", $request);
|
||||
$this->headers->set("Return-Receipt-To", $request);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Check if a read receipt has been requested for this message
|
||||
* @return boolean
|
||||
*/
|
||||
public function wantsReadReceipt()
|
||||
{
|
||||
return $this->headers->has("Disposition-Notification-To");
|
||||
}
|
||||
/**
|
||||
* Get the current message priority
|
||||
* Returns NULL if none set
|
||||
* @return int
|
||||
*/
|
||||
public function getPriority()
|
||||
{
|
||||
if ($this->headers->has("X-Priority")) return $this->headers->get("X-Priority");
|
||||
else return null;
|
||||
}
|
||||
/**
|
||||
* Alias for setData()
|
||||
* @param mixed Body
|
||||
*/
|
||||
public function setBody($body)
|
||||
{
|
||||
$this->setData($body);
|
||||
}
|
||||
/**
|
||||
* Alias for getData()
|
||||
* @return mixed The document body
|
||||
*/
|
||||
public function getBody()
|
||||
{
|
||||
return $this->getData();
|
||||
}
|
||||
/**
|
||||
* Set the MIME warning message which is displayed to old clients
|
||||
* @var string The full warning message (in 7bit ascii)
|
||||
*/
|
||||
public function setMimeWarning($text)
|
||||
{
|
||||
$this->mimeWarning = (string) $text;
|
||||
}
|
||||
/**
|
||||
* Get the MIME warning which is displayed to old clients
|
||||
* @return string
|
||||
*/
|
||||
public function getMimeWarning()
|
||||
{
|
||||
return $this->mimeWarning;
|
||||
}
|
||||
/**
|
||||
* Attach a mime part or an attachment of some sort
|
||||
* Any descendant of Swift_Message_Mime can be added safely (including other Swift_Message objects for mail forwarding!!)
|
||||
* @param Swift_Message_Mime The document to attach
|
||||
* @param string An identifier to use (one is returned otherwise)
|
||||
* @return string The identifier for the part
|
||||
*/
|
||||
public function attach(Swift_Message_Mime $child, $id=null)
|
||||
{
|
||||
try {
|
||||
switch ($child->getLevel())
|
||||
{
|
||||
case Swift_Message_Mime::LEVEL_ALTERNATIVE:
|
||||
$sign = (strtolower($child->getContentType()) == "text/plain") ? -1 : 1;
|
||||
$id = $this->getReference("parent", "alternative")->addChild($child, $id, $sign);
|
||||
$this->setReference("alternative", $id, $child);
|
||||
break;
|
||||
case Swift_Message_Mime::LEVEL_RELATED:
|
||||
$id = "cid:" . $child->getContentId();
|
||||
$id = $this->getReference("parent", "related")->addChild($child, $id, 1);
|
||||
$this->setReference("related", $id, $child);
|
||||
break;
|
||||
case Swift_Message_Mime::LEVEL_MIXED: default:
|
||||
$id = $this->getReference("parent", "mixed")->addChild($child, $id, 1);
|
||||
$this->setReference("mixed", $id, $child);
|
||||
break;
|
||||
}
|
||||
$this->postAttachFixStructure();
|
||||
$this->fixContentType();
|
||||
return $id;
|
||||
} catch (Swift_Message_MimeException $e) {
|
||||
throw new Swift_Message_MimeException("Something went wrong whilst trying to move some MIME parts during an attach(). " .
|
||||
"The MIME component threw an exception:<br />" . $e->getMessage());
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Remove a nested MIME part
|
||||
* @param string The ID of the attached part
|
||||
* @throws Swift_Message_MimeException If no such part exists
|
||||
*/
|
||||
public function detach($id)
|
||||
{
|
||||
try {
|
||||
switch (true)
|
||||
{
|
||||
case array_key_exists($id, $this->references["alternative"]):
|
||||
$this->getReference("parent", "alternative")->removeChild($id);
|
||||
unset($this->references["alternative"][$id]);
|
||||
break;
|
||||
case array_key_exists($id, $this->references["related"]):
|
||||
$this->getReference("parent", "related")->removeChild($id);
|
||||
unset($this->references["related"][$id]);
|
||||
break;
|
||||
case array_key_exists($id, $this->references["mixed"]):
|
||||
$this->getReference("parent", "mixed")->removeChild($id);
|
||||
unset($this->references["mixed"][$id]);
|
||||
break;
|
||||
default:
|
||||
throw new Swift_Message_MimeException("Unable to detach part identified by ID '" . $id . "' since it's not registered.");
|
||||
break;
|
||||
}
|
||||
$this->postDetachFixStructure();
|
||||
$this->fixContentType();
|
||||
} catch (Swift_Message_MimeException $e) {
|
||||
throw new Swift_Message_MimeException("Something went wrong whilst trying to move some MIME parts during a detach(). " .
|
||||
"The MIME component threw an exception:<br />" . $e->getMessage());
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Sets the correct content type header by looking at what types of data we have set
|
||||
*/
|
||||
protected function fixContentType()
|
||||
{
|
||||
if (!empty($this->references["mixed"])) $this->setContentType("multipart/mixed");
|
||||
elseif (!empty($this->references["related"])) $this->setContentType("multipart/related");
|
||||
elseif (!empty($this->references["alternative"])) $this->setContentType("multipart/alternative");
|
||||
}
|
||||
/**
|
||||
* Move a branch of the tree, containing all it's MIME parts onto another branch
|
||||
* @param string The content type on the branch itself
|
||||
* @param string The content type which may exist in the branch's parent
|
||||
* @param array The array containing all the nodes presently
|
||||
* @param string The location of the branch now
|
||||
* @param string The location of the branch after moving
|
||||
* @param string The key to identify the branch by in it's new location
|
||||
*/
|
||||
protected function moveBranchIn($type, $nested_type, $from, $old_branch, $new_branch, $tag)
|
||||
{
|
||||
$new = new Swift_Message_Part();
|
||||
$new->setContentType($type);
|
||||
$this->getReference("parent", $new_branch)->addChild($new, $tag, -1);
|
||||
|
||||
switch ($new_branch)
|
||||
{
|
||||
case "related": $this->setReference("related", $tag, $new);//relatedRefs[$tag] = $new;
|
||||
break;
|
||||
case "mixed": $this->setReference("mixed", $tag, $new);//mixedRefs[$tag] = $new;
|
||||
break;
|
||||
}
|
||||
|
||||
foreach ($from as $id => $ref)
|
||||
{
|
||||
if (!$ref) $ref = $this;
|
||||
$sign = (strtolower($ref->getContentType()) == "text/plain"
|
||||
|| strtolower($ref->getContentType()) == $nested_type) ? -1 : 1;
|
||||
switch ($new_branch)
|
||||
{
|
||||
case "related": $this->getReference("related", $tag)->addChild($ref, $id, $sign);
|
||||
break;
|
||||
case "mixed": $this->getReference("mixed", $tag)->addChild($ref, $id, $sign);
|
||||
break;
|
||||
}
|
||||
$this->getReference("parent", $old_branch)->removeChild($id);
|
||||
}
|
||||
$this->setReference("parent", $old_branch, $new); //parentRefs[$old_branch] = $new;
|
||||
}
|
||||
/**
|
||||
* Analyzes the mixing of MIME types in a mulitpart message an re-arranges if needed
|
||||
* It looks complicated and long winded but the concept is pretty simple, even if putting it
|
||||
* in code does me make want to cry!
|
||||
*/
|
||||
protected function postAttachFixStructure()
|
||||
{
|
||||
switch (true)
|
||||
{
|
||||
case (!empty($this->references["mixed"]) && !empty($this->references["related"]) && !empty($this->references["alternative"])):
|
||||
if (!isset($this->references["related"]["_alternative"]))
|
||||
{
|
||||
$this->moveBranchIn(
|
||||
"multipart/alternative", "multipart/alternative", $this->references["alternative"], "alternative", "related", "_alternative");
|
||||
}
|
||||
if (!isset($this->references["mixed"]["_related"]))
|
||||
{
|
||||
$this->moveBranchIn(
|
||||
"multipart/related", "multipart/alternative", $this->references["related"], "related", "mixed", "_related");
|
||||
}
|
||||
break;
|
||||
case (!empty($this->references["mixed"]) && !empty($this->references["related"])):
|
||||
if (!isset($this->references["mixed"]["_related"]))
|
||||
{
|
||||
$this->moveBranchIn(
|
||||
"multipart/related", "multipart/related", $this->references["related"], "related", "mixed", "_related");
|
||||
}
|
||||
break;
|
||||
case (!empty($this->references["mixed"]) && !empty($this->references["alternative"])):
|
||||
if (!isset($this->references["mixed"]["_alternative"]))
|
||||
{
|
||||
$this->moveBranchIn(
|
||||
"multipart/alternative", null, $this->references["alternative"], "alternative", "mixed", "_alternative");
|
||||
}
|
||||
break;
|
||||
case (!empty($this->references["related"]) && !empty($this->references["alternative"])):
|
||||
if (!isset($this->references["related"]["_alternative"]))
|
||||
{
|
||||
$this->moveBranchIn(
|
||||
"multipart/alternative", "multipart/alternative", $this->references["alternative"], "alternative", "related", "_alternative");
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Move a branch further toward the top of the tree
|
||||
* @param array The array containing MIME parts from the old branch
|
||||
* @param string The name of the old branch
|
||||
* @param string The name of the new branch
|
||||
* @param string The key of the branch being moved
|
||||
*/
|
||||
protected function moveBranchOut($from, $old_branch, $new_branch, $tag)
|
||||
{
|
||||
foreach ($from as $id => $ref)
|
||||
{
|
||||
if (!$ref) $ref = $this;
|
||||
$sign = (strtolower($ref->getContentType()) == "text/html"
|
||||
|| strtolower($ref->getContentType()) == "multipart/alternative") ? -1 : 1;
|
||||
$this->getReference("parent", $new_branch)->addChild($ref, $id, $sign);
|
||||
switch ($new_branch)
|
||||
{
|
||||
case "related": $this->getReference("related", $tag)->removeChild($id);
|
||||
break;
|
||||
case "mixed": $this->getReference("parent", $old_branch)->removeChild($id);
|
||||
break;
|
||||
}
|
||||
}
|
||||
$this->getReference("parent", $new_branch)->removeChild($tag);
|
||||
$mixed = $this->getReference("parent", $new_branch);//parentRefs[$new_branch];
|
||||
$this->setReference("parent", $old_branch, $mixed);//parentRefs[$old_branch] = $mixed;
|
||||
switch ($new_branch)
|
||||
{
|
||||
case "related": unset($this->references["related"][$tag]);
|
||||
break;
|
||||
case "mixed": unset($this->references["mixed"][$tag]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Analyzes the mixing of MIME types in a mulitpart message an re-arranges if needed
|
||||
* It looks complicated and long winded but the concept is pretty simple, even if putting it
|
||||
* in code does me make want to cry!
|
||||
*/
|
||||
protected function postDetachFixStructure()
|
||||
{
|
||||
switch (true)
|
||||
{
|
||||
case (!empty($this->references["mixed"]) && !empty($this->references["related"]) && !empty($this->references["alternative"])):
|
||||
if (array_keys($this->references["related"]) == array("_alternative"))
|
||||
{
|
||||
$alt = $this->getReference("parent", "related")->getChild("_alternative");
|
||||
$this->getReference("parent", "mixed")->addChild($alt, "_alternative", -1);
|
||||
$this->setReference("mixed", "_alternative", $alt);//mixedRefs["_alternative"] = $alt;
|
||||
$this->getReference("parent", "related")->removeChild("_alternative");
|
||||
unset($this->references["related"]["_alternative"]);
|
||||
$this->getReference("parent", "mixed")->removeChild("_related");
|
||||
unset($this->references["mixed"]["_related"]);
|
||||
}
|
||||
if (array_keys($this->references["mixed"]) == array("_related"))
|
||||
{
|
||||
$this->moveBranchOut($this->references["related"], "related", "mixed", "_related");
|
||||
}
|
||||
break;
|
||||
case (!empty($this->references["mixed"]) && !empty($this->references["related"])):
|
||||
if (array_keys($this->references["mixed"]) == array("_related"))
|
||||
{
|
||||
$this->moveBranchOut($this->references["related"], "related", "mixed", "_related");
|
||||
}
|
||||
if (isset($this->references["related"]["_alternative"]))
|
||||
{
|
||||
$this->detach("_alternative");
|
||||
}
|
||||
break;
|
||||
case (!empty($this->references["mixed"]) && !empty($this->references["alternative"])):
|
||||
if (array_keys($this->references["mixed"]) == array("_alternative"))
|
||||
{
|
||||
$this->moveBranchOut($this->references["alternative"], "alternative", "mixed", "_alternative");
|
||||
}
|
||||
break;
|
||||
case (!empty($this->references["related"]) && !empty($this->references["alternative"])):
|
||||
if (array_keys($this->references["related"]) == array("_alternative"))
|
||||
{
|
||||
$this->moveBranchOut($this->references["alternative"], "alternative", "related", "_alternative");
|
||||
}
|
||||
break;
|
||||
case (!empty($this->references["mixed"])):
|
||||
if (isset($this->references["mixed"]["_related"])) $this->detach("_related");
|
||||
case (!empty($this->references["related"])):
|
||||
if (isset($this->references["related"]["_alternative"]) || isset($this->references["mixed"]["_alternative"]))
|
||||
$this->detach("_alternative");
|
||||
break;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Execute needed logic prior to compilation
|
||||
*/
|
||||
public function preBuild()
|
||||
{
|
||||
$data = $this->getData();
|
||||
if (!($enc = $this->getEncoding()))
|
||||
{
|
||||
$this->setEncoding("8bit");
|
||||
}
|
||||
if ($this->getCharset() === null && !$this->numChildren())
|
||||
{
|
||||
Swift_ClassLoader::load("Swift_Message_Encoder");
|
||||
if (is_string($data) && Swift_Message_Encoder::instance()->isUTF8($data))
|
||||
{
|
||||
$this->setCharset("utf-8");
|
||||
}
|
||||
elseif(is_string($data) && Swift_Message_Encoder::instance()->is7BitAscii($data))
|
||||
{
|
||||
$this->setCharset("us-ascii");
|
||||
if (!$enc) $this->setEncoding("7bit");
|
||||
}
|
||||
else $this->setCharset("iso-8859-1");
|
||||
}
|
||||
elseif ($this->numChildren())
|
||||
{
|
||||
if (!$this->getData())
|
||||
{
|
||||
$this->setData($this->getMimeWarning());
|
||||
$this->setLineWrap(76);
|
||||
}
|
||||
|
||||
if ($this->getCharset() !== null) $this->setCharset(null);
|
||||
if ($this->isFlowed()) $this->setFlowed(false);
|
||||
$this->setEncoding("7bit");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,797 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Swift Mailer Message Component
|
||||
* Composes MIME 1.0 messages meeting various RFC standards
|
||||
* Deals with attachments, embedded images, multipart bodies, forwarded messages...
|
||||
* Please read the LICENSE file
|
||||
* @copyright Chris Corbyn <chris@w3style.co.uk>
|
||||
* @author Chris Corbyn <chris@w3style.co.uk>
|
||||
* @package Swift_Message
|
||||
* @license GNU Lesser General Public License
|
||||
*/
|
||||
|
||||
require_once dirname(__FILE__) . "/ClassLoader.php";
|
||||
Swift_ClassLoader::load("Swift_Address");
|
||||
Swift_ClassLoader::load("Swift_Message_Mime");
|
||||
Swift_ClassLoader::load("Swift_Message_Image");
|
||||
Swift_ClassLoader::load("Swift_Message_Part");
|
||||
|
||||
|
||||
/**
|
||||
* Swift Message class
|
||||
* @package Swift_Message
|
||||
* @author Chris Corbyn <chris@w3style.co.uk>
|
||||
*/
|
||||
class Swift_Message extends Swift_Message_Mime
|
||||
{
|
||||
/**
|
||||
* Constant from a high priority message (pretty meaningless)
|
||||
*/
|
||||
const PRIORITY_HIGH = 1;
|
||||
/**
|
||||
* Constant for a low priority message
|
||||
*/
|
||||
const PRIORITY_LOW = 5;
|
||||
/**
|
||||
* Constant for a normal priority message
|
||||
*/
|
||||
const PRIORITY_NORMAL = 3;
|
||||
/**
|
||||
* The MIME warning for client not supporting multipart content
|
||||
* @var string
|
||||
*/
|
||||
protected $mimeWarning = null;
|
||||
/**
|
||||
* The version of the library (Swift) if known.
|
||||
* @var string
|
||||
*/
|
||||
protected $libVersion = "";
|
||||
/**
|
||||
* A container for references to other objects.
|
||||
* This is used in some very complex logic when sub-parts get shifted around.
|
||||
* @var array
|
||||
*/
|
||||
protected $references = array(
|
||||
"parent" => array("alternative" => null, "mixed" => null, "related" => null),
|
||||
"alternative" => array(),
|
||||
"mixed" => array(),
|
||||
"related" => array()
|
||||
);
|
||||
|
||||
/**
|
||||
* Ctor.
|
||||
* @param string Message subject
|
||||
* @param string Body
|
||||
* @param string Content-type
|
||||
* @param string Encoding
|
||||
* @param string Charset
|
||||
*/
|
||||
public function __construct($subject="", $body=null, $type="text/plain", $encoding=null, $charset=null)
|
||||
{
|
||||
parent::__construct();
|
||||
if (function_exists("date_default_timezone_set") && function_exists("date_default_timezone_get"))
|
||||
{
|
||||
date_default_timezone_set(@date_default_timezone_get());
|
||||
}
|
||||
$this->setReturnPath(null);
|
||||
$this->setTo("");
|
||||
$this->setFrom("");
|
||||
$this->setCc(null);
|
||||
$this->setBcc(null);
|
||||
$this->setReplyTo(null);
|
||||
$this->setSubject($subject);
|
||||
$this->setDate(time());
|
||||
if (defined("Swift::VERSION"))
|
||||
{
|
||||
$this->libVersion = Swift::VERSION;
|
||||
$this->headers->set("X-LibVersion", $this->libVersion);
|
||||
}
|
||||
$this->headers->set("MIME-Version", "1.0");
|
||||
$this->setContentType($type);
|
||||
$this->setCharset($charset);
|
||||
$this->setFlowed(true);
|
||||
$this->setEncoding($encoding);
|
||||
|
||||
foreach (array_keys($this->references["parent"]) as $key)
|
||||
{
|
||||
$this->setReference("parent", $key, $this);
|
||||
}
|
||||
|
||||
$this->setMimeWarning(
|
||||
"This is a message in multipart MIME format. Your mail client should not be displaying this. " .
|
||||
"Consider upgrading your mail client to view this message correctly."
|
||||
);
|
||||
|
||||
if ($body !== null)
|
||||
{
|
||||
$this->setData($body);
|
||||
if ($charset === null)
|
||||
{
|
||||
Swift_ClassLoader::load("Swift_Message_Encoder");
|
||||
if (Swift_Message_Encoder::instance()->isUTF8($body)) $this->setCharset("utf-8");
|
||||
else $this->setCharset("iso-8859-1");
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Sets a reference so when nodes are nested, operations can be redirected.
|
||||
* This really should be refactored to use just one array rather than dynamic variables.
|
||||
* @param string Key 1
|
||||
* @param string Key 2
|
||||
* @param Object Reference
|
||||
*/
|
||||
protected function setReference($where, $key, $ref)
|
||||
{
|
||||
if ($ref === $this) $this->references[$where][$key] = false;
|
||||
else $this->references[$where][$key] = $ref;
|
||||
}
|
||||
/**
|
||||
* Get a reference to an object (for complex reasons).
|
||||
* @param string Key 1
|
||||
* @param string Key 2
|
||||
* @return Object
|
||||
*/
|
||||
protected function getReference($where, $key)
|
||||
{
|
||||
if (!$this->references[$where][$key]) return $this;
|
||||
else return $this->references[$where][$key];
|
||||
}
|
||||
/**
|
||||
* Get the level in the MIME hierarchy at which this section should appear.
|
||||
* @return string
|
||||
*/
|
||||
public function getLevel()
|
||||
{
|
||||
return Swift_Message_Mime::LEVEL_TOP;
|
||||
}
|
||||
/**
|
||||
* Set the message id literally.
|
||||
* Unless you know what you are doing you should be using generateId() rather than this method,
|
||||
* otherwise you may break compliancy with RFC 2822.
|
||||
* @param string The message ID string.
|
||||
*/
|
||||
public function setId($id)
|
||||
{
|
||||
$this->headers->set("Message-ID", $id);
|
||||
}
|
||||
/**
|
||||
* Create a RFC 2822 compliant message id, optionally based upon $idstring.
|
||||
* The message ID includes information about the current time, the server and some random characters.
|
||||
* @param string An optional string the base the ID on
|
||||
* @return string The generated message ID, including the <> quotes.
|
||||
* @author Cristian Rodriguez <judas.iscariote@flyspray.org>
|
||||
*/
|
||||
public function generateId($idstring=null)
|
||||
{
|
||||
$midparams = array(
|
||||
"utctime" => gmstrftime("%Y%m%d%H%M%S"),
|
||||
"pid" => getmypid(),
|
||||
"randint" => mt_rand(),
|
||||
"customstr" => (preg_match("/^(?<!\\.)[a-z0-9\\.]+(?!\\.)\$/iD", $idstring) ? $idstring : "swift") ,
|
||||
"hostname" => (isset($_SERVER["SERVER_NAME"]) ? $_SERVER["SERVER_NAME"] : php_uname("n")),
|
||||
);
|
||||
$this->setId(vsprintf("<%s.%d.%d.%s@%s>", $midparams));
|
||||
return $this->getId();
|
||||
}
|
||||
/**
|
||||
* Get the generated message ID for this message, including the <> quotes.
|
||||
* If generated automatically, or using generateId() this method returns a RFC2822 compliant Message-ID.
|
||||
* @return string
|
||||
* @author Cristian Rodriguez <judas.iscariote@flyspray.org>
|
||||
*/
|
||||
public function getId()
|
||||
{
|
||||
return $this->headers->has("Message-ID") ? $this->headers->get("Message-ID") : null;
|
||||
}
|
||||
/**
|
||||
* Set the address in the Return-Path: header
|
||||
* @param string The bounce-detect address
|
||||
*/
|
||||
public function setReturnPath($address)
|
||||
{
|
||||
if ($address instanceof Swift_Address) $address = $address->build(true);
|
||||
$this->headers->set("Return-Path", $address);
|
||||
}
|
||||
/**
|
||||
* Return the address used in the Return-Path: header
|
||||
* @return string
|
||||
* @param boolean Return the address for SMTP command
|
||||
*/
|
||||
public function getReturnPath($smtp=false)
|
||||
{
|
||||
if ($this->headers->has("Return-Path"))
|
||||
{
|
||||
if (!$smtp) return $this->headers->get("Return-Path");
|
||||
else
|
||||
{
|
||||
$path = $this->headers->get("Return-Path");
|
||||
if (strpos($path, ">") > strpos($path, "<")) return substr($path, ($start = strpos($path, "<")), ($start + strrpos($path, ">") + 1));
|
||||
else return "<" . $path . ">";
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Set the address in the From: header
|
||||
* @param string The address to set as From
|
||||
*/
|
||||
public function setFrom($from)
|
||||
{
|
||||
if ($from instanceof Swift_Address) $from = $from->build();
|
||||
$this->headers->set("From", $from);
|
||||
}
|
||||
/**
|
||||
* Get the address used in the From: header
|
||||
* @return string
|
||||
*/
|
||||
public function getFrom()
|
||||
{
|
||||
if ($this->headers->has("From")) return $this->headers->get("From");
|
||||
}
|
||||
/**
|
||||
* Set the list of recipients in the To: header
|
||||
* @param mixed An array or a string
|
||||
*/
|
||||
public function setTo($to)
|
||||
{
|
||||
if ($to)
|
||||
{
|
||||
if (!is_array($to)) $to = array($to);
|
||||
foreach ($to as $key => $value)
|
||||
{
|
||||
if ($value instanceof Swift_Address) $to[$key] = $value->build();
|
||||
}
|
||||
}
|
||||
$this->headers->set("To", $to);
|
||||
}
|
||||
/**
|
||||
* Return the list of recipients in the To: header
|
||||
* @return array
|
||||
*/
|
||||
public function getTo()
|
||||
{
|
||||
if ($this->headers->has("To"))
|
||||
{
|
||||
$to = $this->headers->get("To");
|
||||
if ($to == "") return array();
|
||||
else return (array) $to;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Set the list of recipients in the Reply-To: header
|
||||
* @param mixed An array or a string
|
||||
*/
|
||||
public function setReplyTo($replyto)
|
||||
{
|
||||
if ($replyto)
|
||||
{
|
||||
if (!is_array($replyto)) $replyto = array($replyto);
|
||||
foreach ($replyto as $key => $value)
|
||||
{
|
||||
if ($value instanceof Swift_Address) $replyto[$key] = $value->build();
|
||||
}
|
||||
}
|
||||
$this->headers->set("Reply-To", $replyto);
|
||||
}
|
||||
/**
|
||||
* Return the list of recipients in the Reply-To: header
|
||||
* @return array
|
||||
*/
|
||||
public function getReplyTo()
|
||||
{
|
||||
if ($this->headers->has("Reply-To"))
|
||||
{
|
||||
$reply_to = $this->headers->get("Reply-To");
|
||||
if ($reply_to == "") return array();
|
||||
else return (array) $reply_to;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Set the list of recipients in the Cc: header
|
||||
* @param mixed An array or a string
|
||||
*/
|
||||
public function setCc($cc)
|
||||
{
|
||||
if ($cc)
|
||||
{
|
||||
if (!is_array($cc)) $cc = array($cc);
|
||||
foreach ($cc as $key => $value)
|
||||
{
|
||||
if ($value instanceof Swift_Address) $cc[$key] = $value->build();
|
||||
}
|
||||
}
|
||||
$this->headers->set("Cc", $cc);
|
||||
}
|
||||
/**
|
||||
* Return the list of recipients in the Cc: header
|
||||
* @return array
|
||||
*/
|
||||
public function getCc()
|
||||
{
|
||||
if ($this->headers->has("Cc"))
|
||||
{
|
||||
$cc = $this->headers->get("Cc");
|
||||
if ($cc == "") return array();
|
||||
else return (array) $cc;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Set the list of recipients in the Bcc: header
|
||||
* @param mixed An array or a string
|
||||
*/
|
||||
public function setBcc($bcc)
|
||||
{
|
||||
if ($bcc)
|
||||
{
|
||||
if (!is_array($bcc)) $bcc = array($bcc);
|
||||
foreach ($bcc as $key => $value)
|
||||
{
|
||||
if ($value instanceof Swift_Address) $bcc[$key] = $value->build();
|
||||
}
|
||||
}
|
||||
$this->headers->set("Bcc", $bcc);
|
||||
}
|
||||
/**
|
||||
* Return the list of recipients in the Bcc: header
|
||||
* @return array
|
||||
*/
|
||||
public function getBcc()
|
||||
{
|
||||
if ($this->headers->has("Bcc"))
|
||||
{
|
||||
$bcc = $this->headers->get("Bcc");
|
||||
if ($bcc == "") return array();
|
||||
else return (array) $bcc;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Set the subject in the headers
|
||||
* @param string The subject of the email
|
||||
*/
|
||||
public function setSubject($subject)
|
||||
{
|
||||
$this->headers->set("Subject", $subject);
|
||||
}
|
||||
/**
|
||||
* Get the current subject used in the headers
|
||||
* @return string
|
||||
*/
|
||||
public function getSubject()
|
||||
{
|
||||
return $this->headers->get("Subject");
|
||||
}
|
||||
/**
|
||||
* Set the date in the headers in RFC 2822 format
|
||||
* @param int The time as a UNIX timestamp
|
||||
*/
|
||||
public function setDate($date)
|
||||
{
|
||||
$this->headers->set("Date", date("r", $date));
|
||||
}
|
||||
/**
|
||||
* Get the date as it looks in the headers
|
||||
* @return string
|
||||
*/
|
||||
public function getDate()
|
||||
{
|
||||
return strtotime($this->headers->get("Date"));
|
||||
}
|
||||
/**
|
||||
* Set the charset of the document
|
||||
* @param string The charset used
|
||||
*/
|
||||
public function setCharset($charset)
|
||||
{
|
||||
$this->headers->setAttribute("Content-Type", "charset", $charset);
|
||||
if (($this->getEncoding() == "7bit") && (strtolower($charset) == "utf-8" || strtolower($charset) == "utf8")) $this->setEncoding("8bit");
|
||||
}
|
||||
/**
|
||||
* Get the charset used in the document
|
||||
* Returns null if none is set
|
||||
* @return string
|
||||
*/
|
||||
public function getCharset()
|
||||
{
|
||||
if ($this->headers->hasAttribute("Content-Type", "charset"))
|
||||
{
|
||||
return $this->headers->getAttribute("Content-Type", "charset");
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Set the "format" attribute to flowed
|
||||
* @param boolean On or Off
|
||||
*/
|
||||
public function setFlowed($flowed=true)
|
||||
{
|
||||
$value = null;
|
||||
if ($flowed) $value = "flowed";
|
||||
$this->headers->setAttribute("Content-Type", "format", $value);
|
||||
}
|
||||
/**
|
||||
* Check if the message format is set as flowed
|
||||
* @return boolean
|
||||
*/
|
||||
public function isFlowed()
|
||||
{
|
||||
if ($this->headers->hasAttribute("Content-Type", "format")
|
||||
&& $this->headers->getAttribute("Content-Type", "format") == "flowed")
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else return false;
|
||||
}
|
||||
/**
|
||||
* Set the message prioirty in the mail client (don't rely on this)
|
||||
* @param int The priority as a value between 1 (high) and 5 (low)
|
||||
*/
|
||||
public function setPriority($priority)
|
||||
{
|
||||
$priority = (int) $priority;
|
||||
if ($priority > self::PRIORITY_LOW) $priority = self::PRIORITY_LOW;
|
||||
if ($priority < self::PRIORITY_HIGH) $priority = self::PRIORITY_HIGH;
|
||||
$label = array(1 => "High", 2 => "High", 3 => "Normal", 4 => "Low", 5 => "Low");
|
||||
$this->headers->set("X-Priority", $priority);
|
||||
$this->headers->set("X-MSMail-Priority", $label[$priority]);
|
||||
$this->headers->set("X-MimeOLE", "Produced by SwiftMailer " . $this->libVersion);
|
||||
}
|
||||
/**
|
||||
* Request that the client send back a read-receipt (don't rely on this!)
|
||||
* @param string Request address
|
||||
*/
|
||||
public function requestReadReceipt($request)
|
||||
{
|
||||
if ($request instanceof Swift_Address) $request = $request->build();
|
||||
if (!$request)
|
||||
{
|
||||
$this->headers->set("Disposition-Notification-To", null);
|
||||
$this->headers->set("X-Confirm-Reading-To", null);
|
||||
$this->headers->set("Return-Receipt-To", null);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->headers->set("Disposition-Notification-To", $request);
|
||||
$this->headers->set("X-Confirm-Reading-To", $request);
|
||||
$this->headers->set("Return-Receipt-To", $request);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Check if a read receipt has been requested for this message
|
||||
* @return boolean
|
||||
*/
|
||||
public function wantsReadReceipt()
|
||||
{
|
||||
return $this->headers->has("Disposition-Notification-To");
|
||||
}
|
||||
/**
|
||||
* Get the current message priority
|
||||
* Returns NULL if none set
|
||||
* @return int
|
||||
*/
|
||||
public function getPriority()
|
||||
{
|
||||
if ($this->headers->has("X-Priority")) return $this->headers->get("X-Priority");
|
||||
else return null;
|
||||
}
|
||||
/**
|
||||
* Alias for setData()
|
||||
* @param mixed Body
|
||||
*/
|
||||
public function setBody($body)
|
||||
{
|
||||
$this->setData($body);
|
||||
}
|
||||
/**
|
||||
* Alias for getData()
|
||||
* @return mixed The document body
|
||||
*/
|
||||
public function getBody()
|
||||
{
|
||||
return $this->getData();
|
||||
}
|
||||
/**
|
||||
* Set the MIME warning message which is displayed to old clients
|
||||
* @var string The full warning message (in 7bit ascii)
|
||||
*/
|
||||
public function setMimeWarning($text)
|
||||
{
|
||||
$this->mimeWarning = (string) $text;
|
||||
}
|
||||
/**
|
||||
* Get the MIME warning which is displayed to old clients
|
||||
* @return string
|
||||
*/
|
||||
public function getMimeWarning()
|
||||
{
|
||||
return $this->mimeWarning;
|
||||
}
|
||||
/**
|
||||
* Attach a mime part or an attachment of some sort
|
||||
* Any descendant of Swift_Message_Mime can be added safely (including other Swift_Message objects for mail forwarding!!)
|
||||
* @param Swift_Message_Mime The document to attach
|
||||
* @param string An identifier to use (one is returned otherwise)
|
||||
* @return string The identifier for the part
|
||||
*/
|
||||
public function attach(Swift_Message_Mime $child, $id=null)
|
||||
{
|
||||
try {
|
||||
switch ($child->getLevel())
|
||||
{
|
||||
case Swift_Message_Mime::LEVEL_ALTERNATIVE:
|
||||
$sign = (strtolower($child->getContentType()) == "text/plain") ? -1 : 1;
|
||||
$id = $this->getReference("parent", "alternative")->addChild($child, $id, $sign);
|
||||
$this->setReference("alternative", $id, $child);
|
||||
break;
|
||||
case Swift_Message_Mime::LEVEL_RELATED:
|
||||
$id = "cid:" . $child->getContentId();
|
||||
$id = $this->getReference("parent", "related")->addChild($child, $id, 1);
|
||||
$this->setReference("related", $id, $child);
|
||||
break;
|
||||
case Swift_Message_Mime::LEVEL_MIXED: default:
|
||||
$id = $this->getReference("parent", "mixed")->addChild($child, $id, 1);
|
||||
$this->setReference("mixed", $id, $child);
|
||||
break;
|
||||
}
|
||||
$this->postAttachFixStructure();
|
||||
$this->fixContentType();
|
||||
return $id;
|
||||
} catch (Swift_Message_MimeException $e) {
|
||||
throw new Swift_Message_MimeException("Something went wrong whilst trying to move some MIME parts during an attach(). " .
|
||||
"The MIME component threw an exception:<br />" . $e->getMessage());
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Remove a nested MIME part
|
||||
* @param string The ID of the attached part
|
||||
* @throws Swift_Message_MimeException If no such part exists
|
||||
*/
|
||||
public function detach($id)
|
||||
{
|
||||
try {
|
||||
switch (true)
|
||||
{
|
||||
case array_key_exists($id, $this->references["alternative"]):
|
||||
$this->getReference("parent", "alternative")->removeChild($id);
|
||||
unset($this->references["alternative"][$id]);
|
||||
break;
|
||||
case array_key_exists($id, $this->references["related"]):
|
||||
$this->getReference("parent", "related")->removeChild($id);
|
||||
unset($this->references["related"][$id]);
|
||||
break;
|
||||
case array_key_exists($id, $this->references["mixed"]):
|
||||
$this->getReference("parent", "mixed")->removeChild($id);
|
||||
unset($this->references["mixed"][$id]);
|
||||
break;
|
||||
default:
|
||||
throw new Swift_Message_MimeException("Unable to detach part identified by ID '" . $id . "' since it's not registered.");
|
||||
break;
|
||||
}
|
||||
$this->postDetachFixStructure();
|
||||
$this->fixContentType();
|
||||
} catch (Swift_Message_MimeException $e) {
|
||||
throw new Swift_Message_MimeException("Something went wrong whilst trying to move some MIME parts during a detach(). " .
|
||||
"The MIME component threw an exception:<br />" . $e->getMessage());
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Sets the correct content type header by looking at what types of data we have set
|
||||
*/
|
||||
protected function fixContentType()
|
||||
{
|
||||
if (!empty($this->references["mixed"])) $this->setContentType("multipart/mixed");
|
||||
elseif (!empty($this->references["related"])) $this->setContentType("multipart/related");
|
||||
elseif (!empty($this->references["alternative"])) $this->setContentType("multipart/alternative");
|
||||
}
|
||||
/**
|
||||
* Move a branch of the tree, containing all it's MIME parts onto another branch
|
||||
* @param string The content type on the branch itself
|
||||
* @param string The content type which may exist in the branch's parent
|
||||
* @param array The array containing all the nodes presently
|
||||
* @param string The location of the branch now
|
||||
* @param string The location of the branch after moving
|
||||
* @param string The key to identify the branch by in it's new location
|
||||
*/
|
||||
protected function moveBranchIn($type, $nested_type, $from, $old_branch, $new_branch, $tag)
|
||||
{
|
||||
$new = new Swift_Message_Part();
|
||||
$new->setContentType($type);
|
||||
$this->getReference("parent", $new_branch)->addChild($new, $tag, -1);
|
||||
|
||||
switch ($new_branch)
|
||||
{
|
||||
case "related": $this->setReference("related", $tag, $new);//relatedRefs[$tag] = $new;
|
||||
break;
|
||||
case "mixed": $this->setReference("mixed", $tag, $new);//mixedRefs[$tag] = $new;
|
||||
break;
|
||||
}
|
||||
|
||||
foreach ($from as $id => $ref)
|
||||
{
|
||||
if (!$ref) $ref = $this;
|
||||
$sign = (strtolower($ref->getContentType()) == "text/plain"
|
||||
|| strtolower($ref->getContentType()) == $nested_type) ? -1 : 1;
|
||||
switch ($new_branch)
|
||||
{
|
||||
case "related": $this->getReference("related", $tag)->addChild($ref, $id, $sign);
|
||||
break;
|
||||
case "mixed": $this->getReference("mixed", $tag)->addChild($ref, $id, $sign);
|
||||
break;
|
||||
}
|
||||
$this->getReference("parent", $old_branch)->removeChild($id);
|
||||
}
|
||||
$this->setReference("parent", $old_branch, $new); //parentRefs[$old_branch] = $new;
|
||||
}
|
||||
/**
|
||||
* Analyzes the mixing of MIME types in a mulitpart message an re-arranges if needed
|
||||
* It looks complicated and long winded but the concept is pretty simple, even if putting it
|
||||
* in code does me make want to cry!
|
||||
*/
|
||||
protected function postAttachFixStructure()
|
||||
{
|
||||
switch (true)
|
||||
{
|
||||
case (!empty($this->references["mixed"]) && !empty($this->references["related"]) && !empty($this->references["alternative"])):
|
||||
if (!isset($this->references["related"]["_alternative"]))
|
||||
{
|
||||
$this->moveBranchIn(
|
||||
"multipart/alternative", "multipart/alternative", $this->references["alternative"], "alternative", "related", "_alternative");
|
||||
}
|
||||
if (!isset($this->references["mixed"]["_related"]))
|
||||
{
|
||||
$this->moveBranchIn(
|
||||
"multipart/related", "multipart/alternative", $this->references["related"], "related", "mixed", "_related");
|
||||
}
|
||||
break;
|
||||
case (!empty($this->references["mixed"]) && !empty($this->references["related"])):
|
||||
if (!isset($this->references["mixed"]["_related"]))
|
||||
{
|
||||
$this->moveBranchIn(
|
||||
"multipart/related", "multipart/related", $this->references["related"], "related", "mixed", "_related");
|
||||
}
|
||||
break;
|
||||
case (!empty($this->references["mixed"]) && !empty($this->references["alternative"])):
|
||||
if (!isset($this->references["mixed"]["_alternative"]))
|
||||
{
|
||||
$this->moveBranchIn(
|
||||
"multipart/alternative", null, $this->references["alternative"], "alternative", "mixed", "_alternative");
|
||||
}
|
||||
break;
|
||||
case (!empty($this->references["related"]) && !empty($this->references["alternative"])):
|
||||
if (!isset($this->references["related"]["_alternative"]))
|
||||
{
|
||||
$this->moveBranchIn(
|
||||
"multipart/alternative", "multipart/alternative", $this->references["alternative"], "alternative", "related", "_alternative");
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Move a branch further toward the top of the tree
|
||||
* @param array The array containing MIME parts from the old branch
|
||||
* @param string The name of the old branch
|
||||
* @param string The name of the new branch
|
||||
* @param string The key of the branch being moved
|
||||
*/
|
||||
protected function moveBranchOut($from, $old_branch, $new_branch, $tag)
|
||||
{
|
||||
foreach ($from as $id => $ref)
|
||||
{
|
||||
if (!$ref) $ref = $this;
|
||||
$sign = (strtolower($ref->getContentType()) == "text/html"
|
||||
|| strtolower($ref->getContentType()) == "multipart/alternative") ? -1 : 1;
|
||||
$this->getReference("parent", $new_branch)->addChild($ref, $id, $sign);
|
||||
switch ($new_branch)
|
||||
{
|
||||
case "related": $this->getReference("related", $tag)->removeChild($id);
|
||||
break;
|
||||
case "mixed": $this->getReference("parent", $old_branch)->removeChild($id);
|
||||
break;
|
||||
}
|
||||
}
|
||||
$this->getReference("parent", $new_branch)->removeChild($tag);
|
||||
$mixed = $this->getReference("parent", $new_branch);//parentRefs[$new_branch];
|
||||
$this->setReference("parent", $old_branch, $mixed);//parentRefs[$old_branch] = $mixed;
|
||||
switch ($new_branch)
|
||||
{
|
||||
case "related": unset($this->references["related"][$tag]);
|
||||
break;
|
||||
case "mixed": unset($this->references["mixed"][$tag]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Analyzes the mixing of MIME types in a mulitpart message an re-arranges if needed
|
||||
* It looks complicated and long winded but the concept is pretty simple, even if putting it
|
||||
* in code does me make want to cry!
|
||||
*/
|
||||
protected function postDetachFixStructure()
|
||||
{
|
||||
switch (true)
|
||||
{
|
||||
case (!empty($this->references["mixed"]) && !empty($this->references["related"]) && !empty($this->references["alternative"])):
|
||||
if (array_keys($this->references["related"]) == array("_alternative"))
|
||||
{
|
||||
$alt = $this->getReference("parent", "related")->getChild("_alternative");
|
||||
$this->getReference("parent", "mixed")->addChild($alt, "_alternative", -1);
|
||||
$this->setReference("mixed", "_alternative", $alt);//mixedRefs["_alternative"] = $alt;
|
||||
$this->getReference("parent", "related")->removeChild("_alternative");
|
||||
unset($this->references["related"]["_alternative"]);
|
||||
$this->getReference("parent", "mixed")->removeChild("_related");
|
||||
unset($this->references["mixed"]["_related"]);
|
||||
}
|
||||
if (array_keys($this->references["mixed"]) == array("_related"))
|
||||
{
|
||||
$this->moveBranchOut($this->references["related"], "related", "mixed", "_related");
|
||||
}
|
||||
break;
|
||||
case (!empty($this->references["mixed"]) && !empty($this->references["related"])):
|
||||
if (array_keys($this->references["mixed"]) == array("_related"))
|
||||
{
|
||||
$this->moveBranchOut($this->references["related"], "related", "mixed", "_related");
|
||||
}
|
||||
if (isset($this->references["related"]["_alternative"]))
|
||||
{
|
||||
$this->detach("_alternative");
|
||||
}
|
||||
break;
|
||||
case (!empty($this->references["mixed"]) && !empty($this->references["alternative"])):
|
||||
if (array_keys($this->references["mixed"]) == array("_alternative"))
|
||||
{
|
||||
$this->moveBranchOut($this->references["alternative"], "alternative", "mixed", "_alternative");
|
||||
}
|
||||
break;
|
||||
case (!empty($this->references["related"]) && !empty($this->references["alternative"])):
|
||||
if (array_keys($this->references["related"]) == array("_alternative"))
|
||||
{
|
||||
$this->moveBranchOut($this->references["alternative"], "alternative", "related", "_alternative");
|
||||
}
|
||||
break;
|
||||
case (!empty($this->references["mixed"])):
|
||||
if (isset($this->references["mixed"]["_related"])) $this->detach("_related");
|
||||
case (!empty($this->references["related"])):
|
||||
if (isset($this->references["related"]["_alternative"]) || isset($this->references["mixed"]["_alternative"]))
|
||||
$this->detach("_alternative");
|
||||
break;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Execute needed logic prior to compilation
|
||||
*/
|
||||
public function preBuild()
|
||||
{
|
||||
$data = $this->getData();
|
||||
if (!($enc = $this->getEncoding()))
|
||||
{
|
||||
$this->setEncoding("8bit");
|
||||
}
|
||||
if ($this->getCharset() === null && !$this->numChildren())
|
||||
{
|
||||
Swift_ClassLoader::load("Swift_Message_Encoder");
|
||||
if (is_string($data) && Swift_Message_Encoder::instance()->isUTF8($data))
|
||||
{
|
||||
$this->setCharset("utf-8");
|
||||
}
|
||||
elseif(is_string($data) && Swift_Message_Encoder::instance()->is7BitAscii($data))
|
||||
{
|
||||
$this->setCharset("us-ascii");
|
||||
if (!$enc) $this->setEncoding("7bit");
|
||||
}
|
||||
else $this->setCharset("iso-8859-1");
|
||||
}
|
||||
elseif ($this->numChildren())
|
||||
{
|
||||
if (!$this->getData())
|
||||
{
|
||||
$this->setData($this->getMimeWarning());
|
||||
$this->setLineWrap(76);
|
||||
}
|
||||
|
||||
if ($this->getCharset() !== null) $this->setCharset(null);
|
||||
if ($this->isFlowed()) $this->setFlowed(false);
|
||||
$this->setEncoding("7bit");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -59,17 +59,23 @@ class AdminMondialRelay extends AdminTab
|
||||
|
||||
$errorListTicket = $MRCreateTicket->checkPreValidation();
|
||||
|
||||
if (count($errorListTicket))
|
||||
{
|
||||
$html .= '<div class="error">'.
|
||||
$this->l('Thanks to kindly correct the following errors on ').
|
||||
$titleType = array(
|
||||
'error' => $this->l('Thanks to kindly correct the following errors on ').
|
||||
' <a href="index.php?tab=AdminContact&token='.Tools::getAdminToken('AdminContact'.
|
||||
(int)Tab::getIdFromClassName('AdminContact').(int)$this->context->id_employee).'" style="color:#f00;"> '.
|
||||
$this->l('the contact page').'</a>:<ul>';
|
||||
foreach($errorListTicket as $type => $error)
|
||||
$this->l('the contact page').'</a>:<ul>',
|
||||
'warn' => $this->l('Please take a look to this following warning, maybe the ticket won\'t be generated'));
|
||||
|
||||
foreach($errorListTicket as $errorType => $errorList)
|
||||
{
|
||||
if (count($errorList))
|
||||
{
|
||||
$html .= '<div class="MR_'.$errorType.'">'.$titleType[$errorType];
|
||||
foreach($errorList as $type => $error)
|
||||
$html .= '<li>'.$type.': '.$error.'</li>';
|
||||
$html .= '</ul></div>';
|
||||
}
|
||||
}
|
||||
|
||||
$html .= '<p>'.$this->l('All orders which have the state').' "<b>'.$order_state->name.'</b>" '.
|
||||
$this->l('will be available for sticker creation');
|
||||
|
||||
@@ -274,7 +274,7 @@ class MRCreateTickets implements IMondialRelayWSMethod
|
||||
{
|
||||
$this->_fields['list']['Enseigne']['value'] = Configuration::get('MR_ENSEIGNE_WEBSERVICE');
|
||||
$this->_fields['list']['Expe_Langage']['value'] = Configuration::get('MR_LANGUAGE');
|
||||
$this->_fields['list']['Expe_Ad1']['value'] = Configuration::get('PS_MR_SHOP_NAME');
|
||||
$this->_fields['list']['Expe_Ad1']['value'] = Configuration::get('PS_SHOP_NAME');
|
||||
$this->_fields['list']['Expe_Ad3']['value'] = Configuration::get('PS_SHOP_ADDR1');
|
||||
// Deleted, cause to many failed for the process
|
||||
// $this->_fields['list']['Expe_Ad4']['value'] = Configuration::get('PS_SHOP_ADDR2');
|
||||
@@ -331,7 +331,7 @@ 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->lastname;
|
||||
$tmp['Dest_Ad1']['value'] = $deliveriesAddress->firstname.' '.$deliveriesAddress->lastname;
|
||||
$tmp['Dest_Ad2']['value'] = $deliveriesAddress->address2;
|
||||
$tmp['Dest_Ad3']['value'] = $deliveriesAddress->address1;
|
||||
$tmp['Dest_Ville']['value'] = $deliveriesAddress->city;
|
||||
@@ -342,7 +342,6 @@ class MRCreateTickets implements IMondialRelayWSMethod
|
||||
$tmp['Dest_Tel2']['value'] = $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')
|
||||
{
|
||||
$tmp['LIV_Rel_Pays']['value'] = $orderDetail['MR_Selected_Pays'];
|
||||
@@ -511,7 +510,7 @@ class MRCreateTickets implements IMondialRelayWSMethod
|
||||
*/
|
||||
public function checkPreValidation()
|
||||
{
|
||||
$errorList = array();
|
||||
$errorList = array('error' => array(), 'warn' => array());
|
||||
|
||||
if (!$this->_mondialRelay)
|
||||
$this->_mondialRelay = new MondialRelay();
|
||||
@@ -521,7 +520,7 @@ class MRCreateTickets implements IMondialRelayWSMethod
|
||||
'value' => Configuration::get('MR_LANGUAGE'),
|
||||
'error' => $this->_mondialRelay->l('Please check your language configuration')),
|
||||
'Expe_Ad1' => array(
|
||||
'value' => Configuration::get('PS_MR_SHOP_NAME'),
|
||||
'value' => Configuration::get('PS_SHOP_NAME'),
|
||||
'error' => $this->_mondialRelay->l('Please check your shop name configuration')),
|
||||
'Expe_Ad3' => array(
|
||||
'value' => Configuration::get('PS_SHOP_ADDR1'),
|
||||
@@ -531,7 +530,8 @@ class MRCreateTickets implements IMondialRelayWSMethod
|
||||
'error' => $this->_mondialRelay->l('Please check your city configuration')),
|
||||
'Expe_CP' => array(
|
||||
'value' => Configuration::get('PS_SHOP_CODE'),
|
||||
'error' => $this->_mondialRelay->l('Please check your zipcode configuration')),
|
||||
'error' => $this->_mondialRelay->l('Please check your zipcode configuration'),
|
||||
'warn' => $this->_mondialRelay->l('It seems the layout of your zipcode country is not configured or you didn\'t set a right zipcode')),
|
||||
'Expe_Pays' => array(
|
||||
'value' => ((_PS_VERSION_ >= '1.4') ?
|
||||
Country::getIsoById(Configuration::get('PS_SHOP_COUNTRY_ID')) :
|
||||
@@ -546,16 +546,22 @@ class MRCreateTickets implements IMondialRelayWSMethod
|
||||
|
||||
foreach($list as $name => $tab)
|
||||
{
|
||||
$tab['value'] = strtoupper($tab['value']);
|
||||
// Mac server make an empty string instead of a cleaned string
|
||||
// TODO : test on windows and linux server
|
||||
$cleanedString = MRTools::replaceAccentedCharacters($tab['value']);
|
||||
$tab['value'] = !empty($cleanedString) ? strtoupper($cleanedString) : strtoupper($tab['value']);
|
||||
|
||||
if ($name == 'Expe_CP')
|
||||
{
|
||||
if (!MRTools::checkZipcodeByCountry($tab['value'], array(
|
||||
'id_country' => Configuration::get('PS_COUNTRY_DEFAULT'))))
|
||||
$errorList[$name] = $tab['error'];
|
||||
if (!($zipcodeError = MRTools::checkZipcodeByCountry($tab['value'], array(
|
||||
'id_country' => Configuration::get('PS_COUNTRY_DEFAULT')))))
|
||||
$errorList['error'][$name] = $tab['error'];
|
||||
else if ($zipcodeError < 0)
|
||||
$errorList['warn'][$name] = $tab['warn'];
|
||||
}
|
||||
else if (isset($this->_fields['list'][$name]['regexValidation']) &&
|
||||
(!preg_match($this->_fields['list'][$name]['regexValidation'], $tab['value'], $matches)))
|
||||
$errorList[$name] = $tab['error'];
|
||||
$errorList['error'][$name] = $tab['error'];
|
||||
}
|
||||
return $errorList;
|
||||
}
|
||||
|
||||
@@ -64,14 +64,14 @@ class MRTools
|
||||
{
|
||||
$id_country = $params['id_country'];
|
||||
|
||||
$zipcodeFormat = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('
|
||||
$zipcodeFormat = Db::getInstance()->getValue('
|
||||
SELECT `zip_code_format`
|
||||
FROM `'._DB_PREFIX_.'country`
|
||||
WHERE `id_country` = '.(int)$id_country);
|
||||
|
||||
// Skip the cheking format if doesn't exist
|
||||
// -1 to warn user that no layout exist
|
||||
if (!$zipcodeFormat)
|
||||
return true;
|
||||
return -1;
|
||||
|
||||
$regxMask = str_replace(
|
||||
array('N', 'C', 'L'),
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<module>
|
||||
<name>mondialrelay</name>
|
||||
<displayName><![CDATA[Mondial Relay]]></displayName>
|
||||
<version><![CDATA[1.7.8]]></version>
|
||||
<version><![CDATA[1.7.9]]></version>
|
||||
<description><![CDATA[Deliver in Relay points]]></description>
|
||||
<author><![CDATA[]]></author>
|
||||
<tab><![CDATA[shipping_logistics]]></tab>
|
||||
|
||||
@@ -4,6 +4,7 @@ global $_MODULE;
|
||||
$_MODULE = array();
|
||||
$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_d1908b9b04e81c4b6112e38b608c49af'] = 'Merci de bien vouloir corriger les erreurs suivantes dans';
|
||||
$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_ccce63109db30895153094de05c60fa5'] = 'la page de contact';
|
||||
$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_7c5fd3d93bd19d81953db3b374997961'] = 'Merci de jeter un oeil à la mise en garde suivante, peut-être que l\'étiquette ne sera pas générée';
|
||||
$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_de21dc13e1ea638777fbfad49f88b332'] = 'Toutes les commandes qui auront un statut';
|
||||
$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_a0bf3c9ac2d785f053d883b8746e91ba'] = 'seront disponibles pour la création d\'ètiquette';
|
||||
$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_2345e28c9b93f368968be4781ed70f5c'] = 'Changer la configuration';
|
||||
@@ -46,7 +47,9 @@ $_MODULE['<{mondialrelay}prestashop>mondialrelay_c888438d14855d7d96a2724ee9c306b
|
||||
$_MODULE['<{mondialrelay}prestashop>mondialrelay_07213a0161f52846ab198be103b5ab43'] = 'erreurs';
|
||||
$_MODULE['<{mondialrelay}prestashop>mondialrelay_cb5e100e5a9a3e7f6d1fd97512215282'] = 'erreur';
|
||||
$_MODULE['<{mondialrelay}prestashop>mondialrelay_350c1cc4343826a89f08a33bb49c6d98'] = 'Configuration du Module Mondial Relay';
|
||||
$_MODULE['<{mondialrelay}prestashop>mondialrelay_192a5439bcfb850e8885cd4b5e01ced4'] = 'Essayez de désactiver le cache et de forcer la compilation smarty si vous rencontrez le moindre problème après une mise à jour du module';
|
||||
$_MODULE['<{mondialrelay}prestashop>mondialrelay_5a2355a42ba3ab265701183c914467f2'] = 'Essayez de désactiver le cache et de forcer la compilation smarty';
|
||||
$_MODULE['<{mondialrelay}prestashop>mondialrelay_3de769f9a81eed916583d5b35c58dbdd'] = 'si vous rencontrez le moindre problème après une mise à jour du module';
|
||||
$_MODULE['<{mondialrelay}prestashop>mondialrelay_8f8b21bd013b38d1e3059557c22a57e7'] = 'Consulter le manuel pour vous guider dans la configuration de Mondial Relay';
|
||||
$_MODULE['<{mondialrelay}prestashop>mondialrelay_d21a9f93917604d5490ad529a7cf1ff9'] = 'Pour créer un transporteur Mondial Relay';
|
||||
$_MODULE['<{mondialrelay}prestashop>mondialrelay_c6a2e6af5fff47adb3afd780b97d9b4b'] = 'Remplissez et sauvegarder vos paramètres Mondial Relay';
|
||||
$_MODULE['<{mondialrelay}prestashop>mondialrelay_94fbe32464fcfa902feed9f256439833'] = 'Créez un transporteur via le formulaire ‘’ajouter un transporteur’’ ci-dessous';
|
||||
@@ -114,6 +117,7 @@ $_MODULE['<{mondialrelay}prestashop>mondialrelay_ef2a1f426c2c289ed5986c7636a5d69
|
||||
$_MODULE['<{mondialrelay}prestashop>mondialrelay_80a0c205cd57b22fca7f174253870300'] = 'Heures d\'ouvertures';
|
||||
$_MODULE['<{mondialrelay}prestashop>mondialrelay_2b56b60f878922093facd42284848a0c'] = 'Plus de détails';
|
||||
$_MODULE['<{mondialrelay}prestashop>orderdetail_81b7b4587a2a3ea7a0d6bb1df3fbba54'] = 'Livraison à';
|
||||
$_MODULE['<{mondialrelay}prestashop>orderdetail_c2d05abc7f5ebdc72b6656df35038b43'] = 'Suivre mon colis sur le site de Mondial Relay';
|
||||
$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_a1c3470a944b9625cfb924fd15c8bdbf'] = 'Veuillez choisir au moins une commande';
|
||||
$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_dc41aac14af17f1d19fca5e3b9439e74'] = 'Cette clé';
|
||||
$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_306b346c19017609403424203ea3d720'] = 'est vide et doit être renseignée';
|
||||
@@ -129,6 +133,7 @@ $_MODULE['<{mondialrelay}prestashop>mrcreatetickets_557595c2e17c9948a9448eb763ac
|
||||
$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_017ca6b770ad53669a4eec82894dfcd3'] = 'Merci de vérifier la configuration de votre adresse 1';
|
||||
$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_3f79e1fc66b4f9cca7bd68cab176020d'] = 'Merci de vérifier la configuration de votre ville';
|
||||
$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_404665d9b65239985d59b30b3dcb26b5'] = 'Merci de vérifier la configuration de votre code postal';
|
||||
$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_74cb73eddbe6eaf556023f943fc7e1fd'] = 'Il semble que le format du code postal ne soit pas configuré ou que vous n\'avez pas défini de code postal valide';
|
||||
$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_0b8a30478b9572b86718989d483fd88d'] = 'Merci de vérifier la configuration de votre pays';
|
||||
$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_7ddf2d94bf037b7d1088c0600ea589c3'] = 'Merci de vérifier la configuration de votre téléphone';
|
||||
$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_9c7ce7be9a2c593b24d448edb4f804e0'] = 'Merci de vérifier la configuration de votre email';
|
||||
|
||||
|
After Width: | Height: | Size: 2.5 KiB |
@@ -1,167 +0,0 @@
|
||||
/*!
|
||||
* jQuery JavaScript Library v1.4.4
|
||||
* http://jquery.com/
|
||||
*
|
||||
* Copyright 2010, John Resig
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* Includes Sizzle.js
|
||||
* http://sizzlejs.com/
|
||||
* Copyright 2010, The Dojo Foundation
|
||||
* Released under the MIT, BSD, and GPL Licenses.
|
||||
*
|
||||
* Date: Thu Nov 11 19:04:53 2010 -0500
|
||||
*/
|
||||
(function(E,B){function ka(a,b,d){if(d===B&&a.nodeType===1){d=a.getAttribute("data-"+b);if(typeof d==="string"){try{d=d==="true"?true:d==="false"?false:d==="null"?null:!c.isNaN(d)?parseFloat(d):Ja.test(d)?c.parseJSON(d):d}catch(e){}c.data(a,b,d)}else d=B}return d}function U(){return false}function ca(){return true}function la(a,b,d){d[0].type=a;return c.event.handle.apply(b,d)}function Ka(a){var b,d,e,f,h,l,k,o,x,r,A,C=[];f=[];h=c.data(this,this.nodeType?"events":"__events__");if(typeof h==="function")h=
|
||||
h.events;if(!(a.liveFired===this||!h||!h.live||a.button&&a.type==="click")){if(a.namespace)A=RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)");a.liveFired=this;var J=h.live.slice(0);for(k=0;k<J.length;k++){h=J[k];h.origType.replace(X,"")===a.type?f.push(h.selector):J.splice(k--,1)}f=c(a.target).closest(f,a.currentTarget);o=0;for(x=f.length;o<x;o++){r=f[o];for(k=0;k<J.length;k++){h=J[k];if(r.selector===h.selector&&(!A||A.test(h.namespace))){l=r.elem;e=null;if(h.preType==="mouseenter"||
|
||||
h.preType==="mouseleave"){a.type=h.preType;e=c(a.relatedTarget).closest(h.selector)[0]}if(!e||e!==l)C.push({elem:l,handleObj:h,level:r.level})}}}o=0;for(x=C.length;o<x;o++){f=C[o];if(d&&f.level>d)break;a.currentTarget=f.elem;a.data=f.handleObj.data;a.handleObj=f.handleObj;A=f.handleObj.origHandler.apply(f.elem,arguments);if(A===false||a.isPropagationStopped()){d=f.level;if(A===false)b=false;if(a.isImmediatePropagationStopped())break}}return b}}function Y(a,b){return(a&&a!=="*"?a+".":"")+b.replace(La,
|
||||
"`").replace(Ma,"&")}function ma(a,b,d){if(c.isFunction(b))return c.grep(a,function(f,h){return!!b.call(f,h,f)===d});else if(b.nodeType)return c.grep(a,function(f){return f===b===d});else if(typeof b==="string"){var e=c.grep(a,function(f){return f.nodeType===1});if(Na.test(b))return c.filter(b,e,!d);else b=c.filter(b,e)}return c.grep(a,function(f){return c.inArray(f,b)>=0===d})}function na(a,b){var d=0;b.each(function(){if(this.nodeName===(a[d]&&a[d].nodeName)){var e=c.data(a[d++]),f=c.data(this,
|
||||
e);if(e=e&&e.events){delete f.handle;f.events={};for(var h in e)for(var l in e[h])c.event.add(this,h,e[h][l],e[h][l].data)}}})}function Oa(a,b){b.src?c.ajax({url:b.src,async:false,dataType:"script"}):c.globalEval(b.text||b.textContent||b.innerHTML||"");b.parentNode&&b.parentNode.removeChild(b)}function oa(a,b,d){var e=b==="width"?a.offsetWidth:a.offsetHeight;if(d==="border")return e;c.each(b==="width"?Pa:Qa,function(){d||(e-=parseFloat(c.css(a,"padding"+this))||0);if(d==="margin")e+=parseFloat(c.css(a,
|
||||
"margin"+this))||0;else e-=parseFloat(c.css(a,"border"+this+"Width"))||0});return e}function da(a,b,d,e){if(c.isArray(b)&&b.length)c.each(b,function(f,h){d||Ra.test(a)?e(a,h):da(a+"["+(typeof h==="object"||c.isArray(h)?f:"")+"]",h,d,e)});else if(!d&&b!=null&&typeof b==="object")c.isEmptyObject(b)?e(a,""):c.each(b,function(f,h){da(a+"["+f+"]",h,d,e)});else e(a,b)}function S(a,b){var d={};c.each(pa.concat.apply([],pa.slice(0,b)),function(){d[this]=a});return d}function qa(a){if(!ea[a]){var b=c("<"+
|
||||
a+">").appendTo("body"),d=b.css("display");b.remove();if(d==="none"||d==="")d="block";ea[a]=d}return ea[a]}function fa(a){return c.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:false}var t=E.document,c=function(){function a(){if(!b.isReady){try{t.documentElement.doScroll("left")}catch(j){setTimeout(a,1);return}b.ready()}}var b=function(j,s){return new b.fn.init(j,s)},d=E.jQuery,e=E.$,f,h=/^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/,l=/\S/,k=/^\s+/,o=/\s+$/,x=/\W/,r=/\d/,A=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,
|
||||
C=/^[\],:{}\s]*$/,J=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,w=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,I=/(?:^|:|,)(?:\s*\[)+/g,L=/(webkit)[ \/]([\w.]+)/,g=/(opera)(?:.*version)?[ \/]([\w.]+)/,i=/(msie) ([\w.]+)/,n=/(mozilla)(?:.*? rv:([\w.]+))?/,m=navigator.userAgent,p=false,q=[],u,y=Object.prototype.toString,F=Object.prototype.hasOwnProperty,M=Array.prototype.push,N=Array.prototype.slice,O=String.prototype.trim,D=Array.prototype.indexOf,R={};b.fn=b.prototype={init:function(j,
|
||||
s){var v,z,H;if(!j)return this;if(j.nodeType){this.context=this[0]=j;this.length=1;return this}if(j==="body"&&!s&&t.body){this.context=t;this[0]=t.body;this.selector="body";this.length=1;return this}if(typeof j==="string")if((v=h.exec(j))&&(v[1]||!s))if(v[1]){H=s?s.ownerDocument||s:t;if(z=A.exec(j))if(b.isPlainObject(s)){j=[t.createElement(z[1])];b.fn.attr.call(j,s,true)}else j=[H.createElement(z[1])];else{z=b.buildFragment([v[1]],[H]);j=(z.cacheable?z.fragment.cloneNode(true):z.fragment).childNodes}return b.merge(this,
|
||||
j)}else{if((z=t.getElementById(v[2]))&&z.parentNode){if(z.id!==v[2])return f.find(j);this.length=1;this[0]=z}this.context=t;this.selector=j;return this}else if(!s&&!x.test(j)){this.selector=j;this.context=t;j=t.getElementsByTagName(j);return b.merge(this,j)}else return!s||s.jquery?(s||f).find(j):b(s).find(j);else if(b.isFunction(j))return f.ready(j);if(j.selector!==B){this.selector=j.selector;this.context=j.context}return b.makeArray(j,this)},selector:"",jquery:"1.4.4",length:0,size:function(){return this.length},
|
||||
toArray:function(){return N.call(this,0)},get:function(j){return j==null?this.toArray():j<0?this.slice(j)[0]:this[j]},pushStack:function(j,s,v){var z=b();b.isArray(j)?M.apply(z,j):b.merge(z,j);z.prevObject=this;z.context=this.context;if(s==="find")z.selector=this.selector+(this.selector?" ":"")+v;else if(s)z.selector=this.selector+"."+s+"("+v+")";return z},each:function(j,s){return b.each(this,j,s)},ready:function(j){b.bindReady();if(b.isReady)j.call(t,b);else q&&q.push(j);return this},eq:function(j){return j===
|
||||
-1?this.slice(j):this.slice(j,+j+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(N.apply(this,arguments),"slice",N.call(arguments).join(","))},map:function(j){return this.pushStack(b.map(this,function(s,v){return j.call(s,v,s)}))},end:function(){return this.prevObject||b(null)},push:M,sort:[].sort,splice:[].splice};b.fn.init.prototype=b.fn;b.extend=b.fn.extend=function(){var j,s,v,z,H,G=arguments[0]||{},K=1,Q=arguments.length,ga=false;
|
||||
if(typeof G==="boolean"){ga=G;G=arguments[1]||{};K=2}if(typeof G!=="object"&&!b.isFunction(G))G={};if(Q===K){G=this;--K}for(;K<Q;K++)if((j=arguments[K])!=null)for(s in j){v=G[s];z=j[s];if(G!==z)if(ga&&z&&(b.isPlainObject(z)||(H=b.isArray(z)))){if(H){H=false;v=v&&b.isArray(v)?v:[]}else v=v&&b.isPlainObject(v)?v:{};G[s]=b.extend(ga,v,z)}else if(z!==B)G[s]=z}return G};b.extend({noConflict:function(j){E.$=e;if(j)E.jQuery=d;return b},isReady:false,readyWait:1,ready:function(j){j===true&&b.readyWait--;
|
||||
if(!b.readyWait||j!==true&&!b.isReady){if(!t.body)return setTimeout(b.ready,1);b.isReady=true;if(!(j!==true&&--b.readyWait>0))if(q){var s=0,v=q;for(q=null;j=v[s++];)j.call(t,b);b.fn.trigger&&b(t).trigger("ready").unbind("ready")}}},bindReady:function(){if(!p){p=true;if(t.readyState==="complete")return setTimeout(b.ready,1);if(t.addEventListener){t.addEventListener("DOMContentLoaded",u,false);E.addEventListener("load",b.ready,false)}else if(t.attachEvent){t.attachEvent("onreadystatechange",u);E.attachEvent("onload",
|
||||
b.ready);var j=false;try{j=E.frameElement==null}catch(s){}t.documentElement.doScroll&&j&&a()}}},isFunction:function(j){return b.type(j)==="function"},isArray:Array.isArray||function(j){return b.type(j)==="array"},isWindow:function(j){return j&&typeof j==="object"&&"setInterval"in j},isNaN:function(j){return j==null||!r.test(j)||isNaN(j)},type:function(j){return j==null?String(j):R[y.call(j)]||"object"},isPlainObject:function(j){if(!j||b.type(j)!=="object"||j.nodeType||b.isWindow(j))return false;if(j.constructor&&
|
||||
!F.call(j,"constructor")&&!F.call(j.constructor.prototype,"isPrototypeOf"))return false;for(var s in j);return s===B||F.call(j,s)},isEmptyObject:function(j){for(var s in j)return false;return true},error:function(j){throw j;},parseJSON:function(j){if(typeof j!=="string"||!j)return null;j=b.trim(j);if(C.test(j.replace(J,"@").replace(w,"]").replace(I,"")))return E.JSON&&E.JSON.parse?E.JSON.parse(j):(new Function("return "+j))();else b.error("Invalid JSON: "+j)},noop:function(){},globalEval:function(j){if(j&&
|
||||
l.test(j)){var s=t.getElementsByTagName("head")[0]||t.documentElement,v=t.createElement("script");v.type="text/javascript";if(b.support.scriptEval)v.appendChild(t.createTextNode(j));else v.text=j;s.insertBefore(v,s.firstChild);s.removeChild(v)}},nodeName:function(j,s){return j.nodeName&&j.nodeName.toUpperCase()===s.toUpperCase()},each:function(j,s,v){var z,H=0,G=j.length,K=G===B||b.isFunction(j);if(v)if(K)for(z in j){if(s.apply(j[z],v)===false)break}else for(;H<G;){if(s.apply(j[H++],v)===false)break}else if(K)for(z in j){if(s.call(j[z],
|
||||
z,j[z])===false)break}else for(v=j[0];H<G&&s.call(v,H,v)!==false;v=j[++H]);return j},trim:O?function(j){return j==null?"":O.call(j)}:function(j){return j==null?"":j.toString().replace(k,"").replace(o,"")},makeArray:function(j,s){var v=s||[];if(j!=null){var z=b.type(j);j.length==null||z==="string"||z==="function"||z==="regexp"||b.isWindow(j)?M.call(v,j):b.merge(v,j)}return v},inArray:function(j,s){if(s.indexOf)return s.indexOf(j);for(var v=0,z=s.length;v<z;v++)if(s[v]===j)return v;return-1},merge:function(j,
|
||||
s){var v=j.length,z=0;if(typeof s.length==="number")for(var H=s.length;z<H;z++)j[v++]=s[z];else for(;s[z]!==B;)j[v++]=s[z++];j.length=v;return j},grep:function(j,s,v){var z=[],H;v=!!v;for(var G=0,K=j.length;G<K;G++){H=!!s(j[G],G);v!==H&&z.push(j[G])}return z},map:function(j,s,v){for(var z=[],H,G=0,K=j.length;G<K;G++){H=s(j[G],G,v);if(H!=null)z[z.length]=H}return z.concat.apply([],z)},guid:1,proxy:function(j,s,v){if(arguments.length===2)if(typeof s==="string"){v=j;j=v[s];s=B}else if(s&&!b.isFunction(s)){v=
|
||||
s;s=B}if(!s&&j)s=function(){return j.apply(v||this,arguments)};if(j)s.guid=j.guid=j.guid||s.guid||b.guid++;return s},access:function(j,s,v,z,H,G){var K=j.length;if(typeof s==="object"){for(var Q in s)b.access(j,Q,s[Q],z,H,v);return j}if(v!==B){z=!G&&z&&b.isFunction(v);for(Q=0;Q<K;Q++)H(j[Q],s,z?v.call(j[Q],Q,H(j[Q],s)):v,G);return j}return K?H(j[0],s):B},now:function(){return(new Date).getTime()},uaMatch:function(j){j=j.toLowerCase();j=L.exec(j)||g.exec(j)||i.exec(j)||j.indexOf("compatible")<0&&n.exec(j)||
|
||||
[];return{browser:j[1]||"",version:j[2]||"0"}},browser:{}});b.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(j,s){R["[object "+s+"]"]=s.toLowerCase()});m=b.uaMatch(m);if(m.browser){b.browser[m.browser]=true;b.browser.version=m.version}if(b.browser.webkit)b.browser.safari=true;if(D)b.inArray=function(j,s){return D.call(s,j)};if(!/\s/.test("\u00a0")){k=/^[\s\xA0]+/;o=/[\s\xA0]+$/}f=b(t);if(t.addEventListener)u=function(){t.removeEventListener("DOMContentLoaded",u,
|
||||
false);b.ready()};else if(t.attachEvent)u=function(){if(t.readyState==="complete"){t.detachEvent("onreadystatechange",u);b.ready()}};return E.jQuery=E.$=b}();(function(){c.support={};var a=t.documentElement,b=t.createElement("script"),d=t.createElement("div"),e="script"+c.now();d.style.display="none";d.innerHTML=" <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";var f=d.getElementsByTagName("*"),h=d.getElementsByTagName("a")[0],l=t.createElement("select"),
|
||||
k=l.appendChild(t.createElement("option"));if(!(!f||!f.length||!h)){c.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(h.getAttribute("style")),hrefNormalized:h.getAttribute("href")==="/a",opacity:/^0.55$/.test(h.style.opacity),cssFloat:!!h.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:k.selected,deleteExpando:true,optDisabled:false,checkClone:false,
|
||||
scriptEval:false,noCloneEvent:true,boxModel:null,inlineBlockNeedsLayout:false,shrinkWrapBlocks:false,reliableHiddenOffsets:true};l.disabled=true;c.support.optDisabled=!k.disabled;b.type="text/javascript";try{b.appendChild(t.createTextNode("window."+e+"=1;"))}catch(o){}a.insertBefore(b,a.firstChild);if(E[e]){c.support.scriptEval=true;delete E[e]}try{delete b.test}catch(x){c.support.deleteExpando=false}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function r(){c.support.noCloneEvent=
|
||||
false;d.detachEvent("onclick",r)});d.cloneNode(true).fireEvent("onclick")}d=t.createElement("div");d.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";a=t.createDocumentFragment();a.appendChild(d.firstChild);c.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;c(function(){var r=t.createElement("div");r.style.width=r.style.paddingLeft="1px";t.body.appendChild(r);c.boxModel=c.support.boxModel=r.offsetWidth===2;if("zoom"in r.style){r.style.display="inline";r.style.zoom=
|
||||
1;c.support.inlineBlockNeedsLayout=r.offsetWidth===2;r.style.display="";r.innerHTML="<div style='width:4px;'></div>";c.support.shrinkWrapBlocks=r.offsetWidth!==2}r.innerHTML="<table><tr><td style='padding:0;display:none'></td><td>t</td></tr></table>";var A=r.getElementsByTagName("td");c.support.reliableHiddenOffsets=A[0].offsetHeight===0;A[0].style.display="";A[1].style.display="none";c.support.reliableHiddenOffsets=c.support.reliableHiddenOffsets&&A[0].offsetHeight===0;r.innerHTML="";t.body.removeChild(r).style.display=
|
||||
"none"});a=function(r){var A=t.createElement("div");r="on"+r;var C=r in A;if(!C){A.setAttribute(r,"return;");C=typeof A[r]==="function"}return C};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=f=h=null}})();var ra={},Ja=/^(?:\{.*\}|\[.*\])$/;c.extend({cache:{},uuid:0,expando:"jQuery"+c.now(),noData:{embed:true,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:true},data:function(a,b,d){if(c.acceptData(a)){a=a==E?ra:a;var e=a.nodeType,f=e?a[c.expando]:null,h=
|
||||
c.cache;if(!(e&&!f&&typeof b==="string"&&d===B)){if(e)f||(a[c.expando]=f=++c.uuid);else h=a;if(typeof b==="object")if(e)h[f]=c.extend(h[f],b);else c.extend(h,b);else if(e&&!h[f])h[f]={};a=e?h[f]:h;if(d!==B)a[b]=d;return typeof b==="string"?a[b]:a}}},removeData:function(a,b){if(c.acceptData(a)){a=a==E?ra:a;var d=a.nodeType,e=d?a[c.expando]:a,f=c.cache,h=d?f[e]:e;if(b){if(h){delete h[b];d&&c.isEmptyObject(h)&&c.removeData(a)}}else if(d&&c.support.deleteExpando)delete a[c.expando];else if(a.removeAttribute)a.removeAttribute(c.expando);
|
||||
else if(d)delete f[e];else for(var l in a)delete a[l]}},acceptData:function(a){if(a.nodeName){var b=c.noData[a.nodeName.toLowerCase()];if(b)return!(b===true||a.getAttribute("classid")!==b)}return true}});c.fn.extend({data:function(a,b){var d=null;if(typeof a==="undefined"){if(this.length){var e=this[0].attributes,f;d=c.data(this[0]);for(var h=0,l=e.length;h<l;h++){f=e[h].name;if(f.indexOf("data-")===0){f=f.substr(5);ka(this[0],f,d[f])}}}return d}else if(typeof a==="object")return this.each(function(){c.data(this,
|
||||
a)});var k=a.split(".");k[1]=k[1]?"."+k[1]:"";if(b===B){d=this.triggerHandler("getData"+k[1]+"!",[k[0]]);if(d===B&&this.length){d=c.data(this[0],a);d=ka(this[0],a,d)}return d===B&&k[1]?this.data(k[0]):d}else return this.each(function(){var o=c(this),x=[k[0],b];o.triggerHandler("setData"+k[1]+"!",x);c.data(this,a,b);o.triggerHandler("changeData"+k[1]+"!",x)})},removeData:function(a){return this.each(function(){c.removeData(this,a)})}});c.extend({queue:function(a,b,d){if(a){b=(b||"fx")+"queue";var e=
|
||||
c.data(a,b);if(!d)return e||[];if(!e||c.isArray(d))e=c.data(a,b,c.makeArray(d));else e.push(d);return e}},dequeue:function(a,b){b=b||"fx";var d=c.queue(a,b),e=d.shift();if(e==="inprogress")e=d.shift();if(e){b==="fx"&&d.unshift("inprogress");e.call(a,function(){c.dequeue(a,b)})}}});c.fn.extend({queue:function(a,b){if(typeof a!=="string"){b=a;a="fx"}if(b===B)return c.queue(this[0],a);return this.each(function(){var d=c.queue(this,a,b);a==="fx"&&d[0]!=="inprogress"&&c.dequeue(this,a)})},dequeue:function(a){return this.each(function(){c.dequeue(this,
|
||||
a)})},delay:function(a,b){a=c.fx?c.fx.speeds[a]||a:a;b=b||"fx";return this.queue(b,function(){var d=this;setTimeout(function(){c.dequeue(d,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var sa=/[\n\t]/g,ha=/\s+/,Sa=/\r/g,Ta=/^(?:href|src|style)$/,Ua=/^(?:button|input)$/i,Va=/^(?:button|input|object|select|textarea)$/i,Wa=/^a(?:rea)?$/i,ta=/^(?:radio|checkbox)$/i;c.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",
|
||||
colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};c.fn.extend({attr:function(a,b){return c.access(this,a,b,true,c.attr)},removeAttr:function(a){return this.each(function(){c.attr(this,a,"");this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(c.isFunction(a))return this.each(function(x){var r=c(this);r.addClass(a.call(this,x,r.attr("class")))});if(a&&typeof a==="string")for(var b=(a||"").split(ha),d=0,e=this.length;d<e;d++){var f=this[d];if(f.nodeType===
|
||||
1)if(f.className){for(var h=" "+f.className+" ",l=f.className,k=0,o=b.length;k<o;k++)if(h.indexOf(" "+b[k]+" ")<0)l+=" "+b[k];f.className=c.trim(l)}else f.className=a}return this},removeClass:function(a){if(c.isFunction(a))return this.each(function(o){var x=c(this);x.removeClass(a.call(this,o,x.attr("class")))});if(a&&typeof a==="string"||a===B)for(var b=(a||"").split(ha),d=0,e=this.length;d<e;d++){var f=this[d];if(f.nodeType===1&&f.className)if(a){for(var h=(" "+f.className+" ").replace(sa," "),
|
||||
l=0,k=b.length;l<k;l++)h=h.replace(" "+b[l]+" "," ");f.className=c.trim(h)}else f.className=""}return this},toggleClass:function(a,b){var d=typeof a,e=typeof b==="boolean";if(c.isFunction(a))return this.each(function(f){var h=c(this);h.toggleClass(a.call(this,f,h.attr("class"),b),b)});return this.each(function(){if(d==="string")for(var f,h=0,l=c(this),k=b,o=a.split(ha);f=o[h++];){k=e?k:!l.hasClass(f);l[k?"addClass":"removeClass"](f)}else if(d==="undefined"||d==="boolean"){this.className&&c.data(this,
|
||||
"__className__",this.className);this.className=this.className||a===false?"":c.data(this,"__className__")||""}})},hasClass:function(a){a=" "+a+" ";for(var b=0,d=this.length;b<d;b++)if((" "+this[b].className+" ").replace(sa," ").indexOf(a)>-1)return true;return false},val:function(a){if(!arguments.length){var b=this[0];if(b){if(c.nodeName(b,"option")){var d=b.attributes.value;return!d||d.specified?b.value:b.text}if(c.nodeName(b,"select")){var e=b.selectedIndex;d=[];var f=b.options;b=b.type==="select-one";
|
||||
if(e<0)return null;var h=b?e:0;for(e=b?e+1:f.length;h<e;h++){var l=f[h];if(l.selected&&(c.support.optDisabled?!l.disabled:l.getAttribute("disabled")===null)&&(!l.parentNode.disabled||!c.nodeName(l.parentNode,"optgroup"))){a=c(l).val();if(b)return a;d.push(a)}}return d}if(ta.test(b.type)&&!c.support.checkOn)return b.getAttribute("value")===null?"on":b.value;return(b.value||"").replace(Sa,"")}return B}var k=c.isFunction(a);return this.each(function(o){var x=c(this),r=a;if(this.nodeType===1){if(k)r=
|
||||
a.call(this,o,x.val());if(r==null)r="";else if(typeof r==="number")r+="";else if(c.isArray(r))r=c.map(r,function(C){return C==null?"":C+""});if(c.isArray(r)&&ta.test(this.type))this.checked=c.inArray(x.val(),r)>=0;else if(c.nodeName(this,"select")){var A=c.makeArray(r);c("option",this).each(function(){this.selected=c.inArray(c(this).val(),A)>=0});if(!A.length)this.selectedIndex=-1}else this.value=r}})}});c.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},
|
||||
attr:function(a,b,d,e){if(!a||a.nodeType===3||a.nodeType===8)return B;if(e&&b in c.attrFn)return c(a)[b](d);e=a.nodeType!==1||!c.isXMLDoc(a);var f=d!==B;b=e&&c.props[b]||b;var h=Ta.test(b);if((b in a||a[b]!==B)&&e&&!h){if(f){b==="type"&&Ua.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed");if(d===null)a.nodeType===1&&a.removeAttribute(b);else a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&&
|
||||
b.specified?b.value:Va.test(a.nodeName)||Wa.test(a.nodeName)&&a.href?0:B;return a[b]}if(!c.support.style&&e&&b==="style"){if(f)a.style.cssText=""+d;return a.style.cssText}f&&a.setAttribute(b,""+d);if(!a.attributes[b]&&a.hasAttribute&&!a.hasAttribute(b))return B;a=!c.support.hrefNormalized&&e&&h?a.getAttribute(b,2):a.getAttribute(b);return a===null?B:a}});var X=/\.(.*)$/,ia=/^(?:textarea|input|select)$/i,La=/\./g,Ma=/ /g,Xa=/[^\w\s.|`]/g,Ya=function(a){return a.replace(Xa,"\\$&")},ua={focusin:0,focusout:0};
|
||||
c.event={add:function(a,b,d,e){if(!(a.nodeType===3||a.nodeType===8)){if(c.isWindow(a)&&a!==E&&!a.frameElement)a=E;if(d===false)d=U;else if(!d)return;var f,h;if(d.handler){f=d;d=f.handler}if(!d.guid)d.guid=c.guid++;if(h=c.data(a)){var l=a.nodeType?"events":"__events__",k=h[l],o=h.handle;if(typeof k==="function"){o=k.handle;k=k.events}else if(!k){a.nodeType||(h[l]=h=function(){});h.events=k={}}if(!o)h.handle=o=function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(o.elem,
|
||||
arguments):B};o.elem=a;b=b.split(" ");for(var x=0,r;l=b[x++];){h=f?c.extend({},f):{handler:d,data:e};if(l.indexOf(".")>-1){r=l.split(".");l=r.shift();h.namespace=r.slice(0).sort().join(".")}else{r=[];h.namespace=""}h.type=l;if(!h.guid)h.guid=d.guid;var A=k[l],C=c.event.special[l]||{};if(!A){A=k[l]=[];if(!C.setup||C.setup.call(a,e,r,o)===false)if(a.addEventListener)a.addEventListener(l,o,false);else a.attachEvent&&a.attachEvent("on"+l,o)}if(C.add){C.add.call(a,h);if(!h.handler.guid)h.handler.guid=
|
||||
d.guid}A.push(h);c.event.global[l]=true}a=null}}},global:{},remove:function(a,b,d,e){if(!(a.nodeType===3||a.nodeType===8)){if(d===false)d=U;var f,h,l=0,k,o,x,r,A,C,J=a.nodeType?"events":"__events__",w=c.data(a),I=w&&w[J];if(w&&I){if(typeof I==="function"){w=I;I=I.events}if(b&&b.type){d=b.handler;b=b.type}if(!b||typeof b==="string"&&b.charAt(0)==="."){b=b||"";for(f in I)c.event.remove(a,f+b)}else{for(b=b.split(" ");f=b[l++];){r=f;k=f.indexOf(".")<0;o=[];if(!k){o=f.split(".");f=o.shift();x=RegExp("(^|\\.)"+
|
||||
c.map(o.slice(0).sort(),Ya).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(A=I[f])if(d){r=c.event.special[f]||{};for(h=e||0;h<A.length;h++){C=A[h];if(d.guid===C.guid){if(k||x.test(C.namespace)){e==null&&A.splice(h--,1);r.remove&&r.remove.call(a,C)}if(e!=null)break}}if(A.length===0||e!=null&&A.length===1){if(!r.teardown||r.teardown.call(a,o)===false)c.removeEvent(a,f,w.handle);delete I[f]}}else for(h=0;h<A.length;h++){C=A[h];if(k||x.test(C.namespace)){c.event.remove(a,r,C.handler,h);A.splice(h--,1)}}}if(c.isEmptyObject(I)){if(b=
|
||||
w.handle)b.elem=null;delete w.events;delete w.handle;if(typeof w==="function")c.removeData(a,J);else c.isEmptyObject(w)&&c.removeData(a)}}}}},trigger:function(a,b,d,e){var f=a.type||a;if(!e){a=typeof a==="object"?a[c.expando]?a:c.extend(c.Event(f),a):c.Event(f);if(f.indexOf("!")>=0){a.type=f=f.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();c.event.global[f]&&c.each(c.cache,function(){this.events&&this.events[f]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType===
|
||||
8)return B;a.result=B;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;(e=d.nodeType?c.data(d,"handle"):(c.data(d,"__events__")||{}).handle)&&e.apply(d,b);e=d.parentNode||d.ownerDocument;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()]))if(d["on"+f]&&d["on"+f].apply(d,b)===false){a.result=false;a.preventDefault()}}catch(h){}if(!a.isPropagationStopped()&&e)c.event.trigger(a,b,e,true);else if(!a.isDefaultPrevented()){var l;e=a.target;var k=f.replace(X,""),o=c.nodeName(e,"a")&&k===
|
||||
"click",x=c.event.special[k]||{};if((!x._default||x._default.call(d,a)===false)&&!o&&!(e&&e.nodeName&&c.noData[e.nodeName.toLowerCase()])){try{if(e[k]){if(l=e["on"+k])e["on"+k]=null;c.event.triggered=true;e[k]()}}catch(r){}if(l)e["on"+k]=l;c.event.triggered=false}}},handle:function(a){var b,d,e,f;d=[];var h=c.makeArray(arguments);a=h[0]=c.event.fix(a||E.event);a.currentTarget=this;b=a.type.indexOf(".")<0&&!a.exclusive;if(!b){e=a.type.split(".");a.type=e.shift();d=e.slice(0).sort();e=RegExp("(^|\\.)"+
|
||||
d.join("\\.(?:.*\\.)?")+"(\\.|$)")}a.namespace=a.namespace||d.join(".");f=c.data(this,this.nodeType?"events":"__events__");if(typeof f==="function")f=f.events;d=(f||{})[a.type];if(f&&d){d=d.slice(0);f=0;for(var l=d.length;f<l;f++){var k=d[f];if(b||e.test(k.namespace)){a.handler=k.handler;a.data=k.data;a.handleObj=k;k=k.handler.apply(this,h);if(k!==B){a.result=k;if(k===false){a.preventDefault();a.stopPropagation()}}if(a.isImmediatePropagationStopped())break}}}return a.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),
|
||||
fix:function(a){if(a[c.expando])return a;var b=a;a=c.Event(b);for(var d=this.props.length,e;d;){e=this.props[--d];a[e]=b[e]}if(!a.target)a.target=a.srcElement||t;if(a.target.nodeType===3)a.target=a.target.parentNode;if(!a.relatedTarget&&a.fromElement)a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement;if(a.pageX==null&&a.clientX!=null){b=t.documentElement;d=t.body;a.pageX=a.clientX+(b&&b.scrollLeft||d&&d.scrollLeft||0)-(b&&b.clientLeft||d&&d.clientLeft||0);a.pageY=a.clientY+(b&&b.scrollTop||
|
||||
d&&d.scrollTop||0)-(b&&b.clientTop||d&&d.clientTop||0)}if(a.which==null&&(a.charCode!=null||a.keyCode!=null))a.which=a.charCode!=null?a.charCode:a.keyCode;if(!a.metaKey&&a.ctrlKey)a.metaKey=a.ctrlKey;if(!a.which&&a.button!==B)a.which=a.button&1?1:a.button&2?3:a.button&4?2:0;return a},guid:1E8,proxy:c.proxy,special:{ready:{setup:c.bindReady,teardown:c.noop},live:{add:function(a){c.event.add(this,Y(a.origType,a.selector),c.extend({},a,{handler:Ka,guid:a.handler.guid}))},remove:function(a){c.event.remove(this,
|
||||
Y(a.origType,a.selector),a)}},beforeunload:{setup:function(a,b,d){if(c.isWindow(this))this.onbeforeunload=d},teardown:function(a,b){if(this.onbeforeunload===b)this.onbeforeunload=null}}}};c.removeEvent=t.removeEventListener?function(a,b,d){a.removeEventListener&&a.removeEventListener(b,d,false)}:function(a,b,d){a.detachEvent&&a.detachEvent("on"+b,d)};c.Event=function(a){if(!this.preventDefault)return new c.Event(a);if(a&&a.type){this.originalEvent=a;this.type=a.type}else this.type=a;this.timeStamp=
|
||||
c.now();this[c.expando]=true};c.Event.prototype={preventDefault:function(){this.isDefaultPrevented=ca;var a=this.originalEvent;if(a)if(a.preventDefault)a.preventDefault();else a.returnValue=false},stopPropagation:function(){this.isPropagationStopped=ca;var a=this.originalEvent;if(a){a.stopPropagation&&a.stopPropagation();a.cancelBubble=true}},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=ca;this.stopPropagation()},isDefaultPrevented:U,isPropagationStopped:U,isImmediatePropagationStopped:U};
|
||||
var va=function(a){var b=a.relatedTarget;try{for(;b&&b!==this;)b=b.parentNode;if(b!==this){a.type=a.data;c.event.handle.apply(this,arguments)}}catch(d){}},wa=function(a){a.type=a.data;c.event.handle.apply(this,arguments)};c.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){c.event.special[a]={setup:function(d){c.event.add(this,b,d&&d.selector?wa:va,a)},teardown:function(d){c.event.remove(this,b,d&&d.selector?wa:va)}}});if(!c.support.submitBubbles)c.event.special.submit={setup:function(){if(this.nodeName.toLowerCase()!==
|
||||
"form"){c.event.add(this,"click.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="submit"||d==="image")&&c(b).closest("form").length){a.liveFired=B;return la("submit",this,arguments)}});c.event.add(this,"keypress.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="text"||d==="password")&&c(b).closest("form").length&&a.keyCode===13){a.liveFired=B;return la("submit",this,arguments)}})}else return false},teardown:function(){c.event.remove(this,".specialSubmit")}};if(!c.support.changeBubbles){var V,
|
||||
xa=function(a){var b=a.type,d=a.value;if(b==="radio"||b==="checkbox")d=a.checked;else if(b==="select-multiple")d=a.selectedIndex>-1?c.map(a.options,function(e){return e.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d},Z=function(a,b){var d=a.target,e,f;if(!(!ia.test(d.nodeName)||d.readOnly)){e=c.data(d,"_change_data");f=xa(d);if(a.type!=="focusout"||d.type!=="radio")c.data(d,"_change_data",f);if(!(e===B||f===e))if(e!=null||f){a.type="change";a.liveFired=
|
||||
B;return c.event.trigger(a,b,d)}}};c.event.special.change={filters:{focusout:Z,beforedeactivate:Z,click:function(a){var b=a.target,d=b.type;if(d==="radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return Z.call(this,a)},keydown:function(a){var b=a.target,d=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(d==="checkbox"||d==="radio")||d==="select-multiple")return Z.call(this,a)},beforeactivate:function(a){a=a.target;c.data(a,"_change_data",xa(a))}},setup:function(){if(this.type===
|
||||
"file")return false;for(var a in V)c.event.add(this,a+".specialChange",V[a]);return ia.test(this.nodeName)},teardown:function(){c.event.remove(this,".specialChange");return ia.test(this.nodeName)}};V=c.event.special.change.filters;V.focus=V.beforeactivate}t.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(e){e=c.event.fix(e);e.type=b;return c.event.trigger(e,null,e.target)}c.event.special[b]={setup:function(){ua[b]++===0&&t.addEventListener(a,d,true)},teardown:function(){--ua[b]===
|
||||
0&&t.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,e,f){if(typeof d==="object"){for(var h in d)this[b](h,e,d[h],f);return this}if(c.isFunction(e)||e===false){f=e;e=B}var l=b==="one"?c.proxy(f,function(o){c(this).unbind(o,l);return f.apply(this,arguments)}):f;if(d==="unload"&&b!=="one")this.one(d,e,f);else{h=0;for(var k=this.length;h<k;h++)c.event.add(this[h],d,l,e)}return this}});c.fn.extend({unbind:function(a,b){if(typeof a==="object"&&!a.preventDefault)for(var d in a)this.unbind(d,
|
||||
a[d]);else{d=0;for(var e=this.length;d<e;d++)c.event.remove(this[d],a,b)}return this},delegate:function(a,b,d,e){return this.live(b,d,e,a)},undelegate:function(a,b,d){return arguments.length===0?this.unbind("live"):this.die(b,null,d,a)},trigger:function(a,b){return this.each(function(){c.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0]){var d=c.Event(a);d.preventDefault();d.stopPropagation();c.event.trigger(d,b,this[0]);return d.result}},toggle:function(a){for(var b=arguments,d=
|
||||
1;d<b.length;)c.proxy(a,b[d++]);return this.click(c.proxy(a,function(e){var f=(c.data(this,"lastToggle"+a.guid)||0)%d;c.data(this,"lastToggle"+a.guid,f+1);e.preventDefault();return b[f].apply(this,arguments)||false}))},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var ya={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};c.each(["live","die"],function(a,b){c.fn[b]=function(d,e,f,h){var l,k=0,o,x,r=h||this.selector;h=h?this:c(this.context);if(typeof d===
|
||||
"object"&&!d.preventDefault){for(l in d)h[b](l,e,d[l],r);return this}if(c.isFunction(e)){f=e;e=B}for(d=(d||"").split(" ");(l=d[k++])!=null;){o=X.exec(l);x="";if(o){x=o[0];l=l.replace(X,"")}if(l==="hover")d.push("mouseenter"+x,"mouseleave"+x);else{o=l;if(l==="focus"||l==="blur"){d.push(ya[l]+x);l+=x}else l=(ya[l]||l)+x;if(b==="live"){x=0;for(var A=h.length;x<A;x++)c.event.add(h[x],"live."+Y(l,r),{data:e,selector:r,handler:f,origType:l,origHandler:f,preType:o})}else h.unbind("live."+Y(l,r),f)}}return this}});
|
||||
c.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "),function(a,b){c.fn[b]=function(d,e){if(e==null){e=d;d=null}return arguments.length>0?this.bind(b,d,e):this.trigger(b)};if(c.attrFn)c.attrFn[b]=true});E.attachEvent&&!E.addEventListener&&c(E).bind("unload",function(){for(var a in c.cache)if(c.cache[a].handle)try{c.event.remove(c.cache[a].handle.elem)}catch(b){}});
|
||||
(function(){function a(g,i,n,m,p,q){p=0;for(var u=m.length;p<u;p++){var y=m[p];if(y){var F=false;for(y=y[g];y;){if(y.sizcache===n){F=m[y.sizset];break}if(y.nodeType===1&&!q){y.sizcache=n;y.sizset=p}if(y.nodeName.toLowerCase()===i){F=y;break}y=y[g]}m[p]=F}}}function b(g,i,n,m,p,q){p=0;for(var u=m.length;p<u;p++){var y=m[p];if(y){var F=false;for(y=y[g];y;){if(y.sizcache===n){F=m[y.sizset];break}if(y.nodeType===1){if(!q){y.sizcache=n;y.sizset=p}if(typeof i!=="string"){if(y===i){F=true;break}}else if(k.filter(i,
|
||||
[y]).length>0){F=y;break}}y=y[g]}m[p]=F}}}var d=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,e=0,f=Object.prototype.toString,h=false,l=true;[0,0].sort(function(){l=false;return 0});var k=function(g,i,n,m){n=n||[];var p=i=i||t;if(i.nodeType!==1&&i.nodeType!==9)return[];if(!g||typeof g!=="string")return n;var q,u,y,F,M,N=true,O=k.isXML(i),D=[],R=g;do{d.exec("");if(q=d.exec(R)){R=q[3];D.push(q[1]);if(q[2]){F=q[3];
|
||||
break}}}while(q);if(D.length>1&&x.exec(g))if(D.length===2&&o.relative[D[0]])u=L(D[0]+D[1],i);else for(u=o.relative[D[0]]?[i]:k(D.shift(),i);D.length;){g=D.shift();if(o.relative[g])g+=D.shift();u=L(g,u)}else{if(!m&&D.length>1&&i.nodeType===9&&!O&&o.match.ID.test(D[0])&&!o.match.ID.test(D[D.length-1])){q=k.find(D.shift(),i,O);i=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]}if(i){q=m?{expr:D.pop(),set:C(m)}:k.find(D.pop(),D.length===1&&(D[0]==="~"||D[0]==="+")&&i.parentNode?i.parentNode:i,O);u=q.expr?k.filter(q.expr,
|
||||
q.set):q.set;if(D.length>0)y=C(u);else N=false;for(;D.length;){q=M=D.pop();if(o.relative[M])q=D.pop();else M="";if(q==null)q=i;o.relative[M](y,q,O)}}else y=[]}y||(y=u);y||k.error(M||g);if(f.call(y)==="[object Array]")if(N)if(i&&i.nodeType===1)for(g=0;y[g]!=null;g++){if(y[g]&&(y[g]===true||y[g].nodeType===1&&k.contains(i,y[g])))n.push(u[g])}else for(g=0;y[g]!=null;g++)y[g]&&y[g].nodeType===1&&n.push(u[g]);else n.push.apply(n,y);else C(y,n);if(F){k(F,p,n,m);k.uniqueSort(n)}return n};k.uniqueSort=function(g){if(w){h=
|
||||
l;g.sort(w);if(h)for(var i=1;i<g.length;i++)g[i]===g[i-1]&&g.splice(i--,1)}return g};k.matches=function(g,i){return k(g,null,null,i)};k.matchesSelector=function(g,i){return k(i,null,null,[g]).length>0};k.find=function(g,i,n){var m;if(!g)return[];for(var p=0,q=o.order.length;p<q;p++){var u,y=o.order[p];if(u=o.leftMatch[y].exec(g)){var F=u[1];u.splice(1,1);if(F.substr(F.length-1)!=="\\"){u[1]=(u[1]||"").replace(/\\/g,"");m=o.find[y](u,i,n);if(m!=null){g=g.replace(o.match[y],"");break}}}}m||(m=i.getElementsByTagName("*"));
|
||||
return{set:m,expr:g}};k.filter=function(g,i,n,m){for(var p,q,u=g,y=[],F=i,M=i&&i[0]&&k.isXML(i[0]);g&&i.length;){for(var N in o.filter)if((p=o.leftMatch[N].exec(g))!=null&&p[2]){var O,D,R=o.filter[N];D=p[1];q=false;p.splice(1,1);if(D.substr(D.length-1)!=="\\"){if(F===y)y=[];if(o.preFilter[N])if(p=o.preFilter[N](p,F,n,y,m,M)){if(p===true)continue}else q=O=true;if(p)for(var j=0;(D=F[j])!=null;j++)if(D){O=R(D,p,j,F);var s=m^!!O;if(n&&O!=null)if(s)q=true;else F[j]=false;else if(s){y.push(D);q=true}}if(O!==
|
||||
B){n||(F=y);g=g.replace(o.match[N],"");if(!q)return[];break}}}if(g===u)if(q==null)k.error(g);else break;u=g}return F};k.error=function(g){throw"Syntax error, unrecognized expression: "+g;};var o=k.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+\-]*)\))?/,
|
||||
POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(g){return g.getAttribute("href")}},relative:{"+":function(g,i){var n=typeof i==="string",m=n&&!/\W/.test(i);n=n&&!m;if(m)i=i.toLowerCase();m=0;for(var p=g.length,q;m<p;m++)if(q=g[m]){for(;(q=q.previousSibling)&&q.nodeType!==1;);g[m]=n||q&&q.nodeName.toLowerCase()===
|
||||
i?q||false:q===i}n&&k.filter(i,g,true)},">":function(g,i){var n,m=typeof i==="string",p=0,q=g.length;if(m&&!/\W/.test(i))for(i=i.toLowerCase();p<q;p++){if(n=g[p]){n=n.parentNode;g[p]=n.nodeName.toLowerCase()===i?n:false}}else{for(;p<q;p++)if(n=g[p])g[p]=m?n.parentNode:n.parentNode===i;m&&k.filter(i,g,true)}},"":function(g,i,n){var m,p=e++,q=b;if(typeof i==="string"&&!/\W/.test(i)){m=i=i.toLowerCase();q=a}q("parentNode",i,p,g,m,n)},"~":function(g,i,n){var m,p=e++,q=b;if(typeof i==="string"&&!/\W/.test(i)){m=
|
||||
i=i.toLowerCase();q=a}q("previousSibling",i,p,g,m,n)}},find:{ID:function(g,i,n){if(typeof i.getElementById!=="undefined"&&!n)return(g=i.getElementById(g[1]))&&g.parentNode?[g]:[]},NAME:function(g,i){if(typeof i.getElementsByName!=="undefined"){for(var n=[],m=i.getElementsByName(g[1]),p=0,q=m.length;p<q;p++)m[p].getAttribute("name")===g[1]&&n.push(m[p]);return n.length===0?null:n}},TAG:function(g,i){return i.getElementsByTagName(g[1])}},preFilter:{CLASS:function(g,i,n,m,p,q){g=" "+g[1].replace(/\\/g,
|
||||
"")+" ";if(q)return g;q=0;for(var u;(u=i[q])!=null;q++)if(u)if(p^(u.className&&(" "+u.className+" ").replace(/[\t\n]/g," ").indexOf(g)>=0))n||m.push(u);else if(n)i[q]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()},CHILD:function(g){if(g[1]==="nth"){var i=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=i[1]+(i[2]||1)-0;g[3]=i[3]-0}g[0]=e++;return g},ATTR:function(g,i,n,
|
||||
m,p,q){i=g[1].replace(/\\/g,"");if(!q&&o.attrMap[i])g[1]=o.attrMap[i];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,i,n,m,p){if(g[1]==="not")if((d.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=k(g[3],null,null,i);else{g=k.filter(g[3],i,n,true^p);n||m.push.apply(m,g);return false}else if(o.match.POS.test(g[0])||o.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true);return g}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled===
|
||||
true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild},has:function(g,i,n){return!!k(n[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)},text:function(g){return"text"===g.type},radio:function(g){return"radio"===g.type},checkbox:function(g){return"checkbox"===g.type},file:function(g){return"file"===g.type},password:function(g){return"password"===g.type},submit:function(g){return"submit"===
|
||||
g.type},image:function(g){return"image"===g.type},reset:function(g){return"reset"===g.type},button:function(g){return"button"===g.type||g.nodeName.toLowerCase()==="button"},input:function(g){return/input|select|textarea|button/i.test(g.nodeName)}},setFilters:{first:function(g,i){return i===0},last:function(g,i,n,m){return i===m.length-1},even:function(g,i){return i%2===0},odd:function(g,i){return i%2===1},lt:function(g,i,n){return i<n[3]-0},gt:function(g,i,n){return i>n[3]-0},nth:function(g,i,n){return n[3]-
|
||||
0===i},eq:function(g,i,n){return n[3]-0===i}},filter:{PSEUDO:function(g,i,n,m){var p=i[1],q=o.filters[p];if(q)return q(g,n,i,m);else if(p==="contains")return(g.textContent||g.innerText||k.getText([g])||"").indexOf(i[3])>=0;else if(p==="not"){i=i[3];n=0;for(m=i.length;n<m;n++)if(i[n]===g)return false;return true}else k.error("Syntax error, unrecognized expression: "+p)},CHILD:function(g,i){var n=i[1],m=g;switch(n){case "only":case "first":for(;m=m.previousSibling;)if(m.nodeType===1)return false;if(n===
|
||||
"first")return true;m=g;case "last":for(;m=m.nextSibling;)if(m.nodeType===1)return false;return true;case "nth":n=i[2];var p=i[3];if(n===1&&p===0)return true;var q=i[0],u=g.parentNode;if(u&&(u.sizcache!==q||!g.nodeIndex)){var y=0;for(m=u.firstChild;m;m=m.nextSibling)if(m.nodeType===1)m.nodeIndex=++y;u.sizcache=q}m=g.nodeIndex-p;return n===0?m===0:m%n===0&&m/n>=0}},ID:function(g,i){return g.nodeType===1&&g.getAttribute("id")===i},TAG:function(g,i){return i==="*"&&g.nodeType===1||g.nodeName.toLowerCase()===
|
||||
i},CLASS:function(g,i){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(i)>-1},ATTR:function(g,i){var n=i[1];n=o.attrHandle[n]?o.attrHandle[n](g):g[n]!=null?g[n]:g.getAttribute(n);var m=n+"",p=i[2],q=i[4];return n==null?p==="!=":p==="="?m===q:p==="*="?m.indexOf(q)>=0:p==="~="?(" "+m+" ").indexOf(q)>=0:!q?m&&n!==false:p==="!="?m!==q:p==="^="?m.indexOf(q)===0:p==="$="?m.substr(m.length-q.length)===q:p==="|="?m===q||m.substr(0,q.length+1)===q+"-":false},POS:function(g,i,n,m){var p=o.setFilters[i[2]];
|
||||
if(p)return p(g,n,i,m)}}},x=o.match.POS,r=function(g,i){return"\\"+(i-0+1)},A;for(A in o.match){o.match[A]=RegExp(o.match[A].source+/(?![^\[]*\])(?![^\(]*\))/.source);o.leftMatch[A]=RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[A].source.replace(/\\(\d+)/g,r))}var C=function(g,i){g=Array.prototype.slice.call(g,0);if(i){i.push.apply(i,g);return i}return g};try{Array.prototype.slice.call(t.documentElement.childNodes,0)}catch(J){C=function(g,i){var n=0,m=i||[];if(f.call(g)==="[object Array]")Array.prototype.push.apply(m,
|
||||
g);else if(typeof g.length==="number")for(var p=g.length;n<p;n++)m.push(g[n]);else for(;g[n];n++)m.push(g[n]);return m}}var w,I;if(t.documentElement.compareDocumentPosition)w=function(g,i){if(g===i){h=true;return 0}if(!g.compareDocumentPosition||!i.compareDocumentPosition)return g.compareDocumentPosition?-1:1;return g.compareDocumentPosition(i)&4?-1:1};else{w=function(g,i){var n,m,p=[],q=[];n=g.parentNode;m=i.parentNode;var u=n;if(g===i){h=true;return 0}else if(n===m)return I(g,i);else if(n){if(!m)return 1}else return-1;
|
||||
for(;u;){p.unshift(u);u=u.parentNode}for(u=m;u;){q.unshift(u);u=u.parentNode}n=p.length;m=q.length;for(u=0;u<n&&u<m;u++)if(p[u]!==q[u])return I(p[u],q[u]);return u===n?I(g,q[u],-1):I(p[u],i,1)};I=function(g,i,n){if(g===i)return n;for(g=g.nextSibling;g;){if(g===i)return-1;g=g.nextSibling}return 1}}k.getText=function(g){for(var i="",n,m=0;g[m];m++){n=g[m];if(n.nodeType===3||n.nodeType===4)i+=n.nodeValue;else if(n.nodeType!==8)i+=k.getText(n.childNodes)}return i};(function(){var g=t.createElement("div"),
|
||||
i="script"+(new Date).getTime(),n=t.documentElement;g.innerHTML="<a name='"+i+"'/>";n.insertBefore(g,n.firstChild);if(t.getElementById(i)){o.find.ID=function(m,p,q){if(typeof p.getElementById!=="undefined"&&!q)return(p=p.getElementById(m[1]))?p.id===m[1]||typeof p.getAttributeNode!=="undefined"&&p.getAttributeNode("id").nodeValue===m[1]?[p]:B:[]};o.filter.ID=function(m,p){var q=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");return m.nodeType===1&&q&&q.nodeValue===p}}n.removeChild(g);
|
||||
n=g=null})();(function(){var g=t.createElement("div");g.appendChild(t.createComment(""));if(g.getElementsByTagName("*").length>0)o.find.TAG=function(i,n){var m=n.getElementsByTagName(i[1]);if(i[1]==="*"){for(var p=[],q=0;m[q];q++)m[q].nodeType===1&&p.push(m[q]);m=p}return m};g.innerHTML="<a href='#'></a>";if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")o.attrHandle.href=function(i){return i.getAttribute("href",2)};g=null})();t.querySelectorAll&&
|
||||
function(){var g=k,i=t.createElement("div");i.innerHTML="<p class='TEST'></p>";if(!(i.querySelectorAll&&i.querySelectorAll(".TEST").length===0)){k=function(m,p,q,u){p=p||t;m=m.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!u&&!k.isXML(p))if(p.nodeType===9)try{return C(p.querySelectorAll(m),q)}catch(y){}else if(p.nodeType===1&&p.nodeName.toLowerCase()!=="object"){var F=p.getAttribute("id"),M=F||"__sizzle__";F||p.setAttribute("id",M);try{return C(p.querySelectorAll("#"+M+" "+m),q)}catch(N){}finally{F||
|
||||
p.removeAttribute("id")}}return g(m,p,q,u)};for(var n in g)k[n]=g[n];i=null}}();(function(){var g=t.documentElement,i=g.matchesSelector||g.mozMatchesSelector||g.webkitMatchesSelector||g.msMatchesSelector,n=false;try{i.call(t.documentElement,"[test!='']:sizzle")}catch(m){n=true}if(i)k.matchesSelector=function(p,q){q=q.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(p))try{if(n||!o.match.PSEUDO.test(q)&&!/!=/.test(q))return i.call(p,q)}catch(u){}return k(q,null,null,[p]).length>0}})();(function(){var g=
|
||||
t.createElement("div");g.innerHTML="<div class='test e'></div><div class='test'></div>";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length===0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){o.order.splice(1,0,"CLASS");o.find.CLASS=function(i,n,m){if(typeof n.getElementsByClassName!=="undefined"&&!m)return n.getElementsByClassName(i[1])};g=null}}})();k.contains=t.documentElement.contains?function(g,i){return g!==i&&(g.contains?g.contains(i):true)}:t.documentElement.compareDocumentPosition?
|
||||
function(g,i){return!!(g.compareDocumentPosition(i)&16)}:function(){return false};k.isXML=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false};var L=function(g,i){for(var n,m=[],p="",q=i.nodeType?[i]:i;n=o.match.PSEUDO.exec(g);){p+=n[0];g=g.replace(o.match.PSEUDO,"")}g=o.relative[g]?g+"*":g;n=0;for(var u=q.length;n<u;n++)k(g,q[n],m);return k.filter(p,m)};c.find=k;c.expr=k.selectors;c.expr[":"]=c.expr.filters;c.unique=k.uniqueSort;c.text=k.getText;c.isXMLDoc=k.isXML;
|
||||
c.contains=k.contains})();var Za=/Until$/,$a=/^(?:parents|prevUntil|prevAll)/,ab=/,/,Na=/^.[^:#\[\.,]*$/,bb=Array.prototype.slice,cb=c.expr.match.POS;c.fn.extend({find:function(a){for(var b=this.pushStack("","find",a),d=0,e=0,f=this.length;e<f;e++){d=b.length;c.find(a,this[e],b);if(e>0)for(var h=d;h<b.length;h++)for(var l=0;l<d;l++)if(b[l]===b[h]){b.splice(h--,1);break}}return b},has:function(a){var b=c(a);return this.filter(function(){for(var d=0,e=b.length;d<e;d++)if(c.contains(this,b[d]))return true})},
|
||||
not:function(a){return this.pushStack(ma(this,a,false),"not",a)},filter:function(a){return this.pushStack(ma(this,a,true),"filter",a)},is:function(a){return!!a&&c.filter(a,this).length>0},closest:function(a,b){var d=[],e,f,h=this[0];if(c.isArray(a)){var l,k={},o=1;if(h&&a.length){e=0;for(f=a.length;e<f;e++){l=a[e];k[l]||(k[l]=c.expr.match.POS.test(l)?c(l,b||this.context):l)}for(;h&&h.ownerDocument&&h!==b;){for(l in k){e=k[l];if(e.jquery?e.index(h)>-1:c(h).is(e))d.push({selector:l,elem:h,level:o})}h=
|
||||
h.parentNode;o++}}return d}l=cb.test(a)?c(a,b||this.context):null;e=0;for(f=this.length;e<f;e++)for(h=this[e];h;)if(l?l.index(h)>-1:c.find.matchesSelector(h,a)){d.push(h);break}else{h=h.parentNode;if(!h||!h.ownerDocument||h===b)break}d=d.length>1?c.unique(d):d;return this.pushStack(d,"closest",a)},index:function(a){if(!a||typeof a==="string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var d=typeof a==="string"?c(a,b||this.context):
|
||||
c.makeArray(a),e=c.merge(this.get(),d);return this.pushStack(!d[0]||!d[0].parentNode||d[0].parentNode.nodeType===11||!e[0]||!e[0].parentNode||e[0].parentNode.nodeType===11?e:c.unique(e))},andSelf:function(){return this.add(this.prevObject)}});c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode",d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a,
|
||||
2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")},nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling",d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a,
|
||||
b){c.fn[a]=function(d,e){var f=c.map(this,b,d);Za.test(a)||(e=d);if(e&&typeof e==="string")f=c.filter(e,f);f=this.length>1?c.unique(f):f;if((this.length>1||ab.test(e))&&$a.test(a))f=f.reverse();return this.pushStack(f,a,bb.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return b.length===1?c.find.matchesSelector(b[0],a)?[b[0]]:[]:c.find.matches(a,b)},dir:function(a,b,d){var e=[];for(a=a[b];a&&a.nodeType!==9&&(d===B||a.nodeType!==1||!c(a).is(d));){a.nodeType===1&&
|
||||
e.push(a);a=a[b]}return e},nth:function(a,b,d){b=b||1;for(var e=0;a;a=a[d])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&d.push(a);return d}});var za=/ jQuery\d+="(?:\d+|null)"/g,$=/^\s+/,Aa=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Ba=/<([\w:]+)/,db=/<tbody/i,eb=/<|&#?\w+;/,Ca=/<(?:script|object|embed|option|style)/i,Da=/checked\s*(?:[^=]|=\s*.checked.)/i,fb=/\=([^="'>\s]+\/)>/g,P={option:[1,
|
||||
"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};P.optgroup=P.option;P.tbody=P.tfoot=P.colgroup=P.caption=P.thead;P.th=P.td;if(!c.support.htmlSerialize)P._default=[1,"div<div>","</div>"];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d=
|
||||
c(this);d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==B)return this.empty().append((this[0]&&this[0].ownerDocument||t).createTextNode(a));return c.text(this)},wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this},
|
||||
wrapInner:function(a){if(c.isFunction(a))return this.each(function(b){c(this).wrapInner(a.call(this,b))});return this.each(function(){var b=c(this),d=b.contents();d.length?d.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a)})},
|
||||
prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this)});else if(arguments.length){var a=c(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,
|
||||
this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},remove:function(a,b){for(var d=0,e;(e=this[d])!=null;d++)if(!a||c.filter(a,[e]).length){if(!b&&e.nodeType===1){c.cleanData(e.getElementsByTagName("*"));c.cleanData([e])}e.parentNode&&e.parentNode.removeChild(e)}return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++)for(b.nodeType===1&&c.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild);
|
||||
return this},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,e=this.ownerDocument;if(!d){d=e.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(za,"").replace(fb,'="$1">').replace($,"")],e)[0]}else return this.cloneNode(true)});if(a===true){na(this,b);na(this.find("*"),b.find("*"))}return b},html:function(a){if(a===B)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(za,""):null;
|
||||
else if(typeof a==="string"&&!Ca.test(a)&&(c.support.leadingWhitespace||!$.test(a))&&!P[(Ba.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Aa,"<$1></$2>");try{for(var b=0,d=this.length;b<d;b++)if(this[b].nodeType===1){c.cleanData(this[b].getElementsByTagName("*"));this[b].innerHTML=a}}catch(e){this.empty().append(a)}}else c.isFunction(a)?this.each(function(f){var h=c(this);h.html(a.call(this,f,h.html()))}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(c.isFunction(a))return this.each(function(b){var d=
|
||||
c(this),e=d.html();d.replaceWith(a.call(this,b,e))});if(typeof a!=="string")a=c(a).detach();return this.each(function(){var b=this.nextSibling,d=this.parentNode;c(this).remove();b?c(b).before(a):c(d).append(a)})}else return this.pushStack(c(c.isFunction(a)?a():a),"replaceWith",a)},detach:function(a){return this.remove(a,true)},domManip:function(a,b,d){var e,f,h,l=a[0],k=[];if(!c.support.checkClone&&arguments.length===3&&typeof l==="string"&&Da.test(l))return this.each(function(){c(this).domManip(a,
|
||||
b,d,true)});if(c.isFunction(l))return this.each(function(x){var r=c(this);a[0]=l.call(this,x,b?r.html():B);r.domManip(a,b,d)});if(this[0]){e=l&&l.parentNode;e=c.support.parentNode&&e&&e.nodeType===11&&e.childNodes.length===this.length?{fragment:e}:c.buildFragment(a,this,k);h=e.fragment;if(f=h.childNodes.length===1?h=h.firstChild:h.firstChild){b=b&&c.nodeName(f,"tr");f=0;for(var o=this.length;f<o;f++)d.call(b?c.nodeName(this[f],"table")?this[f].getElementsByTagName("tbody")[0]||this[f].appendChild(this[f].ownerDocument.createElement("tbody")):
|
||||
this[f]:this[f],f>0||e.cacheable||this.length>1?h.cloneNode(true):h)}k.length&&c.each(k,Oa)}return this}});c.buildFragment=function(a,b,d){var e,f,h;b=b&&b[0]?b[0].ownerDocument||b[0]:t;if(a.length===1&&typeof a[0]==="string"&&a[0].length<512&&b===t&&!Ca.test(a[0])&&(c.support.checkClone||!Da.test(a[0]))){f=true;if(h=c.fragments[a[0]])if(h!==1)e=h}if(!e){e=b.createDocumentFragment();c.clean(a,b,e,d)}if(f)c.fragments[a[0]]=h?e:1;return{fragment:e,cacheable:f}};c.fragments={};c.each({appendTo:"append",
|
||||
prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){c.fn[a]=function(d){var e=[];d=c(d);var f=this.length===1&&this[0].parentNode;if(f&&f.nodeType===11&&f.childNodes.length===1&&d.length===1){d[b](this[0]);return this}else{f=0;for(var h=d.length;f<h;f++){var l=(f>0?this.clone(true):this).get();c(d[f])[b](l);e=e.concat(l)}return this.pushStack(e,a,d.selector)}}});c.extend({clean:function(a,b,d,e){b=b||t;if(typeof b.createElement==="undefined")b=b.ownerDocument||
|
||||
b[0]&&b[0].ownerDocument||t;for(var f=[],h=0,l;(l=a[h])!=null;h++){if(typeof l==="number")l+="";if(l){if(typeof l==="string"&&!eb.test(l))l=b.createTextNode(l);else if(typeof l==="string"){l=l.replace(Aa,"<$1></$2>");var k=(Ba.exec(l)||["",""])[1].toLowerCase(),o=P[k]||P._default,x=o[0],r=b.createElement("div");for(r.innerHTML=o[1]+l+o[2];x--;)r=r.lastChild;if(!c.support.tbody){x=db.test(l);k=k==="table"&&!x?r.firstChild&&r.firstChild.childNodes:o[1]==="<table>"&&!x?r.childNodes:[];for(o=k.length-
|
||||
1;o>=0;--o)c.nodeName(k[o],"tbody")&&!k[o].childNodes.length&&k[o].parentNode.removeChild(k[o])}!c.support.leadingWhitespace&&$.test(l)&&r.insertBefore(b.createTextNode($.exec(l)[0]),r.firstChild);l=r.childNodes}if(l.nodeType)f.push(l);else f=c.merge(f,l)}}if(d)for(h=0;f[h];h++)if(e&&c.nodeName(f[h],"script")&&(!f[h].type||f[h].type.toLowerCase()==="text/javascript"))e.push(f[h].parentNode?f[h].parentNode.removeChild(f[h]):f[h]);else{f[h].nodeType===1&&f.splice.apply(f,[h+1,0].concat(c.makeArray(f[h].getElementsByTagName("script"))));
|
||||
d.appendChild(f[h])}return f},cleanData:function(a){for(var b,d,e=c.cache,f=c.event.special,h=c.support.deleteExpando,l=0,k;(k=a[l])!=null;l++)if(!(k.nodeName&&c.noData[k.nodeName.toLowerCase()]))if(d=k[c.expando]){if((b=e[d])&&b.events)for(var o in b.events)f[o]?c.event.remove(k,o):c.removeEvent(k,o,b.handle);if(h)delete k[c.expando];else k.removeAttribute&&k.removeAttribute(c.expando);delete e[d]}}});var Ea=/alpha\([^)]*\)/i,gb=/opacity=([^)]*)/,hb=/-([a-z])/ig,ib=/([A-Z])/g,Fa=/^-?\d+(?:px)?$/i,
|
||||
jb=/^-?\d/,kb={position:"absolute",visibility:"hidden",display:"block"},Pa=["Left","Right"],Qa=["Top","Bottom"],W,Ga,aa,lb=function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){if(arguments.length===2&&b===B)return this;return c.access(this,a,b,true,function(d,e,f){return f!==B?c.style(d,e,f):c.css(d,e)})};c.extend({cssHooks:{opacity:{get:function(a,b){if(b){var d=W(a,"opacity","opacity");return d===""?"1":d}else return a.style.opacity}}},cssNumber:{zIndex:true,fontWeight:true,opacity:true,
|
||||
zoom:true,lineHeight:true},cssProps:{"float":c.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,b,d,e){if(!(!a||a.nodeType===3||a.nodeType===8||!a.style)){var f,h=c.camelCase(b),l=a.style,k=c.cssHooks[h];b=c.cssProps[h]||h;if(d!==B){if(!(typeof d==="number"&&isNaN(d)||d==null)){if(typeof d==="number"&&!c.cssNumber[h])d+="px";if(!k||!("set"in k)||(d=k.set(a,d))!==B)try{l[b]=d}catch(o){}}}else{if(k&&"get"in k&&(f=k.get(a,false,e))!==B)return f;return l[b]}}},css:function(a,b,d){var e,f=c.camelCase(b),
|
||||
h=c.cssHooks[f];b=c.cssProps[f]||f;if(h&&"get"in h&&(e=h.get(a,true,d))!==B)return e;else if(W)return W(a,b,f)},swap:function(a,b,d){var e={},f;for(f in b){e[f]=a.style[f];a.style[f]=b[f]}d.call(a);for(f in b)a.style[f]=e[f]},camelCase:function(a){return a.replace(hb,lb)}});c.curCSS=c.css;c.each(["height","width"],function(a,b){c.cssHooks[b]={get:function(d,e,f){var h;if(e){if(d.offsetWidth!==0)h=oa(d,b,f);else c.swap(d,kb,function(){h=oa(d,b,f)});if(h<=0){h=W(d,b,b);if(h==="0px"&&aa)h=aa(d,b,b);
|
||||
if(h!=null)return h===""||h==="auto"?"0px":h}if(h<0||h==null){h=d.style[b];return h===""||h==="auto"?"0px":h}return typeof h==="string"?h:h+"px"}},set:function(d,e){if(Fa.test(e)){e=parseFloat(e);if(e>=0)return e+"px"}else return e}}});if(!c.support.opacity)c.cssHooks.opacity={get:function(a,b){return gb.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var d=a.style;d.zoom=1;var e=c.isNaN(b)?"":"alpha(opacity="+b*100+")",f=
|
||||
d.filter||"";d.filter=Ea.test(f)?f.replace(Ea,e):d.filter+" "+e}};if(t.defaultView&&t.defaultView.getComputedStyle)Ga=function(a,b,d){var e;d=d.replace(ib,"-$1").toLowerCase();if(!(b=a.ownerDocument.defaultView))return B;if(b=b.getComputedStyle(a,null)){e=b.getPropertyValue(d);if(e===""&&!c.contains(a.ownerDocument.documentElement,a))e=c.style(a,d)}return e};if(t.documentElement.currentStyle)aa=function(a,b){var d,e,f=a.currentStyle&&a.currentStyle[b],h=a.style;if(!Fa.test(f)&&jb.test(f)){d=h.left;
|
||||
e=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;h.left=b==="fontSize"?"1em":f||0;f=h.pixelLeft+"px";h.left=d;a.runtimeStyle.left=e}return f===""?"auto":f};W=Ga||aa;if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b=a.offsetHeight;return a.offsetWidth===0&&b===0||!c.support.reliableHiddenOffsets&&(a.style.display||c.css(a,"display"))==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var mb=c.now(),nb=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,
|
||||
ob=/^(?:select|textarea)/i,pb=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,qb=/^(?:GET|HEAD)$/,Ra=/\[\]$/,T=/\=\?(&|$)/,ja=/\?/,rb=/([?&])_=[^&]*/,sb=/^(\w+:)?\/\/([^\/?#]+)/,tb=/%20/g,ub=/#.*$/,Ha=c.fn.load;c.fn.extend({load:function(a,b,d){if(typeof a!=="string"&&Ha)return Ha.apply(this,arguments);else if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var f=a.slice(e,a.length);a=a.slice(0,e)}e="GET";if(b)if(c.isFunction(b)){d=b;b=null}else if(typeof b===
|
||||
"object"){b=c.param(b,c.ajaxSettings.traditional);e="POST"}var h=this;c.ajax({url:a,type:e,dataType:"html",data:b,complete:function(l,k){if(k==="success"||k==="notmodified")h.html(f?c("<div>").append(l.responseText.replace(nb,"")).find(f):l.responseText);d&&h.each(d,[l.responseText,k,l])}});return this},serialize:function(){return c.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this}).filter(function(){return this.name&&
|
||||
!this.disabled&&(this.checked||ob.test(this.nodeName)||pb.test(this.type))}).map(function(a,b){var d=c(this).val();return d==null?null:c.isArray(d)?c.map(d,function(e){return{name:b.name,value:e}}):{name:b.name,value:d}}).get()}});c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){c.fn[b]=function(d){return this.bind(b,d)}});c.extend({get:function(a,b,d,e){if(c.isFunction(b)){e=e||d;d=b;b=null}return c.ajax({type:"GET",url:a,data:b,success:d,dataType:e})},
|
||||
getScript:function(a,b){return c.get(a,null,b,"script")},getJSON:function(a,b,d){return c.get(a,b,d,"json")},post:function(a,b,d,e){if(c.isFunction(b)){e=e||d;d=b;b={}}return c.ajax({type:"POST",url:a,data:b,success:d,dataType:e})},ajaxSetup:function(a){c.extend(c.ajaxSettings,a)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return new E.XMLHttpRequest},accepts:{xml:"application/xml, text/xml",html:"text/html",
|
||||
script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},ajax:function(a){var b=c.extend(true,{},c.ajaxSettings,a),d,e,f,h=b.type.toUpperCase(),l=qb.test(h);b.url=b.url.replace(ub,"");b.context=a&&a.context!=null?a.context:b;if(b.data&&b.processData&&typeof b.data!=="string")b.data=c.param(b.data,b.traditional);if(b.dataType==="jsonp"){if(h==="GET")T.test(b.url)||(b.url+=(ja.test(b.url)?"&":"?")+(b.jsonp||"callback")+"=?");else if(!b.data||
|
||||
!T.test(b.data))b.data=(b.data?b.data+"&":"")+(b.jsonp||"callback")+"=?";b.dataType="json"}if(b.dataType==="json"&&(b.data&&T.test(b.data)||T.test(b.url))){d=b.jsonpCallback||"jsonp"+mb++;if(b.data)b.data=(b.data+"").replace(T,"="+d+"$1");b.url=b.url.replace(T,"="+d+"$1");b.dataType="script";var k=E[d];E[d]=function(m){if(c.isFunction(k))k(m);else{E[d]=B;try{delete E[d]}catch(p){}}f=m;c.handleSuccess(b,w,e,f);c.handleComplete(b,w,e,f);r&&r.removeChild(A)}}if(b.dataType==="script"&&b.cache===null)b.cache=
|
||||
false;if(b.cache===false&&l){var o=c.now(),x=b.url.replace(rb,"$1_="+o);b.url=x+(x===b.url?(ja.test(b.url)?"&":"?")+"_="+o:"")}if(b.data&&l)b.url+=(ja.test(b.url)?"&":"?")+b.data;b.global&&c.active++===0&&c.event.trigger("ajaxStart");o=(o=sb.exec(b.url))&&(o[1]&&o[1].toLowerCase()!==location.protocol||o[2].toLowerCase()!==location.host);if(b.dataType==="script"&&h==="GET"&&o){var r=t.getElementsByTagName("head")[0]||t.documentElement,A=t.createElement("script");if(b.scriptCharset)A.charset=b.scriptCharset;
|
||||
A.src=b.url;if(!d){var C=false;A.onload=A.onreadystatechange=function(){if(!C&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){C=true;c.handleSuccess(b,w,e,f);c.handleComplete(b,w,e,f);A.onload=A.onreadystatechange=null;r&&A.parentNode&&r.removeChild(A)}}}r.insertBefore(A,r.firstChild);return B}var J=false,w=b.xhr();if(w){b.username?w.open(h,b.url,b.async,b.username,b.password):w.open(h,b.url,b.async);try{if(b.data!=null&&!l||a&&a.contentType)w.setRequestHeader("Content-Type",
|
||||
b.contentType);if(b.ifModified){c.lastModified[b.url]&&w.setRequestHeader("If-Modified-Since",c.lastModified[b.url]);c.etag[b.url]&&w.setRequestHeader("If-None-Match",c.etag[b.url])}o||w.setRequestHeader("X-Requested-With","XMLHttpRequest");w.setRequestHeader("Accept",b.dataType&&b.accepts[b.dataType]?b.accepts[b.dataType]+", */*; q=0.01":b.accepts._default)}catch(I){}if(b.beforeSend&&b.beforeSend.call(b.context,w,b)===false){b.global&&c.active--===1&&c.event.trigger("ajaxStop");w.abort();return false}b.global&&
|
||||
c.triggerGlobal(b,"ajaxSend",[w,b]);var L=w.onreadystatechange=function(m){if(!w||w.readyState===0||m==="abort"){J||c.handleComplete(b,w,e,f);J=true;if(w)w.onreadystatechange=c.noop}else if(!J&&w&&(w.readyState===4||m==="timeout")){J=true;w.onreadystatechange=c.noop;e=m==="timeout"?"timeout":!c.httpSuccess(w)?"error":b.ifModified&&c.httpNotModified(w,b.url)?"notmodified":"success";var p;if(e==="success")try{f=c.httpData(w,b.dataType,b)}catch(q){e="parsererror";p=q}if(e==="success"||e==="notmodified")d||
|
||||
c.handleSuccess(b,w,e,f);else c.handleError(b,w,e,p);d||c.handleComplete(b,w,e,f);m==="timeout"&&w.abort();if(b.async)w=null}};try{var g=w.abort;w.abort=function(){w&&Function.prototype.call.call(g,w);L("abort")}}catch(i){}b.async&&b.timeout>0&&setTimeout(function(){w&&!J&&L("timeout")},b.timeout);try{w.send(l||b.data==null?null:b.data)}catch(n){c.handleError(b,w,null,n);c.handleComplete(b,w,e,f)}b.async||L();return w}},param:function(a,b){var d=[],e=function(h,l){l=c.isFunction(l)?l():l;d[d.length]=
|
||||
encodeURIComponent(h)+"="+encodeURIComponent(l)};if(b===B)b=c.ajaxSettings.traditional;if(c.isArray(a)||a.jquery)c.each(a,function(){e(this.name,this.value)});else for(var f in a)da(f,a[f],b,e);return d.join("&").replace(tb,"+")}});c.extend({active:0,lastModified:{},etag:{},handleError:function(a,b,d,e){a.error&&a.error.call(a.context,b,d,e);a.global&&c.triggerGlobal(a,"ajaxError",[b,a,e])},handleSuccess:function(a,b,d,e){a.success&&a.success.call(a.context,e,d,b);a.global&&c.triggerGlobal(a,"ajaxSuccess",
|
||||
[b,a])},handleComplete:function(a,b,d){a.complete&&a.complete.call(a.context,b,d);a.global&&c.triggerGlobal(a,"ajaxComplete",[b,a]);a.global&&c.active--===1&&c.event.trigger("ajaxStop")},triggerGlobal:function(a,b,d){(a.context&&a.context.url==null?c(a.context):c.event).trigger(b,d)},httpSuccess:function(a){try{return!a.status&&location.protocol==="file:"||a.status>=200&&a.status<300||a.status===304||a.status===1223}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"),
|
||||
e=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(e)c.etag[b]=e;return a.status===304},httpData:function(a,b,d){var e=a.getResponseHeader("content-type")||"",f=b==="xml"||!b&&e.indexOf("xml")>=0;a=f?a.responseXML:a.responseText;f&&a.documentElement.nodeName==="parsererror"&&c.error("parsererror");if(d&&d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b==="json"||!b&&e.indexOf("json")>=0)a=c.parseJSON(a);else if(b==="script"||!b&&e.indexOf("javascript")>=0)c.globalEval(a);return a}});
|
||||
if(E.ActiveXObject)c.ajaxSettings.xhr=function(){if(E.location.protocol!=="file:")try{return new E.XMLHttpRequest}catch(a){}try{return new E.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}};c.support.ajax=!!c.ajaxSettings.xhr();var ea={},vb=/^(?:toggle|show|hide)$/,wb=/^([+\-]=)?([\d+.\-]+)(.*)$/,ba,pa=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];c.fn.extend({show:function(a,b,d){if(a||a===0)return this.animate(S("show",
|
||||
3),a,b,d);else{d=0;for(var e=this.length;d<e;d++){a=this[d];b=a.style.display;if(!c.data(a,"olddisplay")&&b==="none")b=a.style.display="";b===""&&c.css(a,"display")==="none"&&c.data(a,"olddisplay",qa(a.nodeName))}for(d=0;d<e;d++){a=this[d];b=a.style.display;if(b===""||b==="none")a.style.display=c.data(a,"olddisplay")||""}return this}},hide:function(a,b,d){if(a||a===0)return this.animate(S("hide",3),a,b,d);else{a=0;for(b=this.length;a<b;a++){d=c.css(this[a],"display");d!=="none"&&c.data(this[a],"olddisplay",
|
||||
d)}for(a=0;a<b;a++)this[a].style.display="none";return this}},_toggle:c.fn.toggle,toggle:function(a,b,d){var e=typeof a==="boolean";if(c.isFunction(a)&&c.isFunction(b))this._toggle.apply(this,arguments);else a==null||e?this.each(function(){var f=e?a:c(this).is(":hidden");c(this)[f?"show":"hide"]()}):this.animate(S("toggle",3),a,b,d);return this},fadeTo:function(a,b,d,e){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,d,e)},animate:function(a,b,d,e){var f=c.speed(b,
|
||||
d,e);if(c.isEmptyObject(a))return this.each(f.complete);return this[f.queue===false?"each":"queue"](function(){var h=c.extend({},f),l,k=this.nodeType===1,o=k&&c(this).is(":hidden"),x=this;for(l in a){var r=c.camelCase(l);if(l!==r){a[r]=a[l];delete a[l];l=r}if(a[l]==="hide"&&o||a[l]==="show"&&!o)return h.complete.call(this);if(k&&(l==="height"||l==="width")){h.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY];if(c.css(this,"display")==="inline"&&c.css(this,"float")==="none")if(c.support.inlineBlockNeedsLayout)if(qa(this.nodeName)===
|
||||
"inline")this.style.display="inline-block";else{this.style.display="inline";this.style.zoom=1}else this.style.display="inline-block"}if(c.isArray(a[l])){(h.specialEasing=h.specialEasing||{})[l]=a[l][1];a[l]=a[l][0]}}if(h.overflow!=null)this.style.overflow="hidden";h.curAnim=c.extend({},a);c.each(a,function(A,C){var J=new c.fx(x,h,A);if(vb.test(C))J[C==="toggle"?o?"show":"hide":C](a);else{var w=wb.exec(C),I=J.cur()||0;if(w){var L=parseFloat(w[2]),g=w[3]||"px";if(g!=="px"){c.style(x,A,(L||1)+g);I=(L||
|
||||
1)/J.cur()*I;c.style(x,A,I+g)}if(w[1])L=(w[1]==="-="?-1:1)*L+I;J.custom(I,L,g)}else J.custom(I,C,"")}});return true})},stop:function(a,b){var d=c.timers;a&&this.queue([]);this.each(function(){for(var e=d.length-1;e>=0;e--)if(d[e].elem===this){b&&d[e](true);d.splice(e,1)}});b||this.dequeue();return this}});c.each({slideDown:S("show",1),slideUp:S("hide",1),slideToggle:S("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){c.fn[a]=function(d,e,f){return this.animate(b,
|
||||
d,e,f)}});c.extend({speed:function(a,b,d){var e=a&&typeof a==="object"?c.extend({},a):{complete:d||!d&&b||c.isFunction(a)&&a,duration:a,easing:d&&b||b&&!c.isFunction(b)&&b};e.duration=c.fx.off?0:typeof e.duration==="number"?e.duration:e.duration in c.fx.speeds?c.fx.speeds[e.duration]:c.fx.speeds._default;e.old=e.complete;e.complete=function(){e.queue!==false&&c(this).dequeue();c.isFunction(e.old)&&e.old.call(this)};return e},easing:{linear:function(a,b,d,e){return d+e*a},swing:function(a,b,d,e){return(-Math.cos(a*
|
||||
Math.PI)/2+0.5)*e+d}},timers:[],fx:function(a,b,d){this.options=b;this.elem=a;this.prop=d;if(!b.orig)b.orig={}}});c.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(c.fx.step[this.prop]||c.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a=parseFloat(c.css(this.elem,this.prop));return a&&a>-1E4?a:0},custom:function(a,b,d){function e(l){return f.step(l)}
|
||||
var f=this,h=c.fx;this.startTime=c.now();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start;this.pos=this.state=0;e.elem=this.elem;if(e()&&c.timers.push(e)&&!ba)ba=setInterval(h.tick,h.interval)},show:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());c(this.elem).show()},hide:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.hide=true;
|
||||
this.custom(this.cur(),0)},step:function(a){var b=c.now(),d=true;if(a||b>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var e in this.options.curAnim)if(this.options.curAnim[e]!==true)d=false;if(d){if(this.options.overflow!=null&&!c.support.shrinkWrapBlocks){var f=this.elem,h=this.options;c.each(["","X","Y"],function(k,o){f.style["overflow"+o]=h.overflow[k]})}this.options.hide&&c(this.elem).hide();if(this.options.hide||
|
||||
this.options.show)for(var l in this.options.curAnim)c.style(this.elem,l,this.options.orig[l]);this.options.complete.call(this.elem)}return false}else{a=b-this.startTime;this.state=a/this.options.duration;b=this.options.easing||(c.easing.swing?"swing":"linear");this.pos=c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||b](this.state,a,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};c.extend(c.fx,{tick:function(){for(var a=
|
||||
c.timers,b=0;b<a.length;b++)a[b]()||a.splice(b--,1);a.length||c.fx.stop()},interval:13,stop:function(){clearInterval(ba);ba=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){c.style(a.elem,"opacity",a.now)},_default:function(a){if(a.elem.style&&a.elem.style[a.prop]!=null)a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit;else a.elem[a.prop]=a.now}}});if(c.expr&&c.expr.filters)c.expr.filters.animated=function(a){return c.grep(c.timers,function(b){return a===
|
||||
b.elem}).length};var xb=/^t(?:able|d|h)$/i,Ia=/^(?:body|html)$/i;c.fn.offset="getBoundingClientRect"in t.documentElement?function(a){var b=this[0],d;if(a)return this.each(function(l){c.offset.setOffset(this,a,l)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);try{d=b.getBoundingClientRect()}catch(e){}var f=b.ownerDocument,h=f.documentElement;if(!d||!c.contains(h,b))return d||{top:0,left:0};b=f.body;f=fa(f);return{top:d.top+(f.pageYOffset||c.support.boxModel&&
|
||||
h.scrollTop||b.scrollTop)-(h.clientTop||b.clientTop||0),left:d.left+(f.pageXOffset||c.support.boxModel&&h.scrollLeft||b.scrollLeft)-(h.clientLeft||b.clientLeft||0)}}:function(a){var b=this[0];if(a)return this.each(function(x){c.offset.setOffset(this,a,x)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);c.offset.initialize();var d,e=b.offsetParent,f=b.ownerDocument,h=f.documentElement,l=f.body;d=(f=f.defaultView)?f.getComputedStyle(b,null):b.currentStyle;
|
||||
for(var k=b.offsetTop,o=b.offsetLeft;(b=b.parentNode)&&b!==l&&b!==h;){if(c.offset.supportsFixedPosition&&d.position==="fixed")break;d=f?f.getComputedStyle(b,null):b.currentStyle;k-=b.scrollTop;o-=b.scrollLeft;if(b===e){k+=b.offsetTop;o+=b.offsetLeft;if(c.offset.doesNotAddBorder&&!(c.offset.doesAddBorderForTableAndCells&&xb.test(b.nodeName))){k+=parseFloat(d.borderTopWidth)||0;o+=parseFloat(d.borderLeftWidth)||0}e=b.offsetParent}if(c.offset.subtractsBorderForOverflowNotVisible&&d.overflow!=="visible"){k+=
|
||||
parseFloat(d.borderTopWidth)||0;o+=parseFloat(d.borderLeftWidth)||0}d=d}if(d.position==="relative"||d.position==="static"){k+=l.offsetTop;o+=l.offsetLeft}if(c.offset.supportsFixedPosition&&d.position==="fixed"){k+=Math.max(h.scrollTop,l.scrollTop);o+=Math.max(h.scrollLeft,l.scrollLeft)}return{top:k,left:o}};c.offset={initialize:function(){var a=t.body,b=t.createElement("div"),d,e,f,h=parseFloat(c.css(a,"marginTop"))||0;c.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",
|
||||
height:"1px",visibility:"hidden"});b.innerHTML="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";a.insertBefore(b,a.firstChild);d=b.firstChild;e=d.firstChild;f=d.nextSibling.firstChild.firstChild;this.doesNotAddBorder=e.offsetTop!==5;this.doesAddBorderForTableAndCells=
|
||||
f.offsetTop===5;e.style.position="fixed";e.style.top="20px";this.supportsFixedPosition=e.offsetTop===20||e.offsetTop===15;e.style.position=e.style.top="";d.style.overflow="hidden";d.style.position="relative";this.subtractsBorderForOverflowNotVisible=e.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==h;a.removeChild(b);c.offset.initialize=c.noop},bodyOffset:function(a){var b=a.offsetTop,d=a.offsetLeft;c.offset.initialize();if(c.offset.doesNotIncludeMarginInBodyOffset){b+=parseFloat(c.css(a,
|
||||
"marginTop"))||0;d+=parseFloat(c.css(a,"marginLeft"))||0}return{top:b,left:d}},setOffset:function(a,b,d){var e=c.css(a,"position");if(e==="static")a.style.position="relative";var f=c(a),h=f.offset(),l=c.css(a,"top"),k=c.css(a,"left"),o=e==="absolute"&&c.inArray("auto",[l,k])>-1;e={};var x={};if(o)x=f.position();l=o?x.top:parseInt(l,10)||0;k=o?x.left:parseInt(k,10)||0;if(c.isFunction(b))b=b.call(a,d,h);if(b.top!=null)e.top=b.top-h.top+l;if(b.left!=null)e.left=b.left-h.left+k;"using"in b?b.using.call(a,
|
||||
e):f.css(e)}};c.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),d=this.offset(),e=Ia.test(b[0].nodeName)?{top:0,left:0}:b.offset();d.top-=parseFloat(c.css(a,"marginTop"))||0;d.left-=parseFloat(c.css(a,"marginLeft"))||0;e.top+=parseFloat(c.css(b[0],"borderTopWidth"))||0;e.left+=parseFloat(c.css(b[0],"borderLeftWidth"))||0;return{top:d.top-e.top,left:d.left-e.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||t.body;a&&!Ia.test(a.nodeName)&&
|
||||
c.css(a,"position")==="static";)a=a.offsetParent;return a})}});c.each(["Left","Top"],function(a,b){var d="scroll"+b;c.fn[d]=function(e){var f=this[0],h;if(!f)return null;if(e!==B)return this.each(function(){if(h=fa(this))h.scrollTo(!a?e:c(h).scrollLeft(),a?e:c(h).scrollTop());else this[d]=e});else return(h=fa(f))?"pageXOffset"in h?h[a?"pageYOffset":"pageXOffset"]:c.support.boxModel&&h.document.documentElement[d]||h.document.body[d]:f[d]}});c.each(["Height","Width"],function(a,b){var d=b.toLowerCase();
|
||||
c.fn["inner"+b]=function(){return this[0]?parseFloat(c.css(this[0],d,"padding")):null};c.fn["outer"+b]=function(e){return this[0]?parseFloat(c.css(this[0],d,e?"margin":"border")):null};c.fn[d]=function(e){var f=this[0];if(!f)return e==null?null:this;if(c.isFunction(e))return this.each(function(l){var k=c(this);k[d](e.call(this,l,k[d]()))});if(c.isWindow(f))return f.document.compatMode==="CSS1Compat"&&f.document.documentElement["client"+b]||f.document.body["client"+b];else if(f.nodeType===9)return Math.max(f.documentElement["client"+
|
||||
b],f.body["scroll"+b],f.documentElement["scroll"+b],f.body["offset"+b],f.documentElement["offset"+b]);else if(e===B){f=c.css(f,d);var h=parseFloat(f);return c.isNaN(h)?f:h}else return this.css(d,typeof e==="string"?e:e+"px")}})})(window);
|
||||
@@ -1336,6 +1336,14 @@
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Resize map
|
||||
**/
|
||||
this.resize = function()
|
||||
{
|
||||
google.maps.event.trigger(this.getMap(), 'resize');
|
||||
}
|
||||
|
||||
/**
|
||||
* add markers (without address resolution)
|
||||
**/
|
||||
|
||||
@@ -511,6 +511,8 @@ function PS_MRDisplayRelayPoint(json, blockContent, carrier_id)
|
||||
{
|
||||
numberDisplayed = 0;
|
||||
|
||||
// Disable Gmap for IE user
|
||||
if (!$.browser.msie)
|
||||
PS_MRCreateGmap(carrier_id);
|
||||
blockContent.fadeOut('fast', function()
|
||||
{
|
||||
@@ -541,7 +543,13 @@ function PS_MRDisplayRelayPoint(json, blockContent, carrier_id)
|
||||
// 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
|
||||
$('#' + contentBlockid).children('p').click(function() {
|
||||
PS_MROpenPopupDetail(json.success[relayPoint].permaLinkDetail);
|
||||
});
|
||||
}
|
||||
}
|
||||
PS_MRHandleSelectedRelayPoint();
|
||||
@@ -684,6 +692,9 @@ function PS_MRGmapPlaceViewOnMarker($map, marker, relayNum)
|
||||
callback: function()
|
||||
{
|
||||
PS_MRDisplayClickedGmapWindow(marker, relayNum, $map);
|
||||
|
||||
// Make dancing markers in Firefox will use the CPU to 100 %
|
||||
if (!$.browser.mozilla)
|
||||
(function(m)
|
||||
{
|
||||
setTimeout(function()
|
||||
|
||||
@@ -59,7 +59,7 @@ class MondialRelay extends Module
|
||||
{
|
||||
$this->name = 'mondialrelay';
|
||||
$this->tab = 'shipping_logistics';
|
||||
$this->version = '1.7.8';
|
||||
$this->version = '1.7.9';
|
||||
|
||||
parent::__construct();
|
||||
|
||||
@@ -114,20 +114,20 @@ class MondialRelay extends Module
|
||||
{
|
||||
// AdminOrders id_tab
|
||||
$id_parent = 3;
|
||||
|
||||
|
||||
/*tab install */
|
||||
$result = Db::getInstance()->getRow('
|
||||
SELECT position
|
||||
FROM `' . _DB_PREFIX_ . 'tab`
|
||||
SELECT position
|
||||
FROM `' . _DB_PREFIX_ . 'tab`
|
||||
WHERE `id_parent` = '.(int)$id_parent.'
|
||||
ORDER BY `'. _DB_PREFIX_ .'tab`.`position` DESC');
|
||||
|
||||
$pos = (isset($result['position'])) ? $result['position'] + 1 : 0;
|
||||
|
||||
Db::getInstance()->execute('
|
||||
INSERT INTO ' . _DB_PREFIX_ . 'tab
|
||||
(id_parent, class_name, position, module)
|
||||
VALUES('.(int)$id_parent.', "AdminMondialRelay", "'.(int)($pos).'", "mondialrelay")');
|
||||
INSERT INTO ' . _DB_PREFIX_ . 'tab
|
||||
(id_parent, class_name, position, module)
|
||||
VALUES('.(int)$id_parent.', "AdminMondialRelay", "'.(int)($pos).'", "mondialrelay")');
|
||||
|
||||
$id_tab = Db::getInstance()->Insert_ID();
|
||||
|
||||
@@ -200,7 +200,8 @@ class MondialRelay extends Module
|
||||
if (_PS_VERSION_ >= '1.4' &&
|
||||
(!$this->registerHook('processCarrier') ||
|
||||
!$this->registerHook('orderDetail') ||
|
||||
!$this->registerHook('orderDetailDisplayed')))
|
||||
!$this->registerHook('orderDetailDisplayed') ||
|
||||
!$this->registerHook('paymentTop')))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
@@ -316,15 +317,15 @@ class MondialRelay extends Module
|
||||
private function _update_v1_4()
|
||||
{
|
||||
Db::getInstance()->execute('
|
||||
UPDATE `'._DB_PREFIX_.'carrier`
|
||||
SET
|
||||
`shipping_external` = 0,
|
||||
`need_range` = 1,
|
||||
`external_module_name` =
|
||||
"mondialrelay",
|
||||
`shipping_method` = 1
|
||||
WHERE `id_carrier`
|
||||
IN (SELECT `id_carrier`
|
||||
UPDATE `'._DB_PREFIX_.'carrier`
|
||||
SET
|
||||
`shipping_external` = 0,
|
||||
`need_range` = 1,
|
||||
`external_module_name` =
|
||||
"mondialrelay",
|
||||
`shipping_method` = 1
|
||||
WHERE `id_carrier`
|
||||
IN (SELECT `id_carrier`
|
||||
FROM `'._DB_PREFIX_.'mr_method`)');
|
||||
}
|
||||
|
||||
@@ -384,7 +385,7 @@ class MondialRelay extends Module
|
||||
$protocol = (Configuration::get('PS_SSL_ENABLED') || (!empty($_SERVER['HTTPS'])
|
||||
&& strtolower($_SERVER['HTTPS']) != 'off')) ? 'https://' : 'http://';
|
||||
|
||||
$endURL = __PS_BASE_URI__.'/modules/mondialrelay/';
|
||||
$endURL = __PS_BASE_URI__.'modules/mondialrelay/';
|
||||
|
||||
if (method_exists('Tools', 'getShopDomainSsl'))
|
||||
self::$moduleURL = $protocol.Tools::getShopDomainSsl().$endURL;
|
||||
@@ -402,12 +403,12 @@ class MondialRelay extends Module
|
||||
if ($overloadCurrent)
|
||||
return '
|
||||
<script type="text/javascript">
|
||||
currentJquery = jQuery.noConflict(true);
|
||||
currentJquery = jQuery.noConflict(true);
|
||||
</script>
|
||||
<script type="text/javascript" src="'.self::$moduleURL.'/js/jquery-1.6.4.min.js"></script>';
|
||||
<script type="text/javascript" src="'.self::$moduleURL.'js/jquery-1.6.4.min.js"></script>';
|
||||
|
||||
return '
|
||||
<script type="text/javascript" src="'.self::$moduleURL.'/js/jquery-1.6.4.min.js"></script>
|
||||
<script type="text/javascript" src="'.self::$moduleURL.'js/jquery-1.6.4.min.js"></script>
|
||||
<script type="text/javascript">
|
||||
MRjQuery = jQuery.noConflict(true);
|
||||
</script>';
|
||||
@@ -417,8 +418,8 @@ class MondialRelay extends Module
|
||||
{
|
||||
DB::getInstance()->execute('
|
||||
UPDATE `'._DB_PREFIX_.'mr_selected`
|
||||
SET `id_order` = '.$params['order']->id.'
|
||||
WHERE `id_cart` = '.$params['cart']->id);
|
||||
SET `id_order` = '.(int)$params['order']->id.'
|
||||
WHERE `id_cart` = '.(int)$params['cart']->id);
|
||||
}
|
||||
|
||||
public function hookBackOfficeHeader()
|
||||
@@ -426,16 +427,17 @@ class MondialRelay extends Module
|
||||
$cssFilePath = $this->_path.'style.css';
|
||||
$jsFilePath= $this->_path.'mondialrelay.js';
|
||||
|
||||
$ret = '';
|
||||
$ret = '<script type="text/javascript" src="'.$jsFilePath.'"></script>';
|
||||
if (Tools::getValue('tab') == 'AdminMondialRelay')
|
||||
$ret = '
|
||||
$ret .= self::getJqueryCompatibility(true);
|
||||
|
||||
$ret .= '
|
||||
<link type="text/css" rel="stylesheet" href="'.$cssFilePath.'" />
|
||||
<script type="text/javascript">
|
||||
var _PS_MR_MODULE_DIR_ = "'.self::$moduleURL.'";
|
||||
var mrtoken = "'.self::$MRBackToken.'";
|
||||
</script>
|
||||
<script type="text/javascript" src="'.$jsFilePath.'"></script>'.
|
||||
self::getJqueryCompatibility(true);
|
||||
</script>';
|
||||
return $ret;
|
||||
return $ret;
|
||||
}
|
||||
|
||||
@@ -477,13 +479,14 @@ class MondialRelay extends Module
|
||||
if (!Validate::isUnsignedInt(Tools::getValue('id_order_state')))
|
||||
$this->_postErrors[] = $this->l('Invalid order state');
|
||||
}
|
||||
/*
|
||||
else if (Tools::isSubmit('PS_MRSubmitFieldPersonalization'))
|
||||
{
|
||||
$addr1 = Tools::getValue('Expe_ad1');
|
||||
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()
|
||||
{
|
||||
@@ -530,12 +533,13 @@ class MondialRelay extends Module
|
||||
public function hookOrderDetailDisplayed($params)
|
||||
{
|
||||
$res = Db::getInstance()->getRow('
|
||||
SELECT s.`MR_Selected_LgAdr1`, s.`MR_Selected_LgAdr2`, s.`MR_Selected_LgAdr3`, s.`MR_Selected_LgAdr4`, s.`MR_Selected_CP`, s.`MR_Selected_Ville`, s.`MR_Selected_Pays`, s.`MR_Selected_Num`
|
||||
SELECT s.`MR_Selected_LgAdr1`, s.`MR_Selected_LgAdr2`, s.`MR_Selected_LgAdr3`, s.`MR_Selected_LgAdr4`, s.`MR_Selected_CP`, s.`MR_Selected_Ville`, s.`MR_Selected_Pays`, s.`MR_Selected_Num`, s.`url_suivi`
|
||||
FROM `'._DB_PREFIX_.'mr_selected` s
|
||||
WHERE s.`id_cart` = '.$params['order']->id_cart);
|
||||
if ((!$res) OR ($res['MR_Selected_Num'] == 'LD1') OR ($res['MR_Selected_Num'] == 'LDS'))
|
||||
return '';
|
||||
$this->context->smarty->assign('mr_addr', $res['MR_Selected_LgAdr1'].($res['MR_Selected_LgAdr1'] ? ' - ' : '').$res['MR_Selected_LgAdr2'].($res['MR_Selected_LgAdr2'] ? ' - ' : '').$res['MR_Selected_LgAdr3'].($res['MR_Selected_LgAdr3'] ? ' - ' : '').$res['MR_Selected_LgAdr4'].($res['MR_Selected_LgAdr4'] ? ' - ' : '').$res['MR_Selected_CP'].' '.$res['MR_Selected_Ville'].' - '.$res['MR_Selected_Pays']);
|
||||
$smarty->assign('mr_url', $res['url_suivi']);
|
||||
return $this->display(__FILE__, 'orderDetail.tpl');
|
||||
}
|
||||
|
||||
@@ -548,7 +552,7 @@ class MondialRelay extends Module
|
||||
|
||||
/*
|
||||
** Update the carrier id to use the new one if changed
|
||||
*/
|
||||
*/
|
||||
public function hookupdateCarrier($params)
|
||||
{
|
||||
if ((int)($params['id_carrier']) != (int)($params['carrier']->id))
|
||||
@@ -557,14 +561,14 @@ class MondialRelay extends Module
|
||||
INSERT INTO `'._DB_PREFIX_.'mr_method`
|
||||
(mr_Name, mr_Pays_list, mr_ModeCol, mr_ModeLiv, mr_ModeAss, id_carrier)
|
||||
(
|
||||
SELECT
|
||||
mr_Name,
|
||||
mr_Pays_list,
|
||||
mr_ModeCol,
|
||||
mr_ModeLiv,
|
||||
mr_ModeAss,
|
||||
"'.(int)$params['carrier']->id.'"
|
||||
FROM `'._DB_PREFIX_.'mr_method`
|
||||
SELECT
|
||||
mr_Name,
|
||||
mr_Pays_list,
|
||||
mr_ModeCol,
|
||||
mr_ModeLiv,
|
||||
mr_ModeAss,
|
||||
"'.(int)$params['carrier']->id.'"
|
||||
FROM `'._DB_PREFIX_.'mr_method`
|
||||
WHERE id_carrier ='.(int)$params['id_carrier'].')');
|
||||
}
|
||||
}
|
||||
@@ -606,9 +610,8 @@ class MondialRelay extends Module
|
||||
Configuration::get('MR_LANGUAGE') == '')
|
||||
return '';
|
||||
|
||||
$address = new Address((int)($this->context->cart->id_address_delivery));
|
||||
$address = new Address($this->context->cart->id_address_delivery);
|
||||
$id_zone = Address::getZoneById((int)($address->id));
|
||||
//$country = new Country((int)($address->id_country));
|
||||
$carriersList = self::_getCarriers();
|
||||
|
||||
// Check if the defined carrier are ok
|
||||
@@ -629,18 +632,19 @@ class MondialRelay extends Module
|
||||
unset($carriersList[$k]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$preSelectedRelay = $this->getRelayPointSelected($params['cart']->id);
|
||||
$this->context->smarty->assign( array(
|
||||
$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,
|
||||
'carriersextra' => $carriersList,
|
||||
'preSelectedRelay' => isset($preSelectedRelay['MR_selected_num']) ? $preSelectedRelay['MR_selected_num'] : '',
|
||||
'jQueryOverload' => self::getJqueryCompatibility()));
|
||||
'jQueryOverload' => self::getJqueryCompatibility(false)
|
||||
));
|
||||
|
||||
return $this->display(__FILE__, 'mondialrelay.tpl');
|
||||
}
|
||||
return $this->display(__FILE__, 'mondialrelay.tpl');
|
||||
}
|
||||
|
||||
public function getContent()
|
||||
{
|
||||
@@ -666,10 +670,17 @@ class MondialRelay extends Module
|
||||
self::mrDelete((int)($_GET['delete_mr']));
|
||||
|
||||
$this->_html .= '<h2>'.$this->l('Configure Mondial Relay Rate Module').'</h2>
|
||||
|
||||
<div class="MR_warn">'.
|
||||
$this->l('Try to turn off the cache and put the force compilation to on if you have any problems with the module after an update').'
|
||||
|
||||
<div class="MR_warn">
|
||||
<a style="color:#383838;text-decoration:underline" href="index.php?tab=AdminPerformance&token='.Tools::getAdminToken('AdminPerformance'.(int)(Tab::getIdFromClassName('AdminPerformance')).(int)($cookie->id_employee)).'">
|
||||
'.$this->l('Try to turn off the cache and put the force compilation to on').'
|
||||
</a> '.$this->l('if you have any problems with the module after an update').'.
|
||||
</div>
|
||||
<div class="MR_hint">
|
||||
'.$this->l('Have a look to the following HOW-TO to help you to configure the Mondial Relay module').'
|
||||
<b><a href="'.self::$moduleURL.'/docs/install.pdf"><img width="20" src="'.self::$moduleURL.'images/pdf_icon.jpg" /></a></b>
|
||||
</div>
|
||||
<br />
|
||||
<fieldset>
|
||||
<legend>
|
||||
<img src="../modules/mondialrelay/images/logo.gif" />'.$this->l('To create a Mondial Relay carrier').
|
||||
@@ -1165,14 +1176,14 @@ class MondialRelay extends Module
|
||||
LEFT JOIN `'._DB_PREFIX_.'mr_selected` mrs
|
||||
ON (mrs.`id_cart` = o.`id_cart`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'mr_method` mr
|
||||
ON (mr.`id_carrier` = ca.`id_carrier`)
|
||||
ON (mr.`id_mr_method` = mrs.`id_method`)
|
||||
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);
|
||||
}
|
||||
|
||||
public static function ordersSQLQuery1_3($id_order_state)
|
||||
@@ -1190,19 +1201,19 @@ class MondialRelay extends Module
|
||||
mrs.`MR_Selected_Pays` as MR_Selected_Pays, mrs.`exp_number` as exp_number,
|
||||
mr.`mr_ModeCol` as mr_ModeCol, mr.`mr_ModeLiv` as mr_ModeLiv, mr.`mr_ModeAss` as mr_ModeAss
|
||||
FROM `'._DB_PREFIX_.'orders` o
|
||||
LEFT JOIN `'._DB_PREFIX_.'carrier` ca
|
||||
LEFT JOIN `'._DB_PREFIX_.'carrier` ca
|
||||
ON (ca.`id_carrier` = o.`id_carrier`
|
||||
AND ca.`name` = "mondialrelay")
|
||||
LEFT JOIN `'._DB_PREFIX_.'mr_selected` mrs
|
||||
LEFT JOIN `'._DB_PREFIX_.'mr_selected` mrs
|
||||
ON (mrs.`id_cart` = o.`id_cart`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'mr_method` mr
|
||||
ON (mr.`id_carrier` = ca.`id_carrier`)
|
||||
ON (mr.`id_mr_method` = mrs.`id_method`)
|
||||
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`
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -1248,7 +1259,7 @@ class MondialRelay extends Module
|
||||
return $statCode[$code];
|
||||
return $this->l('This error isn\'t referred : ') . $code;
|
||||
}
|
||||
|
||||
|
||||
public function getRelayPointSelected($id_cart)
|
||||
{
|
||||
return Db::getInstance()->getRow('
|
||||
@@ -1256,7 +1267,7 @@ class MondialRelay extends Module
|
||||
FROM `'._DB_PREFIX_.'mr_selected` s
|
||||
WHERE s.`id_cart` = '.(int)$id_cart);
|
||||
}
|
||||
|
||||
|
||||
public function isMondialRelayCarrier($id_carrier)
|
||||
{
|
||||
return Db::getInstance()->getRow('
|
||||
@@ -1264,11 +1275,11 @@ class MondialRelay extends Module
|
||||
FROM `'._DB_PREFIX_.'mr_method`
|
||||
WHERE `id_carrier` = '.(int)$id_carrier);
|
||||
}
|
||||
|
||||
|
||||
public function hookpaymentTop($params)
|
||||
{
|
||||
if ($this->isMondialRelayCarrier($params['cart']->id_carrier) &&
|
||||
!$this->getRelayPointSelected($params['cart']->id))
|
||||
if ($this->isMondialRelayCarrier($params['cart']->id_carrier) &&
|
||||
!$this->getRelayPointSelected($params['cart']->id))
|
||||
$params['cart']->id_carrier = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{*
|
||||
* 2007-2011 PrestaShop
|
||||
* 2007-2011 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
@@ -26,18 +26,17 @@
|
||||
|
||||
{$jQueryOverload}
|
||||
|
||||
<link href="{$new_base_dir}/style.css" rel="stylesheet" type="text/css" media="all" />
|
||||
|
||||
<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 && (isset($opc) && $opc)) ? 1 : 0};
|
||||
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'}";
|
||||
@@ -51,9 +50,9 @@
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
$(document).ready(function()
|
||||
$(document).ready(function()
|
||||
{literal}{{/literal}
|
||||
// Bind id_carrierX to an ajax call
|
||||
// Bind id_carrierX to an ajax call
|
||||
{foreach from=$carriersextra item=carrier name=myLoop}
|
||||
$('#id_carrier' + {$carrier.id_carrier}).click(function()
|
||||
{literal}{{/literal}
|
||||
@@ -74,4 +73,3 @@
|
||||
{literal}}{/literal})
|
||||
{literal}}{/literal});
|
||||
</script>
|
||||
|
||||
|
||||
@@ -23,7 +23,9 @@
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*}
|
||||
|
||||
{if $mr_addr}
|
||||
<p id="dateofdelivery"><b>{l s='Delivery to' mod='mondialrelay'}</b> {$mr_addr}</p>
|
||||
{if $mr_url}
|
||||
<a href="{$mr_url}" target="_blank">{l s='Follow my package on Mondial Relay website' mod='mondialrelay'}.</a>
|
||||
{/if}
|
||||
{/if}
|
||||
|
||||
@@ -294,10 +294,6 @@ a.PS_MRSelectRelayPointButton:hover
|
||||
background:url(images/selectRelayPoint.png) no-repeat 0px -25px;
|
||||
}
|
||||
|
||||
.PS_MRGmapDefaultPosition
|
||||
{
|
||||
}
|
||||
|
||||
.PS_MRGmapDefaultPosition
|
||||
{
|
||||
display:none;
|
||||
@@ -340,3 +336,39 @@ div#PS_MRPersonalizedFields
|
||||
.MR_date tr.p {background-color:#e9e9e9; height:9px;}
|
||||
.MR_date td.g {font-weight:bold;}
|
||||
.MR_date td.d {}
|
||||
|
||||
/* 1.3 compatibility*/
|
||||
.MR_warn
|
||||
{
|
||||
border: 1px solid #D3C200;
|
||||
background-color: #FFFAC6;
|
||||
color: #383838;
|
||||
font-weight: 700;
|
||||
margin: 0 0 10px 0;
|
||||
line-height: 20px;
|
||||
padding: 10px 15px;
|
||||
}
|
||||
|
||||
/* 1.3 compatibility*/
|
||||
.MR_error
|
||||
{
|
||||
border: 1px solid #EC9B9B;
|
||||
background-color: #FAE2E3;
|
||||
color: #383838;
|
||||
font-weight: 700;
|
||||
margin: 0 0 10px 0;
|
||||
line-height: 20px;
|
||||
padding: 10px 15px;
|
||||
}
|
||||
|
||||
/* 1.3 - 1.4 compatibility*/
|
||||
.MR_hint
|
||||
{
|
||||
margin-top: 4px;
|
||||
margin-bottom: 2px;
|
||||
border: 1px solid #268CCD;
|
||||
padding: 8px 6px 8px 34px;
|
||||
color: #383838;
|
||||
background: #F1F9FF url(images/help.png) no-repeat 6px 5px;
|
||||
border-radius: 3px;
|
||||
}
|
||||
@@ -17,13 +17,13 @@ $_MODULE['<{moneybookers}prestashop>moneybookers_fa214007826415a21a8456e3e09f999
|
||||
$_MODULE['<{moneybookers}prestashop>moneybookers_088b74050a381d98fca38d5990b097be'] = 'Sie nutzen zur Zeit die Standard-E-Mail-Adresse von Moneybookers, Sie müssen Ihre eigene E-Mail-Adresse verwenden';
|
||||
$_MODULE['<{moneybookers}prestashop>moneybookers_7593ded970377fe25371c952eb944770'] = 'Kann Inhalt holen';
|
||||
$_MODULE['<{moneybookers}prestashop>moneybookers_b863542eebcb27fa230b647b5dd07819'] = 'Konto-Bestätigung fehlgeschlagen, Ihre E-Mail könnte falsch sein';
|
||||
$_MODULE['<{moneybookers}prestashop>moneybookers_d70c5b5767846906e0abe68498db887b'] = 'E-Mail-Aktivierung erfolgreich, Sie können nun Ihr Kennwort bestâtigen';
|
||||
$_MODULE['<{moneybookers}prestashop>moneybookers_d70c5b5767846906e0abe68498db887b'] = 'E-Mail-Aktivierung erfolgreich, Sie können nun Ihr Geheimwort bestâtigen';
|
||||
$_MODULE['<{moneybookers}prestashop>moneybookers_87ef564ed1574eda7e77b4012eef0b85'] = 'Unmöglich,den Aktivierungs-Server zu kontaktieren, bitte versuchen Sie es später';
|
||||
$_MODULE['<{moneybookers}prestashop>moneybookers_7757ea03f2a0893e36c7916a2ad07ef8'] = 'Das E-Mail-Feld ist erforderlich';
|
||||
$_MODULE['<{moneybookers}prestashop>moneybookers_aa1c444c2ee2f620d5b349fedfa68ba2'] = 'Kennwortbestätigung fehlgeschlagen, max. Versuchszahl überschritten (3 pro Stunde)';
|
||||
$_MODULE['<{moneybookers}prestashop>moneybookers_cdbef58d093e0ff38e13686a669e9fee'] = 'Kennwortbestätigung fehlgeschlagen, Ihr Kennwort könnte falsch sein';
|
||||
$_MODULE['<{moneybookers}prestashop>moneybookers_cd1dfa342c3c11c17ede212e6429ca01'] = 'Kontoaktivierung erfolgreich, Kennwort ok';
|
||||
$_MODULE['<{moneybookers}prestashop>moneybookers_2e531f9ad978a2a1a88a00ae0d4dc78e'] = 'Das Kennwortfeld ist erforderlich';
|
||||
$_MODULE['<{moneybookers}prestashop>moneybookers_aa1c444c2ee2f620d5b349fedfa68ba2'] = 'Geheimwortbestätigung fehlgeschlagen, max. Versuchszahl überschritten (3 pro Stunde)';
|
||||
$_MODULE['<{moneybookers}prestashop>moneybookers_cdbef58d093e0ff38e13686a669e9fee'] = 'Geheimwortbestätigung fehlgeschlagen, Ihr Geheimwort könnte falsch sein';
|
||||
$_MODULE['<{moneybookers}prestashop>moneybookers_cd1dfa342c3c11c17ede212e6429ca01'] = 'Kontoaktivierung erfolgreich, Geheimwort ok';
|
||||
$_MODULE['<{moneybookers}prestashop>moneybookers_2e531f9ad978a2a1a88a00ae0d4dc78e'] = 'Das Geheimwortfeld ist erforderlich';
|
||||
$_MODULE['<{moneybookers}prestashop>moneybookers_bcfaccebf745acfd5e75351095a5394a'] = 'Disable';
|
||||
$_MODULE['<{moneybookers}prestashop>moneybookers_e4abb55720e3790fe55982fec858d213'] = 'Linke Spalte';
|
||||
$_MODULE['<{moneybookers}prestashop>moneybookers_f16072c370ef52db2e329a87b5e7177a'] = 'Rechte Spalte';
|
||||
@@ -62,12 +62,12 @@ $_MODULE['<{moneybookers}prestashop>moneybookers_71b5b9efebe9c2f73fad6dd1849b431
|
||||
$_MODULE['<{moneybookers}prestashop>moneybookers_ece6bf0de28bb0442df6e3a1fd7657d4'] = 'Wenn Sie Hilfe benötigen, lesen Sie das Aktivierungshandbuch';
|
||||
$_MODULE['<{moneybookers}prestashop>moneybookers_32e70e9f3def9ebdcdbc872b739b919f'] = 'Sie können Moneybookers paiement mit dem Test-Account testaccount2@moneybookers.com und das geheime Wort MBTest testen.';
|
||||
$_MODULE['<{moneybookers}prestashop>moneybookers_f5944cfc42cfb20119407c59a97bd9d1'] = 'Vorsicht, dies ist nur ein Test-Account: Sie erhalten keine Geld, wenn Sie diesen Test-Account auf Ihrem Shop zu nutzen. So empfangen Sie Geld, müssen Sie den Login und das Passwort Ihrer persönlichen Moneybookers-Konto zu verwenden!';
|
||||
$_MODULE['<{moneybookers}prestashop>moneybookers_0b65457508cf73c9ed8c96f56b8910ce'] = 'Kennwortbestätigung';
|
||||
$_MODULE['<{moneybookers}prestashop>moneybookers_e44efbda9396a5641d730f0ac4866e52'] = 'Ihr Kennwort wurde aktiviert';
|
||||
$_MODULE['<{moneybookers}prestashop>moneybookers_0b65457508cf73c9ed8c96f56b8910ce'] = 'Geheimwortbestätigung';
|
||||
$_MODULE['<{moneybookers}prestashop>moneybookers_e44efbda9396a5641d730f0ac4866e52'] = 'Ihr Geheimwort wurde aktiviert';
|
||||
$_MODULE['<{moneybookers}prestashop>moneybookers_98061690dbf6a359c5b2aeb84d0eb317'] = 'Sie müssen';
|
||||
$_MODULE['<{moneybookers}prestashop>moneybookers_7360d9333103eec04f2d91fa513a1f46'] = 'bestätigen Sie Ihr Kennwort';
|
||||
$_MODULE['<{moneybookers}prestashop>moneybookers_7986dbc3b2bf0e8f72a328c094981836'] = 'Bitte geben Sie das gleiche Kennwort ein, das Sie zum Öffnen Ihres Moneybookers Kontos benutzen:';
|
||||
$_MODULE['<{moneybookers}prestashop>moneybookers_22f2d26badcc700d11b93f57dc96d386'] = 'Mein Kennwort bestätigen';
|
||||
$_MODULE['<{moneybookers}prestashop>moneybookers_7360d9333103eec04f2d91fa513a1f46'] = 'das Geheimwort bestätigen';
|
||||
$_MODULE['<{moneybookers}prestashop>moneybookers_7986dbc3b2bf0e8f72a328c094981836'] = 'Bitte geben Sie das Geheimwort ein, welches Sie in Ihrem Moneybookerskonto unter Händlereinstellungen hinterlegt haben:';
|
||||
$_MODULE['<{moneybookers}prestashop>moneybookers_22f2d26badcc700d11b93f57dc96d386'] = 'Mein Geheimwort bestätigen';
|
||||
$_MODULE['<{moneybookers}prestashop>moneybookers_cbcd58fce9759ea6e84c86ed92a3db44'] = 'Wie lautet das Geheimwort?';
|
||||
$_MODULE['<{moneybookers}prestashop>moneybookers_ef3cefa901bd32ea6aa2d0f6900b7725'] = 'Das Geheimwort unterscheidet sich vom Passwort. Es ist dazu da, um die Transmission von Ihrem Server zu entschlüsseln.';
|
||||
$_MODULE['<{moneybookers}prestashop>moneybookers_e1674c7b15040ce09b9615714eb3e787'] = 'Warum das Geheimwort sich vom Passwort unterscheiden soll';
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<module>
|
||||
<name>paypal</name>
|
||||
<displayName><![CDATA[PayPal]]></displayName>
|
||||
<version><![CDATA[2.8.3]]></version>
|
||||
<version><![CDATA[2.8.5]]></version>
|
||||
<description><![CDATA[Accepts payments by credit cards (CB, Visa, MasterCard, Amex, Aurore, Cofinoga, 4 stars) with PayPal.]]></description>
|
||||
<author><![CDATA[]]></author>
|
||||
<tab><![CDATA[payments_gateways]]></tab>
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
<a href="{$link->getPageLink('order', true, NULL, "step=3")}" class="button_large">{l s='Return' mod='paypal'}</a><br /><br />
|
||||
<span style="color: red;">{l s='Session expired, please go back and try again' mod='paypal'}</span>
|
||||
{else}
|
||||
<a href="{$link->getPageLink('order', true, NULL, "step=3")}" class="button_large">{l s='Other payment methods' mod='paypal'}</a>
|
||||
<a href="{$link->getPageLink('order', true, NULL, "step=3")}" class="button_large">{l s='Other payment methods' mod='paypal'}</a>
|
||||
<input type="submit" name="submitPayment" value="{l s='I confirm my order' mod='paypal'}" class="exclusive_large" />
|
||||
{/if}
|
||||
</p>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{*
|
||||
* 2007-2011 PrestaShop
|
||||
* 2007-2011 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{*
|
||||
* 2007-2011 PrestaShop
|
||||
* 2007-2011 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{*
|
||||
* 2007-2011 PrestaShop
|
||||
* 2007-2011 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
|
||||
@@ -43,8 +43,8 @@ class PaypalExpress extends Paypal
|
||||
return false;
|
||||
|
||||
// Making request
|
||||
$returnURL = Tools::getShopDomainSsl(true, true).__PS_BASE_URI__.'modules/paypal/express/submit.php';
|
||||
$cancelURL = Tools::getShopDomainSsl(true, true).__PS_BASE_URI__.'order.php';
|
||||
$returnURL = PayPal::getShopDomainSsl(true, true).__PS_BASE_URI__.'modules/paypal/express/submit.php';
|
||||
$cancelURL = PayPal::getShopDomainSsl(true, true).__PS_BASE_URI__.'order.php';
|
||||
$paymentAmount = (float)$cart->getOrderTotal();
|
||||
$currencyCodeType = strval($currency->iso_code);
|
||||
$paymentType = Configuration::get('PAYPAL_CAPTURE') == 1 ? 'Authorization' : 'Sale';
|
||||
|
||||
@@ -112,7 +112,7 @@ function displayConfirm()
|
||||
'ppToken' => strval(Context::getContext()->cookie->paypal_token),
|
||||
'cust_currency' => Context::getContext()->cart->id_currency,
|
||||
'currencies' => $ppExpress->getCurrency((int)Context::getContext()->cart->id_currency),
|
||||
'total' => Context::getContext()->cart->getOrderTotal(true, Cart::BOTH),
|
||||
'total' => Context::getContext()->cart->getOrderTotal(true, PayPal::BOTH),
|
||||
'this_path_ssl' => Tools::getShopDomainSsl(true, true).__PS_BASE_URI__.'modules/'. $ppExpress->name.'/',
|
||||
'payerID' => $payerID,
|
||||
'mode' => 'express/'
|
||||
@@ -133,7 +133,7 @@ function submitConfirm()
|
||||
die('No currency');
|
||||
elseif (!$payerID = Tools::htmlentitiesUTF8(strval(Tools::getValue('payerID'))))
|
||||
die('No payer ID');
|
||||
elseif (!Context::getContext()->cart->getOrderTotal(true, Cart::BOTH))
|
||||
elseif (!Context::getContext()->cart->getOrderTotal(true, PayPal::BOTH))
|
||||
die('Empty cart');
|
||||
|
||||
$ppExpress->makePayPalAPIValidation(Context::getContext()->cookie, Context::getContext()->cart, $currency, $payerID, 'express');
|
||||
@@ -344,7 +344,8 @@ function displayAccount()
|
||||
displayAccount();
|
||||
die('Not logged');
|
||||
}*/
|
||||
if (!Context::getContext()->cart->getOrderTotal(true, Cart::BOTH))
|
||||
|
||||
if (!Context::getContext()->cart->getOrderTotal(true, PayPal::BOTH))
|
||||
die('Empty cart');
|
||||
|
||||
// No token, we need to get one by making PayPal Authorisation
|
||||
|
||||
@@ -87,11 +87,11 @@ $smarty->assign(array(
|
||||
'shipping_address' => $shippingAddress,
|
||||
'shipping_country' => $shippingCountry,
|
||||
'shipping_state' => $shippingState,
|
||||
'amount' => (float)($cart->getOrderTotal(true, Cart::BOTH_WITHOUT_SHIPPING)),
|
||||
'amount' => (float)($cart->getOrderTotal(true, PayPal::BOTH_WITHOUT_SHIPPING)),
|
||||
'customer' => $customer,
|
||||
'total' => (float)($cart->getOrderTotal(true, Cart::BOTH)),
|
||||
'shipping' => Tools::ps_round((float)($cart->getOrderShippingCost()) + (float)($cart->getOrderTotal(true, Cart::ONLY_WRAPPING)), 2),
|
||||
'discount' => $cart->getOrderTotal(true, Cart::ONLY_DISCOUNTS),
|
||||
'total' => (float)($cart->getOrderTotal(true, PayPal::BOTH)),
|
||||
'shipping' => Tools::ps_round((float)($cart->getOrderShippingCost()) + (float)($cart->getOrderTotal(true, PayPal::ONLY_WRAPPING)), 2),
|
||||
'discount' => $cart->getOrderTotal(true, PayPal::ONLY_DISCOUNTS),
|
||||
'business' => $business,
|
||||
'currency_module' => $currency_module,
|
||||
'cart_id' => (int)($cart->id).'_'.pSQL($cart->secure_key),
|
||||
@@ -99,11 +99,17 @@ $smarty->assign(array(
|
||||
'paypal_id' => (int)($paypal->id),
|
||||
'header' => $header,
|
||||
'template' => 'Template'.Configuration::get('PAYPAL_TEMPLATE'),
|
||||
'url' => Tools::getShopDomain(true, true).__PS_BASE_URI__,
|
||||
'url' => PayPal::getShopDomain(true, true).__PS_BASE_URI__,
|
||||
'paymentaction' => (Configuration::get('PAYPAL_CAPTURE') ? 'authorization' : 'sale')
|
||||
));
|
||||
|
||||
|
||||
if (substr(_PS_VERSION_, 0, 3) == '1.3')
|
||||
$smarty->assign('jquery', 'jquery-1.2.6.pack.js');
|
||||
else
|
||||
$smarty->assign('jquery', 'jquery-1.4.4.min.js');
|
||||
|
||||
|
||||
if (is_file(_PS_THEME_DIR_.'modules/paypal/integral_evolution/redirect.tpl'))
|
||||
$smarty->display(_PS_THEME_DIR_.'modules/'.$paypal->name.'/integral_evolution/redirect.tpl');
|
||||
else
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<script type="text/javascript" src="{$url}js/jquery/jquery-1.4.4.min.js"></script>
|
||||
<script type="text/javascript" src="{$url}js/jquery/{$jquery}"></script>
|
||||
</head>
|
||||
<body>
|
||||
<p>{$redirect_text}<br /><a href="javascript:history.go(-1);">{$cancel_text}</a></p>
|
||||
|
||||
@@ -46,8 +46,8 @@ class PaypalPayment extends Paypal
|
||||
|
||||
// Making request
|
||||
$vars = '?fromPayPal=1';
|
||||
$returnURL = Tools::getShopDomainSsl(true, true).__PS_BASE_URI__.'modules/paypal/payment/submit.php'.$vars;
|
||||
$cancelURL = Tools::getShopDomainSsl(true, true).__PS_BASE_URI__.'order.php';
|
||||
$returnURL = PayPal::getShopDomainSsl(true, true).__PS_BASE_URI__.'modules/paypal/payment/submit.php'.$vars;
|
||||
$cancelURL = PayPal::getShopDomainSsl(true, true).__PS_BASE_URI__.'order.php';
|
||||
$paymentAmount = (float)($cart->getOrderTotal());
|
||||
$currencyCodeType = strval($currency->iso_code);
|
||||
$paymentType = Configuration::get('PAYPAL_CAPTURE') == 1 ? 'Authorization' : 'Sale';
|
||||
@@ -68,7 +68,7 @@ class PaypalPayment extends Paypal
|
||||
$country = new Country((int)$address->id_country);
|
||||
if ($address->id_state)
|
||||
$state = new State((int)$address->id_state);
|
||||
$discounts = (float)($cart->getOrderTotal(true, Cart::ONLY_DISCOUNTS));
|
||||
$discounts = (float)($cart->getOrderTotal(true, PayPal::ONLY_DISCOUNTS));
|
||||
if ($discounts == 0)
|
||||
{
|
||||
if ($params['cart']->id_customer)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2011 PrestaShop
|
||||
* 2007-2011 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
@@ -95,7 +95,7 @@ function displayConfirm()
|
||||
'logo' => $ppPayment->getLogo(),
|
||||
'cust_currency' => Context::getContext()->cart->id_currency,
|
||||
'currency' => $ppPayment->getCurrency((int)Context::getContext()->cart->id_currency),
|
||||
'total' => Context::getContext()->cart->getOrderTotal(true, Cart::BOTH),
|
||||
'total' => Context::getContext()->cart->getOrderTotal(true, PayPal::BOTH),
|
||||
'this_path_ssl' => Tools::getShopDomainSsl(true, true).__PS_BASE_URI__.'modules/'. $ppPayment->name.'/',
|
||||
'mode' => 'payment/'
|
||||
));
|
||||
@@ -116,7 +116,7 @@ function submitConfirm()
|
||||
}
|
||||
elseif (!$id_currency = (int)(Tools::getValue('currency_payement')))
|
||||
die('No currency');
|
||||
elseif (!Context::getContext()->cart->getOrderTotal(true, Cart::BOTH))
|
||||
elseif (!Context::getContext()->cart->getOrderTotal(true, PayPal::BOTH))
|
||||
die('Empty cart');
|
||||
$currency = new Currency((int)($id_currency));
|
||||
if (!Validate::isLoadedObject($currency))
|
||||
@@ -133,7 +133,7 @@ function validOrder()
|
||||
header('location:../../../'); exit;
|
||||
die('Not logged');
|
||||
}
|
||||
elseif (!Context::getContext()->cart->getOrderTotal(true, Cart::BOTH))
|
||||
elseif (!Context::getContext()->cart->getOrderTotal(true, PayPal::BOTH))
|
||||
die('Empty cart');
|
||||
if (!$token = Tools::htmlentitiesUTF8(strval(Tools::getValue('token'))))
|
||||
{
|
||||
@@ -153,7 +153,7 @@ function validOrder()
|
||||
|
||||
if (!Context::getContext()->customer->isLogged(true))
|
||||
die('Not logged');
|
||||
elseif (!Context::getContext()->cart->getOrderTotal(true, Cart::BOTH))
|
||||
elseif (!Context::getContext()->cart->getOrderTotal(true, PayPal::BOTH))
|
||||
die('Empty cart');
|
||||
|
||||
// No submit, confirmation page
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2011 PrestaShop
|
||||
* 2007-2011 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
@@ -23,11 +23,11 @@
|
||||
* @version Release: $Revision: 7091 $
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
*/
|
||||
|
||||
if (!defined('_PS_VERSION_'))
|
||||
exit;
|
||||
|
||||
|
||||
define('_PAYPAL_INTEGRAL_', 0);
|
||||
define('_PAYPAL_OPTION_PLUS_', 1);
|
||||
define('_PAYPAL_INTEGRAL_EVOLUTION_', 2);
|
||||
@@ -35,13 +35,13 @@ define('_PAYPAL_INTEGRAL_EVOLUTION_', 2);
|
||||
class PayPal extends PaymentModule
|
||||
{
|
||||
private $_html = '';
|
||||
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->name = 'paypal';
|
||||
$this->tab = 'payments_gateways';
|
||||
$this->version = '2.8.3';
|
||||
|
||||
$this->version = '2.8.5';
|
||||
|
||||
$this->currencies = true;
|
||||
$this->currencies_mode = 'radio';
|
||||
|
||||
@@ -78,7 +78,7 @@ class PayPal extends PaymentModule
|
||||
$this->warning .= Configuration::get('PS_PREACTIVATION_PAYPAL_WARNING');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function install()
|
||||
{
|
||||
/* Install and register on hook */
|
||||
@@ -92,14 +92,14 @@ class PayPal extends PaymentModule
|
||||
OR !$this->registerHook('cancelProduct')
|
||||
OR !$this->registerHook('adminOrder'))
|
||||
return false;
|
||||
|
||||
|
||||
if (file_exists(_PS_ROOT_DIR_.'/modules/paypalapi/paypalapi.php') AND !Configuration::get('PAYPAL_NEW'))
|
||||
{
|
||||
include_once(_PS_ROOT_DIR_.'/modules/paypalapi/paypalapi.php');
|
||||
$paypalapi = new PaypalAPI();
|
||||
return $this->_checkAndUpdateFromOldVersion(true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Set database */
|
||||
if (!Db::getInstance()->execute('CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'paypal_order` (
|
||||
@@ -111,7 +111,7 @@ class PayPal extends PaymentModule
|
||||
PRIMARY KEY (`id_order`)
|
||||
) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8'))
|
||||
return false;
|
||||
|
||||
|
||||
/* Set configuration */
|
||||
Configuration::updateValue('PAYPAL_SANDBOX', 1);
|
||||
Configuration::updateValue('PAYPAL_BUSINESS', 'paypal@prestashop.com');
|
||||
@@ -147,10 +147,10 @@ class PayPal extends PaymentModule
|
||||
copy(dirname(__FILE__).'/../../img/os/'.Configuration::get('PS_OS_PAYPAL').'.gif', dirname(__FILE__).'/../../img/os/'.(int)$orderState->id.'.gif');
|
||||
Configuration::updateValue('PAYPAL_OS_AUTHORIZATION', (int)$orderState->id);
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
public function uninstall()
|
||||
{
|
||||
/* Delete all configurations */
|
||||
@@ -165,23 +165,23 @@ class PayPal extends PaymentModule
|
||||
Configuration::deleteByName('PAYPAL_TEMPLATE');
|
||||
Configuration::deleteByName('PAYPAL_CAPTURE');
|
||||
Configuration::deleteByName('PAYPAL_DEBUG_MODE');
|
||||
|
||||
|
||||
return parent::uninstall();
|
||||
}
|
||||
|
||||
|
||||
public function getContent()
|
||||
{
|
||||
$this->_html .= '<h2>'.$this->l('PayPal').'</h2>';
|
||||
|
||||
$this->_html .= '<h2>'.$this->l('PayPal').'</h2>';
|
||||
|
||||
$this->_postProcess();
|
||||
$this->_setPayPalSubscription();
|
||||
if (file_exists(_PS_ROOT_DIR_.'/modules/paypalapi/paypalapi.php'))
|
||||
$this->_html .= '<div class="warning warn"><h3>'.$this->l('All features of Paypal API module are be include in this new module. In order to don\'t have any conflict, please don\'t use and remove PayPalAPI module.').'</h3></div>';
|
||||
$this->_setConfigurationForm();
|
||||
|
||||
|
||||
return $this->_html;
|
||||
}
|
||||
|
||||
|
||||
public function hookPayment($params)
|
||||
{
|
||||
if (!$this->active)
|
||||
@@ -208,7 +208,7 @@ class PayPal extends PaymentModule
|
||||
else
|
||||
die($this->l('No valid payment method selected'));
|
||||
}
|
||||
|
||||
|
||||
public function hookShoppingCartExtra($params)
|
||||
{
|
||||
if (!$this->active)
|
||||
@@ -220,7 +220,7 @@ class PayPal extends PaymentModule
|
||||
return $this->display(__FILE__, 'express/shopping_cart.tpl');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function hookPaymentReturn($params)
|
||||
{
|
||||
if (!$this->active)
|
||||
@@ -228,7 +228,7 @@ class PayPal extends PaymentModule
|
||||
|
||||
return $this->display(__FILE__, 'confirmation.tpl');
|
||||
}
|
||||
|
||||
|
||||
public function hookRightColumn($params)
|
||||
{
|
||||
$this->context->smarty->assign('iso_code', Tools::strtolower($this->context->language));
|
||||
@@ -240,7 +240,7 @@ class PayPal extends PaymentModule
|
||||
{
|
||||
return $this->hookRightColumn($params);
|
||||
}
|
||||
|
||||
|
||||
public function hookBackBeforePayment($params)
|
||||
{
|
||||
if (!$this->active)
|
||||
@@ -258,7 +258,7 @@ class PayPal extends PaymentModule
|
||||
Tools::redirect('modules/paypal/express/submit.php?confirm=1&token='.$token.'&payerID='.$payerID);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function hookAdminOrder($params)
|
||||
{
|
||||
if (Tools::isSubmit('paypal'))
|
||||
@@ -288,7 +288,7 @@ class PayPal extends PaymentModule
|
||||
<img src="'._PS_IMG_.'admin/ok.gif" alt="" title="" /> '.$message.'
|
||||
</div>';
|
||||
}
|
||||
|
||||
|
||||
if ($this->_needValidation((int)$params['id_order']) AND $this->_isPayPalAPIAvailable())
|
||||
{
|
||||
$this->_html .= '<br />
|
||||
@@ -302,7 +302,7 @@ class PayPal extends PaymentModule
|
||||
$this->_postProcess();
|
||||
$this->_html .= '</fieldset>';
|
||||
}
|
||||
|
||||
|
||||
if ($this->_needCapture((int)$params['id_order']) AND $this->_isPayPalAPIAvailable())
|
||||
{
|
||||
$this->_html .= '<br />
|
||||
@@ -316,7 +316,7 @@ class PayPal extends PaymentModule
|
||||
$this->_postProcess();
|
||||
$this->_html .= '</fieldset>';
|
||||
}
|
||||
|
||||
|
||||
if ($this->_canRefund((int)$params['id_order']) AND $this->_isPayPalAPIAvailable())
|
||||
{
|
||||
$this->_html .= '<br />
|
||||
@@ -331,10 +331,10 @@ class PayPal extends PaymentModule
|
||||
$this->_postProcess();
|
||||
$this->_html .= '</fieldset>';
|
||||
}
|
||||
|
||||
|
||||
return $this->_html;
|
||||
}
|
||||
|
||||
|
||||
public function hookCancelProduct($params)
|
||||
{
|
||||
if (Tools::isSubmit('generateDiscount'))
|
||||
@@ -353,10 +353,10 @@ class PayPal extends PaymentModule
|
||||
$id_transaction = $this->_getTransactionId((int)($order->id));
|
||||
if (!$id_transaction)
|
||||
return false;
|
||||
|
||||
|
||||
$products = $order->getProducts();
|
||||
$amt = $products[(int)($order_detail->id)]['product_price_wt'] * (int)($_POST['cancelQuantity'][(int)($order_detail->id)]);
|
||||
|
||||
|
||||
$response = $this->_makeRefund($id_transaction, $order->id, (float)($amt));
|
||||
$message = $this->l('Cancel products result:').'<br>';
|
||||
foreach ($response AS $k => $value)
|
||||
@@ -381,11 +381,11 @@ class PayPal extends PaymentModule
|
||||
$currency = new Currency((int)($id_currency));
|
||||
$iso_currency = $currency->iso_code;
|
||||
$token = $cookie->paypal_token;
|
||||
$total = (float)($cart->getOrderTotal(true, Cart::BOTH));
|
||||
$total = (float)($cart->getOrderTotal(true, PayPal::BOTH));
|
||||
$paymentType = Configuration::get('PAYPAL_CAPTURE') == 1 ? 'Authorization' : 'Sale';
|
||||
$serverName = urlencode($_SERVER['SERVER_NAME']);
|
||||
$bn = ($type == 'express' ? 'ECS' : 'ECM');
|
||||
$notifyURL = urlencode(Tools::getShopDomainSsl(true, true).__PS_BASE_URI__.'modules/paypal/ipn.php');
|
||||
$notifyURL = urlencode(PayPal::getShopDomainSsl(true, true).__PS_BASE_URI__.'modules/paypal/ipn.php');
|
||||
|
||||
// Getting address
|
||||
if (isset($cookie->id_cart) AND $cookie->id_cart)
|
||||
@@ -402,7 +402,7 @@ class PayPal extends PaymentModule
|
||||
|
||||
// Making request
|
||||
$request='&TOKEN='.urlencode($token).'&PAYERID='.urlencode($payerID).'&PAYMENTACTION='.$paymentType.'&AMT='.$total.'&CURRENCYCODE='.$iso_currency.'&IPADDRESS='.$serverName.'&NOTIFYURL='.$notifyURL.'&BUTTONSOURCE=PRESTASHOP_'.$bn.$requestAddress ;
|
||||
$discounts = (float)$cart->getOrderTotal(true, Cart::ONLY_DISCOUNTS);
|
||||
$discounts = (float)$cart->getOrderTotal(true, PayPal::ONLY_DISCOUNTS);
|
||||
if ($discounts == 0)
|
||||
{
|
||||
$products = $cart->getProducts();
|
||||
@@ -424,7 +424,7 @@ class PayPal extends PaymentModule
|
||||
$products = $cart->getProducts();
|
||||
$description = 0;
|
||||
for ($i = 0; $i < sizeof($products); $i++)
|
||||
$description .= ($description == ''?'':', ').$products[$i]['cart_quantity']." x ".$products[$i]['name'].(isset($products[$i]['attributes'])?' - '.$products[$i]['attributes']:'').(isset($products[$i]['instructions'])?' - '.$products[$i]['instructions']:'') ;
|
||||
$description .= ($description == ''?'':', ').$products[$i]['cart_quantity']." x ".$products[$i]['name'].(isset($products[$i]['attributes'])?' - '.$products[$i]['attributes']:'').(isset($products[$i]['instructions'])?' - '.$products[$i]['instructions']:'') ;
|
||||
$request .= '&ORDERDESCRIPTION='.urlencode(substr($description, 0, 120));
|
||||
}
|
||||
|
||||
@@ -446,6 +446,9 @@ class PayPal extends PaymentModule
|
||||
$ppExpress->displayPayPalAPIError($ppExpress->l('PayPal return error.', 'submit'), $logs);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// Making log
|
||||
$id_transaction = $result['TRANSACTIONID'];
|
||||
if (Configuration::get('PAYPAL_CAPTURE'))
|
||||
@@ -470,20 +473,22 @@ class PayPal extends PaymentModule
|
||||
$id_order_state = Configuration::get('PS_OS_ERROR');
|
||||
}
|
||||
|
||||
|
||||
// Call payment validation method
|
||||
$this->validateOrder($id_cart, $id_order_state, (float)($cart->getOrderTotal(true, Cart::BOTH)), $this->displayName, $message, array('transaction_id' => $id_transaction, 'payment_status' => $result['PAYMENTSTATUS'], 'pending_reason' => $result['PENDINGREASON']), $id_currency, false, $cart->secure_key);
|
||||
|
||||
$this->validateOrder($id_cart, $id_order_state, (float)($cart->getOrderTotal(true, PayPal::BOTH)), $this->displayName, $message, array('transaction_id' => $id_transaction, 'payment_status' => $result['PAYMENTSTATUS'], 'pending_reason' => $result['PENDINGREASON']), $id_currency, false, $cart->secure_key);
|
||||
|
||||
// Clean cookie
|
||||
unset($cookie->paypal_token);
|
||||
|
||||
|
||||
// Displaying output
|
||||
$order = new Order((int)($this->currentOrder));
|
||||
Tools::redirect('index.php?controller=order-confirmation&id_cart='.(int)($id_cart).'&id_module='.(int)($this->id).'&id_order='.(int)($this->currentOrder).'&key='.$order->secure_key);
|
||||
|
||||
|
||||
}
|
||||
|
||||
public function validateOrder($id_cart, $id_order_state, $amountPaid, $paymentMethod = 'Unknown', $message = NULL,
|
||||
$extraVars = array(), $currency_special = NULL, $dont_touch_amount = false, $secure_key = false, Shop $shop = null)
|
||||
|
||||
public function validateOrder($id_cart, $id_order_state, $amountPaid, $paymentMethod = 'Unknown',
|
||||
$message = NULL, $extraVars = array(), $currency_special = NULL, $dont_touch_amount = false,
|
||||
$secure_key = false, Shop $shop = null)
|
||||
{
|
||||
if (!$this->active)
|
||||
return;
|
||||
@@ -493,41 +498,41 @@ class PayPal extends PaymentModule
|
||||
{
|
||||
$this->pcc->transaction_id = (isset($extraVars['transaction_id']) ?
|
||||
$extraVars['transaction_id'] : '');
|
||||
}
|
||||
}
|
||||
|
||||
parent::validateOrder($id_cart, $id_order_state, $amountPaid, $paymentMethod, $message, $extraVars, $currency_special, $dont_touch_amount, $secure_key);
|
||||
|
||||
|
||||
if (array_key_exists('transaction_id', $extraVars) AND array_key_exists('payment_status', $extraVars))
|
||||
$this->_saveTransaction($id_cart, $extraVars);
|
||||
}
|
||||
|
||||
|
||||
public function getPayPalURL()
|
||||
{
|
||||
return 'www'.(Configuration::get('PAYPAL_SANDBOX') ? '.sandbox' : '').'.paypal.com';
|
||||
}
|
||||
|
||||
|
||||
public function getPaypalIntegralEvolutionUrl()
|
||||
{
|
||||
if (Configuration::get('PAYPAL_SANDBOX'))
|
||||
return 'https://'.$this->getPayPalURL().'/cgi-bin/acquiringweb';
|
||||
return 'https://securepayments.paypal.com/acquiringweb?cmd=_hosted-payment';
|
||||
}
|
||||
|
||||
|
||||
public function getPaypalStandardUrl()
|
||||
{
|
||||
return 'https://'.$this->getPayPalURL().'/cgi-bin/webscr';
|
||||
}
|
||||
|
||||
|
||||
public function getAPIURL()
|
||||
{
|
||||
return 'api-3t'.(Configuration::get('PAYPAL_SANDBOX') ? '.sandbox' : '').'.paypal.com';
|
||||
}
|
||||
|
||||
|
||||
public function getAPIScript()
|
||||
{
|
||||
return '/nvp';
|
||||
}
|
||||
|
||||
|
||||
public function getL($key)
|
||||
{
|
||||
$translations = array(
|
||||
@@ -557,7 +562,7 @@ class PayPal extends PaymentModule
|
||||
return $key;
|
||||
return $translations[$key];
|
||||
}
|
||||
|
||||
|
||||
public function getLogo($ppExpress = false, $vertical = false)
|
||||
{
|
||||
if ($ppExpress)
|
||||
@@ -609,14 +614,14 @@ class PayPal extends PaymentModule
|
||||
return _MODULE_DIR_.$this->name.'/img/integral_evolution'.($vertical ? '_vertical' : '').'.png';
|
||||
return _MODULE_DIR_.$this->name.'/img/PayPal_mark_60x38.gif';
|
||||
}
|
||||
|
||||
|
||||
public function getCountryCode()
|
||||
{
|
||||
$address = new Address($this->context->cart->id_address_invoice);
|
||||
$country = new Country($address->id_country);
|
||||
return $country->iso_code;
|
||||
}
|
||||
|
||||
|
||||
public function displayPayPalAPIError($message, $log = false)
|
||||
{
|
||||
$send = true;
|
||||
@@ -648,30 +653,30 @@ class PayPal extends PaymentModule
|
||||
include_once(dirname(__FILE__).'/../../footer.php');
|
||||
die;
|
||||
}
|
||||
|
||||
|
||||
private function _saveTransaction($id_cart, $extraVars)
|
||||
{
|
||||
$cart = new Cart((int)($id_cart));
|
||||
if (Validate::isLoadedObject($cart) AND $cart->OrderExists())
|
||||
{
|
||||
$id_order = Db::getInstance()->getValue('
|
||||
SELECT `id_order`
|
||||
FROM `'._DB_PREFIX_.'orders`
|
||||
SELECT `id_order`
|
||||
FROM `'._DB_PREFIX_.'orders`
|
||||
WHERE `id_cart` = '.(int)$cart->id);
|
||||
|
||||
|
||||
Db::getInstance()->execute('
|
||||
INSERT INTO `'._DB_PREFIX_.'paypal_order` (`id_order`, `id_transaction`, `payment_method`, `payment_status`, `capture`)
|
||||
INSERT INTO `'._DB_PREFIX_.'paypal_order` (`id_order`, `id_transaction`, `payment_method`, `payment_status`, `capture`)
|
||||
VALUES ('.(int)$id_order.', \''.pSQL($extraVars['transaction_id']).'\', '.(int)Configuration::get('PAYPAL_PAYMENT_METHOD').', \''.pSQL($extraVars['payment_status']).((isset($extraVars['pending_reason']) AND $extraVars['pending_reason'] == 'authorization') ? '_authorization' : '').'\', '.(int)(Configuration::get('PAYPAL_CAPTURE')).')');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private function _canRefund($id_order)
|
||||
{
|
||||
if (!(int)$id_order)
|
||||
return false;
|
||||
$paypal_order = Db::getInstance()->getRow('
|
||||
SELECT *
|
||||
FROM `'._DB_PREFIX_.'paypal_order`
|
||||
SELECT *
|
||||
FROM `'._DB_PREFIX_.'paypal_order`
|
||||
WHERE `id_order` = '.(int)$id_order);
|
||||
if (!is_array($paypal_order) OR !sizeof($paypal_order))
|
||||
return false;
|
||||
@@ -679,27 +684,27 @@ class PayPal extends PaymentModule
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
private function _needValidation($id_order)
|
||||
{
|
||||
if (!(int)$id_order)
|
||||
return false;
|
||||
$order = Db::getInstance()->getRow('
|
||||
SELECT `payment_method`, `payment_status`
|
||||
FROM `'._DB_PREFIX_.'paypal_order`
|
||||
SELECT `payment_method`, `payment_status`
|
||||
FROM `'._DB_PREFIX_.'paypal_order`
|
||||
WHERE `id_order` = '.(int)$id_order);
|
||||
if (!$order)
|
||||
return false;
|
||||
return $order['payment_status'] == 'Pending' AND $order['payment_method'] == _PAYPAL_INTEGRAL_EVOLUTION_;
|
||||
}
|
||||
|
||||
|
||||
private function _needCapture($id_order)
|
||||
{
|
||||
if (!(int)$id_order)
|
||||
return false;
|
||||
$result = Db::getInstance()->getRow('
|
||||
SELECT `payment_method`, `payment_status`, `capture`
|
||||
FROM `'._DB_PREFIX_.'paypal_order`
|
||||
SELECT `payment_method`, `payment_status`, `capture`
|
||||
FROM `'._DB_PREFIX_.'paypal_order`
|
||||
WHERE `id_order` = '.(int)($id_order).' AND `capture` = 1');
|
||||
if (!isset($result['payment_method']))
|
||||
return false;
|
||||
@@ -707,11 +712,11 @@ class PayPal extends PaymentModule
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
private function _setConfigurationForm()
|
||||
{
|
||||
$this->_html .= '
|
||||
<form method="post" action="'.htmlentities($_SERVER['REQUEST_URI']).'">
|
||||
<form method="post" action="'.htmlentities($_SERVER['REQUEST_URI']).'">
|
||||
<script type="text/javascript">
|
||||
var pos_select = '.(($tab = (int)Tools::getValue('tabs')) ? $tab : '0').';
|
||||
</script>
|
||||
@@ -720,15 +725,15 @@ class PayPal extends PaymentModule
|
||||
<input type="hidden" name="tabs" id="tabs" value="0" />
|
||||
<div class="tab-pane" id="tab-pane-1" style="width:100%;">
|
||||
<div class="tab-page" id="step1">
|
||||
<h4 class="tab">'.$this->l('Solution').'</h2>
|
||||
<h4 class="tab">'.$this->l('Solution').'</h4>
|
||||
'.$this->_getSolutionTabHtml().'
|
||||
</div>
|
||||
<div class="tab-page" id="step2">
|
||||
<h4 class="tab">'.$this->l('Settings').'</h2>
|
||||
<h4 class="tab">'.$this->l('Settings').'</h4>
|
||||
'.$this->_getSettingsTabHtml().'
|
||||
</div>
|
||||
<div class="tab-page" id="step3">
|
||||
<h4 class="tab">'.$this->l('Logos and personalization').'</h2>
|
||||
<h4 class="tab">'.$this->l('Logos and personalization').'</h4>
|
||||
'.$this->_getPersonalizationsTabHtml().'
|
||||
</div>
|
||||
</div>
|
||||
@@ -739,20 +744,20 @@ class PayPal extends PaymentModule
|
||||
</script>
|
||||
</form>';
|
||||
}
|
||||
|
||||
|
||||
private function _getSolutionTabHtml()
|
||||
{
|
||||
$paymentMethod = (int)(Tools::getValue('payment_method', Configuration::get('PAYPAL_PAYMENT_METHOD')));
|
||||
$paypalExpress = (int)(Tools::isSubmit('paypal_express') ? 1 : Configuration::get('PAYPAL_EXPRESS_CHECKOUT'));
|
||||
$paypalDebug = (int)(Tools::isSubmit('paypal_debug') ? 1 : Configuration::get('PAYPAL_DEBUG_MODE'));
|
||||
|
||||
|
||||
$link = 'http://altfarm.mediaplex.com/ad/ck/3484-23403-8030-88?ID=PROCPRESTA';
|
||||
$lang = $this->context->language;
|
||||
if (strtolower($lang->iso_code) == 'es')
|
||||
$link = 'http://altfarm.mediaplex.com/ad/ck/3484-34334-12439-1';
|
||||
else if (strtolower($lang->iso_code) == 'it')
|
||||
$link = 'https://www.paypal-business.it/paypalpro.asp';
|
||||
|
||||
|
||||
return '
|
||||
<h2>'.$this->l('Solution').'</h2>
|
||||
<h3>'.$this->l('Choose a solution:').'</h3>
|
||||
@@ -773,24 +778,24 @@ class PayPal extends PaymentModule
|
||||
'.$this->l('To use any PayPal solution, you need to set up API parameters in the « Settings » Tab').'
|
||||
</div>';
|
||||
}
|
||||
|
||||
|
||||
private function _getSettingsTabHtml()
|
||||
{
|
||||
$lang = $this->context->language;
|
||||
$sandboxMode = (int)(Tools::getValue('sandbox_mode', Configuration::get('PAYPAL_SANDBOX')));
|
||||
$paypalCapture = (int)(Tools::getValue('paypal_capture', Configuration::get('PAYPAL_CAPTURE')));
|
||||
|
||||
|
||||
$html = '
|
||||
<h2>'.$this->l('Settings').'</h2>
|
||||
<label>'.$this->l('Sandbox mode (tests)').':</label>
|
||||
<div class="margin-form" style="padding-top:2px;">
|
||||
<input type="radio" name="sandbox_mode" id="sandbox_mode_1" value="1" '.($sandboxMode ? 'checked="checked" ' : '').'/> <label for="sandbox_mode_1" class="t">'.$this->l('Active').'</label>
|
||||
<input type="radio" name="sandbox_mode" id="sandbox_mode_1" value="1" '.($sandboxMode ? 'checked="checked" ' : '').'/> <label for="sandbox_mode_1" class="t">'.$this->l('Active').'</label>
|
||||
<input type="radio" name="sandbox_mode" id="sandbox_mode_0" value="0" style="margin-left:15px;" '.(!$sandboxMode ? 'checked="checked" ' : '').'/> <label for="sandbox_mode_0" class="t">'.$this->l('Inactive').'</label>
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
<label>'.$this->l('Payment type').':</label>
|
||||
<div class="margin-form" style="padding-top:2px;">
|
||||
<input type="radio" name="paypal_capture" id="paypal_capture_0" value="0" '.(!$paypalCapture ? 'checked="checked" ' : '').'/> <label for="paypal_capture_0" class="t">'.$this->l('Direct (sales)').'</label>
|
||||
<input type="radio" name="paypal_capture" id="paypal_capture_0" value="0" '.(!$paypalCapture ? 'checked="checked" ' : '').'/> <label for="paypal_capture_0" class="t">'.$this->l('Direct (sales)').'</label>
|
||||
<input type="radio" name="paypal_capture" id="paypal_capture_1" value="1" style="margin-left:15px;" '.($paypalCapture ? 'checked="checked" ' : '').'/> <label for="paypal_capture_1" class="t">'.$this->l('Authorization / Manual Capture').' '.$this->l('(Payment shipping)').'</label>
|
||||
</div>
|
||||
<label>'.$this->l('PayPal account e-mail').':</label>
|
||||
@@ -826,12 +831,12 @@ class PayPal extends PaymentModule
|
||||
<p class="center"><input class="button" type="submit" name="submitPayPal" value="'.$this->l('Save settings').'" /></p>';
|
||||
return $html;
|
||||
}
|
||||
|
||||
|
||||
private function _getPersonalizationsTabHtml()
|
||||
{
|
||||
$lang = $this->context->language;
|
||||
$template_paypal = Tools::getValue('template_paypal', Configuration::get('PAYPAL_TEMPLATE'));
|
||||
|
||||
|
||||
return '
|
||||
<h2>'.$this->l('Logos and personalizations').'</h2>
|
||||
<label for="banner_url">'.$this->l('Banner image URL').':</label>
|
||||
@@ -841,14 +846,14 @@ class PayPal extends PaymentModule
|
||||
</div>
|
||||
<label>'.$this->l('Template chosen for PayPal Integral Evolution').':</label>
|
||||
<div class="margin-form" style="padding-top:2px;">
|
||||
<input type="radio" name="template_paypal" id="template_paypal_a" value="A" '.($template_paypal == 'A' ? 'checked="checked" ' : '').'/> <label for="template_paypal_a" class="t">A</label>
|
||||
<input type="radio" name="template_paypal" id="template_paypal_a" value="A" '.($template_paypal == 'A' ? 'checked="checked" ' : '').'/> <label for="template_paypal_a" class="t">A</label>
|
||||
<input type="radio" name="template_paypal" id="template_paypal_b" value="B" style="margin-left:10px;" '.($template_paypal == 'B' ? 'checked="checked" ' : '').'/> <label for="template_paypal_b" class="t">B</label>
|
||||
<input type="radio" name="template_paypal" id="template_paypal_c" value="C" style="margin-left:10px;" '.($template_paypal == 'C' ? 'checked="checked" ' : '').'/> <label for="template_paypal_c" class="t">C</label>
|
||||
</div>
|
||||
'.($lang->iso_code == 'fr' ? '<p style="clear:both;"><a style="color:blue;text-decoration:underline;" href="https://cms.paypal.com/cms_content/FR/fr_FR/files/developer/Paypal_Integral_Evolution_Personnalisation.pdf" target="_blank">'.$this->l('Click here to learn how to customize these templates').'</a></p>' : '').'
|
||||
<p class="center"><input class="button" type="submit" name="submitPayPal" value="'.$this->l('Save settings').'" /></p>';
|
||||
}
|
||||
|
||||
|
||||
private function _setPayPalSubscription()
|
||||
{
|
||||
$this->_html .= '
|
||||
@@ -865,7 +870,7 @@ class PayPal extends PaymentModule
|
||||
'.$this->l('You need to configure your PayPal account before using this module.').'
|
||||
<div style="clear:both;"> </div>';
|
||||
}
|
||||
|
||||
|
||||
private function _postProcess()
|
||||
{
|
||||
if (Tools::isSubmit('submitPayPal'))
|
||||
@@ -879,7 +884,7 @@ class PayPal extends PaymentModule
|
||||
$this->_errors[] = $this->l('E-mail invalid');
|
||||
if (Tools::getValue('banner_url') != NULL AND !Validate::isUrl(Tools::getValue('banner_url')))
|
||||
$this->_errors[] = $this->l('URL for banner is invalid');
|
||||
elseif (Tools::getValue('banner_url') != NULL AND strpos(Tools::getValue('banner_url'), 'https://') === false)
|
||||
elseif (Tools::getValue('banner_url') != NULL AND strpos(Tools::getValue('banner_url'), 'https://') === false)
|
||||
$this->_errors[] = $this->l('URL for banner must use HTTPS protocol');
|
||||
if (!in_array(Tools::getValue('template_paypal'), $template_available))
|
||||
$this->_errors[] = $this->l('PayPal template invalid.');
|
||||
@@ -889,7 +894,7 @@ class PayPal extends PaymentModule
|
||||
$this->_errors[] = $this->l('Cannot use this solution without API Credentials.');
|
||||
if (Tools::isSubmit('paypal_express') AND (Tools::getValue('api_username') == NULL OR Tools::getValue('api_signature') == NULL))
|
||||
$this->_errors[] = $this->l('Cannot use PayPal Express without API Credentials.');
|
||||
|
||||
|
||||
if (!sizeof($this->_errors))
|
||||
{
|
||||
Configuration::updateValue('PAYPAL_SANDBOX', (int)(Tools::getValue('sandbox_mode')));
|
||||
@@ -921,7 +926,7 @@ class PayPal extends PaymentModule
|
||||
$this->_html = $this->displayError($error_msg);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (Tools::isSubmit('submitPayPalValidation'))
|
||||
{
|
||||
if (!($response = $this->_updatePaymentStatusOfOrder((int)(Tools::getValue('id_order')))) OR !sizeof($response))
|
||||
@@ -939,7 +944,7 @@ class PayPal extends PaymentModule
|
||||
$this->_html .= '<p style="color:red;">'.$this->l('Error from PayPal: ').$response['L_LONGMESSAGE0'].' (#'.$response['L_ERRORCODE0'].')</p>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (Tools::isSubmit('submitPayPalCapture'))
|
||||
{
|
||||
if (!($response = $this->_doCapture((int)(Tools::getValue('id_order')))) OR !sizeof($response))
|
||||
@@ -957,7 +962,7 @@ class PayPal extends PaymentModule
|
||||
$this->_html .= '<p style="color:red;">'.$this->l('Error from PayPal: ').$response['L_LONGMESSAGE0'].' (#'.$response['L_ERRORCODE0'].')</p>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (Tools::isSubmit('submitPayPalRefund'))
|
||||
{
|
||||
if (!($response = $this->_doTotalRefund((int)(Tools::getValue('id_order')))) OR !sizeof($response))
|
||||
@@ -976,27 +981,27 @@ class PayPal extends PaymentModule
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private function _getTransactionId($id_order)
|
||||
{
|
||||
if (!(int)$id_order)
|
||||
return false;
|
||||
|
||||
|
||||
return Db::getInstance()->getValue('
|
||||
SELECT `id_transaction`
|
||||
FROM `'._DB_PREFIX_.'paypal_order`
|
||||
SELECT `id_transaction`
|
||||
FROM `'._DB_PREFIX_.'paypal_order`
|
||||
WHERE `id_order` = '.(int)$id_order);
|
||||
}
|
||||
|
||||
|
||||
private function _makeRefund($id_transaction, $id_order, $amt = false)
|
||||
{
|
||||
include_once(_PS_MODULE_DIR_.'paypal/api/paypallib.php');
|
||||
|
||||
|
||||
if (!$this->_isPayPalAPIAvailable())
|
||||
die(Tools::displayError('Fatal Error: no API Credentials are available'));
|
||||
if (!$id_transaction)
|
||||
die(Tools::displayError('Fatal Error: id_transaction is null'));
|
||||
|
||||
|
||||
if (!$amt)
|
||||
$request = '&TRANSACTIONID='.urlencode($id_transaction).'&REFUNDTYPE=Full';
|
||||
else
|
||||
@@ -1011,7 +1016,7 @@ class PayPal extends PaymentModule
|
||||
$paypalLib = new PaypalLib();
|
||||
return $paypalLib->makeCall($this->getAPIURL(), $this->getAPIScript(), 'RefundTransaction', $request);
|
||||
}
|
||||
|
||||
|
||||
private function _addNewPrivateMessage($id_order, $message)
|
||||
{
|
||||
if (!$id_order)
|
||||
@@ -1026,7 +1031,7 @@ class PayPal extends PaymentModule
|
||||
|
||||
return $msg->add();
|
||||
}
|
||||
|
||||
|
||||
private function _doTotalRefund($id_order)
|
||||
{
|
||||
if (!$this->_isPayPalAPIAvailable())
|
||||
@@ -1073,20 +1078,20 @@ class PayPal extends PaymentModule
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
||||
|
||||
private function _doCapture($id_order)
|
||||
{
|
||||
include_once(_PS_MODULE_DIR_.'paypal/api/paypallib.php');
|
||||
|
||||
|
||||
if (!$this->_isPayPalAPIAvailable())
|
||||
return false;
|
||||
if (!$id_order)
|
||||
return false;
|
||||
|
||||
|
||||
$id_transaction = $this->_getTransactionId((int)($id_order));
|
||||
if (!$id_transaction)
|
||||
return false;
|
||||
|
||||
|
||||
$order = new Order((int)($id_order));
|
||||
$currency = new Currency((int)($order->id_currency));
|
||||
$request = '&AUTHORIZATIONID='.urlencode($id_transaction).'&AMT='.(float)($order->total_paid).'&CURRENCYCODE='.$currency->iso_code.'&COMPLETETYPE=Complete';
|
||||
@@ -1111,11 +1116,11 @@ class PayPal extends PaymentModule
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
||||
|
||||
private function _updatePaymentStatusOfOrder($id_order)
|
||||
{
|
||||
include_once(_PS_MODULE_DIR_.'paypal/api/paypallib.php');
|
||||
|
||||
|
||||
if (!$this->_isPayPalAPIAvailable())
|
||||
return false;
|
||||
if (!$id_order)
|
||||
@@ -1124,7 +1129,7 @@ class PayPal extends PaymentModule
|
||||
$id_transaction = $this->_getTransactionId((int)($id_order));
|
||||
if (!$id_transaction)
|
||||
return false;
|
||||
|
||||
|
||||
$request = '&TRANSACTIONID='.urlencode($id_transaction);
|
||||
$paypalLib = new PaypalLib();
|
||||
$response = $paypalLib->makeCall($this->getAPIURL(), $this->getAPIScript(), 'GetTransactionDetails', $request);
|
||||
@@ -1167,14 +1172,14 @@ class PayPal extends PaymentModule
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
private function _isPayPalAPIAvailable()
|
||||
{
|
||||
if (Configuration::get('PAYPAL_API_USER') != NULL AND Configuration::get('PAYPAL_API_PASSWORD') != NULL AND Configuration::get('PAYPAL_API_SIGNATURE') != NULL)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
private function _checkAndUpdateFromOldVersion($install = false)
|
||||
{
|
||||
if (!Configuration::get('PAYPAL_NEW') AND ($this->active OR $install))
|
||||
@@ -1253,12 +1258,86 @@ class PayPal extends PaymentModule
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
public function getOrder($id_transaction)
|
||||
{
|
||||
return Db::getInstance()->getValue('
|
||||
SELECT `id_order`
|
||||
FROM `'._DB_PREFIX_.'paypal_order`
|
||||
SELECT `id_order`
|
||||
FROM `'._DB_PREFIX_.'paypal_order`
|
||||
WHERE `id_transaction` = \''.pSQL($id_transaction).'\'');
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Retrocompatibility to 1.3
|
||||
const ONLY_PRODUCTS = 1;
|
||||
const ONLY_DISCOUNTS = 2;
|
||||
const BOTH = 3;
|
||||
const BOTH_WITHOUT_SHIPPING = 4;
|
||||
const ONLY_SHIPPING = 5;
|
||||
const ONLY_WRAPPING = 6;
|
||||
const ONLY_PRODUCTS_WITHOUT_SHIPPING = 7;
|
||||
|
||||
|
||||
/**
|
||||
* getShopDomain returns domain name according to configuration and ignoring ssl
|
||||
*
|
||||
* @param boolean $http if true, return domain name with protocol
|
||||
* @param boolean $entities if true,
|
||||
* @return string domain
|
||||
*/
|
||||
public static function getShopDomain($http = false, $entities = false)
|
||||
{
|
||||
if (!($domain = Configuration::get('PS_SHOP_DOMAIN')))
|
||||
$domain = Tools::getHttpHost();
|
||||
if ($entities)
|
||||
$domain = htmlspecialchars($domain, ENT_COMPAT, 'UTF-8');
|
||||
if ($http)
|
||||
$domain = 'http://'.$domain;
|
||||
return $domain;
|
||||
}
|
||||
|
||||
/**
|
||||
* getShopDomainSsl returns domain name according to configuration and depending on ssl activation
|
||||
*
|
||||
* @param boolean $http if true, return domain name with protocol
|
||||
* @param boolean $entities if true,
|
||||
* @return string domain
|
||||
*/
|
||||
public static function getShopDomainSsl($http = false, $entities = false)
|
||||
{
|
||||
if (!($domain = Configuration::get('PS_SHOP_DOMAIN_SSL')))
|
||||
$domain = Tools::getHttpHost();
|
||||
if ($entities)
|
||||
$domain = htmlspecialchars($domain, ENT_COMPAT, 'UTF-8');
|
||||
if ($http)
|
||||
$domain = (Configuration::get('PS_SSL_ENABLED') ? 'https://' : 'http://').$domain;
|
||||
return $domain;
|
||||
}
|
||||
|
||||
public static function display($file, $template, $cacheId = NULL, $compileId = NULL)
|
||||
{
|
||||
if (substr(_PS_VERSION_, 0, 3) != '1.3')
|
||||
return parent::display($file, $template);
|
||||
|
||||
global $smarty;
|
||||
$previousTemplate = $smarty->currentTemplate;
|
||||
$smarty->currentTemplate = substr(basename($template), 0, -4);
|
||||
$smarty->assign('module_dir', __PS_BASE_URI__.'modules/'.basename($file, '.php').'/');
|
||||
if (Tools::file_exists_cache(_PS_THEME_DIR_.'modules/'.basename($file, '.php').'/'.$template))
|
||||
{
|
||||
$smarty->assign('module_template_dir', _THEME_DIR_.'modules/'.basename($file, '.php').'/');
|
||||
$result = $smarty->fetch(_PS_THEME_DIR_.'modules/'.basename($file, '.php').'/'.$template);
|
||||
}
|
||||
elseif (Tools::file_exists_cache(dirname(__FILE__).'/'.$template))
|
||||
{
|
||||
$smarty->assign('module_template_dir', __PS_BASE_URI__.'modules/'.basename($file, '.php').'/');
|
||||
$result = $smarty->fetch(dirname(__FILE__).'/'.$template);
|
||||
}
|
||||
else
|
||||
$result = Tools::displayError('No template found');
|
||||
$smarty->currentTemplate = $previousTemplate;
|
||||
return $result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -66,18 +66,18 @@ $smarty->assign(array(
|
||||
'address' => $address,
|
||||
'country' => $country,
|
||||
'state' => $state,
|
||||
'amount' => (float)($cart->getOrderTotal(true, Cart::BOTH_WITHOUT_SHIPPING)),
|
||||
'amount' => (float)($cart->getOrderTotal(true, PayPal::BOTH_WITHOUT_SHIPPING)),
|
||||
'customer' => $customer,
|
||||
'total' => (float)($cart->getOrderTotal(true, Cart::BOTH)),
|
||||
'shipping' => Tools::ps_round((float)($cart->getOrderShippingCost()) + (float)($cart->getOrderTotal(true, Cart::ONLY_WRAPPING)), 2),
|
||||
'discount' => $cart->getOrderTotal(true, Cart::ONLY_DISCOUNTS),
|
||||
'total' => (float)($cart->getOrderTotal(true, PayPal::BOTH)),
|
||||
'shipping' => Tools::ps_round((float)($cart->getOrderShippingCost()) + (float)($cart->getOrderTotal(true, PayPal::ONLY_WRAPPING)), 2),
|
||||
'discount' => $cart->getOrderTotal(true, PayPal::ONLY_DISCOUNTS),
|
||||
'business' => $business,
|
||||
'currency_module' => $currency_module,
|
||||
'cart_id' => (int)($cart->id).'_'.pSQL($cart->secure_key),
|
||||
'products' => $cart->getProducts(),
|
||||
'paypal_id' => (int)($paypal->id),
|
||||
'header' => $header,
|
||||
'url' => Tools::getShopDomain(true, true).__PS_BASE_URI__
|
||||
'url' => PayPal::getShopDomain(true, true).__PS_BASE_URI__
|
||||
));
|
||||
|
||||
|
||||
|
||||
@@ -570,9 +570,9 @@ var shopImporter = {
|
||||
onAfter:function(){
|
||||
$('#steps').html('');
|
||||
shopImporter.save = 1;
|
||||
if($('#import_module_name').attr('value') == 'importermagento')
|
||||
if(type_connector == 'ws')
|
||||
shopImporter.checkAndSaveConfigWS(shopImporter.save);
|
||||
else if ($('#import_module_name').attr('value') == 'importerosc')
|
||||
else if (type_connector == 'db')
|
||||
shopImporter.checkAndSaveConfig(shopImporter.save);
|
||||
}
|
||||
});
|
||||
@@ -789,7 +789,7 @@ $(document).ready(function(){
|
||||
|
||||
$('#displayOptions').unbind('click').click(function(){
|
||||
$('#displayOptions').show();
|
||||
if($('#import_module_name').attr('value') == 'importermagento')
|
||||
if(type_connector == 'ws')
|
||||
{
|
||||
if($('#loginws').val() == '' || $('#apikey').val() == '' || $('#url').val() == '')
|
||||
{
|
||||
@@ -805,7 +805,7 @@ $(document).ready(function(){
|
||||
|
||||
return false;
|
||||
}
|
||||
else if ($('#import_module_name').attr('value') == 'importerosc')
|
||||
else if (type_connector == 'db')
|
||||
{
|
||||
moduleName = $('#import_module_name').val();
|
||||
server = $('#server').val();
|
||||
@@ -836,7 +836,7 @@ $(document).ready(function(){
|
||||
moduleName = $('#import_module_name').val();
|
||||
if (validateSpecificOptions(moduleName, shopImporter.specificOptions) == true)
|
||||
{
|
||||
if($('#import_module_name').attr('value') == 'importermagento')
|
||||
if(type_connector == 'ws')
|
||||
{
|
||||
$.scrollTo($('#steps'), 300 , {
|
||||
onAfter:function(){
|
||||
@@ -862,7 +862,7 @@ $(document).ready(function(){
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}else if ($('#import_module_name').attr('value') == 'importerosc')
|
||||
}else if (type_connector == 'db')
|
||||
{
|
||||
$.scrollTo($('#steps'), 300 , {
|
||||
onAfter:function(){
|
||||
|
||||
@@ -413,7 +413,6 @@ class shopimporter extends ImportModule
|
||||
<input type="submit" class="button" name="checkAndSaveConfig" id="checkAndSaveConfig" value="'.$this->l('Next Step').'">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>';
|
||||
return $html;
|
||||
}
|
||||
@@ -499,7 +498,7 @@ class shopimporter extends ImportModule
|
||||
$json['hasError'] = true;
|
||||
$json['error'] = $errors;
|
||||
}
|
||||
|
||||
|
||||
if ($save || Tools::isSubmit('syncLang') || Tools::isSubmit('syncLangWS'))
|
||||
{
|
||||
//add language if not exist in prestashop
|
||||
@@ -551,21 +550,21 @@ class shopimporter extends ImportModule
|
||||
$table = $this->supportedImports[strtolower($className)]['table'];
|
||||
|
||||
$object = new $className();
|
||||
|
||||
|
||||
$rules = call_user_func(array($className, 'getValidationRules'), $className);
|
||||
|
||||
|
||||
|
||||
if ((sizeof($rules['requiredLang']) || sizeof($rules['sizeLang']) || sizeof($rules['validateLang']) || Tools::isSubmit('syncLangWS') || Tools::isSubmit('syncCurrency')))
|
||||
{
|
||||
$moduleName = Tools::getValue('moduleName');
|
||||
if (file_exists('../../modules/'.$moduleName.'/'.$moduleName.'.php'))
|
||||
{
|
||||
|
||||
|
||||
require_once('../../modules/'.$moduleName.'/'.$moduleName.'.php');
|
||||
$importModule = new $moduleName();
|
||||
|
||||
$defaultLanguage = new Language((int)Configuration::get('PS_LANG_DEFAULT'));
|
||||
|
||||
|
||||
$languages = $importModule->getLangagues();
|
||||
|
||||
if (Tools::isSubmit('syncLangWS'))
|
||||
@@ -573,10 +572,10 @@ class shopimporter extends ImportModule
|
||||
$defaultIdLand = $importModule->getDefaultIdLang();
|
||||
$defaultLanguageImport = new Language(Language::getIdByIso($languages[$defaultIdLand]['iso_code']));
|
||||
if ($defaultLanguage->iso_code != $defaultLanguageImport->iso_code)
|
||||
$errors[] = $this->l('Default language doesn\'t match : ').'<br>'.Configuration::get('PS_SHOP_NAME').' : '.$defaultLanguage->name.' ≠
|
||||
$errors[] = $this->l('Default language doesn\'t match : ').'<br>'.Configuration::get('PS_SHOP_NAME').' : '.$defaultLanguage->name.' ≠
|
||||
'.$importModule->displayName.' : '.$defaultLanguageImport->name.'<br>'.$this->l('Please change default language in your configuration');
|
||||
}
|
||||
|
||||
|
||||
if (Tools::isSubmit('syncCurrency'))
|
||||
{
|
||||
$defaultIdCurrency = $importModule->getDefaultIdCurrency();
|
||||
@@ -585,7 +584,7 @@ class shopimporter extends ImportModule
|
||||
$defaultCurrencyImport = new Currency((int)Currency::getIdByIsoCode($currencies[$defaultIdCurrency]['iso_code']));
|
||||
else
|
||||
$defaultCurrencyImport = new Currency((int)Currency::getIdByIsoCodeNum($currencies[$defaultIdCurrency]['iso_code_num']));
|
||||
|
||||
|
||||
$defaultCurrency = new Currency((int)Configuration::get('PS_CURRENCY_DEFAULT'));
|
||||
if ($defaultCurrency->iso_code != $defaultCurrencyImport->iso_code)
|
||||
$errors[] = $this->l('Default currency doesn\'t match : ').'<br>'.Configuration::get('PS_SHOP_NAME').' : '.$defaultCurrency->name.' ≠ '.$importModule->displayName.' : '.$defaultCurrencyImport->name.'<br>'.$this->l('Please change default currency in your configuration');
|
||||
@@ -596,7 +595,7 @@ class shopimporter extends ImportModule
|
||||
else
|
||||
die('{"hasError" : true, "error" : ["FATAL ERROR"], "datas" : []}');
|
||||
}
|
||||
|
||||
|
||||
foreach($fields as $key => $field)
|
||||
{
|
||||
$id = $this->supportedImports[strtolower($className)]['identifier'];
|
||||
@@ -616,7 +615,7 @@ class shopimporter extends ImportModule
|
||||
array_unshift($errors[sizeof($errors)-1], $field[$id]);
|
||||
}
|
||||
}
|
||||
if (sizeof($errors) > 0)
|
||||
if (sizeof($errors) > 0)
|
||||
{
|
||||
$json['hasError'] = true;
|
||||
$json['error'] = $errors;
|
||||
@@ -652,14 +651,14 @@ class shopimporter extends ImportModule
|
||||
if ($className == 'Category' AND (sizeof($fields) != (int)Tools::getValue('nbr_import')))
|
||||
$this->updateCat();
|
||||
}
|
||||
if (sizeof($errors) > 0 AND is_array($errors))
|
||||
if (sizeof($errors) > 0 AND is_array($errors))
|
||||
{
|
||||
$json['hasError'] = true;
|
||||
$json['error'] = $errors;
|
||||
}
|
||||
die(Tools::jsonEncode($json));
|
||||
}
|
||||
|
||||
|
||||
private function saveObject($className, $items)
|
||||
{
|
||||
$return = array();
|
||||
@@ -667,13 +666,14 @@ class shopimporter extends ImportModule
|
||||
//creating temporary fields for identifiers matching and password
|
||||
if (array_key_exists('alterTable', $this->supportedImports[strtolower($className)]))
|
||||
$this->alterTable(strtolower($className));
|
||||
$matchIdLang = $this->getMatchIdLang(1);
|
||||
foreach($items as $item)
|
||||
{
|
||||
$object = new $className;
|
||||
$id = $item[$this->supportedImports[strtolower($className)]['identifier']];
|
||||
if (array_key_exists('foreign_key', $this->supportedImports[strtolower($className)]))
|
||||
$this->replaceForeignKey($item, $table);
|
||||
$matchIdLang = $this->getMatchIdLang(1);
|
||||
|
||||
foreach($item as $key => $val)
|
||||
{
|
||||
if ($key == 'passwd')
|
||||
@@ -683,14 +683,16 @@ class shopimporter extends ImportModule
|
||||
}
|
||||
if (is_array($val) AND $key != 'images')
|
||||
{
|
||||
|
||||
$tmp = array();
|
||||
foreach($matchIdLang as $k => $v)
|
||||
if (($k != $v) AND array_key_exists($k, $val))
|
||||
{
|
||||
$item[$key][$v] = $val[$k];
|
||||
unset($item[$key][$k]);
|
||||
if (array_key_exists($k, $val))
|
||||
{
|
||||
$tmp[$v] = $val[$k];
|
||||
}
|
||||
$object->$key = $item[$key];
|
||||
}
|
||||
|
||||
$object->$key = $tmp;
|
||||
}
|
||||
else
|
||||
$object->$key = $val;
|
||||
@@ -863,7 +865,7 @@ class shopimporter extends ImportModule
|
||||
foreach($item['images'] as $key => $image)
|
||||
{
|
||||
$tmpfile = tempnam(_PS_TMP_IMG_DIR_, 'import');
|
||||
if (@copy($image, $tmpfile))
|
||||
if (@copy(str_replace(' ', '%20', $image), $tmpfile))
|
||||
{
|
||||
|
||||
$imagesTypes = ImageType::getImagesTypes($type);
|
||||
@@ -1089,9 +1091,10 @@ class shopimporter extends ImportModule
|
||||
$returnErrors[] = $this->l('the field').' <b>'.call_user_func(array($className, 'displayFieldName'), $fieldLang, $className).' ('.$language['name'].')</b> '.$this->l('is too long').' ('.$maxLength.' '.$this->l('chars max').')';
|
||||
/* Checking for multilingual fields validity */
|
||||
foreach ($rules['validateLang'] AS $fieldLang => $function)
|
||||
{
|
||||
foreach ($languages AS $language)
|
||||
{
|
||||
if (array_key_exists($fieldLang, $fields) AND ($value = $fields[$fieldLang][$language['id_lang']]) !== false AND !empty($value))
|
||||
if (array_key_exists($fieldLang, $fields) AND array_key_exists($language['id_lang'], $fields[$fieldLang]) AND ($value = $fields[$fieldLang][$language['id_lang']]) !== false AND !empty($value))
|
||||
{
|
||||
if (!Validate::$function($value))
|
||||
if ($hasErrors == 2)
|
||||
@@ -1107,6 +1110,7 @@ class shopimporter extends ImportModule
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return $returnErrors;
|
||||
}
|
||||
|
||||
@@ -1152,8 +1156,8 @@ class shopimporter extends ImportModule
|
||||
}
|
||||
else
|
||||
$returnErrors[] = $this->l('the field').' <b>'.call_user_func(array($className, 'displayFieldName'), $field, $className).'</b> '.$this->l('is invalid');
|
||||
|
||||
|
||||
|
||||
|
||||
return $returnErrors;
|
||||
}
|
||||
public function checkAndAddLang ($languages, $add = true)
|
||||
@@ -1233,9 +1237,9 @@ class shopimporter extends ImportModule
|
||||
Db::getInstance()->execute('TRUNCATE TABLE `'._DB_PREFIX_.'country_lang');
|
||||
Db::getInstance()->execute('TRUNCATE TABLE `'._DB_PREFIX_.'country');
|
||||
case 'group' :
|
||||
Db::getInstance()->execute('TRUNCATE TABLE `'._DB_PREFIX_.'customer_group');
|
||||
Db::getInstance()->execute('TRUNCATE TABLE `'._DB_PREFIX_.'ps_group_lang');
|
||||
Db::getInstance()->execute('TRUNCATE TABLE `'._DB_PREFIX_.'group');
|
||||
Db::getInstance()->Execute('TRUNCATE TABLE `'._DB_PREFIX_.'customer_group');
|
||||
Db::getInstance()->Execute('TRUNCATE TABLE `'._DB_PREFIX_.'group_lang');
|
||||
Db::getInstance()->Execute('TRUNCATE TABLE `'._DB_PREFIX_.'group');
|
||||
break;
|
||||
case 'combination' :
|
||||
Db::getInstance()->execute('TRUNCATE TABLE `'._DB_PREFIX_.'product_attribute');
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<module>
|
||||
<name>shoppingfluxexport</name>
|
||||
<displayName><![CDATA[Export Shopping Flux]]></displayName>
|
||||
<version><![CDATA[1.4.1]]></version>
|
||||
<description><![CDATA[Export du catalogue pour Shopping Flux]]></description>
|
||||
<author><![CDATA[]]></author>
|
||||
<tab><![CDATA[advertising_marketing]]></tab>
|
||||
<confirmUninstall>Êtes-vous sur de vouloir supprimer ce module ?</confirmUninstall>
|
||||
<is_configurable>1</is_configurable>
|
||||
<need_instance>1</need_instance>
|
||||
<limited_countries></limited_countries>
|
||||
</module>
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2011 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2011 PrestaShop SA
|
||||
* @version Release: $Revision: 9074 $
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
include(dirname(__FILE__).'/../../config/config.inc.php');
|
||||
include(dirname(__FILE__).'/../../init.php');
|
||||
|
||||
include(dirname(__FILE__).'/shoppingfluxexport.php');
|
||||
@ini_set('display_errors', 'off');
|
||||
|
||||
$f = new shoppingfluxexport();
|
||||
echo $f->generateFlux();
|
||||
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
|
||||
global $_MODULE;
|
||||
$_MODULE = array();
|
||||
$_MODULE['<{shoppingfluxexport}prestashop>shoppingfluxexport_fea9f8736d4903ba7394eae6c6c4a48b'] = 'Export Shopping Flux';
|
||||
$_MODULE['<{shoppingfluxexport}prestashop>shoppingfluxexport_532e375ed3b53b3c888a6bf214329e60'] = 'Export du catalogue pour Shopping Flux';
|
||||
$_MODULE['<{shoppingfluxexport}prestashop>shoppingfluxexport_5abb27355099ec51416a3f003fe63711'] = 'Êtes-vous sur de vouloir supprimer ce module ?';
|
||||
$_MODULE['<{shoppingfluxexport}prestashop>shoppingfluxexport_68a59c7fd2c1bf8103225a22a6088235'] = 'Adresse du fichier :';
|
||||
|
After Width: | Height: | Size: 980 B |
@@ -0,0 +1,208 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2011 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2011 PrestaShop SA
|
||||
* @version Release: $Revision: 9074 $
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
if (!defined('_PS_VERSION_'))
|
||||
exit;
|
||||
|
||||
class shoppingfluxexport extends Module
|
||||
{
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->name = 'shoppingfluxexport';
|
||||
$this->tab = 'advertising_marketing';
|
||||
$this->version = '1.4.1';
|
||||
|
||||
parent::__construct();
|
||||
|
||||
$this->displayName = $this->l('Export Shopping Flux');
|
||||
$this->description = $this->l('Export du catalogue pour Shopping Flux');
|
||||
$this->confirmUninstall = $this->l('Êtes-vous sur de vouloir supprimer ce module ?');
|
||||
}
|
||||
|
||||
public function install()
|
||||
{
|
||||
// Create Token
|
||||
if (!Configuration::updateValue('SHOPPING_FLUX_TOKEN', md5(rand())))
|
||||
return false;
|
||||
|
||||
// Install Module
|
||||
if (!parent::install())
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public function uninstall()
|
||||
{
|
||||
// Delete Token
|
||||
if (!Configuration::deleteByName('SHOPPING_FLUX_TOKEN'))
|
||||
return false;
|
||||
|
||||
// Uninstall Module
|
||||
if (!parent::uninstall())
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public function getContent()
|
||||
{
|
||||
if (isset($_POST['generateFlux']) && $_POST['generateFlux'] != NULL)
|
||||
$this->generateFlux();
|
||||
|
||||
$uri = 'http://'.$_SERVER['HTTP_HOST'].__PS_BASE_URI__.'modules/shoppingfluxexport/flux.php?token='.Configuration::get('SHOPPING_FLUX_TOKEN');
|
||||
|
||||
$this->_html = '<h2>'.$this->displayName.'</h2>
|
||||
<form method="post" action="'.htmlentities($_SERVER['REQUEST_URI']).'">
|
||||
<fieldset>
|
||||
<legend>'.$this->l('Export Shopping Flux').'</legend>
|
||||
|
||||
<p>'.$this->l('Adresse du fichier :').'
|
||||
<a href="'.$uri.'" target="_blank">
|
||||
'.$uri.'</a></p>
|
||||
</fieldset>
|
||||
|
||||
</form>
|
||||
';
|
||||
|
||||
return $this->_html;
|
||||
}
|
||||
|
||||
private function clean($string)
|
||||
{
|
||||
|
||||
$string = str_replace("\r\n", " ", $string);
|
||||
$string = str_replace("|", " ", $string);
|
||||
|
||||
return $string;
|
||||
}
|
||||
|
||||
public function generateFlux()
|
||||
{
|
||||
if (Tools::getValue('token') == '' || Tools::getValue('token') != Configuration::get('SHOPPING_FLUX_TOKEN'))
|
||||
die('Invalid Token');
|
||||
|
||||
$titles = array(
|
||||
0 => 'id_produit',
|
||||
1 => 'nom_produit',
|
||||
2 => 'url_produit',
|
||||
3 => 'url_image',
|
||||
4 => 'description',
|
||||
5 => 'description_courte',
|
||||
6 => 'prix',
|
||||
7 => 'prix_barre',
|
||||
8 => 'frais_de_port',
|
||||
9 => 'delaiLiv',
|
||||
10 => 'marque',
|
||||
11 => 'rayon',
|
||||
12 => 'stock',
|
||||
13 => 'qte_stock',
|
||||
14 => 'EAN',
|
||||
15 => 'poids',
|
||||
16 => 'ecotaxe',
|
||||
17 => 'TVA',
|
||||
18 => 'Reference constructeur',
|
||||
19 => 'Reference fournisseur'
|
||||
);
|
||||
|
||||
echo implode("|", $titles)."\r\n";
|
||||
|
||||
//For Shipping
|
||||
$configuration = Configuration::getMultiple(array('PS_TAX_ADDRESS_TYPE','PS_CARRIER_DEFAULT','PS_COUNTRY_DEFAULT', 'PS_LANG_DEFAULT', 'PS_SHIPPING_FREE_PRICE', 'PS_SHIPPING_HANDLING', 'PS_SHIPPING_METHOD', 'PS_SHIPPING_FREE_WEIGHT'));
|
||||
|
||||
$products = Product::getSimpleProducts($configuration['PS_LANG_DEFAULT']);
|
||||
|
||||
$defaultCountry = new Country($configuration['PS_COUNTRY_DEFAULT'], Configuration::get('PS_LANG_DEFAULT'));
|
||||
$id_zone = (int)$defaultCountry->id_zone;
|
||||
|
||||
$carrier = new Carrier((int)$configuration['PS_CARRIER_DEFAULT']);
|
||||
$carrierTax = Tax::getCarrierTaxRate((int)$carrier->id, (int)$this->{$configuration['PS_TAX_ADDRESS_TYPE']});
|
||||
|
||||
foreach ($products as $key => $produit)
|
||||
{
|
||||
$product = new Product((int)($produit['id_product']), true, $configuration['PS_LANG_DEFAULT']);
|
||||
|
||||
//For links
|
||||
$link = new Link();
|
||||
|
||||
//For images
|
||||
$cover = $product->getCover($product->id);
|
||||
$ids = $product->id.'-'.$cover['id_image'];
|
||||
|
||||
//For shipping
|
||||
|
||||
if ($product->getPrice(true, NULL, 2, NULL, false, true, 1) >= (float)($configuration['PS_SHIPPING_FREE_PRICE']) AND (float)($configuration['PS_SHIPPING_FREE_PRICE']) > 0)
|
||||
$shipping = 0;
|
||||
elseif (isset($configuration['PS_SHIPPING_FREE_WEIGHT']) AND $product->weight >= (float)($configuration['PS_SHIPPING_FREE_WEIGHT']) AND (float)($configuration['PS_SHIPPING_FREE_WEIGHT']) > 0)
|
||||
$shipping = 0;
|
||||
else
|
||||
{
|
||||
if (isset($configuration['PS_SHIPPING_HANDLING']) AND $carrier->shipping_handling)
|
||||
$shipping = (float)($configuration['PS_SHIPPING_HANDLING']);
|
||||
|
||||
if ($carrier->getShippingMethod() == Carrier::SHIPPING_METHOD_WEIGHT)
|
||||
$shipping += $carrier->getDeliveryPriceByWeight($product->weight, $id_zone);
|
||||
else
|
||||
$shipping += $carrier->getDeliveryPriceByPrice($product->getPrice(true, NULL, 2, NULL, false, true, 1), $id_zone);
|
||||
|
||||
$shipping *= 1 + ($carrierTax / 100);
|
||||
$shipping = (float)(Tools::ps_round((float)($shipping), 2));
|
||||
|
||||
}
|
||||
|
||||
$data = array();
|
||||
$data[0] = $product->id;
|
||||
$data[1] = $product->name;
|
||||
$data[2] = $link->getProductLink($product);
|
||||
$data[3] = $link->getImageLink($product->link_rewrite, $ids, 'large');
|
||||
$data[4] = $product->description;
|
||||
$data[5] = $product->description_short;
|
||||
$data[6] = $product->getPrice(true, NULL, 2, NULL, false, true, 1);
|
||||
$data[7] = $product->getPrice(true, NULL, 2, NULL, false, false, 1);
|
||||
$data[8] = $shipping;
|
||||
$data[9] = $carrier->delay[2];
|
||||
$data[10] = $product->manufacturer_name;
|
||||
$data[11] = $product->category;
|
||||
$data[12] = ($product->quantity > 0) ? 'oui' : 'non';
|
||||
$data[13] = $product->quantity;
|
||||
$data[14] = $product->ean13;
|
||||
$data[15] = $product->weight;
|
||||
$data[16] = $product->ecotax;
|
||||
$data[17] = $product->tax_rate;
|
||||
$data[18] = $product->reference;
|
||||
$data[19] = $product->supplier_reference;
|
||||
|
||||
foreach($data as $key => $value)
|
||||
$data[$key] = $this->clean($value);
|
||||
|
||||
echo implode("|", $data)."\r\n";
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,12 +80,9 @@ class StatsForecast extends Module
|
||||
$currency = $this->context->currency;
|
||||
$employee = $this->context->employee;
|
||||
|
||||
// @todo use PHP functions to get timestamp ...
|
||||
$result = $db->getRow('SELECT UNIX_TIMESTAMP(\'2009-06-05 00:00:00\') as t1, UNIX_TIMESTAMP(\''.$employee->stats_date_from.' 00:00:00\') as t2');
|
||||
$from = max($result['t1'], $result['t2']);
|
||||
$from = max(strtotime(_PS_CREATION_DATE_.' 00:00:00'), strtotime($employee->stats_date_from.' 00:00:00'));
|
||||
$to = strtotime($employee->stats_date_to.' 23:59:59');
|
||||
$result2 = $db->getRow('SELECT UNIX_TIMESTAMP(NOW()) as t1, UNIX_TIMESTAMP(\''.$employee->stats_date_to.' 23:59:59\') as t2');
|
||||
$to2 = min($result2['t1'], $result2['t2']);
|
||||
$to2 = min(time(), $to);
|
||||
$interval = ($to - $from) / 60 / 60 / 24;
|
||||
$interval2 = ($to2 - $from) / 60 / 60 / 24;
|
||||
$prop30 = $interval / $interval2;
|
||||
@@ -99,18 +96,17 @@ class StatsForecast extends Module
|
||||
if ($this->context->cookie->stats_granularity == 42)
|
||||
$intervalAvg = $interval2 / 7;
|
||||
|
||||
// @todo : to remove
|
||||
if (!defined('PS_BASE_URI'))
|
||||
define('PS_BASE_URI', '/');
|
||||
$result = $db->getRow('SELECT UNIX_TIMESTAMP(\'2009-06-05\') as t1, UNIX_TIMESTAMP(\''.$employee->stats_date_from.'\') as t2');
|
||||
$from = max($result['t1'], $result['t2']);
|
||||
$to = strtotime($employee->stats_date_to.'');
|
||||
$dataTable = array();
|
||||
if ($cookie->stats_granularity == 10)
|
||||
for ($i = $from; $i <= $to2; $i = strtotime('+1 day', $i))
|
||||
$dataTable[date('Y-m-d', $i)] = array('fix_date' => date('Y-m-d', $i), 'countOrders' => 0, 'countProducts' => 0, 'totalProducts' => 0);
|
||||
|
||||
$dateFromGAdd = ($this->context->cookie->stats_granularity != 42
|
||||
? 'SUBSTRING(date_add, 1, '.(int)$this->context->cookie->stats_granularity.')'
|
||||
? 'LEFT(date_add, '.(int)$this->context->cookie->stats_granularity.')'
|
||||
: 'IFNULL(MAKEDATE(YEAR(date_add),DAYOFYEAR(date_add)-WEEKDAY(date_add)), CONCAT(YEAR(date_add),"-01-01*"))');
|
||||
|
||||
$dateFromGInvoice = ($this->context->cookie->stats_granularity != 42
|
||||
? 'SUBSTRING(invoice_date, 1, '.(int)$this->context->cookie->stats_granularity.')'
|
||||
? 'LEFT(invoice_date, '.(int)$this->context->cookie->stats_granularity.')'
|
||||
: 'IFNULL(MAKEDATE(YEAR(invoice_date),DAYOFYEAR(invoice_date)-WEEKDAY(invoice_date)), CONCAT(YEAR(invoice_date),"-01-01*"))');
|
||||
|
||||
$sql = 'SELECT
|
||||
@@ -128,17 +124,8 @@ class StatsForecast extends Module
|
||||
ORDER BY fix_date';
|
||||
$result = $db->executeS($sql, false);
|
||||
|
||||
$dataTable = array();
|
||||
if ($this->context->cookie->stats_granularity == 10)
|
||||
{
|
||||
$dateEnd = strtotime($employee->stats_date_to.' 23:59:59');
|
||||
$dateToday = time();
|
||||
for ($i = strtotime($employee->stats_date_from.' 00:00:00'); $i <= $dateEnd && $i <= $dateToday; $i += 86400)
|
||||
$dataTable[$i] = array('fix_date' => date('Y-m-d', $i), 'countOrders' => 0, 'countProducts' => 0, 'totalProducts' => 0);
|
||||
}
|
||||
|
||||
while ($row = $db->nextRow($result))
|
||||
$dataTable[strtotime($row['fix_date'])] = $row;
|
||||
$dataTable[$row['fix_date']] = $row;
|
||||
|
||||
$this->_html .= '<div>
|
||||
<fieldset><legend><img src="../modules/'.$this->name.'/logo.gif" /> '.$this->displayName.'</legend>
|
||||
|
||||
@@ -319,6 +319,12 @@ class ThemeInstallator extends Module
|
||||
*/
|
||||
public function getContent()
|
||||
{
|
||||
/* PrestaShop demo mode */
|
||||
if (_PS_MODE_DEMO_)
|
||||
{
|
||||
return '<div class="error">'.Tools::displayError('This functionnality has been disabled.').'</div>';
|
||||
|
||||
}
|
||||
self::init_defines();
|
||||
if (!Tools::isSubmit('cancelExport') AND $this->page == 'exportPage')
|
||||
return self::getContentExport();
|
||||
|
||||
|
After Width: | Height: | Size: 9.7 KiB |
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
|
||||
class OrderInfoTnt
|
||||
{
|
||||
private $_idOrder;
|
||||
|
||||
public function __construct($id_order)
|
||||
{
|
||||
$this->_idOrder = $id_order;
|
||||
}
|
||||
|
||||
public function getInfo()
|
||||
{
|
||||
$info = Db::getInstance()->ExecuteS('SELECT o.shipping_number, a.lastname, a.firstname, a.address1, a.address2, a.postcode, a.city, a.phone, c.email, c.id_customer, a.company
|
||||
FROM `'._DB_PREFIX_.'orders` as o, `'._DB_PREFIX_.'address` as a, `'._DB_PREFIX_.'customer` as c
|
||||
WHERE o.id_order = "'.$this->_idOrder.'" AND a.id_address = o.id_address_delivery AND c.id_customer = o.id_customer');
|
||||
if (!$info)
|
||||
return false;
|
||||
$weight = Db::getInstance()->ExecuteS('SELECT p.weight, o.product_quantity
|
||||
FROM `'._DB_PREFIX_.'order_detail` as o, `'._DB_PREFIX_.'product` as p
|
||||
WHERE o.id_order = "'.$this->_idOrder.'" AND p.id_product = o.product_id');
|
||||
$option = Db::getInstance()->ExecuteS('SELECT t.option
|
||||
FROM `'._DB_PREFIX_.'tnt_carrier_option` as t , `'._DB_PREFIX_.'orders` as o
|
||||
WHERE t.id_carrier = o.id_carrier AND o.id_order = "'.$this->_idOrder.'"');
|
||||
if ($option != null && strpos($option[0]['option'], "D") !== false)
|
||||
$dropOff = Db::getInstance()->ExecuteS('SELECT d.code, d.name, d.address, d.zipcode, d.city
|
||||
FROM `'._DB_PREFIX_.'tnt_carrier_drop_off` as d , `'._DB_PREFIX_.'orders` as o
|
||||
WHERE d.id_cart = o.id_cart AND o.id_order = "'.$this->_idOrder.'"');
|
||||
$w = 0;
|
||||
$tooBig = false;
|
||||
foreach ($weight as $key => $val)
|
||||
{
|
||||
while ($val['product_quantity'] > 0)
|
||||
{
|
||||
if ((int)($val['weight']) > 20)
|
||||
return "Un ou plusieurs articles sont supérieurs à 20 Kg<br/>Vous devez contacter votre commercial TNT";
|
||||
if ($w + $val['weight'] > 20)
|
||||
{
|
||||
$info[1]['weight'][] = (string)($w);
|
||||
$w = $val['weight'];
|
||||
}
|
||||
else
|
||||
$w += $val['weight'];
|
||||
$val['product_quantity']--;
|
||||
}
|
||||
}
|
||||
$info[1]['weight'][] = (string)($w);
|
||||
|
||||
if (date("N") == 5)
|
||||
$next_day = date("Y-m-d", mktime(0, 0, 0, date("m") , date("d")+3, date("Y")));
|
||||
elseif (date("N") == 6)
|
||||
$next_day = date("Y-m-d", mktime(0, 0, 0, date("m") , date("d")+2, date("Y")));
|
||||
else
|
||||
$next_day = date("Y-m-d", mktime(0, 0, 0, date("m") , date("d")+1, date("Y")));
|
||||
$newDate = Tools::getValue('dateErrorOrder');
|
||||
$info[2] = array('delivery_date' => ($newDate != '' ? $newDate : $next_day));
|
||||
if ($option)
|
||||
$info[3] = array('option' => $option[0]['option']);
|
||||
if (isset($dropOff))
|
||||
$info[4] = $dropOff[0];
|
||||
else
|
||||
$info[4] = null;
|
||||
return $info;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
class PackageTnt
|
||||
{
|
||||
private $_idOrder;
|
||||
private $_order;
|
||||
|
||||
public function __construct($id_order)
|
||||
{
|
||||
$this->_idOrder = $id_order;
|
||||
$this->_order = new Order((int)($this->_idOrder));
|
||||
}
|
||||
|
||||
public function setShippingNumber($number)
|
||||
{
|
||||
if ($this->_order->shipping_number == '')
|
||||
{
|
||||
$this->_order->shipping_number = $number;
|
||||
$this->_order->update();
|
||||
}
|
||||
$this->insertSql($number);
|
||||
}
|
||||
|
||||
public function getShippingNumber()
|
||||
{
|
||||
$tab = Db::getInstance()->ExecuteS('SELECT `shipping_number` FROM `'._DB_PREFIX_.'tnt_carrier_shipping_number` WHERE `id_order` = "'.(int)($this->_idOrder).'"');
|
||||
return ($tab);
|
||||
}
|
||||
|
||||
public function insertSql($number)
|
||||
{
|
||||
Db::getInstance()->ExecuteS('INSERT INTO `'._DB_PREFIX_.'tnt_carrier_shipping_number` (`id_order`, `shipping_number`)
|
||||
VALUES ("'.(int)($this->_idOrder).'", "'.$number.'")');
|
||||
}
|
||||
|
||||
public function getOrder()
|
||||
{
|
||||
return ($this->_order);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,238 @@
|
||||
<?php
|
||||
class TntWebService
|
||||
{
|
||||
private $_login;
|
||||
private $_password;
|
||||
private $_account;
|
||||
private $authheader;
|
||||
private $authvars;
|
||||
private $header;
|
||||
private $file;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->_login = Configuration::get('TNT_CARRIER_LOGIN');
|
||||
$this->_password = Configuration::get('TNT_CARRIER_PASSWORD');
|
||||
$this->_account = Configuration::get('TNT_CARRIER_NUMBER_ACCOUNT');
|
||||
|
||||
$this->_authheader = $this->genAuth();
|
||||
$this->_authvars = new SoapVar($this->_authheader, XSD_ANYXML);
|
||||
$this->_header = new SoapHeader("http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd", "Security", $this->_authvars);
|
||||
$this->_file = "http://www.tnt.fr/service/?wsdl";
|
||||
}
|
||||
|
||||
public function genAuth()
|
||||
{
|
||||
return sprintf('
|
||||
<wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
|
||||
<wsse:UsernameToken>
|
||||
<wsse:Username>%s</wsse:Username>
|
||||
<wsse:Password>%s</wsse:Password>
|
||||
</wsse:UsernameToken>
|
||||
</wsse:Security>', htmlspecialchars($this->_login), htmlspecialchars($this->_password));
|
||||
}
|
||||
|
||||
public function faisabilite($dateExpedition, $codePostalDepart, $communeDepart, $codePostalArrivee, $communeArrivee, $typeDestinataire)
|
||||
{
|
||||
$soapclient = new SoapClient($this->_file, array('trace'=>1));
|
||||
$soapclient->__setSOAPHeaders(array($this->_header));
|
||||
|
||||
$sender = array("zipCode" => $codePostalDepart, "city" => $communeDepart);
|
||||
$receiver = array("zipCode" => $codePostalArrivee, "city" => $communeArrivee, "type" => $typeDestinataire);
|
||||
$parameters = array("accountNumber" => $this->_account, "shippingDate" => $dateExpedition, "sender" => $sender, "receiver" => $receiver);
|
||||
$services = $soapclient->feasibility(array('parameters' => $parameters));
|
||||
return ($services);
|
||||
}
|
||||
|
||||
public function putCityInNormeTnt($city)
|
||||
{
|
||||
$city = iconv("utf-8", 'ASCII//TRANSLIT', $city);
|
||||
$city = mb_strtoupper($city, 'utf-8');
|
||||
$table = array('`' => '','\''=> '', '^' => '','À'=>'A', 'Á'=>'A', 'Â'=>'A', 'Ã'=>'A', 'Ä'=>'A', 'Å'=>'A', 'Æ'=>'A', 'Ç'=>'C', 'È'=>'E', 'É'=>'E',
|
||||
'Ê'=>'E', 'Ë'=>'E', 'Ì'=>'I', 'Í'=>'I', 'Î'=>'I', 'Ï'=>'I', 'Ñ'=>'N', 'Ò'=>'O', 'Ó'=>'O', 'Ô'=>'O',
|
||||
'Õ'=>'O', 'Ö'=>'O', 'Ø'=>'O', 'Ù'=>'U', 'Ú'=>'U', 'Û'=>'U', 'Ü'=>'U', 'Ý'=>'Y', 'Þ'=>'B');
|
||||
$city = strtr($city, $table);
|
||||
$old = array("SAINT", "-");
|
||||
$new = array("ST", " ");
|
||||
return (str_replace($old, $new, $city));
|
||||
}
|
||||
|
||||
public function getPackage($info)
|
||||
{
|
||||
$soapclient = new SoapClient($this->_file, array('trace'=>1));
|
||||
$soapclient->__setSOAPHeaders(array($this->_header));
|
||||
|
||||
$sender = array(
|
||||
'type' => (Configuration::get('TNT_CARRIER_SHIPPING_COLLECT') ? "ENTERPRISE" : "DEPOT"), //ENTREPRISE OR DEPOT
|
||||
'typeId' => (Configuration::get('TNT_CARRIER_SHIPPING_COLLECT') ? "" : Configuration::get('TNT_CARRIER_SHIPPING_PEX')) , // code PEX if DEPOT is ON
|
||||
'name' => Configuration::get('TNT_CARRIER_SHIPPING_COMPANY'), // raison social
|
||||
'address1' => Configuration::get('TNT_CARRIER_SHIPPING_ADDRESS1'),
|
||||
'address2' => Configuration::get('TNT_CARRIER_SHIPPING_ADDRESS2'),
|
||||
'zipCode' => Configuration::get('TNT_CARRIER_SHIPPING_ZIPCODE'),
|
||||
'city' => $this->putCityInNormeTnt(Configuration::get('TNT_CARRIER_SHIPPING_CITY')),
|
||||
'contactLastName' => Configuration::get('TNT_CARRIER_SHIPPING_LASTNAME'),
|
||||
'contactFirstName' => Configuration::get('TNT_CARRIER_SHIPPING_FIRSTNAME'),
|
||||
'emailAddress' => Configuration::get('TNT_CARRIER_SHIPPING_EMAIL'),
|
||||
'phoneNumber' => Configuration::get('TNT_CARRIER_SHIPPING_PHONE'),
|
||||
'faxNumber' => '' //may be later
|
||||
);
|
||||
|
||||
if ($info[4] == null)
|
||||
$receiver = array(
|
||||
'type' => ($info[0]['company'] != '' ? "ENTERPRISE" : 'INDIVIDUAL'), // ENTREPRISE DEPOT DROPOFFPOINT INDIVIDUAL
|
||||
'typeId' => '', // IF DEPOT => code PEX else if DROPOFFPOINT => XETT
|
||||
'name' => ($info[0]['company'] != '' ? $info[0]['company'] : ''),
|
||||
'address1' => $info[0]['address1'],
|
||||
'address2' => $info[0]['address2'],
|
||||
'zipCode' => $info[0]['postcode'],
|
||||
'city' => $this->putCityInNormeTnt($info[0]['city']),
|
||||
'instructions' => '',
|
||||
'contactLastName' => $info[0]['lastname'],
|
||||
'contactFirstName' => $info[0]['firstname'],
|
||||
'emailAddress' => $info[0]['email'],
|
||||
'phoneNumber' => $info[0]['phone'],
|
||||
'accessCode' => '',
|
||||
'floorNumber' => '',
|
||||
'buildingId' => '',
|
||||
'sendNotification' => ''
|
||||
);
|
||||
else
|
||||
$receiver = array(
|
||||
'type' => 'DROPOFFPOINT', // ENTREPRISE DEPOT DROPOFFPOINT INDIVIDUAL
|
||||
'typeId' => $info[4]['code'], // IF DEPOT => code PEX else if DROPOFFPOINT => XETT
|
||||
'name' => $info[4]['name'],
|
||||
'address1' => $info[4]['address'],
|
||||
'address2' => '',
|
||||
'zipCode' => $info[4]['zipcode'],
|
||||
'city' => $info[4]['city'],
|
||||
'instructions' => '',
|
||||
'contactLastName' => $info[0]['lastname'],
|
||||
'contactFirstName' => $info[0]['firstname'],
|
||||
'emailAddress' => $info[0]['email'],
|
||||
'phoneNumber' => $info[0]['phone'],
|
||||
'accessCode' => '',
|
||||
'floorNumber' => '',
|
||||
'buildingId' => '',
|
||||
'sendNotification' => ''
|
||||
);
|
||||
|
||||
foreach ($info[1]['weight'] as $k => $v)
|
||||
{
|
||||
$parcelRequest[$k] = array(
|
||||
'sequenceNumber' => $k + 1, // package number, there's only one at this moment
|
||||
'customerReference' => $info[0]['id_customer'], // customer ref
|
||||
'weight' => $v,
|
||||
'insuranceAmount' => '',
|
||||
'priorityGuarantee' => '',
|
||||
'comment' => ''
|
||||
);
|
||||
}
|
||||
|
||||
$parcelsRequest = array('parcelRequest' => $parcelRequest);
|
||||
|
||||
$pickUpRequest = array(
|
||||
'media' => "EMAIL",
|
||||
'faxNumber' => "",
|
||||
'emailAddress' => Configuration::get('TNT_CARRIER_SHIPPING_EMAIL'),
|
||||
'notifySuccess' => "1",
|
||||
'service' => "",
|
||||
'lastName' => "",
|
||||
'firstName' => "",
|
||||
'phoneNumber' => Configuration::get('TNT_CARRIER_SHIPPING_PHONE'),
|
||||
'closingTime' => Configuration::get('TNT_CARRIER_SHIPPING_CLOSING'),
|
||||
'instructions' => ""
|
||||
);
|
||||
|
||||
if (Configuration::get('TNT_CARRIER_SHIPPING_COLLECT') == 1)
|
||||
{
|
||||
$paremeters = array(
|
||||
'pickUpRequest' => $pickUpRequest,
|
||||
'shippingDate' => $info[2]['delivery_date'],
|
||||
'accountNumber' => Configuration::get('TNT_CARRIER_NUMBER_ACCOUNT'),
|
||||
'sender' => $sender,
|
||||
'receiver' => $receiver,
|
||||
'serviceCode' => $info[3]['option'],
|
||||
'quantity' => count($info[1]['weight']), //number of package; count($parcelsRequest)
|
||||
'parcelsRequest' => $parcelsRequest,
|
||||
'saturdayDelivery' => '0',//Configuration::get('TNT_CARRIER_SHIPPING_DELIVERY'),
|
||||
//'paybackInfo' => $paybackInfo,
|
||||
'labelFormat' => (!Configuration::get('TNT_CARRIER_PRINT_STICKER') ? "STDA4" : Configuration::get('TNT_CARRIER_PRINT_STICKER'))
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
$paremeters = array(
|
||||
'shippingDate' => $info[2]['delivery_date'],
|
||||
'accountNumber' => Configuration::get('TNT_CARRIER_NUMBER_ACCOUNT'),
|
||||
'sender' => $sender,
|
||||
'receiver' => $receiver,
|
||||
'serviceCode' => $info[3]['option'],
|
||||
'quantity' => count($info[1]['weight']), //number of package; count($parcelsRequest)
|
||||
'parcelsRequest' => $parcelsRequest,
|
||||
'saturdayDelivery' => '0',//Configuration::get('TNT_CARRIER_SHIPPING_DELIVERY'),
|
||||
//'paybackInfo' => $paybackInfo,
|
||||
'labelFormat' => (!Configuration::get('TNT_CARRIER_PRINT_STICKER') ? "STDA4" : Configuration::get('TNT_CARRIER_PRINT_STICKER'))
|
||||
);
|
||||
}
|
||||
$package = $soapclient->expeditionCreation(array('parameters' => $paremeters));
|
||||
return $package;
|
||||
}
|
||||
|
||||
public function followPackage($transport)
|
||||
{
|
||||
$soapclient = new SoapClient($this->_file, array('trace'=>1));
|
||||
$soapclient->__setSOAPHeaders(array($this->_header));
|
||||
|
||||
$reponse = $soapclient->trackingByConsignment(array('parcelNumber' => $transport));
|
||||
|
||||
if (isset($reponse->Parcel) && $reponse->Parcel)
|
||||
{
|
||||
$colis = $reponse->Parcel;
|
||||
$expediteur = $colis->sender;
|
||||
$destinataire = $colis->receiver;
|
||||
$evenements = $colis->events;
|
||||
|
||||
$requestDate = new DateTime($evenements->requestDate);
|
||||
$processDate = new DateTime($evenements->processDate);
|
||||
$arrivalDate = new DateTime($evenements->arrivalDate);
|
||||
$deliveryDepartureDate = new DateTime($evenements->deliveryDepartureDate);
|
||||
$deliveryDate = new DateTime($evenements->deliveryDate);
|
||||
}
|
||||
|
||||
$packageParam = array(
|
||||
'number' => (isset($colis->consignmentNumber) ? $colis->consignmentNumber : ''),
|
||||
'status' => (isset($colis->shortStatus) ? $colis->shortStatus : ''),
|
||||
'account_number' => (isset($colis->accountNumber) ? $colis->accountNumber : ''),
|
||||
'service' => (isset($colis->service) ? $colis->service : ''),
|
||||
'reference' => (isset($colis->reference) ? $colis->reference : ''),
|
||||
'weight' => (isset($colis->weight) ? $colis->weight : ''),
|
||||
'expediteur_name' => (isset($expediteur->name) ? $expediteur->name : ''),
|
||||
'expediteur_addr1' => (isset($expediteur->address1) ? $expediteur->address1 : ''),
|
||||
'expediteur_addr2' => (isset($expediteur->address2) ? $expediteur->address2 : ''),
|
||||
'expediteur_zipcode' => (isset($expediteur->zipCode) ? $expediteur->zipCode : ''),
|
||||
'expediteur_city' => (isset($expediteur->city) ? $expediteur->city : ''),
|
||||
'destinataire_name' => (isset($destinataire->name) ? $destinataire->name : ''),
|
||||
'destinataire_addr1' => (isset($destinataire->address1) ? $destinataire->address1 : ''),
|
||||
'destinataire_addr2' => (isset($destinataire->address2) ? $destinataire->address2 : ''),
|
||||
'destinataire_zipcode' => (isset($destinataire->zipCode) ? $destinataire->zipCode : ''),
|
||||
'destinataire_city' => (isset($destinataire->city) ? $destinataire->city : ''),
|
||||
'request' => (isset($evenements->requestDate) ? $evenements->requestDate : ''),
|
||||
'requestDate' => (isset($requestDate) && isset($evenements->requestDate) ? $requestDate : ''),
|
||||
'process' => (isset($evenements->processDate) ? $evenements->processDate : ''),
|
||||
'process_date' => (isset($processDate) && isset($evenements->processDate) ? $processDate : ''),
|
||||
'process_center' => (isset($evenements->processCenter) ? $evenements->processCenter : ''),
|
||||
'arrival' => (isset($evenements->arrivalDepartureDate) ? $evenements->arrivalDepartureDate : ''),
|
||||
'arrival_date' => (isset($arrivalDate) ? $arrivalDate : ''),
|
||||
'arrival_center' => (isset($evenements->arrivalCenter) ? $evenements->arrivalCenter : ''),
|
||||
'delivery_departure' => (isset($evenements->deliveryDepartureDate) ? $evenements->deliveryDepartureDate : ''),
|
||||
'delivery_departure_date' => (isset($deliveryDepartureDate) ? $deliveryDepartureDate : ''),
|
||||
'delivery_departure_center' => (isset($evenements->deliveryDepartureCenter) ? $evenements->deliveryDepartureCenter : ''),
|
||||
'delivery' => (isset($evenements->deliveryDate) ? $evenements->deliveryDate : ''),
|
||||
'delivery_date' => (isset($deliveryDate) ? $deliveryDate : ''),
|
||||
'long_status' => (isset($colis->longStatus) ? $colis->longStatus : ''),
|
||||
'linkPicture' => (isset($colis->primaryPODUrl) ? $colis->primaryPODUrl : '')
|
||||
);
|
||||
return $packageParam;
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2011 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2011 PrestaShop SA
|
||||
* @version Release: $Revision: 6594 $
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
|
||||
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
|
||||
|
||||
header("Cache-Control: no-store, no-cache, must-revalidate");
|
||||
header("Cache-Control: post-check=0, pre-check=0", false);
|
||||
header("Pragma: no-cache");
|
||||
|
||||
header("Location: ../../../");
|
||||
exit;
|
||||
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
|
||||
class serviceCache
|
||||
{
|
||||
private $_dateBefore;
|
||||
private $_dateNow;
|
||||
private $_idCard;
|
||||
private $_zipCode;
|
||||
|
||||
public function __construct($id_card, $zipcode)
|
||||
{
|
||||
$this->_dateBefore = date("Y-m-d H:i:s", mktime(date("H"), date("i") - 15, date("s"), date("m") , date("d"), date("Y")));
|
||||
$this->_dateNow = date('Y-m-d H:i:s');
|
||||
$this->_idCard = $id_card;
|
||||
$this->_zipCode = $zipcode;
|
||||
}
|
||||
|
||||
public function getFaisabilityAtThisTime()
|
||||
{
|
||||
if (Db::getInstance()->getValue('SELECT * FROM `'._DB_PREFIX_.'tnt_carrier_cache_service` WHERE `date` >= "'.$this->_dateBefore.'" AND `date` <= "'.$this->_dateNow.'" AND id_card = "'.(int)($this->_idCard).'" AND zipcode = "'.$this->_zipCode.'"'))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
public function deletePreviousServices()
|
||||
{
|
||||
Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'tnt_carrier_cache_service` WHERE `id_card` = "'.(int)($this->_idCard).'"');
|
||||
}
|
||||
|
||||
public static function deleteServices($idCard)
|
||||
{
|
||||
Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'tnt_carrier_cache_service` WHERE `id_card` = "'.(int)($idCard).'"');
|
||||
}
|
||||
|
||||
public function putInCache($service, $serviceRelais)
|
||||
{
|
||||
if (isset($service))
|
||||
{
|
||||
if (is_array($service->Service))
|
||||
foreach ($service->Service as $k => $v)
|
||||
Db::getInstance()->Execute('INSERT INTO `'._DB_PREFIX_.'tnt_carrier_cache_service` (`id_card`, `code`, `date`, `zipcode`) VALUES ("'.(int)($this->_idCard).'", "'.$v->serviceCode.'","'.$this->_dateNow.'", "'.$this->_zipCode.'")');
|
||||
else
|
||||
Db::getInstance()->Execute('INSERT INTO `'._DB_PREFIX_.'tnt_carrier_cache_service` (`id_card`, `code`, `date`, `zipcode`) VALUES ("'.(int)($this->_idCard).'", "'.$service->Service->serviceCode.'","'.$this->_dateNow.'", "'.$this->_zipCode.'")');
|
||||
}
|
||||
if (isset($serviceRelais))
|
||||
{
|
||||
foreach ($serviceRelais as $v)
|
||||
Db::getInstance()->Execute('INSERT INTO `'._DB_PREFIX_.'tnt_carrier_cache_service` (`id_card`, `code`, `date`, `zipcode`) VALUES ("'.(int)($this->_idCard).'", "'.$v->serviceCode.'","'.$this->_dateNow.'", "'.$this->_zipCode.'")');
|
||||
}
|
||||
}
|
||||
|
||||
public function getServices()
|
||||
{
|
||||
return (Db::getInstance()->ExecuteS('SELECT * FROM `'._DB_PREFIX_.'tnt_carrier_cache_service` WHERE id_card = "'.(int)($this->_idCard).'"'));
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<module>
|
||||
<name>tntcarrier</name>
|
||||
<displayName><![CDATA[TNT Express]]></displayName>
|
||||
<version><![CDATA[1.0]]></version>
|
||||
<description><![CDATA[Offer your customers, different delivery methods with TNT]]></description>
|
||||
<author><![CDATA[PrestaShop]]></author>
|
||||
<tab><![CDATA[shipping_logistics]]></tab>
|
||||
<is_configurable>1</is_configurable>
|
||||
<need_instance>1</need_instance>
|
||||
<limited_countries>fr</limited_countries>
|
||||
</module>
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2011 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2011 PrestaShop SA
|
||||
* @version Release: $Revision: 6594 $
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
|
||||
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
|
||||
|
||||
header("Cache-Control: no-store, no-cache, must-revalidate");
|
||||
header("Cache-Control: post-check=0, pre-check=0", false);
|
||||
header("Pragma: no-cache");
|
||||
|
||||
header("Location: ../../../");
|
||||
exit;
|
||||
@@ -0,0 +1,371 @@
|
||||
.tntRCHeader {
|
||||
background-color: #ffffff;
|
||||
background-image: url(../img/logo_24_relaiscolis.jpg);
|
||||
background-position: 10px center;
|
||||
background-repeat: no-repeat;
|
||||
border-color: gray;
|
||||
border-style: solid;
|
||||
border-width: 1px;
|
||||
color: #a0a0a0;
|
||||
display: bloc;
|
||||
font-family: arial,helvetica,sans-serif;
|
||||
font-size: 30pt;
|
||||
font-style: italic;
|
||||
height: 75px;
|
||||
padding-right: 10px;
|
||||
padding-top: 25px;
|
||||
text-align: right;
|
||||
width: 490px;
|
||||
}
|
||||
|
||||
#tntRCdetailRelaisEntete .tntRCHeader
|
||||
{
|
||||
width:590px;
|
||||
}
|
||||
|
||||
.tntRCSubHeader {
|
||||
background-color: #ffffff;
|
||||
border-width: 0px;
|
||||
color: #a0a0a0;
|
||||
display: bloc;
|
||||
font-family: arial,helvetica,sans-serif;
|
||||
font-size: 16pt;
|
||||
font-weight: bold;
|
||||
padding-bottom: 3px;
|
||||
padding-top: 3px;
|
||||
width: 500px;
|
||||
}
|
||||
|
||||
.tntRCBody {
|
||||
background-color: #ffffff;
|
||||
border-color: gray;
|
||||
border-style: solid;
|
||||
border-width: 1px;
|
||||
color: #000000;
|
||||
display: bloc;
|
||||
font-family: arial,helvetica,sans-serif;
|
||||
font-size: 12pt;
|
||||
padding-bottom: 10px;
|
||||
padding-left: 10px;
|
||||
padding-top: 10px;
|
||||
width: 490px;
|
||||
}
|
||||
|
||||
.tntRCBodySearch {
|
||||
background-color: #ffffff;
|
||||
border-color: gray;
|
||||
border-style: solid;
|
||||
border-width: 1px;
|
||||
color: #a0a0a0;
|
||||
font-family: arial,helvetica,sans-serif;
|
||||
font-size: 10pt;
|
||||
font-weight: bold;
|
||||
padding-left: 3px;
|
||||
padding-top: 8px;
|
||||
padding-bottom: 8px;
|
||||
width: 497px;
|
||||
}
|
||||
|
||||
.tntRCError {
|
||||
background-color: #ff6600;
|
||||
color: #ffffff;
|
||||
display: bloc;
|
||||
font-family: arial,helvetica,sans-serif;
|
||||
font-size: 12pt;
|
||||
font-weight: bold;
|
||||
width: 480px;
|
||||
}
|
||||
|
||||
.tntRCGray {
|
||||
background-color: #a0a0a0;
|
||||
border-width: 0px;
|
||||
display: bloc;
|
||||
font-family: arial,helvetica,sans-serif;
|
||||
font-size: 10pt;
|
||||
heigth: 12px;
|
||||
width: 480px;
|
||||
}
|
||||
|
||||
.tntRCInput {
|
||||
background-color: #ffffff;
|
||||
font-family: arial,helvetica,sans-serif;
|
||||
font-size: 10pt;
|
||||
font-weight: normal;
|
||||
text-align: center;
|
||||
width: 50px;
|
||||
}
|
||||
|
||||
.tntRCWhite {
|
||||
background-color: #ffffff;
|
||||
border-width: 0px;
|
||||
display: bloc;
|
||||
font-family: arial,helvetica,sans-serif;
|
||||
font-size: 14pt;
|
||||
width: 500px;
|
||||
}
|
||||
|
||||
.tntRCrelaisColis {
|
||||
font-family: arial,helvetica,sans-serif;
|
||||
font-size: 10px;
|
||||
color: #000000;
|
||||
border-bottom-style: solid;
|
||||
border-bottom-color: #a0a0a0;
|
||||
border-bottom-width: 1px;
|
||||
background-color: #ffffff;
|
||||
padding-bottom: 3px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.tntRCtitreMode {
|
||||
font-family: arial,helvetica,sans-serif;
|
||||
font-size: 28px;
|
||||
color: #a0a0a0;
|
||||
font-style: italic;
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
.tntRCchoix {
|
||||
font-family: arial,helvetica,sans-serif;
|
||||
font-size: 14px;
|
||||
color: #a0a0a0;
|
||||
font-weight: bold;
|
||||
background-color: #ffffff;
|
||||
}
|
||||
.tntRCdetailGros {
|
||||
font-family: arial,helvetica,sans-serif;
|
||||
font-size: 14pt;
|
||||
color: #a0a0a0;
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
.tntRCnoirPetit {
|
||||
font-family: arial,helvetica,sans-serif;
|
||||
font-size: 12pt;
|
||||
color: #000000;
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
.tntRCdetailPetit {
|
||||
font-family: arial,helvetica,sans-serif;
|
||||
font-size: 12pt;
|
||||
color: #a0a0a0;
|
||||
background-color: #ffffff;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.tntRCentree {
|
||||
font-family: arial,helvetica,sans-serif;
|
||||
font-size: 12pt;
|
||||
color: #000000;
|
||||
background-color: #ffffff;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.tntRCgris {
|
||||
font-family: arial,helvetica,sans-serif;
|
||||
font-size: 10pt;
|
||||
color: #ffffff;
|
||||
background-color: #a0a0a0;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
table.tntRCHoraire td {
|
||||
border: 1px solid gray;
|
||||
font-family: arial,helvetica,sans-serif;
|
||||
font-size: 10pt;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.tntRCHoraireJour{
|
||||
color: #a0a0a0;
|
||||
text-align: right;
|
||||
padding-right: 10px;
|
||||
height: 36px;
|
||||
width: 79px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.tntRCHoraireHeure {
|
||||
color: #000000;
|
||||
padding-left: 10px;
|
||||
width: 84px;
|
||||
}
|
||||
|
||||
.tntRCblanc {
|
||||
font-family: arial,helvetica,sans-serif;
|
||||
font-size: 12px;
|
||||
color: #000000;
|
||||
background-color: #ffffff;
|
||||
padding-top: 4px;
|
||||
padding-bottom: 3px;
|
||||
}
|
||||
.tntRCblancpetit {
|
||||
font-family: arial,helvetica,sans-serif;
|
||||
font-size: 12px;
|
||||
color: #000000;
|
||||
background-color: #ffffff;
|
||||
padding-top: 4px;
|
||||
padding-bottom: 3px;
|
||||
}
|
||||
.tntRCfermeture {
|
||||
padding-left: 585px;
|
||||
}
|
||||
|
||||
.tntRCBack2Communes {
|
||||
background-color: #ffffff;
|
||||
color: #a0a0a0;
|
||||
font-family: arial,helvetica,sans-serif;
|
||||
font-style: italic;
|
||||
font-size: 11pt;
|
||||
font-weight: bold;
|
||||
padding-top: 18px;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.tntRCBack2Communes a {
|
||||
color: #a0a0a0;
|
||||
text-decoration: none;
|
||||
padding-right: 5px;
|
||||
}
|
||||
|
||||
.tntRCBack2Communes a img{
|
||||
border: 0;
|
||||
padding-right: 5px;
|
||||
vertical-align: text-bottom;
|
||||
}
|
||||
|
||||
.tntRCBoutonLoupe {
|
||||
background-color: #ffffff;
|
||||
border: 0px;
|
||||
color: #000000;
|
||||
font-family: arial,helvetica,sans-serif;
|
||||
font-size: 12px;
|
||||
padding-top: 4px;
|
||||
padding-bottom: 3px;
|
||||
text-decoration: none;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.jqmWindow {
|
||||
background-color: #FFF;
|
||||
border: 1px solid black;
|
||||
color: #333;
|
||||
display: none;
|
||||
padding: 12px;
|
||||
position: fixed;
|
||||
left: 50%;
|
||||
margin-left: -300px;
|
||||
margin-top: -240px;
|
||||
width: 500px;
|
||||
}
|
||||
|
||||
div.tntRCfermeture .jqmClose em{display:none;}
|
||||
div.tntRCfermeture .jqmClose {
|
||||
background: transparent url(../modules/tntcarrier/img/close_icon_double.png) 0 0 no-repeat;
|
||||
display: block;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
}
|
||||
|
||||
div.tntRCfermeture a.jqmClose:hover{ background-position: 0 -20px; }
|
||||
|
||||
.jqmOverlay {
|
||||
background-color: #000;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
* html .jqmWindow {
|
||||
position: absolute;
|
||||
top: expression((document.documentElement.scrollTop || document.body.scrollTop) + Math.round(17 * (document.documentElement.offsetHeight || document.body.clientHeight) / 100) + 'px');
|
||||
}
|
||||
|
||||
img.tntRCButton {
|
||||
border: 0px;
|
||||
vertical-align: middle;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
sup.tntRCSup {
|
||||
|
||||
}
|
||||
|
||||
table.horairesRC td {
|
||||
width : 100%;
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
table.horairesRCPopup {
|
||||
width : 100%;
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
table.horairesRCPopup tr.selected td {
|
||||
background-color: #eeeeee;
|
||||
color: #ff6600;
|
||||
}
|
||||
|
||||
td.horaireRCPopup {
|
||||
width : 60%;
|
||||
}
|
||||
|
||||
td.horairesRCJourPopup {
|
||||
width : 40%;
|
||||
font-weight: bold;
|
||||
color: #808080;
|
||||
}
|
||||
|
||||
td.horairesRCJour {
|
||||
font-weight: bold;
|
||||
color: #808080;
|
||||
}
|
||||
table.horairesRC tr.selected td {
|
||||
background-color: #eeeeee;
|
||||
color: #ff6600;
|
||||
}
|
||||
|
||||
div.ag {
|
||||
background-image: url(/img/google/agenceTnt.png);
|
||||
background-repeat: no-repeat;
|
||||
padding-left:60px;
|
||||
}
|
||||
|
||||
div.rc {
|
||||
background-image: url(/img/google/relaisColis.png);
|
||||
background-repeat: no-repeat;
|
||||
padding-left:50px;
|
||||
}
|
||||
|
||||
|
||||
#googleMapTnt .lien_reset {
|
||||
color : #ff6600;
|
||||
font-family: arial,helvetica,sans-serif;
|
||||
font-weight: bold;
|
||||
font-size : 15px;
|
||||
text-decoration:none;
|
||||
}
|
||||
|
||||
#googleMapTnt a {
|
||||
color: #f60;
|
||||
outline-color: #f60 !important;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
#googleMapTnt a:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
#googleMapTnt .exemplePresentation {
|
||||
display: inline;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
#tntB2CRelaisColis {
|
||||
width: 610px;
|
||||
}
|
||||
|
||||
.detailRelais
|
||||
{
|
||||
background: url("../img/ui-dialog/fcfdfd_40x100_textures_06_inset_hard_100.png") repeat-x scroll 0 bottom #FCFDFD;
|
||||
height:400px;
|
||||
}
|
||||
@@ -0,0 +1,158 @@
|
||||
/*
|
||||
* jQuery UI screen structure and presentation
|
||||
* This CSS file was generated by ThemeRoller, a Filament Group Project for jQuery UI
|
||||
* Author: Scott Jehl, scott@filamentgroup.com, http://www.filamentgroup.com
|
||||
* Visit ThemeRoller.com
|
||||
*/
|
||||
|
||||
/*
|
||||
* Note: If your ThemeRoller settings have a font size set in ems, your components will scale according to their parent element's font size.
|
||||
* As a rule of thumb, set your body's font size to 62.5% to make 1em = 10px.
|
||||
* body {font-size: 62.5%;}
|
||||
*/
|
||||
|
||||
|
||||
/*dialog*/
|
||||
#googleMapTnt .ui-dialog {
|
||||
/*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
|
||||
font-family: Lucida Grande, Lucida Sans, Arial, sans-serif;
|
||||
font-size: 11px;
|
||||
background: #fcfdfd url(../img/ui-dialog/fcfdfd_40x100_textures_06_inset_hard_100.png) 0 bottom repeat-x;
|
||||
color: #222222;
|
||||
border: 3px solid #808080;
|
||||
position: relative;
|
||||
}
|
||||
#googleMapTnt .ui-resizable-handle {
|
||||
position: absolute;
|
||||
font-size: 0.1px;
|
||||
z-index: 99999;
|
||||
}
|
||||
#googleMapTnt .ui-resizable .ui-resizable-handle {
|
||||
display: block;
|
||||
}
|
||||
#googleMapTnt .ui-resizable-disabled .ui-resizable-handle { display: none; } /* use 'body' to make it more specific (css order) */
|
||||
#googleMapTnt .ui-resizable-autohide .ui-resizable-handle { display: none; } /* use 'body' to make it more specific (css order) */
|
||||
#googleMapTnt .ui-resizable-n {
|
||||
cursor: n-resize;
|
||||
height: 7px;
|
||||
width: 100%;
|
||||
top: -5px;
|
||||
left: 0px;
|
||||
}
|
||||
#googleMapTnt .ui-resizable-s {
|
||||
cursor: s-resize;
|
||||
height: 7px;
|
||||
width: 100%;
|
||||
bottom: -5px;
|
||||
left: 0px;
|
||||
}
|
||||
#googleMapTnt .ui-resizable-e {
|
||||
cursor: e-resize;
|
||||
width: 7px;
|
||||
right: -5px;
|
||||
top: 0px;
|
||||
height: 100%;
|
||||
}
|
||||
#googleMapTnt .ui-resizable-w {
|
||||
cursor: w-resize;
|
||||
width: 7px;
|
||||
left: -5px;
|
||||
top: 0px;
|
||||
height: 100%;
|
||||
}
|
||||
#googleMapTnt .ui-resizable-se {
|
||||
cursor: se-resize;
|
||||
width: 13px;
|
||||
height: 13px;
|
||||
right: 0px;
|
||||
bottom: 0px;
|
||||
background: url(../img/ui-dialog/469bdd_11x11_icon_resize_se.gif) no-repeat 0 0;
|
||||
}
|
||||
#googleMapTnt .ui-resizable-sw {
|
||||
cursor: sw-resize;
|
||||
width: 9px;
|
||||
height: 9px;
|
||||
left: 0px;
|
||||
bottom: 0px;
|
||||
}
|
||||
#googleMapTnt .ui-resizable-nw {
|
||||
cursor: nw-resize;
|
||||
width: 9px;
|
||||
height: 9px;
|
||||
left: 0px;
|
||||
top: 0px;
|
||||
}
|
||||
#googleMapTnt .ui-resizable-ne {
|
||||
cursor: ne-resize;
|
||||
width: 9px;
|
||||
height: 9px;
|
||||
right: 0px;
|
||||
top: 0px;
|
||||
}
|
||||
#googleMapTnt .ui-dialog-titlebar {
|
||||
/*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
|
||||
padding: 5px 15px 5px 10px;
|
||||
color: #2e6e9e;
|
||||
border-bottom: 1px solid #c5dbec;
|
||||
font-size: 10px;
|
||||
font-weight: bold;
|
||||
position: relative;
|
||||
}
|
||||
#googleMapTnt .ui-dialog-title {}
|
||||
#googleMapTnt .ui-dialog-titlebar-close {
|
||||
/*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
|
||||
background: url(../img/ui-dialog/6da8d5_11x11_icon_close.gif) 0 0 no-repeat;
|
||||
position: absolute;
|
||||
right: 8px;
|
||||
top: 7px;
|
||||
width: 11px;
|
||||
height: 11px;
|
||||
z-index: 100;
|
||||
}
|
||||
#googleMapTnt .ui-dialog-titlebar-close-hover, .ui-dialog-titlebar-close:hover {
|
||||
background: url(../img/ui-dialog/217bc0_11x11_icon_close.gif) 0 0 no-repeat;
|
||||
}
|
||||
#googleMapTnt .ui-dialog-titlebar-close:active {
|
||||
background: url(../img/ui-dialog/f9bd01_11x11_icon_close.gif) 0 0 no-repeat;
|
||||
}
|
||||
#googleMapTnt .ui-dialog-titlebar-close span {
|
||||
display: none;
|
||||
}
|
||||
#googleMapTnt .ui-dialog-content {
|
||||
/*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
|
||||
color: #222222;
|
||||
padding: 15px 17px;
|
||||
}
|
||||
#googleMapTnt .ui-dialog-buttonpane {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
text-align: left;
|
||||
border-top: 1px solid #a6c9e2;
|
||||
background: #fcfdfd;
|
||||
}
|
||||
#googleMapTnt .ui-dialog-buttonpane button {
|
||||
margin: 5px 0 5px 8px;
|
||||
color: #2e6e9e;
|
||||
background: #dfeffc url(../img/ui-dialog/dfeffc_40x100_textures_02_glass_85.png) 0 50% repeat-x;
|
||||
font-size: 1;
|
||||
border: 10px solid #c5dbec;
|
||||
cursor: pointer;
|
||||
padding: 2px 6px 3px 6px;
|
||||
line-height: 14px;
|
||||
}
|
||||
#googleMapTnt .ui-dialog-buttonpane button:hover {
|
||||
color: #1d5987;
|
||||
background: #d0e5f5 url(../img/ui-dialog/d0e5f5_40x100_textures_02_glass_75.png) 0 50% repeat-x;
|
||||
border: 1px solid #79b7e7;
|
||||
}
|
||||
#googleMapTnt .ui-dialog-buttonpane button:active {
|
||||
color: #e17009;
|
||||
background: #f5f8f9 url(../img/ui-dialog/f5f8f9_40x100_textures_06_inset_hard_100.png) 0 50% repeat-x;
|
||||
border: 1px solid #79b7e7;
|
||||
}
|
||||
/* This file skins dialog */
|
||||
#googleMapTnt .ui-dialog.ui-draggable .ui-dialog-titlebar,
|
||||
#googleMapTnt .ui-dialog.ui-draggable .ui-dialog-titlebar {
|
||||
cursor: move;
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
/*UI tabs*/
|
||||
.ui-tabs-nav {
|
||||
/*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; /*font-size: 100%;*/ list-style: none;
|
||||
font-family: Lucida Grande, Lucida Sans, Arial, sans-serif;
|
||||
font-size: 10px;
|
||||
float: left;
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
/*border-right: 1px solid #c5dbec;*/
|
||||
bottom: -1px;
|
||||
}
|
||||
.ui-tabs-nav ul {
|
||||
/*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; /*font-size: 100%;*/ list-style: none;
|
||||
}
|
||||
|
||||
.ui-tabs-nav li {
|
||||
/*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; /*font-size: 100%;*/ list-style: none;
|
||||
float: left;
|
||||
border: 1px solid #c5dbec;
|
||||
border-right: none;
|
||||
}
|
||||
|
||||
.ui-tabs-nav li a {
|
||||
/*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; /*font-size: 100%;*/ list-style: none;
|
||||
float: left;
|
||||
font-size: 10px;
|
||||
font-weight: bold;
|
||||
text-decoration: none;
|
||||
padding: .2em 1em;
|
||||
color: #2e6e9e;
|
||||
background: #dfeffc url(../img/ui-dialog/dfeffc_40x100_textures_02_glass_85.png) 0 50% repeat-x;
|
||||
}
|
||||
|
||||
.ui-tabs-nav li a:hover {
|
||||
background: #d0e5f5 url(../img/ui-dialog/d0e5f5_40x100_textures_02_glass_75.png) 0 50% repeat-x;
|
||||
color: #1d5987;
|
||||
}
|
||||
|
||||
.ui-tabs-nav li.ui-tabs-selected {
|
||||
border-bottom-color: #f5f8f9;
|
||||
}
|
||||
|
||||
.ui-tabs-nav li.ui-tabs-selected a, .ui-tabs-nav li.ui-tabs-selected a:hover {
|
||||
background: #f5f8f9 url(../img/ui-dialog/f5f8f9_40x100_textures_06_inset_hard_100.png) 0 50% repeat-x;
|
||||
color: #e17009;
|
||||
}
|
||||
|
||||
.ui-tabs-panel {
|
||||
/*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; /*font-size: 100%;*/ list-style: none;
|
||||
/*font-family: Lucida Grande, Lucida Sans, Arial, sans-serif;*/
|
||||
clear:left;
|
||||
border: 1px solid #c5dbec;
|
||||
background: #fcfdfd url(../img/ui-dialog/fcfdfd_40x100_textures_06_inset_hard_100.png) 0 bottom repeat-x;
|
||||
/*color: #222222;*/
|
||||
padding: 1em 1em;
|
||||
width: 315px;
|
||||
font-size: 10px;
|
||||
}
|
||||
|
||||
.ui-tabs-hide {
|
||||
display: none;/* for accessible hiding: position: absolute; left: -99999999px*/;
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
require('../../config/config.inc.php');
|
||||
require_once(_PS_MODULE_DIR_."/tntcarrier/classes/TntWebService.php");
|
||||
|
||||
global $smarty;
|
||||
|
||||
try
|
||||
{
|
||||
$tntWebService = new TntWebService();
|
||||
$follow[] = $tntWebService->followPackage($_GET['code']);
|
||||
}
|
||||
catch( SoapFault $e )
|
||||
{
|
||||
$erreur = $e->faultstring;
|
||||
echo $erreur;
|
||||
}
|
||||
catch( Exception $e )
|
||||
{
|
||||
$erreur = "Problem : follow failed";
|
||||
}
|
||||
$config['date'] = '%d/%m/%y';
|
||||
$config['time'] = '%I:%M %p';
|
||||
$smarty->assign('erreur', $erreur);
|
||||
$smarty->assign('config',$config);
|
||||
$smarty->assign( 'follow', $follow );
|
||||
$smarty->display('tpl/follow.tpl' );
|
||||
?>
|
||||
@@ -0,0 +1,90 @@
|
||||
<?php
|
||||
|
||||
global $_MODULE;
|
||||
$_MODULE = array();
|
||||
$_MODULE['<{tntcarrier}prestashop>tntcarrier_58ec6a48b4720ef0aa2adfded1ccf8a3'] = 'TNT Express';
|
||||
$_MODULE['<{tntcarrier}prestashop>tntcarrier_9b7637001f5d2bcb42efb4ab6b3e93da'] = 'Offre aux clients, différentes methodes de livraison';
|
||||
$_MODULE['<{tntcarrier}prestashop>tntcarrier_416900392875e9effb318da8648fbdcb'] = 'doit ou doivent etre configuré(s) pour utiliser le module correctement';
|
||||
$_MODULE['<{tntcarrier}prestashop>tntcarrier_632cae5cf3af08786414932a8e6f96a0'] = 'Pseudonyme TNT';
|
||||
$_MODULE['<{tntcarrier}prestashop>tntcarrier_3b4f51300711a1eb61770d1696702402'] = 'Mot de passe TNT';
|
||||
$_MODULE['<{tntcarrier}prestashop>tntcarrier_0e3b102c1a4938889716cea423a95001'] = 'Numéro de compte TNT';
|
||||
$_MODULE['<{tntcarrier}prestashop>tntcarrier_e81d9f25acf7fa457ab32527a882ed50'] = 'Transporteur TNT';
|
||||
$_MODULE['<{tntcarrier}prestashop>tntcarrier_d968787921c136e1cf9f766562aec8bc'] = 'Les paramètres suivants vous ont été fournis par TNT';
|
||||
$_MODULE['<{tntcarrier}prestashop>tntcarrier_af7c2efe81330e4c9089f2c90781282e'] = 'Si vous n\'êtes pas encore inscrit, cliquez sur';
|
||||
$_MODULE['<{tntcarrier}prestashop>tntcarrier_6c92285fa6d3e827b198d120ea3ac674'] = 'ici';
|
||||
$_MODULE['<{tntcarrier}prestashop>tntcarrier_8af703b2bf59cc9742883ae7f4cb0e5b'] = 'Paramètres du compte';
|
||||
$_MODULE['<{tntcarrier}prestashop>tntcarrier_927e079056c2709236d4167bbb96e799'] = 'Réglages d\'expédition';
|
||||
$_MODULE['<{tntcarrier}prestashop>tntcarrier_82fe86ee1a21af1c1db5c8c4c5e5a188'] = 'Paramètres du service';
|
||||
$_MODULE['<{tntcarrier}prestashop>tntcarrier_160f61d02d22b76b47b4305094bf36a6'] = 'Compte TNT';
|
||||
$_MODULE['<{tntcarrier}prestashop>tntcarrier_99dea78007133396a7b8ed70578ac6ae'] = 'Identifiant';
|
||||
$_MODULE['<{tntcarrier}prestashop>tntcarrier_dc647eb65e6711e155375218212b3964'] = 'Mot de passe';
|
||||
$_MODULE['<{tntcarrier}prestashop>tntcarrier_05e642d027a22d12780ccf91bf9d7d34'] = 'Numéro de compte';
|
||||
$_MODULE['<{tntcarrier}prestashop>tntcarrier_8005dfbbaf4c9333592f26e82ddfd0af'] = 'Remplissez le formulaire avec les données';
|
||||
$_MODULE['<{tntcarrier}prestashop>tntcarrier_ea9cf7e47ff33b2be14e6dd07cbcefc6'] = 'Expédition';
|
||||
$_MODULE['<{tntcarrier}prestashop>tntcarrier_4d8ff211a4a8a140e293736f92ac39d5'] = 'Aimeriez-vous que TNT ramasse votre colis ?';
|
||||
$_MODULE['<{tntcarrier}prestashop>tntcarrier_581bf6fa6cd6d4bf4b0bbe2cfe6e404c'] = 'Non (via un dépôt)';
|
||||
$_MODULE['<{tntcarrier}prestashop>tntcarrier_93cba07454f06a4a960172bbd6e2a435'] = 'Oui';
|
||||
$_MODULE['<{tntcarrier}prestashop>tntcarrier_f5234754269687df652c9f6f2f80cc10'] = 'Choisissez votre emplacement dépositaire';
|
||||
$_MODULE['<{tntcarrier}prestashop>tntcarrier_e7a7e191423e6a9ce3b59fd51ecbde87'] = 'Le code pex';
|
||||
$_MODULE['<{tntcarrier}prestashop>tntcarrier_e7b47c58815acf1d3afa59a84b5db7fb'] = 'Nom de l\'entreprise';
|
||||
$_MODULE['<{tntcarrier}prestashop>tntcarrier_8d3f5eff9c40ee315d452392bed5309b'] = 'Nom de famille';
|
||||
$_MODULE['<{tntcarrier}prestashop>tntcarrier_20db0bfeecd8fe60533206a2b5e9891a'] = 'Prénom';
|
||||
$_MODULE['<{tntcarrier}prestashop>tntcarrier_e9f79aa2b1f455a52497a126d9442582'] = 'Adresse ligne 1';
|
||||
$_MODULE['<{tntcarrier}prestashop>tntcarrier_3d4d4cac03e194ab20154382cd544e0f'] = 'Adresse ligne 2';
|
||||
$_MODULE['<{tntcarrier}prestashop>tntcarrier_d30f507473129e70c4b962ceccf175cf'] = 'Zip / Code Postal';
|
||||
$_MODULE['<{tntcarrier}prestashop>tntcarrier_d0585aac6bb77bb49423b2effca0e067'] = 'Votre ville';
|
||||
$_MODULE['<{tntcarrier}prestashop>tntcarrier_f775ad1fbb08939178d4df9c457601f2'] = 'Votre adresse email';
|
||||
$_MODULE['<{tntcarrier}prestashop>tntcarrier_67c19a5276428fb9e49c557b1a3526d5'] = 'Votre numéro de téléphone';
|
||||
$_MODULE['<{tntcarrier}prestashop>tntcarrier_6222760252f52bb4dc70835d238d5484'] = 'Votre heure de clôture';
|
||||
$_MODULE['<{tntcarrier}prestashop>tntcarrier_cf67059a7bd51c3543def1ee4bdc4fe1'] = 'Livraison le samedi';
|
||||
$_MODULE['<{tntcarrier}prestashop>tntcarrier_bafd7322c6e97d25b6299b5d6fe8920b'] = 'Aucun';
|
||||
$_MODULE['<{tntcarrier}prestashop>tntcarrier_dc86b23a40568ae3ece2d3008ca61442'] = 'Format de l\'étiquette pour l\'impression (Cette étiquette doit être collée sur l\'emballage)';
|
||||
$_MODULE['<{tntcarrier}prestashop>tntcarrier_2976cd63d00184e3f0a45c1337cd31f0'] = 'Impression A4';
|
||||
$_MODULE['<{tntcarrier}prestashop>tntcarrier_2f95a5450ee306f7faca792e379ccb34'] = 'sans imprimer le logo de TNT';
|
||||
$_MODULE['<{tntcarrier}prestashop>tntcarrier_44fca4829aecbdf69a2200ea0a10a8aa'] = 'avec une impression inverse';
|
||||
$_MODULE['<{tntcarrier}prestashop>tntcarrier_a67ee8b3121d0ceb601e9f0600db9692'] = 'sans imprimer le logo TNT et avec une impression inverse';
|
||||
$_MODULE['<{tntcarrier}prestashop>tntcarrier_1c85ce46031e67c95be9aa05b859f955'] = 'Nouveau service';
|
||||
$_MODULE['<{tntcarrier}prestashop>tntcarrier_b718adec73e04ce3ec720dd11a06a308'] = 'ID';
|
||||
$_MODULE['<{tntcarrier}prestashop>tntcarrier_49ee3087348e8d44e1feda1917443987'] = 'Nom';
|
||||
$_MODULE['<{tntcarrier}prestashop>tntcarrier_b5a7adde1af5c87d7fd797b6245c2a39'] = 'Description';
|
||||
$_MODULE['<{tntcarrier}prestashop>tntcarrier_ca0dbad92a874b2f69b549293387925e'] = 'Code';
|
||||
$_MODULE['<{tntcarrier}prestashop>tntcarrier_7ec0def44906b0cd2848459349eea638'] = 'Frais additionnels (€)';
|
||||
$_MODULE['<{tntcarrier}prestashop>tntcarrier_cb456215c3333db0551bd0788bc258c7'] = 'Activé';
|
||||
$_MODULE['<{tntcarrier}prestashop>tntcarrier_de95b43bceeb4b998aed4aed5cef1ae7'] = 'modifier';
|
||||
$_MODULE['<{tntcarrier}prestashop>tntcarrier_099af53f601532dbd31e0ea99ffdeb64'] = 'supprimer';
|
||||
$_MODULE['<{tntcarrier}prestashop>tntcarrier_7b9cf007806ed854cd12ab800c8a982b'] = 'Lieu';
|
||||
$_MODULE['<{tntcarrier}prestashop>tntcarrier_b06cdf3c0c75a1a58b82761f87f458e4'] = 'Etat du module transporteur TNT';
|
||||
$_MODULE['<{tntcarrier}prestashop>tntcarrier_4c7b2960da33c41e9bbea499696702ca'] = 'Le module transporteur TNT est configuré et en ligne';
|
||||
$_MODULE['<{tntcarrier}prestashop>tntcarrier_efce38300739e2fd6cef1acd9ce68a1c'] = 'Le module transporteur TNT n\'est pas encore configuré, s\'il vous plait :';
|
||||
$_MODULE['<{tntcarrier}prestashop>tntcarrier_a8341741d73ef0a3ca5e8a7facc9a738'] = 'Assurez vous d\'avoir un compte TNT';
|
||||
$_MODULE['<{tntcarrier}prestashop>tntcarrier_3dab1e2673a4acc557135ccf795d4e31'] = 'Assurez vous d\'avoir une adresse correcte d\'expedition';
|
||||
$_MODULE['<{tntcarrier}prestashop>tntcarrier_057c674e4d23b04c0cbe1bfe81a0bec1'] = 'Assurez vous que certains services sont actifs';
|
||||
$_MODULE['<{tntcarrier}prestashop>tntcarrier_9d5b24e0e3516fcef94916366fadae67'] = 'Nouvelle option Poids';
|
||||
$_MODULE['<{tntcarrier}prestashop>tntcarrier_02f6a536789c7b8399ddbd1652d85d9c'] = 'Poids Min';
|
||||
$_MODULE['<{tntcarrier}prestashop>tntcarrier_03b4258831663af9e7f48bc6bc574e6c'] = 'Poids Max';
|
||||
$_MODULE['<{tntcarrier}prestashop>tntcarrier_7dce122004969d56ae2e0245cb754d35'] = 'Modifier';
|
||||
$_MODULE['<{tntcarrier}prestashop>tntcarrier_f2a6c498fb90ee345d997f888fce3b18'] = 'Supprimer';
|
||||
$_MODULE['<{tntcarrier}prestashop>tntcarrier_0619bef93192e574f288fe2e55c3a7f7'] = 'Poids min';
|
||||
$_MODULE['<{tntcarrier}prestashop>tntcarrier_d8c74112ba3622be2e79d4d4dc24eaf4'] = 'Poids max';
|
||||
$_MODULE['<{tntcarrier}prestashop>tntcarrier_508ccf43328cac4c93d1de242d2ddffb'] = 'Frais additionnels';
|
||||
$_MODULE['<{tntcarrier}prestashop>tntcarrier_69d865b41dc0e6611be76776c4a9456d'] = 'Vous devez donner un nom au service';
|
||||
$_MODULE['<{tntcarrier}prestashop>tntcarrier_e71361626c48f42620b92cc81fd41ba2'] = 'Vous devez donner un code au service';
|
||||
$_MODULE['<{tntcarrier}prestashop>tntcarrier_d2f2575c30fa33e53905ae05bc02f281'] = 'Vous devez donner une description au service';
|
||||
$_MODULE['<{tntcarrier}prestashop>tntcarrier_4a015051e9e879952cf4215d344ec101'] = 'Service enregistré';
|
||||
$_MODULE['<{tntcarrier}prestashop>tntcarrier_74d87a5cbf64f95c490b2cf85710a4eb'] = 'Le(s) numéro(s) d\'expédition(s)';
|
||||
$_MODULE['<{tntcarrier}prestashop>tntcarrier_2fd7870126dd86cedc2be112e7e59ebc'] = 'L\'étiquette';
|
||||
$_MODULE['<{tntcarrier}prestashop>tntcarrier_d5aad80114d8aa47f31a6f5050ef6835'] = 'Expédition';
|
||||
$_MODULE['<{tntcarrier}prestashop>formerror_c3f15ecc6da0827a8da712cb43a0b596'] = 'information d\'expédition';
|
||||
$_MODULE['<{tntcarrier}prestashop>formerror_7f090bbab1cc7f9c08bf4e54d932d3c0'] = 'Modifier';
|
||||
$_MODULE['<{tntcarrier}prestashop>service_ca0dbad92a874b2f69b549293387925e'] = 'Code';
|
||||
$_MODULE['<{tntcarrier}prestashop>service_41350c4c9683f48b15d04adc3f76925b'] = '08h00 express';
|
||||
$_MODULE['<{tntcarrier}prestashop>service_4b0977efd9aa11417b7139f35ed777a0'] = '09h00 express';
|
||||
$_MODULE['<{tntcarrier}prestashop>service_9b75b9fc3e87626793da04f05b8388ac'] = '10:00 express';
|
||||
$_MODULE['<{tntcarrier}prestashop>service_5a3019af5fd97f13e43cb4d946b7c112'] = '12:00 express';
|
||||
$_MODULE['<{tntcarrier}prestashop>service_b144fa061545497bebee8c414efc99a9'] = 'Express';
|
||||
$_MODULE['<{tntcarrier}prestashop>service_7a93a32c1929f10098c9bc055dbe5555'] = 'Express (P)';
|
||||
$_MODULE['<{tntcarrier}prestashop>service_c24eb7cd3484f223c03e64f2728a61ae'] = 'Option code (facultatif)';
|
||||
$_MODULE['<{tntcarrier}prestashop>service_b5410e878f792a03b81e7803a626caaa'] = 'Colis relais';
|
||||
$_MODULE['<{tntcarrier}prestashop>service_6cefaa978ccec960693d10cefeb2c2bf'] = 'Livraison à domicile';
|
||||
$_MODULE['<{tntcarrier}prestashop>service_9582039a366d19cb0b957bd4220dd6f7'] = 'Service entreprise ';
|
||||
$_MODULE['<{tntcarrier}prestashop>shippingnumber_c3f15ecc6da0827a8da712cb43a0b596'] = 'L\'information d\'expédition';
|
||||
|
After Width: | Height: | Size: 894 B |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 961 B |