fix conflicts

This commit is contained in:
Marion Muszynski 2017-02-22 16:28:25 +01:00
commit 54f955f882
3 changed files with 591 additions and 277 deletions

View File

@ -211,6 +211,9 @@ class HelperFormBootstrap{
case 'radio':
$this->inputBool($input);
break;
case 'radio2':
$this->inputRadio($input);
break;
case 'checkbox':
$this->inputCheckbox($input);
break;
@ -620,8 +623,9 @@ class HelperFormBootstrap{
}
public function inputFile($p = array()){
$this->_html .= '<label' . (isset($p['class']) && $p['class'] ? ' class="' . $p['class'] . '"' : '') . '>'.$p['label'].'</label>
<div class="margin-form' . (isset($p['class']) && $p['class'] ? ' ' . $p['class'] : '') . '">
$this->_html .= '
<div class="form-group ' . (isset($p['class']) && $p['class'] ? ' ' . $p['class'] : '') . '">
<label class="control-label '.(isset($p['label-class']) ? $p['label-class'] : '').'">'.$p['label'].'</label>
<input type="file" name="'.$p['name'].'" id="'.$p['name'].'" value="" />
' . ((isset($p['required']) && $p['required']) ? '<sup> *</sup>' : '') . '
' . ((isset($p['hint']) && $p['hint']) ? '<p class="small">'.$p['hint'].'</p>' : '') . '
@ -632,22 +636,24 @@ class HelperFormBootstrap{
public function inputSelect($p = array()){
$disabled = ((isset($p['disabled']) && $p['disabled']) ? 'disabled="disabled"' : '');
$this->_html .= '<label' . (isset($p['class']) && $p['class'] ? ' class="' . $p['class'] . '"' : '') . '>'.$p['label'].'</label>
<div class="margin-form' . (isset($p['class']) && $p['class'] ? ' ' . $p['class'] : '') . '">
<select ' . $disabled . ' id="'.$p['name'].'" name="'.$p['name'].'">';
foreach($p['options'] as $opt) {
$selected = '';
if (
(isset($opt['selected']) && $opt['selected']) ||
(isset($this->_object) && $this->_object->{$p['name']} == $opt['value'])
)
$selected = ' selected="selected"';
$this->_html .= '<option id="' . $p['name'] . '_' . $opt['value'] . '" value="' . $opt['value'] . '"'. $selected .'>'.$opt['label'].'</option>';
}
$this->_html .= '
</select>
' . ((isset($p['filter']) && $p['filter']) ? '<div class="clear"></div><br/><input data-id="' . $p['name'] . '" class="select_filter" id="filter_' . $p['name'] . '" type="text" ' . ((isset($p['filter_text']) && $p['filter_text']) ? 'placeholder="' . $p['filter_text'] . '"' : '') . 'autocomplete="off" value="" />&nbsp;<span class="filter_count" id="filter_count_' . $p['name'] . '"></span>' : '') . '
' . ((isset($p['html']) && $p['html']) ? $p['html'] : '') . '
<div class="form-group ' . (isset($p['class']) && $p['class'] ? ' ' . $p['class'] : '') . '">
<label class="control-label '.(isset($p['label-class']) ? $p['label-class'] : '').'">'.$p['label'].'</label>
<div class="'.(isset($p['input-class']) ? $p['input-class'] : '').'">
<select class="form-control" ' . $disabled . ' id="'.$p['name'].'" name="'.$p['name'].'">';
foreach($p['options'] as $opt) {
$selected = '';
if (
(isset($opt['selected']) && $opt['selected']) ||
(isset($this->_object) && $this->_object->{$p['name']} == $opt['value'])
)
$selected = ' selected="selected"';
$this->_html .= '<option id="' . $p['name'] . '_' . $opt['value'] . '" value="' . $opt['value'] . '"'. $selected .'>'.$opt['label'].'</option>';
}
$this->_html .= '
</select>
' . ((isset($p['html']) && $p['html']) ? $p['html'] : '') . '
</div>
</div>';
}
@ -691,6 +697,21 @@ class HelperFormBootstrap{
</div>';
}
public function inputRadio($p = array()) {
$this->_html .= '
<div class="form-group">
<label class="control-label ' . (isset($p['label-class']) && $p['label-class'] ? $p['label-class'] : '') . '">'.$p['label'].' </label>
<div class="' . (isset($p['input-class']) && $p['input-class'] ? $p['input-class'] : '') . '">';
foreach($p['options'] as $key => $option) {
$this->_html .= '<label class="radio-inline" for="'.$p['name'].'_'.$key.'">
<input type="radio" name="'.$p['name'].'" value="'.$option['value'].'" id="'.$p['name'] . '_' . $opt['value'].'"'.($option['checked']? ' checked="checked"' : '').' /> '.(isset($option['label']) && $option['label'] ?$option['label']:'').'
</label>';
}
$this->_html .= '<div class="clearfix"></div>
</div>
</div>';
}
public function inputCheckbox($p = array()){
$checked = ((isset($p['checked']) && $p['checked']) ? $p['checked'] : false);
if ($this->_object)

View File

@ -192,6 +192,12 @@ form label{
.lateral-solid-t{
border-top:1px solid #E6E9ED;
}
.lateral-delimiter {
width: 1px;
height: 90px;
background: #e5e5e5;
display: inline-block;
}
/* FORM */
form p:first-child{
@ -317,6 +323,13 @@ input[type="file"],
textarea {
border: 1px solid #ccc;
}
.help-block {
font-weight: 100;
font-size: 12px;
margin: 0;
margin-top: 5px;
padding:0;
}
/* table */
table.table-custombordered {

View File

@ -3,6 +3,7 @@ if(!defined('_PS_VERSION_')) {
exit;
}
include_once(_PS_ROOT_DIR_.'/modules/privatesales/Sale.php');
include_once(PS_ADMIN_DIR . '/helpers/HelperFormBootstrap.php');
class AdminBulkUpdate extends AdminTab {
public $_html = '';
@ -11,7 +12,6 @@ class AdminBulkUpdate extends AdminTab {
global $cookie;
set_time_limit(300);
if (Tools::isSubmit('submitUploadProductCustoms')) {
$process = (int) Tools::getValue('customs_process');
if(isset($_FILES['csvfile']) && $_FILES['csvfile']['name'] != '') {
@ -1444,11 +1444,11 @@ class AdminBulkUpdate extends AdminTab {
str_replace('.', ',', Tools::ps_round(($quantity_sold * $p->wholesale_price),2)),
$p->id_tax_rules_group,
// $p->active,
$p->description_short[$id_lang],
$p->description[$id_lang],
$p->description_more[$id_lang],
$p->videos[$id_lang],
$p->description_delivery[$id_lang],
str_replace(array('&euro;','&amp;'),array('€','&'),$p->description_short[$id_lang]),
str_replace(array('&euro;','&amp;'),array('€','&'),$p->description[$id_lang]),
str_replace(array('&euro;','&amp;'),array('€','&'),$p->description_more[$id_lang]),
str_replace(array('&euro;','&amp;'),array('€','&'),$p->videos[$id_lang]),
str_replace(array('&euro;','&amp;'),array('€','&'),$p->description_delivery[$id_lang]),
count($c_images) > 0? implode(', ', $c_images): implode(', ', $images),
count($c_images) > 0? count($c_images): count($images),
$categorie_0,
@ -1507,11 +1507,11 @@ class AdminBulkUpdate extends AdminTab {
str_replace('.', ',', Tools::ps_round(($quantity_sold * $p->wholesale_price),2)),
$p->id_tax_rules_group,
// $p->active,
$p->description_short[$id_lang],
$p->description[$id_lang],
$p->description_more[$id_lang],
$p->videos[$id_lang],
$p->description_delivery[$id_lang],
str_replace(array('&euro;','&amp;'),array('€','&'),$p->description_short[$id_lang]),
str_replace(array('&euro;','&amp;'),array('€','&'),$p->description[$id_lang]),
str_replace(array('&euro;','&amp;'),array('€','&'),$p->description_more[$id_lang]),
str_replace(array('&euro;','&amp;'),array('€','&'),$p->videos[$id_lang]),
str_replace(array('&euro;','&amp;'),array('€','&'),$p->description_delivery[$id_lang]),
implode(', ', $images),
count($images),
$categorie_0,
@ -1900,127 +1900,534 @@ class AdminBulkUpdate extends AdminTab {
public function display(){
global $cookie;
$output = '<h2>Mise à jour groupée</h2>';
$output .= '
<form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="post" enctype="multipart/form-data">
<fieldset><legend><img src="/modules/bulkupdate/logo.gif" alt="" title="" />'.$this->l('Update categories').'</legend>
<label>'.$this->l('Action:').'</label>
<div class="margin-form">
<input type="radio" id="category_process_0" name="category_process" value="0" /> <label style="float: none;" for="category_process_0">'.$this->l('Update').'</label>
<input type="radio" id="category_process_1" name="category_process" value="1" /> <label style="float: none;" for="category_process_1">'.$this->l('Replace').'</label>
</div>
<p> </p>
<label>'.$this->l('File:').'</label>
<div class="margin-form">
<input type="file" name="csvfile" />
<p>'.$this->l('Format: id_product;id_category,id_category,...;id_category_default -- the subsequent columns and the first line are ignored').'</p>
</div>
<p> </p>
<center><input type="submit" name="submitUploadCategories" value="'.$this->l('Upload').'" class="button" /></center>
</fieldset>
</form>';
$option_langs = array();
$option_select_langs = array();
foreach (Language::getLanguages(false) as $key => $value) {
$option_langs[$key] = array(
'value' =>$value['id_lang'],
'label' => $value['iso_code']
);
$option_select_langs[$key] = array(
'value' =>$value['id_lang'],
'label' => $value['name']
);
if($value['id_lang'] == 2){
$option_langs[$key]['checked'] = 1;
$option_select_langs[$key]['selected'] = 1;
}
}
$output .= '
<p><br /></p>
<form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="post" enctype="multipart/form-data">
<fieldset><legend><img src="/modules/bulkupdate/logo.gif" alt="" title="" />'.$this->l('Update prices').'</legend>
<label>'.$this->l('Action:').'</label>
<div class="margin-form">
<input type="radio" id="price_process_1" name="price_process" value="1" /> <label style="float: none;" for="price_process_1">'.$this->l('Réduction').'</label>
<input type="radio" id="price_process_3" name="price_process" value="3" /> <label style="float: none;" for="price_process_3">'.$this->l('Prix d\'achat HT').'</label>
<input type="radio" id="price_process_4" name="price_process" value="4" /> <label style="float: none;" for="price_process_4">'.$this->l('Prix public TTC').'</label>
</div>
<p> </p>
<label>'.$this->l('File:').'</label>
<div class="margin-form">
<input type="file" name="csvfile" />
<p>'.$this->l('Format: id_product;montant').'</p>
<p>'.$this->l('Montant : Pourcentage de remise, Prix HT, Prix TTC en fonction du choix').'</p>
</div>
<p> </p>
<center><input type="submit" name="submitUploadPrices" value="'.$this->l('Upload').'" class="button" /></center>
</fieldset>
</form>';
$option_sales = array();
foreach(Db::getInstance()->ExecuteS('
SELECT c.`id_category`, l.`name`
FROM `'._DB_PREFIX_.'category_lang` l
LEFT JOIN `'._DB_PREFIX_.'category` c
ON c.`id_category` = l.`id_category`
WHERE l.`id_lang` = '.(int) $cookie->id_lang.'
AND c.`id_parent` = 1
ORDER BY id_category DESC
') as $row) {
$extrafields = Category::getSalesInfosWithDate(array((int) $row['id_category']));
$option_sales[] = array(
'value' => $row['id_category'],
'label' => '#'.$row['id_category'].' ('.date("d/m/Y",strtotime($extrafields[(int) $row['id_category']]['date_start'])).') - '.$row['name'].' - '.$extrafields[(int) $row['id_category']]['sales'][1]
);
}
// $output .= '
// <p><br /></p>
// <form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="post" enctype="multipart/form-data">
// <fieldset><legend><img src="'.$this->_path.'logo.gif" alt="" title="" />'.$this->l('Update status').'</legend>
// <label>'.$this->l('File:').'</label>
// <div class="margin-form">
// <input type="file" name="csvfile" />
// <p>'.$this->l('Format: id_product;active (0 / 1) -- the subsequent columns and the first line are ignored').'</p>
// </div>
// <p> </p>
// <center><input type="submit" name="submitUploadStatus" value="'.$this->l('Upload').'" class="button" /></center>
// </fieldset>
// </form>';
$helperForm = new HelperFormBootstrap();
$helperForm->_select2 = true;
$helperForm->_inputSwitch = true;
$helperForm->_inputMask = true;
$output = $helperForm->renderStyle();
$output .= '<h2>Mise à jour groupée</h2>';
$output .= '
<p><br /></p>
<form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="post" enctype="multipart/form-data">
<fieldset><legend><img src="/modules/bulkupdate/logo.gif" alt="" title="" />'.$this->l('Update images').'</legend>
<label>'.$this->l('Action:').'</label>
<div class="margin-form">
<input type="radio" id="image_process_0" name="image_process" value="0" /> <label style="float: none;" for="image_process_0">'.$this->l('Update').'</label>
<input type="radio" id="image_process_1" name="image_process" value="1" /> <label style="float: none;" for="image_process_1">'.$this->l('Replace').'</label>
</div>
<p> </p>
<label>'.$this->l('File:').'</label>
<div class="margin-form">
<input type="file" name="csvfile" />
<p>'.$this->l('Format: id_product;image_url,image_url,... -- the subsequent columns and the first line are ignored').'</p>
</div>
<p> </p>
<center><input type="submit" name="submitUploadImages" value="'.$this->l('Upload').'" class="button" /></center>
</fieldset>
</form>';
// Categories
$output .= '<div class="row">
<div class="col-md-12">
<div class="panel">
<ul class="nav nav-tabs nav-justified">
<li role="presentation" class="active">
<a href="#categories" aria-controls="categories" role="tab" data-toggle="tab"><span class="text-rose anticon anticon-tree"></span> '.$this->l('Categories').'</a>
</li>
<li role="presentation">
<a href="#prices" aria-controls="prices" role="tab" data-toggle="tab"><span class="text-rose anticon anticon-coin-euro"></span> '.$this->l('Prices').'</a>
</li>
<li role="presentation">
<a href="#images" aria-controls="images" role="tab" data-toggle="tab"><span class="text-rose anticon anticon-images"></span> '.$this->l('Images').'</a>
</li>
<li role="presentation">
<a href="#quantities" aria-controls="quantities" role="tab" data-toggle="tab"><span class="text-rose anticon anticon-calculator"></span> '.$this->l('Quantities').'</a>
</li>
<li role="presentation">
<a href="#descriptions" aria-controls="descriptions" role="tab" data-toggle="tab"><span class="text-rose anticon anticon-newspaper"></span> '.$this->l('Descriptions').'</a>
</li>
<li role="presentation">
<a href="#combinations" aria-controls="combinations" role="tab" data-toggle="tab"><span class="text-rose anticon anticon-cross"></span> '.$this->l('Combinations').'</a>
</li>
<li role="presentation">
<a href="#eans" aria-controls="eans" role="tab" data-toggle="tab"><span class="text-rose anticon anticon-barcode"></span> '.$this->l('EAN').'</a>
</li>
<li role="presentation">
<a href="#customs" aria-controls="customs" role="tab" data-toggle="tab"><span class="text-rose anticon anticon-earth"></span> '.$this->l('Customs').'</a>
</li>
</ul>
$output .= '
<p><br /></p>
<form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="post" enctype="multipart/form-data">
<fieldset><legend><img src="/modules/bulkupdate/logo.gif" alt="" title="" />'.$this->l('Update quantities').'</legend>
<label>'.$this->l('Quantity process:').'</label>
<div class="margin-form">
<input type="radio" id="qty_process_0" name="qty_process" value="0" /> <label style="float: none;" for="qty_process_0">'.$this->l('Update').'</label>
<input type="radio" id="qty_process_1" name="qty_process" value="1" /> <label style="float: none;" for="qty_process_1">'.$this->l('Replace').'</label>
</div>
<p> </p>
<label>'.$this->l('File:').'</label>
<div class="margin-form">
<input type="file" name="csvfile" />
<p>'.$this->l('Format: id_product;id_product_attribute;quantity -- the subsequent columns and the first line are ignored').'</p>
</div>
<p> </p>
<center><input type="submit" name="submitUploadQuantities" value="'.$this->l('Upload').'" class="button" /></center>
</fieldset>
</form>';
<div class="tab-content">
<div role="tabpanel" class="tab-pane active" id="categories">
<div class="panel-content">
<h3 class="">'.$this->l('Update categories').'</h3>
<br>
<form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="post" enctype="multipart/form-data">
<div class="col-md-6 col-md-offset-4">';
$input = array(
'type' => 'radio2',
'label' => $this->l('Action'),
'label-class' => 'text-left',
'name' => 'category_process',
'options' => array(
array(
'value' => 0,
'label' => $this->l('Update')
),
array(
'value' => 1,
'label' => $this->l('Replace')
)
),
);
$output .= $helperForm->generateInput($input);
$help = '<br>
<p class="help-block">'.$this->l('Format : id_produit;id_catégorie,id_catégorie,...;id_catégorie_défaut').'</p>
<p class="help-block">'.$this->l('The subsequent columns and the first line are ignored').'</p>
';
$input = array(
'type' => 'file',
'label' => $this->l('File:'),
'name' => 'csvfile',
'html' => $help
);
$output .= $helperForm->generateInput($input).'</div>';
$langs = Language::getLanguages(false);
$output .= '
<div class="clearfix"></div>
<div class="ln_solid"></div>
<div class="form-group text-right">
<button type="submit" class="btn btn-primary" name="submitUploadCategories">'.$this->l('Upload').'</button>
</div>
</form>
</div>
</div>
<div role="tabpanel" class="tab-pane" id="prices">
<div class="panel-content">
<h3 class="">'.$this->l('Update prices').'</h3>
<br>
<form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="post" enctype="multipart/form-data">
<div class="col-md-6 col-md-offset-4">';
$input = array(
'type' => 'radio2',
'label' => $this->l('Action'),
'label-class' => 'text-left',
'name' => 'price_process',
'options' => array(
array(
'value' => 1,
'label' => $this->l('Réduction')
),
array(
'value' => 3,
'label' => $this->l('Prix d\'achat HT')
),
array(
'value' => 4,
'label' => $this->l('Prix public TTC')
)
),
);
$output .= $helperForm->generateInput($input);
$help = '<br><p class="help-block">'.$this->l('Format : id_product;montant').'</p>
<p class="help-block">'.$this->l('Montant : Pourcentage de remise, Prix HT, Prix TTC en fonction du choix').'</p>';
$input = array(
'type' => 'file',
'label' => $this->l('File:'),
'name' => 'csvfile',
'html' => $help
);
$output .= $helperForm->generateInput($input).'</div>';
$output .= '<div class="clearfix"></div>
<div class="ln_solid"></div>
<div class="form-group text-right">
<button type="submit" class="btn btn-primary" name="submitUploadPrices">'.$this->l('Upload').'</button>
</div>
</form>
</div>
</div>
<div role="tabpanel" class="tab-pane" id="images">
<div class="panel-content">
<h3 class="">'.$this->l('Update images').'</h3>
<br>
<form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="post" enctype="multipart/form-data">
<div class="col-md-6 col-md-offset-4">';
$input = array(
'type' => 'radio2',
'label' => $this->l('Action'),
'label-class' => 'text-left',
'select-class' => 'text-left',
'name' => 'image_process',
'options' => array(
array(
'value' => 0,
'label' => $this->l('Update')
),
array(
'value' => 1,
'label' => $this->l('Replace')
)
),
);
$help = '<br>
<p class="help-block">'.$this->l('Format: id_product;image_url,image_url,...').'</p>
<p class="help-block">'.$this->l('the subsequent columns and the first line are ignored').'</p>';
$output .= $helperForm->generateInput($input);
$input = array(
'type' => 'file',
'label' => $this->l('File:'),
'name' => 'csvfile',
'html' => $help
);
$output .= $helperForm->generateInput($input);
$output .= '</div>
<div class="clearfix"></div>
<div class="ln_solid"></div>
<div class="form-group text-right">
<button type="submit" class="btn btn-primary" name="submitUploadImages">'.$this->l('Upload').'</button>
</div>
</form>
</div>
</div>
<div role="tabpanel" class="tab-pane" id="quantities">
<div class="panel-content">
<h3 class="">'.$this->l('Update quantities').'</h3>
<br>
<form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="post" enctype="multipart/form-data">
<div class="col-md-6 col-md-offset-4">';
$input = array(
'type' => 'radio2',
'label' => $this->l('Action'),
'label-class' => 'text-left',
'name' => 'qty_process',
'options' => array(
array(
'value' => 0,
'label' => $this->l('Update')
),
array(
'value' => 1,
'label' => $this->l('Replace')
)
),
);
$output .= $helperForm->generateInput($input);
$help = '<br>
<p class="help-block">'.$this->l('Format: id_product;id_product_attribute;quantity').'</p>
<p class="help-block">'.$this->l('The subsequent columns and the first line are ignored.').'</p>
';
$input = array(
'type' => 'file',
'label' => $this->l('File:'),
'name' => 'csvfile',
'html' => $help
);
$output .= $helperForm->generateInput($input);
$output .= '</div>
<div class="clearfix"></div>
<div class="ln_solid"></div>
<div class="form-group text-right">
<button type="submit" class="btn btn-primary" name="submitUploadQuantities">'.$this->l('Upload').'</button>
</div>
</form>
</div>
</div>';
// Product Description
$output .= '
<div role="tabpanel" class="tab-pane" id="descriptions">
<div class="panel-content">
<h3 class="">'.$this->l('Update product descriptions').'</h3>
<br>
<form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="post" enctype="multipart/form-data">
<div class="col-md-6 col-md-offset-4">';
$input = array(
'type' => 'radio2',
'label' => $this->l('Action'),
'label-class' => 'text-left',
'name' => 'description_process',
'options' => $option_langs
);
$output .= $helperForm->generateInput($input);
$help = '<br>
<p class="help-block">'.$this->l('Format : id_product;description').'</p>
<p class="help-block">'.$this->l('The subsequent columns and the first line are ignored.').'</p>
';
$input = array(
'type' => 'file',
'label' => $this->l('File:'),
'name' => 'csvfile',
'html' => $help
);
$output .= $helperForm->generateInput($input);
$output .= '</div>
<div class="clearfix"></div>
<div class="ln_solid"></div>
<div class="form-group text-right">
<button type="submit" class="btn btn-primary" name="submitUploadProductDescriptions">'.$this->l('Upload').'</button>
</div>
</form>
</div>
</div>
<div role="tabpanel" class="tab-pane" id="combinations">
<div class="panel-content">
<h3 class="">'.$this->l('Delete combinations').'</h3>
<br>
<form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="post" enctype="multipart/form-data">
<div class="col-md-6 col-md-offset-4">';
$help = '<br>
<p class="help-block">'.$this->l('Format: id_product').'</p>
<p class="help-block">'.$this->l('The subsequent columns and the first line are ignored.').'</p>
';
$input = array(
'type' => 'file',
'label' => $this->l('File:'),
'name' => 'csvfile',
'html' => $help
);
$output .= $helperForm->generateInput($input);
$output .= '</div>
<div class="clearfix"></div>
<div class="ln_solid"></div>
<div class="form-group text-right">
<button type="submit" class="btn btn-primary" name="submitUploadCombinations">'.$this->l('Upload').'</button>
</div>
</form>
</div>
</div>
<div role="tabpanel" class="tab-pane" id="eans">
<div class="panel-content">
<h3 class="">'.$this->l('Update EAN').'</h3>
<br>
<form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="post" enctype="multipart/form-data">
<div class="col-md-6 col-md-offset-4">';
$help = '<br>
<p class="help-block">'.$this->l('Format : id_produit;id_product_attribute;ean').'</p>
<p class="help-block">'.$this->l('The subsequent columns and the first line are ignored.').'</p>
';
$input = array(
'type' => 'file',
'label' => $this->l('File:'),
'name' => 'csvfile',
'html' => $help
);
$output .= $helperForm->generateInput($input);
$output .= '</div>
<div class="clearfix"></div>
<div class="ln_solid"></div>
<div class="form-group text-right">
<button type="submit" class="btn btn-primary" name="submitUploadEans">'.$this->l('Upload').'</button>
</div>
</form>
</div>
</div>
<div role="tabpanel" class="tab-pane" id="customs">
<div class="panel-content">
<h3 class="">'.$this->l('Update product customs').'</h3>
<br>
<form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="post" enctype="multipart/form-data">
<div class="col-md-6 col-md-offset-4">';
$input = array(
'type' => 'radio2',
'label' => $this->l('Action'),
'label-class' => 'text-left',
'name' => 'custom_process',
'options' => array(
array(
'value' => 0,
'label' => $this->l('Update')
),
array(
'value' => 1,
'label' => $this->l('Replace')
)
),
);
$output .= $helperForm->generateInput($input);
$help = '<br>
<p class="help-block">'.$this->l('Format : id_product;nc8;country').'</p>
<p class="help-block">'.$this->l('The subsequent columns and the first line are ignored.').'</p>
';
$input = array(
'type' => 'file',
'label' => $this->l('File:'),
'name' => 'csvfile',
'html' => $help
);
$output .= $helperForm->generateInput($input);
$output .= '</div>
<div class="clearfix"></div>
<div class="ln_solid"></div>
<div class="form-group text-right">
<button type="submit" class="btn btn-primary" name="submitUploadProductCustoms">'.$this->l('Upload').'</button>
</div>
</form>
</div>
</div>
</div>
</div>
</div>';
// Sale Export
$output .= '
<p><br /></p>
<form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="post" enctype="multipart/form-data">
<fieldset><legend><img src="/modules/bulkupdate/logo.gif" alt="" title="" />'.$this->l('Update product descriptions').'</legend>
<label>'.$this->l('Description process:').'</label>
<div class="margin-form">';
foreach ($langs as $key => $value) {
if ($value['id_lang'] == 2) {
$output .= '<input type="radio" id="description_process_'.$value['id_lang'].'" name="description_process" value="'.$value['id_lang'].'" checked/> <label style="float: none;" for="description_process_'.$value['id_lang'].'">'.$value['iso_code'].'</label>';
} else {
$output .= '<input type="radio" id="description_process_'.$value['id_lang'].'" name="description_process" value="'.$value['id_lang'].'"/> <label style="float: none;" for="description_process_'.$value['id_lang'].'">'.$value['iso_code'].'</label>';
}
}
<div class="col-md-12">
<div class="panel">
<div class="panel-title">
<h2><span class="text-rose anticon anticon-upload"></span> '.$this->l('Export').'</h2>
<div class="clearfix"></div>
</div>
<div class="panel-content">
<form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="post" enctype="multipart/form-data">
<br>
<div class="col-md-5">';
$input = array(
'type' => 'select2',
'name' => 'category',
'id' => 'category',
'label' => $this->l('Select a category to export:'),
'label-class' => 'col-md-12',
'input-class' => 'col-md-12',
'select-class' => 'col-md-12',
'options' => $option_sales
);
$output .= $helperForm->generateInput($input).
'</div>';
$output .='<div class="col-md-2 text-center"><span class="lateral-delimiter"></span></div>
<div class="col-md-5">';
$input = array(
'type' => 'simpleDate',
'period' => true,
'class-from' => 'col-md-6',
'class-to' => 'col-md-6',
'label' => 'Du :',
'label-to' => 'Au :',
'id' => 'date_start',
'id-to' => 'date_end',
'name' => 'date_start',
'name-to' => 'date_end',
'before' => '<span class="glyphicon glyphicon-calendar"></span>',
'before-to' => '<span class="glyphicon glyphicon-calendar"></span>',
);
$output .= $helperForm->generateInput($input).
'<p class="text-center help-block">Format : AAAA-MM-JJ</p>
</div>
<div class="clearfix"></div>
<br>
<div class="col-md-4 col-md-offset-4 text-center">';
$input = array(
'type' => 'select',
'name' => 'id_lang',
'id' => 'id_lang',
'label' => $this->l('Select a language:'),
'label-class' => 'col-md-12 text-center',
'input-class' => 'col-md-12',
'options' => $option_select_langs
);
$output .= $helperForm->generateInput($input).
'</div>';
$output .= '</div>
<p> </p>
<label>'.$this->l('File:').'</label>
<div class="margin-form">
<input type="file" name="csvfile" />
<p>'.$this->l('Format: id_product;description; the subsequent columns and the first line are ignored').'</p>
<div class="clearfix"></div>
<div class="ln_solid"></div>
<div class="form-group text-right">
<button type="submit" class="btn btn-primary" name="submitExport">'.$this->l('Upload').'</button>
</div>
</form>
</div>
<p> </p>
<center><input type="submit" name="submitUploadProductDescriptions" value="'.$this->l('Upload').'" class="button" /></center>
</fieldset>
</form>';
</div>';
// Export Sale DEB
$output .= '
<div class="col-md-12">
<div class="panel">
<div class="panel-title">
<h2><span class="text-rose anticon anticon-upload"></span> '.$this->l('Export DEB').'</h2>
<div class="clearfix"></div>
</div>
<div class="panel-content">
<form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="post" enctype="multipart/form-data">
<div class="col-md-5 col-md-offset-4">';
$input = array(
'type' => 'select',
'name' => 'deb',
'id' => 'deb',
'label' => $this->l('Select a DEB:'),
'label-class' => 'col-md-12',
'input-class' => 'col-md-12',
'options' => array(
array(
'value' => 1,
'label' => 'DEB introduction'
),
array(
'value' => 2,
'label' => 'DEB expedition'
)
)
);
$output .= $helperForm->generateInput($input).
'<div class="clearfix"></div><br>
<div class="col-md-12">
<p class="text-left help-block">Introduction : Selon date des ventes</p>
<p class="text-left help-block">Expedition : Selon date des commandes</p>
</div>
<div class="clearfix"></div><br>';
$input = array(
'type' => 'simpleDate',
'period' => true,
'class-from' => 'col-md-6',
'class-to' => 'col-md-6',
'label' => 'Du :',
'label-to' => 'Au :',
'id' => 'date_start_deb',
'id-to' => 'date_end_deb',
'name' => 'date_start',
'name-to' => 'date_end',
'before' => '<span class="glyphicon glyphicon-calendar"></span>',
'before-to' => '<span class="glyphicon glyphicon-calendar"></span>',
);
$output .= $helperForm->generateInput($input).
'<p class="text-center help-block">Format : AAAA-MM-JJ</p>';
$output .= '</div>
<div class="clearfix"></div>
<div class="ln_solid"></div>
<div class="form-group text-right">
<button type="submit" class="btn btn-primary" name="submitExportDeb">'.$this->l('Upload').'</button>
</div>
</form>
</div>
</div>
</div>
</div>';
// $output .= '
// <p><br /></p>
@ -2149,143 +2556,16 @@ class AdminBulkUpdate extends AdminTab {
// </fieldset>
// </form>';
$output .= '
<p><br /></p>
<form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="post" enctype="multipart/form-data">
<fieldset><legend><img src="/modules/bulkupdate/logo.gif" alt="" title="" />'.$this->l('Delete combinations').'</legend>
<label>'.$this->l('File:').'</label>
<div class="margin-form">
<input type="file" name="csvfile" />
<p>'.$this->l('Format: id_product -- the subsequent columns and the first line are ignored').'</p>
</div>
<p> </p>
<center><input type="submit" name="submitUploadCombinations" value="'.$this->l('Upload').'" class="button" /></center>
</fieldset>
</form>';
$output .= '
<p><br /></p>
<form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="post" enctype="multipart/form-data">
<fieldset><legend><img src="/modules/bulkupdate/logo.gif" alt="" title="" />'.$this->l('Update EAN').'</legend>
<label>'.$this->l('File:').'</label>
<div class="margin-form">
<input type="file" name="csvfile" />
<p>'.$this->l('Format: id_product;id_product_attribute;ean -- the subsequent columns and the first line are ignored').'</p>
</div>
<p> </p>
<center><input type="submit" name="submitUploadEans" value="'.$this->l('Upload').'" class="button" /></center>
</fieldset>
</form>';
$output .= '
<p><br /></p>
<form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="post" enctype="multipart/form-data">
<fieldset><legend><img src="/modules/bulkupdate/logo.gif" alt="" title="" />'.$this->l('Export').'</legend>
<label>'.$this->l('Select a category to export:').'</label>
<div class="margin-form">
<br />
<select class="chosen-select" id="category" name="category">
<option value=""></option>
';
//$sales_root = (int) Configuration::get('PRIVATESALES_ROOT');
foreach(Db::getInstance()->ExecuteS('
SELECT c.`id_category`, l.`name`
FROM `'._DB_PREFIX_.'category_lang` l
LEFT JOIN `'._DB_PREFIX_.'category` c
ON c.`id_category` = l.`id_category`
WHERE l.`id_lang` = '.(int) $cookie->id_lang.'
AND c.`id_parent` = 1
ORDER BY id_category DESC
') as $row) {
$extrafields = Category::getSalesInfosWithDate(array((int) $row['id_category']));
$output .= '<option value="'.$row['id_category'].'">'.$row['id_category'].' - '.date("d/m/Y",strtotime($extrafields[(int) $row['id_category']]['date_start'])).' - '.$row['name'].' - '.$extrafields[(int) $row['id_category']]['sales'][1].'</option>';
}
$output .= '</select>
</div>
<p> </p>
<label>'.$this->l('Par date de début :').'</label>
<div class="margin-form">
Du <input type="text" name="date_start">
au <input type="text" name="date_end">
<p>Format : AAAA-MM-JJ</p>
</div>
<p> </p>
<label>'.$this->l('Select a language:').'</label>
<div class="margin-form">
<select id="id_lang" name="id_lang">
';
foreach(Language::getLanguages(FALSE) as $lang) {
$output .= '<option value="'.$lang['id_lang'].'"'.($cookie->id_lang == $lang['id_lang']? ' selected="selected"': '').'>'.$lang['name'].'</option>';
}
$output.= '</select>
</div>
<p> </p>
<center><input type="submit" name="submitExport" value="'.$this->l('Export').'" class="button" /></center>
</fieldset>
</form>';
$output .= '<p><br /></p>
<form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="post" enctype="multipart/form-data">
<fieldset><legend><img src="/modules/bulkupdate/logo.gif" alt="" title="" />'.$this->l('Export DEB').'</legend>
<label>'.$this->l('Select a DEB:').'</label>
<div class="margin-form">
<select id="deb" name="deb">
<option value="1">DEB introduction</option>
<option value="2">DEB expedition</option>
</select>
<p>Introduction : selon date des ventes</p>
<p>Expedition : selon date des commandes</p>
</div><p> </p>
<label>'.$this->l('Par date de début :').'</label>
<div class="margin-form">
Du <input type="text" name="date_start">
au <input type="text" name="date_end">
<p>Format : AAAA-MM-JJ</p>
</div>
<center><input type="submit" name="submitExportDeb" value="'.$this->l('Export').'" class="button" /></center>
</fieldset>
</form>';
$output .= '
<p><br /></p>
<form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="post" enctype="multipart/form-data">
<fieldset><legend><img src="/modules/bulkupdate/logo.gif" alt="" title="" />'.$this->l('Update product customs').'</legend>
<label>'.$this->l('Product customs process:').'</label>
<div class="margin-form">
<input type="radio" id="customs_process_0" name="customs_process" value="0" /> <label style="float: none;" for="qty_process_0">'.$this->l('Update').'</label>
<input type="radio" id="customs_process_1" name="customs_process" value="1" /> <label style="float: none;" for="qty_process_1">'.$this->l('Replace').'</label>
</div>
<p> </p>
<label>'.$this->l('File:').'</label>
<div class="margin-form">
<input type="file" name="csvfile" />
<p>'.$this->l('Format: id_product;nc8;country -- the subsequent columns and the first line are ignored').'</p>
</div>
<p> </p>
<center><input type="submit" name="submitUploadProductCustoms" value="'.$this->l('Upload').'" class="button" /></center>
</fieldset>
</form>';
echo '<link type="text/css" rel="stylesheet" href="'._MODULE_DIR_.'bulkupdate/chosen.min.css" />';
echo '<script type="text/javascript" src="'._MODULE_DIR_.'bulkupdate/chosen.jquery.min.js"></script>';
echo '<script type="text/javascript">
$(function() {
$(".chosen-select").chosen(
{
allow_single_deselect:true,
placeholder_text_single : "Choisir une vente",
no_results_text : "Aucun résultat",
enable_split_word_search : true,
search_contains : true,
}
);
});
$output .='</div>';
$helperForm->_js .= '<script type="text/javascript">
$(document).ready(function() {
$("#date_start").inputmask("9999-99-99");
$("#date_end").inputmask("9999-99-99");
$("#date_start_deb").inputmask("9999-99-99");
$("#date_end_deb").inputmask("9999-99-99");
});
</script>';
$output .= $helperForm->renderScript();
echo $output;
}