diff --git a/html/css/style-classic7.css b/html/css/style-classic7.css index 3b5609bf8..8660a45d4 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/class/fiche.class.php b/include/class/fiche.class.php index 401763c11..de666f035 100644 --- a/include/class/fiche.class.php +++ b/include/class/fiche.class.php @@ -1560,26 +1560,40 @@ class Fiche else return 1; } - /*!\brief get all the card from a categorie + /*! + * \brief get all the card from a categorie *\param $p_cn database connx - *\param $pFd_id is the category id + *\param $card_category_id is the category id *\param $p_order for the sort, possible values is name_asc,name_desc or nothing + * \param $inactive int possible values : 1 = inactive included, 0 = only active ones (default 1) *\return an array of card, but only the fiche->id is set */ - static function get_fiche_def($p_cn,$pFd_id,$p_order='') + static function get_fiche_def($p_cn,$card_category_id,$p_order='',$inactive=1) { + // var $cond_active string SQL cond for filtering active or not + $cond_active=($inactive == 1)?"":" and f_enable='1' "; + switch ($p_order) { case 'name_asc': - $sql='select f_id,ad_value from fiche join fiche_detail using (f_id) where ad_id=1 and fd_id=$1 order by 2 asc'; + $sql="select f_id,ad_value from fiche join fiche_detail using (f_id) + where + ad_id=1 + and fd_id=$1 + $cond_active + order by 2 asc"; break; case 'name_desc': - $sql='select f_id,ad_value from fiche join fiche_detail using (f_id) where ad_id=1 and fd_id=$1 order by 2 desc'; + $sql="select f_id,ad_value from fiche join fiche_detail using (f_id) + where ad_id=1 + and fd_id=$1 + $cond_active + order by 2 desc"; break; default: - $sql='select f_id from fiche where fd_id=$1 '; + $sql="select f_id from fiche where fd_id=$1 $cond_active "; } - $array=$p_cn->get_array($sql,array($pFd_id)); + $array=$p_cn->get_array($sql,array($card_category_id)); return $array; } diff --git a/include/class/fiche_def.class.php b/include/class/fiche_def.class.php index 586a752a3..8d9e23b23 100644 --- a/include/class/fiche_def.class.php +++ b/include/class/fiche_def.class.php @@ -337,16 +337,18 @@ $order * \brief Get all the card where the fiche_def.fd_id is given in parameter * \param $step = 0 we don't use the offset, page_size,... * $step = 1 we use the jnr_bar_nav - * + * \param $inactive int possible values : 1 = inactive included, 0 = only active ones (default 1) * \return array ('f_id'=>..,'ad_value'=>..) *\see fiche */ - function get_by_type($step=0) + function get_by_type($step=0,$inactive=1) { + // var $cond_active string SQL cond for filtering active or not + $cond_active=($inactive == 1)?"":" and f_enable='1' "; $sql="select f_id,ad_value from fiche join fiche_detail using(f_id) - where ad_id=1 and fd_id=$1 order by 2"; + where ad_id=1 and fd_id=$1 $cond_active order by 2"; // we use navigation_bar if ($step == 1 && $_SESSION[SESSION_KEY.'g_pagesize'] != -1 ) @@ -361,18 +363,24 @@ $order return $Ret; } /*! - * \brief Get all the card where the fiche_def.frd_id is given in parameter - * \return array of fiche or null is nothing is found + * \brief Get all the card where the fiche_def.frd_id is given in parameter, it is the template for category + *\param $inactive int possible values : 1 = inactive included, 0 = only active ones (default 1) + * \param $template_category int FICHE_DEF_REF.FRD_ID + * \return array of Fiche or null is nothing is found + * */ - function get_by_category($p_cat) + function get_by_category($template_category,$inactive=1) { + // var $cond_active string SQL cond for filtering active or not + $cond_active=($inactive == 1)?"":" and f_enable='1' "; $sql="select f_id,ad_value from fiche join fiche_def using(fd_id) join fiche_detail using(f_id) - where ad_id=1 and frd_id=$1 order by 2 "; + where ad_id=1 and frd_id=$1 $cond_active + order by 2 "; - $Ret=$this->cn->exec_sql($sql,array($p_cat)); + $Ret=$this->cn->exec_sql($sql,array($template_category)); if ( ($Max=Database::num_row($Ret)) == 0 ) return null; $all[0]=new Fiche($this->cn); diff --git a/include/export/export_fiche_csv.php b/include/export/export_fiche_csv.php index 06bdc23f2..ecfbc0b9b 100644 --- a/include/export/export_fiche_csv.php +++ b/include/export/export_fiche_csv.php @@ -39,7 +39,7 @@ if ( isset ($_GET['fd_id'])) { $fiche_def=new Fiche_Def($cn,$http->get('fd_id',"number")); $fiche=new Fiche($cn); - $e=$fiche_def->get_by_type(); + $e=$fiche_def->get_by_type(inactive: $http->request('inactive')); $o=0; // Heading $fiche_def->GetAttribut(); diff --git a/include/fiche.inc.php b/include/fiche.inc.php index 383703f08..9a673050b 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(); ?>