* Copyright (C) 2002-2003 Jean-Louis Bergamo * Copyright (C) 2007-2012 Laurent Destailleur * Copyright (C) 2012 Regis Houssin * * 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/public/members/public_card.php * \ingroup member * \brief File to show a public card of a member */ define("NOLOGIN",1); // This means this output page does not require to be logged. define("NOCSRFCHECK",1); // We accept to go on this page from external web site. // For MultiCompany module. // Do not use GETPOST here, function is not defined and define must be done before including main.inc.php // TODO This should be useless. Because entity must be retreive from object ref and not from url. $entity=(! empty($_GET['entity']) ? (int) $_GET['entity'] : (! empty($_POST['entity']) ? (int) $_POST['entity'] : 1)); if (is_numeric($entity)) define("DOLENTITY", $entity); require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; // Security check if (empty($conf->adherent->enabled)) accessforbidden('',0,0,1); $langs->load("main"); $langs->load("members"); $langs->load("companies"); $langs->load("other"); $id=GETPOST('id','int'); $object = new Adherent($db); $extrafields = new ExtraFields($db); /* * Actions */ // None /* * View */ $morehead=''; if (! empty($conf->global->MEMBER_PUBLIC_CSS)) $morehead=''; else $morehead=''; llxHeaderVierge($langs->trans("MemberCard"), $morehead); // fetch optionals attributes and labels $extralabels=$extrafields->fetch_name_optionals_label('adherent'); if ($id > 0) { $res=$object->fetch($id); if ($res < 0) { dol_print_error($db,$object->error); exit; } $res=$object->fetch_optionals($object->id,$extralabels); print_fiche_titre($langs->trans("MemberCard"), '', ''); if (empty($object->public)) { print $langs->trans("ErrorThisMemberIsNotPublic"); } else { print ''; print '\n"; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; if (isset($object->photo) && $object->photo !='') { $form = new Form($db); print ''."\n"; } // foreach($objecto->attribute_label as $key=>$value){ // print "\n"; // } print ''; print '
'.$langs->trans("Type").''.$object->type."
'.$langs->trans("Person").''.$object->morphy.'
'.$langs->trans("Firstname").''.$object->firstname.' 
'.$langs->trans("Lastname").''.$object->lastname.' 
'.$langs->trans("Company").''.$object->societe.' 
'.$langs->trans("Address").''.nl2br($object->address).' 
'.$langs->trans("Zip").' '.$langs->trans("Town").''.$object->zip.' '.$object->town.' 
'.$langs->trans("Country").''.$object->country.' 
'.$langs->trans("EMail").''.$object->email.' 
'.$langs->trans("Birthday").''.$object->birth.' 
URL Photo'; print $form->showphoto('memberphoto', $object, 64); print '
$value".$object->array_options["options_$key"]." 
'.$langs->trans("Comments").''.nl2br($object->note).'
'; } } llxFooterVierge(); $db->close(); /** * Show header for card member * * @param string $title Title * @param string $head More info into header * @return void */ function llxHeaderVierge($title, $head = "") { global $user, $conf, $langs; header("Content-type: text/html; charset=".$conf->file->character_set_client); print "\n"; print "\n"; print "".$title."\n"; if ($head) print $head."\n"; print "\n"; print ''."\n"; } /** * Show footer for card member * * @return void */ function llxFooterVierge() { printCommonFooter('public'); print "\n"; print "\n"; }