dolibarr  13.0.2
note.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2001-2003,2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3  * Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
4  * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
5  * Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
6  * Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program. If not, see <https://www.gnu.org/licenses/>.
20  */
21 
28 require '../main.inc.php';
29 require_once DOL_DOCUMENT_ROOT.'/core/lib/contact.lib.php';
30 require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
31 
32 $action = GETPOST('action', 'aZ09');
33 
34 // Load translation files required by the page
35 $langs->load("companies");
36 
37 // Security check
38 $id = GETPOST('id', 'int');
39 if ($user->socid) $id = $user->socid;
40 $result = restrictedArea($user, 'contact', $id, 'socpeople&societe');
41 
42 $object = new Contact($db);
43 if ($id > 0) $object->fetch($id);
44 
45 $permissionnote = $user->rights->societe->creer; // Used by the include of actions_setnotes.inc.php
46 
47 
48 /*
49  * Actions
50  */
51 
52 include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not includ_once
53 
54 
55 /*
56  * View
57  */
58 
59 $now = dol_now();
60 
61 $title = (!empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses"));
62 
63 $form = new Form($db);
64 
65 $help_url = 'EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas';
66 llxHeader('', $title, $help_url);
67 
68 if ($id > 0)
69 {
70  /*
71  * Affichage onglets
72  */
73  if (!empty($conf->notification->enabled)) $langs->load("mails");
74 
75  $head = contact_prepare_head($object);
76 
77  print dol_get_fiche_head($head, 'note', $title, -1, 'contact');
78 
79  $linkback = '<a href="'.DOL_URL_ROOT.'/contact/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
80 
81  $morehtmlref = '<div class="refidno">';
82  if (empty($conf->global->SOCIETE_DISABLE_CONTACTS))
83  {
84  $objsoc = new Societe($db);
85  $objsoc->fetch($object->socid);
86  // Thirdparty
87  $morehtmlref .= $langs->trans('ThirdParty').' : ';
88  if ($objsoc->id > 0) $morehtmlref .= $objsoc->getNomUrl(1);
89  else $morehtmlref .= $langs->trans("ContactNotLinkedToCompany");
90  }
91  $morehtmlref .= '</div>';
92 
93  dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref);
94 
95  $cssclass = 'titlefield';
96  //if ($action == 'editnote_public') $cssclass='titlefieldcreate';
97  //if ($action == 'editnote_private') $cssclass='titlefieldcreate';
98 
99  print '<div class="fichecenter">';
100  print '<div class="underbanner clearboth"></div>';
101 
102  print '<table class="border centpercent tableforfield">';
103 
104  // Civility
105  print '<tr><td class="'.$cssclass.'">'.$langs->trans("UserTitle").'</td><td>';
106  print $object->getCivilityLabel();
107  print '</td></tr>';
108 
109  print "</table>";
110 
111 
112  $cssclass = "titlefield";
113  include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php';
114 
115  print '</div>';
116 
118 }
119 
120 llxFooter();
121 $db->close();
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
Class to manage contact/addresses.
dol_now($mode= 'auto')
Return date for now.
llxHeader()
Empty header.
Definition: wrapper.php:45
Class to manage generation of HTML components Only common components must be here.
Class to manage third parties objects (customers, suppliers, prospects...)
contact_prepare_head(Contact $object)
Prepare array with list of tabs.
Definition: contact.lib.php:33
restrictedArea($user, $features, $objectid=0, $tableandshare= '', $feature2= '', $dbt_keyfield= 'fk_soc', $dbt_select= 'rowid', $isdraft=0)
Check permissions of a user to show a page and an object.
dol_get_fiche_head($links=array(), $active= '', $title= '', $notab=0, $picto= '', $pictoisfullpath=0, $morehtmlright= '', $morecss= '', $limittoshow=0, $moretabssuffix= '')
Show tabs of a record.
print
Draft customers invoices.
Definition: index.php:89
dol_get_fiche_end($notab=0)
Return tab footer 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.
llxFooter()
Empty footer.
Definition: wrapper.php:59