Merge branch 'develop' of gitlab.antadis.net:dev-antadis/bebeboutik into develop
This commit is contained in:
commit
cb08580668
@ -67,7 +67,7 @@ class AdminCategories extends AdminTab
|
||||
protected function recurseCategoryTreeFlat($id_category, $category_selected, $level_start = 0)
|
||||
{
|
||||
global $currentIndex;
|
||||
|
||||
|
||||
$id_lang = _USER_ID_LANG_;
|
||||
$categoriesOption = "";
|
||||
$active = false;
|
||||
@ -96,14 +96,14 @@ class AdminCategories extends AdminTab
|
||||
$categoriesOption.= $children;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $categoriesOption;
|
||||
}
|
||||
|
||||
|
||||
protected function displayListTree()
|
||||
{
|
||||
global $currentIndex;
|
||||
|
||||
|
||||
if ($this->_category->id_category == 1) {
|
||||
echo "";
|
||||
}
|
||||
@ -117,7 +117,7 @@ class AdminCategories extends AdminTab
|
||||
if (count($categoryParents) > 0) {
|
||||
$categoryRoot = $categoryParents[count($categoryParents)-1];
|
||||
}
|
||||
|
||||
|
||||
if ($categoryRoot) {
|
||||
echo '<select id="selectCategory" style="margin:0 5px;padding:4px;font-size:14px;"
|
||||
onchange="document.location=$(this).find(\'option:selected\').data(\'url\');">';
|
||||
@ -132,7 +132,7 @@ class AdminCategories extends AdminTab
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function displayListContent($token = NULL)
|
||||
{
|
||||
global $currentIndex, $cookie;
|
||||
@ -456,7 +456,7 @@ class AdminCategories extends AdminTab
|
||||
echo '<br/><a onclick="return confirm(\''.$this->l('Regenerate entire categories tree ?').'\');" class="button btn" href="'.__PS_BASE_URI__.substr($_SERVER['PHP_SELF'], strlen(__PS_BASE_URI__)).'?tab=AdminCatalog®enerateTree&token='.($token!=NULL ? $token : $this->token).'"">' . $this->l('Regenerate NTree') . '</a>';
|
||||
$this->displayListTree();
|
||||
echo '<br/>';
|
||||
|
||||
|
||||
$this->displayList($token);
|
||||
echo '</div>';
|
||||
}
|
||||
@ -486,8 +486,7 @@ class AdminCategories extends AdminTab
|
||||
}
|
||||
}
|
||||
|
||||
// @Override Antadis
|
||||
/* Delete Image Thumb */
|
||||
// @Override Antadis - Delete Image Thumb && Mobile
|
||||
elseif (isset($_GET['deleteImageThumb']) && isset($_GET['id_lang']))
|
||||
{
|
||||
if (Validate::isLoadedObject($object = $this->loadObject())) {
|
||||
@ -495,6 +494,14 @@ class AdminCategories extends AdminTab
|
||||
Tools::redirectAdmin($currentIndex.'&updatecategory&token='.Tools::getValue('token').'&id_category='.(int)($object->id));
|
||||
}
|
||||
|
||||
}
|
||||
elseif (isset($_GET['deleteImageMobile']) && isset($_GET['id_lang']))
|
||||
{
|
||||
if (Validate::isLoadedObject($object = $this->loadObject())) {
|
||||
$this->deleteImageMobile($object,$_GET['id_lang']);
|
||||
Tools::redirectAdmin($currentIndex.'&updatecategory&token='.Tools::getValue('token').'&id_category='.(int)($object->id));
|
||||
}
|
||||
|
||||
}
|
||||
// @EndOverride Antadis
|
||||
|
||||
@ -515,6 +522,7 @@ class AdminCategories extends AdminTab
|
||||
// @Override Antadis
|
||||
foreach (Language::getLanguages(FALSE) as $language) {
|
||||
$this->deleteImageThumb($object, $language['id_lang']);
|
||||
$this->deleteImageMobile($object, $language['id_lang']);
|
||||
}
|
||||
// @End Antadis
|
||||
$object->deleteImage();
|
||||
|
@ -1244,6 +1244,31 @@ class AdminOrders extends AdminTab
|
||||
echo '<p><b>Numéro de suivi </b> : '. $number['shipping_number'] .' ajouté le '. $date->format('d m Y') .'</p>';
|
||||
}
|
||||
}
|
||||
|
||||
// assign delay to Products
|
||||
if (Module::isInstalled('privatesales_delay')) {
|
||||
if (!class_exists('SaleDelay')) {
|
||||
require_once _PS_ROOT_DIR_.'/modules/privatesales_delay/saledelay.php';
|
||||
}
|
||||
$delay_products = SaleDelay::associateDelay($products);
|
||||
$delays = array_keys($delay_products);
|
||||
$date = new DateTime($order->date_add);
|
||||
$delivery_date = SaleDelay::getDeliveryDate($delays, null, $date, true);
|
||||
|
||||
foreach($delivery_date as $k => $date) {
|
||||
if($k == 1) {
|
||||
echo '<p class="delivery-date">
|
||||
'.$this->l('Date d\'expédition : entre le').' <strong>'.$date['date_start']->format('d/m/Y').'</strong> '.$this->l('et le').' <strong>'.$date['date_end']->format('d/m/Y').'</strong>
|
||||
</p>';
|
||||
} elseif ($k == 5){
|
||||
echo '<p class="delivery-date">'.$this->l('Date d\'expédition :').' <strong>'.$this->l('avant le 24/12').'</strong></p>';
|
||||
} elseif ($k == 8){
|
||||
echo '<p class="delivery-date">'.$this->l('Date d\'expédition :').' <strong>'.$this->l('envoi en 48h').'</strong></p>';
|
||||
} elseif ($k == 9){
|
||||
echo '<p class="delivery-date">'.$this->l('Date d\'expédition :').' '.$this->l('Delai indiqué sur la fiche produit').'</p>';
|
||||
}
|
||||
}
|
||||
}
|
||||
echo '<legend><img src="../img/admin/delivery.gif" /> '.$this->l('Shipping information').'</legend>
|
||||
'.$this->l('Total weight:').' <b>'.number_format($order->getTotalWeight(), 3).' '.Configuration::get('PS_WEIGHT_UNIT').'</b><br />
|
||||
'.$this->l('Carrier:').' <b>'.($carrier->name == '0' ? Configuration::get('PS_SHOP_NAME') : $carrier->name).'</b><br />
|
||||
|
@ -42,7 +42,12 @@ class AdminAntCreationcategories extends AdminTab
|
||||
|
||||
if($category->add()) {
|
||||
if (isset($_FILES['image_thumb']) && $_FILES['image_thumb']['name'] != NULL) {
|
||||
copy($_FILES['image_thumb']['tmp_name'], _PS_CAT_IMG_DIR_.$category->id.'_thumb_vp.jpg');
|
||||
copy($_FILES['image_thumb']['tmp_name'], _PS_CAT_IMG_DIR_.$category->id.'_thumb_vp_2.jpg');
|
||||
copy($_FILES['image_thumb']['tmp_name'], _PS_CAT_IMG_DIR_.$category->id.'_thumb_vp_3.jpg');
|
||||
}
|
||||
if (isset($_FILES['image_mobile']) && $_FILES['image_mobile']['name'] != NULL) {
|
||||
copy($_FILES['image_mobile']['tmp_name'], _PS_CAT_IMG_DIR_.$category->id.'_mobile_vp_2.jpg');
|
||||
copy($_FILES['image_mobile']['tmp_name'], _PS_CAT_IMG_DIR_.$category->id.'_mobile_vp_3.jpg');
|
||||
}
|
||||
if (isset($_FILES['image_category']) && $_FILES['image_category']['name'] != NULL) {
|
||||
copy($_FILES['image_category']['tmp_name'], _PS_CAT_IMG_DIR_.$category->id.'.jpg');
|
||||
@ -219,6 +224,14 @@ class AdminAntCreationcategories extends AdminTab
|
||||
'name' => 'image_category',
|
||||
'id' => 'preview_category',
|
||||
),
|
||||
array(
|
||||
'type' => 'uploadImage',
|
||||
'label' => $this->l('Image Application : '),
|
||||
'label-class' => 'col-md-2',
|
||||
'input-class' => 'col-md-6',
|
||||
'name' => 'image_mobile',
|
||||
'id' => 'preview_mobile',
|
||||
),
|
||||
array(
|
||||
'type' => 'tag',
|
||||
'label' => $this->l('Sous Catégorie : '),
|
||||
|
@ -32,7 +32,7 @@ class Category extends CategoryCore {
|
||||
Module::hookExec('categoryUpdate', array('category' => $this));
|
||||
return $ret;
|
||||
}
|
||||
|
||||
|
||||
public function updatePosition($way, $position)
|
||||
{
|
||||
if (!$res = Db::getInstance()->ExecuteS('
|
||||
@ -43,17 +43,17 @@ class Category extends CategoryCore {
|
||||
)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
foreach ($res AS $category) {
|
||||
if ((int)($category['id_category']) == (int)($this->id)) {
|
||||
$movedCategory = $category;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!isset($movedCategory) || !isset($position)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// < and > statements rather than BETWEEN operator
|
||||
// since BETWEEN is treated differently according to databases
|
||||
$result = (Db::getInstance()->Execute('
|
||||
@ -69,9 +69,9 @@ class Category extends CategoryCore {
|
||||
SET `position` = '.(int)($position).'
|
||||
WHERE `id_parent` = '.(int)($movedCategory['id_parent']).'
|
||||
AND `id_category`='.(int)($movedCategory['id_category'])));
|
||||
|
||||
|
||||
Module::hookExec('categoryUpdate', array('category' => $this, 'position' => true));
|
||||
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
@ -522,4 +522,54 @@ class Category extends CategoryCore {
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function deleteImage()
|
||||
{
|
||||
if (!$this->id)
|
||||
return false;
|
||||
|
||||
/* Deleting object images and thumbnails (cache) */
|
||||
if ($this->image_dir)
|
||||
{
|
||||
if (file_exists($this->image_dir.$this->id.'.'.$this->image_format)
|
||||
&& !unlink($this->image_dir.$this->id.'.'.$this->image_format))
|
||||
return false;
|
||||
}
|
||||
if (file_exists(_PS_TMP_IMG_DIR_.$this->table.'_'.$this->id.'.'.$this->image_format)
|
||||
&& !unlink(_PS_TMP_IMG_DIR_.$this->table.'_'.$this->id.'.'.$this->image_format))
|
||||
return false;
|
||||
if (file_exists(_PS_TMP_IMG_DIR_.$this->table.'_mini_'.$this->id.'.'.$this->image_format)
|
||||
&& !unlink(_PS_TMP_IMG_DIR_.$this->table.'_mini_'.$this->id.'.'.$this->image_format))
|
||||
return false;
|
||||
|
||||
$types = ImageType::getImagesTypes();
|
||||
foreach ($types AS $image_type)
|
||||
if (file_exists($this->image_dir.$this->id.'-'.stripslashes($image_type['name']).'.'.$this->image_format)
|
||||
&& !unlink($this->image_dir.$this->id.'-'.stripslashes($image_type['name']).'.'.$this->image_format))
|
||||
return false;
|
||||
|
||||
// @Override Antadis
|
||||
foreach (Language::getLanguages(FALSE) as $language) {
|
||||
$this->deleteImageThumb($language['id_lang']);
|
||||
$this->deleteImageMobile($language['id_lang']);
|
||||
}
|
||||
// @End Override
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// @Adding Antadis
|
||||
public function deleteImageThumb($id_lang)
|
||||
{
|
||||
if(file_exists(_PS_ROOT_DIR_.'/img/c/'.$this->id.'_thumb_vp_'.(int)$id_lang.'.jpg')) {
|
||||
unlink(_PS_ROOT_DIR_.'/img/c/'.$this->id.'_thumb_vp_'.(int)$id_lang.'.jpg');
|
||||
}
|
||||
}
|
||||
// @Adding Antadis
|
||||
public function deleteImageMobile($id_lang)
|
||||
{
|
||||
if(file_exists(_PS_ROOT_DIR_.'/img/c/'.$this->id.'_mobile_vp_'.(int)$id_lang.'.jpg')) {
|
||||
unlink(_PS_ROOT_DIR_.'/img/c/'.$this->id.'_mobile_vp_'.(int)$id_lang.'.jpg');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user