From 2c829e7cb6b5d847e4fd40505a01f181718a5979 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 7 Apr 2016 11:50:45 +0200 Subject: [PATCH] NEW Add picto on module list to show warning and if module is an external module. --- htdocs/admin/modules.php | 45 +++++++++++------- htdocs/core/lib/functions.lib.php | 6 +-- htdocs/theme/eldy/img/credit_card.png | Bin 0 -> 181 bytes htdocs/theme/eldy/img/external.png | Bin 0 -> 378 bytes htdocs/theme/eldy/img/object_energie.png | Bin 376 -> 0 bytes .../img/object_energy.png} | Bin htdocs/theme/eldy/img/setup.png | Bin 702 -> 155 bytes htdocs/theme/eldy/img/upload.png | Bin 0 -> 296 bytes htdocs/theme/eldy/style.css.php | 1 + htdocs/theme/md/img/credit_card.png | Bin 0 -> 181 bytes htdocs/theme/md/img/external.png | Bin 0 -> 316 bytes htdocs/theme/md/img/object_energy.png | Bin 0 -> 158 bytes htdocs/theme/md/img/upload.png | Bin 0 -> 296 bytes htdocs/theme/md/style.css.php | 1 + 14 files changed, 34 insertions(+), 19 deletions(-) create mode 100644 htdocs/theme/eldy/img/credit_card.png create mode 100644 htdocs/theme/eldy/img/external.png delete mode 100644 htdocs/theme/eldy/img/object_energie.png rename htdocs/theme/{md/img/object_energie.png => eldy/img/object_energy.png} (100%) create mode 100644 htdocs/theme/eldy/img/upload.png create mode 100644 htdocs/theme/md/img/credit_card.png create mode 100644 htdocs/theme/md/img/external.png create mode 100644 htdocs/theme/md/img/object_energy.png create mode 100644 htdocs/theme/md/img/upload.png diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 4d824b3805b..a31c8f1707a 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -222,6 +222,7 @@ foreach ($modulesdir as $dir) $orders[$i] = $familyinfo[$familykey]['position']."_".$familykey."_".$moduleposition."_".$j; // Sort by family, then by module position then number $dirmod[$i] = $dir; + //print $i.'-'.$dirmod[$i].'
'; // Set categ[$i] $specialstring = isset($specialtostring[$special])?$specialtostring[$special]:'unknown'; if ($objMod->version == 'development' || $objMod->version == 'experimental') $specialstring='expdev'; @@ -322,9 +323,6 @@ if ($mode != 'marketplace') $moreforfilter.= $langs->trans('Keyword') . ': '; $moreforfilter.= ''; $moreforfilter.='
'; - $moreforfilter.= $langs->trans('Status') . ': '.$form->selectarray('search_status', array('active'=>$langs->transnoentitiesnoconv("Enabled"), 'disabled'=>$langs->transnoentitiesnoconv("Disabled")), $search_status, 1); - $moreforfilter.= '
'; - $moreforfilter.='
'; $moreforfilter.= $langs->trans('Origin') . ': '.$form->selectarray('search_nature', $arrayofnatures, $search_nature, 1); $moreforfilter.= '
'; if (! empty($conf->global->MAIN_FEATURES_LEVEL)) @@ -337,6 +335,9 @@ if ($mode != 'marketplace') $moreforfilter.= $langs->trans('Version') . ': '.$form->selectarray('search_version', $array_version, $search_version, 1); $moreforfilter.= ''; } + $moreforfilter.='
'; + $moreforfilter.= $langs->trans('Status') . ': '.$form->selectarray('search_status', array('active'=>$langs->transnoentitiesnoconv("Enabled"), 'disabled'=>$langs->transnoentitiesnoconv("Disabled")), $search_status, 1); + $moreforfilter.= '
'; $moreforfilter.=' '; $moreforfilter.='
'; $moreforfilter.=''; @@ -370,7 +371,8 @@ if ($mode != 'marketplace') $modName = $filename[$key]; $objMod = $modules[$key]; - + $dirofmodule = $dirmod[$key]; + $special = $objMod->special; //print $objMod->name." - ".$key." - ".$objMod->special.' - '.$objMod->version."
"; @@ -497,11 +499,13 @@ if ($mode != 'marketplace') if ($objMod->getDescLong()) $text.=$objMod->getDesc().'
'.$objMod->getDescLong().'
'; else $text.=$objMod->getDesc().'
'; + $textexternal=''; if ($objMod->isCoreOrExternalModule() == 'external') { - $text.='
'.$langs->trans("Origin").': '.$langs->trans("ExternalModule",$dirofmodule); - if (! empty($objMod->editor_name) && $objMod->editor_name != 'dolibarr') $text.='
'.$langs->trans("Author").': '.$objMod->editor_name; - if (! empty($objMod->editor_url) && $objMod->editor_url != 'www.dolibarr.org') $text.='
'.$langs->trans("Url").': '.$objMod->editor_url; + $textexternal.='
'.$langs->trans("Origin").': '.$langs->trans("ExternalModule",$dirofmodule); + if ($objMod->editor_name != 'dolibarr') $textexternal.='
'.$langs->trans("Publisher").': '.(empty($objMod->editor_name)?$langs->trans("Unknown"):$objMod->editor_name); + if (! empty($objMod->editor_url) && ! preg_match('/dolibarr\.org/i',$objMod->editor_url)) $textexternal.='
'.$langs->trans("Url").': '.$objMod->editor_url; + $text.=$textexternal; $text.='
'; } else @@ -636,13 +640,22 @@ if ($mode != 'marketplace') $text.='
'.$langs->trans("AddOtherPagesOrServices").': '; $text.=$langs->trans("DetectionNotPossible"); - print $form->textwithpicto('', $text, 1, 'help'); + print $form->textwithpicto('', $text, 1, 'help', 'minheight20'); + + // Picto warning + $version=$objMod->getVersion(); + if (preg_match('/development/i', $version)) print img_warning($langs->trans("Development"), 'style="float: right"'); + if (preg_match('/experimental/i', $version)) print img_warning($langs->trans("Experimental"), 'style="float: right"'); + if (preg_match('/deprecated/i', $version)) print img_warning($langs->trans("Deprecated"), 'style="float: right"'); + + // Picto external + if ($textexternal) print img_picto($langs->trans("ExternalModule",$dirofmodule), 'external', 'style="float: right"'); + + print ''; // Version print ''; - $version=$objMod->getVersion(); - $dirofmodule=$dirmod[$key]; print $version; print "\n"; @@ -688,11 +701,11 @@ if ($mode != 'marketplace') { if (preg_match('/^([^@]+)@([^@]+)$/i',$urlpage,$regs)) { - print ''.img_picto($langs->trans("Setup"),"setup").''; + print ''.img_picto($langs->trans("Setup"),"setup",'style="padding-right: 6px"').''; } else { - print ''.img_picto($langs->trans("Setup"),"setup").''; + print ''.img_picto($langs->trans("Setup"),"setup",'style="padding-right: 6px"').''; } } } @@ -700,16 +713,16 @@ if ($mode != 'marketplace') } else if (preg_match('/^([^@]+)@([^@]+)$/i',$objMod->config_page_url,$regs)) { - print ''.img_picto($langs->trans("Setup"),"setup").''; + print ''.img_picto($langs->trans("Setup"),"setup",'style="padding-right: 6px"').''; } else { - print ''.img_picto($langs->trans("Setup"),"setup").''; + print ''.img_picto($langs->trans("Setup"),"setup",'style="padding-right: 6px"').''; } } else { - print ''.img_picto($langs->trans("NothingToSetup"),"setup",'class="opacitytransp"').''; + print ''.img_picto($langs->trans("NothingToSetup"),"setup",'class="opacitytransp" style="padding-right: 6px"').''; } } @@ -732,7 +745,7 @@ if ($mode != 'marketplace') print "\n"; } print "\n"; - print ''.img_picto($langs->trans("NothingToSetup"),"setup",'class="opacitytransp"').''; + print ''.img_picto($langs->trans("NothingToSetup"),"setup",'class="opacitytransp" style="padding-right: 6px"').''; } print "\n"; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 8671638ce0c..63d7f749be7 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -2416,16 +2416,16 @@ function img_info($titlealt = 'default') * Show warning logo * * @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. - * @param int $float If we must add style "float: right" + * @param string $options Add more attribute on img tag (For example 'style="float: right"'). If 1 * @return string Return img tag */ -function img_warning($titlealt = 'default', $float = 0) +function img_warning($titlealt = 'default', $options = '') { global $conf, $langs; if ($titlealt == 'default') $titlealt = $langs->trans('Warning'); - return img_picto($titlealt, 'warning.png', 'class="pictowarning"'.($float ? ' style="float: right"' : '')); + return img_picto($titlealt, 'warning.png', 'class="pictowarning"'.($options ? ($options == '1' ? ' style="float: right"' : ' '.$options): '')); } /** diff --git a/htdocs/theme/eldy/img/credit_card.png b/htdocs/theme/eldy/img/credit_card.png new file mode 100644 index 0000000000000000000000000000000000000000..33b1cb32c9db1754e2fcd6ae165586cabdc40370 GIT binary patch literal 181 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA0wn)(8}b0D8c!F;kP61P*BrSH83?pK{BL5| zE}m4iAzNeS&+!wD%_Vj5*7J?qKkA^>bP0l+XkKRRBjH literal 0 HcmV?d00001 diff --git a/htdocs/theme/eldy/img/external.png b/htdocs/theme/eldy/img/external.png new file mode 100644 index 0000000000000000000000000000000000000000..507d8c24858bdb1892d7848f070b15a98c266363 GIT binary patch literal 378 zcmeAS@N?(olHy`uVBq!ia0vp^LLkh+1|-AI^@Rf|wj^(N7l!{JxM1({$v_d#0*}aI z1_o|n5N2eUHAey{$X?><>&pIsg`HE)Xq)`80tN;~c25__5R21iC$IHmF%)UtuQ)rw zZQ`03ArX5vAr`UY${YL}Y?{;~j%1yf_<>=!Q1=7X01qLR$fFWx_?D@pZksE=-8}Qs zvgdW%pKsI6;Pl*mz(Qw#&i^M{thXGO`N5NXPfcghtK|onG#X1aj2QEpo)|Lx|E86Y z^_w?A#8Lb};i3px(K#mHrXBDU4oOq+=X~JicV}_w?5`|O;{C!mGv-xiSUHw&doNsO zo^*wAX6sK!h8pJ8iVN6p8+*3Cz4gugiw|4m?kOcHyQhVGc^UZ5CH+A667AdXCxsmh zvlU_4z;ENdi{aa$7p2*nv)d13&;Mhw^Hj(AXot{Kw@m)bHTryNw))D3>}_UsjAl<< VHyD`}1Oh{e!PC{xWt~$(697_+lJEck literal 0 HcmV?d00001 diff --git a/htdocs/theme/eldy/img/object_energie.png b/htdocs/theme/eldy/img/object_energie.png deleted file mode 100644 index bc3966d2fa2e83c5810278c33a37ea5fc6718d90..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 376 zcmV-;0f+vHP)?cH9Ukkl^6lsM()jVZh*Ilf$rlN}E>2tLhw}Z492SelF{r5}E)? C7BJiZ literal 702 zcmV;v0zv(WP)L`hzKc=0lo$X z24&~ZpT7un9)=-dVPUD)uV4REQ&Y7WsMZ*!IXpZ(2WWUQT%oqMcG>CEr!PiFN23@L z92}f?_3G9CAnfdH4|0Jq(6C8B?|kz1_Rd7H4P?lnLx(N`Z775KkI~oHxA4M+3;%&( z05+tuvT`%XJ3DslIBITg9)jU#O-;?RJ$v?Cw6(P@v$nPl^6>B|J%0T7e~=;9u3q_n z<;tZmt5>f+VPRoWBQ7p3hBewihAf=Ze|=i3!{x&}=Kj~!)otYDCmzP)P<`upF^OJO+AKB9J zZGOMwMj$RBXn>NEQn0^&;G~NeuY%&d$Ja%(u&3JM%#|ba{?G2V-!iMqt_-IE5)u+2 z{{Eq}u3fwH9~f{`_Soj^JZh>d_)6Nu%2SQv=;fLH*CC4pE4i1p%v k)TUHs8=eVtRRqTh02?mmtpET3 diff --git a/htdocs/theme/eldy/img/upload.png b/htdocs/theme/eldy/img/upload.png new file mode 100644 index 0000000000000000000000000000000000000000..862fb593232ab42fffc8c17029f166f81cd39268 GIT binary patch literal 296 zcmeAS@N?(olHy`uVBq!ia0vp^LLkh+0wn(&ce?|mn3BBRT^Rni_n+Ah4nJ za0`PlBg3pY5H=O_6IENoU(E|N?lh2g?4(nIEHAPKYGc~&&g4w^`ZU|fr(5` z9cCgrO&fR;^rL=QSxs|j-ME-Nii1@&kyEAQnCyzyp4NTGedcYwH`yoc+~0hoVxvFN zS9@ew4&HNkYyRY%SI3ru=(c&nDjf4d^xsO)yuN7a$*x*+_g7{Yzex1d`xQHf7sNXi zz0s-IUUGJ$Lt50V1uIj-e(=|*O`qG~`Dky*oJr<&F4=K!yE2nZN=i(G^1biwni8FVdQ&MBb@08pE8VE_OC literal 0 HcmV?d00001 diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 5dd81e0d0e1..050c685aed8 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -576,6 +576,7 @@ div.myavailability { .maxwidth300 { max-width: 300px; } .maxwidth400 { max-width: 400px; } .maxwidth500 { max-width: 500px; } +.minheight20 { min-height: 20px; } .titlefield { width: 25%; } .titlefieldcreate { width: 20%; } diff --git a/htdocs/theme/md/img/credit_card.png b/htdocs/theme/md/img/credit_card.png new file mode 100644 index 0000000000000000000000000000000000000000..33b1cb32c9db1754e2fcd6ae165586cabdc40370 GIT binary patch literal 181 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA0wn)(8}b0D8c!F;kP61P*BrSH83?pK{BL5| zE}m4iAzNeS&+!wD%_Vj5*7J?qKkA^>bP0l+XkKRRBjH literal 0 HcmV?d00001 diff --git a/htdocs/theme/md/img/external.png b/htdocs/theme/md/img/external.png new file mode 100644 index 0000000000000000000000000000000000000000..e767123a3519bf0a66e099e24aa7eeb06fb07c49 GIT binary patch literal 316 zcmeAS@N?(olHy`uVBq!ia0vp^LLkh+0wn(&ce?|mn3BBRT^Rni_n+Ah4nJ za0`PlBg3pY5H=O_6IENoN|K9&$)jBh0c1qIEHAPUwhFukI7Jg^+A5PN9F`2 z*F`Q%xIHH;iJ#DYz#`KiT)?p8%T9(ErRg57(|I))m)yQ^!{m2z^MX^GQ!4M-oR{wB zw#@7K@cIGQwM7|oC$m;;GZdL}OswL&vc}bCc9IRf$KOSTB;0X{_RmeyH`7+B7J0jn z<>8TiFCJa!4${%zyYkhk^(T5(7hmMMGkZt&4C9N@*L;<{s;f+M*$TEU&kz2yvL<#@ z_oBJC-_;~tpKbT!gv}|tSoJU7YO6B;=jCP3IJ0+c(CnY#GK{)5Q7<(DOkV>%#^CAd K=d#Wzp$Py-zI-MC literal 0 HcmV?d00001 diff --git a/htdocs/theme/md/img/object_energy.png b/htdocs/theme/md/img/object_energy.png new file mode 100644 index 0000000000000000000000000000000000000000..668d1bc68a13e0118d53a2331c13be10cd7a7933 GIT binary patch literal 158 zcmeAS@N?(olHy`uVBq!ia0vp^LLkh+0wn(&ce?|mQaxQ9Ln;`P6+~4GOcV|>yy@aI z_~YKh$0Evjlcz=0@% zE)juZ6I>lGy0WDm>Uz^?!sxo1V|j}ao8_Ud7KszA4Datb)HfdAHXUdogQu&X%Q~lo FCIGsCGZX*- literal 0 HcmV?d00001 diff --git a/htdocs/theme/md/img/upload.png b/htdocs/theme/md/img/upload.png new file mode 100644 index 0000000000000000000000000000000000000000..862fb593232ab42fffc8c17029f166f81cd39268 GIT binary patch literal 296 zcmeAS@N?(olHy`uVBq!ia0vp^LLkh+0wn(&ce?|mn3BBRT^Rni_n+Ah4nJ za0`PlBg3pY5H=O_6IENoU(E|N?lh2g?4(nIEHAPKYGc~&&g4w^`ZU|fr(5` z9cCgrO&fR;^rL=QSxs|j-ME-Nii1@&kyEAQnCyzyp4NTGedcYwH`yoc+~0hoVxvFN zS9@ew4&HNkYyRY%SI3ru=(c&nDjf4d^xsO)yuN7a$*x*+_g7{Yzex1d`xQHf7sNXi zz0s-IUUGJ$Lt50V1uIj-e(=|*O`qG~`Dky*oJr<&F4=K!yE2nZN=i(G^1biwni8FVdQ&MBb@08pE8VE_OC literal 0 HcmV?d00001 diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 9f6f2f3cf91..c497e8f876c 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -566,6 +566,7 @@ div.myavailability { .maxwidth300 { max-width: 300px; } .maxwidth400 { max-width: 400px; } .maxwidth500 { max-width: 500px; } +.minheight20 { min-height: 20px; } .titlefield { width: 30%; } .titlefieldcreate { width: 20%; }