From 657a3ae4c5bfd5d9f7c8d0f561a87922832e979b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 4 Jul 2019 12:43:32 +0200 Subject: [PATCH 1/3] FIX permission to delete a draft purchase order --- htdocs/fourn/commande/card.php | 2 +- htdocs/modulebuilder/template/myobject_card.php | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index da2930ed667..3e42552a942 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -2516,7 +2516,7 @@ elseif (! empty($object->id)) } // Delete - if ($user->rights->fournisseur->commande->supprimer) + if (! empty($user->rights->fournisseur->commande->supprimer) || ($object->statut == CommandeFournisseur::STATUS_DRAFT && ! empty($user->rights->fournisseur->commande->creer))) { print ''.$langs->trans("Delete").''; } diff --git a/htdocs/modulebuilder/template/myobject_card.php b/htdocs/modulebuilder/template/myobject_card.php index cc2eb5062cb..28c817658f6 100644 --- a/htdocs/modulebuilder/template/myobject_card.php +++ b/htdocs/modulebuilder/template/myobject_card.php @@ -434,7 +434,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print '' . $langs->trans('SendMail') . ''."\n"; // Modify - if ($user->rights->mymodule->write) + if (! empty($user->rights->mymodule->write)) { print ''.$langs->trans("Modify").''."\n"; } @@ -444,7 +444,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } // Clone - if ($user->rights->mymodule->write) + if (! empty($user->rights->mymodule->write)) { print '
' . $langs->trans("ToClone") . '
'; } @@ -463,7 +463,8 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } */ - if ($user->rights->mymodule->delete) + // Delete (need delete permission, or if draft, just need create/modify permission) + if (! empty($user->rights->mymodule->delete) || (! empty($object->fields['status']) && $object->status == $object::STATUS_DRAFT && ! empty($user->rights->mymodule->write))) { print ''.$langs->trans('Delete').''."\n"; } From 512b832c77bd1247cd0684f54b7d77e4aca457bc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 4 Jul 2019 13:26:20 +0200 Subject: [PATCH 2/3] CSS --- htdocs/theme/eldy/global.inc.php | 2 +- htdocs/theme/md/style.css.php | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 15b986d4bff..6f4fd4fa660 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -1349,7 +1349,7 @@ img.photorefnoborder { } .trextrafieldseparator td { /* border-bottom: 2px solid rgb() !important; */ - border-bottom: 2px solid rgb() !important; + border-bottom: 2px dashed rgb() !important; } .tdhrthin { diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 6fd50fa42b3..332b4964a94 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -1562,6 +1562,10 @@ img.photorefnoborder { .underbanner { border-bottom: px solid rgb(); } + +.trextrafieldseparator td { + border-bottom: 1px solid rgb() !important; +} .tdhrthin { margin: 0; padding-bottom: 0 !important; From bfa7f22209ecc36cb4c12bd2b0ab20b742645974 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 22 May 2019 11:53:36 +0200 Subject: [PATCH 3/3] FIX missing "dropdown-icon" replacement --- htdocs/main.inc.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 5456e2ce1eb..4e1a6ecf01d 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1741,7 +1741,7 @@ function top_menu_user(User $user, Translate $langs) $userImage = Form::showphoto('userphoto', $user, 0, 0, 0, 'photouserphoto userphoto', 'small', 0, 1); $userDropDownImage = Form::showphoto('userphoto', $user, 0, 0, 0, 'dropdown-user-image', 'small', 0, 1); } - else{ + else { $nophoto='/public/theme/common/user_anonymous.png'; if ($user->gender == 'man') $nophoto='/public/theme/common/user_man.png'; if ($user->gender == 'woman') $nophoto='/public/theme/common/user_woman.png'; @@ -1755,7 +1755,7 @@ function top_menu_user(User $user, Translate $langs) $dropdownBody.= '
'; // login infos - if (!empty($user->admin)) { + if (! empty($user->admin)) { $dropdownBody.= '
' . $langs->trans("Administrator").': '.yn($user->admin); } if (! empty($user->socid)) // Add thirdparty for external users @@ -1808,7 +1808,7 @@ function top_menu_user(User $user, Translate $langs) $profilName = $user->getFullName($langs).' ('.$user->login.')'; - if($user->admin){ + if (! empty($user->admin)) { $profilName = ' '.$profilName; } @@ -1868,6 +1868,8 @@ function top_menu_user(User $user, Translate $langs) if (!$(event.target).closest("#topmenu-login-dropdown").length) { // Hide the menus. $("#topmenu-login-dropdown").removeClass("open"); + $("#dropdown-icon-down").show(); // use show/hide instead toggle for avoid conflict + $("#dropdown-icon-up").hide(); // use show/hide instead toggle for avoid conflict } });