';
foreach ($SkilldetRecords as $sk) {
- if ($sk->rank > $MaxNumberSkill) {
+ if ($sk->rankorder > $MaxNumberSkill) {
continue;
}
@@ -291,7 +291,7 @@ if (($id || $ref) && $action == 'edit') {
// if (!empty($val['help'])) {
// print $form->textwithpicto($langs->trans($val['label']), $langs->trans($val['help']));
// } else {
- print $langs->trans($val['label']).' '.$langs->trans('rank').' '.$sk->rank;
+ print $langs->trans($val['label']).' '.$langs->trans('rank').' '.$sk->rankorder;
// }
print '';
print '| ';
@@ -696,7 +696,7 @@ if ($action != "create" && $action != "edit") {
break; // Should not happen
}
- if ($obj->rank > $MaxNumberSkill) {
+ if ($obj->rankorder > $MaxNumberSkill) {
continue;
}
diff --git a/htdocs/install/mysql/migration/14.0.0-15.0.0.sql b/htdocs/install/mysql/migration/14.0.0-15.0.0.sql
index f383c706653..476e63aab68 100644
--- a/htdocs/install/mysql/migration/14.0.0-15.0.0.sql
+++ b/htdocs/install/mysql/migration/14.0.0-15.0.0.sql
@@ -292,7 +292,7 @@ CREATE TABLE llx_hrm_job_user(
date_creation datetime NOT NULL,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_contrat integer,
- fk_user integer NOT NULL,
+ fk_user integer,
fk_job integer NOT NULL,
date_start date,
date_end date,
diff --git a/htdocs/install/mysql/tables/llx_hrm_job_user-hrm.sql b/htdocs/install/mysql/tables/llx_hrm_job_user-hrm.sql
index 33906d1607f..4e10bf64bf8 100644
--- a/htdocs/install/mysql/tables/llx_hrm_job_user-hrm.sql
+++ b/htdocs/install/mysql/tables/llx_hrm_job_user-hrm.sql
@@ -23,7 +23,7 @@ CREATE TABLE llx_hrm_job_user(
date_creation datetime NOT NULL,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_contrat integer,
- fk_user integer NOT NULL,
+ fk_user integer,
fk_job integer NOT NULL,
date_start datetime,
date_end datetime,
diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang
index 47daec0851b..1bf5233f660 100644
--- a/htdocs/langs/en_US/admin.lang
+++ b/htdocs/langs/en_US/admin.lang
@@ -2216,4 +2216,5 @@ NativeModules=Native modules
NoDeployedModulesFoundWithThisSearchCriteria=No modules found for these search criteria
API_DISABLE_COMPRESSION=Disable compression of API responses
EachTerminalHasItsOwnCounter=Each terminal use its own counter.
-FillAndSaveAccountIdAndSecret=Fill and save account ID and secret first
\ No newline at end of file
+FillAndSaveAccountIdAndSecret=Fill and save account ID and secret first
+PreviousHash=Previous hash
\ No newline at end of file
diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php
index d0b27caf326..87a66279714 100644
--- a/htdocs/projet/class/task.class.php
+++ b/htdocs/projet/class/task.class.php
@@ -800,9 +800,10 @@ class Task extends CommonObject
* @param array $extrafields Show additional column from project or task
* @param int $includebilltime Calculate also the time to bill and billed
* @param array $search_array_options Array of search
+ * @param int $loadextras Fetch all Extrafields on each task
* @return array Array of tasks
*/
- public function getTasksArray($usert = null, $userp = null, $projectid = 0, $socid = 0, $mode = 0, $filteronproj = '', $filteronprojstatus = '-1', $morewherefilter = '', $filteronprojuser = 0, $filterontaskuser = 0, $extrafields = array(), $includebilltime = 0, $search_array_options = array())
+ public function getTasksArray($usert = null, $userp = null, $projectid = 0, $socid = 0, $mode = 0, $filteronproj = '', $filteronprojstatus = '-1', $morewherefilter = '', $filteronprojuser = 0, $filterontaskuser = 0, $extrafields = array(), $includebilltime = 0, $search_array_options = array(), $loadextras = 0)
{
global $conf, $hookmanager;
@@ -1022,6 +1023,10 @@ class Task extends CommonObject
}
}
}
+
+ if ($loadextras) {
+ $tasks[$i]->fetch_optionals();
+ }
}
$i++;
diff --git a/htdocs/ticket/agenda.php b/htdocs/ticket/agenda.php
index 66cbe8e7290..9a4af31014a 100644
--- a/htdocs/ticket/agenda.php
+++ b/htdocs/ticket/agenda.php
@@ -80,7 +80,6 @@ if (!$action) {
// Security check
$id = GETPOST("id", 'int');
-$socid = 0;
if ($user->socid > 0) $socid = $user->socid;
$result = restrictedArea($user, 'ticket', $id, '');
diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php
index 0af211d8a5c..690bcb5cad2 100755
--- a/htdocs/ticket/card.php
+++ b/htdocs/ticket/card.php
@@ -115,7 +115,6 @@ if ($id || $track_id || $ref) {
$url_page_current = DOL_URL_ROOT.'/ticket/card.php';
// Security check - Protection if external user
-$socid = 0;
if ($user->socid > 0) $socid = $user->socid;
$result = restrictedArea($user, 'ticket', $object->id);
diff --git a/htdocs/ticket/contact.php b/htdocs/ticket/contact.php
index d31469f13f2..093aaf5de1e 100644
--- a/htdocs/ticket/contact.php
+++ b/htdocs/ticket/contact.php
@@ -61,7 +61,6 @@ $permissiontoadd = $user->rights->ticket->write;
// Security check
$id = GETPOST("id", 'int');
-$socid = 0;
if ($user->socid > 0) $socid = $user->socid;
$result = restrictedArea($user, 'ticket', $object->id, '');
diff --git a/htdocs/ticket/messaging.php b/htdocs/ticket/messaging.php
index 61291836cdb..292fff329ad 100644
--- a/htdocs/ticket/messaging.php
+++ b/htdocs/ticket/messaging.php
@@ -80,7 +80,6 @@ $permissiontoadd = $user->rights->ticket->write;
// Security check
$id = GETPOST("id", 'int');
-$socid = 0;
if ($user->socid > 0) $socid = $user->socid;
$result = restrictedArea($user, 'ticket', $object->id, '');
diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php
index b8aca57b38c..51a65ca8b80 100644
--- a/htdocs/user/class/user.class.php
+++ b/htdocs/user/class/user.class.php
@@ -1149,9 +1149,12 @@ class User extends CommonObject
$sql .= " AND r.entity = ".((int) $conf->entity);
}
} else {
- $sql .= " AND gr.entity = ".((int) $conf->entity);
- $sql .= " AND gu.entity = ".((int) $conf->entity);
- $sql .= " AND r.entity = ".((int) $conf->entity);
+ $sql .= " AND gr.entity = ".((int) $conf->entity); // Only groups created in current entity
+ // The entity on the table usergroup_user should be useless and shoumd never be used because it is alreay into gr and r.
+ // but when using MULTICOMPANY_TRANSVERSE_MODE, we may insert record that make rubbish result due to duplicate record of
+ // other entities, so we are forced to add a filter here
+ $sql .= " AND gu.entity IN (0,".$conf->entity.")";
+ $sql .= " AND r.entity = ".((int) $conf->entity); // Only permission of modules enabled in current entity
}
$sql .= " AND gr.fk_usergroup = gu.fk_usergroup";
$sql .= " AND gu.fk_user = ".((int) $this->id);
|