From 5e7b7bbc33c846f36768bb3dc8688d4b76879945 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 17 Sep 2019 13:31:45 +0200 Subject: [PATCH 01/10] Update eldy.lib.php --- htdocs/core/menus/standard/eldy.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 2eead6da81d..e7764be3ceb 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -43,7 +43,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/menubase.class.php'; */ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = 0, $mode = '') { - global $user,$conf,$langs,$dolibarr_main_db_name; + global $user,$conf,$langs,$dolibarr_main_db_name,$mysoc; $mainmenu=(empty($_SESSION["mainmenu"])?'':$_SESSION["mainmenu"]); $leftmenu=(empty($_SESSION["leftmenu"])?'':$_SESSION["leftmenu"]); From 44ba0deae69c4dc291bff0c04edfc55dbe588a74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 20 Sep 2019 17:58:22 +0200 Subject: [PATCH 02/10] fix badge linked resources on fichinter --- htdocs/core/lib/fichinter.lib.php | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/htdocs/core/lib/fichinter.lib.php b/htdocs/core/lib/fichinter.lib.php index 8f8dea33b97..c17080d53f5 100644 --- a/htdocs/core/lib/fichinter.lib.php +++ b/htdocs/core/lib/fichinter.lib.php @@ -66,19 +66,20 @@ function fichinter_prepare_head($object) if ($conf->resource->enabled) { require_once DOL_DOCUMENT_ROOT.'/resource/class/dolresource.class.php'; - $nbResource = 0; - $objectres=new Dolresource($db); - if (is_array($objectres->available_resources)) - { - foreach ($objectres->available_resources as $modresources => $resources) - { - $resources=(array) $resources; // To be sure $resources is an array - foreach($resources as $resource_obj) - { - $linked_resources = $object->getElementResources('fichinter', $object->id, $resource_obj); - } - } - } + $objectres = new Dolresource($db); + $linked_resources = $objectres->getElementResources('fichinter', $object->id); + $nbResource = (is_array($linked_resources)?count($linked_resources):0); + // if (is_array($objectres->available_resources)) + // { + // foreach ($objectres->available_resources as $modresources => $resources) + // { + // $resources=(array) $resources; // To be sure $resources is an array + // foreach($resources as $resource_obj) + // { + // $linked_resources = $object->getElementResources('fichinter', $object->id, $resource_obj); + // } + // } + // } $head[$h][0] = DOL_URL_ROOT.'/resource/element_resource.php?element=fichinter&element_id='.$object->id; $head[$h][1] = $langs->trans("Resources"); From 86e8abde65635e41479af3dd250014ff10108f92 Mon Sep 17 00:00:00 2001 From: ATM john Date: Sun, 22 Sep 2019 11:18:54 +0200 Subject: [PATCH 03/10] Fix warning --- htdocs/core/menus/standard/eldy.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 2eead6da81d..9c2f8ea737c 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -43,7 +43,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/menubase.class.php'; */ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = 0, $mode = '') { - global $user,$conf,$langs,$dolibarr_main_db_name; + global $user,$conf,$langs,$dolibarr_main_db_name, $mysoc; $mainmenu=(empty($_SESSION["mainmenu"])?'':$_SESSION["mainmenu"]); $leftmenu=(empty($_SESSION["leftmenu"])?'':$_SESSION["leftmenu"]); From 98acfd6929369ff11a0e6fb2f1583b16b4c36b4a Mon Sep 17 00:00:00 2001 From: ATM john Date: Sun, 22 Sep 2019 11:57:33 +0200 Subject: [PATCH 04/10] Add basic stats to new dashboard --- htdocs/index.php | 51 ++++++++++++++++++++++++++++-- htdocs/theme/eldy/info-box.inc.php | 28 ++++++++++++++++ 2 files changed, 76 insertions(+), 3 deletions(-) diff --git a/htdocs/index.php b/htdocs/index.php index d50b5248fab..9151ead38b8 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -514,47 +514,55 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { 'project' => array( 'groupName' => 'Projects', + 'globalStatsKey' => 'projects', 'stats' => array('project', 'project_task'), ), 'propal' => array( 'groupName' => 'Proposals', + 'globalStatsKey' => 'proposals', 'stats' => array('propal_opened', 'propal_signed'), ), 'commande' => array( 'groupName' => 'Orders', + 'globalStatsKey' => 'orders', 'stats' => array('commande'), ), 'facture' => array( 'groupName' => 'Invoices', + 'globalStatsKey' => 'invoices', 'stats' => array('facture'), ), 'contrat' => array( 'groupName' => 'Contracts', + 'globalStatsKey' => 'Contracts', 'stats' => array('contrat_inactive', 'contrat_active'), ), 'supplier_proposal' => array( 'groupName' => 'SupplierProposals', + 'globalStatsKey' => 'askprice', 'stats' => array('supplier_proposal_opened', 'supplier_proposal_signed'), ), 'order_supplier' => array( 'groupName' => 'SuppliersOrders', + 'globalStatsKey' => 'supplier_orders', 'stats' => array('order_supplier'), ), 'invoice_supplier' => array( 'groupName' => 'BillsSuppliers', + 'globalStatsKey' => 'supplier_invoices', 'stats' => array('invoice_supplier'), ), @@ -567,18 +575,21 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { 'Adherent' => array( 'groupName' => 'Members', + 'globalStatsKey' => 'members', 'stats' => array('Adherent'), ), 'ExpenseReport' => array( 'groupName' => 'ExpenseReport', + 'globalStatsKey' => 'expensereports', 'stats' => array('ExpenseReport'), ), 'Holiday' => array( 'groupName' => 'Holidays', + 'globalStatsKey' => 'holidays', 'stats' => array('Holiday'), ), @@ -672,12 +683,46 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { if (!empty($boards)) { $groupName = $langs->trans($groupElement['groupName']); $groupKeyLowerCase = strtolower($groupKey); + $nbTotalForGroup = 0; + + // global stats + $globalStatsKey = false; + if (!empty($groupElement['globalStatsKey']) && empty($groupElement['globalStats'])){ // can be filled by hook + $globalStatsKey = $groupElement['globalStatsKey']; + $groupElement['globalStats'] = array(); + + if(in_array($globalStatsKey, $keys)) + { + // get key index of stats used in $includes, $classes, $keys, $icons, $titres, $links + $keyIndex = array_search($globalStatsKey, $keys); + + $classe=$classes[$keyIndex]; + if (isset($boardloaded[$classe]) && is_object($boardloaded[$classe])) + { + $groupElement['globalStats']['total'] = $boardloaded[$classe]->nb[$globalStatsKey]?$boardloaded[$classe]->nb[$globalStatsKey]:0; + $nbTotal = doubleval($groupElement['globalStats']['total']); + if($nbTotal>=10000){ $nbTotal = round($nbTotal/1000 , 2) .'k'; } + $groupElement['globalStats']['text'] = $langs->trans('Total').' : '.$langs->trans($titres[$keyIndex]).' ('.$groupElement['globalStats']['total'].')'; + $groupElement['globalStats']['total'] = $nbTotal; + $groupElement['globalStats']['link'] = $links[$keyIndex]; + } + } + } + $openedDashBoard .= '
' . "\n"; $openedDashBoard .= '
' . "\n"; - $openedDashBoard .= ' ' . "\n"; - $openedDashBoard .= '
' . "\n"; - $openedDashBoard .= ' ' . $groupName . '' . "\n"; + $openedDashBoard.= ' '."\n"; + $openedDashBoard.= ' '."\n"; + + if(!empty($groupElement['globalStats'])){ + $openedDashBoard.= ' '.$nbTotal.''."\n"; + } + + $openedDashBoard.= ' '."\n"; + $openedDashBoard .= '
' . "\n"; + + $openedDashBoard .= ' '.$groupName.'' . "\n"; foreach ($boards as $board) { if (!empty($board->labelShort)) { diff --git a/htdocs/theme/eldy/info-box.inc.php b/htdocs/theme/eldy/info-box.inc.php index 3586d310dfa..34254812848 100644 --- a/htdocs/theme/eldy/info-box.inc.php +++ b/htdocs/theme/eldy/info-box.inc.php @@ -8,6 +8,7 @@ if (! defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?> */ .info-box { display: block; + position: relative; min-height: 90px; background: #fff; width: 100%; @@ -54,6 +55,7 @@ if (! defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?> border-bottom-right-radius: 0; border-bottom-left-radius: 2px; display: block; + overflow: hidden; float: left; height: 90px; width: 90px; @@ -71,6 +73,32 @@ if (! defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?> .info-box-icon > img { max-width: 100%; } +.info-box-icon-text{ + box-sizing: border-box; + display: block; + position: absolute; + width: 90px; + bottom: 0px; + color: #ffffff; + background-color: rgba(0,0,0,0.1); + cursor: default; + + font-size: 10px; + line-height: 15px; + padding: 0px 3px; + text-align: center; + opacity: 0; + -webkit-transition: opacity 0.5s, visibility 0s 0.5s; + transition: opacity 0.5s, visibility 0s 0.5s; +} +.info-box-sm .info-box-icon-text{ + overflow: hidden; + width: 80px; +} +.info-box:hover .info-box-icon-text{ + opacity: 1; +} + .info-box-content { padding: 5px 10px; margin-left: 90px; From 0660229602b642a9b7188b0ee8501a586d856463 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Sun, 22 Sep 2019 10:05:13 +0000 Subject: [PATCH 05/10] Fixing style errors. --- htdocs/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/index.php b/htdocs/index.php index 9151ead38b8..b18ba2cf3be 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -701,7 +701,7 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { { $groupElement['globalStats']['total'] = $boardloaded[$classe]->nb[$globalStatsKey]?$boardloaded[$classe]->nb[$globalStatsKey]:0; $nbTotal = doubleval($groupElement['globalStats']['total']); - if($nbTotal>=10000){ $nbTotal = round($nbTotal/1000 , 2) .'k'; } + if($nbTotal>=10000){ $nbTotal = round($nbTotal/1000, 2) .'k'; } $groupElement['globalStats']['text'] = $langs->trans('Total').' : '.$langs->trans($titres[$keyIndex]).' ('.$groupElement['globalStats']['total'].')'; $groupElement['globalStats']['total'] = $nbTotal; $groupElement['globalStats']['link'] = $links[$keyIndex]; From 9e55fee6e44825e47204bec4d6fc55e35b185b25 Mon Sep 17 00:00:00 2001 From: ATM john Date: Sun, 22 Sep 2019 13:46:11 +0200 Subject: [PATCH 06/10] Prepare global stats replacement --- htdocs/index.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/index.php b/htdocs/index.php index 9151ead38b8..a8158f6e473 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -662,7 +662,7 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { // Show dashboard $nbworkboardempty = 0; - $isIntopOpenedDashBoard = array(); + $isIntopOpenedDashBoard = $globalStatInTopOpenedDashBoard = array(); if (!empty($valid_dashboardlines)) { $openedDashBoard = ''; @@ -716,6 +716,7 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { $openedDashBoard.= ' '."\n"; if(!empty($groupElement['globalStats'])){ + $globalStatInTopOpenedDashBoard[] = $groupElement['globalStats']; $openedDashBoard.= ' '.$nbTotal.''."\n"; } From 1ca531239e44a685b729dffd985d3b3d163fb268 Mon Sep 17 00:00:00 2001 From: Abbes Bahfir Date: Tue, 24 Sep 2019 09:38:16 +0100 Subject: [PATCH 07/10] fix:forgotten test condition --- htdocs/product/stock/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/stock/card.php b/htdocs/product/stock/card.php index 958f03dff2f..cef3d6891e0 100644 --- a/htdocs/product/stock/card.php +++ b/htdocs/product/stock/card.php @@ -636,7 +636,7 @@ else /* * Edition fiche */ - if (($action == 'edit' || $action == 're-edit') && 1) + if ($action == 'edit' || $action == 're-edit') { $langs->trans("WarehouseEdit"); From f4929c5315241b02fb6a9f87a56c9f9662007410 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Wed, 25 Sep 2019 15:24:52 +0200 Subject: [PATCH 08/10] NEW Add fa_icon "tools" for load_fiche_titre --- htdocs/admin/index.php | 2 +- htdocs/core/lib/functions.lib.php | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/admin/index.php b/htdocs/admin/index.php index 9e0acb0ff62..0bf4c6bd235 100644 --- a/htdocs/admin/index.php +++ b/htdocs/admin/index.php @@ -43,7 +43,7 @@ $wikihelp='EN:First_setup|FR:Premiers_paramétrages|ES:Primeras_configuraciones' llxHeader('', $langs->trans("Setup"), $wikihelp); -print load_fiche_titre($langs->trans("SetupArea"), '', 'title_setup.png'); +print load_fiche_titre($langs->trans("SetupArea"), '', 'tools_title'); if (! empty($conf->global->MAIN_MOTD_SETUPPAGE)) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index d234195d8cd..61f07dc3e31 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3015,7 +3015,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ //if (in_array($picto, array('switch_off', 'switch_on', 'off', 'on'))) if (empty($srconly) && in_array($pictowithoutext, array( 'bank', 'close_title', 'delete', 'edit', 'ellipsis-h', 'filter', 'grip', 'grip_title', 'list', 'listlight', 'note', 'off', 'on', 'play', 'playdisabled', 'printer', 'resize', - 'note', 'setup', 'sign-out', 'split', 'switch_off', 'switch_on', 'unlink', 'uparrow', '1downarrow', '1uparrow', '1leftarrow', '1rightarrow', + 'note', 'setup', 'tools_title', 'sign-out', 'split', 'switch_off', 'switch_on', 'unlink', 'uparrow', '1downarrow', '1uparrow', '1leftarrow', '1rightarrow', 'jabber','skype','twitter','facebook','linkedin', 'chevron-left','chevron-right','chevron-down','chevron-top' ) @@ -3029,6 +3029,10 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ $fakey = 'fa-cog'; $fasize = '1.4em'; } + elseif ($pictowithoutext == 'tools_title') { + $fakey = 'fa-tools'; + $fasize = '2.4em'; + } elseif ($pictowithoutext == 'switch_off') { $fakey = 'fa-toggle-off'; $facolor = '#999'; From ffe866f96f96c79ba81433a2b7ba21e8050ba003 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 25 Sep 2019 19:24:07 +0200 Subject: [PATCH 09/10] FIX getObjectSid is only for Active Directory --- htdocs/core/login/functions_ldap.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/htdocs/core/login/functions_ldap.php b/htdocs/core/login/functions_ldap.php index d468c882b2d..2afe2f00340 100644 --- a/htdocs/core/login/functions_ldap.php +++ b/htdocs/core/login/functions_ldap.php @@ -164,9 +164,13 @@ function check_user_password_ldap($usertotest,$passwordtotest,$entitytotest) if ($ldapdebug) print "DEBUG: pwdLastSet = ".dol_print_date($ldap->pwdlastset,'day')."
\n"; if ($ldapdebug) print "DEBUG: badPasswordTime = ".dol_print_date($ldap->badpwdtime,'day')."
\n"; - // On recherche le user dolibarr en fonction de son SID ldap - $sid = $ldap->getObjectSid($login); - if ($ldapdebug) print "DEBUG: sid = ".$sid."
\n"; + // On recherche le user dolibarr en fonction de son SID ldap (only for Active Directory) + $sid = null; + if ($conf->global->LDAP_SERVER_TYPE == "activedirectory") + { + $sid = $ldap->getObjectSid($login); + if ($ldapdebug) print "DEBUG: sid = ".$sid."
\n"; + } $usertmp=new User($db); $resultFetchUser=$usertmp->fetch('',$login,$sid); From 55e340c60b3ccb3b3db487c95f5cc4ddc05141f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 25 Sep 2019 21:47:43 +0200 Subject: [PATCH 10/10] closedir only if $handle is ressource --- htdocs/societe/admin/societe.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/admin/societe.php b/htdocs/societe/admin/societe.php index 82f8c32510e..2e7de3712a6 100644 --- a/htdocs/societe/admin/societe.php +++ b/htdocs/societe/admin/societe.php @@ -477,8 +477,8 @@ foreach ($dirsociete as $dirroot) $arrayofmodules[$file] = $modCodeCompta; } } + closedir($handle); } - closedir($handle); } $arrayofmodules = dol_sort_array($arrayofmodules, 'position');