diff --git a/html/annulation.php b/html/annulation.php index f3ec773ef..9c41be2d2 100644 --- a/html/annulation.php +++ b/html/annulation.php @@ -23,6 +23,7 @@ include_once ("poste.php"); include_once("preference.php"); include_once("central_inc.php"); include_once("user_common.php"); +include_Once("form_input.php"); html_page_start($g_UserProperty['use_theme']); if ( ! isset ( $g_dossier ) ) { @@ -54,12 +55,52 @@ foreach ($l_array as $key=>$element) { if ( isset ($annul) ) { if ( isset ($_POST['p_id'])) { // Get the current periode - $period=GetUserPeriode($cn,$g_user); - $p_id=$_POST['p_id']; + $period=GetUserPeriode($cn,$g_user); + $p_id=$_POST['p_id']; + // Get the date + $e_op_date=$_POST['op_date']; + + + // Test if date is valid + if ( isDate ($e_op_date) == null ) { + $msg='Invalid Date'; + echo ""; + // set an incorrect pid to get out from here + $p_id=-1; + } + // userPref contient la periode par default + $userPref=GetUserPeriode($cn,$g_user); + list ($l_date_start,$l_date_end)=GetPeriode($cn,$userPref); + + // Date dans la periode active + echo_debug ("date start periode $l_date_start date fin periode $l_date_end date demandée $e_op_date"); + if ( cmpDate($e_op_date,$l_date_start)<0 || + cmpDate($e_op_date,$l_date_end)>0 ) + { + $msg="Not in the active periode please change your preference"; + echo_error($msg); echo_error($msg); + echo ""; + + // set an incorrect pid to get out from here + $p_id=-1; + + } + // Periode fermée + if ( PeriodeClosed ($cn,$userPref)=='t' ) + { + $msg="This periode is closed please change your preference"; + echo_error($msg); echo_error($msg); + echo ""; + // set an incorrect pid to get out from here + $p_id=-1; + } + + // Test is date is not in a closed periode + // Check if it a centralize operation - if ( isCentralize($cn,$p_id) == 0 and - isValid($cn,$p_id) == 1 ) { - + if ( isValid($cn,$p_id) == 1 ) { + + // get the next op id $seq=GetNextId($cn,'j_grpt')+1; @@ -94,21 +135,27 @@ if ( isset ($annul) ) { // Update jr_valid $Res=ExecSql($cn,"update jrn set jr_valid=false where jr_grpt_id=$p_id"); echo '

Opération annulée

'; - } - ?> Opération '.$l_array['jr_internal'].""; -echo 'Date : '.$e_op_date; + }// if isValid + + } // if Post['p_id'] +}// if annul +echo '
Opération '.$l_array['jr_internal'].'
+
+
'; + +$a=InputType("Date","text", "op_date",$e_op_date,false); +//echo 'Date : '.$e_op_date; +echo $a; echo '
'; -echo $e_comment; +$a=InputType("Description:","text","comment",$e_comment,false); +echo $a; echo '
'; if ( isset ($e_ech) ) { @@ -139,10 +186,10 @@ if ( $a != null ) { }// if ( $a != null ) { echo ' - + - +
'; html_page_stop(); diff --git a/html/jrn_detail.php b/html/jrn_detail.php index 8dcc8ce3e..e7c6ef529 100644 --- a/html/jrn_detail.php +++ b/html/jrn_detail.php @@ -44,7 +44,7 @@ if ( $g_UserProperty['use_admin'] == 0 ) { } } -//echo ''; +// Javascript echo JS_SEARCH_POSTE; if ( isset( $_GET['p_jrn'] )) { session_register("g_jrn"); diff --git a/include/form_input.php b/include/form_input.php index fc37ddedb..247242500 100644 --- a/include/form_input.php +++ b/include/form_input.php @@ -25,8 +25,8 @@ include_once("user_common.php"); * Purpose : Create the tag * * parm : - * - Label - * - The type + * - Label question + * - The type (text, select, text_big * - Name of the variable * - Default Value * - View_only