fix switch and css table of sales

This commit is contained in:
Marion Muszynski 2017-01-02 15:49:14 +01:00
parent 13e343c6ff
commit 966dee6a6e
3 changed files with 112 additions and 342 deletions

View File

@ -10,6 +10,7 @@ require_once('../modules/privatesales_extrafields/privatesales_extrafields.php')
if (isset($_GET['getSales'])){
global $cookie;
$type = $_GET['type'];
if($type == 'finished'){
$sales = Sale::getSales(NULL, NULL, NULL, FALSE , FALSE, FALSE, '`position` DESC', NULL, NULL, FALSE, FALSE);
@ -43,7 +44,7 @@ if (isset($_GET['getSales'])){
<th>FR</th>
<th>ES</th>
<th>Position</th>
<th style='width: 68px;'>Actions</th>
<th>Actions</th>
</tr></thead>
<tbody id='saleActive' class='sortable'>";
@ -55,7 +56,7 @@ if (isset($_GET['getSales'])){
<td><strong>'.$sale->title[intval($cookie->id_lang)].'</strong><br/><span style="color:#666; font-style:italic">'.$extrafields[$sale->id][1].'</span></td>
<td>'.$sale->date_start.'</td>
<td>'.$sale->date_end.'</td>
<td>'.($sale->enabled? '<img src="../img/admin/module_install.png"/>':'<img src="../img/admin/module_notinstall.png"/>').'</td>';
<td>'.($sale->enabled? '<span class="anticon anticon-checkmark text-green-light"></span>':'<span class="anticon anticon-cross text-rose"></span>').'</td>';
if($sale->new == 0){
echo "<td>Non</td>";
@ -68,9 +69,9 @@ if (isset($_GET['getSales'])){
}
echo '<td>'.((int) $sale->id_employee != 0? $employees[(int) $sale->id_employee]: '--').'</td>
<td '.(in_array('fr', $sale->versions) ? 'class="green"' : 'class="red"').'>FR</td>
<td '.(in_array('es', $sale->versions) ? 'class="green"' : 'class="red"').'>ES</td>
<td class="position">';
<td class="text-center '.(in_array('fr', $sale->versions) ? 'green' : 'rose').'">FR</td>
<td class="text-center '.(in_array('es', $sale->versions) ? 'green' : 'rose').'">ES</td>
<td align="center" class="position">';
if($key != 0){
echo '<a href="" class="updatePosition" data-way="0" data-position='. $sale->position .'><img title="Haut" alt="Haut" src="../img/admin/up.gif"></a>';
}
@ -79,18 +80,50 @@ if (isset($_GET['getSales'])){
}
$category_link = Link::getCategoryLink($sale->id_category);
$category_link_bo = '?tab=AdminCatalog&viewcategory&id_category='.$sale->id_category.'&token='.Tools::getAdminToken('AdminCatalog'.(int)(Tab::getIdFromClassName('AdminCatalog')).(int)($cookie->id_employee));
echo '</td>
<td>
'.($export? '<a onclick="window.open(this.href); return false;" href="'.__PS_BASE_URI__.'modules/exports/exports/privatesales.php?id_sale='.$sale->id.'&amp;adtoken='.Tools::encrypt('PrivateSalesDirectExtract'.$sale->id).'"><img style="cursor: pointer;" title="Exporter cette vente" alt="" src="../img/admin/export.gif"></a>': '').'
<img style="cursor: pointer;" onclick="itemEdition('.$sale->id.')" title="Éditer cette vente" alt="" src="../img/admin/edit.gif">
<img style="cursor: pointer;" onclick="itemDeletion('.$sale->id.')" title="Supprimer cette vente" alt="" src="../img/admin/delete.gif">
<a href="'.$category_link.'" target="_blank">
<img style="cursor: pointer;" title="Voir cette vente" alt="" src="../img/admin/details.gif">
<div class="input-group-btn" role="group">
<button class="btn btn-default" onclick="itemEdition('.$sale->id.')" title="Editer la vente">
<span class="anticon anticon-pencil2"></span>
</button>
<a href="'.$category_link.'" target="_blank" class="btn btn-default" title="Voir la vente sur le site">
<span class="anticon anticon-eye"></span>
</a>
<button type="button" style="padding: 2.5px 5px;" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Actions
<span class="caret"></span>
</button>
<ul class="dropdown-menu dropdown-menu-right">
'.($export? '
<li>
<a onclick="window.open(this.href); return false;" href="'.__PS_BASE_URI__.'modules/exports/exports/privatesales.php?id_sale='.$sale->id.'&amp;adtoken='.Tools::encrypt('PrivateSalesDirectExtract'.$sale->id).'">
<i class="glyphicon glyphicon-new-window"></i> Exporter
</a>
</li>':'').'
<li>
<a onclick="window.open(this.href); return false;" href="'.$category_link_bo.'">
<i class="glyphicon glyphicon-eye-open"></i> Voir Catégorie BO
</a>
</li>
<li role="separator" class="divider"></li>
<li>
<a style="cursor: pointer;" onclick="itemDeletion('.$sale->id.')">
<span class="anticon anticon-bin"></span> Supprimer
</a>
</li>
</ul>
</div>
</td>
</tr>
';
// '.($export? '<a onclick="window.open(this.href); return false;" href="'.__PS_BASE_URI__.'modules/exports/exports/privatesales.php?id_sale='.$sale->id.'&amp;adtoken='.Tools::encrypt('PrivateSalesDirectExtract'.$sale->id).'"><img style="cursor: pointer;" title="Exporter cette vente" alt="" src="../img/admin/export.gif"></a>': '').'
// <img style="cursor: pointer;" onclick="itemEdition('.$sale->id.')" title="Éditer cette vente" alt="" src="../img/admin/edit.gif">
// <img style="cursor: pointer;" onclick="itemDeletion('.$sale->id.')" title="Supprimer cette vente" alt="" src="../img/admin/delete.gif">
// <a href="'.$category_link.'" target="_blank">
// <img style="cursor: pointer;" title="Voir cette vente" alt="" src="../img/admin/details.gif">
// </a>
}
echo "</tbody>";
die();

View File

@ -484,7 +484,7 @@ class HelperFormBootstrap{
<div class="'.(isset($p['input-class']) ? $p['input-class'] : '').'">
<div class="checkbox input-switch">
<label>
<input type="checkbox" name="'.$p['name'].'" class="js-switch" '.(isset($p['checked']) && $p['checked']?'checked="checked"':'').' /> '.(isset($p['title'])?$p['title']:'').'
<input type="checkbox" name="'.$p['name'].'" class="js-switch" value="1" '.(isset($p['checked']) && $p['checked']?'checked="checked"':'').' /> '.(isset($p['title'])?$p['title']:'').'
</label>
</div>
</div>

View File

@ -136,71 +136,28 @@ class AdminPrivateSalesSales extends AdminTab {
}
.green {
background : #dffad3;
color: #88AF4D!important;
font-weight:bold;
}
.red {
background : #f29b9b;
}
fieldset.bg-grey{
.rose {
background : #e36ea2;
color: rgba(255, 255, 255,0.7)!important;
}
.table tr:nth-child(even) {
background: #F1F1F1;
border: 1px solid #565485;
}
fieldset.bg-grey legend{
background: rgba(86,84,133,0.9);
border: 1px solid #565485;
color: #fff;
font-weight: 300;
.table>tbody>tr>td{
color:#504d8b;
vertical-align:middle;
font-size:0.9em;
padding: 0 6px 0 4px;
}
table {
background: #fff;
padding: 20px;
-moz-box-shadow: 2px 2px 5px #cccccc;
-webkit-box-shadow: 2px 2px 5px #CCC;
-ms-box-shadow: 2px 2px 5px #cccccc;
-o-box-shadow: 2px 2px 5px #cccccc;
box-shadow: 2px 2px 5px #CCC;
border-collapse: collapse;
border-spacing: 0;
}
.table {
border: 1px solid #565485;
}
.table tr th{
background: rgba(86,84,133,0.9);
color: #fff;
font-weight: 300;
}
.table tr td {
border-bottom: 1px solid #DEDEDE;
color: #000;
padding: 0 4px 0 6px;
}
.table tr td:nth-child(6),
.table tr td:nth-child(7),
.table tr td:nth-child(11),
.table tr td:nth-child(12){
text-align:center;
}
.table tr:nth-child(odd){
background : #F3F3F3;
}
.button.purple {
background-color: rgba(86,84,133,0.7);
border: 1px solid #565485;
border-left: 1px solid rgba(86,84,133,0.6);
border-top: 1px solid rgba(86,84,133,0.6);
color: rgba(255,255,255,0.9);
padding: 3px;
}
.button.purple:hover {
background-color: #565485;
border: 1px solid rgba(86,84,133,0.6);
border-left: 1px solid #565485;
border-top: 1px solid #565485;
color: #fff;
padding: 3px;
}
.button.purple:focus{
background-color: rgba(86,84,133,1.6);
.table .input-group-btn .btn{
padding: 4px 5px;
color: #504d8b;
}
</style>';
echo $helperForm->renderStyle();
@ -459,74 +416,9 @@ class AdminPrivateSalesSales extends AdminTab {
'required' => true,
);
echo $helperForm->generateInput($input);
echo '<div class="clearfix"></div>';
// echo '<label>'.$this->l('Status:').'</label>
// <div class="margin-form">
// <div id="enabled" style="float: left;">
// <input name="enabled" type="radio" value="0"'.($this->cursale!==NULL?($this->cursale->enabled==0?' checked="checked"': ''):'').' /> '.$this->l('Disabled').'&nbsp;&nbsp;&nbsp;<input name="enabled" type="radio" value="1"'.($this->cursale!==NULL?($this->cursale->enabled==1?' checked="checked"': ''):'checked="checked"').' /> '.$this->l('Enabled').'
// <sup> *</sup>
// </div>
// <div class="clear"></div>
// </div>';
// echo '<label>'.$this->l('Display:').'</label>
// <div class="margin-form">
// <div id="logout" style="float: left;">
// <input name="logout" type="radio" value="0"'.($this->cursale!==NULL? ($this->cursale->logout==0? ' checked="checked"': ''):' ').' /> '.$this->l('Only for logged in users').'&nbsp;&nbsp;&nbsp;<input name="logout" type="radio" value="1"'.($this->cursale!==NULL? ($this->cursale->logout==1? ' checked="checked"': ''):' checked="checked"').' /> '.$this->l('Show to guests too').'
// <sup> *</sup>
// </div>
// <div class="clear"></div>
// </div>';
// echo '<label>'.$this->l('Public sale:').'</label>
// <div class="margin-form">
// <div id="public" style="float: left;">
// <input name="pub" type="radio" value="0"'.($this->cursale!==NULL? ($this->cursale->pub==0? ' checked="checked"': ''): ' checked="checked"').' /> '.$this->l('No').'&nbsp;&nbsp;&nbsp;<input name="pub" type="radio" value="1"'.($this->cursale!==NULL && $this->cursale->pub==1? ' checked="checked"': '').' /> '.$this->l('Yes').'
// <sup> *</sup>
// </div>
// <div class="clear"></div>
// </div>';
// echo '<label>'.$this->l('Braderie :').'</label>
// <div class="margin-form">
// <div id="public" style="float: left;">
// <input name="braderie" type="radio" value="0"'.($this->cursale!==NULL? ($this->cursale->braderie==0? ' checked="checked"': ''): ' checked="checked"').' /> '.$this->l('No').'&nbsp;&nbsp;&nbsp;<input name="braderie" type="radio" value="1"'.($this->cursale!==NULL && $this->cursale->braderie ==1? ' checked="checked"': '').' /> '.$this->l('Yes').'
// <sup> *</sup>
// </div>
// <div class="clear"></div>
// </div>';
// echo '<label>'.$this->l('Featured sale:').'</label>
// <div class="margin-form">
// <div id="featured" style="float: left;">
// <input name="featured" type="radio" value="0"'.($this->cursale!==NULL? ($this->cursale->featured==0? ' checked="checked"': ''):' checked="checked"').' /> '.$this->l('No').'&nbsp;&nbsp;&nbsp;<input name="featured" type="radio" value="1"'.($this->cursale!==NULL && $this->cursale->featured==1?' checked="checked"': '').' /> '.$this->l('Yes').'
// <sup> *</sup>
// </div>
// <div class="clear"></div>
// </div>';
// echo '<label>'.$this->l('Nouveau :').'</label>
// <div class="margin-form">
// <div id="new" style="float: left;">
// <input name="new" type="radio" value="0"'.($this->cursale!==NULL? ($this->cursale->new==0? ' checked="checked"': ''):' checked="checked"').' /> '.$this->l('Non').'&nbsp;&nbsp;&nbsp;<input name="new" type="radio" value="1"'.($this->cursale!==NULL && $this->cursale->new==1?' checked="checked"': '').' /> '.$this->l('Oui').'
// <sup> *</sup>
// </div>
// <div class="clear"></div>
// </div>';
// echo '<label>'.$this->l('Mise en avant newsletter :').'</label>
// <div class="margin-form">
// <div id="forward_news" style="float: left;">
// <input name="forward_news" type="radio" value="0"'.($this->cursale!==NULL? ($this->cursale->forward_news==0? ' checked="checked"': ''):' checked="checked"').' /> '.$this->l('Non').'&nbsp;&nbsp;&nbsp;<input name="forward_news" type="radio" value="1"'.($this->cursale!==NULL && $this->cursale->forward_news==1?' checked="checked"': '').' /> '.$this->l('Oui').'
// <sup> *</sup>
// </div>
// <div class="clear"></div>
// </div>';
echo '</div><div class="clearfix"></div>
echo '<div class="clearfix"></div>
</div>
<div class="clearfix"></div>
<div class="col-sm-5">';
$id_employee_options = array();
@ -552,18 +444,6 @@ class AdminPrivateSalesSales extends AdminTab {
echo $helperForm->generateInput($input);
echo '<div class="clearfix"></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>';
$id_delay_options = array(
array(
'label' => $this->l('Livraison classique'),
@ -619,24 +499,6 @@ class AdminPrivateSalesSales extends AdminTab {
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? ', (
@ -674,31 +536,6 @@ class AdminPrivateSalesSales extends AdminTab {
echo $helperForm->generateInput($input);
echo '<div class="clearfix"></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: "&nbsp;",
// oneOrMoreSelected: "*"
// });
// });
// </script>
// <div class="clear"></div>
// </div>';
$id_version_options = array(
array(
'label'=> 'fr',
@ -736,31 +573,6 @@ class AdminPrivateSalesSales extends AdminTab {
);
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: "&nbsp;",
// oneOrMoreSelected: "*"
// });
// });
// </script>
// <div class="clear"></div>
// </div>';
$id_country_options = array();
$id_country_options[0] = array(
@ -789,20 +601,6 @@ class AdminPrivateSalesSales extends AdminTab {
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('
SELECT c.`id_carrier`, IF(c.`name` = "0", "'.Configuration::get('PS_SHOP_NAME').'", c.`name`) AS `name`'.($this->cursale !== NULL? ', (
@ -853,56 +651,6 @@ class AdminPrivateSalesSales extends AdminTab {
echo $helperForm->generateInput($input);
echo '<div class="clearfix"></div>';
// echo '<label>'.$this->l('Carriers:').'</label>
// <div class="margin-form">
// <div id="carriers" style="float: left;">
// <select id="m_carriers" name="m_groups[]" multiple="multiple" size="5">
// <option value=""></option>
// <optgroup label="'.$this->l('Select one or more carriers:').'">';
// if( Tools::getIsset('edit')) {
// foreach($carriers as $carrier) {
// echo '<option value="'.$carrier['id_carrier'].'"'.(isset($carrier['id_sale']) && $carrier['id_sale'] !== NULL?' selected="selected"':'').'>'.$carrier['name'].'</option>';
// }
// } else{
// foreach($carriers as $carrier) {
// echo '<option value="'.$carrier['id_carrier'].'"'.(in_array($carrier['id_carrier'], $carriers_default) ? ' selected="selected"':'').'>'.$carrier['name'].'</option>';
// }
// }
// echo '
// </optgroup>
// </select>
// </div>
// <script type="text/javascript">
// $(document).ready(function() {
// $("#m_carriers").multiSelect({
// selectAllText: "'.$this->l('Select all').'",
// noneSelected: "&nbsp;",
// oneOrMoreSelected: "*"
// });
// });
// </script>
// <div class="clear"></div>
// </div>';
// echo '<label>'.$this->l('Livraison seulement en France :').'</label>
// <div class="margin-form">
// <div id="shipping_fr" style="float: left;">
// <input name="shipping_fr" type="radio" value="0"'.($this->cursale!==NULL? ($this->cursale->shipping_fr==0? ' checked="checked"': ''):' checked="checked"').' /> '.$this->l('Non').'&nbsp;&nbsp;&nbsp;<input name="shipping_fr" type="radio" value="1"'.($this->cursale!==NULL && $this->cursale->shipping_fr==1?' checked="checked"': '').' /> '.$this->l('Oui').'
// <sup> *</sup>
// </div>
// <div class="clear"></div>
// </div>';
// }
// echo '<label>'.$this->l('Sale type:').'</label>
// <div class="margin-form">
// <div id="carriers" style="float: left;">
// '.$this->l('SALETYPE1').' <input '. (isset($this->cursale->sale_type) && in_array(1,$this->cursale->sale_type) ? ' checked': '') .' type="checkbox" name="sale_type[]" value="1">
// '.$this->l('SALETYPE2').' <input '. (isset($this->cursale->sale_type) && in_array(2,$this->cursale->sale_type) ? ' checked': '') .' type="checkbox" name="sale_type[]" value="2">
// '.$this->l('SALETYPE3').' <input '. (isset($this->cursale->sale_type) && in_array(3,$this->cursale->sale_type) ? ' checked': '') .' type="checkbox" name="sale_type[]" value="3">
// </div>
// </div>';
// Description
$input = array(
'type' => 'textarea',
@ -919,23 +667,6 @@ class AdminPrivateSalesSales extends AdminTab {
echo $helperForm->generateInput($input);
echo '<div class="clearfix"></div>';
// echo '<label>'.$this->l('Description:').'</label>
// <div class="margin-form">';
// foreach($this->_languages as $language) {
// echo '<div id="description_'.$language['id_lang'].'" style="display: '.($language['id_lang'] == $this->_defaultFormLanguage ? 'block' : 'none').'; float: left;">
// <textarea style="width: 500px; height: 150px;" name="description_'.$language['id_lang'].'">';
// if($this->cursale !== NULL) {
// echo htmlentities($this->cursale->description[$language['id_lang']]);
// // echo htmlentities(utf8_decode($this->cursale->description[$language['id_lang']]));
// }
// echo '</textarea>
// </div>';
// }
// $this->displayFlags($this->_languages, $this->_defaultFormLanguage, $divLangName, 'description');
// echo '<div class="clear"></div>
// </div>';
// Video
$input = array(
'type' => 'text',
@ -952,17 +683,6 @@ class AdminPrivateSalesSales extends AdminTab {
echo $helperForm->generateInput($input);
echo '<div class="clearfix"></div>';
// echo '<label>'.$this->l('Video:').'</label>
// <div class="margin-form">';
// foreach($this->_languages as $language) {
// echo '<div id="video_'.$language['id_lang'].'" style="display: '.($language['id_lang'] == $this->_defaultFormLanguage ? 'block' : 'none').'; float: left;">
// <input type="text" name="video_'.$language['id_lang'].'"'.($this->cursale !== NULL? ' value="'.htmlentities($this->cursale->video[$language['id_lang']]).'"': '').' />';
// echo '</div>';
// }
// $this->displayFlags($this->_languages, $this->_defaultFormLanguage, $divLangName, 'video');
// echo '<div class="clear"></div>
// <p>'.$this->l('Youtube full URL').'</p>
// </div>';
Module::hookExec('privatesales_edit', array('sale' => $this->cursale));
echo '</div>
@ -986,21 +706,6 @@ class AdminPrivateSalesSales extends AdminTab {
);
echo $helperForm->generateInput($input);
echo '<div class="clearfix"></div>';
// echo '<label>'.$v[0].'</label>
// <div class="">';
// foreach($this->_languages as $language) {
// echo '<div id="img_'.$k.'_'.$language['id_lang'].'" style="display: '.($language['id_lang'] == $this->_defaultFormLanguage ? 'block' : 'none').'; float: left;">
// <input type="file" name="img_'.$k.'_'.$language['id_lang'].'" />
// <p class="help-block">'.$this->l('Size:').' '.$v[1].'</p>';
// if($this->cursale !== NULL && file_exists(_PS_ROOT_DIR_.'/modules/privatesales/img/'.$this->cursale->id.'/'.$k.'_'.$language['id_lang'].'.jpg')) {
// echo '<p><a href="'.__PS_BASE_URI__.'modules/privatesales/img/'.$this->cursale->id.'/'.$k.'_'.$language['id_lang'].'.jpg" onclick="window.open(this.href); return false;"> '.$this->l('Preview').'</a></p>';
// }
// echo '
// </div>';
// }
// $helperForm->displayFlags($this->_languages, $this->_defaultFormLanguage, $divLangName, 'img_'.$k);
// echo '<div class="clear"></div>
// </div>';
}
echo '</div>
<div class="clear"></div>
@ -1184,7 +889,7 @@ class AdminPrivateSalesSales extends AdminTab {
<div class="clearfix"></div>
</div>
<div class="panel-content">
<table class="table list_vente" style="width: 100%;">
<table class="table list_vente table-custombordered" style="width: 100%;">
<thead>
<tr>
<th>'.$this->l('ID').'</th>
@ -1200,7 +905,7 @@ class AdminPrivateSalesSales extends AdminTab {
<th>'.$this->l('Shipping').'</th>
<th>'.$this->l('News').'</th>
<th>'.$this->l('Position').'</th>
<th style="width: '.($export? '68': '55').'px;">'.$this->l('Actions').'</th>
<th>'.$this->l('Actions').'</th>
</tr>
</thead>';
echo ' <tbody id="saleActive" class="sortable">';
@ -1219,7 +924,7 @@ class AdminPrivateSalesSales extends AdminTab {
<td><strong>'.$sale->title[intval($cookie->id_lang)].'</strong><br/><span style="color:#666; font-style:italic">'.$extrafields[$sale->id][1].'</span></td>
<td>'.$sale->date_start.'</td>
<td>'.$sale->date_end.'</td>
<td>'.($sale->enabled?'<img src="../img/admin/module_install.png"/>':'<img src="../img/admin/module_notinstall.png"/>').'</td>
<td>'.($sale->enabled?'<span class="anticon anticon-checkmark text-green-light"></span>':'<span class="anticon anticon-cross text-rose"></span>').'</td>
';
if($sale->new == 0){
@ -1233,14 +938,14 @@ class AdminPrivateSalesSales extends AdminTab {
}
echo '<td>'.((int) $sale->id_employee != 0? $employees[(int) $sale->id_employee]: '--').'</td>
<td '.(in_array('fr', $sale->versions) ? 'class="green"' : 'class="red"').'>FR</td>
<td '.(in_array('es', $sale->versions) ? 'class="green"' : 'class="red"').'>ES</td>
<td class="text-center '.(in_array('fr', $sale->versions) ? 'green' : 'rose').'">FR</td>
<td class="text-center '.(in_array('es', $sale->versions) ? 'green' : 'rose').'">ES</td>
<td>'.(isset($sale_shipping[(int) $sale->id])? ($sale_shipping[(int) $sale->id] == 1? 'Philea': ''): '').'</td>
<td>'. $sale->forward_news .'</td>
<td class="position">';
<td align="center" class="position">';
if($key != 0){
echo '<a href="" class="updatePosition" data-way="0" data-position='. $sale->position .'><img title="Haut" alt="Haut" src="../img/admin/up.gif"></a>';
}
@ -1248,17 +953,51 @@ class AdminPrivateSalesSales extends AdminTab {
echo ' <a href="" class="updatePosition" data-way="1" data-position='. $sale->position .'><img title="Bas" alt="Bas" src="../img/admin/down.gif"></a>';
}
$category_link = Link::getCategoryLink($sale->id_category);
$category_link_bo = '?tab=AdminCatalog&viewcategory&id_category='.$sale->id_category.'&token='.Tools::getAdminToken('AdminCatalog'.(int)(Tab::getIdFromClassName('AdminCatalog')).(int)($cookie->id_employee));
echo '</td>
<td>
'.($export? '<a onclick="window.open(this.href); return false;" href="'.__PS_BASE_URI__.'modules/exports/exports/privatesales.php?id_sale='.$sale->id.'&amp;adtoken='.Tools::encrypt('PrivateSalesDirectExtract'.$sale->id).'"><img style="cursor: pointer;" title="Exporter cette vente" alt="" src="../img/admin/export.gif"></a>': '').'
<img style="cursor: pointer;" onclick="itemEdition('.$sale->id.')" title="Éditer cette vente" alt="" src="../img/admin/edit.gif">
<img style="cursor: pointer;" onclick="itemDeletion('.$sale->id.')" title="Supprimer cette vente" alt="" src="../img/admin/delete.gif">
<a href="'.$category_link.'" target="_blank">
<img style="cursor: pointer;" title="Voir cette vente" alt="" src="../img/admin/details.gif">
<div class="input-group-btn" role="group">
<button class="btn btn-default" onclick="itemEdition('.$sale->id.')" title="Editer la vente">
<span class="anticon anticon-pencil2"></span>
</button>
<a href="'.$category_link.'" target="_blank" class="btn btn-default" title="Voir la vente sur le site">
<span class="anticon anticon-eye"></span>
</a>
<button type="button" style="padding: 2.5px 5px;" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Actions
<span class="caret"></span>
</button>
<ul class="dropdown-menu dropdown-menu-right">
'.($export? '
<li>
<a onclick="window.open(this.href); return false;" href="'.__PS_BASE_URI__.'modules/exports/exports/privatesales.php?id_sale='.$sale->id.'&amp;adtoken='.Tools::encrypt('PrivateSalesDirectExtract'.$sale->id).'">
<i class="glyphicon glyphicon-new-window"></i> Exporter
</a>
</li>':'').'
<li>
<a onclick="window.open(this.href); return false;" href="'.$category_link_bo.'">
<i class="glyphicon glyphicon-eye-open"></i> Voir Catégorie BO
</a>
</li>
<li role="separator" class="divider"></li>
<li>
<a style="cursor: pointer;" onclick="itemDeletion('.$sale->id.')">
<span class="anticon anticon-bin"></span> Supprimer
</a>
</li>
</ul>
</div>
</td>
</tr>
';
// '.($export? '<a onclick="window.open(this.href); return false;" href="'.__PS_BASE_URI__.'modules/exports/exports/privatesales.php?id_sale='.$sale->id.'&amp;adtoken='.Tools::encrypt('PrivateSalesDirectExtract'.$sale->id).'"><img style="cursor: pointer;" title="Exporter cette vente" alt="" src="../img/admin/export.gif"></a>': '').'
// <img style="cursor: pointer;" onclick="itemEdition('.$sale->id.')" title="Éditer cette vente" alt="" src="../img/admin/edit.gif">
// <img style="cursor: pointer;" onclick="itemDeletion('.$sale->id.')" title="Supprimer cette vente" alt="" src="../img/admin/delete.gif">
// <a href="'.$category_link.'" target="_blank">
// <img style="cursor: pointer;" title="Voir cette vente" alt="" src="../img/admin/details.gif">
// </a>
}
echo '
</tbody>
@ -1289,8 +1028,6 @@ class AdminPrivateSalesSales extends AdminTab {
public function postProcess() {
global $cookie, $currentIndex;
//echo '<pre>';var_dump($_POST);echo '</pre>';die();
if(Tools::isSubmit('submitSaleAdd')) {
if (Sale::getSaleFromCategory(Tools::getValue('id_category'))) {
return false;