* Copyright (C) 2013 Florian Henry * * 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/categories/admin/categorie.php * \ingroup categories * \brief Categorie admin pages */ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/categories.lib.php'; if (!$user->admin) accessforbidden(); $langs->load("categories"); $action=GETPOST("action"); /* * Actions */ if (preg_match('/set_(.*)/',$action,$reg)) { $code=$reg[1]; if (dolibarr_set_const($db, $code, 1, 'chaine', 0, '', $conf->entity) > 0) { header("Location: ".$_SERVER["PHP_SELF"]); exit; } else { setEventMessage($db->lasterror(),'errors'); } } if (preg_match('/del_(.*)/',$action,$reg)) { $code=$reg[1]; if (dolibarr_del_const($db, $code, $conf->entity) > 0) { header("Location: ".$_SERVER["PHP_SELF"]); exit; } else { setEventMessage($db->lasterror(),'errors'); } } /* * View */ $help_url='EN:Module Categories|FR:Module Catégories|ES:Módulo Categorías'; $linkback=''.$langs->trans("BackToModuleList").''; llxHeader('',$langs->trans("Categories"),$help_url); print_fiche_titre($langs->trans("CategoriesSetup"),'','setup'); $head=categoriesadmin_prepare_head(); dol_fiche_head($head, 'setup', $langs->trans("Categories"), 0, 'category'); print ''; print ''; print ''; print ''; print ''."\n"; print ''; $var=true; $form = new Form($db); // Mail required for members $var=!$var; print ''; print ''; print ''; print ''; print '
'.$langs->trans("Description").' '.$langs->trans("Value").'
'.$langs->trans("CategorieRecursiv").''. $form->textwithpicto('',$langs->trans("CategorieRecursivHelp"),1,'help').''; if ($conf->use_javascript_ajax) { print ajax_constantonoff('CATEGORIE_RECURSIV_ADD'); } else { if($conf->global->CATEGORIE_RECURSIV_ADD == 0) { print ''.img_picto($langs->trans("Disabled"),'off').''; } else if($conf->global->CATEGORIE_RECURSIV_ADD == 1) { print ''.img_picto($langs->trans("Enabled"),'on').''; } } print '
'; $db->close(); llxFooter();