phpcompta-dev
[Top][All Lists]
Advanced

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

[Phpcompta-dev] r5215 - phpcompta/tags/rel650/include


From: phpcompta-dev
Subject: [Phpcompta-dev] r5215 - phpcompta/tags/rel650/include
Date: Fri, 3 May 2013 23:56:43 +0200 (CEST)

Author: danydb
Date: 2013-05-03 23:56:40 +0200 (Fri, 03 May 2013)
New Revision: 5215

Modified:
   phpcompta/tags/rel650/include/class_document.php
Log:
#0000822: G?\195?\169n?\195?\169ration document : changer le type de cellule

Attention probl?\195?\168me si on a utiliser = devant le tag pour forcer le 
type num?\195?\169rique

Modified: phpcompta/tags/rel650/include/class_document.php
===================================================================
--- phpcompta/tags/rel650/include/class_document.php    2013-05-02 20:54:28 UTC 
(rev 5214)
+++ phpcompta/tags/rel650/include/class_document.php    2013-05-03 21:56:40 UTC 
(rev 5215)
@@ -235,13 +235,23 @@
 
                        $to_remove=$pattern;
                        // we remove the < and > from the pattern
-                       $pattern=str_replace($lt,'',$pattern);
-                       $pattern=str_replace($gt,'',$pattern);
+                       $tag=str_replace($lt,'',$pattern);
+                       $tag=str_replace($gt,'',$tag);
 
 
                        // if the pattern if found we replace it
-                       $value=$this->Replace($pattern,$p_array);
+                       $value=$this->Replace($tag,$p_array);
                        if ( strpos($value,'ERROR') != false )            
$value="";
+                        /*
+                         * Change type of cell to numeric
+                         *  allow numeric cel in ODT for the formatting and 
formula 
+                         */
+                       if ( is_numeric($value) && $p_type=='OOo')
+                         {
+                           
$searched='/office:value-type="string"><text:p>'.$pattern.'/';
+                           $replaced='office:value-type="float" 
office:value="'.$value.'"><text:p>'.$pattern;
+                           $buffer=preg_replace($searched, $replaced, 
$buffer,1);
+                         }
                        // replace into the $buffer
                        // take the position in the buffer
                        $pos=strpos($buffer,$to_remove);



---
PhpCompta est un logiciel de comptabilité libre en ligne (full web)
Projet opensource http://www.phpcompta.eu



reply via email to

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