diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php
index 773638a5b79..f2463804e32 100644
--- a/htdocs/core/class/extrafields.class.php
+++ b/htdocs/core/class/extrafields.class.php
@@ -1860,7 +1860,7 @@ class ExtraFields
}
}
}
- $value = '
'.implode(' ', $toprint).'
';
+ if (!empty($toprint)) $value = ''.implode(' ', $toprint).'
';
} else {
dol_syslog(get_class($this).'::showOutputField error '.$this->db->lasterror(), LOG_WARNING);
}
diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php
index cc99471a69f..03c1aa4afdf 100644
--- a/htdocs/core/lib/company.lib.php
+++ b/htdocs/core/lib/company.lib.php
@@ -835,12 +835,12 @@ function show_projects($conf, $langs, $db, $object, $backtopage = '', $nocreatel
print '';
// Ref
- print '| ';
+ print ' | ';
print $projecttmp->getNomUrl(1);
print ' | ';
// Label
- print ''.$obj->title.' | ';
+ print ''.dol_escape_htmltag($obj->title).' | ';
// Date start
print ''.dol_print_date($db->jdate($obj->do), "day").' | ';
// Date end
diff --git a/htdocs/hrm/admin/admin_establishment.php b/htdocs/hrm/admin/admin_establishment.php
index bf1886f4bca..223f8a720d5 100644
--- a/htdocs/hrm/admin/admin_establishment.php
+++ b/htdocs/hrm/admin/admin_establishment.php
@@ -40,6 +40,24 @@ $permissiontoadd = $user->admin;
if (empty($conf->hrm->enabled)) accessforbidden();
if (empty($permissiontoread)) accessforbidden();
+$sortorder = GETPOST('sortorder', 'aZ09comma');
+$sortfield = GETPOST('sortfield', 'aZ09comma');
+if (!$sortorder) {
+ $sortorder = "DESC";
+}
+if (!$sortfield) {
+ $sortfield = "e.rowid";
+}
+
+if (empty($page) || $page == -1) {
+ $page = 0;
+}
+
+$offset = $limit * $page;
+$pageprev = $page - 1;
+$pagenext = $page + 1;
+$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
+
/*
* Actions
@@ -59,46 +77,50 @@ $title = $langs->trans('Establishments');
llxHeader('', $title, '');
-$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
-$sortorder = GETPOST('sortorder', 'aZ09comma');
-$sortfield = GETPOST('sortfield', 'aZ09comma');
-if (!$sortorder) {
- $sortorder = "DESC";
-}
-if (!$sortfield) {
- $sortfield = "e.rowid";
-}
-
-if (empty($page) || $page == -1) {
- $page = 0;
-}
-
-$offset = $limit * $page;
-$pageprev = $page - 1;
-$pagenext = $page + 1;
-$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
// Subheader
$linkback = ''.$langs->trans("BackToModuleList").'';
print load_fiche_titre($langs->trans("HRMSetup"), $linkback, 'title_setup');
-$newcardbutton = dolGetButtonTitle($langs->trans('NewEstablishment'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/hrm/establishment/card.php?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $permissiontoadd);
// Configuration header
$head = hrmAdminPrepareHead();
-print dol_get_fiche_head($head, 'establishments', $langs->trans("HRM"), -1, "user", 0, $newcardbutton);
+print dol_get_fiche_head($head, 'establishments', $langs->trans("HRM"), -1, "hrm", 0, '');
+
+$param = '';
$sql = "SELECT e.rowid, e.rowid as ref, e.label, e.address, e.zip, e.town, e.status";
$sql .= " FROM ".MAIN_DB_PREFIX."establishment as e";
$sql .= " WHERE e.entity IN (".getEntity('establishment').')';
+
+// Count total nb of records
+$nbtotalofrecords = '';
+if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
+ $resql = $db->query($sql);
+ $nbtotalofrecords = $db->num_rows($resql);
+
+ if (($page * $limit) > $nbtotalofrecords) { // if total of record found is smaller than page * limit, goto and load page 0
+ $page = 0;
+ $offset = 0;
+ }
+ $db->free($resql);
+}
+
$sql .= $db->order($sortfield, $sortorder);
$sql .= $db->plimit($limit + 1, $offset);
+
+$newcardbutton = dolGetButtonTitle($langs->trans('NewEstablishment'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/hrm/establishment/card.php?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $permissiontoadd);
+
+print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', 0, $nbtotalofrecords, '', 0, $newcardbutton, '', $limit, 0, 0, 1);
+
+
$result = $db->query($sql);
if ($result) {
$num = $db->num_rows($result);
$i = 0;
+ print ''; // You can use div-table-responsive-no-min if you dont need reserved height for your table
print '
';
print '';
print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "e.ref", "", "", "", $sortfield, $sortorder);
@@ -139,6 +161,7 @@ if ($result) {
}
print '
';
+ print '
';
} else {
dol_print_error($db);
}
diff --git a/htdocs/hrm/admin/evaluation_extrafields.php b/htdocs/hrm/admin/evaluation_extrafields.php
index 771dfc46e99..6513ea311e3 100644
--- a/htdocs/hrm/admin/evaluation_extrafields.php
+++ b/htdocs/hrm/admin/evaluation_extrafields.php
@@ -27,33 +27,7 @@
*/
// Load Dolibarr environment
-$res = 0;
-// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined)
-if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) {
- $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php";
-}
-// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
-$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1;
-while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) {
- $i--; $j--;
-}
-if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) {
- $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php";
-}
-if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) {
- $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php";
-}
-// Try main.inc.php using relative path
-if (!$res && file_exists("../../main.inc.php")) {
- $res = @include "../../main.inc.php";
-}
-if (!$res && file_exists("../../../main.inc.php")) {
- $res = @include "../../../main.inc.php";
-}
-if (!$res) {
- die("Include of main fails");
-}
-
+require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
require_once '../lib/hrm.lib.php';
@@ -105,7 +79,7 @@ print load_fiche_titre($langs->trans($page_name), $linkback, 'title_setup');
$head = hrmAdminPrepareHead();
-print dol_get_fiche_head($head, 'evaluationsAttributes', $langs->trans($page_name), -1, 'hrm@hrm');
+print dol_get_fiche_head($head, 'evaluationsAttributes', $langs->trans($page_name), -1, 'hrm');
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
diff --git a/htdocs/hrm/admin/job_extrafields.php b/htdocs/hrm/admin/job_extrafields.php
index 467d94437b0..5d6ea5d6990 100644
--- a/htdocs/hrm/admin/job_extrafields.php
+++ b/htdocs/hrm/admin/job_extrafields.php
@@ -27,33 +27,7 @@
*/
// Load Dolibarr environment
-$res = 0;
-// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined)
-if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) {
- $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php";
-}
-// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
-$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1;
-while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) {
- $i--; $j--;
-}
-if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) {
- $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php";
-}
-if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) {
- $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php";
-}
-// Try main.inc.php using relative path
-if (!$res && file_exists("../../main.inc.php")) {
- $res = @include "../../main.inc.php";
-}
-if (!$res && file_exists("../../../main.inc.php")) {
- $res = @include "../../../main.inc.php";
-}
-if (!$res) {
- die("Include of main fails");
-}
-
+require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
require_once '../lib/hrm.lib.php';
@@ -105,7 +79,7 @@ print load_fiche_titre($langs->trans($page_name), $linkback, 'title_setup');
$head = hrmAdminPrepareHead();
-print dol_get_fiche_head($head, 'jobsAttributes', $langs->trans($page_name), -1, 'hrm@job');
+print dol_get_fiche_head($head, 'jobsAttributes', $langs->trans($page_name), -1, 'hrm');
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
diff --git a/htdocs/hrm/admin/skill_extrafields.php b/htdocs/hrm/admin/skill_extrafields.php
index 44042a0e30a..adcf6277dd0 100644
--- a/htdocs/hrm/admin/skill_extrafields.php
+++ b/htdocs/hrm/admin/skill_extrafields.php
@@ -27,33 +27,7 @@
*/
// Load Dolibarr environment
-$res = 0;
-// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined)
-if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) {
- $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php";
-}
-// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
-$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1;
-while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) {
- $i--; $j--;
-}
-if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) {
- $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php";
-}
-if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) {
- $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php";
-}
-// Try main.inc.php using relative path
-if (!$res && file_exists("../../main.inc.php")) {
- $res = @include "../../main.inc.php";
-}
-if (!$res && file_exists("../../../main.inc.php")) {
- $res = @include "../../../main.inc.php";
-}
-if (!$res) {
- die("Include of main fails");
-}
-
+require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
require_once '../lib/hrm.lib.php';
@@ -105,7 +79,7 @@ print load_fiche_titre($langs->trans($page_name), $linkback, 'title_setup');
$head = hrmAdminPrepareHead();
-print dol_get_fiche_head($head, 'skillsAttributes', $langs->trans($page_name), -1, 'hrm@skill');
+print dol_get_fiche_head($head, 'skillsAttributes', $langs->trans($page_name), -1, 'hrm');
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
diff --git a/htdocs/langs/en_US/hrm.lang b/htdocs/langs/en_US/hrm.lang
index a45028aba60..1cac73d2394 100644
--- a/htdocs/langs/en_US/hrm.lang
+++ b/htdocs/langs/en_US/hrm.lang
@@ -12,7 +12,7 @@ OpenEtablishment=Open establishment
CloseEtablishment=Close establishment
# Dictionary
DictionaryPublicHolidays=Leave - Public holidays
-DictionaryDepartment=HRM - Department list
+DictionaryDepartment=HRM - Organizational Unit
DictionaryFunction=HRM - Job positions
# Module
Employees=Employees
diff --git a/htdocs/langs/en_US/stocks.lang b/htdocs/langs/en_US/stocks.lang
index f28151c9efe..47483bb8f3b 100644
--- a/htdocs/langs/en_US/stocks.lang
+++ b/htdocs/langs/en_US/stocks.lang
@@ -265,6 +265,7 @@ ProductBarcodeDoesNotExist=Product with barcode does not exist
WarehouseId=Warehouse ID
WarehouseRef=Warehouse Ref
SaveQtyFirst=Save the real inventoried quantities first, before asking creation of the stock movement.
+ToStart=Start
InventoryStartedShort=Started
ErrorOnElementsInventory=Operation canceled for the following reason:
ErrorCantFindCodeInInventory=Can't find the following code in inventory
diff --git a/htdocs/langs/fr_FR/hrm.lang b/htdocs/langs/fr_FR/hrm.lang
index c812afa1fc9..bc655bcd0ba 100644
--- a/htdocs/langs/fr_FR/hrm.lang
+++ b/htdocs/langs/fr_FR/hrm.lang
@@ -12,7 +12,7 @@ OpenEtablishment=Etablissement ouvert
CloseEtablishment=Etablissement fermé
# Dictionary
DictionaryPublicHolidays=Congés - jours fériés
-DictionaryDepartment=GRH - Liste des départements
+DictionaryDepartment=GRH - Liste des départements organisationnels
DictionaryFunction=GRH - Liste des fonctions
# Module
Employees=Salariés
diff --git a/htdocs/product/inventory/card.php b/htdocs/product/inventory/card.php
index 0a21f9939ee..47404ba4f04 100644
--- a/htdocs/product/inventory/card.php
+++ b/htdocs/product/inventory/card.php
@@ -411,7 +411,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
// Validate
if ($object->status == $object::STATUS_DRAFT || $object->status == $object::STATUS_CANCELED) {
if ($permissiontoadd) {
- print ''.$langs->trans("Validate").' ('.$langs->trans("Start").')';
+ print ''.$langs->trans("Validate").' ('.$langs->trans("ToStart").')';
}
}