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