From e9997555ac8cacde730e436379f67ec00dd6c3b1 Mon Sep 17 00:00:00 2001 From: jmCollin Date: Tue, 4 Oct 2011 15:51:28 +0000 Subject: [PATCH] // fix bug with combination --- admin-dev/tabs/AdminProducts.php | 34 +++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/admin-dev/tabs/AdminProducts.php b/admin-dev/tabs/AdminProducts.php index f5640693b..f6bd01920 100644 --- a/admin-dev/tabs/AdminProducts.php +++ b/admin-dev/tabs/AdminProducts.php @@ -2643,15 +2643,26 @@ class AdminProducts extends AdminTab if ($productDownload->id && file_exists($exists_file) || !empty($productDownload->display_filename)) { - echo ''. $this->l('Yes').' - '.$this->l('No').'

'; + $check_yes = 'checked="checked"'; + $check_no = ''; } else { - echo ''. $this->l('Yes').' - '.$this->l('No').'

'; + if ($productDownload->id && !empty($cache_default_attribute)) + { + $check_yes = 'checked="checked"'; + $check_no = ''; + } + else + { + $check_yes = ''; + $check_no = 'checked="checked"'; + } } + echo ''. $this->l('Yes').' + '.$this->l('No').'

'; + if (!file_exists($exists_file) && !empty($productDownload->display_filename) && empty($cache_default_attribute)) { $msg = sprintf(Tools::displayError('This file "%s" is missing'), $productDownload->display_filename); @@ -2752,7 +2763,7 @@ class AdminProducts extends AdminTab { $productDownloadAttribute = new ProductDownload($product['id_product_download']); $exists_file2 = realpath(_PS_DOWNLOAD_DIR_).'/'.$productDownloadAttribute->filename; - if (!file_exists($exists_file2)) + if (!file_exists($exists_file2) && !empty($productDownloadAttribute->id_product_attribute)) { $msg = sprintf(Tools::displayError('This file "%s" is missing'), $productDownloadAttribute->display_filename); $error .= '

@@ -3702,7 +3713,7 @@ class AdminProducts extends AdminTab $id_product_download = (int) $productDownload->getIdFromIdProduct($this->getFieldValue($obj, 'id')); if (!empty($id_product_download)) $productDownload = new ProductDownload($id_product_download); - + $images = Image::getImages($this->context->language->id, $obj->id); if ($obj->id) { @@ -3988,13 +3999,13 @@ class AdminProducts extends AdminTab '.$this->l('UPC').' '.$this->l('Quantity').''; - if ($id_product_download && !empty($productDownload->display_filename)) + if ($id_product_download && !empty($productDownload->filename)) { echo ' - '.$this->l('Filename').' - '.$this->l('Number of downloads').' - '.$this->l('Number of days').' - '.$this->l('Share').''; + '.$this->l('Filename').' + '.$this->l('Number of downloads').' + '.$this->l('Number of days').' + '.$this->l('Share').''; } echo ''.$this->l('Actions').' @@ -4051,7 +4062,6 @@ class AdminProducts extends AdminTab $available_date = ($product_attribute['available_date'] != 0) ? date('Y-m-d', strtotime($product_attribute['available_date'])) : '0000-00-00'; $id_product_download = $productDownload->getIdFromIdAttibute((int) $id_product_attribute); - if ($id_product_download) $productDownload = new ProductDownload($id_product_download);