From be05a44860c186e264a4ff5e4d0f98eb97c590d4 Mon Sep 17 00:00:00 2001 From: Christian Foellmann Date: Thu, 24 Sep 2020 11:49:59 +0200 Subject: [PATCH 1/7] fix selectbox for table columns supplier prices --- htdocs/product/fournisseurs.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index 1f347353b81..ac0b2596d1c 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -883,9 +883,7 @@ SCRIPT; foreach ($extralabels as $key => $value) { // Show field if not hidden if (!empty($extrafields->attributes["product_fournisseur_price"]['list'][$key]) && $extrafields->attributes["product_fournisseur_price"]['list'][$key] != 3) { - if (!empty($extrafields->attributes["product_fournisseur_price"]['langfile'][$key])) $langs->load($extrafields->attributes["product_fournisseur_price"]['langfile'][$key]); - if (!empty($extrafields->attributes["product_fournisseur_price"]['help'][$key])) $extratitle = $form->textwithpicto($langs->trans($value), $langs->trans($extrafields->attributes["product_fournisseur_price"]['help'][$key])); - else $extratitle = $langs->trans($value); + $extratitle = $langs->trans($value); $arrayfields['ef.'.$key] = array('label'=>$extratitle, 'checked'=>0, 'position'=>(end($arrayfields)['position']+1)); } } From 3c879ddd3457fa9aecb7b748d6ae19b9ed2736a9 Mon Sep 17 00:00:00 2001 From: "Sekan, Tobias" Date: Thu, 24 Sep 2020 13:15:51 +0200 Subject: [PATCH 2/7] Fix unbeautiful error message on intervention --- htdocs/fichinter/card.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index 7a6f0563dec..d89b851a189 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -173,7 +173,7 @@ if (empty($reshook)) header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id); exit; } else { - $mesg = '
'.$object->error.'
'; + $mesg = $object->error; } } elseif ($action == 'confirm_modify' && $confirm == 'yes' && $user->rights->ficheinter->creer) { @@ -198,7 +198,7 @@ if (empty($reshook)) header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id); exit; } else { - $mesg = '
'.$object->error.'
'; + $mesg = $object->error; } } elseif ($action == 'add' && $user->rights->ficheinter->creer) { @@ -372,11 +372,11 @@ if (empty($reshook)) } } } else { - $mesg = $srcobject->error; + $mesg = $srcobject->error; $error++; } } else { - $mesg = $object->error; + $mesg = $object->error; $error++; } } else { @@ -406,7 +406,7 @@ if (empty($reshook)) } } } else { - $mesg = '
'.$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("ThirdParty")).'
'; + $mesg = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("ThirdParty")); $action = 'create'; } } elseif ($action == 'update' && $user->rights->ficheinter->creer) @@ -456,17 +456,17 @@ if (empty($reshook)) { if (!GETPOST('np_desc', 'restricthtml') && empty($conf->global->FICHINTER_EMPTY_LINE_DESC)) { - $mesg = '
'.$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Description")).'
'; + $mesg = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Description")); $error++; } if (empty($conf->global->FICHINTER_WITHOUT_DURATION) && !GETPOST('durationhour', 'int') && !GETPOST('durationmin', 'int')) { - $mesg = '
'.$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Duration")).'
'; + $mesg = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Duration")); $error++; } if (empty($conf->global->FICHINTER_WITHOUT_DURATION) && GETPOST('durationhour', 'int') >= 24 && GETPOST('durationmin', 'int') > 0) { - $mesg = '
'.$langs->trans("ErrorValueTooHigh").'
'; + $mesg = $langs->trans("ErrorValueTooHigh"); $error++; } if (!$error) @@ -538,7 +538,7 @@ if (empty($reshook)) header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id); exit; } else { - $mesg = '
'.$object->error.'
'; + $mesg = $object->error; } } @@ -735,9 +735,9 @@ if (empty($reshook)) if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') { $langs->load("errors"); - $mesg = '
'.$langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType").'
'; + $mesg = $langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"); } else { - $mesg = '
'.$object->error.'
'; + $mesg = $object->error; } } } From 56dd28ca78b3fd28e36d6934cd7f10834afaf3a8 Mon Sep 17 00:00:00 2001 From: "Sekan, Tobias" Date: Thu, 24 Sep 2020 13:25:40 +0200 Subject: [PATCH 3/7] fix wrong color --- htdocs/fichinter/card.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index d89b851a189..b823e505c58 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -784,7 +784,11 @@ if ($action == 'create') print load_fiche_titre($langs->trans("AddIntervention"), '', 'intervention'); - dol_htmloutput_mesg($mesg); + if($error > 0) { + dol_htmloutput_errors($mesg); + } else { + dol_htmloutput_mesg($mesg); + } if ($socid) $res = $soc->fetch($socid); @@ -1058,7 +1062,11 @@ if ($action == 'create') $soc = new Societe($db); $soc->fetch($object->socid); - dol_htmloutput_mesg($mesg); + if($error > 0) { + dol_htmloutput_errors($mesg); + } else { + dol_htmloutput_mesg($mesg); + } $head = fichinter_prepare_head($object); From efd8ffe3904e2907bfc323f884a7b5dd0914fc57 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Thu, 24 Sep 2020 11:29:30 +0000 Subject: [PATCH 4/7] Fixing style errors. --- htdocs/fichinter/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index b823e505c58..4770e6af171 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -784,7 +784,7 @@ if ($action == 'create') print load_fiche_titre($langs->trans("AddIntervention"), '', 'intervention'); - if($error > 0) { + if ($error > 0) { dol_htmloutput_errors($mesg); } else { dol_htmloutput_mesg($mesg); @@ -1062,7 +1062,7 @@ if ($action == 'create') $soc = new Societe($db); $soc->fetch($object->socid); - if($error > 0) { + if ($error > 0) { dol_htmloutput_errors($mesg); } else { dol_htmloutput_mesg($mesg); From 00951a8144d3379b6ae9c28c57b466a559e4ec90 Mon Sep 17 00:00:00 2001 From: "Sekan, Tobias" Date: Fri, 25 Sep 2020 08:10:48 +0200 Subject: [PATCH 5/7] New allow to reopen interventions --- htdocs/fichinter/card.php | 30 +++++++++++++++++++++++++++ htdocs/langs/en_US/interventions.lang | 3 +++ 2 files changed, 33 insertions(+) diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index 7a6f0563dec..9bf42da256a 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -555,6 +555,21 @@ if (empty($reshook)) } } + // Reopen + elseif ($action == 'confirm_reopen' && $user->rights->ficheinter->creer) + { + $result = $object->setStatut(Fichinter::STATUS_VALIDATED); + if ($result > 0) + { + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id); + exit; + } + else + { + $mesg = $object->error; + } + } + /* * Mise a jour d'une ligne d'intervention */ @@ -1099,6 +1114,12 @@ if ($action == 'create') $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ModifyIntervention'), $langs->trans('ConfirmModifyIntervention'), 'confirm_modify', '', 0, 1); } + // Confirm back to open + if ($action == 'reopen') + { + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('Reopen'), $langs->trans('ConfirmReopenIntervention', $object->ref), 'confirm_reopen', '', 0, 1); + } + // Confirm deletion of line if ($action == 'ask_deleteline') { @@ -1568,6 +1589,15 @@ if ($action == 'create') print ''; } + // Reopen + if ($object->statut > Fichinter::STATUS_CLOSED) + { + if ($user->rights->ficheinter->creer) + { + print ''; + } else print ''; + } + // Send if (empty($user->socid)) { if ($object->statut > Fichinter::STATUS_DRAFT) diff --git a/htdocs/langs/en_US/interventions.lang b/htdocs/langs/en_US/interventions.lang index e5936f8246e..2123552bb2b 100644 --- a/htdocs/langs/en_US/interventions.lang +++ b/htdocs/langs/en_US/interventions.lang @@ -64,3 +64,6 @@ InterLineDuration=Line duration intervention InterLineDesc=Line description intervention RepeatableIntervention=Template of intervention ToCreateAPredefinedIntervention=To create a predefined or recurring intervention, create a common intervention and convert it into intervention template +Reopen=Reopen +Reopen=Reopen +ConfirmReopenIntervention=Are you sure you want to open back the intervention %s? From 6fbc5360612915a9a4b4ea5375cf96edc3ab0c75 Mon Sep 17 00:00:00 2001 From: "Sekan, Tobias" Date: Fri, 25 Sep 2020 08:15:20 +0200 Subject: [PATCH 6/7] Remoeve double lang entry --- htdocs/langs/en_US/interventions.lang | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/langs/en_US/interventions.lang b/htdocs/langs/en_US/interventions.lang index 2123552bb2b..51079fca278 100644 --- a/htdocs/langs/en_US/interventions.lang +++ b/htdocs/langs/en_US/interventions.lang @@ -65,5 +65,4 @@ InterLineDesc=Line description intervention RepeatableIntervention=Template of intervention ToCreateAPredefinedIntervention=To create a predefined or recurring intervention, create a common intervention and convert it into intervention template Reopen=Reopen -Reopen=Reopen ConfirmReopenIntervention=Are you sure you want to open back the intervention %s? From 6e2d12413c2c4cb09a3d281e2e3808bd0ffa6621 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Fri, 25 Sep 2020 06:17:52 +0000 Subject: [PATCH 7/7] Fixing style errors. --- htdocs/fichinter/card.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index 9bf42da256a..4f9f3d47201 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -564,8 +564,7 @@ if (empty($reshook)) header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id); exit; } - else - { + else { $mesg = $object->error; } }