33require
'../main.inc.php';
41require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
42require_once DOL_DOCUMENT_ROOT.
'/projet/class/task.class.php';
43require_once DOL_DOCUMENT_ROOT.
'/core/lib/project.lib.php';
44require_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
45require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formprojet.class.php';
46require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
47require_once DOL_DOCUMENT_ROOT.
'/core/modules/project/modules_project.php';
48require_once DOL_DOCUMENT_ROOT.
'/core/class/extrafields.class.php';
49require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
52$langsLoad = array(
'projects',
'companies');
54 $langsLoad[] =
'eventorganization';
57$langs->loadLangs($langsLoad);
61$action =
GETPOST(
'action',
'aZ09');
62$backtopage =
GETPOST(
'backtopage',
'alpha');
63$backtopageforcancel =
GETPOST(
'backtopageforcancel',
'alpha');
64$cancel =
GETPOST(
'cancel',
'alpha');
65$confirm =
GETPOST(
'confirm',
'aZ09');
72$objcanvas =
GETPOST(
"objcanvas",
"alphanohtml");
73$comefromclone =
GETPOST(
"comefromclone",
"alphanohtml");
78$location =
GETPOST(
'location',
'alphanohtml');
81$mine =
GETPOST(
'mode') ==
'mine' ? 1 : 0;
84$hookmanager->initHooks(array(
'projectcard',
'globalcard'));
91if ($id > 0 || !empty($ref)) {
92 $ret =
$object->fetch($id, $ref);
95 if (
getDolGlobalString(
'PROJECT_ALLOW_COMMENT_ON_PROJECT') && method_exists($object,
'fetchComments') && empty(
$object->comments)) {
103$extrafields->fetch_name_optionals_label(
$object->table_element);
110if ($id ==
'' && $ref ==
'' && ($action !=
"create" && $action !=
"add" && $action !=
"update" && !
GETPOST(
"cancel"))) {
114$permissiontoadd = $user->hasRight(
'projet',
'creer');
115$permissiontodelete = $user->hasRight(
'projet',
'supprimer');
116$permissiondellink = $user->hasRight(
'projet',
'creer');
117$permissiontoeditextra = $permissiontoadd;
119if (
GETPOST(
'attribute',
'aZ09') && isset($extrafields->attributes[
$object->table_element][
'perms'][
GETPOST(
'attribute',
'aZ09')])) {
121 $permissiontoeditextra =
dol_eval((
string) $extrafields->attributes[
$object->table_element][
'perms'][
GETPOST(
'attribute',
'aZ09')]);
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:int');
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');
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');
363 setEventMessages($langs->trans(
"ErrorOppStatusRequiredIfAmount"),
null,
'errors');
366 if (!$error && !is_null(
$object->thirdparty) && ((
int)
$object->thirdparty->client == 0 || (
int)
$object->thirdparty->client == 2)) {
368 $idoppstatuswon = (int)
dol_getIdFromCode($db,
'WON',
'c_lead_status',
'code',
'rowid');
370 if (
$object->opp_status == $idoppstatuswon) {
372 if (!empty(
$object->thirdparty) && !empty(
$object->thirdparty->id)) {
373 $object->thirdparty->setAsCustomer();
380 $result =
$object->update($user);
390 $categories =
GETPOST(
'categories',
'array:int');
391 $result =
$object->setCategories($categories);
400 if (
GETPOST(
"reportdate") && (
$object->date_start != $old_start_date)) {
401 $result =
$object->shiftTaskDate((
int) $old_start_date);
411 $resclose =
$object->setClose($user);
434 if ($action ==
'set_opp_status' && $user->hasRight(
'projet',
'creer')) {
435 if (GETPOSTISSET(
'opp_status')) {
436 $object->opp_status = $opp_status;
438 if (GETPOSTISSET(
'opp_percent')) {
439 $object->opp_percent = $opp_percent;
445 setEventMessages($langs->trans(
"ErrorOppStatusRequiredIfAmount"),
null,
'errors');
452 $result =
$object->update($user);
464 if ((
int)
$object->thirdparty->client == 0 || (
int)
$object->thirdparty->client == 2) {
466 $idoppstatuswon = (int)
dol_getIdFromCode($db,
'WON',
'c_lead_status',
'code',
'rowid');
468 if (!$error &&
$object->opp_status == $idoppstatuswon) {
470 if (!empty(
$object->thirdparty) && !empty(
$object->thirdparty->id)) {
471 $object->thirdparty->setAsCustomer();
489 if ($action ==
'builddoc' && $permissiontoadd) {
495 $outputlangs = $langs;
496 if (
GETPOST(
'lang_id',
'aZ09')) {
498 $outputlangs->setDefaultLang(
GETPOST(
'lang_id',
'aZ09'));
500 $result =
$object->generateDocument(
$object->model_pdf, $outputlangs);
510 if ($action ==
'remove_file' && $permissiontoadd) {
512 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
514 $langs->load(
"other");
515 $upload_dir = $conf->project->multidir_output[
$object->entity ?? $conf->entity];
516 $file = $upload_dir.
'/'.
GETPOST(
'file');
528 if ($action ==
'confirm_validate' && $confirm ==
'yes' && $permissiontoadd) {
529 $result =
$object->setValid($user);
535 if ($action ==
'confirm_close' && $confirm ==
'yes' && $permissiontoadd) {
536 $result =
$object->setClose($user);
542 if ($action ==
'confirm_reopen' && $confirm ==
'yes' && $permissiontoadd) {
543 $result =
$object->setValid($user);
549 if ($action ==
'confirm_delete' && $confirm ==
'yes' && $permissiontodelete) {
551 $result =
$object->delete($user);
555 if (!empty($_SESSION[
'pageforbacktolist']) && !empty($_SESSION[
'pageforbacktolist'][
'project'])) {
556 $tmpurl = $_SESSION[
'pageforbacktolist'][
'project'];
557 $tmpurl = preg_replace(
'/__SOCID__/', (
string)
$object->socid, $tmpurl);
558 $urlback = $tmpurl.(preg_match(
'/\?/', $tmpurl) ?
'&' :
'?').
'restore_lastsearch_values=1';
560 $urlback = DOL_URL_ROOT.
'/projet/list.php?restore_lastsearch_values=1';
563 header(
"Location: ".$urlback);
571 if ($action ==
'confirm_clone' && $permissiontoadd && $confirm ==
'yes') {
572 $clone_contacts =
GETPOST(
'clone_contacts') ? 1 : 0;
573 $clone_tasks =
GETPOST(
'clone_tasks') ? 1 : 0;
574 $clone_project_files =
GETPOST(
'clone_project_files') ? 1 : 0;
575 $clone_task_files =
GETPOST(
'clone_task_files') ? 1 : 0;
576 $clone_notes =
GETPOST(
'clone_notes') ? 1 : 0;
577 $move_date =
GETPOST(
'move_date') ? 1 : 0;
580 $result =
$object->createFromClone($user,
$object->id, $clone_contacts, $clone_tasks, $clone_project_files, $clone_task_files, $clone_notes, $move_date, 0, $clone_thirdparty);
586 $newobject->fetch($result);
588 setEventMessages($langs->trans(
"ProjectCreatedInDolibarr", $newobject->ref),
null,
'mesgs');
590 header(
'Location: '.$_SERVER[
'PHP_SELF'].
'?id='.$result.
'&action=edit&comefromclone=1');
596 if ($action ==
'update_extras' && $permissiontoeditextra) {
599 $attribute_name =
GETPOST(
'attribute',
'aZ09');
602 $ret = $extrafields->setOptionalsFromPost(
null, $object, $attribute_name);
608 $result =
$object->updateExtraField($attribute_name,
'PROJECT_MODIFY');
616 $action =
'edit_extras';
621 include DOL_DOCUMENT_ROOT.
'/core/actions_printing.inc.php';
624 $triggersendname =
'PROJECT_SENTBYMAIL';
626 $autocopy =
'MAIN_MAIL_AUTOCOPY_PROJECT_TO';
627 $trackid =
'proj'.$object->id;
628 include DOL_DOCUMENT_ROOT.
'/core/actions_sendmails.inc.php';
636$form =
new Form($db);
639$userstatic =
new User($db);
641$title = $langs->trans(
"Project").
' - '.
$object->ref.(!empty(
$object->thirdparty->name) ?
' - '.$object->thirdparty->name :
'').(!empty(
$object->title) ?
' - '.$object->title :
'');
643 $title =
$object->ref.(!empty(
$object->thirdparty->name) ?
' - '.$object->thirdparty->name :
'').(!empty(
$object->title) ?
' - '.$object->title :
'');
646$help_url =
"EN:Module_Projects|FR:Module_Projets|ES:Módulo_Proyectos|DE:Modul_Projekte";
648llxHeader(
"", $title, $help_url,
'', 0, 0,
'',
'',
'',
'mod-project page-card');
650$titleboth = $langs->trans(
"LeadsOrProjects");
651$titlenew = $langs->trans(
"NewLeadOrProject");
653 $titleboth = $langs->trans(
"Projects");
654 $titlenew = $langs->trans(
"NewProject");
657 $titleboth = $langs->trans(
"Leads");
658 $titlenew = $langs->trans(
"NewLead");
661if ($action ==
'create' && $user->hasRight(
'projet',
'creer')) {
666 $thirdparty =
new Societe($db);
668 $thirdparty->fetch($socid);
673 print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">';
674 print
'<input type="hidden" name="action" value="add">';
675 print
'<input type="hidden" name="token" value="'.newToken().
'">';
676 print
'<input type="hidden" name="backtopage" value="'.$backtopage.
'">';
677 print
'<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.
'">';
678 print
'<input type="hidden" name="dol_openinpopup" value="'.$dol_openinpopup.
'">';
682 print
'<table class="border centpercent tableforfieldcreate">';
692 $dirmodels = array_merge(array(
'/'), (array) $conf->modules_parts[
'models']);
693 foreach ($dirmodels as $reldir) {
694 $file =
dol_buildpath($reldir.
"core/modules/project/".$modele.
'.php', 0);
695 if (file_exists($file)) {
697 $classname = $modele;
702 if ($filefound && !empty($classname)) {
704 if (class_exists($classname)) {
705 $modProject =
new $classname();
706 '@phan-var-force ModeleNumRefProjects $modProject';
707 $defaultref = $modProject->getNextValue($thirdparty, $object);
711 if (is_numeric($defaultref) && $defaultref <= 0) {
717 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).
'">';
719 print
' '.$form->textwithpicto(
'', $langs->trans(
"YouCanCompleteRef", $suggestedref));
724 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>';
728 print
'<tr><td>'.$langs->trans(
"Parent").
'</td><td class="maxwidthonsmartphone">';
729 print
img_picto(
'',
'project',
'class="pictofixedwidth"');
730 $formproject->select_projects(-1,
'',
'fk_project', 64, 0, 1, 1, 0, 0, 0,
'', 0, 0,
'',
'',
'');
736 print
'<tr><td class="tdtop">';
737 print $langs->trans(
"Usage");
741 print
'<input type="checkbox" id="usage_opportunity" name="usage_opportunity"'.(GETPOSTISSET(
'usage_opportunity') ? (
GETPOST(
'usage_opportunity',
'alpha') ?
' checked="checked"' :
'') :
' checked="checked"').
'> ';
742 $htmltext = $langs->trans(
"ProjectFollowOpportunity");
743 print
'<label for="usage_opportunity">'.$form->textwithpicto($langs->trans(
"ProjectFollowOpportunity"), $htmltext).
'</label>';
745 print
'$( document ).ready(function() {
746 jQuery("#usage_opportunity").change(function() {
747 if (jQuery("#usage_opportunity").prop("checked")) {
748 console.log("Show opportunities fields");
749 jQuery(".classuseopportunity").show();
751 console.log("Hide opportunities fields "+jQuery("#usage_opportunity").prop("checked"));
752 jQuery(".classuseopportunity").hide();
756 if (GETPOSTISSET(
'usage_opportunity') && !
GETPOST(
'usage_opportunity')) {
757 print
'jQuery(".classuseopportunity").hide();';
764 print
'<input type="checkbox" id="usage_task" name="usage_task"'.(GETPOSTISSET(
'usage_task') ? (
GETPOST(
'usage_task',
'alpha') ?
' checked="checked"' :
'') :
' checked="checked"').
'> ';
765 $htmltext = $langs->trans(
"ProjectFollowTasks");
766 print
'<label for="usage_task">'.$form->textwithpicto($langs->trans(
"ProjectFollowTasks"), $htmltext).
'</label>';
768 print
'$( document ).ready(function() {
769 jQuery("#usage_task").change(function() {
770 if (jQuery("#usage_task").prop("checked")) {
771 console.log("Show task fields");
772 jQuery(".classusetask").show();
774 console.log("Hide tasks fields "+jQuery("#usage_task").prop("checked"));
775 jQuery(".classusetask").hide();
779 if (GETPOSTISSET(
'usage_task') && !
GETPOST(
'usage_task')) {
780 print
'jQuery(".classusetask").hide();';
787 print
'<input type="checkbox" id="usage_bill_time" name="usage_bill_time"'.(GETPOSTISSET(
'usage_bill_time') ? (
GETPOST(
'usage_bill_time',
'alpha') ?
' checked="checked"' :
'') :
'').
'> ';
788 $htmltext = $langs->trans(
"ProjectBillTimeDescription");
789 print
'<label for="usage_bill_time">'.$form->textwithpicto($langs->trans(
"BillTime"), $htmltext).
'</label>';
791 print
'$( document ).ready(function() {
792 jQuery("#usage_bill_time").change(function() {
793 if (jQuery("#usage_bill_time").prop("checked")) {
794 console.log("Show bill time fields");
795 jQuery(".classusebilltime").show();
797 console.log("Hide bill time fields "+jQuery("#usage_bill_time").prop("checked"));
798 jQuery(".classusebilltime").hide();
802 if (GETPOSTISSET(
'usage_bill_time') && !
GETPOST(
'usage_bill_time')) {
803 print
'jQuery(".classusebilltime").hide();';
810 print
'<input type="checkbox" id="usage_organize_event" name="usage_organize_event"'.(GETPOSTISSET(
'usage_organize_event') ? (
GETPOST(
'usage_organize_event',
'alpha') ?
' checked="checked"' :
'') :
'').
'"> ';
811 $htmltext = $langs->trans(
"EventOrganizationDescriptionLong");
812 print
'<label for="usage_organize_event">'.$form->textwithpicto($langs->trans(
"ManageOrganizeEvent"), $htmltext).
'</label>';
814 print
'$( document ).ready(function() {
815 jQuery("#usage_organize_event").change(function() {
816 if (jQuery("#usage_organize_event").prop("checked")) {
817 console.log("Show organize event fields");
818 jQuery(".classuseorganizeevent").show();
820 console.log("Hide organize event fields "+jQuery("#usage_organize_event").prop("checked"));
821 jQuery(".classuseorganizeevent").hide();
825 if (!
GETPOST(
'usage_organize_event')) {
826 print
'jQuery(".classuseorganizeevent").hide();';
838 print(!
getDolGlobalString(
'PROJECT_THIRDPARTY_REQUIRED') ?
'' :
'<span class="fieldrequired">');
839 print $langs->trans(
"ThirdParty");
841 print
'</td><td class="maxwidthonsmartphone">';
846 $text =
img_picto(
'',
'company',
'class="pictofixedwidth"').$form->select_company(
GETPOSTINT(
'socid'),
'socid', $filter,
'SelectThirdParty', 1, 0, array(), 0,
'minwidth300 widthcentpercentminusxx maxwidth500');
847 if (!
getDolGlobalString(
'PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS') && empty($conf->dol_use_jmobile)) {
848 $texthelp = $langs->trans(
"IfNeedToUseOtherObjectKeepEmpty");
849 print $form->textwithtooltip($text.
' '.
img_help(), $texthelp, 1);
853 if (!GETPOSTISSET(
'backtopage')) {
854 $url =
'/societe/card.php?action=create&customer=3&fournisseur=0&backtopage='.urlencode($_SERVER[
"PHP_SELF"].
'?action=create');
855 $newbutton =
'<span class="fa fa-plus-circle valignmiddle paddingleft" title="'.$langs->trans(
"AddThirdParty").
'"></span>';
858 $jsonclose =
'TODO Not yet implemented';
861 print
' <a href="'.DOL_URL_ROOT.$url.
'">'.$newbutton.
'</a>';
869 print
'<tr><td>'.$langs->trans(
"Status").
'</td><td>';
870 print
'<input type="hidden" name="status" value="'.$status.
'">';
871 print
$object->LibStatut($status, 4);
877 print
'<tr class="classuseopportunity"><td><span class="fieldrequired">'.$langs->trans(
"OpportunityStatus").
'</span></td>';
878 print
'<td class="maxwidthonsmartphone">';
879 print $formproject->selectOpportunityStatus(
'opp_status', GETPOSTISSET(
'opp_status') ?
GETPOST(
'opp_status') :
$object->opp_status, 1, 0, 0, 0,
'', 0, 1);
882 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>';
883 print
'<input type="hidden" name="opp_percent_not_set" id="opp_percent_not_set" value="'.dol_escape_htmltag(GETPOSTISSET(
'opp_percent') ?
'0' :
'1').
'">';
888 print
'<tr class="classuseopportunity"><td>'.$langs->trans(
"OpportunityAmount").
'</td>';
889 print
'<td><input class="width75 right" type="text" name="opp_amount" value="'.dol_escape_htmltag(GETPOSTISSET(
'opp_amount') ?
GETPOST(
'opp_amount') :
'').
'">';
890 print
' '.$langs->getCurrencySymbol($conf->currency);
896 print
'<tr><td>'.$langs->trans(
"Budget").
'</td>';
897 print
'<td><input class="width75 right" type="text" name="budget_amount" value="'.dol_escape_htmltag(GETPOSTISSET(
'budget_amount') ?
GETPOST(
'budget_amount') :
'').
'">';
898 print
' '.$langs->getCurrencySymbol($conf->currency);
903 print
'<tr><td>'.$langs->trans(
"Date").(isModEnabled(
'eventorganization') ?
' <span class="classuseorganizeevent">('.$langs->trans(
"Project").
')</span>' :
'').
'</td><td>';
904 print $form->selectDate(($date_start ? $date_start :
''),
'projectstart', 0, 0, 0,
'', 1, 0);
905 print
' <span class="opacitymedium"> '.$langs->trans(
"to").
' </span> ';
906 print $form->selectDate(($date_end ? $date_end : -1),
'projectend', 0, 0, 0,
'', 1, 0);
911 print
'<tr class="classuseorganizeevent"><td>'.$langs->trans(
"Date").
' ('.$langs->trans(
"Event").
')</td><td>';
912 print $form->selectDate(($date_start_event ? $date_start_event : -1),
'date_start_event', 1, 1, 1,
'', 1, 0);
913 print
' <span class="opacitymedium"> '.$langs->trans(
"to").
' </span> ';
914 print $form->selectDate(($date_end_event ? $date_end_event : -1),
'date_end_event', 1, 1, 1,
'', 1, 0);
918 print
'<tr class="classuseorganizeevent"><td>'.$langs->trans(
"Location").
'</td>';
919 print
'<td><input class="minwidth300 maxwidth500" type="text" name="location" value="'.dol_escape_htmltag($location).
'"></td>';
924 print
'<tr><td class="tdtop">'.$langs->trans(
"Description").
'</td>';
926 $doleditor =
new DolEditor(
'description',
GETPOST(
"description",
'restricthtml'),
'', 90,
'dolibarr_notes',
'',
false,
true,
isModEnabled(
'fckeditor') &&
getDolGlobalString(
'FCKEDITOR_ENABLE_SOCIETE'), ROWS_3,
'90%');
927 $doleditor->Create();
932 print
'<tr><td>'.$langs->trans(
"Categories").
'</td><td colspan="3">';
933 print $form->selectCategories(Categorie::TYPE_PROJECT,
'categories', $object);
938 print
'<tr><td>'.$langs->trans(
"Visibility").
'</td><td class="maxwidthonsmartphone">';
941 $array[0] = $langs->trans(
"PrivateProject");
944 $array[1] = $langs->trans(
"SharedProject");
947 if (count($array) > 0) {
948 print $form->selectarray(
'public', $array,
GETPOSTINT(
'public') ? 1 : 0, 0, 0, 0,
'', 0, 0, 0,
'',
'minwidth200', 1);
950 print
'<input type="hidden" name="public" id="public" value="'.(GETPOSTINT(
'public') ? 1 : 0).
'">';
953 print
img_picto($langs->trans(
'PrivateProject'),
'private',
'class="paddingrightonly"');
954 print $langs->trans(
"PrivateProject");
956 print
img_picto($langs->trans(
'SharedProject'),
'world',
'class="paddingrightonly"');
957 print $langs->trans(
"SharedProject");
963 print
'<tr><td class="tdtop">'.$langs->trans(
"ProjectContactTypeManager").
'</td>';
965 $contactList =
$object->liste_type_contact(
'internal',
'position', 1);
966 $typeofcontact =
GETPOST(
'typeofcontact') ?
GETPOST(
'typeofcontact') :
'PROJECTLEADER';
967 print $form->selectarray(
'typeofcontact', $contactList, $typeofcontact, 0, 0, 0,
'', 0, 0, 0,
'',
'minwidth200', 1);
971 $parameters = array();
972 $reshook = $hookmanager->executeHooks(
'formObjectOptions', $parameters, $object, $action);
973 print $hookmanager->resPrint;
974 if (empty($reshook)) {
975 print
$object->showOptionals($extrafields,
'create');
982 print $form->buttonsSaveCancel(
'CreateDraft');
988 print
'<script type="text/javascript">
989 jQuery(document).ready(function() {
990 function change_percent()
992 var element = jQuery("#opp_status option:selected");
993 var defaultpercent = element.attr("defaultpercent");
994 /*if (jQuery("#opp_percent_not_set").val() == "") */
995 /* defaultpercent is the raw DB value (double(5,2), ie "100.00"), so normalize it */
996 jQuery("#opp_percent").val(parseFloat(defaultpercent));
1000 jQuery("#opp_status").change(function() {
1004 jQuery("#usage_task").change(function() {
1005 console.log("We click on usage task "+jQuery("#usage_task").is(":checked"));
1006 if (! jQuery("#usage_task").is(":checked")) {
1007 jQuery("#usage_bill_time").prop("checked", false);
1011 jQuery("#usage_bill_time").change(function() {
1012 console.log("We click on usage to bill time");
1013 if (jQuery("#usage_bill_time").is(":checked")) {
1014 jQuery("#usage_task").prop("checked", true);
1024 $res =
$object->fetch_optionals();
1027 $userAccess =
$object->restrictedProjectArea($user,
'read');
1028 $userWrite =
$object->restrictedProjectArea($user,
'write');
1029 $userDelete =
$object->restrictedProjectArea($user,
'delete');
1035 if ($action ==
'validate') {
1036 $text = $langs->trans(
'ConfirmValidateProject');
1037 $formconfirm = $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.
$object->id, $langs->trans(
'ValidateProject'), $text,
'confirm_validate',
'', 0, 1);
1040 if ($action ==
'close') {
1041 $text = $langs->trans(
"ConfirmCloseAProject");
1042 $formconfirm = $form->formconfirm($_SERVER[
"PHP_SELF"].
"?id=".
$object->id, $langs->trans(
"CloseAProject"), $text,
"confirm_close",
'',
'', 1);
1045 if ($action ==
'reopen') {
1046 $text = $langs->trans(
"ConfirmReOpenAProject");
1047 $formconfirm = $form->formconfirm($_SERVER[
"PHP_SELF"].
"?id=".
$object->id, $langs->trans(
"ReOpenAProject"), $text,
"confirm_reopen",
'',
'', 1);
1050 if ($action ==
'delete') {
1051 $text = $langs->trans(
"ConfirmDeleteAProject");
1052 $task =
new Task($db);
1053 $taskarray = $task->getTasksArray(
null,
null,
$object->id, 0, 0);
1054 $nboftask = count($taskarray);
1056 $text .=
'<br>'.img_warning().
' '.$langs->trans(
"ThisWillAlsoRemoveTasks", $nboftask);
1058 $formconfirm = $form->formconfirm($_SERVER[
"PHP_SELF"].
"?id=".
$object->id, $langs->trans(
"DeleteAProject"), $text,
"confirm_delete",
'',
'', 1);
1062 if ($action ==
'clone') {
1063 $text = $langs->trans(
"ConfirmCloneProject");
1064 $formquestion = array(
1065 'text' => $langs->trans(
"ConfirmClone"),
1066 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')),
1067 1 => array(
'type' =>
'checkbox',
'name' =>
'clone_contacts',
'label' => $langs->trans(
"CloneContacts"),
'value' => true),
1068 2 => array(
'type' =>
'checkbox',
'name' =>
'clone_tasks',
'label' => $langs->trans(
"CloneTasks"),
'value' => true),
1069 3 => array(
'type' =>
'checkbox',
'name' =>
'move_date',
'label' => $langs->trans(
"CloneMoveDate"),
'value' => true),
1070 4 => array(
'type' =>
'checkbox',
'name' =>
'clone_notes',
'label' => $langs->trans(
"CloneNotes"),
'value' => true),
1071 5 => array(
'type' =>
'checkbox',
'name' =>
'clone_project_files',
'label' => $langs->trans(
"CloneProjectFiles"),
'value' => false),
1072 6 => array(
'type' =>
'checkbox',
'name' =>
'clone_task_files',
'label' => $langs->trans(
"CloneTaskFiles"),
'value' => false)
1075 $formconfirm = $form->formconfirm($_SERVER[
"PHP_SELF"].
"?id=".
$object->id, $langs->trans(
"ToClone"), $text,
"confirm_clone", $formquestion,
'', 1, 400, 590);
1079 $parameters = array(
'formConfirm' => $formconfirm);
1080 $reshook = $hookmanager->executeHooks(
'formConfirm', $parameters, $object, $action);
1081 if (empty($reshook)) {
1082 $formconfirm .= $hookmanager->resPrint;
1083 } elseif ($reshook > 0) {
1084 $formconfirm = $hookmanager->resPrint;
1091 print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">';
1092 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1093 print
'<input type="hidden" name="action" value="update">';
1094 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1095 print
'<input type="hidden" name="comefromclone" value="'.$comefromclone.
'">';
1099 if ($action ==
'edit' && $userWrite > 0) {
1102 print
'<table class="border centpercent">';
1106 print
'<tr><td class="titlefield fieldrequired">'.$langs->trans(
"Ref").
'</td>';
1107 print
'<td><input class="width200" name="ref" value="'.$suggestedref.
'">';
1108 print
' '.$form->textwithpicto(
'', $langs->trans(
"YouCanCompleteRef", $suggestedref));
1112 print
'<tr><td class="fieldrequired">'.$langs->trans(
"Label").
'</td>';
1113 print
'<td><input class="quatrevingtpercent" name="title" value="'.dol_escape_htmltag(
$object->title).
'"></td></tr>';
1116 print
'<tr><td class="fieldrequired">'.$langs->trans(
"Status").
'</td><td>';
1117 print
'<select class="flat" name="status" id="status">';
1118 $statuses =
$object->labelStatusShort;
1120 unset($statuses[$object::STATUS_DRAFT]);
1122 foreach ($statuses as $key => $val) {
1123 print
'<option value="'.$key.
'"'.((GETPOSTISSET(
'status') ?
GETPOST(
'status') :
$object->
status) == $key ?
' selected="selected"' :
'').
'>'.$langs->trans($val).
'</option>';
1131 print
'<tr><td>'.$langs->trans(
"Parent").
'</td><td class="maxwidthonsmartphone">';
1132 print
img_picto(
'',
'project',
'class="pictofixedwidth"');
1133 $formproject->select_projects(-1, (
string)
$object->fk_project,
'fk_project', 64, 0, 1, 1, 0, 0, 0,
'', 0, 0,
'',
'',
'');
1139 print
'<tr><td class="tdtop">';
1140 print $langs->trans(
"Usage");
1144 print
'<input type="checkbox" id="usage_opportunity" name="usage_opportunity"'.(GETPOSTISSET(
'usage_opportunity') ? (
GETPOST(
'usage_opportunity',
'alpha') !=
'' ?
' checked="checked"' :
'') : (
$object->usage_opportunity ?
' checked="checked"' :
'')).
'> ';
1145 $htmltext = $langs->trans(
"ProjectFollowOpportunity");
1146 print
'<label for="usage_opportunity">'.$form->textwithpicto($langs->trans(
"ProjectFollowOpportunity"), $htmltext).
'</label>';
1148 print
'$( document ).ready(function() {
1149 jQuery("#usage_opportunity").change(function() {
1150 set_usage_opportunity();
1153 set_usage_opportunity();
1155 function set_usage_opportunity() {
1156 console.log("set_usage_opportunity");
1157 if (jQuery("#usage_opportunity").prop("checked")) {
1158 console.log("Show opportunities fields");
1159 jQuery(".classuseopportunity").show();
1161 console.log("Hide opportunities fields "+jQuery("#usage_opportunity").prop("checked"));
1162 jQuery(".classuseopportunity").hide();
1170 print
'<input type="checkbox" id="usage_task" name="usage_task"' . (GETPOSTISSET(
'usage_task') ? (
GETPOST(
'usage_task',
'alpha') !=
'' ?
' checked="checked"' :
'') : (
$object->usage_task ?
' checked="checked"' :
'')) .
'> ';
1171 $htmltext = $langs->trans(
"ProjectFollowTasks");
1172 print
'<label for="usage_task">'.$form->textwithpicto($langs->trans(
"ProjectFollowTasks"), $htmltext).
'</label>';
1174 print
'$( document ).ready(function() {
1175 jQuery("#usage_task").change(function() {
1181 function set_usage_task() {
1182 console.log("set_usage_task");
1183 if (jQuery("#usage_task").prop("checked")) {
1184 console.log("Show task fields");
1185 jQuery(".classusetask").show();
1187 console.log("Hide task fields "+jQuery("#usage_task").prop("checked"));
1188 jQuery(".classusetask").hide();
1196 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"' :
'')) .
'> ';
1197 $htmltext = $langs->trans(
"ProjectBillTimeDescription");
1198 print
'<label for="usage_bill_time">'.$form->textwithpicto($langs->trans(
"BillTime"), $htmltext).
'</label>';
1200 print
'$( document ).ready(function() {
1201 jQuery("#usage_bill_time").change(function() {
1202 set_usage_bill_time();
1205 set_usage_bill_time();
1207 function set_usage_bill_time() {
1208 console.log("set_usage_bill_time");
1209 if (jQuery("#usage_bill_time").prop("checked")) {
1210 console.log("Show bill time fields");
1211 jQuery(".classusebilltime").show();
1213 console.log("Hide bill time fields "+jQuery("#usage_bill_time").prop("checked"));
1214 jQuery(".classusebilltime").hide();
1222 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"' :
'')) .
'> ';
1223 $htmltext = $langs->trans(
"EventOrganizationDescriptionLong");
1224 print
'<label for="usage_organize_event">'.$form->textwithpicto($langs->trans(
"ManageOrganizeEvent"), $htmltext).
'</label>';
1226 print
'$( document ).ready(function() {
1227 jQuery("#usage_organize_event").change(function() {
1233 function set_usage_event() {
1234 console.log("set_usage_event");
1235 if (jQuery("#usage_organize_event").prop("checked")) {
1236 console.log("Show organize event fields");
1237 jQuery(".classuseorganizeevent").show();
1239 console.log("Hide organize event fields "+jQuery("#usage_organize_event").prop("checked"));
1240 jQuery(".classuseorganizeevent").hide();
1253 print(!
getDolGlobalString(
'PROJECT_THIRDPARTY_REQUIRED') ?
'' :
'<span class="fieldrequired">');
1254 print $langs->trans(
"ThirdParty");
1261 $text =
img_picto(
'',
'company',
'class="pictofixedwidth"');
1262 $text .= $form->select_company(!empty(
$object->thirdparty->id) ?
$object->thirdparty->id :
"",
'socid', $filter,
'None', 1, 0, array(), 0,
'minwidth300');
1263 if (!
getDolGlobalString(
'PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS') && empty($conf->dol_use_jmobile)) {
1264 $texthelp = $langs->trans(
"IfNeedToUseOtherObjectKeepEmpty");
1265 print $form->textwithtooltip($text.
' '.
img_help(), $texthelp, 1, 0,
'',
'', 2);
1273 $classfortr = (
$object->usage_opportunity ?
'' :
' hideobject');
1275 print
'<tr class="classuseopportunity'.$classfortr.
'"><td>'.$langs->trans(
"OpportunityStatus").
'</td>';
1278 print $formproject->selectOpportunityStatus(
'opp_status', (
string)
$object->opp_status, 1, 0, 0, 0,
'minwidth150 inline-block valignmiddle', 1, 1);
1281 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) :
'')).
'"> %';
1282 print
'<span id="oldopppercent" class="opacitymedium"></span>';
1285 print
'<div id="divtocloseproject" class="inline-block valign clearboth paddingtop" style="display: none;">';
1286 print
'<input type="checkbox" id="inputcloseproject" name="closeproject" class="valignmiddle" />';
1287 print
'<label for="inputcloseproject" class="opacitymedium valignmiddle">';
1288 print $form->textwithpicto($langs->trans(
"AlsoCloseAProject"), $langs->trans(
"AlsoCloseAProjectTooltip")).
'</label>';
1295 print
'<tr class="classuseopportunity'.$classfortr.
'"><td>'.$langs->trans(
"OpportunityAmount").
'</td>';
1296 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) :
'')).
'">';
1297 print $langs->getCurrencySymbol($conf->currency);
1303 print
'<tr><td>'.$langs->trans(
"Budget").
'</td>';
1304 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) :
'')).
'">';
1305 print $langs->getCurrencySymbol($conf->currency);
1310 print
'<tr><td>'.$langs->trans(
"Date").(isModEnabled(
'eventorganization') ?
' <span class="classuseorganizeevent">('.$langs->trans(
"Project").
')</span>' :
'').
'</td><td>';
1311 print $form->selectDate(
$object->date_start ?
$object->date_start : -1,
'projectstart', 0, 0, 0,
'', 1, 0);
1312 print
' <span class="opacitymedium"> '.$langs->trans(
"to").
' </span> ';
1313 print $form->selectDate(
$object->date_end ?
$object->date_end : -1,
'projectend', 0, 0, 0,
'', 1, 0);
1314 $object->getLinesArray(
null, 0);
1316 print
' <span id="divreportdate" class="hidden"> <input type="checkbox" class="valignmiddle" id="reportdate" name="reportdate" value="yes" ';
1317 if ($comefromclone) {
1320 print
'/><label for="reportdate" class="valignmiddle opacitymedium">'.$langs->trans(
"ProjectReportDate").
'</label></span>';
1326 print
'<tr class="classuseorganizeevent"><td>'.$langs->trans(
"Date").
' ('.$langs->trans(
"Event").
')</td><td>';
1327 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);
1328 print
' <span class="opacitymedium"> '.$langs->trans(
"to").
' </span> ';
1329 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);
1333 print
'<tr class="classuseorganizeevent"><td>'.$langs->trans(
"Location").
'</td>';
1334 print
'<td><input class="minwidth300 maxwidth500" type="text" name="location" value="'.dol_escape_htmltag(GETPOSTISSET(
'location') ?
GETPOST(
'location') :
$object->location).
'"></td>';
1339 print
'<tr><td class="tdtop">'.$langs->trans(
"Description").
'</td>';
1341 $doleditor =
new DolEditor(
'description',
$object->description,
'', 90,
'dolibarr_notes',
'',
false,
true,
isModEnabled(
'fckeditor') &&
getDolGlobalInt(
'FCKEDITOR_ENABLE_SOCIETE'), ROWS_3,
'90%');
1342 $doleditor->Create();
1347 print
'<tr><td>'.$langs->trans(
"Categories").
'</td><td>';
1348 print $form->selectCategories(Categorie::TYPE_PROJECT,
'categories', $object);
1353 print
'<tr><td>'.$langs->trans(
"Visibility").
'</td><td>';
1356 $array[0] = $langs->trans(
"PrivateProject");
1359 $array[1] = $langs->trans(
"SharedProject");
1362 if (count($array) > 0) {
1363 print $form->selectarray(
'public', $array,
$object->public, 0, 0, 0,
'', 0, 0, 0,
'',
'', 1);
1365 print
'<input type="hidden" id="public" name="public" value="'.$object->public.
'">';
1368 print
img_picto($langs->trans(
'PrivateProject'),
'private',
'class="paddingrightonly"');
1369 print $langs->trans(
"PrivateProject");
1371 print
img_picto($langs->trans(
'SharedProject'),
'world',
'class="paddingrightonly"');
1372 print $langs->trans(
"SharedProject");
1378 $parameters = array();
1379 $reshook = $hookmanager->executeHooks(
'formObjectOptions', $parameters, $object, $action);
1380 print $hookmanager->resPrint;
1381 if (empty($reshook)) {
1382 print
$object->showOptionals($extrafields,
'edit');
1387 print
dol_get_fiche_head($head,
'project', $langs->trans(
"Project"), -1, (
$object->public ?
'projectpub' :
'project'), 0,
'',
'', 0,
'', 1);
1391 if (!empty($_SESSION[
'pageforbacktolist']) && !empty($_SESSION[
'pageforbacktolist'][
'project'])) {
1392 $tmpurl = $_SESSION[
'pageforbacktolist'][
'project'];
1393 $tmpurl = preg_replace(
'/__SOCID__/', (
string)
$object->socid, $tmpurl);
1394 $linkback =
'<a href="'.$tmpurl.(preg_match(
'/\?/', $tmpurl) ?
'&' :
'?').
'restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
1396 $linkback =
'<a href="'.DOL_URL_ROOT.
'/projet/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
1399 $morehtmlref =
'<div class="refidno">';
1402 $morehtmlref .=
'<br>';
1404 if (!empty(
$object->thirdparty->id) &&
$object->thirdparty->id > 0) {
1405 $morehtmlref .=
$object->thirdparty->getNomUrl(1,
'project');
1411 $parent->fetch(
$object->fk_project);
1412 $morehtmlref .= $langs->trans(
"Child of").
' '.$parent->getNomUrl(1,
'project').
' '.$parent->title;
1415 $morehtmlref .=
'</div>';
1418 if (!$user->hasRight(
'projet',
'all',
'lire')) {
1419 $objectsListId =
$object->getProjectsAuthorizedForUser($user, 0, 0);
1420 $object->next_prev_filter =
"rowid:IN:".$db->sanitize(count($objectsListId) ? implode(
',', array_keys($objectsListId)) :
'0');
1423 dol_banner_tab($object,
'ref', $linkback, 1,
'ref',
'ref', $morehtmlref);
1425 print
'<div class="fichecenter">';
1426 print
'<div class="fichehalfleft">';
1427 print
'<div class="underbanner clearboth"></div>';
1429 print
'<table class="border tableforfield centpercent">';
1433 print
'<tr><td class="tdtop">';
1434 print $langs->trans(
"Usage");
1438 print
'<input type="checkbox" disabled name="usage_opportunity"'.(GETPOSTISSET(
'usage_opportunity') ? (
GETPOST(
'usage_opportunity',
'alpha') !=
'' ?
' checked="checked"' :
'') : (
$object->usage_opportunity ?
' checked="checked"' :
'')).
'> ';
1439 $htmltext = $langs->trans(
"ProjectFollowOpportunity");
1440 print $form->textwithpicto($langs->trans(
"ProjectFollowOpportunity"), $htmltext);
1444 print
'<input type="checkbox" disabled name="usage_task"'.(GETPOSTISSET(
'usage_task') ? (
GETPOST(
'usage_task',
'alpha') !=
'' ?
' checked="checked"' :
'') : (
$object->usage_task ?
' checked="checked"' :
'')).
'> ';
1445 $htmltext = $langs->trans(
"ProjectFollowTasks");
1446 print $form->textwithpicto($langs->trans(
"ProjectFollowTasks"), $htmltext);
1450 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"' :
'')).
'> ';
1451 $htmltext = $langs->trans(
"ProjectBillTimeDescription");
1452 print $form->textwithpicto($langs->trans(
"BillTime"), $htmltext);
1457 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"' :
'')).
'> ';
1458 $htmltext = $langs->trans(
"EventOrganizationDescriptionLong");
1459 print $form->textwithpicto($langs->trans(
"ManageOrganizeEvent"), $htmltext);
1466 print
'<tr><td>'.$langs->trans(
"OpportunityStatus");
1467 if ($action !=
'edit_opp_status' && $user->hasRight(
'projet',
'creer')) {
1468 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>';
1471 $html_name_status = ($action ==
'edit_opp_status') ?
'opp_status' :
'none';
1472 $html_name_percent = ($action ==
'edit_opp_status') ?
'opp_percent' :
'none';
1474 $formproject->formOpportunityStatus($_SERVER[
'PHP_SELF'].
'?socid='.
$object->id, (
string)
$object->opp_status, $percent_value, $html_name_status, $html_name_percent);
1478 print
'<tr><td>'.$langs->trans(
"OpportunityAmount").
'</td><td>';
1479 if (strcmp(
$object->opp_amount,
'')) {
1480 print
'<span class="amount">'.price(
$object->opp_amount, 0, $langs, 1, 0, -1, $conf->currency).
'</span>';
1481 if (strcmp(
$object->opp_percent,
'')) {
1482 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>';
1489 print
'<tr><td>'.$langs->trans(
"Budget").
'</td><td>';
1490 if (!is_null(
$object->budget_amount) && strcmp(
$object->budget_amount,
'')) {
1491 print
'<span class="amount">'.price(
$object->budget_amount, 0, $langs, 1, 0, 0, $conf->currency).
'</span>';
1496 print
'<tr><td>'.$langs->trans(
"Dates").
'</td><td>';
1498 print($start ? $start :
'?');
1500 print
' <span class="opacitymedium">-</span> ';
1501 print($end ? $end :
'?');
1508 print
'<tr><td class="titlefield">'.$langs->trans(
"Visibility").
'</td><td>';
1510 print
img_picto($langs->trans(
'SharedProject'),
'world',
'class="paddingrightonly"');
1511 print $langs->trans(
'SharedProject');
1513 print
img_picto($langs->trans(
'PrivateProject'),
'private',
'class="paddingrightonly"');
1514 print $langs->trans(
'PrivateProject');
1520 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_view.tpl.php';
1525 print
'<div class="fichehalfright">';
1526 print
'<div class="underbanner clearboth"></div>';
1528 print
'<table class="border tableforfield centpercent">';
1532 print
'<tr><td class="valignmiddle">'.$langs->trans(
"Categories").
'</td><td>';
1533 print $form->showCategories(
$object->id, Categorie::TYPE_PROJECT, 1);
1538 print
'<tr><td class="titlefield'.($object->description ?
' noborderbottom' :
'').
'" colspan="2">'.$langs->trans(
"Description").
'</td></tr>';
1540 print
'<tr><td class="nottitleforfield" colspan="2">';
1541 print
'<div class="longmessagecut">';
1552 print
'<div class="clearboth"></div>';
1557 if ($action ==
'edit' && $userWrite > 0) {
1558 print $form->buttonsSaveCancel();
1564 print
'<script type="text/javascript">
1565 jQuery(document).ready(function() {
1566 jQuery("#usage_task").change(function() {
1567 console.log("We click on usage task "+jQuery("#usage_task").is(":checked"));
1568 if (! jQuery("#usage_task").is(":checked")) {
1569 jQuery("#usage_bill_time").prop("checked", false);
1573 jQuery("#usage_bill_time").change(function() {
1574 console.log("We click on usage to bill time");
1575 if (jQuery("#usage_bill_time").is(":checked")) {
1576 jQuery("#usage_task").prop("checked", true);
1580 jQuery("#projectstart").change(function() {
1581 console.log("We modify the start date");
1582 jQuery("#divreportdate").show();
1588 if (!empty($conf->use_javascript_ajax) &&
getDolGlobalString(
'PROJECT_USE_OPPORTUNITIES')) {
1590 $defaultcheckedwhenoppclose = 1;
1592 $defaultcheckedwhenoppclose = 0;
1595 print
'<!-- Javascript to manage opportunity status change -->';
1596 print
'<script type="text/javascript">
1597 jQuery(document).ready(function() {
1598 function change_percent()
1600 var element = jQuery("#opp_status option:selected");
1601 var defaultpercent = element.attr("defaultpercent");
1602 var defaultcloseproject = '.((int) $defaultcheckedwhenoppclose).
';
1603 var elemcode = element.attr("elemcode");
1606 console.log(
"We select "+elemcode);
1609 var closeproject = 0;
1610 if (elemcode == \
'LOST\') closeproject = 1;
1611 if (elemcode == \'WON\') closeproject = defaultcloseproject;
1612 if (closeproject) jQuery("#inputcloseproject").prop("checked", true);
1613 else jQuery("#inputcloseproject").prop("checked", false);
1615 /* Make the close project checkbox visible or not */
1616 console.log("closeproject="+closeproject);
1617 if (elemcode == \'WON\' || elemcode == \'LOST\')
1619 jQuery("#divtocloseproject").show();
1623 jQuery("#divtocloseproject").hide();
1626 /* Note: defaultpercent and oldpercent hold raw DB values (double(5,2), ie "100.00"),
1627 so they are already in universal numeric format and must not go through price2numjs(),
1628 which would strip the "." as a thousand separator in languages like de_DE. */
1629 /* Change percent with default percent (defaultpercent) if new status (defaultpercent) is higher than current (jQuery("#opp_percent").val()) */
1630 if (oldpercent != \'\' && (parseFloat(defaultpercent) < parseFloat(oldpercent)))
1632 console.log("oldpercent="+oldpercent+" defaultpercent="+defaultpercent+" def < old");
1633 if (jQuery("#opp_percent").val() != \'\' && oldpercent != \'\') {
1634 jQuery("#oldopppercent").text(\' - '.
dol_escape_js($langs->transnoentities(
"PreviousValue")).
': \'+parseFloat(oldpercent)+\' %\');
1637 if (parseFloat(oldpercent) != 100 && elemcode != \'LOST\') { jQuery("#opp_percent").val(parseFloat(oldpercent)); }
1638 else { jQuery("#opp_percent").val(parseFloat(defaultpercent)); }
1640 console.log("oldpercent="+oldpercent+" defaultpercent="+defaultpercent);
1641 if (jQuery("#opp_percent").val() == \'\' || (parseFloat(jQuery("#opp_percent").val()) < parseFloat(defaultpercent))) {
1642 if (jQuery("#opp_percent").val() != \'\' && oldpercent != \'\') {
1643 jQuery("#oldopppercent").text(\' - '.
dol_escape_js($langs->transnoentities(
"PreviousValue")).
': \'+parseFloat(oldpercent)+\' %\');
1645 jQuery("#opp_percent").val(parseFloat(defaultpercent));
1650 jQuery("#opp_status").change(function() {
1662 print
'<div class="tabsAction">';
1663 $parameters = array();
1664 $reshook = $hookmanager->executeHooks(
'addMoreActionsButtons', $parameters, $object, $action);
1666 if (empty($reshook)) {
1667 if ($action !=
"edit" && $action !=
'presend') {
1677 if (empty($user->socid)) {
1679 print
dolGetButtonAction(
'', $langs->trans(
'SendMail'),
'email', $_SERVER[
"PHP_SELF"].
'?action=presend&token='.
newToken().
'&id='.
$object->id.
'&mode=init#formmailbeforetitle',
'');
1699 if ($userWrite > 0) {
1700 print
dolGetButtonAction(
'', $langs->trans(
'SetToDraft'),
'default', $_SERVER[
"PHP_SELF"].
'?action=confirm_setdraft&confirm=yes&token='.
newToken().
'&id='.
$object->id,
'');
1702 print
dolGetButtonAction($langs->trans(
'NotOwnerOfProject'), $langs->trans(
'SetToDraft'),
'default', $_SERVER[
'PHP_SELF'].
'#',
'',
false);
1709 if ($userWrite > 0) {
1712 print
dolGetButtonAction($langs->trans(
'NotOwnerOfProject'), $langs->trans(
'Modify'),
'default', $_SERVER[
'PHP_SELF'].
'#',
'',
false);
1718 if ($userWrite > 0) {
1720 print
dolGetButtonAction(
'', $langs->trans(
'Validate'),
'default', $_SERVER[
"PHP_SELF"].
'?action=confirm_validate&confirm=yes&token='.
newToken().
'&id='.
$object->id,
'');
1722 print
dolGetButtonAction($langs->trans(
'NotOwnerOfProject'), $langs->trans(
'Validate'),
'default', $_SERVER[
'PHP_SELF'].
'#',
'',
false);
1728 if ($userWrite > 0) {
1730 print
dolGetButtonAction(
'', $langs->trans(
'Close'),
'default', $_SERVER[
"PHP_SELF"].
'?action=confirm_close&confirm=yes&token='.
newToken().
'&id='.
$object->id,
'');
1732 print
dolGetButtonAction($langs->trans(
'NotOwnerOfProject'), $langs->trans(
'Close'),
'default', $_SERVER[
'PHP_SELF'].
'#',
'',
false);
1738 if ($userWrite > 0) {
1741 print
dolGetButtonAction($langs->trans(
'NotOwnerOfProject'), $langs->trans(
'ReOpen'),
'default', $_SERVER[
'PHP_SELF'].
'#',
'',
false);
1749 $is_customer_or_prospect = (!empty(
$object->thirdparty->prospect) || !empty(
$object->thirdparty->client));
1750 $is_supplier_only= (!empty(
$object->thirdparty->fournisseur) && !$is_customer_or_prospect);
1752 $arrayforbutaction = array(
1753 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),
1754 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),
1755 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),
1756 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 :
'')),
1757 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 :
'')),
1758 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 :
'')),
1759 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),
1760 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),
1761 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),
1762 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),
1765 $params = array(
'backtopage' => $_SERVER[
"PHP_SELF"].
'?id='.
$object->id);
1768 print
dolGetButtonAction(
'', $langs->trans(
"Create"),
'default', $arrayforbutaction,
'', 1, $params);
1772 if ($user->hasRight(
'projet',
'creer')) {
1773 if ($userWrite > 0) {
1776 print
dolGetButtonAction($langs->trans(
'NotOwnerOfProject'), $langs->trans(
'ToClone'),
'default', $_SERVER[
'PHP_SELF'].
'#',
'',
false);
1785 print
dolGetButtonAction($langs->trans(
'NotOwnerOfProject'), $langs->trans(
'Delete'),
'default', $_SERVER[
'PHP_SELF'].
'#',
'',
false);
1793 if (
GETPOST(
'modelselected')) {
1794 $action =
'presend';
1797 if ($action !=
'presend') {
1798 print
'<div class="fichecenter"><div class="fichehalfleft">';
1799 print
'<a name="builddoc"></a>';
1805 $children =
$object->getChildren();
1807 print
'<table class="centpercent notopnoleftnoright table-fiche-title">';
1808 print
'<tr class="titre"><td class="nobordernopadding valignmiddle col-title">';
1809 print
'<div class="titre inline-block">'.$langs->trans(
'Sub-projects').
'</div>';
1810 print
'</td></tr></table>';
1812 print
'<div class="div-table-responsive-no-min">';
1813 print
'<table class="centpercent noborder'.($morecss ?
' '.$morecss :
'').
'">';
1814 print
'<tr class="liste_titre">';
1815 print
getTitleFieldOfList(
'Ref', 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'',
'',
'',
'', 1);
1816 print
getTitleFieldOfList(
'Title', 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'',
'',
'',
'', 1);
1817 print
getTitleFieldOfList(
'Status', 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'',
'',
'',
'', 1);
1821 $subproject =
new Project($db);
1822 foreach ($children as $child) {
1823 $subproject->fetch($child->rowid);
1824 print
'<tr class="oddeven">';
1825 print
'<td class="nowraponall">'.$subproject->getNomUrl(1,
'project').
'</td>';
1826 print
'<td class="nowraponall tdoverflowmax125">'.$child->title.
'</td>';
1827 print
'<td class="nowraponall">'.$subproject->getLibStatut(5).
'</td>';
1841 $urlsource = $_SERVER[
"PHP_SELF"].
"?id=".
$object->id;
1842 $genallowed = ($user->hasRight(
'projet',
'lire') && $userAccess > 0);
1843 $delallowed = ($user->hasRight(
'projet',
'creer') && $userWrite > 0);
1845 print $formfile->showdocuments(
'project', $filename, $filedir, $urlsource, (
int) $genallowed, (int) $delallowed,
$object->model_pdf, 1, 0, 0, 0, 0,
'',
'',
'',
'',
'', $object);
1847 print
'</div><div class="fichehalfright">';
1851 $morehtmlcenter =
'<div class="nowraponall">';
1852 $morehtmlcenter .=
dolGetButtonTitle($langs->trans(
'FullConversation'),
'',
'fa fa-comments imgforviewmode', DOL_URL_ROOT.
'/projet/messaging.php?id='.
$object->id);
1853 $morehtmlcenter .=
dolGetButtonTitle($langs->trans(
'FullList'),
'',
'fa fa-bars imgforviewmode', DOL_URL_ROOT.
'/projet/agenda.php?id='.
$object->id);
1854 $morehtmlcenter .=
'</div>';
1857 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formactions.class.php';
1859 $somethingshown = $formactions->showactions($object,
'project', 0, 1,
'', $MAXEVENT,
'', $morehtmlcenter);
1861 print
'</div></div>';
1865 $modelmail =
'project';
1866 $defaulttopic =
'SendProjectRef';
1867 $defaulttopiclang =
'projects';
1868 $diroutput = $conf->project->multidir_output[
$object->entity ?? $conf->entity];
1869 $autocopy =
'MAIN_MAIL_AUTOCOPY_PROJECT_TO';
1870 $trackid =
'proj'.$object->id;
1872 include DOL_DOCUMENT_ROOT.
'/core/tpl/card_presend.tpl.php';
1875 $parameters = array();
1876 $reshook = $hookmanager->executeHooks(
'mainCardTabAddMore', $parameters, $object, $action);
$id
Support class for third parties, contacts, members, users or resources.
if(! $sortfield) if(! $sortorder) $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 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_now($mode='gmt')
Return date for now.
recordNotFound($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Displays an error page when a record is not found.
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...
dol_getIdFromCode($db, $key, $tablename, $fieldkey='code', $fieldid='id', $entityfilter=0, $filters='', $useCache=true)
Return an id or code from a code or id.
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, $morecssdiv='')
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 '.
dolButtonToOpenUrlInDialogPopup($name, $label, $buttonstring, $url, $disabled='', $morecss='classlink button bordertransp', $jsonopen='', $jsonclose='', $accesskey='')
Return HTML code to output a button to open a dialog popup box.
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.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
dol_eval($s, $returnvalue=1, $hideerrors=1, $onlysimplestring='1')
Replace eval function to add more security.
setEventMessage($mesgs, $style='mesgs', $noduplicate=0, $attop=0)
Set event message in dol_events session object.
dol_sanitizeFileName($str, $newstr='_', $unaccent=1, $includequotes=0, $allowdash=0)
Clean a string to use it as a file name.
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.
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.
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'.
GETPOSTFLOAT($paramname, $rounding='', $option=2)
Return the value of a $_GET or $_POST supervariable, converted into float.
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.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
dol_clone($srcobject, $native=2)
Create a clone of instance of object (new instance with same value for each properties) With native =...
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false, $decorate=0)
Output date in a string format according to outputlangs (or langs if not defined).
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='', $morecssonpicto='widthpictotitle')
Load a title with picto.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
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...
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.