From e2f3f237c75c196d4e67ebdccf8b7d0195844e62 Mon Sep 17 00:00:00 2001 From: sparkyx Date: Thu, 9 Jan 2025 19:22:56 +0100 Subject: [PATCH] 0002405: CARD : Fiche affiche toutes les fiches --- html/css/style-classic7.css | 4 +-- include/fiche.inc.php | 51 ++++++++++++++++++++++----- include/template/impress_cat_card.php | 3 ++ 3 files changed, 48 insertions(+), 10 deletions(-) diff --git a/html/css/style-classic7.css b/html/css/style-classic7.css index 54d1b3eb2..dd91df3a6 100644 --- a/html/css/style-classic7.css +++ b/html/css/style-classic7.css @@ -25,8 +25,8 @@ BODY { color:darkblue !important; background-color:#FCFDFD; --hover : rgba(108, 130, 208, 0.9); - --border-size:8px; - --accent-color:lightblue; + --border-size:6px; + --accent-color:lightblue; --input-color:#4b4b91; --color-red:Crimson; --color-blue2: cornflowerblue; diff --git a/include/fiche.inc.php b/include/fiche.inc.php index 383703f08..46cf1c30e 100644 --- a/include/fiche.inc.php +++ b/include/fiche.inc.php @@ -33,30 +33,46 @@ global $g_user, $g_failed; /** * Show first the form */ -/* category */ +/* var categorie ISelect select card category */ $categorie = new ISelect('cat'); $categorie->value = $cn->make_array("select fd_id,fd_label||' ('||(select count(*) from fiche where fiche.fd_id=fiche_def.fd_id)::text||')' from fiche_def order by fd_label"); $categorie->selected = $http->get('cat','number',0); + +// var $str_categorie string $str_categorie = $categorie->input(); $ac = $http->request('ac'); + +// var $icall ICheckBox : all card or only the current category $icall = new ICheckBox("allcard", 1); $icall->selected = (isset($_GET['allcard'])) ? 1 : 0; +// var $str_icall string $str_icall = $icall->input(); -/* periode */ + +/* var $exercice string current exercice (depending of user's period preferences) */ $exercice = $g_user->get_exercice(); $iperiode = new Periode($cn); list ($first, $last) = $iperiode->get_limit($exercice); +/* + * var $periode_start IDate start date + * var $periode_end IDate end date +*/ $periode_start = new IDate('start'); $periode_end = new IDate('end'); $periode_start->value = $http->get('start',"date",$first->first_day()); $periode_end->value = $http->get('end','date', $last->last_day()); +/* + * var $str_start string date dd.mm.yyyy + * var $str_end string date dd.mm.yyyy + */ $str_start = $periode_start->input(); $str_end = $periode_end->input(); -/* histo ou summary */ + + +/* var $histo ISelect choice */ $histo = new ISelect('histo'); $histo->value = array( array('value' => -1, 'label' => _('Liste')), @@ -76,6 +92,11 @@ $histo->javascript = 'onchange="if (this.value==3 || this.value==-1) { $histo->selected = $http->get('histo',"number", -1); $str_histo = $histo->input(); + +// $inactive checkbox include inactive cards +$inactive = new ICheckbox ('inactive',1); +$inactive->selected=$http->request('inactive','string',0); +$str_inactive=$inactive->input(); ?>
@@ -152,7 +173,7 @@ if ($histo->selected == -1) */ if (isset($_POST['move'])&& $_POST['move'] == 1) { - $move_to=$http->post("move_to","number"); + $move_to=$http->post("move_to","number"); for ($i = 0; $i < count($ack); $i++) { $fiche = new Fiche($cn, $ack[$i]); @@ -188,15 +209,29 @@ if ($histo->selected == -1) } } $sql = "select f_id from fiche "; - if ($allcard == 1) + + // build SQL : all cards or only the selected category , with inactive cards included or only active + if ($allcard == 1 && $inactive->selected == 1) { + // all categories , including inactive cards $cond = ""; - } - else + }elseif ($allcard == 1 && $inactive->selected== 0) + { + // all categories and only active cards + $cond = " where f.f_enable = '1' "; + } + elseif ($allcard == 0 && $inactive->selected == 1) { + // one categorie , including inactive cards $p_cat=$http->get("cat","number"); $cond = " where f.fd_id = " . sql_string($p_cat); - } + }elseif ($allcard == 0 && $inactive->selected == 0) { + // one categorie , without inactive cards + $p_cat=$http->get("cat","number"); + $cond = " where f.fd_id = " . sql_string($p_cat); + $cond .= " and f.f_enable='1'"; + } + // Create nav bar $max = $cn->get_value("select count(*) from fiche as f " . $cond); diff --git a/include/template/impress_cat_card.php b/include/template/impress_cat_card.php index 46563b884..1adf8733d 100644 --- a/include/template/impress_cat_card.php +++ b/include/template/impress_cat_card.php @@ -21,5 +21,8 @@ + + +