30require
'../main.inc.php';
31require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
32require_once DOL_DOCUMENT_ROOT.
'/projet/class/task.class.php';
33require_once DOL_DOCUMENT_ROOT.
'/core/lib/project.lib.php';
34require_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
35require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formprojet.class.php';
36require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
37require_once DOL_DOCUMENT_ROOT.
'/core/modules/project/modules_project.php';
38require_once DOL_DOCUMENT_ROOT.
'/core/class/extrafields.class.php';
39require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
42$langsLoad=array(
'projects',
'companies');
43if (isModEnabled(
'eventorganization')) {
44 $langsLoad[]=
'eventorganization';
47$langs->loadLangs($langsLoad);
51$action =
GETPOST(
'action',
'aZ09');
52$backtopage =
GETPOST(
'backtopage',
'alpha');
53$backtopageforcancel =
GETPOST(
'backtopageforcancel',
'alpha');
54$backtopagejsfields =
GETPOST(
'backtopagejsfields',
'alpha');
55$cancel =
GETPOST(
'cancel',
'alpha');
56$confirm =
GETPOST(
'confirm',
'aZ09');
59if (!empty($backtopagejsfields)) {
60 $tmpbacktopagejsfields = explode(
':', $backtopagejsfields);
61 $dol_openinpopup = $tmpbacktopagejsfields[0];
64$status =
GETPOST(
'status',
'int');
65$opp_status =
GETPOST(
'opp_status',
'int');
67$objcanvas =
GETPOST(
"objcanvas",
"alphanohtml");
68$comefromclone =
GETPOST(
"comefromclone",
"alphanohtml");
73$location =
GETPOST(
'location',
'alphanohtml');
77$mine =
GETPOST(
'mode') ==
'mine' ? 1 : 0;
81$hookmanager->initHooks(array(
'projectcard',
'globalcard'));
88if ($id > 0 || !empty($ref)) {
89 $ret = $object->fetch($id, $ref);
91 $object->fetch_thirdparty();
92 if (
getDolGlobalString(
'PROJECT_ALLOW_COMMENT_ON_PROJECT') && method_exists($object,
'fetchComments') && empty($object->comments)) {
93 $object->fetchComments();
100$extrafields->fetch_name_optionals_label($object->table_element);
103$socid =
GETPOST(
'socid',
'int');
107if ($id ==
'' && $ref ==
'' && ($action !=
"create" && $action !=
"add" && $action !=
"update" && !
GETPOST(
"cancel"))) {
111$permissiontoadd = $user->hasRight(
'projet',
'creer');
112$permissiontodelete = $user->hasRight(
'projet',
'supprimer');
113$permissiondellink = $user->hasRight(
'projet',
'creer');
120$parameters = array(
'id'=>$socid,
'objcanvas'=>$objcanvas);
121$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
126if (empty($reshook)) {
127 $backurlforlist = DOL_URL_ROOT.
'/projet/list.php';
131 if (
GETPOST(
"comefromclone") == 1) {
132 $result = $object->delete($user);
134 header(
"Location: index.php");
138 setEventMessages($langs->trans(
"CantRemoveProject", $langs->transnoentitiesnoconv(
"ProjectOverview")),
null,
'errors');
143 if (empty($backtopage) || ($cancel && empty($id))) {
144 if (empty($backtopage) || ($cancel && strpos($backtopage,
'__ID__'))) {
145 if (empty($id) && (($action !=
'add' && $action !=
'create') || $cancel)) {
146 $backtopage = $backurlforlist;
148 $backtopage = DOL_URL_ROOT.
'/projet/card.php?id='.((!empty($id) && $id > 0) ? $id :
'__ID__');
154 if (!empty($backtopageforcancel)) {
155 header(
"Location: ".$backtopageforcancel);
157 } elseif (!empty($backtopage)) {
158 header(
"Location: ".$backtopage);
164 include DOL_DOCUMENT_ROOT.
'/core/actions_dellink.inc.php';
167 if ($action ==
'confirm_setdraft' && $confirm ==
'yes' && $permissiontoadd) {
168 $result = $object->setStatut($object::STATUS_DRAFT,
null,
'',
'PROJECT_MODIFY');
179 if ($action ==
'add' && $permissiontoadd) {
182 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Ref")),
null,
'errors');
186 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"ProjectLabel")),
null,
'errors');
191 if (
GETPOST(
'usage_opportunity') !=
'' && !(
GETPOST(
'opp_status') > 0)) {
193 setEventMessages($langs->trans(
"ErrorOppStatusRequiredIfUsage"),
null,
'errors');
195 if (
GETPOST(
'opp_amount') !=
'' && !(
GETPOST(
'opp_status') > 0)) {
197 setEventMessages($langs->trans(
"ErrorOppStatusRequiredIfAmount"),
null,
'errors');
211 $object->ref =
GETPOST(
'ref',
'alphanohtml');
212 $object->fk_project =
GETPOST(
'fk_project',
'int');
213 $object->title =
GETPOST(
'title',
'alphanohtml');
214 $object->socid =
GETPOST(
'socid',
'int');
215 $object->description =
GETPOST(
'description',
'restricthtml');
216 $object->public =
GETPOST(
'public',
'alphanohtml');
218 $object->budget_amount =
price2num(
GETPOST(
'budget_amount',
'alphanohtml'));
220 $object->date_start = $date_start;
221 $object->date_end = $date_end;
222 $object->date_start_event = $date_start_event;
223 $object->date_end_event = $date_end_event;
224 $object->location = $location;
225 $object->statut = $status;
226 $object->opp_status = $opp_status;
227 $object->opp_percent = $opp_percent;
228 $object->usage_opportunity = (
GETPOST(
'usage_opportunity',
'alpha') ==
'on' ? 1 : 0);
229 $object->usage_task = (
GETPOST(
'usage_task',
'alpha') ==
'on' ? 1 : 0);
230 $object->usage_bill_time = (
GETPOST(
'usage_bill_time',
'alpha') ==
'on' ? 1 : 0);
231 $object->usage_organize_event = (
GETPOST(
'usage_organize_event',
'alpha') ==
'on' ? 1 : 0);
234 $ret = $extrafields->setOptionalsFromPost(
null, $object);
239 $result = $object->create($user);
240 if (!$error && $result > 0) {
242 $typeofcontact =
'PROJECTLEADER';
243 $result = $object->add_contact($user->id, $typeofcontact,
'internal');
249 } elseif ($result < 0) {
250 $langs->load(
"errors");
255 $langs->load(
"errors");
259 if (!$error && !empty($object->id) > 0) {
261 $categories =
GETPOST(
'categories',
'array');
262 $result = $object->setCategories($categories);
264 $langs->load(
"errors");
273 if (!empty($backtopage)) {
274 $backtopage = preg_replace(
'/--IDFORBACKTOPAGE--|__ID__/', $object->id, $backtopage);
275 $backtopage = $backtopage.
'&projectid='.$object->id;
276 header(
"Location: ".$backtopage);
279 header(
"Location:card.php?id=".$object->id);
284 unset($_POST[
"ref"]);
292 if ($action ==
'update' && empty(
GETPOST(
'cancel')) && $permissiontoadd) {
297 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Ref")),
null,
'errors');
301 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"ProjectLabel")),
null,
'errors');
307 $object->oldcopy = clone $object;
309 $old_start_date = $object->date_start;
311 $object->ref =
GETPOST(
'ref',
'alpha');
312 $object->fk_project =
GETPOST(
'fk_project',
'int');
313 $object->title =
GETPOST(
'title',
'alphanohtml');
314 $object->statut =
GETPOST(
'status',
'int');
315 $object->socid =
GETPOST(
'socid',
'int');
316 $object->description =
GETPOST(
'description',
'restricthtml');
317 $object->public =
GETPOST(
'public',
'alpha');
318 $object->date_start = (!
GETPOST(
'projectstart')) ?
'' : $date_start;
319 $object->date_end = (!
GETPOST(
'projectend')) ?
'' : $date_end;
320 $object->date_start_event = (!
GETPOST(
'date_start_event')) ?
'' : $date_start_event;
321 $object->date_end_event = (!
GETPOST(
'date_end_event')) ?
'' : $date_end_event;
322 $object->location = $location;
323 if (GETPOSTISSET(
'opp_amount')) {
326 if (GETPOSTISSET(
'budget_amount')) {
329 if (GETPOSTISSET(
'opp_status')) {
330 $object->opp_status = $opp_status;
332 if (GETPOSTISSET(
'opp_percent')) {
333 $object->opp_percent = $opp_percent;
335 $object->usage_opportunity = (
GETPOST(
'usage_opportunity',
'alpha') ==
'on' ? 1 : 0);
336 $object->usage_task = (
GETPOST(
'usage_task',
'alpha') ==
'on' ? 1 : 0);
337 $object->usage_bill_time = (
GETPOST(
'usage_bill_time',
'alpha') ==
'on' ? 1 : 0);
338 $object->usage_organize_event = (
GETPOST(
'usage_organize_event',
'alpha') ==
'on' ? 1 : 0);
341 $ret = $extrafields->setOptionalsFromPost(
null, $object,
'@GETPOSTISSET');
348 if ($object->opp_amount && ($object->opp_status <= 0)) {
350 setEventMessages($langs->trans(
"ErrorOppStatusRequiredIfAmount"),
null,
'errors');
355 $result = $object->update($user);
365 $categories =
GETPOST(
'categories',
'array');
366 $result = $object->setCategories($categories);
375 if (
GETPOST(
"reportdate") && ($object->date_start != $old_start_date)) {
376 $result = $object->shiftTaskDate($old_start_date);
379 setEventMessages($langs->trans(
"ErrorShiftTaskDate").
':'.$object->error, $object->errors,
'errors');
386 $resclose = $object->setClose($user);
389 setEventMessages($langs->trans(
"FailedToCloseProject").
':'.$object->error, $object->errors,
'errors');
400 if (
GETPOST(
'socid',
'int') > 0) {
401 $object->fetch_thirdparty(
GETPOST(
'socid',
'int'));
403 unset($object->thirdparty);
409 if ($action ==
'builddoc' && $permissiontoadd) {
412 $object->setDocModel($user,
GETPOST(
'model',
'alpha'));
415 $outputlangs = $langs;
416 if (
GETPOST(
'lang_id',
'aZ09')) {
418 $outputlangs->setDefaultLang(
GETPOST(
'lang_id',
'aZ09'));
420 $result = $object->generateDocument($object->model_pdf, $outputlangs);
428 if ($action ==
'remove_file' && $permissiontoadd) {
429 if ($object->id > 0) {
430 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
432 $langs->load(
"other");
433 $upload_dir = $conf->project->multidir_output[$object->entity];
434 $file = $upload_dir.
'/'.
GETPOST(
'file');
446 if ($action ==
'confirm_validate' && $confirm ==
'yes' && $permissiontoadd) {
447 $result = $object->setValid($user);
453 if ($action ==
'confirm_close' && $confirm ==
'yes' && $permissiontoadd) {
454 $result = $object->setClose($user);
460 if ($action ==
'confirm_reopen' && $confirm ==
'yes' && $permissiontoadd) {
461 $result = $object->setValid($user);
467 if ($action ==
'confirm_delete' && $confirm ==
'yes' && $permissiontodelete) {
469 $result = $object->delete($user);
473 if (!empty($_SESSION[
'pageforbacktolist']) && !empty($_SESSION[
'pageforbacktolist'][
'project'])) {
474 $tmpurl = $_SESSION[
'pageforbacktolist'][
'project'];
475 $tmpurl = preg_replace(
'/__SOCID__/', $object->socid, $tmpurl);
476 $urlback = $tmpurl.(preg_match(
'/\?/', $tmpurl) ?
'&' :
'?').
'restore_lastsearch_values=1';
478 $urlback = DOL_URL_ROOT.
'/projet/list.php?restore_lastsearch_values=1';
481 header(
"Location: ".$urlback);
489 if ($action ==
'confirm_clone' && $permissiontoadd && $confirm ==
'yes') {
490 $clone_contacts =
GETPOST(
'clone_contacts') ? 1 : 0;
491 $clone_tasks =
GETPOST(
'clone_tasks') ? 1 : 0;
492 $clone_project_files =
GETPOST(
'clone_project_files') ? 1 : 0;
493 $clone_task_files =
GETPOST(
'clone_task_files') ? 1 : 0;
494 $clone_notes =
GETPOST(
'clone_notes') ? 1 : 0;
495 $move_date =
GETPOST(
'move_date') ? 1 : 0;
496 $clone_thirdparty =
GETPOST(
'socid',
'int') ?
GETPOST(
'socid',
'int') : 0;
498 $result = $object->createFromClone($user, $object->id, $clone_contacts, $clone_tasks, $clone_project_files, $clone_task_files, $clone_notes, $move_date, 0, $clone_thirdparty);
504 $newobject->fetch($result);
506 setEventMessages($langs->trans(
"ProjectCreatedInDolibarr", $newobject->ref),
"",
'mesgs');
508 header(
'Location: '.$_SERVER[
'PHP_SELF'].
'?id='.$result.
'&action=edit&comefromclone=1');
514 $triggersendname =
'PROJECT_SENTBYMAIL';
516 $autocopy =
'MAIN_MAIL_AUTOCOPY_PROJECT_TO';
517 $trackid =
'proj'.$object->id;
518 include DOL_DOCUMENT_ROOT.
'/core/actions_sendmails.inc.php';
526$form =
new Form($db);
529$userstatic =
new User($db);
531$title = $langs->trans(
"Project").
' - '.$object->ref.(!empty($object->thirdparty->name) ?
' - '.$object->thirdparty->name :
'').(!empty($object->title) ?
' - '.$object->title :
'');
532if (
getDolGlobalString(
'MAIN_HTML_TITLE') && preg_match(
'/projectnameonly/', $conf->global->MAIN_HTML_TITLE)) {
533 $title = $object->ref.(!empty($object->thirdparty->name) ?
' - '.$object->thirdparty->name :
'').(!empty($object->title) ?
' - '.$object->title :
'');
536$help_url =
"EN:Module_Projects|FR:Module_Projets|ES:Módulo_Proyectos|DE:Modul_Projekte";
540$titleboth = $langs->trans(
"LeadsOrProjects");
541$titlenew = $langs->trans(
"NewLeadOrProject");
543 $titleboth = $langs->trans(
"Projects");
544 $titlenew = $langs->trans(
"NewProject");
547 $titleboth = $langs->trans(
"Leads");
548 $titlenew = $langs->trans(
"NewLead");
551if ($action ==
'create' && $user->hasRight(
'projet',
'creer')) {
556 $thirdparty =
new Societe($db);
558 $thirdparty->fetch($socid);
563 print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">';
564 print
'<input type="hidden" name="action" value="add">';
565 print
'<input type="hidden" name="token" value="'.newToken().
'">';
566 print
'<input type="hidden" name="backtopage" value="'.$backtopage.
'">';
567 print
'<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.
'">';
568 print
'<input type="hidden" name="backtopagejsfields" value="'.$backtopagejsfields.
'">';
569 print
'<input type="hidden" name="dol_openinpopup" value="'.$dol_openinpopup.
'">';
573 print
'<table class="border centpercent tableforfieldcreate">';
576 $modele = !
getDolGlobalString(
'PROJECT_ADDON') ?
'mod_project_simple' : $conf->global->PROJECT_ADDON;
582 $dirmodels = array_merge(array(
'/'), (array) $conf->modules_parts[
'models']);
583 foreach ($dirmodels as $reldir) {
584 $file =
dol_buildpath($reldir.
"core/modules/project/".$modele.
'.php', 0);
585 if (file_exists($file)) {
587 $classname = $modele;
594 $modProject =
new $classname();
596 $defaultref = $modProject->getNextValue($thirdparty, $object);
599 if (is_numeric($defaultref) && $defaultref <= 0) {
605 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).
'">';
607 print
' '.$form->textwithpicto(
'', $langs->trans(
"YouCanCompleteRef", $suggestedref));
612 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>';
616 print
'<tr><td>'.$langs->trans(
"Parent").
'</td><td class="maxwidthonsmartphone">';
617 print
img_picto(
'',
'project',
'class="pictofixedwidth"');
618 $formproject->select_projects(-1,
'',
'fk_project', 64, 0, 1, 1, 0, 0, 0,
'', 0, 0,
'',
'',
'');
624 print
'<tr><td class="tdtop">';
625 print $langs->trans(
"Usage");
629 print
'<input type="checkbox" id="usage_opportunity" name="usage_opportunity"'.(GETPOSTISSET(
'usage_opportunity') ? (
GETPOST(
'usage_opportunity',
'alpha') ?
' checked="checked"' :
'') :
' checked="checked"').
'"> ';
630 $htmltext = $langs->trans(
"ProjectFollowOpportunity");
631 print
'<label for="usage_opportunity">'.$form->textwithpicto($langs->trans(
"ProjectFollowOpportunity"), $htmltext).
'</label>';
633 print
'$( document ).ready(function() {
634 jQuery("#usage_opportunity").change(function() {
635 if (jQuery("#usage_opportunity").prop("checked")) {
636 console.log("Show opportunities fields");
637 jQuery(".classuseopportunity").show();
639 console.log("Hide opportunities fields "+jQuery("#usage_opportunity").prop("checked"));
640 jQuery(".classuseopportunity").hide();
644 if (GETPOSTISSET(
'usage_opportunity') && !
GETPOST(
'usage_opportunity')) {
645 print
'jQuery(".classuseopportunity").hide();';
652 print
'<input type="checkbox" id="usage_task" name="usage_task"'.(GETPOSTISSET(
'usage_task') ? (
GETPOST(
'usage_task',
'alpha') ?
' checked="checked"' :
'') :
' checked="checked"').
'"> ';
653 $htmltext = $langs->trans(
"ProjectFollowTasks");
654 print
'<label for="usage_task">'.$form->textwithpicto($langs->trans(
"ProjectFollowTasks"), $htmltext).
'</label>';
656 print
'$( document ).ready(function() {
657 jQuery("#usage_task").change(function() {
658 if (jQuery("#usage_task").prop("checked")) {
659 console.log("Show task fields");
660 jQuery(".classusetask").show();
662 console.log("Hide tasks fields "+jQuery("#usage_task").prop("checked"));
663 jQuery(".classusetask").hide();
667 if (GETPOSTISSET(
'usage_task') && !
GETPOST(
'usage_task')) {
668 print
'jQuery(".classusetask").hide();';
675 print
'<input type="checkbox" id="usage_bill_time" name="usage_bill_time"'.(GETPOSTISSET(
'usage_bill_time') ? (
GETPOST(
'usage_bill_time',
'alpha') ?
' checked="checked"' :
'') :
'').
'"> ';
676 $htmltext = $langs->trans(
"ProjectBillTimeDescription");
677 print
'<label for="usage_bill_time">'.$form->textwithpicto($langs->trans(
"BillTime"), $htmltext).
'</label>';
679 print
'$( document ).ready(function() {
680 jQuery("#usage_bill_time").change(function() {
681 if (jQuery("#usage_bill_time").prop("checked")) {
682 console.log("Show bill time fields");
683 jQuery(".classusebilltime").show();
685 console.log("Hide bill time fields "+jQuery("#usage_bill_time").prop("checked"));
686 jQuery(".classusebilltime").hide();
690 if (GETPOSTISSET(
'usage_bill_time') && !
GETPOST(
'usage_bill_time')) {
691 print
'jQuery(".classusebilltime").hide();';
697 if (isModEnabled(
'eventorganization')) {
698 print
'<input type="checkbox" id="usage_organize_event" name="usage_organize_event"'.(GETPOSTISSET(
'usage_organize_event') ? (
GETPOST(
'usage_organize_event',
'alpha') ?
' checked="checked"' :
'') :
'').
'"> ';
699 $htmltext = $langs->trans(
"EventOrganizationDescriptionLong");
700 print
'<label for="usage_organize_event">'.$form->textwithpicto($langs->trans(
"ManageOrganizeEvent"), $htmltext).
'</label>';
702 print
'$( document ).ready(function() {
703 jQuery("#usage_organize_event").change(function() {
704 if (jQuery("#usage_organize_event").prop("checked")) {
705 console.log("Show organize event fields");
706 jQuery(".classuseorganizeevent").show();
708 console.log("Hide organize event fields "+jQuery("#usage_organize_event").prop("checked"));
709 jQuery(".classuseorganizeevent").hide();
713 if (!
GETPOST(
'usage_organize_event')) {
714 print
'jQuery(".classuseorganizeevent").hide();';
724 if (isModEnabled(
'societe')) {
726 print(!
getDolGlobalString(
'PROJECT_THIRDPARTY_REQUIRED') ?
'' :
'<span class="fieldrequired">');
727 print $langs->trans(
"ThirdParty");
729 print
'</td><td class="maxwidthonsmartphone">';
732 $filter = $conf->global->PROJECT_FILTER_FOR_THIRDPARTY_LIST;
734 $text =
img_picto(
'',
'company').$form->select_company(
GETPOST(
'socid',
'int'),
'socid', $filter,
'SelectThirdParty', 1, 0, array(), 0,
'minwidth300 widthcentpercentminusxx maxwidth500');
735 if (!
getDolGlobalString(
'PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS') && empty($conf->dol_use_jmobile)) {
736 $texthelp = $langs->trans(
"IfNeedToUseOtherObjectKeepEmpty");
737 print $form->textwithtooltip($text.
' '.
img_help(), $texthelp, 1);
741 if (!GETPOSTISSET(
'backtopage')) {
742 $url =
'/societe/card.php?action=create&client=3&fournisseur=0&backtopage='.urlencode($_SERVER[
"PHP_SELF"].
'?action=create');
743 $newbutton =
'<span class="fa fa-plus-circle valignmiddle paddingleft" title="'.$langs->trans(
"AddThirdParty").
'"></span>';
746 $tmpbacktopagejsfields =
'addthirdparty:socid,search_socid';
747 print
dolButtonToOpenUrlInDialogPopup(
'addthirdparty', $langs->transnoentitiesnoconv(
'AddThirdParty'), $newbutton, $url,
'',
'',
'', $tmpbacktopagejsfields);
749 print
' <a href="'.DOL_URL_ROOT.$url.
'">'.$newbutton.
'</a>';
757 print
'<tr><td>'.$langs->trans(
"Status").
'</td><td>';
758 print
'<input type="hidden" name="status" value="'.$status.
'">';
759 print $object->LibStatut($status, 4);
764 print
'<tr><td>'.$langs->trans(
"Visibility").
'</td><td class="maxwidthonsmartphone">';
767 $array[0] = $langs->trans(
"PrivateProject");
770 $array[1] = $langs->trans(
"SharedProject");
773 if (count($array) > 0) {
774 print $form->selectarray(
'public', $array,
GETPOST(
'public'), 0, 0, 0,
'', 0, 0, 0,
'',
'', 1);
776 print
'<input type="hidden" name="public" id="public" value="'.GETPOST(
'public').
'">';
779 print
img_picto($langs->trans(
'PrivateProject'),
'private',
'class="paddingrightonly"');
780 print $langs->trans(
"PrivateProject");
782 print
img_picto($langs->trans(
'SharedProject'),
'world',
'class="paddingrightonly"');
783 print $langs->trans(
"SharedProject");
790 print
'<tr class="classuseopportunity"><td><span class="fieldrequired">'.$langs->trans(
"OpportunityStatus").
'</span></td>';
791 print
'<td class="maxwidthonsmartphone">';
792 print $formproject->selectOpportunityStatus(
'opp_status', GETPOSTISSET(
'opp_status') ?
GETPOST(
'opp_status') : $object->opp_status, 1, 0, 0, 0,
'', 0, 1);
795 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>';
796 print
'<input type="hidden" name="opp_percent_not_set" id="opp_percent_not_set" value="'.dol_escape_htmltag(GETPOSTISSET(
'opp_percent') ?
'0' :
'1').
'">';
801 print
'<tr class="classuseopportunity"><td>'.$langs->trans(
"OpportunityAmount").
'</td>';
802 print
'<td><input class="width75 right" type="text" name="opp_amount" value="'.dol_escape_htmltag(GETPOSTISSET(
'opp_amount') ?
GETPOST(
'opp_amount') :
'').
'">';
803 print
' '.$langs->getCurrencySymbol($conf->currency);
809 print
'<tr><td>'.$langs->trans(
"Budget").
'</td>';
810 print
'<td><input class="width75 right" type="text" name="budget_amount" value="'.dol_escape_htmltag(GETPOSTISSET(
'budget_amount') ?
GETPOST(
'budget_amount') :
'').
'">';
811 print
' '.$langs->getCurrencySymbol($conf->currency);
816 print
'<tr><td>'.$langs->trans(
"Date").(isModEnabled(
'eventorganization') ?
' <span class="classuseorganizeevent">('.$langs->trans(
"Project").
')</span>' :
'').
'</td><td>';
817 print $form->selectDate(($date_start ? $date_start :
''),
'projectstart', 0, 0, 0,
'', 1, 0);
818 print
' <span class="opacitymedium"> '.$langs->trans(
"to").
' </span> ';
819 print $form->selectDate(($date_end ? $date_end : -1),
'projectend', 0, 0, 0,
'', 1, 0);
822 if (isModEnabled(
'eventorganization')) {
824 print
'<tr class="classuseorganizeevent"><td>'.$langs->trans(
"Date").
' ('.$langs->trans(
"Event").
')</td><td>';
825 print $form->selectDate(($date_start_event ? $date_start_event : -1),
'date_start_event', 1, 1, 1,
'', 1, 0);
826 print
' <span class="opacitymedium"> '.$langs->trans(
"to").
' </span> ';
827 print $form->selectDate(($date_end_event ? $date_end_event : -1),
'date_end_event', 1, 1, 1,
'', 1, 0);
831 print
'<tr class="classuseorganizeevent"><td>'.$langs->trans(
"Location").
'</td>';
832 print
'<td><input class="minwidth300 maxwidth500" type="text" name="location" value="'.dol_escape_htmltag($location).
'"></td>';
837 print
'<tr><td class="tdtop">'.$langs->trans(
"Description").
'</td>';
839 $doleditor =
new DolEditor(
'description',
GETPOST(
"description",
'restricthtml'),
'', 90,
'dolibarr_notes',
'',
false,
true,
getDolGlobalString(
'FCKEDITOR_ENABLE_SOCIETE'), ROWS_3,
'90%');
840 $doleditor->Create();
843 if (isModEnabled(
'categorie')) {
845 print
'<tr><td>'.$langs->trans(
"Categories").
'</td><td colspan="3">';
846 $cate_arbo = $form->select_all_categories(Categorie::TYPE_PROJECT,
'',
'parent', 64, 0, 1);
847 $arrayselected =
GETPOST(
'categories',
'array');
848 print
img_picto(
'',
'category',
'class="pictofixedwidth"').$form->multiselectarray(
'categories', $cate_arbo, $arrayselected,
'', 0,
'quatrevingtpercent widthcentpercentminusx', 0, 0);
853 $parameters = array();
854 $reshook = $hookmanager->executeHooks(
'formObjectOptions', $parameters, $object, $action);
855 print $hookmanager->resPrint;
856 if (empty($reshook)) {
857 print $object->showOptionals($extrafields,
'create');
864 print $form->buttonsSaveCancel(
'CreateDraft');
870 print
'<script type="text/javascript">
871 jQuery(document).ready(function() {
872 function change_percent()
874 var element = jQuery("#opp_status option:selected");
875 var defaultpercent = element.attr("defaultpercent");
876 /*if (jQuery("#opp_percent_not_set").val() == "") */
877 jQuery("#opp_percent").val(defaultpercent);
881 jQuery("#opp_status").change(function() {
885 jQuery("#usage_task").change(function() {
886 console.log("We click on usage task "+jQuery("#usage_task").is(":checked"));
887 if (! jQuery("#usage_task").is(":checked")) {
888 jQuery("#usage_bill_time").prop("checked", false);
892 jQuery("#usage_bill_time").change(function() {
893 console.log("We click on usage to bill time");
894 if (jQuery("#usage_bill_time").is(":checked")) {
895 jQuery("#usage_task").prop("checked", true);
900} elseif ($object->id > 0) {
905 $res = $object->fetch_optionals();
908 $userAccess = $object->restrictedProjectArea($user,
'read');
909 $userWrite = $object->restrictedProjectArea($user,
'write');
910 $userDelete = $object->restrictedProjectArea($user,
'delete');
915 if ($action ==
'validate') {
916 print $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.$object->id, $langs->trans(
'ValidateProject'), $langs->trans(
'ConfirmValidateProject'),
'confirm_validate',
'', 0, 1);
919 if ($action ==
'close') {
920 print $form->formconfirm($_SERVER[
"PHP_SELF"].
"?id=".$object->id, $langs->trans(
"CloseAProject"), $langs->trans(
"ConfirmCloseAProject"),
"confirm_close",
'',
'', 1);
923 if ($action ==
'reopen') {
924 print $form->formconfirm($_SERVER[
"PHP_SELF"].
"?id=".$object->id, $langs->trans(
"ReOpenAProject"), $langs->trans(
"ConfirmReOpenAProject"),
"confirm_reopen",
'',
'', 1);
927 if ($action ==
'delete') {
928 $text = $langs->trans(
"ConfirmDeleteAProject");
929 $task =
new Task($db);
930 $taskarray = $task->getTasksArray(0, 0, $object->id, 0, 0);
931 $nboftask = count($taskarray);
933 $text .=
'<br>'.img_warning().
' '.$langs->trans(
"ThisWillAlsoRemoveTasks", $nboftask);
935 print $form->formconfirm($_SERVER[
"PHP_SELF"].
"?id=".$object->id, $langs->trans(
"DeleteAProject"), $text,
"confirm_delete",
'',
'', 1);
939 if ($action ==
'clone') {
940 $formquestion = array(
941 'text' => $langs->trans(
"ConfirmClone"),
942 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')),
943 array(
'type' =>
'checkbox',
'name' =>
'clone_contacts',
'label' => $langs->trans(
"CloneContacts"),
'value' => true),
944 array(
'type' =>
'checkbox',
'name' =>
'clone_tasks',
'label' => $langs->trans(
"CloneTasks"),
'value' => true),
945 array(
'type' =>
'checkbox',
'name' =>
'move_date',
'label' => $langs->trans(
"CloneMoveDate"),
'value' => true),
946 array(
'type' =>
'checkbox',
'name' =>
'clone_notes',
'label' => $langs->trans(
"CloneNotes"),
'value' => true),
947 array(
'type' =>
'checkbox',
'name' =>
'clone_project_files',
'label' => $langs->trans(
"CloneProjectFiles"),
'value' => false),
948 array(
'type' =>
'checkbox',
'name' =>
'clone_task_files',
'label' => $langs->trans(
"CloneTaskFiles"),
'value' => false)
951 print $form->formconfirm($_SERVER[
"PHP_SELF"].
"?id=".$object->id, $langs->trans(
"ToClone"), $langs->trans(
"ConfirmCloneProject"),
"confirm_clone", $formquestion,
'', 1, 400, 590);
955 print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">';
956 print
'<input type="hidden" name="token" value="'.newToken().
'">';
957 print
'<input type="hidden" name="action" value="update">';
958 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
959 print
'<input type="hidden" name="comefromclone" value="'.$comefromclone.
'">';
963 if ($action ==
'edit' && $userWrite > 0) {
964 print
dol_get_fiche_head($head,
'project', $langs->trans(
"Project"), 0, ($object->public ?
'projectpub' :
'project'));
966 print
'<table class="border centpercent">';
969 $suggestedref = $object->ref;
970 print
'<tr><td class="titlefield fieldrequired">'.$langs->trans(
"Ref").
'</td>';
971 print
'<td><input size="25" name="ref" value="'.$suggestedref.
'">';
972 print
' '.$form->textwithpicto(
'', $langs->trans(
"YouCanCompleteRef", $suggestedref));
976 print
'<tr><td class="fieldrequired">'.$langs->trans(
"Label").
'</td>';
977 print
'<td><input class="quatrevingtpercent" name="title" value="'.dol_escape_htmltag($object->title).
'"></td></tr>';
980 print
'<tr><td class="fieldrequired">'.$langs->trans(
"Status").
'</td><td>';
981 print
'<select class="flat" name="status" id="status">';
982 $statuses = $object->labelStatusShort;
984 unset($statuses[$object::STATUS_DRAFT]);
986 foreach ($statuses as $key => $val) {
987 print
'<option value="'.$key.
'"'.((GETPOSTISSET(
'status') ?
GETPOST(
'status') : $object->
statut) == $key ?
' selected="selected"' :
'').
'>'.$langs->trans($val).
'</option>';
995 print
'<tr><td>'.$langs->trans(
"Parent").
'</td><td class="maxwidthonsmartphone">';
996 print
img_picto(
'',
'project',
'class="pictofixedwidth"');
997 $formproject->select_projects(-1, $object->fk_project,
'fk_project', 64, 0, 1, 1, 0, 0, 0,
'', 0, 0,
'',
'',
'');
1003 print
'<tr><td class="tdtop">';
1004 print $langs->trans(
"Usage");
1008 print
'<input type="checkbox" id="usage_opportunity" name="usage_opportunity"'.(GETPOSTISSET(
'usage_opportunity') ? (
GETPOST(
'usage_opportunity',
'alpha') !=
'' ?
' checked="checked"' :
'') : ($object->usage_opportunity ?
' checked="checked"' :
'')).
'> ';
1009 $htmltext = $langs->trans(
"ProjectFollowOpportunity");
1010 print
'<label for="usage_opportunity">'.$form->textwithpicto($langs->trans(
"ProjectFollowOpportunity"), $htmltext).
'</label>';
1012 print
'$( document ).ready(function() {
1013 jQuery("#usage_opportunity").change(function() {
1014 set_usage_opportunity();
1017 set_usage_opportunity();
1019 function set_usage_opportunity() {
1020 console.log("set_usage_opportunity");
1021 if (jQuery("#usage_opportunity").prop("checked")) {
1022 console.log("Show opportunities fields");
1023 jQuery(".classuseopportunity").show();
1025 console.log("Hide opportunities fields "+jQuery("#usage_opportunity").prop("checked"));
1026 jQuery(".classuseopportunity").hide();
1034 print
'<input type="checkbox" id="usage_task" name="usage_task"' . (GETPOSTISSET(
'usage_task') ? (
GETPOST(
'usage_task',
'alpha') !=
'' ?
' checked="checked"' :
'') : ($object->usage_task ?
' checked="checked"' :
'')) .
'> ';
1035 $htmltext = $langs->trans(
"ProjectFollowTasks");
1036 print
'<label for="usage_task">'.$form->textwithpicto($langs->trans(
"ProjectFollowTasks"), $htmltext).
'</label>';
1038 print
'$( document ).ready(function() {
1039 jQuery("#usage_task").change(function() {
1045 function set_usage_task() {
1046 console.log("set_usage_task");
1047 if (jQuery("#usage_task").prop("checked")) {
1048 console.log("Show task fields");
1049 jQuery(".classusetask").show();
1051 console.log("Hide task fields "+jQuery("#usage_task").prop("checked"));
1052 jQuery(".classusetask").hide();
1060 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"' :
'')) .
'> ';
1061 $htmltext = $langs->trans(
"ProjectBillTimeDescription");
1062 print
'<label for="usage_bill_time">'.$form->textwithpicto($langs->trans(
"BillTime"), $htmltext).
'</label>';
1064 print
'$( document ).ready(function() {
1065 jQuery("#usage_bill_time").change(function() {
1066 set_usage_bill_time();
1069 set_usage_bill_time();
1071 function set_usage_bill_time() {
1072 console.log("set_usage_bill_time");
1073 if (jQuery("#usage_bill_time").prop("checked")) {
1074 console.log("Show bill time fields");
1075 jQuery(".classusebilltime").show();
1077 console.log("Hide bill time fields "+jQuery("#usage_bill_time").prop("checked"));
1078 jQuery(".classusebilltime").hide();
1085 if (isModEnabled(
'eventorganization')) {
1086 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"' :
'')) .
'> ';
1087 $htmltext = $langs->trans(
"EventOrganizationDescriptionLong");
1088 print
'<label for="usage_organize_event">'.$form->textwithpicto($langs->trans(
"ManageOrganizeEvent"), $htmltext).
'</label>';
1090 print
'$( document ).ready(function() {
1091 jQuery("#usage_organize_event").change(function() {
1097 function set_usage_event() {
1098 console.log("set_usage_event");
1099 if (jQuery("#usage_organize_event").prop("checked")) {
1100 console.log("Show organize event fields");
1101 jQuery(".classuseorganizeevent").show();
1103 console.log("Hide organize event fields "+jQuery("#usage_organize_event").prop("checked"));
1104 jQuery(".classuseorganizeevent").hide();
1115 if (isModEnabled(
'societe')) {
1117 print(!
getDolGlobalString(
'PROJECT_THIRDPARTY_REQUIRED') ?
'' :
'<span class="fieldrequired">');
1118 print $langs->trans(
"ThirdParty");
1123 $filter = $conf->global->PROJECT_FILTER_FOR_THIRDPARTY_LIST;
1125 $text =
img_picto(
'',
'company',
'class="pictofixedwidth"');
1126 $text .= $form->select_company(!empty($object->thirdparty->id) ? $object->thirdparty->id :
"",
'socid', $filter,
'None', 1, 0, array(), 0,
'minwidth300');
1127 if (!
getDolGlobalString(
'PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS') && empty($conf->dol_use_jmobile)) {
1128 $texthelp = $langs->trans(
"IfNeedToUseOtherObjectKeepEmpty");
1129 print $form->textwithtooltip($text.
' '.
img_help(), $texthelp, 1, 0,
'',
'', 2);
1137 print
'<tr><td>'.$langs->trans(
"Visibility").
'</td><td>';
1140 $array[0] = $langs->trans(
"PrivateProject");
1143 $array[1] = $langs->trans(
"SharedProject");
1146 if (count($array) > 0) {
1147 print $form->selectarray(
'public', $array, $object->public, 0, 0, 0,
'', 0, 0, 0,
'',
'', 1);
1149 print
'<input type="hidden" id="public" name="public" value="'.$object->public.
'">';
1151 if ($object->public == 0) {
1152 print
img_picto($langs->trans(
'PrivateProject'),
'private',
'class="paddingrightonly"');
1153 print $langs->trans(
"PrivateProject");
1155 print
img_picto($langs->trans(
'SharedProject'),
'world',
'class="paddingrightonly"');
1156 print $langs->trans(
"SharedProject");
1162 $classfortr = ($object->usage_opportunity ?
'' :
' hideobject');
1164 print
'<tr class="classuseopportunity'.$classfortr.
'"><td>'.$langs->trans(
"OpportunityStatus").
'</td>';
1167 print $formproject->selectOpportunityStatus(
'opp_status', $object->opp_status, 1, 0, 0, 0,
'minwidth150 inline-block valignmiddle', 1, 1);
1170 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) :
'')).
'"> %';
1171 print
'<span id="oldopppercent" class="opacitymedium"></span>';
1174 print
'<div id="divtocloseproject" class="inline-block valign clearboth paddingtop" style="display: none;">';
1175 print
'<input type="checkbox" id="inputcloseproject" name="closeproject" />';
1176 print
'<label for="inputcloseproject">';
1177 print $form->textwithpicto($langs->trans(
"AlsoCloseAProject"), $langs->trans(
"AlsoCloseAProjectTooltip")).
'</label>';
1184 print
'<tr class="classuseopportunity'.$classfortr.
'"><td>'.$langs->trans(
"OpportunityAmount").
'</td>';
1185 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) :
'')).
'">';
1186 print $langs->getCurrencySymbol($conf->currency);
1192 print
'<tr><td>'.$langs->trans(
"Budget").
'</td>';
1193 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) :
'')).
'">';
1194 print $langs->getCurrencySymbol($conf->currency);
1199 print
'<tr><td>'.$langs->trans(
"Date").(isModEnabled(
'eventorganization') ?
' <span class="classuseorganizeevent">('.$langs->trans(
"Project").
')</span>' :
'').
'</td><td>';
1200 print $form->selectDate($object->date_start ? $object->date_start : -1,
'projectstart', 0, 0, 0,
'', 1, 0);
1201 print
' <span class="opacitymedium"> '.$langs->trans(
"to").
' </span> ';
1202 print $form->selectDate($object->date_end ? $object->date_end : -1,
'projectend', 0, 0, 0,
'', 1, 0);
1203 $object->getLinesArray(
null, 0);
1204 if (!empty($object->usage_task) && !empty($object->lines)) {
1205 print
' <span id="divreportdate" class="hidden"> <input type="checkbox" class="valignmiddle" id="reportdate" name="reportdate" value="yes" ';
1206 if ($comefromclone) {
1209 print
'/><label for="reportdate" class="valignmiddle opacitymedium">'.$langs->trans(
"ProjectReportDate").
'</label></span>';
1213 if (isModEnabled(
'eventorganization')) {
1215 print
'<tr class="classuseorganizeevent"><td>'.$langs->trans(
"Date").
' ('.$langs->trans(
"Event").
')</td><td>';
1216 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);
1217 print
' <span class="opacitymedium"> '.$langs->trans(
"to").
' </span> ';
1218 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);
1222 print
'<tr class="classuseorganizeevent"><td>'.$langs->trans(
"Location").
'</td>';
1223 print
'<td><input class="minwidth300 maxwidth500" type="text" name="location" value="'.dol_escape_htmltag(GETPOSTISSET(
'location') ?
GETPOST(
'location') : $object->location).
'"></td>';
1228 print
'<tr><td class="tdtop">'.$langs->trans(
"Description").
'</td>';
1230 $doleditor =
new DolEditor(
'description', $object->description,
'', 90,
'dolibarr_notes',
'',
false,
true,
getDolGlobalInt(
'FCKEDITOR_ENABLE_SOCIETE'), ROWS_3,
'90%');
1231 $doleditor->Create();
1235 if (isModEnabled(
'categorie')) {
1236 $arrayselected = array();
1237 print
'<tr><td>'.$langs->trans(
"Categories").
'</td><td>';
1238 $cate_arbo = $form->select_all_categories(Categorie::TYPE_PROJECT,
'',
'parent', 64, 0, 1);
1240 $cats = $c->containing($object->id, Categorie::TYPE_PROJECT);
1241 foreach ($cats as $cat) {
1242 $arrayselected[] = $cat->id;
1244 print
img_picto(
'',
'category',
'class="pictofixedwidth"').$form->multiselectarray(
'categories', $cate_arbo, $arrayselected, 0, 0,
'quatrevingtpercent widthcentpercentminusx', 0,
'0');
1249 $parameters = array();
1250 $reshook = $hookmanager->executeHooks(
'formObjectOptions', $parameters, $object, $action);
1251 print $hookmanager->resPrint;
1252 if (empty($reshook)) {
1253 print $object->showOptionals($extrafields,
'edit');
1258 print
dol_get_fiche_head($head,
'project', $langs->trans(
"Project"), -1, ($object->public ?
'projectpub' :
'project'));
1262 if (!empty($_SESSION[
'pageforbacktolist']) && !empty($_SESSION[
'pageforbacktolist'][
'project'])) {
1263 $tmpurl = $_SESSION[
'pageforbacktolist'][
'project'];
1264 $tmpurl = preg_replace(
'/__SOCID__/', $object->socid, $tmpurl);
1265 $linkback =
'<a href="'.$tmpurl.(preg_match(
'/\?/', $tmpurl) ?
'&' :
'?').
'restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
1267 $linkback =
'<a href="'.DOL_URL_ROOT.
'/projet/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
1270 $morehtmlref =
'<div class="refidno">';
1273 $morehtmlref .=
'<br>';
1275 if (!empty($object->thirdparty->id) && $object->thirdparty->id > 0) {
1276 $morehtmlref .= $object->thirdparty->getNomUrl(1,
'project');
1280 if (!empty($object->fk_project) && $object->fk_project) {
1282 $parent->fetch($object->fk_project);
1283 $morehtmlref .= $langs->trans(
"Child of").
' '.$parent->getNomUrl(1,
'project').
' '.$parent->title;
1286 $morehtmlref .=
'</div>';
1289 if (!$user->hasRight(
'projet',
'all',
'lire')) {
1290 $objectsListId = $object->getProjectsAuthorizedForUser($user, 0, 0);
1291 $object->next_prev_filter =
"rowid IN (".$db->sanitize(count($objectsListId) ? join(
',', array_keys($objectsListId)) :
'0').
")";
1294 dol_banner_tab($object,
'ref', $linkback, 1,
'ref',
'ref', $morehtmlref);
1296 print
'<div class="fichecenter">';
1297 print
'<div class="fichehalfleft">';
1298 print
'<div class="underbanner clearboth"></div>';
1300 print
'<table class="border tableforfield centpercent">';
1304 print
'<tr><td class="tdtop">';
1305 print $langs->trans(
"Usage");
1309 print
'<input type="checkbox" disabled name="usage_opportunity"'.(GETPOSTISSET(
'usage_opportunity') ? (
GETPOST(
'usage_opportunity',
'alpha') !=
'' ?
' checked="checked"' :
'') : ($object->usage_opportunity ?
' checked="checked"' :
'')).
'> ';
1310 $htmltext = $langs->trans(
"ProjectFollowOpportunity");
1311 print $form->textwithpicto($langs->trans(
"ProjectFollowOpportunity"), $htmltext);
1315 print
'<input type="checkbox" disabled name="usage_task"'.(GETPOSTISSET(
'usage_task') ? (
GETPOST(
'usage_task',
'alpha') !=
'' ?
' checked="checked"' :
'') : ($object->usage_task ?
' checked="checked"' :
'')).
'> ';
1316 $htmltext = $langs->trans(
"ProjectFollowTasks");
1317 print $form->textwithpicto($langs->trans(
"ProjectFollowTasks"), $htmltext);
1321 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"' :
'')).
'> ';
1322 $htmltext = $langs->trans(
"ProjectBillTimeDescription");
1323 print $form->textwithpicto($langs->trans(
"BillTime"), $htmltext);
1327 if (isModEnabled(
'eventorganization')) {
1328 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"' :
'')).
'> ';
1329 $htmltext = $langs->trans(
"EventOrganizationDescriptionLong");
1330 print $form->textwithpicto($langs->trans(
"ManageOrganizeEvent"), $htmltext);
1336 print
'<tr><td class="titlefield">'.$langs->trans(
"Visibility").
'</td><td>';
1337 if ($object->public) {
1338 print
img_picto($langs->trans(
'SharedProject'),
'world',
'class="paddingrightonly"');
1339 print $langs->trans(
'SharedProject');
1341 print
img_picto($langs->trans(
'PrivateProject'),
'private',
'class="paddingrightonly"');
1342 print $langs->trans(
'PrivateProject');
1346 if (
getDolGlobalString(
'PROJECT_USE_OPPORTUNITIES') && !empty($object->usage_opportunity)) {
1348 print
'<tr><td>'.$langs->trans(
"OpportunityStatus").
'</td><td>';
1349 $code =
dol_getIdFromCode($db, $object->opp_status,
'c_lead_status',
'rowid',
'code');
1351 print $langs->trans(
"OppStatus".$code);
1355 print
' <span title="'.$langs->trans(
"OpportunityProbability").
'"> / ';
1356 if (strcmp($object->opp_percent,
'')) {
1357 print
price($object->opp_percent, 0, $langs, 1, 0).
' %';
1359 print
'</span></td></tr>';
1362 print
'<tr><td>'.$langs->trans(
"OpportunityAmount").
'</td><td>';
1363 if (strcmp($object->opp_amount,
'')) {
1364 print
'<span class="amount">'.price($object->opp_amount, 0, $langs, 1, 0, -1, $conf->currency).
'</span>';
1365 if (strcmp($object->opp_percent,
'')) {
1366 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>';
1373 print
'<tr><td>'.$langs->trans(
"Budget").
'</td><td>';
1374 if (!is_null($object->budget_amount) && strcmp($object->budget_amount,
'')) {
1375 print
'<span class="amount">'.price($object->budget_amount, 0, $langs, 1, 0, 0, $conf->currency).
'</span>';
1380 print
'<tr><td>'.$langs->trans(
"Dates").
'</td><td>';
1382 print($start ? $start :
'?');
1384 print
' <span class="opacitymedium">-</span> ';
1385 print($end ? $end :
'?');
1386 if ($object->hasDelay()) {
1393 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_view.tpl.php';
1398 print
'<div class="fichehalfright">';
1399 print
'<div class="underbanner clearboth"></div>';
1401 print
'<table class="border tableforfield centpercent">';
1404 print
'<td class="titlefield tdtop">'.$langs->trans(
"Description").
'</td><td>';
1409 if (isModEnabled(
'categorie')) {
1410 print
'<tr><td class="valignmiddle">'.$langs->trans(
"Categories").
'</td><td>';
1411 print $form->showCategories($object->id, Categorie::TYPE_PROJECT, 1);
1420 print
'<div class="clearboth"></div>';
1425 if ($action ==
'edit' && $userWrite > 0) {
1426 print $form->buttonsSaveCancel();
1432 print
'<script type="text/javascript">
1433 jQuery(document).ready(function() {
1434 jQuery("#usage_task").change(function() {
1435 console.log("We click on usage task "+jQuery("#usage_task").is(":checked"));
1436 if (! jQuery("#usage_task").is(":checked")) {
1437 jQuery("#usage_bill_time").prop("checked", false);
1441 jQuery("#usage_bill_time").change(function() {
1442 console.log("We click on usage to bill time");
1443 if (jQuery("#usage_bill_time").is(":checked")) {
1444 jQuery("#usage_task").prop("checked", true);
1448 jQuery("#projectstart").change(function() {
1449 console.log("We modify the start date");
1450 jQuery("#divreportdate").show();
1456 if (!empty($conf->use_javascript_ajax) &&
getDolGlobalString(
'PROJECT_USE_OPPORTUNITIES')) {
1458 $defaultcheckedwhenoppclose = 1;
1460 $defaultcheckedwhenoppclose = 0;
1463 print
'<!-- Javascript to manage opportunity status change -->';
1464 print
'<script type="text/javascript">
1465 jQuery(document).ready(function() {
1466 function change_percent()
1468 var element = jQuery("#opp_status option:selected");
1469 var defaultpercent = element.attr("defaultpercent");
1470 var defaultcloseproject = '.((int) $defaultcheckedwhenoppclose).
';
1471 var elemcode = element.attr("elemcode");
1472 var oldpercent = \''.
dol_escape_js($object->opp_percent).
'\';
1474 console.log(
"We select "+elemcode);
1477 var closeproject = 0;
1478 if (elemcode == \
'LOST\') closeproject = 1;
1479 if (elemcode == \'WON\') closeproject = defaultcloseproject;
1480 if (closeproject) jQuery("#inputcloseproject").prop("checked", true);
1481 else jQuery("#inputcloseproject").prop("checked", false);
1483 /* Make the close project checkbox visible or not */
1484 console.log("closeproject="+closeproject);
1485 if (elemcode == \'WON\' || elemcode == \'LOST\')
1487 jQuery("#divtocloseproject").show();
1491 jQuery("#divtocloseproject").hide();
1494 /* Change percent with default percent (defaultpercent) if new status (defaultpercent) is higher than current (jQuery("#opp_percent").val()) */
1495 if (oldpercent != \'\' && (parseFloat(defaultpercent) < parseFloat(oldpercent)))
1497 console.log("oldpercent="+oldpercent+" defaultpercent="+defaultpercent+" def < old");
1498 if (jQuery("#opp_percent").val() != \'\' && oldpercent != \'\') {
1499 jQuery("#oldopppercent").text(\' - '.
dol_escape_js($langs->transnoentities(
"PreviousValue")).
': \'+price2numjs(oldpercent)+\' %\');
1502 if (parseFloat(oldpercent) != 100 && elemcode != \'LOST\') { jQuery("#opp_percent").val(oldpercent); }
1503 else { jQuery("#opp_percent").val(price2numjs(defaultpercent)); }
1505 console.log("oldpercent="+oldpercent+" defaultpercent="+defaultpercent);
1506 if (jQuery("#opp_percent").val() == \'\' || (parseFloat(jQuery("#opp_percent").val()) < parseFloat(defaultpercent))) {
1507 if (jQuery("#opp_percent").val() != \'\' && oldpercent != \'\') {
1508 jQuery("#oldopppercent").text(\' - '.
dol_escape_js($langs->transnoentities(
"PreviousValue")).
': \'+price2numjs(oldpercent)+\' %\');
1510 jQuery("#opp_percent").val(price2numjs(defaultpercent));
1515 jQuery("#opp_status").change(function() {
1527 print
'<div class="tabsAction">';
1528 $parameters = array();
1529 $reshook = $hookmanager->executeHooks(
'addMoreActionsButtons', $parameters, $object, $action);
1531 if (empty($reshook)) {
1532 if ($action !=
"edit" && $action !=
'presend') {
1542 if (empty($user->socid)) {
1544 print
dolGetButtonAction(
'', $langs->trans(
'SendMail'),
'default', $_SERVER[
"PHP_SELF"].
'?action=presend&token='.newToken().
'&id='.$object->id.
'&mode=init#formmailbeforetitle',
'');
1564 if ($userWrite > 0) {
1565 print
dolGetButtonAction(
'', $langs->trans(
'SetToDraft'),
'default', $_SERVER[
"PHP_SELF"].
'?action=confirm_setdraft&confirm=yes&token='.newToken().
'&id='.$object->id,
'');
1567 print
dolGetButtonAction($langs->trans(
'NotOwnerOfProject'), $langs->trans(
'SetToDraft'),
'default', $_SERVER[
'PHP_SELF'].
'#',
'',
false);
1574 if ($userWrite > 0) {
1575 print
dolGetButtonAction(
'', $langs->trans(
'Modify'),
'default', $_SERVER[
"PHP_SELF"].
'?action=edit&token='.newToken().
'&id='.$object->id,
'');
1577 print
dolGetButtonAction($langs->trans(
'NotOwnerOfProject'), $langs->trans(
'Modify'),
'default', $_SERVER[
'PHP_SELF'].
'#',
'',
false);
1583 if ($userWrite > 0) {
1584 print
dolGetButtonAction(
'', $langs->trans(
'Validate'),
'default', $_SERVER[
"PHP_SELF"].
'?action=validate&token='.newToken().
'&id='.$object->id,
'');
1586 print
dolGetButtonAction($langs->trans(
'NotOwnerOfProject'), $langs->trans(
'Validate'),
'default', $_SERVER[
'PHP_SELF'].
'#',
'',
false);
1592 if ($userWrite > 0) {
1593 print
dolGetButtonAction(
'', $langs->trans(
'Close'),
'default', $_SERVER[
"PHP_SELF"].
'?action=close&token='.newToken().
'&id='.$object->id,
'');
1595 print
dolGetButtonAction($langs->trans(
'NotOwnerOfProject'), $langs->trans(
'Close'),
'default', $_SERVER[
'PHP_SELF'].
'#',
'',
false);
1601 if ($userWrite > 0) {
1602 print
dolGetButtonAction(
'', $langs->trans(
'ReOpen'),
'default', $_SERVER[
"PHP_SELF"].
'?action=reopen&token='.newToken().
'&id='.$object->id,
'');
1604 print
dolGetButtonAction($langs->trans(
'NotOwnerOfProject'), $langs->trans(
'ReOpen'),
'default', $_SERVER[
'PHP_SELF'].
'#',
'',
false);
1611 $is_customer_or_prospect = (!empty($object->thirdparty->prospect) || !empty($object->thirdparty->client));
1612 $is_supplier_only= (!empty($object->thirdparty->fournisseur) && $is_customer_or_prospect ==
false);
1614 $arrayforbutaction = array(
1615 10 => array(
'lang'=>
'propal',
'enabled'=>(isModEnabled(
"propal") && $is_customer_or_prospect ==
true),
'perm'=>$user->hasRight(
'propal',
'creer'),
'label' =>
'AddProp',
'url'=>
'/comm/propal/card.php?action=create&projectid='.$object->id.
'&socid='.$object->socid),
1616 20 => array(
'lang'=>
'orders',
'enabled'=>(isModEnabled(
"commande") && $is_customer_or_prospect ==
true),
'perm'=>$user->hasRight(
'commande',
'creer'),
'label' =>
'CreateOrder',
'url'=>
'/commande/card.php?action=create&projectid='.$object->id.
'&socid='.$object->socid),
1617 30 => array(
'lang'=>
'bills',
'enabled'=>(isModEnabled(
"facture") && $is_customer_or_prospect ==
true),
'perm'=>$user->hasRight(
'facture',
'creer'),
'label' =>
'CreateBill',
'url'=>
'/compta/facture/card.php?action=create&projectid='.$object->id.
'&socid='.$object->socid),
1618 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.($is_supplier_only ==
true ?
'&socid='.$object->socid :
'')),
1619 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.($is_supplier_only == true ?
'&socid='.$object->socid :
'')),
1620 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.($is_supplier_only == true ?
'&socid='.$object->socid :
'')),
1621 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),
1622 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),
1623 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),
1624 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),
1627 $params = array(
'backtopage' => $_SERVER[
"PHP_SELF"].
'?id='.$object->id);
1629 print
dolGetButtonAction(
'', $langs->trans(
"Create"),
'default', $arrayforbutaction,
'', 1, $params);
1633 if ($user->hasRight(
'projet',
'creer')) {
1634 if ($userWrite > 0) {
1635 print
dolGetButtonAction(
'', $langs->trans(
'ToClone'),
'default', $_SERVER[
"PHP_SELF"].
'?action=clone&token='.newToken().
'&id='.$object->id,
'');
1637 print
dolGetButtonAction($langs->trans(
'NotOwnerOfProject'), $langs->trans(
'ToClone'),
'default', $_SERVER[
'PHP_SELF'].
'#',
'',
false);
1642 if ($user->hasRight(
'projet',
'supprimer') || ($object->statut ==
Project::STATUS_DRAFT && $user->hasRight(
'projet',
'creer'))) {
1643 if ($userDelete > 0 || ($object->statut ==
Project::STATUS_DRAFT && $user->hasRight(
'projet',
'creer'))) {
1644 print
dolGetButtonAction(
'', $langs->trans(
'Delete'),
'delete', $_SERVER[
"PHP_SELF"].
'?action=delete&token='.newToken().
'&id='.$object->id,
'');
1646 print
dolGetButtonAction($langs->trans(
'NotOwnerOfProject'), $langs->trans(
'Delete'),
'default', $_SERVER[
'PHP_SELF'].
'#',
'',
false);
1654 if (
GETPOST(
'modelselected')) {
1655 $action =
'presend';
1658 if ($action !=
'presend') {
1659 print
'<div class="fichecenter"><div class="fichehalfleft">';
1660 print
'<a name="builddoc"></a>';
1666 $children = $object->getChildren();
1668 print
'<table class="centpercent notopnoleftnoright table-fiche-title">';
1669 print
'<tr class="titre"><td class="nobordernopadding valignmiddle col-title">';
1670 print
'<div class="titre inline-block">'.$langs->trans(
'Sub-projects').
'</div>';
1671 print
'</td></tr></table>';
1673 print
'<div class="div-table-responsive-no-min">';
1674 print
'<table class="centpercent noborder'.($morecss ?
' '.$morecss :
'').
'">';
1675 print
'<tr class="liste_titre">';
1676 print
getTitleFieldOfList(
'Ref', 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'',
'',
'',
'', 1);
1677 print
getTitleFieldOfList(
'Title', 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'',
'',
'',
'', 1);
1678 print
getTitleFieldOfList(
'Status', 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'',
'',
'',
'', 1);
1682 $subproject =
new Project($db);
1683 foreach ($children as $child) {
1684 $subproject->fetch($child->rowid);
1685 print
'<tr class="oddeven">';
1686 print
'<td class="nowraponall">'.$subproject->getNomUrl(1,
'project').
'</td>';
1687 print
'<td class="nowraponall tdoverflowmax125">'.$child->title.
'</td>';
1688 print
'<td class="nowraponall">'.$subproject->getLibStatut(5).
'</td>';
1701 $filedir = $conf->project->multidir_output[$object->entity].
"/".
dol_sanitizeFileName($object->ref);
1702 $urlsource = $_SERVER[
"PHP_SELF"].
"?id=".$object->id;
1703 $genallowed = ($user->hasRight(
'projet',
'lire') && $userAccess > 0);
1704 $delallowed = ($user->hasRight(
'projet',
'creer') && $userWrite > 0);
1706 print $formfile->showdocuments(
'project', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 0, 0,
'',
'',
'',
'',
'', $object);
1708 print
'</div><div class="fichehalfright">';
1712 $morehtmlcenter =
'<div class="nowraponall">';
1713 $morehtmlcenter .=
dolGetButtonTitle($langs->trans(
'FullConversation'),
'',
'fa fa-comments imgforviewmode', DOL_URL_ROOT.
'/projet/messaging.php?id='.$object->id);
1714 $morehtmlcenter .=
dolGetButtonTitle($langs->trans(
'FullList'),
'',
'fa fa-bars imgforviewmode', DOL_URL_ROOT.
'/projet/agenda.php?id='.$object->id);
1715 $morehtmlcenter .=
'</div>';
1718 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formactions.class.php';
1720 $somethingshown =
$formactions->showactions($object,
'project', 0, 1,
'', $MAXEVENT,
'', $morehtmlcenter);
1722 print
'</div></div>';
1726 $modelmail =
'project';
1727 $defaulttopic =
'SendProjectRef';
1728 $defaulttopiclang =
'projects';
1729 $diroutput = $conf->project->multidir_output[$object->entity];
1730 $autocopy =
'MAIN_MAIL_AUTOCOPY_PROJECT_TO';
1731 $trackid =
'proj'.$object->id;
1733 include DOL_DOCUMENT_ROOT.
'/core/tpl/card_presend.tpl.php';
1736 $parameters = array();
1737 $reshook = $hookmanager->executeHooks(
'mainCardTabAddMore', $parameters, $object, $action);
1739 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.