From 5791048fa6654731da11bdb539b607c75038e390 Mon Sep 17 00:00:00 2001 From: Christian Foellmann Date: Mon, 22 Aug 2022 13:57:18 +0200 Subject: [PATCH] improve security by always loading --- .../recruitmentcandidature_card.php | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/htdocs/recruitment/recruitmentcandidature_card.php b/htdocs/recruitment/recruitmentcandidature_card.php index 9e2f6be9398..1a3b9a131f3 100644 --- a/htdocs/recruitment/recruitmentcandidature_card.php +++ b/htdocs/recruitment/recruitmentcandidature_card.php @@ -257,12 +257,18 @@ $form = new Form($db); $formfile = new FormFile($db); $formproject = new FormProjets($db); +if ($action == 'create') { + $title = $langs->trans('NewCandidature'); + $help_url = ''; +} else { + $title = $object->ref." - ".$langs->trans('Card'); + $help_url = ''; +} + +llxHeader('', $title, $help_url); // Part to create if ($action == 'create') { - $title = $langs->trans('NewCandidature'); - $help_url = ''; - llxHeader('', $title, $help_url); print load_fiche_titre($langs->trans("NewObject", $langs->transnoentitiesnoconv("RecruitmentCandidature")), '', 'object_'.$object->picto); @@ -299,9 +305,6 @@ if ($action == 'create') { // Part to edit record if (($id || $ref) && $action == 'edit') { - $title = $object->ref." - ".$langs->trans('Card'); - $help_url = ''; - llxHeader('', $title, $help_url); print load_fiche_titre($langs->trans("RecruitmentCandidature"), '', 'object_'.$object->picto); @@ -339,10 +342,6 @@ if (($id || $ref) && $action == 'edit') { if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create'))) { $res = $object->fetch_optionals(); - $title = $object->ref." - ".$langs->trans('Card'); - $help_url = ''; - llxHeader('', $title, $help_url); - $head = recruitmentcandidaturePrepareHead($object); print dol_get_fiche_head($head, 'card', $langs->trans("RecruitmentCandidature"), -1, $object->picto);