fix conflict

This commit is contained in:
Marion Muszynski 2017-01-09 15:04:04 +01:00
commit 75d2269f9a
4 changed files with 78 additions and 28 deletions

View File

@ -296,7 +296,7 @@ class HelperFormBootstrap{
<div class="form-group '.(isset($p['class-group'])?$p['class-group']:'').'">
<label class="control-label '.(isset($p['label-class']) ? $p['label-class'] : '').'" for="'.(isset($p['id']) ? $p['id'] : $p['name']).'">'.$p['label'].'</label>
<div class="'.(isset($p['input-class']) ? $p['input-class'] : '').'">
<input type="text" class="form-control" name="'.$p['name'].'" id="'.(isset($p['id']) ? $p['id'] : $p['name']).'" placeholder="'.((isset($p['placeholder']) && $p['placeholder'])?$p['placeholder']:'').'">
<input type="text" class="form-control" name="'.$p['name'].'" id="'.(isset($p['id']) ? $p['id'] : $p['name']).'" placeholder="'.((isset($p['placeholder']) && $p['placeholder'])?$p['placeholder']:'').'" value="'.(isset($p['default']) ? $p['default'] : '').'">
</div>
</div>';
}
@ -674,13 +674,14 @@ class HelperFormBootstrap{
$class = isset($p['class']) && $p['class'] ? $p['class'] : false;
if($label) {
$this->_html .= '<div class="form-group">
<label class="control-label '.(isset($p['label-class']) ? $p['label-class'] : '').'" for="'.(isset($p['id']) ? $p['id'] : $p['name']).'">'.$p['label'].'</label>';
<label class="control-label '.(isset($p['label-class']) ? $p['label-class'] : '').'" for="'.(isset($p['id']) ? $p['id'] : $p['name']).'">'.$p['label'].'</label>
<div class="'.(isset($p['input-class']) ? $p['input-class'] : '').'">';
}
$this->_html .= '
<input '.($css ? 'style="'.$css.'"' : '').' type="submit" class="btn '.($class ? $class : '').'" name="'.$p['name'].'" value="'.$p['value'].'" />
';
if($label) {
$this->_html .= '</div>';
$this->_html .= '</div></div>';
}
}

View File

@ -11,7 +11,16 @@ class AdminAntConfigurations extends AdminTab
{
public function postProcess() {
global $cookie;
if(Tools::isSubmit('submitProductSaleCache')) {
if(Tools::isSubmit('submitUpdateConfigurations')) {
Configuration::updateValue('ANT_CARRIER_DROP', Tools::getValue('carrier_dropshipping'));
Configuration::updateValue('ANT_CARRIER_DOM', Tools::getValue('carrier_domicile'));
Configuration::updateValue('ANT_CARRIERS_SOCOL', Tools::getValue('carriers_socol'));
Configuration::updateValue('ANT_CARRIERS_OOH', Tools::getValue('carriers_ooh'));
HelperFormBootstrap::echoConfirmation($this->l('Configurations mises à jour'));
} elseif(Tools::isSubmit('submitProductSaleCache')) {
$fileName = 'cron_sale_cache.php';
$output = shell_exec("ps -ax | grep $fileName | wc -l");
$hour = (int) date('H');
@ -177,6 +186,9 @@ class AdminAntConfigurations extends AdminTab
.button:focus{
background-color: rgba(86,84,133,0.6);
}
.control-label {
padding: 0;
}
</style>';
$id_sale_options = array();
@ -268,10 +280,44 @@ class AdminAntConfigurations extends AdminTab
array(
'type' => 'submit',
'class' => 'btn-default',
'label-class' => 'col-md-6',
'input-class' => 'col-md-4',
'name' => 'submitUpdateLoyaltyOrders',
'label' => $this->l('Credit fidélité ').($nb_credits>0?'('.$nb_credits.')':'').': ',
'label' => $this->l('Credit fidélité ').($nb_credits>0?'('.$nb_credits.')':'').' : ',
'value' => $this->l('Mettre à jour'),
),
array(
'type' => 'simpleText',
'name' => 'carrier_dropshipping',
'label-class' => 'col-md-6',
'input-class' => 'col-md-4',
'label' => $this->l('Transporteur Dropshipping :'),
'default' => Configuration::get('ANT_CARRIER_DROP')
),
array(
'type' => 'simpleText',
'name' => 'carrier_domicile',
'label-class' => 'col-md-6',
'input-class' => 'col-md-4',
'label' => $this->l('Transporteur domicile :'),
'default' => Configuration::get('ANT_CARRIER_DOM')
),
array(
'type' => 'simpleText',
'name' => 'carriers_socol',
'label-class' => 'col-md-6',
'input-class' => 'col-md-4',
'label' => $this->l('Transporteur socol :'),
'default' => Configuration::get('ANT_CARRIERS_SOCOL')
),
array(
'type' => 'simpleText',
'name' => 'carriers_ooh',
'label-class' => 'col-md-6',
'input-class' => 'col-md-4',
'label' => $this->l('Transporteur OOH :'),
'default' => Configuration::get('ANT_CARRIERS_OOH')
),
),
),
array(
@ -303,6 +349,15 @@ class AdminAntConfigurations extends AdminTab
'actions-class' => 'text-right',
),
),
'actions' => array(
array(
'type' => 'submit',
'class' => 'btn-primary',
'name' => 'submitUpdateConfigurations',
'value' => $this->l('Mettre à jour les configurations')
)
),
'actions-class' => 'text-center',
);
}

View File

@ -500,12 +500,14 @@ class AdminPrivateSalesSales extends AdminTab {
carriers_info += "<p>"+$(el).data("carrier-name")+"</p>";
carriers_selected.push($(el).val());
});
var config_carriers_socol = ['.Configuration::get('ANT_CARRIERS_SOCOL').'];
var is_equal = carriers_selected.length==config_carriers_socol.length && carriers_selected.every(function(v,i) { return ($.inArray(v,config_carriers_socol) != -1)})
$(".carriers_info div.info").html(carriers_info);
if ($.inArray("45",carriers_selected)!= -1 && $.inArray("47",carriers_selected)!= -1 && $.inArray("48",carriers_selected)!= -1) {
if (is_equal) {
$("#delivery_mode option[value=\'1\']").attr("selected","selected");
} else if ($.inArray("45",carriers_selected)!= -1) {
} else if ($.inArray("'.Configuration::get('ANT_CARRIER_DOM').'",carriers_selected)!= -1) {
$("#delivery_mode option[value=\'2\']").attr("selected","selected");
} else if ($.inArray("22",carriers_selected)!= -1) {
} else if ($.inArray("'.Configuration::get('ANT_CARRIER_DROP').'",carriers_selected)!= -1) {
$("#delivery_mode option[value=\'3\']").attr("selected","selected");
}
@ -516,11 +518,11 @@ class AdminPrivateSalesSales extends AdminTab {
});
var selected_carriers = [];
if($(this).val() == 1) {
selected_carriers = ["45", "47", "48"];
selected_carriers = ["'.str_replace(',','","',Configuration::get('ANT_CARRIERS_SOCOL')).'"];
} else if($(this).val() == 2) {
selected_carriers = ["45"];
selected_carriers = ["'.Configuration::get('ANT_CARRIER_DOM').'"];
} else if($(this).val() == 3) {
selected_carriers = ["22"];
selected_carriers = ["'.Configuration::get('ANT_CARRIER_DROP').'"];
}
$("input[name=\'m_carriers[]\']").each(function(){
if ($.inArray($(this).val(),selected_carriers) != -1){

View File

@ -51,6 +51,8 @@ class ParentOrderController extends ParentOrderControllerCore {
$sale_delivery = array();
// Restriction du choix du transporteur
if(Module::isInstalled('privatesales')) {
$carrier_dropshipping = (int)Configuration::get('ANT_CARRIER_DROP');
$carrier_dom = (int)Configuration::get('ANT_CARRIER_DOM');
if(Configuration::get('PRIVATESALES_CARRIERFENCE') ) {
$cart_products = self::$cart->getProducts();
if(count($cart_products) > 0) {
@ -82,7 +84,7 @@ class ParentOrderController extends ParentOrderControllerCore {
&& !in_array($carrier['id_carrier'], $carrier_uniq)) {
$_carriers[] = $carrier;
$carrier_uniq[] = $carrier['id_carrier'];
if((int)$carrier['id_carrier'] == 22) {
if((int)$carrier['id_carrier'] == $carrier_dropshipping) {
$dropshipping = true;
}
}
@ -153,7 +155,7 @@ class ParentOrderController extends ParentOrderControllerCore {
// Gestion carrier socolissimo (soflexibilite)
$carriers_socol = array();
foreach ($_carriers as $key => $carrier) {
if($dropshipping && $carrier['id_carrier'] == 22) {
if($dropshipping && $carrier['id_carrier'] == $carrier_dropshipping) {
$carrier_drop = $carrier;
}
if ($carrier['external_module_name'] == "soflexibilite") {
@ -185,24 +187,14 @@ class ParentOrderController extends ParentOrderControllerCore {
// distinction "at home" et "out of home"
$carriers_ah = array();
$carriers_ooh = array();
$config_carrier_ooh = array(88,89); // prod
//$config_carrier_ooh = array(47,48); // dev
//$config_carrier_ooh = array(40,45); // local
$config_carrier_ooh = array_map('intval',explode(',', Configuration::get('ANT_CARRIERS_OOH')));
foreach ($carriers as $carrier) {
if($shipping_only_athome && $carrier['id_carrier'] != 87) { // prod
//if($shipping_only_athome && $carrier['id_carrier'] != 45) { // dev
//if($shipping_only_athome && $carrier['id_carrier'] != 38) { // local
if($shipping_only_athome && $carrier['id_carrier'] != $carrier_dom) {
continue;
}
if($carrier['id_carrier'] != 87
&& isset($count_carriers[(int)$carrier['id_carrier']]) && isset($count_carriers[87])
&& $count_carriers[(int)$carrier['id_carrier']] < $count_carriers[87]) { // prod
// if($carrier['id_carrier'] != 45
// && isset($count_carriers[(int)$carrier['id_carrier']]) && isset($count_carriers[45])
// && $count_carriers[(int)$carrier['id_carrier']] < $count_carriers[45]) { // dev
// if($carrier['id_carrier'] != 38
// && isset($count_carriers[(int)$carrier['id_carrier']]) && isset($count_carriers[38])
// && $count_carriers[(int)$carrier['id_carrier']] < $count_carriers[38]) { //local
if($carrier['id_carrier'] != $carrier_dom
&& isset($count_carriers[(int)$carrier['id_carrier']]) && isset($count_carriers[$carrier_dom])
&& $count_carriers[(int)$carrier['id_carrier']] < $count_carriers[$carrier_dom]) {
continue;
}
if (in_array($carrier['id_carrier'], $config_carrier_ooh) ){