phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] property/inc class.bocommon.inc.php


From: Sigurd Nes
Subject: [Phpgroupware-cvs] property/inc class.bocommon.inc.php
Date: Mon, 19 Feb 2007 18:46:09 +0000

CVSROOT:        /sources/phpgroupware
Module name:    property
Changes by:     Sigurd Nes <sigurdne>   07/02/19 18:46:09

Modified files:
        inc            : class.bocommon.inc.php 

Log message:
        move to utf-8

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/property/inc/class.bocommon.inc.php?cvsroot=phpgroupware&r1=1.60&r2=1.61

Patches:
Index: class.bocommon.inc.php
===================================================================
RCS file: /sources/phpgroupware/property/inc/class.bocommon.inc.php,v
retrieving revision 1.60
retrieving revision 1.61
diff -u -b -r1.60 -r1.61
--- class.bocommon.inc.php      26 Jan 2007 14:53:46 -0000      1.60
+++ class.bocommon.inc.php      19 Feb 2007 18:46:09 -0000      1.61
@@ -24,7 +24,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage core
-       * @version $Id: class.bocommon.inc.php,v 1.60 2007/01/26 14:53:46 
sigurdne Exp $
+       * @version $Id: class.bocommon.inc.php,v 1.61 2007/02/19 18:46:09 
sigurdne Exp $
        */
 
        /**
@@ -1327,7 +1327,7 @@
 
                        $filename= 
$GLOBALS['phpgw_info']['user']['account_lid'].'.xls';
 
-                       $workbook       = 
CreateObject($this->currentapp.'.excel',"-");
+                       $workbook       = CreateObject('phpgwapi.excel',"-");
                        $browser = CreateObject('phpgwapi.browser');
                        
$browser->content_header($filename,'application/vnd.ms-excel');
 
@@ -1346,7 +1346,7 @@
                                                if($input_type[$k]!='hidden')
                                                {
                                                        $content[$j][$m]        
= str_replace("\r\n"," ",$entry[$name[$k]]);
-                                                       
$worksheet1->write_string(0, $m, $descr[$k]);
+                                                       
$worksheet1->write_string(0, $m, $this->utf2ascii($descr[$k]));
                                                        $m++;
                                                }
                                        }
@@ -1359,7 +1359,7 @@
                                        $line++;
                                        for ($i=0; $i<count($row); $i++)
                                        {
-                                               
$worksheet1->write($line,$i,$row[$i]);
+                                               $worksheet1->write($line,$i, 
$this->utf2ascii($row[$i]));
                                        }
                                }
                        }
@@ -1451,5 +1451,23 @@
                        
                        return $values;
                }
+               
+               /**
+               * Converts ascii to utf-8
+               *
+               * @param string $text string
+               * @return string utf-8 encoded 
+               */
+               function utf2ascii($text = '')
+               {       
+                       if ($text == utf8_decode($text))
+                       {
+                               return $text;
+                       }
+                       else
+                       {
+                               return utf8_decode($text);
+                       }
+               }
        }
 ?>




reply via email to

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