31require
'../main.inc.php';
32require_once DOL_DOCUMENT_ROOT.
'/loan/class/loan.class.php';
33require_once DOL_DOCUMENT_ROOT.
'/core/lib/loan.lib.php';
34if (isModEnabled(
'project')) {
35 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
38$action =
GETPOST(
'action',
'aZ09');
41$langs->loadLangs(array(
"loan"));
46$hookmanager->initHooks(array(
'loannote'));
49$object =
new Loan($db);
54$permissionnote = $user->rights->loan->write;
62$reshook = $hookmanager->executeHooks(
'doActions', array(), $object, $action);
67 include DOL_DOCUMENT_ROOT.
'/core/actions_setnotes.inc.php';
77$title = $langs->trans(
"Loan").
' - '.$langs->trans(
"Notes");
78$help_url =
'EN:Module_Loan|FR:Module_Emprunt';
85 $totalpaid = $object->getSumPayment();
91 $morehtmlref =
'<div class="refidno">';
93 $morehtmlref .= $form->editfieldkey(
"Label",
'label', $object->label, $object, 0,
'string',
'', 0, 1);
94 $morehtmlref .= $form->editfieldval(
"Label",
'label', $object->label, $object, 0,
'string',
'',
null,
null,
'', 1);
96 if (isModEnabled(
'project')) {
97 $langs->loadLangs(array(
"projects"));
98 $morehtmlref .=
'<br>'.$langs->trans(
'Project').
' : ';
99 if ($user->hasRight(
'loan',
'write')) {
102 if ($action ==
'classify') {
104 $morehtmlref .=
'<form method="post" action="'.$_SERVER[
'PHP_SELF'].
'?id='.$object->id.
'">';
105 $morehtmlref .=
'<input type="hidden" name="action" value="classin">';
106 $morehtmlref .=
'<input type="hidden" name="token" value="'.newToken().
'">';
107 $morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project,
'projectid', $maxlength, 0, 1, 0, 1, 0, 0,
'', 1);
108 $morehtmlref .=
'<input type="submit" class="button valignmiddle" value="'.$langs->trans(
"Modify").
'">';
109 $morehtmlref .=
'</form>';
111 $morehtmlref .= $form->form_project($_SERVER[
'PHP_SELF'].
'?id='.$object->id, $object->socid, $object->fk_project,
'none', 0, 0, 0, 1,
'',
'maxwidth300');
114 if (!empty($object->fk_project)) {
116 $proj->fetch($object->fk_project);
117 $morehtmlref .=
' : '.$proj->getNomUrl(1);
119 $morehtmlref .=
' - '.$proj->title;
126 $morehtmlref .=
'</div>';
128 $linkback =
'<a href="'.DOL_URL_ROOT.
'/loan/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
130 $object->totalpaid = $totalpaid;
132 dol_banner_tab($object,
'id', $linkback, 1,
'rowid',
'ref', $morehtmlref,
'', 0,
'', $morehtmlright);
134 print
'<div class="fichecenter">';
135 print
'<div class="underbanner clearboth"></div>';
137 $cssclass =
'titlefield';
138 $permission = $user->rights->loan->write;
139 include DOL_DOCUMENT_ROOT.
'/core/tpl/notes.tpl.php';
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
Class to manage projects.
dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='rowid', $fieldref='ref', $morehtmlref='', $moreparam='', $nodbprefix=0, $morehtmlleft='', $morehtmlstatus='', $onlybanner=0, $morehtmlright='')
Show tab footer of a card.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0)
Show tabs of a record.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
loan_prepare_head($object)
Prepare array with list of tabs.
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $mode=0)
Check permissions of a user to show a page and an object.