diff --git a/htdocs/recruitment/class/recruitmentcandidature.class.php b/htdocs/recruitment/class/recruitmentcandidature.class.php index 2657cece25a..ed7aa6f3934 100644 --- a/htdocs/recruitment/class/recruitmentcandidature.class.php +++ b/htdocs/recruitment/class/recruitmentcandidature.class.php @@ -224,7 +224,7 @@ class RecruitmentCandidature extends CommonObject */ public function __construct(DoliDB $db) { - global $conf, $langs; + global $langs; $this->db = $db; @@ -261,16 +261,6 @@ class RecruitmentCandidature extends CommonObject } } } - - if (GETPOST("action", "aZ09") == 'create') { - $reg = array(); - preg_match('/^(integer|link):(.*):(.*):(.*):(.*)/i', $this->fields['fk_recruitmentjobposition']['type'], $reg); - if (!empty($reg)) { - $this->fields['fk_recruitmentjobposition']['type'] .= " AND (t.status:=:1)"; - } else { - $this->fields['fk_recruitmentjobposition']['type'] .= ":(t.status:=:1)"; - } - } } /** diff --git a/htdocs/recruitment/recruitmentcandidature_card.php b/htdocs/recruitment/recruitmentcandidature_card.php index fe80fcb63de..b47557d5f45 100644 --- a/htdocs/recruitment/recruitmentcandidature_card.php +++ b/htdocs/recruitment/recruitmentcandidature_card.php @@ -97,6 +97,17 @@ $isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); $result = restrictedArea($user, 'recruitment', $object->id, 'recruitment_recruitmentcandidature', 'recruitmentjobposition', '', 'rowid', $isdraft); +if (GETPOST("action", "aZ09") == 'create') { + $reg = array(); + preg_match('/^(integer|link):(.*):(.*):(.*):(.*)/i', $object->fields['fk_recruitmentjobposition']['type'], $reg); + if (!empty($reg)) { + $object->fields['fk_recruitmentjobposition']['type'] .= " AND (t.status:=:1)"; + } else { + $object->fields['fk_recruitmentjobposition']['type'] .= ":(t.status:=:1)"; + } +} + + /* * Actions */