From 1cc7b41de3f17bc1ed2ec0982286cb789ecb11f1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 3 Nov 2020 15:07:46 +0100 Subject: [PATCH] Debug recruitment module --- ...recruitment_recruitmentjobposition.lib.php | 10 +- ...> recruitmentjobposition_applications.php} | 123 +----------------- 2 files changed, 9 insertions(+), 124 deletions(-) rename htdocs/recruitment/{recruitmentjobposition_candidature.php => recruitmentjobposition_applications.php} (82%) diff --git a/htdocs/recruitment/lib/recruitment_recruitmentjobposition.lib.php b/htdocs/recruitment/lib/recruitment_recruitmentjobposition.lib.php index a5739a53153..dbf4ef5040c 100644 --- a/htdocs/recruitment/lib/recruitment_recruitmentjobposition.lib.php +++ b/htdocs/recruitment/lib/recruitment_recruitmentjobposition.lib.php @@ -41,10 +41,12 @@ function recruitmentjobpositionPrepareHead($object) $head[$h][2] = 'card'; $h++; - $head[$h][0] = dol_buildpath("/recruitment/recruitmentjobposition_candidature.php", 1).'?id='.$object->id; - $head[$h][1] = $langs->trans("Candidatures"); - $head[$h][2] = 'candidatures'; - $h++; + if ($conf->global->MAIN_FEATURES_LEVEL >= 1) { + $head[$h][0] = dol_buildpath("/recruitment/recruitmentjobposition_applications.php", 1).'?id='.$object->id; + $head[$h][1] = $langs->trans("Candidatures"); + $head[$h][2] = 'candidatures'; + $h++; + } if (isset($object->fields['note_public']) || isset($object->fields['note_private'])) { diff --git a/htdocs/recruitment/recruitmentjobposition_candidature.php b/htdocs/recruitment/recruitmentjobposition_applications.php similarity index 82% rename from htdocs/recruitment/recruitmentjobposition_candidature.php rename to htdocs/recruitment/recruitmentjobposition_applications.php index dbafdb3a423..381a3181485 100644 --- a/htdocs/recruitment/recruitmentjobposition_candidature.php +++ b/htdocs/recruitment/recruitmentjobposition_applications.php @@ -16,9 +16,9 @@ */ /** - * \file recruitmentjobposition_candidature.php + * \file recruitmentjobposition_applications.php * \ingroup recruitment - * \brief Page to see/add candidatures + * \brief Page to see/add applications of a job position */ //if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); // Do not create database handler $db @@ -438,124 +438,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print "\n"; } - - // Buttons for actions - - if ($action != 'presend' && $action != 'editline') { - print '
'."\n"; - $parameters = array(); - $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook - if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); - - if (empty($reshook)) - { - // Send - if (empty($user->socid)) { - print ''.$langs->trans('SendMail').''."\n"; - } - - // Back to draft - if ($object->status == $object::STATUS_VALIDATED) - { - if ($permissiontoadd) - { - print ''.$langs->trans("SetToDraft").''; - } - } - - // Modify - if ($permissiontoadd) - { - print ''.$langs->trans("Modify").''."\n"; - } else { - print ''.$langs->trans('Modify').''."\n"; - } - - // Validate - if ($object->status == $object::STATUS_DRAFT) - { - if ($permissiontoadd) - { - if (empty($object->table_element_line) || (is_array($object->lines) && count($object->lines) > 0)) - { - print ''.$langs->trans("Validate").''; - } else { - $langs->load("errors"); - print ''.$langs->trans("Validate").''; - } - } - } - - // Clone - if ($permissiontoadd) - { - print ''.$langs->trans("ToClone").''."\n"; - } - - /* - if ($permissiontoadd) - { - if ($object->status == $object::STATUS_ENABLED) - { - print ''.$langs->trans("Disable").''."\n"; - } - else - { - print ''.$langs->trans("Enable").''."\n"; - } - } - if ($permissiontoadd) - { - if ($object->status == $object::STATUS_VALIDATED) - { - print ''.$langs->trans("Cancel").''."\n"; - } - else - { - print ''.$langs->trans("Re-Open").''."\n"; - } - } - */ - - // Delete (need delete permission, or if draft, just need create/modify permission) - if ($permissiontodelete || ($object->status == $object::STATUS_DRAFT && $permissiontoadd)) - { - print ''.$langs->trans('Delete').''."\n"; - } else { - print ''.$langs->trans('Delete').''."\n"; - } - } - print '
'."\n"; - } - - - // Select mail models is same action as presend - if (GETPOST('modelselected')) { - $action = 'presend'; - } - - if ($action != 'presend') - { - print '
'; - print ''; // ancre - - - print '
'; - - - print '
'; - } - - //Select mail models is same action as presend - if (GETPOST('modelselected')) $action = 'presend'; - - // Presend form - $modelmail = 'recruitmentjobposition'; - $defaulttopic = 'InformationMessage'; - $diroutput = $conf->recruitment->dir_output; - $trackid = 'recruitmentjobposition'.$object->id; - - include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php'; + print '
'.$langs->trans("FeatureNotYetAvailable"); } // End of page