$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 <<$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 '';
+ 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 '';
$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 '';
}
?>
-$search='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;
+}
?>
@@ -45,5 +51,8 @@ $a->label="Fermer";
$a->javascript="removeDiv('".$div."')";
echo $a->input();
?>
- echo HtmlInput::submit('save','Sauver'); ?>
-
+';
+}
+?>
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 @@
require_once('template/ledger_detail_top.php'); ?>