dolibarr  7.0.0-beta
note.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3  * Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
4  * Copyright (C) 2015 Frederic France <frederic.france@free.fr>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program. If not, see <http://www.gnu.org/licenses/>.
18  */
19 
26 require '../main.inc.php';
27 require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
28 require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
29 require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
30 
31 $langs->load("companies");
32 $langs->load("members");
33 $langs->load("bills");
34 
35 $action=GETPOST('action','alpha');
36 $id=GETPOST('id','int');
37 
38 // Security check
39 $result=restrictedArea($user,'adherent',$id);
40 
41 $object = new Adherent($db);
42 $result=$object->fetch($id);
43 if ($result > 0)
44 {
45  $adht = new AdherentType($db);
46  $result=$adht->fetch($object->typeid);
47 }
48 
49 $permissionnote=$user->rights->adherent->creer; // Used by the include of actions_setnotes.inc.php
50 
51 /*
52  * Actions
53  */
54 
55 include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once
56 
57 
58 
59 /*
60  * View
61  */
62 $title=$langs->trans("Member") . " - " . $langs->trans("Note");
63 $helpurl="EN:Module_Foundations|FR:Module_Adh&eacute;rents|ES:M&oacute;dulo_Miembros";
64 llxHeader("",$title,$helpurl);
65 
66 $form = new Form($db);
67 
68 if ($id)
69 {
70  $head = member_prepare_head($object);
71 
72  dol_fiche_head($head, 'note', $langs->trans("Member"), -1, 'user');
73 
74  print "<form method=\"post\" action=\"".$_SERVER['PHP_SELF']."\">";
75  print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
76 
77  $linkback = '<a href="'.DOL_URL_ROOT.'/adherents/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
78 
79  dol_banner_tab($object, 'rowid', $linkback);
80 
81  print '<div class="fichecenter">';
82 
83  print '<div class="underbanner clearboth"></div>';
84  print '<table class="border centpercent">';
85 
86  // Login
87  if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED))
88  {
89  print '<tr><td class="titlefield">'.$langs->trans("Login").' / '.$langs->trans("Id").'</td><td class="valeur">'.$object->login.'&nbsp;</td></tr>';
90  }
91 
92  // Type
93  print '<tr><td>'.$langs->trans("Type").'</td><td class="valeur">'.$adht->getNomUrl(1)."</td></tr>\n";
94 
95  // Morphy
96  print '<tr><td class="titlefield">'.$langs->trans("Nature").'</td><td class="valeur" >'.$object->getmorphylib().'</td>';
97  /*print '<td rowspan="'.$rowspan.'" align="center" valign="middle" width="25%">';
98  print $form->showphoto('memberphoto',$member);
99  print '</td>';*/
100  print '</tr>';
101 
102  // Company
103  print '<tr><td>'.$langs->trans("Company").'</td><td class="valeur">'.$object->societe.'</td></tr>';
104 
105  // Civility
106  print '<tr><td>'.$langs->trans("UserTitle").'</td><td class="valeur">'.$object->getCivilityLabel().'&nbsp;</td>';
107  print '</tr>';
108 
109  print "</table>";
110 
111  print '</div>';
112 
113 
114  $cssclass='titlefield';
115  $permission = $user->rights->adherent->creer; // Used by the include of notes.tpl.php
116  include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php';
117 
118 
119  dol_fiche_end();
120 
121 }
122 
123 
124 llxFooter();
125 $db->close();
llxFooter()
Empty footer.
Definition: wrapper.php:58
dol_fiche_head($links=array(), $active='0', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='')
Show tab header of a card.
dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='rowid', $fieldref='ref', $morehtmlref='', $moreparam='', $nodbprefix=0, $morehtmlleft='', $morehtmlstatus='', $onlybanner=0, $morehtmlright='')
Show tab footer of a card.
member_prepare_head(Adherent $object)
Return array head with list of tabs to view object informations.
Definition: member.lib.php:33
if(empty($reshook)) $form
View.
Definition: perms.php:103
GETPOST($paramname, $check='none', $method=0, $filter=NULL, $options=NULL, $noreplace=0)
Return value of a param into GET or POST supervariable.
Class to manage generation of HTML components Only common components must be here.
if($_POST["cancel"]==$langs->trans("Cancel")&&!$id) if($action== 'setdatev'&&$user->rights->tax->charges->creer) if($action== 'add'&&$_POST["cancel"]<> $langs->trans("Cancel")) if($action== 'delete') $title
Actions.
Definition: card.php:183
dol_fiche_end($notab=0)
Show tab footer of a card.
Class to manage members of a foundation.
llxHeader()
Empty header.
Definition: wrapper.php:46
Class to manage members type.
print
Draft customers invoices.
Definition: index.php:91
restrictedArea($user, $features, $objectid=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $objcanvas=null)
Check permissions of a user to show a page and an object.