Task #4359 : Multiecran

This commit is contained in:
sparkyx 2005-07-04 20:14:28 +00:00
parent 2fa74b7510
commit 1c5abfa5cf
10 changed files with 156 additions and 59 deletions

View file

@ -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 '<h2 class="error">Journal inexistant</h2>';
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='<INPUT TYPE="BUTTON" VALUE="Cherche" OnClick="SearchPoste(\''.$sessid."','not')\">";
$search='<INPUT TYPE="BUTTON" VALUE="Cherche" OnClick="SearchPoste(\''.$sessid."','not','".$_GET['p_jrn']."')\">";
echo '<DIV CLASS="ccontent">';
echo '<H2 class="info"> Fiches </H2>';
echo '<FORM ACTION="jrn_detail.php" METHOD="POST">';

View file

@ -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']);

View file

@ -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="<TD>$this->label</TD><TD>$r</TD>";
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('<TD>
<INPUT TYPE="button" onClick=SearchPoste(\'%s\',\'%s\',\'%s\') value="Search">
%s</TD><TD>
<INPUT TYPE="Text" NAME="%s" VALUE="%s" SIZE="8">
</TD>',
$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('<TD>
<INPUT TYPE="button" onClick=SearchPosteFilter(\'%s\',\'%s\',\'%s\',\'%s\') value="Search">
%s</TD><TD>
<INPUT TYPE="Text" NAME="%s" VALUE="%s" SIZE="8">
</TD>',
$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('<TD>
<INPUT TYPE="button" onClick=NewCard(\'%s\',\'%s\',\'%s\',\'%s\') value="New">
<INPUT TYPE="button" onClick=SearchCard(\'%s\',\'%s\',\'%s\',\'%s\') value="Search">
%s</TD><TD>
<INPUT TYPE="Text" NAME="%s" VALUE="%s" SIZE="8">
</TD>',
$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() {

View file

@ -110,13 +110,13 @@ define ("FICHE_TYPE_FOURNISSEUR",8);
define ("FICHE_TYPE_FIN",4);
define ("FICHE_TYPE_ADM_TAX",14);
define ("JS_SEARCH_POSTE","<SCRIPT language=\"javascript\">function SearchPoste(p_sessid,p_ctl)
define ("JS_SEARCH_POSTE","<SCRIPT language=\"javascript\">function SearchPoste(p_sessid,p_ctl,p_jrn)
{
var win=window.open('poste_search.php?p_ctl='+p_ctl+'&PHPSESSID='+p_sessid,'Cherche','toolbar=no,width=600,height=600,scrollbars=yes,resizable=yes');
var win=window.open('poste_search.php?p_jrn='+p_jrn+'p_ctl='+p_ctl+'&PHPSESSID='+p_sessid,'Cherche','toolbar=no,width=600,height=600,scrollbars=yes,resizable=yes');
}
function SearchPosteFilter(p_sessid,p_ctl,p_filter)
function SearchPosteFilter(p_sessid,p_ctl,p_filter,jrn)
{
var win=window.open('poste_search.php?p_ctl='+p_ctl+'&PHPSESSID='+p_sessid+'&filter='+p_filter,'Cherche','toolbar=no,width=600,height=600,scrollbars=yes,resizable=yes');
var win=window.open('poste_search.php?p_jrn='+jrn+'&p_ctl='+p_ctl+'&PHPSESSID='+p_sessid+'&filter='+p_filter,'Cherche','toolbar=no,width=600,height=600,scrollbars=yes,resizable=yes');
}
function GetIt() {
window.close();
@ -191,13 +191,13 @@ define ("JS_SEARCH_CARD","
/* type must be cred or deb and name is
* the control's name
*/
function SearchCard(p_sessid,type,name)
function SearchCard(p_sessid,type,name,jrn)
{
var a=window.open('fiche_search.php?PHPSESSID='+p_sessid+'&type='+type+'&name='+name,'item','toolbar=no,width=350,height=450,scrollbars=yes');
var a=window.open('fiche_search.php?p_jrn='+jrn+'&PHPSESSID='+p_sessid+'&type='+type+'&name='+name,'item','toolbar=no,width=350,height=450,scrollbars=yes');
}
function NewCard(p_sessid,type,name)
function NewCard(p_sessid,type,name,jrn)
{
var a=window.open('fiche_new.php?PHPSESSID='+p_sessid+'&type='+type+'&name='+name,'item','toolbar=no,width=350,height=450,scrollbars=yes');
var a=window.open('fiche_new.php?p_jrn='+jrn+'&PHPSESSID='+p_sessid+'&type='+type+'&name='+name,'item','toolbar=no,width=350,height=450,scrollbars=yes');
}
/* SetValue( p_ctl,p_value )
/* p_ctl is the name of the control

View file

@ -235,6 +235,7 @@ function AddFiche($p_cn,$p_type,$p_array) {
*
* NOTE STAN: je ne trouve pas le nom "EncodeFiche" super claire pour une fonction qui affiche les détails d'une fiche...
* on ne changerait pas en "DisplayFiche" ?
* NOTE DANY: Oui je suis assez d'accord avec toi
*
*/
function EncodeFiche($p_cn,$p_type,$p_array=null) {

View file

@ -271,7 +271,7 @@ function FormVente($p_cn,$p_jrn,$p_user,$p_array=null,$view_only=true,$p_article
$r.=JS_SEARCH_CARD;
$r.=JS_SHOW_TVA;
$r.=JS_TVA;
$r.="<FORM NAME=\"form_detail\" ACTION=\"user_jrn.php?action=insert_vente\" METHOD=\"POST\">";
$r.="<FORM NAME=\"form_detail\" ACTION=\"user_jrn.php?action=insert_vente&p_jrn=$p_jrn\" METHOD=\"POST\">";
}
@ -307,8 +307,14 @@ function FormVente($p_cn,$p_jrn,$p_user,$p_array=null,$view_only=true,$p_article
}
}
$r.='<TR>'.InputType("Client ","js_search","e_client",$e_client,$view_only,$fiche).'</TD>';
// $r.='<TR>'.InputType("Client ","js_search","e_client",$e_client,$view_only,$fiche).'</TD>';
$W1=new widget("js_search");
$W1->label="Client";
$W1->name="e_client";
$W1->value=$e_client;
$W1->extra=$fiche; // list of card
$W1->extra2=$p_jrn;
$r.="<TR>".$W1->IOValue()."</TD>";
$r.= InputType("" ,"span" ,"e_client_label",$e_client_label,false).'</TD>';
$r.="</TABLE>";
@ -361,7 +367,15 @@ function FormVente($p_cn,$p_jrn,$p_user,$p_array=null,$view_only=true,$p_article
}
}
// Show input
$r.='<TR>'.InputType("","js_search","e_march".$i,$march,$view_only,'cred');
// $r.='<TR>'.InputType("","js_search","e_march".$i,$march,$view_only,'cred');
$W1=new widget("js_search");
$W1->label="";
$W1->name="e_march".$i;
$W1->value=$march;
$W1->extra='cred'; // credits
$W1->extra2=$p_jrn;
$r.="<TR>".$W1->IOValue()."</TD>";
// card's name
$r.=InputType("","span", "e_march".$i."_label", $march_label,$view_only);
@ -643,7 +657,7 @@ for ($o = 0;$o < $p_number; $o++) {
$r.="</DIV>";
if ( $p_doc == 'form' ) {
$r.='<FORM METHOD="POST" enctype="multipart/form-data" ACTION="user_jrn.php?action=record">';
$r.='<FORM METHOD="POST" enctype="multipart/form-data" ACTION="user_jrn.php?action=record&p_jrn='.$p_jrn.'">';
// check for upload piece
$file=new widget("file");
$file->table=1;
@ -845,7 +859,7 @@ function FormAch($p_cn,$p_jrn,$p_user,$p_submit,$p_array=null,$view_only=true,$p
}
$r.="<FORM NAME=\"form_detail\" enctype=\"multipart/form-data\" ACTION=\"user_jrn.php?action=new\" METHOD=\"POST\">";
$r.="<FORM NAME=\"form_detail\" enctype=\"multipart/form-data\" ACTION=\"user_jrn.php?action=new&p_jrn=$p_jrn\" METHOD=\"POST\">";
$r.='<TABLE>';
$r.='<TR>'.InputType("Date ","Text","e_date",$e_date,$view_only).'</TR>';
$r.='<TR>'.InputType("Echeance","Text","e_ech",$e_ech,$view_only).'</TR>';
@ -881,7 +895,13 @@ function FormAch($p_cn,$p_jrn,$p_user,$p_submit,$p_array=null,$view_only=true,$p
}
$r.="</TABLE>";
$r.="<TABLE>";
$r.='<TR>'.InputType("Fournisseur","js_search","e_client",$e_client,$view_only,'cred');
// $r.='<TR>'.InputType("Fournisseur","js_search","e_client",$e_client,$view_only,'cred');
$W1=new widget("js_search");
$W1->name="e_client";
$W1->value=$e_client;
$W1->extra='cred';
$W1->extra2=$p_jrn;
$r.="<TR>".$W1->IOValue();
$r.= InputType("" ,"span" ,"e_client_label",$e_client_label,false).'</TR>';
$r.="</TABLE>";
@ -956,7 +976,15 @@ function FormAch($p_cn,$p_jrn,$p_user,$p_submit,$p_array=null,$view_only=true,$p
return null;
}
}
$r.='<TR>'.InputType("","js_search","e_march".$i,$march,$view_only,'deb');
// $r.='<TR>'.InputType("","js_search","e_march".$i,$march,$view_only,'deb');
$W1=new widget("js_search");
$W1->label="";
$W1->name="e_march".$i;
$W1->value=$march;
$W1->extra='deb'; // credits
$W1->extra2=$p_jrn;
$r.="<TR>".$W1->IOValue()."</TD>";
$r.=InputType("","span", "e_march".$i."_label", $march_label,$view_only);
// price
$r.=InputType("","text","e_march".$i."_buy",$march_buy,$view_only);
@ -1213,7 +1241,7 @@ function FormFin($p_cn,$p_jrn,$p_user,$p_submit,$p_array=null,$view_only=true,$p
$r.=JS_CONCERNED_OP;
}
// $r.='<FORM METHOD="POST" enctype="multipart/form-data" ACTION="user_jrn.php?action=record">';
$r.="<FORM NAME=\"form_detail\" enctype=\"multipart/form-data\" ACTION=\"user_jrn.php?action=new\" METHOD=\"POST\">";
$r.="<FORM NAME=\"form_detail\" enctype=\"multipart/form-data\" ACTION=\"user_jrn.php?action=new&p_jrn=$p_jrn\" METHOD=\"POST\">";
$r.='<TABLE>';
$r.='<TR>'.InputType("Date ","Text","e_date",$e_date,$view_only).'</TR>';
@ -1249,7 +1277,15 @@ function FormFin($p_cn,$p_jrn,$p_user,$p_submit,$p_array=null,$view_only=true,$p
}
$r.='<TR>'.InputType("Banque","js_search","e_bank_account",$e_bank_account,$view_only,FICHE_TYPE_FIN).'</TR>';
// $r.='<TR>'.InputType("Banque","js_search","e_bank_account",$e_bank_account,$view_only,FICHE_TYPE_FIN).'</TR>';
$W1=new widget("js_search");
$W1->label="Banque";
$W1->name="e_bank_account";
$W1->value=$e_bank_account;
$W1->extra=FICHE_TYPE_FIN; // credits
$W1->extra2=$p_jrn;
$r.="<TR>".$W1->IOValue()."</TD>";
$r.="</TABLE>";
$r.= InputType("" ,"span" ,"e_bank_account_label",$e_bank_account_label,false).'</TD>';
@ -1309,7 +1345,15 @@ function FormFin($p_cn,$p_jrn,$p_user,$p_submit,$p_array=null,$view_only=true,$p
${"e_other$i"."_amount"}=(isset (${"e_other$i"."_amount"}))?${"e_other$i"."_amount"}:0;
// Compute the string to pass to InputType
$f=FICHE_TYPE_CLIENT.",".FICHE_TYPE_FOURNISSEUR.",".FICHE_TYPE_ADM_TAX.",".FICHE_TYPE_FIN;
$r.='<TR>'.InputType("","js_search","e_other".$i,$tiers,$view_only,'cred');
// $r.='<TR>'.InputType("","js_search","e_other".$i,$tiers,$view_only,'cred');
$W1=new widget("js_search");
$W1->label="";
$W1->name="e_other".$i;
$W1->value=$tiers;
$W1->extra='cred'; // credits
$W1->extra2=$p_jrn;
$r.="<TR>".$W1->IOValue()."</TD>";
$r.=InputType("","span", "e_other$i"."_label", $tiers_label,$view_only);
// Comment
$r.=InputType("","Text","e_other$i"."_comment",$tiers_comment,$view_only);
@ -1495,7 +1539,7 @@ function FormODS($p_cn,$p_jrn,$p_user,$p_submit,$p_array=null,$view_only=true,$p
if ( $view_only == false) {
$r.=JS_SEARCH_POSTE;
}
$r.="<FORM NAME=\"form_detail\" enctype=\"multipart/form-data\" ACTION=\"user_jrn.php?action=new\" METHOD=\"POST\">";
$r.="<FORM NAME=\"form_detail\" enctype=\"multipart/form-data\" ACTION=\"user_jrn.php?action=new&p_jrn=$p_jrn\" METHOD=\"POST\">";
$r.='<TABLE>';
$r.='<TR>'.InputType("Date ","Text","e_date",$e_date,$view_only).'</TR>';
$r.='<TR>'.InputType("Description","Text_big","e_comment",$e_comment,$view_only).'</TR>';
@ -1558,8 +1602,12 @@ function FormODS($p_cn,$p_jrn,$p_user,$p_submit,$p_array=null,$view_only=true,$p
}
else
$filter=null;
$r.='<TR>'.InputType("","js_search_poste","e_account".$i,$account,$view_only,$filter);
$W = new widget('js_search_poste');
$W->label="";
$W->extra=$p_jrn;
$W->extra2=$filter;
// $r.='<TR>'.InputType("","js_search_poste","e_account".$i,$account,$view_only,$filter);
$r.="<TR>".$W->IOValue("e_account".$i);
//libelle
$r.="<td> $lib </td>";
//amount

View file

@ -136,8 +136,10 @@ if ( $action == 'voir_jrn' ) {
}
?>
<div class="u_redcontent">
<form method="post" action="user_jrn.php?action=voir_jrn">
<?
echo "<form method= \"post\" action=\"user_jrn.php?action=voir_jrn&p_jrn=$p_jrn\">";
$w=new widget("select");
$periode_start=make_array($cn,"select p_id,to_char(p_start,'DD-MM-YYYY') from parm_periode order by p_id");

View file

@ -145,8 +145,10 @@ if ( $action == 'voir_jrn' ) {
}
?>
<div class="u_redcontent">
<form method="post" action="user_jrn.php?action=voir_jrn&p_jrn=hop">
<?
echo "<form method= \"post\" action=\"user_jrn.php?action=voir_jrn&p_jrn=$p_jrn\">";
$w=new widget("select");
$periode_start=make_array($cn,"select p_id,to_char(p_start,'DD-MM-YYYY') from parm_periode order by p_id");

View file

@ -142,8 +142,10 @@ if ( $action == 'voir_jrn' ) {
// Date - date of payment - Customer - amount
?>
<div class="u_redcontent">
<form method="post" action="user_jrn.php?action=voir_jrn">
<?
echo "<form method= \"post\" action=\"user_jrn.php?action=voir_jrn&p_jrn=$p_jrn\">";
$w=new widget("select");
$periode_start=make_array($cn,"select p_id,to_char(p_start,'DD-MM-YYYY') from parm_periode order by p_id");

View file

@ -127,8 +127,9 @@ if ( isset($_POST["record_and_print_invoice"])) {
}
?>
<div class="u_redcontent">
<form method="post" action="user_jrn.php?action=voir_jrn">
<?
echo "<form method= \"post\" action=\"user_jrn.php?action=voir_jrn&p_jrn=$p_jrn\">";
$w=new widget("select");
$periode_start=make_array($cn,"select p_id,to_char(p_start,'DD-MM-YYYY') from parm_periode order by p_id");
@ -167,32 +168,6 @@ if ( $action == 'voir_jrn_non_paye' ) {
echo $list2;
echo '</div>';
}
// if ( $action == 'impress' ) {
// // Print list of sell or print the current invoice
// }
//Search
// if ( $action == 'search' ) {
// // Check privilege
// if ( CheckJrn($g_dossier,$g_user,$p_jrn) < 1 ) {
// NoAccess();
// exit -1;
// }
// // PhpSessid
// $sessid=(isset ($_POST['PHPSESSID']))?$_POST['PHPSESSID']:$_GET['PHPSESSID'];
// // display a search box
// $search_box=u_ShowMenuRecherche($cn,$p_jrn,$sessid,$HTTP_POST_VARS);
// echo '<DIV class="u_redcontent">';
// echo $search_box;
// // if nofirst is set then show result
// if ( isset ($_GET['nofirst'] ) ) {
// $a=ListJrn($cn,$p_jrn,"",$HTTP_POST_VARS);
// echo $a;
// }
// echo '</DIV>';
// }
include("user_update.php");
?>