[-] MO : Remove modules from wrong branche
@@ -1,274 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2012 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-2012 PrestaShop SA
|
||||
* @version Release: $Revision: 14011 $
|
||||
* @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 authorizeAIM extends PaymentModule
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$this->name = 'authorizeaim';
|
||||
$this->tab = 'payments_gateways';
|
||||
$this->version = '1.3.2';
|
||||
$this->author = 'PrestaShop';
|
||||
//$this->limited_countries = array('us');
|
||||
$this->need_instance = 0;
|
||||
|
||||
parent::__construct();
|
||||
|
||||
$this->displayName = 'Authorize.net AIM (Advanced Integration Method)';
|
||||
$this->description = $this->l('Receive payment with Authorize.net');
|
||||
|
||||
/* 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 cURL is enabled */
|
||||
if (!is_callable('curl_exec'))
|
||||
$this->warning = $this->l('cURL extension must be enabled on your server to use this module.');
|
||||
|
||||
/* Backward compatibility */
|
||||
require(_PS_MODULE_DIR_.$this->name.'/backward_compatibility/backward.php');
|
||||
}
|
||||
|
||||
public function install()
|
||||
{
|
||||
return parent::install() &&
|
||||
$this->registerHook('orderConfirmation') &&
|
||||
$this->registerHook('payment') &&
|
||||
$this->registerHook('header') &&
|
||||
Configuration::updateValue('AUTHORIZE_AIM_DEMO', 1) &&
|
||||
Configuration::updateValue('AUTHORIZE_AIM_HOLD_REVIEW_OS', _PS_OS_ERROR);
|
||||
}
|
||||
|
||||
public function uninstall()
|
||||
{
|
||||
Configuration::deleteByName('AUTHORIZE_AIM_LOGIN_ID');
|
||||
Configuration::deleteByName('AUTHORIZE_AIM_KEY');
|
||||
Configuration::deleteByName('AUTHORIZE_AIM_DEMO');
|
||||
Configuration::deleteByName('AUTHORIZE_AIM_CARD_VISA');
|
||||
Configuration::deleteByName('AUTHORIZE_AIM_CARD_MASTERCARD');
|
||||
Configuration::deleteByName('AUTHORIZE_AIM_CARD_DISCOVER');
|
||||
Configuration::deleteByName('AUTHORIZE_AIM_CARD_AX');
|
||||
|
||||
Configuration::deleteByName('AUTHORIZE_AIM_HOLD_REVIEW_OS');
|
||||
|
||||
return parent::uninstall();
|
||||
}
|
||||
|
||||
public function hookOrderConfirmation($params)
|
||||
{
|
||||
if ($params['objOrder']->module != $this->name)
|
||||
return;
|
||||
|
||||
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');
|
||||
}
|
||||
|
||||
public function getContent()
|
||||
{
|
||||
$html = '';
|
||||
if (Tools::isSubmit('submitModule'))
|
||||
{
|
||||
Configuration::updateValue('AUTHORIZE_AIM_LOGIN_ID', Tools::getvalue('authorizeaim_login_id'));
|
||||
Configuration::updateValue('AUTHORIZE_AIM_KEY', Tools::getvalue('authorizeaim_key'));
|
||||
Configuration::updateValue('AUTHORIZE_AIM_DEMO', Tools::getvalue('authorizeaim_demo_mode'));
|
||||
Configuration::updateValue('AUTHORIZE_AIM_CARD_VISA', Tools::getvalue('authorizeaim_card_visa'));
|
||||
Configuration::updateValue('AUTHORIZE_AIM_CARD_MASTERCARD', Tools::getvalue('authorizeaim_card_mastercard'));
|
||||
Configuration::updateValue('AUTHORIZE_AIM_CARD_DISCOVER', Tools::getvalue('authorizeaim_card_discover'));
|
||||
Configuration::updateValue('AUTHORIZE_AIM_CARD_AX', Tools::getvalue('authorizeaim_card_ax'));
|
||||
|
||||
Configuration::updateValue('AUTHORIZE_AIM_HOLD_REVIEW_OS', Tools::getvalue('authorizeaim_hold_review_os'));
|
||||
|
||||
$html .= $this->displayConfirmation($this->l('Configuration updated'));
|
||||
}
|
||||
|
||||
// For Hold for Review
|
||||
$orderStates = OrderState::getOrderStates((int)$this->context->cookie->id_lang);
|
||||
|
||||
|
||||
$html .= '
|
||||
<h2>'.$this->displayName.'</h2>
|
||||
<fieldset><legend><img src="../modules/'.$this->name.'/logo.gif" alt="" /> '.$this->l('Help').'</legend>
|
||||
<a href="http://api.prestashop.com/partner/authorize.net/" target="_blank" style="float: right;"><img src="../modules/'.$this->name.'/logo_authorize.png" alt="" /></a>
|
||||
<h3>'.$this->l('In your PrestaShop admin panel').'</h3>
|
||||
- '.$this->l('Fill the Login ID field with the one provided by Authorize.net').'<br />
|
||||
- '.$this->l('Fill the key field with the transaction key provided by Authorize.net').'<br />
|
||||
<span style="color: red;" >- '.$this->l('Warning: Your website must possess a SSL certificate to use the Authorize.net AIM payment system. You are responsible for the safety of your customers\' bank information. PrestaShop cannot be blamed for any security issue on your website.').'</span><br />
|
||||
<br />
|
||||
</fieldset><br />
|
||||
<form action="'.Tools::htmlentitiesutf8($_SERVER['REQUEST_URI']).'" method="post">
|
||||
<fieldset class="width2">
|
||||
<legend><img src="../img/admin/contact.gif" alt="" />'.$this->l('Settings').'</legend>
|
||||
<label for="authorizeaim_login_id">'.$this->l('Login ID').'</label>
|
||||
<div class="margin-form"><input type="text" size="20" id="authorizeaim_login_id" name="authorizeaim_login_id" value="'.Configuration::get('AUTHORIZE_AIM_LOGIN_ID').'" /></div>
|
||||
<label for="authorizeaim_key">'.$this->l('Key').'</label>
|
||||
<div class="margin-form"><input type="text" size="20" id="authorizeaim_login_id" name="authorizeaim_key" value="'.Configuration::get('AUTHORIZE_AIM_KEY').'" /></div>
|
||||
<label for="authorizeaim_demo_mode">'.$this->l('Mode:').'</label>
|
||||
<div class="margin-form" id="authorizeaim_demo">
|
||||
<input type="radio" name="authorizeaim_demo_mode" value="0" style="vertical-align: middle;" '.(!Tools::getValue('authorizeaim_demo_mode', Configuration::get('AUTHORIZE_AIM_DEMO')) ? 'checked="checked"' : '').' />
|
||||
<span style="color: #080;">'.$this->l('Production').'</span>
|
||||
<input type="radio" name="authorizeaim_demo_mode" value="1" style="vertical-align: middle;" '.(Tools::getValue('authorizeaim_demo_mode', Configuration::get('AUTHORIZE_AIM_DEMO')) ? 'checked="checked"' : '').' />
|
||||
<span style="color: #900;">'.$this->l('Test').'</span>
|
||||
</div>
|
||||
<label for="authorizeaim_cards">'.$this->l('Cards:').'</label>
|
||||
<div class="margin-form" id="authorizeaim_cards">
|
||||
<input type="checkbox" name="authorizeaim_card_visa" '.(Configuration::get('AUTHORIZE_AIM_CARD_VISA') ? 'checked="checked"' : '').' />
|
||||
<img src="../modules/'.$this->name.'/cards/visa.gif" alt="visa" />
|
||||
<input type="checkbox" name="authorizeaim_card_mastercard" '.(Configuration::get('AUTHORIZE_AIM_CARD_MASTERCARD') ? 'checked="checked"' : '').' />
|
||||
<img src="../modules/'.$this->name.'/cards/mastercard.gif" alt="visa" />
|
||||
<input type="checkbox" name="authorizeaim_card_discover" '.(Configuration::get('AUTHORIZE_AIM_CARD_DISCOVER') ? 'checked="checked"' : '').' />
|
||||
<img src="../modules/'.$this->name.'/cards/discover.gif" alt="visa" />
|
||||
<input type="checkbox" name="authorizeaim_card_ax" '.(Configuration::get('AUTHORIZE_AIM_CARD_AX') ? 'checked="checked"' : '').' />
|
||||
<img src="../modules/'.$this->name.'/cards/ax.gif" alt="visa" />
|
||||
</div>
|
||||
|
||||
<label for="authorizeaim_hold_review_os">'.$this->l('"Hold for Review" order state').'</label>
|
||||
<div class="margin-form">
|
||||
<select id="authorizeaim_hold_review_os" name="authorizeaim_hold_review_os">';
|
||||
// Hold for Review order state selection
|
||||
foreach ($orderStates as $os)
|
||||
$html .= '
|
||||
<option value="'.(int)$os['id_order_state'].'"'.((int)$os['id_order_state'] == (int)Configuration::get('AUTHORIZE_AIM_HOLD_REVIEW_OS') ? ' selected' : '').'>'.
|
||||
Tools::stripslashes($os['name']).
|
||||
'</option>'."\n";
|
||||
$html .= '
|
||||
</select></div>
|
||||
|
||||
|
||||
<br /><center><input type="submit" name="submitModule" value="'.$this->l('Update settings').'" class="button" /></center>
|
||||
</fieldset>
|
||||
</form>';
|
||||
|
||||
return $html;
|
||||
}
|
||||
|
||||
public function hookPayment($params)
|
||||
{
|
||||
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_solution_ID'] = 'A1000006';
|
||||
$authorizeAIMParams['x_login'] = Configuration::get('AUTHORIZE_AIM_LOGIN_ID');
|
||||
$authorizeAIMParams['x_tran_key'] = Configuration::get('AUTHORIZE_AIM_KEY');
|
||||
$authorizeAIMParams['x_version'] = '3.1';
|
||||
$authorizeAIMParams['x_delim_data'] = 'TRUE';
|
||||
$authorizeAIMParams['x_delim_char'] = '|';
|
||||
$authorizeAIMParams['x_relay_response'] = 'FALSE';
|
||||
$authorizeAIMParams['x_type'] = 'AUTH_CAPTURE';
|
||||
$authorizeAIMParams['x_method'] = 'CC';
|
||||
$authorizeAIMParams['x_test_request'] = Configuration::get('AUTHORIZE_AIM_DEMO');
|
||||
$authorizeAIMParams['x_invoice_num'] = (int)$params['cart']->id;
|
||||
$authorizeAIMParams['x_amount'] = number_format($params['cart']->getOrderTotal(true, 3), 2, '.', '');
|
||||
$authorizeAIMParams['x_address'] = $invoiceAddress->address1.' '.$invoiceAddress->address2;
|
||||
$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();
|
||||
$cards['visa'] = Configuration::get('AUTHORIZE_AIM_CARD_VISA') == 'on' ? 1 : 0;
|
||||
$cards['mastercard'] = Configuration::get('AUTHORIZE_AIM_CARD_MASTERCARD') == 'on' ? 1 : 0;
|
||||
$cards['discover'] = Configuration::get('AUTHORIZE_AIM_CARD_DISCOVER') == 'on' ? 1 : 0;
|
||||
$cards['ax'] = Configuration::get('AUTHORIZE_AIM_CARD_AX') == 'on' ? 1 : 0;
|
||||
|
||||
if (method_exists('Tools', 'getShopDomainSsl'))
|
||||
$url = 'https://'.Tools::getShopDomainSsl().__PS_BASE_URI__.'/modules/'.$this->name.'/';
|
||||
else
|
||||
$url = 'https://'.$_SERVER['HTTP_HOST'].__PS_BASE_URI__.'modules/'.$this->name.'/';
|
||||
|
||||
$this->context->smarty->assign('p', $authorizeAIMParams);
|
||||
$this->context->smarty->assign('cards', $cards);
|
||||
$this->context->smarty->assign('isFailed', $isFailed);
|
||||
$this->context->smarty->assign('new_base_dir', $url);
|
||||
|
||||
return $this->display(__FILE__, 'authorizeaim.tpl');
|
||||
}
|
||||
}
|
||||
|
||||
public function hookHeader()
|
||||
{
|
||||
if (_PS_VERSION_ < '1.5')
|
||||
Tools::addJS(_PS_JS_DIR_.'jquery/jquery.validate.creditcard2-1.0.1.js');
|
||||
else
|
||||
$this->context->controller->addJqueryPlugin('validate-creditcard');
|
||||
}
|
||||
|
||||
/**
|
||||
* 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];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,135 +0,0 @@
|
||||
{*
|
||||
* 2007-2012 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-2012 PrestaShop SA
|
||||
* @version Release: $Revision: 14297 $
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*}
|
||||
<link rel="shortcut icon" type="image/x-icon" href="{$module_dir}secure.png" />
|
||||
<p class="payment_module" >
|
||||
|
||||
{if $isFailed == 1}
|
||||
<p style="color: red;">{l s='Error, please verify the card information' mod='authorizeaim'}</p>
|
||||
{/if}
|
||||
|
||||
<form name="authorizeaim_form" id="authorizeaim_form" action="{$new_base_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; 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}
|
||||
<div id="aut2"style="display:none">
|
||||
{else}
|
||||
<div id="aut2">
|
||||
{/if}
|
||||
<br /><br />
|
||||
|
||||
<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-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>
|
||||
/
|
||||
<select name="x_exp_date_y">{section name=date_y start=11 loop=20}
|
||||
<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-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: 129px; padding-left: 25px; padding-right: 25px;" class="button" />
|
||||
<input type="hidden" controller="order-opc" />
|
||||
</div>
|
||||
</span>
|
||||
</form>
|
||||
</p>
|
||||
<script type="text/javascript">
|
||||
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()
|
||||
{
|
||||
if ($(this).val() < 10)
|
||||
{
|
||||
$(this).val('0' + $(this).val());
|
||||
$(this).html($(this).val())
|
||||
}
|
||||
});
|
||||
$('#click_authorizeaim').click(function(e){
|
||||
e.preventDefault();
|
||||
$('#click_authorizeaim').fadeOut("fast",function(){
|
||||
$("#aut2").show();
|
||||
$('#click_authorizeaim').fadeIn('fast');
|
||||
});
|
||||
$('#click_authorizeaim').unbind();
|
||||
$('#click_authorizeaim').click(function(e){
|
||||
e.preventDefault();
|
||||
});
|
||||
});
|
||||
|
||||
$('#cvv_help').click(function(){
|
||||
$("#cvv_help_img").show();
|
||||
$('#cvv_help').unbind();
|
||||
});
|
||||
|
||||
$('#asubmit').click(function()
|
||||
{
|
||||
if ($('#fullname').val() == '')
|
||||
{
|
||||
alert(mess_error2);
|
||||
}
|
||||
else if (!validateCC($('#cardnum').val(), $('#cardType').val()) || $('#x_card_code').val() == '')
|
||||
{
|
||||
alert(mess_error);
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#authorizeaim_form').submit();
|
||||
}
|
||||
return false;
|
||||
});
|
||||
});
|
||||
|
||||
{/literal}
|
||||
</script>
|
||||
@@ -1,222 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2012 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Open Software License (OSL 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/osl-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-2012 PrestaShop SA
|
||||
* @version Release: $Revision: 7723 $
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
// Retro 1.3, 'class_exists' cause problem with autoload...
|
||||
if (version_compare(_PS_VERSION_, '1.4', '<'))
|
||||
{
|
||||
// Not exist for 1.3
|
||||
class Shop extends ObjectModel
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public static function getShops()
|
||||
{
|
||||
return array(
|
||||
array('id_shop' => 1, 'name' => 'Default shop')
|
||||
);
|
||||
}
|
||||
|
||||
public static function getCurrentShop()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Not exist for 1.3 and 1.4
|
||||
class Context
|
||||
{
|
||||
/**
|
||||
* @var Context
|
||||
*/
|
||||
protected static $instance;
|
||||
|
||||
/**
|
||||
* @var Cart
|
||||
*/
|
||||
public $cart;
|
||||
|
||||
/**
|
||||
* @var Customer
|
||||
*/
|
||||
public $customer;
|
||||
|
||||
/**
|
||||
* @var Cookie
|
||||
*/
|
||||
public $cookie;
|
||||
|
||||
/**
|
||||
* @var Link
|
||||
*/
|
||||
public $link;
|
||||
|
||||
/**
|
||||
* @var Country
|
||||
*/
|
||||
public $country;
|
||||
|
||||
/**
|
||||
* @var Employee
|
||||
*/
|
||||
public $employee;
|
||||
|
||||
/**
|
||||
* @var Controller
|
||||
*/
|
||||
public $controller;
|
||||
|
||||
/**
|
||||
* @var Language
|
||||
*/
|
||||
public $language;
|
||||
|
||||
/**
|
||||
* @var Currency
|
||||
*/
|
||||
public $currency;
|
||||
|
||||
/**
|
||||
* @var AdminTab
|
||||
*/
|
||||
public $tab;
|
||||
|
||||
/**
|
||||
* @var Shop
|
||||
*/
|
||||
public $shop;
|
||||
|
||||
/**
|
||||
* @var Smarty
|
||||
*/
|
||||
public $smarty;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
global $cookie, $cart, $smarty, $link;
|
||||
|
||||
$this->tab = null;
|
||||
|
||||
if ($cookie)
|
||||
$this->cookie = $cookie;
|
||||
|
||||
$this->cart = $cart;
|
||||
$this->smarty = $smarty;
|
||||
$this->link = $link;
|
||||
|
||||
$this->controller = new ControllerBackwardModule();
|
||||
if ($cookie)
|
||||
{
|
||||
$this->currency = new Currency((int)$cookie->id_currency);
|
||||
$this->language = new Language((int)$cookie->id_lang);
|
||||
$this->country = new Country((int)$cookie->id_country);
|
||||
$this->customer = new Customer((int)$cookie->id_customer);
|
||||
$this->employee = new Employee((int)$cookie->id_employee);
|
||||
}
|
||||
$this->shop = new ShopBackwardModule();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a singleton context
|
||||
*
|
||||
* @return Context
|
||||
*/
|
||||
public static function getContext()
|
||||
{
|
||||
if (!isset(self::$instance))
|
||||
self::$instance = new Context();
|
||||
return self::$instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clone current context
|
||||
*
|
||||
* @return Context
|
||||
*/
|
||||
public function cloneContext()
|
||||
{
|
||||
return clone($this);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int Shop context type (Shop::CONTEXT_ALL, etc.)
|
||||
*/
|
||||
public static function shop()
|
||||
{
|
||||
if (!self::$instance->shop->getContextType())
|
||||
return ShopBackwardModule::CONTEXT_ALL;
|
||||
return self::$instance->shop->getContextType();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Class Shop for Backward compatibility
|
||||
*/
|
||||
class ShopBackwardModule extends Shop
|
||||
{
|
||||
const CONTEXT_ALL = 1;
|
||||
|
||||
public function getContextType()
|
||||
{
|
||||
return ShopBackwardModule::CONTEXT_ALL;
|
||||
}
|
||||
|
||||
// Simulate shop for 1.3 / 1.4
|
||||
public function getID()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Class Controller for a Backward compatibility
|
||||
* Allow to use method declared in 1.5
|
||||
*/
|
||||
class ControllerBackwardModule
|
||||
{
|
||||
/**
|
||||
* @param $js_uri
|
||||
* @return void
|
||||
*/
|
||||
public function addJS($js_uri)
|
||||
{
|
||||
Tools::addJS($js_uri);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $css_uri
|
||||
* @param string $css_media_type
|
||||
* @return void
|
||||
*/
|
||||
public function addCSS($css_uri, $css_media_type = 'all')
|
||||
{
|
||||
Tools::addCSS($css_uri, $css_media_type);
|
||||
}
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2012 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Open Software License (OSL 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/osl-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-2012 PrestaShop SA
|
||||
* @version Release: $Revision: 7723 $
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
/**
|
||||
* Backward function compatibility
|
||||
* Need to be called for each module in 1.4
|
||||
*/
|
||||
|
||||
// Get out if the context is already defined
|
||||
if (!in_array('Context', get_declared_classes()))
|
||||
require_once(dirname(__FILE__).'/Context.php');
|
||||
|
||||
if (!isset($this) || isset($this->context))
|
||||
return;
|
||||
|
||||
$this->context = Context::getContext();
|
||||
$this->smarty = $this->context->smarty;
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2012 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Open Software License (OSL 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/osl-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-2012 PrestaShop SA
|
||||
* @version Release: $Revision: 7776 $
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 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;
|
||||
|
Before Width: | Height: | Size: 560 B |
|
Before Width: | Height: | Size: 504 B |
@@ -1,36 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2012 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Open Software License (OSL 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/osl-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-2012 PrestaShop SA
|
||||
* @version Release: $Revision: 7233 $
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 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;
|
||||
|
Before Width: | Height: | Size: 595 B |
|
Before Width: | Height: | Size: 451 B |
@@ -1,12 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<module>
|
||||
<name>authorizeaim</name>
|
||||
<displayName><![CDATA[Authorize.net AIM (Advanced Integration Method)]]></displayName>
|
||||
<version><![CDATA[1.3.1]]></version>
|
||||
<description><![CDATA[Receive payment with Authorize.net]]></description>
|
||||
<author><![CDATA[PrestaShop]]></author>
|
||||
<tab><![CDATA[payments_gateways]]></tab>
|
||||
<is_configurable>1</is_configurable>
|
||||
<need_instance>0</need_instance>
|
||||
<limited_countries></limited_countries>
|
||||
</module>
|
||||
|
Before Width: | Height: | Size: 8.3 KiB |
@@ -1,44 +0,0 @@
|
||||
<?php
|
||||
|
||||
global $_MODULE;
|
||||
$_MODULE = array();
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_f745351b1387473d3d2de5bfe18d3562'] = 'Fehler, bitte Kreditkarteninformationen überprüfen';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_1814fc250eea61e13aa95e81b61bf72a'] = 'Bezahlen Sie mit authorizeaim';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_442155d68aea78b4ef707796d76ca48c'] = 'Visa-Logo';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_f65943f43529e119969e533dc6f691f9'] = 'Master Card-Logo';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_2937b5dab08029b1055b37c98a98d740'] = 'Discover-Logo';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_3b8a6fa58a71e7448c264c9dc61e6904'] = 'American Express Logo';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_1edaf23879c3b52a8df80069d2af3cef'] = 'Sichere Kreditkartenzahlung mit Authorize.net';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_f11b368cddfe37c47af9b9d91c6ba4f0'] = 'Vollständiger Name';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_379c80c789f0f3e0165b5e6d5df839ca'] = 'Karten-Typ';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_a44217022190f5734b2f72ba1e4f8a79'] = 'Kartennummer';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_8c1279db4db86553e4b9682f78cf500e'] = 'Verfallsdatum';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_60a104dc50579d60cbc90158fada1dcf'] = 'CVV';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_6149e52c36edb9ee4494d5412e42eef2'] = 'die letzten drei Ziffern auf der Rückseite Ihrer Kreditkarte';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_40566b26dcc126bce704f2c1d622a6a3'] = 'Bestellung bestätigen';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_5dfe4041e37dfb15cdbdfe8b977950f5'] = 'Bitte überprüfen Sie Ihre Kreditkarteninformationen (Kreditkarten-Typ, Kreditkarten-Nr. und Verfallsdatum)';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_90c9737c99792791c8fe7c9e469bae9c'] = 'Bitte geben Sie den kompletten Namen an';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_cb313e911b15b21b57f4fc7b53058e4f'] = 'Zahlung mit Authorize.net erhalten';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_9d5b40ff49295ac0b4a5a13a88ccd285'] = 'cURL muss aktiviert sein, um dieses Modul nutzen zu können.';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_20015706a8cbd457cbb6ea3e7d5dc9b3'] = 'Konfiguration aktualisiert';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_6a26f548831e6a8c26bfbbd9f6ec61e0'] = 'Hilfe';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_11a4b229c0e206b831f729572618553f'] = 'In Ihrem PrestaShop Admin-Panel';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_bc6781f2b59d4e973bd0075baab62a40'] = 'Füllen Sie das Login-ID-Feld mit der von Authorize.net vorgesehenen Kennung aus';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_95eb440b753d6505aad5c3f72b50eec9'] = 'Füllen Sie das Schlüsselfeld mit dem Transaktionsschlüssel von Authorize.net aus';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_a7180ba675bb293f415aab47e52a1732'] = 'Hinweis: Ihre Webseite muss ein SSL-Zertifikat besitzen, um Authorize.net AIM verwenden zu können. Sie selbst sind für die sichere Aufbewahrung und Übermittlung der von Ihren Kunden an Sie übermittelten personenbezogenen Daten wie z.B. die Bankdaten verantwortlich. Prestashop entzieht sich jeder Verantwortung falls die Daten gestohlen werden.';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_f4f70727dc34561dfde1a3c529b6205c'] = 'Einstellungen';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_f3ef34226d51e9ca88eaa2f20d7ffb91'] = 'Login-ID';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_897356954c2cd3d41b221e3f24f99bba'] = 'Schlüssel';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_1ee1c44c2dc81681f961235604247b81'] = 'Modus:';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_756d97bb256b8580d4d71ee0c547804e'] = 'Produktion';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_0cbc6611f5540bd0809a388dc95a615b'] = 'Test';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_291cdb0a8abb42484f5d44dc20540ce6'] = 'Karten:';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_b17f3f4dcf653a5776792498a9b44d6a'] = 'Aktualisierungseinstellungen';
|
||||
$_MODULE['<{authorizeaim}prestashop>hookorderconfirmation_2e2117b7c81aa9ea6931641ea2c6499f'] = 'Ihre Bestellung vom';
|
||||
$_MODULE['<{authorizeaim}prestashop>hookorderconfirmation_75fbf512d744977d62599cc3f0ae2bb4'] = ' ist abgeschlossen.';
|
||||
$_MODULE['<{authorizeaim}prestashop>hookorderconfirmation_30163d8fc3068e8297e7ab5bf32aec87'] = 'Ihre Bestellung wird so schnell wie möglich zugeschickt.';
|
||||
$_MODULE['<{authorizeaim}prestashop>hookorderconfirmation_0db71da7150c27142eef9d22b843b4a9'] = 'Bei Fragen oder für weitere Informationen, kontaktieren Sie bitte unseren';
|
||||
$_MODULE['<{authorizeaim}prestashop>hookorderconfirmation_64430ad2835be8ad60c59e7d44e4b0b1'] = 'Kunden-Support';
|
||||
$_MODULE['<{authorizeaim}prestashop>hookorderconfirmation_8de637e24570c1edb0357826a2ad5aea'] = 'Bei Ihrer Bestellung ist ein Fehler aufgetreten. Bitte wenden Sie sich an unseren';
|
||||
|
||||
?>
|
||||
@@ -1,4 +0,0 @@
|
||||
<?php
|
||||
|
||||
global $_MODULE;
|
||||
$_MODULE = array();
|
||||
@@ -1,43 +0,0 @@
|
||||
<?php
|
||||
|
||||
global $_MODULE;
|
||||
$_MODULE = array();
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_cb313e911b15b21b57f4fc7b53058e4f'] = 'Recibir pagos con Authorize.net';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_9d5b40ff49295ac0b4a5a13a88ccd285'] = 'La extención cURL debe estar habilitada en su servidor para utilizar este modulo. ';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_20015706a8cbd457cbb6ea3e7d5dc9b3'] = 'Configuración actualizada';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_6a26f548831e6a8c26bfbbd9f6ec61e0'] = 'Ayuda';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_11a4b229c0e206b831f729572618553f'] = 'En su panel de administración de PrestaShop';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_bc6781f2b59d4e973bd0075baab62a40'] = 'Rellene el campo \"Nombre de usuario\" con el ID proporcionado por Authorize.net';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_95eb440b753d6505aad5c3f72b50eec9'] = 'Rellene el campo \"Clave\" con la clave de operación facilitada por Authorize.net';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_a7180ba675bb293f415aab47e52a1732'] = 'Atención: Su sitio web debe poseer un certificado SSL para utilizar el módulo Authorize.net AIM. Usted es responsable de la seguridad de los datos bancarios de sus clientes. PrestaShop no podrá ser culpado en caso de problemas de seguridad en su sitio web.';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_f4f70727dc34561dfde1a3c529b6205c'] = 'Configuración';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_f3ef34226d51e9ca88eaa2f20d7ffb91'] = 'Nombre de usuario';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_897356954c2cd3d41b221e3f24f99bba'] = 'Clave';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_1ee1c44c2dc81681f961235604247b81'] = 'Modo:';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_756d97bb256b8580d4d71ee0c547804e'] = 'Producción';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_0cbc6611f5540bd0809a388dc95a615b'] = 'Prueba';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_291cdb0a8abb42484f5d44dc20540ce6'] = 'Tarjetas:';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_7c413866cd5708e4c390273762b5c479'] = 'Estado de la orden \"En espera de revisión\"';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_b17f3f4dcf653a5776792498a9b44d6a'] = 'Actualizar la configuración';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_f745351b1387473d3d2de5bfe18d3562'] = 'Error, por favor compruebe sus datos bancarios';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_1814fc250eea61e13aa95e81b61bf72a'] = 'Pagar con authorizeaim';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_442155d68aea78b4ef707796d76ca48c'] = 'Logotipo de Visa';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_f65943f43529e119969e533dc6f691f9'] = 'Logotipo de MasterCard';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_2937b5dab08029b1055b37c98a98d740'] = 'Logotipo de Discover';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_3b8a6fa58a71e7448c264c9dc61e6904'] = 'Logotipo de American Express';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_1edaf23879c3b52a8df80069d2af3cef'] = 'Pago seguro con Authorize.net';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_f11b368cddfe37c47af9b9d91c6ba4f0'] = 'Nombre y apellidos';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_379c80c789f0f3e0165b5e6d5df839ca'] = 'Tipo de tarjeta';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_a44217022190f5734b2f72ba1e4f8a79'] = 'Número de tarjeta';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_8c1279db4db86553e4b9682f78cf500e'] = 'Fecha de caducidad';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_60a104dc50579d60cbc90158fada1dcf'] = 'CVV';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_6149e52c36edb9ee4494d5412e42eef2'] = 'los 3 últimos dígitos de la parte posterior de su tarjeta de crédito';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_40566b26dcc126bce704f2c1d622a6a3'] = 'Validar el pedido';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_5dfe4041e37dfb15cdbdfe8b977950f5'] = 'Por favor verifique le información de su tarjeta de crédito (tipo de tarjeta, fecha de expiración)';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_90c9737c99792791c8fe7c9e469bae9c'] = 'Por favor ponga su nombre completo';
|
||||
$_MODULE['<{authorizeaim}prestashop>hookorderconfirmation_2e2117b7c81aa9ea6931641ea2c6499f'] = 'Su orden en';
|
||||
$_MODULE['<{authorizeaim}prestashop>hookorderconfirmation_75fbf512d744977d62599cc3f0ae2bb4'] = 'está completa.';
|
||||
$_MODULE['<{authorizeaim}prestashop>hookorderconfirmation_30163d8fc3068e8297e7ab5bf32aec87'] = 'Su orden será enviada lo antes posible.';
|
||||
$_MODULE['<{authorizeaim}prestashop>hookorderconfirmation_0db71da7150c27142eef9d22b843b4a9'] = 'Para cualquier pregunta o más información, por favor, contacte nuestro';
|
||||
$_MODULE['<{authorizeaim}prestashop>hookorderconfirmation_64430ad2835be8ad60c59e7d44e4b0b1'] = 'servicio al cliente';
|
||||
$_MODULE['<{authorizeaim}prestashop>hookorderconfirmation_8de637e24570c1edb0357826a2ad5aea'] = 'Hemos encontrado un problema con su orden. Si usted considera que esto es un error puede contactar a nuestro';
|
||||
@@ -1,42 +0,0 @@
|
||||
<?php
|
||||
|
||||
global $_MODULE;
|
||||
$_MODULE = array();
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_cb313e911b15b21b57f4fc7b53058e4f'] = 'Recevoir des paiments avec Authorize.net';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_9d5b40ff49295ac0b4a5a13a88ccd285'] = 'L\'extension cURL doit être activée sur votre serveur pour utiliser ce module.';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_20015706a8cbd457cbb6ea3e7d5dc9b3'] = 'Configuration mise à jour';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_6a26f548831e6a8c26bfbbd9f6ec61e0'] = 'Aide';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_11a4b229c0e206b831f729572618553f'] = 'Dans votre panneau d\'aministration PrestaShop';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_bc6781f2b59d4e973bd0075baab62a40'] = 'Indiquez le login fourni par Authorize.net';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_95eb440b753d6505aad5c3f72b50eec9'] = 'Indiquez la clé de transaction fournie par Authorize.net';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_a7180ba675bb293f415aab47e52a1732'] = 'Attention: votre site doit posséder un certificat SSL pour utiliser le module Authorize.net AIM. Vous êtes responsable de la sécurité des informations bancaires de vos clients. PrestaShop ne peut être tenu responsable en cas de problème de sécurité sur votre site.';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_f4f70727dc34561dfde1a3c529b6205c'] = 'Paramètres';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_f3ef34226d51e9ca88eaa2f20d7ffb91'] = 'Login';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_897356954c2cd3d41b221e3f24f99bba'] = 'Clé';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_1ee1c44c2dc81681f961235604247b81'] = 'Mode';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_756d97bb256b8580d4d71ee0c547804e'] = 'Production';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_0cbc6611f5540bd0809a388dc95a615b'] = 'Test';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_291cdb0a8abb42484f5d44dc20540ce6'] = 'Cartes';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_b17f3f4dcf653a5776792498a9b44d6a'] = 'Mettre à jour la configuration';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_f745351b1387473d3d2de5bfe18d3562'] = 'Erreur, veuillez verifier vos informations bancaires';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_1814fc250eea61e13aa95e81b61bf72a'] = 'Payer avec AuthorizeAIM';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_442155d68aea78b4ef707796d76ca48c'] = 'Logo Visa';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_f65943f43529e119969e533dc6f691f9'] = 'Logo Mastercard';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_2937b5dab08029b1055b37c98a98d740'] = 'Logo Discover';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_3b8a6fa58a71e7448c264c9dc61e6904'] = 'Logo American Express';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_1edaf23879c3b52a8df80069d2af3cef'] = 'Paiement sécurisé avec Authorize.net';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_f11b368cddfe37c47af9b9d91c6ba4f0'] = 'Nom complet';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_379c80c789f0f3e0165b5e6d5df839ca'] = 'Type de carte';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_a44217022190f5734b2f72ba1e4f8a79'] = 'Numéro de carte';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_8c1279db4db86553e4b9682f78cf500e'] = 'Date d\'expiration';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_60a104dc50579d60cbc90158fada1dcf'] = 'Code CVV';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_6149e52c36edb9ee4494d5412e42eef2'] = 'les 3 derniers chiffres au dos de votre carte';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_40566b26dcc126bce704f2c1d622a6a3'] = 'Valider la commande';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_5dfe4041e37dfb15cdbdfe8b977950f5'] = 'Veuillez vérifier vos informations bancaires (type de carte de crédit, numéro et date d\'expiration)';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_90c9737c99792791c8fe7c9e469bae9c'] = 'Merci de spécifier votre nom complet';
|
||||
$_MODULE['<{authorizeaim}prestashop>hookorderconfirmation_2e2117b7c81aa9ea6931641ea2c6499f'] = 'Votre commande sur';
|
||||
$_MODULE['<{authorizeaim}prestashop>hookorderconfirmation_75fbf512d744977d62599cc3f0ae2bb4'] = 'Est reussie';
|
||||
$_MODULE['<{authorizeaim}prestashop>hookorderconfirmation_30163d8fc3068e8297e7ab5bf32aec87'] = 'Votre commende vous sera expedié le plus rapidement possible';
|
||||
$_MODULE['<{authorizeaim}prestashop>hookorderconfirmation_0db71da7150c27142eef9d22b843b4a9'] = 'Pour toute question, contactez nous';
|
||||
$_MODULE['<{authorizeaim}prestashop>hookorderconfirmation_64430ad2835be8ad60c59e7d44e4b0b1'] = 'Service client';
|
||||
$_MODULE['<{authorizeaim}prestashop>hookorderconfirmation_8de637e24570c1edb0357826a2ad5aea'] = 'Nous avons remarqué une erreur avec votre commande. Si vous pensez que c\'est une erreur, vous pouvez contacter notre';
|
||||
|
Before Width: | Height: | Size: 911 B |
@@ -1,36 +0,0 @@
|
||||
{*
|
||||
* 2007-2012 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-2012 PrestaShop SA
|
||||
* @version Release: $Revision: 14297 $
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*}
|
||||
{if $status == 'ok'}
|
||||
<p>{l s='Your order on' mod='authorizeaim'} <span class="bold">{$shop_name}</span> {l s='is complete.' mod='authorizeaim'}
|
||||
<br /><br /><span class="bold">{l s='Your order will be sent as soon as possible.' mod='authorizeaim'}</span>
|
||||
<br /><br />{l s='For any questions or for further information, please contact our' mod='authorizeaim'} <a href="{$link->getPageLink('contact', true)}">{l s='customer support' mod='authorizeaim'}</a>.
|
||||
</p>
|
||||
{else}
|
||||
<p class="warning">
|
||||
{l s='We noticed a problem with your order. If you think this is an error, you can contact our' mod='authorizeaim'}
|
||||
<a href="{$link->getPageLink('contact', true)}">{l s='customer support' mod='authorizeaim'}</a>.
|
||||
</p>
|
||||
{/if}
|
||||
@@ -1,36 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2012 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Open Software License (OSL 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/osl-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-2012 PrestaShop SA
|
||||
* @version Release: $Revision: 14011 $
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 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;
|
||||
@@ -1,44 +0,0 @@
|
||||
<?php
|
||||
|
||||
global $_MODULE;
|
||||
$_MODULE = array();
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_f745351b1387473d3d2de5bfe18d3562'] = 'Errore, vi preghiamo di verificare le informazioni della carta';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_1814fc250eea61e13aa95e81b61bf72a'] = 'Paga con authorizeaim';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_442155d68aea78b4ef707796d76ca48c'] = 'logo visa';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_f65943f43529e119969e533dc6f691f9'] = 'logo mastercard';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_2937b5dab08029b1055b37c98a98d740'] = 'logo discover';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_3b8a6fa58a71e7448c264c9dc61e6904'] = 'logo american express';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_1edaf23879c3b52a8df80069d2af3cef'] = 'Pagamento sicuro con carta di credito con Authorize.net';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_f11b368cddfe37c47af9b9d91c6ba4f0'] = 'Nome completo';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_379c80c789f0f3e0165b5e6d5df839ca'] = 'Tipo di carta';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_a44217022190f5734b2f72ba1e4f8a79'] = 'Numero di carta';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_8c1279db4db86553e4b9682f78cf500e'] = 'Data di scadenza';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_60a104dc50579d60cbc90158fada1dcf'] = 'CVV';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_6149e52c36edb9ee4494d5412e42eef2'] = 'le ultime 3 cifre sul retro della vostra carta di credito';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_40566b26dcc126bce704f2c1d622a6a3'] = 'Convalida ordine';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_5dfe4041e37dfb15cdbdfe8b977950f5'] = 'Per favore verifica le informazione della tua carta (Tipo di carta, numero e data)';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_90c9737c99792791c8fe7c9e469bae9c'] = 'Inserisci il tuo nome completo';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_cb313e911b15b21b57f4fc7b53058e4f'] = 'Ricevi il pagamento con Authorize.net';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_9d5b40ff49295ac0b4a5a13a88ccd285'] = 'estensione cURL deve essere abilitato sul server per utilizzare questo modulo.';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_20015706a8cbd457cbb6ea3e7d5dc9b3'] = 'Configurazione aggiornata';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_6a26f548831e6a8c26bfbbd9f6ec61e0'] = 'Aiuto';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_11a4b229c0e206b831f729572618553f'] = 'Nel tuo pannello admin PrestaShop';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_bc6781f2b59d4e973bd0075baab62a40'] = 'Riempi il campo ID Login con quello fornito da Authorize.net';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_95eb440b753d6505aad5c3f72b50eec9'] = 'Riempire il campo chiave con la chiave di transazione fornita da Authorize.net';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_a7180ba675bb293f415aab47e52a1732'] = 'Attenzione: Il tuo sito web deve possedere un certificato SSL per utilizzare il sistema AIM Authorize.net pagamento. L\'utente è responsabile per la sicurezza dei dati bancari dei vostri clienti \'. PrestaShop non possono essere incolpati per qualsiasi problema di sicurezza nel tuo sito web.';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_f4f70727dc34561dfde1a3c529b6205c'] = 'Impostazioni';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_f3ef34226d51e9ca88eaa2f20d7ffb91'] = 'ID Login ';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_897356954c2cd3d41b221e3f24f99bba'] = 'Chiave';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_1ee1c44c2dc81681f961235604247b81'] = 'Modalità:';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_756d97bb256b8580d4d71ee0c547804e'] = 'Produzione';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_0cbc6611f5540bd0809a388dc95a615b'] = 'Test';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_291cdb0a8abb42484f5d44dc20540ce6'] = 'Carte di credito:';
|
||||
$_MODULE['<{authorizeaim}prestashop>authorizeaim_b17f3f4dcf653a5776792498a9b44d6a'] = 'Aggiorna le impostazioni';
|
||||
$_MODULE['<{authorizeaim}prestashop>hookorderconfirmation_2e2117b7c81aa9ea6931641ea2c6499f'] = 'Il tuo ordine';
|
||||
$_MODULE['<{authorizeaim}prestashop>hookorderconfirmation_75fbf512d744977d62599cc3f0ae2bb4'] = 'è completo.';
|
||||
$_MODULE['<{authorizeaim}prestashop>hookorderconfirmation_30163d8fc3068e8297e7ab5bf32aec87'] = 'Il tuo ordine verrà inviato al più presto.';
|
||||
$_MODULE['<{authorizeaim}prestashop>hookorderconfirmation_0db71da7150c27142eef9d22b843b4a9'] = 'Per eventuali domande o per ulteriori informazioni, contatta la nostra';
|
||||
$_MODULE['<{authorizeaim}prestashop>hookorderconfirmation_64430ad2835be8ad60c59e7d44e4b0b1'] = 'assistenza clienti';
|
||||
$_MODULE['<{authorizeaim}prestashop>hookorderconfirmation_8de637e24570c1edb0357826a2ad5aea'] = 'Abbiamo notato un problema con il tuo ordine. Se pensi che questo sia un errore, contatta la nostra';
|
||||
|
||||
?>
|
||||
|
Before Width: | Height: | Size: 79 B |
|
Before Width: | Height: | Size: 6.4 KiB |
|
Before Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 611 B |
@@ -1,133 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2012 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-2012 PrestaShop SA
|
||||
* @version Release: $Revision: 14011 $
|
||||
* @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');
|
||||
/* will include backward file */
|
||||
include(dirname(__FILE__). '/authorizeaim.php');
|
||||
|
||||
$authorizeaim = new authorizeAIM();
|
||||
|
||||
/* SSL Tricks to bypass the redirect for the FrontController in 1.5 + */
|
||||
Configuration::updateValue('PS_SSL_ENABLED', 0);
|
||||
include(dirname(__FILE__). '/../../init.php');
|
||||
Configuration::updateValue('PS_SSL_ENABLED', 1);
|
||||
|
||||
/* Transform the POST from the template to a GET for the CURL */
|
||||
if (isset($_POST['x_exp_date_m']) && isset($_POST['x_exp_date_y']))
|
||||
{
|
||||
$_POST['x_exp_date'] = $_POST['x_exp_date_m'].$_POST['x_exp_date_y'];
|
||||
unset($_POST['x_exp_date_m']);
|
||||
unset($_POST['x_exp_date_y']);
|
||||
}
|
||||
$postString = '';
|
||||
foreach ($_POST as $key => $value)
|
||||
$postString .= $key.'='.urlencode($value).'&';
|
||||
|
||||
$postString = trim($postString, '&');
|
||||
|
||||
$url = 'https://secure.authorize.net/gateway/transact.dll';
|
||||
if (Configuration::get('AUTHORIZE_AIM_DEMO'))
|
||||
{
|
||||
$postString .= '&x_test_request=TRUE';
|
||||
$url = 'https://test.authorize.net/gateway/transact.dll';
|
||||
}
|
||||
|
||||
/* Do the CURL request ro Authorize.net */
|
||||
$request = curl_init($url);
|
||||
curl_setopt($request, CURLOPT_HEADER, 0);
|
||||
curl_setopt($request, CURLOPT_RETURNTRANSFER, 1);
|
||||
curl_setopt($request, CURLOPT_POSTFIELDS, $postString);
|
||||
curl_setopt($request, CURLOPT_SSL_VERIFYPEER, FALSE);
|
||||
$postResponse = curl_exec($request);
|
||||
curl_close($request);
|
||||
|
||||
$response = explode('|', $postResponse);
|
||||
if (!isset($response[7]) || !isset($response[3]) || !isset($response[9]))
|
||||
{
|
||||
$msg = 'Authorize.net returned a malformed response for cart';
|
||||
if (isset($response[7]))
|
||||
$msg .= ' '.(int)$response[7];
|
||||
Logger::addLog($msg, 4);
|
||||
die('Authorize.net returned a malformed response, aborted.');
|
||||
}
|
||||
|
||||
/* Does the cart exist and is valid? */
|
||||
$cart = new Cart((int)$response[7]);
|
||||
if (!Validate::isLoadedObject($cart))
|
||||
{
|
||||
Logger::addLog('Cart loading failed for cart '.(int)$response[7], 4);
|
||||
die('An unrecoverable error occured with the cart '.(int)$repsonse[7]);
|
||||
}
|
||||
$customer = new Customer((int)$cart->id_customer);
|
||||
$message = $response[3];
|
||||
$payment_method = 'Authorize.net AIM';
|
||||
|
||||
switch ($response[0]) // Response code
|
||||
{
|
||||
case 1: // Payment accepted
|
||||
$authorizeaim->setTransactionDetail($response);
|
||||
$authorizeaim->validateOrder((int)$cart->id,
|
||||
Configuration::get('PS_OS_PAYMENT'), (float)$response[9],
|
||||
$payment_method, $message, NULL, NULL, false, $customer->secure_key);
|
||||
break ;
|
||||
|
||||
case 4: // Hold for review
|
||||
$authorizeaim->validateOrder((int)$cart->id,
|
||||
Configuration::get('AUTHORIZE_AIM_HOLD_REVIEW_OS'), (float)$response[9],
|
||||
$authorizeaim->displayName, $response[3]);
|
||||
break ;
|
||||
|
||||
default:
|
||||
$checkout_type = Configuration::get('PS_ORDER_PROCESS_TYPE') ?
|
||||
'order-opc' : 'order';
|
||||
$url = _PS_VERSION_ >= '1.5' ?
|
||||
'index.php?controller='.$checkout_type.'&' : $checkout_type.'.php?';
|
||||
$url .= 'step=3&cgv=1&aimerror=1';
|
||||
|
||||
if (!isset($_SERVER['HTTP_REFERER']) ||
|
||||
strstr($_SERVER['HTTP_REFERER'], 'order'))
|
||||
Tools::redirect($url);
|
||||
elseif (strstr($_SERVER['HTTP_REFERER'], '?'))
|
||||
Tools::redirect($_SERVER['HTTP_REFERER'].'&aimerror=1', '');
|
||||
else
|
||||
Tools::redirect($_SERVER['HTTP_REFERER'].'?aimerror=1', '');
|
||||
|
||||
exit;
|
||||
|
||||
/// @todo check the reason code and determine weither we should retry are
|
||||
/// mark the order as failed.
|
||||
$authorizeaim->validateOrder((int)$cart->id,
|
||||
Configuration::get('PS_OS_ERROR'), (float)$response[9],
|
||||
$payment_method, $message, NULL, NULL, false, $customer->secure_key);
|
||||
}
|
||||
|
||||
$url = 'index.php?controller=order-confirmation&';
|
||||
if (_PS_VERSION_ < '1.5')
|
||||
$url = 'order-confirmation.php?';
|
||||
|
||||
Tools::redirect($url.'id_module='.(int)$authorizeaim->id.'&id_cart='.
|
||||
(int)$cart->id.'&key='.$customer->secure_key);
|
||||
@@ -1,221 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2012 PrestaShop SA
|
||||
* @version Release: $Revision: 1.4 $
|
||||
*
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
// Retro 1.3, 'class_exists' cause problem with autoload...
|
||||
if (version_compare(_PS_VERSION_, '1.4', '<'))
|
||||
{
|
||||
// Not exist for 1.3
|
||||
class Shop extends ObjectModel
|
||||
{
|
||||
public $id = 1;
|
||||
public $id_group_shop = 1;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public static function getShops()
|
||||
{
|
||||
return array(
|
||||
array('id_shop' => 1, 'name' => 'Default shop')
|
||||
);
|
||||
}
|
||||
|
||||
public static function getCurrentShop()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
class Logger
|
||||
{
|
||||
public static function AddLog($message, $severity = 2)
|
||||
{
|
||||
$fp = fopen(dirname(__FILE__).'/../logs.txt', 'a+');
|
||||
fwrite($fp, '['.(int)$severity.'] '.Tools::safeOutput($message));
|
||||
fclose($fp);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Not exist for 1.3 and 1.4
|
||||
class Context
|
||||
{
|
||||
/**
|
||||
* @var Context
|
||||
*/
|
||||
protected static $instance;
|
||||
|
||||
/**
|
||||
* @var Cart
|
||||
*/
|
||||
public $cart;
|
||||
|
||||
/**
|
||||
* @var Customer
|
||||
*/
|
||||
public $customer;
|
||||
|
||||
/**
|
||||
* @var Cookie
|
||||
*/
|
||||
public $cookie;
|
||||
|
||||
/**
|
||||
* @var Link
|
||||
*/
|
||||
public $link;
|
||||
|
||||
/**
|
||||
* @var Country
|
||||
*/
|
||||
public $country;
|
||||
|
||||
/**
|
||||
* @var Employee
|
||||
*/
|
||||
public $employee;
|
||||
|
||||
/**
|
||||
* @var Controller
|
||||
*/
|
||||
public $controller;
|
||||
|
||||
/**
|
||||
* @var Language
|
||||
*/
|
||||
public $language;
|
||||
|
||||
/**
|
||||
* @var Currency
|
||||
*/
|
||||
public $currency;
|
||||
|
||||
/**
|
||||
* @var AdminTab
|
||||
*/
|
||||
public $tab;
|
||||
|
||||
/**
|
||||
* @var Shop
|
||||
*/
|
||||
public $shop;
|
||||
|
||||
/**
|
||||
* @var Smarty
|
||||
*/
|
||||
public $smarty;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
global $cookie, $cart, $smarty, $link;
|
||||
|
||||
$this->tab = null;
|
||||
|
||||
if ($cookie)
|
||||
$this->cookie = $cookie;
|
||||
|
||||
$this->cart = $cart;
|
||||
$this->smarty = $smarty;
|
||||
$this->link = $link;
|
||||
|
||||
$this->controller = new ControllerBackwardModule();
|
||||
if ($cookie)
|
||||
{
|
||||
$this->currency = new Currency((int)$cookie->id_currency);
|
||||
$this->language = new Language((int)$cookie->id_lang);
|
||||
$this->country = new Country((int)$cookie->id_country);
|
||||
$this->customer = new Customer((int)$cookie->id_customer);
|
||||
$this->employee = new Employee((int)$cookie->id_employee);
|
||||
}
|
||||
$this->shop = new ShopBackwardModule();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a singleton context
|
||||
*
|
||||
* @return Context
|
||||
*/
|
||||
public static function getContext()
|
||||
{
|
||||
if (!isset(self::$instance))
|
||||
self::$instance = new Context();
|
||||
return self::$instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clone current context
|
||||
*
|
||||
* @return Context
|
||||
*/
|
||||
public function cloneContext()
|
||||
{
|
||||
return clone($this);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int Shop context type (Shop::CONTEXT_ALL, etc.)
|
||||
*/
|
||||
public static function shop()
|
||||
{
|
||||
if (!self::$instance->shop->getContextType())
|
||||
return ShopBackwardModule::CONTEXT_ALL;
|
||||
return self::$instance->shop->getContextType();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Class Shop for Backward compatibility
|
||||
*/
|
||||
class ShopBackwardModule extends Shop
|
||||
{
|
||||
const CONTEXT_ALL = 1;
|
||||
public $id = 1;
|
||||
public $id_group_shop = 1;
|
||||
|
||||
|
||||
public function getContextType()
|
||||
{
|
||||
return ShopBackwardModule::CONTEXT_ALL;
|
||||
}
|
||||
|
||||
// Simulate shop for 1.3 / 1.4
|
||||
public function getID()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Class Controller for a Backward compatibility
|
||||
* Allow to use method declared in 1.5
|
||||
*/
|
||||
class ControllerBackwardModule
|
||||
{
|
||||
/**
|
||||
* @param $js_uri
|
||||
* @return void
|
||||
*/
|
||||
public function addJS($js_uri)
|
||||
{
|
||||
Tools::addJS($js_uri);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $css_uri
|
||||
* @param string $css_media_type
|
||||
* @return void
|
||||
*/
|
||||
public function addCSS($css_uri, $css_media_type = 'all')
|
||||
{
|
||||
Tools::addCSS($css_uri, $css_media_type);
|
||||
}
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2012 PrestaShop SA
|
||||
* @version Release: $Revision: 1.4 $
|
||||
*
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
/**
|
||||
* Backward function compatibility
|
||||
* Need to be called for each module in 1.4
|
||||
*/
|
||||
|
||||
// Get out if the context is already defined
|
||||
if (!in_array('Context', get_declared_classes()))
|
||||
require_once(dirname(__FILE__).'/Context.php');
|
||||
|
||||
if (!isset($this) || isset($this->context))
|
||||
return;
|
||||
|
||||
$this->context = Context::getContext();
|
||||
$this->smarty = $this->context->smarty;
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2012 PrestaShop SA
|
||||
* @version Release: $Revision: 1.4 $
|
||||
*
|
||||
* 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;
|
||||
@@ -1,860 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2012 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-2012 PrestaShop SA
|
||||
* @version Release: $Revision: 1.4 $
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
// Security
|
||||
if (!defined('_PS_VERSION_'))
|
||||
exit;
|
||||
|
||||
if (file_exists(dirname(__FILE__).'/lib/CloudCacheApi.php'))
|
||||
require(dirname(__FILE__).'/lib/CloudCacheApi.php');
|
||||
elseif (file_exists(dirname(__FILE__).'/../modules/cloudcache/lib/CloudCacheApi.php'))
|
||||
require(dirname(__FILE__).'/../modules/cloudcache/lib/CloudCacheApi.php');
|
||||
|
||||
define('CLOUDCACHE_API_PORT', 80);
|
||||
define('CLOUDCACHE_API_HTTP_METHOD', 'http11');
|
||||
define('CLOUDCACHE_API_URI', '/xmlrpc/');
|
||||
define('CLOUDCACHE_API_URL', 'api.netdna.com');
|
||||
define('CLOUDCACHE_API_ZONE_URL', 'netdna-cdn.com');
|
||||
define('CLOUDCACHE_API_HASH_TYPE', 'sha256');
|
||||
define('CLOUDCACHE_API_PULL_ZONE_TYPE', 1);
|
||||
|
||||
class CloudCache extends Module
|
||||
{
|
||||
/** @var _cipherTool Helper Object to encrypt API KEY */
|
||||
private $_cipherTool;
|
||||
|
||||
/** @var _api Cloudcache Api Object */
|
||||
private $_api;
|
||||
|
||||
/******************************************************************/
|
||||
/** Construct Method **********************************************/
|
||||
/******************************************************************/
|
||||
public function __construct()
|
||||
{
|
||||
$this->name = 'cloudcache';
|
||||
$this->tab = 'administration';
|
||||
$this->version = '1.2';
|
||||
$this->author = 'PrestaShop';
|
||||
|
||||
parent::__construct();
|
||||
|
||||
$this->displayName = $this->l('CloudCache');
|
||||
$this->description = $this->l('Supercharge your Shop with the CloudCache.com Content Delivery Network (CDN).');
|
||||
|
||||
|
||||
/* Backward compatibility */
|
||||
require(_PS_MODULE_DIR_.$this->name.'/backward_compatibility/backward.php');
|
||||
$this->context->smarty->assign('base_dir', __PS_BASE_URI__);
|
||||
|
||||
if (Configuration::get('PS_CIPHER_ALGORITHM'))
|
||||
$this->_cipherTool = new Rijndael(_RIJNDAEL_KEY_, _RIJNDAEL_IV_);
|
||||
else
|
||||
$this->_cipherTool = new Blowfish(_COOKIE_KEY_, _COOKIE_IV_);
|
||||
|
||||
$this->_api = new CloudcacheApi();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Install/Uninstall Configuration variables
|
||||
*
|
||||
* @param install True for installation, false for uninstall
|
||||
*
|
||||
* @return Success or failure
|
||||
*/
|
||||
private function _setupConfigVariables($install = true)
|
||||
{
|
||||
$configVars = array(
|
||||
'CLOUDCACHE_API_USER' => '',
|
||||
'CLOUDCACHE_API_KEY' => '',
|
||||
'CLOUDCACHE_API_COMPANY_ID' => '',
|
||||
'CLOUDCACHE_API_ACTIVE' => 0,
|
||||
);
|
||||
|
||||
$error = 0;
|
||||
foreach ($configVars as $varName => $value)
|
||||
if ($install)
|
||||
$error += Configuration::updateValue($varName, $value) ? 0 : 1;
|
||||
else
|
||||
$error += Configuration::deleteByName($varName) ? 0 : 1;
|
||||
|
||||
return $error > 0 ? false : true;
|
||||
}
|
||||
|
||||
private function _installOverride()
|
||||
{
|
||||
// Hash of the empty file in 1.5 => file name
|
||||
$files = array('810f3fa83a88b5019be31d7b80db460d' => 'classes/Tools.php');
|
||||
if (_PS_VERSION_ > '1.5')
|
||||
$files['5b917f57038acb75714cf144c9043bb4'] = 'classes/controller/FrontController.php';
|
||||
|
||||
// Make sure the environment is OK
|
||||
if (!is_dir(dirname(__FILE__).'/../../override/classes/'))
|
||||
mkdir(dirname(__FILE__).'/../../override/classes/', 0777, true);
|
||||
if (_PS_VERSION_ > '1.5' && !is_dir(dirname(__FILE__).'/../../override/classes/controller/'))
|
||||
mkdir(dirname(__FILE__).'/../../override/classes/controller/', 0777);
|
||||
|
||||
$errors = array();
|
||||
foreach ($files as $hash => $path)
|
||||
{
|
||||
if (file_exists(dirname(__FILE__).'/../../override/'.$path))
|
||||
{
|
||||
if (md5_file(dirname(__FILE__).'/../../override/'.$path) == $hash)
|
||||
rename(dirname(__FILE__).'/../../override/'.$path, dirname(__FILE__).'/../../override/'.$path.'.origin.php');
|
||||
elseif (md5_file(dirname(__FILE__).'/../../override/'.$path) == md5_file(dirname(__FILE__).'/override/'.$path))
|
||||
continue ;
|
||||
else
|
||||
{
|
||||
$errors[] = '/override/'.$path;
|
||||
continue ;
|
||||
}
|
||||
}
|
||||
copy(dirname(__FILE__).'/override/'.$path, dirname(__FILE__).'/../../override/'.$path);
|
||||
}
|
||||
|
||||
if (count($errors))
|
||||
die('<div class="conf warn">
|
||||
<img src="../img/admin/warn2.png" alt="" title="" />'.
|
||||
$this->l('The module was successfully installed (').
|
||||
'<a href="?tab=AdminModules&configure=cloudcache&token='.Tools::getAdminTokenLite('AdminModules').'&tab_module=administration&module_name=cloudcache" style="color: blue;">'.$this->l('configure').'</a>'.
|
||||
$this->l(') but the following file already exist. Please, merge the file manually.').'<br />'.
|
||||
implode('<br />', $errors).
|
||||
'</div>');
|
||||
return true;
|
||||
}
|
||||
|
||||
/******************************************************************/
|
||||
/** Install / Uninstall Methods ***********************************/
|
||||
/******************************************************************/
|
||||
public function install()
|
||||
{
|
||||
// Setup config variable with 'install' flag on
|
||||
if (!$this->_setupConfigVariables(true))
|
||||
return false;
|
||||
|
||||
if (!parent::install() || !$this->registerHook('backOfficeTop'))
|
||||
return false;
|
||||
|
||||
// Perform the sql install
|
||||
include(dirname(__FILE__).'/sql/sql-install.php');
|
||||
foreach ($sql as $s)
|
||||
if (!Db::getInstance()->execute($s))
|
||||
return false;
|
||||
|
||||
return $this->_installOverride();;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Uninstall function
|
||||
*
|
||||
* @return Success or failure
|
||||
*/
|
||||
public function uninstall()
|
||||
{
|
||||
// Uninstall parent and unregister Configuration
|
||||
if (!parent::uninstall())
|
||||
return false;
|
||||
|
||||
// Unregister hook
|
||||
if (!$this->unregisterHook('backOfficeTop'))
|
||||
return false;
|
||||
|
||||
// Remove configuration variable with 'install' flag off
|
||||
if (!$this->_setupConfigVariables(false))
|
||||
return false;
|
||||
|
||||
// Uninstall SQL
|
||||
include(dirname(__FILE__).'/sql/sql-uninstall.php');
|
||||
foreach ($sql as $s)
|
||||
if (!Db::getInstance()->execute($s))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Check that everything is alright for Cloudcache usage.
|
||||
*
|
||||
* @return Array empty on success, filled with error messages on failure.
|
||||
*/
|
||||
private function _compatibilityCheck()
|
||||
{
|
||||
// Compatibility check
|
||||
$messages = array();
|
||||
if (Configuration::get('PS_CSS_THEME_CACHE') ||
|
||||
Configuration::get('PS_JS_THEME_CACHE') ||
|
||||
Configuration::get('PS_HTML_THEME_COMPRESSION') ||
|
||||
Configuration::get('PS_JS_HTML_THEME_COMPRESSION') ||
|
||||
Configuration::get('PS_HIGH_HTML_THEME_COMPRESSION'))
|
||||
$messages[] = $this->l('In order to succesfully use Cloudcache, please fix the following:');
|
||||
|
||||
if (Configuration::get('PS_CSS_THEME_CACHE'))
|
||||
$messages[] = $this->l('Make sure you check "Keep CSS as original"');
|
||||
if (Configuration::get('PS_JS_THEME_CACHE'))
|
||||
$messages[] = $this->l('Make sure you check "Keep JavaScript as original"');
|
||||
if (Configuration::get('PS_HTML_THEME_COMPRESSION'))
|
||||
$messages[] = $this->l('Make sure you check "Keep HTML as original"');
|
||||
if (Configuration::get('PS_JS_HTML_THEME_COMPRESSION'))
|
||||
$messages[] = $this->l('Make sure you check "Keep inline JavaScript in HTML as original"');
|
||||
if (Configuration::get('PS_HIGH_HTML_THEME_COMPRESSION'))
|
||||
$messages[] = $this->l('Make sure you check "Keep W3C validation"');
|
||||
if (!extension_loaded('curl'))
|
||||
$messages[] = $this->l('You should ask your hosting provider to enable CURL extension in PHP (php.ini) for Cloudcache module to work.');
|
||||
|
||||
// If there is any compatibility issue, just deactivate everything
|
||||
if (count($messages))
|
||||
Configuration::updateValue('CLOUDCACHE_API_ACTIVE', 0);
|
||||
|
||||
return $messages;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief hookBackOfficeTop Implementation.
|
||||
*
|
||||
* Hook that allow to add script anywhere in the backoffice.
|
||||
*
|
||||
* @return Render to display
|
||||
*/
|
||||
public function hookBackOfficeTop()
|
||||
{
|
||||
$this->context->smarty->assign('isModuleActive', $this->active);
|
||||
$this->context->smarty->assign('adminToken', Tools::getAdminTokenLite('AdminModules'));
|
||||
|
||||
$messages = $this->_compatibilityCheck();
|
||||
if (count($messages))
|
||||
$this->context->smarty->assign('compatibilityIssues', $messages);
|
||||
|
||||
return $this->display(__FILE__, 'views/backOfficeTop.tpl');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Empty all tables of the module.
|
||||
*/
|
||||
private function _clearTables()
|
||||
{
|
||||
Db::getInstance()->execute('DELETE FROM `'._DB_PREFIX_.'cloudcache_zone` WHERE `id_shop` = '.(int)$this->context->shop->id);
|
||||
}
|
||||
|
||||
private function _getCouponUrl()
|
||||
{
|
||||
$curLang = $this->context->cookie->id_lang;
|
||||
|
||||
// $prestaBaseUrl = 'http://www.prestashop.com/modules/cloudcache.png?source='.urlencode($_SERVER['HTTP_HOST']);
|
||||
$prestaBaseUrl = __PS_BASE_URI__.'modules/cloudcache/coupon.php?lang='.$curLang.'&source='.urlencode($_SERVER['HTTP_HOST']);
|
||||
if (Configuration::get('CLOUDCACHE_API_ACTIVE'))
|
||||
return $prestaBaseUrl.'&userId='.((int)Configuration::get('CLOUDCACHE_API_USER')).
|
||||
'&companyId='.urlencode(Configuration::get('CLOUDCACHE_API_COMPANY_ID'));
|
||||
return $prestaBaseUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Main Form Method
|
||||
*
|
||||
* @return Rendered form
|
||||
*/
|
||||
public function getContent()
|
||||
{
|
||||
if (Tools::isSubmit('SubmitCloudcacheSettings'))
|
||||
{
|
||||
// If we change the credentials, we deactivate the module
|
||||
Configuration::updateValue('CLOUDCACHE_API_ACTIVE', 0);
|
||||
// And clear the local cache for the zones
|
||||
$this->_clearTables();
|
||||
|
||||
Configuration::updateValue('CLOUDCACHE_API_USER',
|
||||
Tools::getValue('cloudcache_api_user'));
|
||||
Configuration::updateValue('CLOUDCACHE_API_COMPANY_ID',
|
||||
Tools::getValue('cloudcache_api_company_id'));
|
||||
Configuration::updateValue('CLOUDCACHE_API_KEY',
|
||||
$this->_cipherTool->encrypt(Tools::getValue('cloudcache_api_key')));
|
||||
|
||||
$this->context->smarty->assign('confirmMessage',
|
||||
$this->_displayConfirmation());
|
||||
}
|
||||
elseif (Tools::isSubmit('SubmitCloudcacheTestConnection'))
|
||||
$connectionTestResult = $this->_testConnection();
|
||||
elseif (Tools::isSubmit('SubmitCloudcacheAdd_zone'))
|
||||
{
|
||||
// Check http[s]
|
||||
if (substr(Tools::getValue('origin'), 0, 7) != 'http://' &&
|
||||
substr(Tools::getValue('origin'), 0, 8) != 'https://')
|
||||
$origin = 'http://'.Tools::getValue('origin');
|
||||
else
|
||||
$origin = Tools::getValue('origin');
|
||||
|
||||
if (substr(Tools::getValue('vanity_domain'), 0, 7) == 'http://' ||
|
||||
substr(Tools::getValue('vanity_domain'), 0, 8) == 'https://')
|
||||
$vanity = substr(Tools::getValue('vanity_domain'), strpos(':') + 3);
|
||||
else
|
||||
$vanity = Tools::getValue('vanity_domain');
|
||||
|
||||
$zone_info = array(
|
||||
'name' => Tools::getValue('name'),
|
||||
'origin' => $origin,
|
||||
'vanity_domain' => $vanity,
|
||||
'label' => Tools::getValue('label'),
|
||||
'compress' => Tools::getValue('compress'),
|
||||
);
|
||||
|
||||
$action = $this->createZone(Tools::getValue('type'), $zone_info);
|
||||
|
||||
if (is_array($action))
|
||||
{
|
||||
Db::getInstance()->Execute('UPDATE `'._DB_PREFIX_.'cloudcache_zone` SET
|
||||
`name` = \''.pSQL($_POST['name']).'\',
|
||||
`origin` = \''.pSQL($_POST['origin']).'\',
|
||||
`compress` = \''.(isset($_POST['compress']) ? 1: 0).'\',
|
||||
`label` = \''.pSQL($_POST['label']).'\',
|
||||
`file_type` = \''.pSQL(CLOUDCACHE_FILE_TYPE_ALL).'\',
|
||||
`cdn_url` = \''.($_POST['vanity_domain'] ? pSQL($_POST['vanity_domain']) : pSQL($_POST['name'].'.'.Configuration::get('CLOUDCACHE_API_COMPANY_ID').'.'.CLOUDCACHE_API_ZONE_URL)).'\'
|
||||
WHERE `id_zone` = '.(int)$action['id']);
|
||||
|
||||
$this->context->smarty->assign('confirmMessage',
|
||||
$this->_displayConfirmation($this->l('Zone added.')));
|
||||
}
|
||||
else
|
||||
$this->context->smarty->assign('confirmMessage',
|
||||
$this->_displayConfirmation($this->l('Error adding the zone: ').' '.pSQL($action), 'error'));
|
||||
}
|
||||
elseif (Tools::isSubmit('SubmitCloudcacheSync'))
|
||||
{
|
||||
$action = $this->_syncZonesWithServer('all');
|
||||
if (is_array($action))
|
||||
$this->context->smarty->assign('confirmMessage',
|
||||
$this->_displayConfirmation($this->l('All zones were synced.')));
|
||||
else
|
||||
$this->context->smarty->assign('confirmMessage',
|
||||
$this->_displayConfirmation($this->l('Error syncing zones: ').' '.pSQL($action), 'error'));
|
||||
}
|
||||
elseif (Tools::isSubmit('SubmitCloudcacheClearAllCache'))
|
||||
{
|
||||
$error = false;
|
||||
foreach (Db::getInstance()->ExecuteS('SELECT `id_zone`, `zone_type`, `name` FROM `'._DB_PREFIX_.'cloudcache_zone` WHERE `id_shop` = '.(int)$this->context->shop->id.' AND `id_shop` = '.(int)$this->context->shop->id) as $zone)
|
||||
if (!$this->_api->cachePurgeAll('cache', $zone['id_zone']))
|
||||
{
|
||||
$error = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if (!$error)
|
||||
$this->context->smarty->assign('confirmMessage',
|
||||
$this->_displayConfirmation($this->l('The cache was purged for all zones.')));
|
||||
else
|
||||
$this->context->smarty->assign('confirmMessage',
|
||||
$this->_displayConfirmation($this->l('Error purging cache for all zones.'), 'error'));
|
||||
}
|
||||
elseif (Tools::isSubmit('SubmitCloudcacheClearZoneCache'))
|
||||
{
|
||||
$zoneName = Db::getInstance()->ExecuteS('SELECT `name` FROM '._DB_PREFIX_.'cloudcache_zone
|
||||
WHERE `id_zone` = '.(int)Tools::getValue('id_zone').' AND `id_shop` = '.(int)$this->context->shop->id);
|
||||
|
||||
if ($this->_api->cachePurgeAll('cache', Tools::getValue('id_zone')))
|
||||
$this->context->smarty->assign('confirmMessage',
|
||||
$this->_displayConfirmation($this->l('The cache was purged for zone:').' '.Tools::safeOutput($zoneName[0]['name'])));
|
||||
else
|
||||
$this->context->smarty->assign('confirmMessage',
|
||||
$this->_displayConfirmation($this->l('Error purging cache for zone:').' '.Tools::safeOutput($zoneName[0]['name']), 'error'));
|
||||
}
|
||||
elseif (Tools::isSubmit('SubmitCloudcacheEditZoneAction')) // display the form to edit the zone
|
||||
{
|
||||
// Get info for current zone
|
||||
$zone_info = Db::getInstance()->getRow('SELECT `id_zone`, `name`, `origin`, `compress`, `label`,
|
||||
`cdn_url`, `bw_yesterday`, `bw_last_week`, `bw_last_month`,
|
||||
`file_type`, `zone_type`
|
||||
FROM `'._DB_PREFIX_.'cloudcache_zone`
|
||||
WHERE `id_zone` = '.(int)Tools::getValue('id_zone').' AND `id_shop` = '.(int)$this->context->shop->id);
|
||||
|
||||
// Clean $zone_info before sending to smarty
|
||||
$zone_info_clean = array();
|
||||
foreach ($zone_info as $key => $z)
|
||||
$zone_info_clean[$key] = pSQL($z);
|
||||
|
||||
$this->context->smarty->assign('edit_zone_info', $zone_info_clean);
|
||||
}
|
||||
elseif (Tools::isSubmit('SubmitCloudcacheEdit_zone')) // save the changes on the edited zone
|
||||
{
|
||||
Db::getInstance()->Execute('UPDATE `'._DB_PREFIX_.'cloudcache_zone` SET
|
||||
`name` = \''.pSQL($_POST['name']).'\',
|
||||
`origin` = \''.pSQL($_POST['origin']).'\',
|
||||
`compress` = \''.(isset($_POST['compress']) ? 1: 0).'\',
|
||||
`label` = \''.pSQL($_POST['label']).'\',
|
||||
`cdn_url` = \''.pSQL($_POST['vanity_domain']).'\',
|
||||
`file_type` = \''.pSQL($_POST['file_type']).'\'
|
||||
WHERE `id_zone` = '.(int)Tools::getValue('id_zone'));
|
||||
|
||||
$zone_info = array('id_zone' => (int)Tools::getValue('id_zone'),
|
||||
'name' => Tools::getValue('name'),
|
||||
'origin' => Tools::getValue('origin'),
|
||||
'vanity_domain' => Tools::getValue('vanity_domain'),
|
||||
'label' => Tools::getValue('label'),
|
||||
'compress' => (bool)Tools::getValue('compress'),
|
||||
'file_type' => Tools::getValue('file_type'));
|
||||
|
||||
if (!$this->updateZone(Tools::getValue('type'), $zone_info)) // 0 : good | 1 : bad
|
||||
$this->context->smarty->assign('confirmMessage',
|
||||
$this->_displayConfirmation($this->l('The following zone was updated:').' '.pSQL(Tools::getValue('name'))));
|
||||
else
|
||||
$this->context->smarty->assign('confirmMessage',
|
||||
$this->_displayConfirmation($this->l('Error updating zone:').' '.pSQL(Tools::getValue('name')), 'error'));
|
||||
}
|
||||
|
||||
$confValues = Configuration::getMultiple(array(
|
||||
'CLOUDCACHE_API_USER',
|
||||
'CLOUDCACHE_API_KEY',
|
||||
'CLOUDCACHE_API_COMPANY_ID'));
|
||||
|
||||
// Set the smarty env
|
||||
$this->context->smarty->assign('serverRequestUri',
|
||||
Tools::safeOutput($_SERVER['REQUEST_URI']));
|
||||
$this->context->smarty->assign('displayName',
|
||||
Tools::safeOutput($this->displayName));
|
||||
|
||||
if (isset($connectionTestResult))
|
||||
$this->context->smarty->assign('connectionTestResult',
|
||||
$connectionTestResult);
|
||||
|
||||
if (isset($confValues['CLOUDCACHE_API_COMPANY_ID']))
|
||||
$this->context->smarty->assign('companyId',
|
||||
Tools::safeOutput($confValues['CLOUDCACHE_API_COMPANY_ID']));
|
||||
if (isset($confValues['CLOUDCACHE_API_USER']))
|
||||
$this->context->smarty->assign('apiUser',
|
||||
Tools::safeOutput($confValues['CLOUDCACHE_API_USER']));
|
||||
|
||||
$this->context->smarty->assign('apiKey',
|
||||
Tools::safeOutput($this->_cipherTool->decrypt($confValues['CLOUDCACHE_API_KEY'])));
|
||||
|
||||
$messages = $this->_compatibilityCheck();
|
||||
|
||||
if (count($messages))
|
||||
$this->context->smarty->assign('compatibilityIssues', $messages);
|
||||
|
||||
$this->context->smarty->assign('allAvailableZones', $this->_api->getAvailableNamespaces(true));
|
||||
$this->context->smarty->assign('prepaidBandwith', $this->getPrepaidBandwidth());
|
||||
|
||||
// Get the zones
|
||||
//$zones = array('zone2' => array('name' => '','type' => 'css'));
|
||||
|
||||
$zones = array();
|
||||
if (Configuration::get('CLOUDCACHE_API_USER'))
|
||||
$zones = $this->getZones('pullzone');
|
||||
|
||||
// display the form
|
||||
$this->context->smarty->assign('apiActive', Configuration::get('CLOUDCACHE_API_ACTIVE'));
|
||||
$this->context->smarty->assign('zones', $zones);
|
||||
|
||||
$this->context->smarty->assign('couponUrl', $this->_getCouponUrl());
|
||||
$this->context->smarty->assign('defaultOriginServerURL', (Configuration::get('PS_SSL_ENABLED') ? 'https://' : 'http://').Configuration::get('PS_SHOP_DOMAIN'));
|
||||
if (isset($_GET['id_tab']))
|
||||
$this->context->smarty->assign('cloudcache_id_tab', (int)$_GET['id_tab']);
|
||||
$this->context->smarty->assign('cloudcache_tracking', 'http://www.prestashop.com/modules/'.$this->name.'.png?url_site='.Tools::safeOutput($_SERVER['SERVER_NAME']).'&id_lang='.$this->context->cookie->id_lang);
|
||||
return $this->display(__FILE__, 'views/content2.tpl');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Test the conenction to Cloudcache and the credentials.
|
||||
*
|
||||
* In order to test that, we just try to get the pullzones amd we check if
|
||||
* the server reply the errorCode 0. If can't connect or other errorCode, then
|
||||
* there is something wrong.
|
||||
*
|
||||
* @return True if the connection is OK, false otherwise
|
||||
*/
|
||||
private function _testConnection()
|
||||
{
|
||||
set_time_limit(0);
|
||||
|
||||
if (count($this->_compatibilityCheck()))
|
||||
return array('<img src="../img/admin/forbbiden.gif" alt="" /><b style="color: #CC0000;">'.
|
||||
$this->l('You have compatibility issues, please fix them before using the module.').'</b>',
|
||||
'#FFD8D8');
|
||||
|
||||
$zones = $this->_api->listZones('pullzone');
|
||||
|
||||
if ($this->_api->getLastFaultCode())
|
||||
{
|
||||
$ret = array('<img src="../img/admin/forbbiden.gif" alt="" />
|
||||
<b style="color: #CC0000;">'.$this->l('Connection Test Failed.').'</b>',
|
||||
'#FFD8D8', false);
|
||||
Configuration::updateValue('CLOUDCACHE_API_ACTIVE', 0);
|
||||
return $ret;
|
||||
}
|
||||
|
||||
$defaultName = pSQL($this->l('prestashop'));
|
||||
// Check if default zone exists
|
||||
for ($i = 0; $i < count($zones); $i++)
|
||||
if ($zones[$i]['name'] == $defaultName)
|
||||
{
|
||||
$defaultName .= rand(1, 999);
|
||||
$i = 0;
|
||||
}
|
||||
|
||||
$newZone = false;
|
||||
|
||||
// If there is no zones, then create the default one
|
||||
if (!count($zones) || !Configuration::get('CLOUDCACHE_API_COMPANY_ID'))
|
||||
{
|
||||
$origin = pSQL((Configuration::get('PS_SSL_ENABLED') ? 'https://' : 'http://').Configuration::get('PS_SHOP_DOMAIN'));
|
||||
$r = $this->createZone('pullzone', array(
|
||||
'name' => $defaultName,
|
||||
'origin' => $origin,
|
||||
'compress' => 1,
|
||||
));
|
||||
|
||||
if (is_array($r))
|
||||
{
|
||||
Db::getInstance()->Execute('UPDATE `'._DB_PREFIX_.'cloudcache_zone` SET `name` = \''.pSQL($defaultName).'\', `origin` = \''.$origin.'\', `compress` = \'1\', `file_type` = \''.pSQL(CLOUDCACHE_FILE_TYPE_ALL).'\', `cdn_url` = \''.pSQL($r['cdn_url']).'\' WHERE `id_zone` = '.(int)$r['id']);
|
||||
|
||||
$tmp = substr($r['cdn_url'], strlen($defaultName) + 1);
|
||||
$companyId = substr($tmp, 0, strlen('netdna-cdn.com') * -1 - 1);
|
||||
Configuration::updateValue('CLOUDCACHE_API_COMPANY_ID', pSQL($companyId));
|
||||
}
|
||||
else // If failure, the zonename have probably been taken
|
||||
{
|
||||
$defaultName .= rand(1, 999);
|
||||
$r = $this->createZone('pullzone', array(
|
||||
'name' => $defaultName,
|
||||
'origin' => $origin,
|
||||
'compress' => 1,
|
||||
));
|
||||
if (is_array($r))
|
||||
{
|
||||
Db::getInstance()->Execute('UPDATE `'._DB_PREFIX_.'cloudcache_zone` SET `name` = \''.pSQL($defaultName).'\', `origin` = \''.$origin.'\', `compress` = \'1\', `file_type` = \''.pSQL(CLOUDCACHE_FILE_TYPE_ALL).'\', `cdn_url` = \''.pSQL($r['cdn_url']).'\' WHERE `id_zone` = '.(int)$r['id']);
|
||||
$tmp = substr($r['cdn_url'], strlen($defaultName) + 1);
|
||||
$companyId = substr($tmp, 0, strlen('netdna-cdn.com') * -1 - 1);
|
||||
Configuration::updateValue('CLOUDCACHE_API_COMPANY_ID', pSQL($companyId));
|
||||
}
|
||||
else
|
||||
return array('<img src="../img/admin/error.png" /><b style="color: red;">'.$this->l('An error occured, impossible to create a default zone.').'</b>', '#FFD8D8', true);
|
||||
}
|
||||
$newZone = $tmp;
|
||||
}
|
||||
|
||||
Configuration::updateValue('CLOUDCACHE_API_ACTIVE', 1);
|
||||
$ret = array('<img src="../img/admin/ok.gif" alt="" />
|
||||
<b style="color: green;">'.$this->l('Register').' '.
|
||||
Configuration::get('PS_SHOP_DOMAIN').' '.
|
||||
$this->l('on Cloudcache').'<br /></b>
|
||||
<img src="http://www.prestashop.com/modules/'.$this->name.'.png?api_user='.urlencode(Configuration::get('CLOUDCACHE_API_COMPANY_ID')).
|
||||
'" style="display: none;" />
|
||||
', '#D6F5D6', true);
|
||||
if ($newZone)
|
||||
$ret['newZone'] = $origin;
|
||||
return $ret;
|
||||
}
|
||||
|
||||
/*
|
||||
** Display a custom message for settings update
|
||||
** $text string Text to be displayed in the message
|
||||
** $type string (confirm|warn|error) Decides what color will the
|
||||
** message have (green|yellow)
|
||||
*/
|
||||
private function _displayConfirmation($text = '', $type = 'confirm')
|
||||
{
|
||||
switch ($type)
|
||||
{
|
||||
case 'confirm':
|
||||
$img = 'ok.gif';
|
||||
break ;
|
||||
case 'warn':
|
||||
$img = 'warn2.png';
|
||||
break ;
|
||||
case 'error':
|
||||
$img = 'disabled.gif';
|
||||
break ;
|
||||
default:
|
||||
die('Invalid type.');
|
||||
}
|
||||
|
||||
return array(
|
||||
'class' => Tools::safeOutput($type),
|
||||
'img' => Tools::safeOutput($img),
|
||||
'text' => (empty($text) ? $this->l('Settings updated') : $text)
|
||||
);
|
||||
}
|
||||
|
||||
/******************************************************************/
|
||||
/** Tools methods *************************************************/
|
||||
/******************************************************************/
|
||||
function getCurrentURL($htmlEntities = false)
|
||||
{
|
||||
$url = $_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];
|
||||
return (!empty($_SERVER['HTTPS']) ? 'https' : 'http').
|
||||
'://'.($htmlEntities ? preg_replace('/&/', '&', $url): $url);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Retrieve the bandwith from the selected zone and date range.
|
||||
*
|
||||
* @param zoneId Zone Id from which we want to retrieve data
|
||||
* @param range Range to retrieve (daily, weekly, monthly)
|
||||
*
|
||||
* @return Bandwith spent by the selecte zone between the wanted date range.
|
||||
*/
|
||||
private function _getZoneTransfer($zoneId, $range)
|
||||
{
|
||||
// Associate a range with real date
|
||||
$allowedRange = array(
|
||||
'daily' => date('Y-m-d',
|
||||
mktime(0, 0, 0, date('n'), date('j') - 1, date('Y'))),
|
||||
'weekly' => date('Y-m-d',
|
||||
mktime(0, 0, 0, date('n'), date('j') - 7, date('Y'))),
|
||||
'monthly' => date('Y-m-d',
|
||||
mktime(0, 0, 0, date('n') - 1, date('j'), date('Y'))),
|
||||
);
|
||||
// Retrieve today's date
|
||||
$today = date('Y-m-d');
|
||||
|
||||
// We check the range is correct
|
||||
if (!array_key_exists($range, $allowedRange))
|
||||
return -1;
|
||||
|
||||
|
||||
$companyId = Configuration::get('CLOUDCACHE_API_COMPANY_ID');
|
||||
|
||||
// Retrieve the data from the server
|
||||
$r = $this->_api->getTotalTransferStats('report', $companyId, $zoneId,
|
||||
$allowedRange[$range], $today);
|
||||
|
||||
// Check if the transaction went well
|
||||
if ($this->_api->getLastFaultCode())
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Retrieves Zones from Cloudcache Server and sync with local data
|
||||
*
|
||||
* @param type Namespace of the zones to retrieve (pullzone, pushzone, etc)
|
||||
*
|
||||
* @return Array describing the zones.
|
||||
*/
|
||||
private function _syncZonesWithServer($type)
|
||||
{
|
||||
// Send the request to the API server
|
||||
$cdnZones = array();
|
||||
if ($type == 'all')
|
||||
foreach ($this->_api->getAvailableNamespaces() as $namespace)
|
||||
$cdnZones[$namespace] = $this->_api->listZones($namespace);
|
||||
else
|
||||
$cdnZones[$type] = $this->_api->listZones($type);
|
||||
|
||||
|
||||
$zones = array();
|
||||
// Check if the transaction went well
|
||||
if (!$this->_api->getLastFaultCode())
|
||||
{
|
||||
// Build our custom array from the retieved data
|
||||
foreach ($cdnZones as $namespace => $cdnZone)
|
||||
{
|
||||
foreach ($cdnZone as $zone)
|
||||
{
|
||||
$exists = false;
|
||||
|
||||
$row = Db::getInstance()->getRow('SELECT `id_zone`, `id_shop`, `origin`, `cdn_url`, `file_type` FROM `'._DB_PREFIX_.'cloudcache_zone` WHERE `id_zone` = '.(int)$zone['id']);
|
||||
|
||||
if ($row['id_zone'])
|
||||
$exists = true;
|
||||
|
||||
if ($exists && $row['id_shop'] != $this->context->shop->id)
|
||||
continue ;
|
||||
|
||||
$zones[(int)$zone['id']] = array(
|
||||
'id_zone' => (int)$zone['id'],
|
||||
'name' => pSQL($zone['name']),
|
||||
'origin' => ($exists ? pSQL($row['origin']) : $this->l('no data')),
|
||||
'cdn_url' => ($exists ? pSQL($row['cdn_url']) : $this->l('no data')),
|
||||
'bw_yesterday' => (int)$this->_getZoneTransfer($zone['id'], 'daily'),
|
||||
'bw_last_week' => (int)$this->_getZoneTransfer($zone['id'], 'weekly'),
|
||||
'bw_last_month' => (int)$this->_getZoneTransfer($zone['id'], 'monthly'),
|
||||
'file_type' => ($exists ? pSQL($row['file_type']) : 'none'),
|
||||
'zone_type' => pSQL($namespace),
|
||||
'id_shop' => $this->context->shop->id,
|
||||
'id_group_shop' => $this->context->shop->id_group_shop,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// For each zone, update or insert the new data in the database
|
||||
foreach ($zones as $id_zone => $zone_data)
|
||||
if ($zone_data['zone_type'] != 'all')
|
||||
Db::getInstance()->Execute('REPLACE INTO `'._DB_PREFIX_.'cloudcache_zone`
|
||||
(`'.implode('`,`', array_keys($zone_data)).'`)
|
||||
VALUES (\''.implode('\', \'', $zone_data).'\')');
|
||||
|
||||
return $zones;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get Zones from the selected zone type.
|
||||
*
|
||||
* If the sync flag is setted to true, then retrieve data from Cloudcache servers.
|
||||
*
|
||||
* @note Function call thru ajax
|
||||
*
|
||||
* @param type Type of zone (Cloudcache namespace)
|
||||
* @param sync Flag to know if we should ask the Cloudcache servers.
|
||||
*
|
||||
* @return Array describing the zones
|
||||
*/
|
||||
public function getZones($type, $sync = false)
|
||||
{
|
||||
// Check that the $type is correct an harmless for the database
|
||||
if (!in_array($type, $this->_api->getAvailableNamespaces()))
|
||||
return $this->context->smarty->assign('confirmMessage',
|
||||
$this->_displayConfirmation($this->l('Invalid zone type.'), 'error'));
|
||||
|
||||
// Check on the database if $sync is false (cache)
|
||||
$zones = array();
|
||||
if (!$sync)
|
||||
{
|
||||
$d = Db::getInstance()->ExecuteS('
|
||||
SELECT `id_zone`, `id_shop`, `name`, `origin`, `compress`, `label`, `cdn_url`,
|
||||
`bw_yesterday`, `bw_last_week`, `bw_last_month`, `file_type`, `zone_type`
|
||||
FROM `'._DB_PREFIX_.'cloudcache_zone`
|
||||
WHERE `zone_type` = \''.pSQL($type).'\' AND `id_shop` = '.(int)$this->context->shop->id);
|
||||
foreach ($d as $line)
|
||||
$zones[$line['id_zone']] = $line;
|
||||
}
|
||||
|
||||
// if no result or if $sync, load data from API server
|
||||
if (($sync || !count($zones)) && Configuration::get('CLOUDCACHE_API_ACTIVE'))
|
||||
$zones = $this->_syncZonesWithServer($type);
|
||||
|
||||
// Return the data array
|
||||
return $zones;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Create a Zone on the Cloudcache Server.
|
||||
*
|
||||
* First create the zone thru the API then call the sync function in order to
|
||||
* update the local data.
|
||||
*
|
||||
* @param type Type of the zone (pullzone, pushzone, etc)
|
||||
* @param values Array describing the zone.
|
||||
*
|
||||
* @return True if everything went well, False otherwise
|
||||
*/
|
||||
public function createZone($type, $values)
|
||||
{
|
||||
// Check that the $type is correct an harmless for the database
|
||||
if (!in_array($type, $this->_api->getAvailableNamespaces()))
|
||||
return $this->context->smarty->assign('confirmMessage',
|
||||
$this->_displayConfirmation($this->l('Invalid zone type.'), 'error'));
|
||||
|
||||
// Create the basic zone data
|
||||
$zone = array(
|
||||
'name' => pSQL($values['name']),
|
||||
'origin' => pSQL($values['origin']),
|
||||
);
|
||||
|
||||
// If an optional field is set, add it to the zone
|
||||
$optionalFields = array('vanity_domain', 'vhost',
|
||||
'ip', 'compress', 'label');
|
||||
foreach ($optionalFields as $field)
|
||||
if (isset($values[$field]) && !empty($values[$field]))
|
||||
$zone[$field] = pSQL($values[$field]);
|
||||
|
||||
// Then send the request to the server
|
||||
// The server return an array with the new id, vanity_ip and cdn_url
|
||||
$r = $this->_api->createZone($type, $zone);
|
||||
|
||||
// Check if the transaction went well and return result
|
||||
if ($this->_api->getLastFaultCode())
|
||||
return $this->_api->getLastFaultString();
|
||||
|
||||
/* // Insert the new zone in database */
|
||||
/* if ($this->_updateZoneSql($r, 'CRE)) */
|
||||
/* return $this->context->smarty->assign('confirmMessage', */
|
||||
/* $this->_displayConfirmation($this->l('Unknown internal error.'), 'error')); */
|
||||
|
||||
// Sync
|
||||
$this->_syncZonesWithServer($type);
|
||||
|
||||
return $r;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Update the selected zone.
|
||||
*
|
||||
* @param type Type of the zone (namespace)
|
||||
* @param values Values of the updated zone
|
||||
*
|
||||
* @return True if OK, false otherwise.
|
||||
*/
|
||||
public function updateZone($type, $values)
|
||||
{
|
||||
// Check that the $type is correct an harmless for the database
|
||||
if (!in_array($type, $this->_api->getAvailableNamespaces()))
|
||||
return $this->context->smarty->assign('confirmMessage',
|
||||
$this->_displayConfirmation($this->l('Invalid zone type.'), 'error'));
|
||||
|
||||
// Create the basic zone data
|
||||
$zone = array(
|
||||
'id' => (int)$values['id_zone'],
|
||||
);
|
||||
|
||||
$optionalFields = array('name', 'origin', 'vhost', 'ip', 'compress', 'label');
|
||||
foreach ($optionalFields as $field)
|
||||
if (isset($values[$field]) && !empty($values[$field]))
|
||||
$zone[$field] = pSQL($values[$field]);
|
||||
|
||||
// The updateZone return a bool success/error
|
||||
$r = $this->_api->updateZone($type, (int)$values['id_zone'], $zone);
|
||||
|
||||
// Check if the transaction went well
|
||||
if ($this->_api->getLastFaultCode())
|
||||
return ; //die('KO '.pSQL($this->_api->getLastFaultString())); // pSQL for XSS
|
||||
|
||||
return $r;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Retrieve the paid Bandwith left
|
||||
*
|
||||
* @return The bandwith left.
|
||||
*/
|
||||
public function getPrepaidBandwidth()
|
||||
{
|
||||
// The namespace need to retrieve the bandwith is 'account'
|
||||
// The server reply the amount of bandwith left
|
||||
$r = $this->_api->getBandwidth('account');
|
||||
|
||||
// Check if the transaction went well
|
||||
if ($this->_api->getLastFaultCode())
|
||||
return $this->l('N/A');
|
||||
|
||||
// $r /= (1024 * 1024 * 1024 * 1024);
|
||||
$r /= (1000 * 1000 * 1000 * 1000);
|
||||
return round($r, 2);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
Before Width: | Height: | Size: 9.6 KiB |
|
Before Width: | Height: | Size: 26 KiB |
@@ -1,12 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<module>
|
||||
<name>cloudcache</name>
|
||||
<displayName><![CDATA[CloudCache]]></displayName>
|
||||
<version><![CDATA[1.2]]></version>
|
||||
<description><![CDATA[Supercharge your Shop with the CloudCache.com Content Delivery Network (CDN).]]></description>
|
||||
<author><![CDATA[PrestaShop]]></author>
|
||||
<tab><![CDATA[administration]]></tab>
|
||||
<is_configurable>1</is_configurable>
|
||||
<need_instance>1</need_instance>
|
||||
<limited_countries></limited_countries>
|
||||
</module>
|
||||
|
Before Width: | Height: | Size: 19 KiB |
@@ -1,108 +0,0 @@
|
||||
<?php
|
||||
|
||||
global $_MODULE;
|
||||
$_MODULE = array();
|
||||
$_MODULE['<{cloudcache}prestashop>cloudcache_f86d8910fee395bdb3d9e0165763235d'] = 'CloudCache';
|
||||
$_MODULE['<{cloudcache}prestashop>cloudcache_04a5752fc2ed63bac60e8e819fb37a8a'] = 'Acelera tu tienda con la red de distribución de contenido de CloudCache.com';
|
||||
$_MODULE['<{cloudcache}prestashop>cloudcache_3d31c37e7b674b0882fd6eb636b9f883'] = 'El módulo se ha instalado correctamente (';
|
||||
$_MODULE['<{cloudcache}prestashop>cloudcache_e2d5a00791bce9a01f99bc6fd613a39d'] = 'configurar';
|
||||
$_MODULE['<{cloudcache}prestashop>cloudcache_7171d1fc720355ddfb40537f566d8775'] = ') pero el siguiente archivo ya existe. Por favor, combine los archivos manualmente.';
|
||||
$_MODULE['<{cloudcache}prestashop>cloudcache_21d079ded53ed9bc6e6fef18a7deff87'] = 'Para poder usar Cloudcache correctamente, por favor corrija los siguientes errores:';
|
||||
$_MODULE['<{cloudcache}prestashop>cloudcache_c3c06280e8f7a758b5b3ba55bc31aa54'] = 'Asegúrese de marcar \"Mantener CSS como el original\"';
|
||||
$_MODULE['<{cloudcache}prestashop>cloudcache_610c04b1a22a45228804fbe850e5035c'] = 'Asegúrese de marcar \"Mantener JavaScript como el original\"';
|
||||
$_MODULE['<{cloudcache}prestashop>cloudcache_adf0bfd77f102fb4b793f62efdb52ad8'] = 'Asegúrese de marcar \"Mantener HTML como el original\"';
|
||||
$_MODULE['<{cloudcache}prestashop>cloudcache_936aea1c0611cae3cd3c8b6299d22c28'] = 'Asegúrese de marcar \"Mantener JavaScript en HTML como el original\"';
|
||||
$_MODULE['<{cloudcache}prestashop>cloudcache_3da4c8edd49a7c69fcd74b31955ec538'] = 'Asegúrese de marcar \"Mantener validación W3C como el original\"';
|
||||
$_MODULE['<{cloudcache}prestashop>cloudcache_f0c746da3e0a8585f9431752a47f4471'] = 'Usted debe pedir a su proveedor de hosting que active la extensión CURL de PHP (php.ini) para que el módulo Cloudcache pueda funcionar correctamente.';
|
||||
$_MODULE['<{cloudcache}prestashop>cloudcache_108118f45620e45322c3d5862591c418'] = 'Zona añadida.';
|
||||
$_MODULE['<{cloudcache}prestashop>cloudcache_a63636b538337a40fcdd3363c6707f15'] = 'Error añadiendo zona.';
|
||||
$_MODULE['<{cloudcache}prestashop>cloudcache_58f9c3960361509cf1d68bf643941ca1'] = 'Todas las zonas fueron sincronizadas.';
|
||||
$_MODULE['<{cloudcache}prestashop>cloudcache_c72fd9c59ceba8b6724e2fd47823a371'] = 'Error sincronizando las zonas.';
|
||||
$_MODULE['<{cloudcache}prestashop>cloudcache_3d015f6519d6a4266d58735cbb0646aa'] = 'Se limpió el cache para todas las zonas.';
|
||||
$_MODULE['<{cloudcache}prestashop>cloudcache_927a80bfb795058dd0d56b910ce75182'] = 'Error limpiando el cache para todas las zonas.';
|
||||
$_MODULE['<{cloudcache}prestashop>cloudcache_0784546200bf0e0b692ce92fca030051'] = 'Se limpió el cache de la zona: ';
|
||||
$_MODULE['<{cloudcache}prestashop>cloudcache_677b9ce0ce1753890cfeb9d88b8b6a2d'] = 'Error limpiando el cache de la zona: ';
|
||||
$_MODULE['<{cloudcache}prestashop>cloudcache_5ea453e070eec6c0d81206b66e7b47bb'] = 'La siguiente zona fue actualizada:';
|
||||
$_MODULE['<{cloudcache}prestashop>cloudcache_7e185a7cd33a7ec22abaff3f1faa8d28'] = 'Error actualizando la zona: ';
|
||||
$_MODULE['<{cloudcache}prestashop>cloudcache_d5a735d3395d8928332af64d25479273'] = 'Se han encontrado problemas de compatibilidad, por favor corrija los errores antes de usar el modulo.';
|
||||
$_MODULE['<{cloudcache}prestashop>cloudcache_63a77eaf9f310dc5def6709c2887dcc4'] = 'Conexión de prueba fallida.';
|
||||
$_MODULE['<{cloudcache}prestashop>cloudcache_4dee17e319890f92a2595a308752a1c3'] = 'prestashop';
|
||||
$_MODULE['<{cloudcache}prestashop>cloudcache_2631b272000ffdc568ad04d7982d1f7c'] = 'Ha ocurrido un error. Imposible crear una zona predeterminada.';
|
||||
$_MODULE['<{cloudcache}prestashop>cloudcache_0ba7583639a274c434bbe6ef797115a4'] = 'Incribirse';
|
||||
$_MODULE['<{cloudcache}prestashop>cloudcache_43bff7159a5c1a845ce6bd00f90b692f'] = 'en Cloudcache';
|
||||
$_MODULE['<{cloudcache}prestashop>cloudcache_c888438d14855d7d96a2724ee9c306bd'] = 'Opciones actualizadas';
|
||||
$_MODULE['<{cloudcache}prestashop>cloudcache_42c4d8746ae597c8db2724998063b0f5'] = 'no hay datos';
|
||||
$_MODULE['<{cloudcache}prestashop>cloudcache_fd7695c3fa7df2aeb0957554d5007378'] = 'Tipo de zona inválida.';
|
||||
$_MODULE['<{cloudcache}prestashop>cloudcache_fb27ef14699bf81370e0c7384aa9e118'] = 'Error interno desconocido';
|
||||
$_MODULE['<{cloudcache}prestashop>cloudcache_382b0f5185773fa0f67a8ed8056c7759'] = 'N/A';
|
||||
$_MODULE['<{cloudcache}prestashop>backofficetop_3f3391f413c692b76b90034e19074ea4'] = 'Actualmente usted está teniendo mejor rendimiento';
|
||||
$_MODULE['<{cloudcache}prestashop>backofficetop_baccc7910ea31b5cf2fedc346eee0fe6'] = 'usando el módulo CloudCache';
|
||||
$_MODULE['<{cloudcache}prestashop>backofficetop_bdb079cd385ce7a5227f1d56d91200c0'] = 'el mejor servicio CDN recomendado por usuarios de PrestaShop!';
|
||||
$_MODULE['<{cloudcache}prestashop>backofficetop_69595fc8764ca77da1ca3cab85ba38b1'] = 'Tenga aun mejor rendimiento';
|
||||
$_MODULE['<{cloudcache}prestashop>backofficetop_938d6948b598780c6d713b7cd350e963'] = 'al activar el módulo CloudCache';
|
||||
$_MODULE['<{cloudcache}prestashop>backofficetop_fa65e0f3acb9c0b1d8243c3edeebe058'] = 'Todo luce bien para CloudCache';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_41902f7e9bb357cbada1d47b0c252f23'] = 'Abra su cuenta en CloudCache.com';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_d500acbdf6da11b99ba163036743bd67'] = 'CloudCache provee a los usuarios de PrestaShop un descuento exclusivo del 25% al mes en cada paquete disponible. Por favor, haga click en logo abajo para subscribirse:';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_38d9b91c515b7d3a97f2bf6e72cd24ec'] = 'Este módulo le permite acelerar su tienda PrestaShop a través de la red de distribución de contenido de CloudCache.';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_03894b6f1d0447b352ae5093b25beb3d'] = 'Una red de distribución de contenido (CDN) es para cada dueño de tiendas en línea que demanda de un alto rendimiento, y un servicio exclusivo al visitante.';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_0bcf4cd42f3d29472055668091d3ebc6'] = 'Chequeo de compatibilidad de CloudCache';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_d83cbcd4f991b9b43098437b58a7d1f3'] = 'Por qué CloudCache';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_6a26f548831e6a8c26bfbbd9f6ec61e0'] = 'Ayuda';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_f4f70727dc34561dfde1a3c529b6205c'] = 'Opciones';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_dad1f8d794ee0dd7753fe75e73b78f31'] = 'Zonas';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_52b730e469f179c52956110ff7d1920f'] = 'CloudCache está enfocado en entregar el contenido de la web con una eficiencia a la velocidad de la luz. Nosotros mantenemos una copia de los elementos \"pesados\" de su tienda PrestaShop, como imágenes, CSS y JavaScript en nuestros centros de datos alrededor del mundo y entregamos el contenido a sus visitantes desde la localización mas cercana. Estos son algunos de los numerosos beneficios de tener un sitio que carga mas rápido:';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_3ce64c688b949bec0dcec57bbdf2e48f'] = 'Crezca durante los picos de tráfico';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_be2501ec16464402d9069fabeae68cd0'] = 'En caso de que llegará a ser famoso durante la noche (es decir, su tienda se menciona en la televisión), sus ventas se dispararían, pero su servidor puede bloquearse debido a la sobrecarga, nosotros te ayudamos a equilibrar la sobrecarga de tráfico.';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_867681a0d2b527c81f35f397e26d96dc'] = 'Certificados SSL fáciles';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_aeebd43d3152b36de94e03808ad25957'] = 'Nuestra aceleración SSL disminuye la sobrecarga de energía de la CPU del servidor hasta un 70%. Además, hemos hecho que sea muy fácil y asequible para ejecutar SSL en la nube. Solo cobramos $ 24.95 por certificados SSL por Zona, por mes, incluyendo el certificado SSL.';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_2ea70b7571baf4de04631283af3a3a4b'] = 'Mayor puntuación SEO';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_6ad31549b6404d19697b28d718e2aa77'] = 'Google utiliza la velocidad de la página como un factor clave en su algoritmo de clasificación. Páginas que cargan rapido ganan posiciones más altas en los resultados de búsqueda, lo que significa más tráfico y más dinero para usted.';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_5b40a55b46342c709ef61fe48a11572f'] = 'Aumentar sus conversiones';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_8a8d5433fef3fe8b8940e32698d97e9d'] = 'Amazon halló que si su sitio se carga 100 milésimas de segundo más lento, pierden un 1% mas de sus ingresos. Creemos que esta sola razón es suficiente para preocuparse por el tiempo de carga de página.';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_412504f79aaab3a708c24f2b5f6af4b6'] = 'Cómo configurar CloudCache';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_2cb43a908b4bc11d16e651063a9c4027'] = 'Suscríbete a CloudCache haciendo clic en el logo a la derecha';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_f85e413f1f55286db4da358df3053062'] = 'Crear un usuario de la API y obtenga el ID de usuario y la clave de la API';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_13ad6491d90c3d8b08f072c13c34a797'] = 'ver vídeo tutorial';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_44641e218ebb6c07d0cb756a79673069'] = 'Cómo configurar el módulo:';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_784f83c332ae60b4d453cb63dc8c49b1'] = 'Llene el ID de usuario CloudCache y el campos de la clave de la API con los proporcionados por CloudCache.';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_2a5075cb5b1148436ee37a1ef46e51a6'] = 'Haga clic en \"Guardar configuración\" y luego \"Probar su conexión\".';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_59c8906c9f68c992003be17308173bd9'] = 'Si usted no tiene las zonas ya existentes, una zona predeterminada se creará.';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_fbd942973e8b17f065e587a2512a8f7f'] = 'Con el fin de aumentar el rendimiento, se puede ir a su cuenta CloudCache haciendo clic en el enlace de la derecha, vaya a la lista Pullzones, elija su zona, editar, ir a las Opciones avanzadas y desactive la opción de \"Query String\". Con el fin de guardar los cambios, haga clic en \"Actualizar\".';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_727283f37d3e70d3faceb71761d0fb51'] = 'Propósito del modulo:';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_0bae64ec079443c47750df1bdbf35871'] = 'Un Content Delivery Network (CDN) es para cada propietario de un sitio que exige un alto rendimiento, y proveer una experiencia excelente al visitante. ¿Por qué? Debido a que nuestro CDN acelera al máximo tus archivos descargables - imágenes, vídeo, scripts, css-con tiempos de carga super-rápido.';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_343618e9fcce53224cc7a47c2145c5e5'] = '¿Qué modificaciones hace el módulo de hacer en mi tienda?';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_082be8b13b40bfbf9c9cc70316bc1fec'] = 'Tools.php se sobrescribirá.';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_21ce50e4e30845efcb5005cdaa912bfd'] = '[Ficha Preferencias -> Rendimiento -> Servidores de Medios de Comunicación] mostrará un enlace a las configuraciones de módulos CloudCache y una notificación cuando el módulo está activo.';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_b480863a2096d2a5fca0cb3460b79c1e'] = 'Ha ocurrido un error mientras se prueba la conexión.';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_e72dafd095a9ec228dfd9c054f0530b0'] = 'Éxito! Eso es todo lo que tienes que hacer!';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_633d7bd9ecfcb1b67fa03b8a281aa8dd'] = 'ahora es acelerado por cloudcache.com';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_7e1678acc78078f22f6196a9737e3431'] = 'Éxito! La conexión se ha establecido!';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_bd93cd0fb528a1a2cb9cee3ecea69906'] = 'Haga clic aquí para acceder a su cuenta CloudCache';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_c949d7fe576e586e47a39b41752bd12c'] = 'El ancho de banda disponible es:';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_c6bce2a0c02ed4dc352779f8ecfdb3f5'] = 'ID de la compañia';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_e9db460a0154b96521063e4054997cdc'] = 'Usuario API';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_d876ff8da67c3731ae25d8335a4168b4'] = 'Clave API';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_9daf1fb753b42c3cdc8f1d01669cd6d8'] = 'Guardar configuración';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_79ddd6cfbf01f63986f7b114ecc2ca95'] = 'Haga clic aquí para Conexión de prueba';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_16bfbf9c462762cf1cba4134ec53c504'] = 'Cargando';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_382b0f5185773fa0f67a8ed8056c7759'] = 'N/A';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_7469a286259799e5b37e5db9296f00b3'] = 'SI';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_c2f3f489a00553e7a01d369c103c7251'] = 'NO';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_2e1911a1922b9c56488e7e3d37bf9cb5'] = 'Purgar caché';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_50100a6fa3a40543749d43b69210d473'] = 'Sincronizar las zonas!';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_1cd6038e51e247649e3046c3d963658d'] = 'Añadir zonas';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_3114114e2cdf0892739ee4ca557e8da5'] = 'Borrar todo el caché';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_93604834836f885a26ad3c780a490841'] = 'ID de la zona';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_fa018acf009f5435d50578357f449ed3'] = 'Nombre del Pull Zone';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_5e50936ee3316f28363a8de993cb07e8'] = 'URL del servidor de origen';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_ae9980aee84bd689e09532a927049f2c'] = 'Dominio CDN personalizado ';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_b021df6aac4654c454f46c77646e745f'] = 'Etiqueta';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_82af841589057aa8922b1ac3bb4a28a4'] = 'Compresión';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_e539fd665e202f536325140d87d7bf72'] = 'Tipo de Archivo';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_b1c94ca2fbc3e78fc30069c8d0f01680'] = 'Todo';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_9b001c69726efc0b7ef4876759a01874'] = 'Tipo de Zona';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_ea4788705e6873b424c65e91c2846b19'] = 'Cancelar';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_c9cc8cce247e49bae79f15173ce97354'] = 'Guardar';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_962a4c03ca790e4682304039c71e79d4'] = 'Crear Zona';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_96f583efefa0ce369ffeb5c3a7b3bd2a'] = 'Cloudcache y PrestaShop';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_fb66c688ec4cf810d1d60a11a67458c4'] = 'Aprenda mas acerca de Cloudcache en PrestaShop.com';
|
||||
@@ -1,108 +0,0 @@
|
||||
<?php
|
||||
|
||||
global $_MODULE;
|
||||
$_MODULE = array();
|
||||
$_MODULE['<{cloudcache}prestashop>cloudcache_f86d8910fee395bdb3d9e0165763235d'] = 'CloudCache';
|
||||
$_MODULE['<{cloudcache}prestashop>cloudcache_04a5752fc2ed63bac60e8e819fb37a8a'] = 'Accélérez votre boutique avec le Content Delivery Network (CDN) de CloudCache.com';
|
||||
$_MODULE['<{cloudcache}prestashop>cloudcache_3d31c37e7b674b0882fd6eb636b9f883'] = 'Le module a été correctement intallé (';
|
||||
$_MODULE['<{cloudcache}prestashop>cloudcache_e2d5a00791bce9a01f99bc6fd613a39d'] = 'configurer';
|
||||
$_MODULE['<{cloudcache}prestashop>cloudcache_7171d1fc720355ddfb40537f566d8775'] = ') mais le fichier suivant existe. Fusionnez le manuellement.';
|
||||
$_MODULE['<{cloudcache}prestashop>cloudcache_21d079ded53ed9bc6e6fef18a7deff87'] = 'Pour utiliser correctement CloudCache, réglez les problèmes suivant:';
|
||||
$_MODULE['<{cloudcache}prestashop>cloudcache_c3c06280e8f7a758b5b3ba55bc31aa54'] = 'Assurez vous que \'Gardez les CSS originaux\'';
|
||||
$_MODULE['<{cloudcache}prestashop>cloudcache_610c04b1a22a45228804fbe850e5035c'] = 'Assurez vous que \'Gardez les JavaScript originaux\'';
|
||||
$_MODULE['<{cloudcache}prestashop>cloudcache_adf0bfd77f102fb4b793f62efdb52ad8'] = 'Assurez vous que \'Gardez les HTML originaux\'';
|
||||
$_MODULE['<{cloudcache}prestashop>cloudcache_936aea1c0611cae3cd3c8b6299d22c28'] = 'Assurez vous que \"Gardez les Javascript dans les HTML originaux\"';
|
||||
$_MODULE['<{cloudcache}prestashop>cloudcache_3da4c8edd49a7c69fcd74b31955ec538'] = 'Assurez vous que \'Garder la validation W3C\' soit séléctionné';
|
||||
$_MODULE['<{cloudcache}prestashop>cloudcache_f0c746da3e0a8585f9431752a47f4471'] = 'Vous devez demander à votre hébergeur d\'activer l\'extension PHP CURL (dans php.ini) afin de pouvoir faire fonctionner le module CloudCache.';
|
||||
$_MODULE['<{cloudcache}prestashop>cloudcache_108118f45620e45322c3d5862591c418'] = 'Zone ajouté.';
|
||||
$_MODULE['<{cloudcache}prestashop>cloudcache_a63636b538337a40fcdd3363c6707f15'] = 'Erreur pendant l\'ajout de la zone:';
|
||||
$_MODULE['<{cloudcache}prestashop>cloudcache_58f9c3960361509cf1d68bf643941ca1'] = 'Toutes les zones ont été synchronisé';
|
||||
$_MODULE['<{cloudcache}prestashop>cloudcache_c72fd9c59ceba8b6724e2fd47823a371'] = 'Erreur pendant la synchronisation des zones:';
|
||||
$_MODULE['<{cloudcache}prestashop>cloudcache_3d015f6519d6a4266d58735cbb0646aa'] = 'Le cache a été purgé pour toutes les zones.';
|
||||
$_MODULE['<{cloudcache}prestashop>cloudcache_927a80bfb795058dd0d56b910ce75182'] = 'Erreur pendant la purge du cache pour toutes els zones.';
|
||||
$_MODULE['<{cloudcache}prestashop>cloudcache_0784546200bf0e0b692ce92fca030051'] = 'Le cache a été purgé pour la zone:';
|
||||
$_MODULE['<{cloudcache}prestashop>cloudcache_677b9ce0ce1753890cfeb9d88b8b6a2d'] = 'Erreur pendant la purge du cache pour la zone:';
|
||||
$_MODULE['<{cloudcache}prestashop>cloudcache_5ea453e070eec6c0d81206b66e7b47bb'] = 'Les zones suivantes ont été mise à jour:';
|
||||
$_MODULE['<{cloudcache}prestashop>cloudcache_7e185a7cd33a7ec22abaff3f1faa8d28'] = 'Erreur pendant la mise à jour de la zone:';
|
||||
$_MODULE['<{cloudcache}prestashop>cloudcache_d5a735d3395d8928332af64d25479273'] = 'Vous avez des erreurs de compatibilité, résolvez les avant d\'utiliser le module.';
|
||||
$_MODULE['<{cloudcache}prestashop>cloudcache_63a77eaf9f310dc5def6709c2887dcc4'] = 'Le test de connexion a échoué.';
|
||||
$_MODULE['<{cloudcache}prestashop>cloudcache_4dee17e319890f92a2595a308752a1c3'] = 'PrestaShop';
|
||||
$_MODULE['<{cloudcache}prestashop>cloudcache_2631b272000ffdc568ad04d7982d1f7c'] = 'Une erreur est survenue, impossible de créer la zone par défault.';
|
||||
$_MODULE['<{cloudcache}prestashop>cloudcache_0ba7583639a274c434bbe6ef797115a4'] = 'S\'inscrire';
|
||||
$_MODULE['<{cloudcache}prestashop>cloudcache_43bff7159a5c1a845ce6bd00f90b692f'] = 'sur CloudCache';
|
||||
$_MODULE['<{cloudcache}prestashop>cloudcache_c888438d14855d7d96a2724ee9c306bd'] = 'Paramètres mis à jour';
|
||||
$_MODULE['<{cloudcache}prestashop>cloudcache_42c4d8746ae597c8db2724998063b0f5'] = 'Aucune données';
|
||||
$_MODULE['<{cloudcache}prestashop>cloudcache_fd7695c3fa7df2aeb0957554d5007378'] = 'Type de zone invalide.';
|
||||
$_MODULE['<{cloudcache}prestashop>cloudcache_fb27ef14699bf81370e0c7384aa9e118'] = 'Erreur interne.';
|
||||
$_MODULE['<{cloudcache}prestashop>cloudcache_382b0f5185773fa0f67a8ed8056c7759'] = 'N/A';
|
||||
$_MODULE['<{cloudcache}prestashop>backofficetop_3f3391f413c692b76b90034e19074ea4'] = 'Vous économisez encore plus de performances en';
|
||||
$_MODULE['<{cloudcache}prestashop>backofficetop_baccc7910ea31b5cf2fedc346eee0fe6'] = 'utilisant le module CloudCache';
|
||||
$_MODULE['<{cloudcache}prestashop>backofficetop_bdb079cd385ce7a5227f1d56d91200c0'] = 'le meilleur server CDN recommandé par les utilisateurs de PrestaShop!';
|
||||
$_MODULE['<{cloudcache}prestashop>backofficetop_69595fc8764ca77da1ca3cab85ba38b1'] = 'Économisez encore plus de performances en';
|
||||
$_MODULE['<{cloudcache}prestashop>backofficetop_938d6948b598780c6d713b7cd350e963'] = 'activant le module CloudCache';
|
||||
$_MODULE['<{cloudcache}prestashop>backofficetop_fa65e0f3acb9c0b1d8243c3edeebe058'] = 'Tout les paramètres sont corrects pour CloudCache';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_41902f7e9bb357cbada1d47b0c252f23'] = 'Ouvrir un compte chez CloudCache.com';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_d500acbdf6da11b99ba163036743bd67'] = 'CloudCache fournis aux utilsiateurs de PrestaShop une réduction exclusive de 25% par mois sur tous les pack disponible. Cliquez sur le logo ci-dessous pour s\'inscrire:';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_38d9b91c515b7d3a97f2bf6e72cd24ec'] = 'Ce module permet d\'accélérer votre PrestaShop grâce au Content Delivery Network de CloudCache';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_03894b6f1d0447b352ae5093b25beb3d'] = 'Un Content Delivery Network (CDN) est pour un webmaster qui cherche de hautes performances et qui préviligie l\'expérience utilisateur.';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_0bcf4cd42f3d29472055668091d3ebc6'] = 'Vérification de compatiblité pour CloudCache';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_d83cbcd4f991b9b43098437b58a7d1f3'] = 'Pourquoi CloudCache';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_6a26f548831e6a8c26bfbbd9f6ec61e0'] = 'Aide';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_f4f70727dc34561dfde1a3c529b6205c'] = 'Paramètres';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_dad1f8d794ee0dd7753fe75e73b78f31'] = 'Zones';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_52b730e469f179c52956110ff7d1920f'] = 'CloudCache est centré sur l\'envoie de votre contenu à très haute vitesse. Nous convervons une copie de des éléments \'lourd\' de PrestaShop comme les images, CSS et les JavaScript dans nos datacenters répartie partout dans le monde et nous envoyons ces fichier à vos visiteurs depuis l\'endroit le plus proche de chez eux. Ci-dessous vous trouvez quelques avantage d\'avoir un site qui charge plus rapidement';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_3ce64c688b949bec0dcec57bbdf2e48f'] = 'Fonctionne très bien lors des période de fort traffic';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_be2501ec16464402d9069fabeae68cd0'] = 'Si vous devenez célébre dans la nuit (e.g. votre boutique aparrait à la télé), vos ventes vont augmenter mais votre server risque de tomber; nous vous aidons à gérer la balance de votre traffic.';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_867681a0d2b527c81f35f397e26d96dc'] = 'SSL personnel facilité';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_aeebd43d3152b36de94e03808ad25957'] = 'Notre accélération SSL alège la charge CPU de votre server de 70%. En plus, on a rendu très simple et bon marché la mise en place du SSL sur la \'cloud\'. Le coût est de 24.95$ par Zone personnalisée par mois incluant le certificat SSL.';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_2ea70b7571baf4de04631283af3a3a4b'] = 'Meilleur classement SEO';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_6ad31549b6404d19697b28d718e2aa77'] = 'Google utilise la vitesse de chargement des page comme facteur clef dans leur algorithme de classement. Les pages les plus rapide ont le meilleurs classement, ce qui signifie plus de traffic et donc plus de revenu pour vous.';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_5b40a55b46342c709ef61fe48a11572f'] = 'Augement le taux de conversions';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_8a8d5433fef3fe8b8940e32698d97e9d'] = 'Amazon a trouvé que si votre site charge 100 millisecondes plus lentement, vous perdez 1% de vos revenue. Nous penseons que pour cette simple raison, il est important de s\'inquiéter du temps de chargement des pages.';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_412504f79aaab3a708c24f2b5f6af4b6'] = 'Comment configurer CloudCache';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_2cb43a908b4bc11d16e651063a9c4027'] = 'S\'inscrire sur CloudCache en cliquant sur le logo à droite';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_f85e413f1f55286db4da358df3053062'] = 'Créer des identifiants récupérer le \'User Id\' et le \'API key\'';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_13ad6491d90c3d8b08f072c13c34a797'] = 'jouer la video tutoriel (en anglais)';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_44641e218ebb6c07d0cb756a79673069'] = 'Comment configurer le module:';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_784f83c332ae60b4d453cb63dc8c49b1'] = 'Remplir les champs \'User Id\' et \'Api keu\' avec les informations founis par CloudCache';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_2a5075cb5b1148436ee37a1ef46e51a6'] = 'Cliquer sur le bouton \'Sauvegarder les paramètres\' puis sur \'Tester la connexion\'';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_59c8906c9f68c992003be17308173bd9'] = 'Si vous n\'avez pas de zones, une zone par défaut sera créée';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_fbd942973e8b17f065e587a2512a8f7f'] = 'Pour améliorer les performances, vous pouvez aller sur votre compte CloudCache en cliquant sur le lien à droite, allez sur la liste des \'Pullzones\', choisissez votre zone, éditez la, allez à \'Advanced Settings\' et décochez l\'option \'Query String\'. Pour sauvegar, cliquez sur \'Update\'.';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_727283f37d3e70d3faceb71761d0fb51'] = 'But du module:';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_0bae64ec079443c47750df1bdbf35871'] = 'Un Content Delivery Network (CDN) est pour tout webmaster qui veut des hautes performances. Pourquoi? Parce que notre CDN hébérge vos fichiers téléchargeables (images, vidéos, scripts, css) avec des temps de chargement extrêmement rapide.';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_343618e9fcce53224cc7a47c2145c5e5'] = 'Quelles modifications le module apporte à mon magasin?';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_082be8b13b40bfbf9c9cc70316bc1fec'] = 'Le fichier Tools.php va être surchargé.';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_21ce50e4e30845efcb5005cdaa912bfd'] = '[Onglet Préférences -> Performance -> Servers de média] va afficher un lien vers la page de configuration du module CloudCache que celui ci est actif.';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_b480863a2096d2a5fca0cb3460b79c1e'] = 'Un erreur est survenue pendant le test de la connexion.';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_e72dafd095a9ec228dfd9c054f0530b0'] = 'Succès! C\'est out ce que vous aviez à faire!';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_633d7bd9ecfcb1b67fa03b8a281aa8dd'] = 'est maintenant accéléré par CloudCache.com';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_7e1678acc78078f22f6196a9737e3431'] = 'Succès! La connexion a été correctement établie!';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_bd93cd0fb528a1a2cb9cee3ecea69906'] = 'Cliquez ici pour accéder à votre compte CloudCache';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_c949d7fe576e586e47a39b41752bd12c'] = 'Votre bande passante disponnible est:';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_c6bce2a0c02ed4dc352779f8ecfdb3f5'] = 'Company ID';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_e9db460a0154b96521063e4054997cdc'] = 'API User';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_d876ff8da67c3731ae25d8335a4168b4'] = 'API Key';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_9daf1fb753b42c3cdc8f1d01669cd6d8'] = 'Sauvegarder les paramètres';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_79ddd6cfbf01f63986f7b114ecc2ca95'] = 'Cliquer ici pour tester la connexion';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_16bfbf9c462762cf1cba4134ec53c504'] = 'Chargement';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_382b0f5185773fa0f67a8ed8056c7759'] = 'N/A';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_7469a286259799e5b37e5db9296f00b3'] = 'OUI';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_c2f3f489a00553e7a01d369c103c7251'] = 'NON';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_2e1911a1922b9c56488e7e3d37bf9cb5'] = 'Purger le cache';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_50100a6fa3a40543749d43b69210d473'] = 'Synchroniser les Zones!';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_1cd6038e51e247649e3046c3d963658d'] = 'Ajouter des zones';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_3114114e2cdf0892739ee4ca557e8da5'] = 'Effacer tout le cache';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_93604834836f885a26ad3c780a490841'] = 'Zone ID';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_fa018acf009f5435d50578357f449ed3'] = 'Nom de la Pull Zone';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_5e50936ee3316f28363a8de993cb07e8'] = 'URL du server d\'origine';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_ae9980aee84bd689e09532a927049f2c'] = 'Domaine CDN personalisé';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_b021df6aac4654c454f46c77646e745f'] = 'Label';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_82af841589057aa8922b1ac3bb4a28a4'] = 'Compression';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_e539fd665e202f536325140d87d7bf72'] = 'Type de fichier';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_b1c94ca2fbc3e78fc30069c8d0f01680'] = 'Tous';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_9b001c69726efc0b7ef4876759a01874'] = 'Type de Zone';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_ea4788705e6873b424c65e91c2846b19'] = 'Annuler';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_c9cc8cce247e49bae79f15173ce97354'] = 'Sauvegarder';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_962a4c03ca790e4682304039c71e79d4'] = 'Créer la zone';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_96f583efefa0ce369ffeb5c3a7b3bd2a'] = 'CloudCache et PrestaShop';
|
||||
$_MODULE['<{cloudcache}prestashop>content2_fb66c688ec4cf810d1d60a11a67458c4'] = 'En savoir plus sur CloudCache sur PrestaShop.com';
|
||||
@@ -1,36 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2012 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Open Software License (OSL 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/osl-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-2012 PrestaShop SA
|
||||
* @version Release: $Revision: 14011 $
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 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;
|
||||
@@ -1,36 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2012 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Open Software License (OSL 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/osl-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-2012 PrestaShop SA
|
||||
* @version Release: $Revision: 14011 $
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 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;
|
||||
@@ -1,155 +0,0 @@
|
||||
/**
|
||||
* jQuery Easy Confirm Dialog plugin 1.2
|
||||
*
|
||||
* Copyright (c) 2010 Emil Janitzek (http://projectshadowlight.org)
|
||||
* Based on Confirm 1.3 by Nadia Alramli (http://nadiana.com/)
|
||||
*
|
||||
* Samples and instructions at:
|
||||
* http://projectshadowlight.org/jquery-easy-confirm-dialog/
|
||||
*
|
||||
* This script is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the Free
|
||||
* Software Foundation, either version 3 of the License, or (at your option)
|
||||
* any later version.
|
||||
*/
|
||||
(function($) {
|
||||
$.easyconfirm = {};
|
||||
$.easyconfirm.locales = {};
|
||||
$.easyconfirm.locales.enUS = {
|
||||
title: 'Are you sure?',
|
||||
text: 'Are you sure that you want to perform this action?',
|
||||
button: ['Cancel', 'Confirm'],
|
||||
closeText: 'close'
|
||||
};
|
||||
$.easyconfirm.locales.svSE = {
|
||||
title: 'Är du säker?',
|
||||
text: 'Är du säker på att du vill genomföra denna åtgärden?',
|
||||
button: ['Avbryt', 'Bekräfta'],
|
||||
closeText: 'stäng'
|
||||
};
|
||||
|
||||
$.fn.easyconfirm = function(options) {
|
||||
|
||||
var _attr = $.fn.attr;
|
||||
|
||||
$.fn.attr = function(attr, value) {
|
||||
// Let the original attr() do its work.
|
||||
var returned = _attr.apply(this, arguments);
|
||||
|
||||
// Fix for jQuery 1.6+
|
||||
if (attr == 'title' && returned === undefined)
|
||||
returned = '';
|
||||
|
||||
return returned;
|
||||
};
|
||||
|
||||
var options = jQuery.extend({
|
||||
eventType: 'click',
|
||||
icon: 'help'
|
||||
}, options);
|
||||
|
||||
var locale = jQuery.extend({}, $.easyconfirm.locales.enUS, options.locale);
|
||||
|
||||
// Shortcut to eventType.
|
||||
var type = options.eventType;
|
||||
|
||||
return this.each(function() {
|
||||
var target = this;
|
||||
var $target = jQuery(target);
|
||||
|
||||
// If no events present then and if there is a valid url, then trigger url change
|
||||
var urlClick = function() {
|
||||
if (target.href) {
|
||||
var length = String(target.href).length;
|
||||
if (target.href.substring(length - 1, length) != '#')
|
||||
document.location = target.href;
|
||||
}
|
||||
};
|
||||
|
||||
// If any handlers where bind before triggering, lets save them and add them later
|
||||
var saveHandlers = function() {
|
||||
var events = jQuery.data(target, 'events');
|
||||
if (events) {
|
||||
target._handlers = new Array();
|
||||
for (var i in events[type]) {
|
||||
target._handlers.push(events[type][i]);
|
||||
}
|
||||
|
||||
$target.unbind(type);
|
||||
}
|
||||
};
|
||||
// Re-bind old events
|
||||
var rebindHandlers = function() {
|
||||
if (target._handlers !== undefined) {
|
||||
jQuery.each(target._handlers, function() {
|
||||
$target.bind(type, this);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
if ($target.attr('title') !== null && $target.attr('title').length > 0)
|
||||
locale.text = $target.attr('title');
|
||||
|
||||
var dialog = (options.dialog === undefined || typeof(options.dialog) != 'object') ?
|
||||
$('<div class="dialog confirm">' + locale.text + '</div>') :
|
||||
options.dialog;
|
||||
|
||||
var buttons = {};
|
||||
buttons[locale.button[1]] = function() {
|
||||
// Unbind overriding handler and let default actions pass through
|
||||
$target.unbind(type, handler);
|
||||
|
||||
// Close dialog
|
||||
$(dialog).dialog("close");
|
||||
|
||||
// Check if there is any events on the target
|
||||
if (jQuery.data(target, 'events')) {
|
||||
// Trigger click event.
|
||||
$target.click();
|
||||
}
|
||||
else {
|
||||
// No event trigger new url
|
||||
urlClick();
|
||||
}
|
||||
|
||||
init();
|
||||
|
||||
};
|
||||
buttons[locale.button[0]] = function() {
|
||||
$(dialog).dialog("close");
|
||||
};
|
||||
|
||||
$(dialog).dialog({
|
||||
autoOpen: false,
|
||||
resizable: false,
|
||||
draggable: false,
|
||||
closeOnEscape: true,
|
||||
width: 'auto',
|
||||
minHeight: 220,
|
||||
maxHeight: 200,
|
||||
buttons: buttons,
|
||||
title: locale.title,
|
||||
closeText: locale.closeText,
|
||||
modal: true
|
||||
});
|
||||
|
||||
// Handler that will override all other actions
|
||||
var handler = function(event) {
|
||||
$(dialog).dialog('open');
|
||||
event.stopImmediatePropagation();
|
||||
event.preventDefault();
|
||||
return false;
|
||||
};
|
||||
|
||||
var init = function() {
|
||||
saveHandlers();
|
||||
$target.bind(type, handler);
|
||||
rebindHandlers();
|
||||
};
|
||||
|
||||
init();
|
||||
|
||||
});
|
||||
|
||||
};
|
||||
})(jQuery);
|
||||
@@ -1,388 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2012 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-2012 PrestaShop SA
|
||||
* @version Release: $Revision: 1.4 $
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
// Load the XML-RPC abstraction
|
||||
require(dirname(__FILE__).'/xmlrpc.inc.php');
|
||||
|
||||
// Defines for the report.gettotaltransfert Method rangeType values
|
||||
if (!defined('CLOUDCACHE_RANGE_TYPE_TODAY'))
|
||||
{
|
||||
define('CLOUDCACHE_RANGE_TYPE_TODAY', '1');
|
||||
define('CLOUDCACHE_RANGE_TYPE_HOUR', '2');
|
||||
define('CLOUDCACHE_RANGE_TYPE_DATE', '3');
|
||||
|
||||
define('CLOUDCACHE_FILE_TYPE_UNASSOCIATED', 'none');
|
||||
define('CLOUDCACHE_FILE_TYPE_ALL', 'all');
|
||||
define('CLOUDCACHE_FILE_TYPE_IMG', 'img');
|
||||
define('CLOUDCACHE_FILE_TYPE_JS', 'js');
|
||||
define('CLOUDCACHE_FILE_TYPE_CSS', 'css');
|
||||
define('CLOUDCACHE_FILE_TYPE_OTHER', 'other');
|
||||
}
|
||||
|
||||
class CloudcacheApi
|
||||
{
|
||||
private $apiKey;
|
||||
private $apiUserId;
|
||||
private $companyId;
|
||||
private $curDate;
|
||||
private $hashType;
|
||||
private $pullzoneType;
|
||||
private $availableNamespaces = array('pullzone' => 'Pull Zone');
|
||||
|
||||
private $lastRpcRequest;
|
||||
private $lastRpcResponse;
|
||||
|
||||
/** @var port Port of the cloudcache XML-RPC Api server */
|
||||
private $port;
|
||||
|
||||
/** @var httpMethod Http method to be used when using the XML-RPC API */
|
||||
private $httpMethod;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
// Declare which method is avaible for which namespace
|
||||
$tab = array(
|
||||
'user' => array('listUsers', 'update'),
|
||||
'account' => array('getBandwidth'),
|
||||
'report' => array(
|
||||
'getTotalTransfer',
|
||||
'getTotalHits',
|
||||
'getTotalTransferStats',
|
||||
'getCacheHitStats',
|
||||
'getPopularFiles',
|
||||
'getUsagePerDay',
|
||||
'getNodeHits',
|
||||
'getConnectionStats',
|
||||
'getHourlyConnectionStats',
|
||||
),
|
||||
'cache' => array('purge', 'purgeAllCache'),
|
||||
'pullzone' => array('listZones', 'create', 'update'),
|
||||
'pushzone' => array('listZones', 'create', 'update'),
|
||||
'vodzone' => array('listZones', 'create', 'update'),
|
||||
// 'livezone' => array('listZones', 'create', 'update', 'delete'), // Not yet implemented
|
||||
);
|
||||
|
||||
// Connection settings
|
||||
$this->port = CLOUDCACHE_API_PORT;
|
||||
$this->httpMethod = CLOUDCACHE_API_HTTP_METHOD;
|
||||
$this->apiURI = CLOUDCACHE_API_URI;
|
||||
$this->apiURL = CLOUDCACHE_API_URL;
|
||||
|
||||
// Api credentials
|
||||
if (Configuration::get('PS_CIPHER_ALGORITHM'))
|
||||
$this->_cipherTool = new Rijndael(_RIJNDAEL_KEY_, _RIJNDAEL_IV_);
|
||||
else
|
||||
$this->_cipherTool = new Blowfish(_COOKIE_KEY_, _COOKIE_IV_);
|
||||
|
||||
$this->apiKey = $this->_cipherTool->decrypt(Configuration::get('CLOUDCACHE_API_KEY'));
|
||||
$this->apiUserId = Configuration::get('CLOUDCACHE_API_USER');
|
||||
$this->companyId = Configuration::get('CLOUDCACHE_API_COMPANY_ID');
|
||||
|
||||
// Random stuff needed by the API
|
||||
// Save the current timezone
|
||||
$currentTimezone = date_default_timezone_get();
|
||||
// Set the timezone to the Cloudcache one
|
||||
date_default_timezone_set('America/Los_Angeles');
|
||||
// Retreive the RFC 8601 With Cloudcache timezone
|
||||
$this->curDate = date('c');
|
||||
// Put back user timezone
|
||||
date_default_timezone_set($currentTimezone);
|
||||
|
||||
$this->hashType = CLOUDCACHE_API_HASH_TYPE;
|
||||
$this->pullzoneType = CLOUDCACHE_API_PULL_ZONE_TYPE;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Create a new empty XML-RPC message ready for cloudcache API.
|
||||
*
|
||||
* @param namespace Namespace of the request
|
||||
* @param method Method used
|
||||
*
|
||||
* @return The new xmlrpcmsg Object instance.
|
||||
*/
|
||||
private function _getEmptyRpcMessage($namespace, $method)
|
||||
{
|
||||
// reset last command
|
||||
$this->lastRpcRequest = $this->lastRpcResponse = null;
|
||||
|
||||
return new xmlrpcmsg($namespace.'.'.$method, array(
|
||||
php_xmlrpc_encode($this->apiUserId),
|
||||
php_xmlrpc_encode(hash($this->hashType,
|
||||
$this->curDate.':'.$this->apiKey.':'.$method)),
|
||||
php_xmlrpc_encode($this->curDate),
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief List zones.
|
||||
*
|
||||
* @param namespace Namespace wanted (pullzone, pushzone, vodzone)
|
||||
*
|
||||
* @return List of the zones (replied by the cloudcache server)
|
||||
*/
|
||||
public function listZones($namespace)
|
||||
{
|
||||
$method = 'listZones';
|
||||
|
||||
// Initialize the XML-RPC message
|
||||
$rpcMsg = $this->_getEmptyRpcMessage($namespace, $method);
|
||||
|
||||
switch ($namespace)
|
||||
{
|
||||
case 'pullzone':
|
||||
// For the pullzone, we add a parameter type
|
||||
$rpcMsg->addParam(php_xmlrpc_encode($this->pullzoneType));
|
||||
break;
|
||||
case 'pushzone':
|
||||
case 'vodzone':
|
||||
case 'livezone':
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return $this->_sendRequest($namespace, $rpcMsg);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Create a zone.
|
||||
*
|
||||
* @param namespace Namespace wanted (pullzone, pushzone, vodzone)
|
||||
* @param values Array describing the zone to create.
|
||||
*
|
||||
* @return The anwser from the server.
|
||||
*/
|
||||
public function createZone($namespace, $values)
|
||||
{
|
||||
$method = 'create';
|
||||
|
||||
// $values['name'] = 'zonename';
|
||||
// $values['origin'] = 'zone origin url';
|
||||
// $values['vanity_domain'] = 'domain to use for the zone';
|
||||
|
||||
$rpcMsg = $this->_getEmptyRpcMessage($namespace, $method);
|
||||
$rpcMsg->addParam(php_xmlrpc_encode($values));
|
||||
|
||||
return $this->_sendRequest($namespace, $rpcMsg);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Update a zone
|
||||
*
|
||||
* @param namespace Namespace wanted (pullzone, pushzone, vodzone)
|
||||
* @param zoneId Id of the zone to update
|
||||
* @param values Array describing the new infos of the zone.
|
||||
*
|
||||
* @return Reply from the server.
|
||||
*/
|
||||
public function updateZone($namespace, $zoneId, $values)
|
||||
{
|
||||
$method = 'update';
|
||||
|
||||
$rpcMsg = $this->_getEmptyRpcMessage($namespace, $method);
|
||||
$rpcMsg->addParam(php_xmlrpc_encode($zoneId));
|
||||
$rpcMsg->addParam(php_xmlrpc_encode($values));
|
||||
|
||||
return $this->_sendRequest($namespace, $rpcMsg);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Retrieve the Bandwith of the wanted time area
|
||||
*
|
||||
* @param namespace Namespace wanted (should be 'account')
|
||||
* @param from From when to check
|
||||
* @param to Until when to check
|
||||
*
|
||||
* @return Bandwith used (Replied from the server)
|
||||
*/
|
||||
public function getBandwidth($namespace, $from = null, $to = null)
|
||||
{
|
||||
$method = 'getBandwidth';
|
||||
|
||||
$rpcMsg = $this->_getEmptyRpcMessage($namespace, $method);
|
||||
if ($from)
|
||||
$rpcMsg->addParam(php_xmlrpc_encode($from));
|
||||
if ($to)
|
||||
$rpcMsg->addParam(php_xmlrpc_encode($to));
|
||||
|
||||
return $this->_sendRequest($namespace, $rpcMsg);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Purge the cache of the given URL.
|
||||
*
|
||||
* @param namespace Namespace wanted (should be 'cache')
|
||||
* @param url Url to purge
|
||||
*
|
||||
* @return Reply from the server.
|
||||
*/
|
||||
public function cachePurge($namespace, $url)
|
||||
{
|
||||
$method = 'purge';
|
||||
|
||||
$rpcMsg = $this->_getEmptyRpcMessage($namespace, $method);
|
||||
$rpcMsg->addParam(php_xmlrpc_encode($url));
|
||||
|
||||
return $this->_sendRequest($namespace, $rpcMsg);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Purge all cache of the specified zone.
|
||||
*
|
||||
* @param namespace Namespace wanted (should be 'cache')
|
||||
* @param zoneId Zone to purge.
|
||||
*
|
||||
* @return Reply from the server.
|
||||
*/
|
||||
public function cachePurgeAll($namespace, $zoneId)
|
||||
{
|
||||
$method = 'purgeAllCache';
|
||||
|
||||
$rpcMsg = $this->_getEmptyRpcMessage($namespace, $method);
|
||||
$rpcMsg->addParam(php_xmlrpc_encode($zoneId));
|
||||
|
||||
return $this->_sendRequest($namespace, $rpcMsg);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Retrieve the data transfert from the given zone and dates
|
||||
*
|
||||
* @param namespace Namespace wanted (should be 'report')
|
||||
* @param zoneId Zone to check
|
||||
* @param rangeType Type of date range wanted (1: today, 2:cur day,
|
||||
* 3: date range)
|
||||
* @param from Date from where to retrieve the data (format Y-m-d)
|
||||
* @param to Date from where to retrieve the data (format Y-m-d)
|
||||
*
|
||||
* @return Reply from the server.
|
||||
*/
|
||||
public function getTotalTransfer($namespace, $zoneId, $rangeType,
|
||||
$from = null, $to = null)
|
||||
{
|
||||
$method = 'getTotalTransferStats';
|
||||
|
||||
|
||||
$rpcMsg = $this->_getEmptyRpcMessage($namespace, $method);
|
||||
$rpcMsg->addParam(php_xmlrpc_encode(Configuration::get('CLOUDCACHE_API_COMPANY_ID')));
|
||||
|
||||
$rpcMsg->addParam(php_xmlrpc_encode($zoneId));
|
||||
//$rpcMsg->addParam(php_xmlrpc_encode($rangeType));
|
||||
|
||||
if ($rangeType == CLOUDCACHE_RANGE_TYPE_DATE)
|
||||
{
|
||||
if ($from)
|
||||
$rpcMsg->addParam(php_xmlrpc_encode($from));
|
||||
if ($to)
|
||||
$rpcMsg->addParam(php_xmlrpc_encode($to));
|
||||
}
|
||||
return $this->_sendRequest($namespace, $rpcMsg);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Retrieve the data transfert from the given zone and dates
|
||||
*
|
||||
* @param namespace Namespace wanted (should be 'report')
|
||||
* @param companyId Company to check
|
||||
* @param zoneId Zone to check
|
||||
* @param from Date from where to retrieve the data (format Y-m-d)
|
||||
* @param to Date from where to retrieve the data (format Y-m-d)
|
||||
*
|
||||
* @return Reply from the server.
|
||||
*/
|
||||
public function getTotalTransferStats($namespace, $companyId, $zoneId,
|
||||
$from, $to)
|
||||
{
|
||||
$method = 'getTotalTransferStats';
|
||||
|
||||
$rpcMsg = $this->_getEmptyRpcMessage($namespace, $method);
|
||||
$rpcMsg->addParam(php_xmlrpc_encode($companyId));
|
||||
$rpcMsg->addParam(php_xmlrpc_encode($from));
|
||||
$rpcMsg->addParam(php_xmlrpc_encode($to));
|
||||
$rpcMsg->addParam(php_xmlrpc_encode($zoneId));
|
||||
|
||||
return $this->_sendRequest($namespace, $rpcMsg);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Actually send the request to the cloudcache API server.
|
||||
*
|
||||
* @param namespace Namespace of the request
|
||||
* @param rpcMsg XML-RPC message Object containing the actual request
|
||||
*
|
||||
* @return Reply from the server
|
||||
*/
|
||||
private function _sendRequest($namespace, $rpcMsg)
|
||||
{
|
||||
$this->lastRpcRequest = $rpcMsg;
|
||||
|
||||
// Initialize the XML-RPL client
|
||||
$rpcClient = new xmlrpc_client($this->apiURI.$namespace,
|
||||
$this->apiURL, $this->port, $this->httpMethod);
|
||||
|
||||
if (file_exists(dirname(__FILE__).'/proxy.inc.php'))
|
||||
{
|
||||
include(dirname(__FILE__).'/proxy.inc.php');
|
||||
$rpcClient->setProxy($proxy->host, $proxy->port,
|
||||
$proxy->username, $proxy->password);
|
||||
}
|
||||
|
||||
// Send the message
|
||||
$this->lastRpcResponse = $rpcClient->send($rpcMsg);
|
||||
|
||||
return !$this->getLastFaultCode() ? php_xmlrpc_decode($this->lastRpcResponse->value()) : false;
|
||||
}
|
||||
|
||||
public function getLastFaultCode()
|
||||
{
|
||||
if ($this->lastRpcResponse)
|
||||
return $this->lastRpcResponse->faultCode();
|
||||
return false;
|
||||
}
|
||||
|
||||
public function getLastFaultString()
|
||||
{
|
||||
if ($this->lastRpcResponse)
|
||||
return $this->lastRpcResponse->faultString();
|
||||
return false;
|
||||
}
|
||||
|
||||
public function getLastRpcResponse()
|
||||
{
|
||||
return $this->lastRpcResponse;
|
||||
}
|
||||
|
||||
public function getLastRpcRequest()
|
||||
{
|
||||
return $this->lastRpcRequest;
|
||||
}
|
||||
|
||||
public function getAvailableNamespaces($name = false)
|
||||
{
|
||||
return !$name ? array_keys($this->availableNamespaces) : $this->availableNamespaces;
|
||||
}
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2012 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Open Software License (OSL 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/osl-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-2012 PrestaShop SA
|
||||
* @version Release: $Revision: 14011 $
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 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;
|
||||
|
Before Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 845 B |
@@ -1,180 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2012 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Open Software License (OSL 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/osl-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-2012 PrestaShop SA
|
||||
* @version Release: $Revision: 12823 $
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
if (!class_exists('CloudCache') && file_exists(dirname(__FILE__).'/../../modules/cloudcache/cloudcache.php'))
|
||||
require(dirname(__FILE__).'/../../modules/cloudcache/cloudcache.php');
|
||||
|
||||
class Tools extends ToolsCore
|
||||
{
|
||||
/** @var _totalServerCount Total count of all servers */
|
||||
private static $_totalServerCount = 0;
|
||||
/** @var _servers Array containing all the media servers by type */
|
||||
private static $_servers = null;
|
||||
/** @var _serversCount Array countaining the count of servers by type */
|
||||
private static $_serversCount = null;
|
||||
/** @var _fileTypes Available file types */
|
||||
private static $_fileTypes = null;
|
||||
/** @var _activatedModule Flag weither or not the module is active */
|
||||
private static $_activatedModule = false;
|
||||
|
||||
public static $id_group_shop = 1;
|
||||
public static $id_shop = 1;
|
||||
|
||||
/**
|
||||
* @brief Init the statics needed by getMediaServer
|
||||
*/
|
||||
private static function _initServers()
|
||||
{
|
||||
require_once(dirname(__FILE__).'/../../modules/cloudcache/backward_compatibility/backward.php');
|
||||
|
||||
$context = Context::getContext();
|
||||
self::$id_shop = $context->shop->id;
|
||||
self::$id_group_shop = $context->shop->id_group_shop;
|
||||
|
||||
// Init the statics
|
||||
self::$_servers = array();
|
||||
self::$_serversCount = array();
|
||||
self::$_fileTypes = array(CLOUDCACHE_FILE_TYPE_IMG, CLOUDCACHE_FILE_TYPE_JS,
|
||||
CLOUDCACHE_FILE_TYPE_CSS, CLOUDCACHE_FILE_TYPE_OTHER,
|
||||
CLOUDCACHE_FILE_TYPE_ALL);
|
||||
|
||||
// check if the module is active
|
||||
self::$_activatedModule = Configuration::get('CLOUDCACHE_API_ACTIVE');
|
||||
|
||||
foreach (self::$_fileTypes as $type)
|
||||
{
|
||||
self::$_servers[$type] = array();
|
||||
self::$_serversCount[$type] = 0;
|
||||
}
|
||||
|
||||
$d = Db::getInstance()->executeS('SELECT `cdn_url`, `file_type`
|
||||
FROM `'._DB_PREFIX_.'cloudcache_zone`
|
||||
WHERE `file_type` != \''.CLOUDCACHE_FILE_TYPE_UNASSOCIATED.'\' AND `id_shop` = '.(int)self::$id_shop);
|
||||
|
||||
$allOnly = false;
|
||||
foreach ($d as $line)
|
||||
if ($line['file_type'] == CLOUDCACHE_FILE_TYPE_ALL)
|
||||
{
|
||||
self::$_servers[CLOUDCACHE_FILE_TYPE_ALL][] = pSQL($line['cdn_url']);
|
||||
self::$_serversCount[CLOUDCACHE_FILE_TYPE_ALL]++;
|
||||
self::$_totalServerCount++;
|
||||
$allOnly = true;
|
||||
}
|
||||
|
||||
foreach ($d as $line)
|
||||
if ($line['file_type'] && !$allOnly)
|
||||
{
|
||||
self::$_servers[$line['file_type']][] = $line['cdn_url'];
|
||||
self::$_serversCount[$line['file_type']]++;
|
||||
self::$_totalServerCount++;
|
||||
}
|
||||
}
|
||||
|
||||
public static function addJS($js_uri)
|
||||
{
|
||||
parent::addJS($js_uri);
|
||||
global $js_files;
|
||||
|
||||
foreach ($js_files as &$file)
|
||||
if (!preg_match('/^http(s?):\/\//i', $file))
|
||||
$file = 'http://'.self::getMediaServer($file).$file;
|
||||
}
|
||||
|
||||
public static function addCSS($css_uri, $css_media_type = 'all')
|
||||
{
|
||||
parent::addCSS($css_uri, $css_media_type);
|
||||
global $css_files;
|
||||
|
||||
$new = array();
|
||||
foreach ($css_files as $key => $file)
|
||||
{
|
||||
if (!preg_match('/^http(s?):\/\//i', $key))
|
||||
$key = 'http://'.self::getMediaServer($key).$key;
|
||||
$new[$key] = $file;
|
||||
}
|
||||
$css_files = $new;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Retrieve the media server to use
|
||||
*
|
||||
* @param filename Name of the file to serve (acually, part of the path)
|
||||
*
|
||||
* @todo Check performences
|
||||
*
|
||||
* @return URL of the server to use.
|
||||
*/
|
||||
public static function getMediaServer($filename)
|
||||
{
|
||||
// Override default behavior only if module is active
|
||||
if (!class_exists('CloudCache'))
|
||||
include(dirname(__FILE__).'/../../modules/cloudcache/cloudcache.php');
|
||||
|
||||
$module = new CloudCache();
|
||||
|
||||
if (!$module->active)
|
||||
return parent::getMediaServer($filename);
|
||||
|
||||
// Init the server list if needed
|
||||
if (!self::$_servers)
|
||||
self::_initServers();
|
||||
|
||||
if (!self::$_activatedModule)
|
||||
return parent::getMediaServer($filename);
|
||||
|
||||
// If there is a least one ALL server, then use one of them
|
||||
if (self::$_serversCount[CLOUDCACHE_FILE_TYPE_ALL])
|
||||
// Return one of those server
|
||||
return (self::$_servers[CLOUDCACHE_FILE_TYPE_ALL][(abs(crc32($filename)) %
|
||||
self::$_serversCount[CLOUDCACHE_FILE_TYPE_ALL])]);
|
||||
|
||||
|
||||
// If there is servers, then use them
|
||||
if (self::$_totalServerCount)
|
||||
{
|
||||
// Loop on the file types to find the current one
|
||||
foreach (self::$_fileTypes as $type)
|
||||
// If we find the type in the filename, then it is our
|
||||
if (strstr($filename, $type) && self::$_serversCount[$type])
|
||||
{
|
||||
// Return one of those server
|
||||
return (self::$_servers[$type][(abs(crc32($filename)) %
|
||||
self::$_serversCount[$type])]);
|
||||
}
|
||||
|
||||
// If no file type found, then it is 'other'
|
||||
// If there is server setted for the 'other' type, use it
|
||||
if (self::$_serversCount[CLOUDCACHE_FILE_TYPE_OTHER])
|
||||
// Return one of the server setted up
|
||||
return (self::$_servers[$type][(abs(crc32($filename)) %
|
||||
self::$_serversCount[$type])]);
|
||||
}
|
||||
|
||||
// If there is no server setted up, then use the parent method
|
||||
return parent::getMediaServer($filename);
|
||||
}
|
||||
}
|
||||
@@ -1,55 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2012 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-2012 PrestaShop SA
|
||||
* @version Release: $Revision: 1.4 $
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
class FrontController extends FrontControllerCore
|
||||
{
|
||||
public function addCSS($css_uri, $css_media_type = 'all')
|
||||
{
|
||||
if (!is_array($css_uri))
|
||||
$css_uri = array($css_uri);
|
||||
|
||||
$new_uri = array();
|
||||
foreach ($css_uri as $uri)
|
||||
if ($uri && !preg_match('/^http(s?):\/\//', $uri) && preg_match('#.css$#', $uri))
|
||||
$new_uri[] = 'http://'.Tools::getMediaServer($uri).$uri;
|
||||
else
|
||||
$new_uri[] = $uri;
|
||||
|
||||
return parent::addCSS($new_uri, $css_media_type);
|
||||
}
|
||||
|
||||
public function addJS($js_uri)
|
||||
{
|
||||
if (!is_array($js_uri))
|
||||
$js_uri = array($js_uri);
|
||||
|
||||
foreach ($js_uri as &$uri)
|
||||
if ($uri && !preg_match('/^http(s?):\/\//', $uri))
|
||||
$uri = 'http://'.Tools::getMediaServer($uri).$uri;
|
||||
return parent::addJS($js_uri);
|
||||
}
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2012 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Open Software License (OSL 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/osl-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-2012 PrestaShop SA
|
||||
* @version Release: $Revision: 14011 $
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 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;
|
||||
@@ -1,36 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2012 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Open Software License (OSL 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/osl-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-2012 PrestaShop SA
|
||||
* @version Release: $Revision: 14011 $
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 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;
|
||||
@@ -1,36 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2012 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Open Software License (OSL 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/osl-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-2012 PrestaShop SA
|
||||
* @version Release: $Revision: 14011 $
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 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;
|
||||
@@ -1,94 +0,0 @@
|
||||
$(function(){
|
||||
$('.tabbed-form.content li').not('#tab1_content').hide();
|
||||
$('.tabbed-form.menu li').click(function(){
|
||||
$('.tabbed-form.menu li').removeClass('active');
|
||||
$(this).addClass('active');
|
||||
$('.tabbed-form.content li').hide();
|
||||
$('.tabbed-form.content li:eq(' + $(this).index() + ')').show();
|
||||
});
|
||||
$('.tabbed-form.menu li:eq(0)').addClass('active');
|
||||
$('.tabbed-form.content li:eq(0)').show();
|
||||
|
||||
/* Make table first column bolded (on table with 2 cols) */
|
||||
$('.bold-first-column td:even').addClass('bold');
|
||||
|
||||
/* Make sure all .tree.closed have (+) inside, and the content is not shown */
|
||||
$('span.tree-button').live('click', function(){
|
||||
$(this).parent().find('.details').toggle("fast");
|
||||
$(this).toggleClass('opened');
|
||||
|
||||
if ($(this).hasClass('opened'))
|
||||
$(this).html('–');
|
||||
else
|
||||
$(this).html('+');
|
||||
});
|
||||
|
||||
/* jExcerpt v1.1.1 */
|
||||
length = 20;
|
||||
jExcerptClass = '.jexcerpt-short';
|
||||
$(jExcerptClass).each(function(){
|
||||
if ($(this).text().length > length)
|
||||
{
|
||||
// Create the .jexcerpt-long
|
||||
$('<div class="jexcerpt-long">' + $(this).text() + '</div>').appendTo($(this).parent());
|
||||
|
||||
excerpt = $(this).text().substring(0, length);
|
||||
$(this).text(excerpt + '...');
|
||||
}
|
||||
});
|
||||
|
||||
$(jExcerptClass).mouseover(function(){
|
||||
$('.jexcerpt-long').hide();
|
||||
$(this).parent().attr('width', $(this).parent().width());
|
||||
$(this).parent().find('.jexcerpt-long')
|
||||
.css('left', $(this).parent().offset().left + 4 + 'px')
|
||||
.css('top', $(this).parent().offset().top + 9 + 'px')
|
||||
.show();
|
||||
});
|
||||
|
||||
|
||||
$('.jexcerpt-long').live('mouseout', function(){
|
||||
$(this).parent().find(jExcerptClass).show();
|
||||
$(this).hide();
|
||||
});
|
||||
|
||||
/* Add span.tree for those .tree who have .details */
|
||||
$('<span class="tree-button">+</span>').prependTo($('.tree').has('.details'));
|
||||
|
||||
if ($('#cloudcache_edit_zone_form').size())
|
||||
window.scroll(0, $('#cloudcache_edit_zone_form').offset().top-100);
|
||||
|
||||
/* CRUD Zones*/
|
||||
$('#cloudcache_add_zone_form').hide();
|
||||
$('#cloudcache_add_zone').live('click', function(event){
|
||||
if ($('.tabbed-form.menu li.active').size())
|
||||
{
|
||||
indexActiveTab = $('.tabbed-form.menu li.active').index();
|
||||
$('#cloudcache_add_zone_form:eq(' + indexActiveTab + ') #type').attr('value', 'pullzone');
|
||||
$('#cloudcache_add_zone_form:eq(' + indexActiveTab + ')').toggle('fast');
|
||||
} else {
|
||||
$('#cloudcache_add_zone_form').toggle();
|
||||
}
|
||||
|
||||
event.preventDefault();
|
||||
});
|
||||
$('.SubmitCloudcacheEditZone').click(function(event){
|
||||
$('.CloudcacheZone_action').val('edit');
|
||||
$(this).parent().submit();
|
||||
});
|
||||
$('.SubmitCloudcacheClearZoneCache').click(function(event){
|
||||
$('.CloudcacheZone_action').val('clear_zone_cache');
|
||||
$(this).parent().submit();
|
||||
});
|
||||
|
||||
/* Validate the required fields */
|
||||
$('#SubmitCloudcacheAdd_zone').click(function(){
|
||||
if ($('#name').val().length < 1 || $('#origin').val().length < 1)
|
||||
{
|
||||
alert($('#requiredFieldsTranslation').text());
|
||||
return false;
|
||||
}
|
||||
else
|
||||
$(this).parent('form').submit();
|
||||
});
|
||||
});
|
||||
@@ -1,36 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2012 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Open Software License (OSL 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/osl-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-2012 PrestaShop SA
|
||||
* @version Release: $Revision: 14011 $
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 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;
|
||||
@@ -1,21 +0,0 @@
|
||||
<?php
|
||||
|
||||
$sql = array();
|
||||
|
||||
$sql[] = 'CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'cloudcache_zone` (
|
||||
`id_zone` int(10) unsigned NOT NULL,
|
||||
`id_shop` int(10) unsigned NOT NULL,
|
||||
`id_group_shop` int(10) unsigned NOT NULL,
|
||||
`name` varchar(255) NOT NULL,
|
||||
`origin` varchar(255) NULL,
|
||||
`compress` tinyint NULL,
|
||||
`label` varchar(255) NULL,
|
||||
`cdn_url` varchar(255) NOT NULL,
|
||||
`bw_yesterday` int(10) NOT NULL,
|
||||
`bw_last_week` int(10) NOT NULL,
|
||||
`bw_last_month` int(10) NOT NULL,
|
||||
`file_type` varchar(16) NOT NULL,
|
||||
`zone_type` varchar(16) NOT NULL,
|
||||
PRIMARY KEY (`id_zone`, `id_shop`),
|
||||
UNIQUE (`id_zone`, `name`, `cdn_url`))
|
||||
ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8;';
|
||||
@@ -1,5 +0,0 @@
|
||||
<?php
|
||||
|
||||
$sql = array();
|
||||
|
||||
$sql[] = 'DROP TABLE IF EXISTS `'._DB_PREFIX_.'cloudcache_zone`;';
|
||||
@@ -1,128 +0,0 @@
|
||||
fieldset.cloudcache_fieldset td.cloudcache_column { padding: 0 18px; text-align: right; vertical-align: top;}
|
||||
fieldset.cloudcache_fieldset input[type=text] { width: 250px; }
|
||||
fieldset.cloudcache_fieldset input.cloudcache_button { margin-top: 10px; }
|
||||
fieldset.cloudcache_fieldset div#test_connection { margin-left: 18px; border: 1px solid #DFD5C3; padding: 5px; font-size: 11px; margin-bottom: 10px; width: 90%; }
|
||||
fieldset.cloudcache_fieldset a { color: #0000CC; font-weight: bold; text-decoration: underline; }
|
||||
.clear {clear: both; margin: 0 auto;}
|
||||
.current-page {border: 1px solid #000; padding: 3px;}
|
||||
.description {font-size: 11px; color: #777; font-style: italic; margin-top: 3px;}
|
||||
|
||||
.small { font-size: 10px; display: inline-block; }
|
||||
|
||||
.tabbed-form { margin: 0px; padding: 0px; }
|
||||
.tabbed-form.menu li { list-style: none; float: left; border: 1px solid #CCC; padding: 3px 6px; border-bottom: none;}
|
||||
.tabbed-form.menu li.active { background: #FFF; height: 22px; margin-top: -7px; border: 1px solid #AAA; border-bottom: none; position: relative; top: 2px;}
|
||||
.tabbed-form.menu li:hover { background: #FFF; cursor: pointer; }
|
||||
.tabbed-form.content { border: 1px solid #AAA; padding-left: 10px; background: #FFF;}
|
||||
.tabbed-form.content li { list-style: none; width: 100%; padding: 10px; }
|
||||
|
||||
span.tree-button { border: 1px solid #000000; font-size: 10px; height: 0; margin: 4px; padding: 0 2px; }
|
||||
span.tree-button:hover { background: #DDD; cursor: pointer; }
|
||||
.tree .details { display: none; margin: 5px 20px;}
|
||||
.tree table { vertical-align: middle; }
|
||||
.tree table td { padding: 0px 5px; min-width: 50px;}
|
||||
|
||||
.spaced-table { border-collapse: collapse }
|
||||
.spaced-table td {padding: 0px 5px; min-width: 50px; font-weight: bold; border-bottom: 1px dashed #E8E8E8;}
|
||||
|
||||
.spaced-table2 th{ min-width: 65px; }
|
||||
.spaced-table2 td{ max-width: 100px; }
|
||||
|
||||
.cloudcache-dialogbox { border: 1px solid #D8D8D8; padding: 10px; width: 90%; margin: 10px 0px;}
|
||||
.cloudcache-dialogbox input { margin: 5px 0px;}
|
||||
.cloudcache-dialogbox label{ padding: 0.2em 1.5em 0 0; width: 150px; }
|
||||
|
||||
.prepaid-bandwidth {
|
||||
background: none repeat scroll 0 0 #DDE9F7;
|
||||
border: 1px solid #50B0EC;
|
||||
font-size: 11px;
|
||||
left: 566px;
|
||||
padding: 10px;
|
||||
position: relative;
|
||||
text-shadow: 0 1px 0 #FFFFFF;
|
||||
top: 26px;
|
||||
width: 155px;
|
||||
}
|
||||
|
||||
.prepaid-bandwidth.coupon {
|
||||
left: 565px;
|
||||
width: 340px;
|
||||
}
|
||||
|
||||
.bandwidth-value { font-size: 30px; text-align: center; margin-top: 10px;}
|
||||
|
||||
.bold-td { font-weight: bold; }
|
||||
.hint { padding: 8px 6px 8px 42px; }
|
||||
|
||||
/* Aliases */
|
||||
.MB0 {margin-bottom: 0;}
|
||||
.MB10 {margin-bottom: 10px;}
|
||||
.MB20 {margin-bottom: 20px;}
|
||||
.MB30 {margin-bottom: 30px;}
|
||||
.MT0 {margin-top: 0;}
|
||||
.MT10 {margin-top: 10px;}
|
||||
.MT20 {margin-top: 20px;}
|
||||
.MT30 {margin-top: 30px;}
|
||||
.ML0 {margin-left: 0px;}
|
||||
.ML10 {margin-left: 10px;}
|
||||
.ML20 {margin-left: 20px;}
|
||||
.ML30 {margin-left: 30px;}
|
||||
.MR0 {margin-right: 0px;}
|
||||
.MR10 {margin-right: 10px;}
|
||||
.MR20 {margin-right: 20px;}
|
||||
.MR30 {margin-right: 30px;}
|
||||
.resetM {margin: 0;}
|
||||
.C { clear: both; margin: 0 auto; }
|
||||
.I {font-style: italic;}
|
||||
.L {float: left;}
|
||||
.R {float: right;}
|
||||
|
||||
/* jExcerpt */
|
||||
.jexcerpt-long {
|
||||
float: left;
|
||||
display: none;
|
||||
position: absolute;
|
||||
background: #FFF;
|
||||
border: 1px solid #444;
|
||||
padding: 3px;
|
||||
margin: -3px;
|
||||
cursor: default;
|
||||
}
|
||||
.jexcerpt-short {
|
||||
float: left;
|
||||
}
|
||||
|
||||
#requiredFieldsTranslation { display: none; }
|
||||
|
||||
/* Tabs */
|
||||
#menuTab {
|
||||
float: left;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
text-align: left;
|
||||
}
|
||||
#menuTab li {
|
||||
text-align: left;
|
||||
float: left;
|
||||
display: inline;
|
||||
padding: 5px;
|
||||
padding-right: 10px;
|
||||
background: #EFEFEF;
|
||||
font-weight: bold;
|
||||
cursor: pointer;
|
||||
border-left: 1px solid #CCCCCC;
|
||||
border-right: 1px solid #CCCCCC;
|
||||
border-top: 1px solid #CCCCCC;
|
||||
}
|
||||
#menuTab li.menuTabButton.selected {
|
||||
background: #FFFFF0;
|
||||
border-left: 1px solid #CCCCCC;
|
||||
border-right: 1px solid #CCCCCC;
|
||||
border-top: 1px solid #CCCCCC;
|
||||
height: 20px;
|
||||
margin-bottom: -8px;
|
||||
margin-top: -4px;
|
||||
}
|
||||
#tabList { clear: left; }
|
||||
.tabItem { display: none; }
|
||||
.tabItem.selected { display: block; background: #FFFFF0; border: 1px solid #CCCCCC; padding: 10px; padding-top: 20px; }
|
||||
@@ -1,35 +0,0 @@
|
||||
{literal}
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
{/literal}
|
||||
mediaServerForm = $('input[name="submitMediaServers"]').parent().parent();
|
||||
ccc = $('input[name="submitCCC"]').parent().parent();
|
||||
{if $isModuleActive}
|
||||
legend = $(mediaServerForm).find('legend').html();
|
||||
$(mediaServerForm).empty();
|
||||
$('<legend>' + legend + '</legend>' +
|
||||
'<div class="conf"><img alt="" src="../img/admin/ok2.png">' +
|
||||
'{l s='You are currently saving even more performance by' mod='cloudcache'}' +
|
||||
' <a href="?tab=AdminModules&configure=cloudcache&token={$adminToken}&tab_module=administration&module_name=cloudcache" style="color: blue; font-weight: bold">' +
|
||||
'{l s='using CloudCache module' mod='cloudcache'}</a>, ' +
|
||||
'{l s='the Best CDN service recommended by PrestaShop users!' mod='cloudcache'} ' +
|
||||
'</div>').prependTo(mediaServerForm);
|
||||
{else}
|
||||
$('<div class="warn"><img src="../img/admin/warn2.png">' + '{l s='Save even more performance by' mod='cloudcache'}' + '<a href="?tab=AdminModules&configure=cloudcache&token={$adminToken}&tab_module=administration&module_name=cloudcache" style="color: blue; font-weight: bold">{l s='activating CloudCache module' mod='cloudcache'}</a>, {l s='the Best CDN service recommended by PrestaShop users!' mod='cloudcache'}</div>').prependTo(mediaServerForm);
|
||||
{/if}
|
||||
|
||||
{if $isModuleActive}
|
||||
{if isset($compatibilityIssues)}
|
||||
$('<div class="warn"><img src="../img/admin/warn2.png"> ' +
|
||||
{foreach from=$compatibilityIssues key=i item=message}
|
||||
'{if $i > 0}{$i} - {/if}{$message}' +
|
||||
{/foreach}
|
||||
'</div>').prependTo(ccc);
|
||||
{else}
|
||||
$('<div class="conf"><img src="../img/admin/ok2.png">{l s='Everything looks good for CloudCache' mod='cloudcache'}</div>').prependTo(ccc);
|
||||
{/if}
|
||||
{/if}
|
||||
|
||||
{literal}
|
||||
});</script>
|
||||
{/literal}
|
||||
@@ -1,360 +0,0 @@
|
||||
<script type="text/javascript" src="{$base_dir}modules/cloudcache/script.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="{$base_dir}modules/cloudcache/style.css" />
|
||||
<script type="text/javascript">
|
||||
var apikey = '{$apiKey|escape}';
|
||||
{literal}
|
||||
$(document).ready(function()
|
||||
{
|
||||
$('#loading').hide();
|
||||
$("#SubmitCloudcacheSettings").click(function()
|
||||
{
|
||||
if ($("#cloudcache_api_user").val() != '' && $("#cloudcache_api_key").val() != '')
|
||||
{
|
||||
if (apikey == '')
|
||||
return true;
|
||||
if (confirm("Are you sure ?"))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
});
|
||||
{/literal}
|
||||
</script>
|
||||
<div style="float:right;width:400px;margin-bottom:10px">
|
||||
<fieldset>
|
||||
<h3>{l s='Opening your CloudCache.com Account' mod='cloudcache'}</h3>
|
||||
<p>{l s='CloudCache provides Prestashop users an exclusive discount of 25% per month on every available package. Please click the logo below to sign up: ' mod='cloudcache'}</p><br/>
|
||||
<a href="http://www.cloudcache.com/prestashop"><img style="width: 370px;" src="{$base_dir}modules/cloudcache/cloudcache_ps_logo.png" alt="cloudcache"/></a>
|
||||
</fieldset>
|
||||
</div>
|
||||
<div style="width:450px">
|
||||
<div style="float: left; width: 150px">
|
||||
<img style="width:150px; float:left; margin:25px 20px 0px 0px;" src="../modules/cloudcache/cloudcache_logo.png" alt="cloudcache"/>
|
||||
</div>
|
||||
<div style="float: left; width: 250px; margin: 25px;">
|
||||
<b>{l s='This module allows you to acclerate your PrestaShop via the CloudCache Content Delivery Network.' mod='cloudcache'}</b><br /><br />
|
||||
{l s='A content Delivery Network (CDN) is for every site owner who demands a high performance, primo visitor experience.' mod='cloudcache'}
|
||||
</div>
|
||||
</div>
|
||||
<br/>
|
||||
<br/>
|
||||
{if isset($confirmMessage)}
|
||||
<div style="clear:both" class="conf {$confirmMessage['class']}">
|
||||
<img src="../img/admin/{$confirmMessage['img']}" alt="" title="" />
|
||||
{$confirmMessage['text']}
|
||||
</div>
|
||||
{/if}
|
||||
{if isset($compatibilityIssues)}
|
||||
<fieldset style="clear:both" class="width6 cloudcache_fieldset">
|
||||
<legend>
|
||||
<img src="../img/admin/statsettings.gif" alt="" />
|
||||
{l s='CloudCache Compatibilty Check' mod='cloudcache'}
|
||||
</legend>
|
||||
<p>
|
||||
<div class="warn">
|
||||
<img src="../img/admin/warn2.png" />
|
||||
{foreach from=$compatibilityIssues key=i item=message}
|
||||
{if $i > 0}{$i|strip_tags} - {/if}{$message|strip_tags}<br />
|
||||
{/foreach}
|
||||
</div>
|
||||
</p>
|
||||
</fieldset><br />
|
||||
{else}
|
||||
<ul id="menuTab" style="clear:both">
|
||||
<li id="menuTab1" class="menuTabButton selected">{l s='Why CloudCache' mod='cloudcache'}</li>
|
||||
<li id="menuTab2" class="menuTabButton">{l s='Help' mod='cloudcache'}</li>
|
||||
<li id="menuTab3" class="menuTabButton">{l s='Settings' mod='cloudcache'}</li>
|
||||
{if isset($couponUrl) && isset($apiActive) && $apiActive == 1}
|
||||
<li id="menuTab4" class="menuTabButton">{l s='Zones' mod='cloudcache'}</li>
|
||||
{/if}
|
||||
</ul>
|
||||
<div id="tabList">
|
||||
<div id="menuTab1Sheet" class="tabItem selected">
|
||||
<p>{l s='CloudCache is focused on delivering your web content at light speed efficiency. We keep a copy of the “heavy” objects from your PrestaShop, like images, CSS and JavaScript on our datacenters around the world and deliver these to your visitors from the closest location to them. Here are numerous benefits of having a faster loading site: ' mod='cloudcache'}</p>
|
||||
{*
|
||||
<ul>
|
||||
<li><b>{l s='Thrive During Traffic Spikes!' mod='cloudcache'}</b><p style="display: block;">{l s='In case you become famous overnight (i.e your shop is mentioned on TV), your sales would skyrocket, but your server might crash from the load; we help you to load balance your traffic.' mod='cloudcache'}</p><br /></li>
|
||||
<li><p><b style="display: block;">{l s='Custom SSL made Easy' mod='cloudcache'}</b><br /></p>{l s='Our SSL acceleration offloads up to 70% of your server CPU power. Plus we made it super easy and affordable to run SSL on the cloud. We only charge $24.95 per Custom SSL Zone, per month including the SSL certificate.' mod='cloudcache'}</li>
|
||||
<li><p><b>{l s='Higher SEO Rankings' mod='cloudcache'}</b><br /></p><p>{l s='Google uses page speed as a key factor in their ranking algorithm. Faster loading pages earn higher rankings in search results, which means more traffic and more money for you.' mod='cloudcache'}</p></li>
|
||||
<li><p><b>{l s='Increase your Conversions' mod='cloudcache'}</b></p><p>{l s='Amazon found that if your site loads 100 milliseconds slower they lose 1% of their revenue. We think that this reason alone is enough to worry about page load time.' mod='cloudcache'}</p></li>
|
||||
</ul> *}
|
||||
|
||||
<ul style="float: right; width: 45%;">
|
||||
<li style="margin-bottom: 10px;"><b>Thrive During Traffic Spikes!</b><br />In case you become famous overnight (i.e your shop is mentioned on TV), your sales would skyrocket, but your server might crash from the load; we help you to load balance your traffic.</li>
|
||||
<li><b>Custom SSL made Easy</b><br />Our SSL acceleration offloads up to 70% of your server CPU power. Plus we made it super easy and affordable to run SSL on the cloud. We only charge $24.95 per Custom SSL Zone, per month including the SSL certificate.</li>
|
||||
</ul>
|
||||
<ul style="float: right; width: 45%">
|
||||
<li style="margin-bottom: 10px;"><b>Higher SEO Rankings</b><br />Google uses page speed as a key factor in their ranking algorithm. Faster loading pages earn higher rankings in search results, which means more traffic and more money for you.<br /></li>
|
||||
<li><b>Increase your Conversions</b><br />Amazon found that if your site loads 100 milliseconds slower they lose 1% of their revenue. We think that this reason alone is enough to worry about page load time.<br /></li>
|
||||
</ul>
|
||||
|
||||
<div style="clear:both;"></div>
|
||||
|
||||
</div>
|
||||
<div id="menuTab2Sheet" class="tabItem">
|
||||
<h3>{l s='How to configure CloudCache' mod='cloudcache'}</h3>
|
||||
- {l s='Subscribe to CloudCache by clicking on the logo on the right' mod='cloudcache'}<br />
|
||||
- {l s='Create an API user and retrieve the User ID and the API key' mod='cloudcache'} (<a style="color:blue;text-decoration:underline" href="http://www.youtube.com/watch?v=YfKFkq-J2CU">{l s='see how-to video' mod='cloudcache'}</a>)<br /><br />
|
||||
<h3>{l s='How to configure the Module:' mod='cloudcache'}</h3>
|
||||
- {l s='Fill the CloudCache User ID and API key fields with those provided by CloudCache.' mod='cloudcache'}<br />
|
||||
- {l s='Click on the "Save Settings" button and then Test your connection.' mod='cloudcache'}<br />
|
||||
- {l s='If you do not have existing zones, a default zone will be created.' mod='cloudcache'}<br />
|
||||
- {l s='In order to increase the performance, you can go to your CloudCache account by clicking on the link at the right, go to the Pullzones list, choose your zone, edit it, go to the Advanced Settings and uncheck the "Query String" option. In order to save the change, click on the "Update".' mod='cloudcache'}<br /><br />
|
||||
{* <h3>{l s='Module purpose:' mod='cloudcache'}</h3>
|
||||
{l s='A Content Delivery Network (CDN) is for every site owner who demands a high performance, primo visitor experience. Why? Because our CDN delivers your downloadables – images, video, scripts, css – with super-fast load times. ' mod='cloudcache'}<br /><br /> *}
|
||||
<h3>{l s='What modifications does the module do on my store?' mod='cloudcache'}</h3>
|
||||
- {l s='Tools.php will be overwritten.' mod='cloudcache'}<br />
|
||||
- {l s='[Preferences Tab -> Performance -> Media Servers] will display a link to the CloudCache module configurations and a notification when the module is active.' mod='cloudcache'}<br />
|
||||
|
||||
</div>
|
||||
<div id="menuTab3Sheet" class="tabItem">
|
||||
<form action="{$serverRequestUri|strip_tags}&id_tab=3" method="post">
|
||||
{if isset($connectionTestResult)}
|
||||
<div id="test_connection" style="background: {$connectionTestResult[1]};" >
|
||||
{$connectionTestResult[0]}<br />
|
||||
{if $connectionTestResult[1] == '#FFD8D8'}
|
||||
<b style="color: red">{l s='An error occured while testing the connection.' mod='cloudcache'}</b>
|
||||
{elseif isset($connectionTestResult['newZone'])}
|
||||
<b style="color: green;">{l s='Success! That is all you have to do!' mod='cloudcache'} {$connectionTestResult['newZone']|escape} {l s='is now accelerated by cloudcache.com' mod='cloudcache'}</b>
|
||||
{else}
|
||||
<b style="color: green;">{l s='Success! The connection have been established!' mod='cloudcache'}</b>
|
||||
{/if}<br />
|
||||
</div>
|
||||
{/if}
|
||||
<div style="height: 0px;">
|
||||
<div style="display: block; float: right; margin-top: 14px;">
|
||||
{if !empty($companyId)}
|
||||
<fieldset>
|
||||
<legend>CloudCache</legend>
|
||||
<a href="http://login.cloudcache.com">
|
||||
{l s='Click Here to access your CloudCache account' mod='cloudcache'}
|
||||
</a>
|
||||
</fieldset>
|
||||
{/if}
|
||||
</div>
|
||||
<div style="clear: both;"></div>
|
||||
{*if isset($couponUrl) && isset($apiActive) && $apiActive == 1}
|
||||
<div class="prepaid-bandwidth MT20" style="display: block;">
|
||||
<b>{l s='Your available bandwidth is:' mod='cloudcache'}</b><br />
|
||||
<div class="bandwidth-value">{$prepaidBandwith|escape} Tb left</div>
|
||||
</div>
|
||||
{/if*}
|
||||
</div>
|
||||
<table border="0" cellspacing="5">
|
||||
{if 0 && !empty($companyId)}<tr>
|
||||
<td class="cloudcache_column">{l s='Company ID' mod='cloudcache'}</td>
|
||||
<td><input type="text" name="cloudcache_api_company_id" value="{if isset($companyId)}{$companyId|escape}{/if}" /></td>
|
||||
</tr> {/if}
|
||||
<tr>
|
||||
<td class="cloudcache_column">{l s='API User' mod='cloudcache'}</td>
|
||||
<td><input type="text" name="cloudcache_api_user" id="cloudcache_api_user" value="{if isset($apiUser)}{$apiUser|escape}{/if}" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="cloudcache_column">{l s='API Key' mod='cloudcache'}</td>
|
||||
<td><input type="{if isset($apiKey) && !empty($apiKey)}password{else}text{/if}" id="cloudcache_api_key" name="cloudcache_api_key" value="{if isset($apiKey)}{$apiKey|escape}{/if}"/></td>
|
||||
</tr>
|
||||
</table>
|
||||
<center><input type="submit" id="SubmitCloudcacheSettings" class="button cloudcache_button" name="SubmitCloudcacheSettings" value="{l s='Save Settings' mod='cloudcache'}" /></center>
|
||||
<hr size="1" style="margin: 14px auto;" noshade />
|
||||
<center><img src="../img/admin/exchangesrate.gif" alt="" /> <input type="submit" onClick="$('#loading').show();" id="cloudcache_test_connection" class="button cloudcache_button" name="SubmitCloudcacheTestConnection" value="{l s='Click here to Test Connection' mod='cloudcache'}" style="margin-top: 0;" /><div id="loading" >{l s='Loading' mod='cloudcache'} <img src="{$base_dir|escape}modules/cloudcache/loading.gif" style="height: 25px;" /></div></center>
|
||||
</form>
|
||||
</div>
|
||||
{if isset($couponUrl) && isset($apiActive) && $apiActive == 1}
|
||||
<div id="menuTab4Sheet" class="tabItem">
|
||||
|
||||
<!-- Menu -->
|
||||
{if !empty($zones)}
|
||||
<ul class="tabbed-form menu">
|
||||
{foreach from=$allAvailableZones key=type item=name}
|
||||
<li>{$name|escape}</li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
<ul class="tabbed-form content" style="margin-top: 23px">
|
||||
<li id="tab1_content">
|
||||
<table style="display: inline-block;" class="spaced-table2">
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>File Type</th>
|
||||
<th>Origin</th>
|
||||
<th>Vanity URL</th>
|
||||
{* <th>Label</th> *}
|
||||
<th>Compress</th>
|
||||
<th>BW Last Month</th>
|
||||
<th>BW Last Week</th>
|
||||
<th>BW Yesterday</th>
|
||||
<th style="min-width: 150px;"></th>
|
||||
</tr>
|
||||
{foreach from=$zones key=id_zone item=zone}
|
||||
<tr align="left" valign="top">
|
||||
<td>{$zone['name']|escape}</td>
|
||||
<td>{if $zone['file_type'] eq null or $zone['file_type'] eq 'none' or $zone['file_type'] eq '0'}{l s='N/A' mod='cloudcache'}{else}{$zone['file_type']|upper|escape}{/if}</td>
|
||||
<td><div class="jexcerpt-short">{$zone['origin']|substr:0:10|escape}{if $zone['origin']|strlen > 10}...{/if}</div>{if $zone['origin']|strlen > 10}<div class="jexcerpt-long">{$zone['origin']}</div>{/if}</td>
|
||||
<td><span class="jexcerpt-short">{$zone['cdn_url']|substr:0:10|escape}{if $zone['cdn_url']|strlen > 10}...{/if}</span>{if $zone['cdn_url']|strlen > 10}<span class="jexcerpt-long">{$zone['cdn_url']|escape}</span>{/if}</td>
|
||||
{* <td>{if isset($zone.label)}{$zone['label']|escape}{/if}</td> *}
|
||||
<td>{if isset($zone['compress']) && $zone['compress'] == 1}{l s='YES' mod='cloudcache'}{else}{l s='NO' mod='cloudcache'}{/if}</td>
|
||||
<td>{if $zone.bw_last_month != -1}{$zone['bw_last_month']|escape}{else}{l s='N/A' mod='cloudcache'}{/if}</td>
|
||||
<td>{if $zone.bw_last_week != -1}{$zone['bw_last_week']|escape}{else}{l s='N/A' mod='cloudcache'}{/if}</td>
|
||||
<td>{if $zone.bw_yesterday != -1}{$zone['bw_yesterday']|escape}{else}{l s='N/A' mod='cloudcache'}{/if}</td>
|
||||
|
||||
<td>
|
||||
<form method="post" action="{$serverRequestUri|strip_tags}&id_tab=4">
|
||||
<input type="hidden" value="{$id_zone|escape}" name="id_zone"/>
|
||||
<input type="hidden" value="" name="CloudcacheZone_action" class="CloudcacheZone_action"/>
|
||||
<input type="submit" name="SubmitCloudcacheEditZoneAction" value="Edit" class="button"/>
|
||||
<input type="submit" name="SubmitCloudcacheClearZoneCache" value="{l s='Purge Cache' mod='cloudcache'}" class="button"/>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</table>
|
||||
</li>
|
||||
</ul>
|
||||
{/if}
|
||||
<form method="post" action="{$serverRequestUri|strip_tags}&id_tab=4" class="MT20">
|
||||
<div class="R">
|
||||
<input type="submit" class="button MB10" id="SubmitCloudcacheSync" name="SubmitCloudcacheSync" value="{l s='Sync Zones!' mod='cloudcache'}" />
|
||||
{if !isset($edit_zone_info)}
|
||||
<input type="submit" class="button MB10" id="cloudcache_add_zone" name="cloudcache_add_zone" value="{l s='Add zones' mod='cloudcache'}" />
|
||||
{/if}
|
||||
<input type="submit" class="button MB10" id="SubmitCloudcacheClearAllCache" name="SubmitCloudcacheClearAllCache" value="{l s='Clear All Cache' mod='cloudcache'}" />
|
||||
</div>
|
||||
</form>
|
||||
<div style="margin-bottom: 60px;"></div>
|
||||
{if isset($edit_zone_info)}
|
||||
<div id="cloudcache_edit_zone_form" class="cloudcache-dialogbox">
|
||||
<form method="post" action="{$serverRequestUri|strip_tags}&id_tab=4">
|
||||
<input type="hidden" name="id_zone" id="id_zone" value="{$edit_zone_info['id_zone']|escape}"/>
|
||||
<table border="0" cellspacing="5" class="bold-td">
|
||||
<tr>
|
||||
<td>{l s='ID Zone' mod='cloudcache'}</td>
|
||||
<td>{$edit_zone_info['id_zone']|escape}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{l s='Pull Zone Name' mod='cloudcache'}</td>
|
||||
<td><input type="hidden" name="name" id="name" size="20" maxlength="30" value="{$edit_zone_info['name']|escape}"/>{$edit_zone_info['name']|escape}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{l s='Origin Server Url' mod='cloudcache'}</td>
|
||||
<td><input type="hidden" name="origin" id="origin" size="20" maxlength="30" value="{$edit_zone_info['origin']|escape}"/>{$edit_zone_info['origin']|escape}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{l s='Custom CDN Domain' mod='cloudcache'}</td>
|
||||
<td><input type="text" name="vanity_domain" id="vanity_domain" size="20" maxlength="30" value="{$edit_zone_info['cdn_url']|escape}"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{l s='Label' mod='cloudcache'}</td>
|
||||
<td><input type="text" name="label" id="label" size="20" maxlength="30" value="{$edit_zone_info['label']|escape}"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{l s='Compression' mod='cloudcache'}</td>
|
||||
<td>
|
||||
<input type="checkbox" name="compress" id="compress" size="20" maxlength="30" {if $edit_zone_info['compress'] == 1}checked="checked"{/if}/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{l s='File Type' mod='cloudcache'}</td>
|
||||
<td>
|
||||
<select name="file_type" id="file_type">
|
||||
<option value="all" {if $edit_zone_info['file_type'] == 'all'}selected="selected"{/if}>{l s='All' mod='cloudcache'}</option>
|
||||
<option value="0" {if !$edit_zone_info['file_type']}selected="selected"{/if}>--not assigned--</option>
|
||||
<option value="css" {if $edit_zone_info['file_type'] == 'css'}selected="selected"{/if}>CSS</option>
|
||||
<option value="js" {if $edit_zone_info['file_type'] == 'js'}selected="selected"{/if}>JS</option>
|
||||
<option value="img" {if $edit_zone_info['file_type'] == 'img'}selected="selected"{/if}>Images</option>
|
||||
<option value="other" {if $edit_zone_info['file_type'] == 'other'}selected="selected"{/if}>Others</option>
|
||||
</select>
|
||||
<input type="hidden" style="display: none;" name="type" value="pullzone" />
|
||||
</td>
|
||||
</tr>
|
||||
{* <tr>
|
||||
<td>{l s='Zone Type' mod='cloudcache'}</td>
|
||||
<td><select name="type" id="type">
|
||||
{foreach from=$allAvailableZones key=type item=name}
|
||||
<option value="{$type|escape}" {if $edit_zone_info['type'] == $type}selected="selected"{/if}>{$name|escape}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
*}
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>
|
||||
<input type="submit" class="button R" style="margin: 0px 10px;" id="cloudcache_close_edit" name="cloudcache_close_edit" value="{l s='Cancel' mod='cloudcache'}" />
|
||||
<input type="submit" name="SubmitCloudcacheEdit_zone" id="SubmitCloudcacheEdit_zone" value="{l s='Save' mod='cloudcache'}" class="button R ML20" style="margin: 0px 10px;" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="C"></div>
|
||||
</form>
|
||||
</div>
|
||||
{else}
|
||||
<div id="cloudcache_add_zone_form" class="cloudcache-dialogbox">
|
||||
<form method="post" action="{$serverRequestUri|strip_tags}&id_tab=4">
|
||||
<table border="0" cellspacing="5" class="bold-td">
|
||||
<tr>
|
||||
<td>{l s='Pull Zone Name' mod='cloudcache'}<sup> *</sup></td>
|
||||
<td><input type="text" name="name" id="name" size="20" maxlength="30" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{l s='Origin Server Url' mod='cloudcache'}<sup> *</sup></td>
|
||||
<td><input type="text" name="origin" id="origin" size="20" maxlength="30" value="{$defaultOriginServerURL|strip_tags}"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{l s='Custom CDN Domain' mod='cloudcache'}</td>
|
||||
<td><input type="text" name="vanity_domain" id="vanity_domain" size="20" maxlength="30" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{l s='Label' mod='cloudcache'}</td>
|
||||
<td><input type="text" name="label" id="label" size="20" maxlength="30" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{l s='Compression' mod='cloudcache'}</td>
|
||||
<td><input type="checkbox" name="compress" id="compress" size="20" maxlength="30" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{l s='Zone Type' mod='cloudcache'}</td>
|
||||
<td><select name="type" id="type">
|
||||
{foreach from=$allAvailableZones key=type item=name}
|
||||
<option value="{$type|escape}">{$name|escape}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td><input type="submit" name="SubmitCloudcacheAdd_zone" id="SubmitCloudcacheAdd_zone" value="{l s='Create Zone' mod='cloudcache'}" class="button R MR20" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="C"></div>
|
||||
</form>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
<br clear="left" />
|
||||
<fieldset class="width2 cloudcache_fieldset">
|
||||
<legend><img src="../img/admin/statsettings.gif" alt="" />{l s='Cloudcache and PrestaShop' mod='cloudcache'}</legend>
|
||||
<p><a href="http://www.prestashop.com/en/industry-partners/management/cloudcache" target="_blank">{l s='Learn more about Cloudcache at PrestaShop.com' mod='cloudcache'}</a></p>
|
||||
</fieldset><br />
|
||||
<br />
|
||||
|
||||
<script type="text/javascript">
|
||||
{literal}
|
||||
$(".menuTabButton").click(function () {
|
||||
$(".menuTabButton.selected").removeClass("selected");
|
||||
$(this).addClass("selected");
|
||||
$(".tabItem.selected").removeClass("selected");
|
||||
$("#" + this.id + "Sheet").addClass("selected");
|
||||
});
|
||||
{/literal}
|
||||
{if (isset($cloudcache_id_tab))}
|
||||
var id_tab = '{$cloudcache_id_tab}';
|
||||
{literal}
|
||||
$(".menuTabButton.selected").removeClass("selected");
|
||||
$("#menuTab"+id_tab).addClass("selected");
|
||||
$(".tabItem.selected").removeClass("selected");
|
||||
$("#menuTab"+id_tab+"Sheet").addClass("selected");
|
||||
{/literal}
|
||||
{/if}
|
||||
</script>
|
||||
@@ -1,36 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2012 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Open Software License (OSL 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/osl-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-2012 PrestaShop SA
|
||||
* @version Release: $Revision: 14011 $
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 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;
|
||||
@@ -1,12 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<module>
|
||||
<name>shipwire</name>
|
||||
<displayName><![CDATA[Shipwire]]></displayName>
|
||||
<version><![CDATA[1.1.2]]></version>
|
||||
<description><![CDATA[Enterprise logistics for everyone.]]></description>
|
||||
<author><![CDATA[PrestaShop]]></author>
|
||||
<tab><![CDATA[administration]]></tab>
|
||||
<is_configurable>1</is_configurable>
|
||||
<need_instance>1</need_instance>
|
||||
<limited_countries></limited_countries>
|
||||
</module>
|
||||
@@ -1,54 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2012 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-2012 PrestaShop SA
|
||||
* @version Release: $Revision: 1.4 $
|
||||
* @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');
|
||||
|
||||
if (isset($_GET['secure_key']) || isset($_ARGV[1]))
|
||||
{
|
||||
$secureKey = md5(_COOKIE_KEY_.Configuration::get('PS_SHOP_NAME'));
|
||||
if (!empty($secureKey) && ($secureKey == $_GET['secure_key'] || (isset($_ARGV[1]) && $secureKey == $_ARGV[1])))
|
||||
{
|
||||
// Clean logs
|
||||
$logDeleteDate = date('Y-m-d', mktime(0, 0, 0, date('n'), date('j') - Configuration::get('SHIPWIRE_LOG_LIFE'), date('Y'))).' 00:00:00';
|
||||
Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'shipwire_log` WHERE `date_added` < \''.pSQL($logDeleteDate).'\'');
|
||||
|
||||
if (!class_exists('Shipwire'))
|
||||
require(dirname(__FILE__).'/shipwire.php');
|
||||
|
||||
require(dirname(__FILE__).'/lib/ShipwireApi.php');
|
||||
require(dirname(__FILE__).'/lib/ShipwireTracking.php');
|
||||
|
||||
$m = new Shipwire();
|
||||
$d = Db::getInstance()->ExecuteS('SELECT `id_order` FROM `'._DB_PREFIX_.'shipwire_order` WHERE `transaction_ref` IS NULL OR `transaction_ref` = \'\'');
|
||||
foreach ($d as $line)
|
||||
$m->updateOrderStatus($line['id_order']);
|
||||
|
||||
ShipwireTracking::updateTracking(); // This will be called directly thru the browser or cronjob
|
||||
}
|
||||
|
||||
die('Invalid key.');
|
||||
}
|
||||
@@ -1,68 +0,0 @@
|
||||
<?php
|
||||
|
||||
global $_MODULE;
|
||||
$_MODULE = array();
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_e912562384b72ccc478a47019c553dc7'] = 'Shipwire';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_387ef38ac0cb1704e465d537ab8d690d'] = 'Logística empresarial para todos.';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_621db7652ee0cb6a53c8ca4ec683bae5'] = 'No se envió a Shipwire.';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_485ed82930e1e53e6da27a11ccf2089b'] = 'Shipwire Estatus';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_7ae1032125a8a684fba52b9b6c09ded0'] = 'Ha ocurrido un error en el servidor remoto:';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_45d696d51dc4a18515658aeebddf4179'] = 'Un error desconocido ocurrió con el ID de la orden.';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_b5bccda6d3a04e1d8f79846355290435'] = 'Por favor, introduzca una dirección de correo electrónico válida.';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_76a8cba9f6f6ca77abe5dfb9e56ba994'] = 'Inventario actualizado.';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_e1b21d2b3dae6a61b0937d9e5d483b3a'] = 'Error en la actualización del inventario';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_8d72a4c1a23232d68f7fc3c36bc1ed53'] = 'Transacciones actualizadas.';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_3fa1e76061af98ff1d61c688e2b5283a'] = 'Fallo al actualizar las transacciones.';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_f4725a7b56d133e57f0ff8ccef7861f1'] = 'Orden reenviada satisfactoriamente.';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_7ae3fd45db978dd817e1e023548009b1'] = 'Error al enviar. Inténtelo más tarde.';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_38af966ecd35842058e527c36f17e42f'] = 'Transacciones reenviadas satisfactoriamente.';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_db7972f220d257cc289fef03cbad3779'] = 'Error reenviando transacciones.';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_77ab0beb2c0eb88c3e6375d6355b42d7'] = 'Registros vacíos.';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_b8529249c5c02d3d62cedac39afcfd67'] = 'Error al eliminar registros.';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_63a77eaf9f310dc5def6709c2887dcc4'] = 'Error en la conexión de prueba.';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_527fe8cddad7740fc09d02dbd718a8b8'] = '¡Felicitaciones! Su tienda está ahora conectado a Shipwire.';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_c888438d14855d7d96a2724ee9c306bd'] = 'Configuración actualizada';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_6a26f548831e6a8c26bfbbd9f6ec61e0'] = 'Ayuda';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_de54437623a7b25ea277a303772e0912'] = 'Cómo configurar el módulo de Shipwire:';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_082efcf162e9fc2ce9cd32e13706790b'] = 'Llene el correo electrónico Shipwire y Contraseña con los proporcionados por Shipwire.';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_2a5075cb5b1148436ee37a1ef46e51a6'] = 'Haga clic en \"Guardar configuración\" y luego probar su conexión.';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_727283f37d3e70d3faceb71761d0fb51'] = 'Propósito del módulo :';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_5a2b02068a8824776581bf12ea9b84c0'] = 'La plataforma de la empresa de logística Shipwire le ayudará a reducir costos, incrementar las ventas y ofrecer una gran experiencia para sus clientes. Shipwire asegura que sus órdenes se envíen con rapidez y a un costo menor.';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_fd78097435e14fb77cea008f89beb08a'] = 'Conecte con facilidad sus canales de ventas y expándase en otros, como el comercio social. Utilice los almacenes globales de Shipwire para llegar a más clientes con mayor rapidez y a un costo más bajo.';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_cf628555f89cf93adc51e5a98f74406d'] = 'Quel que soit le volume de vos ventes, les entrepôts automatisés de Shipwire traitent vos commandes rapidement et avec précision, pour des clients Sea cual sea el volumen, los almacenes automatizados de Shipwire procesan sus órdenes de forma rápida y precisa.';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_e8d3449d135b1840e2d5ca638f0d608f'] = 'Credenciales Shipwire';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_ce8ae9da5b7cd6c3df2929543a9af92d'] = 'E-mail';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_dc647eb65e6711e155375218212b3964'] = 'Contraseña';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_9daf1fb753b42c3cdc8f1d01669cd6d8'] = 'Guardar configuración';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_79ddd6cfbf01f63986f7b114ecc2ca95'] = 'Haga clic aquí para Conexión de prueba';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_8d47e6b887cacc0d7d48ce49f403cf7f'] = 'Shipwire y PrestaShop';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_989004cc8be1a096644202bcb9ed5111'] = 'Más información sobre Shipwire en PrestaShop.com';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_dae8ace18bdcbcc6ae5aece263e14fe8'] = 'Opciones';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_858b7d4b9e6c0a1066c76b67492ebfc2'] = 'Estados de pedido que interactuarán con Shipwire';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_fda9efefff2479c9f299cf01757b0354'] = 'Cuando un estado de la orden se actualiza en Shipwire, los estados siguientes se aplicarán a la orden en su tienda.';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_004bf6c9a40003140292e97330236c53'] = 'Acción';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_4bb3e6ea4b1aa93c3429e410129b4be4'] = 'Estado de la orden en su tienda';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_20e85fb909bc0a3f5465e4847a421727'] = 'Enviar orden a Shipwire';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_f6aa2a9d2f9c62fcebed30a12718174e'] = 'Marcar orden como ENVIADO en su tienda.';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_b69c10301eb67f486f8c7b53ef297f3f'] = 'Marcar orden como ENTREGADO en su tienda.';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_5292f1fdc23e0772998728bfe960fafe'] = 'Duración de los registros';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_e166edcc50bf23bd04a651f99af1e6a8'] = 'Borrar registros de transacciones cada';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_2c30957d90dbbb192712f11e183853cd'] = 'dias (recomendado: 30 días)';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_8be66d7d19c88192adcbbe43ca7b5781'] = '--Seleccione uno--';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_af22fc80f66213750302086471651553'] = 'Métodos de Envío';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_241e84e8de91e9c6295063a40e46d175'] = 'Seleccione los métodos de envío que usted aceptará (Tienen que ser único para cada uno.)';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_89d1b3d4a7ffb1bda5a2f5104e5c9536'] = 'Envío terrestre';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_1ab6826e411df2c1c802305135824edf'] = 'Entrega al día siguiente';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_96e85eae3ebdf4f8bb77a5fa381745c5'] = 'Segundo día de entrega';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_569b506f9bc511a1b93035883f3d8f0a'] = 'Entrega internacional';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_23183cd144a4dcc5a599a4b6506f7154'] = 'Guardar opciones';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_ef87224bb79834a8b6e9180a6e9a850b'] = 'Limpiar registro';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_7c100dd5d4dc4f335c54fb59dbd2fb67'] = 'Actualizar Inventario';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_1936d6b9a73b24d6f49a7970d0310e8c'] = 'Inventario Shipwire';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_b4b449bf2a9925610b5ba0dfefeb78a9'] = 'Actualizar Transacciones';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_0af92eb536ec6c250e93a928acff6c42'] = 'Reenviar Transacciones Fallidas';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_d5a65aabf6965a9c075d869273d66b8c'] = 'Transacciones Shipwire';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_cd6ed4022793c016945dc5b9394467d6'] = 'Haga click aqui para reenviar la orden a Shipwire';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_e9d1630ae443a956bfff65409d479fe8'] = 'No hay transacciones disponibles.';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_f246ef453f4bf9f68366c9879964965c'] = 'Cronjob de Shipwire';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_54a0794ef5c2900f26b99596ba230c4f'] = 'Utilice el servicio web de PrestaShop para actualizar su inventario y estados de pedido. Ponga esta URL en el crontab (frecuencia sugerida: Cada 5 horas) o acceda de forma manual todos los días:';
|
||||
@@ -1,68 +0,0 @@
|
||||
<?php
|
||||
|
||||
global $_MODULE;
|
||||
$_MODULE = array();
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_e912562384b72ccc478a47019c553dc7'] = 'Shipwire';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_387ef38ac0cb1704e465d537ab8d690d'] = 'La logistique d\'entreprise pour tous';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_621db7652ee0cb6a53c8ca4ec683bae5'] = 'Non envoyé à Shipwire';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_485ed82930e1e53e6da27a11ccf2089b'] = 'Statut Shipwire';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_7ae1032125a8a684fba52b9b6c09ded0'] = 'Une erreur est survenue sur le serveur distant :';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_45d696d51dc4a18515658aeebddf4179'] = 'Une erreur inconnue est survenue avec la référence de la commande.';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_b5bccda6d3a04e1d8f79846355290435'] = 'Veuillez entrer une adresse email valide';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_76a8cba9f6f6ca77abe5dfb9e56ba994'] = 'Stock mis à jour';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_e1b21d2b3dae6a61b0937d9e5d483b3a'] = 'La mise à jour du stock a échoué';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_8d72a4c1a23232d68f7fc3c36bc1ed53'] = 'Les transactions ont été mises à jour';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_3fa1e76061af98ff1d61c688e2b5283a'] = 'La mise à jour des transactions a échoué';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_f4725a7b56d133e57f0ff8ccef7861f1'] = 'Commande correctement renvoyée';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_7ae3fd45db978dd817e1e023548009b1'] = 'Erreur pendant l\'envoi. Réessayez plus tard.';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_38af966ecd35842058e527c36f17e42f'] = 'Les transactions ont été correctement renvoyées.';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_db7972f220d257cc289fef03cbad3779'] = 'Erreur pendant le renvoi des transactions.';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_77ab0beb2c0eb88c3e6375d6355b42d7'] = 'Logs vides.';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_b8529249c5c02d3d62cedac39afcfd67'] = 'Erreur pendant la suppression des logs.';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_63a77eaf9f310dc5def6709c2887dcc4'] = 'Le test de connexion a échoué.';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_527fe8cddad7740fc09d02dbd718a8b8'] = 'Félicitations ! Votre boutique est maintenant liée à Shipwire.';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_c888438d14855d7d96a2724ee9c306bd'] = 'Les paramètres ont correctement été mis à jour.';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_6a26f548831e6a8c26bfbbd9f6ec61e0'] = 'Aide';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_de54437623a7b25ea277a303772e0912'] = 'Comment configurer le module Shipwire :';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_082efcf162e9fc2ce9cd32e13706790b'] = 'Remplir les champs \"Email\" et \"Mot de passe\" avec ceux fournis par Shipwire.';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_2a5075cb5b1148436ee37a1ef46e51a6'] = 'Cliquer sur \"Sauvegarder les paramètres\" puis sur \"Tester la connexion\"';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_727283f37d3e70d3faceb71761d0fb51'] = 'Avantages du module Shipwire :';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_5a2b02068a8824776581bf12ea9b84c0'] = 'La plate-forme logistique de Shipwire vous permet de réduire vos coûts de gestion logistique, augmenter vos ventes, et d\'offrir une excellente expérience d\'achat à vos clients.';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_fd78097435e14fb77cea008f89beb08a'] = 'Les entrepôts de Shipwire, répartis à travers le monde, vous permettent d\'atteindre davantage de clients plus rapidement - à un moindre coût.';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_cf628555f89cf93adc51e5a98f74406d'] = 'Quel que soit le volume de vos ventes, les entrepôts automatisés de Shipwire traitent vos commandes rapidement et avec précision, pour des clients satisfaits !';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_e8d3449d135b1840e2d5ca638f0d608f'] = 'Identifiants Shipwire';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_ce8ae9da5b7cd6c3df2929543a9af92d'] = 'Email';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_dc647eb65e6711e155375218212b3964'] = 'Mot de passe';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_9daf1fb753b42c3cdc8f1d01669cd6d8'] = 'Sauvegarder les paramètres';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_79ddd6cfbf01f63986f7b114ecc2ca95'] = 'Cliquer ici pour tester la connexion';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_8d47e6b887cacc0d7d48ce49f403cf7f'] = 'Shipwire et PrestaShop';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_989004cc8be1a096644202bcb9ed5111'] = 'En savoir plus sur Shipwire sur PrestaShop.com';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_dae8ace18bdcbcc6ae5aece263e14fe8'] = 'Options';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_858b7d4b9e6c0a1066c76b67492ebfc2'] = 'Statuts de commande qui intéragissent avec Shipwire';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_fda9efefff2479c9f299cf01757b0354'] = 'Quand un statut est mis à jour dans Shipwire, les statuts suivant seront appliqués sur la commande dans votre boutique PrestaShop.';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_004bf6c9a40003140292e97330236c53'] = 'Action';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_4bb3e6ea4b1aa93c3429e410129b4be4'] = 'Statut de commande dans votre boutique';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_20e85fb909bc0a3f5465e4847a421727'] = 'Envoyer la commande à Shipwire';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_f6aa2a9d2f9c62fcebed30a12718174e'] = 'Marquer la commande comme \"Envoyée\" dans votre boutique';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_b69c10301eb67f486f8c7b53ef297f3f'] = 'Marquer la commande comme \"Livrée\" dans votre boutique';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_5292f1fdc23e0772998728bfe960fafe'] = 'Sauvegarde des logs';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_e166edcc50bf23bd04a651f99af1e6a8'] = 'Supprimer l\'historique des transactions tous les';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_2c30957d90dbbb192712f11e183853cd'] = 'jours (recommandé : 30 jours)';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_8be66d7d19c88192adcbbe43ca7b5781'] = '-- Choisir --';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_af22fc80f66213750302086471651553'] = 'Méthodes d\'expédition';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_241e84e8de91e9c6295063a40e46d175'] = 'Choisir les méthodes d\'expédition que vous utilisez (une méthode ne peut être associée qu\'une fois)';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_89d1b3d4a7ffb1bda5a2f5104e5c9536'] = 'Transport terrestre';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_1ab6826e411df2c1c802305135824edf'] = 'Livraison le lendemain';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_96e85eae3ebdf4f8bb77a5fa381745c5'] = 'Livraison en 2 jours';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_569b506f9bc511a1b93035883f3d8f0a'] = 'Livraison internationnale';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_23183cd144a4dcc5a599a4b6506f7154'] = 'Sauvegarder les options';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_ef87224bb79834a8b6e9180a6e9a850b'] = 'Vider les logs';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_7c100dd5d4dc4f335c54fb59dbd2fb67'] = 'Mettre à jour le stock';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_1936d6b9a73b24d6f49a7970d0310e8c'] = 'Stock Shipwire';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_b4b449bf2a9925610b5ba0dfefeb78a9'] = 'Rafraîchir les transactions';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_0af92eb536ec6c250e93a928acff6c42'] = 'Renvoyer les transactions en erreur';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_d5a65aabf6965a9c075d869273d66b8c'] = 'Transactions Shipwire';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_cd6ed4022793c016945dc5b9394467d6'] = 'Cliquer ici pour renvoyer la commande à Shipwire';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_e9d1630ae443a956bfff65409d479fe8'] = 'Pas de transaction pour le moment';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_f246ef453f4bf9f68366c9879964965c'] = 'Tâche planifiée Shipwire';
|
||||
$_MODULE['<{shipwire}prestashop>shipwire_54a0794ef5c2900f26b99596ba230c4f'] = 'Utilisez le web-service de PrestaShop pour mettre à jour votre stock et le statut des commandes. Mettez cette URL dans la table des tâches planifiées (fréquence suggérée : toutes les 5 heures) ou accédez-y manuellement une fois par jour :';
|
||||
@@ -1,36 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2012 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Open Software License (OSL 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/osl-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-2012 PrestaShop SA
|
||||
* @version Release: $Revision: 14009 $
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 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;
|
||||
@@ -1,111 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2012 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-2012 PrestaShop SA
|
||||
* @version Release: $Revision: 1.4 $
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
/// @todo document and handle errors
|
||||
class SWCurl
|
||||
{
|
||||
/** @var _ch Curl Handler Resource */
|
||||
private $_ch;
|
||||
/** @var _url Url to call */
|
||||
private $_url;
|
||||
/** @var _lastResponse Last HTTP response fetched */
|
||||
private $_lastResponse;
|
||||
/** @var _params Array containing data for Methods */
|
||||
private $_params;
|
||||
|
||||
public function __construct($url = null, $sslCheck = true)
|
||||
{
|
||||
$this->_ch = curl_init();
|
||||
$this->_url = $url;
|
||||
/* $this->_setOpt(CURLOPT_HEADER, true); */
|
||||
/* $this->_setOpt(CURLINFO_HEADER_OUT, true); */
|
||||
$this->_setOpt(CURLOPT_RETURNTRANSFER, true);
|
||||
if (!$sslCheck)
|
||||
$this->_setOpt(CURLOPT_SSL_VERIFYPEER, false);
|
||||
}
|
||||
|
||||
public function __destruct()
|
||||
{
|
||||
curl_close($this->_ch);
|
||||
}
|
||||
|
||||
private function _setOpt($flag, $value)
|
||||
{
|
||||
curl_setopt($this->_ch, $flag, $value);
|
||||
}
|
||||
|
||||
public function setPostMethod(Array $params)
|
||||
{
|
||||
$this->_params['POST'] = http_build_query($params);
|
||||
curl_setopt($this->_ch, CURLOPT_POST, true);
|
||||
curl_setopt($this->_ch, CURLOPT_POSTFIELDS, $this->_params['POST']);
|
||||
}
|
||||
|
||||
public function setCustomPost($paramString)
|
||||
{
|
||||
curl_setopt($this->_ch, CURLOPT_POST, true);
|
||||
curl_setopt($this->_ch, CURLOPT_POSTFIELDS, $paramString);
|
||||
$this->_params['POST'] = $paramString;
|
||||
}
|
||||
|
||||
public function setHttpHeader(Array $headers)
|
||||
{
|
||||
curl_setopt($this->_ch, CURLOPT_HTTPHEADER, $headers);
|
||||
}
|
||||
|
||||
public function setGetParams(Array $params)
|
||||
{
|
||||
$this->_params['GET'] = http_build_query($params);
|
||||
}
|
||||
|
||||
public function send($url = null)
|
||||
{
|
||||
if (!$url)
|
||||
$url = $this->_url;
|
||||
if (!$url)
|
||||
return false;
|
||||
|
||||
if (isset($this->_params['GET']))
|
||||
$url .= '?'.$this->_params['GET'];
|
||||
|
||||
curl_setopt($this->_ch, CURLOPT_URL, $url);
|
||||
$this->_lastResponse = curl_exec($this->_ch);
|
||||
|
||||
if ($this->_lastResponse === false)
|
||||
{
|
||||
trigger_error('Curl error: '.curl_error($this->_ch), E_USER_WARNING);
|
||||
return false;
|
||||
}
|
||||
|
||||
return $this->_lastResponse;
|
||||
}
|
||||
|
||||
public function getLastResponse()
|
||||
{
|
||||
return $this->_lastResponse;
|
||||
}
|
||||
}
|
||||
@@ -1,133 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2012 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-2012 PrestaShop SA
|
||||
* @version Release: $Revision: 1.4 $
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
/* Security */
|
||||
if (!defined('_PS_VERSION_'))
|
||||
exit;
|
||||
|
||||
class ShipwireApi
|
||||
{
|
||||
protected $_configVars = array(
|
||||
'SHIPWIRE_API_SERVER' => '',
|
||||
'SHIPWIRE_API_USER' => '',
|
||||
'SHIPWIRE_API_PASSWD' => '',
|
||||
'SHIPWIRE_API_CONNECTED' => '',
|
||||
'SHIPWIRE_API_MODE' => '',
|
||||
'SHIPWIRE_WAREHOUSE' => '',
|
||||
'SHIPWIRE_ACCOUNT_NAME' => '',
|
||||
'SHIPWIRE_TRACKING_LAST_DATE' => '',
|
||||
'SHIPWIRE_COMMIT_ID' => '',
|
||||
'SHIPWIRE_SENT_ID' => '',
|
||||
'SHIPWIRE_DELIVERED_ID' => '',
|
||||
);
|
||||
|
||||
/** @var _xml Array with header body and footer of the final xml */
|
||||
public $_xml = array();
|
||||
|
||||
/** @var _mode Sets the connection mode: Test | Production */
|
||||
protected $_mode = 'Production';
|
||||
|
||||
/** @var _urlConn URL to connect to at Shipwire's end */
|
||||
|
||||
protected $_url = array(
|
||||
'inventoryUpdate' => array(
|
||||
'Test' => 'https://api.beta.shipwire.com/exec/InventoryServices.php',
|
||||
'Production' => 'https://api.shipwire.com/exec/InventoryServices.php',
|
||||
'prefix' => 'InventoryUpdateXML',
|
||||
),
|
||||
'fulfillmentServices' => array(
|
||||
'Test' => 'https://api.beta.shipwire.com/exec/FulfillmentServices.php',
|
||||
'Production' => 'https://api.shipwire.com/exec/FulfillmentServices.php',
|
||||
'prefix' => 'OrderListXML',
|
||||
),
|
||||
'trackingUpdate' => array(
|
||||
'Test' => 'https://api.beta.shipwire.com/exec/TrackingServices.php',
|
||||
'Production' => 'https://api.shipwire.com/exec/TrackingServices.php',
|
||||
'prefix' => 'TrackingUpdateXML',
|
||||
),
|
||||
);
|
||||
|
||||
// protected $_url = array(
|
||||
// 'inventoryUpdate' => array(
|
||||
// 'Test' => 'https://api.beta.shipwire.com/exec/InventoryServices.php',
|
||||
// 'Production' => 'https://api.beta.shipwire.com/exec/InventoryServices.php',
|
||||
// 'prefix' => 'InventoryUpdateXML',
|
||||
// ),
|
||||
// 'fulfillmentServices' => array(
|
||||
// 'Test' => 'https://api.beta.shipwire.com/exec/FulfillmentServices.php',
|
||||
// 'Production' => 'https://api.beta.shipwire.com/exec/FulfillmentServices.php',
|
||||
// 'prefix' => 'OrderListXML',
|
||||
// ),
|
||||
// 'trackingUpdate' => array(
|
||||
// 'Test' => 'https://api.beta.shipwire.com/exec/TrackingServices.php',
|
||||
// 'Production' => 'https://api.beta.shipwire.com/exec/TrackingServices.php',
|
||||
// 'prefix' => 'TrackingUpdateXML',
|
||||
// ),
|
||||
// );
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
foreach ($this->_configVars as $key => $v)
|
||||
$this->_configVars[$key] = Configuration::get($key);
|
||||
|
||||
if (Configuration::get('PS_CIPHER_ALGORITHM'))
|
||||
$this->_cipherTool = new Rijndael(_RIJNDAEL_KEY_, _RIJNDAEL_IV_);
|
||||
else
|
||||
$this->_cipherTool = new Blowfish(_COOKIE_KEY_, _COOKIE_IV_);
|
||||
|
||||
$this->_configVars['SHIPWIRE_API_PASSWD'] = Tools::safeOutput($this->_cipherTool->decrypt($this->_configVars['SHIPWIRE_API_PASSWD']));
|
||||
$this->_configVars['SHIPWIRE_API_MODE'] = $this->_mode;
|
||||
}
|
||||
|
||||
public function sendData($xmlTagFields = array())
|
||||
{
|
||||
$xmlDocument = $this->_buildXMLDoc();
|
||||
|
||||
$urlConn = new SWCurl($this->_url[$this->_apiType][$this->_mode], false);
|
||||
$urlConn->setCustomPost($this->_url[$this->_apiType]['prefix'].'='.urlencode($xmlDocument));
|
||||
|
||||
$action = $urlConn->send();
|
||||
|
||||
$xml = simplexml_load_string($urlConn->getLastResponse());
|
||||
$json = json_encode($xml);
|
||||
|
||||
return json_decode($json,TRUE);
|
||||
}
|
||||
|
||||
private function _buildXMLDoc()
|
||||
{
|
||||
$xmlDocument = '';
|
||||
foreach ($this->_xml['header'] as $header)
|
||||
$xmlDocument .= $header;
|
||||
foreach ($this->_xml['body'] as $body)
|
||||
$xmlDocument .= $body;
|
||||
foreach ($this->_xml['footer'] as $footer)
|
||||
$xmlDocument .= $footer;
|
||||
|
||||
return $xmlDocument;
|
||||
}
|
||||
}
|
||||
@@ -1,61 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2012 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-2012 PrestaShop SA
|
||||
* @version Release: $Revision: 1.4 $
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
/* Security */
|
||||
if (!defined('_PS_VERSION_'))
|
||||
exit;
|
||||
|
||||
class ShipwireInventoryUpdate extends ShipwireApi
|
||||
{
|
||||
protected $_apiType = 'inventoryUpdate';
|
||||
|
||||
public function __construct($apiUser, $apiPasswd)
|
||||
{
|
||||
$this->_xml['header'][] =
|
||||
'<InventoryUpdate>'.
|
||||
'<EmailAddress>'.$apiUser.'</EmailAddress>'.
|
||||
'<Password>'.$apiPasswd.'</Password>'.
|
||||
'<Server>'.$this->_configVars['SHIPWIRE_API_MODE'].'</Server>'.
|
||||
'<AffiliateId>7403</AffiliateId>'.
|
||||
'<Warehouse></Warehouse>
|
||||
<ProductCode></ProductCode>
|
||||
<IncludeEmpty/>';
|
||||
|
||||
$this->_xml['body'][] = '';
|
||||
$this->_xml['footer'][] = '</InventoryUpdate>';
|
||||
}
|
||||
|
||||
public function getInventory($field = NULL)
|
||||
{
|
||||
$result = $this->sendData();
|
||||
|
||||
if (!empty($field) && isset($result[$field]))
|
||||
$result = $result[$field];
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
@@ -1,91 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2012 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-2012 PrestaShop SA
|
||||
* @version Release: $Revision: 1.4 $
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
/* Security */
|
||||
if (!defined('_PS_VERSION_'))
|
||||
exit;
|
||||
|
||||
class ShipwireOrder extends ShipwireApi
|
||||
{
|
||||
protected $_apiType = 'fulfillmentServices';
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
$this->_configVars['SHIPWIRE_ACCOUNT_NAME'] = '';
|
||||
|
||||
$this->_xml['header'] = array(
|
||||
'<OrderList>',// StorAccountName="'.$this->_configVars['SHIPWIRE_ACCOUNT_NAME'].'">',
|
||||
'<Username>'.$this->_configVars['SHIPWIRE_API_USER'].'</Username>',
|
||||
'<Password>'.$this->_configVars['SHIPWIRE_API_PASSWD'].'</Password>',
|
||||
'<Server>'.$this->_configVars['SHIPWIRE_API_MODE'].'</Server>',
|
||||
'<AffiliateId>7403</AffiliateId>',
|
||||
);
|
||||
$this->_xml['body'][] = '';
|
||||
$this->_xml['footer'][] = '</OrderList>';
|
||||
}
|
||||
|
||||
public function addOrder($values, $refresh = false)
|
||||
{
|
||||
foreach ($values as &$v)
|
||||
if (!empty($v) && !is_array($v))
|
||||
$v = pSQL($v);
|
||||
|
||||
if (!$refresh)
|
||||
$this->_xml['body'] = array(
|
||||
'<Order id="'.$values['orderId'].'">',
|
||||
'<Warehouse>'.$this->_configVars['SHIPWIRE_WAREHOUSE'].'</Warehouse>',
|
||||
// '<SameDay>'.$values['sameDay'].'</SameDay>',
|
||||
'<AddressInfo type="ship">',
|
||||
'<Name><Full>'.$values['name'].'</Full></Name>',
|
||||
'<Address1>'.$values['address1'].'</Address1>',
|
||||
'<Address2>'.$values['address2'].'</Address2>',
|
||||
'<City>'.$values['city'].'</City>',
|
||||
'<Country>'.$values['country'].'</Country>',
|
||||
'<Zip>'.$values['zip'].'</Zip>',
|
||||
'<Phone>'.$values['phone'].'</Phone>',
|
||||
'<Email>'.$values['mail'].'</Email>',
|
||||
'</AddressInfo>',
|
||||
'<Shipping>'.$values['shippingType'].'</Shipping>',
|
||||
);
|
||||
else
|
||||
$this->_xml['body'] = array('<Order id="'.(int)$values['orderId'].'">');
|
||||
|
||||
$i = 0;
|
||||
foreach ($values['packageList'] as $item)
|
||||
{
|
||||
$this->_xml['body'][] = '<Item num="'.($i++).'">';
|
||||
$this->_xml['body'][] = '<Code>'.$item['code'].'</Code>';
|
||||
$this->_xml['body'][] = '<Quantity>'.$item['quantity'].'</Quantity>';
|
||||
$this->_xml['body'][] = '</Item>';
|
||||
}
|
||||
|
||||
$this->_xml['body'][] = '</Order>';
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,188 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2012 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-2012 PrestaShop SA
|
||||
* @version Release: $Revision: 1.4 $
|
||||
* @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_'))
|
||||
require(dirname(__FILE__).'/../../../config/config.inc.php');
|
||||
|
||||
if (!class_exists('Shipwire'))
|
||||
require(dirname(__FILE__).'/../shipwire.php');
|
||||
|
||||
class ShipwireTracking extends ShipwireApi
|
||||
{
|
||||
protected $_apiType = 'trackingUpdate';
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
$this->_configVars['SHIPWIRE_ACCOUNT_NAME'] = '';
|
||||
|
||||
$this->_xml['header'] = array(
|
||||
'<TrackingUpdate>',
|
||||
'<Username>'.$this->_configVars['SHIPWIRE_API_USER'].'</Username>',
|
||||
'<Password>'.$this->_configVars['SHIPWIRE_API_PASSWD'].'</Password>',
|
||||
'<Server>'.$this->_configVars['SHIPWIRE_API_MODE'].'</Server>',
|
||||
'<AffiliateId>7403</AffiliateId>',
|
||||
);
|
||||
$this->_xml['body'] = array();
|
||||
$this->_xml['footer'][] = '</TrackingUpdate>';
|
||||
}
|
||||
|
||||
public function retrieveFromTransacId($transactionId)
|
||||
{
|
||||
$this->_xml['body'][] = '<ShipwireId>'.pSQL($transactionId).'</ShipwireId>';
|
||||
}
|
||||
|
||||
public function retrieveFromOrderId($orderId)
|
||||
{
|
||||
$this->_xml['body'][] = '<OrderNo>'.pSQL($orderId).'</OrderNo>';
|
||||
}
|
||||
|
||||
public function retrieveFull()
|
||||
{
|
||||
$this->_xml['body'][] = '<Bookmark>1</Bookmark>';
|
||||
}
|
||||
|
||||
public function retrieveNew()
|
||||
{
|
||||
$this->_xml['body'][] = '<Bookmark>3</Bookmark>';
|
||||
}
|
||||
|
||||
/*
|
||||
* @brief Updates tracking info in local database.
|
||||
* Declared as a static method so shipwire.php can access it thru autoload
|
||||
*/
|
||||
public static function updateTracking($static = false)
|
||||
{
|
||||
return updateTracking($static);
|
||||
}
|
||||
}
|
||||
|
||||
function updateTracking($static = false)
|
||||
{
|
||||
$api = new ShipwireTracking();
|
||||
$api->retrieveFull();
|
||||
$d = $api->sendData();
|
||||
|
||||
if ($d['Status'])
|
||||
if ($static)
|
||||
return false;
|
||||
else
|
||||
die('KO');
|
||||
|
||||
if ($d['TotalOrders'] > 0)
|
||||
{
|
||||
foreach ($d['Order'] as $order)
|
||||
{
|
||||
$o = array();
|
||||
if (isset($order['@attributes']))
|
||||
$o = $order['@attributes'];
|
||||
|
||||
if (!isset($o['id']))
|
||||
{
|
||||
Logger::addLog('Shipwire: Order ID not defined. >>>>'.print_r($d, true).'<<<<', 4);
|
||||
continue;
|
||||
}
|
||||
|
||||
$orderExists = Db::getInstance()->ExecuteS('SELECT `id_order`
|
||||
FROM `'._DB_PREFIX_.'shipwire_order`
|
||||
WHERE `id_order` = '.(int)$o['id'].' LIMIT 1');
|
||||
|
||||
if (isset($orderExists[0]['id_order']) && !empty($orderExists[0]['id_order']))
|
||||
{
|
||||
Db::getInstance()->Execute('UPDATE `'._DB_PREFIX_.'shipwire_order` SET '
|
||||
.(isset($order['TrackingNumber']) ? '`tracking_number` = \''.pSQL($order['TrackingNumber']).'\',' : '')
|
||||
.(isset($o['shipped']) ? '`shipped` = \''.pSQL($o['shipped']).'\'' : '')
|
||||
.(isset($o['shipper']) ? ',`shipper` = \''.pSQL($o['shipper']).'\'' : '')
|
||||
.(isset($o['shipDate']) ? ',`shipDate` = \''.pSQL($o['shipDate']).'\'' : '')
|
||||
.(isset($o['expectedDeliveryDate']) ? ',`expectedDeliveryDate` = \''.pSQL($o['expectedDeliveryDate']).'\'' : '')
|
||||
.(isset($o['href']) ? ',`href` = \''.pSQL($o['href']).'\'' : '')
|
||||
.(isset($o['shipperFullName']) ? ',`shipperFullName` = \''.pSQL($o['shipperFullName']).'\'' : '')
|
||||
.' WHERE `id_order` = '.(int)$o['id']);
|
||||
}
|
||||
else
|
||||
{
|
||||
Db::getInstance()->Execute('INSERT INTO `'._DB_PREFIX_.'shipwire_order`
|
||||
(`id_order`, `tracking_number`, `shipped`, `shipper`, `shipDate`, `expectedDeliveryDate`, `href`, `shipperFullName`)
|
||||
VALUES (
|
||||
\''.pSQL($o['id']).'\''
|
||||
.(isset($order['TrackingNumber']) ? ',\''.pSQL($order['TrackingNumber']).'\'' : ',\'\'')
|
||||
.(isset($o['shipped']) ? ',\''.pSQL($o['shipped']).'\'' : ',\'\'')
|
||||
.(isset($o['shipper']) ? ',\''.pSQL($o['shipper']).'\'' : ',\'\'')
|
||||
.(isset($o['shipDate']) ? ',\''.pSQL($o['shipDate']).'\'' : ',\'\'')
|
||||
.(isset($o['expectedDeliveryDate']) ? ',\''.pSQL($o['expectedDeliveryDate']).'\'' : ',\'\'')
|
||||
.(isset($o['href']) ? ',\''.pSQL($o['href']).'\'' : ',\'\'')
|
||||
.(isset($o['shipperFullName']) ? ',\''.pSQL($o['shipperFullName']).'\'' : ',\'\'')
|
||||
.')');
|
||||
}
|
||||
|
||||
$result = Db::getInstance()->getValue('SELECT `transaction_ref`
|
||||
FROM `'._DB_PREFIX_.'shipwire_order`
|
||||
WHERE `id_order` = '.(int)$o['id']);
|
||||
if (empty($result))
|
||||
{
|
||||
$module = new Shipwire();
|
||||
$module->updateOrderStatus((int)$o['id'], true);
|
||||
}
|
||||
|
||||
if (isset($order['TrackingNumber']))
|
||||
{
|
||||
Db::getInstance()->Execute('UPDATE `'._DB_PREFIX_.'orders`
|
||||
SET `shipping_number` = \''.pSQL($order['TrackingNumber']).'\'
|
||||
WHERE `id_order` = '.(int)$o['id']);
|
||||
if ($o['id'])
|
||||
{
|
||||
$psOrder = new Order($o['id']);
|
||||
if ($psOrder->id)
|
||||
{
|
||||
$history = new OrderHistory();
|
||||
$history->id_order = $o['id'];
|
||||
if (isset($o['shipped']) && $o['shipped'] == 'YES')
|
||||
$history->changeIdOrderState(Configuration::get('SHIPWIRE_SENT_ID'), $o['id']);
|
||||
|
||||
$history->addWithemail();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (Configuration::get('PS_CIPHER_ALGORITHM'))
|
||||
$cipherTool = new Rijndael(_RIJNDAEL_KEY_, _RIJNDAEL_IV_);
|
||||
else
|
||||
$cipherTool = new Blowfish(_COOKIE_KEY_, _COOKIE_IV_);
|
||||
|
||||
$shipWireInventoryUpdate = new ShipwireInventoryUpdate(Configuration::get('SHIPWIRE_API_USER'),
|
||||
$cipherTool->decrypt(Configuration::get('SHIPWIRE_API_PASSWD')));
|
||||
$shipWireInventoryUpdate->getInventory();
|
||||
|
||||
if ($static)
|
||||
return true;
|
||||
else
|
||||
die('OK');
|
||||
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2012 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Open Software License (OSL 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/osl-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-2012 PrestaShop SA
|
||||
* @version Release: $Revision: 14009 $
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 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;
|
||||
|
Before Width: | Height: | Size: 162 B |
@@ -1,956 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2012 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-2012 PrestaShop SA
|
||||
* @version Release: $Revision: 1.4 $
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
/* Security */
|
||||
if (!defined('_PS_VERSION_'))
|
||||
exit;
|
||||
|
||||
spl_autoload_register('shipwireAutoload');
|
||||
|
||||
class Shipwire extends Module
|
||||
{
|
||||
/** @var _cipherTool Helper Object to encrypt API KEY */
|
||||
private $_cipherTool;
|
||||
|
||||
/** @var dParams Array replacing smarty (display parameters) */
|
||||
private $dParams = array();
|
||||
|
||||
/** @const _SHIPWIRE_SERVER Shipwire server url */
|
||||
private $_configVars = array(
|
||||
'SHIPWIRE_API_SERVER' => '',
|
||||
'SHIPWIRE_API_USER' => '',
|
||||
'SHIPWIRE_API_PASSWD' => '',
|
||||
'SHIPWIRE_API_CONNECTED' => '',
|
||||
'SHIPWIRE_API_MODE' => '',
|
||||
'SHIPWIRE_WAREHOUSE' => '',
|
||||
'SHIPWIRE_ACCOUNT_NAME' => '',
|
||||
'SHIPWIRE_TRACKING_LAST_DATE' => '',
|
||||
'SHIPWIRE_COMMIT_ID' => '',
|
||||
'SHIPWIRE_SENT_ID' => '',
|
||||
'SHIPWIRE_DELIVERED_ID' => '',
|
||||
);
|
||||
|
||||
/** @var _shipWireInventoryUpdate Shipwire Api Object */
|
||||
private $_shipWireInventoryUpdate;
|
||||
|
||||
/******************************************************************/
|
||||
/** Construct Method **********************************************/
|
||||
/******************************************************************/
|
||||
public function __construct()
|
||||
{
|
||||
$this->_initContext();
|
||||
|
||||
$this->name = 'shipwire';
|
||||
$this->tab = 'administration';
|
||||
$this->version = '1.1.3';
|
||||
$this->author = 'PrestaShop';
|
||||
|
||||
parent::__construct();
|
||||
|
||||
$this->displayName = $this->l('Shipwire');
|
||||
$this->description = $this->l('Enterprise logistics for everyone.');
|
||||
|
||||
if (Configuration::get('PS_CIPHER_ALGORITHM'))
|
||||
$this->_cipherTool = new Rijndael(_RIJNDAEL_KEY_, _RIJNDAEL_IV_);
|
||||
else
|
||||
$this->_cipherTool = new Blowfish(_COOKIE_KEY_, _COOKIE_IV_);
|
||||
|
||||
$this->_shipWireInventoryUpdate = new ShipwireInventoryUpdate(Configuration::get('SHIPWIRE_API_USER'), $this->_cipherTool->decrypt(Configuration::get('SHIPWIRE_API_PASSWD')));
|
||||
$this->_shipWireOrder = new ShipwireOrder();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Make the module compatible 1.4/1.5
|
||||
*/
|
||||
private function _initContext()
|
||||
{
|
||||
$this->dParams['base_dir'] = __PS_BASE_URI__;
|
||||
|
||||
if (class_exists('Context') && function_exists('getContent'))
|
||||
$this->context = Context::getContent();
|
||||
else
|
||||
{
|
||||
global $smarty, $cookie;
|
||||
|
||||
$this->context = new StdClass();
|
||||
$this->context->smarty = $smarty;
|
||||
$this->context->cookie = $cookie;
|
||||
$this->context->shop = new StdClass();
|
||||
$this->context->shop->id = 1;
|
||||
$this->context->shop->id_group_shop = 1;
|
||||
}
|
||||
|
||||
$this->_loadConfiguration();
|
||||
}
|
||||
|
||||
private function _loadConfiguration()
|
||||
{
|
||||
foreach ($this->_configVars as $key => $v)
|
||||
$this->_configVars[$key] = Configuration::get($key);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Install/Uninstall Configuration variables
|
||||
*
|
||||
* @param install True for installation, false for uninstall
|
||||
*
|
||||
* @return Success or failure
|
||||
*/
|
||||
private function _setupConfigVariables($install = true)
|
||||
{
|
||||
$configVars = array(
|
||||
'SHIPWIRE_API_SERVER' => '',
|
||||
'SHIPWIRE_API_USER' => '',
|
||||
'SHIPWIRE_API_PASSWD' => '',
|
||||
'SHIPWIRE_API_CONNECTED' => 0,
|
||||
'SHIPWIRE_ACCOUNT_NAME' => '',
|
||||
'SHIPWIRE_API_MODE' => 'Test',
|
||||
'SHIPWIRE_WAREHOUSE' => '00',
|
||||
'SHIPWIRE_TRACKING_LAST_DATE' => 0,
|
||||
'SHIPWIRE_COMMIT_ID' => 2,
|
||||
'SHIPWIRE_SENT_ID' => 4,
|
||||
'SHIPWIRE_DELIVERED_ID' => 5,
|
||||
'SHIPWIRE_LOG_LIFE' => 10,
|
||||
);
|
||||
|
||||
$error = 0;
|
||||
foreach ($configVars as $varName => $value)
|
||||
if ($install)
|
||||
$error += Configuration::updateValue($varName, $value) ? 0 : 1;
|
||||
else
|
||||
$error += Configuration::deleteByName($varName) ? 0 : 1;
|
||||
|
||||
return !$error;
|
||||
}
|
||||
|
||||
/******************************************************************/
|
||||
/** Install / Uninstall Methods ***********************************/
|
||||
/******************************************************************/
|
||||
public function install()
|
||||
{
|
||||
// Setup config variable with 'install' flag on
|
||||
if (!$this->_setupConfigVariables(true))
|
||||
return false;
|
||||
|
||||
if (!parent::install() || !$this->registerHook('backOfficeTop') || !$this->registerHook('updateOrderStatus'))
|
||||
return false;
|
||||
|
||||
// Perform the sql install
|
||||
include(dirname(__FILE__).'/sql/sql-install.php');
|
||||
foreach ($sql as $s)
|
||||
if (!Db::getInstance()->Execute($s))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Uninstall function
|
||||
*
|
||||
* @return Success or failure
|
||||
*/
|
||||
public function uninstall()
|
||||
{
|
||||
// Uninstall parent and unregister Configuration
|
||||
if (!parent::uninstall())
|
||||
return false;
|
||||
|
||||
// Unregister hook
|
||||
if (!$this->unregisterHook('backOfficeTop') || !$this->unregisterHook('updateOrderStatus'))
|
||||
return false;
|
||||
|
||||
// Remove configuration variable with 'install' flag off
|
||||
if (!$this->_setupConfigVariables(false))
|
||||
return false;
|
||||
|
||||
// Uninstall SQL
|
||||
include(dirname(__FILE__).'/sql/sql-uninstall.php');
|
||||
foreach ($sql as $s)
|
||||
if (!Db::getInstance()->Execute($s))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief hookBackOfficeTop Implementation.
|
||||
*
|
||||
* Hook that allow to add script anywhere in the backoffice.
|
||||
*
|
||||
* @return Render to display
|
||||
*/
|
||||
public function hookBackOfficeTop()
|
||||
{
|
||||
$r = array();
|
||||
if (isset($_GET['id_order']))
|
||||
$r = Db::getInstance()->ExecuteS('SELECT `id_order`, `transaction_ref`, `order_ref`, `status`
|
||||
FROM `'._DB_PREFIX_.'shipwire_order`
|
||||
WHERE `id_order` = '.(int)$_GET['id_order']);
|
||||
|
||||
$status = isset($r[0]['status']) && !empty($r[0]['status']) ? ucfirst($r[0]['status']) : $this->l('Not sent to Shipwire.');
|
||||
|
||||
echo '
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
/* Add Shipwire fieldset to Order Details page */
|
||||
html = \'<br /><br /><fieldset>\' +
|
||||
\'<legend><img src="'.$this->_path.'logo.gif" alt="">'.$this->l('Shipwire Status').'</legend>\' +
|
||||
\'<b>Status:</b> '.Tools::safeOutput($status).'\' +
|
||||
\'</fieldset>\';
|
||||
|
||||
if ($(\'#content select[name="id_order_state"]\').size())
|
||||
$(\'#content div:eq(3)\').append(html);
|
||||
|
||||
$(\'.link-submit-form\').click(function(){
|
||||
$(this).parent(\'form\').submit();
|
||||
});
|
||||
|
||||
/* jExcerpt v1.1 */
|
||||
length = 20;
|
||||
$(\'.jexcerpt\').each(function(){
|
||||
if ($(this).text().length > length)
|
||||
{
|
||||
// Create the .jexcerpt-long
|
||||
$(\'<div class="jexcerpt-long">\' + $(this).text() + \'</div>\').appendTo($(this).parent());
|
||||
|
||||
excerpt = $(this).text().substring(0, length);
|
||||
$(this).text(excerpt + \'...\');
|
||||
}
|
||||
});
|
||||
|
||||
$(\'.jexcerpt\').mouseover(function(){
|
||||
$(\'.jexcerpt-long\').hide();
|
||||
$(this).parent().attr(\'width\', $(this).parent().width());
|
||||
$(this).parent().find(\'.jexcerpt-long\')
|
||||
.css(\'left\', $(this).parent().offset().left)
|
||||
.css(\'top\', $(this).parent().offset().top)
|
||||
.show();
|
||||
});
|
||||
|
||||
$(\'.jexcerpt-long\').live(\'mouseout\', function(){
|
||||
$(this).parent().find(\'.jexcerpt\').show();
|
||||
$(this).hide();
|
||||
});
|
||||
});
|
||||
</script>';
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief hookUpdateOrderStatus Implementation.
|
||||
*
|
||||
* @return ?
|
||||
*/
|
||||
public function hookUpdateOrderStatus($params)
|
||||
{
|
||||
$orderStatusId = $params['newOrderStatus']->id;
|
||||
|
||||
// We check the orderstatus
|
||||
if ($orderStatusId != $this->_configVars['SHIPWIRE_COMMIT_ID'])
|
||||
return false;
|
||||
|
||||
// Check that the order was not already commited to Shipwire
|
||||
$r = Db::getInstance()->ExecuteS('SELECT `id_order`, `transaction_ref`, `order_ref`, `status`
|
||||
FROM `'._DB_PREFIX_.'shipwire_order`
|
||||
WHERE `id_order` = '.(int)$params['id_order']);
|
||||
if (!(isset($r[0]['transaction_ref']) && !empty($r[0]['transaction_ref'])))
|
||||
{
|
||||
$this->updateOrderStatus($params['id_order']);
|
||||
ShipwireTracking::updateTracking(true);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public function updateOrderStatus($idOrder, $refresh = false)
|
||||
{
|
||||
$order = new Order($idOrder);
|
||||
if (!$order->id)
|
||||
return false;
|
||||
|
||||
$address = new Address($order->id_address_delivery);
|
||||
$customer = new Customer($order->id_customer);
|
||||
$carrier = new Carrier($order->id_carrier);
|
||||
$cart = new Cart($order->id_cart);
|
||||
|
||||
$products = $cart->getProducts();
|
||||
|
||||
$packageList = array();
|
||||
foreach ($products as $product)
|
||||
{
|
||||
$packageList[] = array(
|
||||
'code' => (!empty($product['reference']) ? pSQL($product['reference']) : (int)$product['id_product_attribute']), // SKU
|
||||
'quantity' => (int)$product['cart_quantity'],
|
||||
);
|
||||
}
|
||||
|
||||
switch ($order->id_carrier)
|
||||
{
|
||||
default:
|
||||
case Configuration::get('SHIPWIRE_GD') :
|
||||
$shippingType = 'GD';
|
||||
break;
|
||||
case Configuration::get('SHIPWIRE_1D') :
|
||||
$shippingType = '1D';
|
||||
break;
|
||||
case Configuration::get('SHIPWIRE_2D') :
|
||||
$shippingType = '2D';
|
||||
break;
|
||||
case Configuration::get('SHIPWIRE_INTL') :
|
||||
$shippingType = 'INTL';
|
||||
break;
|
||||
}
|
||||
|
||||
$this->_shipWireOrder->addOrder(array(
|
||||
'orderId' => $order->id,
|
||||
'name' => $customer->firstname.'.'.$customer->lastname,
|
||||
'address1' => $address->address1,
|
||||
'address2' => $address->address2,
|
||||
'city' => $address->city,
|
||||
'country' => $address->country,
|
||||
'zip' => $address->postcode,
|
||||
'phone' => $address->phone,
|
||||
'mail' => $customer->email,
|
||||
'shippingType' => $shippingType,
|
||||
'packageList' => $packageList,
|
||||
), $refresh);
|
||||
|
||||
$r = $this->_shipWireOrder->sendData();
|
||||
|
||||
if ($r['Status'])
|
||||
$this->_displayConfirmation($this->l('An error occured on the remote server: ').$r['ErrorMessage'], 'error');
|
||||
|
||||
foreach ($r['OrderInformation'] as $o)
|
||||
{
|
||||
if ($o['@attributes']['number'] != $order->id)
|
||||
$this->_displayConfirmation($this->l('An unkown error occured with order Id.'), 'error');
|
||||
//$val = Db::getInstance()->getValue('SELECT `transaction_ref` FROM `'._DB_PREFIX_.'shipwire_order` WHERE `id_order` = '.(int)$order->id);
|
||||
|
||||
$orderExists = Db::getInstance()->ExecuteS('SELECT `id_order` FROM `'._DB_PREFIX_.'shipwire_order` WHERE `id_order` = '.(int)$order->id.' LIMIT 1');
|
||||
if (isset($orderExists[0]['id_order']) && !empty($orderExists[0]['id_order']))
|
||||
{
|
||||
Db::getInstance()->Execute('UPDATE `'._DB_PREFIX_.'shipwire_order`
|
||||
SET `transaction_ref` = \''.pSQL($o['@attributes']['id']).'\',
|
||||
`order_ref` = \''.pSQL($o['@attributes']['number']).'\',
|
||||
`status` = \''.pSQL($o['@attributes']['status']).'\'
|
||||
WHERE `id_order` = '.(int)$order->id);
|
||||
}
|
||||
else
|
||||
{
|
||||
Db::getInstance()->Execute('INSERT INTO `'._DB_PREFIX_.'shipwire_order`
|
||||
(`id_order`, `transaction_ref`, `status`)
|
||||
VALUES (
|
||||
\''.pSQL($order->id).'\''
|
||||
.(isset($o['id']) ? ',\''.pSQL($o['id']).'\'' : ',\'\'')
|
||||
.(isset($o['status']) ? ',\''.pSQL($o['status']).'\'' : ',\'\'')
|
||||
.')');
|
||||
}
|
||||
$this->log((int)$order->id, $o['@attributes']['id']);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Empty all tables of the module.
|
||||
*/
|
||||
private function _clearTables()
|
||||
{
|
||||
/// @todo : check if this method is used
|
||||
if (!Db::getInstance()->Execute('TRUNCATE `'._DB_PREFIX_.'shipwire_order`') ||
|
||||
Db::getInstance()->Execute('TRUNCATE `'._DB_PREFIX_.'shipwire_stock`'))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Main Form Method
|
||||
*
|
||||
* @return Rendered form
|
||||
*/
|
||||
public function getContent()
|
||||
{
|
||||
if (Tools::isSubmit('SubmitShipwireSettings'))
|
||||
{
|
||||
if (Validate::isEmail(Tools::getValue('shipwire_api_user')))
|
||||
{
|
||||
Configuration::updateValue('SHIPWIRE_API_CONNECTED', 0);
|
||||
Configuration::updateValue('SHIPWIRE_API_USER',
|
||||
Tools::getValue('shipwire_api_user'));
|
||||
Configuration::updateValue('SHIPWIRE_API_PASSWD',
|
||||
$this->_cipherTool->encrypt(Tools::getValue('shipwire_api_passwd')));
|
||||
|
||||
$this->dParams['confirmMessage'] = $this->_displayConfirmation();
|
||||
Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'shipwire_order`');
|
||||
Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'shipwire_stock`');
|
||||
}
|
||||
else
|
||||
$this->dParams['confirmMessage'] = $this->_displayConfirmation($this->l('Please enter a valid email address.'), 'error');
|
||||
}
|
||||
elseif (Tools::isSubmit('SubmitShipwireTestConnection'))
|
||||
{
|
||||
$connectionTestResult = $this->_testConnection();
|
||||
}
|
||||
elseif (Tools::isSubmit('SubmitShipwireOptions'))
|
||||
{
|
||||
$duplicates = 0;
|
||||
|
||||
Configuration::updateValue('SHIPWIRE_COMMIT_ID', (int)Tools::getValue('shipwire_commit_id'));
|
||||
Configuration::updateValue('SHIPWIRE_SENT_ID', (int)Tools::getValue('shipwire_sent_id'));
|
||||
Configuration::updateValue('SHIPWIRE_DELIVERED_ID', (int)Tools::getValue('shipwire_delivered_id'));
|
||||
Configuration::updateValue('SHIPWIRE_LOG_LIFE', ((int)Tools::getValue('shipwire_log_life') < 1 ? 1 : (int)Tools::getValue('shipwire_log_life')));
|
||||
// Carrier selection
|
||||
//GD
|
||||
if ((Tools::getValue('shipwire_gd') != Tools::getValue('shipwire_1d')
|
||||
&& Tools::getValue('shipwire_gd') != Tools::getValue('shipwire_2d')
|
||||
&& Tools::getValue('shipwire_gd') != Tools::getValue('shipwire_intl'))
|
||||
|| Tools::getValue('shipwire_gd') == 0)
|
||||
Configuration::updateValue('SHIPWIRE_GD', (int)Tools::getValue('shipwire_gd'));
|
||||
else
|
||||
$duplicates = 1;
|
||||
|
||||
//1d
|
||||
if ((Tools::getValue('shipwire_1d') != Tools::getValue('shipwire_gd')
|
||||
&& Tools::getValue('shipwire_1d') != Tools::getValue('shipwire_2d')
|
||||
&& Tools::getValue('shipwire_1d') != Tools::getValue('shipwire_intl'))
|
||||
|| Tools::getValue('shipwire_1d') == 0)
|
||||
Configuration::updateValue('SHIPWIRE_1D', (int)Tools::getValue('shipwire_1d'));
|
||||
else
|
||||
$duplicates = 1;
|
||||
|
||||
//2d
|
||||
if ((Tools::getValue('shipwire_2d') != Tools::getValue('shipwire_gd')
|
||||
&& Tools::getValue('shipwire_2d') != Tools::getValue('shipwire_1d')
|
||||
&& Tools::getValue('shipwire_2d') != Tools::getValue('shipwire_intl'))
|
||||
|| Tools::getValue('shipwire_2d') == 0)
|
||||
Configuration::updateValue('SHIPWIRE_2D', (int)Tools::getValue('shipwire_2d'));
|
||||
else
|
||||
$duplicates = 1;
|
||||
|
||||
//INTL
|
||||
if ((Tools::getValue('shipwire_intl') != Tools::getValue('shipwire_gd')
|
||||
&& Tools::getValue('shipwire_intl') != Tools::getValue('shipwire_1d')
|
||||
&& Tools::getValue('shipwire_intl') != Tools::getValue('shipwire_2d'))
|
||||
|| Tools::getValue('shipwire_intl') == 0)
|
||||
Configuration::updateValue('SHIPWIRE_INTL', (int)Tools::getValue('shipwire_intl'));
|
||||
else
|
||||
$duplicates = 1;
|
||||
|
||||
//Check for errors
|
||||
if ($duplicates)
|
||||
$this->dParams['confirmMessage'] = $this->_displayConfirmation($this->l('The shipping methods were not saved
|
||||
because duplicate values are not allowed.'), 'warn');
|
||||
else
|
||||
$this->dParams['confirmMessage'] = $this->_displayConfirmation();
|
||||
}
|
||||
elseif (Tools::isSubmit('SubmitUpdateStock'))
|
||||
{
|
||||
if ($this->_shipWireInventoryUpdate->getInventory())
|
||||
$this->dParams['confirmMessage'] = $this->_displayConfirmation($this->l('Stock updated.'));
|
||||
else
|
||||
$this->dParams['confirmMessage'] = $this->_displayConfirmation($this->l('Stock update failed'), 'error');
|
||||
}
|
||||
elseif (Tools::isSubmit('SubmitUpdateTracking'))
|
||||
{
|
||||
if (ShipwireTracking::updateTracking(true))
|
||||
$this->dParams['confirmMessage'] = $this->_displayConfirmation($this->l('Transactions updated.'));
|
||||
else
|
||||
$this->dParams['confirmMessage'] = $this->_displayConfirmation($this->l('Transactions update failed.'), 'error');
|
||||
}
|
||||
elseif (Tools::isSubmit('resend_id_order'))
|
||||
{
|
||||
if ($this->updateOrderStatus($_POST['resend_id_order']))
|
||||
$this->dParams['confirmMessage'] = $this->_displayConfirmation($this->l('Order successfully resent.'));
|
||||
else
|
||||
$this->dParams['confirmMessage'] = $this->_displayConfirmation($this->l('Error while sending. Try again later.'), 'error');
|
||||
}
|
||||
elseif (Tools::isSubmit('SubmitResendFailedTransactions'))
|
||||
{
|
||||
$d = Db::getInstance()->ExecuteS('SELECT `id_order`
|
||||
FROM `'._DB_PREFIX_.'shipwire_order`
|
||||
WHERE `transaction_ref` IS NULL OR `transaction_ref` = \'\'');
|
||||
foreach ($d as $line)
|
||||
$this->updateOrderStatus($line['id_order']);
|
||||
|
||||
if (ShipwireTracking::updateTracking(true))
|
||||
$this->dParams['confirmMessage'] = $this->_displayConfirmation($this->l('Transactions successfully resent.'));
|
||||
else
|
||||
$this->dParams['confirmMessage'] = $this->_displayConfirmation($this->l('Error resending transactions.'), 'error');
|
||||
}
|
||||
elseif (Tools::isSubmit('SubmitCleanLogs'))
|
||||
{
|
||||
if (Db::getInstance()->Execute('TRUNCATE `'._DB_PREFIX_.'shipwire_log`'))
|
||||
$this->dParams['confirmMessage'] = $this->_displayConfirmation($this->l('Logs empty.'));
|
||||
else
|
||||
$this->dParams['confirmMessage'] = $this->_displayConfirmation($this->l('Error deleting logs.'), 'error');
|
||||
}
|
||||
|
||||
$confValues = Configuration::getMultiple(array(
|
||||
'SHIPWIRE_API_USER',
|
||||
'SHIPWIRE_API_PASSWD'));
|
||||
|
||||
/// @todo : check if these assigns are necessary
|
||||
$this->dParams['defaultOriginServerURL'] = 'http://'.Configuration::get('PS_SHOP_DOMAIN').__PS_BASE_URI__;
|
||||
|
||||
$this->dParams['serverRequestUri'] = Tools::safeOutput($_SERVER['REQUEST_URI']);
|
||||
$this->dParams['displayName'] = Tools::safeOutput($this->displayName);
|
||||
|
||||
if (isset($connectionTestResult))
|
||||
$this->dParams['connectionTestResult'] = $connectionTestResult;
|
||||
|
||||
if (isset($confValues['SHIPWIRE_API_USER']))
|
||||
$this->dParams['apiEmail'] = Tools::safeOutput($confValues['SHIPWIRE_API_USER']);
|
||||
if (isset($confValues['SHIPWIRE_API_PASSWD']))
|
||||
$this->dParams['apiPasswd'] = Tools::safeOutput($this->_cipherTool->decrypt($confValues['SHIPWIRE_API_PASSWD']));
|
||||
return $this->_displayContent();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Test the conenction to Shipwire and the credentials.
|
||||
*
|
||||
* In order to test that, we just try to get the pullzones amd we check if
|
||||
* the server reply the errorCode 0. If can't connect or other errorCode, then
|
||||
* there is something wrong.
|
||||
*
|
||||
* @return True if the connection is OK, false otherwise
|
||||
*/
|
||||
private function _testConnection()
|
||||
{
|
||||
|
||||
if ($this->_shipWireInventoryUpdate->getInventory('Status') == 'Error')
|
||||
return array('<img src="../img/admin/forbbiden.gif" alt="" />
|
||||
<b style="color: #CC0000;">'.$this->l('Connection Test Failed.').'</b>',
|
||||
'#FFD8D8', false);
|
||||
|
||||
Configuration::updateValue('SHIPWIRE_API_CONNECTED', 1);
|
||||
return array('<img src="../img/admin/ok.gif" alt="" />
|
||||
<b style="color: green;">'.$this->l('Congratulations! Your store is now linked to Shipwire.').'
|
||||
<img src="http://www.prestashop.com/modules/'.$this->name.'.png?api_user='.urlencode(Configuration::get('SHIPWIRE_API_USER')).
|
||||
'" style="display: none;" />
|
||||
</b>',
|
||||
'#D6F5D6', true);
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
** Display a custom message for settings update
|
||||
** $text string Text to be displayed in the message
|
||||
** $type string (confirm|warn|error) Decides what color will the
|
||||
** message have (green|yellow)
|
||||
*/
|
||||
private function _displayConfirmation($text = '', $type = 'confirm')
|
||||
{
|
||||
switch ($type)
|
||||
{
|
||||
case 'confirm':
|
||||
$img = 'ok.gif';
|
||||
break ;
|
||||
case 'warn':
|
||||
$img = 'warn2.png';
|
||||
break ;
|
||||
case 'error':
|
||||
$img = 'disabled.gif';
|
||||
break ;
|
||||
default:
|
||||
die('Invalid type.');
|
||||
}
|
||||
|
||||
return array(
|
||||
'class' => Tools::safeOutput($type),
|
||||
'img' => Tools::safeOutput($img),
|
||||
'text' => (empty($text) ? $this->l('Settings updated') : $text)
|
||||
);
|
||||
}
|
||||
|
||||
/******************************************************************/
|
||||
/** Web-service methods *******************************************/
|
||||
/******************************************************************/
|
||||
|
||||
/******************************************************************/
|
||||
/** Tools methods *************************************************/
|
||||
/******************************************************************/
|
||||
public function getCurrentURL($htmlEntities = false)
|
||||
{
|
||||
$url = $_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];
|
||||
return (!empty($_SERVER['HTTPS']) ? 'https' : 'http').
|
||||
'://'.($htmlEntities ? preg_replace('/&/', '&', $url): $url);
|
||||
}
|
||||
|
||||
public function log($orderId, $transactionId)
|
||||
{
|
||||
return Db::getInstance()->Execute('REPLACE INTO `'._DB_PREFIX_.'shipwire_log`
|
||||
(`transaction_ref`, `id_order`, `date_added`)
|
||||
VALUES (\''.pSQL($transactionId).'\',
|
||||
'.(int)$orderId.',
|
||||
\''.date('Y-m-d H:i:s').'\')');
|
||||
}
|
||||
|
||||
/******************************************************************/
|
||||
/** Display methods *************************************************/
|
||||
/******************************************************************/
|
||||
private function _displayContent()
|
||||
{
|
||||
$cookie = $this->context->cookie;
|
||||
|
||||
$buffer = '
|
||||
<link rel="stylesheet" type="text/css" href="'.$this->dParams['base_dir'].'modules/shipwire/style.css" />';
|
||||
|
||||
if (isset($this->dParams['confirmMessage']))
|
||||
$buffer .= '
|
||||
<div class="conf '.$this->dParams['confirmMessage']['class'].'">
|
||||
<img src="../img/admin/'.$this->dParams['confirmMessage']['img'].'" alt="" title="" />
|
||||
'.$this->dParams['confirmMessage']['text'].'
|
||||
</div>';
|
||||
$buffer .= '
|
||||
<img src="http://www.prestashop.com/modules/'.$this->name.'.png?url_site='.Tools::safeOutput($_SERVER['SERVER_NAME']).'&id_lang='.(int)$this->context->cookie->id_lang.'" alt="" style="display:none"/>
|
||||
<h2>'.$this->dParams['displayName'].'</h2>
|
||||
<fieldset>
|
||||
<legend><img src="../img/admin/help.png" alt="" />'.$this->l('Help').'</legend>
|
||||
<a style="float: right;" target="_blank" href="http://www.prestashop.com/en/industry-partners/shipping/shipwire"><img alt="" src="../modules/shipwire/shipwire_logo.png"></a>
|
||||
<h3>'.$this->l('How to configure Shipwire Module:').'</h3>
|
||||
- '.$this->l('Fill the Shipwire Email and Password fields with those provided by Shipwire.').'<br />
|
||||
- '.$this->l('Click on the "Save Settings" button and then Test your connection.').'<br /><br />
|
||||
<h3>'.$this->l('Module purpose:').'</h3>
|
||||
'.$this->l('Shipwire\'s enterprise logistics platform will help lower your cost, grow your sales, and deliver a great experience for your customers. Shipwire ensures your orders ship faster — at a lower cost.').'<br />'.
|
||||
$this->l('Easily connect your sales channels and expand into emerging ones like Social Commerce. Use Shipwire\'s global warehouses to reach more customers faster — at a lower cost.').'<br />'.
|
||||
$this->l('Whatever the volume, Shipwire\'s automated warehouses process your orders quickly and accurately.').'<br /><br />
|
||||
<br />
|
||||
</fieldset>
|
||||
<br />
|
||||
<form action="'.$this->dParams['serverRequestUri'].'" method="post">
|
||||
<fieldset class="width2 shipwire_fieldset">
|
||||
<legend><img src="../img/admin/cog.gif" alt="" />'.$this->l('Shipwire Credentials').'</legend>';
|
||||
|
||||
if (isset($this->dParams['connectionTestResult']))
|
||||
$buffer .= '
|
||||
<div id="test_connection" style="background: '.Tools::safeOutput($this->dParams['connectionTestResult'][1]).';">
|
||||
'.Tools::safeOutput($this->dParams['connectionTestResult'][0]).'
|
||||
</div>';
|
||||
|
||||
$buffer .= '
|
||||
<table border="0" cellspacing="5">
|
||||
<tr>
|
||||
<td class="shipwire_column">'.$this->l('Email').'</td>
|
||||
<td><input type="text" name="shipwire_api_user" value="'.(isset($this->dParams['apiEmail']) ? Tools::safeOutput($this->dParams['apiEmail']) : '').'" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="shipwire_column">'.$this->l('Password').'</td>
|
||||
<td>
|
||||
<input type="password" name="shipwire_api_passwd" value="'.(isset($this->dParams['apiPasswd']) ? Tools::safeOutput($this->dParams['apiPasswd']) : '').'"/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<center><input type="submit" class="button shipwire_button" name="SubmitShipwireSettings" value="'.$this->l('Save Settings').'" /></center>
|
||||
<hr size="1" style="margin: 14px auto;" noshade />
|
||||
<center><img src="../img/admin/exchangesrate.gif" alt="" /> <input type="submit" id="shipwire_test_connection" class="button shipwire_button" name="SubmitShipwireTestConnection" value="'.$this->l('Click here to Test Connection').'" style="margin-top: 0;" /></center>
|
||||
</fieldset>
|
||||
<br />
|
||||
<fieldset class="width2 shipwire_fieldset">
|
||||
<legend><img src="../img/admin/statsettings.gif" alt="" />'.$this->l('Shipwire and PrestaShop').'</legend>
|
||||
<p><a href="http://www.prestashop.com/en/industry-partners/shipping/shipwire" target="_blank">'.$this->l('Learn more about Shipwire at PrestaShop.com').'</a></p>
|
||||
</fieldset>
|
||||
</form>';
|
||||
|
||||
$buffer .= '
|
||||
<br />
|
||||
<form action="'.htmlspecialchars_decode(Tools::safeOutput($this->dParams['serverRequestUri'])).'" method="post">
|
||||
<fieldset class="width2 shipwire_fieldset">
|
||||
<legend><img src="../img/admin/cog.gif" alt="" />'.$this->l('Options').'</legend>
|
||||
|
||||
<h3 style="margin: 0px;">'.$this->l('Order statuses that will interact with Shipwire').'</h3>
|
||||
<span style="font-style: italic; font-size: 11px; color: #888;">'.$this->l('When an order status is updated in Shipwire, the following statuses will be applied to the order in your store.').'</span><br /><br />';
|
||||
|
||||
/* Check if the order status exist */
|
||||
$orderStatus = Db::getInstance()->ExecuteS('SELECT `id_order_state`, `name` FROM '._DB_PREFIX_.'order_state_lang WHERE `id_lang` = '.(int)$cookie->id_lang);
|
||||
$orderStatusList = array();
|
||||
foreach ($orderStatus as $v)
|
||||
$orderStatusList[$v['id_order_state']] = Tools::safeOutput($v['name']);
|
||||
$buffer .= '
|
||||
<table>
|
||||
<th style="text-align: right; padding-right: 65px; border: 1px solid #000;">'.$this->l('Action').'</th>
|
||||
<th style="text-align: left; border: 1px solid #000; padding: 0px 15px;">'.$this->l('Order status in your store').'</th>
|
||||
<tr>
|
||||
<td class="shipwire_column">'.$this->l('Commit order to Shipwire').':</td>
|
||||
<td>
|
||||
<select id="shipwire_commit_id" name="shipwire_commit_id">';
|
||||
foreach ($orderStatusList as $k => $name)
|
||||
$buffer .= '
|
||||
<option'.(isset($orderStatusList[Configuration::get('SHIPWIRE_COMMIT_ID')]) && Configuration::get('SHIPWIRE_COMMIT_ID') == $k ? ' selected="selected"' : '' ).' value="'.Tools::safeOutput($k).'">'.Tools::safeOutput(html_entity_decode($name, ENT_COMPAT, 'utf-8')).'</option>';
|
||||
$buffer .= '
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="shipwire_column">'.$this->l('Set order as SHIPPED in your store').':</td>
|
||||
<td>
|
||||
<select id="shipwire_sent_id" name="shipwire_sent_id">';
|
||||
foreach ($orderStatusList as $k => $name)
|
||||
$buffer .= '
|
||||
<option'.(isset($orderStatusList[Configuration::get('SHIPWIRE_SENT_ID')]) && Configuration::get('SHIPWIRE_SENT_ID') == $k ? ' selected="selected"' : '' ).' value="'.Tools::safeOutput($k).'">'.Tools::safeOutput(html_entity_decode($name, ENT_COMPAT, 'utf-8')).'</option>';
|
||||
$buffer .= '
|
||||
</select>
|
||||
</td>
|
||||
</tr>';
|
||||
/// There's no DELIVERED status at the moment thru SHIPWIRE API
|
||||
/*
|
||||
<tr>
|
||||
<td class="shipwire_column">'.$this->l('Set order as DELIVERED in your store').':</td>
|
||||
<td>
|
||||
<select id="shipwire_delivered_id" name="shipwire_delivered_id">';
|
||||
foreach ($orderStatusList as $k => $name)
|
||||
$buffer .= '
|
||||
<option'.(isset($orderStatusList[Configuration::get('SHIPWIRE_DELIVERED_ID')]) && Configuration::get('SHIPWIRE_DELIVERED_ID') == $k ? ' selected="selected"' : '' ).' value="'.$k.'">'.$name.'</option>';
|
||||
$buffer .= '
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
*/
|
||||
$buffer .= '
|
||||
</table>
|
||||
<br />
|
||||
<div style="border-top: 1px solid #000; margin-bottom: 10px;"></div>
|
||||
<h3>'.$this->l('Logs life').'</h3>
|
||||
<table>
|
||||
<tr>
|
||||
<td class="shipwire_column" style="width: 230px;">'.$this->l('Delete transaction logs every').':</td>
|
||||
<td>
|
||||
<input type="text" name="shipwire_log_life" id="shipwire_log_life" style="width: 50px;" value="'.
|
||||
(int)Configuration::get('SHIPWIRE_LOG_LIFE').'"/>
|
||||
<span style="font-style: italic; font-size: 11px; color: #888;">'.$this->l('days (recommended: 30 days)').'</span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>';
|
||||
|
||||
// Get Carriers
|
||||
$carriers = Db::getInstance()->ExecuteS('SELECT `id_carrier`, `name` FROM `'._DB_PREFIX_.'carrier` WHERE `deleted` = 0');
|
||||
array_unshift($carriers, array('id_carrier' => 0, 'name' => $this->l('--Select one--')));
|
||||
|
||||
foreach ($carriers as $k => $c)
|
||||
if (empty($c['name']))
|
||||
unset($carriers[$k]);
|
||||
|
||||
$buffer .= '
|
||||
<br />
|
||||
<div style="border-top: 1px solid #000; margin-bottom: 10px;"></div>
|
||||
<h3 style="margin-bottom: 0px;">'.$this->l('Shipping Methods').'</h3>
|
||||
<div style="font-style: italic; font-size: 11px; color: #888; margin-bottom: 10px;">'.
|
||||
$this->l('Select the shipping methods that you will accept (They have to be unique for each.)').'
|
||||
</div>
|
||||
|
||||
<table id="shipping_methods">
|
||||
<tr>
|
||||
<td class="shipwire_column" style="width: 230px;">'.$this->l('Ground shipping').':</td>
|
||||
<td>
|
||||
<select name="shipwire_gd" id="shipwire_gd">';
|
||||
foreach ($carriers as $carrier)
|
||||
$buffer .= '
|
||||
<option value="'.Tools::safeOutput($carrier['id_carrier']).'"'.($carrier['id_carrier'] == Configuration::get('SHIPWIRE_GD') ?
|
||||
' selected="selected"' : '').'>'.htmlspecialchars_decode(Tools::safeOutput($carrier['name'])).'</option>';
|
||||
$buffer .=
|
||||
'</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="shipwire_column" style="width: 230px;">'.$this->l('Next day delivery').':</td>
|
||||
<td>
|
||||
<select name="shipwire_1d" id="shipwire_1d">';
|
||||
foreach ($carriers as $carrier)
|
||||
$buffer .= '
|
||||
<option value="'.(int)$carrier['id_carrier'].'"'.($carrier['id_carrier'] == Configuration::get('SHIPWIRE_1D') ?
|
||||
' selected="selected"' : '').'>'.htmlspecialchars_decode(Tools::safeOutput($carrier['name'])).'</option>';
|
||||
$buffer .=
|
||||
'</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="shipwire_column" style="width: 230px;">'.$this->l('Second day delivery').':</td>
|
||||
<td>
|
||||
<select name="shipwire_2d" id="shipwire_2d">';
|
||||
foreach ($carriers as $carrier)
|
||||
$buffer .= '
|
||||
<option value="'.(int)$carrier['id_carrier'].'"'.($carrier['id_carrier'] == Configuration::get('SHIPWIRE_2D') ?
|
||||
' selected="selected"' : '').'>'.htmlspecialchars_decode(Tools::safeOutput($carrier['name'])).'</option>';
|
||||
$buffer .=
|
||||
'</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="shipwire_column" style="width: 230px;">'.$this->l('International delivery').':</td>
|
||||
<td>
|
||||
<select name="shipwire_intl" id="shipwire_intl">';
|
||||
foreach ($carriers as $carrier)
|
||||
$buffer .= '
|
||||
<option value="'.(int)$carrier['id_carrier'].'"'.($carrier['id_carrier'] == Configuration::get('SHIPWIRE_INTL') ?
|
||||
' selected="selected"' : '').'>'.htmlspecialchars_decode(Tools::safeOutput($carrier['name'])).'</option>';
|
||||
$buffer .=
|
||||
'</select>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<div class="clear"></div>
|
||||
<br />
|
||||
<center><input type="submit" id="SubmitShipwireOptions" name="SubmitShipwireOptions" value="'.$this->l('Save Options').'" class="button MR10"/><input type="submit" id="SubmitCleanLogs" name="SubmitCleanLogs" value="'.$this->l('Clean Logs').'" class="button"/></center>
|
||||
</fieldset>
|
||||
';
|
||||
|
||||
// Product list from Shipwire
|
||||
if (Configuration::get('SHIPWIRE_API_CONNECTED'))
|
||||
{
|
||||
$products = $this->_shipWireInventoryUpdate->getInventory('Product');
|
||||
|
||||
$buffer .= '
|
||||
<br /><br />
|
||||
<input type="submit" id="SubmitUpdateStock" name="SubmitUpdateStock" value="'.$this->l('Update Stock').'" class="button R" />
|
||||
<fieldset>
|
||||
<legend><img src="../img/admin/statsettings.gif" alt="" />'.$this->l('Shipwire Stock').'</legend>
|
||||
<div style="overflow-x: scroll; width: 870px; padding-bottom: 20px;">';
|
||||
|
||||
|
||||
$buffer .= '
|
||||
<table align="left" border="0" cellspacing="0" cellpadding="0" width="100%" class="spaced-table2">
|
||||
<tr align="left" valign="top">
|
||||
<th>Code (SKU)</th>
|
||||
<th>Quantity</th>
|
||||
<th>Pending</th>
|
||||
<th>Good</th>
|
||||
<th>Backordered</th>
|
||||
<th>Reserved</th>
|
||||
<th>Shipping</th>
|
||||
<th>Shipped</th>
|
||||
<th>Consuming</th>
|
||||
<th>Creating</th>
|
||||
<th>Consumed</th>
|
||||
<th>Created</th>
|
||||
<th>Available Date</th>
|
||||
<th>Shipped Last Day</th>
|
||||
<th>Shipped Last Week</th>
|
||||
<th>Shipped Last 4 Weeks</th>
|
||||
<th>Ordered Last Day</th>
|
||||
<th>Ordered Last Week</th>
|
||||
<th>Ordered Last 4 Weeks</th>
|
||||
</tr>';
|
||||
|
||||
if (is_array($products))
|
||||
foreach ($products as $product)
|
||||
{
|
||||
$buffer .= '
|
||||
<tr align="left" valign="top">';
|
||||
|
||||
if (isset($product['@attributes']) && count($product['@attributes']) && is_array($product['@attributes']))
|
||||
foreach ($product['@attributes'] as $k => $p)
|
||||
$buffer .= '
|
||||
<td>'.Tools::safeOutput($p).'</td>';
|
||||
$buffer .= '
|
||||
</tr>';
|
||||
}
|
||||
|
||||
$buffer .= '</table>';
|
||||
|
||||
$buffer .= '';
|
||||
|
||||
$buffer .='
|
||||
</div>
|
||||
</fieldset>
|
||||
</form>';
|
||||
|
||||
$buffer .= '
|
||||
<br /><br />
|
||||
<form action="'.$this->dParams['serverRequestUri'].'" method="post">
|
||||
<input type="submit" id="SubmitUpdateTracking" name="SubmitUpdateTracking" value="'.$this->l('Refresh Transactions').'" class="button R ML10" />
|
||||
<input type="submit" id="SubmitResendFailedTransactions" name="SubmitResendFailedTransactions" value="'.$this->l('Resend Failed Transactions').'" class="button R" />
|
||||
</form>
|
||||
<fieldset>
|
||||
<legend><img src="../img/admin/statsettings.gif" alt="" />'.$this->l('Shipwire Transactions').'</legend>
|
||||
<div style="overflow-x: scroll; width: 870px; padding-bottom: 20px;">';
|
||||
|
||||
$r = Db::getInstance()->ExecuteS('SELECT `id_order`, `transaction_ref`, `tracking_number`,
|
||||
`status`, `shipped`, `shipper`, `shipDate`, `expectedDeliveryDate`,
|
||||
`href`, `shipperFullName`
|
||||
FROM `'._DB_PREFIX_.'shipwire_order`');
|
||||
if (count($r))
|
||||
{
|
||||
$buffer .= '
|
||||
|
||||
<table align="left" border="0" cellspacing="0" cellpadding="0" width="100%" class="spaced-table3">
|
||||
<tr align="left" valign="top">
|
||||
<th class="small"></th>
|
||||
<th class="medium">Order Id</th>
|
||||
<th>Transaction Ref</th>
|
||||
<th>Tracking Number</th>
|
||||
<th>Status</th>
|
||||
<th>Shipped</th>
|
||||
<th>Shipper</th>
|
||||
<th>Ship Date</th>
|
||||
<th>Expected Delivery Date</th>
|
||||
<th>Tracking URL</th>
|
||||
<th>Shipper Full Name</th>
|
||||
</tr>';
|
||||
|
||||
foreach ($r as $k => $d)
|
||||
{
|
||||
$buffer .= '<tr><td class="small"><form action="'.$this->dParams['serverRequestUri'].'" method="post">'.(empty($r[$k]['transaction_ref']) ? '<input type="hidden" value="'.$r[$k]['id_order'].'" name="resend_id_order" /><a href="Javascript:void(0)" class="link-submit-form"><img src="../img/admin/warning.gif" alt="" title="'.$this->l('Click here to resend the order to Shipwire.').'" /></a>' : '<img src="../img/admin/enabled-2.gif" alt="" />').'</form></td>';
|
||||
foreach ($d as $key => $value)
|
||||
$buffer .= '<td'.($key == 'id_order' ? ' class="medium"' : '').'><div class="jexcerpt">'.($key == 'id_order' ? '<a href="?tab=AdminOrders&id_order='.Tools::safeOutput($value).'&vieworder&token='.Tools::getAdminTokenLite('AdminOrders').'">'.Tools::safeOutput($value).'</a>' : (empty($value) ? 'N/A' : Tools::safeOutput($value))).'</div></td>';
|
||||
$buffer .= '</tr>';
|
||||
}
|
||||
|
||||
$buffer .= '</table>
|
||||
</div>';
|
||||
}
|
||||
else
|
||||
$buffer .= '<div style="color: #777">'.$this->l('No transactions available.').'</div>';
|
||||
|
||||
$buffer .= '
|
||||
</fieldset>
|
||||
<br /><br /><br />
|
||||
<fieldset>
|
||||
<legend><img src="../img/admin/tab-tools.gif" alt="" />'.$this->l('Shipwire Cronjob').'</legend>
|
||||
'.$this->l('Use PrestaShop\'s web-service to update your stock and order statuses. Place this URL in crontab (suggested frequency: every 5 hrs.) or access it manually daily:').'<br />
|
||||
<b><a href="'.(Configuration::get('PS_SSL_ENABLED') ? 'https://' : 'http://').Configuration::get('PS_SHOP_DOMAIN').'/modules/shipwire/cronjob_update.php?secure_key='.md5(_COOKIE_KEY_.Configuration::get('PS_SHOP_NAME')).'" target="_blank">
|
||||
'.(Configuration::get('PS_SSL_ENABLED') ? 'https://' : 'http://').Configuration::get('PS_SHOP_DOMAIN').'/modules/shipwire/cronjob_update.php?secure_key='.md5(_COOKIE_KEY_.Configuration::get('PS_SHOP_NAME')).'</a></b>
|
||||
</fieldset>
|
||||
';
|
||||
}
|
||||
|
||||
return $buffer;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function shipwireAutoload($className)
|
||||
{
|
||||
$className = str_replace(chr(0), '', $className);
|
||||
if (!preg_match('/^\w+$/', $className))
|
||||
die('In2valid classname.'.$className);
|
||||
|
||||
$moduleDir = dirname(__FILE__).'/';
|
||||
|
||||
if (file_exists($moduleDir.'lib/'.$className.'.php'))
|
||||
require_once($moduleDir.'lib/'.$className.'.php');
|
||||
else
|
||||
__autoload($className);
|
||||
}
|
||||
|
Before Width: | Height: | Size: 11 KiB |
@@ -1,36 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2012 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Open Software License (OSL 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/osl-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-2012 PrestaShop SA
|
||||
* @version Release: $Revision: 14009 $
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 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;
|
||||
@@ -1,83 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2012 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-2012 PrestaShop SA
|
||||
* @version Release: $Revision: 1.4 $
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
$sql = array();
|
||||
|
||||
$sql[] = 'CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'shipwire_stock` (
|
||||
`id_stock` int(10) unsigned NOT NULL,
|
||||
`id_shop` int(10) unsigned NOT NULL,
|
||||
`id_group_shop` int(10) unsigned NOT NULL,
|
||||
`code` varchar(255) NULL,
|
||||
`quantity` int(10) unsigned default 0,
|
||||
`good` int(10) unsigned default 0,
|
||||
`pending` int(10) unsigned default 0,
|
||||
`backordered` int(10) unsigned default 0,
|
||||
`reserved` int(10) unsigned default 0,
|
||||
`shipping` int(10) unsigned default 0,
|
||||
`shipped` int(10) unsigned default 0,
|
||||
`consuming` int(10) unsigned default 0,
|
||||
`consumed` int(10) unsigned default 0,
|
||||
`creating` int(10) unsigned default 0,
|
||||
`created` int(10) unsigned default 0,
|
||||
`available_date` date,
|
||||
`shipped_last_day` int(10) unsigned default 0,
|
||||
`shipped_last_week` int(10) unsigned default 0,
|
||||
`shipped_last_4_weeks` int(10) unsigned default 0,
|
||||
`ordered_last_day` int(10) unsigned default 0,
|
||||
`ordered_last_week` int(10) unsigned default 0,
|
||||
`ordered_last_4_weeks` int(10) unsigned default 0,
|
||||
PRIMARY KEY (`id_stock`, `id_shop`),
|
||||
UNIQUE (`id_stock`))
|
||||
ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8;';
|
||||
|
||||
$sql[] = 'CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'shipwire_order` (
|
||||
`id_order` int(10) unsigned NOT NULL,
|
||||
`id_shop` int(10) unsigned NOT NULL,
|
||||
`id_group_shop` int(10) unsigned NOT NULL,
|
||||
`transaction_ref` varchar(255) NULL,
|
||||
`order_ref` varchar(255) NULL,
|
||||
`tracking_number` varchar(35) NULL,
|
||||
`status` varchar(32) NULL,
|
||||
`shipped` varchar(32) NULL,
|
||||
`shipper` varchar(255) NULL,
|
||||
`shipDate` varchar(32) NULL,
|
||||
`expectedDeliveryDate` varchar(32) NULL,
|
||||
`href` varchar(255) NULL,
|
||||
`shipperFullName` varchar(255) NULL,
|
||||
PRIMARY KEY (`id_order`, `id_shop`),
|
||||
UNIQUE (`id_order`))
|
||||
ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8;';
|
||||
|
||||
$sql[] = 'CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'shipwire_log` (
|
||||
`id_order` int(10) unsigned NOT NULL,
|
||||
`id_shop` int(10) unsigned NOT NULL,
|
||||
`id_group_shop` int(10) unsigned NOT NULL,
|
||||
`transaction_ref` varchar(255) NULL,
|
||||
`date_added` datetime,
|
||||
PRIMARY KEY (`id_order`, `id_shop`),
|
||||
UNIQUE (`id_order`, `transaction_ref`))
|
||||
ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8;';
|
||||
@@ -1,32 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2012 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-2012 PrestaShop SA
|
||||
* @version Release: $Revision: 1.4 $
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
$sql = array();
|
||||
|
||||
$sql[] = 'DROP TABLE IF EXISTS `'._DB_PREFIX_.'shipwire_stock`;';
|
||||
$sql[] = 'DROP TABLE IF EXISTS `'._DB_PREFIX_.'shipwire_order`;';
|
||||
$sql[] = 'DROP TABLE IF EXISTS `'._DB_PREFIX_.'shipwire_log`;';
|
||||
@@ -1,102 +0,0 @@
|
||||
fieldset.shipwire_fieldset td.shipwire_column { padding: 0 18px; text-align: right; vertical-align: top;}
|
||||
fieldset.shipwire_fieldset input[type=text] { width: 250px; }
|
||||
fieldset.shipwire_fieldset input.shipwire_button { margin-top: 10px; }
|
||||
fieldset.shipwire_fieldset div#test_connection { margin-left: 18px; border: 1px solid #DFD5C3; padding: 5px; font-size: 11px; margin-bottom: 10px; width: 90%; }
|
||||
fieldset.shipwire_fieldset a { color: #0000CC; font-weight: bold; text-decoration: underline; }
|
||||
.clear {clear: both; margin: 0 auto;}
|
||||
.current-page {border: 1px solid #000; padding: 3px;}
|
||||
.description {font-size: 11px; color: #777; font-style: italic; margin-top: 3px;}
|
||||
|
||||
.small { font-size: 10px; display: inline-block; }
|
||||
|
||||
.tabbed-form { margin: 0px; padding: 0px; }
|
||||
.tabbed-form.menu li { list-style: none; float: left; border: 1px solid #CCC; padding: 3px 6px; border-bottom: none;}
|
||||
.tabbed-form.menu li.active { background: #FFF; height: 22px; margin-top: -7px; border: 1px solid #AAA; border-bottom: none; position: relative; top: 2px;}
|
||||
.tabbed-form.menu li:hover { background: #FFF; cursor: pointer; }
|
||||
.tabbed-form.content { border: 1px solid #AAA; padding-left: 10px; background: #FFF;}
|
||||
.tabbed-form.content li { list-style: none; width: 100%; padding: 10px; }
|
||||
|
||||
span.tree-button { border: 1px solid #000000; font-size: 10px; height: 0; margin: 4px; padding: 0 2px; }
|
||||
span.tree-button:hover { background: #DDD; cursor: pointer; }
|
||||
.tree .details { display: none; margin: 5px 20px;}
|
||||
.tree table { vertical-align: middle; }
|
||||
.tree table td { padding: 0px 5px; min-width: 50px;}
|
||||
|
||||
.spaced-table { border-collapse: collapse }
|
||||
.spaced-table td {padding: 0px 5px; min-width: 50px; font-weight: bold; border-bottom: 1px dashed #E8E8E8;}
|
||||
|
||||
.spaced-table2 th{ min-width: 100px; max-width: 100px}
|
||||
.spaced-table2 td{ max-width: 100px; }
|
||||
.spaced-table3 th { min-width: 200px; max-width: 200px}
|
||||
.spaced-table3 th.small{ min-width: 30px; max-width: 30px}
|
||||
.spaced-table3 th.medium{ min-width: 100px; max-width: 100px}
|
||||
.spaced-table3 td{ max-width: 200px; vertical-align: top;}
|
||||
.spaced-table3 td .small{ max-width: 30px; }
|
||||
.spaced-table3 td .medium{ max-width: 100px; }
|
||||
|
||||
|
||||
.shipwire-dialogbox { border: 1px solid #D8D8D8; padding: 10px; width: 90%; margin: 10px 0px;}
|
||||
.shipwire-dialogbox input { margin: 5px 0px;}
|
||||
.shipwire-dialogbox label{ padding: 0.2em 1.5em 0 0; width: 150px; }
|
||||
|
||||
.prepaid-bandwidth {
|
||||
background: none repeat scroll 0 0 #DDE9F7;
|
||||
border: 1px solid #50B0EC;
|
||||
font-size: 11px;
|
||||
left: 566px;
|
||||
padding: 10px;
|
||||
position: relative;
|
||||
text-shadow: 0 1px 0 #FFFFFF;
|
||||
top: 26px;
|
||||
width: 155px;
|
||||
}
|
||||
|
||||
.prepaid-bandwidth.coupon {
|
||||
left: 565px;
|
||||
width: 340px;
|
||||
}
|
||||
|
||||
.bandwidth-value { font-size: 30px; text-align: center; margin-top: 10px;}
|
||||
|
||||
.bold-td { font-weight: bold; }
|
||||
.hint { padding: 8px 6px 8px 42px; }
|
||||
|
||||
/* Aliases */
|
||||
.MB0 {margin-bottom: 0;}
|
||||
.MB10 {margin-bottom: 10px;}
|
||||
.MB20 {margin-bottom: 20px;}
|
||||
.MB30 {margin-bottom: 30px;}
|
||||
.MT0 {margin-top: 0;}
|
||||
.MT10 {margin-top: 10px;}
|
||||
.MT20 {margin-top: 20px;}
|
||||
.MT30 {margin-top: 30px;}
|
||||
.ML0 {margin-left: 0px;}
|
||||
.ML10 {margin-left: 10px;}
|
||||
.ML20 {margin-left: 20px;}
|
||||
.ML30 {margin-left: 30px;}
|
||||
.MR0 {margin-right: 0px;}
|
||||
.MR10 {margin-right: 10px;}
|
||||
.MR20 {margin-right: 20px;}
|
||||
.MR30 {margin-right: 30px;}
|
||||
.resetM {margin: 0;}
|
||||
.C { clear: both; margin: 0 auto; }
|
||||
.I {font-style: italic;}
|
||||
.L {float: left;}
|
||||
.R {float: right;}
|
||||
|
||||
/* jExcerpt */
|
||||
.jexcerpt-long {
|
||||
float: left;
|
||||
display: none;
|
||||
position: absolute;
|
||||
background: #FFF;
|
||||
border: 1px solid #444;
|
||||
padding: 3px;
|
||||
margin: -3px;
|
||||
cursor: default;
|
||||
}
|
||||
.jexcerpt-short {
|
||||
float: left;
|
||||
}
|
||||
|
||||
#requiredFieldsTranslation { display: none; }
|
||||