29require
'../main.inc.php';
30require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
31require_once DOL_DOCUMENT_ROOT.
'/projet/class/task.class.php';
32require_once DOL_DOCUMENT_ROOT.
'/core/lib/project.lib.php';
33require_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
34require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formprojet.class.php';
35require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
36require_once DOL_DOCUMENT_ROOT.
'/core/modules/project/modules_project.php';
37require_once DOL_DOCUMENT_ROOT.
'/core/class/extrafields.class.php';
38require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
41$langsLoad=array(
'projects',
'companies');
42if (isModEnabled(
'eventorganization')) {
43 $langsLoad[]=
'eventorganization';
46$langs->loadLangs($langsLoad);
50$action =
GETPOST(
'action',
'aZ09');
51$backtopage =
GETPOST(
'backtopage',
'alpha');
52$backtopageforcancel =
GETPOST(
'backtopageforcancel',
'alpha');
53$backtopagejsfields =
GETPOST(
'backtopagejsfields',
'alpha');
54$cancel =
GETPOST(
'cancel',
'alpha');
55$confirm =
GETPOST(
'confirm',
'aZ09');
58if (!empty($backtopagejsfields)) {
59 $tmpbacktopagejsfields = explode(
':', $backtopagejsfields);
60 $dol_openinpopup = $tmpbacktopagejsfields[0];
63$status =
GETPOST(
'status',
'int');
64$opp_status =
GETPOST(
'opp_status',
'int');
66$objcanvas =
GETPOST(
"objcanvas",
"alphanohtml");
67$comefromclone =
GETPOST(
"comefromclone",
"alphanohtml");
72$location =
GETPOST(
'location',
'alphanohtml');
76$mine =
GETPOST(
'mode') ==
'mine' ? 1 : 0;
80$hookmanager->initHooks(array(
'projectcard',
'globalcard'));
87if ($id > 0 || !empty($ref)) {
88 $ret = $object->fetch($id, $ref);
90 $object->fetch_thirdparty();
91 if (
getDolGlobalString(
'PROJECT_ALLOW_COMMENT_ON_PROJECT') && method_exists($object,
'fetchComments') && empty($object->comments)) {
92 $object->fetchComments();
99$extrafields->fetch_name_optionals_label($object->table_element);
102$socid =
GETPOST(
'socid',
'int');
106if ($id ==
'' && $ref ==
'' && ($action !=
"create" && $action !=
"add" && $action !=
"update" && !
GETPOST(
"cancel"))) {
110$permissiontoadd = $user->hasRight(
'projet',
'creer');
111$permissiontodelete = $user->hasRight(
'projet',
'supprimer');
112$permissiondellink = $user->hasRight(
'projet',
'creer');
119$parameters = array(
'id'=>$socid,
'objcanvas'=>$objcanvas);
120$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
125if (empty($reshook)) {
126 $backurlforlist = DOL_URL_ROOT.
'/projet/list.php';
130 if (
GETPOST(
"comefromclone") == 1) {
131 $result = $object->delete($user);
133 header(
"Location: index.php");
137 setEventMessages($langs->trans(
"CantRemoveProject", $langs->transnoentitiesnoconv(
"ProjectOverview")),
null,
'errors');
142 if (empty($backtopage) || ($cancel && empty($id))) {
143 if (empty($backtopage) || ($cancel && strpos($backtopage,
'__ID__'))) {
144 if (empty($id) && (($action !=
'add' && $action !=
'create') || $cancel)) {
145 $backtopage = $backurlforlist;
147 $backtopage = DOL_URL_ROOT.
'/projet/card.php?id='.((!empty($id) && $id > 0) ? $id :
'__ID__');
153 if (!empty($backtopageforcancel)) {
154 header(
"Location: ".$backtopageforcancel);
156 } elseif (!empty($backtopage)) {
157 header(
"Location: ".$backtopage);
163 include DOL_DOCUMENT_ROOT.
'/core/actions_dellink.inc.php';
166 if ($action ==
'confirm_setdraft' && $confirm ==
'yes' && $permissiontoadd) {
167 $result = $object->setStatut($object::STATUS_DRAFT,
null,
'',
'PROJECT_MODIFY');
178 if ($action ==
'add' && $permissiontoadd) {
181 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Ref")),
null,
'errors');
185 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"ProjectLabel")),
null,
'errors');
190 if (
GETPOST(
'usage_opportunity') !=
'' && !(
GETPOST(
'opp_status') > 0)) {
192 setEventMessages($langs->trans(
"ErrorOppStatusRequiredIfUsage"),
null,
'errors');
194 if (
GETPOST(
'opp_amount') !=
'' && !(
GETPOST(
'opp_status') > 0)) {
196 setEventMessages($langs->trans(
"ErrorOppStatusRequiredIfAmount"),
null,
'errors');
210 $object->ref =
GETPOST(
'ref',
'alphanohtml');
211 $object->fk_project =
GETPOST(
'fk_project',
'int');
212 $object->title =
GETPOST(
'title',
'alphanohtml');
213 $object->socid =
GETPOST(
'socid',
'int');
214 $object->description =
GETPOST(
'description',
'restricthtml');
215 $object->public =
GETPOST(
'public',
'alphanohtml');
217 $object->budget_amount =
price2num(
GETPOST(
'budget_amount',
'alphanohtml'));
219 $object->date_start = $date_start;
220 $object->date_end = $date_end;
221 $object->date_start_event = $date_start_event;
222 $object->date_end_event = $date_end_event;
223 $object->location = $location;
224 $object->statut = $status;
225 $object->opp_status = $opp_status;
226 $object->opp_percent = $opp_percent;
227 $object->usage_opportunity = (
GETPOST(
'usage_opportunity',
'alpha') ==
'on' ? 1 : 0);
228 $object->usage_task = (
GETPOST(
'usage_task',
'alpha') ==
'on' ? 1 : 0);
229 $object->usage_bill_time = (
GETPOST(
'usage_bill_time',
'alpha') ==
'on' ? 1 : 0);
230 $object->usage_organize_event = (
GETPOST(
'usage_organize_event',
'alpha') ==
'on' ? 1 : 0);
233 $ret = $extrafields->setOptionalsFromPost(
null, $object);
238 $result = $object->create($user);
239 if (!$error && $result > 0) {
241 $typeofcontact =
'PROJECTLEADER';
242 $result = $object->add_contact($user->id, $typeofcontact,
'internal');
248 } elseif ($result < 0) {
249 $langs->load(
"errors");
254 $langs->load(
"errors");
258 if (!$error && !empty($object->id) > 0) {
260 $categories =
GETPOST(
'categories',
'array');
261 $result = $object->setCategories($categories);
263 $langs->load(
"errors");
272 if (!empty($backtopage)) {
273 $backtopage = preg_replace(
'/--IDFORBACKTOPAGE--|__ID__/', $object->id, $backtopage);
274 $backtopage = $backtopage.
'&projectid='.$object->id;
275 header(
"Location: ".$backtopage);
278 header(
"Location:card.php?id=".$object->id);
283 unset($_POST[
"ref"]);
291 if ($action ==
'update' && empty(
GETPOST(
'cancel')) && $permissiontoadd) {
296 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Ref")),
null,
'errors');
300 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"ProjectLabel")),
null,
'errors');
306 $object->oldcopy = clone $object;
308 $old_start_date = $object->date_start;
310 $object->ref =
GETPOST(
'ref',
'alpha');
311 $object->fk_project =
GETPOST(
'fk_project',
'int');
312 $object->title =
GETPOST(
'title',
'alphanohtml');
313 $object->statut =
GETPOST(
'status',
'int');
314 $object->socid =
GETPOST(
'socid',
'int');
315 $object->description =
GETPOST(
'description',
'restricthtml');
316 $object->public =
GETPOST(
'public',
'alpha');
317 $object->date_start = (!
GETPOST(
'projectstart')) ?
'' : $date_start;
318 $object->date_end = (!
GETPOST(
'projectend')) ?
'' : $date_end;
319 $object->date_start_event = (!
GETPOST(
'date_start_event')) ?
'' : $date_start_event;
320 $object->date_end_event = (!
GETPOST(
'date_end_event')) ?
'' : $date_end_event;
321 $object->location = $location;
322 if (GETPOSTISSET(
'opp_amount')) {
325 if (GETPOSTISSET(
'budget_amount')) {
328 if (GETPOSTISSET(
'opp_status')) {
329 $object->opp_status = $opp_status;
331 if (GETPOSTISSET(
'opp_percent')) {
332 $object->opp_percent = $opp_percent;
334 $object->usage_opportunity = (
GETPOST(
'usage_opportunity',
'alpha') ==
'on' ? 1 : 0);
335 $object->usage_task = (
GETPOST(
'usage_task',
'alpha') ==
'on' ? 1 : 0);
336 $object->usage_bill_time = (
GETPOST(
'usage_bill_time',
'alpha') ==
'on' ? 1 : 0);
337 $object->usage_organize_event = (
GETPOST(
'usage_organize_event',
'alpha') ==
'on' ? 1 : 0);
340 $ret = $extrafields->setOptionalsFromPost(
null, $object,
'@GETPOSTISSET');
347 if ($object->opp_amount && ($object->opp_status <= 0)) {
349 setEventMessages($langs->trans(
"ErrorOppStatusRequiredIfAmount"),
null,
'errors');
354 $result = $object->update($user);
364 $categories =
GETPOST(
'categories',
'array');
365 $result = $object->setCategories($categories);
374 if (
GETPOST(
"reportdate") && ($object->date_start != $old_start_date)) {
375 $result = $object->shiftTaskDate($old_start_date);
378 setEventMessages($langs->trans(
"ErrorShiftTaskDate").
':'.$object->error, $object->errors,
'errors');
385 $resclose = $object->setClose($user);
388 setEventMessages($langs->trans(
"FailedToCloseProject").
':'.$object->error, $object->errors,
'errors');
399 if (
GETPOST(
'socid',
'int') > 0) {
400 $object->fetch_thirdparty(
GETPOST(
'socid',
'int'));
402 unset($object->thirdparty);
408 if ($action ==
'builddoc' && $permissiontoadd) {
411 $object->setDocModel($user,
GETPOST(
'model',
'alpha'));
414 $outputlangs = $langs;
415 if (
GETPOST(
'lang_id',
'aZ09')) {
417 $outputlangs->setDefaultLang(
GETPOST(
'lang_id',
'aZ09'));
419 $result = $object->generateDocument($object->model_pdf, $outputlangs);
427 if ($action ==
'remove_file' && $permissiontoadd) {
428 if ($object->id > 0) {
429 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
431 $langs->load(
"other");
432 $upload_dir = $conf->project->multidir_output[$object->entity];
433 $file = $upload_dir.
'/'.
GETPOST(
'file');
445 if ($action ==
'confirm_validate' && $confirm ==
'yes' && $permissiontoadd) {
446 $result = $object->setValid($user);
452 if ($action ==
'confirm_close' && $confirm ==
'yes' && $permissiontoadd) {
453 $result = $object->setClose($user);
459 if ($action ==
'confirm_reopen' && $confirm ==
'yes' && $permissiontoadd) {
460 $result = $object->setValid($user);
466 if ($action ==
'confirm_delete' && $confirm ==
'yes' && $permissiontodelete) {
468 $result = $object->delete($user);
472 if (!empty($_SESSION[
'pageforbacktolist']) && !empty($_SESSION[
'pageforbacktolist'][
'project'])) {
473 $tmpurl = $_SESSION[
'pageforbacktolist'][
'project'];
474 $tmpurl = preg_replace(
'/__SOCID__/', $object->socid, $tmpurl);
475 $urlback = $tmpurl.(preg_match(
'/\?/', $tmpurl) ?
'&' :
'?').
'restore_lastsearch_values=1';
477 $urlback = DOL_URL_ROOT.
'/projet/list.php?restore_lastsearch_values=1';
480 header(
"Location: ".$urlback);
488 if ($action ==
'confirm_clone' && $permissiontoadd && $confirm ==
'yes') {
489 $clone_contacts =
GETPOST(
'clone_contacts') ? 1 : 0;
490 $clone_tasks =
GETPOST(
'clone_tasks') ? 1 : 0;
491 $clone_project_files =
GETPOST(
'clone_project_files') ? 1 : 0;
492 $clone_task_files =
GETPOST(
'clone_task_files') ? 1 : 0;
493 $clone_notes =
GETPOST(
'clone_notes') ? 1 : 0;
494 $move_date =
GETPOST(
'move_date') ? 1 : 0;
495 $clone_thirdparty =
GETPOST(
'socid',
'int') ?
GETPOST(
'socid',
'int') : 0;
497 $result = $object->createFromClone($user, $object->id, $clone_contacts, $clone_tasks, $clone_project_files, $clone_task_files, $clone_notes, $move_date, 0, $clone_thirdparty);
503 $newobject->fetch($result);
504 $newobject->fetch_optionals();
505 $newobject->fetch_thirdparty();
506 $object = $newobject;
508 $comefromclone =
true;
510 setEventMessages($langs->trans(
"ProjectCreatedInDolibarr", $newobject->ref),
"",
'mesgs');
516 $triggersendname =
'PROJECT_SENTBYMAIL';
518 $autocopy =
'MAIN_MAIL_AUTOCOPY_PROJECT_TO';
519 $trackid =
'proj'.$object->id;
520 include DOL_DOCUMENT_ROOT.
'/core/actions_sendmails.inc.php';
528$form =
new Form($db);
531$userstatic =
new User($db);
533$title = $langs->trans(
"Project").
' - '.$object->ref.(!empty($object->thirdparty->name) ?
' - '.$object->thirdparty->name :
'').(!empty($object->title) ?
' - '.$object->title :
'');
534if (
getDolGlobalString(
'MAIN_HTML_TITLE') && preg_match(
'/projectnameonly/', $conf->global->MAIN_HTML_TITLE)) {
535 $title = $object->ref.(!empty($object->thirdparty->name) ?
' - '.$object->thirdparty->name :
'').(!empty($object->title) ?
' - '.$object->title :
'');
538$help_url =
"EN:Module_Projects|FR:Module_Projets|ES:Módulo_Proyectos|DE:Modul_Projekte";
542$titleboth = $langs->trans(
"LeadsOrProjects");
543$titlenew = $langs->trans(
"NewLeadOrProject");
545 $titleboth = $langs->trans(
"Projects");
546 $titlenew = $langs->trans(
"NewProject");
549 $titleboth = $langs->trans(
"Leads");
550 $titlenew = $langs->trans(
"NewLead");
553if ($action ==
'create' && $user->hasRight(
'projet',
'creer')) {
558 $thirdparty =
new Societe($db);
560 $thirdparty->fetch($socid);
565 print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">';
566 print
'<input type="hidden" name="action" value="add">';
567 print
'<input type="hidden" name="token" value="'.newToken().
'">';
568 print
'<input type="hidden" name="backtopage" value="'.$backtopage.
'">';
569 print
'<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.
'">';
570 print
'<input type="hidden" name="backtopagejsfields" value="'.$backtopagejsfields.
'">';
571 print
'<input type="hidden" name="dol_openinpopup" value="'.$dol_openinpopup.
'">';
575 print
'<table class="border centpercent tableforfieldcreate">';
578 $modele = !
getDolGlobalString(
'PROJECT_ADDON') ?
'mod_project_simple' : $conf->global->PROJECT_ADDON;
584 $dirmodels = array_merge(array(
'/'), (array) $conf->modules_parts[
'models']);
585 foreach ($dirmodels as $reldir) {
586 $file =
dol_buildpath($reldir.
"core/modules/project/".$modele.
'.php', 0);
587 if (file_exists($file)) {
589 $classname = $modele;
596 $modProject =
new $classname();
598 $defaultref = $modProject->getNextValue($thirdparty, $object);
601 if (is_numeric($defaultref) && $defaultref <= 0) {
607 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).
'">';
609 print
' '.$form->textwithpicto(
'', $langs->trans(
"YouCanCompleteRef", $suggestedref));
614 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>';
618 print
'<tr><td>'.$langs->trans(
"Parent").
'</td><td class="maxwidthonsmartphone">';
619 print
img_picto(
'',
'project',
'class="pictofixedwidth"');
620 $formproject->select_projects(-1,
'',
'fk_project', 64, 0, 1, 1, 0, 0, 0,
'', 0, 0,
'',
'',
'');
626 print
'<tr><td class="tdtop">';
627 print $langs->trans(
"Usage");
631 print
'<input type="checkbox" id="usage_opportunity" name="usage_opportunity"'.(GETPOSTISSET(
'usage_opportunity') ? (
GETPOST(
'usage_opportunity',
'alpha') ?
' checked="checked"' :
'') :
' checked="checked"').
'"> ';
632 $htmltext = $langs->trans(
"ProjectFollowOpportunity");
633 print
'<label for="usage_opportunity">'.$form->textwithpicto($langs->trans(
"ProjectFollowOpportunity"), $htmltext).
'</label>';
635 print
'$( document ).ready(function() {
636 jQuery("#usage_opportunity").change(function() {
637 if (jQuery("#usage_opportunity").prop("checked")) {
638 console.log("Show opportunities fields");
639 jQuery(".classuseopportunity").show();
641 console.log("Hide opportunities fields "+jQuery("#usage_opportunity").prop("checked"));
642 jQuery(".classuseopportunity").hide();
646 if (GETPOSTISSET(
'usage_opportunity') && !
GETPOST(
'usage_opportunity')) {
647 print
'jQuery(".classuseopportunity").hide();';
654 print
'<input type="checkbox" id="usage_task" name="usage_task"'.(GETPOSTISSET(
'usage_task') ? (
GETPOST(
'usage_task',
'alpha') ?
' checked="checked"' :
'') :
' checked="checked"').
'"> ';
655 $htmltext = $langs->trans(
"ProjectFollowTasks");
656 print
'<label for="usage_task">'.$form->textwithpicto($langs->trans(
"ProjectFollowTasks"), $htmltext).
'</label>';
658 print
'$( document ).ready(function() {
659 jQuery("#usage_task").change(function() {
660 if (jQuery("#usage_task").prop("checked")) {
661 console.log("Show task fields");
662 jQuery(".classusetask").show();
664 console.log("Hide tasks fields "+jQuery("#usage_task").prop("checked"));
665 jQuery(".classusetask").hide();
669 if (GETPOSTISSET(
'usage_task') && !
GETPOST(
'usage_task')) {
670 print
'jQuery(".classusetask").hide();';
677 print
'<input type="checkbox" id="usage_bill_time" name="usage_bill_time"'.(GETPOSTISSET(
'usage_bill_time') ? (
GETPOST(
'usage_bill_time',
'alpha') ?
' checked="checked"' :
'') :
'').
'"> ';
678 $htmltext = $langs->trans(
"ProjectBillTimeDescription");
679 print
'<label for="usage_bill_time">'.$form->textwithpicto($langs->trans(
"BillTime"), $htmltext).
'</label>';
681 print
'$( document ).ready(function() {
682 jQuery("#usage_bill_time").change(function() {
683 if (jQuery("#usage_bill_time").prop("checked")) {
684 console.log("Show bill time fields");
685 jQuery(".classusebilltime").show();
687 console.log("Hide bill time fields "+jQuery("#usage_bill_time").prop("checked"));
688 jQuery(".classusebilltime").hide();
692 if (GETPOSTISSET(
'usage_bill_time') && !
GETPOST(
'usage_bill_time')) {
693 print
'jQuery(".classusebilltime").hide();';
699 if (isModEnabled(
'eventorganization')) {
700 print
'<input type="checkbox" id="usage_organize_event" name="usage_organize_event"'.(GETPOSTISSET(
'usage_organize_event') ? (
GETPOST(
'usage_organize_event',
'alpha') ?
' checked="checked"' :
'') :
'').
'"> ';
701 $htmltext = $langs->trans(
"EventOrganizationDescriptionLong");
702 print
'<label for="usage_organize_event">'.$form->textwithpicto($langs->trans(
"ManageOrganizeEvent"), $htmltext).
'</label>';
704 print
'$( document ).ready(function() {
705 jQuery("#usage_organize_event").change(function() {
706 if (jQuery("#usage_organize_event").prop("checked")) {
707 console.log("Show organize event fields");
708 jQuery(".classuseorganizeevent").show();
710 console.log("Hide organize event fields "+jQuery("#usage_organize_event").prop("checked"));
711 jQuery(".classuseorganizeevent").hide();
715 if (!
GETPOST(
'usage_organize_event')) {
716 print
'jQuery(".classuseorganizeevent").hide();';
726 if (isModEnabled(
'societe')) {
728 print(!
getDolGlobalString(
'PROJECT_THIRDPARTY_REQUIRED') ?
'' :
'<span class="fieldrequired">');
729 print $langs->trans(
"ThirdParty");
731 print
'</td><td class="maxwidthonsmartphone">';
734 $filter = $conf->global->PROJECT_FILTER_FOR_THIRDPARTY_LIST;
736 $text =
img_picto(
'',
'company').$form->select_company(
GETPOST(
'socid',
'int'),
'socid', $filter,
'SelectThirdParty', 1, 0, array(), 0,
'minwidth300 widthcentpercentminusxx maxwidth500');
737 if (!
getDolGlobalString(
'PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS') && empty($conf->dol_use_jmobile)) {
738 $texthelp = $langs->trans(
"IfNeedToUseOtherObjectKeepEmpty");
739 print $form->textwithtooltip($text.
' '.
img_help(), $texthelp, 1);
743 if (!GETPOSTISSET(
'backtopage')) {
744 $url =
'/societe/card.php?action=create&client=3&fournisseur=0&backtopage='.urlencode($_SERVER[
"PHP_SELF"].
'?action=create');
745 $newbutton =
'<span class="fa fa-plus-circle valignmiddle paddingleft" title="'.$langs->trans(
"AddThirdParty").
'"></span>';
748 $tmpbacktopagejsfields =
'addthirdparty:socid,search_socid';
749 print
dolButtonToOpenUrlInDialogPopup(
'addthirdparty', $langs->transnoentitiesnoconv(
'AddThirdParty'), $newbutton, $url,
'',
'',
'', $tmpbacktopagejsfields);
751 print
' <a href="'.DOL_URL_ROOT.$url.
'">'.$newbutton.
'</a>';
759 print
'<tr><td>'.$langs->trans(
"Status").
'</td><td>';
760 print
'<input type="hidden" name="status" value="'.$status.
'">';
761 print $object->LibStatut($status, 4);
766 print
'<tr><td>'.$langs->trans(
"Visibility").
'</td><td class="maxwidthonsmartphone">';
769 $array[0] = $langs->trans(
"PrivateProject");
772 $array[1] = $langs->trans(
"SharedProject");
775 if (count($array) > 0) {
776 print $form->selectarray(
'public', $array,
GETPOST(
'public'), 0, 0, 0,
'', 0, 0, 0,
'',
'', 1);
778 print
'<input type="hidden" name="public" id="public" value="'.GETPOST(
'public').
'">';
781 print
img_picto($langs->trans(
'PrivateProject'),
'private',
'class="paddingrightonly"');
782 print $langs->trans(
"PrivateProject");
784 print
img_picto($langs->trans(
'SharedProject'),
'world',
'class="paddingrightonly"');
785 print $langs->trans(
"SharedProject");
792 print
'<tr class="classuseopportunity"><td><span class="fieldrequired">'.$langs->trans(
"OpportunityStatus").
'</span></td>';
793 print
'<td class="maxwidthonsmartphone">';
794 print $formproject->selectOpportunityStatus(
'opp_status', GETPOSTISSET(
'opp_status') ?
GETPOST(
'opp_status') : $object->opp_status, 1, 0, 0, 0,
'', 0, 1);
797 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>';
798 print
'<input type="hidden" name="opp_percent_not_set" id="opp_percent_not_set" value="'.dol_escape_htmltag(GETPOSTISSET(
'opp_percent') ?
'0' :
'1').
'">';
803 print
'<tr class="classuseopportunity"><td>'.$langs->trans(
"OpportunityAmount").
'</td>';
804 print
'<td><input class="width75 right" type="text" name="opp_amount" value="'.dol_escape_htmltag(GETPOSTISSET(
'opp_amount') ?
GETPOST(
'opp_amount') :
'').
'">';
805 print
' '.$langs->getCurrencySymbol($conf->currency);
811 print
'<tr><td>'.$langs->trans(
"Budget").
'</td>';
812 print
'<td><input class="width75 right" type="text" name="budget_amount" value="'.dol_escape_htmltag(GETPOSTISSET(
'budget_amount') ?
GETPOST(
'budget_amount') :
'').
'">';
813 print
' '.$langs->getCurrencySymbol($conf->currency);
818 print
'<tr><td>'.$langs->trans(
"Date").(isModEnabled(
'eventorganization') ?
' <span class="classuseorganizeevent">('.$langs->trans(
"Project").
')</span>' :
'').
'</td><td>';
819 print $form->selectDate(($date_start ? $date_start :
''),
'projectstart', 0, 0, 0,
'', 1, 0);
820 print
' <span class="opacitymedium"> '.$langs->trans(
"to").
' </span> ';
821 print $form->selectDate(($date_end ? $date_end : -1),
'projectend', 0, 0, 0,
'', 1, 0);
824 if (isModEnabled(
'eventorganization')) {
826 print
'<tr class="classuseorganizeevent"><td>'.$langs->trans(
"Date").
' ('.$langs->trans(
"Event").
')</td><td>';
827 print $form->selectDate(($date_start_event ? $date_start_event : -1),
'date_start_event', 1, 1, 1,
'', 1, 0);
828 print
' <span class="opacitymedium"> '.$langs->trans(
"to").
' </span> ';
829 print $form->selectDate(($date_end_event ? $date_end_event : -1),
'date_end_event', 1, 1, 1,
'', 1, 0);
833 print
'<tr class="classuseorganizeevent"><td>'.$langs->trans(
"Location").
'</td>';
834 print
'<td><input class="minwidth300 maxwidth500" type="text" name="location" value="'.dol_escape_htmltag($location).
'"></td>';
839 print
'<tr><td class="tdtop">'.$langs->trans(
"Description").
'</td>';
841 $doleditor =
new DolEditor(
'description',
GETPOST(
"description",
'restricthtml'),
'', 90,
'dolibarr_notes',
'',
false,
true,
getDolGlobalString(
'FCKEDITOR_ENABLE_SOCIETE'), ROWS_3,
'90%');
842 $doleditor->Create();
845 if (isModEnabled(
'categorie')) {
847 print
'<tr><td>'.$langs->trans(
"Categories").
'</td><td colspan="3">';
848 $cate_arbo = $form->select_all_categories(Categorie::TYPE_PROJECT,
'',
'parent', 64, 0, 1);
849 $arrayselected =
GETPOST(
'categories',
'array');
850 print
img_picto(
'',
'category',
'class="pictofixedwidth"').$form->multiselectarray(
'categories', $cate_arbo, $arrayselected,
'', 0,
'quatrevingtpercent widthcentpercentminusx', 0, 0);
855 $parameters = array();
856 $reshook = $hookmanager->executeHooks(
'formObjectOptions', $parameters, $object, $action);
857 print $hookmanager->resPrint;
858 if (empty($reshook)) {
859 print $object->showOptionals($extrafields,
'create');
866 print $form->buttonsSaveCancel(
'CreateDraft');
872 print
'<script type="text/javascript">
873 jQuery(document).ready(function() {
874 function change_percent()
876 var element = jQuery("#opp_status option:selected");
877 var defaultpercent = element.attr("defaultpercent");
878 /*if (jQuery("#opp_percent_not_set").val() == "") */
879 jQuery("#opp_percent").val(defaultpercent);
883 jQuery("#opp_status").change(function() {
887 jQuery("#usage_task").change(function() {
888 console.log("We click on usage task "+jQuery("#usage_task").is(":checked"));
889 if (! jQuery("#usage_task").is(":checked")) {
890 jQuery("#usage_bill_time").prop("checked", false);
894 jQuery("#usage_bill_time").change(function() {
895 console.log("We click on usage to bill time");
896 if (jQuery("#usage_bill_time").is(":checked")) {
897 jQuery("#usage_task").prop("checked", true);
902} elseif ($object->id > 0) {
907 $res = $object->fetch_optionals();
910 $userAccess = $object->restrictedProjectArea($user,
'read');
911 $userWrite = $object->restrictedProjectArea($user,
'write');
912 $userDelete = $object->restrictedProjectArea($user,
'delete');
917 if ($action ==
'validate') {
918 print $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.$object->id, $langs->trans(
'ValidateProject'), $langs->trans(
'ConfirmValidateProject'),
'confirm_validate',
'', 0, 1);
921 if ($action ==
'close') {
922 print $form->formconfirm($_SERVER[
"PHP_SELF"].
"?id=".$object->id, $langs->trans(
"CloseAProject"), $langs->trans(
"ConfirmCloseAProject"),
"confirm_close",
'',
'', 1);
925 if ($action ==
'reopen') {
926 print $form->formconfirm($_SERVER[
"PHP_SELF"].
"?id=".$object->id, $langs->trans(
"ReOpenAProject"), $langs->trans(
"ConfirmReOpenAProject"),
"confirm_reopen",
'',
'', 1);
929 if ($action ==
'delete') {
930 $text = $langs->trans(
"ConfirmDeleteAProject");
931 $task =
new Task($db);
932 $taskarray = $task->getTasksArray(0, 0, $object->id, 0, 0);
933 $nboftask = count($taskarray);
935 $text .=
'<br>'.img_warning().
' '.$langs->trans(
"ThisWillAlsoRemoveTasks", $nboftask);
937 print $form->formconfirm($_SERVER[
"PHP_SELF"].
"?id=".$object->id, $langs->trans(
"DeleteAProject"), $text,
"confirm_delete",
'',
'', 1);
941 if ($action ==
'clone') {
942 $formquestion = array(
943 'text' => $langs->trans(
"ConfirmClone"),
944 array(
'type' =>
'other',
'name' =>
'socid',
'label' => $langs->trans(
"SelectThirdParty"),
'value' => $form->select_company(
GETPOST(
'socid',
'int') > 0 ?
GETPOST(
'socid',
'int') : $object->socid,
'socid',
'',
"None", 0, 0, null, 0,
'minwidth200 maxwidth250')),
945 array(
'type' =>
'checkbox',
'name' =>
'clone_contacts',
'label' => $langs->trans(
"CloneContacts"),
'value' => true),
946 array(
'type' =>
'checkbox',
'name' =>
'clone_tasks',
'label' => $langs->trans(
"CloneTasks"),
'value' => true),
947 array(
'type' =>
'checkbox',
'name' =>
'move_date',
'label' => $langs->trans(
"CloneMoveDate"),
'value' => true),
948 array(
'type' =>
'checkbox',
'name' =>
'clone_notes',
'label' => $langs->trans(
"CloneNotes"),
'value' => true),
949 array(
'type' =>
'checkbox',
'name' =>
'clone_project_files',
'label' => $langs->trans(
"CloneProjectFiles"),
'value' => false),
950 array(
'type' =>
'checkbox',
'name' =>
'clone_task_files',
'label' => $langs->trans(
"CloneTaskFiles"),
'value' => false)
953 print $form->formconfirm($_SERVER[
"PHP_SELF"].
"?id=".$object->id, $langs->trans(
"ToClone"), $langs->trans(
"ConfirmCloneProject"),
"confirm_clone", $formquestion,
'', 1, 400, 590);
957 print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">';
958 print
'<input type="hidden" name="token" value="'.newToken().
'">';
959 print
'<input type="hidden" name="action" value="update">';
960 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
961 print
'<input type="hidden" name="comefromclone" value="'.$comefromclone.
'">';
965 if ($action ==
'edit' && $userWrite > 0) {
966 print
dol_get_fiche_head($head,
'project', $langs->trans(
"Project"), 0, ($object->public ?
'projectpub' :
'project'));
968 print
'<table class="border centpercent">';
971 $suggestedref = $object->ref;
972 print
'<tr><td class="titlefield fieldrequired">'.$langs->trans(
"Ref").
'</td>';
973 print
'<td><input size="25" name="ref" value="'.$suggestedref.
'">';
974 print
' '.$form->textwithpicto(
'', $langs->trans(
"YouCanCompleteRef", $suggestedref));
978 print
'<tr><td class="fieldrequired">'.$langs->trans(
"Label").
'</td>';
979 print
'<td><input class="quatrevingtpercent" name="title" value="'.dol_escape_htmltag($object->title).
'"></td></tr>';
982 print
'<tr><td class="fieldrequired">'.$langs->trans(
"Status").
'</td><td>';
983 print
'<select class="flat" name="status" id="status">';
984 $statuses = $object->labelStatusShort;
986 unset($statuses[$object::STATUS_DRAFT]);
988 foreach ($statuses as $key => $val) {
989 print
'<option value="'.$key.
'"'.((GETPOSTISSET(
'status') ?
GETPOST(
'status') : $object->
statut) == $key ?
' selected="selected"' :
'').
'>'.$langs->trans($val).
'</option>';
997 print
'<tr><td>'.$langs->trans(
"Parent").
'</td><td class="maxwidthonsmartphone">';
998 print
img_picto(
'',
'project',
'class="pictofixedwidth"');
999 $formproject->select_projects(-1, $object->fk_project,
'fk_project', 64, 0, 1, 1, 0, 0, 0,
'', 0, 0,
'',
'',
'');
1005 print
'<tr><td class="tdtop">';
1006 print $langs->trans(
"Usage");
1010 print
'<input type="checkbox" id="usage_opportunity" name="usage_opportunity"'.(GETPOSTISSET(
'usage_opportunity') ? (
GETPOST(
'usage_opportunity',
'alpha') !=
'' ?
' checked="checked"' :
'') : ($object->usage_opportunity ?
' checked="checked"' :
'')).
'> ';
1011 $htmltext = $langs->trans(
"ProjectFollowOpportunity");
1012 print
'<label for="usage_opportunity">'.$form->textwithpicto($langs->trans(
"ProjectFollowOpportunity"), $htmltext).
'</label>';
1014 print
'$( document ).ready(function() {
1015 jQuery("#usage_opportunity").change(function() {
1016 set_usage_opportunity();
1019 set_usage_opportunity();
1021 function set_usage_opportunity() {
1022 console.log("set_usage_opportunity");
1023 if (jQuery("#usage_opportunity").prop("checked")) {
1024 console.log("Show opportunities fields");
1025 jQuery(".classuseopportunity").show();
1027 console.log("Hide opportunities fields "+jQuery("#usage_opportunity").prop("checked"));
1028 jQuery(".classuseopportunity").hide();
1036 print
'<input type="checkbox" id="usage_task" name="usage_task"' . (GETPOSTISSET(
'usage_task') ? (
GETPOST(
'usage_task',
'alpha') !=
'' ?
' checked="checked"' :
'') : ($object->usage_task ?
' checked="checked"' :
'')) .
'> ';
1037 $htmltext = $langs->trans(
"ProjectFollowTasks");
1038 print
'<label for="usage_task">'.$form->textwithpicto($langs->trans(
"ProjectFollowTasks"), $htmltext).
'</label>';
1040 print
'$( document ).ready(function() {
1041 jQuery("#usage_task").change(function() {
1047 function set_usage_task() {
1048 console.log("set_usage_task");
1049 if (jQuery("#usage_task").prop("checked")) {
1050 console.log("Show task fields");
1051 jQuery(".classusetask").show();
1053 console.log("Hide task fields "+jQuery("#usage_task").prop("checked"));
1054 jQuery(".classusetask").hide();
1062 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"' :
'')) .
'> ';
1063 $htmltext = $langs->trans(
"ProjectBillTimeDescription");
1064 print
'<label for="usage_bill_time">'.$form->textwithpicto($langs->trans(
"BillTime"), $htmltext).
'</label>';
1066 print
'$( document ).ready(function() {
1067 jQuery("#usage_bill_time").change(function() {
1068 set_usage_bill_time();
1071 set_usage_bill_time();
1073 function set_usage_bill_time() {
1074 console.log("set_usage_bill_time");
1075 if (jQuery("#usage_bill_time").prop("checked")) {
1076 console.log("Show bill time fields");
1077 jQuery(".classusebilltime").show();
1079 console.log("Hide bill time fields "+jQuery("#usage_bill_time").prop("checked"));
1080 jQuery(".classusebilltime").hide();
1087 if (isModEnabled(
'eventorganization')) {
1088 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"' :
'')) .
'> ';
1089 $htmltext = $langs->trans(
"EventOrganizationDescriptionLong");
1090 print
'<label for="usage_organize_event">'.$form->textwithpicto($langs->trans(
"ManageOrganizeEvent"), $htmltext).
'</label>';
1092 print
'$( document ).ready(function() {
1093 jQuery("#usage_organize_event").change(function() {
1099 function set_usage_event() {
1100 console.log("set_usage_event");
1101 if (jQuery("#usage_organize_event").prop("checked")) {
1102 console.log("Show organize event fields");
1103 jQuery(".classuseorganizeevent").show();
1105 console.log("Hide organize event fields "+jQuery("#usage_organize_event").prop("checked"));
1106 jQuery(".classuseorganizeevent").hide();
1117 if (isModEnabled(
'societe')) {
1119 print(!
getDolGlobalString(
'PROJECT_THIRDPARTY_REQUIRED') ?
'' :
'<span class="fieldrequired">');
1120 print $langs->trans(
"ThirdParty");
1125 $filter = $conf->global->PROJECT_FILTER_FOR_THIRDPARTY_LIST;
1127 $text =
img_picto(
'',
'company',
'class="pictofixedwidth"');
1128 $text .= $form->select_company(!empty($object->thirdparty->id) ? $object->thirdparty->id :
"",
'socid', $filter,
'None', 1, 0, array(), 0,
'minwidth300');
1129 if (!
getDolGlobalString(
'PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS') && empty($conf->dol_use_jmobile)) {
1130 $texthelp = $langs->trans(
"IfNeedToUseOtherObjectKeepEmpty");
1131 print $form->textwithtooltip($text.
' '.
img_help(), $texthelp, 1, 0,
'',
'', 2);
1139 print
'<tr><td>'.$langs->trans(
"Visibility").
'</td><td>';
1142 $array[0] = $langs->trans(
"PrivateProject");
1145 $array[1] = $langs->trans(
"SharedProject");
1148 if (count($array) > 0) {
1149 print $form->selectarray(
'public', $array, $object->public, 0, 0, 0,
'', 0, 0, 0,
'',
'', 1);
1151 print
'<input type="hidden" id="public" name="public" value="'.$object->public.
'">';
1153 if ($object->public == 0) {
1154 print
img_picto($langs->trans(
'PrivateProject'),
'private',
'class="paddingrightonly"');
1155 print $langs->trans(
"PrivateProject");
1157 print
img_picto($langs->trans(
'SharedProject'),
'world',
'class="paddingrightonly"');
1158 print $langs->trans(
"SharedProject");
1164 $classfortr = ($object->usage_opportunity ?
'' :
' hideobject');
1166 print
'<tr class="classuseopportunity'.$classfortr.
'"><td>'.$langs->trans(
"OpportunityStatus").
'</td>';
1169 print $formproject->selectOpportunityStatus(
'opp_status', $object->opp_status, 1, 0, 0, 0,
'minwidth150 inline-block valignmiddle', 1, 1);
1172 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) :
'')).
'"> %';
1173 print
'<span id="oldopppercent" class="opacitymedium"></span>';
1176 print
'<div id="divtocloseproject" class="inline-block valign clearboth paddingtop" style="display: none;">';
1177 print
'<input type="checkbox" id="inputcloseproject" name="closeproject" />';
1178 print
'<label for="inputcloseproject">';
1179 print $form->textwithpicto($langs->trans(
"AlsoCloseAProject"), $langs->trans(
"AlsoCloseAProjectTooltip")).
'</label>';
1186 print
'<tr class="classuseopportunity'.$classfortr.
'"><td>'.$langs->trans(
"OpportunityAmount").
'</td>';
1187 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) :
'')).
'">';
1188 print $langs->getCurrencySymbol($conf->currency);
1194 print
'<tr><td>'.$langs->trans(
"Budget").
'</td>';
1195 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) :
'')).
'">';
1196 print $langs->getCurrencySymbol($conf->currency);
1201 print
'<tr><td>'.$langs->trans(
"Date").(isModEnabled(
'eventorganization') ?
' <span class="classuseorganizeevent">('.$langs->trans(
"Project").
')</span>' :
'').
'</td><td>';
1202 print $form->selectDate($object->date_start ? $object->date_start : -1,
'projectstart', 0, 0, 0,
'', 1, 0);
1203 print
' <span class="opacitymedium"> '.$langs->trans(
"to").
' </span> ';
1204 print $form->selectDate($object->date_end ? $object->date_end : -1,
'projectend', 0, 0, 0,
'', 1, 0);
1205 $object->getLinesArray(
null, 0);
1206 if (!empty($object->usage_task) && !empty($object->lines)) {
1207 print
' <span id="divreportdate" class="hidden"> <input type="checkbox" class="valignmiddle" id="reportdate" name="reportdate" value="yes" ';
1208 if ($comefromclone) {
1211 print
'/><label for="reportdate" class="valignmiddle opacitymedium">'.$langs->trans(
"ProjectReportDate").
'</label></span>';
1215 if (isModEnabled(
'eventorganization')) {
1217 print
'<tr class="classuseorganizeevent"><td>'.$langs->trans(
"Date").
' ('.$langs->trans(
"Event").
')</td><td>';
1218 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);
1219 print
' <span class="opacitymedium"> '.$langs->trans(
"to").
' </span> ';
1220 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);
1224 print
'<tr class="classuseorganizeevent"><td>'.$langs->trans(
"Location").
'</td>';
1225 print
'<td><input class="minwidth300 maxwidth500" type="text" name="location" value="'.dol_escape_htmltag(GETPOSTISSET(
'location') ?
GETPOST(
'location') : $object->location).
'"></td>';
1230 print
'<tr><td class="tdtop">'.$langs->trans(
"Description").
'</td>';
1232 $doleditor =
new DolEditor(
'description', $object->description,
'', 90,
'dolibarr_notes',
'',
false,
true,
getDolGlobalInt(
'FCKEDITOR_ENABLE_SOCIETE'), ROWS_3,
'90%');
1233 $doleditor->Create();
1237 if (isModEnabled(
'categorie')) {
1238 $arrayselected = array();
1239 print
'<tr><td>'.$langs->trans(
"Categories").
'</td><td>';
1240 $cate_arbo = $form->select_all_categories(Categorie::TYPE_PROJECT,
'',
'parent', 64, 0, 1);
1242 $cats = $c->containing($object->id, Categorie::TYPE_PROJECT);
1243 foreach ($cats as $cat) {
1244 $arrayselected[] = $cat->id;
1246 print
img_picto(
'',
'category',
'class="pictofixedwidth"').$form->multiselectarray(
'categories', $cate_arbo, $arrayselected, 0, 0,
'quatrevingtpercent widthcentpercentminusx', 0,
'0');
1251 $parameters = array();
1252 $reshook = $hookmanager->executeHooks(
'formObjectOptions', $parameters, $object, $action);
1253 print $hookmanager->resPrint;
1254 if (empty($reshook)) {
1255 print $object->showOptionals($extrafields,
'edit');
1260 print
dol_get_fiche_head($head,
'project', $langs->trans(
"Project"), -1, ($object->public ?
'projectpub' :
'project'));
1264 if (!empty($_SESSION[
'pageforbacktolist']) && !empty($_SESSION[
'pageforbacktolist'][
'project'])) {
1265 $tmpurl = $_SESSION[
'pageforbacktolist'][
'project'];
1266 $tmpurl = preg_replace(
'/__SOCID__/', $object->socid, $tmpurl);
1267 $linkback =
'<a href="'.$tmpurl.(preg_match(
'/\?/', $tmpurl) ?
'&' :
'?').
'restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
1269 $linkback =
'<a href="'.DOL_URL_ROOT.
'/projet/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
1272 $morehtmlref =
'<div class="refidno">';
1275 $morehtmlref .=
'<br>';
1277 if (!empty($object->thirdparty->id) && $object->thirdparty->id > 0) {
1278 $morehtmlref .= $object->thirdparty->getNomUrl(1,
'project');
1282 if (!empty($object->fk_project) && $object->fk_project) {
1284 $parent->fetch($object->fk_project);
1285 $morehtmlref .= $langs->trans(
"Child of").
' '.$parent->getNomUrl(1,
'project').
' '.$parent->title;
1288 $morehtmlref .=
'</div>';
1291 if (!$user->hasRight(
'projet',
'all',
'lire')) {
1292 $objectsListId = $object->getProjectsAuthorizedForUser($user, 0, 0);
1293 $object->next_prev_filter =
"rowid IN (".$db->sanitize(count($objectsListId) ? join(
',', array_keys($objectsListId)) :
'0').
")";
1296 dol_banner_tab($object,
'ref', $linkback, 1,
'ref',
'ref', $morehtmlref);
1298 print
'<div class="fichecenter">';
1299 print
'<div class="fichehalfleft">';
1300 print
'<div class="underbanner clearboth"></div>';
1302 print
'<table class="border tableforfield centpercent">';
1306 print
'<tr><td class="tdtop">';
1307 print $langs->trans(
"Usage");
1311 print
'<input type="checkbox" disabled name="usage_opportunity"'.(GETPOSTISSET(
'usage_opportunity') ? (
GETPOST(
'usage_opportunity',
'alpha') !=
'' ?
' checked="checked"' :
'') : ($object->usage_opportunity ?
' checked="checked"' :
'')).
'> ';
1312 $htmltext = $langs->trans(
"ProjectFollowOpportunity");
1313 print $form->textwithpicto($langs->trans(
"ProjectFollowOpportunity"), $htmltext);
1317 print
'<input type="checkbox" disabled name="usage_task"'.(GETPOSTISSET(
'usage_task') ? (
GETPOST(
'usage_task',
'alpha') !=
'' ?
' checked="checked"' :
'') : ($object->usage_task ?
' checked="checked"' :
'')).
'> ';
1318 $htmltext = $langs->trans(
"ProjectFollowTasks");
1319 print $form->textwithpicto($langs->trans(
"ProjectFollowTasks"), $htmltext);
1323 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"' :
'')).
'> ';
1324 $htmltext = $langs->trans(
"ProjectBillTimeDescription");
1325 print $form->textwithpicto($langs->trans(
"BillTime"), $htmltext);
1329 if (isModEnabled(
'eventorganization')) {
1330 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"' :
'')).
'> ';
1331 $htmltext = $langs->trans(
"EventOrganizationDescriptionLong");
1332 print $form->textwithpicto($langs->trans(
"ManageOrganizeEvent"), $htmltext);
1338 print
'<tr><td class="titlefield">'.$langs->trans(
"Visibility").
'</td><td>';
1339 if ($object->public) {
1340 print
img_picto($langs->trans(
'SharedProject'),
'world',
'class="paddingrightonly"');
1341 print $langs->trans(
'SharedProject');
1343 print
img_picto($langs->trans(
'PrivateProject'),
'private',
'class="paddingrightonly"');
1344 print $langs->trans(
'PrivateProject');
1348 if (
getDolGlobalString(
'PROJECT_USE_OPPORTUNITIES') && !empty($object->usage_opportunity)) {
1350 print
'<tr><td>'.$langs->trans(
"OpportunityStatus").
'</td><td>';
1351 $code =
dol_getIdFromCode($db, $object->opp_status,
'c_lead_status',
'rowid',
'code');
1353 print $langs->trans(
"OppStatus".$code);
1357 print
' <span title="'.$langs->trans(
"OpportunityProbability").
'"> / ';
1358 if (strcmp($object->opp_percent,
'')) {
1359 print
price($object->opp_percent, 0, $langs, 1, 0).
' %';
1361 print
'</span></td></tr>';
1364 print
'<tr><td>'.$langs->trans(
"OpportunityAmount").
'</td><td>';
1365 if (strcmp($object->opp_amount,
'')) {
1366 print
'<span class="amount">'.price($object->opp_amount, 0, $langs, 1, 0, -1, $conf->currency).
'</span>';
1367 if (strcmp($object->opp_percent,
'')) {
1368 print
' <span title="'.dol_escape_htmltag($langs->trans(
'OpportunityWeightedAmount')).
'"><span class="opacitymedium">'.$langs->trans(
"Weighted").
'</span>: <span class="amount">'.
price($object->opp_amount * $object->opp_percent / 100, 0, $langs, 1, 0, -1, $conf->currency).
'</span></span>';
1375 print
'<tr><td>'.$langs->trans(
"Budget").
'</td><td>';
1376 if (!is_null($object->budget_amount) && strcmp($object->budget_amount,
'')) {
1377 print
'<span class="amount">'.price($object->budget_amount, 0, $langs, 1, 0, 0, $conf->currency).
'</span>';
1382 print
'<tr><td>'.$langs->trans(
"Dates").
'</td><td>';
1384 print($start ? $start :
'?');
1386 print
' <span class="opacitymedium">-</span> ';
1387 print($end ? $end :
'?');
1388 if ($object->hasDelay()) {
1395 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_view.tpl.php';
1400 print
'<div class="fichehalfright">';
1401 print
'<div class="underbanner clearboth"></div>';
1403 print
'<table class="border tableforfield centpercent">';
1406 print
'<td class="titlefield tdtop">'.$langs->trans(
"Description").
'</td><td>';
1411 if (isModEnabled(
'categorie')) {
1412 print
'<tr><td class="valignmiddle">'.$langs->trans(
"Categories").
'</td><td>';
1413 print $form->showCategories($object->id, Categorie::TYPE_PROJECT, 1);
1422 print
'<div class="clearboth"></div>';
1427 if ($action ==
'edit' && $userWrite > 0) {
1428 print $form->buttonsSaveCancel();
1434 print
'<script type="text/javascript">
1435 jQuery(document).ready(function() {
1436 jQuery("#usage_task").change(function() {
1437 console.log("We click on usage task "+jQuery("#usage_task").is(":checked"));
1438 if (! jQuery("#usage_task").is(":checked")) {
1439 jQuery("#usage_bill_time").prop("checked", false);
1443 jQuery("#usage_bill_time").change(function() {
1444 console.log("We click on usage to bill time");
1445 if (jQuery("#usage_bill_time").is(":checked")) {
1446 jQuery("#usage_task").prop("checked", true);
1450 jQuery("#projectstart").change(function() {
1451 console.log("We modify the start date");
1452 jQuery("#divreportdate").show();
1458 if (!empty($conf->use_javascript_ajax) &&
getDolGlobalString(
'PROJECT_USE_OPPORTUNITIES')) {
1460 $defaultcheckedwhenoppclose = 1;
1462 $defaultcheckedwhenoppclose = 0;
1465 print
'<!-- Javascript to manage opportunity status change -->';
1466 print
'<script type="text/javascript">
1467 jQuery(document).ready(function() {
1468 function change_percent()
1470 var element = jQuery("#opp_status option:selected");
1471 var defaultpercent = element.attr("defaultpercent");
1472 var defaultcloseproject = '.((int) $defaultcheckedwhenoppclose).
';
1473 var elemcode = element.attr("elemcode");
1474 var oldpercent = \''.
dol_escape_js($object->opp_percent).
'\';
1476 console.log(
"We select "+elemcode);
1479 var closeproject = 0;
1480 if (elemcode == \
'LOST\') closeproject = 1;
1481 if (elemcode == \'WON\') closeproject = defaultcloseproject;
1482 if (closeproject) jQuery("#inputcloseproject").prop("checked", true);
1483 else jQuery("#inputcloseproject").prop("checked", false);
1485 /* Make the close project checkbox visible or not */
1486 console.log("closeproject="+closeproject);
1487 if (elemcode == \'WON\' || elemcode == \'LOST\')
1489 jQuery("#divtocloseproject").show();
1493 jQuery("#divtocloseproject").hide();
1496 /* Change percent with default percent (defaultpercent) if new status (defaultpercent) is higher than current (jQuery("#opp_percent").val()) */
1497 if (oldpercent != \'\' && (parseFloat(defaultpercent) < parseFloat(oldpercent)))
1499 console.log("oldpercent="+oldpercent+" defaultpercent="+defaultpercent+" def < old");
1500 if (jQuery("#opp_percent").val() != \'\' && oldpercent != \'\') {
1501 jQuery("#oldopppercent").text(\' - '.
dol_escape_js($langs->transnoentities(
"PreviousValue")).
': \'+price2numjs(oldpercent)+\' %\');
1504 if (parseFloat(oldpercent) != 100 && elemcode != \'LOST\') { jQuery("#opp_percent").val(oldpercent); }
1505 else { jQuery("#opp_percent").val(price2numjs(defaultpercent)); }
1507 console.log("oldpercent="+oldpercent+" defaultpercent="+defaultpercent);
1508 if (jQuery("#opp_percent").val() == \'\' || (parseFloat(jQuery("#opp_percent").val()) < parseFloat(defaultpercent))) {
1509 if (jQuery("#opp_percent").val() != \'\' && oldpercent != \'\') {
1510 jQuery("#oldopppercent").text(\' - '.
dol_escape_js($langs->transnoentities(
"PreviousValue")).
': \'+price2numjs(oldpercent)+\' %\');
1512 jQuery("#opp_percent").val(price2numjs(defaultpercent));
1517 jQuery("#opp_status").change(function() {
1529 print
'<div class="tabsAction">';
1530 $parameters = array();
1531 $reshook = $hookmanager->executeHooks(
'addMoreActionsButtons', $parameters, $object, $action);
1533 if (empty($reshook)) {
1534 if ($action !=
"edit" && $action !=
'presend') {
1544 if (empty($user->socid)) {
1546 print
dolGetButtonAction(
'', $langs->trans(
'SendMail'),
'default', $_SERVER[
"PHP_SELF"].
'?action=presend&token='.newToken().
'&id='.$object->id.
'&mode=init#formmailbeforetitle',
'');
1566 if ($userWrite > 0) {
1567 print
dolGetButtonAction(
'', $langs->trans(
'SetToDraft'),
'default', $_SERVER[
"PHP_SELF"].
'?action=confirm_setdraft&confirm=yes&token='.newToken().
'&id='.$object->id,
'');
1569 print
dolGetButtonAction($langs->trans(
'NotOwnerOfProject'), $langs->trans(
'SetToDraft'),
'default', $_SERVER[
'PHP_SELF'].
'#',
'',
false);
1576 if ($userWrite > 0) {
1577 print
dolGetButtonAction(
'', $langs->trans(
'Modify'),
'default', $_SERVER[
"PHP_SELF"].
'?action=edit&token='.newToken().
'&id='.$object->id,
'');
1579 print
dolGetButtonAction($langs->trans(
'NotOwnerOfProject'), $langs->trans(
'Modify'),
'default', $_SERVER[
'PHP_SELF'].
'#',
'',
false);
1585 if ($userWrite > 0) {
1586 print
dolGetButtonAction(
'', $langs->trans(
'Validate'),
'default', $_SERVER[
"PHP_SELF"].
'?action=validate&token='.newToken().
'&id='.$object->id,
'');
1588 print
dolGetButtonAction($langs->trans(
'NotOwnerOfProject'), $langs->trans(
'Validate'),
'default', $_SERVER[
'PHP_SELF'].
'#',
'',
false);
1594 if ($userWrite > 0) {
1595 print
dolGetButtonAction(
'', $langs->trans(
'Close'),
'default', $_SERVER[
"PHP_SELF"].
'?action=close&token='.newToken().
'&id='.$object->id,
'');
1597 print
dolGetButtonAction($langs->trans(
'NotOwnerOfProject'), $langs->trans(
'Close'),
'default', $_SERVER[
'PHP_SELF'].
'#',
'',
false);
1603 if ($userWrite > 0) {
1604 print
dolGetButtonAction(
'', $langs->trans(
'ReOpen'),
'default', $_SERVER[
"PHP_SELF"].
'?action=reopen&token='.newToken().
'&id='.$object->id,
'');
1606 print
dolGetButtonAction($langs->trans(
'NotOwnerOfProject'), $langs->trans(
'ReOpen'),
'default', $_SERVER[
'PHP_SELF'].
'#',
'',
false);
1612 $arrayforbutaction = array(
1613 10 => array(
'lang'=>
'propal',
'enabled'=>isModEnabled(
"propal"),
'perm'=>$user->hasRight(
'propal',
'creer'),
'label' =>
'AddProp',
'url'=>
'/comm/propal/card.php?action=create&projectid='.$object->id.
'&socid='.$object->socid),
1614 20 => array(
'lang'=>
'orders',
'enabled'=>isModEnabled(
"commande"),
'perm'=>$user->hasRight(
'commande',
'creer'),
'label' =>
'CreateOrder',
'url'=>
'/commande/card.php?action=create&projectid='.$object->id.
'&socid='.$object->socid),
1615 30 => array(
'lang'=>
'bills',
'enabled'=>isModEnabled(
"facture"),
'perm'=>$user->hasRight(
'facture',
'creer'),
'label' =>
'CreateBill',
'url'=>
'/compta/facture/card.php?action=create&projectid='.$object->id.
'&socid='.$object->socid),
1616 40 => array(
'lang'=>
'supplier_proposal',
'enabled'=>isModEnabled(
"supplier_proposal"),
'perm'=>$user->hasRight(
'supplier_proposal',
'creer'),
'label' =>
'AddSupplierProposal',
'url'=>
'/supplier_proposal/card.php?action=create&projectid='.$object->id.
'&socid='.$object->socid),
1617 50 => array(
'lang'=>
'suppliers',
'enabled'=>isModEnabled(
"supplier_order"),
'perm'=>$user->hasRight(
'fournisseur',
'commande',
'creer'),
'label' =>
'AddSupplierOrder',
'url'=>
'/fourn/commande/card.php?action=create&projectid='.$object->id.
'&socid='.$object->socid),
1618 60 => array(
'lang'=>
'suppliers',
'enabled'=>isModEnabled(
"supplier_invoice"),
'perm'=>$user->hasRight(
'fournisseur',
'facture',
'creer'),
'label' =>
'AddSupplierInvoice',
'url'=>
'/fourn/facture/card.php?action=create&projectid='.$object->id.
'&socid='.$object->socid),
1619 70 => array(
'lang'=>
'interventions',
'enabled'=>isModEnabled(
"ficheinter"),
'perm'=>$user->hasRight(
'fichinter',
'creer'),
'label' =>
'AddIntervention',
'url'=>
'/fichinter/card.php?action=create&projectid='.$object->id.
'&socid='.$object->socid),
1620 80 => array(
'lang'=>
'contracts',
'enabled'=>isModEnabled(
"contrat"),
'perm'=>$user->hasRight(
'contrat',
'creer'),
'label' =>
'AddContract',
'url'=>
'/contrat/card.php?action=create&projectid='.$object->id.
'&socid='.$object->socid),
1621 90 => array(
'lang'=>
'trips',
'enabled'=>isModEnabled(
"expensereport"),
'perm'=>$user->hasRight(
'expensereport',
'creer'),
'label' =>
'AddTrip',
'url'=>
'/expensereport/card.php?action=create&projectid='.$object->id.
'&socid='.$object->socid),
1622 100 => array(
'lang'=>
'donations',
'enabled'=>isModEnabled(
"don"),
'perm'=>$user->hasRight(
'don',
'creer'),
'label' =>
'AddDonation',
'url'=>
'/don/card.php?action=create&projectid='.$object->id.
'&socid='.$object->socid),
1625 $params = array(
'backtopage' => $_SERVER[
"PHP_SELF"].
'?id='.$object->id);
1627 print
dolGetButtonAction(
'', $langs->trans(
"Create"),
'default', $arrayforbutaction,
'', 1, $params);
1631 if ($user->hasRight(
'projet',
'creer')) {
1632 if ($userWrite > 0) {
1633 print
dolGetButtonAction(
'', $langs->trans(
'ToClone'),
'default', $_SERVER[
"PHP_SELF"].
'?action=clone&token='.newToken().
'&id='.$object->id,
'');
1635 print
dolGetButtonAction($langs->trans(
'NotOwnerOfProject'), $langs->trans(
'ToClone'),
'default', $_SERVER[
'PHP_SELF'].
'#',
'',
false);
1640 if ($user->hasRight(
'projet',
'supprimer') || ($object->statut ==
Project::STATUS_DRAFT && $user->hasRight(
'projet',
'creer'))) {
1641 if ($userDelete > 0 || ($object->statut ==
Project::STATUS_DRAFT && $user->hasRight(
'projet',
'creer'))) {
1642 print
dolGetButtonAction(
'', $langs->trans(
'Delete'),
'delete', $_SERVER[
"PHP_SELF"].
'?action=delete&token='.newToken().
'&id='.$object->id,
'');
1644 print
dolGetButtonAction($langs->trans(
'NotOwnerOfProject'), $langs->trans(
'Delete'),
'default', $_SERVER[
'PHP_SELF'].
'#',
'',
false);
1652 if (
GETPOST(
'modelselected')) {
1653 $action =
'presend';
1656 if ($action !=
'presend') {
1657 print
'<div class="fichecenter"><div class="fichehalfleft">';
1658 print
'<a name="builddoc"></a>';
1664 $children = $object->getChildren();
1666 print
'<table class="centpercent notopnoleftnoright table-fiche-title">';
1667 print
'<tr class="titre"><td class="nobordernopadding valignmiddle col-title">';
1668 print
'<div class="titre inline-block">'.$langs->trans(
'Sub-projects').
'</div>';
1669 print
'</td></tr></table>';
1671 print
'<div class="div-table-responsive-no-min">';
1672 print
'<table class="centpercent noborder'.($morecss ?
' '.$morecss :
'').
'">';
1673 print
'<tr class="liste_titre">';
1674 print
getTitleFieldOfList(
'Ref', 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'',
'',
'',
'', 1);
1675 print
getTitleFieldOfList(
'Title', 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'',
'',
'',
'', 1);
1676 print
getTitleFieldOfList(
'Status', 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'',
'',
'',
'', 1);
1680 $subproject =
new Project($db);
1681 foreach ($children as $child) {
1682 $subproject->fetch($child->rowid);
1683 print
'<tr class="oddeven">';
1684 print
'<td class="nowraponall">'.$subproject->getNomUrl(1,
'project').
'</td>';
1685 print
'<td class="nowraponall tdoverflowmax125">'.$child->title.
'</td>';
1686 print
'<td class="nowraponall">'.$subproject->getLibStatut(5).
'</td>';
1699 $filedir = $conf->project->multidir_output[$object->entity].
"/".
dol_sanitizeFileName($object->ref);
1700 $urlsource = $_SERVER[
"PHP_SELF"].
"?id=".$object->id;
1701 $genallowed = ($user->hasRight(
'projet',
'lire') && $userAccess > 0);
1702 $delallowed = ($user->hasRight(
'projet',
'creer') && $userWrite > 0);
1704 print $formfile->showdocuments(
'project', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 0, 0,
'',
'',
'',
'',
'', $object);
1706 print
'</div><div class="fichehalfright">';
1710 $morehtmlcenter =
'<div class="nowraponall">';
1711 $morehtmlcenter .=
dolGetButtonTitle($langs->trans(
'FullConversation'),
'',
'fa fa-comments imgforviewmode', DOL_URL_ROOT.
'/projet/messaging.php?id='.$object->id);
1712 $morehtmlcenter .=
dolGetButtonTitle($langs->trans(
'FullList'),
'',
'fa fa-bars imgforviewmode', DOL_URL_ROOT.
'/projet/agenda.php?id='.$object->id);
1713 $morehtmlcenter .=
'</div>';
1716 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formactions.class.php';
1718 $somethingshown =
$formactions->showactions($object,
'project', 0, 1,
'', $MAXEVENT,
'', $morehtmlcenter);
1720 print
'</div></div>';
1724 $modelmail =
'project';
1725 $defaulttopic =
'SendProjectRef';
1726 $defaulttopiclang =
'projects';
1727 $diroutput = $conf->project->multidir_output[$object->entity];
1728 $autocopy =
'MAIN_MAIL_AUTOCOPY_PROJECT_TO';
1729 $trackid =
'proj'.$object->id;
1731 include DOL_DOCUMENT_ROOT.
'/core/tpl/card_presend.tpl.php';
1734 $parameters = array();
1735 $reshook = $hookmanager->executeHooks(
'mainCardTabAddMore', $parameters, $object, $action);
1737 print $langs->trans(
"RecordNotFound");
if(preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg)) if(preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg)) if($action=='set') elseif( $action=='specimen') elseif($action=='setmodel') elseif( $action=='del') elseif($action=='setdoc') $formactions
View.
ajax_combobox($htmlname, $events=array(), $minLengthToAutocomplete=0, $forcefocus=0, $widthTypeOfAutocomplete='resolve', $idforemptyvalue='-1', $morecss='')
Convert a html select field into an ajax combobox.
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
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.
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_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='rowid', $fieldref='ref', $morehtmlref='', $moreparam='', $nodbprefix=0, $morehtmlleft='', $morehtmlstatus='', $onlybanner=0, $morehtmlright='')
Show tab footer of a card.
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed informations (by default a local PHP server timestamp) Re...
vatrate($rate, $addpercent=false, $info_bits=0, $usestarfornpr=0, $html=0)
Return a string with VAT rate label formated for view output Used into pdf and HTML pages.
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
img_help($usehelpcursor=1, $usealttitle=1)
Show help logo with cursor "?".
img_warning($titlealt='default', $moreatt='', $morecss='pictowarning')
Show warning logo.
GETPOSTINT($paramname, $method=0)
Return value of a param into GET or POST supervariable.
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.
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)
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_print_date($time, $format='', $tzoutput='auto', $outputlangs='', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
dol_now($mode='auto')
Return date for now.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
dol_escape_js($stringtoescape, $mode=0, $noescapebackslashn=0)
Returns text escaped for inclusion into javascript code.
dol_getIdFromCode($db, $key, $tablename, $fieldkey='code', $fieldid='id', $entityfilter=0, $filters='')
Return an id or code from a code or id.
if(!function_exists( 'dol_getprefix')) dol_include_once($relpath, $classname='')
Make an include_once using default root and alternate root if it fails.
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.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
dol_sanitizeFileName($str, $newstr='_', $unaccent=1)
Clean a string to use it as a file name.
dol_htmlentitiesbr($stringtoencode, $nl2brmode=0, $pagecodefrom='UTF-8', $removelasteolbr=1)
This function is called to encode a string into a HTML string but differs from htmlentities because a...
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
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...
publicphonebutton2 phonegreen basiclayout basiclayout TotalHT VATCode TotalVAT TotalLT1 TotalLT2 TotalTTC TotalHT clearboth nowraponall right right takeposterminal SELECT e e e e e statut
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.