[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 53/323: Bug : search cannot select ledger
From: |
Dany De Bontridder |
Subject: |
[Noalyss-commit] [noalyss] 53/323: Bug : search cannot select ledger |
Date: |
Wed, 14 Mar 2018 17:38:17 -0400 (EDT) |
sparkyx pushed a commit to branch master
in repository noalyss.
commit a233f2446cdce515e0fcff85bd816bffac8fc5ea
Author: Dany De Bontridder <address@hidden>
Date: Thu Jan 11 18:11:00 2018 +0100
Bug : search cannot select ledger
---
html/js/scripts.js | 7 +++++--
include/class/acc_ledger_search.class.php | 4 ++--
include/class/user.class.php | 12 +++++++++---
3 files changed, 16 insertions(+), 7 deletions(-)
diff --git a/html/js/scripts.js b/html/js/scripts.js
index b09ebdd..95f4bc1 100644
--- a/html/js/scripts.js
+++ b/html/js/scripts.js
@@ -913,7 +913,10 @@ function hide_ledger_choice(p_frm_search)
try
{
var nb = $(p_frm_search).nb_jrn.value;
- var div = $(p_frm_search).div.value;
+ var div = "";
+ if ( $(p_frm_search).div ) {
+ div = $(p_frm_search).div.value;
+ }
var i = 0;
var str = "";
var name = "";
@@ -922,7 +925,7 @@ function hide_ledger_choice(p_frm_search)
for (i = 0; i < nb; i++) {
n_name = div + "r_jrn[" + sel + "]";
name = div + "r_jrn" + i;
- if ($(name).checked) {
+ if ( $(name).checked) {
str += '<input type="hidden" id="' + n_name + '" name="' +
n_name + '" value="' + $(name).value + '">';
sel++;
}
diff --git a/include/class/acc_ledger_search.class.php
b/include/class/acc_ledger_search.class.php
index e9b0cd2..40c3ae7 100644
--- a/include/class/acc_ledger_search.class.php
+++ b/include/class/acc_ledger_search.class.php
@@ -1057,7 +1057,7 @@ class Acc_Ledger_Search
global $g_user;
$r = '';
/* security : filter ledger on user */
- $p_array = $g_user->get_ledger($this->type, 3);
+ $p_array = $g_user->get_ledger($this->type, 3,FALSE);
ob_start();
@@ -1094,7 +1094,7 @@ class Acc_Ledger_Search
for ($e=0;$e<count($p_array);$e++)
{
$row=$p_array[$e];
- if ( $row['jrn_enable']==0) continue;
+// if ( $row['jrn_enable']==0) continue;
$r=new ICheckBox($p_div.'r_jrn'.$e,$row['jrn_def_id']);
$r->set_attribute("ledger_type", $row['jrn_def_type']);
$idx=$row['jrn_def_id'];
diff --git a/include/class/user.class.php b/include/class/user.class.php
index 256b5e3..05c5da0 100644
--- a/include/class/user.class.php
+++ b/include/class/user.class.php
@@ -296,6 +296,7 @@ class User
* \brief get all the available ledgers for the current user
* \param $p_type = ALL or the type of the ledger (ACH,VEN,FIN,ODS)
* \param $p_access =3 for Read or WRITE, 2 write, 1 for readonly
+ * \param (boolean) $all if true show also inactive
* \return a double array of available ledgers
@verbatim
[0] => [jrn_def_id]
@@ -309,8 +310,13 @@ class User
@endverbatim
*/
- function get_ledger($p_type = 'ALL', $p_access = 3)
+ function get_ledger($p_type = 'ALL', $p_access = 3,$disable=TRUE)
{
+ if ($disable==TRUE) {
+ $sql_enable="";
+ } else {
+ $sql_enable="and jrn_enable=1";
+ }
if ($this->admin != 1 && $this->is_local_admin() != 1 &&
$this->get_status_security_ledger() == 1)
{
$sql_type = ($p_type == 'ALL') ? '' : "and
jrn_def_type=upper('" . sql_string($p_type) . "')";
@@ -335,12 +341,12 @@ class User
join user_sec_jrn on uj_jrn_id=jrn_def_id,jrn_enable
where
uj_login='" . $this->login . "'" .
- $sql_type . $sql_access .
+ $sql_type . $sql_access .$sql_enable.
" order by jrn_Def_name";
}
else
{
- $sql_type = ($p_type == 'ALL') ? ' ' : "where
jrn_def_type=upper('" . sql_string($p_type) . "') ";
+ $sql_type = ($p_type == 'ALL') ? ' '.$sql_enable :
"where jrn_def_type=upper('" . sql_string($p_type) . "') ".$sql_enable;
$sql = "select
jrn_def_id,jrn_def_type,jrn_def_name,jrn_def_class_deb,jrn_def_class_cred,jrn_deb_max_line,jrn_cred_max_line,
jrn_type_id,jrn_desc,'W' as
uj_priv,jrn_def_description,jrn_enable
from jrn_def join jrn_type on jrn_def_type=jrn_type_id
- [Noalyss-commit] [noalyss] 41/323: Category of card : dialog box too large for screen cannot be viewed, (continued)
- [Noalyss-commit] [noalyss] 41/323: Category of card : dialog box too large for screen cannot be viewed, Dany De Bontridder, 2018/03/14
- [Noalyss-commit] [noalyss] 40/323: Category of card : cannot be removed due to FK in attr_min, Dany De Bontridder, 2018/03/14
- [Noalyss-commit] [noalyss] 42/323: Manage_Table dialog box draggable, Dany De Bontridder, 2018/03/14
- [Noalyss-commit] [noalyss] 46/323: Mix between odd and even row, Dany De Bontridder, 2018/03/14
- [Noalyss-commit] [noalyss] 23/323: Task #1485 : by default the dialog box are fixed but can be moved, Dany De Bontridder, 2018/03/14
- [Noalyss-commit] [noalyss] 51/323: 0001523: Dans HISTO , Operation History (HISTO) , tiers is clickable, Dany De Bontridder, 2018/03/14
- [Noalyss-commit] [noalyss] 50/323: task #0001513: Détail fiche : ajout bouton effacer, Dany De Bontridder, 2018/03/14
- [Noalyss-commit] [noalyss] 49/323: Tak #1522 : Journaux peuvent être inactif, Dany De Bontridder, 2018/03/14
- [Noalyss-commit] [noalyss] 38/323: Task #1518 : ajout de modèle de catégorie de fiche Modification des attributs minimums, Dany De Bontridder, 2018/03/14
- [Noalyss-commit] [noalyss] 34/323: Rewriting Module Template Category of card, Dany De Bontridder, 2018/03/14
- [Noalyss-commit] [noalyss] 53/323: Bug : search cannot select ledger,
Dany De Bontridder <=
- [Noalyss-commit] [noalyss] 47/323: Task #0001519: Assouplissement de la sécurité : Administrateur accès à tout, ajout d'utilisateur par défaut securité désactivée, Dany De Bontridder, 2018/03/14
- [Noalyss-commit] [noalyss] 72/323: typo, Dany De Bontridder, 2018/03/14
- [Noalyss-commit] [noalyss] 64/323: th.num align right, Dany De Bontridder, 2018/03/14
- [Noalyss-commit] [noalyss] 55/323: Task #1457 & 1281 : export PDF with opening writing, Dany De Bontridder, 2018/03/14
- [Noalyss-commit] [noalyss] 54/323: Task #1326 & #1512 = ajout détail extourne, libellé directement après ajout opération, Dany De Bontridder, 2018/03/14
- [Noalyss-commit] [noalyss] 57/323: Task #0001527: Effacement du champ code fiche : bouton , indent, Dany De Bontridder, 2018/03/14
- [Noalyss-commit] [noalyss] 63/323: Task #0001529: Icon_Action missing, Dany De Bontridder, 2018/03/14
- [Noalyss-commit] [noalyss] 62/323: Merge branch 'master' of ssh://ns3/srv/git/noalyss, Dany De Bontridder, 2018/03/14
- [Noalyss-commit] [noalyss] 66/323: Database : add function is_prepare() to check if pg_prepare has already run, Dany De Bontridder, 2018/03/14
- [Noalyss-commit] [noalyss] 48/323: Task #1520 : Préférence : pouvoir changer les préférence pour les exports CSV, Dany De Bontridder, 2018/03/14