From 75877ce4ae94fd26b9bd396d1bdc5a413db62f95 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 15 Sep 2007 22:42:19 +0000 Subject: [PATCH] Debut module gestion noms de domaines --- htdocs/domain/index.php | 17 +++++++----- .../menus/barre_left/eldy_backoffice.php | 7 +++++ .../menus/barre_left/eldy_frontoffice.php | 8 ++++++ htdocs/includes/modules/modDomain.class.php | 26 ++++++++++++++----- htdocs/main.inc.php | 6 ++++- 5 files changed, 51 insertions(+), 13 deletions(-) diff --git a/htdocs/domain/index.php b/htdocs/domain/index.php index fa3d0f2d935..830e8638463 100644 --- a/htdocs/domain/index.php +++ b/htdocs/domain/index.php @@ -1,5 +1,6 @@ + * Copyright (C) 2007 Laurent Destailleur * * $Id$ * $Source$ @@ -17,23 +18,27 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * */ require("./pre.inc.php"); + +/* + * Affichage + */ + llxHeader(); - -print_titre("Noms de domaines internet"); - - $sql = "SELECT label "; $sql .= " FROM ".MAIN_DB_PREFIX."domain ORDER BY label ASC"; $result = $db->query($sql); -if ($result) { +if ($result) +{ + $num = $db->num_rows($result); + + print_barre_liste($langs->trans("DomainNames"), $page, "liste.php","",$sortfield,$sortorder,"",$num); print "
"; print ""; diff --git a/htdocs/includes/menus/barre_left/eldy_backoffice.php b/htdocs/includes/menus/barre_left/eldy_backoffice.php index 95cedaab259..89281b53b6c 100644 --- a/htdocs/includes/menus/barre_left/eldy_backoffice.php +++ b/htdocs/includes/menus/barre_left/eldy_backoffice.php @@ -724,6 +724,13 @@ class MenuLeft { $newmenu->add_submenu(DOL_URL_ROOT."/exports/export.php?leftmenu=export",$langs->trans("NewExport"),1, $user->rights->export->creer); } + if ($conf->global->MAIN_MODULE_DOMAIN) + { + $langs->load("domains"); + $newmenu->add_submenu(DOL_URL_ROOT."/domain/index.php?leftmenu=export",$langs->trans("DomainNames"),0, $user->rights->domain->read); + $newmenu->add_submenu(DOL_URL_ROOT."/domain/fiche.php?action=create&leftmenu=export",$langs->trans("NewDomain"),1, $user->rights->domain->create); + $newmenu->add_submenu(DOL_URL_ROOT."/domain/index.php?leftmenu=export",$langs->trans("List"),1, $user->rights->domain->read); + } } /* diff --git a/htdocs/includes/menus/barre_left/eldy_frontoffice.php b/htdocs/includes/menus/barre_left/eldy_frontoffice.php index 00210c9cba1..87f8f61e9bf 100644 --- a/htdocs/includes/menus/barre_left/eldy_frontoffice.php +++ b/htdocs/includes/menus/barre_left/eldy_frontoffice.php @@ -710,6 +710,14 @@ class MenuLeft { $newmenu->add_submenu(DOL_URL_ROOT."/exports/index.php?leftmenu=export",$langs->trans("FormatedExport"),0, $user->rights->export->lire); $newmenu->add_submenu(DOL_URL_ROOT."/exports/export.php?leftmenu=export",$langs->trans("NewExport"),1, $user->rights->export->creer); } + + if ($conf->global->MAIN_MODULE_DOMAIN) + { + $langs->load("domains"); + $newmenu->add_submenu(DOL_URL_ROOT."/domain/index.php?leftmenu=export",$langs->trans("DomainNames"),0, $user->rights->domain->read); + $newmenu->add_submenu(DOL_URL_ROOT."/domain/fiche.php?action=create&leftmenu=export",$langs->trans("NewDomain"),1, $user->rights->domain->create); + $newmenu->add_submenu(DOL_URL_ROOT."/domain/index.php?leftmenu=export",$langs->trans("List"),1, $user->rights->domain->read); + } } /* diff --git a/htdocs/includes/modules/modDomain.class.php b/htdocs/includes/modules/modDomain.class.php index 080f2d2085a..aeb6257a5a0 100644 --- a/htdocs/includes/modules/modDomain.class.php +++ b/htdocs/includes/modules/modDomain.class.php @@ -86,12 +86,26 @@ class modDomain extends DolibarrModules $this->rights_class = 'domain'; $r=0; - // $this->rights[$r][0] Id permission (unique tous modules confondus) - // $this->rights[$r][1] Libellé par défaut si traduction de clé "PermissionXXX" non trouvée (XXX = Id permission) - // $this->rights[$r][2] Non utilisé - // $this->rights[$r][3] 1=Permis par defaut, 0=Non permis par defaut - // $this->rights[$r][4] Niveau 1 pour nommer permission dans code - // $this->rights[$r][5] Niveau 2 pour nommer permission dans code + $r++; + $this->rights[$r][0] = 1301; + $this->rights[$r][1] = 'Read domain names'; + $this->rights[$r][2] = 'r'; + $this->rights[$r][3] = 1; + $this->rights[$r][4] = 'read'; + + $r++; + $this->rights[$r][0] = 1302; + $this->rights[$r][1] = 'Create/modify domain names'; + $this->rights[$r][2] = 'w'; + $this->rights[$r][3] = 0; + $this->rights[$r][4] = 'create'; + + $r++; + $this->rights[$r][0] = 1303; + $this->rights[$r][1] = 'Delete domain names'; + $this->rights[$r][2] = 'd'; + $this->rights[$r][3] = 0; + $this->rights[$r][4] = 'delete'; // Exports //-------- diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 5cea1c2d9e2..49782b3e036 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -958,7 +958,11 @@ function llxFooter($foot='',$limitIEbug=1) if (function_exists("memory_get_usage")) { print ' - Memory usage: '.memory_get_usage(); - } + } + if (function_exists("zend_loader_file_encoded")) + { + print ' - Zend encoded file: '.(zend_loader_file_encoded()?'yes':'no'); + } print '"'; print "\n"; }