diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 699060afcfc..060f1d387c7 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -840,7 +840,12 @@ class FormFile $fileinfo = pathinfo($file['name']); print ''; $minifile=$fileinfo['filename'].'_mini.'.strtolower($fileinfo['extension']); // Thumbs are created with filename in lower case - if (image_format_supported($file['name']) > 0) print ''; + if (image_format_supported($file['name']) > 0) + { + print ''; + print ''; + print ''; + } else print ' '; print ''; } @@ -848,6 +853,15 @@ class FormFile // ($param must start with &) print ''; if ($useinecm) print ''.img_view().'   '; + else + { + if (image_format_supported($file['name']) > 0) + { + // TODO Add link from photo page here + + + } + } if ($permtodelete) { /* diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 079c0772d8b..90851b53e90 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -3552,7 +3552,8 @@ class Product extends CommonObject // Si fichier vignette disponible et image source trop grande, on utilise la vignette, sinon on utilise photo origine $alt=$langs->transnoentitiesnoconv('File').': '.$pdir.$photo; $alt.=' - '.$langs->transnoentitiesnoconv('Size').': '.$imgarray['width'].'x'.$imgarray['height']; - if ($photo_vignette && $imgarray['height'] > $maxHeight) { + if ($photo_vignette && $imgarray['height'] > $maxHeight) + { $return.= ''; $return.= 'dol_use_jmobile?'max-height':'height').'="'.$maxHeight.'" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=product&entity='.$this->entity.'&file='.urlencode($pdirthumb.$photo_vignette).'" title="'.dol_escape_htmltag($alt).'">'; } diff --git a/htdocs/product/document.php b/htdocs/product/document.php index 797af35248e..35d1b1080fb 100644 --- a/htdocs/product/document.php +++ b/htdocs/product/document.php @@ -103,7 +103,7 @@ if (empty($reshook)) } } } - + // Action sending file include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_pre_headers.tpl.php'; @@ -112,18 +112,18 @@ if (empty($reshook)) if ($action=='filemerge') { $is_refresh = GETPOST('refresh'); if (empty($is_refresh)) { - + $filetomerge_file_array = GETPOST('filetoadd'); - + $filetomerge_file_array = GETPOST('filetoadd'); - + if ($conf->global->MAIN_MULTILANGS) { $lang_id = GETPOST('lang_id'); } - + // Delete all file already associated $filetomerge = new Propalmergepdfproduct($db); - + if ($conf->global->MAIN_MULTILANGS) { $result=$filetomerge->delete_by_product($user, $object->id, $lang_id); } else { @@ -132,17 +132,17 @@ if ($action=='filemerge') { if ($result<0) { setEventMessage($filetomerge->error,'errors'); } - + // for each file checked add it to the product if (is_array($filetomerge_file_array)) { foreach ( $filetomerge_file_array as $filetomerge_file ) { $filetomerge->fk_product = $object->id; $filetomerge->file_name = $filetomerge_file; - + if ($conf->global->MAIN_MULTILANGS) { $filetomerge->lang = $lang_id; } - + $result=$filetomerge->create($user); if ($result<0) { setEventMessage($filetomerge->error,'errors'); @@ -206,31 +206,31 @@ if ($object->id) print ''.$langs->trans("NbOfAttachedFiles").''.count($filearray).''; print ''.$langs->trans("TotalSizeOfAttachedFiles").''.$totalsize.' '.$langs->trans("bytes").''; print ''; - + print ''; $modulepart = 'produit'; $permission = (($object->type == Product::TYPE_PRODUCT && $user->rights->produit->creer) || ($object->type == Product::TYPE_SERVICE && $user->rights->service->creer)); $param = '&id=' . $object->id; include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php'; - - - //Merge propal PDF docuemnt PDF files + + + // Merge propal PDF docuemnt PDF files if (!empty($conf->global->PRODUIT_PDF_MERGE_PROPAL)) { $filetomerge = new Propalmergepdfproduct($db); - + if ($conf->global->MAIN_MULTILANGS) { $lang_id = GETPOST('lang_id'); $result = $filetomerge->fetch_by_product($object->id, $lang_id); } else { $result = $filetomerge->fetch_by_product($object->id); } - + $form = new Form($db); - + $filearray = dol_dir_list($upload_dir, "files", 0, '', '\.meta$', 'name', SORT_ASC, 1); - + // For each file build select list with PDF extention if (count($filearray) > 0) { print '
'; @@ -238,31 +238,31 @@ if ($object->id) if (count($filetomerge->lines) > 0) { print $langs->trans('PropalMergePdfProductActualFile'); } - + print '
'; print ''; print ''; if (count($filetomerge->lines) == 0) { print $langs->trans('PropalMergePdfProductChooseFile'); } - + print ''; - + // Get language if ($conf->global->MAIN_MULTILANGS) { - + $langs->load("languages"); - + print ''; } - + $style = 'impair'; - foreach ( $filearray as $filetoadd ) { - - if ($ext = pathinfo($filetoadd['name'], PATHINFO_EXTENSION) == 'pdf') { - + foreach ($filearray as $filetoadd) + { + if ($ext = pathinfo($filetoadd['name'], PATHINFO_EXTENSION) == 'pdf') + { if ($style == 'pair') { $style = 'impair'; } else { $style = 'pair'; } - + $checked = ''; $filename = $filetoadd['name']; - + if ($conf->global->MAIN_MULTILANGS) { if (array_key_exists($filetoadd['name'] . '_' . $delauft_lang, $filetomerge->lines)) { $filename = $filetoadd['name'] . ' - ' . $langs->trans('Language_' . $delauft_lang); @@ -322,23 +324,24 @@ if ($object->id) $checked = ' checked '; } } - + print ''; } } + print ''; + print '
'; - + $delauft_lang = (empty($lang_id)) ? $langs->getDefaultLang() : $lang_id; - + $langs_available = $langs->get_available_languages(DOL_DOCUMENT_ROOT, 12); - + print ''; - + if ($conf->global->MAIN_MULTILANGS) { print ''; } - + print '
'; - + print '' . $filename . ''; print '
'; - print ''; print '
'; - + print '
'; } } - + } else {