29 require
'../../main.inc.php';
30 require_once DOL_DOCUMENT_ROOT.
'/comm/propal/class/propal.class.php';
31 require_once DOL_DOCUMENT_ROOT.
'/core/lib/propal.lib.php';
32 if (!empty($conf->project->enabled)) {
33 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
37 $langs->loadLangs(array(
'propal',
'compta',
'bills',
'companies'));
41 $action =
GETPOST(
'action',
'aZ09');
46 if ($id > 0 || !empty($ref)) {
47 $object->fetch($id, $ref);
51 if ($user->socid > 0) {
52 $socid = $user->socid;
53 $object->id = $user->socid;
57 $hookmanager->initHooks(array(
'propalnote'));
66 $permissionnote = $user->rights->propale->creer;
68 $reshook = $hookmanager->executeHooks(
'doActions', array(), $object, $action);
72 if (empty($reshook)) {
73 include DOL_DOCUMENT_ROOT.
'/core/actions_setnotes.inc.php';
84 $title = $langs->trans(
'Proposal').
" - ".$langs->trans(
'Notes');
85 $help_url =
'EN:Commercial_Proposals|FR:Proposition_commerciale|ES:Presupuestos';
88 if ($object->id > 0) {
89 if ($object->fetch_thirdparty() > 0) {
93 $cssclass =
'titlefield';
100 $linkback =
'<a href="'.DOL_URL_ROOT.
'/comm/propal/list.php?restore_lastsearch_values=1'.(!empty($socid) ?
'&socid='.$socid :
'').
'">'.$langs->trans(
"BackToList").
'</a>';
103 $morehtmlref =
'<div class="refidno">';
105 $morehtmlref .=
$form->editfieldkey(
"RefCustomer",
'ref_client', $object->ref_client, $object, 0,
'string',
'', 0, 1);
106 $morehtmlref .=
$form->editfieldval(
"RefCustomer",
'ref_client', $object->ref_client, $object, 0,
'string',
'',
null,
null,
'', 1);
108 $morehtmlref .=
'<br>'.$langs->trans(
'ThirdParty').
' : '.$object->thirdparty->getNomUrl(1);
110 if (!empty($conf->project->enabled)) {
111 $langs->load(
"projects");
112 $morehtmlref .=
'<br>'.$langs->trans(
'Project').
' ';
113 if ($user->rights->propal->creer) {
114 if ($action !=
'classify') {
116 $morehtmlref .=
' : ';
118 if ($action ==
'classify') {
120 $morehtmlref .=
'<form method="post" action="'.$_SERVER[
'PHP_SELF'].
'?id='.$object->id.
'">';
121 $morehtmlref .=
'<input type="hidden" name="action" value="classin">';
122 $morehtmlref .=
'<input type="hidden" name="token" value="'.newToken().
'">';
123 $morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project,
'projectid', $maxlength, 0, 1, 0, 1, 0, 0,
'', 1);
124 $morehtmlref .=
'<input type="submit" class="button valignmiddle" value="'.$langs->trans(
"Modify").
'">';
125 $morehtmlref .=
'</form>';
127 $morehtmlref .=
$form->form_project($_SERVER[
'PHP_SELF'].
'?id='.$object->id, $object->socid, $object->fk_project,
'none', 0, 0, 0, 1);
130 if (!empty($object->fk_project)) {
132 $proj->fetch($object->fk_project);
133 $morehtmlref .=
' : '.$proj->getNomUrl(1);
135 $morehtmlref .=
' - '.$proj->title;
142 $morehtmlref .=
'</div>';
144 dol_banner_tab($object,
'ref', $linkback, 1,
'ref',
'ref', $morehtmlref);
146 print
'<div class="fichecenter">';
147 print
'<div class="underbanner clearboth"></div>';
149 $cssclass =
"titlefield";
150 include DOL_DOCUMENT_ROOT.
'/core/tpl/notes.tpl.php';