* Copyright (C) 2003 Jean-Louis Bergamo * Copyright (C) 2004-2011 Laurent Destailleur * * 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, see . */ /** * \file htdocs/adherents/admin/adherent_extrafields.php * \ingroup member * \brief Page to setup extra fields of members */ require("../../main.inc.php"); require_once(DOL_DOCUMENT_ROOT."/core/lib/member.lib.php"); require_once(DOL_DOCUMENT_ROOT."/core/class/extrafields.class.php"); $langs->load("members"); $langs->load("admin"); $extrafields = new ExtraFields($db); $form = new Form($db); // List of supported format $type2label=array( 'varchar'=>$langs->trans('String'), 'text'=>$langs->trans('Text'), 'int'=>$langs->trans('Int'), 'date'=>$langs->trans('Date'), 'datetime'=>$langs->trans('DateAndTime') ); $action=GETPOST("action"); $elementtype='member'; if (!$user->admin) accessforbidden(); /* * Actions */ require(DOL_DOCUMENT_ROOT."/core/admin_extrafields.inc.php"); /* * View */ $textobject=$langs->transnoentitiesnoconv("Members"); $help_url='EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros'; llxHeader('',$langs->trans("MembersSetup"),$help_url); $linkback=''.$langs->trans("BackToModuleList").''; print_fiche_titre($langs->trans("MembersSetup"),$linkback,'setup'); $head = member_admin_prepare_head($adh); dol_fiche_head($head, 'attributes', $langs->trans("Member"), 0, 'user'); print $langs->trans("DefineHereComplementaryAttributes",$textobject).'
'."\n"; print '
'; dol_htmloutput_errors($mesg); // Load attribute_label $extrafields->fetch_name_optionals_label($elementtype); print ""; print ''; print ''; print ''; print ''; print ''; print ''; print "\n"; $var=True; foreach($extrafields->attribute_type as $key => $value) { $var=!$var; print ""; print "\n"; print "\n"; print "\n"; print '\n"; print '\n"; print ""; // $i++; } print "
'.$langs->trans("Label").''.$langs->trans("AttributeCode").''.$langs->trans("Type").''.$langs->trans("Size").' 
".$extrafields->attribute_label[$key]."".$key."".$type2label[$extrafields->attribute_type[$key]]."'.$extrafields->attribute_size[$key]."'.img_edit().''; print "  ".img_delete()."
"; dol_fiche_end(); /* * Barre d'actions * */ if ($action != 'create' && $action != 'edit') { print '"; } /* ************************************************************************** */ /* */ /* Creation d'un champ optionnel /* */ /* ************************************************************************** */ if ($action == 'create') { print "
"; print_titre($langs->trans('NewAttribute')); print '
'; print ''; print ''; print ''; // Label print ''; // Code print ''; // Type print ''; // Size print ''; print '
'.$langs->trans("Label").'
'.$langs->trans("AttributeCode").' ('.$langs->trans("AlphaNumOnlyCharsAndNoSpace").')
'.$langs->trans("Type").''; print $form->selectarray('type',$type2label,GETPOST('type')); print '
'.$langs->trans("Size").'
'; print '

  '; print '
'; print "
\n"; } /* ************************************************************************** */ /* */ /* Edition d'un champ optionnel */ /* */ /* ************************************************************************** */ if ($_GET["attrname"] && $action == 'edit') { print "
"; print_titre($langs->trans("FieldEdition",$_GET["attrname"])); /* * formulaire d'edition */ print '
'; print ''; print ''; print ''; print ''; // Label print ''; print ''; print ''; // Code print ''; print ''; print ''; print ''; // Type $type=$extrafields->attribute_type[$_GET["attrname"]]; $size=$extrafields->attribute_size[$_GET["attrname"]]; print ''; print ''; // Size print ''; print '
'.$langs->trans("Label").'
'.$langs->trans("AttributeCode").''.$_GET["attrname"].' 
'.$langs->trans("Type").''; print $type2label[$type]; print ''; print '
'.$langs->trans("Size").'
'; print '

  '; print '
'; print "
"; } $db->close(); llxFooter(); ?>