continuing
This commit is contained in:
parent
a50e10fd90
commit
b6788e7bbd
@ -341,11 +341,12 @@ class HelperFormBootstrap{
|
||||
}
|
||||
|
||||
public function inputSelect2($p = array()) {
|
||||
$this->_html .='
|
||||
$all_opt = array();
|
||||
$this->_html .='
|
||||
<div class="form-group '.(isset($p['class-group'])?$p['class-group']:'').'">
|
||||
'.(isset($p['label'])?'<label class="'.(isset($p['label-class']) ? $p['label-class'] : 'control-label col-md-3 col-sm-3 col-xs-12').'">'.$p['label'].'</label>':'').'
|
||||
<div class="'.(isset($p['label'])?(isset($p['select-class']) ? $p['select-class'] :'col-md-9 col-sm-9 col-xs-12'):'').'">
|
||||
<select class="form-control" name="'.$p['name'].'" id="'.(isset($p['id']) ? $p['id'] : $p['name']).'" tabindex="-1">';
|
||||
<select class="form-control" name="'.$p['name'].'" id="'.(isset($p['id']) ? $p['id'] : $p['name']).'" '.((isset($p['multiple']) && $p['multiple'])?'multiple':'').' tabindex="-1">';
|
||||
foreach($p['options'] as $opt) {
|
||||
$selected = '';
|
||||
if (
|
||||
@ -359,18 +360,43 @@ class HelperFormBootstrap{
|
||||
$disabled = ' disabled="disabled"';
|
||||
}
|
||||
$this->_html .= '<option id="' . $p['name'] . '_' . $opt['value'] . '" value="' . $opt['value'] . '"'. $selected .' '.$disabled.'>'.$opt['label'].'</option>';
|
||||
$all_opt[] = $opt['value'];
|
||||
}
|
||||
$this->_html .='</select>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$("#'.(isset($p['id']) ? $p['id'] : $p['name']).'").select2({
|
||||
placeholder: "'.(isset($p['placeholder'])?$p['placeholder']:'').'",
|
||||
allowClear: true
|
||||
$this->_html .='</select>';
|
||||
|
||||
if((isset($p['option_all']) && $p['option_all']) || (isset($p['option_clear']) && $p['option_clear'])) {
|
||||
$this->_html .='
|
||||
<div class="btn-group btn-group-sm" role="group">
|
||||
'.((isset($p['option_all']) && $p['option_all'])?'<button type="button" class="select_all_for_'.(isset($p['id']) ? $p['id'] : $p['name']).' btn btn-default">Tout</button>':'').'
|
||||
'.((isset($p['option_clear']) && $p['option_clear'])?'<button type="button" class="clear_for_'.(isset($p['id']) ? $p['id'] : $p['name']).' btn btn-default">Clear</button>':'').'
|
||||
</div>';
|
||||
}
|
||||
|
||||
$this->_html .='</div>
|
||||
</div>';
|
||||
|
||||
if(isset($p['multiple']) && $p['multiple']){
|
||||
$this->_html .='<script>
|
||||
$(document).ready(function() {
|
||||
$("#'.(isset($p['id']) ? $p['id'] : $p['name']).'").select2({
|
||||
maximumSelectionLength: '.count($p['options']).',
|
||||
placeholder: "'.(isset($p['placeholder'])?$p['placeholder']:'').'",
|
||||
allowClear: true
|
||||
});
|
||||
'.((isset($p['option_all']) && $p['option_all'])?'$(".select_all_for_'.(isset($p['id']) ? $p['id'] : $p['name']).'").on("click", function () { $("#'.(isset($p['id']) ? $p['id'] : $p['name']).'").select2().val(["'.(implode('","',$all_opt)).'"]).trigger("change"); });':'').'
|
||||
'.((isset($p['option_clear']) && $p['option_clear'])?'$(".clear_for_'.(isset($p['id']) ? $p['id'] : $p['name']).'").on("click", function () { $("#'.(isset($p['id']) ? $p['id'] : $p['name']).'").select2().val(null).trigger("change"); });':'').'
|
||||
});
|
||||
</script>';
|
||||
} else {
|
||||
$this->_html .='<script>
|
||||
$(document).ready(function() {
|
||||
$("#'.(isset($p['id']) ? $p['id'] : $p['name']).'").select2({
|
||||
placeholder: "'.(isset($p['placeholder'])?$p['placeholder']:'').'",
|
||||
allowClear: true
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>';
|
||||
</script>';
|
||||
}
|
||||
}
|
||||
|
||||
public function inputUploadImage($p = array()) {
|
||||
|
@ -259,7 +259,7 @@ class AdminPrivateSalesSales extends AdminTab {
|
||||
});
|
||||
</script>';
|
||||
|
||||
echo '<div class="col-md-4">';
|
||||
echo '<div class="col-md-5">';
|
||||
// select root category
|
||||
$input = array(
|
||||
'type' => 'select2',
|
||||
@ -330,7 +330,7 @@ class AdminPrivateSalesSales extends AdminTab {
|
||||
echo $helperForm->generateInput($input);
|
||||
echo '<div class="clearfix"></div>';
|
||||
|
||||
echo '</div><div class="col-md-7 col-md-offset-1">';
|
||||
echo '</div><div class="col-md-5 col-md-offset-2" style="background:#eee;padding:10px;border-radius:7px;">';
|
||||
|
||||
// Status
|
||||
$input = array(
|
||||
@ -339,106 +339,113 @@ class AdminPrivateSalesSales extends AdminTab {
|
||||
'label' => $this->l('Status:'),
|
||||
'label_on' => '<span class="anticon anticon-checkmark text-green-light"></span>',
|
||||
'label_off' => '<span class="anticon anticon-cross text-rose"></span>',
|
||||
'label-class' => 'col-sm-5',
|
||||
'input-class' => 'col-sm-6',
|
||||
'label-class' => 'col-sm-8',
|
||||
'input-class' => 'col-sm-4',
|
||||
'default' => ($this->cursale!==NULL?($this->cursale->enabled==0?0:1):0),
|
||||
'required' => true,
|
||||
);
|
||||
echo $helperForm->generateInput($input);
|
||||
echo '<div class="clearfix"></div>';
|
||||
|
||||
// Display
|
||||
$input = array(
|
||||
'type' => 'bool',
|
||||
'name' => 'logout',
|
||||
'label' => $this->l('Display:'),
|
||||
'label_on' => '<span class="anticon anticon-user-check text-green-light"></span>',
|
||||
'label_off' => '<span class="anticon anticon-user-minus text-rose"></span>',
|
||||
'label-class' => 'col-sm-5',
|
||||
'input-class' => 'col-sm-6',
|
||||
'label-class' => 'col-sm-8',
|
||||
'input-class' => 'col-sm-4',
|
||||
'default' => ($this->cursale!==NULL?($this->cursale->logout==0?0:1):0),
|
||||
'required' => true,
|
||||
);
|
||||
echo $helperForm->generateInput($input);
|
||||
echo '<div class="clearfix"></div>';
|
||||
|
||||
// Public
|
||||
$input = array(
|
||||
'type' => 'bool',
|
||||
'name' => 'pub',
|
||||
'label' => $this->l('Public sale:'),
|
||||
'label_on' => '<span class="anticon anticon-checkmark text-green-light"></span>',
|
||||
'label_off' => '<span class="anticon anticon-cross text-rose"></span>',
|
||||
'label-class' => 'col-sm-5',
|
||||
'input-class' => 'col-sm-6',
|
||||
'label-class' => 'col-sm-8',
|
||||
'input-class' => 'col-sm-4',
|
||||
'default' => ($this->cursale!==NULL?($this->cursale->pub==0?0:1):0),
|
||||
'required' => true,
|
||||
);
|
||||
echo $helperForm->generateInput($input);
|
||||
echo '<div class="clearfix"></div>';
|
||||
|
||||
// Braderie
|
||||
$input = array(
|
||||
'type' => 'bool',
|
||||
'name' => 'braderie',
|
||||
'label' => $this->l('Braderie :'),
|
||||
'label_on' => '<span class="anticon anticon-checkmark text-green-light"></span>',
|
||||
'label_off' => '<span class="anticon anticon-cross text-rose"></span>',
|
||||
'label-class' => 'col-sm-5',
|
||||
'input-class' => 'col-sm-6',
|
||||
'label-class' => 'col-sm-8',
|
||||
'input-class' => 'col-sm-4',
|
||||
'default' => ($this->cursale!==NULL?($this->cursale->braderie==0?0:1):0),
|
||||
'required' => true,
|
||||
);
|
||||
echo $helperForm->generateInput($input);
|
||||
echo '<div class="clearfix"></div>';
|
||||
|
||||
// Featured
|
||||
$input = array(
|
||||
'type' => 'bool',
|
||||
'name' => 'featured',
|
||||
'label' => $this->l('Featured sale:'),
|
||||
'label_on' => '<span class="anticon anticon-checkmark text-green-light"></span>',
|
||||
'label_off' => '<span class="anticon anticon-cross text-rose"></span>',
|
||||
'label-class' => 'col-sm-5',
|
||||
'input-class' => 'col-sm-6',
|
||||
'label-class' => 'col-sm-8',
|
||||
'input-class' => 'col-sm-4',
|
||||
'default' => ($this->cursale!==NULL?($this->cursale->featured==0?0:1):0),
|
||||
'required' => true,
|
||||
);
|
||||
echo $helperForm->generateInput($input);
|
||||
echo '<div class="clearfix"></div>';
|
||||
|
||||
// New
|
||||
$input = array(
|
||||
'type' => 'bool',
|
||||
'name' => 'new',
|
||||
'label' => $this->l('Nouveau :'),
|
||||
'label_on' => '<span class="anticon anticon-checkmark text-green-light"></span>',
|
||||
'label_off' => '<span class="anticon anticon-cross text-rose"></span>',
|
||||
'label-class' => 'col-sm-5',
|
||||
'input-class' => 'col-sm-6',
|
||||
'label-class' => 'col-sm-8',
|
||||
'input-class' => 'col-sm-4',
|
||||
'default' => ($this->cursale!==NULL?($this->cursale->new==0?0:1):0),
|
||||
'required' => true,
|
||||
);
|
||||
echo $helperForm->generateInput($input);
|
||||
echo '<div class="clearfix"></div>';
|
||||
|
||||
// Newsletter
|
||||
$input = array(
|
||||
'type' => 'bool',
|
||||
'name' => 'forward_news',
|
||||
'label' => $this->l('Mise en avant Newsletter :'),
|
||||
'label_on' => '<span class="anticon anticon-checkmark text-green-light"></span>',
|
||||
'label_off' => '<span class="anticon anticon-cross text-rose"></span>',
|
||||
'label-class' => 'col-sm-5',
|
||||
'input-class' => 'col-sm-6',
|
||||
'label-class' => 'col-sm-8',
|
||||
'input-class' => 'col-sm-4',
|
||||
'default' => ($this->cursale!==NULL?($this->cursale->forward_news==0?0:1):0),
|
||||
'required' => true,
|
||||
);
|
||||
echo $helperForm->generateInput($input);
|
||||
echo '<div class="clearfix"></div>';
|
||||
|
||||
// Shipping only fr
|
||||
$input = array(
|
||||
'type' => 'bool',
|
||||
'name' => 'shipping_fr',
|
||||
'label' => $this->l('Livraison seulement en France :'),
|
||||
'label_on' => '<span class="anticon anticon-checkmark text-green-light"></span>',
|
||||
'label_off' => '<span class="anticon anticon-cross text-rose"></span>',
|
||||
'label-class' => 'col-sm-5',
|
||||
'input-class' => 'col-sm-6',
|
||||
'label-class' => 'col-sm-8',
|
||||
'input-class' => 'col-sm-4',
|
||||
'default' => ($this->cursale!==NULL?($this->cursale->shipping_fr==0?0:1):0),
|
||||
'required' => true,
|
||||
);
|
||||
@ -510,109 +517,282 @@ class AdminPrivateSalesSales extends AdminTab {
|
||||
// <div class="clear"></div>
|
||||
// </div>';
|
||||
|
||||
echo '</div><div class="clearfix"></div>';
|
||||
echo '</div><div class="clearfix"></div>
|
||||
<div class="col-sm-5">';
|
||||
|
||||
echo '<label>'.$this->l('Sale manager:').'</label>
|
||||
<div class="margin-form">
|
||||
<select name="id_employee">
|
||||
<option value="0"></option>';
|
||||
foreach(Employee::getEmployees() as $e) {
|
||||
echo '<option value="'.$e['id_employee'].'"'.($this->cursale!==NULL? ($this->cursale->id_employee==$e['id_employee']?' selected="selected"': ''): '').'>'.$e['name'].'</option>';
|
||||
}
|
||||
echo '</select>
|
||||
<sup> *</sup>
|
||||
<div class="clear"></div>
|
||||
</div>';
|
||||
$id_employee_options = array();
|
||||
foreach(Employee::getEmployees() as $e) {
|
||||
$id_employee_options[(int)$e['id_employee']] = array(
|
||||
'label' => $e['name'],
|
||||
'value' => (int) $e['id_employee']
|
||||
);
|
||||
if($this->cursale!==NULL && $this->cursale->id_employee==$e['id_employee']){
|
||||
$id_employee_options[(int)$e['id_employee']]['selected'] = true;
|
||||
}
|
||||
}
|
||||
// Employee manager
|
||||
$input = array(
|
||||
'type' => 'select2',
|
||||
'label' => $this->l('Sale manager:'),
|
||||
'label-class' => 'text-left',
|
||||
'select-class' => 'text-left',
|
||||
'name' => 'id_employee',
|
||||
'options' => $id_employee_options,
|
||||
'required' => true,
|
||||
);
|
||||
echo $helperForm->generateInput($input);
|
||||
echo '<div class="clearfix"></div>';
|
||||
|
||||
echo '<label>'.$this->l('Délai de livraison :').'</label>
|
||||
<div class="margin-form">
|
||||
<div id="delivery_delay" style="float: left;">
|
||||
<select name="delivery_delay" id="delivery_delay">
|
||||
<option value="1" '.($this->cursale!==NULL? ($this->cursale->delivery_delay== 1? ' selected="selected"': ''):' selected="selected"').'>'.$this->l('Livraison classique').'</option>
|
||||
<option value="2" '.($this->cursale!==NULL? ($this->cursale->delivery_delay== 2? ' selected="selected"': ''):' ').'>'.$this->l('Livraison 48h').'</option>
|
||||
<option value="3" '.($this->cursale!==NULL? ($this->cursale->delivery_delay== 3? ' selected="selected"': ''):' ').'>'.$this->l('Livraison 7 Jours').'</option>
|
||||
<option value="4" '.($this->cursale!==NULL? ($this->cursale->delivery_delay== 4? ' selected="selected"': ''):' ').'>'.$this->l('Livraison 10 Jours').'</option>
|
||||
<option value="5" '.($this->cursale!==NULL? ($this->cursale->delivery_delay== 5? ' selected="selected"': ''):' ').'>'.$this->l('Livraison Noël').'</option>
|
||||
<option value="6" '.($this->cursale!==NULL? ($this->cursale->delivery_delay== 6? ' selected="selected"': ''):' ').'>'.$this->l('Produit Star').'</option>
|
||||
<option value="7" '.($this->cursale!==NULL? ($this->cursale->delivery_delay== 7? ' selected="selected"': ''):' ').'>'.$this->l('Livraison 72h').'</option>
|
||||
<option value="8" '.($this->cursale!==NULL? ($this->cursale->delivery_delay== 8? ' selected="selected"': ''):' ').'>'.$this->l('Livraison 48h Noel').'</option>
|
||||
</select>
|
||||
<sup> *</sup>
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>';
|
||||
// echo '<label>'.$this->l('Sale manager:').'</label>
|
||||
// <div class="margin-form">
|
||||
// <select name="id_employee">
|
||||
// <option value="0"></option>';
|
||||
// foreach(Employee::getEmployees() as $e) {
|
||||
// echo '<option value="'.$e['id_employee'].'"'.($this->cursale!==NULL? ($this->cursale->id_employee==$e['id_employee']?' selected="selected"': ''): '').'>'.$e['name'].'</option>';
|
||||
// }
|
||||
// echo '</select>
|
||||
// <sup> *</sup>
|
||||
// <div class="clear"></div>
|
||||
// </div>';
|
||||
|
||||
$groups = Db::getInstance()->ExecuteS('
|
||||
$id_delay_options = array(
|
||||
array(
|
||||
'label' => $this->l('Livraison classique'),
|
||||
'value' => 1,
|
||||
'selected' => ($this->cursale!==NULL && $this->cursale->delivery_delay== 1?true:false)
|
||||
),
|
||||
array(
|
||||
'label' => $this->l('Livraison 48h'),
|
||||
'value' => 2,
|
||||
'selected' => ($this->cursale!==NULL && $this->cursale->delivery_delay== 2?true:false)
|
||||
),
|
||||
array(
|
||||
'label' => $this->l('Livraison 7 Jours'),
|
||||
'value' => 3,
|
||||
'selected' => ($this->cursale!==NULL && $this->cursale->delivery_delay== 3?true:false)
|
||||
),
|
||||
array(
|
||||
'label' => $this->l('Livraison 10 Jours'),
|
||||
'value' => 4,
|
||||
'selected' => ($this->cursale!==NULL && $this->cursale->delivery_delay== 4?true:false)
|
||||
),
|
||||
array(
|
||||
'label' => $this->l('Livraison Noel'),
|
||||
'value' => 5,
|
||||
'selected' => ($this->cursale!==NULL && $this->cursale->delivery_delay== 5?true:false)
|
||||
),
|
||||
array(
|
||||
'label' => $this->l('Produit Star'),
|
||||
'value' => 6,
|
||||
'selected' => ($this->cursale!==NULL && $this->cursale->delivery_delay== 6?true:false)
|
||||
),
|
||||
array(
|
||||
'label' => $this->l('Livraison 72h'),
|
||||
'value' => 7,
|
||||
'selected' => ($this->cursale!==NULL && $this->cursale->delivery_delay== 7?true:false)
|
||||
),
|
||||
array(
|
||||
'label' => $this->l('Livraison 48h Noel'),
|
||||
'value' => 8,
|
||||
'selected' => ($this->cursale!==NULL && $this->cursale->delivery_delay== 8?true:false)
|
||||
),
|
||||
);
|
||||
// Delivery delay
|
||||
$input = array(
|
||||
'type' => 'select2',
|
||||
'label' => $this->l('Délai de livraison :'),
|
||||
'label-class' => 'text-left',
|
||||
'select-class' => 'text-left',
|
||||
'name' => 'delivery_delay',
|
||||
'options' => $id_delay_options,
|
||||
'required' => true,
|
||||
);
|
||||
echo $helperForm->generateInput($input);
|
||||
echo '<div class="clearfix"></div>';
|
||||
|
||||
// echo '<label>'.$this->l('Délai de livraison :').'</label>
|
||||
// <div class="margin-form">
|
||||
// <div id="delivery_delay" style="float: left;">
|
||||
// <select name="delivery_delay" id="delivery_delay">
|
||||
// <option value="1" '.($this->cursale!==NULL? ($this->cursale->delivery_delay== 1? ' selected="selected"': ''):' selected="selected"').'>'.$this->l('Livraison classique').'</option>
|
||||
// <option value="2" '.($this->cursale!==NULL? ($this->cursale->delivery_delay== 2? ' selected="selected"': ''):' ').'>'.$this->l('Livraison 48h').'</option>
|
||||
// <option value="3" '.($this->cursale!==NULL? ($this->cursale->delivery_delay== 3? ' selected="selected"': ''):' ').'>'.$this->l('Livraison 7 Jours').'</option>
|
||||
// <option value="4" '.($this->cursale!==NULL? ($this->cursale->delivery_delay== 4? ' selected="selected"': ''):' ').'>'.$this->l('Livraison 10 Jours').'</option>
|
||||
// <option value="5" '.($this->cursale!==NULL? ($this->cursale->delivery_delay== 5? ' selected="selected"': ''):' ').'>'.$this->l('Livraison Noël').'</option>
|
||||
// <option value="6" '.($this->cursale!==NULL? ($this->cursale->delivery_delay== 6? ' selected="selected"': ''):' ').'>'.$this->l('Produit Star').'</option>
|
||||
// <option value="7" '.($this->cursale!==NULL? ($this->cursale->delivery_delay== 7? ' selected="selected"': ''):' ').'>'.$this->l('Livraison 72h').'</option>
|
||||
// <option value="8" '.($this->cursale!==NULL? ($this->cursale->delivery_delay== 8? ' selected="selected"': ''):' ').'>'.$this->l('Livraison 48h Noel').'</option>
|
||||
// </select>
|
||||
// <sup> *</sup>
|
||||
// </div>
|
||||
// <div class="clear"></div>
|
||||
// </div>';
|
||||
|
||||
$id_group_options = array();
|
||||
foreach(Db::getInstance()->ExecuteS('
|
||||
SELECT l.`id_group`, l.`name`'.($this->cursale !== NULL? ', (
|
||||
SELECT IFNULL(g.`id_sale`, NULL) FROM `'._DB_PREFIX_.'privatesale_group` g WHERE l.`id_group` = g.`id_group` AND g.`id_sale` = '.$this->cursale->id.'
|
||||
) AS `id_sale`': '').'
|
||||
FROM `'._DB_PREFIX_.'group_lang` l
|
||||
WHERE l.`id_lang` = '.$cookie->id_lang
|
||||
) as $group) {
|
||||
$id_group_options[(int)$group['id_group']] = array(
|
||||
'label' => $group['name'],
|
||||
'value' => (int) $group['id_group']
|
||||
);
|
||||
if(isset($group['id_sale']) && $group['id_sale'] !== NULL){
|
||||
$id_group_options[(int)$group['id_group']]['selected'] = true;
|
||||
}
|
||||
if(!isset($this->cursale->id) && $group['id_group'] == 1){
|
||||
$id_group_options[(int)$group['id_group']]['selected'] = true;
|
||||
}
|
||||
}
|
||||
// Group
|
||||
$input = array(
|
||||
'type' => 'select2',
|
||||
'label' => $this->l('Groups:'),
|
||||
'label-class' => 'text-left',
|
||||
'select-class' => 'text-left',
|
||||
'name' => 'm_groups[]',
|
||||
'id' => 'm_groups',
|
||||
'option_all' => true,
|
||||
'option_clear' => true,
|
||||
'options' => $id_group_options,
|
||||
'multiple' => true,
|
||||
'placeholder' => $this->l('Select one or more groups...'),
|
||||
'required' => true,
|
||||
);
|
||||
echo '<label>'.$this->l('Groups:').'</label>
|
||||
<div class="margin-form">
|
||||
<div id="groups" style="float: left;">
|
||||
<select id="m_groups" name="m_groups[]" multiple="multiple" size="5">
|
||||
<option value=""></option>
|
||||
<optgroup label="'.$this->l('Select one or more groups:').'">';
|
||||
foreach($groups as $group) {
|
||||
echo '<option value="'.$group['id_group'].'"'.(isset($group['id_sale']) && $group['id_sale'] !== NULL?' selected="selected"':'').(!isset($this->cursale->id) && $group['id_group'] == 1? ' selected="selected"': '').'>'.$group['name'].'</option>';
|
||||
}
|
||||
echo '
|
||||
</optgroup>
|
||||
</select>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$("#m_groups").multiSelect({
|
||||
selectAllText: "'.$this->l('Select all').'",
|
||||
noneSelected: " ",
|
||||
oneOrMoreSelected: "*"
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<div class="clear"></div>
|
||||
</div>';
|
||||
echo $helperForm->generateInput($input);
|
||||
echo '<div class="clearfix"></div>';
|
||||
|
||||
$site_versions = array('fr', 'es'/*, 'it'*/);
|
||||
echo '<label>'.$this->l('Versions :').'</label>
|
||||
<div class="margin-form">
|
||||
<div id="versions" style="float: left;">
|
||||
<select id="m_versions" name="m_versions[]" multiple="multiple" size="5">
|
||||
<option value=""></option>
|
||||
<optgroup label="'.$this->l('Select one or more versions:').'">';
|
||||
foreach($site_versions as $version) {
|
||||
echo '<option value="'.$version.'"'.(isset($this->cursale->id) && in_array($version, $this->cursale->versions)? ' selected="selected"': '').(!isset($this->cursale->id) ? ( ($version == 'fr') ? 'selected' : '' ) :'').'>'.$version.'</option>';
|
||||
}
|
||||
echo '
|
||||
</optgroup>
|
||||
</select>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$("#m_versions").multiSelect({
|
||||
selectAllText: "'.$this->l('Select all').'",
|
||||
noneSelected: " ",
|
||||
oneOrMoreSelected: "*"
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<div class="clear"></div>
|
||||
</div>';
|
||||
// echo '<label>'.$this->l('Groups:').'</label>
|
||||
// <div class="margin-form">
|
||||
// <div id="groups" style="float: left;">
|
||||
// <select id="m_groups" name="m_groups[]" multiple="multiple" size="5">
|
||||
// <option value=""></option>
|
||||
// <optgroup label="'.$this->l('Select one or more groups:').'">';
|
||||
// foreach($groups as $group) {
|
||||
// echo '<option value="'.$group['id_group'].'"'.(isset($group['id_sale']) && $group['id_sale'] !== NULL?' selected="selected"':'').(!isset($this->cursale->id) && $group['id_group'] == 1? ' selected="selected"': '').'>'.$group['name'].'</option>';
|
||||
// }
|
||||
// echo '
|
||||
// </optgroup>
|
||||
// </select>
|
||||
// </div>
|
||||
// <script type="text/javascript">
|
||||
// $(document).ready(function() {
|
||||
// $("#m_groups").multiSelect({
|
||||
// selectAllText: "'.$this->l('Select all').'",
|
||||
// noneSelected: " ",
|
||||
// oneOrMoreSelected: "*"
|
||||
// });
|
||||
// });
|
||||
// </script>
|
||||
// <div class="clear"></div>
|
||||
// </div>';
|
||||
|
||||
$countries = Country::getCountries($cookie->id_lang, false);
|
||||
echo '<label>'.$this->l('Pays de la Vente :').'</label>
|
||||
<div class="margin-form">
|
||||
<div id="privatesale_country" style="float: left;">
|
||||
<select name="id_country" id="id_country">
|
||||
<option value="0"></option>';
|
||||
foreach ($countries as $key => $country) {
|
||||
echo '<option value="'.$country['id_country'].'"'.($this->cursale!==NULL? ($this->cursale->id_country==$country['id_country']?' selected="selected"': ''): '').'>'.$country['name'].'</option>';
|
||||
}
|
||||
echo '</select>
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>';
|
||||
$id_version_options = array(
|
||||
array(
|
||||
'label'=> 'fr',
|
||||
'value'=>'fr',
|
||||
'selected'=>false,
|
||||
),
|
||||
array(
|
||||
'label'=>'es',
|
||||
'value'=>'es',
|
||||
'selected'=>false,
|
||||
),
|
||||
);
|
||||
foreach($id_version_options as $version) {
|
||||
if(isset($this->cursale->id) && in_array($version, $this->cursale->versions)){
|
||||
$version['selected'] = true;
|
||||
}
|
||||
if(!isset($this->cursale->id) && $version == 'fr') {
|
||||
$version['selected'] = true;
|
||||
}
|
||||
}
|
||||
// Version
|
||||
$input = array(
|
||||
'type' => 'select2',
|
||||
'label' => $this->l('Versions :'),
|
||||
'label-class' => 'text-left',
|
||||
'select-class' => 'text-left',
|
||||
'name' => 'm_versions[]',
|
||||
'id' => 'm_versions',
|
||||
'option_all' => true,
|
||||
'option_clear' => true,
|
||||
'options' => $id_version_options,
|
||||
'multiple' => true,
|
||||
'placeholder' => $this->l('Select one or more versions...'),
|
||||
'required' => true,
|
||||
);
|
||||
echo $helperForm->generateInput($input);
|
||||
echo '<div class="clearfix"></div>';
|
||||
// $site_versions = array('fr', 'es'/*, 'it'*/);
|
||||
// echo '<label>'.$this->l('Versions :').'</label>
|
||||
// <div class="margin-form">
|
||||
// <div id="versions" style="float: left;">
|
||||
// <select id="m_versions" name="m_versions[]" multiple="multiple" size="5">
|
||||
// <option value=""></option>
|
||||
// <optgroup label="'.$this->l('Select one or more versions:').'">';
|
||||
// foreach($site_versions as $version) {
|
||||
// echo '<option value="'.$version.'"'.(isset($this->cursale->id) && in_array($version, $this->cursale->versions)? ' selected="selected"': '').(!isset($this->cursale->id) ? ( ($version == 'fr') ? 'selected' : '' ) :'').'>'.$version.'</option>';
|
||||
// }
|
||||
// echo '
|
||||
// </optgroup>
|
||||
// </select>
|
||||
// </div>
|
||||
// <script type="text/javascript">
|
||||
// $(document).ready(function() {
|
||||
// $("#m_versions").multiSelect({
|
||||
// selectAllText: "'.$this->l('Select all').'",
|
||||
// noneSelected: " ",
|
||||
// oneOrMoreSelected: "*"
|
||||
// });
|
||||
// });
|
||||
// </script>
|
||||
// <div class="clear"></div>
|
||||
// </div>';
|
||||
|
||||
$id_country_options = array();
|
||||
$id_country_options[0] = array(
|
||||
'label' => 'Choisir...',
|
||||
'value' => (int) 0
|
||||
);
|
||||
foreach (Country::getCountries($cookie->id_lang, false) as $country) {
|
||||
$id_country_options[(int)$country['id_country']] = array(
|
||||
'label' => $country['name'],
|
||||
'value' => (int) $country['id_country']
|
||||
);
|
||||
if($this->cursale!==NULL && $this->cursale->id_country==$country['id_country']){
|
||||
$id_country_options[(int)$country['id_country']]['selected'] = true;
|
||||
}
|
||||
}
|
||||
// country
|
||||
$input = array(
|
||||
'type' => 'select2',
|
||||
'label' => $this->l('Pays de la Vente :'),
|
||||
'label-class' => 'text-left',
|
||||
'select-class' => 'text-left',
|
||||
'name' => 'id_country',
|
||||
'options' => $id_country_options,
|
||||
'required' => true,
|
||||
);
|
||||
echo $helperForm->generateInput($input);
|
||||
echo '<div class="clearfix"></div>';
|
||||
|
||||
// $countries = Country::getCountries($cookie->id_lang, false);
|
||||
// echo '<label>'.$this->l('Pays de la Vente :').'</label>
|
||||
// <div class="margin-form">
|
||||
// <div id="privatesale_country" style="float: left;">
|
||||
// <select name="id_country" id="id_country">
|
||||
// <option value="0"></option>';
|
||||
// foreach ($countries as $key => $country) {
|
||||
// echo '<option value="'.$country['id_country'].'"'.($this->cursale!==NULL? ($this->cursale->id_country==$country['id_country']?' selected="selected"': ''): '').'>'.$country['name'].'</option>';
|
||||
// }
|
||||
// echo '</select>
|
||||
// </div>
|
||||
// <div class="clear"></div>
|
||||
// </div>';
|
||||
|
||||
// if(Configuration::get('PRIVATESALES_CARRIERFENCE')) {
|
||||
$carriers = Db::getInstance()->ExecuteS('
|
||||
|
Loading…
Reference in New Issue
Block a user