diff --git a/html/ajax_ledger.php b/html/ajax_ledger.php index 60027a0d2..07c79abf4 100644 --- a/html/ajax_ledger.php +++ b/html/ajax_ledger.php @@ -51,7 +51,22 @@ $cn=new Database(dossier::id()); // check if the user is valid and can access this folder $User=new User($cn); $User->check(); -if ( $User->check_dossier(dossier::id(),true)=='X' ) exit(); +if ( $User->check_dossier(dossier::id(),true)=='X' ) { + ob_start(); + require_once ('template/ledger_detail_forbidden.php'); + $html=ob_get_contents(); + ob_clean(); + $html=escape_xml($html); + header('Content-type: text/xml; charset=UTF-8'); +echo << + +$div +$html + +EOF; +exit(); +} // check if the user can access the ledger where the operation is (view) and @@ -60,7 +75,23 @@ $op=new Acc_Operation($cn); $op->jr_id=$_GET['jr_id']; $ledger=$op->get_ledger(); $access=$User->get_ledger_access($ledger); -if ( $access == 'X' ) exit(); +if ( $access == 'X' ) { + ob_start(); + require_once ('template/ledger_detail_forbidden.php'); + $html=ob_get_contents(); + ob_clean(); + + $html=escape_xml($html); + header('Content-type: text/xml; charset=UTF-8'); +echo << + +$div +$html + +EOF; +exit(); +} $html=var_export($_REQUEST,true); switch ($action) { @@ -102,14 +133,21 @@ case 'de': $op->get(); $obj=$op->get_quant(); /* return an obj. ACH / FIN or VEN or null if nothing is found*/ if ( $obj->det->jr_pj_name=='') { - echo '
'; - echo HtmlInput::hidden('act','loadfile'); - echo dossier::hidden(); - echo HtmlInput::hidden('jr_id',$jr_id); - echo HtmlInput::hidden('div',$div); + if ( $access=='W') { + echo ''; + $sp=new ISpan('file'.$div);$sp->style="display:none;width:155;height:15;background-color:red;color:white;font-size:14"; + $sp->value="Chargement"; + echo $sp->input(); + echo HtmlInput::hidden('act','loadfile'); + echo dossier::hidden(); + echo HtmlInput::hidden('jr_id',$jr_id); + echo HtmlInput::hidden('div',$div); - echo ''; - echo '
'; + echo ''; + echo ''; + } else { + echo _('Aucun fichier'); + } exit(); } else { echo ""; @@ -121,6 +159,8 @@ case 'de': $h=sprintf('%s', $gDossier,$ledger,$obj->det->jr_grpt_id,h( $obj->det->jr_pj_name)); echo $h; + $x=''; + if ($access=='W') $x=sprintf('enlever', $gDossier,$div,$jr_id); echo $x; @@ -131,7 +171,7 @@ case 'de': // load a file ///////////////////////////////////////////////////////////////////////////// case 'loadfile': - if ( isset ($_FILES)) { + if ( $access == 'W' && isset ($_FILES)) { $cn->start(); // remove the file $grpt=$cn->get_value('select jr_grpt_id from jrn where jr_id=$1',array($jr_id)); @@ -160,13 +200,18 @@ case 'de': // remove a file ///////////////////////////////////////////////////////////////////////////// case 'rmf': + if ( $access == 'W' ){ echo '
'; + $sp=new ISpan('file'.$div);$sp->style="display:none;width:155;height:15;background-color:red;color:white;font-size:14"; + $sp->value="Chargement"; + echo $sp->input(); + echo HtmlInput::hidden('act','loadfile'); echo dossier::hidden(); echo HtmlInput::hidden('jr_id',$jr_id); echo HtmlInput::hidden('div',$div); - echo ''; + echo ''; echo '
'; $ret=$cn->exec_sql("select jr_pj from jrn where jr_id=$1",array($jr_id)); if (Database::num_row($ret) != 0) { @@ -182,11 +227,13 @@ case 'rmf': $cn->exec_sql("update jrn set jr_pj=null, jr_pj_name=null, ". "jr_pj_type=null where jr_id=$1",array($jr_id)); } + } exit(); ///////////////////////////////////////////////////////////////////////////// // Save operation detail ///////////////////////////////////////////////////////////////////////////// case 'save': + if ( $access=="W") { $cn->exec_sql('update jrn set jr_comment=$1,jr_pj_number=$2 where jr_id=$3', array($_GET['lib'],$_GET['npj'],$jr_id)); $rapt=$_GET['rapt']; @@ -210,14 +257,17 @@ case 'rmf': $rec->insert($rapt); } } + } break; ///////////////////////////////////////////////////////////////////////////// // remove a reconciliation ///////////////////////////////////////////////////////////////////////////// case 'rmr': - $rec=new Acc_Reconciliation($cn); - $rec->set_jr_id($jr_id); - $rec->remove($_GET['jr_id2']); + if ( $access=='W') { + $rec=new Acc_Reconciliation($cn); + $rec->set_jr_id($jr_id); + $rec->remove($_GET['jr_id2']); + } break; } $html=escape_xml($html); diff --git a/html/js/scripts.js b/html/js/scripts.js index 28e961579..04d97de8b 100644 --- a/html/js/scripts.js +++ b/html/js/scripts.js @@ -472,7 +472,7 @@ function success_box(req,json) code_html=unescape_xml(code_html); g(name_ctl).innerHTML=code_html; g(name_ctl).style.height='auto'; - g(name_ctl).style.width='auto'; +/* g(name_ctl).style.width='auto';*/ } catch (e) { alert("success_box"+e.message);} diff --git a/html/style-color.css b/html/style-color.css index 7ed20ea8f..3df15b00a 100644 --- a/html/style-color.css +++ b/html/style-color.css @@ -834,14 +834,16 @@ h2.gest_name { } div.op_detail { - background-color:#EDF3FF; + background-color:#e4e7ed; font-size:10; font-family:helvetica,arial,sans-serif; padding:0; margin:0; overflow:none; + z-index:3; -position:fixed;width:500;height:200;left:20%; +position:absolute;width:500;height:200;left:200; + border:1px solid darkblue; } div.op_detail_title { diff --git a/include/template/ledger_detail_bottom.php b/include/template/ledger_detail_bottom.php index bc74fdf44..ad1d189e3 100644 --- a/include/template/ledger_detail_bottom.php +++ b/include/template/ledger_detail_bottom.php @@ -24,16 +24,22 @@ if ($aRap != null ) { $aRap[$e], $tableid ); - echo tr (td(''.$internal.'').td($amount).td($rmReconciliation->input())); + if ( $access=='W') + $remove=$rmReconciliation->input(); + else + $remove=''; + echo tr (td(''.$internal.'').td($amount).td($remove)); } echo ''; } ?> det->jr_montant."')\">"; -$rapt=new IText('rapt'.$div); -echo $rapt->input().$search; +if ( $access=='W') { + $search='det->jr_montant."')\">"; + $rapt=new IText('rapt'.$div); + echo $rapt->input().$search; +} ?> label="Fermer"; $a->javascript="removeDiv('".$div."')"; echo $a->input(); ?> - - +'; +} +?> diff --git a/include/template/ledger_detail_file.php b/include/template/ledger_detail_file.php index 98e274d55..d8ae16bcb 100644 --- a/include/template/ledger_detail_file.php +++ b/include/template/ledger_detail_file.php @@ -6,4 +6,4 @@ */ $str='?'.dossier::get()."&div=$div&act=file&jr_id=$jr_id"; ?> - \ No newline at end of file + \ No newline at end of file diff --git a/include/template/ledger_detail_fin.php b/include/template/ledger_detail_fin.php index b6420b96b..b388171de 100644 --- a/include/template/ledger_detail_fin.php +++ b/include/template/ledger_detail_fin.php @@ -1,7 +1,10 @@
+
+ + @@ -20,7 +23,7 @@ echo td($bk->get_quick_code()); * et celui qui est ni client ni fournisseur est forcément le compte banque, insérer. *@todo Ajouter une clef unique sur quant_fin.jr_id, quant_purchase.j_id et quant_sold.j_id */ -echo td($bk->getName()); +echo td(h($bk->getName())); ?> @@ -29,16 +32,16 @@ echo td($bk->getName()); $bk=new Fiche($cn,$obj->det->array[0]['qf_other']); echo td($bk->get_quick_code()); -echo td($bk->getName()); +echo td(h($bk->getName())); ?> value=$obj->det->jr_comment; -$itext->size=40; -echo td(_('Libellé')).td($itext->input()); + $itext=new IText('lib'); + $itext->value=$obj->det->jr_comment; + $itext->size=40; + echo td(_('Libellé')).td($itext->input()); ?> @@ -77,7 +80,7 @@ $detail->get(); } else { // libellé du compte $name=$cn->get_value('select pcm_lib from tmp_pcmn where pcm_val=$1',array($q[$e]['j_poste'])); - $row.=td($name); + $row.=td(h($name)); } $montant=td($q[$e]['j_montant'],'class="num"'); $row.=($q[$e]['j_debit']=='t')?$montant:td(''); diff --git a/include/template/ledger_detail_top.php b/include/template/ledger_detail_top.php index 65cd800df..68dc56b64 100644 --- a/include/template/ledger_detail_top.php +++ b/include/template/ledger_detail_top.php @@ -1,7 +1,7 @@
Fermer'; +echo 'Fermer'; ?>
get_name()); ?> -det->jr_internal; ?> \ No newline at end of file +det->jr_internal); ?> \ No newline at end of file