diff --git a/html/jrn_detail.php b/html/jrn_detail.php index 1e710ede3..451f99de0 100644 --- a/html/jrn_detail.php +++ b/html/jrn_detail.php @@ -47,9 +47,10 @@ if ( $User->CheckAction($cn,GJRN) == 0 ){ echo JS_SEARCH_POSTE; if ( isset( $_GET['p_jrn'] )) { $p_jrn=$_GET['p_jrn']; - $_SESSION["p_jrn"]=$p_jrn; - -} + } else { + echo '

Journal inexistant

'; + exit(); + } @@ -113,7 +114,7 @@ $Res=ExecSql($cn,"select jrn_def_name,jrn_def_class_deb,jrn_def_class_cred,". " jrn_def_id=".$_GET['p_jrn']); $l_line=pg_fetch_array($Res,0); $sessid = $_REQUEST['PHPSESSID']; -$search='"; +$search='"; echo '
'; echo '

Fiches

'; echo '
'; diff --git a/html/user_jrn.php b/html/user_jrn.php index 7ef7da19b..120cdee0b 100644 --- a/html/user_jrn.php +++ b/html/user_jrn.php @@ -48,7 +48,6 @@ if ( isset( $_GET['p_jrn'] )) if ( isset ($_GET['JRN_TYPE'] ) ) { $p_jrn=-1; } -//$_SESSION["p_jrn"]=$p_jrn; ShowMenuCompta($_SESSION['g_dossier']); diff --git a/include/class_widget.php b/include/class_widget.php index b222f8ad5..5d5219ac7 100644 --- a/include/class_widget.php +++ b/include/class_widget.php @@ -36,6 +36,8 @@ class widget { var $table; var $label; var $disabled; + var $extra; + var $extra2; function widget($p_type="") { $this->type=$p_type; $this->readonly=false; @@ -59,9 +61,10 @@ class widget { $p_label is the label of the INPUT return : string containing the tag +++*/ - function IOValue($p_name,$p_value=null,$p_label="") { + function IOValue($p_name=null,$p_value=null,$p_label="") { // echo __FILE__."p_value $p_value"; - $this->name=$p_name; + if ( $p_name != null) + $this->name=$p_name; $this->value=($p_value===null)?"":$p_value; $this->label=($p_label == "")?$this->label:$p_label; //echo "this->value =".$this->value; @@ -194,6 +197,70 @@ class widget { if ( $this->table==1) $r="$this->label$r"; return $r; } + // input type == js_search_poste => button search for the account + if ( strtolower($this->type)=="js_search_poste") { + + $l_sessid=$_REQUEST['PHPSESSID']; + // Do we need to filter ?? + if ( $this->extra2 == null ) { + $r=sprintf(' + + %s + + + ', + $l_sessid, + $this->name, + $this->extra, + $this->label, + $this->name, + $this->value + ); + + } else { // $p_list is not null, so we have a filter + $r=sprintf(' + + %s + + + ', + $l_sessid, + $this->name, + $this->extra2, + $this->extra, + $this->label, + $this->name, + $this->value + ); + + } //else + return $r; + } // end js_search_poste + + // input type == js_search => button search for card + if ( strtolower($this->type)=="js_search") { + $l_sessid=$_REQUEST['PHPSESSID']; + $r=sprintf(' + + + %s + + + ', + $l_sessid, + $this->extra, // deb or cred + $this->name, + $this->extra2, //jrn + $l_sessid, + $this->extra, + $this->name, + $this->extra2, + $this->label, + $this->name, + $this->value + ); + return $r; + } } //end function function debug() { diff --git a/include/constant.php b/include/constant.php index b81472179..70ae370e2 100644 --- a/include/constant.php +++ b/include/constant.php @@ -110,13 +110,13 @@ define ("FICHE_TYPE_FOURNISSEUR",8); define ("FICHE_TYPE_FIN",4); define ("FICHE_TYPE_ADM_TAX",14); -define ("JS_SEARCH_POSTE","