dolibarr 22.0.5
expensereport_addfile.tpl.php
1<?php
2/* Copyright (C) 2025 MDW <mdeweerd@users.noreply.github.com>
3 */
4
8'
9@phan-var-force int $colspan
10';
11
12// Add line to upload new file
13print '<!-- expensereport_addfile.tpl.php -->'."\n";
14print '<tr class="truploadnewfilenow'.(empty($tredited) ? ' oddeven nohover' : ' '.$tredited).'"'.(!getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER') ? ' style="display: none"' : '').'>';
15
16// Num line
17if ($action == 'editline') {
18 print '<td></td>';
19}
20
21// Upload section
22print '<td colspan="'.($action == 'editline' ? $colspan - 1 : $colspan).'">';
23
24$modulepart = 'expensereport';
25$permission = $user->hasRight('expensereport', 'creer');
26
27// We define var to enable the feature to add prefix of uploaded files
28$savingdocmask = '';
29if (!getDolGlobalString('MAIN_DISABLE_SUGGEST_REF_AS_PREFIX')) {
30 //var_dump($modulepart);
31 if (in_array($modulepart, array('facture_fournisseur', 'commande_fournisseur', 'facture', 'commande', 'propal', 'supplier_proposal', 'ficheinter', 'contract', 'expedition', 'project', 'project_task', 'expensereport', 'tax', 'produit', 'product_batch'))) {
32 $savingdocmask = dol_sanitizeFileName($object->ref).'-__file__';
33 }
34}
35
36// Show upload form (document and links)
37$formfile->form_attach_new_file(
38 $_SERVER["PHP_SELF"].'?id='.$object->id,
39 'none',
40 0,
41 0,
42 $permission,
43 $conf->browser->layout == 'phone' ? 40 : 60,
44 $object,
45 '',
46 1,
47 $savingdocmask,
48 0,
49 'formuserfile',
50 'accept',
51 '',
52 1
53);
54
55print '</td></tr>';
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
Definition card.php:67
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...
Definition member.php:79