Merge remote-tracking branch 'origin/development' into development

This commit is contained in:
Fabio Chelly
2013-10-03 15:32:27 +02:00
11 changed files with 107 additions and 30 deletions
@@ -925,11 +925,33 @@
var addresses_invoice_options = '';
var address_invoice_detail = '';
var address_delivery_detail = '';
var delivery_address_edit_link = '';
var invoice_address_edit_link = '';
$.each(addresses, function() {
if (this.id_address == id_address_invoice)
address_invoice_detail = this.company+' '+this.firstname+' '+this.lastname+'<br />'+this.address1+'<br />'+this.address2+'<br />'+this.postcode+' '+this.city+' '+this.country;
{
address_invoice_detail = this.company+' '+this.firstname+' '+this.lastname+'<br />'+this.address1+'<br />'+this.address2+'<br />'+this.postcode+' '+this.city;
if (this.state != null)
address_invoice_detail += ' '+this.state;
address_invoice_detail += '</br>'+this.country;
invoice_address_edit_link = "{$link->getAdminLink('AdminAddresses')}&id_address="+this.id_address+"&updateaddress&realedit=1&liteDisplaying=1&submitFormAjax=1#";
}
if(this.id_address == id_address_delivery)
address_delivery_detail = this.company+' '+this.firstname+' '+this.lastname+'<br />'+this.address1+'<br />'+this.address2+'<br />'+this.postcode+' '+this.city+' '+this.country;
{
address_delivery_detail = this.company+' '+this.firstname+' '+this.lastname+'<br />'+this.address1+'<br />'+this.address2+'<br />'+this.postcode+' '+this.city;
if (this.state != null)
address_delivery_detail += ' '+this.state;
address_delivery_detail += '</br>'+this.country;
delivery_address_edit_link = "{$link->getAdminLink('AdminAddresses')}&id_address="+this.id_address+"&updateaddress&realedit=1&liteDisplaying=1&submitFormAjax=1#";
}
addresses_delivery_options += '<option value="'+this.id_address+'" '+(this.id_address == id_address_delivery ? 'selected="selected"' : '')+'>'+this.alias+'</option>';
addresses_invoice_options += '<option value="'+this.id_address+'" '+(this.id_address == id_address_invoice ? 'selected="selected"' : '')+'>'+this.alias+'</option>';
@@ -949,6 +971,8 @@
$('#id_address_invoice').html(addresses_invoice_options);
$('#address_delivery_detail').html(address_delivery_detail);
$('#address_invoice_detail').html(address_invoice_detail);
$('#edit_delivery_address').attr('href', delivery_address_edit_link);
$('#edit_invoice_address').attr('href', invoice_address_edit_link);
}
function updateAddresses()
@@ -1159,14 +1183,14 @@
<div id="address_delivery">
<h3>{l s='Delivery'}</h3>
<select id="id_address_delivery" name="id_address_delivery">
</select>
</select>&nbsp;<a class="fancybox" id="edit_delivery_address" href="#"><img src="../img/admin/edit.gif" /></a>
<div id="address_delivery_detail">
</div>
</div>
<div id="address_invoice">
<h3>{l s='Invoice'}</h3>
<select id="id_address_invoice" name="id_address_invoice">
</select>
</select>&nbsp;<a class="fancybox" id="edit_invoice_address" href="#"><img src="../img/admin/edit.gif" /></a>
<div id="address_invoice_detail">
</div>
</div>
+1 -1
View File
@@ -1261,7 +1261,7 @@ class CartCore extends ObjectModel
return true;
}
public static function getTotalCart($id_cart, $use_tax_display = false, $type = CART::BOTH)
public static function getTotalCart($id_cart, $use_tax_display = false, $type = Cart::BOTH)
{
$cart = new Cart($id_cart);
if (!Validate::isLoadedObject($cart))
+7 -2
View File
@@ -841,7 +841,7 @@ class AdminControllerCore extends Controller
$this->redirect_after = self::$currentIndex.'&'.$this->identifier.'='.$parent_id.'&conf=4&token='.$this->token;
// Default behavior (save and back)
if (empty($this->redirect_after))
if (empty($this->redirect_after) && $this->redirect_after !== false)
$this->redirect_after = self::$currentIndex.($parent_id ? '&'.$this->identifier.'='.$object->id : '').'&conf=4&token='.$this->token;
}
Logger::addLog(sprintf($this->l('%s edition'), $this->className), 1, null, $this->className, (int)$object->id, true, (int)$this->context->employee->id);
@@ -2427,7 +2427,12 @@ class AdminControllerCore extends Controller
$class_name = $this->className;
$object = new $class_name();
$definition = ObjectModel::getDefinition($class_name);
if (method_exists($this, 'getValidationRules'))
$definition = $this->getValidationRules();
else
$definition = ObjectModel::getDefinition($class_name);
$default_language = new Language((int)Configuration::get('PS_LANG_DEFAULT'));
foreach ($definition['fields'] as $field => $def)
+3
View File
@@ -578,6 +578,9 @@ class FrontControllerCore extends Controller
header('HTTP/1.1 503 temporarily overloaded');
$this->context->smarty->assign($this->initLogoAndFavicon());
$this->context->smarty->assign(array(
'HOOK_MAINTENANCE' => Hook::exec('displayMaintenance', array()),
));
$template_dir = ($this->context->getMobileDevice() == true ? _PS_THEME_MOBILE_DIR_ : _PS_THEME_DIR_);
$this->smartyOutputContent($template_dir.'maintenance.tpl');
@@ -299,6 +299,9 @@ class AdminAddressesControllerCore extends AdminController
public function processSave()
{
if (Tools::getValue('submitFormAjax'))
$this->redirect_after = false;
// Transform e-mail in id_customer for parent processing
if (Validate::isEmail(Tools::getValue('email')))
{
@@ -619,7 +619,7 @@ class AdminCarrierWizardControllerCore extends AdminController
}
}
else
$this->validateRules('AdminCarrierWizardControllerCore');
$this->validateRules();
}
if (count($this->errors))
@@ -874,7 +874,7 @@ class AdminCarrierWizardControllerCore extends AdminController
return $return;
}
public static function getValidationRules()
public function getValidationRules()
{
$step_number = Tools::getValue('step_number');
@@ -894,20 +894,12 @@ class AdminCarrierWizardControllerCore extends AdminController
array_splice($step_fields, 1, 0, $multistore_field);
}
$rules = Carrier::getValidationRules('Carrier');
foreach ($rules as $key_r => $rule)
foreach ($rule as $key_f => $field)
{
if (in_array($key_r, array('required', 'requiredLang')))
{
if(!in_array($field, $step_fields[$step_number]))
unset($rules[$key_r][$key_f]);
}
else if(!in_array($key_f, $step_fields[$step_number]))
unset($rules[$key_r][$key_f]);
}
return $rules;
$definition = ObjectModel::getDefinition('Carrier');
foreach ($definition['fields'] as $field => $def)
if (!in_array($field, $step_fields[$step_number]))
unset($definition['fields'][$field]);
return $definition;
}
public static function displayFieldName($field)
+3
View File
@@ -13,6 +13,9 @@
<hook id="actionValidateOrder" live_edit="0">
<name>actionValidateOrder</name><title>New orders</title><description/>
</hook>
<hook id="displayMaintenance" live_edit="0">
<name>displayMaintenance</name><title>Maintenance Page</title><description>This hook displays new elements on the maintenance page</description>
</hook>
<hook id="actionPaymentConfirmation" live_edit="0">
<name>actionPaymentConfirmation</name><title>Payment confirmation</title><description>This hook displays new elements after the payment is validated</description>
</hook>
+6 -6
View File
@@ -37,12 +37,12 @@ $(document).ready(function(){
matchFields += '&'+$(this).attr('id')+'='+$(this).attr('value');
});
$.ajax({
type: 'GET',
type: 'POST',
url: 'index.php',
async: false,
cache: false,
dataType : "json",
data: 'ajax=1&action=saveImportMatchs&skip='+$('input[name=skip]').attr('value')+'&newImportMatchs='+newImportMatchs+matchFields+'&tab=AdminImport&token='+token,
data: 'ajax=1&action=saveImportMatchs&tab=AdminImport&token=' + token + '&skip=' + $('input[name=skip]').attr('value') + '&newImportMatchs=' + newImportMatchs + matchFields,
success: function(jsonData)
{
$('#valueImportMatchs').append('<option id="'+jsonData.id+'" value="'+matchFields+'" selected="selected">'+newImportMatchs+'</option>');
@@ -62,12 +62,12 @@ $(document).ready(function(){
var idToLoad = $('select#valueImportMatchs option:selected').attr('id');
$.ajax({
type: 'GET',
type: 'POST',
url: 'index.php',
async: false,
cache: false,
dataType : "json",
data: 'ajax=1&action=loadImportMatchs&idImportMatchs='+idToLoad+'&tab=AdminImport&token='+token,
data: 'ajax=1&action=loadImportMatchs&tab=AdminImport&token=' + token + '&idImportMatchs=' + idToLoad,
success: function(jsonData)
{
var matchs = jsonData.matchs.split('|')
@@ -87,12 +87,12 @@ $(document).ready(function(){
var idToDelete = $('select#valueImportMatchs option:selected').attr('id');
$.ajax({
type: 'GET',
type: 'POST',
url: 'index.php',
async: false,
cache: false,
dataType : "json",
data: 'ajax=1&action=deleteImportMatchs&idImportMatchs='+idToDelete+'&tab=AdminImport&token='+token,
data: 'ajax=1&action=deleteImportMatchs&tab=AdminImport&token=' + token + '&idImportMatchs=' + idToDelete ,
success: function(jsonData)
{
$('select#valueImportMatchs option[id=\''+idToDelete+'\']').remove();
+44
View File
@@ -161,6 +161,50 @@
<taxRule iso_code_country="uk" id_tax="2" />
</taxRulesGroup>
</taxes>
<states>
<state name="Bucuresti" iso_code="B" country="RO" zone="Europe"/>
<state name="Alba" iso_code="AB" country="RO" zone="Europe"/>
<state name="Arad" iso_code="AR" country="RO" zone="Europe"/>
<state name="Arges" iso_code="AG" country="RO" zone="Europe"/>
<state name="Bacau" iso_code="BC" country="RO" zone="Europe"/>
<state name="Bihor" iso_code="BH" country="RO" zone="Europe"/>
<state name="Bistrita-Nasaud" iso_code="BN" country="RO" zone="Europe"/>
<state name="Botosani" iso_code="BT" country="RO" zone="Europe"/>
<state name="Brasov" iso_code="BV" country="RO" zone="Europe"/>
<state name="Braila" iso_code="BR" country="RO" zone="Europe"/>
<state name="Buzau" iso_code="BZ" country="RO" zone="Europe"/>
<state name="Calarasi" iso_code="CL" country="RO" zone="Europe"/>
<state name="Caras-Severin" iso_code="CS" country="RO" zone="Europe"/>
<state name="Cluj" iso_code="CJ" country="RO" zone="Europe"/>
<state name="Constanta" iso_code="CT" country="RO" zone="Europe"/>
<state name="Covasna" iso_code="CV" country="RO" zone="Europe"/>
<state name="Dambovita" iso_code="DB" country="RO" zone="Europe"/>
<state name="Dolj" iso_code="DJ" country="RO" zone="Europe"/>
<state name="Galati" iso_code="GL" country="RO" zone="Europe"/>
<state name="Giurgiu" iso_code="GR" country="RO" zone="Europe"/>
<state name="Gorj" iso_code="GJ" country="RO" zone="Europe"/>
<state name="Harghita" iso_code="HR" country="RO" zone="Europe"/>
<state name="Hunedoara" iso_code="HD" country="RO" zone="Europe"/>
<state name="Ialomita" iso_code="IL" country="RO" zone="Europe"/>
<state name="Iasi" iso_code="IS" country="RO" zone="Europe"/>
<state name="Ilfov" iso_code="IF" country="RO" zone="Europe"/>
<state name="Maramures" iso_code="MM" country="RO" zone="Europe"/>
<state name="Mehedinti" iso_code="MH" country="RO" zone="Europe"/>
<state name="Mures" iso_code="MS" country="RO" zone="Europe"/>
<state name="Neamt" iso_code="NT" country="RO" zone="Europe"/>
<state name="Olt" iso_code="OT" country="RO" zone="Europe"/>
<state name="Prahova" iso_code="PH" country="RO" zone="Europe"/>
<state name="Satu Mare" iso_code="SM" country="RO" zone="Europe"/>
<state name="Salaj" iso_code="SJ" country="RO" zone="Europe"/>
<state name="Sibiu" iso_code="SB" country="RO" zone="Europe"/>
<state name="Suceava" iso_code="SV" country="RO" zone="Europe"/>
<state name="Teleorman" iso_code="TR" country="RO" zone="Europe"/>
<state name="Timis" iso_code="TM" country="RO" zone="Europe"/>
<state name="Tulcea" iso_code="TL" country="RO" zone="Europe"/>
<state name="Vaslui" iso_code="VS" country="RO" zone="Europe"/>
<state name="Valcea" iso_code="VL" country="RO" zone="Europe"/>
<state name="Vrancea" iso_code="VN" country="RO" zone="Europe"/>
</states>
<units>
<unit type="weight" value="kg" />
<unit type="volume" value="L" />
+3
View File
@@ -40,11 +40,14 @@
</head>
<body>
<div id="maintenance">
<p><img src="{$logo_url}" {if $logo_image_width}width="{$logo_image_width}"{/if} {if $logo_image_height}height="{$logo_image_height}"{/if} alt="logo" /><br /><br /></p>
{$HOOK_MAINTENANCE}
<p id="message">
{l s='In order to perform website maintenance, our online store will be temporarily offline.'}<br /><br />
{l s='We apologize for the inconvenience and ask that you please try again later.'}
</p>
<span style="clear:both;">&nbsp;</span>
</div>
</body>
+1 -1
View File
@@ -36,7 +36,7 @@
{/if}
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
<meta name="generator" content="PrestaShop" />
<meta name="robots" content="{if isset($nobots)}no{/if}index,follow" />
<meta name="robots" content="{if isset($nobots)}no{/if}index,{if isset($nofollow) && $nofollow}no{/if}follow" />
<link rel="icon" type="image/vnd.microsoft.icon" href="{$favicon_url}?{$img_update_time}" />
<link rel="shortcut icon" type="image/x-icon" href="{$favicon_url}?{$img_update_time}" />
<script type="text/javascript">