Merge pull request #7809 from defrance/patch-102
Expensereport Normalize link and generate document
This commit is contained in:
commit
3b3b017226
@ -2391,47 +2391,39 @@ if (GETPOST('modelselected')) {
|
|||||||
|
|
||||||
if ($action != 'presend')
|
if ($action != 'presend')
|
||||||
{
|
{
|
||||||
print '<div class="fichehalfleft">';
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Generate documents
|
* Generate documents
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if($user->rights->expensereport->export && $action != 'create' && $action != 'edit')
|
print '<div class="fichecenter"><div class="fichehalfleft">';
|
||||||
|
print '<a name="builddoc"></a>'; // ancre
|
||||||
|
|
||||||
|
if($user->rights->expensereport->creer && $action != 'create' && $action != 'edit')
|
||||||
{
|
{
|
||||||
$filename = dol_sanitizeFileName($object->ref);
|
$filename = dol_sanitizeFileName($object->ref);
|
||||||
$filedir = $conf->expensereport->dir_output . "/" . dol_sanitizeFileName($object->ref);
|
$filedir = $conf->expensereport->dir_output . "/" . dol_sanitizeFileName($object->ref);
|
||||||
$urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id;
|
$urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id;
|
||||||
$genallowed = $user->rights->expensereport->export;
|
$genallowed = $user->rights->expensereport->creer;
|
||||||
$delallowed = $user->rights->expensereport->export;
|
$delallowed = $user->rights->expensereport->creer;
|
||||||
$var = true;
|
$var = true;
|
||||||
print $formfile->showdocuments('expensereport',$filename,$filedir,$urlsource,$genallowed,$delallowed);
|
print $formfile->showdocuments('expensereport', $filename, $filedir, $urlsource, $genallowed, $delallowed);
|
||||||
$somethingshown = $formfile->numoffiles;
|
$somethingshown = $formfile->numoffiles;
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</div>';
|
|
||||||
|
|
||||||
if ($action != 'create' && $action != 'edit' && ($id || $ref))
|
if ($action != 'create' && $action != 'edit' && ($id || $ref))
|
||||||
{
|
{
|
||||||
$permissiondellink=$user->rights->facture->creer; // Used by the include of actions_dellink.inc.php
|
$linktoelem = $form->showLinkToObjectBlock($object, null, array('expensereport'));
|
||||||
include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be include, not include_once
|
$somethingshown = $form->showLinkedObjectBlock($object, $linktoelem);
|
||||||
|
|
||||||
// Link invoice to intervention
|
|
||||||
if (GETPOST('LinkedFichinter')) {
|
|
||||||
$object->fetch($id);
|
|
||||||
$object->fetch_thirdparty();
|
|
||||||
$result = $object->add_object_linked('fichinter', GETPOST('LinkedFichinter'));
|
|
||||||
}
|
|
||||||
|
|
||||||
// Show links to link elements
|
|
||||||
$linktoelements=array();
|
|
||||||
if (! empty($conf->global->EXPENSES_LINK_TO_INTERVENTION))
|
|
||||||
{
|
|
||||||
$linktoelements[]='fichinter';
|
|
||||||
$linktoelem = $form->showLinkToObjectBlock($object, $linktoelements, array('expensereport'));
|
|
||||||
$somethingshown = $form->showLinkedObjectBlock($object, $linktoelem);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
||||||
|
// List of actions on element
|
||||||
|
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
|
||||||
|
$formactions = new FormActions($db);
|
||||||
|
$somethingshown = $formactions->showactions($object, 'expensereport', null);
|
||||||
|
|
||||||
|
print '</div></div></div>';
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Presend form
|
// Presend form
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user