dolibarr 20.0.2
expensereport_addfile.tpl.php
1<?php
2
3// Add line to upload new file
4print '<!-- expensereport_addfile.tpl.php -->'."\n";
5print '<tr class="truploadnewfilenow'.(empty($tredited) ? ' oddeven nohover' : ' '.$tredited).'"'.(!getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER') ? ' style="display: none"' : '').'>';
6
7// Num line
8if ($action == 'editline') {
9 print '<td></td>';
10}
11
12// Upload section
13print '<td colspan="'.($action == 'editline' ? $colspan - 1 : $colspan).'">';
14
15$modulepart = 'expensereport';
16$permission = $user->hasRight('expensereport', 'creer');
17
18// We define var to enable the feature to add prefix of uploaded files
19$savingdocmask = '';
20if (!getDolGlobalString('MAIN_DISABLE_SUGGEST_REF_AS_PREFIX')) {
21 //var_dump($modulepart);
22 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'))) {
23 $savingdocmask = dol_sanitizeFileName($object->ref).'-__file__';
24 }
25}
26
27// Show upload form (document and links)
28$formfile->form_attach_new_file(
29 $_SERVER["PHP_SELF"].'?id='.$object->id,
30 'none',
31 0,
32 0,
33 $permission,
34 $conf->browser->layout == 'phone' ? 40 : 60,
35 $object,
36 '',
37 1,
38 $savingdocmask,
39 0,
40 'formuserfile',
41 'accept',
42 '',
43 1
44);
45
46print '</td></tr>';
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
Definition card.php:58
dol_sanitizeFileName($str, $newstr='_', $unaccent=1)
Clean a string to use it as a file name.
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.