diff --git a/include/ajax/ajax_mod_document.php b/include/ajax/ajax_mod_document.php index a26046763..909a8030b 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 85c6ae5bb..33cb7d800 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.=""; $r.=td(h($row['md_affect'])); $r.=""; - $r.='Document'; + $href=http_build_query(array('gDossier'=>$dosid,'md_id'=>$row['md_id'],'act'=>'RAW:document_template')); + $r.=''.h($row['md_filename']).''; $r.=""; $r.=""; $c=new ICheckBox(); $c->name="dm_remove_".$row['md_id']; $r.=$c->input(); $r.=""; - $r.=td(HtmlInput::detail_modele_document($row['md_id'],'Modifier')); + $r.=td(HtmlInput::detail_modele_document($row['md_id'],_('Modifier'))); $r.=""; } 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 61002b8df..d60b2fb71 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 679b82462..1ba0ef718 100644 --- a/include/template/modele_document.php +++ b/include/template/modele_document.php @@ -60,9 +60,10 @@ echo $a->input(); $dosid,'md_id'=>$doc->md_id,'act'=>'RAW:document_template')); - echo '(fichier actuel)'; + echo ''.'('._('fichier actuel').')'; ?> diff --git a/sql/upgrade.sql b/sql/upgrade.sql index 84a2c73a3..906e4441d 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