[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 03/03: Restructure files , move show_document
From: |
Dany De Bontridder |
Subject: |
[Noalyss-commit] [noalyss] 03/03: Restructure files , move show_document_modele.php to export_document_template.php |
Date: |
Sat, 17 Oct 2015 15:07:06 +0000 |
sparkyx pushed a commit to branch master
in repository noalyss.
commit 659cbc6b0fbf25ecd3aed37188a05f1deda732bf
Author: Dany De Bontridder <address@hidden>
Date: Sat Oct 17 17:01:04 2015 +0200
Restructure files , move show_document_modele.php to
export_document_template.php
---
include/ajax/ajax_mod_document.php | 2 +-
include/class/class_document_modele.php | 9 +++++----
.../export/export_document_template.php | 12 ------------
include/template/modele_document.php | 5 +++--
sql/upgrade.sql | 11 ++++++++---
5 files changed, 17 insertions(+), 22 deletions(-)
diff --git a/include/ajax/ajax_mod_document.php
b/include/ajax/ajax_mod_document.php
index a260467..909a803 100644
--- a/include/ajax/ajax_mod_document.php
+++ b/include/ajax/ajax_mod_document.php
@@ -28,7 +28,7 @@ require_once NOALYSS_INCLUDE.'/class/class_dossier.php';
require_once NOALYSS_INCLUDE.'/class/class_document_modele.php';
/* 1. Check security */
-$cn=Dossier::id();
+$cn=Dossier::connect();
/* 2. find the document */
$doc=new Document_Modele($cn,$id);
diff --git a/include/class/class_document_modele.php
b/include/class/class_document_modele.php
index 85c6ae5..33cb7d8 100644
--- a/include/class/class_document_modele.php
+++ b/include/class/class_document_modele.php
@@ -52,8 +52,8 @@ class Document_modele
*/
function myList()
{
- $s=dossier::get();
- $sql="select md_id,md_name,md_affect,dt_value from document_modele
join document_type on(dt_id=md_type) order by md_name";
+ $dosid=dossier::id();
+ $sql="select md_id,md_name,md_affect,dt_value,md_filename from
document_modele join document_type on(dt_id=md_type) order by md_name";
$Res=$this->cn->exec_sql($sql);
$all=Database::fetch_all($Res);
$r='';
@@ -80,14 +80,15 @@ class Document_modele
$r.="</td>";
$r.=td(h($row['md_affect']));
$r.="<td>";
- $r.='<A
HREF="show_document_modele.php?md_id='.$row['md_id'].'&'.$s.'">Document</a>';
+
$href=http_build_query(array('gDossier'=>$dosid,'md_id'=>$row['md_id'],'act'=>'RAW:document_template'));
+ $r.='<A
HREF="export.php?'.$href.'">'.h($row['md_filename']).'</a>';
$r.="</td>";
$r.="<TD>";
$c=new ICheckBox();
$c->name="dm_remove_".$row['md_id'];
$r.=$c->input();
$r.="</td>";
-
$r.=td(HtmlInput::detail_modele_document($row['md_id'],'Modifier'));
+
$r.=td(HtmlInput::detail_modele_document($row['md_id'],_('Modifier')));
$r.="</tr>";
}
diff --git a/html/show_document_modele.php
b/include/export/export_document_template.php
similarity index 88%
rename from html/show_document_modele.php
rename to include/export/export_document_template.php
index 61002b8..d60b2fb 100644
--- a/html/show_document_modele.php
+++ b/include/export/export_document_template.php
@@ -21,22 +21,10 @@
/*! \file
* \brief send the document template
*/
-require_once '../include/constant.php';
require_once NOALYSS_INCLUDE.'/lib/class_database.php';
require_once NOALYSS_INCLUDE.'/lib/ac_common.php';
require_once NOALYSS_INCLUDE.'/class/class_dossier.php';
-$gDossier=dossier::id();
-$cn=Dossier::connect();
-
-
-require_once NOALYSS_INCLUDE.'/class/class_user.php';
-global $g_user;
-$g_user=new User($cn);
-$g_user->Check();
-$g_user->check_dossier($gDossier);
-
-set_language();
if ( $g_user->check_module("CFGDOC") == 0 ) exit();
// retrieve the document
$r=$cn->exec_sql("select md_id,md_lob,md_filename,md_mimetype
diff --git a/include/template/modele_document.php
b/include/template/modele_document.php
index 679b824..1ba0ef7 100644
--- a/include/template/modele_document.php
+++ b/include/template/modele_document.php
@@ -60,9 +60,10 @@ echo $a->input();
<td>
<?php echo _("Fichier")?>
<?php
- $s=dossier::get();
+ $dosid=dossier::id();
+
$href=http_build_query(array('gDossier'=>$dosid,'md_id'=>$doc->md_id,'act'=>'RAW:document_template'));
- echo '<A
HREF="show_document_modele.php?md_id='.$doc->md_id.'&'.$s.'">(fichier
actuel)</a>';
+ echo '<A HREF="export.php?'.$href.'">'.'('._('fichier actuel').')</a>';
?>
</td>
<td>
diff --git a/sql/upgrade.sql b/sql/upgrade.sql
index 84a2c73..906e444 100644
--- a/sql/upgrade.sql
+++ b/sql/upgrade.sql
@@ -7,12 +7,17 @@ CREATE TRIGGER fiche_detail_upd_trg
EXECUTE PROCEDURE comptaproc.fiche_detail_qcode_upd();
insert into menu_ref(me_code,me_file,me_menu,me_description,me_type)
-values ('RAW:receipt','export_receipt.php','Export la pièce','export la pièce
justificative d''une opération','PR');
+values ('RAW:receipt','export_receipt.php','Exporte la pièce','export la pièce
justificative d''une opération','PR');
insert into profile_menu (me_code,p_id,p_type_display) select
'RAW:receipt',p_id,'P' from profile where p_id > 0;
insert into menu_ref(me_code,me_file,me_menu,me_description,me_type)
-values ('RAW:document','export_document.php','Export le document','export le
document d''une événement','PR');
+values ('RAW:document','export_document.php','Export le document','exporte le
document d''un événement','PR');
-insert into profile_menu (me_code,p_id,p_type_display) select
'RAW:document',p_id,'P' from profile where p_id > 0;
\ No newline at end of file
+insert into profile_menu (me_code,p_id,p_type_display) select
'RAW:document',p_id,'P' from profile where p_id > 0;
+
+insert into menu_ref(me_code,me_file,me_menu,me_description,me_type)
+values ('RAW:document_template','export_document_template.php','Exporte le
modèle de document','export le modèle de document utilisé dans le suivi','PR');
+
+insert into profile_menu (me_code,p_id,p_type_display) select
'RAW:document_template',p_id,'P' from profile where p_id > 0;
\ No newline at end of file