noalyss-commit
[Top][All Lists]
Advanced

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

[Noalyss-commit] [noalyss] 142/151: Doc : complete documentation


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 142/151: Doc : complete documentation
Date: Sat, 4 Feb 2017 17:14:35 +0000 (UTC)

sparkyx pushed a commit to branch master
in repository noalyss.

commit 4c4128d619e06b53167f3052abdb47400862e3eb
Author: Dany De Bontridder <address@hidden>
Date:   Sat Jan 28 09:40:12 2017 +0100

    Doc : complete documentation
---
 include/class/class_document.php |   37 ++++++++++++++++++++++---------------
 1 file changed, 22 insertions(+), 15 deletions(-)

diff --git a/include/class/class_document.php b/include/class/class_document.php
index d3a544c..1ab9fee 100644
--- a/include/class/class_document.php
+++ b/include/class/class_document.php
@@ -63,25 +63,32 @@ class Document
         $this->db->exec_sql($sql);
 
     }
-       function compute_filename($pj,$filename)
-       {
-               foreach (array('/','*','<','>',';',',','\\','.',':') as $i) {
-                       $pj= str_replace($i, "-",$pj);
-               }
-               // save the suffix
-               $pos_prefix=strrpos($filename,".");
-               if ($pos_prefix == 0) $pos_prefix=strlen($filename);
-               $filename_no=substr($filename,0,$pos_prefix);
-               $filename_suff=substr($filename,$pos_prefix,strlen($filename));
-               $new_filename=  strtolower($filename_no."-".$pj.$filename_suff);
-               return $new_filename;
-       }
+    /**
+     * Insert the receipt number into the filename , each generated file
+     * will have the name of the template (model) + receipt number)
+     * @param type $pj the receipt number
+     * @param type $filename the name of the file
+     * @return string
+     */
+    function compute_filename($pj,$filename)
+    {
+            foreach (array('/','*','<','>',';',',','\\','.',':','(',')',' 
','[',']') as $i) {
+                    $pj= str_replace($i, "-",$pj);
+            }
+            // save the suffix
+            $pos_prefix=strrpos($filename,".");
+            if ($pos_prefix == 0) $pos_prefix=strlen($filename);
+            $filename_no=substr($filename,0,$pos_prefix);
+            $filename_suff=substr($filename,$pos_prefix,strlen($filename));
+            $new_filename=  strtolower($filename_no."-".$pj.$filename_suff);
+            return $new_filename;
+    }
     /*!
      * \brief Generate the document, Call $this-\>Replace to replace
      *        tag by value
      address@hidden p_array contains the data normally it is the $_POST
-     address@hidden contains the new filename
-     * \return an array : the url where the generated doc can be found, the 
name
+     address@hidden $p_filename contains the new filename
+     * \return an string : the url where the generated doc can be found, the 
name
      * of the file and his mimetype
      */
     function Generate($p_array,$p_filename="")



reply via email to

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