53if (empty($langs) || !is_object($langs)) {
54 print
"Error, template page can't be called as URL";
68@phan-var-force string $action
69@phan-var-force string $modulepart
70@phan-var-force string $upload_dir
71@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
72@phan-var-force ?int<0,1> $permtoedit
73@phan-var-force ?int<0,1> $permission
74@phan-var-force int<0,1> $permissiontoadd
75@phan-var-force ?string $savingdocmask
76@phan-var-force ?string $param
77@phan-var-force CommonObject $object
78@phan-var-force string $sortfield
79@phan-var-force string $sortorder
84if (empty($relativepathwithnofile)) {
85 $relativepathwithnofile =
'';
89if (!isset($permission)) {
90 $permission = $permissiontoadd;
92if (!isset($permtoedit)) {
93 $permtoedit = $permissiontoadd;
104if (in_array($modulepart, array(
'product',
'produit',
'societe',
'user',
'ticket',
'holiday',
'expensereport'))) {
107$parameters = array();
108$reshook = $hookmanager->executeHooks(
'isLinkedDocumentObjectNotMovable', $parameters,
$object);
110 $disablemove = $hookmanager->resArray[
'disablemove'];
117if ($action ==
'deletefile' || $action ==
'deletelink') {
118 $langs->load(
"companies");
119 print $form->formconfirm(
120 $_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&urlfile='.urlencode(
GETPOST(
"urlfile")).
'&linkid='.
GETPOSTINT(
'linkid').(empty($param) ?
'' : $param),
121 $langs->trans(
'DeleteFile'),
122 $langs->trans(
'ConfirmDeleteFile'),
123 'confirm_deletefile',
133if (!isset($savingdocmask) ||
getDolGlobalString(
'MAIN_DISABLE_SUGGEST_REF_AS_PREFIX')) {
137 if (in_array($modulepart, array(
138 'facture_fournisseur',
139 'commande_fournisseur',
167if (empty($formfile) || !is_object($formfile)) {
168 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
173$tmparray = $formfile->form_attach_new_file(
174 $_SERVER[
"PHP_SELF"].
'?id='.
$object->id.(empty($withproject) ?
'' :
'&withproject=1').(empty($moreparam) ?
'' : $moreparam),
179 $conf->browser->layout ==
'phone' ? 40 : 60,
194$formToUploadAFile =
'';
197if (is_array($tmparray) && !empty($tmparray)) {
198 $formToUploadAFile = $tmparray[
'formToUploadAFile'];
199 $formToAddALink = $tmparray[
'formToAddALink'];
205 print
'<div class="fichecenter">';
206 print
'<div class="fichehalfleft">';
210$showHideAddButtonValue = 1;
212 $showHideAddButtonValue = 0;
216$formfile->list_of_documents(
222 $relativepathwithnofile,
238 array(
'afteruploadtitle' => $formToUploadAFile,
'showhideaddbutton' => $showHideAddButtonValue)
243 print
'<div class="fichehalfright">';
249$showHideAddButtonValue = 1;
251 $showHideAddButtonValue = 0;
255$formfile->listOfLinks(
262 array(
'afterlinktitle' => $formToAddALink,
'showhideaddbutton' => $showHideAddButtonValue)
if(! $sortfield) if(! $sortorder) $object
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_sanitizeFileName($str, $newstr='_', $unaccent=1, $includequotes=0, $allowdash=0)
Clean a string to use it as a file name.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
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.