expensereport_addfile.tpl.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. // Num line
  6. if ($action == 'editline') {
  7. print '<td></td>';
  8. }
  9. // Upload section
  10. print '<td colspan="'.($action == 'editline' ? $colspan - 1 : $colspan).'">';
  11. $modulepart = 'expensereport';
  12. $permission = $user->rights->expensereport->creer;
  13. // We define var to enable the feature to add prefix of uploaded files
  14. $savingdocmask = '';
  15. if (empty($conf->global->MAIN_DISABLE_SUGGEST_REF_AS_PREFIX)) {
  16. //var_dump($modulepart);
  17. 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'))) {
  18. $savingdocmask = dol_sanitizeFileName($object->ref).'-__file__';
  19. }
  20. }
  21. // Show upload form (document and links)
  22. $formfile->form_attach_new_file(
  23. $_SERVER["PHP_SELF"].'?id='.$object->id,
  24. 'none',
  25. 0,
  26. 0,
  27. $permission,
  28. $conf->browser->layout == 'phone' ? 40 : 60,
  29. $object,
  30. '',
  31. 1,
  32. $savingdocmask,
  33. 0,
  34. 'formuserfile',
  35. 'accept',
  36. '',
  37. 1
  38. );
  39. print '</td></tr>';