From 8da3f5db5d88ab987ad8d3818884365603042162 Mon Sep 17 00:00:00 2001 From: sparkyx Date: Thu, 12 Aug 2021 16:13:14 +0200 Subject: [PATCH] Cosmetic and Ergonomy --- html/css/style-classic7.css | 7 ++++++- include/class/acc_account_ledger.class.php | 1 + include/class/acc_ledger.class.php | 2 +- include/class/periode.class.php | 4 ++-- include/compta_ods.inc.php | 13 +++++++++---- include/operation_ods_new.inc.php | 8 +++++++- 6 files changed, 26 insertions(+), 9 deletions(-) diff --git a/html/css/style-classic7.css b/html/css/style-classic7.css index 3a882bf8c..8a1fcc8e6 100644 --- a/html/css/style-classic7.css +++ b/html/css/style-classic7.css @@ -2592,11 +2592,16 @@ div.progressbar { * Warning */ span.warning { - color:red; + color:white; font-style: normal; font-weight: bold; background-color: #eddadd; padding:10px; + margin:2px; + animation-name: error_h2; + animation-duration: 4s; + animation-iteration-count: infinite; + display: block; } /**********************************************************************************************************************/ /* LI as list diff --git a/include/class/acc_account_ledger.class.php b/include/class/acc_account_ledger.class.php index 8f34325b6..d19a1e21a 100644 --- a/include/class/acc_account_ledger.class.php +++ b/include/class/acc_account_ledger.class.php @@ -677,6 +677,7 @@ class Acc_Account_Ledger { $l=new Acc_Ledger($this->db,$p_jrn); $row=$l->get_propertie(); + if ($l->get_type() != 'ODS') { return [];} if ( $row == null || strlen(trim($row['jrn_def_class_deb'])) == 0 ) return array(); $valid_account=explode(" ",$row['jrn_def_class_deb']); return $valid_account; diff --git a/include/class/acc_ledger.class.php b/include/class/acc_ledger.class.php index 1a1a79d58..7f3fa723e 100644 --- a/include/class/acc_ledger.class.php +++ b/include/class/acc_ledger.class.php @@ -254,7 +254,7 @@ class Acc_Ledger extends jrn_def_sql if ($per->is_open()==0) { - throw new Exception(_('PERIODE FERMEE')); + throw new Exception(_('PERIODE FERMEE')." $p_date "); } diff --git a/include/class/periode.class.php b/include/class/periode.class.php index 3ad125037..316ca6cef 100644 --- a/include/class/periode.class.php +++ b/include/class/periode.class.php @@ -397,9 +397,9 @@ class Periode $ret=$this->cn->exec_sql($sql, array($p_date)); $nb_periode=Database::num_row($ret); if ($nb_periode==0) - throw (new Exception('Aucune période trouvée', 101)); + throw (new Exception(_('Aucune période trouvée')." $p_date ", 101)); if ($nb_periode>1) - throw (new Exception("Trop de périodes trouvées $nb_periode pour $p_date", + throw (new Exception(sprintf(_("Trop de périodes trouvées %s pour %s"),$nb_periode,$p_date), 100)); $per=Database::fetch_result($ret, 0); $this->p_id=$per; diff --git a/include/compta_ods.inc.php b/include/compta_ods.inc.php index 4f5f0908e..83952b504 100644 --- a/include/compta_ods.inc.php +++ b/include/compta_ods.inc.php @@ -43,7 +43,9 @@ $ledger = new Acc_Ledger($cn, $id_ledger); $first_ledger = $ledger->get_first('ODS'); if ( empty ($first_ledger)) { - exit(_('Pas de journal disponible')); + exit( ''. + _('Pas de journal disponible'). + ''); } $ledger->id = ($ledger->id == -1) ? $first_ledger['jrn_def_id'] : $id_ledger; @@ -95,12 +97,15 @@ elseif (isset($_POST['save'])) echo '

'._("Opération enregistrée")._("Piece") . h($ledger->pj) . '

'; if (strcmp($ledger->pj, $_POST['e_pj']) != 0) { - echo '

' . _('Attention numéro pièce existante, elle a du être adaptée') . '

'; + echo '

' . _('Attention numéro pièce existante, elle a du être adaptée') . + '

'; } - printf('%s
', $jr_id, dossier::id(), $ledger->internal); + printf('%s
', + $jr_id, dossier::id(), $ledger->internal); // show feedback - echo '
'; echo '

' . $ledger->get_name() . '

'; echo '
'; + echo '
'; echo '

' . + $ledger->get_name() . '

'; echo '
'; echo $ledger->confirm($_POST, true); // extourne if (isset($_POST['reverse_ck'])) diff --git a/include/operation_ods_new.inc.php b/include/operation_ods_new.inc.php index aff4ab24b..06d0ef58c 100644 --- a/include/operation_ods_new.inc.php +++ b/include/operation_ods_new.inc.php @@ -41,6 +41,9 @@ $ledger->id = ($ledger->id == -1) ? $first_ledger['jrn_def_id'] : $id_ledger; if ( $g_user->check_jrn($ledger->id)=='X') { alert(_("Vous ne pouvez pas écrire dans ce journal, contactez votre administrateur")); + echo ''. + _("Vous ne pouvez pas écrire dans ce journal, contactez votre administrateur"). + ''; return; } echo '
'; @@ -68,7 +71,10 @@ if ( isset ($_GET['action']) && ! isset($_POST['correct']) && ! isset($correct) } } $p_msg=(isset($p_msg))?$p_msg:""; -print '

'.$p_msg.'

'; +if ( !empty ($p_msg)) +{ + print ''.$p_msg.''; +} echo '
'; echo dossier::hidden(); echo HtmlInput::request_to_hidden(array('ac','jr_optype'));