';
} else {
- dol_print_error($db);
-}
+ // Menu with list of bookmarks
+ $sql = "SELECT rowid, title, url, target FROM ".MAIN_DB_PREFIX."bookmark";
+ $sql .= " WHERE (fk_user = ".((int) $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)) {
+ $bookmarkList = '
';
+
+
+ $searchForm .= '';
+ } else {
+ dol_print_error($db);
+ }
+}
// Execute hook printBookmarks
$parameters = array('bookmarks'=>$bookmarkList);
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index 98ba6ca3cc2..56f7c41994b 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -5088,8 +5088,7 @@ class Form
if ($selected) {
$projet = new Project($this->db);
$projet->fetch($selected);
- //print ''.$projet->title.'';
- $out .= $projet->getNomUrl(0, '', 1);
+ $out .= $projet->getNomUrl(1, '', 1);
} else {
$out .= " ";
}
diff --git a/htdocs/core/multicompany_page.php b/htdocs/core/multicompany_page.php
new file mode 100644
index 00000000000..239e5c46392
--- /dev/null
+++ b/htdocs/core/multicompany_page.php
@@ -0,0 +1,147 @@
+
+ *
+ * This file is a modified version of datepicker.php from phpBSM to fix some
+ * bugs, to add new features and to dramatically increase speed.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+/**
+ * \file htdocs/multicompany_page.php
+ * \brief File to return a page with the list of all entities user can switch to
+ */
+
+//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); // Not disabled cause need to load personalized language
+//if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); // Not disabled cause need to load personalized language
+//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1');
+//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); // Not disabled cause need to do translations
+if (!defined('NOCSRFCHECK')) {
+ define('NOCSRFCHECK', 1);
+}
+if (!defined('NOTOKENRENEWAL')) {
+ define('NOTOKENRENEWAL', 1);
+}
+//if (! defined('NOLOGIN')) define('NOLOGIN',1); // Not disabled cause need to load personalized language
+if (!defined('NOREQUIREMENU')) {
+ define('NOREQUIREMENU', 1);
+}
+//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML',1);
+
+require_once '../main.inc.php';
+
+$action = GETPOST('action', 'aZ09');
+$entityid = GETPOST('entity', 'int');
+$backtourl = GETPOST('backtourl');
+if (empty($backtourl)) {
+ $backtourl = DOL_URL_ROOT;
+}
+
+if (GETPOST('lang', 'aZ09')) {
+ $langs->setDefaultLang(GETPOST('lang', 'aZ09')); // If language was forced on URL by the main.inc.php
+}
+
+$langs->load("main");
+
+$right = ($langs->trans("DIRECTION") == 'rtl' ? 'left' : 'right');
+$left = ($langs->trans("DIRECTION") == 'rtl' ? 'right' : 'left');
+
+
+
+/*
+ * Actions
+ */
+
+if (GETPOST('acction', 'aZ') == 'switchentity') {
+ if (is_object($mc)) {
+ $mc->switchEntity($entityid);
+ }
+
+ header("Location: ".$backtourl);
+ exit(0);
+}
+
+
+
+/*
+ * View
+ */
+
+$title = $langs->trans("Multicompanies");
+
+// URL http://mydolibarr/core/multicompany_page?dol_use_jmobile=1 can be used for tests
+$head = ''."\n";
+$arrayofjs = array();
+$arrayofcss = array();
+top_htmlhead($head, $title, 0, 0, $arrayofjs, $arrayofcss);
+
+
+print ''."\n";
+print '