diff --git a/htdocs/compta/prelevement/card.php b/htdocs/compta/prelevement/card.php
index d4311abe112..a076299b4cd 100644
--- a/htdocs/compta/prelevement/card.php
+++ b/htdocs/compta/prelevement/card.php
@@ -238,7 +238,14 @@ if ($id > 0 || $ref) {
$modulepart = 'paymentbybanktransfer';
}
print ''.$relativepath.'';
- print '';
+ print '';
+
+ // Other attributes
+ $parameters = array();
+ $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
+ print $hookmanager->resPrint;
+
+ print '';
print '';
diff --git a/htdocs/hrm/class/position.class.php b/htdocs/hrm/class/position.class.php
index 2401791bb5f..d9df0624b0b 100644
--- a/htdocs/hrm/class/position.class.php
+++ b/htdocs/hrm/class/position.class.php
@@ -109,7 +109,7 @@ class Position extends CommonObject
'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>'1', 'position'=>500, 'notnull'=>1, 'visible'=>-2,),
'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>'1', 'position'=>501, 'notnull'=>0, 'visible'=>-2,),
'fk_contrat' => array('type'=>'integer:Contrat:contrat/class/contrat.class.php', 'label'=>'fk_contrat', 'enabled'=>'1', 'position'=>50, 'notnull'=>0, 'visible'=>0,),
- 'fk_user' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'Employee', 'enabled'=>'1', 'position'=>55, 'notnull'=>0, 'visible'=>1,),
+ 'fk_user' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'Employee', 'enabled'=>'1', 'position'=>55, 'notnull'=>1, 'visible'=>1, 'default'=>0),
'fk_job' => array('type'=>'integer:Job:/hrm/class/job.class.php', 'label'=>'Job', 'enabled'=>'1', 'position'=>56, 'notnull'=>1, 'visible'=>1,),
'date_start' => array('type'=>'date', 'label'=>'DateStart', 'enabled'=>'1', 'position'=>51, 'notnull'=>1, 'visible'=>1,),
'date_end' => array('type'=>'date', 'label'=>'DateEnd', 'enabled'=>'1', 'position'=>52, 'notnull'=>0, 'visible'=>1,),
@@ -843,6 +843,76 @@ class Position extends CommonObject
}
/**
+ * Return HTML string to put an input field into a page
+ * Code very similar with showInputField of extra fields
+ *
+ * @param array $val Array of properties for field to show
+ * @param string $key Key of attribute
+ * @param string $value Preselected value to show (for date type it must be in timestamp format, for amount or price it must be a php numeric value)
+ * @param string $moreparam To add more parameters on html input tag
+ * @param string $keysuffix Prefix string to add into name and id of field (can be used to avoid duplicate names)
+ * @param string $keyprefix Suffix string to add into name and id of field (can be used to avoid duplicate names)
+ * @param string|int $morecss Value for css to define style/length of field. May also be a numeric.
+ * @return string
+ */
+ public function showInputField($val, $key, $value, $moreparam = '', $keysuffix = '', $keyprefix = '', $morecss = 0, $nonewbutton = 0)
+ {
+ global $langs;
+
+ if ($key == 'fk_user') {
+ $vacantId = $keyprefix.$key.'vacant'.$keysuffix;
+
+ $out = parent::showInputField($val, $key, $value, $moreparam, $keysuffix, $keyprefix, $morecss);
+ $out .= '';
+
+ ?>
+
+ fk_user == 0) {
+ return $langs->trans("VacantPosition");
+ }
+ return parent::showOutputField($val, $key, $value, $moreparam, $keysuffix, $keyprefix, $morecss);
+ }
+
+
+ /**
* Load the info information in the object
*
* @param int $id Id of object
@@ -1072,7 +1142,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/class/commonobjectline.class.php';
class PositionLine extends CommonObjectLine
{
// To complete with content of an object PositionLine
- // We should have a field rowid, fk_position and position
+ // We should have a field rowid , fk_position and position
/**
* @var int Does object support extrafields ? 0=No, 1=Yes
diff --git a/htdocs/hrm/position_list.php b/htdocs/hrm/position_list.php
index d6ed72c2612..1585ed1e03f 100644
--- a/htdocs/hrm/position_list.php
+++ b/htdocs/hrm/position_list.php
@@ -270,6 +270,10 @@ foreach ($search as $key => $val) {
}
}
}
+$vacant = GETPOST('search_fk_uservacant', 'alphanohtml') === 'on';
+if ($vacant) {
+ $sql .= ' AND t.fk_user = 0';
+}
if ($search_all) {
$sql .= natural_search(array_keys($fieldstosearchall), $search_all);
}
diff --git a/htdocs/langs/en_US/hrm.lang b/htdocs/langs/en_US/hrm.lang
index c571ec6ca8a..ab3628026c5 100644
--- a/htdocs/langs/en_US/hrm.lang
+++ b/htdocs/langs/en_US/hrm.lang
@@ -79,3 +79,6 @@ NoEval=No evaluation done for this employee
HowManyUserWithThisMaxNote=Number of users with this rank
HighestRank=Highest rank
SkillComparison=Skill comparison
+ActionsOnJob=Events on this job
+VacantPosition=job vacancy
+VacantCheckboxHelper=Checking this option will show unfilled positions (job vacancy)
diff --git a/htdocs/langs/fr_FR/hrm.lang b/htdocs/langs/fr_FR/hrm.lang
index cab3c7c11af..dca9ca4deb6 100644
--- a/htdocs/langs/fr_FR/hrm.lang
+++ b/htdocs/langs/fr_FR/hrm.lang
@@ -79,4 +79,6 @@ NoEval=Aucune évaluation effectuée pour cet employé
HowManyUserWithThisMaxNote=Nombre d'employés avec ce niveau
HighestRank=Plus haut niveau
SkillComparison=Comparaison des compétences
-ActionsOnJob=Événements sur cet emploi
\ No newline at end of file
+ActionsOnJob=Événements sur cet emploi
+VacantPosition=Poste vacant
+VacantCheckboxHelper=Cocher cette option affichera le(s) poste(s) comme non pourvu(s)
diff --git a/htdocs/loan/card.php b/htdocs/loan/card.php
index 88701e35166..4bc539c1ff0 100644
--- a/htdocs/loan/card.php
+++ b/htdocs/loan/card.php
@@ -618,6 +618,11 @@ if ($id > 0) {
}
print '';
+ // Other attributes
+ $parameters = array();
+ $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
+ print $hookmanager->resPrint;
+
print '';
print '';
diff --git a/htdocs/opensurvey/card.php b/htdocs/opensurvey/card.php
index 773571b7b1c..3f822679350 100644
--- a/htdocs/opensurvey/card.php
+++ b/htdocs/opensurvey/card.php
@@ -54,6 +54,9 @@ if ($result <= 0) {
exit;
}
+// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
+$hookmanager->initHooks(array('surveycard', 'globalcard'));
+
$expiredate = dol_mktime(0, 0, 0, GETPOST('expiremonth'), GETPOST('expireday'), GETPOST('expireyear'));
@@ -338,6 +341,11 @@ if ($action != 'edit') {
print '';
+// Other attributes
+$parameters = array();
+$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
+print $hookmanager->resPrint;
+
print '';
print '';