32require
'../main.inc.php';
33require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
34require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
35require_once DOL_DOCUMENT_ROOT.
'/core/lib/images.lib.php';
36require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
47$langs->loadLangs(array(
"companies",
"other"));
51$action =
GETPOST(
'action',
'aZ09');
57$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
58$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
61if (empty($page) || $page == -1) {
65$offset = $limit * $page;
80 $sortfield =
"position_name";
85if ($id > 0 || !empty($ref)) {
86 $result =
$object->fetch($id, $ref);
93$hookmanager->initHooks(array(
'thirdpartydocument',
'globalcard'));
95$permissiontoadd = $user->hasRight(
'societe',
'creer');
98if ($user->socid > 0) {
100 $socid = $user->socid;
113include DOL_DOCUMENT_ROOT.
'/core/actions_linkedfiles.inc.php';
120$form =
new Form($db);
122$title = $langs->trans(
"ThirdParty").
' - '.$langs->trans(
"Files");
124 $title =
$object->name.
' - '.$langs->trans(
"Files");
126$help_url =
'EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas';
132print
dol_get_fiche_head($head,
'document', $langs->trans(
"ThirdParty"), -1,
'company');
136$filearray =
dol_dir_list($upload_dir,
"files", 0,
'',
'(\.meta|_preview.*\.png)$', $sortfield, (strtolower($sortorder) ==
'desc' ? SORT_DESC : SORT_ASC), 1);
138foreach ($filearray as $key => $file) {
139 $totalsize += $file[
'size'];
142$linkback =
'<a href="'.DOL_URL_ROOT.
'/societe/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
144dol_banner_tab($object,
'socid', $linkback, ($user->socid ? 0 : 1),
'rowid',
'nom');
146print
'<div class="fichecenter">';
148print
'<div class="underbanner clearboth"></div>';
149print
'<table class="border tableforfield centpercent">';
152print
'<tr><td class="titlefield">'.$langs->trans(
'NatureOfThirdParty').
'</td><td>';
158 print
'<tr><td class="titlefield">'.$langs->trans(
'Prefix').
'</td><td colspan="3">'.
$object->prefix_comm.
'</td></tr>';
162 print
'<tr><td class="titlefield">';
163 print $langs->trans(
'CustomerCode').
'</td><td colspan="3">';
165 $tmpcheck =
$object->check_codeclient();
166 if ($tmpcheck != 0 && $tmpcheck != -5) {
167 print
' <span class="error">('.$langs->trans(
"WrongCustomerCode").
')</span>';
173 print
'<tr><td class="titlefield">';
174 print $langs->trans(
'SupplierCode').
'</td><td colspan="3">';
176 $tmpcheck =
$object->check_codefournisseur();
177 if ($tmpcheck != 0 && $tmpcheck != -5) {
178 print
' <span class="error">('.$langs->trans(
"WrongSupplierCode").
')</span>';
184print
'<tr><td class="titlefield">'.$langs->trans(
"NbOfAttachedFiles").
'</td><td colspan="3">'.count($filearray).
'</td></tr>';
187print
'<tr><td>'.$langs->trans(
"TotalSizeOfAttachedFiles").
'</td><td colspan="3">'.
dol_print_size($totalsize, 1, 1).
'</td></tr>';
195$modulepart =
'societe';
196$permissiontoadd = $user->hasRight(
'societe',
'creer');
197$permtoedit = $user->hasRight(
'societe',
'creer');
198$param =
'&id='.$object->id;
199include DOL_DOCUMENT_ROOT.
'/core/tpl/document_actions_post_headers.tpl.php';
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...)
societe_prepare_head(Societe $object)
Return array of tabs to used on pages for third parties cards.
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.
showValueWithClipboardCPButton($valuetocopy, $showonlyonhover=1, $texttoshow='')
Create a button to copy $valuetocopy in the clipboard (for copy and paste feature).
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.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
get_exdir($num, $level, $alpha, $withoutslash, $object, $modulepart='')
Return a path to have a the directory according to object where files are stored.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Returns text escaped for inclusion in HTML alt or title or value tags, or into values of HTML input f...
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
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.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.