Merge branch 'release' of https://github.com/PrestaShop/PrestaShop into release

This commit is contained in:
Rémi Gaillard
2013-04-19 15:14:51 +02:00
170 changed files with 1854 additions and 1387 deletions
+6
View File
@@ -29,4 +29,10 @@ themes/default/cache/*.js
themes/default/cache/*.css
modules/*/translations/*.php
!modules/*/translations/index.php
mails/*
!mails/en
modules/*/mails/*
!modules/*/mails/en
translations/*
!translations/*.gzip
+1 -1
View File
@@ -23,7 +23,7 @@
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
require_once(dirname(__FILE__).'/../images.inc.php');
function bindDatepicker($id, $time)
{
if ($time)
+5 -1
View File
@@ -664,4 +664,8 @@ ul.listForm li {padding-bottom:3px;}
/******** CREATE AN ORDER **************/
#carrier_form label{padding-top:0}
#carrier_form input{margin-top:3px}
#carrier_form input{margin-top:3px}
/************** SCENE *****************/
#large_scene_image{clear:both;border:1px solid transparent;}
@@ -27,7 +27,7 @@
{block name="label"}
{if $input.type == 'color'}
<div id="colorAttributeProperties" style="display:{if $colorAttributeProperties}block{else}none{/if}";>
<div id="colorAttributeProperties" style="display:{if $colorAttributeProperties}block{else}none{/if};">
{/if}
{$smarty.block.parent}
{/block}
@@ -84,6 +84,13 @@ function addCartRuleOption(item)
function updateProductRuleShortDescription(item)
{
/******* For IE: put a product in condition on cart rules *******/
if(typeof String.prototype.trim !== 'function') {
String.prototype.trim = function() {
return this.replace(/^\s+|\s+$/g, '');
}
}
var id1 = $(item).attr('id').replace('_add', '').replace('_remove', '');
var id2 = id1.replace('_select', '');
var length = $('#' + id1 + '_2 option').length;
@@ -22,91 +22,79 @@
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
<script type="text/javascript">
var there_are = '{l s='There are'}';
var there_is = '{l s='There is'}';
var label_errors = '{l s='errors'}';
var label_error = '{l s='error'}';
</script>
<div id="container">
<div id="error" {if !isset($errors)}class="hide"{/if}>
{if isset($errors)}
<h3>{if $nbErrors > 1}{l s='There are %d errors.' sprintf=$nbErrors}{else}{l s='There is %d error.' sprintf=$nbErrors}{/if}</h3>
<ol style="margin: 0 0 0 20px;">
{foreach from=$errors item="error"}
<li>{$error}</li>
{/foreach}
</ol>
{/if}
</div>
<br />
{if isset($warningSslMessage)}
<div class="warn">
{$warningSslMessage}
</div>
{/if}
<div id="login">
<h1>{$shop_name}</h1>
{if !isset($wrong_folder_name) && !isset($wrong_install_name)}
<form action="#" id="login_form" method="post">
<div class="field">
<label for="email">{l s='Email address:'}</label>
<input type="text" id="email" name="email" class="input email_field" value="{if isset($email)}{$email|escape:'htmlall':'UTF-8'}{/if}" />
</div>
<div class="field">
<label for="passwd">{l s='Password:'}</label>
<input id="passwd" type="password" name="passwd" class="input password_field" value="{if isset($password)}{$password}{/if}"/>
</div>
<div class="field">
<input type="submit" name="submitLogin" value="{l s='Log in'}" class="button fl margin-right-5" />
<p class="fl no-margin hide ajax-loader">
<img src="../img/loader.gif" alt="" />
</p>
<p class="fr no-margin">
<a href="#" class="show-forgot-password">{l s='Lost password?'}</a>
</p>
<div class="clear"></div>
</div>
<input type="hidden" name="redirect" id="redirect" value="{$redirect}"/>
</form>
<form action="#" id="forgot_password_form" method="post" class="hide">
<h2 class="no-margin">{l s='Forgot your password?'}</h2>
<p class="bold">{l s='In order to receive your access code by email, please enter the address you provided during the registration process.'}</p>
<div class="field">
<label>{l s='Email address:'}</label>
<input type="text" name="email_forgot" id="email_forgot" class="input email_field" />
</div>
<div class="field">
<input type="submit" name="submit" value="{l s='Send'}" class="button fl margin-right-5" />
<p class="fl no-margin hide ajax-loader">
<img src="../img/loader.gif" alt="" />
</p>
<p class="fr no-margin">
<a href="#" class="show-login-form">{l s='Back to login'}</a>
</p>
<div class="clear"></div>
</div>
</form>
{else}
<div class="padding-30">
<p>{l s='For security reasons, you cannot connect to the Back Office until after you have:'}</p>
<ul>
{if isset($wrong_install_name) && $wrong_install_name == true}<li>{l s='deleted the /install folder'}</li>{/if}
{if isset($wrong_folder_name) && $wrong_folder_name == true}<li>{l s='renamed the /admin folder (e.g. /admin%d)' sprintf=$randomNb}</li>{/if}
</ul>
{if isset($wrong_folder_name) && $wrong_folder_name == true}<p>{l s='Please then access this page by the new URL (e.g. http://www.yoursite.com/admin%d)' sprintf=$randomNb}</p>{/if}
</div>
{/if}
</div>
<h2><a href="http://www.prestashop.com">&copy; 2005 - {$smarty.now|date_format:"%Y"} Copyright by PrestaShop. all rights reserved.</a></h2>
</div>
<script type="text/javascript">
var there_are = '{l s='There are'}';
var there_is = '{l s='There is'}';
var label_errors = '{l s='errors'}';
var label_error = '{l s='error'}';
</script>
<div id="container">
<div id="error" {if !isset($errors)}class="hide"{/if}>
{if isset($errors)}
<h3>{if $nbErrors > 1}{l s='There are %d errors.' sprintf=$nbErrors}{else}{l s='There is %d error.' sprintf=$nbErrors}{/if}</h3>
<ol style="margin: 0 0 0 20px;">
{foreach from=$errors item="error"}
<li>{$error}</li>
{/foreach}
</ol>
{/if}
</div>
<br />
{if isset($warningSslMessage)}
<div class="warn">{$warningSslMessage}</div>
{/if}
<div id="login">
<h1>{$shop_name}</h1>
{if !isset($wrong_folder_name) && !isset($wrong_install_name)}
<form action="#" id="login_form" method="post">
<div class="field">
<label for="email">{l s='Email address:'}</label>
<input type="text" id="email" name="email" class="input email_field" value="{if isset($email)}{$email|escape:'htmlall':'UTF-8'}{/if}" />
</div>
<div class="field">
<label for="passwd">{l s='Password:'}</label>
<input id="passwd" type="password" name="passwd" class="input password_field" value="{if isset($password)}{$password}{/if}"/>
</div>
<div class="field">
<input type="submit" name="submitLogin" value="{l s='Log in'}" class="button fl margin-right-5" />
<p class="fl no-margin hide ajax-loader">
<img src="../img/loader.gif" alt="" />
</p>
<p class="fr no-margin">
<a href="#" class="show-forgot-password">{l s='Lost password?'}</a>
</p>
<div class="clear"></div>
</div>
<input type="hidden" name="redirect" id="redirect" value="{$redirect}"/>
</form>
<form action="#" id="forgot_password_form" method="post" class="hide">
<h2 class="no-margin">{l s='Forgot your password?'}</h2>
<p class="bold">{l s='In order to receive your access code by email, please enter the address you provided during the registration process.'}</p>
<div class="field">
<label>{l s='Email address:'}</label>
<input type="text" name="email_forgot" id="email_forgot" class="input email_field" />
</div>
<div class="field">
<input type="submit" name="submit" value="{l s='Send'}" class="button fl margin-right-5" />
<p class="fl no-margin hide ajax-loader">
<img src="../img/loader.gif" alt="" />
</p>
<p class="fr no-margin">
<a href="#" class="show-login-form">{l s='Back to login'}</a>
</p>
<div class="clear"></div>
</div>
</form>
{else}
<div class="padding-30">
<p>{l s='For security reasons, you cannot connect to the Back Office until after you have:'}</p>
<ul>
{if isset($wrong_install_name) && $wrong_install_name == true}<li>{l s='deleted the /install folder'}</li>{/if}
{if isset($wrong_folder_name) && $wrong_folder_name == true}<li>{l s='renamed the /admin folder (e.g. %s)' sprintf=$randomNb}</li>{/if}
</ul>
<p><a href="{$adminUrl|escape:'htmlall':'UTF-8'}">{l s='Please then access this page by the new URL (e.g. %s)' sprintf=$adminUrl}</a></p>
</div>
{/if}
</div>
<h2><a href="http://www.prestashop.com">&copy; 2005 - {$smarty.now|date_format:"%Y"} Copyright by PrestaShop. all rights reserved.</a></h2>
</div>
@@ -321,6 +321,46 @@
catch(e){}
return false;
});
$('.toggle_favorite').live('click', function(event)
{
var el = $(this);
var value_pref = el.data('value');
var module_pref = el.data('module');
var action_pref = 'f';
try
{
resAjax = $.ajax({
type:"POST",
url : ajaxCurrentIndex,
async: true,
data : {
ajax : "1",
token : token,
controller : "AdminModules",
action : "saveFavoritePreferences",
action_pref : action_pref,
module_pref : module_pref,
value_pref : value_pref
},
success : function(data)
{
// res.status = cache or refresh
if (data == 'OK')
{
el.parent('div').find('.toggle_favorite').toggle();
}
},
error: function(res,textStatus,jqXHR)
{
//jAlert("TECHNICAL ERROR"+res);
}
});
}
catch(e){}
return false;
});
});
{/literal}
@@ -79,7 +79,18 @@
<p class="desc">{if isset($module->description) && $module->description ne ''}{l s='Description'} : {$module->description}{else}&nbsp;{/if}</p>
{if isset($module->message)}<div class="conf">{$module->message}</div>{/if}
<div class="row-actions-module">
{if !isset($module->not_on_disk)}{$module->optionsHtml}{else}&nbsp;{/if}
{if !isset($module->not_on_disk)}
{$module->optionsHtml}
{if isset($module->preferences) && $module->preferences['favorite'] == 1}
<a class="action_module action_unfavorite toggle_favorite" data-module="{$module->name}" data-value="0" href="#">{l s='Remove from Favorites'}</a>
<a class="action_module action_favorite toggle_favorite" data-module="{$module->name}" data-value="1" href="#" style="display: none;">{l s='Mark as Favorite'}</a>
{else}
<a class="action_module action_unfavorite toggle_favorite" data-module="{$module->name}" data-value="0" href="#" style="display: none;">{l s='Remove from Favorites'}</a>
<a class="action_module action_favorite toggle_favorite" data-module="{$module->name}" data-value="1" href="#">{l s='Mark as Favorite'}</a>
{/if}
{else}
&nbsp;
{/if}
</div>
</div>
</td>
@@ -26,7 +26,16 @@
<div id="productBox">
{include file='controllers/modules/header.tpl'}
{include file='controllers/modules/filters.tpl'}
{if $upgrade_available|@count}
<div class="hint" style="display:block;">
{l s='An upgrade is available for some of your modules!'}
<ul>
{foreach from=$upgrade_available item='module'}
<li> &raquo; <a href="{$currentIndex|escape:htmlall}&token={$token|escape:htmlall}&anchor=anchor{$module.anchor|escape:htmlall}"><b>{$module.name|escape:htmlall}</b></a></li>
{/foreach}
</ul>
</div>
{/if}
<ul class="view-modules">
<li class="button normal-view-disabled"><img src="themes/default/img/modules_view_layout_sidebar.png" alt="{l s='Normal view'}" border="0" /><span>{l s='Normal view'}</span></li>
<li class="button favorites-view"><a href="index.php?controller={$smarty.get.controller|htmlentities}&token={$smarty.get.token|htmlentities}&select=favorites"><img src="themes/default/img/modules_view_table_select_row.png" alt="{l s='Favorites view'}" border="0" /><span>{l s='Favorites view'}</span></a></li>
@@ -66,7 +66,7 @@
{else if !isset($module->not_on_disk)}
{$module->optionsHtml}
<div class="clear">&nbsp;</div>
<a href="#" class="button action_tab_module" data-option="select_{$module->name}" class="button">Valider</a>
<a href="#" class="button action_tab_module" data-option="select_{$module->name}" class="button">{l s='Submit'}</a>
{else}
<a href="{$module->options.install_url}" class="button">{l s='Install'}</a>
{/if}
@@ -22,22 +22,23 @@
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
{if $product.customizedDatas}
<tr class="customized customized-{$product.id_order_detail}">
<input type="hidden" class="edit_product_id_order_detail" value="{$product.id_order_detail}" />
<td align="center">{if isset($product.image) && $product.image->id}{$product.image_tag}{else}--{/if}</td>
{if $product['customizedDatas']}
<tr class="customized customized-{$product['id_order_detail']|intval}">
<td align="center">
<input type="hidden" class="edit_product_id_order_detail" value="{$product['id_order_detail']|intval}" />
{if isset($product['image']) && $product['image']->id|intval}{$product['image_tag']}{else}--{/if}</td>
<td>
<a href="index.php?controller=adminproducts&id_product={$product['product_id']}&updateproduct&token={getAdminToken tab='AdminProducts'}">
<a href="index.php?controller=adminproducts&id_product={$product['product_id']|intval}&updateproduct&token={getAdminToken tab='AdminProducts'}">
<span class="productName">{$product['product_name']} - {l s='Customized'}</span><br />
{if ($product['product_reference'])}{l s='Ref:'} {$product['product_reference']}<br />{/if}
{if ($product['product_supplier_reference'])}{l s='Ref Supplier:'} {$product['product_supplier_reference']}{/if}
</a>
</td>
<td align="center">
<span class="product_price_show">{displayPrice price=$product['product_price_wt'] currency=$currency->id}</span>
<span class="product_price_show">{displayPrice price=$product['product_price_wt'] currency=$currency->id|intval}</span>
{if $can_edit}
<span class="product_price_edit" style="display:none;">
<input type="hidden" name="product_id_order_detail" class="edit_product_id_order_detail" value="{$product['id_order_detail']}" />
<input type="hidden" name="product_id_order_detail" class="edit_product_id_order_detail" value="{$product['id_order_detail']|intval}" />
{if $currency->sign % 2}{$currency->sign}{/if}<input type="text" name="product_price_tax_excl" class="edit_product_price_tax_excl edit_product_price" value="{Tools::ps_round($product['unit_price_tax_excl'], 2)}" size="5" /> {if !($currency->sign % 2)}{$currency->sign}{/if} {l s='tax excl.'}<br />
{if $currency->sign % 2}{$currency->sign}{/if}<input type="text" name="product_price_tax_incl" class="edit_product_price_tax_incl edit_product_price" value="{Tools::ps_round($product['unit_price_tax_incl'], 2)}" size="5" /> {if !($currency->sign % 2)}{$currency->sign}{/if} {l s='tax incl.'}
</span>
@@ -49,32 +50,37 @@
{if $stock_management}<td align="center" class=""> - </td>{/if}
<td align="center" class="total_product">
{if ($order->getTaxCalculationMethod() == $smarty.const.PS_TAX_EXC)}
{displayPrice price=Tools::ps_round($product['product_price'] * $product['customizationQuantityTotal'], 2) currency=$currency->id}
{displayPrice price=Tools::ps_round($product['product_price'] * $product['customizationQuantityTotal'], 2) currency=$currency->id|intval}
{else}
{displayPrice price=Tools::ps_round($product['product_price_wt'] * $product['customizationQuantityTotal'], 2) currency=$currency->id}
{displayPrice price=Tools::ps_round($product['product_price_wt'] * $product['customizationQuantityTotal'], 2) currency=$currency->id|intval}
{/if}
</td>
<td class="cancelQuantity standard_refund_fields current-edit" style="display:none" colspan="2">
&nbsp;
</td>
<td class="edit_product_fields" colspan="2" style="display:none">&nbsp;</td>
<td class="partial_refund_fields current-edit" style="text-align:left;display:none"></td>
<td class="product_action" style="text-align:right">
<a href="#" class="edit_product_change_link"><img src="../img/admin/edit.gif" alt="{l s='Edit'}" /></a>
<input type="submit" class="button" name="submitProductChange" value="{l s='Update'}" style="display: none;" />
<a href="#" class="cancel_product_change_link" style="display: none;"><img src="../img/admin/disabled.gif" alt="{l s='Cancel'}" /></a>
<a href="#" class="delete_product_line"><img src="../img/admin/delete.gif" alt="{l s='Delete'}" /></a>
</td>
{if ($can_edit && !$order->hasBeenDelivered())}
<td class="product_action" style="text-align:right">
<a href="#" class="edit_product_change_link"><img src="../img/admin/edit.gif" alt="{l s='Edit'}" /></a>
<input type="submit" class="button" name="submitProductChange" value="{l s='Update'}" style="display: none;" />
<a href="#" class="cancel_product_change_link" style="display: none;"><img src="../img/admin/disabled.gif" alt="{l s='Cancel'}" /></a>
<a href="#" class="delete_product_line"><img src="../img/admin/delete.gif" alt="{l s='Delete'}" /></a>
</td>
{/if}
</tr>
{foreach $product.customizedDatas as $customizationPerAddress}
{foreach $product['customizedDatas'] as $customizationPerAddress}
{foreach $customizationPerAddress as $customizationId => $customization}
<tr class="customized customized-{$product.id_order_detail}">
<input type="hidden" class="edit_product_id_order_detail" value="{$product.id_order_detail}" />
<tr class="customized customized-{$product['id_order_detail']|intval}">
<td colspan="2">
<input type="hidden" class="edit_product_id_order_detail" value="{$product['id_order_detail']|intval}" />
{foreach $customization.datas as $type => $datas}
{if ($type == Product::CUSTOMIZE_FILE)}
<ul style="margin: 4px 0px 4px 0px; padding: 0px; list-style-type: none;">
{foreach from=$datas item=data}
<li style="margin: 2px;">
<span>{if $data['name']}{$data['name']}{else}{l s='Picture #'}{$data@iteration}{/if}{l s=':'}</span>&nbsp;
<a href="displayImage.php?img={$data['value']}&name={$order->id}-file{$data@iteration}" target="_blank"><img src="{$smarty.const._THEME_PROD_PIC_DIR_}{$data['value']}_small" alt="" /></a>
<a href="displayImage.php?img={$data['value']}&name={$order->id|intval}-file{$data@iteration}" target="_blank"><img src="{$smarty.const._THEME_PROD_PIC_DIR_}{$data['value']}_small" alt="" /></a>
</li>
{/foreach}
</ul>
@@ -90,10 +96,10 @@
<td align="center">-
</td>
<td align="center" class="productQuantity">
<span class="product_quantity_show">{$customization['quantity']}</span>
<span class="product_quantity_show{if (int)$customization['quantity'] > 1} red bold{/if}">{$customization['quantity']}</span>
{if $can_edit}
<span class="product_quantity_edit" style="display:none;">
<input type="text" name="product_quantity[{$customizationId}]" class="edit_product_quantity" value="{$customization['quantity']|htmlentities}" size="2" />
<input type="text" name="product_quantity[{$customizationId|intval}]" class="edit_product_quantity" value="{$customization['quantity']|htmlentities}" size="2" />
</span>
{/if}
</td>
@@ -104,36 +110,38 @@
</td>
<td align="center" class="total_product">
{if ($order->getTaxCalculationMethod() == $smarty.const.PS_TAX_EXC)}
{displayPrice price=Tools::ps_round($product['product_price'] * $customization['quantity'], 2) currency=$currency->id}
{displayPrice price=Tools::ps_round($product['product_price'] * $customization['quantity'], 2) currency=$currency->id|intval}
{else}
{displayPrice price=Tools::ps_round($product['product_price_wt'] * $customization['quantity'], 2) currency=$currency->id}
{displayPrice price=Tools::ps_round($product['product_price_wt'] * $customization['quantity'], 2) currency=$currency->id|intval}
{/if}
</td>
<td align="center" class="cancelCheck standard_refund_fields current-edit" style="display:none">
<input type="hidden" name="totalQtyReturn" id="totalQtyReturn" value="{$customization['quantity_returned']}" />
<input type="hidden" name="totalQty" id="totalQty" value="{$customization['quantity']}" />
<input type="hidden" name="totalQtyReturn" id="totalQtyReturn" value="{$customization['quantity_returned']|intval}" />
<input type="hidden" name="totalQty" id="totalQty" value="{$customization['quantity']|intval}" />
<input type="hidden" name="productName" id="productName" value="{$product['product_name']}" />
{if ((!$order->hasBeenDelivered() OR Configuration::get('PS_ORDER_RETURN')) AND (int)($customization['quantity_returned']) < (int)($customization['quantity']))}
<input type="checkbox" name="id_order_detail[{$product['id_order_detail']}]" id="id_order_detail[{$product['id_order_detail']}]" value="{$product['id_order_detail']}" onchange="setCancelQuantity(this, {$product['id_order_detail']}, {$customization['quantity'] - $product['customizationQuantityTotal'] - $product['product_quantity_reinjected']})" {if ($product['product_quantity_return'] + $product['product_quantity_refunded'] >= $product['product_quantity'])}disabled="disabled" {/if}/>
<input type="checkbox" name="id_customization[{$customizationId|intval}]" id="id_customization[{$customizationId|intval}]" value="{$product['id_order_detail']|intval}" onchange="setCancelQuantity(this, {$customizationId|intval}, {$customization['quantity'] - $product['customizationQuantityTotal'] - $product['product_quantity_reinjected']})" {if ($product['product_quantity_return'] + $product['product_quantity_refunded'] >= $product['product_quantity'])}disabled="disabled" {/if}/>
{else}
--
{/if}
</td>
<td class="cancelQuantity standard_refund_fields current-edit" style="display:none">
{if ($customization['quantity_returned'] + $customization['quantity_refunded'] >= $customization['quantity'])}
<input type="hidden" name="cancelQuantity[{$product['id_order_detail']}]" value="0" />
<input type="hidden" name="cancelCustomizationQuantity[{$customizationId|intval}]" value="0" />
{elseif (!$order->hasBeenDelivered() OR Configuration::get('PS_ORDER_RETURN'))}
<input type="text" id="cancelQuantity_{$product['id_order_detail']}" name="cancelQuantity[{$product['id_order_detail']}]" size="2" onclick="selectCheckbox(this);" value="" />0/{$customization['quantity']-$customization['quantity_refunded']}
<input type="text" id="cancelQuantity_{$customizationId|intval}" name="cancelCustomizationQuantity[{$customizationId|intval}]" size="2" onclick="selectCheckbox(this);" value="" />0/{$customization['quantity']-$customization['quantity_refunded']}
{/if}
</td>
<td class="partial_refund_fields current-edit" style="text-align:left;display:none">
<div style="width:40%;margin-top:5px;float:left">{l s='Quantity:'}</div> <div style="width:60%;margin-top:2px;float:left"><input type="text" size="3" name="partialRefundProductQuantity[{$product['id_order_detail']}]" value="0" />
<div style="width:40%;margin-top:5px;float:left">{l s='Quantity:'}</div> <div style="width:60%;margin-top:2px;float:left"><input type="text" size="3" name="partialRefundProductQuantity[{$product['id_order_detail']|intval}]" value="0" />
0/{$customization['quantity']-$customization['quantity_refunded']}
</div>
<div style="width:40%;margin-top:5px;float:left">{l s='Amount:'}</div> <div style="width:60%;margin-top:2px;float:left">{$currency->prefix}<input type="text" size="3" name="partialRefundProduct[{$product['id_order_detail']}]" />{$currency->suffix}</div>
<td class="edit_product_fields" colspan="2" style="display:none"></td>
<td class="product_action" style="text-align:right">
<div style="width:40%;margin-top:5px;float:left">{l s='Amount:'}</div> <div style="width:60%;margin-top:2px;float:left">{$currency->prefix}<input type="text" size="3" name="partialRefundProduct[{$product['id_order_detail']|intval}]" />{$currency->suffix}</div>
</td>
{if ($can_edit && !$order->hasBeenDelivered())}
<td class="edit_product_fields" colspan="2" style="display:none"></td>
<td class="product_action" style="text-align:right"></td>
{/if}
</tr>
{/foreach}
{/foreach}
@@ -49,7 +49,7 @@
{/if}
</td>
<td align="center" class="productQuantity">
<span class="product_quantity_show">{$product['product_quantity']}</span>
<span class="product_quantity_show{if (int)$product['product_quantity'] > 1} red bold{/if}">{$product['product_quantity']}</span>
{if $can_edit}
<span class="product_quantity_edit" style="display:none;">
<input type="text" name="product_quantity" class="edit_product_quantity" value="{$product['product_quantity']|htmlentities}" size="2" />
@@ -24,7 +24,7 @@
*}
<script type="text/javascript">
var id_cart = {$cart->id|intval};
var id_customer = '';
var id_customer = 0;
var changed_shipping_price = false;
var shipping_price_selected_carrier = '';
var current_index = '{$current}&token={$token}';
@@ -464,6 +464,7 @@
$('#summary_part').show();
var address_link = $('#new_address').attr('href');
id_customer = idCustomer;
id_cart = 0;
$('#new_address').attr('href', address_link.replace(/id_customer=[0-9]+/, 'id_customer='+id_customer));
$.ajax({
type:"POST",
@@ -317,8 +317,8 @@
line = line.replace(/image_path/g, path);
line = line.replace(/image_position/g, position);
line = line.replace(/blank/g, cover);
line = line.replace("<tbody>", "");
line = line.replace("</tbody>", "");
line = line.replace(/<tbody>/gi, "");
line = line.replace(/<\/tbody>/gi, "");
if (shops != false)
{
$.each(shops, function(key, value){
@@ -227,7 +227,7 @@
{else}
<div class="hint clear" style="display: block;width: 70%;">{l s='You cannot edit your file here because you used combinations. Please edit this file in the Combinations tab.'}</div>
<br />
{$error_product_download}
{if isset($error_product_download)}{$error_product_download}{/if}
{/if}
</table>
</div>
+24 -26
View File
@@ -22,33 +22,31 @@
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
<div style="clear:both;height:0;line-height:0">&nbsp;</div>
</div>
<div style="clear:both;height:0;line-height:0">&nbsp;</div>
<div style="clear:both;height:0;line-height:0">&nbsp;</div>
</div>
<div style="clear:both;height:0;line-height:0">&nbsp;</div>
</div>
{if $display_footer}
{hook h="displayBackOfficeFooter"}
<div id="footer">
<div class="footerLeft">
<a href="http://www.prestashop.com/" target="_blank">PrestaShop&trade; {$ps_version}</a><br />
<span>{l s='Load time: '}{number_format(microtime(true) - $timer_start, 3, '.', '')}s</span>
</div>
{if $display_footer}
{hook h="displayBackOfficeFooter"}
<div id="footer">
<div class="footerLeft">
<a href="http://www.prestashop.com/" target="_blank">PrestaShop&trade; {$ps_version}</a><br />
<span>{l s='Load time: '}{number_format(microtime(true) - $timer_start, 3, '.', '')}s</span>
</div>
<div class="footerRight">
{if $iso_is_fr}
<span>Questions / Renseignements / Formations :</span> <strong>+33 (0)1.40.18.30.04</strong> de 09h &agrave; 18h
{/if}
|&nbsp;<a href="http://www.prestashop.com/en/contact_us/" target="_blank" class="footer_link">{l s='Contact'}</a>
|&nbsp;<a href="http://forge.prestashop.com" target="_blank" class="footer_link">{l s='Bug Tracker'}</a>
|&nbsp;<a href="http://www.prestashop.com/forums/" target="_blank" class="footer_link">{l s='Forum'}</a>
</div>
<div class="footerRight">
{if $iso_is_fr}
<span>Questions / Renseignements / Formations :</span> <strong>+33 (0)1.40.18.30.04</strong> de 09h &agrave; 18h
{/if}
|&nbsp;<a href="http://www.prestashop.com/en/contact_us/" target="_blank" class="footer_link">{l s='Contact'}</a>
|&nbsp;<a href="http://forge.prestashop.com" target="_blank" class="footer_link">{l s='Bug Tracker'}</a>
|&nbsp;<a href="http://www.prestashop.com/forums/" target="_blank" class="footer_link">{l s='Forum'}</a>
</div>
</div>
</div>
<div id="ajax_confirmation" style="display:none"></div>
{* ajaxBox allows*}
<div id="ajaxBox" style="display:none"></div>
{/if}
<div id="scrollTop"><a href="#top"></a></div>
</body>
</html>
</div>
<div id="ajax_confirmation" style="display:none"></div>
{* ajaxBox allows*} <div id="ajaxBox" style="display:none"></div>
{/if}
<div id="scrollTop"><a href="#top"></a></div>
</body>
</html>
+34 -46
View File
@@ -82,7 +82,6 @@
<script type="text/javascript" src="{$js_uri}"></script>
{/foreach}
{/if}
<link rel="icon" type="image/vnd.microsoft.icon" href="{$img_dir}favicon.ico" />
<link rel="shortcut icon" type="image/x-icon" href="{$img_dir}favicon.ico" />
{if isset($displayBackOfficeHeader)}
@@ -91,16 +90,15 @@
<!--[if IE]>
<link type="text/css" rel="stylesheet" href="{$base_url}css/admin-ie.css" />
<![endif]-->
{if isset($brightness)}
{if isset($brightness)}
<style type="text/css">
div#header_infos, div#header_infos a#header_shopname, div#header_infos a#header_logout, div#header_infos a#header_foaccess {ldelim}color:{$brightness}{rdelim}
</style>
{/if}
{/if}
</head>
<body style="{if isset($bo_color) && $bo_color}background:{$bo_color};{/if}{if isset($bo_width) && $bo_width > 0}text-align:center;{/if}">
{if $display_header}
<div id="ajax_running"><img src="../img/admin/ajax-loader-yellow.gif" alt="" /> {l s='Loading...'}</div>
<div id="top_container" {if $bo_width > 0}style="margin:auto;width:{$bo_width}px"{/if}>
<div id="container">
{* begin HEADER *}
@@ -108,7 +106,7 @@
<div id="header_infos">
<a id="header_shopname" href="{$link->getAdminLink('AdminHome')|escape:'htmlall':'UTF-8'}"><span>{$shop_name}</span></a>
<div id="notifs_icon_wrapper">
{if {$show_new_orders} == 1}
{if {$show_new_orders} == 1}
<div id="orders_notif" class="notifs">
<span id="orders_notif_number_wrapper" class="number_wrapper">
<span id="orders_notif_value">0</span>
@@ -120,8 +118,8 @@
<p><a href="index.php?controller=AdminOrders&amp;token={getAdminToken tab='AdminOrders'}">{l s='Show all orders'}</a></p>
</div>
</div>
{/if}
{if ($show_new_customers == 1)}
{/if}
{if ($show_new_customers == 1)}
<div id="customers_notif" class="notifs notifs_alternate">
<span id="customers_notif_number_wrapper" class="number_wrapper">
<span id="customers_notif_value">0</span>
@@ -133,8 +131,8 @@
<p><a href="index.php?controller=AdminCustomers&amp;token={getAdminToken tab='AdminCustomers'}">{l s='Show all customers'}</a></p>
</div>
</div>
{/if}
{if {$show_new_messages} == 1}
{/if}
{if {$show_new_messages} == 1}
<div id="customer_messages_notif" class="notifs">
<span id="customer_messages_notif_number_wrapper" class="number_wrapper">
<span id="customer_messages_notif_value">0</span>
@@ -146,9 +144,8 @@
<p><a href="index.php?tab=AdminCustomerThreads&amp;token={getAdminToken tab='AdminCustomerThreads'}">{l s='Show all messages'}</a></p>
</div>
</div>
{/if}
{/if}
</div>
<div id="employee_box">
<div id="employee_infos">
<div class="employee_name">{l s='Welcome,'} <strong>{$first_name}&nbsp;{$last_name}</strong></div>
@@ -157,14 +154,13 @@
<li><a href="{$link->getAdminLink('AdminEmployees')|escape:'htmlall':'UTF-8'}&id_employee={$employee->id}&amp;updateemployee">{l s='My preferences'}</a></li>
<li class="separator">&nbsp;</li>
<li><a id="header_logout" href="index.php?logout">{l s='logout'}</a></li>
{if {$base_url}}
<li class="separator">&nbsp;</li>
<a href="{$base_url}" id="header_foaccess" target="_blank" title="{l s='View my shop'}">{l s='View my shop'}</a>
{/if}
{if {$base_url}}
<li class="separator">&nbsp;</li>
<a href="{$base_url}" id="header_foaccess" target="_blank" title="{l s='View my shop'}">{l s='View my shop'}</a>
{/if}
</ul>
</div>
</div>
<div id="header_search">
<form method="post" action="index.php?controller=AdminSearch&amp;token={getAdminToken tab='AdminSearch'}">
<input type="text" name="bo_query" id="bo_query" value="{$bo_query}" />
@@ -183,8 +179,7 @@
<input type="submit" id="bo_search_submit" class="button" value="{l s='Search'}"/>
</form>
</div>
{if count($quick_access) > 0}
{if count($quick_access) > 0}
<div id="header_quick">
<select onchange="quickSelect(this);" id="quick_select" class="chosen no-search">
<option value="0">{l s='Quick Access'}</option>
@@ -193,19 +188,15 @@
{/foreach}
</select>
</div>
{/if}
{if isset($displayBackOfficeTop)}
{$displayBackOfficeTop}
{/if}
{/if}
{if isset($displayBackOfficeTop)}{$displayBackOfficeTop}{/if}
</div>{* end header_infos*}
<ul id="menu">
{if !$tab}
<div class="mainsubtablist" style="display:none">
</div>
{/if}
{foreach $tabs AS $t}
{if $t.active}
{if !$tab}
<div class="mainsubtablist" style="display:none"></div>
{/if}
{foreach $tabs AS $t}
{if $t.active}
<li class="submenu_size maintab {if $t.current}active{/if}" id="maintab{$t.id_tab}">
<a href="#" class="title">
<img src="{$t.img}" alt="" />{if $t.name eq ''}{$t.class_name}{else}{$t.name}{/if}
@@ -218,23 +209,20 @@
{/foreach}
</ul>
</li>
{/if}
{/foreach}
{/if}
{/foreach}
</ul>
{/if}
</div>{* end header*}
</div>{* end header*}
{/if}
<div id="main">
<div id="content">
{if $display_header && $install_dir_exists}
<div style="background-color: #FFEBCC;border: 1px solid #F90;line-height: 20px;margin: 0px 0px 10px;padding: 10px 20px;">
{l s='For security reasons, you must also:'} {l s='delete the /install folder'}
</div>
{/if}
{if $display_header && $is_multishop && $shop_list && ($multishop_context & Shop::CONTEXT_GROUP || $multishop_context & Shop::CONTEXT_SHOP)}
<div class="multishop_toolbar">
<span class="text_multishop">{l s='Multistore configuration for'}</span>
{$shop_list}
</div>
{/if}
{if $display_header && $install_dir_exists}
<div style="background-color: #FFEBCC;border: 1px solid #F90;line-height: 20px;margin: 0px 0px 10px;padding: 10px 20px;">
{l s='For security reasons, you must also:'}&nbsp;{l s='delete the /install folder'}
</div>
{/if}
{if $display_header && $is_multishop && $shop_list && ($multishop_context & Shop::CONTEXT_GROUP || $multishop_context & Shop::CONTEXT_SHOP)}
<div class="multishop_toolbar">
<span class="text_multishop">{l s='Multistore configuration for'}</span> {$shop_list}
</div>
{/if}
@@ -116,6 +116,8 @@
{if isset($params.color) && isset($tr.color)}
</span>
{/if}
{/block}
{block name="close_td"}
</td>
{/block}
{/foreach}
@@ -189,8 +189,8 @@
<option value="0" {if $params.value == 0 && $params.value != ''} selected="selected" {/if}>{l s='No'}</option>
</select>
{elseif $params.type == 'date' || $params.type == 'datetime'}
{l s='From'} <input type="text" class="filter datepicker" id="{$params.id_date}_0" name="{$params.name_date}[0]" value="{if isset($value.0)}$value.0{/if}"{if isset($params.width)} style="width:70px"{/if}/><br />
{l s='To'} <input type="text" class="filter datepicker" id="{$params.id_date}_1" name="{$params.name_date}[1]" value="{if isset($value.1)}$value.1{/if}"{if isset($params.width)} style="width:70px"{/if}/>
{l s='From'} <input type="text" class="filter datepicker" id="{$params.id_date}_0" name="{$params.name_date}[0]" value="{if isset($params.value.0)}{$params.value.0}{/if}"{if isset($params.width)} style="width:70px"{/if}/><br />
{l s='To'} <input type="text" class="filter datepicker" id="{$params.id_date}_1" name="{$params.name_date}[1]" value="{if isset($params.value.1)}{$params.value.1}{/if}"{if isset($params.width)} style="width:70px"{/if}/>
{elseif $params.type == 'select'}
{if isset($params.filter_key)}
<select onchange="$('#submitFilterButton{$table}').focus();$('#submitFilterButton{$table}').click();" name="{$table}Filter_{$params.filter_key}" {if isset($params.width)} style="width:{$params.width}px"{/if}>
+1 -5
View File
@@ -47,7 +47,6 @@
{/if}
</div>
{/if}
{if isset($informations) && count($informations) && $informations}
<div class="hint clear" style="display:block;">
<span id="see_more_infos">
@@ -60,7 +59,6 @@
</div>
</div><br />
{/if}
{if isset($confirmations) && count($confirmations) && $confirmations}
<div class="conf" style="display:block;">
{foreach $confirmations as $conf}
@@ -68,7 +66,6 @@
{/foreach}
</div><br />
{/if}
{if count($warnings)}
<div class="warn">
<span style="float:right">
@@ -94,6 +91,5 @@
{/if}
</div>
{/if}
{$page}
{include file='footer.tpl'}
{include file='footer.tpl'}
+1 -1
View File
@@ -128,7 +128,7 @@ class CarrierCore extends ObjectModel
'max_width' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt'),
'max_height' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt'),
'max_depth' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt'),
'max_weight' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt'),
'max_weight' => array('type' => self::TYPE_FLOAT, 'validate' => 'isFloat'),
'grade' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt', 'size' => 1),
'external_module_name' => array('type' => self::TYPE_STRING, 'size' => 64),
'is_module' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'),
+12 -7
View File
@@ -953,6 +953,7 @@ class CartCore extends ObjectModel
$this->update(true);
$context = Context::getContext()->cloneContext();
$context->cart = $this;
Cache::clean('getContextualValue_*');
if ($auto_add_cart_rule)
CartRule::autoAddToCart($context);
@@ -1591,9 +1592,9 @@ class CartCore extends ObjectModel
*/
public function getPackageList($flush = false)
{
static $cache = false;
if ($cache !== false && !$flush)
return $cache;
static $cache = array();
if (isset($cache[(int)$this->id]) && $cache[(int)$this->id] !== false && !$flush)
return $cache[(int)$this->id];
$product_list = $this->getProducts();
// Step 1 : Get product informations (warehouse_list and carrier_list), count warehouse
@@ -1821,7 +1822,7 @@ class CartCore extends ObjectModel
);
}
}
$cache = $final_package_list;
$cache[(int)$this->id] = $final_package_list;
return $final_package_list;
}
@@ -2292,7 +2293,7 @@ class CartCore extends ObjectModel
$this->id_carrier = 0;
return;
}
Cache::clean('getContextualValue_*');
$delivery_option_list = $this->getDeliveryOptionList(null, true);
foreach ($delivery_option_list as $id_address => $options)
@@ -2869,8 +2870,12 @@ class CartCore extends ObjectModel
{
$cart_rule['value_real'] -= $total_shipping;
$cart_rule['value_tax_exc'] -= $total_shipping_tax_exc;
$total_discounts -= $total_shipping;
$total_discounts_tax_exc -= $total_shipping_tax_exc;
$cart_rule['value_real'] = Tools::ps_round($cart_rule['value_real'], (int)$context->currency->decimals * _PS_PRICE_DISPLAY_PRECISION_);
$cart_rule['value_tax_exc'] = Tools::ps_round($cart_rule['value_tax_exc'], (int)$context->currency->decimals * _PS_PRICE_DISPLAY_PRECISION_);
if ($total_discounts > $cart_rule['value_real'])
$total_discounts -= $total_shipping;
if ($total_discounts_tax_exc > $cart_rule['value_tax_exc'])
$total_discounts_tax_exc -= $total_shipping_tax_exc;
// Update total shipping
$total_shipping = 0;
+7 -7
View File
@@ -912,7 +912,7 @@ class CartRuleCore extends ObjectModel
if ($cart_vat_amount == 0 || $cart_amount_te == 0)
$cart_average_vat_rate = 0;
else
$cart_average_vat_rate = $cart_vat_amount / $cart_amount_te;
$cart_average_vat_rate = Tools::ps_round($cart_vat_amount / $cart_amount_te, 3);
if ($this->reduction_tax && !$use_tax)
$reduction_value += $prorata * $reduction_amount / (1 + $cart_average_vat_rate);
@@ -1079,12 +1079,12 @@ class CartRuleCore extends ObjectModel
if (!CartRule::isFeatureActive() || !Validate::isLoadedObject($context->cart))
return;
$result = Db::getInstance()->executeS('
$sql = '
SELECT cr.*
FROM '._DB_PREFIX_.'cart_rule cr
LEFT JOIN '._DB_PREFIX_.'cart_rule_shop crs ON cr.id_cart_rule = crs.id_cart_rule
LEFT JOIN '._DB_PREFIX_.'cart_rule_carrier crca ON cr.id_cart_rule = crca.id_cart_rule
'.($context->cart->id_carrier ? 'INNER JOIN '._DB_PREFIX_.'carrier c ON (c.id_reference = crca.id_carrier AND c.deleted = 0)' : '').'
'.($context->cart->id_carrier ? 'LEFT JOIN '._DB_PREFIX_.'carrier c ON (c.id_reference = crca.id_carrier AND c.deleted = 0)' : '').'
LEFT JOIN '._DB_PREFIX_.'cart_rule_country crco ON cr.id_cart_rule = crco.id_cart_rule
WHERE cr.active = 1
AND cr.code = ""
@@ -1108,9 +1108,9 @@ class CartRuleCore extends ObjectModel
'.($context->customer->id ? 'OR 0 < (
SELECT cg.id_group
FROM '._DB_PREFIX_.'customer_group cg
LEFT JOIN '._DB_PREFIX_.'cart_rule_group crg ON cg.id_group = crg.id_group
LEFT JOIN '._DB_PREFIX_.'cart_rule_group crg ON (cg.id_group = crg.id_group AND cg.id_group = '.(int)$context->customer->id_default_group.')
WHERE cr.id_cart_rule = crg.id_cart_rule
AND cg.id_customer = '.(int)$context->customer->id.'
AND cg.id_customer = '.(int)$context->customer->id.' LIMIT 1
)' : '').'
)
AND (
@@ -1122,8 +1122,8 @@ class CartRuleCore extends ObjectModel
)
)
AND cr.id_cart_rule NOT IN (SELECT id_cart_rule FROM '._DB_PREFIX_.'cart_cart_rule WHERE id_cart = '.(int)$context->cart->id.')
ORDER BY priority');
ORDER BY priority';
$result = Db::getInstance()->executeS($sql);
if ($result)
{
$cart_rules = ObjectModel::hydrateCollection('CartRule', $result);
+10 -8
View File
@@ -47,7 +47,6 @@ class ConfigurationTestCore
'upload' => false,
'gd' => false,
'mysql_support' => false,
'sessions' => false,
'config_dir' => 'config',
'cache_dir' => 'cache',
'sitemap' => 'sitemap.xml',
@@ -55,9 +54,9 @@ class ConfigurationTestCore
'img_dir' => 'img',
'mails_dir' => 'mails',
'module_dir' => 'modules',
'theme_lang_dir' => 'themes/'._THEME_NAME_.'/lang',
'theme_lang_dir' => 'themes/'._THEME_NAME_.'/lang/',
'theme_pdf_lang_dir' => 'themes/'._THEME_NAME_.'/pdf/lang/',
'theme_cache_dir' => 'themes/'._THEME_NAME_.'/cache',
'theme_cache_dir' => 'themes/'._THEME_NAME_.'/cache/',
'translations_dir' => 'translations',
'customizable_products_dir' => 'upload',
'virtual_products_dir' => 'download'
@@ -267,21 +266,24 @@ class ConfigurationTestCore
public static function test_theme_lang_dir($dir)
{
if (!file_exists($dir))
return true;
$absoluteDir = rtrim(_PS_ROOT_DIR_, '\\/').DIRECTORY_SEPARATOR.trim($dir, '\\/');
if (!file_exists($absoluteDir))
return true;
return ConfigurationTest::test_dir($dir, true);
}
public static function test_theme_pdf_lang_dir($dir)
{
if (!file_exists($dir))
$absoluteDir = rtrim(_PS_ROOT_DIR_, '\\/').DIRECTORY_SEPARATOR.trim($dir, '\\/');
if (!file_exists($absoluteDir))
return true;
return ConfigurationTest::test_dir($dir, true);
}
public static function test_theme_cache_dir($dir)
{
if (!file_exists($dir))
$absoluteDir = rtrim(_PS_ROOT_DIR_, '\\/').DIRECTORY_SEPARATOR.trim($dir, '\\/');
if (!file_exists($absoluteDir))
return true;
return ConfigurationTest::test_dir($dir, true);
}
@@ -317,4 +319,4 @@ class ConfigurationTestCore
{
return extension_loaded('Dom');
}
}
}
+2 -2
View File
@@ -66,8 +66,8 @@ class GenderCore extends ObjectModel
public function getImage($use_unknown = false)
{
if (!file_exists(_PS_GENDERS_DIR_.$this->id.'.jpg'))
return ($use_unknown) ? _PS_ADMIN_IMG_.'unknown.gif' : false;
if (!isset($this->id) || empty($this->id) || !file_exists(_PS_GENDERS_DIR_.$this->id.'.jpg'))
return _THEME_GENDERS_DIR_.'Unknown.jpg';
return _THEME_GENDERS_DIR_.$this->id.'.jpg';
}
}
+2 -2
View File
@@ -274,8 +274,9 @@ class HookCore extends ObjectModel
// For payment modules, we check that they are available in the contextual country
elseif ($frontend)
{
$sql->where(Module::getPaypalIgnore());
if (Validate::isLoadedObject($context->country))
$sql->where('(h.name = "displayPayment" AND (SELECT id_country FROM '._DB_PREFIX_.'module_country mc WHERE mc.id_module = m.id_module AND id_country = '.(int)$context->country->id.' LIMIT 1) = '.(int)$context->country->id.')');
$sql->where('(h.name = "displayPayment" AND (SELECT id_country FROM '._DB_PREFIX_.'module_country mc WHERE mc.id_module = m.id_module AND id_country = '.(int)$context->country->id.' AND id_shop = '.(int)$context->shop->id.' LIMIT 1) = '.(int)$context->country->id.')');
if (Validate::isLoadedObject($context->currency))
$sql->where('(h.name = "displayPayment" AND (SELECT id_currency FROM '._DB_PREFIX_.'module_currency mcr WHERE mcr.id_module = m.id_module AND id_currency IN ('.(int)$context->currency->id.', -2) LIMIT 1) IN ('.(int)$context->currency->id.', -2))');
}
@@ -286,7 +287,6 @@ class HookCore extends ObjectModel
{
$sql->leftJoin('module_group', 'mg', 'mg.`id_module` = m.`id_module`');
$sql->where('mg.`id_group` IN ('.implode(', ', $groups).')');
$sql->where(Module::getPaypalIgnore());
$sql->groupBy('hm.id_hook, hm.id_module');
}
+2
View File
@@ -801,6 +801,8 @@ class LanguageCore extends ObjectModel
$files_list = $gz->listContent();
if (!$gz->extract(_PS_TRANSLATIONS_DIR_.'../', false))
$errors[] = Tools::displayError('Cannot decompress the translation file for the following language: ').(string)$iso;
// Clear smarty modules cache
Tools::clearCache();
if (!Language::checkAndAddLanguage((string)$iso, $lang_pack, false, $params))
$errors[] = Tools::displayError('An error occurred while creating the language: ').(string)$iso;
else
+1 -1
View File
@@ -251,7 +251,7 @@ class MailCore
$template_vars['{shop_logo}'] = $message->attach(new Swift_Message_EmbeddedFile(new Swift_File($logo), null, ImageManager::getMimeTypeByExtension($logo)));
$template_vars['{shop_name}'] = Tools::safeOutput(Configuration::get('PS_SHOP_NAME', null, null, $id_shop));
$template_vars['{shop_url}'] = Tools::getShopDomain(true, true).__PS_BASE_URI__.'index.php';
$template_vars['{shop_url}'] = Context::getContext()->link->getPageLink('index', true, Context::getContext()->language->id);
$template_vars['{my_account_url}'] = Context::getContext()->link->getPageLink('my-account', true, Context::getContext()->language->id);
$template_vars['{guest_tracking_url}'] = Context::getContext()->link->getPageLink('guest-tracking', true, Context::getContext()->language->id);
$template_vars['{history_url}'] = Context::getContext()->link->getPageLink('history', true, Context::getContext()->language->id);
+15 -6
View File
@@ -940,8 +940,8 @@ abstract class ObjectModelCore
{
global $_FIELDS;
if (file_exists(_PS_TRANSLATIONS_DIR_.Context::getContext()->language->iso_code.'/fields.php'))
include(_PS_TRANSLATIONS_DIR_.Context::getContext()->language->iso_code.'/fields.php');
if ($_FIELDS === null && file_exists(_PS_TRANSLATIONS_DIR_.Context::getContext()->language->iso_code.'/fields.php'))
include_once(_PS_TRANSLATIONS_DIR_.Context::getContext()->language->iso_code.'/fields.php');
$key = $class.'_'.md5($field);
return ((is_array($_FIELDS) && array_key_exists($key, $_FIELDS)) ? ($htmlentities ? htmlentities($_FIELDS[$key], ENT_QUOTES, 'utf-8') : $_FIELDS[$key]) : $field);
@@ -1536,14 +1536,23 @@ abstract class ObjectModelCore
foreach($suffixs as $suffix)
{
foreach ($this->{'fieldsValidate'.$suffix} as $field => $validate)
{
$this->def['fields'][$field]['validate'] = $validate;
if ($suffix == 'Lang')
$this->def['fields'][$field]['lang'] = true;
}
foreach ($this->{'fieldsRequired'.$suffix} as $field)
{
$this->def['fields'][$field]['required'] = true;
if ($suffix == 'Lang')
$this->def['fields'][$field]['lang'] = true;
}
foreach ($this->{'fieldsSize'.$suffix} as $field => $size)
{
$this->def['fields'][$field]['size'] = $size;
if ($suffix == 'Lang')
$this->def['fields'][$field]['lang'] = true;
}
}
}
}
@@ -1587,4 +1596,4 @@ abstract class ObjectModelCore
{
$this->update_fields = $fields;
}
}
}
+4 -2
View File
@@ -429,12 +429,14 @@ abstract class PaymentModuleCore extends Module
// Set the new voucher value
if ($voucher->reduction_tax)
$voucher->reduction_amount = $values['tax_incl'] - $order->total_products_wt;
$voucher->reduction_amount = $values['tax_incl'] - $order->total_products_wt - $order->total_shipping_tax_incl;
else
$voucher->reduction_amount = $values['tax_excl'] - $order->total_products;
$voucher->reduction_amount = $values['tax_excl'] - $order->total_products - $order->total_shipping_tax_excl;
$voucher->id_customer = $order->id_customer;
$voucher->quantity = 1;
$voucher->quantity_per_user = 1;
$voucher->free_shipping = 0;
if ($voucher->add())
{
// If the voucher has conditions, they are now copied to the new voucher
+8 -1
View File
@@ -458,6 +458,10 @@ class ProductCore extends ObjectModel
$this->tax_rate = $this->getTaxesRate(new Address($address));
$this->new = $this->isNew();
// keep base price
$this->base_price = $this->price;
$this->price = Product::getPriceStatic((int)$this->id, false, null, 6, null, false, true, 1, false, null, null, null, $this->specificPrice);
$this->unit_price = ($this->unit_price_ratio != 0 ? $this->price / $this->unit_price_ratio : 0);
if ($this->id)
@@ -2135,7 +2139,10 @@ class ProductCore extends ObjectModel
$sql = 'SELECT p.*, product_shop.*, stock.`out_of_stock` out_of_stock, pl.`description`, pl.`description_short`,
pl.`link_rewrite`, pl.`meta_description`, pl.`meta_keywords`, pl.`meta_title`, pl.`name`,
p.`ean13`, p.`upc`, MAX(image_shop.`id_image`) id_image, il.`legend`
p.`ean13`, p.`upc`, MAX(image_shop.`id_image`) id_image, il.`legend`,
DATEDIFF(product_shop.`date_add`, DATE_SUB(NOW(),
INTERVAL '.(Validate::isUnsignedInt(Configuration::get('PS_NB_DAYS_NEW_PRODUCT')) ? Configuration::get('PS_NB_DAYS_NEW_PRODUCT') : 20).'
DAY)) > 0 AS new
FROM `'._DB_PREFIX_.'product` p
LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (
p.`id_product` = pl.`id_product`
+1 -1
View File
@@ -175,7 +175,7 @@ class ProductDownloadCore extends ObjectModel
{
if (!ProductDownload::isFeatureActive())
return false;
if (array_key_exists($id_product, self::$_productIds))
if (array_key_exists((int)$id_product, self::$_productIds))
return self::$_productIds[$id_product];
self::$_productIds[$id_product] = (int)Db::getInstance()->getValue('
SELECT `id_product_download`
+2 -4
View File
@@ -65,11 +65,9 @@ class ProductSaleCore
{
if ($page_number < 0) $page_number = 0;
if ($nb_products < 1) $nb_products = 10;
$final_order_by = $order_by;
if (empty($order_by) || $order_by == 'position' || $order_by = 'price') $order_by = 'sales';
if (empty($order_way) || $order_by == 'sales') $order_way = 'DESC';
if (is_null($order_by) || $order_by == 'position' || $order_by == 'price') $order_by = 'sales';
if (is_null($order_way) || $order_by == 'sales') $order_way == 'DESC';
$groups = FrontController::getCurrentCustomerGroups();
$sql_groups = (count($groups) ? 'IN ('.implode(',', $groups).')' : '= 1');
$interval = Validate::isUnsignedInt(Configuration::get('PS_NB_DAYS_NEW_PRODUCT')) ? Configuration::get('PS_NB_DAYS_NEW_PRODUCT') : 20;
+2 -2
View File
@@ -280,7 +280,7 @@ class SpecificPriceRuleCore extends ObjectModel
$specific_price->id_currency = (int)$rule->id_currency;
$specific_price->id_group = (int)$rule->id_group;
$specific_price->from_quantity = (int)$rule->from_quantity;
$specific_price->price = (int)$rule->price;
$specific_price->price = (float)$rule->price;
$specific_price->reduction_type = $rule->reduction_type;
$specific_price->reduction = ($rule->reduction_type == 'percentage' ? $rule->reduction / 100 : (float)$rule->reduction);
$specific_price->from = $rule->from;
@@ -288,4 +288,4 @@ class SpecificPriceRuleCore extends ObjectModel
return $specific_price->add();
}
}
}
+19 -15
View File
@@ -1562,6 +1562,9 @@ class ToolsCore
fwrite($write_fd, "# .htaccess automaticaly generated by PrestaShop e-commerce open-source solution\n");
fwrite($write_fd, "# http://www.prestashop.com - http://www.prestashop.com/forums\n\n");
if ($disable_modsec)
fwrite($write_fd, "<IfModule mod_security.c>\nSecFilterEngine Off\nSecFilterScanPOST Off\n</IfModule>\n");
// RewriteEngine
fwrite($write_fd, "<IfModule mod_rewrite.c>\n");
@@ -1569,9 +1572,6 @@ class ToolsCore
if ($disable_multiviews)
fwrite($write_fd, "\n# Disable Multiviews\nOptions -Multiviews\n\n");
if ($disable_modsec)
fwrite($write_fd, "<IfModule mod_security.c>\nSecFilterEngine Off\nSecFilterScanPOST Off\n</IfModule>");
fwrite($write_fd, "RewriteEngine on\n");
if (!$medias)
@@ -1598,8 +1598,10 @@ class ToolsCore
// Webservice
fwrite($write_fd, 'RewriteRule ^api/?(.*)$ %{ENV:REWRITEBASE}webservice/dispatcher.php?url=$1 [QSA,L]'."\n\n");
$rewrite_settings = (int)Configuration::get('PS_REWRITING_SETTINGS', null, null, (int)$uri['id_shop']);
if (!$rewrite_settings)
$rewrite_settings = (int)Configuration::get('PS_REWRITING_SETTINGS', null, null, (int)$uri['id_shop']);
$domain_rewrite_cond = 'RewriteCond %{HTTP_HOST} ^'.$domain.'$'."\n";
// Rewrite virtual multishop uri
if ($uri['virtual'])
@@ -2115,11 +2117,14 @@ exit;
*
* @param Smarty $smarty
*/
public static function clearCache($smarty, $tpl = false, $cache_id = null, $compile_id = null)
public static function clearCache($smarty = null, $tpl = false, $cache_id = null, $compile_id = null)
{
if (is_null($smarty))
if ($smarty === null)
$smarty = Context::getContext()->smarty;
if ($smarty === null)
return;
if (!$tpl && $cache_id === null && $compile_id === null)
return $smarty->clearAllCache();
@@ -2345,16 +2350,16 @@ exit;
$addons_url = 'api.addons.prestashop.com';
$postData = '';
$postDataArray = array(
'version' => _PS_VERSION_,
'iso_lang' => strtolower(Context::getContext()->language->iso_code),
'iso_code' => strtolower(Country::getIsoById(Configuration::get('PS_COUNTRY_DEFAULT'))),
'shop_url' => urlencode(Tools::getShopDomain()),
'mail' => urlencode(Configuration::get('PS_SHOP_EMAIL'))
'version' => isset($params['version']) ? $params['version'] : _PS_VERSION_,
'iso_lang' => Tools::strtolower(isset($params['iso_lang']) ? $params['iso_lang'] : Context::getContext()->language->iso_code),
'iso_code' => Tools::strtolower(isset($params['iso_country']) ? $params['iso_country'] : Country::getIsoById(Configuration::get('PS_COUNTRY_DEFAULT'))),
'shop_url' => urlencode(isset($params['shop_url']) ? $params['shop_url'] : Tools::getShopDomain()),
'mail' => urlencode(isset($params['email']) ? $params['email'] : Configuration::get('email'))
);
foreach ($postDataArray as $postDataKey => $postDataValue)
$postData .= '&'.$postDataKey.'='.$postDataValue;
$postData = ltrim($postData, '&');
// Config for each request
if ($request == 'native')
{
@@ -2452,4 +2457,3 @@ function cmpPriceDesc($a, $b)
return -1;
return 0;
}
+1 -1
View File
@@ -129,7 +129,7 @@ class TranslateCore
static $translations_merged = array();
$name = $module instanceof Module ? $module->name : $module;
if (!isset($translations_merged[$name]))
if (!isset($translations_merged[$name]) && isset(Context::getContext()->language))
{
$filesByPriority = array(
// Translations in theme
+6 -7
View File
@@ -205,7 +205,6 @@ abstract class CacheCore
foreach ($this->keys as $k => $ttl)
if (preg_match('#^'.$pattern.'$#', $k))
$keys[] = $k;
}
// Delete keys
@@ -235,13 +234,13 @@ abstract class CacheCore
if (is_null($this->sql_tables_cached))
{
$this->sql_tables_cached = $this->get(self::SQL_TABLES_NAME);
$this->sql_tables_cached = $this->get(_COOKIE_IV_.self::SQL_TABLES_NAME);
if (!is_array($this->sql_tables_cached))
$this->sql_tables_cached = array();
}
// Store query results in cache if this query is not already cached
$key = md5($query);
$key = md5(_COOKIE_IV_.$query);
if ($this->exists($key))
return true;
$this->set($key, $result);
@@ -251,7 +250,7 @@ abstract class CacheCore
foreach ($tables as $table)
if (!isset($this->sql_tables_cached[$table][$key]))
$this->sql_tables_cached[$table][$key] = true;
$this->set(self::SQL_TABLES_NAME, $this->sql_tables_cached);
$this->set(_COOKIE_IV_.self::SQL_TABLES_NAME, $this->sql_tables_cached);
}
protected function getTables($string)
@@ -271,7 +270,7 @@ abstract class CacheCore
{
if (is_null($this->sql_tables_cached))
{
$this->sql_tables_cached = $this->get(self::SQL_TABLES_NAME);
$this->sql_tables_cached = $this->get(_COOKIE_IV_.self::SQL_TABLES_NAME);
if (!is_array($this->sql_tables_cached))
$this->sql_tables_cached = array();
}
@@ -287,7 +286,7 @@ abstract class CacheCore
}
unset($this->sql_tables_cached[$table]);
}
$this->set(self::SQL_TABLES_NAME, $this->sql_tables_cached);
$this->set(_COOKIE_IV_.self::SQL_TABLES_NAME, $this->sql_tables_cached);
}
/**
@@ -326,7 +325,7 @@ abstract class CacheCore
public static function clean($key)
{
if (strpos($key, '*'))
if (strpos($key, '*') !== false)
{
$regexp = str_replace('\\*', '.*', preg_quote($key, '#'));
foreach (array_keys(Cache::$local) as $key)
+14 -13
View File
@@ -443,7 +443,8 @@ class AdminControllerCore extends Controller
if (isset($_GET) && !empty($_GET) && isset($this->table))
foreach ($_GET as $key => $value)
if (stripos($key, $this->table.'OrderBy') === 0 || stripos($key, $this->table.'Orderway') === 0)
$this->context->cookie->$key = $value;
$this->context->cookie->{$prefix.$key} = $value;
$filters = $this->context->cookie->getFamily($prefix.$this->table.'Filter_');
foreach ($filters as $key => $value)
{
@@ -885,11 +886,11 @@ class AdminControllerCore extends Controller
if (isset($this->context->cookie->{'submitFilter'.$this->table}))
unset($this->context->cookie->{'submitFilter'.$this->table});
if (isset($this->context->cookie->{$this->table.'Orderby'}))
unset($this->context->cookie->{$this->table.'Orderby'});
if (isset($this->context->cookie->{$prefix.$this->table.'Orderby'}))
unset($this->context->cookie->{$prefix.$this->table.'Orderby'});
if (isset($this->context->cookie->{$this->table.'Orderway'}))
unset($this->context->cookie->{$this->table.'Orderway'});
if (isset($this->context->cookie->{$prefix.$this->table.'Orderway'}))
unset($this->context->cookie->{$prefix.$this->table.'Orderway'});
unset($_POST);
$this->_filter = false;
@@ -2045,11 +2046,11 @@ class AdminControllerCore extends Controller
if (!Validate::isTableOrIdentifier($this->table))
throw new PrestaShopException(sprintf('Table name %s is invalid:', $this->table));
$prefix = str_replace(array('admin', 'controller'), '', Tools::strtolower(get_class($this)));
if (empty($order_by))
{
if ($this->context->cookie->{$this->table.'Orderby'})
$order_by = $this->context->cookie->{$this->table.'Orderby'};
if ($this->context->cookie->{$prefix.$this->table.'Orderby'})
$order_by = $this->context->cookie->{$prefix.$this->table.'Orderby'};
elseif ($this->_orderBy)
$order_by = $this->_orderBy;
else
@@ -2058,8 +2059,8 @@ class AdminControllerCore extends Controller
if (empty($order_way))
{
if ($this->context->cookie->{$this->table.'Orderway'})
$order_way = $this->context->cookie->{$this->table.'Orderway'};
if ($this->context->cookie->{$prefix.$this->table.'Orderway'})
$order_way = $this->context->cookie->{$prefix.$this->table.'Orderway'};
elseif ($this->_orderWay)
$order_way = $this->_orderWay;
else
@@ -2298,7 +2299,7 @@ class AdminControllerCore extends Controller
else
{
$fieldValue = $this->getFieldValue($obj, $input['name']);
if (empty($fieldValue) && isset($input['default_value']))
if ($fieldValue === false && isset($input['default_value']))
$fieldValue = $input['default_value'];
$this->fields_value[$input['name']] = $fieldValue;
}
@@ -2320,9 +2321,9 @@ class AdminControllerCore extends Controller
public function getFieldValue($obj, $key, $id_lang = null)
{
if ($id_lang)
$default_value = ($obj->id && isset($obj->{$key}[$id_lang])) ? $obj->{$key}[$id_lang] : '';
$default_value = ($obj->id && isset($obj->{$key}[$id_lang])) ? $obj->{$key}[$id_lang] : false;
else
$default_value = isset($obj->{$key}) ? $obj->{$key} : '';
$default_value = isset($obj->{$key}) ? $obj->{$key} : false;
return Tools::getValue($key.($id_lang ? '_'.$id_lang : ''), $default_value);
}
+1 -1
View File
@@ -176,7 +176,7 @@ abstract class ControllerCore
if ($this->ajax)
{
$action = Tools::getValue('action');
if (!empty($action) && method_exists($this, 'displayAjax'.Tools::toCamelCase($action, true)))
if (!empty($action) && method_exists($this, 'displayAjax'.Tools::toCamelCase($action, true)))
$this->{'displayAjax'.$action}();
elseif (method_exists($this, 'displayAjax'))
$this->displayAjax();
+5 -2
View File
@@ -398,7 +398,7 @@ class FrontControllerCore extends Controller
$this->displayRestrictedCountryPage();
if (Tools::isSubmit('live_edit') && !$this->checkLiveEditAccess())
die(Tools::displayError());
Tools::redirect('index.php?controller=404');
$this->iso = $iso;
@@ -705,7 +705,7 @@ class FrontControllerCore extends Controller
$this->addJS(_THEME_MOBILE_JS_DIR_.'jqm-docs.js');
$this->addJS(_PS_JS_DIR_.'tools.js');
$this->addJS(_THEME_MOBILE_JS_DIR_.'global.js');
$this->addjqueryPlugin('fancybox');
$this->addjqueryPlugin('fancybox');
$this->addCSS(_THEME_MOBILE_CSS_DIR_.'jquery.mobile-1.3.0.min.css', 'all');
$this->addCSS(_THEME_MOBILE_CSS_DIR_.'jqm-docs.css', 'all');
@@ -721,6 +721,9 @@ class FrontControllerCore extends Controller
$this->setMobileMedia();
return true;
}
if (Tools::file_exists_cache(_PS_ROOT_DIR_.Tools::str_replace_once(__PS_BASE_URI__, DIRECTORY_SEPARATOR, _THEME_CSS_DIR_.'grid_prestashop.css')))
$this->addCSS(_THEME_CSS_DIR_.'grid_prestashop.css', 'all');
$this->addCSS(_THEME_CSS_DIR_.'global.css', 'all');
$this->addjquery();
$this->addjqueryPlugin('easing');
+8 -6
View File
@@ -60,7 +60,7 @@ abstract class ModuleCore
/** @var int need_instance */
public $need_instance = 1;
/** @var string Admin tab correponding to the module */
/** @var string Admin tab corresponding to the module */
public $tab = null;
/** @var boolean Status */
@@ -139,8 +139,9 @@ abstract class ModuleCore
public function __construct($name = null, Context $context = null)
{
// Load context and smarty
$this->context = $context ? $context : Context::getContext();
$this->smarty = $this->context->smarty->createData($this->context->smarty);
$this->context = $context ? $context : Context::getContext();
if (is_object($this->context->smarty))
$this->smarty = $this->context->smarty->createData($this->context->smarty);
// If the module has no name we gave him its id as name
if ($this->name == null)
@@ -152,8 +153,9 @@ abstract class ModuleCore
// If cache is not generated, we generate it
if (self::$modules_cache == null && !is_array(self::$modules_cache))
{
// Join clause is done to check if the module is activated in current shop context
$sql_limit_shop = 'SELECT COUNT(*) FROM `'._DB_PREFIX_.'module_shop` ms WHERE m.`id_module` = ms.`id_module` AND ms.`id_shop` = '.(int)Context::getContext()->shop->id;
// Join clause is done to check if the module is activated in current shop context
$sql_limit_shop = 'SELECT COUNT(*) FROM `'._DB_PREFIX_.'module_shop` ms WHERE m.`id_module` = ms.`id_module` AND ms.`id_shop` = '.((is_object(Context::getContext()->shop) && $id = (int)Context::getContext()->shop->id) ? $id : 1);
$sql = 'SELECT m.`id_module`, m.`name`, ('.$sql_limit_shop.') as total FROM `'._DB_PREFIX_.'module` m';
// Result is cached
@@ -1595,7 +1597,7 @@ abstract class ModuleCore
{
if ($name === null)
$name = $this->name;
return $name.'|'.(int)$this->context->shop->id.'_'.(int)Group::getCurrent()->id.'_'.(int)$this->context->language->id;
return $name.'|'.(int)Tools::usingSecureMode().'|'.(int)$this->context->shop->id.'|'.(int)Group::getCurrent()->id.'|'.(int)$this->context->language->id;
}
public function display($file, $template, $cacheId = null, $compileId = null)
+1 -1
View File
@@ -175,7 +175,7 @@ class OrderCore extends ObjectModel
'current_state' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
'secure_key' => array('type' => self::TYPE_STRING, 'validate' => 'isMd5'),
'payment' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName', 'required' => true),
'module' => array('type' => self::TYPE_STRING),
'module' => array('type' => self::TYPE_STRING, 'validate' => 'isModuleName', 'required' => true),
'recyclable' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'),
'gift' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'),
'gift_message' => array('type' => self::TYPE_STRING, 'validate' => 'isMessage'),
+18 -8
View File
@@ -117,20 +117,30 @@ class OrderHistoryCore extends ObjectModel
{
$assign[$key]['name'] = $product_download->display_filename;
$dl_link = $product_download->getTextLink(false, $virtual_product['download_hash'])
.'&id_order='.$order->id
.'&id_order='.(int)$order->id
.'&secure_key='.$order->secure_key;
$assign[$key]['link'] = $dl_link;
if ($virtual_product['download_deadline'] != '0000-00-00 00:00:00')
$assign[$key]['deadline'] = Tools::displayDate($virtual_product['download_deadline'], $order->id_lang);
if ($virtual_product['date_expiration'] != '0000-00-00 00:00:00')
$assign[$key]['deadline'] = Tools::displayDate($virtual_product['date_expiration '], $order->id_lang);
if ($product_download->nb_downloadable != 0)
$assign[$key]['downloadable'] = $product_download->nb_downloadable;
$assign[$key]['downloadable'] = (int)$product_download->nb_downloadable;
}
}
$customer = new Customer((int)$order->id_customer);
$context->smarty->assign('virtualProducts', $assign);
$context->smarty->assign('id_order', $order->id);
$iso = Language::getIsoById((int)($order->id_lang));
$links = $context->smarty->fetch(_PS_MAIL_DIR_.$iso.'/download-product.tpl');
$links = '<ul>';
foreach($assign as $product)
{
$links .= '<li>';
$links .= '<a href="'.$product['link'].'">'.Tools::htmlentitiesUTF8($product['name']).'</a>';
if (isset($product['deadline']))
$links .= '&nbsp;'.Tools::htmlentitiesUTF8(Tools::displayError('expires on')).'&nbsp;'.$product['deadline'];
if (isset($product['downloadable']))
$links .= '&nbsp;'.Tools::htmlentitiesUTF8(sprintf(Tools::displayError('downloadable %d time(s)'), (int)$product['downloadable']));
$links .= '</li>';
}
$links .= '<ul>';
$data = array(
'{lastname}' => $customer->lastname,
'{firstname}' => $customer->firstname,
+1 -1
View File
@@ -56,7 +56,7 @@ class OrderReturnCore extends ObjectModel
'fields' => array(
'id_customer' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true),
'id_order' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true),
'question' => array('type' => self::TYPE_HTML, 'validate' => 'isMessage'),
'question' => array('type' => self::TYPE_HTML, 'validate' => 'isCleanHtml'),
'state' => array('type' => self::TYPE_STRING),
'date_add' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'),
'date_upd' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'),
@@ -33,7 +33,7 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
/**
* @var string The extension of the image to display
*/
protected $imgExtension = 'jpg';
protected $imgExtension;
/**
* @var array The type of images (general, categories, manufacturers, suppliers, stores...)
@@ -119,10 +119,18 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
// display image content if needed
else if ($this->imgToDisplay)
{
if(empty($this->imgExtension)){
$imginfo = getimagesize($this->imgToDisplay);
$this->imgExtension = image_type_to_extension($imginfo[2],false);
}
$imageResource = false;
$types = array('jpg' => array('function' => 'imagecreatefromjpeg', 'Content-Type' => 'image/jpeg'),
'gif' => array('function' => 'imagecreatefromgif', 'Content-Type' => 'image/gif')
);
$types = array(
'jpg' => array('function' => 'imagecreatefromjpeg', 'Content-Type' => 'image/jpeg'),
'jpeg' => array('function' => 'imagecreatefromjpeg', 'Content-Type' => 'image/jpeg'),
'png' => array('function' => 'imagecreatefrompng', 'Content-Type' => 'image/png'),
'gif' => array('function' => 'imagecreatefromgif', 'Content-Type' => 'image/gif')
);
if (array_key_exists($this->imgExtension, $types))
$imageResource = @$types[$this->imgExtension]['function']($this->imgToDisplay);
+2 -2
View File
@@ -71,11 +71,11 @@ define('_THEME_LANG_DIR_', _PS_IMG_.'l/');
define('_THEME_COL_DIR_', _PS_IMG_.'co/');
define('_THEME_GENDERS_DIR_', _PS_IMG_.'genders/');
define('_SUPP_DIR_', _PS_IMG_.'su/');
define('_PS_PROD_IMG_', 'img/p/');
define('_PS_PROD_IMG_', _PS_IMG_.'p/');
/* Other URLs */
define('_PS_JS_DIR_', __PS_BASE_URI__.'js/');
define('_PS_CSS_DIR_', __PS_BASE_URI__.'css/');
define('_THEME_PROD_PIC_DIR_', __PS_BASE_URI__.'upload/');
define('_MAIL_DIR_', __PS_BASE_URI__.'mails/');
define('_MODULE_DIR_', __PS_BASE_URI__.'modules/');
define('_MODULE_DIR_', __PS_BASE_URI__.'modules/');
+2
View File
@@ -32,6 +32,8 @@ global $smarty;
$smarty = new Smarty();
$smarty->setCompileDir(_PS_CACHE_DIR_.'smarty/compile');
$smarty->setCacheDir(_PS_CACHE_DIR_.'smarty/cache');
if (!Tools::getSafeModeStatus())
$smarty->use_sub_dirs = true;
$smarty->setConfigDir(_PS_SMARTY_DIR_.'configs');
$smarty->caching = false;
$smarty->force_compile = (Configuration::get('PS_SMARTY_FORCE_COMPILE') == _PS_SMARTY_FORCE_COMPILE_) ? true : false;
+3 -2
View File
@@ -101,15 +101,15 @@ class AdminCartsControllerCore extends AdminController
{
if (!($cart = $this->loadObject(true)))
return;
$customer = new Customer($cart->id_customer);
$currency = new Currency($cart->id_currency);
$this->context->cart = $cart;
$this->context->currency = $currency;
$this->context->customer = $customer;
$products = $cart->getProducts();
$customized_datas = Product::getAllCustomizedDatas((int)$cart->id);
Product::addCustomizationPrice($products, $customized_datas);
$summary = $cart->getSummaryDetails();
$currency = new Currency($cart->id_currency);
/* Display order information */
$id_order = (int)Order::getOrderByCartId($cart->id);
@@ -739,6 +739,7 @@ class AdminCartsControllerCore extends AdminController
{
$context = Context::getContext();
$context->cart = new Cart($id_cart);
$context->currency = new Currency((int)$context->cart->id_currency);
$context->customer = new Customer((int)$context->cart->id_customer);
return Cart::getTotalCart($id_cart, true, Cart::BOTH_WITHOUT_SHIPPING);
}
@@ -542,9 +542,14 @@ class AdminCategoriesControllerCore extends AdminController
{
$id_category = (int)Tools::getValue('id_category');
$id_parent = (int)Tools::getValue('id_parent');
// if true, we are in a root category creation
if (!$id_parent && !Tools::isSubmit('is_root_category'))
$_POST['is_root_category'] = $_POST['level_depth'] = $_POST['id_parent'] = $id_parent = 1;
{
$_POST['is_root_category'] = $_POST['level_depth'] = 1;
$_POST['id_parent'] = $id_parent = (int)Configuration::get('PS_ROOT_CATEGORY');
}
if ($id_category)
{
if ($id_category != $id_parent)
+4 -14
View File
@@ -219,22 +219,12 @@ class AdminCmsControllerCore extends AdminController
/* Close list table and submit button */
$this->displayListFooter($token);
}
/**
* Modifying initial getList method to display position feature (drag and drop)
*/
public function getList($id_lang, $order_by = null, $order_way = null, $start = 0, $limit = null, $id_lang_shop = false)
{
if ($order_by && $this->context->cookie->__get($this->table.'Orderby'))
$order_by = $this->context->cookie->__get($this->table.'Orderby');
else
$order_by = 'position';
parent::getList($id_lang, $order_by, $order_way, $start, $limit, $id_lang_shop);
}
public function postProcess()
{
if (Tools::isSubmit($this->table.'Orderby') || Tools::isSubmit($this->table.'Orderway'))
$this->filter = true;
if (Tools::isSubmit('viewcms') && ($id_cms = (int)Tools::getValue('id_cms')) && ($cms = new CMS($id_cms, $this->context->language->id)) && Validate::isLoadedObject($cms))
{
$redir = $this->context->link->getCMSLink($cms);
@@ -442,7 +442,7 @@ class AdminCountriesControllerCore extends AdminController
$html .= '<li>
<a href="javascript:void(0);" onClick="displayAvailableFields(\''.$class_name.'\')">'.$class_name.'</a>';
foreach (AddressFormat::getValidateFields($class_name) as $name)
$fields[] = '<a style="color:#4B8;" href="javascript:void(0);" class="addPattern" '.$name.' id="'.($class_name == 'Address' ? $name : $class_name.':'.$name).'">
$fields[] = '<a style="color:#4B8;" href="javascript:void(0);" class="addPattern" id="'.($class_name == 'Address' ? $name : $class_name.':'.$name).'">
'.$name.'</a>';
$html .= '
<div class="availableFieldsList" id="availableListFieldsFor_'.$class_name.'" style="width:300px;">
@@ -458,7 +458,7 @@ class AdminCustomerThreadsControllerCore extends AdminController
$extension = false;
foreach ($extensions as $key => $val)
if (substr($filename, -4) == $key || substr($filename, -5) == $key)
if (substr(Tools::strtolower($filename), -4) == $key || substr(Tools::strtolower($filename), -5) == $key)
{
$extension = $val;
break;
@@ -227,7 +227,7 @@ class AdminEmployeesControllerCore extends AdminController
'name' => 'id_lang',
'required' => true,
'options' => array(
'query' => Language::getLanguages(),
'query' => Language::getLanguages(false),
'id' => 'id_lang',
'name' => 'name'
)
+1 -7
View File
@@ -2518,13 +2518,7 @@ class AdminImportControllerCore extends AdminController
public function utf8EncodeArray($array)
{
if (is_array($array))
foreach ($array as $key => $value)
$array[$key] = utf8_encode($value);
else
$array = utf8_encode($array);
return $array;
return (is_array($array) ? array_map('utf8_encode', $array) : utf8_encode($array));
}
protected function getNbrColumn($handle, $glue)
+10 -5
View File
@@ -70,18 +70,23 @@ class AdminLoginControllerCore extends AdminController
if (file_exists(_PS_ADMIN_DIR_.'/../install'))
$this->context->smarty->assign('wrong_install_name', true);
if (file_exists(_PS_ADMIN_DIR_.'/../admin'))
if (basename(_PS_ADMIN_DIR_) == 'admin' && file_exists(_PS_ADMIN_DIR_.'/../admin/'))
{
$rand = sprintf('%04d', rand(0, 9999));
if (@rename(_PS_ADMIN_DIR_.'/../admin', _PS_ADMIN_DIR_.'/../admin'.$rand))
Tools::redirectAdmin('../admin'.$rand);
$rand = 'admin'.sprintf('%04d', rand(0, 9999)).'/';
if (@rename(_PS_ADMIN_DIR_.'/../admin/', _PS_ADMIN_DIR_.'/../'.$rand))
Tools::redirectAdmin('../'.$rand);
else
$this->context->smarty->assign(array(
'wrong_folder_name' => true
));
}
else
$rand = basename(_PS_ADMIN_DIR_).'/';
$this->context->smarty->assign(array(
'randomNb' => rand(0, 9999)
'randomNb' => $rand,
'adminUrl' => Tools::getCurrentUrlProtocolPrefix().Tools::getShopDomain().__PS_BASE_URI__.$rand
));
// Redirect to admin panel
+1 -1
View File
@@ -66,7 +66,7 @@ class AdminMetaControllerCore extends AdminController
),
'PS_ALLOW_ACCENTED_CHARS_URL' => array(
'title' => $this->l('Accented URL'),
'desc' => $this->l('Enable if you want to allow accented characters in your friendly URLs.'),
'desc' => $this->l('Enable if you want to allow accented characters in your friendly URLs.').' '.$this->l('You should only activate this option if you are using non-latin characters ; for all the latin charsets, your SEO will be better without this option.'),
'validation' => 'isBool',
'cast' => 'intval',
'type' => 'bool'
+21 -19
View File
@@ -391,6 +391,8 @@ class AdminModulesControllerCore extends AdminController
$this->recursiveDeleteOnDisk($tmp_folder);
if ($success && $redirect)
Tools::redirectAdmin(self::$currentIndex.'&conf=8&anchor=anchor'.ucfirst($folder).'&token='.$this->token);
return $success;
}
protected function recursiveDeleteOnDisk($dir)
@@ -600,25 +602,14 @@ class AdminModulesControllerCore extends AdminController
foreach ($modules as $name)
{
$full_report = null;
if ($key == 'update')
{
if (ConfigurationTest::test_dir('modules/'.$name, true, $full_report))
Tools::deleteDirectory('../modules/'.$name.'/');
else
{
$module = Module::getInstanceByName(urldecode($name));
$this->errors[] = $this->l(sprintf("Module %s can't be upgraded : ", $module->displayName)).$full_report;
continue;
}
}
// If Addons module, download and unzip it before installing it
if (!file_exists('../modules/'.$name.'/'.$name.'.php'))
if (!file_exists('../modules/'.$name.'/'.$name.'.php') || $key == 'update')
{
$filesList = array(
array('type' => 'addonsNative', 'file' => Module::CACHE_FILE_DEFAULT_COUNTRY_MODULES_LIST, 'loggedOnAddons' => 0),
array('type' => 'addonsBought', 'file' => Module::CACHE_FILE_CUSTOMER_MODULES_LIST, 'loggedOnAddons' => 1),
);
foreach ($filesList as $f)
if (file_exists(_PS_ROOT_DIR_.$f['file']))
{
@@ -628,12 +619,19 @@ class AdminModulesControllerCore extends AdminController
foreach ($xml->module as $modaddons)
if ($name == $modaddons->name && isset($modaddons->id) && ($this->logged_on_addons || $f['loggedOnAddons'] == 0))
{
$download_ok = false;
if ($f['loggedOnAddons'] == 0)
if (file_put_contents('../modules/'.$modaddons->name.'.zip', Tools::addonsRequest('module', array('id_module' => pSQL($modaddons->id)))))
$this->extractArchive('../modules/'.$modaddons->name.'.zip', false);
if ($f['loggedOnAddons'] == 1 && $this->logged_on_addons)
if (file_put_contents('../modules/'.$modaddons->name.'.zip', Tools::addonsRequest('module', array('id_module' => pSQL($modaddons->id), 'username_addons' => pSQL(trim($this->context->cookie->username_addons)), 'password_addons' => pSQL(trim($this->context->cookie->password_addons))))))
$this->extractArchive('../modules/'.$modaddons->name.'.zip', false);
if (file_put_contents(_PS_MODULE_DIR_.$modaddons->name.'.zip', Tools::addonsRequest('module', array('id_module' => pSQL($modaddons->id)))))
$download_ok = true;
elseif ($f['loggedOnAddons'] == 1 && $this->logged_on_addons)
if (file_put_contents(_PS_MODULE_DIR_.$modaddons->name.'.zip', Tools::addonsRequest('module', array('id_module' => pSQL($modaddons->id), 'username_addons' => pSQL(trim($this->context->cookie->username_addons)), 'password_addons' => pSQL(trim($this->context->cookie->password_addons))))))
$download_ok = true;
if (!$download_ok)
$this->errors[] = $this->l('Error on downloading the lastest version');
else
if(!$this->extractArchive(_PS_MODULE_DIR_.$modaddons->name.'.zip', false))
$this->errors[] = $this->l(sprintf("Module %s can't be upgraded: ", $modaddons->name));
}
}
}
@@ -1005,6 +1003,7 @@ class AdminModulesControllerCore extends AdminController
$this->nb_modules_total = count($modules);
$module_errors = array();
$module_success = array();
$upgrade_available = array();
// Browse modules list
foreach ($modules as $km => $module)
@@ -1015,7 +1014,7 @@ class AdminModulesControllerCore extends AdminController
unset($modules[$km]);
continue;
}
// Upgrade Module process, init check if a module could be upgraded
if (Module::initUpgradeModule($module))
{
@@ -1085,6 +1084,8 @@ class AdminModulesControllerCore extends AdminController
$modules[$km]->preferences = $modules_preferences[$modules[$km]->name];
}
unset($object);
if (isset($module->version_addons))
$upgrade_available[] = array('anchor' => ucfirst($module->name), 'name' => $module->displayName);;
}
// Don't display categories without modules
@@ -1109,6 +1110,7 @@ class AdminModulesControllerCore extends AdminController
$tpl_vars = array();
$tpl_vars['token'] = $this->token;
$tpl_vars['upgrade_available'] = $upgrade_available;
$tpl_vars['currentIndex'] = self::$currentIndex;
$tpl_vars['dirNameCurrentIndex'] = dirname(self::$currentIndex);
$tpl_vars['ajaxCurrentIndex'] = str_replace('index', 'ajax-tab', self::$currentIndex);
@@ -303,7 +303,7 @@ class AdminModulesPositionsControllerCore extends AdminController
{
$url = $this->context->shop->getBaseURL().Dispatcher::getInstance()->createUrl('index', (int)$this->context->language->id, $live_edit_params);
if (Configuration::get('PS_REWRITING_SETTINGS'))
$url = str_replace('index.php', Language::getIsoById($this->context->employee->id_lang).'/', $url);
$url = str_replace('index.php', ((count(Language::getLanguages(true)) > 1)? Language::getIsoById($this->context->employee->id_lang).'/' : ''), $url);
return $url;
}
+5 -4
View File
@@ -568,9 +568,9 @@ class AdminOrdersControllerCore extends AdminController
{
if ($this->tabAccess['delete'] === '1')
{
if (!Tools::isSubmit('id_order_detail'))
if (!Tools::isSubmit('id_order_detail') && !Tools::isSubmit('id_customization'))
$this->errors[] = Tools::displayError('You must select a product.');
elseif (!Tools::isSubmit('cancelQuantity'))
elseif (!Tools::isSubmit('cancelQuantity') && !Tools::isSubmit('cancelCustomizationQuantity'))
$this->errors[] = Tools::displayError('You must enter a quantity.');
else
{
@@ -597,7 +597,8 @@ class AdminOrdersControllerCore extends AdminController
foreach ($customizationList as $key => $id_order_detail)
{
$full_product_list[(int)$id_order_detail] = $id_order_detail;
$full_quantity_list[(int)$id_order_detail] += $customizationQtyList[$key];
if (isset($customizationQtyList[$key]))
$full_quantity_list[(int)$id_order_detail] += $customizationQtyList[$key];
}
if ($productList || $customizationList)
@@ -1297,7 +1298,7 @@ class AdminOrdersControllerCore extends AdminController
// display warning if there are products out of stock
$display_out_of_stock_warning = false;
$current_order_state = $order->getCurrentOrderState();
if (!Validate::isLoadedObject($current_order_state) || ($current_order_state->delivery != 1 && $current_order_state->shipped != 1))
if (configuration::get('PS_STOCK_MANAGEMENT') && (!Validate::isLoadedObject($current_order_state) || ($current_order_state->delivery != 1 && $current_order_state->shipped != 1)))
$display_out_of_stock_warning = true;
// products current stock (from stock_available)
@@ -223,7 +223,7 @@ class AdminPPreferencesControllerCore extends AdminController
public function beforeUpdateOptions()
{
if (!Tools::getValue('PS_STOCK_MANAGEMENT'))
if (!Tools::getValue('PS_STOCK_MANAGEMENT', true))
{
$_POST['PS_ORDER_OUT_OF_STOCK'] = 1;
$_POST['PS_DISPLAY_QTIES'] = 0;
@@ -26,6 +26,13 @@
class AdminPerformanceControllerCore extends AdminController
{
public function __construct()
{
$this->className = 'Configuration';
parent::__construct();
}
public function initFieldsetSmarty()
{
$this->fields_form[0]['form'] = array(
@@ -541,6 +548,7 @@ class AdminPerformanceControllerCore extends AdminController
public function postProcess()
{
/* PrestaShop demo mode */
if (_PS_MODE_DEMO_)
{
@@ -617,6 +625,9 @@ class AdminPerformanceControllerCore extends AdminController
{
if ($this->tabAccess['edit'] === '1')
{
$theme_cache_directory = _PS_ALL_THEMES_DIR_.$this->context->shop->theme_directory.'/cache/';
if (((bool)Tools::getValue('PS_CSS_THEME_CACHE') || (bool)Tools::getValue('PS_JS_THEME_CACHE')) && !is_writable($theme_cache_directory))
$this->errors[] = Tools::displayError(sprintf($this->l('To use Smart Cache directory %s must be writable.'), realpath($theme_cache_directory)));
if (!Configuration::updateValue('PS_CSS_THEME_CACHE', (int)Tools::getValue('PS_CSS_THEME_CACHE')) ||
!Configuration::updateValue('PS_JS_THEME_CACHE', (int)Tools::getValue('PS_JS_THEME_CACHE')) ||
!Configuration::updateValue('PS_HTML_THEME_COMPRESSION', (int)Tools::getValue('PS_HTML_THEME_COMPRESSION')) ||
@@ -665,9 +676,8 @@ class AdminPerformanceControllerCore extends AdminController
else
$this->errors[] = Tools::displayError('You do not have permission to edit this.');
}
if ((bool)Tools::getValue('ciphering_up') && Configuration::get('PS_CIPHER_ALGORITHM') != (int)Tools::getValue('PS_CIPHER_ALGORITHM'))
{
{
if ($this->tabAccess['edit'] === '1')
{
$algo = (int)Tools::getValue('PS_CIPHER_ALGORITHM');
@@ -793,8 +803,6 @@ class AdminPerformanceControllerCore extends AdminController
Hook::exec('action'.get_class($this).ucfirst($this->action).'After', array('controller' => $this, 'return' => ''));
Tools::redirectAdmin(self::$currentIndex.'&token='.Tools::getValue('token').'&conf=4');
}
else
return parent::postProcess();
}
public function ajaxProcess()
+1 -1
View File
@@ -206,7 +206,7 @@ class AdminScenesControllerCore extends AdminController
$this->addJqueryPlugin('autocomplete');
$this->addJqueryPlugin('imgareaselect');
$this->addJs(_PS_JS_DIR_.'admin-scene-cropping.js' );
$image_to_map_desc .= '<br /><img id="large_scene_image" style="clear:both;border:1px solid black;" alt="" src="'.
$image_to_map_desc .= '<br /><img id="large_scene_image" alt="" src="'.
_THEME_SCENE_DIR_.$obj->id.'-scene_default.jpg" /><br />';
$image_to_map_desc .= '
@@ -586,7 +586,6 @@ class AdminTranslationsControllerCore extends AdminController
{
// Get instance of this tab by class name
$tab = Tab::getInstanceFromClassName($class_name);
//Check if class name exists
if (isset($tab->class_name) && !empty($tab->class_name))
{
@@ -687,6 +686,9 @@ class AdminTranslationsControllerCore extends AdminController
if (pathinfo($file2check['filename'], PATHINFO_BASENAME) == 'index.php' && file_put_contents(_PS_TRANSLATIONS_DIR_.'../'.$file2check['filename'], Tools::getDefaultIndexContent()))
continue;
// Clear smarty modules cache
Tools::clearCache();
if (Validate::isLanguageFileName($filename))
{
if (!Language::checkAndAddLanguage($iso_code))
@@ -736,13 +738,14 @@ class AdminTranslationsControllerCore extends AdminController
$this->errors[] = Tools::displayError('The archive cannot be extracted.'). ' '.$error->message;
else
{
if (!Language::checkAndAddLanguage($arr_import_lang[0]))
$conf = 20;
else
{
// Reset cache
Language::loadLanguages();
// Clear smarty modules cache
Tools::clearCache();
AdminTranslationsController::checkAndAddMailsFiles($arr_import_lang[0], $files_list);
if ($tab_errors = AdminTranslationsController::addNewTabs($arr_import_lang[0], $files_list))
@@ -1331,22 +1334,19 @@ class AdminTranslationsControllerCore extends AdminController
{
if ($this->tabAccess['edit'] === '1')
{
// Get a good path for module directory
if ($this->theme_selected == self::DEFAULT_THEME_NAME && _PS_MODE_DEV_)
$i18n_dir = $this->translations_informations[$this->type_selected]['dir'];
else
$i18n_dir = $this->translations_informations[$this->type_selected]['override']['dir'];
// Get list of modules
if ($modules = $this->getListModules())
{
// Get files of all modules
$arr_files = $this->getAllModuleFiles($modules, $i18n_dir, $this->lang_selected->iso_code, true);
$arr_files = $this->getAllModuleFiles($modules, null, $this->lang_selected->iso_code, true);
// Find and write all translation modules files
foreach ($arr_files as $value)
$this->findAndWriteTranslationsIntoFile($value['file_name'], $value['files'], $value['theme'], $value['module'], $value['dir']);
// Clear modules cache
Tools::clearCache();
// Redirect
if (Tools::getValue('submitTranslationsModulesAndStay'))
$this->redirect(true);
@@ -1882,24 +1882,10 @@ class AdminTranslationsControllerCore extends AdminController
throw new PrestaShopException(Tools::displayError('The module directory must be writable.'));
$modules = array();
if (!_PS_MODE_DEV_ && $this->theme_selected == self::DEFAULT_THEME_NAME)
{
// Get all module which are installed for to have a minimum of POST
$modules = Module::getModulesInstalled();
foreach ($modules as &$module)
$module = $module['name'];
}
else if ($this->theme_selected == self::DEFAULT_THEME_NAME)
if (Tools::file_exists_cache($this->translations_informations['modules']['dir']))
$modules = scandir($this->translations_informations['modules']['dir']);
else
$this->displayWarning(Tools::displayError('There are no active modules in this copy of PrestaShop. Please use the Modules page to activate, or visit the PrestaShop Addons Store to download them.'));
else
if (Tools::file_exists_cache($this->translations_informations['modules']['override']['dir']))
$modules = scandir($this->translations_informations['modules']['override']['dir']);
else
$this->displayWarning(Tools::displayError('There are no active modules in this copy of PrestaShop. Please use the Modules page to activate, or visit the PrestaShop Addons Store to download them.'));
// Get all module which are installed for to have a minimum of POST
$modules = Module::getModulesInstalled();
foreach ($modules as &$module)
$module = $module['name'];
return $modules;
}
@@ -2539,12 +2525,30 @@ class AdminTranslationsControllerCore extends AdminController
* @param boolean $is_default set it if modules are located in root/prestashop/modules folder
* This allow to distinguish overrided prestashop theme and original module
*/
protected function getAllModuleFiles($modules, $root_dir, $lang, $is_default = false)
protected function getAllModuleFiles($modules, $root_dir = null, $lang, $is_default = false)
{
$array_files = array();
$initial_root_dir = $root_dir;
foreach ($modules as $module)
{
if ($module{0} != '.' && is_dir($root_dir.$module))
$root_dir = $initial_root_dir;
if ($module{0} == '.')
continue;
// Get path of directory for find a good path of translation file
if ($root_dir == null)
{
$i18n_dir = $this->translations_informations[$this->type_selected]['override']['dir'];
if (is_dir($i18n_dir.$module))
$root_dir = $i18n_dir;
}
if ($root_dir == null)
{
$i18n_dir = $this->translations_informations[$this->type_selected]['dir'];
if (is_dir($i18n_dir.$module))
$root_dir = $i18n_dir;
}
if (is_dir($root_dir.$module))
{
if (Tools::file_exists_cache($root_dir.$module.'/translations/'.$lang.'.php'))
$lang_file = $root_dir.$module.'/translations/'.$lang.'.php';
@@ -2564,20 +2568,13 @@ class AdminTranslationsControllerCore extends AdminController
*/
public function initFormModules()
{
// Get path of directory for find a good path of translation file
if ($this->theme_selected != self::DEFAULT_THEME_NAME || !_PS_MODE_DEV_)
$i18n_dir = $this->translations_informations[$this->type_selected]['override']['dir'];
else
$i18n_dir = $this->translations_informations[$this->type_selected]['dir'];
// Get list of modules
$modules = $this->getListModules();
if (!empty($modules))
{
// Get all modules files and include all translation files
$arr_files = $this->getAllModuleFiles($modules, $i18n_dir, $this->lang_selected->iso_code, true);
$arr_files = $this->getAllModuleFiles($modules, null, $this->lang_selected->iso_code, true);
foreach ($arr_files as $value)
$this->findAndFillTranslations($value['files'], $value['theme'], $value['module'], $value['dir']);
+14 -5
View File
@@ -104,12 +104,21 @@ class AuthControllerCore extends FrontController
$countries = Carrier::getDeliveredCountries($this->context->language->id, true, true);
else
$countries = Country::getCountries($this->context->language->id, true);
if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE']))
{
$array = preg_split('/,|-/', $_SERVER['HTTP_ACCEPT_LANGUAGE']);
if (!Validate::isLanguageIsoCode($array[0]) || !($sl_country = Country::getByIso($array[0])))
$sl_country = (int)Configuration::get('PS_COUNTRY_DEFAULT');
}
else
$sl_country = (int)Tools::getValue('id_country', Configuration::get('PS_COUNTRY_DEFAULT'));
$this->context->smarty->assign(array(
'inOrderProcess' => true,
'PS_GUEST_CHECKOUT_ENABLED' => Configuration::get('PS_GUEST_CHECKOUT_ENABLED'),
'PS_REGISTRATION_PROCESS_TYPE' => Configuration::get('PS_REGISTRATION_PROCESS_TYPE'),
'sl_country' => (int)Tools::getValue('id_country', Configuration::get('PS_COUNTRY_DEFAULT')),
'sl_country' => (int)$sl_country,
'countries' => $countries
));
}
@@ -307,7 +316,7 @@ class AuthControllerCore extends FrontController
$this->context->cart->secure_key = $customer->secure_key;
$this->context->cart->save();
$this->context->cookie->id_cart = (int)$this->context->cart->id;
$this->context->cookie->update();
$this->context->cookie->write();
$this->context->cart->autosetProductAddress();
Hook::exec('actionAuthentication');
@@ -379,8 +388,8 @@ class AuthControllerCore extends FrontController
$this->errors[] = Tools::displayError('An account using this email address has already been registered.', false);
// Preparing customer
$customer = new Customer();
$lastnameAddress = $_POST['lastname'];
$firstnameAddress = $_POST['firstname'];
$lastnameAddress = Tools::getValue('lastname');
$firstnameAddress = Tools::getValue('firstname');
$_POST['lastname'] = Tools::getValue('customer_lastname');
$_POST['firstname'] = Tools::getValue('customer_firstname');
+1 -1
View File
@@ -31,7 +31,7 @@ class CompareControllerCore extends FrontController
public function setMedia()
{
parent::setMedia();
$this->addCSS(_THEME_CSS_DIR_.'/comparator.css');
$this->addCSS(_THEME_CSS_DIR_.'comparator.css');
if (Configuration::get('PS_COMPARATOR_MAX_ITEM') > 0)
$this->addJS(_THEME_JS_DIR_.'products-comparison.js');
+1 -1
View File
@@ -57,7 +57,7 @@ class ContactControllerCore extends FrontController
$this->errors[] = Tools::displayError('Please select a subject from the list provided. ');
else if (!empty($_FILES['fileUpload']['name']) && $_FILES['fileUpload']['error'] != 0)
$this->errors[] = Tools::displayError('An error occurred during the file-upload process.');
else if (!empty($_FILES['fileUpload']['name']) && !in_array(substr($_FILES['fileUpload']['name'], -4), $extension) && !in_array(substr($_FILES['fileUpload']['name'], -5), $extension))
else if (!empty($_FILES['fileUpload']['name']) && !in_array(substr(Tools::strtolower($_FILES['fileUpload']['name']), -4), $extension) && !in_array(substr(Tools::strtolower($_FILES['fileUpload']['name']), -5), $extension))
$this->errors[] = Tools::displayError('Bad file extension');
else
{
-1
View File
@@ -347,7 +347,6 @@ class OrderControllerCore extends ParentOrderController
$this->context->smarty->assign(
array(
'free_shipping' => false, // Deprecated since a cart rule can be applied the specific carriers only
'is_guest' => (isset($this->context->customer->is_guest) ? $this->context->customer->is_guest : 0)
));
}
+26 -3
View File
@@ -190,6 +190,13 @@ class OrderOpcControllerCore extends ParentOrderController
$this->context->cart->id_address_invoice = Tools::isSubmit('same') ? $this->context->cart->id_address_delivery : (int)(Tools::getValue('id_address_invoice'));
if (!$this->context->cart->update())
$this->errors[] = Tools::displayError('An error occurred while updating your cart.');
$infos = Address::getCountryAndState((int)($this->context->cart->id_address_delivery));
if (isset($infos['id_country']) && $infos['id_country'])
{
$country = new Country((int)$infos['id_country']);
$this->context->country = $country;
}
// Address has changed, so we check if the cart rules still apply
CartRule::autoRemoveFromCart($this->context);
@@ -316,7 +323,7 @@ class OrderOpcControllerCore extends ParentOrderController
// If a rule offer free-shipping, force hidding shipping prices
$free_shipping = false;
foreach ($this->context->cart->getCartRules() as $rule)
if ($rule['free_shipping'])
if ($rule['free_shipping'] && !$rule['carrier_restriction'])
{
$free_shipping = true;
break;
@@ -357,7 +364,8 @@ class OrderOpcControllerCore extends ParentOrderController
$this->_assignPayment();
Tools::safePostVars();
$this->context->smarty->assign('newsletter', (int)Module::getInstanceByName('blocknewsletter')->active);
$blocknewsletter = Module::getInstanceByName('blocknewsletter');
$this->context->smarty->assign('newsletter', (bool)($blocknewsletter && $blocknewsletter->active));
$this->_processAddressFormat();
$this->setTemplate(_PS_THEME_DIR_.'order-opc.tpl');
@@ -405,9 +413,11 @@ class OrderOpcControllerCore extends ParentOrderController
if (!$this->isLogged)
{
$carriers = $this->context->cart->simulateCarriersOutput();
$oldMessage = Message::getMessageByCartId((int)($this->context->cart->id));
$this->context->smarty->assign(array(
'HOOK_EXTRACARRIER' => null,
'HOOK_EXTRACARRIER_ADDR' => null,
'oldMessage' => isset($oldMessage['message'])? $oldMessage['message'] : '',
'HOOK_BEFORECARRIER' => Hook::exec('displayBeforeCarrier', array(
'carriers' => $carriers,
'checked' => $this->context->cart->simulateCarrierSelectedOutput(),
@@ -494,9 +504,20 @@ class OrderOpcControllerCore extends ParentOrderController
$wrapping_fees = $this->context->cart->getGiftWrappingPrice(false);
$wrapping_fees_tax_inc = $wrapping_fees = $this->context->cart->getGiftWrappingPrice();
$oldMessage = Message::getMessageByCartId((int)($this->context->cart->id));
$free_shipping = false;
foreach ($this->context->cart->getCartRules() as $rule)
{
if ($rule['free_shipping'] && !$rule['carrier_restriction'])
{
$free_shipping = true;
break;
}
}
$vars = array(
'free_shipping' => false, // Deprecated since a cart rule can be applied the specific carriers only
'free_shipping' => $free_shipping,
'checkedTOS' => (int)($this->context->cookie->checkedTOS),
'recyclablePackAllowed' => (int)(Configuration::get('PS_RECYCLABLE_PACK')),
'giftAllowed' => (int)(Configuration::get('PS_GIFT_WRAPPING')),
@@ -513,6 +534,7 @@ class OrderOpcControllerCore extends ParentOrderController
'delivery_option' => $delivery_option,
'address_collection' => $this->context->cart->getAddressCollection(),
'opc' => true,
'oldMessage' => isset($oldMessage['message'])? $oldMessage['message'] : '',
'HOOK_BEFORECARRIER' => Hook::exec('displayBeforeCarrier', array(
'carriers' => $carriers,
'delivery_option_list' => $this->context->cart->getDeliveryOptionList(),
@@ -538,6 +560,7 @@ class OrderOpcControllerCore extends ParentOrderController
)),
'carrier_block' => $this->context->smarty->fetch(_PS_THEME_DIR_.'order-carrier.tpl')
);
Cart::addExtraCarriers($result);
return $result;
}
+16 -4
View File
@@ -30,6 +30,8 @@
class FreeOrder extends PaymentModule
{
public $active = 1;
public $name = 'free_order';
public $displayName = 'free_order';
}
class ParentOrderControllerCore extends FrontController
@@ -454,15 +456,15 @@ class ParentOrderControllerCore extends FrontController
}
protected function _assignCarrier()
{
{
$address = new Address($this->context->cart->id_address_delivery);
$id_zone = Address::getZoneById($address->id);
$carriers = $this->context->cart->simulateCarriersOutput();
$checked = $this->context->cart->simulateCarrierSelectedOutput();
$delivery_option_list = $this->context->cart->getDeliveryOptionList();
$this->setDefaultCarrierSelection($delivery_option_list);
$this->context->smarty->assign(array(
$this->context->smarty->assign(array(
'address_collection' => $this->context->cart->getAddressCollection(),
'delivery_option_list' => $delivery_option_list,
'carriers' => $carriers,
@@ -497,8 +499,18 @@ class ParentOrderControllerCore extends FrontController
$this->link_conditions .= '?content_only=1';
else
$this->link_conditions .= '&content_only=1';
$free_shipping = false;
foreach ($this->context->cart->getCartRules() as $rule)
{
if ($rule['free_shipping'] && !$rule['carrier_restriction'])
{
$free_shipping = true;
break;
}
}
$this->context->smarty->assign(array(
'free_shipping' => $free_shipping,
'checkedTOS' => (int)($this->context->cookie->checkedTOS),
'recyclablePackAllowed' => (int)(Configuration::get('PS_RECYCLABLE_PACK')),
'giftAllowed' => (int)(Configuration::get('PS_GIFT_WRAPPING')),
+52 -13
View File
@@ -257,9 +257,9 @@ class ProductControllerCore extends FrontController
'HOOK_EXTRA_LEFT' => Hook::exec('displayLeftColumnProduct'),
'HOOK_EXTRA_RIGHT' => Hook::exec('displayRightColumnProduct'),
'HOOK_PRODUCT_OOS' => Hook::exec('actionProductOutOfStock', array('product' => $this->product)),
'HOOK_PRODUCT_ACTIONS' => Hook::exec('displayProductButtons'),
'HOOK_PRODUCT_TAB' => Hook::exec('displayProductTab'),
'HOOK_PRODUCT_TAB_CONTENT' => Hook::exec('displayProductTabContent'),
'HOOK_PRODUCT_ACTIONS' => Hook::exec('displayProductButtons', array('product' => $this->product)),
'HOOK_PRODUCT_TAB' => Hook::exec('displayProductTab', array('product' => $this->product)),
'HOOK_PRODUCT_TAB_CONTENT' => Hook::exec('displayProductTabContent', array('product' => $this->product)),
'display_qties' => (int)Configuration::get('PS_DISPLAY_QTIES'),
'display_ht' => !Tax::excludeTaxeOption(),
'currencySign' => $this->context->currency->sign,
@@ -340,26 +340,39 @@ class ProductControllerCore extends FrontController
{
$images = $this->product->getImages((int)$this->context->cookie->id_lang);
$product_images = array();
if(isset($images[0]))
$this->context->smarty->assign('mainImage', $images[0]);
foreach ($images as $k => $image)
{
if ($image['cover'])
{
$this->context->smarty->assign('mainImage', $images[0]);
$this->context->smarty->assign('mainImage', $image);
$cover = $image;
$cover['id_image'] = (Configuration::get('PS_LEGACY_IMAGES') ? ($this->product->id.'-'.$image['id_image']) : $image['id_image']);
$cover['id_image_only'] = (int)$image['id_image'];
}
$product_images[(int)$image['id_image']] = $image;
}
if (!isset($cover))
$cover = array(
'id_image' => $this->context->language->iso_code.'-default',
'legend' => 'No picture',
'title' => 'No picture'
{
if(isset($images[0]))
{
$cover = $images[0];
$cover['id_image'] = (Configuration::get('PS_LEGACY_IMAGES') ? ($this->product->id.'-'.$images[0]['id_image']) : $images[0]['id_image']);
$cover['id_image_only'] = (int)$images[0]['id_image'];
}
else
$cover = array(
'id_image' => $this->context->language->iso_code.'-default',
'legend' => 'No picture',
'title' => 'No picture'
);
}
$size = Image::getSize(ImageType::getFormatedName('large'));
$this->context->smarty->assign(array(
'have_image' => Product::getCover((int)Tools::getValue('id_product')),
'have_image' => isset($cover['id_image'])? array((int)$cover['id_image']) : Product::getCover((int)Tools::getValue('id_product')),
'cover' => $cover,
'imgWidth' => (int)$size['width'],
'mediumSize' => Image::getSize(ImageType::getFormatedName('medium')),
@@ -432,11 +445,37 @@ class ProductControllerCore extends FrontController
else
$combinations[$row['id_product_attribute']]['available_date'] = '';
if (isset($combination_images[$row['id_product_attribute']][0]['id_image']))
$combinations[$row['id_product_attribute']]['id_image'] = $combination_images[$row['id_product_attribute']][0]['id_image'];
else
if (!isset($combination_images[$row['id_product_attribute']][0]['id_image']))
$combinations[$row['id_product_attribute']]['id_image'] = -1;
else
{
$combinations[$row['id_product_attribute']]['id_image'] = $id_image = (int)$combination_images[$row['id_product_attribute']][0]['id_image'];
if ($row['default_on'] && $id_image > 0)
{
if (isset($this->context->smarty->tpl_vars['images']->value))
$product_images = $this->context->smarty->tpl_vars['images']->value;
if (is_array($product_images) && isset($product_images[$id_image]))
{
$product_images[$id_image]['cover'] = 1;
$this->context->smarty->assign('mainImage', $product_images[$id_image]);
if (count($product_images))
$this->context->smarty->assign('images', $product_images);
}
if (isset($this->context->smarty->tpl_vars['cover']->value))
$cover = $this->context->smarty->tpl_vars['cover']->value;
if (is_array($cover) && is_array($product_images))
{
$product_images[$cover['id_image']]['cover'] = 0;
if (isset($product_images[$id_image]))
$cover = $product_images[$id_image];
$cover['id_image'] = (Configuration::get('PS_LEGACY_IMAGES') ? ($this->product->id.'-'.$id_image) : (int)$id_image);
$cover['id_image_only'] = (int)$id_image;
$this->context->smarty->assign('cover', $cover);
}
}
}
}
// wash attributes list (if some attributes are unavailables and if allowed to wash it)
if (!Product::isAvailableWhenOutOfStock($this->product->out_of_stock) && Configuration::get('PS_DISP_UNAVAILABLE_ATTR') == 0)
{
@@ -616,4 +655,4 @@ class ProductControllerCore extends FrontController
}
return $specific_prices;
}
}
}
+5 -1
View File
@@ -199,6 +199,8 @@ background: -moz-linear-gradient(center top , #F9F9F9, #ECECEC) repeat-x scroll
color: #7F7F7F;
font-size: 0.85em;
}
.margin-form .normal-text {
display: block;
padding-top: 0.2em;
@@ -761,7 +763,6 @@ tr.deleted td {
}
.row {
background: #F4E6C9 url(../img/admin/news-bg.gif) repeat-x top left;
}
.uppercase {
@@ -844,6 +845,9 @@ tr.deleted td {
font-weight:bold;
font-size:16px;
}
span.hint {position: relative;}
div.hint {
position: relative;
}
+1
View File
@@ -34,6 +34,7 @@ else
{
$controller = new FrontController();
$controller->init();
$controller->setMedia();
}
Tools::displayFileAsDeprecated();
$controller->displayHeader();
+176
View File
@@ -0,0 +1,176 @@
<?php
/*
* 2007-2013 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-2013 PrestaShop SA
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
abstract class InstallControllerConsole
{
/**
* @var array List of installer steps
*/
protected static $steps = array('process');
protected static $instances = array();
/**
* @var string Current step
*/
public $step;
/**
* @var array List of errors
*/
public $errors = array();
/**
* @var InstallController
*/
public $controller;
/**
* @var InstallSession
*/
public $session;
/**
* @var InstallLanguages
*/
public $language;
/**
* @var InstallAbstractModel
*/
public $model;
/**
* Validate current step
*/
abstract public function validate();
final public static function execute($argc, $argv)
{
if (!($argc-1))
{
$available_arguments = Datas::getInstance()->getArgs();
echo 'Arguments available:'."\n";
foreach ($available_arguments as $key => $arg)
{
$name = isset($arg['name']) ? $arg['name'] : $key;
echo '--'.$name."\t".(isset($arg['help']) ? $arg['help'] : '').(isset($arg['default']) ? "\t".'(Default: '.$arg['default'].')' : '')."\n";
}
exit;
}
$errors = Datas::getInstance()->getAndCheckArgs($argv);
if (Datas::getInstance()->show_license)
{
echo strip_tags(file_get_contents(_PS_INSTALL_PATH_.'theme/views/license_content.phtml'));
exit;
}
if ($errors !== true)
{
if (count($errors))
foreach ($errors as $error)
echo $error."\n";
exit;
}
// Include all controllers
foreach (self::$steps as $step)
{
if (!file_exists(_PS_INSTALL_CONTROLLERS_PATH_.'console/'.$step.'.php'))
throw new PrestashopInstallerException("Controller file 'console/{$step}.php' not found");
require_once _PS_INSTALL_CONTROLLERS_PATH_.'console/'.$step.'.php';
$classname = 'InstallControllerConsole'.$step;
self::$instances[$step] = new $classname($step);
}
$datas = Datas::getInstance();
/* redefine HTTP_HOST */
$_SERVER['HTTP_HOST'] = $datas->http_host;
@date_default_timezone_set($datas->timezone);
if (!$current_step = $datas->step)
return false;
self::$instances[$current_step]->process();
}
final public function __construct($step)
{
$this->step = $step;
$this->datas = Datas::getInstance();
// Set current language
$this->language = InstallLanguages::getInstance();
if (!$this->datas->language)
die('No language defined');
$this->language->setLanguage($this->datas->language);
$this->init();
}
/**
* Initialize model
*/
public function init()
{
}
public function printErrors()
{
$errors = $this->model_install->getErrors();
if (count($errors))
{
if (!is_array($errors))
$errors = array($errors);
echo 'Errors :'."\n";
foreach ($errors as $error_process)
foreach ($error_process as $error)
echo $error."\n";
die;
}
}
/**
* Get translated string
*
* @param string $str String to translate
* @param ... All other params will be used with sprintf
* @return string
*/
public function l($str)
{
$args = func_get_args();
return call_user_func_array(array($this->language, 'l'), $args);
}
public function process()
{
}
}
+203
View File
@@ -0,0 +1,203 @@
<?php
/*
* 2007-2013 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-2013 PrestaShop SA
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
class Datas
{
private static $instance = null;
protected static $available_args = array(
'step' => array(
'name' => 'step',
'default' => 'process',
'validate' => 'isGenericName',
),
'language' => array(
'default' => 'en',
'validate' => 'isLanguageIsoCode',
'alias' => 'l',
'help' => 'language iso code',
),
'timezone' => array(
'default' => 'Europe/Paris',
'alias' => 't',
),
'http_host' => array(
'name' => 'domain',
'validate' => 'isGenericName',
'default' => 'localhost',
),
'database_server' => array(
'name' => 'db_server',
'default' => 'localhost',
'validate' => 'isGenericName',
'alias' => 'h',
),
'database_login' => array(
'name' => 'db_user',
'alias' => 'u',
'default' => 'root',
'validate' => 'isGenericName',
),
'database_password' => array(
'name' => 'db_password',
'alias' => 'p',
'default' => '',
),
'database_name' => array(
'name' => 'db_name',
'alias' => 'd',
'default' => 'prestashop',
'validate' => 'isGenericName',
),
'database_clear' => array(
'name' => 'db_clear',
'default' => '1',
'validate' => 'isInt',
'help' => 'Drop existing tables'
),
'database_prefix' => array(
'name' => 'prefix',
'default' => 'ps_',
'validate' => 'isGenericName',
),
'database_engine' => array(
'name' => 'engine',
'validate' => 'isMySQLEngine',
'default' => 'InnoDB',
'help' => 'InnoDB/MyISAM',
),
'shop_name' => array(
'name' => 'name',
'validate' => 'isGenericName',
'default' => 'PrestaShop',
),
'shop_activity' => array(
'name' => 'activity',
'default' => 0,
'validate' => 'isInt',
),
'shop_country' => array(
'name' => 'country',
'validate' => 'isLanguageIsoCode',
'default' => 'fr',
),
'admin_firstname' => array(
'name' => 'firstname',
'validate' => 'isName',
'default' => 'John',
),
'admin_lastname' => array(
'name' => 'lastname',
'validate' => 'isName',
'default' => 'Doe',
),
'admin_password' => array(
'name' => 'password',
'validate' => 'isPasswd',
'default' => '0123456789',
),
'admin_email' => array(
'name' => 'email',
'validate' => 'isEmail',
'default' => 'pub@prestashop.com'
),
'show_license' => array(
'name' => 'license',
'default' => 0,
'help' => 'show PrestaShop license'
),
'newsletter' => array(
'name' => 'newsletter',
'default' => 1,
'help' => 'get news from PrestaShop',
),
);
protected $datas = array();
public function __get($key)
{
if (isset($this->datas[$key]))
return $this->datas[$key];
return false;
}
public function __set($key, $value)
{
$this->datas[$key] = $value;
}
public static function getInstance()
{
if (Datas::$instance === null)
Datas::$instance = new Datas();
return Datas::$instance;
}
public static function getArgs()
{
return Datas::$available_args;
}
public function getAndCheckArgs($argv)
{
if (!$argv)
return false;
$args_ok = array();
foreach ($argv as $arg)
{
if (!preg_match('/^--([^=\'"><|`]+)(?:=([^=\'"><|`]+)|(?!license))/i', trim($arg), $res))
continue;
if ($res[1] == 'license' && !isset($res[2]))
$res[2] = 1;
$args_ok[$res[1]] = $res[2];
}
$errors = array();
foreach (Datas::getArgs() as $key => $row)
{
if (isset($row['name']))
$name = $row['name'];
else
$name = $key;
if (!isset($args_ok[$name]))
{
if (!isset($row['default']))
$errors[] = 'Field '.$row['name'].' is empty';
else
$this->$key = $row['default'];
}
elseif (isset($row['validate']) && !call_user_func(array('Validate', $row['validate']), $args_ok[$name]))
$errors[] = 'Field '.$row['name'].' is not valid';
else
$this->$key = $args_ok[$name];
}
return count($errors) ? $errors : true;
}
}
+288
View File
@@ -0,0 +1,288 @@
<?php
/*
* 2007-2013 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-2013 PrestaShop SA
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
class InstallControllerConsoleProcess extends InstallControllerConsole
{
const SETTINGS_FILE = 'config/settings.inc.php';
/**
* @var InstallModelInstall
*/
protected $model_install;
public $process_steps = array();
public $previous_button = false;
public function init()
{
require_once _PS_INSTALL_MODELS_PATH_.'install.php';
require_once _PS_INSTALL_MODELS_PATH_.'database.php';
$this->model_install = new InstallModelInstall();
$this->model_database = new InstallModelDatabase();
}
/**
* @see InstallAbstractModel::processNextStep()
*/
public function processNextStep()
{
}
/**
* @see InstallAbstractModel::validate()
*/
public function validate()
{
return false;
}
public function initializeContext()
{
global $smarty;
// Clean all cache values
Cache::clean('*');
Context::getContext()->shop = new Shop(1);
Shop::setContext(Shop::CONTEXT_SHOP, 1);
Configuration::loadConfiguration();
if (!isset(Context::getContext()->language) || !Validate::isLoadedObject(Context::getContext()->language))
if ($id_lang = (int)Configuration::get('PS_LANG_DEFAULT'))
Context::getContext()->language = new Language($id_lang);
if (!isset(Context::getContext()->country) || !Validate::isLoadedObject(Context::getContext()->country))
if ($id_country = (int)Configuration::get('PS_COUNTRY_DEFAULT'))
Context::getContext()->country = new Country((int)$id_country);
Context::getContext()->cart = new Cart();
Context::getContext()->employee = new Employee(1);
if (!defined('_PS_SMARTY_FAST_LOAD_'))
define('_PS_SMARTY_FAST_LOAD_', true);
require_once _PS_ROOT_DIR_.'/config/smarty.config.inc.php';
Context::getContext()->smarty = $smarty;
}
public function process()
{
/*if (file_exists(_PS_ROOT_DIR_.'/'.self::SETTINGS_FILE))
@require_once _PS_ROOT_DIR_.'/'.self::SETTINGS_FILE;*/
if (!$this->processGenerateSettingsFile())
$this->printErrors();
if (!$this->model_database->testDatabaseSettings($this->datas->database_server, $this->datas->database_name, $this->datas->database_login, $this->datas->database_password, $this->datas->database_prefix, $this->datas->database_engine, $this->datas->database_clear))
$this->printErrors();
if (!$this->processInstallDatabase())
$this->printErrors();
if (!$this->processInstallDefaultData())
$this->printErrors();
if (!$this->processPopulateDatabase())
$this->printErrors();
if (!$this->processConfigureShop())
$this->printErrors();
if (!$this->processInstallModules())
$this->printErrors();
if (!$this->processInstallAddonsModules())
$this->printErrors();
if (!$this->processInstallFixtures())
$this->printErrors();
if (!$this->processInstallTheme())
$this->printErrors();
if (!$this->processSendEmail())
$this->printErrors();
$params = http_build_query(array(
'email' => $this->datas->admin_email,
'method' => 'addMemberToNewsletter',
'language' => $this->datas->lang,
'visitorType' => 1,
'source' => 'installer'
));
Tools::file_get_contents('http://www.prestashop.com/ajax/controller.php?'.$params);
}
/**
* PROCESS : generateSettingsFile
*/
public function processGenerateSettingsFile()
{
return $this->model_install->generateSettingsFile(
$this->datas->database_server,
$this->datas->database_login,
$this->datas->database_password,
$this->datas->database_name,
$this->datas->database_prefix,
$this->datas->database_engine
);
}
/**
* PROCESS : installDatabase
* Create database structure
*/
public function processInstallDatabase()
{
$this->initializeContext();
return $this->model_install->installDatabase($this->datas->database_clear);
}
/**
* PROCESS : installDefaultData
* Create default shop and languages
*/
public function processInstallDefaultData()
{
$this->initializeContext();
return $this->model_install->installDefaultData($this->datas->shop_name, true);
}
/**
* PROCESS : populateDatabase
* Populate database with default data
*/
public function processPopulateDatabase()
{
$this->initializeContext();
$this->model_install->xml_loader_ids = $this->datas->xml_loader_ids;
$result = $this->model_install->populateDatabase();
$this->datas->xml_loader_ids = $this->model_install->xml_loader_ids;
return $result;
}
/**
* PROCESS : configureShop
* Set default shop configuration
*/
public function processConfigureShop()
{
$this->initializeContext();
return $this->model_install->configureShop(array(
'shop_name' => $this->datas->shop_name,
'shop_activity' => $this->datas->shop_activity,
'shop_country' => $this->datas->shop_country,
'shop_timezone' => $this->datas->timezone,
'use_smtp' => false,
'smtp_server' => null,
'smtp_login' => null,
'smtp_password' => null,
'smtp_encryption' => null,
'smtp_port' => null,
'admin_firstname' => $this->datas->admin_firstname,
'admin_lastname' => $this->datas->admin_lastname,
'admin_password' => $this->datas->admin_password,
'admin_email' => $this->datas->admin_email,
'configuration_agrement' => true,
));
}
/**
* PROCESS : installModules
* Install all modules in ~/modules/ directory
*/
public function processInstallModules()
{
$this->initializeContext();
return $this->model_install->installModules();
}
/**
* PROCESS : installFixtures
* Install fixtures (E.g. demo products)
*/
public function processInstallFixtures()
{
$this->initializeContext();
$this->model_install->xml_loader_ids = $this->datas->xml_loader_ids;
$result = $this->model_install->installFixtures();
$this->datas->xml_loader_ids = $this->model_install->xml_loader_ids;
return $result;
}
/**
* PROCESS : installTheme
* Install theme
*/
public function processInstallTheme()
{
$this->initializeContext();
return $this->model_install->installTheme();
}
/**
* PROCESS : sendEmail
* Send information e-mail
*/
public function processSendEmail()
{
require_once _PS_INSTALL_MODELS_PATH_.'mail.php';
$mail = new InstallModelMail(
$this->datas->use_smtp,
$this->datas->smtp_server,
$this->datas->smtp_login,
$this->datas->smtp_password,
$this->datas->smtp_port,
$this->datas->smtp_encryption,
$this->datas->admin_email
);
if (file_exists(_PS_INSTALL_LANGS_PATH_.$this->language->getLanguageIso().'/mail_identifiers.txt'))
$content = file_get_contents(_PS_INSTALL_LANGS_PATH_.$this->language->getLanguageIso().'/mail_identifiers.txt');
else
$content = file_get_contents(_PS_INSTALL_LANGS_PATH_.InstallLanguages::DEFAULT_ISO.'/mail_identifiers.txt');
$vars = array(
'{firstname}' => $this->datas->admin_firstname,
'{lastname}' => $this->datas->admin_lastname,
'{shop_name}' => $this->datas->shop_name,
'{passwd}' => $this->datas->admin_password,
'{email}' => $this->datas->admin_email,
'{shop_url}' => Tools::getHttpHost(true).__PS_BASE_URI__,
);
$content = str_replace(array_keys($vars), array_values($vars), $content);
$mail->send(
$this->l('%s - Login information', $this->datas->shop_name),
$content
);
return true;
}
/**
* PROCESS : installModulesAddons
* Install modules from addons
*/
public function processInstallAddonsModules()
{
return $this->model_install->installModulesAddons();
}
}
+22 -21
View File
@@ -227,28 +227,29 @@ class InstallControllerHttpConfigure extends InstallControllerHttp
{
// List of activities
$list_activities = array(
$this->l('Lingerie and Adult'),
$this->l('Animals and Pets'),
$this->l('Art and Culture'),
$this->l('Babies'),
$this->l('Beauty and Personal Care'),
$this->l('Cars'),
$this->l('Computer Hardware and Software'),
$this->l('Download'),
$this->l('Fashion and accessories'),
$this->l('Flowers, Gifts and Crafts'),
$this->l('Food and beverage'),
$this->l('HiFi, Photo and Video'),
$this->l('Home and Garden'),
$this->l('Home Appliances'),
$this->l('Jewelry'),
$this->l('Mobile and Telecom'),
$this->l('Services'),
$this->l('Shoes and accessories'),
$this->l('Sports and Entertainment'),
$this->l('Travel'),
1 => $this->l('Lingerie and Adult'),
2 => $this->l('Animals and Pets'),
3 => $this->l('Art and Culture'),
4 => $this->l('Babies'),
5 => $this->l('Beauty and Personal Care'),
6 => $this->l('Cars'),
7 => $this->l('Computer Hardware and Software'),
8 => $this->l('Download'),
9 => $this->l('Fashion and accessories'),
10 => $this->l('Flowers, Gifts and Crafts'),
11 => $this->l('Food and beverage'),
12 => $this->l('HiFi, Photo and Video'),
13 => $this->l('Home and Garden'),
14 => $this->l('Home Appliances'),
15 => $this->l('Jewelry'),
16 => $this->l('Mobile and Telecom'),
17 => $this->l('Services'),
18 => $this->l('Shoes and accessories'),
19 => $this->l('Sports and Entertainment'),
20 => $this->l('Travel'),
);
sort($list_activities);
asort($list_activities);
$this->list_activities = $list_activities;
// Countries list
+34 -3
View File
@@ -66,7 +66,7 @@ class InstallControllerHttpProcess extends InstallControllerHttp
Shop::setContext(Shop::CONTEXT_SHOP, 1);
Configuration::loadConfiguration();
Context::getContext()->language = new Language(Configuration::get('PS_LANG_DEFAULT'));
Context::getContext()->country = new Country('PS_COUNTRY_DEFAULT');
Context::getContext()->country = new Country(Configuration::get('PS_COUNTRY_DEFAULT'));
Context::getContext()->cart = new Cart();
Context::getContext()->employee = new Employee(1);
define('_PS_SMARTY_FAST_LOAD_', true);
@@ -95,7 +95,9 @@ class InstallControllerHttpProcess extends InstallControllerHttp
$this->processConfigureShop();
elseif (Tools::getValue('installModules') && !empty($this->session->process_validated['configureShop']))
$this->processInstallModules();
elseif (Tools::getValue('installFixtures') && !empty($this->session->process_validated['installModules']))
elseif (Tools::getValue('installModulesAddons') && !empty($this->session->process_validated['installModules']))
$this->processInstallAddonsModules();
elseif (Tools::getValue('installFixtures') && !empty($this->session->process_validated['installModulesAddons']))
$this->processInstallFixtures();
elseif (Tools::getValue('installTheme') && !empty($this->session->process_validated['installModules']))
$this->processInstallTheme();
@@ -231,6 +233,23 @@ class InstallControllerHttpProcess extends InstallControllerHttp
$this->session->process_validated = array_merge($this->session->process_validated, array('installModules' => true));
$this->ajaxJsonAnswer(true);
}
/**
* PROCESS : installModulesAddons
* Install modules from addons
*/
public function processInstallAddonsModules()
{
$this->initializeContext();
if ($module = Tools::getValue('module') && $id_module = Tools::getValue('id_module'))
$result = $this->model_install->installModulesAddons(array('name' => $module, 'id_module' => $id_module));
else
$result = $this->model_install->installModulesAddons();
if (!$result || $this->model_install->getErrors())
$this->ajaxJsonAnswer(false, $this->model_install->getErrors());
$this->session->process_validated = array_merge($this->session->process_validated, array('installModulesAddons' => true));
$this->ajaxJsonAnswer(true);
}
/**
* PROCESS : installFixtures
@@ -333,12 +352,24 @@ class InstallControllerHttpProcess extends InstallControllerHttp
$this->process_steps[] = $populate_step;
$this->process_steps[] = array('key' => 'configureShop', 'lang' => $this->l('Configure shop information'));
$install_modules = array('key' => 'installModules', 'lang' => $this->l('Install modules'));
if ($low_memory)
foreach ($this->model_install->getModulesList() as $module)
$install_modules['subtasks'][] = array('module' => $module);
$this->process_steps[] = $install_modules;
$install_modules = array('key' => 'installModulesAddons', 'lang' => $this->l('Install modules Addons'));
$params = array('iso_lang' => $this->language->getLanguageIso(),
'iso_country' => $this->session->shop_country,
'email' => $this->session->admin_email,
'shop_url' => Tools::getHttpHost(),
'version' => _PS_INSTALL_VERSION_);
if ($low_memory)
foreach ($this->model_install->getAddonsModulesList($params) as $module)
$install_modules['subtasks'][] = array('module' => (string)$module['name'], 'id_module' => (string)$module['id_module']);
$this->process_steps[] = $install_modules;
// Fixtures are installed only if option is selected
if ($this->session->install_type == 'full')
+1 -4
View File
@@ -74,7 +74,6 @@ class InstallControllerHttpSystem extends InstallControllerHttp
if (!isset($this->tests['optional']))
$this->tests['optional'] = $this->model_system->checkOptionalTests();
$session_path = @ini_get('session.save_path');
// Generate display array
$this->tests_render = array(
'required' => array(
@@ -87,7 +86,6 @@ class InstallControllerHttpSystem extends InstallControllerHttp
'system' => $this->l('Cannot create new files and folders'),
'gd' => $this->l('GD Library is not installed'),
'mysql_support' => $this->l('MySQL support is not activated'),
'sessions' => $this->l('Your PHP sessions path is not writable - check with your hosting provider:').' '.$session_path,
)
),
array(
@@ -139,5 +137,4 @@ class InstallControllerHttpSystem extends InstallControllerHttp
$this->displayTemplate('system');
}
}
}
+1 -1
View File
@@ -144,7 +144,7 @@ CREATE TABLE `PREFIX_carrier` (
`max_width` int(10) DEFAULT 0,
`max_height` int(10) DEFAULT 0,
`max_depth` int(10) DEFAULT 0,
`max_weight` int(10) DEFAULT 0,
`max_weight` DECIMAL(20,6) DEFAULT 0,
`grade` int(10) DEFAULT 0,
PRIMARY KEY (`id_carrier`),
KEY `deleted` (`deleted`,`active`),
@@ -42,13 +42,13 @@
<attribute id="Black">
<name>Black</name>
</attribute>
<attribute id="8Go">
<attribute id="8GB">
<name>8Go</name>
</attribute>
<attribute id="16Go">
<attribute id="16GB">
<name>16Go</name>
</attribute>
<attribute id="32Go">
<attribute id="32GB">
<name>32Go</name>
</attribute>
<attribute id="Purple">
@@ -4,10 +4,10 @@
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* 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/afl-3.0.php
* 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.
@@ -20,16 +20,22 @@
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2013 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* @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;
/* Redefine REQUEST_URI */
$_SERVER['REQUEST_URI'] = '/install/index_cli.php';
require_once dirname(__FILE__).'/init.php';
require_once _PS_INSTALL_PATH_.'classes/datas.php';
ini_set('memory_limit', '128M');
try
{
require_once _PS_INSTALL_PATH_.'classes/controllerConsole.php';
InstallControllerConsole::execute($argc, $argv);
echo '-- Installation successfull! --'."\n";
}
catch (PrestashopInstallerException $e)
{
$e->displayMessage();
}
+1 -1
View File
@@ -24,4 +24,4 @@
* International Registered Trademark & Property of PrestaShop SA
*/
define('_PS_INSTALL_VERSION_', '1.5.4.0');
define('_PS_INSTALL_VERSION_', '1.5.4.1');
+1 -1
View File
@@ -19,7 +19,7 @@
<tab id="Advanced_Parameters" name="Par&#xE2;metros Avan&#xE7;ados"/>
<tab id="Administration" name="Administra&#xE7;&#xE3;o"/>
<tab id="Stats" name="Estat&#xED;sticas"/>
<tab id="Estoque" name="Estoque"/>
<tab id="Stock" name="Estoque"/>
<tab id="Products" name="Products"/>
<tab id="Categories" name="Categories"/>
<tab id="Monitoring" name="Monitoring"/>
+26 -10
View File
@@ -557,7 +557,6 @@ class InstallModelInstall extends InstallAbstractModel
'graphvisifire',
'graphxmlswfcharts',
'gridhtml',
'gsitemap',
'homefeatured',
'homeslider',
'pagesnotfound',
@@ -585,14 +584,13 @@ class InstallModelInstall extends InstallAbstractModel
'statsvisits',
);
}
return $modules;
}
public function getAddonsModulesList()
public function getAddonsModulesList($params = array())
{
$addons_modules = array();
$content = Tools::addonsRequest('install-modules');
$content = Tools::addonsRequest('install-modules', $params);
$xml = @simplexml_load_string($content, null, LIBXML_NOCDATA);
if ($xml !== false and isset($xml->module))
@@ -602,18 +600,16 @@ class InstallModelInstall extends InstallAbstractModel
return $addons_modules;
}
/**
* PROCESS : installModules
* Download module from addons and Install all modules in ~/modules/ directory
*/
public function installModules($module = null)
public function installModulesAddons($module = null)
{
$modules = $module ? array($module) : $this->getModulesList();
$addons_modules = $module ? array($module) : $this->getAddonsModulesList();
$modules = array();
if (!InstallSession::getInstance()->safe_mode)
{
$addons_modules = $this->getAddonsModulesList();
foreach($addons_modules as $addons_module)
if (file_put_contents(_PS_MODULE_DIR_.$addons_module['name'].'.zip', Tools::addonsRequest('module', array('id_module' => $addons_module['id_module']))))
if (Tools::ZipExtract(_PS_MODULE_DIR_.$addons_module['name'].'.zip', _PS_MODULE_DIR_))
@@ -622,6 +618,26 @@ class InstallModelInstall extends InstallAbstractModel
unlink(_PS_MODULE_DIR_.$addons_module['name'].'.zip');
}
}
$errors = array();
foreach ($modules as $module_name)
$this->installModules($module_name);
if ($errors)
{
$this->setError($errors);
return false;
}
return true;
}
/**
* PROCESS : installModules
* Download module from addons and Install all modules in ~/modules/ directory
*/
public function installModules($module = null)
{
$modules = $module ? array($module) : $this->getModulesList();
$errors = array();
foreach ($modules as $module_name)
{
@@ -634,7 +650,7 @@ class InstallModelInstall extends InstallAbstractModel
}
if ($errors)
{
{
$this->setError($errors);
return false;
}
+1 -1
View File
@@ -26,7 +26,7 @@ var default_iso = '<?php echo $this->session->shop_country ?>';
<select id="infosActivity" name="shop_activity" class="chosen">
<option value="0" style="font-weight: bold" <?php if (!$this->session->shop_activity): ?>selected="selected"<?php endif; ?>><?php echo $this->l('Please choose your main activity') ?></option>
<?php foreach ($this->list_activities as $i => $activity): ?>
<option value="<?php echo $i ?>" <?php if ($this->session->shop_activity == $i): ?>selected="selected"<?php endif; ?>><?php echo $activity ?></option>
<option value="<?php echo $i ?>" <?php if (isset($this->session->shop_activity) && $this->session->shop_activity == $i): ?>selected="selected"<?php endif; ?>><?php echo $activity ?></option>
<?php endforeach; ?>
<option value="0"><?php echo $this->l('Other activity...') ?></option>
</select>
+1 -53
View File
@@ -4,59 +4,7 @@
<h2 id="licenses-agreement"><?php echo $this->l('License Agreements') ?></h2>
<p><strong><?php echo $this->l('To enjoy the many features that are offered by PrestaShop, please read the license terms below. PrestaShop core is licensed under OSL 3.0, while the modules and themes are licensed under AFL 3.0.') ?></strong></p>
<div style="height:200px; border:1px solid #ccc; margin-bottom:8px; padding:5px; background:#fff; overflow: auto; overflow-x:hidden; overflow-y:scroll;">
<h3>Core: Open Software License ("OSL") v. 3.0</h3>
<p>This Open Software License (the "License") applies to any original work of authorship (the "Original Work") whose owner (the "Licensor") has placed the following licensing notice adjacent to the copyright notice for the Original Work:</p>
<h4>Licensed under the Open Software License version 3.0</h4>
<p><strong>1. Grant of Copyright License.</strong> Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, for the duration of the copyright, to do the following:</p>
<ol style="list-style-type: lower-alpha; margin-left: 20px">
<li>to reproduce the Original Work in copies, either alone or as part of a collective work</li>
<li>to translate, adapt, alter, transform, modify, or arrange the Original Work, thereby creating derivative works ("Derivative Works") based upon the Original Work</li>
<li>to distribute or communicate copies of the Original Work and Derivative Works to the public, with the proviso that copies of Original Work or Derivative Works that You distribute or communicate shall be licensed under this Open Software License</li>
<li>to perform the Original Work publicly</li>
<li>to display the Original Work publicly</li>
</ol>
<p><strong>2. Grant of Patent License.</strong> Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, under patent claims owned or controlled by the Licensor that are embodied in the Original Work as furnished by the Licensor, for the duration of the patents, to make, use, sell, offer for sale, have made, and import the Original Work and Derivative Works.</p>
<p><strong>3. Grant of Source Code License.</strong> The term "Source Code" means the preferred form of the Original Work for making modifications to it and all available documentation describing how to modify the Original Work. Licensor agrees to provide a machine-readable copy of the Source Code of the Original Work along with each copy of the Original Work that Licensor distributes. Licensor reserves the right to satisfy this obligation by placing a machine-readable copy of the Source Code in an information repository reasonably calculated to permit inexpensive and convenient access by You for as long as Licensor continues to distribute the Original Work.</p>
<p><strong>4. Exclusions From License Grant.</strong> Neither the names of Licensor, nor the names of any contributors to the Original Work, nor any of their trademarks or service marks, may be used to endorse or promote products derived from this Original Work without express prior permission of the Licensor. Except as expressly stated herein, nothing in this License grants any license to Licensor's trademarks, copyrights, patents, trade secrets or any other intellectual property. No patent license is granted to make, use, sell, offer for sale, have made, or import embodiments of any patent claims other than the licensed claims defined in Section 2. No license is granted to the trademarks of Licensor even if such marks are included in the Original Work. Nothing in this License shall be interpreted to prohibit Licensor from licensing under terms different from this License any Original Work that Licensor otherwise would have a right to license.</p>
<p><strong>5. External Deployment.</strong> The term "External Deployment" means the use, distribution, or communication of the Original Work or Derivative Works in any way such that the Original Work or Derivative Works may be used by anyone other than You, whether those works are distributed or communicated to those persons or made available as an application intended for use over a network. As an express condition for the grants of license hereunder, You must treat any External Deployment by You of the Original Work or a Derivative Work as a distribution under section 1(c).</p>
<p><strong>6. Attribution Rights.</strong> You must retain, in the Source Code of any Derivative Works that You create, all copyright, patent, or trademark notices from the Source Code of the Original Work, as well as any notices of licensing and any descriptive text identified therein as an "Attribution Notice." You must cause the Source Code for any Derivative Works that You create to carry a prominent Attribution Notice reasonably calculated to inform recipients that You have modified the Original Work.</p>
<p><strong>7. Warranty of Provenance and Disclaimer of Warranty.</strong> Licensor warrants that the copyright in and to the Original Work and the patent rights granted herein by Licensor are owned by the Licensor or are sublicensed to You under the terms of this License with the permission of the contributor(s) of those copyrights and patent rights. Except as expressly stated in the immediately preceding sentence, the Original Work is provided under this License on an "AS IS" BASIS and WITHOUT WARRANTY, either express or implied, including, without limitation, the warranties of non-infringement, merchantability or fitness for a particular purpose. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL WORK IS WITH YOU. This DISCLAIMER OF WARRANTY constitutes an essential part of this License. No license to the Original Work is granted by this License except under this disclaimer.</p>
<p><strong>8. Limitation of Liability.</strong> Under no circumstances and under no legal theory, whether in tort (including negligence), contract, or otherwise, shall the Licensor be liable to anyone for any indirect, special, incidental, or consequential damages of any character arising as a result of this License or the use of the Original Work including, without limitation, damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses. This limitation of liability shall not apply to the extent applicable law prohibits such limitation.</p>
<p><strong>9. Acceptance and Termination.</strong> If, at any time, You expressly assented to this License, that assent indicates your clear and irrevocable acceptance of this License and all of its terms and conditions. If You distribute or communicate copies of the Original Work or a Derivative Work, You must make a reasonable effort under the circumstances to obtain the express assent of recipients to the terms of this License. This License conditions your rights to undertake the activities listed in Section 1, including your right to create Derivative Works based upon the Original Work, and doing so without honoring these terms and conditions is prohibited by copyright law and international treaty. Nothing in this License is intended to affect copyright exceptions and limitations (including 'fair use' or 'fair dealing'). This License shall terminate immediately and You may no longer exercise any of the rights granted to You by this License upon your failure to honor the conditions in Section 1(c).</p>
<p><strong>10. Termination for Patent Action.</strong> This License shall terminate automatically and You may no longer exercise any of the rights granted to You by this License as of the date You commence an action, including a cross-claim or counterclaim, against Licensor or any licensee alleging that the Original Work infringes a patent. This termination provision shall not apply for an action alleging patent infringement by combinations of the Original Work with other software or hardware.</p>
<p><strong>11. Jurisdiction, Venue and Governing Law.</strong> Any action or suit relating to this License may be brought only in the courts of a jurisdiction wherein the Licensor resides or in which Licensor conducts its primary business, and under the laws of that jurisdiction excluding its conflict-of-law provisions. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any use of the Original Work outside the scope of this License or after its termination shall be subject to the requirements and penalties of copyright or patent law in the appropriate jurisdiction. This section shall survive the termination of this License.</p>
<p><strong>12. Attorneys Fees.</strong> In any action to enforce the terms of this License or seeking damages relating thereto, the prevailing party shall be entitled to recover its costs and expenses, including, without limitation, reasonable attorneys' fees and costs incurred in connection with such action, including any appeal of such action. This section shall survive the termination of this License.</p>
<p><strong>13. Miscellaneous.</strong> If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable.</p>
<p><strong>14. Definition of "You" in This License.</strong> "You" throughout this License, whether in upper or lower case, means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License. For legal entities, "You" includes any entity that controls, is controlled by, or is under common control with you. For purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.</p>
<p><strong>15. Right to Use.</strong> You may use the Original Work in all ways not otherwise restricted or conditioned by this License or by law, and Licensor promises not to interfere with or be responsible for such uses by You.</p>
<p><strong>16. Modification of This License.</strong> This License is Copyright &copy; 2005 Lawrence Rosen. Permission is granted to copy, distribute, or communicate this License without modification. Nothing in this License permits You to modify this License as applied to the Original Work or to Derivative Works. However, You may modify the text of this License and copy, distribute or communicate your modified version (the "Modified License") and apply it to other original works of authorship subject to the following conditions: (i) You may not indicate in any way that your Modified License is the "Open Software License" or "OSL" and you may not use those names in the name of your Modified License; (ii) You must replace the notice specified in the first paragraph above with the notice "Licensed under Open Software License ("OSL") v. 3.0" or with a notice of your own that is not confusingly similar to the notice in this License; and (iii) You may not claim that your original works are open source software unless your Modified License has been approved by Open Source Initiative (OSI) and You comply with its license review and certification process.</p>
<h3>Modules and Themes: Academic Free License ("AFL") v. 3.0</h3>
<p>This Academic Free License (the "License") applies to any original work of authorship (the "Original Work") whose owner (the "Licensor") has placed the following licensing notice adjacent to the copyright notice for the Original Work:</p>
<h4>Licensed under the Academic Free License version 3.0</h4>
<p><strong>1. Grant of Copyright License.</strong> Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, for the duration of the copyright, to do the following:</p>
<ol style="list-style-type: lower-alpha; margin-left: 20px">
<li>to reproduce the Original Work in copies, either alone or as part of a collective work;</li>
<li>to translate, adapt, alter, transform, modify, or arrange the Original Work, thereby creating derivative works ("Derivative Works") based upon the Original Work;</li>
<li>to distribute or communicate copies of the Original Work and Derivative Works to the public, <span style="text-decoration: underline">under any license of your choice that does not contradict the terms and conditions, including Licensor's reserved rights and remedies, in this Academic Free License</span>;</li>
<li>to perform the Original Work publicly; and</li>
<li>to display the Original Work publicly.</li>
</ol>
<p><strong>2. Grant of Patent License.</strong> Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, under patent claims owned or controlled by the Licensor that are embodied in the Original Work as furnished by the Licensor, for the duration of the patents, to make, use, sell, offer for sale, have made, and import the Original Work and Derivative Works.</p>
<p><strong>3. Grant of Source Code License.</strong> The term "Source Code" means the preferred form of the Original Work for making modifications to it and all available documentation describing how to modify the Original Work. Licensor agrees to provide a machine-readable copy of the Source Code of the Original Work along with each copy of the Original Work that Licensor distributes. Licensor reserves the right to satisfy this obligation by placing a machine-readable copy of the Source Code in an information repository reasonably calculated to permit inexpensive and convenient access by You for as long as Licensor continues to distribute the Original Work.</p>
<p><strong>4. Exclusions From License Grant.</strong> Neither the names of Licensor, nor the names of any contributors to the Original Work, nor any of their trademarks or service marks, may be used to endorse or promote products derived from this Original Work without express prior permission of the Licensor. Except as expressly stated herein, nothing in this License grants any license to Licensor's trademarks, copyrights, patents, trade secrets or any other intellectual property. No patent license is granted to make, use, sell, offer for sale, have made, or import embodiments of any patent claims other than the licensed claims defined in Section 2. No license is granted to the trademarks of Licensor even if such marks are included in the Original Work. Nothing in this License shall be interpreted to prohibit Licensor from licensing under terms different from this License any Original Work that Licensor otherwise would have a right to license.</p>
<p><strong>5. External Deployment.</strong> The term "External Deployment" means the use, distribution, or communication of the Original Work or Derivative Works in any way such that the Original Work or Derivative Works may be used by anyone other than You, whether those works are distributed or communicated to those persons or made available as an application intended for use over a network. As an express condition for the grants of license hereunder, You must treat any External Deployment by You of the Original Work or a Derivative Work as a distribution under section 1(c).</p>
<p><strong>6. Attribution Rights.</strong> You must retain, in the Source Code of any Derivative Works that You create, all copyright, patent, or trademark notices from the Source Code of the Original Work, as well as any notices of licensing and any descriptive text identified therein as an "Attribution Notice." You must cause the Source Code for any Derivative Works that You create to carry a prominent Attribution Notice reasonably calculated to inform recipients that You have modified the Original Work.</p>
<p><strong>7. Warranty of Provenance and Disclaimer of Warranty.</strong> Licensor warrants that the copyright in and to the Original Work and the patent rights granted herein by Licensor are owned by the Licensor or are sublicensed to You under the terms of this License with the permission of the contributor(s) of those copyrights and patent rights. Except as expressly stated in the immediately preceding sentence, the Original Work is provided under this License on an "AS IS" BASIS and WITHOUT WARRANTY, either express or implied, including, without limitation, the warranties of non-infringement, merchantability or fitness for a particular purpose. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL WORK IS WITH YOU. This DISCLAIMER OF WARRANTY constitutes an essential part of this License. No license to the Original Work is granted by this License except under this disclaimer.</p>
<p><strong>8. Limitation of Liability.</strong> Under no circumstances and under no legal theory, whether in tort (including negligence), contract, or otherwise, shall the Licensor be liable to anyone for any indirect, special, incidental, or consequential damages of any character arising as a result of this License or the use of the Original Work including, without limitation, damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses. This limitation of liability shall not apply to the extent applicable law prohibits such limitation.</p>
<p><strong>9. Acceptance and Termination.</strong> If, at any time, You expressly assented to this License, that assent indicates your clear and irrevocable acceptance of this License and all of its terms and conditions. If You distribute or communicate copies of the Original Work or a Derivative Work, You must make a reasonable effort under the circumstances to obtain the express assent of recipients to the terms of this License. This License conditions your rights to undertake the activities listed in Section 1, including your right to create Derivative Works based upon the Original Work, and doing so without honoring these terms and conditions is prohibited by copyright law and international treaty. Nothing in this License is intended to affect copyright exceptions and limitations (including "fair use" or "fair dealing"). This License shall terminate immediately and You may no longer exercise any of the rights granted to You by this License upon your failure to honor the conditions in Section 1(c).</p>
<p><strong>10. Termination for Patent Action.</strong> This License shall terminate automatically and You may no longer exercise any of the rights granted to You by this License as of the date You commence an action, including a cross-claim or counterclaim, against Licensor or any licensee alleging that the Original Work infringes a patent. This termination provision shall not apply for an action alleging patent infringement by combinations of the Original Work with other software or hardware.</p>
<p><strong>11. Jurisdiction, Venue and Governing Law.</strong> Any action or suit relating to this License may be brought only in the courts of a jurisdiction wherein the Licensor resides or in which Licensor conducts its primary business, and under the laws of that jurisdiction excluding its conflict-of-law provisions. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any use of the Original Work outside the scope of this License or after its termination shall be subject to the requirements and penalties of copyright or patent law in the appropriate jurisdiction. This section shall survive the termination of this License.</p>
<p><strong>12. Attorneys' Fees.</strong> In any action to enforce the terms of this License or seeking damages relating thereto, the prevailing party shall be entitled to recover its costs and expenses, including, without limitation, reasonable attorneys' fees and costs incurred in connection with such action, including any appeal of such action. This section shall survive the termination of this License.</p>
<p><strong>13. Miscellaneous.</strong> If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable.</p>
<p><strong>14. Definition of "You" in This License.</strong> "You" throughout this License, whether in upper or lower case, means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License. For legal entities, "You" includes any entity that controls, is controlled by, or is under common control with you. For purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.</p>
<p><strong>15. Right to Use.</strong> You may use the Original Work in all ways not otherwise restricted or conditioned by this License or by law, and Licensor promises not to interfere with or be responsible for such uses by You.</p>
<p><strong>16. Modification of This License.</strong> This License is Copyright © 2005 Lawrence Rosen. Permission is granted to copy, distribute, or communicate this License without modification. Nothing in this License permits You to modify this License as applied to the Original Work or to Derivative Works. However, You may modify the text of this License and copy, distribute or communicate your modified version (the "Modified License") and apply it to other original works of authorship subject to the following conditions: (i) You may not indicate in any way that your Modified License is the "Academic Free License" or "AFL" and you may not use those names in the name of your Modified License; (ii) You must replace the notice specified in the first paragraph above with the notice "Licensed under &lt;insert your license name here&gt;" or with a notice of your own that is not confusingly similar to the notice in this License; and (iii) You may not claim that your original works are open source software unless your Modified License has been approved by Open Source Initiative (OSI) and You comply with its license review and certification process.</p>
<?php $this->displayTemplate('license_content'); ?>
</div>
<div>
@@ -0,0 +1,53 @@
<h3>Core: Open Software License ("OSL") v. 3.0</h3>
<p>This Open Software License (the "License") applies to any original work of authorship (the "Original Work") whose owner (the "Licensor") has placed the following licensing notice adjacent to the copyright notice for the Original Work:</p>
<h4>Licensed under the Open Software License version 3.0</h4>
<p><strong>1. Grant of Copyright License.</strong> Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, for the duration of the copyright, to do the following:</p>
<ol style="list-style-type: lower-alpha; margin-left: 20px">
<li>to reproduce the Original Work in copies, either alone or as part of a collective work</li>
<li>to translate, adapt, alter, transform, modify, or arrange the Original Work, thereby creating derivative works ("Derivative Works") based upon the Original Work</li>
<li>to distribute or communicate copies of the Original Work and Derivative Works to the public, with the proviso that copies of Original Work or Derivative Works that You distribute or communicate shall be licensed under this Open Software License</li>
<li>to perform the Original Work publicly</li>
<li>to display the Original Work publicly</li>
</ol>
<p><strong>2. Grant of Patent License.</strong> Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, under patent claims owned or controlled by the Licensor that are embodied in the Original Work as furnished by the Licensor, for the duration of the patents, to make, use, sell, offer for sale, have made, and import the Original Work and Derivative Works.</p>
<p><strong>3. Grant of Source Code License.</strong> The term "Source Code" means the preferred form of the Original Work for making modifications to it and all available documentation describing how to modify the Original Work. Licensor agrees to provide a machine-readable copy of the Source Code of the Original Work along with each copy of the Original Work that Licensor distributes. Licensor reserves the right to satisfy this obligation by placing a machine-readable copy of the Source Code in an information repository reasonably calculated to permit inexpensive and convenient access by You for as long as Licensor continues to distribute the Original Work.</p>
<p><strong>4. Exclusions From License Grant.</strong> Neither the names of Licensor, nor the names of any contributors to the Original Work, nor any of their trademarks or service marks, may be used to endorse or promote products derived from this Original Work without express prior permission of the Licensor. Except as expressly stated herein, nothing in this License grants any license to Licensor's trademarks, copyrights, patents, trade secrets or any other intellectual property. No patent license is granted to make, use, sell, offer for sale, have made, or import embodiments of any patent claims other than the licensed claims defined in Section 2. No license is granted to the trademarks of Licensor even if such marks are included in the Original Work. Nothing in this License shall be interpreted to prohibit Licensor from licensing under terms different from this License any Original Work that Licensor otherwise would have a right to license.</p>
<p><strong>5. External Deployment.</strong> The term "External Deployment" means the use, distribution, or communication of the Original Work or Derivative Works in any way such that the Original Work or Derivative Works may be used by anyone other than You, whether those works are distributed or communicated to those persons or made available as an application intended for use over a network. As an express condition for the grants of license hereunder, You must treat any External Deployment by You of the Original Work or a Derivative Work as a distribution under section 1(c).</p>
<p><strong>6. Attribution Rights.</strong> You must retain, in the Source Code of any Derivative Works that You create, all copyright, patent, or trademark notices from the Source Code of the Original Work, as well as any notices of licensing and any descriptive text identified therein as an "Attribution Notice." You must cause the Source Code for any Derivative Works that You create to carry a prominent Attribution Notice reasonably calculated to inform recipients that You have modified the Original Work.</p>
<p><strong>7. Warranty of Provenance and Disclaimer of Warranty.</strong> Licensor warrants that the copyright in and to the Original Work and the patent rights granted herein by Licensor are owned by the Licensor or are sublicensed to You under the terms of this License with the permission of the contributor(s) of those copyrights and patent rights. Except as expressly stated in the immediately preceding sentence, the Original Work is provided under this License on an "AS IS" BASIS and WITHOUT WARRANTY, either express or implied, including, without limitation, the warranties of non-infringement, merchantability or fitness for a particular purpose. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL WORK IS WITH YOU. This DISCLAIMER OF WARRANTY constitutes an essential part of this License. No license to the Original Work is granted by this License except under this disclaimer.</p>
<p><strong>8. Limitation of Liability.</strong> Under no circumstances and under no legal theory, whether in tort (including negligence), contract, or otherwise, shall the Licensor be liable to anyone for any indirect, special, incidental, or consequential damages of any character arising as a result of this License or the use of the Original Work including, without limitation, damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses. This limitation of liability shall not apply to the extent applicable law prohibits such limitation.</p>
<p><strong>9. Acceptance and Termination.</strong> If, at any time, You expressly assented to this License, that assent indicates your clear and irrevocable acceptance of this License and all of its terms and conditions. If You distribute or communicate copies of the Original Work or a Derivative Work, You must make a reasonable effort under the circumstances to obtain the express assent of recipients to the terms of this License. This License conditions your rights to undertake the activities listed in Section 1, including your right to create Derivative Works based upon the Original Work, and doing so without honoring these terms and conditions is prohibited by copyright law and international treaty. Nothing in this License is intended to affect copyright exceptions and limitations (including 'fair use' or 'fair dealing'). This License shall terminate immediately and You may no longer exercise any of the rights granted to You by this License upon your failure to honor the conditions in Section 1(c).</p>
<p><strong>10. Termination for Patent Action.</strong> This License shall terminate automatically and You may no longer exercise any of the rights granted to You by this License as of the date You commence an action, including a cross-claim or counterclaim, against Licensor or any licensee alleging that the Original Work infringes a patent. This termination provision shall not apply for an action alleging patent infringement by combinations of the Original Work with other software or hardware.</p>
<p><strong>11. Jurisdiction, Venue and Governing Law.</strong> Any action or suit relating to this License may be brought only in the courts of a jurisdiction wherein the Licensor resides or in which Licensor conducts its primary business, and under the laws of that jurisdiction excluding its conflict-of-law provisions. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any use of the Original Work outside the scope of this License or after its termination shall be subject to the requirements and penalties of copyright or patent law in the appropriate jurisdiction. This section shall survive the termination of this License.</p>
<p><strong>12. Attorneys Fees.</strong> In any action to enforce the terms of this License or seeking damages relating thereto, the prevailing party shall be entitled to recover its costs and expenses, including, without limitation, reasonable attorneys' fees and costs incurred in connection with such action, including any appeal of such action. This section shall survive the termination of this License.</p>
<p><strong>13. Miscellaneous.</strong> If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable.</p>
<p><strong>14. Definition of "You" in This License.</strong> "You" throughout this License, whether in upper or lower case, means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License. For legal entities, "You" includes any entity that controls, is controlled by, or is under common control with you. For purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.</p>
<p><strong>15. Right to Use.</strong> You may use the Original Work in all ways not otherwise restricted or conditioned by this License or by law, and Licensor promises not to interfere with or be responsible for such uses by You.</p>
<p><strong>16. Modification of This License.</strong> This License is Copyright &copy; 2005 Lawrence Rosen. Permission is granted to copy, distribute, or communicate this License without modification. Nothing in this License permits You to modify this License as applied to the Original Work or to Derivative Works. However, You may modify the text of this License and copy, distribute or communicate your modified version (the "Modified License") and apply it to other original works of authorship subject to the following conditions: (i) You may not indicate in any way that your Modified License is the "Open Software License" or "OSL" and you may not use those names in the name of your Modified License; (ii) You must replace the notice specified in the first paragraph above with the notice "Licensed under Open Software License ("OSL") v. 3.0" or with a notice of your own that is not confusingly similar to the notice in this License; and (iii) You may not claim that your original works are open source software unless your Modified License has been approved by Open Source Initiative (OSI) and You comply with its license review and certification process.</p>
<h3>Modules and Themes: Academic Free License ("AFL") v. 3.0</h3>
<p>This Academic Free License (the "License") applies to any original work of authorship (the "Original Work") whose owner (the "Licensor") has placed the following licensing notice adjacent to the copyright notice for the Original Work:</p>
<h4>Licensed under the Academic Free License version 3.0</h4>
<p><strong>1. Grant of Copyright License.</strong> Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, for the duration of the copyright, to do the following:</p>
<ol style="list-style-type: lower-alpha; margin-left: 20px">
<li>to reproduce the Original Work in copies, either alone or as part of a collective work;</li>
<li>to translate, adapt, alter, transform, modify, or arrange the Original Work, thereby creating derivative works ("Derivative Works") based upon the Original Work;</li>
<li>to distribute or communicate copies of the Original Work and Derivative Works to the public, <span style="text-decoration: underline">under any license of your choice that does not contradict the terms and conditions, including Licensor's reserved rights and remedies, in this Academic Free License</span>;</li>
<li>to perform the Original Work publicly; and</li>
<li>to display the Original Work publicly.</li>
</ol>
<p><strong>2. Grant of Patent License.</strong> Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, under patent claims owned or controlled by the Licensor that are embodied in the Original Work as furnished by the Licensor, for the duration of the patents, to make, use, sell, offer for sale, have made, and import the Original Work and Derivative Works.</p>
<p><strong>3. Grant of Source Code License.</strong> The term "Source Code" means the preferred form of the Original Work for making modifications to it and all available documentation describing how to modify the Original Work. Licensor agrees to provide a machine-readable copy of the Source Code of the Original Work along with each copy of the Original Work that Licensor distributes. Licensor reserves the right to satisfy this obligation by placing a machine-readable copy of the Source Code in an information repository reasonably calculated to permit inexpensive and convenient access by You for as long as Licensor continues to distribute the Original Work.</p>
<p><strong>4. Exclusions From License Grant.</strong> Neither the names of Licensor, nor the names of any contributors to the Original Work, nor any of their trademarks or service marks, may be used to endorse or promote products derived from this Original Work without express prior permission of the Licensor. Except as expressly stated herein, nothing in this License grants any license to Licensor's trademarks, copyrights, patents, trade secrets or any other intellectual property. No patent license is granted to make, use, sell, offer for sale, have made, or import embodiments of any patent claims other than the licensed claims defined in Section 2. No license is granted to the trademarks of Licensor even if such marks are included in the Original Work. Nothing in this License shall be interpreted to prohibit Licensor from licensing under terms different from this License any Original Work that Licensor otherwise would have a right to license.</p>
<p><strong>5. External Deployment.</strong> The term "External Deployment" means the use, distribution, or communication of the Original Work or Derivative Works in any way such that the Original Work or Derivative Works may be used by anyone other than You, whether those works are distributed or communicated to those persons or made available as an application intended for use over a network. As an express condition for the grants of license hereunder, You must treat any External Deployment by You of the Original Work or a Derivative Work as a distribution under section 1(c).</p>
<p><strong>6. Attribution Rights.</strong> You must retain, in the Source Code of any Derivative Works that You create, all copyright, patent, or trademark notices from the Source Code of the Original Work, as well as any notices of licensing and any descriptive text identified therein as an "Attribution Notice." You must cause the Source Code for any Derivative Works that You create to carry a prominent Attribution Notice reasonably calculated to inform recipients that You have modified the Original Work.</p>
<p><strong>7. Warranty of Provenance and Disclaimer of Warranty.</strong> Licensor warrants that the copyright in and to the Original Work and the patent rights granted herein by Licensor are owned by the Licensor or are sublicensed to You under the terms of this License with the permission of the contributor(s) of those copyrights and patent rights. Except as expressly stated in the immediately preceding sentence, the Original Work is provided under this License on an "AS IS" BASIS and WITHOUT WARRANTY, either express or implied, including, without limitation, the warranties of non-infringement, merchantability or fitness for a particular purpose. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL WORK IS WITH YOU. This DISCLAIMER OF WARRANTY constitutes an essential part of this License. No license to the Original Work is granted by this License except under this disclaimer.</p>
<p><strong>8. Limitation of Liability.</strong> Under no circumstances and under no legal theory, whether in tort (including negligence), contract, or otherwise, shall the Licensor be liable to anyone for any indirect, special, incidental, or consequential damages of any character arising as a result of this License or the use of the Original Work including, without limitation, damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses. This limitation of liability shall not apply to the extent applicable law prohibits such limitation.</p>
<p><strong>9. Acceptance and Termination.</strong> If, at any time, You expressly assented to this License, that assent indicates your clear and irrevocable acceptance of this License and all of its terms and conditions. If You distribute or communicate copies of the Original Work or a Derivative Work, You must make a reasonable effort under the circumstances to obtain the express assent of recipients to the terms of this License. This License conditions your rights to undertake the activities listed in Section 1, including your right to create Derivative Works based upon the Original Work, and doing so without honoring these terms and conditions is prohibited by copyright law and international treaty. Nothing in this License is intended to affect copyright exceptions and limitations (including "fair use" or "fair dealing"). This License shall terminate immediately and You may no longer exercise any of the rights granted to You by this License upon your failure to honor the conditions in Section 1(c).</p>
<p><strong>10. Termination for Patent Action.</strong> This License shall terminate automatically and You may no longer exercise any of the rights granted to You by this License as of the date You commence an action, including a cross-claim or counterclaim, against Licensor or any licensee alleging that the Original Work infringes a patent. This termination provision shall not apply for an action alleging patent infringement by combinations of the Original Work with other software or hardware.</p>
<p><strong>11. Jurisdiction, Venue and Governing Law.</strong> Any action or suit relating to this License may be brought only in the courts of a jurisdiction wherein the Licensor resides or in which Licensor conducts its primary business, and under the laws of that jurisdiction excluding its conflict-of-law provisions. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any use of the Original Work outside the scope of this License or after its termination shall be subject to the requirements and penalties of copyright or patent law in the appropriate jurisdiction. This section shall survive the termination of this License.</p>
<p><strong>12. Attorneys' Fees.</strong> In any action to enforce the terms of this License or seeking damages relating thereto, the prevailing party shall be entitled to recover its costs and expenses, including, without limitation, reasonable attorneys' fees and costs incurred in connection with such action, including any appeal of such action. This section shall survive the termination of this License.</p>
<p><strong>13. Miscellaneous.</strong> If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable.</p>
<p><strong>14. Definition of "You" in This License.</strong> "You" throughout this License, whether in upper or lower case, means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License. For legal entities, "You" includes any entity that controls, is controlled by, or is under common control with you. For purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.</p>
<p><strong>15. Right to Use.</strong> You may use the Original Work in all ways not otherwise restricted or conditioned by this License or by law, and Licensor promises not to interfere with or be responsible for such uses by You.</p>
<p><strong>16. Modification of This License.</strong> This License is Copyright © 2005 Lawrence Rosen. Permission is granted to copy, distribute, or communicate this License without modification. Nothing in this License permits You to modify this License as applied to the Original Work or to Derivative Works. However, You may modify the text of this License and copy, distribute or communicate your modified version (the "Modified License") and apply it to other original works of authorship subject to the following conditions: (i) You may not indicate in any way that your Modified License is the "Academic Free License" or "AFL" and you may not use those names in the name of your Modified License; (ii) You must replace the notice specified in the first paragraph above with the notice "Licensed under &lt;insert your license name here&gt;" or with a notice of your own that is not confusingly similar to the notice in this License; and (iii) You may not claim that your original works are open source software unless your Modified License has been approved by Open Source Initiative (OSI) and You comply with its license review and certification process.</p>
+1 -1
View File
@@ -75,7 +75,7 @@ var process_steps = <?php echo Tools::jsonEncode($this->process_steps) ?>;
</div>
<?php if (@fsockopen('addons.prestashop.com', 80, $errno, $errst, 3)): ?>
<iframe src="http://addons.prestashop.com/psinstall.php?version=2&lang=<?php echo $this->language->getLanguageIso() ?>&email=<?php echo $this->session->admin_email ?>&activity=<?php echo $this->session->shop_activity ?>" scrolling="no" id="prestastore">
<iframe src="http://addons.prestashop.com/psinstall.php?version=2&lang=<?php echo $this->language->getLanguageIso() ?>&email=<?php echo $this->session->admin_email ?>&activity=<?php echo $this->session->shop_activity ?>&country=<?php echo $this->session->shop_country ?>" scrolling="no" id="prestastore">
<p>Your browser does not support iframes.</p>
</iframe>
<?php endif; ?>
@@ -28,5 +28,5 @@ function add_column_orders_reference_if_not_exists()
{
$column = Db::getInstance()->executeS('SHOW FIELDS FROM `'._DB_PREFIX_.'orders` LIKE "reference"');
if (empty($column))
return Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.'orders` ADD COLUMN `reference` varchar(9) AFTER `id_order`');
return Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.'orders` ADD COLUMN `reference` varchar(10) AFTER `id_order`');
}
@@ -26,11 +26,11 @@
function block_category_1521()
{
if (!Db::getInstance()->ExecuteS('SELECT `'._DB_PREFIX_.'configuration` WHERE `name`=\'BLOCK_CATEG_MAX_DEPTH\' '))
if (!Db::getInstance()->getValue('SELECT FROM `'._DB_PREFIX_.'configuration` WHERE `name` LIKE \'BLOCK_CATEG_MAX_DEPTH\' '))
Db::getInstance()->Execute('INSERT INTO `'._DB_PREFIX_.'configuration`
(`id_configuration` ,`id_shop_group` ,`id_shop` ,`name` ,`value` ,`date_add` ,`date_upd`)
VALUES (NULL, NULL, NULL, \'BLOCK_CATEG_MAX_DEPTH\', 2, NOW(), NOW())');
else if (Db::getInstance()->ExecuteS('SELECT `'._DB_PREFIX_.'configuration` WHERE and `value` IS NOT NULL AND `value` <> 0'))
Db::getInstance()->Execute('UPDATE `'._DB_PREFIX_.'configuration` SET `value` = 2 WHERE `name`=\'BLOCK_CATEG_MAX_DEPTH\' ');
VALUES (NULL, NULL, NULL, \'BLOCK_CATEG_MAX_DEPTH\', 4, NOW(), NOW())');
else if ($maxdepth = (int)Db::getInstance()->getValue('SELECT FROM `'._DB_PREFIX_.'configuration` WHERE `value` IS NOT NULL AND `value` <> 0'))
Db::getInstance()->Execute('UPDATE `'._DB_PREFIX_.'configuration` SET `value` = '.($maxdepth + 1).' WHERE `name` LIKE\'BLOCK_CATEG_MAX_DEPTH\'');
}
@@ -72,7 +72,7 @@ function p15018_change_image_types()
$option
);
$folder = implode(DIRECTORY_SEPARATOR, str_split((string)$row['id_image'])).DIRECTORY_SEPARATOR;
if (file_exists(_PS_ROOT_DIR_.'img'.DIRECTORY_SEPARATOR.'p'.DIRECTORY_SEPARATOR.$folder.$row['id_image'].'.jpg'))
if (file_exists(_PS_ROOT_DIR_.DIRECTORY_SEPARATOR.'img'.DIRECTORY_SEPARATOR.'p'.DIRECTORY_SEPARATOR.$folder.$row['id_image'].'.jpg'))
foreach ($replace_types['products'] as $old_type => $new_type)
p15018_copy_or_rename(
_PS_ROOT_DIR_.DIRECTORY_SEPARATOR.'img'.DIRECTORY_SEPARATOR.'p'.DIRECTORY_SEPARATOR.$folder.$row['id_image'].'-'.$old_type.'.jpg',
@@ -47,10 +47,15 @@ function p1540_add_missing_columns()
$list_fields[$k] = $field['Field'];
if (!in_array('id_shop', $list_fields))
if (!Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.'layered_product_attribute` ADD `id_shop` INT( 10 ) UNSIGNED NOT NULL DEFAULT "1" AFTER `id_attribute_group` '))
if (!Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.'layered_product_attribute` ADD `id_shop` INT( 10 ) UNSIGNED NOT NULL DEFAULT "1" AFTER `id_attribute_group`'))
$errors[] = Db::getInstance()->getMsgError();
}
$key_exists = Db::getInstance()->executeS('SHOW INDEX FROM `'._DB_PREFIX_.'stock_available` WHERE KEY_NAME = "product_sqlstock"');;
if (is_array($key_exists))
if (!Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.'stock_available` DROP INDEX `product_sqlstock`'))
$errors[] = Db::getInstance()->getMsgError();
if (count($errors))
return array('error' => 1, 'msg' => implode(',', $errors)) ;
}
@@ -31,6 +31,7 @@
function update_mailalerts_add_column_idshop()
{
$installed = Db::getInstance()->getValue('SELECT id_module FROM `'._DB_PREFIX_.'module` WHERE name = "mailalerts"');
$installed &= Db::getInstance()->getValue('SHOW TABLES LIKE "'._DB_PREFIX_.'mailalert_customer_oos"');
if ($installed && !Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.'mailalert_customer_oos` ADD COLUMN `id_shop` int(11) NOT NULL default "0" AFTER `id_customer`'))
return array('error' => 1, 'msg' => sprintf('unable to create column id_shop (%s)', Db::getInstance ()->getMsgError()));
return true;
@@ -33,42 +33,38 @@ function update_order_messages()
$nb_loop = ceil($count_messages / $step);
for($i = 0; $i < $nb_loop; $i++)
{
$sql = 'SELECT id_message, message FROM '._DB_PREFIX_.'message LIMIT '.(int)$start.', '.(int)$step;
if ($messages = Db::getInstance()->executeS($sql))
{
if(is_array($messages))
foreach($messages as $message)
$sql = 'SELECT id_message, message FROM `'._DB_PREFIX_.'message` WHERE message REGEXP \'<br|&[^;]{1,8}\' LIMIT '.(int)$start.', '.(int)$step;
if ($messages = Db::getInstance()->query($sql))
while ($message = Db::getInstance()->nextRow($messages))
{
if(is_array($message))
{
$sql = 'UPDATE '._DB_PREFIX_.'message SET message = \''.pSQL(Tools::htmlentitiesDecodeUTF8(br2nl($message['message']))).'\'
$sql = 'UPDATE `'._DB_PREFIX_.'message` SET message = \''.pSQL(Tools::htmlentitiesDecodeUTF8(br2nl($message['message']))).'\'
WHERE id_message = '.(int)$message['id_message'];
$result = Db::getInstance()->execute($sql);
}
$start += ($step + 1);
}
}
}
$count_messages = Db::getInstance()->getValue('SELECT count(id_customer_message) FROM '._DB_PREFIX_.'customer_message');
$nb_loop = $start = 0;
if($count_messages > 0)
$nb_loop = ceil($count_messages / $step);
for($i = 0; $i < $nb_loop; $i++)
{
$sql = 'SELECT id_customer_message, message FROM '._DB_PREFIX_.'customer_message LIMIT '.(int)$start.', '.(int)$step;
if ($messages = Db::getInstance()->executeS($sql))
{
if(is_array($messages))
foreach($messages as $message)
{
$sql = 'UPDATE '._DB_PREFIX_.'customer_message SET message = \''.pSQL(Tools::htmlentitiesDecodeUTF8(str_replace('&amp;', '&', $message['message']))).'\'
$sql = 'SELECT id_customer_message, message FROM `'._DB_PREFIX_.'customer_message` WHERE message REGEXP \'<br|&[^;]{1,8}\' LIMIT '.(int)$start.', '.(int)$step;
if ($messages = Db::getInstance()->query($sql))
while ($message = Db::getInstance()->nextRow($messages))
{
if(is_array($message))
{
$sql = 'UPDATE `'._DB_PREFIX_.'customer_message` SET message = \''.pSQL(Tools::htmlentitiesDecodeUTF8(str_replace('&amp;', '&', $message['message']))).'\'
WHERE id_customer_message = '.(int)$message['id_customer_message'];
Db::getInstance()->execute($sql);
}
$start += ($step + 1);
}
}
}
}
function br2nl($str)
{
return preg_replace("/<br( \/)?>/i", "\n", $str);
return str_replace(array('<br>', '<br />', '<br/>'), "\n", $str);
}
+1 -1
View File
@@ -23,7 +23,7 @@ INSERT INTO `PREFIX_order_invoice_payment`
-- Step 2: Add the collumn id_order_reference
ALTER TABLE `PREFIX_order_payment`
ADD COLUMN `order_reference` VARCHAR(9) AFTER `id_order`,
ADD COLUMN `order_reference` VARCHAR(10) AFTER `id_order`,
ADD INDEX `order_reference`(`order_reference`);
+2 -1
View File
@@ -33,7 +33,8 @@ CREATE TABLE `PREFIX_tab_module_preference` (
/* PHP:add_new_tab(AdminMarketing, es:Marketing|it:Marketing|en:Marketing|de:Marketing|fr:Marketing, 1); */;
ALTER TABLE `PREFIX_stock_available` DROP INDEX `product_sqlstock`;
/* PHP:p1540_add_missing_columns(); */;
ALTER TABLE `PREFIX_stock_available` ADD UNIQUE `product_sqlstock` (`id_product`, `id_product_attribute`, `id_shop`, `id_shop_group`);
UPDATE PREFIX_configuration SET `value` = '8388608' WHERE `name` = 'PS_PRODUCT_PICTURE_MAX_SIZE' AND `value` <= '524288';
+11
View File
@@ -0,0 +1,11 @@
SET NAMES 'utf8';
ALTER TABLE `PREFIX_carrier` CHANGE `max_weight` `max_weight` DECIMAL( 20, 6 ) NULL DEFAULT '0';
DELETE ms.*, hm.* FROM `PREFIX_module_shop` ms INNER JOIN `PREFIX_hook_module` hm USING (`id_module`) INNER JOIN `PREFIX_module` m USING (`id_module`) WHERE m.`name` LIKE 'backwardcompatibility';
UPDATE `PREFIX_module` SET `active` = 0 WHERE `name` LIKE 'backwardcompatibility';
ALTER TABLE `PREFIX_orders` CHANGE `reference` `reference` VARCHAR( 10 ) NULL DEFAULT NULL;
ALTER TABLE `PREFIX_order_payment` CHANGE `order_reference` `order_reference` VARCHAR( 10 ) NULL DEFAULT NULL;
+22
View File
@@ -246,6 +246,28 @@ if(!defined('_PS_CACHE_ENABLED_'))
define('_PS_CACHE_ENABLED_', '0');
if(!defined('_MYSQL_ENGINE_'))
define('_MYSQL_ENGINE_', 'MyISAM');
global $smarty;
// Clean all cache values
Cache::clean('*');
Context::getContext()->shop = new Shop(1);
Shop::setContext(Shop::CONTEXT_SHOP, 1);
Configuration::loadConfiguration();
if (!isset(Context::getContext()->language) || !Validate::isLoadedObject(Context::getContext()->language))
if ($id_lang = (int)Configuration::get('PS_LANG_DEFAULT'))
Context::getContext()->language = new Language($id_lang);
if (!isset(Context::getContext()->country) || !Validate::isLoadedObject(Context::getContext()->country))
if ($id_country = (int)Configuration::get('PS_COUNTRY_DEFAULT'))
Context::getContext()->country = new Country((int)$id_country);
Context::getContext()->cart = new Cart();
Context::getContext()->employee = new Employee(1);
if (!defined('_PS_SMARTY_FAST_LOAD_'))
define('_PS_SMARTY_FAST_LOAD_', true);
require_once _PS_ROOT_DIR_.'/config/smarty.config.inc.php';
Context::getContext()->smarty = $smarty;
if(isset($_GET['customModule']) AND $_GET['customModule'] == 'desactivate')
{
+4 -3
View File
@@ -31,9 +31,10 @@
var imageWidth = $(this).get(0).offsetWidth;
var imageHeight = $(this).get(0).offsetHeight;
noalt = $(this).attr("alt");
attr = typeof($(this).attr("rel")) != 'undefined' ? "rel" : "alt";
noalt = $(this).attr(attr);
var bigimage = noalt;
$(this).attr("alt", '');
$(this).attr(attr, '');
if($("div.zoomdiv").get().length == 0)
$(this).after("<div class='zoomdiv'><img class='bigimg' src='"+bigimage+"'/></div>");
@@ -67,7 +68,7 @@
$("div.zoomdiv").get(0).scrollLeft = (scrollx) * scalex ;
});
}, function() {
$(this).attr("alt", noalt);
$(this).attr(attr, noalt);
$("div.zoomdiv").hide();
$(document.body).unbind("mousemove");
$(".lenszoom").remove();
+2 -2
View File
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8" ?>
<module>
<name>blockadvertising</name>
<displayName><![CDATA[Block advertising]]></displayName>
<displayName><![CDATA[Bloc publicit&eacute;]]></displayName>
<version><![CDATA[0.5]]></version>
<description><![CDATA[Adds an advertisement block to selected sections of your e-commerce webiste.]]></description>
<description><![CDATA[Ajoute un bloc affichant une publicit&eacute;]]></description>
<author><![CDATA[PrestaShop]]></author>
<tab><![CDATA[advertising_marketing]]></tab>
<is_configurable>1</is_configurable>

Some files were not shown because too many files have changed in this diff Show More