28require
'../main.inc.php';
29require_once DOL_DOCUMENT_ROOT.
'/contact/class/contact.class.php';
30require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
31require_once DOL_DOCUMENT_ROOT.
'/core/lib/images.lib.php';
32require_once DOL_DOCUMENT_ROOT.
'/core/lib/contact.lib.php';
33require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
36$langs->loadLangs(array(
'other',
'companies',
'contact'));
40$action =
GETPOST(
'action',
'aZ09');
41$confirm =
GETPOST(
'confirm',
'alpha');
50 require_once DOL_DOCUMENT_ROOT.
'/core/class/canvas.class.php';
51 $objcanvas =
new Canvas($db, $action);
52 $objcanvas->getCanvas(
'contact',
'contactcard', $canvas);
57$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
58$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
60if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
64$offset = $limit * $page;
87$modulepart =
'contact';
90$hookmanager->initHooks(array(
'contactdocument'));
94 $socid = $user->socid;
96$result =
restrictedArea($user,
'contact', $id,
'socpeople&societe',
'',
'',
'rowid', 0);
98$permissiontoadd = $user->hasRight(
'societe',
'contact',
'creer');
105include DOL_DOCUMENT_ROOT.
'/core/actions_linkedfiles.inc.php';
112$form =
new Form($db);
114$title = $langs->trans(
"ContactLinkedFiles");
118$help_url =
'EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas';
120llxHeader(
'', $title, $help_url,
'', 0, 0,
'',
'',
'',
'mod-societe page-contact-card_documents');
124 $title = (
getDolGlobalString(
'SOCIETE_ADDRESSES_MANAGEMENT') ? $langs->trans(
"Contacts") : $langs->trans(
"ContactsAddresses"));
130 $filearray =
dol_dir_list($upload_dir,
"files", 0,
'',
'(\.meta|_preview.*\.png)$', $sortfield, (strtolower($sortorder) ==
'desc' ? SORT_DESC : SORT_ASC), 1);
132 foreach ($filearray as $key => $file) {
133 $totalsize += $file[
'size'];
136 $linkback =
'<a href="'.DOL_URL_ROOT.
'/contact/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
138 $morehtmlref =
'<a href="'.DOL_URL_ROOT.
'/contact/vcard.php?id='.
$object->id.
'" class="refid">';
139 $morehtmlref .=
img_picto($langs->trans(
"Download").
' '.$langs->trans(
"VCard"),
'vcard.png',
'class="valignmiddle marginleftonly paddingrightonly"');
140 $morehtmlref .=
'</a>';
142 $morehtmlref .=
'<div class="refidno">';
145 $objsoc->fetch(
$object->socid);
147 if ($objsoc->id > 0) {
148 $morehtmlref .= $objsoc->getNomUrl(1);
150 $morehtmlref .=
'<span class="opacitymedium">'.$langs->trans(
"ContactNotLinkedToCompany").
'</span>';
153 $morehtmlref .=
'</div>';
155 dol_banner_tab($object,
'id', $linkback, 1,
'rowid',
'ref', $morehtmlref);
157 print
'<div class="fichecenter">';
159 print
'<div class="underbanner clearboth"></div>';
160 print
'<table class="border tableforfield centpercent">';
183 print
'<tr><td class="titlefield">'.$langs->trans(
"UserTitle").
'</td><td colspan="3">';
184 print
$object->getCivilityLabel();
187 print
'<tr><td>'.$langs->trans(
"NbOfAttachedFiles").
'</td><td colspan="3">'.count($filearray).
'</td></tr>';
188 print
'<tr><td>'.$langs->trans(
"TotalSizeOfAttachedFiles").
'</td><td colspan="3">'.
dol_print_size($totalsize, 1, 1).
'</td></tr>';
195 $modulepart =
'contact';
196 $permissiontoadd = $user->hasRight(
'societe',
'contact',
'creer');
197 $permtoedit = $user->hasRight(
'societe',
'contact',
'creer');
198 $param =
'&id='.$object->id;
199 include DOL_DOCUMENT_ROOT.
'/core/tpl/document_actions_post_headers.tpl.php';
201 print $langs->trans(
"ErrorUnknown");
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Class to manage third parties objects (customers, suppliers, prospects...)
dol_dir_list($utf8_path, $types="all", $recursive=0, $filter="", $excludefilter=null, $sortcriteria="name", $sortorder=SORT_ASC, $mode=0, $nohook=0, $relativename="", $donotfollowsymlinks=0, $nbsecondsold=0)
Scan a directory and return a list of files/directories.
dol_print_size($size, $shortvalue=0, $shortunit=0)
Return string with formatted size.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0)
Show tabs of a record.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_sanitizeFileName($str, $newstr='_', $unaccent=1)
Clean a string to use it as a file name.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $mode=0)
Check permissions of a user to show a page and an object.