// fix bug upload image

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@11777 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
lLefevre
2011-12-27 08:53:27 +00:00
parent 4515866661
commit 35ac5cd809
4 changed files with 12 additions and 17 deletions
@@ -79,10 +79,10 @@
<label>{l s='Carriers:'}</label>
</td>
<td class="padding-bottom:5px;">
<select name="carriers[]" multiple="multiple" size="4">
{foreach $carrier_list as $carrier}
<option value="{$carrier.id_reference}" {if isset($carrier.selected) && $carrier.selected}selected="selected"{/if}>{$carrier.name}</option>
{/foreach}
<select name="carriers[]" multiple="multiple" size="4" style="height:100px;width:200px;">
{foreach $carrier_list as $carrier}
<option value="{$carrier.id_reference}" {if isset($carrier.selected) && $carrier.selected}selected="selected"{/if}>{$carrier.name}</option>
{/foreach}
</select>
</td>
</tr>
-1
View File
@@ -87,7 +87,6 @@ class FileUploaderCore
if($this->allowedExtensions && !in_array(strtolower($ext), $this->allowedExtensions))
return array('error' => Tools::displayError('File has an invalid extension, it should be one of '). $these . '.');
return $this->file->save();
}
+1 -1
View File
@@ -314,7 +314,7 @@ class HelperCore
*/
public function renderAssoShop($type = 'shop')
{
if (!Shop::isFeatureActive() || (!$this->id && $this->context->shop->getContextType() != Shop::CONTEXT_ALL))
if (!Shop::isFeatureActive())
return;
if ($type != 'shop' && $type != 'group_shop')
+7 -11
View File
@@ -27,8 +27,6 @@
class AdminProductsControllerCore extends AdminController
{
protected $max_file_size = NULL;
/** @var integer Max image size for upload
* As of 1.5 it is recommended to not set a limit to max image size
**/
@@ -90,8 +88,7 @@ class AdminProductsControllerCore extends AdminController
$this->imageType = 'jpg';
$this->context = Context::getContext();
$this->_defaultOrderBy = 'position';
$this->max_file_size = (Configuration::get('PS_LIMIT_UPLOAD_IMAGE_VALUE') * 1000000);
$this->max_image_size = (Configuration::get('PS_LIMIT_UPLOAD_FILE_VALUE') * 1000000);
$this->max_image_size = (int)Configuration::get('PS_PRODUCT_PICTURE_MAX_SIZE');
$categoriesArray = array();
$categories = Category::getSimpleCategories($this->context->language->id);
@@ -1041,8 +1038,7 @@ class AdminProductsControllerCore extends AdminController
self::$currentIndex = 'index.php?tab=AdminProducts';
$allowedExtensions = array("jpeg", "gif", "png", "jpg");
// max file size in bytes
$sizeLimit = $this->max_file_size == 0 ? 10485760 : $this->max_file_size;
$uploader = new FileUploader($allowedExtensions, $sizeLimit);
$uploader = new FileUploader($allowedExtensions, $this->max_image_size);
$result = $uploader->handleUpload();
if (isset($result['success']))
{
@@ -1270,7 +1266,7 @@ class AdminProductsControllerCore extends AdminController
$this->status = 'ok';
}
protected function _validateSpecificPrice($id_shop, $id_currency, $id_country, $id_group, $id_customer, $price, $from_quantity, $reduction, $reduction_type, $from, $to)
{
if (!Validate::isUnsignedId($id_shop) || !Validate::isUnsignedId($id_currency) || !Validate::isUnsignedId($id_country) || !Validate::isUnsignedId($id_group) || !Validate::isUnsignedId($id_customer))
@@ -2698,7 +2694,7 @@ class AdminProductsControllerCore extends AdminController
$input_namepack_items = Tools::getValue('namePackItems');
else
foreach ($product->packItems as $pack_item)
$input_namepack_items .= $pack_item->pack_quantity.' x '.$pack_item->name.'¤';
$input_namepack_items .= $pack_item->pack_quantity.' x '.$pack_item->name.'¤';
$data->assign(array(
'product' => $product,
@@ -2980,7 +2976,7 @@ class AdminProductsControllerCore extends AdminController
$j = 0;
for ($i = $alreadyGenerated[Product::CUSTOMIZE_TEXTFIELD]; $i < (int)($this->getFieldValue($obj, 'text_fields')); $i++)
$customizableFieldIds[] = 'newLabel_'.Product::CUSTOMIZE_TEXTFIELD.'_'.$j++;
return implode('¤', $customizableFieldIds);
return implode('¤', $customizableFieldIds);
}
private function _displayLabelField(&$label, $languages, $default_language, $type, $fieldIds, $id_customization_field)
@@ -3240,7 +3236,7 @@ class AdminProductsControllerCore extends AdminController
$data->assign('token', $this->token);
$data->assign('table', $this->table);
$data->assign('max_image_size', (int)Configuration::get('PS_PRODUCT_PICTURE_MAX_SIZE') / 1000);
$data->assign('max_image_size', $this->max_image_size / 1000);
$data->assign('up_filename', strval(Tools::getValue('virtual_product_filename_attribute')));
$data->assign('currency', $this->context->currency);
@@ -3834,7 +3830,7 @@ class AdminProductsControllerCore extends AdminController
$input_namepack_items = Tools::getValue('namePackItems');
else
foreach ($product->packItems as $pack_item)
$input_namepack_items .= $pack_item->pack_quantity.' x '.$pack_item->name.'¤';
$input_namepack_items .= $pack_item->pack_quantity.' x '.$pack_item->name.'¤';
$this->tpl_form_vars['input_namepack_items'] = $input_namepack_items;
}