Merge remote-tracking branch 'origin/3.9' into develop
Conflicts: htdocs/core/lib/files.lib.php
This commit is contained in:
commit
10f639507f
@ -863,11 +863,15 @@ class FormFile
|
||||
{
|
||||
$fileinfo = pathinfo($file['name']);
|
||||
print '<td align="center">';
|
||||
$minifile=$fileinfo['filename'].'_mini.'.strtolower($fileinfo['extension']); // Thumbs are created with filename in lower case
|
||||
if (image_format_supported($file['name']) > 0)
|
||||
{
|
||||
print '<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&file='.urlencode($relativepath.$fileinfo['filename'].'.'.strtolower($fileinfo['extension'])).'" class="aphoto" target="_blank">';
|
||||
print '<img border="0" height="'.$maxheightmini.'" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&file='.urlencode($relativepath.'thumbs/'.$minifile).'" title="">';
|
||||
$minifile=getImageFileNameForSize($file['name'], '_mini', '.png'); // Thumbs are created with filename in lower case and with .png extension
|
||||
//print $relativepath.'<br>';
|
||||
//print $file['path'].'/'.$minifile.'<br>';
|
||||
if (! dol_is_file($file['path'].'/'.$minifile)) $minifile=getImageFileNameForSize($file['name'], '_mini', '.'.$fileinfo['extension']); // For old thumbs
|
||||
//print $file['path'].'/'.$minifile.'<br>';
|
||||
print '<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&file='.urlencode($relativepath.$fileinfo['filename'].'.'.strtolower($fileinfo['extension'])).'" class="aphoto" target="_blank">';
|
||||
print '<img border="0" height="'.$maxheightmini.'" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&file='.urlencode($relativepath.$minifile).'" title="">';
|
||||
print '</a>';
|
||||
}
|
||||
else print ' ';
|
||||
|
||||
@ -1469,7 +1469,9 @@ function dol_add_file_process($upload_dir, $allowoverwrite=0, $donotupdatesessio
|
||||
// lowercase extension
|
||||
$info = pathinfo($destpath);
|
||||
$destpath = $info['dirname'].'/'.$info['filename'].'.'.strtolower($info['extension']);
|
||||
|
||||
$info = pathinfo($destfile);
|
||||
$destfile = $info['filename'].'.'.strtolower($info['extension']);
|
||||
|
||||
$resupload = dol_move_uploaded_file($TFile['tmp_name'][$i], $destpath, $allowoverwrite, 0, $TFile['error'][$i], 0, $varfiles);
|
||||
if (is_numeric($resupload) && $resupload > 0)
|
||||
{
|
||||
|
||||
@ -301,7 +301,7 @@ function dol_imageResizeOrCrop($file, $mode, $newWidth, $newHeight, $src_x=0, $s
|
||||
* @param string $extName Extension to differenciate thumb file name ('_small', '_mini')
|
||||
* @param int $quality Quality of compression (0=worst, 100=best)
|
||||
* @param string $outdir Directory where to store thumb
|
||||
* @param int $targetformat New format of target (1,2,3,... or 0 to keep old format)
|
||||
* @param int $targetformat New format of target (IMAGETYPE_GIF, IMAGETYPE_JPG, IMAGETYPE_PNG, IMAGETYPE_BMP, IMAGETYPE_WBMP ... or 0 to keep old format)
|
||||
* @return string Full path of thumb or '' if it fails
|
||||
*/
|
||||
function vignette($file, $maxWidth = 160, $maxHeight = 120, $extName='_small', $quality=50, $outdir='thumbs', $targetformat=0)
|
||||
@ -473,6 +473,7 @@ function vignette($file, $maxWidth = 160, $maxHeight = 120, $extName='_small', $
|
||||
}
|
||||
|
||||
// Initialisation des variables selon l'extension de l'image
|
||||
// $targetformat is 0 by default, in such case, we keep original extension
|
||||
switch($targetformat)
|
||||
{
|
||||
case IMAGETYPE_GIF: // 1
|
||||
|
||||
@ -189,13 +189,13 @@ class modStock extends DolibarrModules
|
||||
$this->import_icon[$r]=$this->picto;
|
||||
$this->import_entities_array[$r]=array(); // We define here only fields that use another icon that the one defined into import_icon
|
||||
$this->import_tables_array[$r]=array('ps'=>MAIN_DB_PREFIX.'product_stock');
|
||||
$this->import_fields_array[$r]=array('ps.fk_product'=>"Product*",'ps.fk_entrepot'=>"Warehouse*",'ps.reel'=>"Stock*",'ps.pmp'=>"PMP" );
|
||||
$this->import_fields_array[$r]=array('ps.fk_product'=>"Product*",'ps.fk_entrepot'=>"Warehouse*",'ps.reel'=>"Stock*");
|
||||
|
||||
$this->import_convertvalue_array[$r]=array(
|
||||
'ps.fk_product'=>array('rule'=>'fetchidfromref','classfile'=>'/product/class/product.class.php','class'=>'Product','method'=>'fetch','element'=>'product'),
|
||||
'ps.fk_entrepot'=>array('rule'=>'fetchidfromref','classfile'=>'/product/stock/class/entrepot.class.php','class'=>'Entrepot','method'=>'fetch','element'=>'label')
|
||||
);
|
||||
$this->import_examplevalues_array[$r]=array('ps.fk_product'=>"PREF123456",'ps.fk_entrepot'=>"ALM001",'ps.reel'=>"10",'ps.pmp'=>"25"
|
||||
$this->import_examplevalues_array[$r]=array('ps.fk_product'=>"PREF123456",'ps.fk_entrepot'=>"ALM001",'ps.reel'=>"10"
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user