diff --git a/htdocs/admin/mails_senderprofile_list.php b/htdocs/admin/mails_senderprofile_list.php index bf841a03abe..89f9e23fdca 100644 --- a/htdocs/admin/mails_senderprofile_list.php +++ b/htdocs/admin/mails_senderprofile_list.php @@ -43,6 +43,7 @@ $backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') $id = GETPOST('id', 'int'); +$rowid = GETPOST('rowid', 'alpha'); // Load variable for pagination $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; @@ -122,6 +123,10 @@ $permissiontoread = $user->admin; $permissiontoadd = $user->admin; $permissiontodelete = $user->admin; +if ($id > 0) { + $object->fetch($id); +} + /* * Actions @@ -191,7 +196,6 @@ $now = dol_now(); $help_url = ''; $title = $langs->trans("EMailsSetup"); - llxHeader('', $title); $linkback = ''; @@ -230,7 +234,7 @@ foreach ($search as $key => $val) { if ($key == 'status' && $search[$key] == -1) continue; $mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0); - if (strpos($object->fields[$key]['type'], 'integer:') === 0) { + if (strpos($object->fields[$key]['type'], 'integer:') === 0 || $key == 'active') { if ($search[$key] == '-1') $search[$key] = ''; $mode_search = 2; } @@ -347,15 +351,41 @@ print '
'; print ''; print ''; -print ''; +print ''; print ''; print ''; print ''; +print ''; print ''; $newcardbutton = ''; if ($action != 'create') { $newcardbutton = dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', $_SERVER['PHP_SELF'].'?action=create', '', $permissiontoadd); + + if ($action == 'edit') { + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print '
'.$langs->trans("Label").'
'.$langs->trans("Email").'
'.$langs->trans("Signature").''; + require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; + $doleditor = new DolEditor('signature', (GETPOSTISSET('signature') ? GETPOST('signature', 'restricthtml') : $object->signature), '', 138, 'dolibarr_notes', 'In', true, true, empty($conf->global->FCKEDITOR_ENABLE_USERSIGN) ? 0 : 1, ROWS_4, '90%'); + print $doleditor->Create(1); + print '
'.$langs->trans("User").''; + print $form->select_dolusers((GETPOSTISSET('private') ? GETPOST('private', 'int') : $object->private), 'private', 1, null, 0, ($user->admin ? '' : $user->id)); + print '
'.$langs->trans("Position").'
'.$langs->trans("Status").''; + print $form->selectarray('active', $object->fields['active']['arrayofkeyval'], (GETPOSTISSET('active') ? GETPOST('active', 'int') : $object->active), 0, 0, 0, '', 1); + print '
'; + print '
'; + print '
'; + print ''; + print '   '; + print ''; + print '
'; + } } else { /*print ''; if ($optioncss != '') print ''; @@ -367,7 +397,7 @@ if ($action != 'create') { print ''; */ print ''; - print ''; + print ''; print ''; print ''; if (!$i) $totalarray['nbfield']++; @@ -550,14 +580,14 @@ while ($i < ($limit ? min($num, $limit) : $num)) print $hookmanager->resPrint; // Action column print '
'.$langs->trans("Label").'
'.$langs->trans("Label").'
'.$langs->trans("Email").'
'.$langs->trans("Signature").''; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; @@ -531,7 +561,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) if (!empty($arrayfields['t.'.$key]['checked'])) { print ''; - if ($key == 'status') print $object->getLibStatut(5); + if ($key == 'status' || $key == 'active') print $object->getLibStatut(5); else print $object->showOutputField($val, $key, $object->$key, ''); print ''; - $url = $_SERVER["PHP_SELF"].'?action=list&id='.$obj->rowid; + $url = $_SERVER["PHP_SELF"].'?id='.$obj->rowid; if ($limit) $url .= '&limit='.urlencode($limit); if ($page) $url .= '&page='.urlencode($page); if ($sortfield) $url .= '&sortfield='.urlencode($sortfield); if ($sortorder) $url .= '&page='.urlencode($sortorder); - //print ''.img_edit().''; + print ''.img_edit().''; //print '   '; - print ''.img_delete().'   '; + print ''.img_delete().'   '; if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined { $selected = 0; diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index ad9627a817d..128a55a4889 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -45,7 +45,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php'; // Load translation files required by the page $langs->loadLangs(array("errors", "admin", "mails", "languages")); -$action = GETPOST('action', 'alpha') ?GETPOST('action', 'alpha') : 'view'; +$action = GETPOST('action', 'aZ09') ?GETPOST('action', 'aZ09') : 'view'; $confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation $id = GETPOST('id', 'int'); @@ -411,13 +411,15 @@ if (empty($reshook)) $form = new Form($db); $formadmin = new FormAdmin($db); -llxHeader(); +$help_url = ''; +$title = $langs->trans("EMailsSetup"); + +llxHeader('', $title); -$titre = $langs->trans("EMailsSetup"); $linkback = ''; $titlepicto = 'title_setup'; -print load_fiche_titre($titre, $linkback, $titlepicto); +print load_fiche_titre($title, $linkback, $titlepicto); $head = email_admin_prepare_head(); diff --git a/htdocs/core/class/emailsenderprofile.class.php b/htdocs/core/class/emailsenderprofile.class.php index 25a0d2a25c5..7cf18ae4801 100644 --- a/htdocs/core/class/emailsenderprofile.class.php +++ b/htdocs/core/class/emailsenderprofile.class.php @@ -95,13 +95,12 @@ class EmailSenderProfile extends CommonObject 'entity' => array('type'=>'integer', 'label'=>'Entity', 'visible'=>-1, 'enabled'=>1, 'position'=>20, 'notnull'=>1, 'index'=>1,), 'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'visible'=>1, 'enabled'=>1, 'position'=>30, 'notnull'=>1), 'email' => array('type'=>'varchar(255)', 'label'=>'Email', 'visible'=>1, 'enabled'=>1, 'position'=>40, 'notnull'=>-1), - //'fk_user_creat' => array('type'=>'integer', 'label'=>'UserAuthor', 'visible'=>-1, 'enabled'=>1, 'position'=>500, 'notnull'=>1,), 'private' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'User', 'visible'=>-1, 'enabled'=>1, 'position'=>50, 'default'=>'0', 'notnull'=>1), 'signature' => array('type'=>'text', 'label'=>'Signature', 'visible'=>3, 'enabled'=>1, 'position'=>400, 'notnull'=>-1, 'index'=>1,), 'position' => array('type'=>'integer', 'label'=>'Position', 'visible'=>1, 'enabled'=>1, 'position'=>405, 'notnull'=>-1, 'index'=>1,), 'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'visible'=>-1, 'enabled'=>1, 'position'=>500, 'notnull'=>1,), 'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'visible'=>-1, 'enabled'=>1, 'position'=>500, 'notnull'=>1,), - 'active' => array('type'=>'integer', 'label'=>'Status', 'visible'=>1, 'enabled'=>1, 'default'=>1, 'position'=>1000, 'notnull'=>-1, 'index'=>1, 'arrayofkeyval'=>array(0=>'Disabled', 1=>'Enabled')), + 'active' => array('type'=>'integer', 'label'=>'Status', 'visible'=>1, 'enabled'=>1, 'default'=>1, 'position'=>1000, 'notnull'=>1, 'index'=>1, 'arrayofkeyval'=>array(0=>'Disabled', 1=>'Enabled')), ); /** @@ -331,7 +330,7 @@ class EmailSenderProfile extends CommonObject */ public function getLibStatut($mode = 0) { - return $this->LibStatut($this->status, $mode); + return $this->LibStatut($this->active, $mode); } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps @@ -346,31 +345,16 @@ class EmailSenderProfile extends CommonObject { global $langs; - if ($mode == 0 || $mode == 1) - { - if ($status == 1) return $langs->trans('Enabled'); - elseif ($status == 0) return $langs->trans('Disabled'); - } elseif ($mode == 2) - { - if ($status == 1) return img_picto($langs->trans('Enabled'), 'statut4').' '.$langs->trans('Enabled'); - elseif ($status == 0) return img_picto($langs->trans('Disabled'), 'statut5').' '.$langs->trans('Disabled'); - } elseif ($mode == 3) - { - if ($status == 1) return img_picto($langs->trans('Enabled'), 'statut4'); - elseif ($status == 0) return img_picto($langs->trans('Disabled'), 'statut5'); - } elseif ($mode == 4) - { - if ($status == 1) return img_picto($langs->trans('Enabled'), 'statut4').' '.$langs->trans('Enabled'); - elseif ($status == 0) return img_picto($langs->trans('Disabled'), 'statut5').' '.$langs->trans('Disabled'); - } elseif ($mode == 5) - { - if ($status == 1) return $langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'), 'statut4'); - elseif ($status == 0) return $langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'), 'statut5'); - } elseif ($mode == 6) - { - if ($status == 1) return $langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'), 'statut4'); - elseif ($status == 0) return $langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'), 'statut5'); + if ($status == 1) { + $label = $labelshort = $langs->trans('Enabled'); + } else { + $label = $labelshort = $langs->trans('Disabled'); } + + $statusType = 'status'.$status; + if ($status == self::STATUS_ENABLED) $statusType = 'status4'; + + return dolGetStatus($label, $labelshort, '', $statusType, $mode); } /** diff --git a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php index b9de189b996..cd7b0c8afb0 100644 --- a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php +++ b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php @@ -59,10 +59,11 @@ class InterfaceActionsAuto extends DolibarrTriggers * $object->sendtoid (id of contact or array of ids of contacts) * $object->socid (id of thirdparty) * $object->fk_project - * $object->fk_element - * $object->elementtype + * $object->fk_element (ID of object to link action event to) + * $object->elementtype (->element of object to link action to) + * $object->module (if defined, elementtype in llx_actioncomm will be elementtype@module) * - * @param string $action Event action code + * @param string $action Event action code ('CONTRACT_MODIFY', 'RECRUITMENTCANDIDATURE_MODIFIY', ...) * @param Object $object Object * @param User $user Object user * @param Translate $langs Object langs @@ -74,6 +75,7 @@ class InterfaceActionsAuto extends DolibarrTriggers if (empty($conf->agenda->enabled)) return 0; // Module not active, we do nothing $key = 'MAIN_AGENDA_ACTIONAUTO_'.$action; + //var_dump($action.' - '.$conf->global->$key);exit; // Do not log events not enabled for this action if (empty($conf->global->$key)) { @@ -778,15 +780,29 @@ class InterfaceActionsAuto extends DolibarrTriggers $object->sendtoid = 0; } // TODO Merge all previous cases into this generic one - else // $action = BILL_DELETE, TICKET_CREATE, TICKET_MODIFY, TICKET_DELETE, CONTACT_SENTBYMAIL, ... + else // $action = BILL_DELETE, TICKET_CREATE, TICKET_MODIFY, TICKET_DELETE, CONTACT_SENTBYMAIL, RECRUITMENTCANDIDATURE_MODIFY, ... { // Note: We are here only if $conf->global->MAIN_AGENDA_ACTIONAUTO_action is on (tested at begining of this function). // Note that these key can be set in agenda setup, only if defined into c_action_trigger // Load translation files required by the page - $langs->loadLangs(array("agenda", "other")); - - if (empty($object->actionmsg2)) $object->actionmsg2 = $langs->transnoentities($action."InDolibarr", $object->ref); - if (empty($object->actionmsg)) $object->actionmsg = $langs->transnoentities($action."InDolibarr", $object->ref); + if (empty($object->actionmsg2)) { + $langs->loadLangs(array("agenda", "other")); + if ($langs->transnoentities($action."InDolibarr", ($object->newref ? $object->newref : $object->ref)) != $action."InDolibarr") { // specific translation key + $object->actionmsg2 = $langs->transnoentities($action."InDolibarr", ($object->newref ? $object->newref : $object->ref)); + } else { // generic translation key + $tmp = explode('_', $action); + $object->actionmsg2 = $langs->transnoentities($tmp[count($tmp)-1]."InDolibarr", ($object->newref ? $object->newref : $object->ref)); + } + } + if (empty($object->actionmsg)) { + $langs->loadLangs(array("agenda", "other")); + if ($langs->transnoentities($action."InDolibarr", ($object->newref ? $object->newref : $object->ref)) != $action."InDolibarr") { // specific translation key + $object->actionmsg = $langs->transnoentities($action."InDolibarr", ($object->newref ? $object->newref : $object->ref)); + } else { // generic translation key + $tmp = explode('_', $action); + $object->actionmsg = $langs->transnoentities($tmp[count($tmp)-1]."InDolibarr", ($object->newref ? $object->newref : $object->ref)); + } + } if (! isset($object->sendtoid) || ! is_array($object->sendtoid)) { $object->sendtoid = 0; @@ -827,14 +843,15 @@ class InterfaceActionsAuto extends DolibarrTriggers $projectid = isset($object->fk_project) ? $object->fk_project : 0; if ($object->element == 'project') $projectid = $object->id; - $elementid = $object->id; + $elementid = $object->id; // id of object $elementtype = $object->element; + $elementmodule = $object->module; if ($object->element == 'subscription') { $elementid = $object->fk_adherent; $elementtype = 'member'; } - //var_dump($societeforaction);var_dump($contactforaction);exit; + //var_dump($societeforaction);var_dump($contactforaction);var_dump($elementid);var_dump($elementtype);exit; // Insertion action require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; @@ -867,7 +884,7 @@ class InterfaceActionsAuto extends DolibarrTriggers if (!in_array($elementtype, array('societe', 'contact', 'project'))) { $actioncomm->fk_element = $elementid; - $actioncomm->elementtype = $elementtype; + $actioncomm->elementtype = $elementtype.($elementmodule ? '@'.$elementmodule : ''); } if (property_exists($object, 'attachedfiles') && is_array($object->attachedfiles) && count($object->attachedfiles) > 0) { diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 4657b49899d..28c0b86d765 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -768,7 +768,7 @@ class CommandeFournisseur extends CommonOrder global $langs, $conf, $user; $result = ''; - $label = ''.$langs->trans("ShowOrder").''; + $label = ''.$langs->trans("PurchaseOrder").''; if (!empty($this->ref)) $label .= '
'.$langs->trans('Ref').': '.$this->ref; if (!empty($this->ref_supplier)) diff --git a/htdocs/install/mysql/data/llx_c_action_trigger.sql b/htdocs/install/mysql/data/llx_c_action_trigger.sql index d54ac24a203..eeca137dbc0 100644 --- a/htdocs/install/mysql/data/llx_c_action_trigger.sql +++ b/htdocs/install/mysql/data/llx_c_action_trigger.sql @@ -124,13 +124,23 @@ insert into llx_c_action_trigger (code,label,description,elementtype,rang) value insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BOM_CLOSE','BOM disabled','Executed when a BOM is disabled','bom',652); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BOM_REOPEN','BOM reopen','Executed when a BOM is re-open','bom',653); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BOM_DELETE','BOM deleted','Executed when a BOM deleted','bom',654); -insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MRP_MO_VALIDATE','MO validated','Executed when a MO is validated','bom',660); -insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MRP_MO_PRODUCED','MO produced','Executed when a MO is produced','bom',661); -insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MRP_MO_DELETE','MO deleted','Executed when a MO is deleted','bom',662); -insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MRP_MO_CANCEL','MO canceled','Executed when a MO is canceled','bom',663); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MRP_MO_VALIDATE','MO validated','Executed when a MO is validated','mrp',660); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MRP_MO_PRODUCED','MO produced','Executed when a MO is produced','mrp',661); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MRP_MO_DELETE','MO deleted','Executed when a MO is deleted','mrp',662); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MRP_MO_CANCEL','MO canceled','Executed when a MO is canceled','mrp',663); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('CONTACT_CREATE','Contact address created','Executed when a contact is created','contact',50); -insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('CONTACT_SENTBYMAIL','Mails sent from third party card','Executed when you send email from contact adress card','contact',51); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('CONTACT_SENTBYMAIL','Mails sent from third party card','Executed when you send email from contact address record','contact',51); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('CONTACT_DELETE','Contact address deleted','Executed when a contact is deleted','contact',52); + +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('RECRUITMENTJOBPOSITION_CREATE','Job created','Executed when a job is created','recruitment',7500); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('RECRUITMENTJOBPOSITION_MODIFY','Job modified','Executed when a job is modified','recruitment',7502); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('RECRUITMENTJOBPOSITION_SENTBYMAIL','Mails sent from job record','Executed when you send email from job record','recruitment',7504); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('RECRUITMENTJOBPOSITION_DELETE','Job deleted','Executed when a job is deleted','recruitment',7506); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('RECRUITMENTCANDIDATURE_CREATE','Candidature created','Executed when a candidature is created','recruitment',7510); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('RECRUITMENTCANDIDATURE_MODIFY','Candidature modified','Executed when a candidature is modified','recruitment',7512); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('RECRUITMENTCANDIDATURE_SENTBYMAIL','Mails sent from candidature record','Executed when you send email from candidature record','recruitment',7514); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('RECRUITMENTCANDIDATURE_DELETE','Candidature deleted','Executed when a candidature is deleted','recruitment',7516); + -- actions not enabled by default : they are excluded when we enable the module Agenda (except TASK_...) insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('TASK_CREATE','Task created','Executed when a project task is created','project',150); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('TASK_MODIFY','Task modified','Executed when a project task is modified','project',151); diff --git a/htdocs/install/mysql/migration/12.0.0-13.0.0.sql b/htdocs/install/mysql/migration/12.0.0-13.0.0.sql index 3ff02c889bc..108dc94f485 100644 --- a/htdocs/install/mysql/migration/12.0.0-13.0.0.sql +++ b/htdocs/install/mysql/migration/12.0.0-13.0.0.sql @@ -270,3 +270,13 @@ ALTER TABLE llx_ecm_files CHANGE COLUMN date_m tms timestamp; INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines,joinfiles) VALUES (0,'recruitment','recruitmentcandidature_send','',0,null,null,'(AnswerCandidature)' ,100,'$conf->recruitment->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourCandidature)__', '__(Hello)__ __CANDIDATE_FULLNAME__,

\n\n__(YourCandidatureAnswer)__
\n

\n__(Sincerely)__
__USER_SIGNATURE__',null, 0); +ALTER TABLE llx_c_action_trigger MODIFY COLUMN code varchar(64) NOT NULL; + +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('RECRUITMENTJOBPOSITION_CREATE','Job created','Executed when a job is created','recruitment',7500); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('RECRUITMENTJOBPOSITION_MODIFY','Job modified','Executed when a job is modified','recruitment',7502); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('RECRUITMENTJOBPOSITION_SENTBYMAIL','Mails sent from job record','Executed when you send email from job record','recruitment',7504); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('RECRUITMENTJOBPOSITION_DELETE','Job deleted','Executed when a job is deleted','recruitment',7506); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('RECRUITMENTCANDIDATURE_CREATE','Candidature created','Executed when a candidature is created','recruitment',7510); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('RECRUITMENTCANDIDATURE_MODIFY','Candidature modified','Executed when a candidature is modified','recruitment',7512); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('RECRUITMENTCANDIDATURE_SENTBYMAIL','Mails sent from candidature record','Executed when you send email from candidature record','recruitment',7514); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('RECRUITMENTCANDIDATURE_DELETE','Candidature deleted','Executed when a candidature is deleted','recruitment',7516); diff --git a/htdocs/install/mysql/tables/llx_c_action_trigger.sql b/htdocs/install/mysql/tables/llx_c_action_trigger.sql index c29f13b9fd4..8f7450d0fe9 100644 --- a/htdocs/install/mysql/tables/llx_c_action_trigger.sql +++ b/htdocs/install/mysql/tables/llx_c_action_trigger.sql @@ -23,7 +23,7 @@ create table llx_c_action_trigger ( rowid integer AUTO_INCREMENT PRIMARY KEY, elementtype varchar(64) NOT NULL, - code varchar(32) NOT NULL, + code varchar(64) NOT NULL, label varchar(128) NOT NULL, description varchar(255), rang integer DEFAULT 0 diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 1466b6389a9..186272da1b6 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -1077,4 +1077,8 @@ AmountMustBePositive=Amount must be positive ByStatus=By status InformationMessage=Information ASAP=As Soon As Possible - \ No newline at end of file +CREATEInDolibarr=Record %s create +MODIFYInDolibarr=Record %s modified +DELETEInDolibarr=Record %s deleted +VALIDATEInDolibarr=Record %s validated +APPROVEDInDolibarr=Record %s approved diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php index 5a2e27e6bc6..3a64bc557ea 100644 --- a/htdocs/modulebuilder/template/class/myobject.class.php +++ b/htdocs/modulebuilder/template/class/myobject.class.php @@ -32,6 +32,11 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; */ class MyObject extends CommonObject { + /** + * @var string ID of module. + */ + public $module = 'mymodule'; + /** * @var string ID to identify managed object. */ diff --git a/htdocs/modulebuilder/template/myobject_card.php b/htdocs/modulebuilder/template/myobject_card.php index a85f84a50ba..dfa79e499bc 100644 --- a/htdocs/modulebuilder/template/myobject_card.php +++ b/htdocs/modulebuilder/template/myobject_card.php @@ -157,7 +157,7 @@ if (empty($reshook)) if ($action == 'set_thirdparty' && $permissiontoadd) { - $object->setValueFrom('fk_soc', GETPOST('fk_soc', 'int'), '', '', 'date', '', $user, 'MYOBJECT_MODIFY'); + $object->setValueFrom('fk_soc', GETPOST('fk_soc', 'int'), '', '', 'date', '', $user, $triggermodname); } if ($action == 'classin' && $permissiontoadd) { @@ -165,7 +165,7 @@ if (empty($reshook)) } // Actions to send emails - $triggersendname = 'MYOBJECT_SENTBYMAIL'; + $triggersendname = 'MYMODULE_MYOBJECT_SENTBYMAIL'; $autocopy = 'MAIN_MAIL_AUTOCOPY_MYOBJECT_TO'; $trackid = 'myobject'.$object->id; include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php'; diff --git a/htdocs/recruitment/class/recruitmentcandidature.class.php b/htdocs/recruitment/class/recruitmentcandidature.class.php index b6f7bdd1215..0be25758617 100644 --- a/htdocs/recruitment/class/recruitmentcandidature.class.php +++ b/htdocs/recruitment/class/recruitmentcandidature.class.php @@ -1,6 +1,5 @@ - * Copyright (C) ---Put here your own copyright and developer email--- +/* Copyright (C) 2020 Laurent Destailleur * * 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 @@ -32,6 +31,11 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; */ class RecruitmentCandidature extends CommonObject { + /** + * @var string ID of module. + */ + public $module = 'recruitment'; + /** * @var string ID to identify managed object. */ @@ -61,6 +65,7 @@ class RecruitmentCandidature extends CommonObject const STATUS_DRAFT = 0; const STATUS_VALIDATED = 1; + //const STATUS_INTERVIEW_SCHEDULED = 2; const STATUS_CONTRACT_PROPOSED = 3; const STATUS_CONTRACT_SIGNED = 5; const STATUS_REFUSED = 8; diff --git a/htdocs/recruitment/class/recruitmentjobposition.class.php b/htdocs/recruitment/class/recruitmentjobposition.class.php index 3a0daa3eebf..d6a8c62e000 100644 --- a/htdocs/recruitment/class/recruitmentjobposition.class.php +++ b/htdocs/recruitment/class/recruitmentjobposition.class.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2020 Laurent Destailleur * * 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 @@ -31,6 +31,11 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; */ class RecruitmentJobPosition extends CommonObject { + /** + * @var string ID of module. + */ + public $module = 'recruitment'; + /** * @var string ID to identify managed object */ diff --git a/htdocs/recruitment/recruitmentcandidature_card.php b/htdocs/recruitment/recruitmentcandidature_card.php index 730d8fb884a..49587f76b09 100644 --- a/htdocs/recruitment/recruitmentcandidature_card.php +++ b/htdocs/recruitment/recruitmentcandidature_card.php @@ -138,7 +138,7 @@ if (empty($reshook)) else $backtopage = dol_buildpath('/recruitment/recruitmentcandidature_card.php', 1).'?id='.($id > 0 ? $id : '__ID__'); } } - $triggermodname = 'RECRUITMENT_RECRUITMENTCANDIDATURE_MODIFY'; // Name of trigger action code to execute when we modify record + $triggermodname = 'RECRUITMENTCANDIDATURE_MODIFY'; // Name of trigger action code to execute when we modify record // Actions cancel, add, update, update_extras, confirm_validate, confirm_delete, confirm_deleteline, confirm_clone, confirm_close, confirm_setdraft, confirm_reopen include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php'; @@ -155,16 +155,12 @@ if (empty($reshook)) // Action to build doc include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; - if ($action == 'set_thirdparty' && $permissiontoadd) - { - $object->setValueFrom('fk_soc', GETPOST('fk_soc', 'int'), '', '', 'date', '', $user, 'RECRUITMENTCANDIDATURE_MODIFY'); - } if ($action == 'classin' && $permissiontoadd) { $object->setProject(GETPOST('projectid', 'int')); } if ($action == 'confirm_decline' && $confirm == 'yes' && $permissiontoadd) { - $result = $object->setStatut($object::STATUS_REFUSED, null, '', 'RECRUITMENTCANDIDATURE_DECLINE'); + $result = $object->setStatut($object::STATUS_REFUSED, null, '', $triggermodname); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } @@ -506,7 +502,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } // Refuse - Decline - if ($object->status >= $object::STATUS_VALIDATED && $object->status < $object::STATUS_CANCELED) + if ($object->status >= $object::STATUS_VALIDATED && $object->status < $object::STATUS_REFUSED) { if ($permissiontoadd) {