diff --git a/doc/images/invoice.png b/doc/images/invoice.png
new file mode 100644
index 00000000000..9be03a52ed8
Binary files /dev/null and b/doc/images/invoice.png differ
diff --git a/htdocs/core/modules/modHoliday.class.php b/htdocs/core/modules/modHoliday.class.php
index 6673f55711c..a146a855ccb 100644
--- a/htdocs/core/modules/modHoliday.class.php
+++ b/htdocs/core/modules/modHoliday.class.php
@@ -177,7 +177,7 @@ class modHoliday extends DolibarrModules
$this->rights[$r][0] = 20005; // Permission id (must not be already used)
$this->rights[$r][1] = 'Create/modify leave requests for everybody'; // Permission label
$this->rights[$r][3] = 0; // Permission by default for new user (0/1)
- $this->rights[$r][4] = 'write_all'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
+ $this->rights[$r][4] = 'writeall_advance'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
$this->rights[$r][5] = ''; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
$r++;
diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php
index 2e826cb4080..8613c5db742 100644
--- a/htdocs/expensereport/card.php
+++ b/htdocs/expensereport/card.php
@@ -1354,6 +1354,7 @@ if (empty($reshook))
$title = $langs->trans("ExpenseReport")." - ".$langs->trans("Card");
$helpurl = "EN:Module_Expense_Reports";
+
llxHeader("", $title, $helpurl);
$form = new Form($db);
diff --git a/htdocs/holiday/card.php b/htdocs/holiday/card.php
index d9bbe6607bf..cfc0deeef7b 100644
--- a/htdocs/holiday/card.php
+++ b/htdocs/holiday/card.php
@@ -82,7 +82,8 @@ if (($id > 0) || $ref)
}
$cancreate = 0;
-if (!empty($user->rights->holiday->write_all)) $cancreate = 1;
+
+if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->holiday->writeall_advance)) $cancreate = 1;
if (!empty($user->rights->holiday->write) && in_array($fuserid, $childids)) $cancreate = 1;
$candelete = 0;
@@ -741,7 +742,8 @@ if (empty($reshook))
$object->fetch($id);
// Si statut en attente de validation et valideur = valideur ou utilisateur, ou droits de faire pour les autres
- if (($object->statut == Holiday::STATUS_VALIDATED || $object->statut == Holiday::STATUS_APPROVED) && ($user->id == $object->fk_validator || in_array($object->fk_user, $childids) || !empty($user->rights->holiday->write_all)))
+ if (($object->statut == Holiday::STATUS_VALIDATED || $object->statut == Holiday::STATUS_APPROVED) && ($user->id == $object->fk_validator || in_array($object->fk_user, $childids)
+ || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->holiday->writeall_advance))))
{
$db->begin();
@@ -867,7 +869,7 @@ llxHeader('', $langs->trans('CPTitreMenu'));
if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add')
{
// Si l'utilisateur n'a pas le droit de faire une demande
- if (($fuserid == $user->id && empty($user->rights->holiday->write)) || ($fuserid != $user->id && empty($user->rights->holiday->write_all)))
+ if (($fuserid == $user->id && empty($user->rights->holiday->write)) || ($fuserid != $user->id && (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || empty($user->rights->holiday->writeall_advance))))
{
$errors[] = $langs->trans('CantCreateCP');
} else {
@@ -981,11 +983,13 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add')
print '
'.$langs->trans("User").' | ';
print '';
- if (empty($user->rights->holiday->write_all))
+ if (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || empty($user->rights->holiday->writeall_advance))
{
print $form->select_dolusers(($fuserid ? $fuserid : $user->id), 'fuserid', 0, '', 0, 'hierarchyme', '', '0,'.$conf->entity, 0, 0, $morefilter, 0, '', 'maxwidth300');
//print '';
- } else print $form->select_dolusers(GETPOST('fuserid', 'int') ?GETPOST('fuserid', 'int') : $user->id, 'fuserid', 0, '', 0, '', '', '0,'.$conf->entity, 0, 0, $morefilter, 0, '', 'maxwidth300');
+ } else {
+ print $form->select_dolusers(GETPOST('fuserid', 'int') ? GETPOST('fuserid', 'int') : $user->id, 'fuserid', 0, '', 0, '', '', '0,'.$conf->entity, 0, 0, $morefilter, 0, '', 'maxwidth300');
+ }
print ' | ';
print '';
@@ -1459,7 +1463,7 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add')
print ''.$langs->trans("ActionRefuseCP").'';
}
}
- if (($user->id == $object->fk_validator || in_array($object->fk_user, $childids) || !empty($user->rights->holiday->write_all)) && ($object->statut == 2 || $object->statut == 3)) // Status validated or approved
+ if (($user->id == $object->fk_validator || in_array($object->fk_user, $childids) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->holiday->writeall_advance))) && ($object->statut == 2 || $object->statut == 3)) // Status validated or approved
{
if (($object->date_debut > dol_now()) || $user->admin) print 'id.'&action=cancel" class="butAction">'.$langs->trans("ActionCancelCP").'';
else print ''.$langs->trans("ActionCancelCP").'';
diff --git a/htdocs/holiday/list.php b/htdocs/holiday/list.php
index ca83d9341f2..0cd0489c701 100644
--- a/htdocs/holiday/list.php
+++ b/htdocs/holiday/list.php
@@ -421,7 +421,7 @@ if ($resql)
print '';
- $canedit = (($user->id == $user_id && $user->rights->holiday->write) || ($user->id != $user_id && $user->rights->holiday->write_all));
+ $canedit = (($user->id == $user_id && $user->rights->holiday->write) || ($user->id != $user_id && (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->holiday->writeall_advance))));
if ($canedit)
{
diff --git a/htdocs/install/mysql/migration/12.0.0-13.0.0.sql b/htdocs/install/mysql/migration/12.0.0-13.0.0.sql
index 6a34b69d1a2..1514a18e74c 100644
--- a/htdocs/install/mysql/migration/12.0.0-13.0.0.sql
+++ b/htdocs/install/mysql/migration/12.0.0-13.0.0.sql
@@ -359,3 +359,7 @@ ALTER TABLE llx_website_page ADD COLUMN fk_object varchar(255);
DELETE FROM llx_const WHERE name in ('MAIN_INCLUDE_ZERO_VAT_IN_REPORTS');
ALTER TABLE llx_projet_task_time MODIFY COLUMN datec datetime;
+
+DELETE FROM llx_user_rights WHERE fk_id IN (SELECT id FROM llx_rights_def where module = 'holiday' and perms = 'lire_tous');
+DELETE FROM llx_rights_def where module = 'holiday' and perms = 'lire_tous';
+
diff --git a/htdocs/theme/eldy/ckeditor/config.js b/htdocs/theme/eldy/ckeditor/config.js
index b52fd6f7e51..50bf77c00ff 100644
--- a/htdocs/theme/eldy/ckeditor/config.js
+++ b/htdocs/theme/eldy/ckeditor/config.js
@@ -73,7 +73,7 @@ CKEDITOR.editorConfig = function( config )
['Maximize'],
['SpellChecker', 'Scayt'], // 'Cut','Copy','Paste','-', are useless, can be done with right click, even on smarpthone
['Undo','Redo','-','Find','Replace'],
- ['Format','Font','FontSize'],
+ ['Font','FontSize'],
['Bold','Italic','Underline','Strike','Superscript','-','TextColor','RemoveFormat'],
['NumberedList','BulletedList','Outdent','Indent'],
['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],