* Copyright (C) 2004-2016 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ /** * \file htdocs/projet/card.php * \ingroup projet * \brief Project card */ // Load Dolibarr environment require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/modules/project/modules_project.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; // Load translation files required by the page $langsLoad=array('projects', 'companies'); if (isModEnabled('eventorganization')) { $langsLoad[]='eventorganization'; } $langs->loadLangs($langsLoad); $id = GETPOST('id', 'int'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); $backtopage = GETPOST('backtopage', 'alpha'); $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); $backtopagejsfields = GETPOST('backtopagejsfields', 'alpha'); $cancel = GETPOST('cancel', 'alpha'); $confirm = GETPOST('confirm', 'aZ09'); $dol_openinpopup = GETPOST('dol_openinpopup', 'aZ09'); $status = GETPOST('status', 'int'); $opp_status = GETPOST('opp_status', 'int'); $opp_percent = price2num(GETPOST('opp_percent', 'alphanohtml')); $objcanvas = GETPOST("objcanvas", "alphanohtml"); $comefromclone = GETPOST("comefromclone", "alphanohtml"); $date_start = dol_mktime(0, 0, 0, GETPOST('projectstartmonth', 'int'), GETPOST('projectstartday', 'int'), GETPOST('projectstartyear', 'int')); $date_end = dol_mktime(0, 0, 0, GETPOST('projectendmonth', 'int'), GETPOST('projectendday', 'int'), GETPOST('projectendyear', 'int')); $date_start_event = dol_mktime(GETPOST('date_start_eventhour', 'int'), GETPOST('date_start_eventmin', 'int'), GETPOST('date_start_eventsec', 'int'), GETPOST('date_start_eventmonth', 'int'), GETPOST('date_start_eventday', 'int'), GETPOST('date_start_eventyear', 'int')); $date_end_event = dol_mktime(GETPOST('date_end_eventhour', 'int'), GETPOST('date_end_eventmin', 'int'), GETPOST('date_end_eventsec', 'int'), GETPOST('date_end_eventmonth', 'int'), GETPOST('date_end_eventday', 'int'), GETPOST('date_end_eventyear', 'int')); $location = GETPOST('location', 'alphanohtml'); $mine = GETPOST('mode') == 'mine' ? 1 : 0; //if (! $user->rights->projet->all->lire) $mine=1; // Special for projects // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('projectcard', 'globalcard')); $object = new Project($db); $extrafields = new ExtraFields($db); // Load object //include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Can't use generic include because when creating a project, ref is defined and we dont want error if fetch fails from ref. if ($id > 0 || !empty($ref)) { $ret = $object->fetch($id, $ref); // If we create project, ref may be defined into POST but record does not yet exists into database if ($ret > 0) { $object->fetch_thirdparty(); if (!empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT) && method_exists($object, 'fetchComments') && empty($object->comments)) { $object->fetchComments(); } $id = $object->id; } } // fetch optionals attributes and labels $extrafields->fetch_name_optionals_label($object->table_element); // Security check $socid = GETPOST('socid', 'int'); //if ($user->socid > 0) $socid = $user->socid; // For external user, no check is done on company because readability is managed by public status of project and assignement. restrictedArea($user, 'projet', $object->id, 'projet&project'); if ($id == '' && $ref == '' && ($action != "create" && $action != "add" && $action != "update" && !GETPOST("cancel"))) { accessforbidden(); } $permissiontoadd = $user->rights->projet->creer; $permissiontodelete = $user->rights->projet->supprimer; $permissiondellink = $user->rights->projet->creer; // Used by the include of actions_dellink.inc.php /* * Actions */ $parameters = array('id'=>$socid, 'objcanvas'=>$objcanvas); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } if (empty($reshook)) { $backurlforlist = DOL_URL_ROOT.'/projet/list.php'; // Cancel if ($cancel) { if (GETPOST("comefromclone") == 1) { $result = $object->delete($user); if ($result > 0) { header("Location: index.php"); exit; } else { dol_syslog($object->error, LOG_DEBUG); setEventMessages($langs->trans("CantRemoveProject", $langs->transnoentitiesnoconv("ProjectOverview")), null, 'errors'); } } } if (empty($backtopage) || ($cancel && empty($id))) { if (empty($backtopage) || ($cancel && strpos($backtopage, '__ID__'))) { if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) { $backtopage = $backurlforlist; } else { $backtopage = DOL_URL_ROOT.'/projet/card.php?id='.((!empty($id) && $id > 0) ? $id : '__ID__'); } } } if ($cancel) { if (!empty($backtopageforcancel)) { header("Location: ".$backtopageforcancel); exit; } elseif (!empty($backtopage)) { header("Location: ".$backtopage); exit; } $action = ''; } include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be include, not include_once // Action setdraft object if ($action == 'confirm_setdraft' && $confirm == 'yes' && $permissiontoadd) { $result = $object->setStatut($object::STATUS_DRAFT, null, '', 'PROJECT_MODIFY'); if ($result >= 0) { // Nothing else done } else { $error++; setEventMessages($object->error, $object->errors, 'errors'); } $action = ''; } // Action add if ($action == 'add' && $permissiontoadd) { $error = 0; if (!GETPOST('ref')) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Ref")), null, 'errors'); $error++; } if (!GETPOST('title')) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("ProjectLabel")), null, 'errors'); $error++; } if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { if (GETPOST('opp_amount') != '' && !(GETPOST('opp_status') > 0)) { $error++; setEventMessages($langs->trans("ErrorOppStatusRequiredIfAmount"), null, 'errors'); } } // Create with status validated immediatly if (!empty($conf->global->PROJECT_CREATE_NO_DRAFT)) { $status = Project::STATUS_VALIDATED; } if (!$error) { $error = 0; $db->begin(); $object->ref = GETPOST('ref', 'alphanohtml'); $object->title = GETPOST('title', 'alphanohtml'); $object->socid = GETPOST('socid', 'int'); $object->description = GETPOST('description', 'restricthtml'); // Do not use 'alpha' here, we want field as it is $object->public = GETPOST('public', 'alphanohtml'); $object->opp_amount = price2num(GETPOST('opp_amount', 'alphanohtml')); $object->budget_amount = price2num(GETPOST('budget_amount', 'alphanohtml')); $object->date_c = dol_now(); $object->date_start = $date_start; $object->date_end = $date_end; $object->date_start_event = $date_start_event; $object->date_end_event = $date_end_event; $object->location = $location; $object->statut = $status; $object->opp_status = $opp_status; $object->opp_percent = $opp_percent; $object->usage_opportunity = (GETPOST('usage_opportunity', 'alpha') == 'on' ? 1 : 0); $object->usage_task = (GETPOST('usage_task', 'alpha') == 'on' ? 1 : 0); $object->usage_bill_time = (GETPOST('usage_bill_time', 'alpha') == 'on' ? 1 : 0); $object->usage_organize_event = (GETPOST('usage_organize_event', 'alpha') == 'on' ? 1 : 0); // Fill array 'array_options' with data from add form $ret = $extrafields->setOptionalsFromPost(null, $object); if ($ret < 0) { $error++; } $result = $object->create($user); if (!$error && $result > 0) { // Add myself as project leader $typeofcontact = 'PROJECTLEADER'; $result = $object->add_contact($user->id, $typeofcontact, 'internal'); // -3 means type not found (PROJECTLEADER renamed, de-activated or deleted), so don't prevent creation if it has been the case if ($result == -3) { setEventMessage('ErrorPROJECTLEADERRoleMissingRestoreIt', 'errors'); $error++; } elseif ($result < 0) { $langs->load("errors"); setEventMessages($object->error, $object->errors, 'errors'); $error++; } } else { $langs->load("errors"); setEventMessages($object->error, $object->errors, 'errors'); $error++; } if (!$error && !empty($object->id) > 0) { // Category association $categories = GETPOST('categories', 'array'); $result = $object->setCategories($categories); if ($result < 0) { $langs->load("errors"); setEventMessages($object->error, $object->errors, 'errors'); $error++; } } if (!$error) { $db->commit(); if (!empty($backtopage)) { $backtopage = preg_replace('/--IDFORBACKTOPAGE--|__ID__/', $object->id, $backtopage); // New method to autoselect project after a New on another form object creation $backtopage = $backtopage.'&projectid='.$object->id; // Old method header("Location: ".$backtopage); exit; } else { header("Location:card.php?id=".$object->id); exit; } } else { $db->rollback(); unset($_POST["ref"]); $action = 'create'; } } else { $action = 'create'; } } if ($action == 'update' && empty(GETPOST('cancel')) && $permissiontoadd) { $error = 0; if (empty($ref)) { $error++; setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Ref")), null, 'errors'); } if (!GETPOST("title")) { $error++; setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("ProjectLabel")), null, 'errors'); } $db->begin(); if (!$error) { $object->oldcopy = clone $object; $old_start_date = $object->date_start; $object->ref = GETPOST('ref', 'alpha'); $object->title = GETPOST('title', 'alphanohtml'); // Do not use 'alpha' here, we want field as it is $object->statut = GETPOST('status', 'int'); $object->socid = GETPOST('socid', 'int'); $object->description = GETPOST('description', 'restricthtml'); // Do not use 'alpha' here, we want field as it is $object->public = GETPOST('public', 'alpha'); $object->date_start = (!GETPOST('projectstart')) ? '' : $date_start; $object->date_end = (!GETPOST('projectend')) ? '' : $date_end; $object->date_start_event = (!GETPOST('date_start_event')) ? '' : $date_start_event; $object->date_end_event = (!GETPOST('date_end_event')) ? '' : $date_end_event; $object->location = $location; if (GETPOSTISSET('opp_amount')) { $object->opp_amount = price2num(GETPOST('opp_amount', 'alpha')); } if (GETPOSTISSET('budget_amount')) { $object->budget_amount = price2num(GETPOST('budget_amount', 'alpha')); } if (GETPOSTISSET('opp_status')) { $object->opp_status = $opp_status; } if (GETPOSTISSET('opp_percent')) { $object->opp_percent = $opp_percent; } $object->usage_opportunity = (GETPOST('usage_opportunity', 'alpha') == 'on' ? 1 : 0); $object->usage_task = (GETPOST('usage_task', 'alpha') == 'on' ? 1 : 0); $object->usage_bill_time = (GETPOST('usage_bill_time', 'alpha') == 'on' ? 1 : 0); $object->usage_organize_event = (GETPOST('usage_organize_event', 'alpha') == 'on' ? 1 : 0); // Fill array 'array_options' with data from add form $ret = $extrafields->setOptionalsFromPost(null, $object, '@GETPOSTISSET'); if ($ret < 0) { $error++; } } if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { if ($object->opp_amount && ($object->opp_status <= 0)) { $error++; setEventMessages($langs->trans("ErrorOppStatusRequiredIfAmount"), null, 'errors'); } } if (!$error) { $result = $object->update($user); if ($result < 0) { $error++; if ($result == -4) { setEventMessages($langs->trans("ErrorRefAlreadyExists"), null, 'errors'); } else { setEventMessages($object->error, $object->errors, 'errors'); } } else { // Category association $categories = GETPOST('categories', 'array'); $result = $object->setCategories($categories); if ($result < 0) { $error++; setEventMessages($object->error, $object->errors, 'errors'); } } } if (!$error) { if (GETPOST("reportdate") && ($object->date_start != $old_start_date)) { $result = $object->shiftTaskDate($old_start_date); if ($result < 0) { $error++; setEventMessages($langs->trans("ErrorShiftTaskDate").':'.$object->error, $object->errors, 'errors'); } } } // Check if we must change status if (GETPOST('closeproject')) { $resclose = $object->setClose($user); if ($resclose < 0) { $error++; setEventMessages($langs->trans("FailedToCloseProject").':'.$object->error, $object->errors, 'errors'); } } if ($error) { $db->rollback(); $action = 'edit'; } else { $db->commit(); if (GETPOST('socid', 'int') > 0) { $object->fetch_thirdparty(GETPOST('socid', 'int')); } else { unset($object->thirdparty); } } } // Build doc if ($action == 'builddoc' && $permissiontoadd) { // Save last template used to generate document if (GETPOST('model')) { $object->setDocModel($user, GETPOST('model', 'alpha')); } $outputlangs = $langs; if (GETPOST('lang_id', 'aZ09')) { $outputlangs = new Translate("", $conf); $outputlangs->setDefaultLang(GETPOST('lang_id', 'aZ09')); } $result = $object->generateDocument($object->model_pdf, $outputlangs); if ($result <= 0) { setEventMessages($object->error, $object->errors, 'errors'); $action = ''; } } // Delete file in doc form if ($action == 'remove_file' && $permissiontoadd) { if ($object->id > 0) { require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; $langs->load("other"); $upload_dir = $conf->project->multidir_output[$object->entity]; $file = $upload_dir.'/'.GETPOST('file'); $ret = dol_delete_file($file, 0, 0, 0, $object); if ($ret) { setEventMessages($langs->trans("FileWasRemoved", GETPOST('file')), null, 'mesgs'); } else { setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('file')), null, 'errors'); } $action = ''; } } if ($action == 'confirm_validate' && $confirm == 'yes' && $permissiontoadd) { $result = $object->setValid($user); if ($result <= 0) { setEventMessages($object->error, $object->errors, 'errors'); } } if ($action == 'confirm_close' && $confirm == 'yes' && $permissiontoadd) { $result = $object->setClose($user); if ($result <= 0) { setEventMessages($object->error, $object->errors, 'errors'); } } if ($action == 'confirm_reopen' && $confirm == 'yes' && $permissiontoadd) { $result = $object->setValid($user); if ($result <= 0) { setEventMessages($object->error, $object->errors, 'errors'); } } if ($action == 'confirm_delete' && $confirm == 'yes' && $permissiontodelete) { $object->fetch($id); $result = $object->delete($user); if ($result > 0) { setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs'); header("Location: list.php?restore_lastsearch_values=1"); exit; } else { dol_syslog($object->error, LOG_DEBUG); setEventMessages($object->error, $object->errors, 'errors'); } } if ($action == 'confirm_clone' && $permissiontoadd && $confirm == 'yes') { $clone_contacts = GETPOST('clone_contacts') ? 1 : 0; $clone_tasks = GETPOST('clone_tasks') ? 1 : 0; $clone_project_files = GETPOST('clone_project_files') ? 1 : 0; $clone_task_files = GETPOST('clone_task_files') ? 1 : 0; $clone_notes = GETPOST('clone_notes') ? 1 : 0; $move_date = GETPOST('move_date') ? 1 : 0; $clone_thirdparty = GETPOST('socid', 'int') ?GETPOST('socid', 'int') : 0; $result = $object->createFromClone($user, $object->id, $clone_contacts, $clone_tasks, $clone_project_files, $clone_task_files, $clone_notes, $move_date, 0, $clone_thirdparty); if ($result <= 0) { setEventMessages($object->error, $object->errors, 'errors'); } else { // Load new object $newobject = new Project($db); $newobject->fetch($result); $newobject->fetch_optionals(); $newobject->fetch_thirdparty(); // Load new object $object = $newobject; $action = 'edit'; $comefromclone = true; } } // Actions to send emails $triggersendname = 'PROJECT_SENTBYMAIL'; $paramname = 'id'; $autocopy = 'MAIN_MAIL_AUTOCOPY_PROJECT_TO'; // used to know the automatic BCC to add $trackid = 'proj'.$object->id; include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php'; } /* * View */ $form = new Form($db); $formfile = new FormFile($db); $formproject = new FormProjets($db); $userstatic = new User($db); $title = $langs->trans("Project").' - '.$object->ref.(!empty($object->thirdparty->name) ? ' - '.$object->thirdparty->name : '').(!empty($object->title) ? ' - '.$object->title : ''); if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/projectnameonly/', $conf->global->MAIN_HTML_TITLE)) { $title = $object->ref.(!empty($object->thirdparty->name) ? ' - '.$object->thirdparty->name : '').(!empty($object->title) ? ' - '.$object->title : ''); } $help_url = "EN:Module_Projects|FR:Module_Projets|ES:Módulo_Proyectos|DE:Modul_Projekte"; llxHeader("", $title, $help_url); $titleboth = $langs->trans("LeadsOrProjects"); $titlenew = $langs->trans("NewLeadOrProject"); // Leads and opportunities by default if (!getDolGlobalInt('PROJECT_USE_OPPORTUNITIES')) { $titleboth = $langs->trans("Projects"); $titlenew = $langs->trans("NewProject"); } if (getDolGlobalInt('PROJECT_USE_OPPORTUNITIES') == 2) { // 2 = leads only $titleboth = $langs->trans("Leads"); $titlenew = $langs->trans("NewLead"); } if ($action == 'create' && $user->rights->projet->creer) { /* * Create */ $thirdparty = new Societe($db); if ($socid > 0) { $thirdparty->fetch($socid); } print load_fiche_titre($titlenew, '', 'project'); print '
'; print ''; print ''; print ''; print ''; print ''; print dol_get_fiche_head(); print ''; $defaultref = ''; $modele = empty($conf->global->PROJECT_ADDON) ? 'mod_project_simple' : $conf->global->PROJECT_ADDON; // Search template files $file = ''; $classname = ''; $filefound = 0; $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']); foreach ($dirmodels as $reldir) { $file = dol_buildpath($reldir."core/modules/project/".$modele.'.php', 0); if (file_exists($file)) { $filefound = 1; $classname = $modele; break; } } if ($filefound) { $result = dol_include_once($reldir."core/modules/project/".$modele.'.php'); $modProject = new $classname; $defaultref = $modProject->getNextValue($thirdparty, $object); } if (is_numeric($defaultref) && $defaultref <= 0) { $defaultref = ''; } // Ref $suggestedref = (GETPOST("ref") ? GETPOST("ref") : $defaultref); print ''; // Label print ''; // Usage (opp, task, bill time, ...) if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES) || empty($conf->global->PROJECT_HIDE_TASKS) || isModEnabled('eventorganization')) { print ''; print ''; print ''; } // Thirdparty if (isModEnabled('societe')) { print ''; } // Status if ($status != '') { print ''; } // Visibility print ''; if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { // Opportunity status print ''; print ''; print ''; // Opportunity amount print ''; print ''; print ''; } // Budget print ''; print ''; print ''; // Date project print ''; if (isModEnabled('eventorganization')) { // Date event print ''; // Location print ''; print ''; print ''; } // Description print ''; print ''; if (isModEnabled('categorie')) { // Categories print '"; } // Other options $parameters = array(); $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (empty($reshook)) { print $object->showOptionals($extrafields, 'create'); } print '
'.$langs->trans("Ref").''; if ($suggestedref) { print ' '.$form->textwithpicto('', $langs->trans("YouCanCompleteRef", $suggestedref)); } print '
'.$langs->trans("Label").'
'; print $langs->trans("Usage"); print ''; if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { print ' '; $htmltext = $langs->trans("ProjectFollowOpportunity"); print ''; print ''; print '
'; } if (empty($conf->global->PROJECT_HIDE_TASKS)) { print ' '; $htmltext = $langs->trans("ProjectFollowTasks"); print ''; print ''; print '
'; } if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT)) { print ' '; $htmltext = $langs->trans("ProjectBillTimeDescription"); print ''; print ''; print '
'; } if (isModEnabled('eventorganization')) { print ' '; $htmltext = $langs->trans("EventOrganizationDescriptionLong"); print ''; print ''; } print '
'; print (empty($conf->global->PROJECT_THIRDPARTY_REQUIRED) ? '' : ''); print $langs->trans("ThirdParty"); print (empty($conf->global->PROJECT_THIRDPARTY_REQUIRED) ? '' : ''); print ''; $filteronlist = ''; if (!empty($conf->global->PROJECT_FILTER_FOR_THIRDPARTY_LIST)) { $filteronlist = $conf->global->PROJECT_FILTER_FOR_THIRDPARTY_LIST; } $text = img_picto('', 'company').$form->select_company(GETPOST('socid', 'int'), 'socid', $filteronlist, 'SelectThirdParty', 1, 0, array(), 0, 'minwidth300 widthcentpercentminusxx maxwidth500'); if (empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS) && empty($conf->dol_use_jmobile)) { $texthelp = $langs->trans("IfNeedToUseOtherObjectKeepEmpty"); print $form->textwithtooltip($text.' '.img_help(), $texthelp, 1); } else { print $text; } if (!GETPOSTISSET('backtopage')) { $url = '/societe/card.php?action=create&client=3&fournisseur=0&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create'); $newbutton = ''; // TODO @LDR Implement this if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) { $tmpbacktopagejsfields = 'addthirdparty:socid,search_socid'; print dolButtonToOpenUrlInDialogPopup('addthirdparty', $langs->transnoentitiesnoconv('AddThirdParty'), $newbutton, $url, '', '', $tmpbacktopagejsfields); } else { print ' '.$newbutton.''; } } print '
'.$langs->trans("Status").''; print ''; print $object->LibStatut($status, 4); print '
'.$langs->trans("Visibility").''; $array = array(); if (empty($conf->global->PROJECT_DISABLE_PRIVATE_PROJECT)) { $array[0] = $langs->trans("PrivateProject"); } if (empty($conf->global->PROJECT_DISABLE_PUBLIC_PROJECT)) { $array[1] = $langs->trans("SharedProject"); } if (count($array) > 0) { print $form->selectarray('public', $array, GETPOST('public'), 0, 0, 0, '', 0, 0, 0, '', '', 1); } else { print ''; if (GETPOST('public') == 0) { print img_picto($langs->trans('PrivateProject'), 'private', 'class="paddingrightonly"'); print $langs->trans("PrivateProject"); } else { print img_picto($langs->trans('SharedProject'), 'world', 'class="paddingrightonly"'); print $langs->trans("SharedProject"); } } print '
'.$langs->trans("OpportunityStatus").''; print $formproject->selectOpportunityStatus('opp_status', GETPOSTISSET('opp_status') ? GETPOST('opp_status') : $object->opp_status, 1, 0, 0, 0, '', 0, 1); // Opportunity probability print ' %'; print ''; print '
'.$langs->trans("OpportunityAmount").''; print ' '.$langs->getCurrencySymbol($conf->currency); print '
'.$langs->trans("Budget").''; print ' '.$langs->getCurrencySymbol($conf->currency); print '
'.$langs->trans("Date").(isModEnabled('eventorganization') ? ' ('.$langs->trans("Project").')' : '').''; print $form->selectDate(($date_start ? $date_start : ''), 'projectstart', 0, 0, 0, '', 1, 0); print ' '.$langs->trans("to").' '; print $form->selectDate(($date_end ? $date_end : -1), 'projectend', 0, 0, 0, '', 1, 0); print '
'.$langs->trans("Date").' ('.$langs->trans("Event").')'; print $form->selectDate(($date_start_event ? $date_start_event : -1), 'date_start_event', 1, 1, 1, '', 1, 0); print ' '.$langs->trans("to").' '; print $form->selectDate(($date_end_event ? $date_end_event : -1), 'date_end_event', 1, 1, 1, '', 1, 0); print '
'.$langs->trans("Location").'
'.$langs->trans("Description").''; $doleditor = new DolEditor('description', GETPOST("description", 'restricthtml'), '', 90, 'dolibarr_notes', '', false, true, getDolGlobalString('FCKEDITOR_ENABLE_SOCIETE'), ROWS_3, '90%'); $doleditor->Create(); print '
'.$langs->trans("Categories").''; $cate_arbo = $form->select_all_categories(Categorie::TYPE_PROJECT, '', 'parent', 64, 0, 1); $arrayselected = GETPOST('categories', 'array'); print img_picto('', 'category').$form->multiselectarray('categories', $cate_arbo, $arrayselected, '', 0, 'quatrevingtpercent widthcentpercentminusx', 0, 0); print "
'; print dol_get_fiche_end(); print $form->buttonsSaveCancel('CreateDraft'); print '
'; // Change probability from status or role of project // Set also dependencies between use taks and bill time print ''; } elseif ($object->id > 0) { /* * Show or edit */ $res = $object->fetch_optionals(); // To verify role of users $userAccess = $object->restrictedProjectArea($user, 'read'); $userWrite = $object->restrictedProjectArea($user, 'write'); $userDelete = $object->restrictedProjectArea($user, 'delete'); //print "userAccess=".$userAccess." userWrite=".$userWrite." userDelete=".$userDelete; // Confirmation validation if ($action == 'validate') { print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateProject'), $langs->trans('ConfirmValidateProject'), 'confirm_validate', '', 0, 1); } // Confirmation close if ($action == 'close') { print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id, $langs->trans("CloseAProject"), $langs->trans("ConfirmCloseAProject"), "confirm_close", '', '', 1); } // Confirmation reopen if ($action == 'reopen') { print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id, $langs->trans("ReOpenAProject"), $langs->trans("ConfirmReOpenAProject"), "confirm_reopen", '', '', 1); } // Confirmation delete if ($action == 'delete') { $text = $langs->trans("ConfirmDeleteAProject"); $task = new Task($db); $taskarray = $task->getTasksArray(0, 0, $object->id, 0, 0); $nboftask = count($taskarray); if ($nboftask) { $text .= '
'.img_warning().' '.$langs->trans("ThisWillAlsoRemoveTasks", $nboftask); } print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id, $langs->trans("DeleteAProject"), $text, "confirm_delete", '', '', 1); } // Clone confirmation if ($action == 'clone') { $formquestion = array( 'text' => $langs->trans("ConfirmClone"), 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')), array('type' => 'checkbox', 'name' => 'clone_contacts', 'label' => $langs->trans("CloneContacts"), 'value' => true), array('type' => 'checkbox', 'name' => 'clone_tasks', 'label' => $langs->trans("CloneTasks"), 'value' => true), array('type' => 'checkbox', 'name' => 'move_date', 'label' => $langs->trans("CloneMoveDate"), 'value' => true), array('type' => 'checkbox', 'name' => 'clone_notes', 'label' => $langs->trans("CloneNotes"), 'value' => true), array('type' => 'checkbox', 'name' => 'clone_project_files', 'label' => $langs->trans("CloneProjectFiles"), 'value' => false), array('type' => 'checkbox', 'name' => 'clone_task_files', 'label' => $langs->trans("CloneTaskFiles"), 'value' => false) ); print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id, $langs->trans("ToClone"), $langs->trans("ConfirmCloneProject"), "confirm_clone", $formquestion, '', 1, 400, 590); } print '
'; print ''; print ''; print ''; print ''; $head = project_prepare_head($object); if ($action == 'edit' && $userWrite > 0) { print dol_get_fiche_head($head, 'project', $langs->trans("Project"), 0, ($object->public ? 'projectpub' : 'project')); print ''; // Ref $suggestedref = $object->ref; print ''; print ''; // Label print ''; print ''; // Status print ''; // Usage if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES) || empty($conf->global->PROJECT_HIDE_TASKS) || isModEnabled('eventorganization')) { print ''; print ''; } print ''; // Thirdparty if (isModEnabled('societe')) { print ''; } // Visibility print ''; if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { $classfortr = ($object->usage_opportunity ? '' : ' hideobject'); // Opportunity status print ''; print ''; print ''; // Opportunity amount print ''; print ''; print ''; } // Budget print ''; print ''; print ''; // Date project print ''; if (isModEnabled('eventorganization')) { // Date event print ''; // Location print ''; print ''; print ''; } // Description print ''; print ''; // Tags-Categories if (isModEnabled('categorie')) { print '"; } // Other options $parameters = array(); $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (empty($reshook)) { print $object->showOptionals($extrafields, 'edit'); } print '
'.$langs->trans("Ref").''; print ' '.$form->textwithpicto('', $langs->trans("YouCanCompleteRef", $suggestedref)); print '
'.$langs->trans("Label").'
'.$langs->trans("Status").''; print ''; print ajax_combobox('status'); print '
'; print $langs->trans("Usage"); print ''; if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { print 'usage_opportunity ? ' checked="checked"' : '')).'"> '; $htmltext = $langs->trans("ProjectFollowOpportunity"); print ''; print ''; print '
'; } if (empty($conf->global->PROJECT_HIDE_TASKS)) { print 'usage_task ? ' checked="checked"' : '')) . '"> '; $htmltext = $langs->trans("ProjectFollowTasks"); print ''; print ''; print '
'; } if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT)) { print 'usage_bill_time ? ' checked="checked"' : '')) . '"> '; $htmltext = $langs->trans("ProjectBillTimeDescription"); print ''; print ''; print '
'; } if (isModEnabled('eventorganization')) { print 'usage_organize_event ? ' checked="checked"' : '')) . '"> '; $htmltext = $langs->trans("EventOrganizationDescriptionLong"); print ''; print ''; } print '
'; print (empty($conf->global->PROJECT_THIRDPARTY_REQUIRED) ? '' : ''); print $langs->trans("ThirdParty"); print (empty($conf->global->PROJECT_THIRDPARTY_REQUIRED) ? '' : ''); print ''; $filteronlist = ''; if (!empty($conf->global->PROJECT_FILTER_FOR_THIRDPARTY_LIST)) { $filteronlist = $conf->global->PROJECT_FILTER_FOR_THIRDPARTY_LIST; } $text = img_picto('', 'company', 'class="pictofixedwidth"'); $text .= $form->select_company($object->thirdparty->id, 'socid', $filteronlist, 'None', 1, 0, array(), 0, 'minwidth300'); if (empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS) && empty($conf->dol_use_jmobile)) { $texthelp = $langs->trans("IfNeedToUseOtherObjectKeepEmpty"); print $form->textwithtooltip($text.' '.img_help(), $texthelp, 1, 0, '', '', 2); } else { print $text; } print '
'.$langs->trans("Visibility").''; $array = array(); if (empty($conf->global->PROJECT_DISABLE_PRIVATE_PROJECT)) { $array[0] = $langs->trans("PrivateProject"); } if (empty($conf->global->PROJECT_DISABLE_PUBLIC_PROJECT)) { $array[1] = $langs->trans("SharedProject"); } if (count($array) > 0) { print $form->selectarray('public', $array, $object->public, 0, 0, 0, '', 0, 0, 0, '', '', 1); } else { print ''; if ($object->public == 0) { print img_picto($langs->trans('PrivateProject'), 'private', 'class="paddingrightonly"'); print $langs->trans("PrivateProject"); } else { print img_picto($langs->trans('SharedProject'), 'world', 'class="paddingrightonly"'); print $langs->trans("SharedProject"); } } print '
'.$langs->trans("OpportunityStatus").''; print '
'; print $formproject->selectOpportunityStatus('opp_status', $object->opp_status, 1, 0, 0, 0, 'minwidth150 inline-block valignmiddle', 1, 1); // Opportunity probability print ' %'; print ''; print '
'; print ''; print '
'.$langs->trans("OpportunityAmount").''; print $langs->getCurrencySymbol($conf->currency); print '
'.$langs->trans("Budget").''; print $langs->getCurrencySymbol($conf->currency); print '
'.$langs->trans("Date").(isModEnabled('eventorganization') ? ' ('.$langs->trans("Project").')' : '').''; print $form->selectDate($object->date_start ? $object->date_start : -1, 'projectstart', 0, 0, 0, '', 1, 0); print ' '.$langs->trans("to").' '; print $form->selectDate($object->date_end ? $object->date_end : -1, 'projectend', 0, 0, 0, '', 1, 0); print '     '; print '
'.$langs->trans("Date").' ('.$langs->trans("Event").')'; 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); print ' '.$langs->trans("to").' '; 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); print '
'.$langs->trans("Location").'
'.$langs->trans("Description").''; $doleditor = new DolEditor('description', $object->description, '', 90, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_SOCIETE'), ROWS_3, '90%'); $doleditor->Create(); print '
'.$langs->trans("Categories").''; $cate_arbo = $form->select_all_categories(Categorie::TYPE_PROJECT, '', 'parent', 64, 0, 1); $c = new Categorie($db); $cats = $c->containing($object->id, Categorie::TYPE_PROJECT); foreach ($cats as $cat) { $arrayselected[] = $cat->id; } print img_picto('', 'category').$form->multiselectarray('categories', $cate_arbo, $arrayselected, 0, 0, 'quatrevingtpercent widthcentpercentminusx', 0, '0'); print "
'; } else { print dol_get_fiche_head($head, 'project', $langs->trans("Project"), -1, ($object->public ? 'projectpub' : 'project')); // Project card $linkback = ''.$langs->trans("BackToList").''; $morehtmlref = '
'; // Title $morehtmlref .= dol_escape_htmltag($object->title); // Thirdparty $morehtmlref .= '
'; if (!empty($object->thirdparty->id) && $object->thirdparty->id > 0) { $morehtmlref .= $object->thirdparty->getNomUrl(1, 'project'); } $morehtmlref .= '
'; // Define a complementary filter for search of next/prev ref. if (empty($user->rights->projet->all->lire)) { $objectsListId = $object->getProjectsAuthorizedForUser($user, 0, 0); $object->next_prev_filter = " rowid IN (".$db->sanitize(count($objectsListId) ? join(',', array_keys($objectsListId)) : '0').")"; } dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); print '
'; print '
'; print '
'; print ''; // Usage if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES) || empty($conf->global->PROJECT_HIDE_TASKS) || isModEnabled('eventorganization')) { print ''; print ''; } // Visibility print ''; if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES) && !empty($object->usage_opportunity)) { // Opportunity status print ''; // Opportunity Amount print ''; // Opportunity Weighted Amount /* print ''; */ } // Budget print ''; // Date start - end project print ''; // Other attributes $cols = 2; include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; print '
'; print $langs->trans("Usage"); print ''; if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { print 'usage_opportunity ? ' checked="checked"' : '')).'"> '; $htmltext = $langs->trans("ProjectFollowOpportunity"); print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext); print '
'; } if (empty($conf->global->PROJECT_HIDE_TASKS)) { print 'usage_task ? ' checked="checked"' : '')).'"> '; $htmltext = $langs->trans("ProjectFollowTasks"); print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext); print '
'; } if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT)) { print 'usage_bill_time ? ' checked="checked"' : '')).'"> '; $htmltext = $langs->trans("ProjectBillTimeDescription"); print $form->textwithpicto($langs->trans("BillTime"), $htmltext); print '
'; } if (isModEnabled('eventorganization')) { print 'usage_organize_event ? ' checked="checked"' : '')).'"> '; $htmltext = $langs->trans("EventOrganizationDescriptionLong"); print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext); } print '
'.$langs->trans("Visibility").''; if ($object->public) { print img_picto($langs->trans('SharedProject'), 'world', 'class="paddingrightonly"'); print $langs->trans('SharedProject'); } else { print img_picto($langs->trans('PrivateProject'), 'private', 'class="paddingrightonly"'); print $langs->trans('PrivateProject'); } print '
'.$langs->trans("OpportunityStatus").''; $code = dol_getIdFromCode($db, $object->opp_status, 'c_lead_status', 'rowid', 'code'); if ($code) { print $langs->trans("OppStatus".$code); } // Opportunity percent print ' / '; if (strcmp($object->opp_percent, '')) { print price($object->opp_percent, 0, $langs, 1, 0).' %'; } print '
'.$langs->trans("OpportunityAmount").''; if (strcmp($object->opp_amount, '')) { print ''.price($object->opp_amount, 0, $langs, 1, 0, -1, $conf->currency).''; if (strcmp($object->opp_percent, '')) { print '       '.$langs->trans("Weighted").': '.price($object->opp_amount * $object->opp_percent / 100, 0, $langs, 1, 0, -1, $conf->currency).''; } } print '
'.$langs->trans('OpportunityWeightedAmount').''; if (strcmp($object->opp_amount, '') && strcmp($object->opp_percent, '')) { print ''.price($object->opp_amount * $object->opp_percent / 100, 0, $langs, 1, 0, -1, $conf->currency).''; } print '
'.$langs->trans("Budget").''; if (!is_null($object->budget_amount) && strcmp($object->budget_amount, '')) { print ''.price($object->budget_amount, 0, $langs, 1, 0, 0, $conf->currency).''; } print '
'.$langs->trans("Dates").''; $start = dol_print_date($object->date_start, 'day'); print ($start ? $start : '?'); $end = dol_print_date($object->date_end, 'day'); print ' - '; print ($end ? $end : '?'); if ($object->hasDelay()) { print img_warning("Late"); } print '
'; print '
'; print '
'; print '
'; print ''; // Description print ''; // Categories if (isModEnabled('categorie')) { print '"; } print '
'.$langs->trans("Description").''; print dol_htmlentitiesbr($object->description); print '
'.$langs->trans("Categories").''; print $form->showCategories($object->id, Categorie::TYPE_PROJECT, 1); print "
'; print '
'; print '
'; print '
'; } print dol_get_fiche_end(); if ($action == 'edit' && $userWrite > 0) { print $form->buttonsSaveCancel(); } print '
'; // Set also dependencies between use taks and bill time print ''; // Change probability from status if (!empty($conf->use_javascript_ajax) && !empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { // Default value to close or not when we set opp to 'WON'. $defaultcheckedwhenoppclose = 1; if (empty($conf->global->PROJECT_HIDE_TASKS)) { $defaultcheckedwhenoppclose = 0; } print ''; print ''; } /* * Actions Buttons */ print '
'; $parameters = array(); $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been // modified by hook if (empty($reshook)) { if ($action != "edit" && $action != 'presend') { // Create event /*if (isModEnabled('agenda') && !empty($conf->global->MAIN_ADD_EVENT_ON_ELEMENT_CARD)) // Add hidden condition because this is not a // "workflow" action so should appears somewhere else on // page. { print '' . $langs->trans("AddAction") . ''; }*/ // Send if (empty($user->socid)) { if ($object->statut != Project::STATUS_CLOSED) { print dolGetButtonAction('', $langs->trans('SendMail'), 'default', $_SERVER["PHP_SELF"].'?action=presend&token='.newToken().'&id='.$object->id.'&mode=init#formmailbeforetitle', ''); } } // Accounting Report /* $accouting_module_activated = isModEnabled('comptabilite') || isModEnabled('accounting'); if ($accouting_module_activated && $object->statut != Project::STATUS_DRAFT) { $start = dol_getdate((int) $object->date_start); $end = dol_getdate((int) $object->date_end); $url = DOL_URL_ROOT.'/compta/accounting-files.php?projectid='.$object->id; if (!empty($object->date_start)) $url .= '&date_startday='.$start['mday'].'&date_startmonth='.$start['mon'].'&date_startyear='.$start['year']; if (!empty($object->date_end)) $url .= '&date_stopday='.$end['mday'].'&date_stopmonth='.$end['mon'].'&date_stopyear='.$end['year']; print dolGetButtonAction('', $langs->trans('ExportAccountingReportButtonLabel'), 'default', $url, ''); } */ // Back to draft if (!getDolGlobalString('MAIN_DISABLEDRAFTSTATUS') && !getDolGlobalString('MAIN_DISABLEDRAFTSTATUS_PROJECT')) { if ($object->statut != Project::STATUS_DRAFT && $user->rights->projet->creer) { if ($userWrite > 0) { print dolGetButtonAction('', $langs->trans('SetToDraft'), 'default', $_SERVER["PHP_SELF"].'?action=confirm_setdraft&confirm=yes&token='.newToken().'&id='.$object->id, ''); } else { print dolGetButtonAction($langs->trans('NotOwnerOfProject'), $langs->trans('SetToDraft'), 'default', $_SERVER['PHP_SELF']. '#', '', false); } } } // Modify if ($object->statut != Project::STATUS_CLOSED && $user->rights->projet->creer) { if ($userWrite > 0) { print dolGetButtonAction('', $langs->trans('Modify'), 'default', $_SERVER["PHP_SELF"].'?action=edit&token='.newToken().'&id='.$object->id, ''); } else { print dolGetButtonAction($langs->trans('NotOwnerOfProject'), $langs->trans('Modify'), 'default', $_SERVER['PHP_SELF']. '#', '', false); } } // Validate if ($object->statut == Project::STATUS_DRAFT && $user->rights->projet->creer) { if ($userWrite > 0) { print dolGetButtonAction('', $langs->trans('Validate'), 'default', $_SERVER["PHP_SELF"].'?action=validate&token='.newToken().'&id='.$object->id, ''); } else { print dolGetButtonAction($langs->trans('NotOwnerOfProject'), $langs->trans('Validate'), 'default', $_SERVER['PHP_SELF']. '#', '', false); } } // Close if ($object->statut == Project::STATUS_VALIDATED && $user->rights->projet->creer) { if ($userWrite > 0) { print dolGetButtonAction('', $langs->trans('Close'), 'default', $_SERVER["PHP_SELF"].'?action=close&token='.newToken().'&id='.$object->id, ''); } else { print dolGetButtonAction($langs->trans('NotOwnerOfProject'), $langs->trans('Close'), 'default', $_SERVER['PHP_SELF']. '#', '', false); } } // Reopen if ($object->statut == Project::STATUS_CLOSED && $user->rights->projet->creer) { if ($userWrite > 0) { print dolGetButtonAction('', $langs->trans('ReOpen'), 'default', $_SERVER["PHP_SELF"].'?action=reopen&token='.newToken().'&id='.$object->id, ''); } else { print dolGetButtonAction($langs->trans('NotOwnerOfProject'), $langs->trans('ReOpen'), 'default', $_SERVER['PHP_SELF']. '#', '', false); } } if (!empty($conf->global->PROJECT_SHOW_CREATE_OBJECT_BUTTON)) { print'"; } // Clone if ($user->rights->projet->creer) { if ($userWrite > 0) { print dolGetButtonAction('', $langs->trans('ToClone'), 'default', $_SERVER["PHP_SELF"].'?action=clone&token='.newToken().'&id='.$object->id, ''); } else { print dolGetButtonAction($langs->trans('NotOwnerOfProject'), $langs->trans('ToClone'), 'default', $_SERVER['PHP_SELF']. '#', '', false); } } // Delete if ($user->rights->projet->supprimer || ($object->statut == Project::STATUS_DRAFT && $user->rights->projet->creer)) { if ($userDelete > 0 || ($object->statut == Project::STATUS_DRAFT && $user->rights->projet->creer)) { print dolGetButtonAction('', $langs->trans('Delete'), 'delete', $_SERVER["PHP_SELF"].'?action=delete&token='.newToken().'&id='.$object->id, ''); } else { print dolGetButtonAction($langs->trans('NotOwnerOfProject'), $langs->trans('Delete'), 'default', $_SERVER['PHP_SELF']. '#', '', false); } } } } print "
"; if (GETPOST('modelselected')) { $action = 'presend'; } if ($action != 'presend') { print '
'; print ''; // ancre /* * Generated documents */ $filename = dol_sanitizeFileName($object->ref); $filedir = $conf->project->multidir_output[$object->entity]."/".dol_sanitizeFileName($object->ref); $urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id; $genallowed = ($user->rights->projet->lire && $userAccess > 0); $delallowed = ($user->rights->projet->creer && $userWrite > 0); print $formfile->showdocuments('project', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 0, 0, '', '', '', '', '', $object); print '
'; $MAXEVENT = 10; $morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT.'/projet/messaging.php?id='.$object->id); // List of actions on element include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; $formactions = new FormActions($db); $somethingshown = $formactions->showactions($object, 'project', 0, 1, '', $MAXEVENT, '', $morehtmlcenter); print '
'; } // Presend form $modelmail = 'project'; $defaulttopic = 'SendProjectRef'; $diroutput = $conf->project->multidir_output[$object->entity]; $autocopy = 'MAIN_MAIL_AUTOCOPY_PROJECT_TO'; // used to know the automatic BCC to add $trackid = 'proj'.$object->id; include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php'; // Hook to add more things on page $parameters = array(); $reshook = $hookmanager->executeHooks('mainCardTabAddMore', $parameters, $object, $action); // Note that $action and $object may have been modified by hook } else { print $langs->trans("RecordNotFound"); } // End of page llxFooter(); $db->close();