noalyss-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Noalyss-commit] [noalyss] 06/17: Document Template


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 06/17: Document Template
Date: Tue, 16 May 2023 14:50:12 -0400 (EDT)

sparkyx pushed a commit to branch master
in repository noalyss.

commit 6291417e5bb663eff81a0be96b9545823ad69c4d
Author: sparkyx <danydb@noalyss.eu>
AuthorDate: Sat Apr 29 09:32:30 2023 +0200

    Document Template
    
    Document template : improve upload
---
 include/class/document_modele.class.php | 4 +++-
 include/template/modele_document.php    | 6 +++++-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/include/class/document_modele.class.php 
b/include/class/document_modele.class.php
index 1bf5938a5..7e723e9b7 100644
--- a/include/class/document_modele.class.php
+++ b/include/class/document_modele.class.php
@@ -237,7 +237,8 @@ class Document_modele
         $r='<p class="notice">';
         $r.='Veuillez introduire les mod&egrave;les servant à 
g&eacute;n&eacute;rer vos documents';
         $r.='</p>';
-        $r.='<form enctype="multipart/form-data"  method="post">';
+        $r.='<form enctype="multipart/form-data"  method="post" 
onsubmit="return check_file_size(this,'.           MAX_FILE_SIZE.')">';
+        $r.=\HtmlInput::hidden("MAX_FILE_SIZE", MAX_FILE_SIZE);
         $r.=dossier::hidden();
         // we need to add the sub action as hidden
         $h=new IHidden();
@@ -270,6 +271,7 @@ class Document_modele
 
         $f=new IFile();
         $f->name="doc";
+        $f->setAlertOnSize(true);
         $r.="<tr><td>fichier</td><td> ".$f->input()."</td></tr>";
 
         $start=new IText();
diff --git a/include/template/modele_document.php 
b/include/template/modele_document.php
index 60136e14c..d0942d9cf 100644
--- a/include/template/modele_document.php
+++ b/include/template/modele_document.php
@@ -2,9 +2,12 @@
 //This file is part of NOALYSS and is under GPL 
 //see licence.txt
 global $doc,$cn;
+\Noalyss\Dbg::echo_file(__FILE__);
+echo \Noalyss\Dbg::echo_var(1,"MAX SIZE IS ".MAX_FILE_SIZE);
 ?>
     <?php echo HtmlInput::title_box("Modèle de document","mod_doc",'hide')?>
-<form  method="post" enctype="multipart/form-data">
+<form  method="post" enctype="multipart/form-data"  onsubmit="return 
check_file_size(this,<?=MAX_FILE_SIZE?>)">
+<?php echo \HtmlInput::hidden("MAX_FILE_SIZE", MAX_FILE_SIZE);?>
 <table>
 
 <tr>
@@ -67,6 +70,7 @@ echo $a->input();
 <td>
 <?php
 $file=new IFile('doc');
+$file->setAlertOnSize(true);
 echo $file->input();
 
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]