diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index 7d95da69aef..dfa6eec515c 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -673,7 +673,8 @@ else print "
"; - + print '
'; + // Add personnal information print load_fiche_titre('
'.$langs->trans("PersonalInformations").'
','',''); diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 5aa699c055c..d90b906882f 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -867,9 +867,9 @@ class FormFile // Preview $urladvanced = getAdvancedPreviewUrl($modulepart, $relativepath); - if ($urladvanced) $tmpout.= '
  • '.img_picto('','detail').' '.$langs->trans("Preview").' '.$ext.'
  • '; + if ($urladvanced) $tmpout.= '
  • '.img_picto('','detail').' '.$langs->trans("Preview").' '.$ext.'
  • '; // Download - $tmpout.= '
  • browser->layout != 'phone') { - $urladvancedpreview=getAdvancedPreviewUrl($modulepart, $relativepath); // Return if a file is qualified for preview - if ($urladvancedpreview) + $urladvancedpreview=getAdvancedPreviewUrl($modulepart, $relativepath, 1); // Return if a file is qualified for preview. + if (count($urladvancedpreview)) { - $out.= ''; - if (empty($ruleforpicto)) $out.= img_picto($langs->trans('Preview').' '.$file['name'], 'detail'); + $out.= ''; + //$out.= ''; + if (empty($ruleforpicto)) $out.= img_picto($langs->trans('Preview').' '.$file['name'], 'detail'); else $out.= img_mime($relativepath, $langs->trans('Preview').' '.$file['name']); $out.= ''; } diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index bfb893d92ee..fb901198852 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -693,7 +693,6 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='') $colspan=9; print ''; - print_liste_field_titre(''); print_liste_field_titre($langs->trans("Name"),$_SERVER["PHP_SELF"],"p.lastname","",$param,'',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Poste"),$_SERVER["PHP_SELF"],"p.poste","",$param,'',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Address").' / '.$langs->trans("Phone").' / '.$langs->trans("Email"),$_SERVER["PHP_SELF"],"","",$param,'',$sortfield,$sortorder); @@ -728,21 +727,16 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='') { print ''; - // Photo - print ''; - print ''; - - // Name - Position + // Photo - Name print ''; print ''; print ''; - // Address / Phone + // Position print ''; - //print ''; print ''; - // Email + // Address - Phone - Email print ' '; // Status @@ -797,14 +791,10 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='') print ""; - // Photo - print ''; - print $form->showphoto('contact',$contactstatic,0,0,0,'photorefnoborder','small',1,0,1); - print ''; - - // Name + // Photo - Name print ''; - print $contactstatic->getNomUrl(0,'',0,'&backtopage='.urlencode($backtopage)); + print $form->showphoto('contact',$contactstatic,0,0,0,'photorefnoborder valignmiddle marginrightonly','small',1,0,1); + print $contactstatic->getNomUrl(0,'',0,'&backtopage='.urlencode($backtopage)); print ''; // Job position @@ -812,7 +802,7 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='') if ($obj->poste) print $obj->poste; print ''; - // Address and phone + // Address - Phone - Email print ''; print $contactstatic->getBannerAddress('contact', $object); print ''; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index a872d166283..64b26ed7875 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -5855,10 +5855,11 @@ function getImageFileNameForSize($file, $extName, $extImgTarget='') * Return URL we can use for advanced preview links * * @param string $modulepart propal, facture, facture_fourn, ... - * @param string $relativepath Relative path of docs - * @return string Output string with HTML + * @param string $relativepath Relative path of docs. + * @param int $alldata Return array with all components (1 is recommended) + * @return string|array Output string with href link or array with all components of link */ -function getAdvancedPreviewUrl($modulepart, $relativepath) +function getAdvancedPreviewUrl($modulepart, $relativepath, $alldata=0) { global $conf, $langs; @@ -5868,8 +5869,15 @@ function getAdvancedPreviewUrl($modulepart, $relativepath) //$mime_preview[]='vnd.oasis.opendocument.presentation'; //$mime_preview[]='archive'; $num_mime = array_search(dol_mimetype($relativepath, '', 1), $mime_preview); + + if ($alldata == 1) + { + if ($num_mime !== false) return array('target'=>'_blank', 'css'=>'documentpreview', 'url'=>DOL_URL_ROOT.'/document.php?modulepart='.$modulepart.'&attachment=0&file='.urlencode($relativepath), 'mime'=>dol_mimetype($relativepath), ); + else return array(); + } - if ($num_mime !== false) return 'javascript:document_preview(\''.dol_escape_js(DOL_URL_ROOT.'/document.php?modulepart='.$modulepart.'&attachment=0&file='.$relativepath).'\', \''.dol_mimetype($relativepath).'\', \''.dol_escape_js($langs->trans('Preview')).'\')'; + // old behavior + if ($num_mime !== false) return 'javascript:document_preview(\''.dol_escape_js(DOL_URL_ROOT.'/document.php?modulepart='.$modulepart.'&attachment=0&file='.urlencode($relativepath)).'\', \''.dol_mimetype($relativepath).'\', \''.dol_escape_js($langs->trans('Preview')).'\')'; else return ''; } diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 9c0a98cbcfb..7d5e5dfa64c 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1882,7 +1882,9 @@ if (! function_exists("llxFooter")) if (! empty($delayedhtmlcontent)) print $delayedhtmlcontent; - // Wrapper to show tooltips + // TODO Move this in lib_head.js + + // Wrapper to show tooltips (html or onclick popup) if (! empty($conf->use_javascript_ajax) && empty($conf->dol_no_mouse_hover)) { print "\n\n"; @@ -1902,6 +1904,21 @@ if (! function_exists("llxFooter")) ' . "\n"; } + // Wrapper to manage document_preview + if (! empty($conf->use_javascript_ajax)) + { + print "\n\n"; + print '' . "\n"; + } + // Wrapper to manage dropdown if ($conf->use_javascript_ajax) { diff --git a/htdocs/societe/rib.php b/htdocs/societe/rib.php index f1db2d21835..42860abb98a 100644 --- a/htdocs/societe/rib.php +++ b/htdocs/societe/rib.php @@ -802,7 +802,7 @@ if ($socid && $action == 'create' && $user->rights->societe->creer) dol_banner_tab($object, 'socid', $linkback, ($user->societe_id?0:1), 'rowid', 'nom'); - print '
    '; + print '
    '; print '
    '; print ''; @@ -845,7 +845,7 @@ if ($socid && $action == 'create' && $user->rights->societe->creer) } print '"; @@ -854,7 +854,7 @@ if ($socid && $action == 'create' && $user->rights->societe->creer) print "\n"; print '";
    '.$langs->trans("BankAccountDomiciliation").''; - print '
    '.$langs->trans("BankAccountOwnerAddress").''; - print '