From a20aab0289818850430ce21186b9c36babc655a8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20Jacob?= Date: Fri, 6 Jun 2008 03:19:58 +0200 Subject: [PATCH] Adds admnistration pages for sub-sectors and functions, and a suitable edition page for them (Closes #830) --- modules/profile.php | 28 +++++++++++++++++++++++----- templates/admin/index.tpl | 40 ++++++++++++++++++++++------------------ 2 files changed, 45 insertions(+), 23 deletions(-) diff --git a/modules/profile.php b/modules/profile.php index 467f11e..b75fbe0 100644 --- a/modules/profile.php +++ b/modules/profile.php @@ -59,6 +59,8 @@ class ProfileModule extends PLModule 'admin/sections' => $this->make_hook('admin_sections', AUTH_MDP, 'admin'), 'admin/secteurs' => $this->make_hook('admin_secteurs', AUTH_MDP, 'admin'), 'admin/trombino' => $this->make_hook('admin_trombino', AUTH_MDP, 'admin'), + 'admin/ss_secteurs' => $this->make_hook('admin_ss_secteurs', AUTH_MDP, 'admin'), + 'admin/fonctions' => $this->make_hook('admin_fonctions', AUTH_MDP, 'admin'), ); } @@ -763,16 +765,32 @@ class ProfileModule extends PLModule } function handler_admin_sections(&$page, $action = 'list', $id = null) { $page->assign('xorg_title','Polytechnique.org - Administration - Sections'); - $page->assign('title', 'Gestion des Sections'); + $page->assign('title', 'Gestion des sections'); $table_editor = new PLTableEditor('admin/sections','sections','id'); $table_editor->describe('text','intitulé',true); $table_editor->apply($page, $action, $id); } + function handler_admin_ss_secteurs(&$page, $action = 'list', $id = null) { + $page->assign('xorg_title', 'Polytechnique.org - Administration - Sous-secteurs'); + $page->assign('title', 'Gestion des sous-secteurs'); + $table_editor = new PLTableEditor('admin/ss_secteurs', 'emploi_ss_secteur', 'id', true); + $table_editor->describe('label', 'intitulé', true); + $table_editor->apply($page, $action, $id); + } + function handler_admin_fonctions(&$page, $action = 'list', $id = null) { + $page->assign('xorg_title', 'Polytechnique.org - Administration - Fonctions'); + $page->assign('title', 'Gestion des fonctions'); + $table_editor = new PLTableEditor('admin/fonctions', 'fonctions_def', 'id', true); + $table_editor->describe('fonction_fr', 'intitulé', true); + $table_editor->describe('fonction_en', 'intitulé (ang)', true); + $table_editor->describe('flags', 'titre', true); + $table_editor->apply($page, $action, $id); + } function handler_admin_secteurs(&$page, $action = 'list', $id = null) { - $page->assign('xorg_title','Polytechnique.org - Administration - Secteurs'); - $page->assign('title', 'Gestion des Secteurs'); - $table_editor = new PLTableEditor('admin/secteurs','emploi_secteur','id'); - $table_editor->describe('label','intitulé',true); + $page->assign('xorg_title', 'Polytechnique.org - Administration - Secteurs'); + $page->assign('title', 'Gestion des secteurs'); + $table_editor = new PLTableEditor('admin/secteurs', 'emploi_secteur', 'id', true); + $table_editor->describe('label', 'intitulé', true); $table_editor->apply($page, $action, $id); } function handler_admin_medals(&$page, $action = 'list', $id = null) { diff --git a/templates/admin/index.tpl b/templates/admin/index.tpl index f2ff716..f6b59cc 100644 --- a/templates/admin/index.tpl +++ b/templates/admin/index.tpl @@ -1,23 +1,23 @@ {**************************************************************************} -{* *} -{* Copyright (C) 2003-2008 Polytechnique.org *} -{* http://opensource.polytechnique.org/ *} -{* *} +{* *} +{* Copyright (C) 2003-2008 Polytechnique.org *} +{* http://opensource.polytechnique.org/ *} +{* *} {* 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 2 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, write to the Free Software *} -{* Foundation, Inc., *} -{* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *} -{* *} +{* the Free Software Foundation; either version 2 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, write to the Free Software *} +{* Foundation, Inc., *} +{* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *} +{* *} {**************************************************************************}

Administration Polytechnique.org

@@ -102,6 +102,10 @@ Sections   |   Secteurs +   |   + Sous-secteurs +   |   + Fonctions @@ -109,7 +113,7 @@ Newsletter :   Liste   |   - Catégories + Catégories -- 2.1.4