Extrafields for expensereports are visible on cards
This commit is contained in:
parent
cc9230c07f
commit
10c1f02243
@ -262,7 +262,6 @@ if (empty($reshook))
|
|||||||
$object->location_incoterms = GETPOST('location_incoterms', 'alpha');
|
$object->location_incoterms = GETPOST('location_incoterms', 'alpha');
|
||||||
$object->multicurrency_code = GETPOST('multicurrency_code', 'alpha');
|
$object->multicurrency_code = GETPOST('multicurrency_code', 'alpha');
|
||||||
$object->multicurrency_tx = GETPOST('originmulticurrency_tx', 'int');
|
$object->multicurrency_tx = GETPOST('originmulticurrency_tx', 'int');
|
||||||
|
|
||||||
// Fill array 'array_options' with data from add form
|
// Fill array 'array_options' with data from add form
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
@ -1212,7 +1211,6 @@ if (empty($reshook))
|
|||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
// Actions on extra fields (by external module or standard code)
|
// Actions on extra fields (by external module or standard code)
|
||||||
// TODO le hook fait double emploi avec le trigger !!
|
|
||||||
$hookmanager->initHooks(array('orderdao'));
|
$hookmanager->initHooks(array('orderdao'));
|
||||||
$parameters = array('id' => $object->id);
|
$parameters = array('id' => $object->id);
|
||||||
$reshook = $hookmanager->executeHooks('insertExtraFields', $parameters, $object, $action); // Note that $action and $object may have been modified by
|
$reshook = $hookmanager->executeHooks('insertExtraFields', $parameters, $object, $action); // Note that $action and $object may have been modified by
|
||||||
|
|||||||
@ -38,6 +38,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/modules/expensereport/modules_expenserep
|
|||||||
require_once DOL_DOCUMENT_ROOT . '/expensereport/class/expensereport.class.php';
|
require_once DOL_DOCUMENT_ROOT . '/expensereport/class/expensereport.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT . '/compta/paiement/class/paiement.class.php';
|
require_once DOL_DOCUMENT_ROOT . '/compta/paiement/class/paiement.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php';
|
require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php';
|
||||||
|
|
||||||
$langs->load("trips");
|
$langs->load("trips");
|
||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
@ -89,13 +90,37 @@ $hidedesc = (GETPOST('hidedesc', 'int') ? GETPOST('hidedesc', 'int') : (! empty(
|
|||||||
$hideref = (GETPOST('hideref', 'int') ? GETPOST('hideref', 'int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF) ? 1 : 0));
|
$hideref = (GETPOST('hideref', 'int') ? GETPOST('hideref', 'int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF) ? 1 : 0));
|
||||||
|
|
||||||
|
|
||||||
|
$object=new ExpenseReport($db);
|
||||||
|
$extrafields = new ExtraFields($db);
|
||||||
|
|
||||||
|
// fetch optionals attributes and labels
|
||||||
|
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
||||||
|
|
||||||
|
// Load object
|
||||||
|
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once
|
||||||
|
|
||||||
|
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||||
|
$hookmanager->initHooks(array('expensereportcard','globalcard'));
|
||||||
|
|
||||||
|
$permissionnote = $user->rights->expensereport->creer; // Used by the include of actions_setnotes.inc.php
|
||||||
|
$permissiondellink = $user->rights->expensereport->creer; // Used by the include of actions_dellink.inc.php
|
||||||
|
$permissionedit = $user->rights->expensereport->creer; // Used by the include of actions_lineupdown.inc.php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ($cancel)
|
$parameters = array('socid' => $socid);
|
||||||
|
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
|
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||||
|
|
||||||
|
if (empty($reshook))
|
||||||
{
|
{
|
||||||
|
if ($cancel)
|
||||||
|
{
|
||||||
$action='';
|
$action='';
|
||||||
$fk_projet='';
|
$fk_projet='';
|
||||||
$date_start='';
|
$date_start='';
|
||||||
@ -106,10 +131,46 @@ if ($cancel)
|
|||||||
$value_unit='';
|
$value_unit='';
|
||||||
$qty=1;
|
$qty=1;
|
||||||
$fk_c_type_fees=-1;
|
$fk_c_type_fees=-1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action == 'confirm_delete' && GETPOST("confirm") == "yes" && $id > 0 && $user->rights->expensereport->supprimer)
|
include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once
|
||||||
{
|
|
||||||
|
include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be include, not include_once
|
||||||
|
|
||||||
|
include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be include, not include_once
|
||||||
|
|
||||||
|
// Action clone object
|
||||||
|
if ($action == 'confirm_clone' && $confirm == 'yes' && $user->rights->expensereport->creer)
|
||||||
|
{
|
||||||
|
if (1==0 && ! GETPOST('clone_content') && ! GETPOST('clone_receivers'))
|
||||||
|
{
|
||||||
|
setEventMessages($langs->trans("NoCloneOptionsSpecified"), null, 'errors');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ($object->id > 0)
|
||||||
|
{
|
||||||
|
// Because createFromClone modifies the object, we must clone it so that we can restore it later
|
||||||
|
$orig = clone $object;
|
||||||
|
|
||||||
|
$result=$object->createFromClone($socid);
|
||||||
|
if ($result > 0)
|
||||||
|
{
|
||||||
|
header("Location: ".$_SERVER['PHP_SELF'].'?id='.$result);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
|
$object = $orig;
|
||||||
|
$action='';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($action == 'confirm_delete' && GETPOST("confirm") == "yes" && $id > 0 && $user->rights->expensereport->supprimer)
|
||||||
|
{
|
||||||
$object = new ExpenseReport($db);
|
$object = new ExpenseReport($db);
|
||||||
$result=$object->delete($id, $user);
|
$result=$object->delete($id, $user);
|
||||||
if ($result >= 0)
|
if ($result >= 0)
|
||||||
@ -121,10 +182,10 @@ if ($action == 'confirm_delete' && GETPOST("confirm") == "yes" && $id > 0 && $us
|
|||||||
{
|
{
|
||||||
setEventMessages($object->error, $object->errors, 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action == 'add' && $user->rights->expensereport->creer)
|
if ($action == 'add' && $user->rights->expensereport->creer)
|
||||||
{
|
{
|
||||||
$object = new ExpenseReport($db);
|
$object = new ExpenseReport($db);
|
||||||
|
|
||||||
$object->date_debut = $date_start;
|
$object->date_debut = $date_start;
|
||||||
@ -135,6 +196,12 @@ if ($action == 'add' && $user->rights->expensereport->creer)
|
|||||||
$object->fk_user_validator = GETPOST('fk_user_validator','int');
|
$object->fk_user_validator = GETPOST('fk_user_validator','int');
|
||||||
$object->note_public = GETPOST('note_public');
|
$object->note_public = GETPOST('note_public');
|
||||||
$object->note_private = GETPOST('note_private');
|
$object->note_private = GETPOST('note_private');
|
||||||
|
// Fill array 'array_options' with data from add form
|
||||||
|
if (! $error)
|
||||||
|
{
|
||||||
|
$ret = $extrafields->setOptionalsFromPost($extralabels, $object);
|
||||||
|
if ($ret < 0) $error++;
|
||||||
|
}
|
||||||
|
|
||||||
if ($object->periode_existe($user,$object->date_debut,$object->date_fin))
|
if ($object->periode_existe($user,$object->date_debut,$object->date_fin))
|
||||||
{
|
{
|
||||||
@ -162,10 +229,10 @@ if ($action == 'add' && $user->rights->expensereport->creer)
|
|||||||
$action='create';
|
$action='create';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action == 'update' && $user->rights->expensereport->creer)
|
if ($action == 'update' && $user->rights->expensereport->creer)
|
||||||
{
|
{
|
||||||
$object = new ExpenseReport($db);
|
$object = new ExpenseReport($db);
|
||||||
$object->fetch($id);
|
$object->fetch($id);
|
||||||
|
|
||||||
@ -192,10 +259,37 @@ if ($action == 'update' && $user->rights->expensereport->creer)
|
|||||||
{
|
{
|
||||||
setEventMessages($object->error, $object->errors, 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action == "confirm_validate" && GETPOST("confirm") == "yes" && $id > 0 && $user->rights->expensereport->creer)
|
if ($action == 'update_extras')
|
||||||
{
|
{
|
||||||
|
// Fill array 'array_options' with data from update form
|
||||||
|
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
||||||
|
$ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute'));
|
||||||
|
if ($ret < 0) $error++;
|
||||||
|
|
||||||
|
if (! $error)
|
||||||
|
{
|
||||||
|
// Actions on extra fields (by external module or standard code)
|
||||||
|
$hookmanager->initHooks(array('expensereportdao'));
|
||||||
|
$parameters = array('id' => $object->id);
|
||||||
|
$reshook = $hookmanager->executeHooks('insertExtraFields', $parameters, $object, $action); // Note that $action and $object may have been modified by
|
||||||
|
// some hooks
|
||||||
|
if (empty($reshook)) {
|
||||||
|
$result = $object->insertExtraFields();
|
||||||
|
if ($result < 0) {
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
|
} else if ($reshook < 0)
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($error)
|
||||||
|
$action = 'edit_extras';
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($action == "confirm_validate" && GETPOST("confirm") == "yes" && $id > 0 && $user->rights->expensereport->creer)
|
||||||
|
{
|
||||||
$object = new ExpenseReport($db);
|
$object = new ExpenseReport($db);
|
||||||
$object->fetch($id);
|
$object->fetch($id);
|
||||||
$result = $object->setValidate($user);
|
$result = $object->setValidate($user);
|
||||||
@ -303,10 +397,10 @@ if ($action == "confirm_validate" && GETPOST("confirm") == "yes" && $id > 0 && $
|
|||||||
{
|
{
|
||||||
setEventMessages($object->error, $object->errors, 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action == "confirm_save_from_refuse" && GETPOST("confirm") == "yes" && $id > 0 && $user->rights->expensereport->creer)
|
if ($action == "confirm_save_from_refuse" && GETPOST("confirm") == "yes" && $id > 0 && $user->rights->expensereport->creer)
|
||||||
{
|
{
|
||||||
$object = new ExpenseReport($db);
|
$object = new ExpenseReport($db);
|
||||||
$object->fetch($id);
|
$object->fetch($id);
|
||||||
$result = $object->set_save_from_refuse($user);
|
$result = $object->set_save_from_refuse($user);
|
||||||
@ -407,11 +501,11 @@ if ($action == "confirm_save_from_refuse" && GETPOST("confirm") == "yes" && $id
|
|||||||
{
|
{
|
||||||
setEventMessages($object->error, $object->errors, 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Approve
|
// Approve
|
||||||
if ($action == "confirm_approve" && GETPOST("confirm") == "yes" && $id > 0 && $user->rights->expensereport->approve)
|
if ($action == "confirm_approve" && GETPOST("confirm") == "yes" && $id > 0 && $user->rights->expensereport->approve)
|
||||||
{
|
{
|
||||||
$object = new ExpenseReport($db);
|
$object = new ExpenseReport($db);
|
||||||
$object->fetch($id);
|
$object->fetch($id);
|
||||||
|
|
||||||
@ -512,10 +606,10 @@ if ($action == "confirm_approve" && GETPOST("confirm") == "yes" && $id > 0 && $u
|
|||||||
{
|
{
|
||||||
setEventMessages($object->error, $object->errors, 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action == "confirm_refuse" && GETPOST('confirm')=="yes" && $id > 0 && $user->rights->expensereport->approve)
|
if ($action == "confirm_refuse" && GETPOST('confirm')=="yes" && $id > 0 && $user->rights->expensereport->approve)
|
||||||
{
|
{
|
||||||
$object = new ExpenseReport($db);
|
$object = new ExpenseReport($db);
|
||||||
$object->fetch($id);
|
$object->fetch($id);
|
||||||
|
|
||||||
@ -593,11 +687,11 @@ if ($action == "confirm_refuse" && GETPOST('confirm')=="yes" && $id > 0 && $user
|
|||||||
{
|
{
|
||||||
setEventMessages($object->error, $object->errors, 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//var_dump($user->id == $object->fk_user_validator);exit;
|
//var_dump($user->id == $object->fk_user_validator);exit;
|
||||||
if ($action == "confirm_cancel" && GETPOST('confirm')=="yes" && GETPOST('detail_cancel') && $id > 0 && $user->rights->expensereport->creer)
|
if ($action == "confirm_cancel" && GETPOST('confirm')=="yes" && GETPOST('detail_cancel') && $id > 0 && $user->rights->expensereport->creer)
|
||||||
{
|
{
|
||||||
$object = new ExpenseReport($db);
|
$object = new ExpenseReport($db);
|
||||||
$object->fetch($id);
|
$object->fetch($id);
|
||||||
|
|
||||||
@ -686,10 +780,10 @@ if ($action == "confirm_cancel" && GETPOST('confirm')=="yes" && GETPOST('detail_
|
|||||||
{
|
{
|
||||||
setEventMessages($langs->transnoentitiesnoconv("OnlyOwnerCanCancel"), '', 'errors'); // Should not happened
|
setEventMessages($langs->transnoentitiesnoconv("OnlyOwnerCanCancel"), '', 'errors'); // Should not happened
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action == "confirm_brouillonner" && GETPOST('confirm')=="yes" && $id > 0 && $user->rights->expensereport->creer)
|
if ($action == "confirm_brouillonner" && GETPOST('confirm')=="yes" && $id > 0 && $user->rights->expensereport->creer)
|
||||||
{
|
{
|
||||||
$object = new ExpenseReport($db);
|
$object = new ExpenseReport($db);
|
||||||
$object->fetch($id);
|
$object->fetch($id);
|
||||||
if ($user->id == $object->fk_user_author || $user->id == $object->fk_user_valid)
|
if ($user->id == $object->fk_user_author || $user->id == $object->fk_user_valid)
|
||||||
@ -730,10 +824,10 @@ if ($action == "confirm_brouillonner" && GETPOST('confirm')=="yes" && $id > 0 &&
|
|||||||
{
|
{
|
||||||
setEventMessages("NOT_AUTHOR", '', 'errors');
|
setEventMessages("NOT_AUTHOR", '', 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action == 'set_paid' && $id > 0 && $user->rights->expensereport->to_paid)
|
if ($action == 'set_paid' && $id > 0 && $user->rights->expensereport->to_paid)
|
||||||
{
|
{
|
||||||
$object = new ExpenseReport($db);
|
$object = new ExpenseReport($db);
|
||||||
$object->fetch($id);
|
$object->fetch($id);
|
||||||
|
|
||||||
@ -821,10 +915,10 @@ if ($action == 'set_paid' && $id > 0 && $user->rights->expensereport->to_paid)
|
|||||||
{
|
{
|
||||||
setEventMessages($object->error, $object->errors, 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action == "addline" && $user->rights->expensereport->creer)
|
if ($action == "addline" && $user->rights->expensereport->creer)
|
||||||
{
|
{
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
$db->begin();
|
$db->begin();
|
||||||
@ -918,10 +1012,10 @@ if ($action == "addline" && $user->rights->expensereport->creer)
|
|||||||
}
|
}
|
||||||
|
|
||||||
$action='';
|
$action='';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action == 'confirm_delete_line' && GETPOST("confirm") == "yes" && $user->rights->expensereport->creer)
|
if ($action == 'confirm_delete_line' && GETPOST("confirm") == "yes" && $user->rights->expensereport->creer)
|
||||||
{
|
{
|
||||||
$object = new ExpenseReport($db);
|
$object = new ExpenseReport($db);
|
||||||
$object->fetch($id);
|
$object->fetch($id);
|
||||||
|
|
||||||
@ -961,10 +1055,10 @@ if ($action == 'confirm_delete_line' && GETPOST("confirm") == "yes" && $user->ri
|
|||||||
{
|
{
|
||||||
setEventMessages($object->error, $object->errors, 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action == "updateligne" && $user->rights->expensereport->creer)
|
if ($action == "updateligne" && $user->rights->expensereport->creer)
|
||||||
{
|
{
|
||||||
$object = new ExpenseReport($db);
|
$object = new ExpenseReport($db);
|
||||||
$object->fetch($id);
|
$object->fetch($id);
|
||||||
|
|
||||||
@ -1025,14 +1119,14 @@ if ($action == "updateligne" && $user->rights->expensereport->creer)
|
|||||||
setEventMessages($object->error, $object->errors, 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Generate or regenerate the PDF document
|
* Generate or regenerate the PDF document
|
||||||
*/
|
*/
|
||||||
if ($action == 'builddoc') // GET or POST
|
if ($action == 'builddoc') // GET or POST
|
||||||
{
|
{
|
||||||
$depl = new ExpenseReport($db, 0, $_GET['id']);
|
$depl = new ExpenseReport($db, 0, $_GET['id']);
|
||||||
$depl->fetch($id);
|
$depl->fetch($id);
|
||||||
|
|
||||||
@ -1053,11 +1147,11 @@ if ($action == 'builddoc') // GET or POST
|
|||||||
setEventMessages($object->error, $object->errors, 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
$action='';
|
$action='';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove file in doc form
|
// Remove file in doc form
|
||||||
else if ($action == 'remove_file')
|
else if ($action == 'remove_file')
|
||||||
{
|
{
|
||||||
$object = new ExpenseReport($db, 0, $_GET['id']);
|
$object = new ExpenseReport($db, 0, $_GET['id']);
|
||||||
if ($object->fetch($id))
|
if ($object->fetch($id))
|
||||||
{
|
{
|
||||||
@ -1073,12 +1167,14 @@ else if ($action == 'remove_file')
|
|||||||
else setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), null, 'errors');
|
else setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), null, 'errors');
|
||||||
$action='';
|
$action='';
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$title=$langs->trans("ExpenseReport") . " - " . $langs->trans("Card");
|
$title=$langs->trans("ExpenseReport") . " - " . $langs->trans("Card");
|
||||||
$helpurl="EN:Module_Expense_Reports";
|
$helpurl="EN:Module_Expense_Reports";
|
||||||
llxHeader("",$title,$helpurl);
|
llxHeader("",$title,$helpurl);
|
||||||
@ -1155,6 +1251,14 @@ if ($action == 'create')
|
|||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Other attributes
|
||||||
|
$parameters = array('colspan' => ' colspan="3"');
|
||||||
|
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by
|
||||||
|
// hook
|
||||||
|
if (empty($reshook) && ! empty($extrafields->attribute_label)) {
|
||||||
|
print $object->showOptionals($extrafields, 'edit');
|
||||||
|
}
|
||||||
|
|
||||||
print '<tbody>';
|
print '<tbody>';
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
@ -1171,9 +1275,10 @@ else
|
|||||||
{
|
{
|
||||||
if($id > 0 || $ref)
|
if($id > 0 || $ref)
|
||||||
{
|
{
|
||||||
$object = new ExpenseReport($db);
|
|
||||||
$result = $object->fetch($id, $ref);
|
$result = $object->fetch($id, $ref);
|
||||||
|
|
||||||
|
$res = $object->fetch_optionals($object->id, $extralabels);
|
||||||
|
|
||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
{
|
{
|
||||||
if ($object->fk_user_author != $user->id)
|
if ($object->fk_user_author != $user->id)
|
||||||
@ -1285,6 +1390,10 @@ else
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Other attributes
|
||||||
|
//$cols = 3;
|
||||||
|
//include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_edit.tpl.php';
|
||||||
|
|
||||||
// Public note
|
// Public note
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td class="border" valign="top">' . $langs->trans('NotePublic') . '</td>';
|
print '<td class="border" valign="top">' . $langs->trans('NotePublic') . '</td>';
|
||||||
@ -1609,6 +1718,10 @@ else
|
|||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Other attributes
|
||||||
|
$cols = 3;
|
||||||
|
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
@ -2046,6 +2159,7 @@ print '<div style="width:50%">';
|
|||||||
/*
|
/*
|
||||||
* Generate documents
|
* Generate documents
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if($user->rights->expensereport->export && $object->fk_statut>0 && $action != 'edit')
|
if($user->rights->expensereport->export && $object->fk_statut>0 && $action != 'edit')
|
||||||
{
|
{
|
||||||
$filename = dol_sanitizeFileName($object->ref);
|
$filename = dol_sanitizeFileName($object->ref);
|
||||||
@ -2074,10 +2188,12 @@ if ($action != 'create' && $action != 'edit' && ($id || $ref))
|
|||||||
|
|
||||||
// Show links to link elements
|
// Show links to link elements
|
||||||
$linktoelements=array();
|
$linktoelements=array();
|
||||||
if (! empty($conf->global->EXPENSES_LINK_TO_INTERVENTION)) $linktoelements[]='fichinter';
|
if (! empty($conf->global->EXPENSES_LINK_TO_INTERVENTION))
|
||||||
|
{
|
||||||
|
$linktoelements[]='fichinter';
|
||||||
$linktoelem = $form->showLinkToObjectBlock($object, $linktoelements, array('expensereport'));
|
$linktoelem = $form->showLinkToObjectBlock($object, $linktoelements, array('expensereport'));
|
||||||
$somethingshown = $form->showLinkedObjectBlock($object, $linktoelem);
|
$somethingshown = $form->showLinkedObjectBlock($object, $linktoelem);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user