From 9e013bf44f5b188c84a70b21857d42e38567fbb2 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Tue, 23 Aug 2022 20:52:56 +0200 Subject: [PATCH] Update traduction.php --- htdocs/categories/traduction.php | 33 +++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/htdocs/categories/traduction.php b/htdocs/categories/traduction.php index 512f25a67e2..00ff32c6206 100644 --- a/htdocs/categories/traduction.php +++ b/htdocs/categories/traduction.php @@ -20,9 +20,9 @@ */ /** - * \file htdocs/product/traduction.php - * \ingroup product - * \brief Page of translation of products + * \file htdocs/categories/traduction.php + * \ingroup categories + * \brief Page of translation of categories */ require '../main.inc.php'; @@ -35,8 +35,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; // Load translation files required by the page $langs->loadLangs(array('categories', 'languages')); -$id = GETPOST('id', 'int'); -$label = GETPOST('label', 'alpha'); +$id = GETPOST('id', 'int'); +$label = GETPOST('label', 'alpha'); $action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'alpha'); @@ -56,21 +56,23 @@ if ($result <= 0) { $type = $object->type; if (is_numeric($type)) { - $type = Categorie::$MAP_ID_TO_CODE[$type]; // For backward compatibility + $type = Categorie::$MAP_ID_TO_CODE[$type]; // For backward compatibility } + /* * Actions */ + $error = 0; -// retour a l'affichage des traduction si annulation +// return to translation view if cancelled if ($cancel == $langs->trans("Cancel")) { $action = ''; } -// Validation de l'ajout +// validation of addition if ($action == 'vadd' && $cancel != $langs->trans("Cancel") && ($user->rights->categorie->creer)) { @@ -94,7 +96,7 @@ $cancel != $langs->trans("Cancel") && } if (!$error) { - // update de l'objet + // update the object if ($forcelangprod == $current_lang) { $object->label = $libelle; $object->description = dol_htmlcleanlastbr($desc); @@ -103,7 +105,7 @@ $cancel != $langs->trans("Cancel") && $object->multilangs[$forcelangprod]["description"] = dol_htmlcleanlastbr($desc); } - // sauvegarde en base + // save in base / sauvegarde en base $res = $object->setMultiLangs($user); if ($res < 0) { $error++; @@ -119,14 +121,14 @@ $cancel != $langs->trans("Cancel") && } } -// Validation de l'edition +// validation of the edition if ($action == 'vedit' && $cancel != $langs->trans("Cancel") && ($user->rights->categorie->creer)) { $object->fetch($id); $current_lang = $langs->getDefaultLang(); - foreach ($object->multilangs as $key => $value) { // enregistrement des nouvelles valeurs dans l'objet + foreach ($object->multilangs as $key => $value) { // recording of new values in the object $libelle = GETPOST('libelle-'.$key, 'alpha'); $desc = GETPOST('desc-'.$key); @@ -164,7 +166,7 @@ $cancel != $langs->trans("Cancel") && * View */ -$form = new Form($db); +$form = new Form($db); $formadmin = new FormAdmin($db); $formother = new FormOther($db); @@ -223,10 +225,10 @@ print dol_get_fiche_end(); - /* * Action bar */ + print "\n
\n"; if ($action == '') { @@ -243,7 +245,7 @@ print "\n
\n"; if ($action == 'edit') { - //WYSIWYG Editor + // WYSIWYG Editor require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; print '
'; @@ -260,6 +262,7 @@ if ($action == 'edit') { // Label $libelle = (GETPOST('libelle-'.$key, 'alpha') ? GETPOST('libelle-'.$key, 'alpha') : $object->multilangs[$key]['label']); print ''.$langs->trans('Label').''; + // Desc $desc = (GETPOST('desc-'.$key) ? GETPOST('desc-'.$key) : $object->multilangs[$key]['description']); print ''.$langs->trans('Description').'';