diff --git a/htdocs/bookmarks/admin/bookmark.php b/htdocs/bookmarks/admin/bookmark.php index 9aa1989fa2e..c049d4af16f 100644 --- a/htdocs/bookmarks/admin/bookmark.php +++ b/htdocs/bookmarks/admin/bookmark.php @@ -28,20 +28,21 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; // Load translation files required by the page $langs->load("admin"); -if (!$user->admin) -accessforbidden(); +if (!$user->admin) { + accessforbidden(); +} $action = GETPOST('action', 'aZ09'); -if ($action == 'setvalue') -{ +if ($action == 'setvalue') { $showmenu = GETPOST('BOOKMARKS_SHOW_IN_MENU', 'alpha'); $res = dolibarr_set_const($db, "BOOKMARKS_SHOW_IN_MENU", $showmenu, 'chaine', 0, '', $conf->entity); - if (!$res > 0) $error++; + if (!$res > 0) { + $error++; + } - if (!$error) - { + if (!$error) { $db->commit(); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { diff --git a/htdocs/bookmarks/bookmarks.lib.php b/htdocs/bookmarks/bookmarks.lib.php index 63a95fed4c0..ffd1673ac63 100644 --- a/htdocs/bookmarks/bookmarks.lib.php +++ b/htdocs/bookmarks/bookmarks.lib.php @@ -38,20 +38,23 @@ function printDropdownBookmarksList() $url = $_SERVER["PHP_SELF"]; - if (!empty($_SERVER["QUERY_STRING"])) - { + if (!empty($_SERVER["QUERY_STRING"])) { $url .= (dol_escape_htmltag($_SERVER["QUERY_STRING"]) ? '?'.dol_escape_htmltag($_SERVER["QUERY_STRING"]) : ''); } else { global $sortfield, $sortorder; $tmpurl = ''; // No urlencode, all param $url will be urlencoded later - if ($sortfield) $tmpurl .= ($tmpurl ? '&' : '').'sortfield='.$sortfield; - if ($sortorder) $tmpurl .= ($tmpurl ? '&' : '').'sortorder='.$sortorder; - if (is_array($_POST)) - { - foreach ($_POST as $key => $val) - { - if (preg_match('/^search_/', $key) && $val != '') $tmpurl .= ($tmpurl ? '&' : '').$key.'='.$val; + if ($sortfield) { + $tmpurl .= ($tmpurl ? '&' : '').'sortfield='.$sortfield; + } + if ($sortorder) { + $tmpurl .= ($tmpurl ? '&' : '').'sortorder='.$sortorder; + } + if (is_array($_POST)) { + foreach ($_POST as $key => $val) { + if (preg_match('/^search_/', $key) && $val != '') { + $tmpurl .= ($tmpurl ? '&' : '').$key.'='.$val; + } } } $url .= ($tmpurl ? '?'.$tmpurl : ''); @@ -68,8 +71,7 @@ function printDropdownBookmarksList() // Url to go on create new bookmark page $newbtn = ''; - if (!empty($user->rights->bookmark->creer)) - { + if (!empty($user->rights->bookmark->creer)) { //$urltoadd=DOL_URL_ROOT.'/bookmarks/card.php?action=create&urlsource='.urlencode($url).'&url='.urlencode($url); $urltoadd = DOL_URL_ROOT.'/bookmarks/card.php?action=create&url='.urlencode($url); $newbtn .= ''; @@ -81,13 +83,11 @@ function printDropdownBookmarksList() $sql .= " WHERE (fk_user = ".$user->id." OR fk_user is NULL OR fk_user = 0)"; $sql .= " AND entity IN (".getEntity('bookmarks').")"; $sql .= " ORDER BY position"; - if ($resql = $db->query($sql)) - { + if ($resql = $db->query($sql)) { if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { $bookmarkList = '