diff --git a/htdocs/accountancy/class/accountancyimport.class.php b/htdocs/accountancy/class/accountancyimport.class.php
index ece843515e2..ea88534b6ed 100644
--- a/htdocs/accountancy/class/accountancyimport.class.php
+++ b/htdocs/accountancy/class/accountancyimport.class.php
@@ -55,8 +55,8 @@ class AccountancyImport
$fieldname = $fieldArr[1];
}
- $debit = trim($arrayrecord[11]['val']);
- $credit = trim($arrayrecord[12]['val']);
+ $debit = floatval(trim($arrayrecord[11]['val']));
+ $credit = floatval(trim($arrayrecord[12]['val']));
if (!empty($debit)) {
$amount = $debit;
} else {
@@ -86,7 +86,7 @@ class AccountancyImport
$fieldname = $fieldArr[1];
}
- $debit = trim($arrayrecord[11]['val']);
+ $debit = floatval(trim($arrayrecord[11]['val']));
if (!empty($debit)) {
$sens = 'D';
} else {
diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php
index 58eeb2afd2b..a83a311010d 100644
--- a/htdocs/accountancy/class/bookkeeping.class.php
+++ b/htdocs/accountancy/class/bookkeeping.class.php
@@ -331,7 +331,7 @@ class BookKeeping extends CommonObject
if (empty($this->piece_num)) {
$sqlnum = "SELECT MAX(piece_num)+1 as maxpiecenum";
$sqlnum .= " FROM ".MAIN_DB_PREFIX.$this->table_element;
- $sqlnum .= " WHERE entity = ".$conf->entity; // Do not use getEntity for accounting features
+ $sqlnum .= " WHERE entity = " . ((int) $conf->entity); // Do not use getEntity for accounting features
$resqlnum = $this->db->query($sqlnum);
if ($resqlnum) {
@@ -745,7 +745,7 @@ class BookKeeping extends CommonObject
$sql .= " t.date_validated as date_validation";
$sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.$mode.' as t';
$sql .= ' WHERE 1 = 1';
- $sql .= " AND entity IN (".getEntity('accountancy').")";
+ $sql .= " AND entity = " . ((int) $conf->entity); // Do not use getEntity for accounting features
if (null !== $ref) {
$sql .= " AND t.ref = '".$this->db->escape($ref)."'";
} else {
@@ -890,7 +890,7 @@ class BookKeeping extends CommonObject
}
$sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' as t';
$sql .= ' WHERE 1 = 1';
- $sql .= " AND entity IN (".getEntity('accountancy').")";
+ $sql .= " AND entity = " . ((int) $conf->entity); // Do not use getEntity for accounting features
if (count($sqlwhere) > 0) {
$sql .= " AND ".implode(" ".$filtermode." ", $sqlwhere);
}
@@ -1046,7 +1046,7 @@ class BookKeeping extends CommonObject
}
}
}
- $sql .= ' WHERE t.entity IN ('.getEntity('accountancy').')';
+ $sql .= ' WHERE t.entity = ' . ((int) $conf->entity); // Do not use getEntity for accounting features
if ($showAlreadyExportMovements == 0) {
$sql .= " AND t.date_export IS NULL";
}
@@ -1166,7 +1166,7 @@ class BookKeeping extends CommonObject
}
}
}
- $sql .= ' WHERE entity IN ('.getEntity('accountancy').')';
+ $sql .= ' WHERE entity = ' . ((int) $conf->entity); // Do not use getEntity for accounting features
if (count($sqlwhere) > 0) {
$sql .= " AND ".implode(" ".$filtermode." ", $sqlwhere);
}
@@ -1464,7 +1464,7 @@ class BookKeeping extends CommonObject
*/
public function deleteByYearAndJournal($delyear = 0, $journal = '', $mode = '', $delmonth = 0)
{
- global $langs;
+ global $conf, $langs;
if (empty($delyear) && empty($journal)) {
$this->error = 'ErrorOneFieldRequired';
@@ -1485,7 +1485,7 @@ class BookKeeping extends CommonObject
if (!empty($journal)) {
$sql .= " AND code_journal = '".$this->db->escape($journal)."'";
}
- $sql .= " AND entity IN (".getEntity('accountancy').")";
+ $sql .= " AND entity = " . ((int) $conf->entity); // Do not use getEntity for accounting features
// Exclusion of validated entries at the time of deletion
$sql .= " AND date_validated IS NULL";
@@ -1524,7 +1524,7 @@ class BookKeeping extends CommonObject
$sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element;
$sql .= " WHERE piece_num = ".(int) $piecenum;
$sql .= " AND date_validated IS NULL"; // For security, exclusion of validated entries at the time of deletion
- $sql .= " AND entity IN (".getEntity('accountancy').")";
+ $sql .= " AND entity = " . ((int) $conf->entity); // Do not use getEntity for accounting features
$resql = $this->db->query($sql);
@@ -1646,7 +1646,7 @@ class BookKeeping extends CommonObject
}
$sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element.$mode;
$sql .= " WHERE piece_num = ".((int) $piecenum);
- $sql .= " AND entity IN (".getEntity('accountancy').")";
+ $sql .= " AND entity = " . ((int) $conf->entity); // Do not use getEntity for accounting features
dol_syslog(__METHOD__, LOG_DEBUG);
$result = $this->db->query($sql);
@@ -1684,9 +1684,10 @@ class BookKeeping extends CommonObject
global $conf;
$sql = "SELECT MAX(piece_num)+1 as max FROM ".MAIN_DB_PREFIX.$this->table_element.$mode;
- $sql .= " WHERE entity IN (".getEntity('accountancy').")";
+ $sql .= " WHERE entity = " . ((int) $conf->entity); // Do not use getEntity for accounting features
+
+ dol_syslog(get_class($this)."::getNextNumMvt", LOG_DEBUG);
- dol_syslog(get_class($this)."getNextNumMvt", LOG_DEBUG);
$result = $this->db->query($sql);
if ($result) {
@@ -1727,7 +1728,7 @@ class BookKeeping extends CommonObject
}
$sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element.$mode;
$sql .= " WHERE piece_num = ".((int) $piecenum);
- $sql .= " AND entity IN (".getEntity('accountancy').")";
+ $sql .= " AND entity = " . ((int) $conf->entity); // Do not use getEntity for accounting features
dol_syslog(__METHOD__, LOG_DEBUG);
$result = $this->db->query($sql);
@@ -1790,7 +1791,7 @@ class BookKeeping extends CommonObject
$sql .= " montant as amount, sens, fk_user_author, import_key, code_journal, piece_num,";
$sql .= " date_validated as date_validation";
$sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element;
- $sql .= " WHERE entity IN (".getEntity('accountancy').")";
+ $sql .= " WHERE entity = " . ((int) $conf->entity); // Do not use getEntity for accounting features
dol_syslog(get_class($this)."::export_bookkeeping", LOG_DEBUG);
@@ -1846,6 +1847,8 @@ class BookKeeping extends CommonObject
*/
public function transformTransaction($direction = 0, $piece_num = '')
{
+ global $conf;
+
$error = 0;
$this->db->begin();
@@ -1865,14 +1868,14 @@ class BookKeeping extends CommonObject
$sql .= ' doc_ref, fk_doc, fk_docdet, entity, thirdparty_code, subledger_account, subledger_label,';
$sql .= ' numero_compte, label_compte, label_operation, debit, credit,';
$sql .= ' montant, sens, fk_user_author, import_key, code_journal, journal_label, '.((int) $next_piecenum).", '".$this->db->idate($now)."'";
- $sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.'_tmp WHERE piece_num = '.((int) $piece_num);
+ $sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.'_tmp WHERE piece_num = '.((int) $piece_num).' AND entity = ' .((int) $conf->entity);
$resql = $this->db->query($sql);
if (!$resql) {
$error++;
$this->errors[] = 'Error '.$this->db->lasterror();
dol_syslog(__METHOD__.' '.join(',', $this->errors), LOG_ERR);
}
- $sql = 'DELETE FROM '.MAIN_DB_PREFIX.$this->table_element.'_tmp WHERE piece_num = '.((int) $piece_num);
+ $sql = 'DELETE FROM '.MAIN_DB_PREFIX.$this->table_element.'_tmp WHERE piece_num = '.((int) $piece_num).' AND entity = ' .((int) $conf->entity);
$resql = $this->db->query($sql);
if (!$resql) {
$error++;
@@ -1880,7 +1883,7 @@ class BookKeeping extends CommonObject
dol_syslog(__METHOD__.' '.join(',', $this->errors), LOG_ERR);
}
} elseif ($direction == 1) {
- $sql = 'DELETE FROM '.MAIN_DB_PREFIX.$this->table_element.'_tmp WHERE piece_num = '.((int) $piece_num);
+ $sql = 'DELETE FROM '.MAIN_DB_PREFIX.$this->table_element.'_tmp WHERE piece_num = '.((int) $piece_num).' AND entity = ' .((int) $conf->entity);
$resql = $this->db->query($sql);
if (!$resql) {
$error++;
@@ -1895,14 +1898,14 @@ class BookKeeping extends CommonObject
$sql .= ' doc_ref, fk_doc, fk_docdet, thirdparty_code, subledger_account, subledger_label,';
$sql .= ' numero_compte, label_compte, label_operation, debit, credit,';
$sql .= ' montant, sens, fk_user_author, import_key, code_journal, journal_label, piece_num';
- $sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' WHERE piece_num = '.((int) $piece_num);
+ $sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' WHERE piece_num = '.((int) $piece_num).' AND entity = ' .((int) $conf->entity);
$resql = $this->db->query($sql);
if (!$resql) {
$error++;
$this->errors[] = 'Error '.$this->db->lasterror();
dol_syslog(__METHOD__.' '.join(',', $this->errors), LOG_ERR);
}
- $sql = 'DELETE FROM '.MAIN_DB_PREFIX.$this->table_element.'_tmp WHERE piece_num = '.((int) $piece_num);
+ $sql = 'DELETE FROM '.MAIN_DB_PREFIX.$this->table_element.'_tmp WHERE piece_num = '.((int) $piece_num).' AND entity = ' .((int) $conf->entity);
$resql = $this->db->query($sql);
if (!$resql) {
$error++;
@@ -1957,7 +1960,7 @@ class BookKeeping extends CommonObject
$sql .= " AND aa.active = 1";
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."accounting_system as asy ON aa.fk_pcg_version = asy.pcg_version";
$sql .= " AND asy.rowid = ".((int) $pcgver);
- $sql .= " AND ab.entity IN (".getEntity('accountancy').")";
+ $sql .= " AND ab.entity = " . ((int) $conf->entity); // Do not use getEntity for accounting features
$sql .= " ORDER BY account_number ASC";
dol_syslog(get_class($this)."::select_account", LOG_DEBUG);
@@ -2021,7 +2024,7 @@ class BookKeeping extends CommonObject
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as parent ON aa.account_parent = parent.rowid AND parent.active = 1";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as root ON parent.account_parent = root.rowid AND root.active = 1";
$sql .= " WHERE aa.account_number = '".$this->db->escape($account)."'";
- $sql .= " AND aa.entity IN (".getEntity('accountancy').")";
+ $sql .= " AND aa.entity = " . ((int) $conf->entity); // Do not use getEntity for accounting features
dol_syslog(get_class($this)."::select_account", LOG_DEBUG);
$resql = $this->db->query($sql);
@@ -2061,7 +2064,7 @@ class BookKeeping extends CommonObject
$sql .= " AND asy.rowid = ".((int) $pcgver);
$sql .= " AND aa.active = 1";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_accounting_category as cat ON aa.fk_accounting_category = cat.rowid";
- $sql .= " WHERE aa.entity IN (".getEntity('accountancy').")";
+ $sql .= " WHERE aa.entity = " . ((int) $conf->entity); // Do not use getEntity for accounting features
dol_syslog(get_class($this)."::select_account", LOG_DEBUG);
$resql = $this->db->query($sql);
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/compta/stats/cabyprodserv.php b/htdocs/compta/stats/cabyprodserv.php
index 084516c52df..e201d403bf4 100644
--- a/htdocs/compta/stats/cabyprodserv.php
+++ b/htdocs/compta/stats/cabyprodserv.php
@@ -455,7 +455,7 @@ if ($modecompta == 'CREANCES-DETTES') {
$_SERVER["PHP_SELF"],
"amount",
"",
- $classslink,
+ $paramslink,
'class="right"',
$sortfield,
$sortorder
diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php
index 732be0937d0..31c33716233 100644
--- a/htdocs/core/class/extrafields.class.php
+++ b/htdocs/core/class/extrafields.class.php
@@ -1558,7 +1558,7 @@ class ExtraFields
} elseif ($type == 'price') {
//$value = price($value, 0, $langs, 0, 0, -1, $conf->currency);
if ($value || $value == '0') {
- $value = price($value, 0, $langs, 0, 0, -1);
+ $value = price($value, 0, $langs, 0, $conf->global->MAIN_MAX_DECIMALS_TOT, -1).' '.$langs->getCurrencySymbol($conf->currency);
}
} elseif ($type == 'select') {
$valstr = (!empty($param['options'][$value]) ? $param['options'][$value] : '');
diff --git a/htdocs/core/modules/import/import_csv.modules.php b/htdocs/core/modules/import/import_csv.modules.php
index 9eeb76cc3cf..781c22ce7e3 100644
--- a/htdocs/core/modules/import/import_csv.modules.php
+++ b/htdocs/core/modules/import/import_csv.modules.php
@@ -736,6 +736,29 @@ class ImportCsv extends ModeleImports
$tmp = explode('-', $val, 2);
$listfields[] = preg_replace('/^'.preg_quote($alias, '/').'\./', '', $key);
$listvalues[] = "'".$this->db->escape($tmp[1])."'";
+ } elseif (preg_match('/^rule-/', $val)) {
+ $fieldname = $key;
+ if (!empty($objimport->array_import_convertvalue[0][$fieldname])) {
+ if ($objimport->array_import_convertvalue[0][$fieldname]['rule'] == 'compute') {
+ $file = (empty($objimport->array_import_convertvalue[0][$fieldname]['classfile']) ? $objimport->array_import_convertvalue[0][$fieldname]['file'] : $objimport->array_import_convertvalue[0][$fieldname]['classfile']);
+ $class = $objimport->array_import_convertvalue[0][$fieldname]['class'];
+ $method = $objimport->array_import_convertvalue[0][$fieldname]['method'];
+ $resultload = dol_include_once($file);
+ if (empty($resultload)) {
+ dol_print_error('', 'Error trying to call file=' . $file . ', class=' . $class . ', method=' . $method);
+ break;
+ }
+ $classinstance = new $class($this->db);
+ $res = call_user_func_array(array($classinstance, $method), array(&$arrayrecord, $fieldname, &$listfields, &$listvalues));
+ if ($res < 0) {
+ if (!empty($objimport->array_import_convertvalue[0][$fieldname]['dict'])) $this->errors[$error]['lib'] = $langs->trans('ErrorFieldValueNotIn', $key, end($listvalues), 'code', $langs->transnoentitiesnoconv($objimport->array_import_convertvalue[0][$fieldname]['dict']));
+ else $this->errors[$error]['lib'] = 'ErrorFieldValueNotIn';
+ $this->errors[$error]['type'] = 'FOREIGNKEY';
+ $errorforthistable++;
+ $error++;
+ }
+ }
+ }
} else {
$this->errors[$error]['lib'] = 'Bad value of profile setup '.$val.' for array_import_fieldshidden';
$this->errors[$error]['type'] = 'Import profile setup';
diff --git a/htdocs/core/modules/import/import_xlsx.modules.php b/htdocs/core/modules/import/import_xlsx.modules.php
index 0171eb83ea9..1c38f52cbfc 100644
--- a/htdocs/core/modules/import/import_xlsx.modules.php
+++ b/htdocs/core/modules/import/import_xlsx.modules.php
@@ -776,7 +776,30 @@ class ImportXlsx extends ModeleImports
} elseif (preg_match('/^const-/', $val)) {
$tmp = explode('-', $val, 2);
$listfields[] = preg_replace('/^' . preg_quote($alias, '/') . '\./', '', $key);
- $listvalues[] = "'" . $this->db->escape($tmp[1]) . "'";
+ $listvalues[] = "'".$this->db->escape($tmp[1])."'";
+ } elseif (preg_match('/^rule-/', $val)) {
+ $fieldname = $key;
+ if (!empty($objimport->array_import_convertvalue[0][$fieldname])) {
+ if ($objimport->array_import_convertvalue[0][$fieldname]['rule'] == 'compute') {
+ $file = (empty($objimport->array_import_convertvalue[0][$fieldname]['classfile']) ? $objimport->array_import_convertvalue[0][$fieldname]['file'] : $objimport->array_import_convertvalue[0][$fieldname]['classfile']);
+ $class = $objimport->array_import_convertvalue[0][$fieldname]['class'];
+ $method = $objimport->array_import_convertvalue[0][$fieldname]['method'];
+ $resultload = dol_include_once($file);
+ if (empty($resultload)) {
+ dol_print_error('', 'Error trying to call file=' . $file . ', class=' . $class . ', method=' . $method);
+ break;
+ }
+ $classinstance = new $class($this->db);
+ $res = call_user_func_array(array($classinstance, $method), array(&$arrayrecord, $fieldname, &$listfields, &$listvalues));
+ if ($res < 0) {
+ if (!empty($objimport->array_import_convertvalue[0][$fieldname]['dict'])) $this->errors[$error]['lib'] = $langs->trans('ErrorFieldValueNotIn', $key, end($listvalues), 'code', $langs->transnoentitiesnoconv($objimport->array_import_convertvalue[0][$fieldname]['dict']));
+ else $this->errors[$error]['lib'] = 'ErrorFieldValueNotIn';
+ $this->errors[$error]['type'] = 'FOREIGNKEY';
+ $errorforthistable++;
+ $error++;
+ }
+ }
+ }
} else {
$this->errors[$error]['lib'] = 'Bad value of profile setup ' . $val . ' for array_import_fieldshidden';
$this->errors[$error]['type'] = 'Import profile setup';
diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php
index 59c3a57c4ac..e5cc12fe1c4 100644
--- a/htdocs/fourn/commande/list.php
+++ b/htdocs/fourn/commande/list.php
@@ -1532,9 +1532,7 @@ if ($resql) {
$projectstatic = new Project($db);
$i = 0;
- $totalarray = array();
- $totalarray['nbfield'] = 0;
- $totalarray['val'] = array();
+ $totalarray = array('nbfield' => 0, 'val' => array(), 'pos' => array());
$totalarray['val']['cf.total_ht'] = 0;
$totalarray['val']['cf.total_ttc'] = 0;
while ($i < min($num, $limit)) {
diff --git a/htdocs/hrm/class/position.class.php b/htdocs/hrm/class/position.class.php
index 8c51d667f9e..f83fa5901d8 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,77 @@ 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.
+ * @param int $nonewbutton Do not show new button
+ * @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 +1143,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/imports/import.php b/htdocs/imports/import.php
index 41059a45e92..01f152f1ea5 100644
--- a/htdocs/imports/import.php
+++ b/htdocs/imports/import.php
@@ -141,6 +141,7 @@ $endatlinenb = (GETPOST('endatlinenb') ? GETPOST('endatlinenb') : '');
$updatekeys = (GETPOST('updatekeys', 'array') ? GETPOST('updatekeys', 'array') : array());
$separator = (GETPOST('separator', 'nohtml') ? GETPOST('separator', 'nohtml') : (!empty($conf->global->IMPORT_CSV_SEPARATOR_TO_USE) ? $conf->global->IMPORT_CSV_SEPARATOR_TO_USE : ','));
$enclosure = (GETPOST('enclosure', 'nohtml') ? GETPOST('enclosure', 'nohtml') : '"');
+$separator_used = str_replace('\t', "\t", $separator);
$objimport = new Import($db);
$objimport->load_arrays($user, ($step == 1 ? '' : $datatoimport));
@@ -773,7 +774,7 @@ if ($step == 4 && $datatoimport) {
require_once $dir.$file;
$obj = new $classname($db, $datatoimport);
if ($model == 'csv') {
- $obj->separator = $separator;
+ $obj->separator = $separator_used;
$obj->enclosure = $enclosure;
}
if ($model == 'xlsx') {
@@ -1334,7 +1335,7 @@ if ($step == 5 && $datatoimport) {
require_once $dir.$file;
$obj = new $classname($db, $datatoimport);
if ($model == 'csv') {
- $obj->separator = $separator;
+ $obj->separator = $separator_used;
$obj->enclosure = $enclosure;
}
@@ -1783,7 +1784,7 @@ if ($step == 6 && $datatoimport) {
require_once $dir.$file;
$obj = new $classname($db, $datatoimport);
if ($model == 'csv') {
- $obj->separator = $separator;
+ $obj->separator = $separator_used;
$obj->enclosure = $enclosure;
}
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 '';
diff --git a/htdocs/user/param_ihm.php b/htdocs/user/param_ihm.php
index 80f83732906..bb1320ecd0b 100644
--- a/htdocs/user/param_ihm.php
+++ b/htdocs/user/param_ihm.php
@@ -207,6 +207,9 @@ if (!empty($conf->adherent->enabled)) {
if (!empty($conf->agenda->enabled)) {
$tmparray['comm/action/index.php?mainmenu=agenda&leftmenu='] = 'Agenda';
}
+if (!empty($conf->ticket->enabled)) {
+ $tmparray['ticket/list.php?mainmenu=ticket&leftmenu='] = 'Tickets';
+}
$head = user_prepare_head($object);