From e1c27d54a6bd646e953215cfacaba944cbf3889d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 27 May 2007 03:55:11 +0000 Subject: [PATCH] Modif doxygen pour preparer ajout entree menu depuis module --- htdocs/html.form.class.php | 39 +++++++-- .../menus/barre_top/eldy_backoffice.php | 38 ++++----- .../menus/barre_top/eldy_frontoffice.php | 83 ++++++++++--------- .../includes/modules/modWebcalendar.class.php | 43 +++++++++- htdocs/langs/en_US/admin.lang | 1 + htdocs/langs/fr_FR/admin.lang | 1 + mysql/tables/llx_menu.sql | 4 +- 7 files changed, 137 insertions(+), 72 deletions(-) diff --git a/htdocs/html.form.class.php b/htdocs/html.form.class.php index dc61803ed1d..468cd5543f9 100644 --- a/htdocs/html.form.class.php +++ b/htdocs/html.form.class.php @@ -497,28 +497,55 @@ class Form */ function select_menu($selected='',$htmlname,$dirmenu) { - global $langs; + global $langs,$conf; if ($selected == 'eldy.php') $selected='eldy_backoffice.php'; // Pour compatibilité - - print ''; + ksort($menuarray); + + // Affichage liste deroulante des menus + print ''; } /** diff --git a/htdocs/includes/menus/barre_top/eldy_backoffice.php b/htdocs/includes/menus/barre_top/eldy_backoffice.php index 2885857867c..a3fad4a5f96 100644 --- a/htdocs/includes/menus/barre_top/eldy_backoffice.php +++ b/htdocs/includes/menus/barre_top/eldy_backoffice.php @@ -325,7 +325,25 @@ class MenuTop { print 'atarget?" target=$this->atarget":"").'>'.$langs->trans("OSCommerce").''; } - // Webcal + // Members + if ($conf->adherent->enabled) + { + $langs->load("members"); + + $class=""; + if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "members") + { + $class='class="tmenu" id="sel"'; + } + else + { + $class = 'class="tmenu"'; + } + + print 'atarget?" target=$this->atarget":"").'>'.$langs->trans("Members").''; + } + + // Webcal if ($conf->webcal->enabled) { $langs->load("other"); @@ -364,24 +382,6 @@ class MenuTop { print 'atarget?" target=$this->atarget":"").'>'.$langs->trans("BugTracker").''; } - - // Members - if ($conf->adherent->enabled) - { - $langs->load("members"); - - $class=""; - if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "members") - { - $class='class="tmenu" id="sel"'; - } - else - { - $class = 'class="tmenu"'; - } - - print 'atarget?" target=$this->atarget":"").'>'.$langs->trans("Members").''; - } print ''; diff --git a/htdocs/includes/menus/barre_top/eldy_frontoffice.php b/htdocs/includes/menus/barre_top/eldy_frontoffice.php index a4608642549..575a402e700 100644 --- a/htdocs/includes/menus/barre_top/eldy_frontoffice.php +++ b/htdocs/includes/menus/barre_top/eldy_frontoffice.php @@ -239,47 +239,7 @@ class MenuTop { print 'atarget?" target=$this->atarget":"").'>'.$langs->trans("Tools").''; } - // Webcal - if ($conf->webcal->enabled) - { - $langs->load("other"); - - $class=""; - if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "webcal") - { - $class='class="tmenu" id="sel"'; - } - else - { - $class = 'class="tmenu"'; - } - -// print 'atarget?" target=$this->atarget":"").'>'.$langs->trans("Calendar").''; - } - - // Mantis - if ($conf->mantis->enabled) - { - $langs->load("other"); - - $class=""; - if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "mantis") - { - $class='class="tmenu" id="sel"'; - } - elseif (ereg("^".DOL_URL_ROOT.".*\/mantis",$_SERVER["PHP_SELF"]) || ereg("^".DOL_URL_ROOT."\/mantis\/",$_SERVER["PHP_SELF"])) - { - $class='class="tmenu" id="sel"'; - } - else - { - $class = 'class="tmenu"'; - } - - print 'atarget?" target=$this->atarget":"").'>'.$langs->trans("BugTracker").''; - } - - // Telephonie + // Telephonie if ($conf->telephonie->enabled && $user->rights->telephonie->lire) { $class=""; @@ -330,6 +290,47 @@ class MenuTop { print 'atarget?" target=$this->atarget":"").'>'.$langs->trans("Members").''; } + // Webcal + if ($conf->webcal->enabled) + { + $langs->load("other"); + + $class=""; + if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "webcal") + { + $class='class="tmenu" id="sel"'; + } + else + { + $class = 'class="tmenu"'; + } + +// print 'atarget?" target=$this->atarget":"").'>'.$langs->trans("Calendar").''; + } + + // Mantis + if ($conf->mantis->enabled) + { + $langs->load("other"); + + $class=""; + if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "mantis") + { + $class='class="tmenu" id="sel"'; + } + elseif (ereg("^".DOL_URL_ROOT.".*\/mantis",$_SERVER["PHP_SELF"]) || ereg("^".DOL_URL_ROOT."\/mantis\/",$_SERVER["PHP_SELF"])) + { + $class='class="tmenu" id="sel"'; + } + else + { + $class = 'class="tmenu"'; + } + + print 'atarget?" target=$this->atarget":"").'>'.$langs->trans("BugTracker").''; + } + + print ''; } diff --git a/htdocs/includes/modules/modWebcalendar.class.php b/htdocs/includes/modules/modWebcalendar.class.php index 835601d655b..a89fa25ca57 100644 --- a/htdocs/includes/modules/modWebcalendar.class.php +++ b/htdocs/includes/modules/modWebcalendar.class.php @@ -74,11 +74,11 @@ class modWebcalendar extends DolibarrModules // Data directories to create when module is enabled $this->dirs = array(); - // Config pages + // Config pages. Put here list of php page names stored in admmin directory used to setup module $this->config_page_url = array("webcalendar.php"); // Dependencies - $this->depends = array(); // List of modules id that must be enabled + $this->depends = array(); // List of modules id that must be enabled if this module is enabled $this->requiredby = array(); // List of modules id to disable if this one is disabled // Constants @@ -86,22 +86,57 @@ class modWebcalendar extends DolibarrModules // Boxes $this->boxes = array(); // List of boxes + $r=0; + // Add here list of default box name and php file stored in includes/boxes that + // contains class to show a box. + // Example: + //$this->boxes[$r][0] = "My box"; + //$this->boxes[$r][1] = "mybox.php"; + //$r++; + // Permissions $this->rights_class = 'webcal'; // Permission key $this->rights = array(); // Permission array used by this module - // Example + + // Add here list of permission defined by an id, a label, a boolean and two constant strings. + // Example: // $r++; // $this->rights[$r][0] = 2000; // Permission id (must not be already used) // $this->rights[$r][1] = 'Permision label'; // Permission label // $this->rights[$r][3] = 1; // Permission by default for new user (0/1) // $this->rights[$r][4] = 'level1'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) // $this->rights[$r][5] = 'level2'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) + + $this->rights_class = 'webcal'; // Permission key + $this->rights = array(); // Permission array used by this module + + // Main menu entries + $this->menus = array(); // List of menus to add + $r=0; + + // Example: + // $r++; + // insert into `llx_menu` ( + // menu_handler 'all' // Menu handler name (all to add with all menu handlers) + // type 'top' // Menu top or left + // `mainmenu`, 'webcal' // Name family/module (home, companies, ...) + // `fk_menu`, 0 // 0 or Id of mother menu line + // `order` 10 // Order of entry + // `url`, '/webcal/webcal.php?mainmenu=webcal&leftmenu=' // Relative (or absolute) url to go + // `target`, '' // Target of Url link + // `titre`, 'Calendar' // Key for menu translation + // `langs`, other // Lang file to load for translation + // `level`, -1 // deprecated + // `leftmenu`, '' // Condition to compare to $_REQUEST["leftmenu"] to show or hide menu entry + // `right`, '' // Condition to show enabled or disabled menu entry + // `user`, 0 // 0 if menu for all users, 1 for external only, 2 for internal only + } /** * \brief Function called when module is enabled. - * Add constants, boxes and permissions into Dolibarr database. + * The init function add previous constants, boxes and permissions into Dolibarr database. * It also creates data directories. */ function init() diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 3ecbacbb600..242379efa85 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -3,6 +3,7 @@ Version=Version VersionExperimental=Experimental VersionDevelopment=Development VersionUnknown=Unknown +VersionRecommanded=Recommanded WarningModuleNotActive=Module %s must be enabled DolibarrSetup=Dolibarr setup DolibarrUser=Dolibarr user diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index 0042a793f59..92953af53d1 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -3,6 +3,7 @@ Version=Version VersionExperimental=Expérimental VersionDevelopment=Développement VersionUnknown=Inconnue +VersionRecommanded=Recommandé WarningModuleNotActive=Module %s non actif DolibarrSetup=Installation de Dolibarr DolibarrUser=Utilisateur Dolibarr diff --git a/mysql/tables/llx_menu.sql b/mysql/tables/llx_menu.sql index daf564acc40..a65c86a51e5 100644 --- a/mysql/tables/llx_menu.sql +++ b/mysql/tables/llx_menu.sql @@ -31,7 +31,7 @@ CREATE TABLE `llx_menu` ( `fk_menu` int(11) NOT NULL, -- 0 or Id of mother menu line `order` tinyint(4) NOT NULL, -- Order of entry - `url` varchar(255) NOT NULL, -- Url to go + `url` varchar(255) NOT NULL, -- Relative (or absolute) url to go `target` varchar(100) NULL, -- Target of Url link `titre` varchar(255) NOT NULL, -- Key for menu translation @@ -41,6 +41,6 @@ CREATE TABLE `llx_menu` ( `leftmenu` varchar(100) NULL, -- Condition to show or hide `right` varchar(255), -- Condition to show enabled or disabled - `user` tinyint(4) NOT NULL default '0', -- 0 if menu for all users + `user` tinyint(4) NOT NULL default '0', -- 0 if menu for all users, 1 for external only, 2 for internal only PRIMARY KEY (`rowid`) ) type=innodb;