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',
168if (empty($formfile) || !is_object($formfile)) {
169 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
174$tmparray = $formfile->form_attach_new_file(
175 $_SERVER[
"PHP_SELF"].
'?id='.
$object->id.(empty($withproject) ?
'' :
'&withproject=1').(empty($moreparam) ?
'' : $moreparam),
180 $conf->browser->layout ==
'phone' ? 40 : 60,
195$formToUploadAFile =
'';
198if (is_array($tmparray) && !empty($tmparray)) {
199 $formToUploadAFile = $tmparray[
'formToUploadAFile'];
200 $formToAddALink = $tmparray[
'formToAddALink'];
206 print
'<div class="fichecenter">';
207 print
'<div class="fichehalfleft">';
211$showHideAddButtonValue = 1;
213 $showHideAddButtonValue = 0;
217$formfile->list_of_documents(
223 $relativepathwithnofile,
239 array(
'afteruploadtitle' => $formToUploadAFile,
'showhideaddbutton' => $showHideAddButtonValue)
244 print
'<div class="fichehalfright">';
250$showHideAddButtonValue = 1;
252 $showHideAddButtonValue = 0;
256$formfile->listOfLinks(
263 array(
'afterlinktitle' => $formToAddALink,
'showhideaddbutton' => $showHideAddButtonValue)
if(! $sortfield) if(! $sortorder) $object
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $conf
The main.inc.php has been included so the following variable are now defined:
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, $nodefault=0)
Return value of a param into GET or POST supervariable.
GETPOSTINT($paramname, $method=0, $nodefault=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.