diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index 90ce1a5b821..74e3afaa141 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -1934,7 +1934,7 @@ function dol_get_fiche_head($links = array(), $active = '', $title = '', $notab
$out .= '
';
if (!empty($links[$i][0])) {
$titletoshow = preg_replace('/<.*$/', '', $links[$i][1]);
- $out .= '
';
+ $out .= ' ';
}
$out .= $links[$i][1];
if (!empty($links[$i][0])) {
diff --git a/htdocs/core/lib/functionsnumtoword.lib.php b/htdocs/core/lib/functionsnumtoword.lib.php
index 1dfe42d63b2..f451f7370eb 100644
--- a/htdocs/core/lib/functionsnumtoword.lib.php
+++ b/htdocs/core/lib/functionsnumtoword.lib.php
@@ -187,7 +187,7 @@ function dolNumberToWord($numero, $langs, $numorcurrency = 'number')
/*In dolibarr 3.6.2 (my current version) doesn't have $langs->default and
in case exist why ask $lang like a parameter?*/
- if (((is_object($langs) && $langs->default == 'es_MX') || (!is_object($langs) && $langs == 'es_MX')) && $numorcurrency == 'currency') {
+ if (((is_object($langs) && $langs->getDefaultLang(0) == 'es_MX') || (!is_object($langs) && $langs == 'es_MX')) && $numorcurrency == 'currency') {
if ($numero >= 1 && $numero < 2) {
return ("UN PESO ".$parte_decimal." / 100 M.N.");
} elseif ($numero >= 0 && $numero < 1) {
diff --git a/htdocs/core/modules/dons/html_cerfafr.modules.php b/htdocs/core/modules/dons/html_cerfafr.modules.php
index 792c8434ba4..83c2504be3d 100644
--- a/htdocs/core/modules/dons/html_cerfafr.modules.php
+++ b/htdocs/core/modules/dons/html_cerfafr.modules.php
@@ -120,18 +120,18 @@ class html_cerfafr extends ModeleDon
// This is not the proper way to do it but $formclass->form_modes_reglement
// prints the translation instead of returning it
- if ($don->modepaiementid) {
- $formclass->load_cache_types_paiements();
- $paymentmode = $formclass->cache_types_paiements[$don->modepaiementid]['label'];
+ $formclass->load_cache_types_paiements();
+ if ($don->modepaymentid) {
+ $paymentmode = $formclass->cache_types_paiements[$don->modepaymentid]['label'];
} else {
$paymentmode = '';
}
-
- if ($don->modepaymentcode == 'CHQ') {
+ $modepaymentcode = $formclass->cache_types_paiements[$don->modepaymentid]['code'];
+ if ($modepaymentcode == 'CHQ') {
$ModePaiement = ' Remise d\'espèces Chèque Virement, prélèvement, carte bancaire';
- } elseif ($don->modepaymentcode == 'LIQ') {
+ } elseif ($modepaymentcode == 'LIQ') {
$ModePaiement = '
Remise d\'espèces Chèque Virement, prélèvement, carte bancaire';
- } elseif ($don->modepaymentcode == 'VIR' || $don->modepaymentcode == 'PRE' || $don->modepaymentcode == 'CB') {
+ } elseif ($modepaymentcode == 'VIR' || $modepaymentcode == 'PRE' || $modepaymentcode == 'CB') {
$ModePaiement = '
Remise d\'espèces Chèque Virement, prélèvement, carte bancaire';
} else {
$ModePaiement = '
Remise d\'espèces Chèque Virement, prélèvement, carte bancaire';
diff --git a/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php b/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php
index 94d511367e2..821b6a24e10 100644
--- a/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php
+++ b/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php
@@ -334,7 +334,7 @@ class doc_generic_product_odt extends ModelePDFProduct
'__FROM_EMAIL__' => $this->emetteur->email,
'__TOTAL_TTC__' => $object->total_ttc,
'__TOTAL_HT__' => $object->total_ht,
- '__TOTAL_VAT__' => $object->total_vat
+ '__TOTAL_VAT__' => $object->total_tva
);
complete_substitutions_array($substitutionarray, $langs, $object);
// Call the ODTSubstitution hook
diff --git a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php
index 8b1261f35f0..4e8be5f6389 100644
--- a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php
+++ b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php
@@ -134,8 +134,8 @@ class doc_generic_project_odt extends ModelePDFProjects
// Get source company
$this->emetteur = $mysoc;
- if (!$this->emetteur->pays_code) {
- $this->emetteur->pays_code = substr($langs->defaultlang, -2); // Par defaut, si n'etait pas defini
+ if (!$this->emetteur->country_code) {
+ $this->emetteur->country_code = substr($langs->defaultlang, -2); // Par defaut, si n'etait pas defini
}
}
diff --git a/htdocs/langs/en_US/users.lang b/htdocs/langs/en_US/users.lang
index 3f2c7f5f53a..757e9f1dedf 100644
--- a/htdocs/langs/en_US/users.lang
+++ b/htdocs/langs/en_US/users.lang
@@ -127,3 +127,5 @@ DateLastLogin=Date last login
DatePreviousLogin=Date previous login
IPLastLogin=IP last login
IPPreviousLogin=IP previous login
+ShowAllPerms=Show all permission rows
+HideAllPerms=Hide all permission rows
diff --git a/htdocs/user/perms.php b/htdocs/user/perms.php
index 6dca3bdca83..8f7d152e73a 100644
--- a/htdocs/user/perms.php
+++ b/htdocs/user/perms.php
@@ -44,6 +44,7 @@ $action = GETPOST('action', 'aZ09');
$confirm = GETPOST('confirm', 'alpha');
$module = GETPOST('module', 'alpha');
$rights = GETPOST('rights', 'int');
+$updatedmodulename = GETPOST('updatedmodulename', 'alpha');
$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'userperms'; // To manage different context of search
if (!isset($id) || empty($id)) {
@@ -267,7 +268,7 @@ print '
';
print '
';
// Login
-print ''.$langs->trans("Login").' ';
+print ''.$langs->trans("Login").' ';
if (!empty($object->ldap_sid) && $object->statut == 0) {
print '';
print $langs->trans("LoginAccountDisableInDolibarr");
@@ -306,7 +307,6 @@ if ($reshook < 0) {
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
}
-
print "\n";
print '';
print '
';
@@ -320,13 +320,22 @@ if (($caneditperms && empty($objMod->rights_admin_allowed)) || empty($object->ad
print ' / ';
print 'id.'&action=delrights&token='.newToken().'&entity='.$entity.'&module=allmodules&confirm=yes">'.$langs->trans("None")." ";
print '';
+ } else {
+ print ' ';
}
print ' ';
+} else {
+ print ' ';
+ print ' ';
}
+
print ''.$langs->trans("Permissions").' ';
-if ($user->admin) {
- print ' ';
-}
+print '';
+print ''.img_picto('', 'folder-open', 'class="paddingright"').''.$langs->trans("ExpandAll").' ';
+print ' | ';
+print ''.img_picto('', 'folder', 'class="paddingright"').''.$langs->trans("UndoExpandAll").' ';
+print ' ';
+
print ''."\n";
@@ -469,38 +478,51 @@ if ($result) {
$picto = ($objMod->picto ? $objMod->picto : 'generic');
// Show break line
- print '';
+ print ' ';
print '';
print img_object('', $picto, 'class="pictoobjectwidth paddingright"').' '.$objMod->getName();
print ' ';
print ' ';
if (($caneditperms && empty($objMod->rights_admin_allowed)) || empty($object->admin)) {
if ($caneditperms) {
- print '';
- print 'id.'&action=addrights&token='.newToken().'&entity='.$entity.'&module='.$obj->module.'&confirm=yes">'.$langs->trans("All")." ";
+ print ' module && $module != "allmodules" ? ' style="display:none"' : '').'>';
+ print 'id.'&action=addrights&token='.newToken().'&entity='.$entity.'&module='.$obj->module.'&confirm=yes&updatedmodulename='.$obj->module.'">'.$langs->trans("All")." ";
print ' / ';
- print 'id.'&action=delrights&token='.newToken().'&entity='.$entity.'&module='.$obj->module.'&confirm=yes">'.$langs->trans("None")." ";
+ print 'id.'&action=delrights&token='.newToken().'&entity='.$entity.'&module='.$obj->module.'&confirm=yes&updatedmodulename='.$obj->module.'">'.$langs->trans("None")." ";
print ' ';
+ print 'module || $module == "allmodules" ? ' style="display:none"' : '').'> ';
+ } else {
+ print ' ';
}
print ' ';
} else {
if ($caneditperms) {
- print ' ';
+ print 'module && $module != "allmodules" ? ' style="display:none"' : '').'>';
+ print 'id.'&action=addrights&token='.newToken().'&entity='.$entity.'&module='.$obj->module.'&confirm=yes&updatedmodulename='.$obj->module.'">'.$langs->trans("All")." ";
+ print ' / ';
+ print 'id.'&action=delrights&token='.newToken().'&entity='.$entity.'&module='.$obj->module.'&confirm=yes&updatedmodulename='.$obj->module.'">'.$langs->trans("None")." ";
+ print ' ';
+ print 'module || $module == "allmodules" ? ' style="display:none"' : '').'> ';
+ } else {
+ print ' ';
}
print ' ';
}
print ' ';
- // Permission id
- if ($user->admin) {
- print ' ';
- }
-
+ print '';
+ print '';
+ print img_picto('', 'folder', 'class="marginright"');
+ print '
';
+ print '';
+ print img_picto('', 'folder-open', 'class="marginright"');
+ print '
';
+ print ' '; //Add picto + / - when open en closed
print ' '."\n";
}
print ''."\n";
- print '';
+ print ' module && $module != "allmodules" ? ' style="display:none"' : '').'>';
// Picto and label of module
print '';
@@ -511,16 +533,20 @@ if ($result) {
if (!empty($object->admin) && !empty($objMod->rights_admin_allowed)) { // Permission granted because admin
if ($caneditperms) {
print ' '.img_picto($langs->trans("Administrator"), 'star').' ';
+ } else {
+ print ' ';
}
print '';
print img_picto($langs->trans("Active"), 'tick');
print ' ';
} elseif (in_array($obj->id, $permsuser)) { // Permission granted by user
if ($caneditperms) {
- print 'id.'&action=delrights&token='.newToken().'&entity='.$entity.'&rights='.$obj->id.'&confirm=yes">';
+ print ' id.'&action=delrights&token='.newToken().'&entity='.$entity.'&rights='.$obj->id.'&confirm=yes&updatedmodulename='.$obj->module.'">';
//print img_edit_remove($langs->trans("Remove"));
print img_picto($langs->trans("Remove"), 'switch_on');
print ' ';
+ } else {
+ print ' ';
}
print '';
print img_picto($langs->trans("Active"), 'tick');
@@ -531,6 +557,8 @@ if ($result) {
print ' ';
print $form->textwithtooltip($langs->trans("Inherited"), $langs->trans("PermissionInheritedFromAGroup"));
print ' ';
+ } else {
+ print ' ';
}
print '';
print img_picto($langs->trans("Active"), 'tick');
@@ -538,27 +566,35 @@ if ($result) {
} else {
// Do not own permission
if ($caneditperms) {
- print ' id.'&action=addrights&entity='.$entity.'&rights='.$obj->id.'&confirm=yes&token='.newToken().'">';
+ print ' id.'&action=addrights&entity='.$entity.'&rights='.$obj->id.'&confirm=yes&token='.newToken().'&updatedmodulename='.$obj->module.'">';
//print img_edit_add($langs->trans("Add"));
print img_picto($langs->trans("Add"), 'switch_off');
print ' ';
+ } else {
+ print ' ';
}
print ' ';
}
} else {
// Do not own permission
if ($caneditperms) {
- print 'id.'&action=addrights&entity='.$entity.'&rights='.$obj->id.'&confirm=yes&token='.newToken().'">';
+ print ' id.'&action=addrights&entity='.$entity.'&rights='.$obj->id.'&confirm=yes&token='.newToken().'&updatedmodulename='.$obj->module.'">';
//print img_edit_add($langs->trans("Add"));
print img_picto($langs->trans("Add"), 'switch_off');
print ' ';
+ } else {
+ print ' ';
}
print ' ';
}
// Description of permission
$permlabel = (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ($langs->trans("PermissionAdvanced".$obj->id) != ("PermissionAdvanced".$obj->id)) ? $langs->trans("PermissionAdvanced".$obj->id) : (($langs->trans("Permission".$obj->id) != ("Permission".$obj->id)) ? $langs->trans("Permission".$obj->id) : $langs->trans($obj->label)));
- print '';
+ if (!$user->admin) {
+ print ' ';
+ } else {
+ print ' ';
+ }
print $permlabel;
if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS)) {
if (preg_match('/_advance$/', $obj->perms)) {
@@ -587,6 +623,53 @@ if ($result) {
print '
';
print '
';
+print '';
+
+print '';
+
$parameters = array();
$reshook = $hookmanager->executeHooks('insertExtraFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) {