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);
505 setEventMessages($langs->trans(
"ProjectCreatedInDolibarr", $newobject->ref),
"",
'mesgs');
507 header(
'Location: '.$_SERVER[
'PHP_SELF'].
'?id='.$result.
'&action=edit&comefromclone=1');
513 $triggersendname =
'PROJECT_SENTBYMAIL';
515 $autocopy =
'MAIN_MAIL_AUTOCOPY_PROJECT_TO';
516 $trackid =
'proj'.$object->id;
517 include DOL_DOCUMENT_ROOT.
'/core/actions_sendmails.inc.php';
525$form =
new Form($db);
528$userstatic =
new User($db);
530$title = $langs->trans(
"Project").
' - '.$object->ref.(!empty($object->thirdparty->name) ?
' - '.$object->thirdparty->name :
'').(!empty($object->title) ?
' - '.$object->title :
'');
531if (
getDolGlobalString(
'MAIN_HTML_TITLE') && preg_match(
'/projectnameonly/', $conf->global->MAIN_HTML_TITLE)) {
532 $title = $object->ref.(!empty($object->thirdparty->name) ?
' - '.$object->thirdparty->name :
'').(!empty($object->title) ?
' - '.$object->title :
'');
535$help_url =
"EN:Module_Projects|FR:Module_Projets|ES:Módulo_Proyectos|DE:Modul_Projekte";
539$titleboth = $langs->trans(
"LeadsOrProjects");
540$titlenew = $langs->trans(
"NewLeadOrProject");
542 $titleboth = $langs->trans(
"Projects");
543 $titlenew = $langs->trans(
"NewProject");
546 $titleboth = $langs->trans(
"Leads");
547 $titlenew = $langs->trans(
"NewLead");
550if ($action ==
'create' && $user->hasRight(
'projet',
'creer')) {
555 $thirdparty =
new Societe($db);
557 $thirdparty->fetch($socid);
562 print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">';
563 print
'<input type="hidden" name="action" value="add">';
564 print
'<input type="hidden" name="token" value="'.newToken().
'">';
565 print
'<input type="hidden" name="backtopage" value="'.$backtopage.
'">';
566 print
'<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.
'">';
567 print
'<input type="hidden" name="backtopagejsfields" value="'.$backtopagejsfields.
'">';
568 print
'<input type="hidden" name="dol_openinpopup" value="'.$dol_openinpopup.
'">';
572 print
'<table class="border centpercent tableforfieldcreate">';
575 $modele = !
getDolGlobalString(
'PROJECT_ADDON') ?
'mod_project_simple' : $conf->global->PROJECT_ADDON;
581 $dirmodels = array_merge(array(
'/'), (array) $conf->modules_parts[
'models']);
582 foreach ($dirmodels as $reldir) {
583 $file =
dol_buildpath($reldir.
"core/modules/project/".$modele.
'.php', 0);
584 if (file_exists($file)) {
586 $classname = $modele;
593 $modProject =
new $classname();
595 $defaultref = $modProject->getNextValue($thirdparty, $object);
598 if (is_numeric($defaultref) && $defaultref <= 0) {
604 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).
'">';
606 print
' '.$form->textwithpicto(
'', $langs->trans(
"YouCanCompleteRef", $suggestedref));
611 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>';
615 print
'<tr><td>'.$langs->trans(
"Parent").
'</td><td class="maxwidthonsmartphone">';
616 print
img_picto(
'',
'project',
'class="pictofixedwidth"');
617 $formproject->select_projects(-1,
'',
'fk_project', 64, 0, 1, 1, 0, 0, 0,
'', 0, 0,
'',
'',
'');
623 print
'<tr><td class="tdtop">';
624 print $langs->trans(
"Usage");
628 print
'<input type="checkbox" id="usage_opportunity" name="usage_opportunity"'.(GETPOSTISSET(
'usage_opportunity') ? (
GETPOST(
'usage_opportunity',
'alpha') ?
' checked="checked"' :
'') :
' checked="checked"').
'"> ';
629 $htmltext = $langs->trans(
"ProjectFollowOpportunity");
630 print
'<label for="usage_opportunity">'.$form->textwithpicto($langs->trans(
"ProjectFollowOpportunity"), $htmltext).
'</label>';
632 print
'$( document ).ready(function() {
633 jQuery("#usage_opportunity").change(function() {
634 if (jQuery("#usage_opportunity").prop("checked")) {
635 console.log("Show opportunities fields");
636 jQuery(".classuseopportunity").show();
638 console.log("Hide opportunities fields "+jQuery("#usage_opportunity").prop("checked"));
639 jQuery(".classuseopportunity").hide();
643 if (GETPOSTISSET(
'usage_opportunity') && !
GETPOST(
'usage_opportunity')) {
644 print
'jQuery(".classuseopportunity").hide();';
651 print
'<input type="checkbox" id="usage_task" name="usage_task"'.(GETPOSTISSET(
'usage_task') ? (
GETPOST(
'usage_task',
'alpha') ?
' checked="checked"' :
'') :
' checked="checked"').
'"> ';
652 $htmltext = $langs->trans(
"ProjectFollowTasks");
653 print
'<label for="usage_task">'.$form->textwithpicto($langs->trans(
"ProjectFollowTasks"), $htmltext).
'</label>';
655 print
'$( document ).ready(function() {
656 jQuery("#usage_task").change(function() {
657 if (jQuery("#usage_task").prop("checked")) {
658 console.log("Show task fields");
659 jQuery(".classusetask").show();
661 console.log("Hide tasks fields "+jQuery("#usage_task").prop("checked"));
662 jQuery(".classusetask").hide();
666 if (GETPOSTISSET(
'usage_task') && !
GETPOST(
'usage_task')) {
667 print
'jQuery(".classusetask").hide();';
674 print
'<input type="checkbox" id="usage_bill_time" name="usage_bill_time"'.(GETPOSTISSET(
'usage_bill_time') ? (
GETPOST(
'usage_bill_time',
'alpha') ?
' checked="checked"' :
'') :
'').
'"> ';
675 $htmltext = $langs->trans(
"ProjectBillTimeDescription");
676 print
'<label for="usage_bill_time">'.$form->textwithpicto($langs->trans(
"BillTime"), $htmltext).
'</label>';
678 print
'$( document ).ready(function() {
679 jQuery("#usage_bill_time").change(function() {
680 if (jQuery("#usage_bill_time").prop("checked")) {
681 console.log("Show bill time fields");
682 jQuery(".classusebilltime").show();
684 console.log("Hide bill time fields "+jQuery("#usage_bill_time").prop("checked"));
685 jQuery(".classusebilltime").hide();
689 if (GETPOSTISSET(
'usage_bill_time') && !
GETPOST(
'usage_bill_time')) {
690 print
'jQuery(".classusebilltime").hide();';
696 if (isModEnabled(
'eventorganization')) {
697 print
'<input type="checkbox" id="usage_organize_event" name="usage_organize_event"'.(GETPOSTISSET(
'usage_organize_event') ? (
GETPOST(
'usage_organize_event',
'alpha') ?
' checked="checked"' :
'') :
'').
'"> ';
698 $htmltext = $langs->trans(
"EventOrganizationDescriptionLong");
699 print
'<label for="usage_organize_event">'.$form->textwithpicto($langs->trans(
"ManageOrganizeEvent"), $htmltext).
'</label>';
701 print
'$( document ).ready(function() {
702 jQuery("#usage_organize_event").change(function() {
703 if (jQuery("#usage_organize_event").prop("checked")) {
704 console.log("Show organize event fields");
705 jQuery(".classuseorganizeevent").show();
707 console.log("Hide organize event fields "+jQuery("#usage_organize_event").prop("checked"));
708 jQuery(".classuseorganizeevent").hide();
712 if (!
GETPOST(
'usage_organize_event')) {
713 print
'jQuery(".classuseorganizeevent").hide();';
723 if (isModEnabled(
'societe')) {
725 print(!
getDolGlobalString(
'PROJECT_THIRDPARTY_REQUIRED') ?
'' :
'<span class="fieldrequired">');
726 print $langs->trans(
"ThirdParty");
728 print
'</td><td class="maxwidthonsmartphone">';
731 $filter = $conf->global->PROJECT_FILTER_FOR_THIRDPARTY_LIST;
733 $text =
img_picto(
'',
'company').$form->select_company(
GETPOST(
'socid',
'int'),
'socid', $filter,
'SelectThirdParty', 1, 0, array(), 0,
'minwidth300 widthcentpercentminusxx maxwidth500');
734 if (!
getDolGlobalString(
'PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS') && empty($conf->dol_use_jmobile)) {
735 $texthelp = $langs->trans(
"IfNeedToUseOtherObjectKeepEmpty");
736 print $form->textwithtooltip($text.
' '.
img_help(), $texthelp, 1);
740 if (!GETPOSTISSET(
'backtopage')) {
741 $url =
'/societe/card.php?action=create&client=3&fournisseur=0&backtopage='.urlencode($_SERVER[
"PHP_SELF"].
'?action=create');
742 $newbutton =
'<span class="fa fa-plus-circle valignmiddle paddingleft" title="'.$langs->trans(
"AddThirdParty").
'"></span>';
745 $tmpbacktopagejsfields =
'addthirdparty:socid,search_socid';
746 print
dolButtonToOpenUrlInDialogPopup(
'addthirdparty', $langs->transnoentitiesnoconv(
'AddThirdParty'), $newbutton, $url,
'',
'',
'', $tmpbacktopagejsfields);
748 print
' <a href="'.DOL_URL_ROOT.$url.
'">'.$newbutton.
'</a>';
756 print
'<tr><td>'.$langs->trans(
"Status").
'</td><td>';
757 print
'<input type="hidden" name="status" value="'.$status.
'">';
758 print $object->LibStatut($status, 4);
763 print
'<tr><td>'.$langs->trans(
"Visibility").
'</td><td class="maxwidthonsmartphone">';
766 $array[0] = $langs->trans(
"PrivateProject");
769 $array[1] = $langs->trans(
"SharedProject");
772 if (count($array) > 0) {
773 print $form->selectarray(
'public', $array,
GETPOST(
'public'), 0, 0, 0,
'', 0, 0, 0,
'',
'', 1);
775 print
'<input type="hidden" name="public" id="public" value="'.GETPOST(
'public').
'">';
778 print
img_picto($langs->trans(
'PrivateProject'),
'private',
'class="paddingrightonly"');
779 print $langs->trans(
"PrivateProject");
781 print
img_picto($langs->trans(
'SharedProject'),
'world',
'class="paddingrightonly"');
782 print $langs->trans(
"SharedProject");
789 print
'<tr class="classuseopportunity"><td><span class="fieldrequired">'.$langs->trans(
"OpportunityStatus").
'</span></td>';
790 print
'<td class="maxwidthonsmartphone">';
791 print $formproject->selectOpportunityStatus(
'opp_status', GETPOSTISSET(
'opp_status') ?
GETPOST(
'opp_status') : $object->opp_status, 1, 0, 0, 0,
'', 0, 1);
794 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>';
795 print
'<input type="hidden" name="opp_percent_not_set" id="opp_percent_not_set" value="'.dol_escape_htmltag(GETPOSTISSET(
'opp_percent') ?
'0' :
'1').
'">';
800 print
'<tr class="classuseopportunity"><td>'.$langs->trans(
"OpportunityAmount").
'</td>';
801 print
'<td><input class="width75 right" type="text" name="opp_amount" value="'.dol_escape_htmltag(GETPOSTISSET(
'opp_amount') ?
GETPOST(
'opp_amount') :
'').
'">';
802 print
' '.$langs->getCurrencySymbol($conf->currency);
808 print
'<tr><td>'.$langs->trans(
"Budget").
'</td>';
809 print
'<td><input class="width75 right" type="text" name="budget_amount" value="'.dol_escape_htmltag(GETPOSTISSET(
'budget_amount') ?
GETPOST(
'budget_amount') :
'').
'">';
810 print
' '.$langs->getCurrencySymbol($conf->currency);
815 print
'<tr><td>'.$langs->trans(
"Date").(isModEnabled(
'eventorganization') ?
' <span class="classuseorganizeevent">('.$langs->trans(
"Project").
')</span>' :
'').
'</td><td>';
816 print $form->selectDate(($date_start ? $date_start :
''),
'projectstart', 0, 0, 0,
'', 1, 0);
817 print
' <span class="opacitymedium"> '.$langs->trans(
"to").
' </span> ';
818 print $form->selectDate(($date_end ? $date_end : -1),
'projectend', 0, 0, 0,
'', 1, 0);
821 if (isModEnabled(
'eventorganization')) {
823 print
'<tr class="classuseorganizeevent"><td>'.$langs->trans(
"Date").
' ('.$langs->trans(
"Event").
')</td><td>';
824 print $form->selectDate(($date_start_event ? $date_start_event : -1),
'date_start_event', 1, 1, 1,
'', 1, 0);
825 print
' <span class="opacitymedium"> '.$langs->trans(
"to").
' </span> ';
826 print $form->selectDate(($date_end_event ? $date_end_event : -1),
'date_end_event', 1, 1, 1,
'', 1, 0);
830 print
'<tr class="classuseorganizeevent"><td>'.$langs->trans(
"Location").
'</td>';
831 print
'<td><input class="minwidth300 maxwidth500" type="text" name="location" value="'.dol_escape_htmltag($location).
'"></td>';
836 print
'<tr><td class="tdtop">'.$langs->trans(
"Description").
'</td>';
838 $doleditor =
new DolEditor(
'description',
GETPOST(
"description",
'restricthtml'),
'', 90,
'dolibarr_notes',
'',
false,
true,
getDolGlobalString(
'FCKEDITOR_ENABLE_SOCIETE'), ROWS_3,
'90%');
839 $doleditor->Create();
842 if (isModEnabled(
'categorie')) {
844 print
'<tr><td>'.$langs->trans(
"Categories").
'</td><td colspan="3">';
845 $cate_arbo = $form->select_all_categories(Categorie::TYPE_PROJECT,
'',
'parent', 64, 0, 1);
846 $arrayselected =
GETPOST(
'categories',
'array');
847 print
img_picto(
'',
'category',
'class="pictofixedwidth"').$form->multiselectarray(
'categories', $cate_arbo, $arrayselected,
'', 0,
'quatrevingtpercent widthcentpercentminusx', 0, 0);
852 $parameters = array();
853 $reshook = $hookmanager->executeHooks(
'formObjectOptions', $parameters, $object, $action);
854 print $hookmanager->resPrint;
855 if (empty($reshook)) {
856 print $object->showOptionals($extrafields,
'create');
863 print $form->buttonsSaveCancel(
'CreateDraft');
869 print
'<script type="text/javascript">
870 jQuery(document).ready(function() {
871 function change_percent()
873 var element = jQuery("#opp_status option:selected");
874 var defaultpercent = element.attr("defaultpercent");
875 /*if (jQuery("#opp_percent_not_set").val() == "") */
876 jQuery("#opp_percent").val(defaultpercent);
880 jQuery("#opp_status").change(function() {
884 jQuery("#usage_task").change(function() {
885 console.log("We click on usage task "+jQuery("#usage_task").is(":checked"));
886 if (! jQuery("#usage_task").is(":checked")) {
887 jQuery("#usage_bill_time").prop("checked", false);
891 jQuery("#usage_bill_time").change(function() {
892 console.log("We click on usage to bill time");
893 if (jQuery("#usage_bill_time").is(":checked")) {
894 jQuery("#usage_task").prop("checked", true);
899} elseif ($object->id > 0) {
904 $res = $object->fetch_optionals();
907 $userAccess = $object->restrictedProjectArea($user,
'read');
908 $userWrite = $object->restrictedProjectArea($user,
'write');
909 $userDelete = $object->restrictedProjectArea($user,
'delete');
914 if ($action ==
'validate') {
915 print $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.$object->id, $langs->trans(
'ValidateProject'), $langs->trans(
'ConfirmValidateProject'),
'confirm_validate',
'', 0, 1);
918 if ($action ==
'close') {
919 print $form->formconfirm($_SERVER[
"PHP_SELF"].
"?id=".$object->id, $langs->trans(
"CloseAProject"), $langs->trans(
"ConfirmCloseAProject"),
"confirm_close",
'',
'', 1);
922 if ($action ==
'reopen') {
923 print $form->formconfirm($_SERVER[
"PHP_SELF"].
"?id=".$object->id, $langs->trans(
"ReOpenAProject"), $langs->trans(
"ConfirmReOpenAProject"),
"confirm_reopen",
'',
'', 1);
926 if ($action ==
'delete') {
927 $text = $langs->trans(
"ConfirmDeleteAProject");
928 $task =
new Task($db);
929 $taskarray = $task->getTasksArray(0, 0, $object->id, 0, 0);
930 $nboftask = count($taskarray);
932 $text .=
'<br>'.img_warning().
' '.$langs->trans(
"ThisWillAlsoRemoveTasks", $nboftask);
934 print $form->formconfirm($_SERVER[
"PHP_SELF"].
"?id=".$object->id, $langs->trans(
"DeleteAProject"), $text,
"confirm_delete",
'',
'', 1);
938 if ($action ==
'clone') {
939 $formquestion = array(
940 'text' => $langs->trans(
"ConfirmClone"),
941 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')),
942 array(
'type' =>
'checkbox',
'name' =>
'clone_contacts',
'label' => $langs->trans(
"CloneContacts"),
'value' => true),
943 array(
'type' =>
'checkbox',
'name' =>
'clone_tasks',
'label' => $langs->trans(
"CloneTasks"),
'value' => true),
944 array(
'type' =>
'checkbox',
'name' =>
'move_date',
'label' => $langs->trans(
"CloneMoveDate"),
'value' => true),
945 array(
'type' =>
'checkbox',
'name' =>
'clone_notes',
'label' => $langs->trans(
"CloneNotes"),
'value' => true),
946 array(
'type' =>
'checkbox',
'name' =>
'clone_project_files',
'label' => $langs->trans(
"CloneProjectFiles"),
'value' => false),
947 array(
'type' =>
'checkbox',
'name' =>
'clone_task_files',
'label' => $langs->trans(
"CloneTaskFiles"),
'value' => false)
950 print $form->formconfirm($_SERVER[
"PHP_SELF"].
"?id=".$object->id, $langs->trans(
"ToClone"), $langs->trans(
"ConfirmCloneProject"),
"confirm_clone", $formquestion,
'', 1, 400, 590);
954 print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">';
955 print
'<input type="hidden" name="token" value="'.newToken().
'">';
956 print
'<input type="hidden" name="action" value="update">';
957 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
958 print
'<input type="hidden" name="comefromclone" value="'.$comefromclone.
'">';
962 if ($action ==
'edit' && $userWrite > 0) {
963 print
dol_get_fiche_head($head,
'project', $langs->trans(
"Project"), 0, ($object->public ?
'projectpub' :
'project'));
965 print
'<table class="border centpercent">';
968 $suggestedref = $object->ref;
969 print
'<tr><td class="titlefield fieldrequired">'.$langs->trans(
"Ref").
'</td>';
970 print
'<td><input size="25" name="ref" value="'.$suggestedref.
'">';
971 print
' '.$form->textwithpicto(
'', $langs->trans(
"YouCanCompleteRef", $suggestedref));
975 print
'<tr><td class="fieldrequired">'.$langs->trans(
"Label").
'</td>';
976 print
'<td><input class="quatrevingtpercent" name="title" value="'.dol_escape_htmltag($object->title).
'"></td></tr>';
979 print
'<tr><td class="fieldrequired">'.$langs->trans(
"Status").
'</td><td>';
980 print
'<select class="flat" name="status" id="status">';
981 $statuses = $object->labelStatusShort;
983 unset($statuses[$object::STATUS_DRAFT]);
985 foreach ($statuses as $key => $val) {
986 print
'<option value="'.$key.
'"'.((GETPOSTISSET(
'status') ?
GETPOST(
'status') : $object->
statut) == $key ?
' selected="selected"' :
'').
'>'.$langs->trans($val).
'</option>';
994 print
'<tr><td>'.$langs->trans(
"Parent").
'</td><td class="maxwidthonsmartphone">';
995 print
img_picto(
'',
'project',
'class="pictofixedwidth"');
996 $formproject->select_projects(-1, $object->fk_project,
'fk_project', 64, 0, 1, 1, 0, 0, 0,
'', 0, 0,
'',
'',
'');
1002 print
'<tr><td class="tdtop">';
1003 print $langs->trans(
"Usage");
1007 print
'<input type="checkbox" id="usage_opportunity" name="usage_opportunity"'.(GETPOSTISSET(
'usage_opportunity') ? (
GETPOST(
'usage_opportunity',
'alpha') !=
'' ?
' checked="checked"' :
'') : ($object->usage_opportunity ?
' checked="checked"' :
'')).
'> ';
1008 $htmltext = $langs->trans(
"ProjectFollowOpportunity");
1009 print
'<label for="usage_opportunity">'.$form->textwithpicto($langs->trans(
"ProjectFollowOpportunity"), $htmltext).
'</label>';
1011 print
'$( document ).ready(function() {
1012 jQuery("#usage_opportunity").change(function() {
1013 set_usage_opportunity();
1016 set_usage_opportunity();
1018 function set_usage_opportunity() {
1019 console.log("set_usage_opportunity");
1020 if (jQuery("#usage_opportunity").prop("checked")) {
1021 console.log("Show opportunities fields");
1022 jQuery(".classuseopportunity").show();
1024 console.log("Hide opportunities fields "+jQuery("#usage_opportunity").prop("checked"));
1025 jQuery(".classuseopportunity").hide();
1033 print
'<input type="checkbox" id="usage_task" name="usage_task"' . (GETPOSTISSET(
'usage_task') ? (
GETPOST(
'usage_task',
'alpha') !=
'' ?
' checked="checked"' :
'') : ($object->usage_task ?
' checked="checked"' :
'')) .
'> ';
1034 $htmltext = $langs->trans(
"ProjectFollowTasks");
1035 print
'<label for="usage_task">'.$form->textwithpicto($langs->trans(
"ProjectFollowTasks"), $htmltext).
'</label>';
1037 print
'$( document ).ready(function() {
1038 jQuery("#usage_task").change(function() {
1044 function set_usage_task() {
1045 console.log("set_usage_task");
1046 if (jQuery("#usage_task").prop("checked")) {
1047 console.log("Show task fields");
1048 jQuery(".classusetask").show();
1050 console.log("Hide task fields "+jQuery("#usage_task").prop("checked"));
1051 jQuery(".classusetask").hide();
1059 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"' :
'')) .
'> ';
1060 $htmltext = $langs->trans(
"ProjectBillTimeDescription");
1061 print
'<label for="usage_bill_time">'.$form->textwithpicto($langs->trans(
"BillTime"), $htmltext).
'</label>';
1063 print
'$( document ).ready(function() {
1064 jQuery("#usage_bill_time").change(function() {
1065 set_usage_bill_time();
1068 set_usage_bill_time();
1070 function set_usage_bill_time() {
1071 console.log("set_usage_bill_time");
1072 if (jQuery("#usage_bill_time").prop("checked")) {
1073 console.log("Show bill time fields");
1074 jQuery(".classusebilltime").show();
1076 console.log("Hide bill time fields "+jQuery("#usage_bill_time").prop("checked"));
1077 jQuery(".classusebilltime").hide();
1084 if (isModEnabled(
'eventorganization')) {
1085 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"' :
'')) .
'> ';
1086 $htmltext = $langs->trans(
"EventOrganizationDescriptionLong");
1087 print
'<label for="usage_organize_event">'.$form->textwithpicto($langs->trans(
"ManageOrganizeEvent"), $htmltext).
'</label>';
1089 print
'$( document ).ready(function() {
1090 jQuery("#usage_organize_event").change(function() {
1096 function set_usage_event() {
1097 console.log("set_usage_event");
1098 if (jQuery("#usage_organize_event").prop("checked")) {
1099 console.log("Show organize event fields");
1100 jQuery(".classuseorganizeevent").show();
1102 console.log("Hide organize event fields "+jQuery("#usage_organize_event").prop("checked"));
1103 jQuery(".classuseorganizeevent").hide();
1114 if (isModEnabled(
'societe')) {
1116 print(!
getDolGlobalString(
'PROJECT_THIRDPARTY_REQUIRED') ?
'' :
'<span class="fieldrequired">');
1117 print $langs->trans(
"ThirdParty");
1122 $filter = $conf->global->PROJECT_FILTER_FOR_THIRDPARTY_LIST;
1124 $text =
img_picto(
'',
'company',
'class="pictofixedwidth"');
1125 $text .= $form->select_company(!empty($object->thirdparty->id) ? $object->thirdparty->id :
"",
'socid', $filter,
'None', 1, 0, array(), 0,
'minwidth300');
1126 if (!
getDolGlobalString(
'PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS') && empty($conf->dol_use_jmobile)) {
1127 $texthelp = $langs->trans(
"IfNeedToUseOtherObjectKeepEmpty");
1128 print $form->textwithtooltip($text.
' '.
img_help(), $texthelp, 1, 0,
'',
'', 2);
1136 print
'<tr><td>'.$langs->trans(
"Visibility").
'</td><td>';
1139 $array[0] = $langs->trans(
"PrivateProject");
1142 $array[1] = $langs->trans(
"SharedProject");
1145 if (count($array) > 0) {
1146 print $form->selectarray(
'public', $array, $object->public, 0, 0, 0,
'', 0, 0, 0,
'',
'', 1);
1148 print
'<input type="hidden" id="public" name="public" value="'.$object->public.
'">';
1150 if ($object->public == 0) {
1151 print
img_picto($langs->trans(
'PrivateProject'),
'private',
'class="paddingrightonly"');
1152 print $langs->trans(
"PrivateProject");
1154 print
img_picto($langs->trans(
'SharedProject'),
'world',
'class="paddingrightonly"');
1155 print $langs->trans(
"SharedProject");
1161 $classfortr = ($object->usage_opportunity ?
'' :
' hideobject');
1163 print
'<tr class="classuseopportunity'.$classfortr.
'"><td>'.$langs->trans(
"OpportunityStatus").
'</td>';
1166 print $formproject->selectOpportunityStatus(
'opp_status', $object->opp_status, 1, 0, 0, 0,
'minwidth150 inline-block valignmiddle', 1, 1);
1169 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) :
'')).
'"> %';
1170 print
'<span id="oldopppercent" class="opacitymedium"></span>';
1173 print
'<div id="divtocloseproject" class="inline-block valign clearboth paddingtop" style="display: none;">';
1174 print
'<input type="checkbox" id="inputcloseproject" name="closeproject" />';
1175 print
'<label for="inputcloseproject">';
1176 print $form->textwithpicto($langs->trans(
"AlsoCloseAProject"), $langs->trans(
"AlsoCloseAProjectTooltip")).
'</label>';
1183 print
'<tr class="classuseopportunity'.$classfortr.
'"><td>'.$langs->trans(
"OpportunityAmount").
'</td>';
1184 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) :
'')).
'">';
1185 print $langs->getCurrencySymbol($conf->currency);
1191 print
'<tr><td>'.$langs->trans(
"Budget").
'</td>';
1192 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) :
'')).
'">';
1193 print $langs->getCurrencySymbol($conf->currency);
1198 print
'<tr><td>'.$langs->trans(
"Date").(isModEnabled(
'eventorganization') ?
' <span class="classuseorganizeevent">('.$langs->trans(
"Project").
')</span>' :
'').
'</td><td>';
1199 print $form->selectDate($object->date_start ? $object->date_start : -1,
'projectstart', 0, 0, 0,
'', 1, 0);
1200 print
' <span class="opacitymedium"> '.$langs->trans(
"to").
' </span> ';
1201 print $form->selectDate($object->date_end ? $object->date_end : -1,
'projectend', 0, 0, 0,
'', 1, 0);
1202 $object->getLinesArray(
null, 0);
1203 if (!empty($object->usage_task) && !empty($object->lines)) {
1204 print
' <span id="divreportdate" class="hidden"> <input type="checkbox" class="valignmiddle" id="reportdate" name="reportdate" value="yes" ';
1205 if ($comefromclone) {
1208 print
'/><label for="reportdate" class="valignmiddle opacitymedium">'.$langs->trans(
"ProjectReportDate").
'</label></span>';
1212 if (isModEnabled(
'eventorganization')) {
1214 print
'<tr class="classuseorganizeevent"><td>'.$langs->trans(
"Date").
' ('.$langs->trans(
"Event").
')</td><td>';
1215 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);
1216 print
' <span class="opacitymedium"> '.$langs->trans(
"to").
' </span> ';
1217 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);
1221 print
'<tr class="classuseorganizeevent"><td>'.$langs->trans(
"Location").
'</td>';
1222 print
'<td><input class="minwidth300 maxwidth500" type="text" name="location" value="'.dol_escape_htmltag(GETPOSTISSET(
'location') ?
GETPOST(
'location') : $object->location).
'"></td>';
1227 print
'<tr><td class="tdtop">'.$langs->trans(
"Description").
'</td>';
1229 $doleditor =
new DolEditor(
'description', $object->description,
'', 90,
'dolibarr_notes',
'',
false,
true,
getDolGlobalInt(
'FCKEDITOR_ENABLE_SOCIETE'), ROWS_3,
'90%');
1230 $doleditor->Create();
1234 if (isModEnabled(
'categorie')) {
1235 $arrayselected = array();
1236 print
'<tr><td>'.$langs->trans(
"Categories").
'</td><td>';
1237 $cate_arbo = $form->select_all_categories(Categorie::TYPE_PROJECT,
'',
'parent', 64, 0, 1);
1239 $cats = $c->containing($object->id, Categorie::TYPE_PROJECT);
1240 foreach ($cats as $cat) {
1241 $arrayselected[] = $cat->id;
1243 print
img_picto(
'',
'category',
'class="pictofixedwidth"').$form->multiselectarray(
'categories', $cate_arbo, $arrayselected, 0, 0,
'quatrevingtpercent widthcentpercentminusx', 0,
'0');
1248 $parameters = array();
1249 $reshook = $hookmanager->executeHooks(
'formObjectOptions', $parameters, $object, $action);
1250 print $hookmanager->resPrint;
1251 if (empty($reshook)) {
1252 print $object->showOptionals($extrafields,
'edit');
1257 print
dol_get_fiche_head($head,
'project', $langs->trans(
"Project"), -1, ($object->public ?
'projectpub' :
'project'));
1261 if (!empty($_SESSION[
'pageforbacktolist']) && !empty($_SESSION[
'pageforbacktolist'][
'project'])) {
1262 $tmpurl = $_SESSION[
'pageforbacktolist'][
'project'];
1263 $tmpurl = preg_replace(
'/__SOCID__/', $object->socid, $tmpurl);
1264 $linkback =
'<a href="'.$tmpurl.(preg_match(
'/\?/', $tmpurl) ?
'&' :
'?').
'restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
1266 $linkback =
'<a href="'.DOL_URL_ROOT.
'/projet/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
1269 $morehtmlref =
'<div class="refidno">';
1272 $morehtmlref .=
'<br>';
1274 if (!empty($object->thirdparty->id) && $object->thirdparty->id > 0) {
1275 $morehtmlref .= $object->thirdparty->getNomUrl(1,
'project');
1279 if (!empty($object->fk_project) && $object->fk_project) {
1281 $parent->fetch($object->fk_project);
1282 $morehtmlref .= $langs->trans(
"Child of").
' '.$parent->getNomUrl(1,
'project').
' '.$parent->title;
1285 $morehtmlref .=
'</div>';
1288 if (!$user->hasRight(
'projet',
'all',
'lire')) {
1289 $objectsListId = $object->getProjectsAuthorizedForUser($user, 0, 0);
1290 $object->next_prev_filter =
"rowid IN (".$db->sanitize(count($objectsListId) ? join(
',', array_keys($objectsListId)) :
'0').
")";
1293 dol_banner_tab($object,
'ref', $linkback, 1,
'ref',
'ref', $morehtmlref);
1295 print
'<div class="fichecenter">';
1296 print
'<div class="fichehalfleft">';
1297 print
'<div class="underbanner clearboth"></div>';
1299 print
'<table class="border tableforfield centpercent">';
1303 print
'<tr><td class="tdtop">';
1304 print $langs->trans(
"Usage");
1308 print
'<input type="checkbox" disabled name="usage_opportunity"'.(GETPOSTISSET(
'usage_opportunity') ? (
GETPOST(
'usage_opportunity',
'alpha') !=
'' ?
' checked="checked"' :
'') : ($object->usage_opportunity ?
' checked="checked"' :
'')).
'> ';
1309 $htmltext = $langs->trans(
"ProjectFollowOpportunity");
1310 print $form->textwithpicto($langs->trans(
"ProjectFollowOpportunity"), $htmltext);
1314 print
'<input type="checkbox" disabled name="usage_task"'.(GETPOSTISSET(
'usage_task') ? (
GETPOST(
'usage_task',
'alpha') !=
'' ?
' checked="checked"' :
'') : ($object->usage_task ?
' checked="checked"' :
'')).
'> ';
1315 $htmltext = $langs->trans(
"ProjectFollowTasks");
1316 print $form->textwithpicto($langs->trans(
"ProjectFollowTasks"), $htmltext);
1320 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"' :
'')).
'> ';
1321 $htmltext = $langs->trans(
"ProjectBillTimeDescription");
1322 print $form->textwithpicto($langs->trans(
"BillTime"), $htmltext);
1326 if (isModEnabled(
'eventorganization')) {
1327 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"' :
'')).
'> ';
1328 $htmltext = $langs->trans(
"EventOrganizationDescriptionLong");
1329 print $form->textwithpicto($langs->trans(
"ManageOrganizeEvent"), $htmltext);
1335 print
'<tr><td class="titlefield">'.$langs->trans(
"Visibility").
'</td><td>';
1336 if ($object->public) {
1337 print
img_picto($langs->trans(
'SharedProject'),
'world',
'class="paddingrightonly"');
1338 print $langs->trans(
'SharedProject');
1340 print
img_picto($langs->trans(
'PrivateProject'),
'private',
'class="paddingrightonly"');
1341 print $langs->trans(
'PrivateProject');
1345 if (
getDolGlobalString(
'PROJECT_USE_OPPORTUNITIES') && !empty($object->usage_opportunity)) {
1347 print
'<tr><td>'.$langs->trans(
"OpportunityStatus").
'</td><td>';
1348 $code =
dol_getIdFromCode($db, $object->opp_status,
'c_lead_status',
'rowid',
'code');
1350 print $langs->trans(
"OppStatus".$code);
1354 print
' <span title="'.$langs->trans(
"OpportunityProbability").
'"> / ';
1355 if (strcmp($object->opp_percent,
'')) {
1356 print
price($object->opp_percent, 0, $langs, 1, 0).
' %';
1358 print
'</span></td></tr>';
1361 print
'<tr><td>'.$langs->trans(
"OpportunityAmount").
'</td><td>';
1362 if (strcmp($object->opp_amount,
'')) {
1363 print
'<span class="amount">'.price($object->opp_amount, 0, $langs, 1, 0, -1, $conf->currency).
'</span>';
1364 if (strcmp($object->opp_percent,
'')) {
1365 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>';
1372 print
'<tr><td>'.$langs->trans(
"Budget").
'</td><td>';
1373 if (!is_null($object->budget_amount) && strcmp($object->budget_amount,
'')) {
1374 print
'<span class="amount">'.price($object->budget_amount, 0, $langs, 1, 0, 0, $conf->currency).
'</span>';
1379 print
'<tr><td>'.$langs->trans(
"Dates").
'</td><td>';
1381 print($start ? $start :
'?');
1383 print
' <span class="opacitymedium">-</span> ';
1384 print($end ? $end :
'?');
1385 if ($object->hasDelay()) {
1392 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_view.tpl.php';
1397 print
'<div class="fichehalfright">';
1398 print
'<div class="underbanner clearboth"></div>';
1400 print
'<table class="border tableforfield centpercent">';
1403 print
'<td class="titlefield tdtop">'.$langs->trans(
"Description").
'</td><td>';
1408 if (isModEnabled(
'categorie')) {
1409 print
'<tr><td class="valignmiddle">'.$langs->trans(
"Categories").
'</td><td>';
1410 print $form->showCategories($object->id, Categorie::TYPE_PROJECT, 1);
1419 print
'<div class="clearboth"></div>';
1424 if ($action ==
'edit' && $userWrite > 0) {
1425 print $form->buttonsSaveCancel();
1431 print
'<script type="text/javascript">
1432 jQuery(document).ready(function() {
1433 jQuery("#usage_task").change(function() {
1434 console.log("We click on usage task "+jQuery("#usage_task").is(":checked"));
1435 if (! jQuery("#usage_task").is(":checked")) {
1436 jQuery("#usage_bill_time").prop("checked", false);
1440 jQuery("#usage_bill_time").change(function() {
1441 console.log("We click on usage to bill time");
1442 if (jQuery("#usage_bill_time").is(":checked")) {
1443 jQuery("#usage_task").prop("checked", true);
1447 jQuery("#projectstart").change(function() {
1448 console.log("We modify the start date");
1449 jQuery("#divreportdate").show();
1455 if (!empty($conf->use_javascript_ajax) &&
getDolGlobalString(
'PROJECT_USE_OPPORTUNITIES')) {
1457 $defaultcheckedwhenoppclose = 1;
1459 $defaultcheckedwhenoppclose = 0;
1462 print
'<!-- Javascript to manage opportunity status change -->';
1463 print
'<script type="text/javascript">
1464 jQuery(document).ready(function() {
1465 function change_percent()
1467 var element = jQuery("#opp_status option:selected");
1468 var defaultpercent = element.attr("defaultpercent");
1469 var defaultcloseproject = '.((int) $defaultcheckedwhenoppclose).
';
1470 var elemcode = element.attr("elemcode");
1471 var oldpercent = \''.
dol_escape_js($object->opp_percent).
'\';
1473 console.log(
"We select "+elemcode);
1476 var closeproject = 0;
1477 if (elemcode == \
'LOST\') closeproject = 1;
1478 if (elemcode == \'WON\') closeproject = defaultcloseproject;
1479 if (closeproject) jQuery("#inputcloseproject").prop("checked", true);
1480 else jQuery("#inputcloseproject").prop("checked", false);
1482 /* Make the close project checkbox visible or not */
1483 console.log("closeproject="+closeproject);
1484 if (elemcode == \'WON\' || elemcode == \'LOST\')
1486 jQuery("#divtocloseproject").show();
1490 jQuery("#divtocloseproject").hide();
1493 /* Change percent with default percent (defaultpercent) if new status (defaultpercent) is higher than current (jQuery("#opp_percent").val()) */
1494 if (oldpercent != \'\' && (parseFloat(defaultpercent) < parseFloat(oldpercent)))
1496 console.log("oldpercent="+oldpercent+" defaultpercent="+defaultpercent+" def < old");
1497 if (jQuery("#opp_percent").val() != \'\' && oldpercent != \'\') {
1498 jQuery("#oldopppercent").text(\' - '.
dol_escape_js($langs->transnoentities(
"PreviousValue")).
': \'+price2numjs(oldpercent)+\' %\');
1501 if (parseFloat(oldpercent) != 100 && elemcode != \'LOST\') { jQuery("#opp_percent").val(oldpercent); }
1502 else { jQuery("#opp_percent").val(price2numjs(defaultpercent)); }
1504 console.log("oldpercent="+oldpercent+" defaultpercent="+defaultpercent);
1505 if (jQuery("#opp_percent").val() == \'\' || (parseFloat(jQuery("#opp_percent").val()) < parseFloat(defaultpercent))) {
1506 if (jQuery("#opp_percent").val() != \'\' && oldpercent != \'\') {
1507 jQuery("#oldopppercent").text(\' - '.
dol_escape_js($langs->transnoentities(
"PreviousValue")).
': \'+price2numjs(oldpercent)+\' %\');
1509 jQuery("#opp_percent").val(price2numjs(defaultpercent));
1514 jQuery("#opp_status").change(function() {
1526 print
'<div class="tabsAction">';
1527 $parameters = array();
1528 $reshook = $hookmanager->executeHooks(
'addMoreActionsButtons', $parameters, $object, $action);
1530 if (empty($reshook)) {
1531 if ($action !=
"edit" && $action !=
'presend') {
1541 if (empty($user->socid)) {
1543 print
dolGetButtonAction(
'', $langs->trans(
'SendMail'),
'default', $_SERVER[
"PHP_SELF"].
'?action=presend&token='.newToken().
'&id='.$object->id.
'&mode=init#formmailbeforetitle',
'');
1563 if ($userWrite > 0) {
1564 print
dolGetButtonAction(
'', $langs->trans(
'SetToDraft'),
'default', $_SERVER[
"PHP_SELF"].
'?action=confirm_setdraft&confirm=yes&token='.newToken().
'&id='.$object->id,
'');
1566 print
dolGetButtonAction($langs->trans(
'NotOwnerOfProject'), $langs->trans(
'SetToDraft'),
'default', $_SERVER[
'PHP_SELF'].
'#',
'',
false);
1573 if ($userWrite > 0) {
1574 print
dolGetButtonAction(
'', $langs->trans(
'Modify'),
'default', $_SERVER[
"PHP_SELF"].
'?action=edit&token='.newToken().
'&id='.$object->id,
'');
1576 print
dolGetButtonAction($langs->trans(
'NotOwnerOfProject'), $langs->trans(
'Modify'),
'default', $_SERVER[
'PHP_SELF'].
'#',
'',
false);
1582 if ($userWrite > 0) {
1583 print
dolGetButtonAction(
'', $langs->trans(
'Validate'),
'default', $_SERVER[
"PHP_SELF"].
'?action=validate&token='.newToken().
'&id='.$object->id,
'');
1585 print
dolGetButtonAction($langs->trans(
'NotOwnerOfProject'), $langs->trans(
'Validate'),
'default', $_SERVER[
'PHP_SELF'].
'#',
'',
false);
1591 if ($userWrite > 0) {
1592 print
dolGetButtonAction(
'', $langs->trans(
'Close'),
'default', $_SERVER[
"PHP_SELF"].
'?action=close&token='.newToken().
'&id='.$object->id,
'');
1594 print
dolGetButtonAction($langs->trans(
'NotOwnerOfProject'), $langs->trans(
'Close'),
'default', $_SERVER[
'PHP_SELF'].
'#',
'',
false);
1600 if ($userWrite > 0) {
1601 print
dolGetButtonAction(
'', $langs->trans(
'ReOpen'),
'default', $_SERVER[
"PHP_SELF"].
'?action=reopen&token='.newToken().
'&id='.$object->id,
'');
1603 print
dolGetButtonAction($langs->trans(
'NotOwnerOfProject'), $langs->trans(
'ReOpen'),
'default', $_SERVER[
'PHP_SELF'].
'#',
'',
false);
1609 $arrayforbutaction = array(
1610 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),
1611 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),
1612 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),
1613 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),
1614 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),
1615 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),
1616 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),
1617 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),
1618 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),
1619 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),
1622 $params = array(
'backtopage' => $_SERVER[
"PHP_SELF"].
'?id='.$object->id);
1624 print
dolGetButtonAction(
'', $langs->trans(
"Create"),
'default', $arrayforbutaction,
'', 1, $params);
1628 if ($user->hasRight(
'projet',
'creer')) {
1629 if ($userWrite > 0) {
1630 print
dolGetButtonAction(
'', $langs->trans(
'ToClone'),
'default', $_SERVER[
"PHP_SELF"].
'?action=clone&token='.newToken().
'&id='.$object->id,
'');
1632 print
dolGetButtonAction($langs->trans(
'NotOwnerOfProject'), $langs->trans(
'ToClone'),
'default', $_SERVER[
'PHP_SELF'].
'#',
'',
false);
1637 if ($user->hasRight(
'projet',
'supprimer') || ($object->statut ==
Project::STATUS_DRAFT && $user->hasRight(
'projet',
'creer'))) {
1638 if ($userDelete > 0 || ($object->statut ==
Project::STATUS_DRAFT && $user->hasRight(
'projet',
'creer'))) {
1639 print
dolGetButtonAction(
'', $langs->trans(
'Delete'),
'delete', $_SERVER[
"PHP_SELF"].
'?action=delete&token='.newToken().
'&id='.$object->id,
'');
1641 print
dolGetButtonAction($langs->trans(
'NotOwnerOfProject'), $langs->trans(
'Delete'),
'default', $_SERVER[
'PHP_SELF'].
'#',
'',
false);
1649 if (
GETPOST(
'modelselected')) {
1650 $action =
'presend';
1653 if ($action !=
'presend') {
1654 print
'<div class="fichecenter"><div class="fichehalfleft">';
1655 print
'<a name="builddoc"></a>';
1661 $children = $object->getChildren();
1663 print
'<table class="centpercent notopnoleftnoright table-fiche-title">';
1664 print
'<tr class="titre"><td class="nobordernopadding valignmiddle col-title">';
1665 print
'<div class="titre inline-block">'.$langs->trans(
'Sub-projects').
'</div>';
1666 print
'</td></tr></table>';
1668 print
'<div class="div-table-responsive-no-min">';
1669 print
'<table class="centpercent noborder'.($morecss ?
' '.$morecss :
'').
'">';
1670 print
'<tr class="liste_titre">';
1671 print
getTitleFieldOfList(
'Ref', 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'',
'',
'',
'', 1);
1672 print
getTitleFieldOfList(
'Title', 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'',
'',
'',
'', 1);
1673 print
getTitleFieldOfList(
'Status', 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'',
'',
'',
'', 1);
1677 $subproject =
new Project($db);
1678 foreach ($children as $child) {
1679 $subproject->fetch($child->rowid);
1680 print
'<tr class="oddeven">';
1681 print
'<td class="nowraponall">'.$subproject->getNomUrl(1,
'project').
'</td>';
1682 print
'<td class="nowraponall tdoverflowmax125">'.$child->title.
'</td>';
1683 print
'<td class="nowraponall">'.$subproject->getLibStatut(5).
'</td>';
1696 $filedir = $conf->project->multidir_output[$object->entity].
"/".
dol_sanitizeFileName($object->ref);
1697 $urlsource = $_SERVER[
"PHP_SELF"].
"?id=".$object->id;
1698 $genallowed = ($user->hasRight(
'projet',
'lire') && $userAccess > 0);
1699 $delallowed = ($user->hasRight(
'projet',
'creer') && $userWrite > 0);
1701 print $formfile->showdocuments(
'project', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 0, 0,
'',
'',
'',
'',
'', $object);
1703 print
'</div><div class="fichehalfright">';
1707 $morehtmlcenter =
'<div class="nowraponall">';
1708 $morehtmlcenter .=
dolGetButtonTitle($langs->trans(
'FullConversation'),
'',
'fa fa-comments imgforviewmode', DOL_URL_ROOT.
'/projet/messaging.php?id='.$object->id);
1709 $morehtmlcenter .=
dolGetButtonTitle($langs->trans(
'FullList'),
'',
'fa fa-bars imgforviewmode', DOL_URL_ROOT.
'/projet/agenda.php?id='.$object->id);
1710 $morehtmlcenter .=
'</div>';
1713 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formactions.class.php';
1715 $somethingshown =
$formactions->showactions($object,
'project', 0, 1,
'', $MAXEVENT,
'', $morehtmlcenter);
1717 print
'</div></div>';
1721 $modelmail =
'project';
1722 $defaulttopic =
'SendProjectRef';
1723 $defaulttopiclang =
'projects';
1724 $diroutput = $conf->project->multidir_output[$object->entity];
1725 $autocopy =
'MAIN_MAIL_AUTOCOPY_PROJECT_TO';
1726 $trackid =
'proj'.$object->id;
1728 include DOL_DOCUMENT_ROOT.
'/core/tpl/card_presend.tpl.php';
1731 $parameters = array();
1732 $reshook = $hookmanager->executeHooks(
'mainCardTabAddMore', $parameters, $object, $action);
1734 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...
dol_getIdFromCode($db, $key, $tablename, $fieldkey='code', $fieldid='id', $entityfilter=0, $filters='', $useCache=true)
Return an id or code from a code or id.
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.
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.