From 156f1e7e2a70209290fefd0eb20b167daa0d1eea Mon Sep 17 00:00:00 2001 From: Christian Foellmann Date: Thu, 28 Oct 2021 11:00:12 +0200 Subject: [PATCH 1/5] fix holiday page titles --- htdocs/holiday/card.php | 2 +- htdocs/holiday/document.php | 3 +-- htdocs/holiday/info.php | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/htdocs/holiday/card.php b/htdocs/holiday/card.php index b4bb54f3b1b..216e524a905 100644 --- a/htdocs/holiday/card.php +++ b/htdocs/holiday/card.php @@ -882,7 +882,7 @@ $object = new Holiday($db); $listhalfday = array('morning'=>$langs->trans("Morning"), "afternoon"=>$langs->trans("Afternoon")); -$title = $langs->trans('CPTitreMenu'); +$title = $langs->trans('Leave'); $help_url = 'EN:Module_Holiday'; llxHeader('', $title, $help_url); diff --git a/htdocs/holiday/document.php b/htdocs/holiday/document.php index 7dc086a113f..17687a101ab 100644 --- a/htdocs/holiday/document.php +++ b/htdocs/holiday/document.php @@ -137,8 +137,7 @@ include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php'; $form = new Form($db); $listhalfday = array('morning'=>$langs->trans("Morning"), "afternoon"=>$langs->trans("Afternoon")); - -$title = $langs->trans('InterventionCard'); +$title = $langs->trans("Leave").' - '.$langs->trans("Files"); llxHeader('', $title); diff --git a/htdocs/holiday/info.php b/htdocs/holiday/info.php index 3ec95e61a52..5df3a5069de 100644 --- a/htdocs/holiday/info.php +++ b/htdocs/holiday/info.php @@ -78,7 +78,7 @@ $result = restrictedArea($user, 'holiday', $object->id, 'holiday'); $form = new Form($db); -$title = $langs->trans("Holiday")." - ".$langs->trans("Info"); +$title = $langs->trans("Leave")." - ".$langs->trans("Info"); $helpurl = ""; llxHeader("", $title, $helpurl); From d93cf696e8a7c9223d8f667835a7da24898a6bc4 Mon Sep 17 00:00:00 2001 From: Christian Foellmann Date: Thu, 28 Oct 2021 11:00:51 +0200 Subject: [PATCH 2/5] use FKEditor only if activated --- htdocs/holiday/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/holiday/card.php b/htdocs/holiday/card.php index 216e524a905..82a8542a9e0 100644 --- a/htdocs/holiday/card.php +++ b/htdocs/holiday/card.php @@ -1088,7 +1088,7 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') { print ''; print ''.$langs->trans("DescCP").''; print ''; - $doleditor = new DolEditor('description', GETPOST('description', 'restricthtml'), '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%'); + $doleditor = new DolEditor('description', GETPOST('description', 'restricthtml'), '', 80, 'dolibarr_notes', 'In', 0, false, empty($conf->fckeditor->enabled) ? false : $conf->fckeditor->enabled, ROWS_3, '90%'); print $doleditor->Create(1); print ''; @@ -1289,7 +1289,7 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') { print ''; print ''.$langs->trans('DescCP').''; print ''; - $doleditor = new DolEditor('description', $object->description, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%'); + $doleditor = new DolEditor('description', $object->description, '', 80, 'dolibarr_notes', 'In', 0, false, empty($conf->fckeditor->enabled) ? false : $conf->fckeditor->enabled, ROWS_3, '90%'); print $doleditor->Create(1); print ''; } From 449e1821fc2a2ab1b9d822c8d8b56dccaede1bbb Mon Sep 17 00:00:00 2001 From: Christian Foellmann Date: Thu, 28 Oct 2021 11:04:43 +0200 Subject: [PATCH 3/5] cleanup html and comment --- htdocs/holiday/card.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/htdocs/holiday/card.php b/htdocs/holiday/card.php index 82a8542a9e0..045c370de8e 100644 --- a/htdocs/holiday/card.php +++ b/htdocs/holiday/card.php @@ -1158,7 +1158,7 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') { setEventMessages($errors, null, 'errors'); } - // On vérifie si l'utilisateur à le droit de lire cette demande + // check if the user has the right to read this request if ($canread) { $head = holiday_prepare_head($object); @@ -1433,11 +1433,9 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') { if (($action == 'edit' && $object->statut == Holiday::STATUS_DRAFT) || ($action == 'editvalidator')) { if ($action == 'edit' && $object->statut == Holiday::STATUS_DRAFT) { - print '
'; if ($cancreate && $object->statut == Holiday::STATUS_DRAFT) { - print ''; + print $form->buttonsSaveCancel(); } - print '
'; } print ''; @@ -1521,7 +1519,7 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') { $action = 'presend'; } - if ($action != 'presend') { + if ($action != 'presend' && $action != 'edit') { print '
'; print ''; // ancre @@ -1543,7 +1541,7 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') { //$somethingshown = $form->showLinkedObjectBlock($object, $linktoelem); - print '
'; + print '
'; $MAXEVENT = 10; @@ -1552,7 +1550,7 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') { $formactions = new FormActions($db); $somethingshown = $formactions->showactions($object, $object->element, (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlright); - print '
'; + print '
'; } } } From 966b3ab85fec62b979bbceed7519f489645a4b76 Mon Sep 17 00:00:00 2001 From: Christian Foellmann Date: Thu, 28 Oct 2021 11:05:01 +0200 Subject: [PATCH 4/5] use ref prefix for file uploads --- htdocs/holiday/document.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/holiday/document.php b/htdocs/holiday/document.php index 17687a101ab..6986d75d630 100644 --- a/htdocs/holiday/document.php +++ b/htdocs/holiday/document.php @@ -346,12 +346,12 @@ if ($object->id) { print dol_get_fiche_end(); - - - $modulepart = 'holiday'; $permissiontoadd = $user->rights->holiday->write; $permtoedit = $user->rights->holiday->write; $param = '&id='.$object->id; + $relativepathwithnofile = $modulepart.'/'.dol_sanitizeFileName($object->ref).'/'; + $savingdocmask = dol_sanitizeFileName($object->ref).'-__file__'; + include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } else { print $langs->trans("ErrorUnknown"); From 41b8c92311f37172436886394bec319f8354d6f3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 31 Oct 2021 15:16:40 +0100 Subject: [PATCH 5/5] Update card.php --- htdocs/holiday/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/holiday/card.php b/htdocs/holiday/card.php index 045c370de8e..e84fb79c7e3 100644 --- a/htdocs/holiday/card.php +++ b/htdocs/holiday/card.php @@ -1541,7 +1541,7 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') { //$somethingshown = $form->showLinkedObjectBlock($object, $linktoelem); - print '
'; + print '
'; $MAXEVENT = 10; @@ -1550,7 +1550,7 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') { $formactions = new FormActions($db); $somethingshown = $formactions->showactions($object, $object->element, (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlright); - print '
'; + print ''; } } }