dolibarr  7.0.0-beta
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@capnetworks.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 <http://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 $langs->load("companies");
35 
36 // Security check
37 $id = GETPOST('id','int');
38 if ($user->societe_id) $id=$user->societe_id;
39 $result = restrictedArea($user, 'contact', $id, 'socpeople&societe');
40 
41 $object = new Contact($db);
42 if ($id > 0) $object->fetch($id);
43 
44 $permissionnote=$user->rights->societe->creer; // Used by the include of actions_setnotes.inc.php
45 
46 
47 /*
48  * Actions
49  */
50 
51 include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not includ_once
52 
53 
54 /*
55  * View
56  */
57 
58 $now=dol_now();
59 
60 $title = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses"));
61 
62 $form = new Form($db);
63 
64 $help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas';
65 llxHeader('', $title, $help_url);
66 
67 if ($id > 0)
68 {
69  /*
70  * Affichage onglets
71  */
72  if (! empty($conf->notification->enabled)) $langs->load("mails");
73 
74  $head = contact_prepare_head($object);
75 
76  dol_fiche_head($head, 'note', $title, -1, 'contact');
77 
78  $linkback = '<a href="'.DOL_URL_ROOT.'/contact/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
79 
80  $morehtmlref='<div class="refidno">';
81  if (empty($conf->global->SOCIETE_DISABLE_CONTACTS))
82  {
83  $objsoc=new Societe($db);
84  $objsoc->fetch($object->socid);
85  // Thirdparty
86  $morehtmlref.=$langs->trans('ThirdParty') . ' : ';
87  if ($objsoc->id > 0) $morehtmlref.=$objsoc->getNomUrl(1);
88  else $morehtmlref.=$langs->trans("ContactNotLinkedToCompany");
89  }
90  $morehtmlref.='</div>';
91 
92  dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref);
93 
94  $cssclass='titlefield';
95  //if ($action == 'editnote_public') $cssclass='titlefieldcreate';
96  //if ($action == 'editnote_private') $cssclass='titlefieldcreate';
97 
98  print '<div class="fichecenter">';
99  print '<div class="underbanner clearboth"></div>';
100 
101  print '<table class="border centpercent">';
102 
103  // Civility
104  print '<tr><td class="'.$cssclass.'">'.$langs->trans("UserTitle").'</td><td>';
105  print $object->getCivilityLabel();
106  print '</td></tr>';
107 
108  print "</table>";
109 
110 
111  $cssclass="titlefield";
112  include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php';
113 
114  print '</div>';
115 
116  dol_fiche_end();
117 }
118 
119 llxFooter();
120 $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.
Class to manage contact/addresses.
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.
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.
Class to manage third parties objects (customers, suppliers, prospects...)
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.
contact_prepare_head(Contact $object)
Prepare array with list of tabs.
Definition: contact.lib.php:33
llxHeader()
Empty header.
Definition: wrapper.php:46
dol_now($mode='gmt')
Return date for now.
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.