diff --git a/admin-dev/get-file-admin.php b/admin-dev/get-file-admin.php index 61c06b289..1962155ca 100644 --- a/admin-dev/get-file-admin.php +++ b/admin-dev/get-file-admin.php @@ -27,4 +27,4 @@ define('_PS_ADMIN_DIR_', getcwd()); require(dirname(dirname(__FILE__)).'/config/config.inc.php'); -Controller::getController('getFileController')->run(); \ No newline at end of file +Controller::getController('GetFileController')->run(); \ No newline at end of file diff --git a/admin-dev/tabs/AdminProducts.php b/admin-dev/tabs/AdminProducts.php index 1f8825f67..cabaaae96 100644 --- a/admin-dev/tabs/AdminProducts.php +++ b/admin-dev/tabs/AdminProducts.php @@ -1,9 +1,9 @@ table = 'product'; $this->className = 'Product'; $this->lang = true; @@ -129,8 +128,6 @@ class AdminProducts extends AdminTab $nb = count($this->_list); if ($this->_list) { - - /* update product final price */ for ($i = 0; $i < $nb; $i++) $this->_list[$i]['price_tmp'] = Product::getPriceStatic($this->_list[$i]['id_product'], true, null, 6, null, false, true, 1, true); @@ -158,6 +155,14 @@ class AdminProducts extends AdminTab return $productDownload->deleteFile(); } + public function deleteVirtualProductAttribute() + { + if (!($id_product_download = ProductDownload::getIdFromIdAttibute((int) Tools::getValue('id_product_attribute')))) + return false; + $productDownload = new ProductDownload((int)($id_product_download)); + return $productDownload->deleteFile(); + } + /** * postProcess handle every checks before saving products information * @@ -182,6 +187,15 @@ class AdminProducts extends AdminTab $this->deleteVirtualProduct(); else $this->_errors[] = Tools::displayError('You do not have permission to delete here.'); + } + + /* Delete a product in the download folder */ + if (Tools::getValue('deleteVirtualProductAttribute')) + { + if ($this->tabAccess['delete'] === '1') + $this->deleteVirtualProductAttribute(); + else + $this->_errors[] = Tools::displayError('You do not have permission to delete here.'); } /* Update attachments */ @@ -509,6 +523,7 @@ class AdminProducts extends AdminTab $this->_errors[] = Tools::displayError('An error occurred while updating qty.'); } Hook::updateProductAttribute((int)$id_product_attribute); + $this->updateDownloadProduct($product, 1, $id_product_attribute); } else { @@ -541,6 +556,7 @@ class AdminProducts extends AdminTab Tools::getValue('attribute_default'), Tools::getValue('attribute_location'), Tools::getValue('attribute_upc')); + $this->updateDownloadProduct($product, 0, $id_product_attribute); } else $this->_errors[] = Tools::displayError('You do not have permission to').'
id || Tools::getValue('is_virtual_good')=='true') && $productDownload->active) echo 'checked="checked"' ?> /> -
-
- l('Your download repository is not writable.'); ?>
-
-
- checkFile()): ?> -
- l('This product is missing') ?>:
- physically_filename ?>
+
+
+
+ '.$msg.' :
+ '.realpath(_PS_DOWNLOAD_DIR_) .'/'. $productDownload->filename.'
+
+ '.$this->l('Your download repository is not writable.').'
+ '.realpath(_PS_DOWNLOAD_DIR_).'
+