45if (empty($langs) || !is_object($langs)) {
46 print
"Error, template page can't be called as URL";
50@phan-var-force array<array{name:string,path:string,level1name:string,relativename:string,fullname:string,date:string,size:int,perm:int,type:string,position_name:string,cover:string,keywords:string,acl:string,rowid:int,label:string,share:string}> $filearray
51@phan-var-force ?int<0,1> $permtoedit
52@phan-var-force ?int<0,1> $permission
53@phan-var-force int<0,1> $permissiontoadd
54@phan-var-force ?string $savingdocmask
55@phan-var-force ?string $param
56@phan-var-force CommonObject $object
61if (empty($relativepathwithnofile)) {
62 $relativepathwithnofile =
'';
66if (!isset($permission)) {
67 $permission = $permissiontoadd;
69if (!isset($permtoedit)) {
70 $permtoedit = $permissiontoadd;
81if (in_array($modulepart, array(
'product',
'produit',
'societe',
'user',
'ticket',
'holiday',
'expensereport'))) {
85$reshook = $hookmanager->executeHooks(
'isLinkedDocumentObjectNotMovable', $parameters,
$object);
87 $disablemove = $hookmanager->resArray[
'disablemove'];
94if ($action ==
'deletefile' || $action ==
'deletelink') {
95 $langs->load(
"companies");
96 print $form->formconfirm(
97 $_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&urlfile='.urlencode(
GETPOST(
"urlfile")).
'&linkid='.
GETPOSTINT(
'linkid').(empty($param) ?
'' : $param),
98 $langs->trans(
'DeleteFile'),
99 $langs->trans(
'ConfirmDeleteFile'),
100 'confirm_deletefile',
110if (!isset($savingdocmask) ||
getDolGlobalString(
'MAIN_DISABLE_SUGGEST_REF_AS_PREFIX')) {
114 if (in_array($modulepart, array(
115 'facture_fournisseur',
116 'commande_fournisseur',
144if (empty($formfile) || !is_object($formfile)) {
149$tmparray = $formfile->form_attach_new_file(
150 $_SERVER[
"PHP_SELF"].
'?id='.
$object->id.(empty($withproject) ?
'' :
'&withproject=1').(empty($moreparam) ?
'' : $moreparam),
155 $conf->browser->layout ==
'phone' ? 40 : 60,
170$formToUploadAFile =
'';
173if (is_array($tmparray) && !empty($tmparray)) {
174 $formToUploadAFile = $tmparray[
'formToUploadAFile'];
175 $formToAddALink = $tmparray[
'formToAddALink'];
180$formfile->list_of_documents(
186 $relativepathwithnofile,
202 array(
'afteruploadtitle' => $formToUploadAFile,
'showhideaddbutton' => 1)
210$formfile->listOfLinks(
217 array(
'afterlinktitle' => $formToAddALink,
'showhideaddbutton' => 1)
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
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, $includequotes=0)
Clean a string to use it as a file name.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...