33require
'../main.inc.php';
34require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
35require_once DOL_DOCUMENT_ROOT.
'/projet/class/task.class.php';
36require_once DOL_DOCUMENT_ROOT.
'/core/lib/project.lib.php';
37require_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
38require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formprojet.class.php';
39require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
40require_once DOL_DOCUMENT_ROOT.
'/core/modules/project/modules_project.php';
41require_once DOL_DOCUMENT_ROOT.
'/core/class/extrafields.class.php';
42require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
53$langsLoad = array(
'projects',
'companies');
54if (isModEnabled(
'eventorganization')) {
55 $langsLoad[] =
'eventorganization';
58$langs->loadLangs($langsLoad);
62$action =
GETPOST(
'action',
'aZ09');
63$backtopage =
GETPOST(
'backtopage',
'alpha');
64$backtopageforcancel =
GETPOST(
'backtopageforcancel',
'alpha');
65$backtopagejsfields =
GETPOST(
'backtopagejsfields',
'alpha');
66$cancel =
GETPOST(
'cancel',
'alpha');
67$confirm =
GETPOST(
'confirm',
'aZ09');
70if (!empty($backtopagejsfields)) {
71 $tmpbacktopagejsfields = explode(
':', $backtopagejsfields);
72 $dol_openinpopup = preg_replace(
'/[^a-z0-9_]/i',
'', $tmpbacktopagejsfields[0]);
78$objcanvas =
GETPOST(
"objcanvas",
"alphanohtml");
79$comefromclone =
GETPOST(
"comefromclone",
"alphanohtml");
84$location =
GETPOST(
'location',
'alphanohtml');
88$mine =
GETPOST(
'mode') ==
'mine' ? 1 : 0;
92$hookmanager->initHooks(array(
'projectcard',
'globalcard'));
99if ($id > 0 || !empty($ref)) {
100 $ret =
$object->fetch($id, $ref);
111$extrafields->fetch_name_optionals_label(
$object->table_element);
118if ($id ==
'' && $ref ==
'' && ($action !=
"create" && $action !=
"add" && $action !=
"update" && !
GETPOST(
"cancel"))) {
122$permissiontoadd = $user->hasRight(
'projet',
'creer');
123$permissiontodelete = $user->hasRight(
'projet',
'supprimer');
124$permissiondellink = $user->hasRight(
'projet',
'creer');
131$parameters = array(
'id' => $socid,
'objcanvas' => $objcanvas);
132$reshook = $hookmanager->executeHooks(
'doActions', $parameters,
$object, $action);
137if (empty($reshook)) {
138 $backurlforlist = DOL_URL_ROOT.
'/projet/list.php';
142 if (
GETPOST(
"comefromclone") == 1) {
143 $result =
$object->delete($user);
145 header(
"Location: index.php");
149 setEventMessages($langs->trans(
"CantRemoveProject", $langs->transnoentitiesnoconv(
"ProjectOverview")),
null,
'errors');
154 if (empty($backtopage) || ($cancel && empty($id))) {
155 if (empty($backtopage) || ($cancel && strpos($backtopage,
'__ID__'))) {
156 if (empty($id) && (($action !=
'add' && $action !=
'create') || $cancel)) {
157 $backtopage = $backurlforlist;
159 $backtopage = DOL_URL_ROOT.
'/projet/card.php?id='.((!empty($id) &&
$id > 0) ? $id :
'__ID__');
165 if (!empty($backtopageforcancel)) {
166 header(
"Location: ".$backtopageforcancel);
168 } elseif (!empty($backtopage)) {
169 header(
"Location: ".$backtopage);
175 include DOL_DOCUMENT_ROOT.
'/core/actions_dellink.inc.php';
178 if ($action ==
'confirm_setdraft' && $confirm ==
'yes' && $permissiontoadd) {
179 $result =
$object->setStatut($object::STATUS_DRAFT,
null,
'',
'PROJECT_MODIFY');
189 $object->statut = $object::STATUS_DRAFT;
193 if ($action ==
'add' && $permissiontoadd) {
196 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Ref")),
null,
'errors');
200 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"ProjectLabel")),
null,
'errors');
205 if (
GETPOST(
'usage_opportunity') !=
'' && !(
GETPOST(
'opp_status') > 0)) {
207 setEventMessages($langs->trans(
"ErrorOppStatusRequiredIfUsage"),
null,
'errors');
209 if (
GETPOST(
'opp_amount') !=
'' && !(
GETPOST(
'opp_status') > 0)) {
211 setEventMessages($langs->trans(
"ErrorOppStatusRequiredIfAmount"),
null,
'errors');
234 $object->date_start = $date_start;
236 $object->date_start_event = $date_start_event;
237 $object->date_end_event = $date_end_event;
240 $object->opp_status = $opp_status;
241 $object->opp_percent = $opp_percent;
242 $object->usage_opportunity = (
GETPOST(
'usage_opportunity',
'alpha') ==
'on' ? 1 : 0);
243 $object->usage_task = (
GETPOST(
'usage_task',
'alpha') ==
'on' ? 1 : 0);
244 $object->usage_bill_time = (
GETPOST(
'usage_bill_time',
'alpha') ==
'on' ? 1 : 0);
245 $object->usage_organize_event = (
GETPOST(
'usage_organize_event',
'alpha') ==
'on' ? 1 : 0);
248 $ret = $extrafields->setOptionalsFromPost(
null,
$object);
253 $result =
$object->create($user);
254 if (!$error && $result > 0) {
256 $typeofcontact =
GETPOST(
'typeofcontact');
257 $result =
$object->add_contact($user->id, $typeofcontact,
'internal');
263 } elseif ($result < 0) {
264 $langs->load(
"errors");
269 $langs->load(
"errors");
273 if (!$error && !empty(
$object->id) > 0) {
275 $categories =
GETPOST(
'categories',
'array');
276 $result =
$object->setCategories($categories);
278 $langs->load(
"errors");
287 if (!empty($backtopage)) {
288 $backtopage = preg_replace(
'/--IDFORBACKTOPAGE--|__ID__/', (
string)
$object->id, $backtopage);
289 $backtopage = $backtopage.
'&projectid='.
$object->id;
290 header(
"Location: ".$backtopage);
293 header(
"Location:card.php?id=".
$object->id);
298 unset($_POST[
"ref"]);
306 if ($action ==
'update' && empty(
GETPOST(
'cancel')) && $permissiontoadd) {
309 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Ref")),
null,
'errors');
313 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"ProjectLabel")),
null,
'errors');
317 $old_start_date =
null;
321 $old_start_date =
$object->date_start;
330 $object->date_start = (!
GETPOST(
'projectstart')) ?
'' : $date_start;
332 $object->date_start_event = (!
GETPOST(
'date_start_event')) ?
'' : $date_start_event;
333 $object->date_end_event = (!
GETPOST(
'date_end_event')) ?
'' : $date_end_event;
335 if (GETPOSTISSET(
'opp_amount')) {
338 if (GETPOSTISSET(
'budget_amount')) {
341 if (GETPOSTISSET(
'opp_status')) {
342 $object->opp_status = $opp_status;
344 if (GETPOSTISSET(
'opp_percent')) {
345 $object->opp_percent = $opp_percent;
347 $object->usage_opportunity = (
GETPOST(
'usage_opportunity',
'alpha') ==
'on' ? 1 : 0);
348 $object->usage_task = (
GETPOST(
'usage_task',
'alpha') ==
'on' ? 1 : 0);
349 $object->usage_bill_time = (
GETPOST(
'usage_bill_time',
'alpha') ==
'on' ? 1 : 0);
350 $object->usage_organize_event = (
GETPOST(
'usage_organize_event',
'alpha') ==
'on' ? 1 : 0);
353 $ret = $extrafields->setOptionalsFromPost(
null,
$object,
'@GETPOSTISSET');
362 setEventMessages($langs->trans(
"ErrorOppStatusRequiredIfAmount"),
null,
'errors');
367 $result =
$object->update($user);
377 $categories =
GETPOST(
'categories',
'array');
378 $result =
$object->setCategories($categories);
387 if (
GETPOST(
"reportdate") && (
$object->date_start != $old_start_date)) {
388 $result =
$object->shiftTaskDate($old_start_date);
398 $resclose =
$object->setClose($user);
420 if ($action ==
'set_opp_status' && $user->hasRight(
'projet',
'creer')) {
421 if (GETPOSTISSET(
'opp_status')) {
422 $object->opp_status = $opp_status;
424 if (GETPOSTISSET(
'opp_percent')) {
425 $object->opp_percent = $opp_percent;
431 setEventMessages($langs->trans(
"ErrorOppStatusRequiredIfAmount"),
null,
'errors');
436 $result =
$object->update($user);
456 if ($action ==
'builddoc' && $permissiontoadd) {
462 $outputlangs = $langs;
463 if (
GETPOST(
'lang_id',
'aZ09')) {
465 $outputlangs->setDefaultLang(
GETPOST(
'lang_id',
'aZ09'));
467 $result =
$object->generateDocument(
$object->model_pdf, $outputlangs);
475 if ($action ==
'remove_file' && $permissiontoadd) {
477 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
479 $langs->load(
"other");
480 $upload_dir =
$conf->project->multidir_output[
$object->entity];
481 $file = $upload_dir.
'/'.
GETPOST(
'file');
493 if ($action ==
'confirm_validate' && $confirm ==
'yes' && $permissiontoadd) {
494 $result =
$object->setValid($user);
500 if ($action ==
'confirm_close' && $confirm ==
'yes' && $permissiontoadd) {
501 $result =
$object->setClose($user);
507 if ($action ==
'confirm_reopen' && $confirm ==
'yes' && $permissiontoadd) {
508 $result =
$object->setValid($user);
514 if ($action ==
'confirm_delete' && $confirm ==
'yes' && $permissiontodelete) {
516 $result =
$object->delete($user);
520 if (!empty($_SESSION[
'pageforbacktolist']) && !empty($_SESSION[
'pageforbacktolist'][
'project'])) {
521 $tmpurl = $_SESSION[
'pageforbacktolist'][
'project'];
522 $tmpurl = preg_replace(
'/__SOCID__/', (
string)
$object->socid, $tmpurl);
523 $urlback = $tmpurl.(preg_match(
'/\?/', $tmpurl) ?
'&' :
'?').
'restore_lastsearch_values=1';
525 $urlback = DOL_URL_ROOT.
'/projet/list.php?restore_lastsearch_values=1';
528 header(
"Location: ".$urlback);
536 if ($action ==
'confirm_clone' && $permissiontoadd && $confirm ==
'yes') {
537 $clone_contacts =
GETPOST(
'clone_contacts') ? 1 : 0;
538 $clone_tasks =
GETPOST(
'clone_tasks') ? 1 : 0;
539 $clone_project_files =
GETPOST(
'clone_project_files') ? 1 : 0;
540 $clone_task_files =
GETPOST(
'clone_task_files') ? 1 : 0;
541 $clone_notes =
GETPOST(
'clone_notes') ? 1 : 0;
542 $move_date =
GETPOST(
'move_date') ? 1 : 0;
545 $result =
$object->createFromClone($user,
$object->id, $clone_contacts, $clone_tasks, $clone_project_files, $clone_task_files, $clone_notes, $move_date, 0, $clone_thirdparty);
551 $newobject->fetch($result);
553 setEventMessages($langs->trans(
"ProjectCreatedInDolibarr", $newobject->ref),
null,
'mesgs');
555 header(
'Location: '.$_SERVER[
'PHP_SELF'].
'?id='.$result.
'&action=edit&comefromclone=1');
561 if ($action ==
'update_extras' && $permissiontoadd) {
565 $ret = $extrafields->setOptionalsFromPost(
null,
$object,
GETPOST(
'attribute',
'restricthtml'));
572 $result =
$object->insertExtraFields(
'PROJECT_MODIFY');
580 $action =
'edit_extras';
585 $triggersendname =
'PROJECT_SENTBYMAIL';
587 $autocopy =
'MAIN_MAIL_AUTOCOPY_PROJECT_TO';
588 $trackid =
'proj'.$object->id;
589 include DOL_DOCUMENT_ROOT.
'/core/actions_sendmails.inc.php';
597$form =
new Form($db);
600$userstatic =
new User($db);
602$title = $langs->trans(
"Project").
' - '.
$object->ref.(!empty(
$object->thirdparty->name) ?
' - '.$object->thirdparty->name :
'').(!empty(
$object->title) ?
' - '.$object->title :
'');
604 $title =
$object->ref.(!empty(
$object->thirdparty->name) ?
' - '.$object->thirdparty->name :
'').(!empty(
$object->title) ?
' - '.$object->title :
'');
607$help_url =
"EN:Module_Projects|FR:Module_Projets|ES:Módulo_Proyectos|DE:Modul_Projekte";
609llxHeader(
"", $title, $help_url,
'', 0, 0,
'',
'',
'',
'mod-project page-card');
611$titleboth = $langs->trans(
"LeadsOrProjects");
612$titlenew = $langs->trans(
"NewLeadOrProject");
614 $titleboth = $langs->trans(
"Projects");
615 $titlenew = $langs->trans(
"NewProject");
618 $titleboth = $langs->trans(
"Leads");
619 $titlenew = $langs->trans(
"NewLead");
622if ($action ==
'create' && $user->hasRight(
'projet',
'creer')) {
627 $thirdparty =
new Societe($db);
629 $thirdparty->fetch($socid);
634 print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">';
635 print
'<input type="hidden" name="action" value="add">';
636 print
'<input type="hidden" name="token" value="'.newToken().
'">';
637 print
'<input type="hidden" name="backtopage" value="'.$backtopage.
'">';
638 print
'<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.
'">';
639 print
'<input type="hidden" name="backtopagejsfields" value="'.$backtopagejsfields.
'">';
640 print
'<input type="hidden" name="dol_openinpopup" value="'.$dol_openinpopup.
'">';
644 print
'<table class="border centpercent tableforfieldcreate">';
654 $dirmodels = array_merge(array(
'/'), (array)
$conf->modules_parts[
'models']);
655 foreach ($dirmodels as $reldir) {
656 $file =
dol_buildpath($reldir.
"core/modules/project/".$modele.
'.php', 0);
657 if (file_exists($file)) {
659 $classname = $modele;
664 if ($filefound && !empty($classname)) {
666 if (class_exists($classname)) {
667 $modProject =
new $classname();
668 '@phan-var-force ModeleNumRefProjects $modProject';
669 $defaultref = $modProject->getNextValue($thirdparty,
$object);
673 if (is_numeric($defaultref) && $defaultref <= 0) {
679 print
'<tr><td class="titlefieldcreate"><span class="fieldrequired">'.$langs->trans(
"Ref").
'</span></td><td class><input class="maxwidth150onsmartphone" type="text" name="ref" value="'.
dol_escape_htmltag($suggestedref).
'">';
681 print
' '.$form->textwithpicto(
'', $langs->trans(
"YouCanCompleteRef", $suggestedref));
686 print
'<tr><td><span class="fieldrequired">'.$langs->trans(
"Label").
'</span></td><td><input class="width500 maxwidth150onsmartphone" type="text" name="title" value="'.
dol_escape_htmltag(
GETPOST(
"title",
'alphanohtml')).
'" autofocus></td></tr>';
690 print
'<tr><td>'.$langs->trans(
"Parent").
'</td><td class="maxwidthonsmartphone">';
691 print
img_picto(
'',
'project',
'class="pictofixedwidth"');
692 $formproject->select_projects(-1,
'',
'fk_project', 64, 0, 1, 1, 0, 0, 0,
'', 0, 0,
'',
'',
'');
698 print
'<tr><td class="tdtop">';
699 print $langs->trans(
"Usage");
703 print
'<input type="checkbox" id="usage_opportunity" name="usage_opportunity"'.(GETPOSTISSET(
'usage_opportunity') ? (
GETPOST(
'usage_opportunity',
'alpha') ?
' checked="checked"' :
'') :
' checked="checked"').
'"> ';
704 $htmltext = $langs->trans(
"ProjectFollowOpportunity");
705 print
'<label for="usage_opportunity">'.$form->textwithpicto($langs->trans(
"ProjectFollowOpportunity"), $htmltext).
'</label>';
707 print
'$( document ).ready(function() {
708 jQuery("#usage_opportunity").change(function() {
709 if (jQuery("#usage_opportunity").prop("checked")) {
710 console.log("Show opportunities fields");
711 jQuery(".classuseopportunity").show();
713 console.log("Hide opportunities fields "+jQuery("#usage_opportunity").prop("checked"));
714 jQuery(".classuseopportunity").hide();
718 if (GETPOSTISSET(
'usage_opportunity') && !
GETPOST(
'usage_opportunity')) {
719 print
'jQuery(".classuseopportunity").hide();';
726 print
'<input type="checkbox" id="usage_task" name="usage_task"'.(GETPOSTISSET(
'usage_task') ? (
GETPOST(
'usage_task',
'alpha') ?
' checked="checked"' :
'') :
' checked="checked"').
'"> ';
727 $htmltext = $langs->trans(
"ProjectFollowTasks");
728 print
'<label for="usage_task">'.$form->textwithpicto($langs->trans(
"ProjectFollowTasks"), $htmltext).
'</label>';
730 print
'$( document ).ready(function() {
731 jQuery("#usage_task").change(function() {
732 if (jQuery("#usage_task").prop("checked")) {
733 console.log("Show task fields");
734 jQuery(".classusetask").show();
736 console.log("Hide tasks fields "+jQuery("#usage_task").prop("checked"));
737 jQuery(".classusetask").hide();
741 if (GETPOSTISSET(
'usage_task') && !
GETPOST(
'usage_task')) {
742 print
'jQuery(".classusetask").hide();';
749 print
'<input type="checkbox" id="usage_bill_time" name="usage_bill_time"'.(GETPOSTISSET(
'usage_bill_time') ? (
GETPOST(
'usage_bill_time',
'alpha') ?
' checked="checked"' :
'') :
'').
'"> ';
750 $htmltext = $langs->trans(
"ProjectBillTimeDescription");
751 print
'<label for="usage_bill_time">'.$form->textwithpicto($langs->trans(
"BillTime"), $htmltext).
'</label>';
753 print
'$( document ).ready(function() {
754 jQuery("#usage_bill_time").change(function() {
755 if (jQuery("#usage_bill_time").prop("checked")) {
756 console.log("Show bill time fields");
757 jQuery(".classusebilltime").show();
759 console.log("Hide bill time fields "+jQuery("#usage_bill_time").prop("checked"));
760 jQuery(".classusebilltime").hide();
764 if (GETPOSTISSET(
'usage_bill_time') && !
GETPOST(
'usage_bill_time')) {
765 print
'jQuery(".classusebilltime").hide();';
771 if (isModEnabled(
'eventorganization')) {
772 print
'<input type="checkbox" id="usage_organize_event" name="usage_organize_event"'.(GETPOSTISSET(
'usage_organize_event') ? (
GETPOST(
'usage_organize_event',
'alpha') ?
' checked="checked"' :
'') :
'').
'"> ';
773 $htmltext = $langs->trans(
"EventOrganizationDescriptionLong");
774 print
'<label for="usage_organize_event">'.$form->textwithpicto($langs->trans(
"ManageOrganizeEvent"), $htmltext).
'</label>';
776 print
'$( document ).ready(function() {
777 jQuery("#usage_organize_event").change(function() {
778 if (jQuery("#usage_organize_event").prop("checked")) {
779 console.log("Show organize event fields");
780 jQuery(".classuseorganizeevent").show();
782 console.log("Hide organize event fields "+jQuery("#usage_organize_event").prop("checked"));
783 jQuery(".classuseorganizeevent").hide();
787 if (!
GETPOST(
'usage_organize_event')) {
788 print
'jQuery(".classuseorganizeevent").hide();';
798 if (isModEnabled(
'societe')) {
800 print(!
getDolGlobalString(
'PROJECT_THIRDPARTY_REQUIRED') ?
'' :
'<span class="fieldrequired">');
801 print $langs->trans(
"ThirdParty");
803 print
'</td><td class="maxwidthonsmartphone">';
808 $text =
img_picto(
'',
'company',
'class="pictofixedwidth"').$form->select_company(
GETPOSTINT(
'socid'),
'socid', $filter,
'SelectThirdParty', 1, 0, array(), 0,
'minwidth300 widthcentpercentminusxx maxwidth500');
810 $texthelp = $langs->trans(
"IfNeedToUseOtherObjectKeepEmpty");
811 print $form->textwithtooltip($text.
' '.
img_help(), $texthelp, 1);
815 if (!GETPOSTISSET(
'backtopage')) {
816 $url =
'/societe/card.php?action=create&customer=3&fournisseur=0&backtopage='.urlencode($_SERVER[
"PHP_SELF"].
'?action=create');
817 $newbutton =
'<span class="fa fa-plus-circle valignmiddle paddingleft" title="'.$langs->trans(
"AddThirdParty").
'"></span>';
820 $tmpbacktopagejsfields =
'addthirdparty:socid,search_socid';
821 print
dolButtonToOpenUrlInDialogPopup(
'addthirdparty', $langs->transnoentitiesnoconv(
'AddThirdParty'), $newbutton, $url,
'',
'',
'', $tmpbacktopagejsfields);
823 print
' <a href="'.DOL_URL_ROOT.$url.
'">'.$newbutton.
'</a>';
831 print
'<tr><td>'.$langs->trans(
"Status").
'</td><td>';
832 print
'<input type="hidden" name="status" value="'.$status.
'">';
833 print
$object->LibStatut($status, 4);
839 print
'<tr class="classuseopportunity"><td><span class="fieldrequired">'.$langs->trans(
"OpportunityStatus").
'</span></td>';
840 print
'<td class="maxwidthonsmartphone">';
841 print $formproject->selectOpportunityStatus(
'opp_status', GETPOSTISSET(
'opp_status') ?
GETPOST(
'opp_status') :
$object->opp_status, 1, 0, 0, 0,
'', 0, 1);
844 print
' <input class="width50 right" type="text" id="opp_percent" name="opp_percent" title="'.dol_escape_htmltag($langs->trans(
"OpportunityProbability")).
'" value="'.
dol_escape_htmltag(GETPOSTISSET(
'opp_percent') ?
GETPOST(
'opp_percent') :
'').
'"><span class="hideonsmartphone"> %</span>';
845 print
'<input type="hidden" name="opp_percent_not_set" id="opp_percent_not_set" value="'.dol_escape_htmltag(GETPOSTISSET(
'opp_percent') ?
'0' :
'1').
'">';
850 print
'<tr class="classuseopportunity"><td>'.$langs->trans(
"OpportunityAmount").
'</td>';
851 print
'<td><input class="width75 right" type="text" name="opp_amount" value="'.dol_escape_htmltag(GETPOSTISSET(
'opp_amount') ?
GETPOST(
'opp_amount') :
'').
'">';
852 print
' '.$langs->getCurrencySymbol(
$conf->currency);
858 print
'<tr><td>'.$langs->trans(
"Budget").
'</td>';
859 print
'<td><input class="width75 right" type="text" name="budget_amount" value="'.dol_escape_htmltag(GETPOSTISSET(
'budget_amount') ?
GETPOST(
'budget_amount') :
'').
'">';
860 print
' '.$langs->getCurrencySymbol(
$conf->currency);
865 print
'<tr><td>'.$langs->trans(
"Date").(isModEnabled(
'eventorganization') ?
' <span class="classuseorganizeevent">('.$langs->trans(
"Project").
')</span>' :
'').
'</td><td>';
866 print $form->selectDate(($date_start ? $date_start :
''),
'projectstart', 0, 0, 0,
'', 1, 0);
867 print
' <span class="opacitymedium"> '.$langs->trans(
"to").
' </span> ';
868 print $form->selectDate(($date_end ? $date_end : -1),
'projectend', 0, 0, 0,
'', 1, 0);
871 if (isModEnabled(
'eventorganization')) {
873 print
'<tr class="classuseorganizeevent"><td>'.$langs->trans(
"Date").
' ('.$langs->trans(
"Event").
')</td><td>';
874 print $form->selectDate(($date_start_event ? $date_start_event : -1),
'date_start_event', 1, 1, 1,
'', 1, 0);
875 print
' <span class="opacitymedium"> '.$langs->trans(
"to").
' </span> ';
876 print $form->selectDate(($date_end_event ? $date_end_event : -1),
'date_end_event', 1, 1, 1,
'', 1, 0);
880 print
'<tr class="classuseorganizeevent"><td>'.$langs->trans(
"Location").
'</td>';
881 print
'<td><input class="minwidth300 maxwidth500" type="text" name="location" value="'.dol_escape_htmltag($location).
'"></td>';
886 print
'<tr><td class="tdtop">'.$langs->trans(
"Description").
'</td>';
888 $doleditor =
new DolEditor(
'description',
GETPOST(
"description",
'restricthtml'),
'', 90,
'dolibarr_notes',
'',
false,
true, isModEnabled(
'fckeditor') &&
getDolGlobalString(
'FCKEDITOR_ENABLE_SOCIETE'), ROWS_3,
'90%');
889 $doleditor->Create();
892 if (isModEnabled(
'category')) {
894 print
'<tr><td>'.$langs->trans(
"Categories").
'</td><td colspan="3">';
895 $cate_arbo = $form->select_all_categories(Categorie::TYPE_PROJECT,
'',
'parent', 64, 0, 3);
896 $arrayselected =
GETPOST(
'categories',
'array');
897 print
img_picto(
'',
'category',
'class="pictofixedwidth"').$form->multiselectarray(
'categories', $cate_arbo, $arrayselected, 0, 0,
'quatrevingtpercent widthcentpercentminusx', 0, 0);
902 print
'<tr><td>'.$langs->trans(
"Visibility").
'</td><td class="maxwidthonsmartphone">';
905 $array[0] = $langs->trans(
"PrivateProject");
908 $array[1] = $langs->trans(
"SharedProject");
911 if (count($array) > 0) {
912 print $form->selectarray(
'public', $array,
GETPOSTINT(
'public') ? 1 : 0, 0, 0, 0,
'', 0, 0, 0,
'',
'', 1);
914 print
'<input type="hidden" name="public" id="public" value="'.(GETPOSTINT(
'public') ? 1 : 0).
'">';
917 print
img_picto($langs->trans(
'PrivateProject'),
'private',
'class="paddingrightonly"');
918 print $langs->trans(
"PrivateProject");
920 print
img_picto($langs->trans(
'SharedProject'),
'world',
'class="paddingrightonly"');
921 print $langs->trans(
"SharedProject");
927 print
'<tr><td class="tdtop">'.$langs->trans(
"ProjectContactTypeManager").
'</td>';
929 $contactList =
$object->liste_type_contact(
'internal',
'position', 1);
930 $typeofcontact =
GETPOST(
'typeofcontact') ?
GETPOST(
'typeofcontact') :
'PROJECTLEADER';
931 print $form->selectarray(
'typeofcontact', $contactList, $typeofcontact, 0, 0, 0,
'', 0, 0, 0,
'',
'', 1);
935 $parameters = array();
936 $reshook = $hookmanager->executeHooks(
'formObjectOptions', $parameters,
$object, $action);
937 print $hookmanager->resPrint;
938 if (empty($reshook)) {
939 print
$object->showOptionals($extrafields,
'create');
946 print $form->buttonsSaveCancel(
'CreateDraft');
952 print
'<script type="text/javascript">
953 jQuery(document).ready(function() {
954 function change_percent()
956 var element = jQuery("#opp_status option:selected");
957 var defaultpercent = element.attr("defaultpercent");
958 /*if (jQuery("#opp_percent_not_set").val() == "") */
959 jQuery("#opp_percent").val(defaultpercent);
963 jQuery("#opp_status").change(function() {
967 jQuery("#usage_task").change(function() {
968 console.log("We click on usage task "+jQuery("#usage_task").is(":checked"));
969 if (! jQuery("#usage_task").is(":checked")) {
970 jQuery("#usage_bill_time").prop("checked", false);
974 jQuery("#usage_bill_time").change(function() {
975 console.log("We click on usage to bill time");
976 if (jQuery("#usage_bill_time").is(":checked")) {
977 jQuery("#usage_task").prop("checked", true);
987 $res =
$object->fetch_optionals();
990 $userAccess =
$object->restrictedProjectArea($user,
'read');
991 $userWrite =
$object->restrictedProjectArea($user,
'write');
992 $userDelete =
$object->restrictedProjectArea($user,
'delete');
998 if ($action ==
'validate') {
999 $text = $langs->trans(
'ConfirmValidateProject');
1000 $formconfirm = $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.
$object->id, $langs->trans(
'ValidateProject'), $text,
'confirm_validate',
'', 0, 1);
1003 if ($action ==
'close') {
1004 $text = $langs->trans(
"ConfirmCloseAProject");
1005 $formconfirm = $form->formconfirm($_SERVER[
"PHP_SELF"].
"?id=".
$object->id, $langs->trans(
"CloseAProject"), $text,
"confirm_close",
'',
'', 1);
1008 if ($action ==
'reopen') {
1009 $text = $langs->trans(
"ConfirmReOpenAProject");
1010 $formconfirm = $form->formconfirm($_SERVER[
"PHP_SELF"].
"?id=".
$object->id, $langs->trans(
"ReOpenAProject"), $text,
"confirm_reopen",
'',
'', 1);
1013 if ($action ==
'delete') {
1014 $text = $langs->trans(
"ConfirmDeleteAProject");
1015 $task =
new Task($db);
1016 $taskarray = $task->getTasksArray(
null,
null,
$object->id, 0, 0);
1017 $nboftask = count($taskarray);
1019 $text .=
'<br>'.img_warning().
' '.$langs->trans(
"ThisWillAlsoRemoveTasks", $nboftask);
1021 $formconfirm = $form->formconfirm($_SERVER[
"PHP_SELF"].
"?id=".
$object->id, $langs->trans(
"DeleteAProject"), $text,
"confirm_delete",
'',
'', 1);
1025 if ($action ==
'clone') {
1026 $text = $langs->trans(
"ConfirmCloneProject");
1027 $formquestion = array(
1028 'text' => $langs->trans(
"ConfirmClone"),
1029 0 => array(
'type' =>
'other',
'name' =>
'socid',
'label' => $langs->trans(
"SelectThirdParty"),
'value' => $form->select_company(
GETPOSTINT(
'socid') > 0 ?
GETPOSTINT(
'socid') :
$object->socid,
'socid',
'',
"None", 0, 0, array(), 0,
'minwidth200 maxwidth250')),
1030 1 => array(
'type' =>
'checkbox',
'name' =>
'clone_contacts',
'label' => $langs->trans(
"CloneContacts"),
'value' => true),
1031 2 => array(
'type' =>
'checkbox',
'name' =>
'clone_tasks',
'label' => $langs->trans(
"CloneTasks"),
'value' => true),
1032 3 => array(
'type' =>
'checkbox',
'name' =>
'move_date',
'label' => $langs->trans(
"CloneMoveDate"),
'value' => true),
1033 4 => array(
'type' =>
'checkbox',
'name' =>
'clone_notes',
'label' => $langs->trans(
"CloneNotes"),
'value' => true),
1034 5 => array(
'type' =>
'checkbox',
'name' =>
'clone_project_files',
'label' => $langs->trans(
"CloneProjectFiles"),
'value' => false),
1035 6 => array(
'type' =>
'checkbox',
'name' =>
'clone_task_files',
'label' => $langs->trans(
"CloneTaskFiles"),
'value' => false)
1038 $formconfirm = $form->formconfirm($_SERVER[
"PHP_SELF"].
"?id=".
$object->id, $langs->trans(
"ToClone"), $text,
"confirm_clone", $formquestion,
'', 1, 400, 590);
1042 $parameters = array(
'formConfirm' => $formconfirm);
1043 $reshook = $hookmanager->executeHooks(
'formConfirm', $parameters,
$object, $action);
1044 if (empty($reshook)) {
1045 $formconfirm .= $hookmanager->resPrint;
1046 } elseif ($reshook > 0) {
1047 $formconfirm = $hookmanager->resPrint;
1054 print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">';
1055 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1056 print
'<input type="hidden" name="action" value="update">';
1057 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1058 print
'<input type="hidden" name="comefromclone" value="'.$comefromclone.
'">';
1062 if ($action ==
'edit' && $userWrite > 0) {
1065 print
'<table class="border centpercent">';
1069 print
'<tr><td class="titlefield fieldrequired">'.$langs->trans(
"Ref").
'</td>';
1070 print
'<td><input class="width200" name="ref" value="'.$suggestedref.
'">';
1071 print
' '.$form->textwithpicto(
'', $langs->trans(
"YouCanCompleteRef", $suggestedref));
1075 print
'<tr><td class="fieldrequired">'.$langs->trans(
"Label").
'</td>';
1076 print
'<td><input class="quatrevingtpercent" name="title" value="'.dol_escape_htmltag(
$object->title).
'"></td></tr>';
1079 print
'<tr><td class="fieldrequired">'.$langs->trans(
"Status").
'</td><td>';
1080 print
'<select class="flat" name="status" id="status">';
1081 $statuses =
$object->labelStatusShort;
1083 unset($statuses[$object::STATUS_DRAFT]);
1085 foreach ($statuses as $key => $val) {
1086 print
'<option value="'.$key.
'"'.((GETPOSTISSET(
'status') ?
GETPOST(
'status') :
$object->
status) == $key ?
' selected="selected"' :
'').
'>'.$langs->trans($val).
'</option>';
1094 print
'<tr><td>'.$langs->trans(
"Parent").
'</td><td class="maxwidthonsmartphone">';
1095 print
img_picto(
'',
'project',
'class="pictofixedwidth"');
1096 $formproject->select_projects(-1,
$object->fk_project,
'fk_project', 64, 0, 1, 1, 0, 0, 0,
'', 0, 0,
'',
'',
'');
1102 print
'<tr><td class="tdtop">';
1103 print $langs->trans(
"Usage");
1107 print
'<input type="checkbox" id="usage_opportunity" name="usage_opportunity"'.(GETPOSTISSET(
'usage_opportunity') ? (
GETPOST(
'usage_opportunity',
'alpha') !=
'' ?
' checked="checked"' :
'') : (
$object->usage_opportunity ?
' checked="checked"' :
'')).
'> ';
1108 $htmltext = $langs->trans(
"ProjectFollowOpportunity");
1109 print
'<label for="usage_opportunity">'.$form->textwithpicto($langs->trans(
"ProjectFollowOpportunity"), $htmltext).
'</label>';
1111 print
'$( document ).ready(function() {
1112 jQuery("#usage_opportunity").change(function() {
1113 set_usage_opportunity();
1116 set_usage_opportunity();
1118 function set_usage_opportunity() {
1119 console.log("set_usage_opportunity");
1120 if (jQuery("#usage_opportunity").prop("checked")) {
1121 console.log("Show opportunities fields");
1122 jQuery(".classuseopportunity").show();
1124 console.log("Hide opportunities fields "+jQuery("#usage_opportunity").prop("checked"));
1125 jQuery(".classuseopportunity").hide();
1133 print
'<input type="checkbox" id="usage_task" name="usage_task"' . (GETPOSTISSET(
'usage_task') ? (
GETPOST(
'usage_task',
'alpha') !=
'' ?
' checked="checked"' :
'') : (
$object->usage_task ?
' checked="checked"' :
'')) .
'> ';
1134 $htmltext = $langs->trans(
"ProjectFollowTasks");
1135 print
'<label for="usage_task">'.$form->textwithpicto($langs->trans(
"ProjectFollowTasks"), $htmltext).
'</label>';
1137 print
'$( document ).ready(function() {
1138 jQuery("#usage_task").change(function() {
1144 function set_usage_task() {
1145 console.log("set_usage_task");
1146 if (jQuery("#usage_task").prop("checked")) {
1147 console.log("Show task fields");
1148 jQuery(".classusetask").show();
1150 console.log("Hide task fields "+jQuery("#usage_task").prop("checked"));
1151 jQuery(".classusetask").hide();
1159 print
'<input type="checkbox" id="usage_bill_time" name="usage_bill_time"' . (GETPOSTISSET(
'usage_bill_time') ? (
GETPOST(
'usage_bill_time',
'alpha') !=
'' ?
' checked="checked"' :
'') : (
$object->usage_bill_time ?
' checked="checked"' :
'')) .
'> ';
1160 $htmltext = $langs->trans(
"ProjectBillTimeDescription");
1161 print
'<label for="usage_bill_time">'.$form->textwithpicto($langs->trans(
"BillTime"), $htmltext).
'</label>';
1163 print
'$( document ).ready(function() {
1164 jQuery("#usage_bill_time").change(function() {
1165 set_usage_bill_time();
1168 set_usage_bill_time();
1170 function set_usage_bill_time() {
1171 console.log("set_usage_bill_time");
1172 if (jQuery("#usage_bill_time").prop("checked")) {
1173 console.log("Show bill time fields");
1174 jQuery(".classusebilltime").show();
1176 console.log("Hide bill time fields "+jQuery("#usage_bill_time").prop("checked"));
1177 jQuery(".classusebilltime").hide();
1184 if (isModEnabled(
'eventorganization')) {
1185 print
'<input type="checkbox" id="usage_organize_event" name="usage_organize_event"'. (GETPOSTISSET(
'usage_organize_event') ? (
GETPOST(
'usage_organize_event',
'alpha') !=
'' ?
' checked="checked"' :
'') : (
$object->usage_organize_event ?
' checked="checked"' :
'')) .
'> ';
1186 $htmltext = $langs->trans(
"EventOrganizationDescriptionLong");
1187 print
'<label for="usage_organize_event">'.$form->textwithpicto($langs->trans(
"ManageOrganizeEvent"), $htmltext).
'</label>';
1189 print
'$( document ).ready(function() {
1190 jQuery("#usage_organize_event").change(function() {
1196 function set_usage_event() {
1197 console.log("set_usage_event");
1198 if (jQuery("#usage_organize_event").prop("checked")) {
1199 console.log("Show organize event fields");
1200 jQuery(".classuseorganizeevent").show();
1202 console.log("Hide organize event fields "+jQuery("#usage_organize_event").prop("checked"));
1203 jQuery(".classuseorganizeevent").hide();
1214 if (isModEnabled(
'societe')) {
1216 print(!
getDolGlobalString(
'PROJECT_THIRDPARTY_REQUIRED') ?
'' :
'<span class="fieldrequired">');
1217 print $langs->trans(
"ThirdParty");
1224 $text =
img_picto(
'',
'company',
'class="pictofixedwidth"');
1225 $text .= $form->select_company(!empty(
$object->thirdparty->id) ?
$object->thirdparty->id :
"",
'socid', $filter,
'None', 1, 0, array(), 0,
'minwidth300');
1227 $texthelp = $langs->trans(
"IfNeedToUseOtherObjectKeepEmpty");
1228 print $form->textwithtooltip($text.
' '.
img_help(), $texthelp, 1, 0,
'',
'', 2);
1236 $classfortr = (
$object->usage_opportunity ?
'' :
' hideobject');
1238 print
'<tr class="classuseopportunity'.$classfortr.
'"><td>'.$langs->trans(
"OpportunityStatus").
'</td>';
1241 print $formproject->selectOpportunityStatus(
'opp_status',
$object->opp_status, 1, 0, 0, 0,
'minwidth150 inline-block valignmiddle', 1, 1);
1244 print
' <input class="width50 right" type="text" id="opp_percent" name="opp_percent" title="'.dol_escape_htmltag($langs->trans(
"OpportunityProbability")).
'" value="'.(GETPOSTISSET(
'opp_percent') ?
GETPOST(
'opp_percent') : (strcmp(
$object->opp_percent,
'') ?
vatrate(
$object->opp_percent) :
'')).
'"> %';
1245 print
'<span id="oldopppercent" class="opacitymedium"></span>';
1248 print
'<div id="divtocloseproject" class="inline-block valign clearboth paddingtop" style="display: none;">';
1249 print
'<input type="checkbox" id="inputcloseproject" name="closeproject" />';
1250 print
'<label for="inputcloseproject">';
1251 print $form->textwithpicto($langs->trans(
"AlsoCloseAProject"), $langs->trans(
"AlsoCloseAProjectTooltip")).
'</label>';
1258 print
'<tr class="classuseopportunity'.$classfortr.
'"><td>'.$langs->trans(
"OpportunityAmount").
'</td>';
1259 print
'<td><input class="width75 right" type="text" name="opp_amount" value="'.(GETPOSTISSET(
'opp_amount') ?
GETPOST(
'opp_amount') : (strcmp(
$object->opp_amount,
'') ?
price2num(
$object->opp_amount) :
'')).
'">';
1260 print $langs->getCurrencySymbol(
$conf->currency);
1266 print
'<tr><td>'.$langs->trans(
"Budget").
'</td>';
1267 print
'<td><input class="width75 right" type="text" name="budget_amount" value="'.(GETPOSTISSET(
'budget_amount') ?
GETPOST(
'budget_amount') : (strcmp(
$object->budget_amount,
'') ?
price2num(
$object->budget_amount) :
'')).
'">';
1268 print $langs->getCurrencySymbol(
$conf->currency);
1273 print
'<tr><td>'.$langs->trans(
"Date").(isModEnabled(
'eventorganization') ?
' <span class="classuseorganizeevent">('.$langs->trans(
"Project").
')</span>' :
'').
'</td><td>';
1274 print $form->selectDate(
$object->date_start ?
$object->date_start : -1,
'projectstart', 0, 0, 0,
'', 1, 0);
1275 print
' <span class="opacitymedium"> '.$langs->trans(
"to").
' </span> ';
1276 print $form->selectDate(
$object->date_end ?
$object->date_end : -1,
'projectend', 0, 0, 0,
'', 1, 0);
1277 $object->getLinesArray(
null, 0);
1279 print
' <span id="divreportdate" class="hidden"> <input type="checkbox" class="valignmiddle" id="reportdate" name="reportdate" value="yes" ';
1280 if ($comefromclone) {
1283 print
'/><label for="reportdate" class="valignmiddle opacitymedium">'.$langs->trans(
"ProjectReportDate").
'</label></span>';
1287 if (isModEnabled(
'eventorganization')) {
1289 print
'<tr class="classuseorganizeevent"><td>'.$langs->trans(
"Date").
' ('.$langs->trans(
"Event").
')</td><td>';
1290 print $form->selectDate(($date_start_event ? $date_start_event : (
$object->date_start_event ?
$object->date_start_event : -1)),
'date_start_event', 1, 1, 1,
'', 1, 0);
1291 print
' <span class="opacitymedium"> '.$langs->trans(
"to").
' </span> ';
1292 print $form->selectDate(($date_end_event ? $date_end_event : (
$object->date_end_event ?
$object->date_end_event : -1)),
'date_end_event', 1, 1, 1,
'', 1, 0);
1296 print
'<tr class="classuseorganizeevent"><td>'.$langs->trans(
"Location").
'</td>';
1297 print
'<td><input class="minwidth300 maxwidth500" type="text" name="location" value="'.dol_escape_htmltag(GETPOSTISSET(
'location') ?
GETPOST(
'location') :
$object->location).
'"></td>';
1302 print
'<tr><td class="tdtop">'.$langs->trans(
"Description").
'</td>';
1304 $doleditor =
new DolEditor(
'description',
$object->description,
'', 90,
'dolibarr_notes',
'',
false,
true, isModEnabled(
'fckeditor') &&
getDolGlobalInt(
'FCKEDITOR_ENABLE_SOCIETE'), ROWS_3,
'90%');
1305 $doleditor->Create();
1309 if (isModEnabled(
'category')) {
1310 $arrayselected = array();
1311 print
'<tr><td>'.$langs->trans(
"Categories").
'</td><td>';
1312 $cate_arbo = $form->select_all_categories(Categorie::TYPE_PROJECT,
'',
'parent', 64, 0, 3);
1314 $cats =
$c->containing(
$object->id, Categorie::TYPE_PROJECT);
1315 foreach ($cats as $cat) {
1316 $arrayselected[] = $cat->id;
1318 print
img_picto(
'',
'category',
'class="pictofixedwidth"').$form->multiselectarray(
'categories', $cate_arbo, $arrayselected, 0, 0,
'quatrevingtpercent widthcentpercentminusx', 0,
'0');
1323 print
'<tr><td>'.$langs->trans(
"Visibility").
'</td><td>';
1326 $array[0] = $langs->trans(
"PrivateProject");
1329 $array[1] = $langs->trans(
"SharedProject");
1332 if (count($array) > 0) {
1333 print $form->selectarray(
'public', $array,
$object->public, 0, 0, 0,
'', 0, 0, 0,
'',
'', 1);
1335 print
'<input type="hidden" id="public" name="public" value="'.$object->public.
'">';
1338 print
img_picto($langs->trans(
'PrivateProject'),
'private',
'class="paddingrightonly"');
1339 print $langs->trans(
"PrivateProject");
1341 print
img_picto($langs->trans(
'SharedProject'),
'world',
'class="paddingrightonly"');
1342 print $langs->trans(
"SharedProject");
1348 $parameters = array();
1349 $reshook = $hookmanager->executeHooks(
'formObjectOptions', $parameters,
$object, $action);
1350 print $hookmanager->resPrint;
1351 if (empty($reshook)) {
1352 print
$object->showOptionals($extrafields,
'edit');
1357 print
dol_get_fiche_head($head,
'project', $langs->trans(
"Project"), -1, (
$object->public ?
'projectpub' :
'project'), 0,
'',
'', 0,
'', 1);
1361 if (!empty($_SESSION[
'pageforbacktolist']) && !empty($_SESSION[
'pageforbacktolist'][
'project'])) {
1362 $tmpurl = $_SESSION[
'pageforbacktolist'][
'project'];
1363 $tmpurl = preg_replace(
'/__SOCID__/', (
string)
$object->socid, $tmpurl);
1364 $linkback =
'<a href="'.$tmpurl.(preg_match(
'/\?/', $tmpurl) ?
'&' :
'?').
'restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
1366 $linkback =
'<a href="'.DOL_URL_ROOT.
'/projet/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
1369 $morehtmlref =
'<div class="refidno">';
1372 $morehtmlref .=
'<br>';
1374 if (!empty(
$object->thirdparty->id) &&
$object->thirdparty->id > 0) {
1375 $morehtmlref .=
$object->thirdparty->getNomUrl(1,
'project');
1381 $parent->fetch(
$object->fk_project);
1382 $morehtmlref .= $langs->trans(
"Child of").
' '.$parent->getNomUrl(1,
'project').
' '.$parent->title;
1385 $morehtmlref .=
'</div>';
1388 if (!$user->hasRight(
'projet',
'all',
'lire')) {
1389 $objectsListId =
$object->getProjectsAuthorizedForUser($user, 0, 0);
1390 $object->next_prev_filter =
"rowid:IN:".$db->sanitize(count($objectsListId) ? implode(
',', array_keys($objectsListId)) :
'0');
1393 dol_banner_tab(
$object,
'ref', $linkback, 1,
'ref',
'ref', $morehtmlref);
1395 print
'<div class="fichecenter">';
1396 print
'<div class="fichehalfleft">';
1397 print
'<div class="underbanner clearboth"></div>';
1399 print
'<table class="border tableforfield centpercent">';
1403 print
'<tr><td class="tdtop">';
1404 print $langs->trans(
"Usage");
1408 print
'<input type="checkbox" disabled name="usage_opportunity"'.(GETPOSTISSET(
'usage_opportunity') ? (
GETPOST(
'usage_opportunity',
'alpha') !=
'' ?
' checked="checked"' :
'') : (
$object->usage_opportunity ?
' checked="checked"' :
'')).
'> ';
1409 $htmltext = $langs->trans(
"ProjectFollowOpportunity");
1410 print $form->textwithpicto($langs->trans(
"ProjectFollowOpportunity"), $htmltext);
1414 print
'<input type="checkbox" disabled name="usage_task"'.(GETPOSTISSET(
'usage_task') ? (
GETPOST(
'usage_task',
'alpha') !=
'' ?
' checked="checked"' :
'') : (
$object->usage_task ?
' checked="checked"' :
'')).
'> ';
1415 $htmltext = $langs->trans(
"ProjectFollowTasks");
1416 print $form->textwithpicto($langs->trans(
"ProjectFollowTasks"), $htmltext);
1420 print
'<input type="checkbox" disabled name="usage_bill_time"'.(GETPOSTISSET(
'usage_bill_time') ? (
GETPOST(
'usage_bill_time',
'alpha') !=
'' ?
' checked="checked"' :
'') : (
$object->usage_bill_time ?
' checked="checked"' :
'')).
'> ';
1421 $htmltext = $langs->trans(
"ProjectBillTimeDescription");
1422 print $form->textwithpicto($langs->trans(
"BillTime"), $htmltext);
1426 if (isModEnabled(
'eventorganization')) {
1427 print
'<input type="checkbox" disabled name="usage_organize_event"'.(GETPOSTISSET(
'usage_organize_event') ? (
GETPOST(
'usage_organize_event',
'alpha') !=
'' ?
' checked="checked"' :
'') : (
$object->usage_organize_event ?
' checked="checked"' :
'')).
'> ';
1428 $htmltext = $langs->trans(
"EventOrganizationDescriptionLong");
1429 print $form->textwithpicto($langs->trans(
"ManageOrganizeEvent"), $htmltext);
1436 print
'<tr><td>'.$langs->trans(
"OpportunityStatus");
1437 if ($action !=
'edit_opp_status' && $user->hasRight(
'projet',
'creer')) {
1438 print
'<a class="editfielda paddingtop" href="'.$_SERVER[
"PHP_SELF"].
'?action=edit_opp_status&token='.
newToken().
'&id='.
$object->id.
'">'.
img_edit($langs->transnoentitiesnoconv(
'Edit'), 1).
'</a>';
1441 $html_name_status = ($action ==
'edit_opp_status') ?
'opp_status' :
'none';
1442 $html_name_percent = ($action ==
'edit_opp_status') ?
'opp_percent' :
'none';
1443 $percent_value = (GETPOSTISSET(
'opp_percent') ?
GETPOST(
'opp_percent') : (strcmp(
$object->opp_percent,
'') ?
vatrate(
$object->opp_percent) :
''));
1444 $formproject->formOpportunityStatus($_SERVER[
'PHP_SELF'].
'?socid='.
$object->id,
$object->opp_status, $percent_value, $html_name_status, $html_name_percent);
1448 print
'<tr><td>'.$langs->trans(
"OpportunityAmount").
'</td><td>';
1449 if (strcmp(
$object->opp_amount,
'')) {
1450 print
'<span class="amount">'.price(
$object->opp_amount, 0, $langs, 1, 0, -1,
$conf->currency).
'</span>';
1451 if (strcmp(
$object->opp_percent,
'')) {
1452 print
' <span title="'.dol_escape_htmltag($langs->trans(
'OpportunityWeightedAmount')).
'"><span class="opacitymedium">'.$langs->trans(
"OpportunityWeightedAmountShort").
'</span>: <span class="amount">'.
price(
$object->opp_amount *
$object->opp_percent / 100, 0, $langs, 1, 0, -1,
$conf->currency).
'</span></span>';
1459 print
'<tr><td>'.$langs->trans(
"Budget").
'</td><td>';
1460 if (!is_null(
$object->budget_amount) && strcmp(
$object->budget_amount,
'')) {
1461 print
'<span class="amount">'.price(
$object->budget_amount, 0, $langs, 1, 0, 0,
$conf->currency).
'</span>';
1466 print
'<tr><td>'.$langs->trans(
"Dates").
'</td><td>';
1468 print($start ? $start :
'?');
1470 print
' <span class="opacitymedium">-</span> ';
1471 print($end ? $end :
'?');
1478 print
'<tr><td class="titlefield">'.$langs->trans(
"Visibility").
'</td><td>';
1480 print
img_picto($langs->trans(
'SharedProject'),
'world',
'class="paddingrightonly"');
1481 print $langs->trans(
'SharedProject');
1483 print
img_picto($langs->trans(
'PrivateProject'),
'private',
'class="paddingrightonly"');
1484 print $langs->trans(
'PrivateProject');
1490 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_view.tpl.php';
1495 print
'<div class="fichehalfright">';
1496 print
'<div class="underbanner clearboth"></div>';
1498 print
'<table class="border tableforfield centpercent">';
1501 if (isModEnabled(
'category')) {
1502 print
'<tr><td class="valignmiddle">'.$langs->trans(
"Categories").
'</td><td>';
1503 print $form->showCategories(
$object->id, Categorie::TYPE_PROJECT, 1);
1508 print
'<tr><td class="titlefield'.($object->description ?
' noborderbottom' :
'').
'" colspan="2">'.$langs->trans(
"Description").
'</td></tr>';
1510 print
'<tr><td class="nottitleforfield" colspan="2">';
1511 print
'<div class="longmessagecut">';
1522 print
'<div class="clearboth"></div>';
1527 if ($action ==
'edit' && $userWrite > 0) {
1528 print $form->buttonsSaveCancel();
1534 print
'<script type="text/javascript">
1535 jQuery(document).ready(function() {
1536 jQuery("#usage_task").change(function() {
1537 console.log("We click on usage task "+jQuery("#usage_task").is(":checked"));
1538 if (! jQuery("#usage_task").is(":checked")) {
1539 jQuery("#usage_bill_time").prop("checked", false);
1543 jQuery("#usage_bill_time").change(function() {
1544 console.log("We click on usage to bill time");
1545 if (jQuery("#usage_bill_time").is(":checked")) {
1546 jQuery("#usage_task").prop("checked", true);
1550 jQuery("#projectstart").change(function() {
1551 console.log("We modify the start date");
1552 jQuery("#divreportdate").show();
1560 $defaultcheckedwhenoppclose = 1;
1562 $defaultcheckedwhenoppclose = 0;
1565 print
'<!-- Javascript to manage opportunity status change -->';
1566 print
'<script type="text/javascript">
1567 jQuery(document).ready(function() {
1568 function change_percent()
1570 var element = jQuery("#opp_status option:selected");
1571 var defaultpercent = element.attr("defaultpercent");
1572 var defaultcloseproject = '.((int) $defaultcheckedwhenoppclose).
';
1573 var elemcode = element.attr("elemcode");
1576 console.log(
"We select "+elemcode);
1579 var closeproject = 0;
1580 if (elemcode == \
'LOST\') closeproject = 1;
1581 if (elemcode == \'WON\') closeproject = defaultcloseproject;
1582 if (closeproject) jQuery("#inputcloseproject").prop("checked", true);
1583 else jQuery("#inputcloseproject").prop("checked", false);
1585 /* Make the close project checkbox visible or not */
1586 console.log("closeproject="+closeproject);
1587 if (elemcode == \'WON\' || elemcode == \'LOST\')
1589 jQuery("#divtocloseproject").show();
1593 jQuery("#divtocloseproject").hide();
1596 /* Change percent with default percent (defaultpercent) if new status (defaultpercent) is higher than current (jQuery("#opp_percent").val()) */
1597 if (oldpercent != \'\' && (parseFloat(defaultpercent) < parseFloat(oldpercent)))
1599 console.log("oldpercent="+oldpercent+" defaultpercent="+defaultpercent+" def < old");
1600 if (jQuery("#opp_percent").val() != \'\' && oldpercent != \'\') {
1601 jQuery("#oldopppercent").text(\' - '.
dol_escape_js($langs->transnoentities(
"PreviousValue")).
': \'+price2numjs(oldpercent)+\' %\');
1604 if (parseFloat(oldpercent) != 100 && elemcode != \'LOST\') { jQuery("#opp_percent").val(oldpercent); }
1605 else { jQuery("#opp_percent").val(price2numjs(defaultpercent)); }
1607 console.log("oldpercent="+oldpercent+" defaultpercent="+defaultpercent);
1608 if (jQuery("#opp_percent").val() == \'\' || (parseFloat(jQuery("#opp_percent").val()) < parseFloat(defaultpercent))) {
1609 if (jQuery("#opp_percent").val() != \'\' && oldpercent != \'\') {
1610 jQuery("#oldopppercent").text(\' - '.
dol_escape_js($langs->transnoentities(
"PreviousValue")).
': \'+price2numjs(oldpercent)+\' %\');
1612 jQuery("#opp_percent").val(price2numjs(defaultpercent));
1617 jQuery("#opp_status").change(function() {
1629 print
'<div class="tabsAction">';
1630 $parameters = array();
1631 $reshook = $hookmanager->executeHooks(
'addMoreActionsButtons', $parameters,
$object, $action);
1633 if (empty($reshook)) {
1634 if ($action !=
"edit" && $action !=
'presend') {
1644 if (empty($user->socid)) {
1646 print
dolGetButtonAction(
'', $langs->trans(
'SendMail'),
'default', $_SERVER[
"PHP_SELF"].
'?action=presend&token='.
newToken().
'&id='.
$object->id.
'&mode=init#formmailbeforetitle',
'');
1666 if ($userWrite > 0) {
1667 print
dolGetButtonAction(
'', $langs->trans(
'SetToDraft'),
'default', $_SERVER[
"PHP_SELF"].
'?action=confirm_setdraft&confirm=yes&token='.
newToken().
'&id='.
$object->id,
'');
1669 print
dolGetButtonAction($langs->trans(
'NotOwnerOfProject'), $langs->trans(
'SetToDraft'),
'default', $_SERVER[
'PHP_SELF'].
'#',
'',
false);
1676 if ($userWrite > 0) {
1679 print
dolGetButtonAction($langs->trans(
'NotOwnerOfProject'), $langs->trans(
'Modify'),
'default', $_SERVER[
'PHP_SELF'].
'#',
'',
false);
1685 if ($userWrite > 0) {
1688 print
dolGetButtonAction($langs->trans(
'NotOwnerOfProject'), $langs->trans(
'Validate'),
'default', $_SERVER[
'PHP_SELF'].
'#',
'',
false);
1694 if ($userWrite > 0) {
1697 print
dolGetButtonAction($langs->trans(
'NotOwnerOfProject'), $langs->trans(
'Close'),
'default', $_SERVER[
'PHP_SELF'].
'#',
'',
false);
1703 if ($userWrite > 0) {
1706 print
dolGetButtonAction($langs->trans(
'NotOwnerOfProject'), $langs->trans(
'ReOpen'),
'default', $_SERVER[
'PHP_SELF'].
'#',
'',
false);
1714 $is_customer_or_prospect = (!empty(
$object->thirdparty->prospect) || !empty(
$object->thirdparty->client));
1715 $is_supplier_only= (!empty(
$object->thirdparty->fournisseur) && !$is_customer_or_prospect);
1717 $arrayforbutaction = array(
1718 10 => array(
'lang'=>
'propal',
'enabled' => (isModEnabled(
"propal") && $is_customer_or_prospect),
'perm' => $user->hasRight(
'propal',
'creer') ?
true : false,
'label' =>
'AddProp',
'url'=>
'/comm/propal/card.php?action=create&projectid='.
$object->id.
'&socid='.
$object->socid),
1719 20 => array(
'lang'=>
'orders',
'enabled' => (isModEnabled(
"order") && $is_customer_or_prospect),
'perm' => $user->hasRight(
'commande',
'creer') ? true : false,
'label' =>
'CreateOrder',
'url'=>
'/commande/card.php?action=create&projectid='.
$object->id.
'&socid='.
$object->socid),
1720 30 => array(
'lang'=>
'bills',
'enabled' => (isModEnabled(
"invoice") && $is_customer_or_prospect),
'perm' => $user->hasRight(
'facture',
'creer') ? true : false,
'label' =>
'CreateBill',
'url'=>
'/compta/facture/card.php?action=create&projectid='.
$object->id.
'&socid='.
$object->socid),
1721 40 => array(
'lang'=>
'supplier_proposal',
'enabled' => isModEnabled(
"supplier_proposal"),
'perm' => $user->hasRight(
'supplier_proposal',
'creer') ? true : false,
'label' =>
'AddSupplierProposal',
'url'=>
'/supplier_proposal/card.php?action=create&projectid='.
$object->id.($is_supplier_only ?
'&socid='.
$object->socid :
'')),
1722 50 => array(
'lang'=>
'suppliers',
'enabled' => isModEnabled(
"supplier_order"),
'perm' => $user->hasRight(
'fournisseur',
'commande',
'creer') ? true : false,
'label' =>
'AddSupplierOrder',
'url'=>
'/fourn/commande/card.php?action=create&projectid='.
$object->id.($is_supplier_only ?
'&socid='.
$object->socid :
'')),
1723 60 => array(
'lang'=>
'suppliers',
'enabled' => isModEnabled(
"supplier_invoice"),
'perm' => $user->hasRight(
'fournisseur',
'facture',
'creer') ? true : false,
'label' =>
'AddSupplierInvoice',
'url'=>
'/fourn/facture/card.php?action=create&projectid='.
$object->id.($is_supplier_only ?
'&socid='.
$object->socid :
'')),
1724 70 => array(
'lang'=>
'interventions',
'enabled' => isModEnabled(
"intervention"),
'perm' => $user->hasRight(
'fichinter',
'creer') ? true : false,
'label' =>
'AddIntervention',
'url'=>
'/fichinter/card.php?action=create&projectid='.
$object->id.
'&socid='.
$object->socid),
1725 80 => array(
'lang'=>
'contracts',
'enabled' => isModEnabled(
"contract"),
'perm' => $user->hasRight(
'contrat',
'creer') ? true : false,
'label' =>
'AddContract',
'url'=>
'/contrat/card.php?action=create&projectid='.
$object->id.
'&socid='.
$object->socid),
1726 90 => array(
'lang'=>
'trips',
'enabled' => isModEnabled(
"expensereport"),
'perm' => $user->hasRight(
'expensereport',
'creer') ? true : false,
'label' =>
'AddTrip',
'url'=>
'/expensereport/card.php?action=create&projectid='.
$object->id.
'&socid='.
$object->socid),
1727 100 => array(
'lang'=>
'donations',
'enabled' => isModEnabled(
"don"),
'perm' => $user->hasRight(
'don',
'creer') ? true : false,
'label' =>
'AddDonation',
'url'=>
'/don/card.php?action=create&projectid='.
$object->id.
'&socid='.
$object->socid),
1730 $params = array(
'backtopage' => $_SERVER[
"PHP_SELF"].
'?id='.
$object->id);
1733 print
dolGetButtonAction(
'', $langs->trans(
"Create"),
'default', $arrayforbutaction,
'', 1, $params);
1737 if ($user->hasRight(
'projet',
'creer')) {
1738 if ($userWrite > 0) {
1741 print
dolGetButtonAction($langs->trans(
'NotOwnerOfProject'), $langs->trans(
'ToClone'),
'default', $_SERVER[
'PHP_SELF'].
'#',
'',
false);
1750 print
dolGetButtonAction($langs->trans(
'NotOwnerOfProject'), $langs->trans(
'Delete'),
'default', $_SERVER[
'PHP_SELF'].
'#',
'',
false);
1758 if (
GETPOST(
'modelselected')) {
1759 $action =
'presend';
1762 if ($action !=
'presend') {
1763 print
'<div class="fichecenter"><div class="fichehalfleft">';
1764 print
'<a name="builddoc"></a>';
1770 $children =
$object->getChildren();
1772 print
'<table class="centpercent notopnoleftnoright table-fiche-title">';
1773 print
'<tr class="titre"><td class="nobordernopadding valignmiddle col-title">';
1774 print
'<div class="titre inline-block">'.$langs->trans(
'Sub-projects').
'</div>';
1775 print
'</td></tr></table>';
1777 print
'<div class="div-table-responsive-no-min">';
1778 print
'<table class="centpercent noborder'.($morecss ?
' '.$morecss :
'').
'">';
1779 print
'<tr class="liste_titre">';
1780 print
getTitleFieldOfList(
'Ref', 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'',
'',
'',
'', 1);
1781 print
getTitleFieldOfList(
'Title', 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'',
'',
'',
'', 1);
1782 print
getTitleFieldOfList(
'Status', 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'',
'',
'',
'', 1);
1786 $subproject =
new Project($db);
1787 foreach ($children as $child) {
1788 $subproject->fetch($child->rowid);
1789 print
'<tr class="oddeven">';
1790 print
'<td class="nowraponall">'.$subproject->getNomUrl(1,
'project').
'</td>';
1791 print
'<td class="nowraponall tdoverflowmax125">'.$child->title.
'</td>';
1792 print
'<td class="nowraponall">'.$subproject->getLibStatut(5).
'</td>';
1806 $urlsource = $_SERVER[
"PHP_SELF"].
"?id=".
$object->id;
1807 $genallowed = ($user->hasRight(
'projet',
'lire') && $userAccess > 0);
1808 $delallowed = ($user->hasRight(
'projet',
'creer') && $userWrite > 0);
1810 print $formfile->showdocuments(
'project', $filename, $filedir, $urlsource, $genallowed, $delallowed,
$object->model_pdf, 1, 0, 0, 0, 0,
'',
'',
'',
'',
'',
$object);
1812 print
'</div><div class="fichehalfright">';
1816 $morehtmlcenter =
'<div class="nowraponall">';
1817 $morehtmlcenter .=
dolGetButtonTitle($langs->trans(
'FullConversation'),
'',
'fa fa-comments imgforviewmode', DOL_URL_ROOT.
'/projet/messaging.php?id='.
$object->id);
1818 $morehtmlcenter .=
dolGetButtonTitle($langs->trans(
'FullList'),
'',
'fa fa-bars imgforviewmode', DOL_URL_ROOT.
'/projet/agenda.php?id='.
$object->id);
1819 $morehtmlcenter .=
'</div>';
1822 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formactions.class.php';
1824 $somethingshown = $formactions->showactions(
$object,
'project', 0, 1,
'', $MAXEVENT,
'', $morehtmlcenter);
1826 print
'</div></div>';
1830 $modelmail =
'project';
1831 $defaulttopic =
'SendProjectRef';
1832 $defaulttopiclang =
'projects';
1833 $diroutput =
$conf->project->multidir_output[
$object->entity];
1834 $autocopy =
'MAIN_MAIL_AUTOCOPY_PROJECT_TO';
1835 $trackid =
'proj'.$object->id;
1837 include DOL_DOCUMENT_ROOT.
'/core/tpl/card_presend.tpl.php';
1840 $parameters = array();
1841 $reshook = $hookmanager->executeHooks(
'mainCardTabAddMore', $parameters,
$object, $action);
1843 print $langs->trans(
"RecordNotFound");
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
ajax_combobox($htmlname, $events=array(), $minLengthToAutocomplete=0, $forcefocus=0, $widthTypeOfAutocomplete='resolve', $idforemptyvalue='-1', $morecss='')
Convert a html select field into an ajax combobox.
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Class to manage categories.
Class to manage a WYSIWYG editor.
Class to manage projects.
const STATUS_VALIDATED
Open/Validated status.
const STATUS_CLOSED
Closed status.
const STATUS_DRAFT
Draft status.
Class to manage third parties objects (customers, suppliers, prospects...)
Class to manage translations.
Class to manage Dolibarr users.
print $langs trans("Ref").' m titre as m m statut as status
Or an array listing all the potential status of the object: array: int of the status => translated la...
dol_delete_file($file, $disableglob=0, $nophperrors=0, $nohook=0, $object=null, $allowdotdot=false, $indexdatabase=1, $nolog=0)
Remove a file or several files with a mask.
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed information (by default a local PHP server timestamp) Rep...
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
vatrate($rate, $addpercent=false, $info_bits=0, $usestarfornpr=0, $html=0)
Return a string with VAT rate label formatted for view output Used into pdf and HTML pages.
img_help($usehelpcursor=1, $usealttitle=1)
Show help logo with cursor "?".
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2, $allowothertags=array())
Show picto whatever it's its name (generic function)
img_warning($titlealt='default', $moreatt='', $morecss='pictowarning')
Show warning logo.
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
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.
dolPrintHTML($s, $allowiframe=0)
Return a string (that can be on several lines) ready to be output on a HTML page.
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
dolGetButtonTitle($label, $helpText='', $iconClass='fa fa-file', $url='', $id='', $status=1, $params=array())
Function dolGetButtonTitle : this kind of buttons are used in title in list.
dolButtonToOpenUrlInDialogPopup($name, $label, $buttonstring, $url, $disabled='', $morecss='classlink button bordertransp', $jsonopen='', $backtopagejsfields='', $accesskey='')
Return HTML code to output a button to open a dialog popup box.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
setEventMessage($mesgs, $style='mesgs', $noduplicate=0, $attop=0)
Set event message in dol_events session object.
price($amount, $form=0, $outlangs='', $trunc=1, $rounding=-1, $forcerounding=-1, $currency_code='')
Function to format a value into an amount for visual output Function used into PDF and HTML pages.
dol_now($mode='auto')
Return date for now.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dol_escape_js($stringtoescape, $mode=0, $noescapebackslashn=0)
Returns text escaped for inclusion into javascript code.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
if(!function_exists( 'dol_getprefix')) dol_include_once($relpath, $classname='')
Make an include_once using default root and alternate root if it fails.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
dolGetButtonAction($label, $text='', $actionType='default', $url='', $id='', $userRight=1, $params=array())
Function dolGetButtonAction.
getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $disablesortlink=0, $tooltip='', $forcenowrapcolumntitle=0)
Get title line of an array.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
GETPOSTFLOAT($paramname, $rounding='')
Return the value of a $_GET or $_POST supervariable, converted into float.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
dol_clone($object, $native=2)
Create a clone of instance of object (new instance with same value for each properties) With native =...
dol_sanitizeFileName($str, $newstr='_', $unaccent=1, $includequotes=0)
Clean a string to use it as a file name.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
img_edit($titlealt='default', $float=0, $other='')
Show logo edit/modify fiche.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Returns text escaped for inclusion in HTML alt or title or value tags, or into values of HTML input f...
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
project_prepare_head(Project $project, $moreparam='')
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.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.