diff --git a/htdocs/public/recruitment/view.php b/htdocs/public/recruitment/view.php
index 8a751328e5a..b5576913d77 100644
--- a/htdocs/public/recruitment/view.php
+++ b/htdocs/public/recruitment/view.php
@@ -45,6 +45,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/security.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/public.lib.php';
+require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
/**
* @var Conf $conf
@@ -100,6 +101,8 @@ $object->fetch(0, $ref);
$user->loadDefaultValues();
$errmsg = "";
+$extrafields = new ExtraFields($db);
+
/*
* Actions
*/
@@ -174,6 +177,15 @@ if ($action == "dosubmit") { // Test on permission not required here (anonymous
$error++;
$errmsg .= implode('
', $candidature->errors);
}
+
+ // Fill array 'array_options' with data from add form
+ $extrafields->fetch_name_optionals_label($candidature->table_element);
+ $ret = $extrafields->setOptionalsFromPost(null, $candidature);
+ if ($ret < 0) {
+ $error++;
+ $errmsg .= $candidature->error;
+ }
+
if (!$error) {
$result = $candidature->create($user);
if ($result <= 0) {
@@ -415,6 +427,13 @@ if ($action != 'dosubmit') {
print '';
print ''."\n";
+ // Other attributes
+ $object = new RecruitmentCandidature($db);
+ $parameters['tpl_context'] = 'public'; // define template context to public
+ $parameters['tdclass'] = 'left';
+ $extrafields->fetch_name_optionals_label("recruitment_recruitmentcandidature");
+ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php';
+
print '