commit 3e3ac5b4f79892bc5ea321eb2c0291a28edb1b37
Author: Eric Seigne <eric.seigne@ryxeo.com>
Date:   Fri Apr 2 18:41:45 2010 +0200

    utf8

diff --git a/plugins/anet_epacks/front/abuledu-epack.odt b/plugins/anet_epacks/front/abuledu-epack.odt
index 1cacbe0..4b3b6d9 100644
Binary files a/plugins/anet_epacks/front/abuledu-epack.odt and b/plugins/anet_epacks/front/abuledu-epack.odt differ
diff --git a/plugins/anet_epacks/front/plugin_anet_epacks.generate_odt_activated.form.php b/plugins/anet_epacks/front/plugin_anet_epacks.generate_odt_activated.form.php
index bc95b3f..213e6cf 100644
--- a/plugins/anet_epacks/front/plugin_anet_epacks.generate_odt_activated.form.php
+++ b/plugins/anet_epacks/front/plugin_anet_epacks.generate_odt_activated.form.php
@@ -52,23 +52,23 @@ setlocale(LC_TIME, "fr_FR");
 $odf->setVars('date', strftime("%A %e %B %Y"),'true', 'UTF-8');
 
 //Les coordonnées du client de ryxeo
-$odf->setVars('correspondant', utf8_decode($data['g2name']));
-$odf->setVars('adresse', utf8_decode($data['g2daddress']));
+$odf->setVars('correspondant', $data['g2name'], true, 'UTF-8');
+$odf->setVars('adresse', $data['g2daddress'], true, 'UTF-8');
 $odf->setVars('cp', $data['g2dpostcode']);
-$odf->setVars('ville', utf8_decode($data['g2dtown']));
+$odf->setVars('ville', $data['g2dtown'], true, 'UTF-8');
 
-$odf->setVars('client', utf8_decode($data['g3name']));
-$odf->setVars('clientadresse', utf8_decode($data['g3daddress']));
+$odf->setVars('client', $data['g3name'], true, 'UTF-8');
+$odf->setVars('clientadresse', $data['g3daddress'], true, 'UTF-8');
 $odf->setVars('clientcp', $data['g3dpostcode']);
-$odf->setVars('clientville', utf8_decode($data['g3dtown']));
+$odf->setVars('clientville', $data['g3dtown'], true, 'UTF-8');
 
-$odf->setVars('clientfinal', utf8_decode($data['g4name']));
-$odf->setVars('clientfinaladresse', utf8_decode($data['g4daddress']));
+$odf->setVars('clientfinal', $data['g4name'], true, 'UTF-8');
+$odf->setVars('clientfinaladresse', $data['g4daddress'], true, 'UTF-8');
 $odf->setVars('clientfinalcp', $data['g4dpostcode']);
-$odf->setVars('clientfinalville', utf8_decode($data['g4dtown']));
+$odf->setVars('clientfinalville', $data['g4dtown'], true, 'UTF-8');
 
 if(preg_match("/avenant_contrat_partenaire/i",$_GET['mode'])) {
-  $odf->setVars('cname', utf8_decode("ABE10-" . $data['code']));
+  $odf->setVars('cname', "ABE10-" . $data['code'], true, 'UTF-8');
 
   $query2 = "SELECT * FROM glpi_contracts WHERE FK_entities='" . $data['g2id'] . "' AND name LIKE '%-ENR20'";
   $result2 = $DB->query($query2);
@@ -77,9 +77,9 @@ if(preg_match("/avenant_contrat_partenaire/i",$_GET['mode'])) {
   //print_r($data2);
   //exit;
 
-  $odf->setVars('globalcname', utf8_decode($data2['name']));
+  $odf->setVars('globalcname', $data2['name'], true, 'UTF-8');
 
-  $odf->setVars('epack', utf8_decode($data['code']));
+  $odf->setVars('epack', $data['code'], true, 'UTF-8');
   setlocale(LC_TIME, "fr_FR");
   $timestamp = strtotime($_GET['date']);
   $odf->setVars('datedebut', strftime("%A %e %B %Y",$timestamp),'true', 'UTF-8');
@@ -91,15 +91,15 @@ if(preg_match("/avenant_contrat_partenaire/i",$_GET['mode'])) {
     //a faire / décider 
   }
 
-  $odf->setVars('correspondantadresse', utf8_decode($data['g2daddress']));
+  $odf->setVars('correspondantadresse', $data['g2daddress'], true, 'UTF-8');
   $odf->setVars('correspondantcp', $data['g2dpostcode']);
-  $odf->setVars('correspondantville', utf8_decode($data['g2dtown']));
+  $odf->setVars('correspondantville', $data['g2dtown'], true, 'UTF-8');
 
-  $odf->setVars('correspondanttype', utf8_decode("____________________"));
-  $odf->setVars('correspondantcapital', utf8_decode("____________________"));
-  $odf->setVars('correspondantrcs', utf8_decode("____________________"));
-  $odf->setVars('correspondantsiret', utf8_decode("____________________"));
-  $odf->setVars('correspondantcontact', utf8_decode("____________________"));
+  $odf->setVars('correspondanttype', "____________________", true, 'UTF-8');
+  $odf->setVars('correspondantcapital', "____________________", true, 'UTF-8');
+  $odf->setVars('correspondantrcs', "____________________", true, 'UTF-8');
+  $odf->setVars('correspondantsiret', "____________________", true, 'UTF-8');
+  $odf->setVars('correspondantcontact', "____________________", true, 'UTF-8');
 
 
  }
diff --git a/plugins/anet_epacks/front/plugin_anet_epacks.generate_odt_client2.form.php b/plugins/anet_epacks/front/plugin_anet_epacks.generate_odt_client2.form.php
index 621a8f3..abede22 100644
--- a/plugins/anet_epacks/front/plugin_anet_epacks.generate_odt_client2.form.php
+++ b/plugins/anet_epacks/front/plugin_anet_epacks.generate_odt_client2.form.php
@@ -78,7 +78,7 @@ $odf->setVars('code', $data['code']);
 $odf->setVars('password', $data['password']);
 
 setlocale(LC_TIME, "fr_FR");
-$odf->setVars('date', strftime("%A %e %B %Y"));
+$odf->setVars('date', strftime("%A %e %B %Y"), true, 'UTF-8');
 
 $query2="SELECT * FROM glpi_entities, glpi_entities_data WHERE glpi_entities.ID=FK_entities AND glpi_entities.ID='$fk_entitee';";
 //print $query2;
@@ -86,10 +86,10 @@ $query2="SELECT * FROM glpi_entities, glpi_entities_data WHERE glpi_entities.ID=
 $result2 = $DB->query($query2);
 $data2=$DB->fetch_array($result2);
 
-$odf->setVars('correspondant', utf8_decode($data2['name']));
-$odf->setVars('adresse', utf8_decode($data2['address']));
+$odf->setVars('correspondant', $data2['name'], true, 'UTF-8');
+$odf->setVars('adresse', $data2['address'], true, 'UTF-8');
 $odf->setVars('cp', $data2['postcode']);
-$odf->setVars('ville', utf8_decode($data2['town']));
+$odf->setVars('ville', $data2['town'], true, 'UTF-8');
 
 //On "grille" le epack pour eviter de l'affecter a qqn d'autre ... cas particulier du client direct
 if($_POST['clientdirect'] == 1) {
diff --git a/plugins/anet_epacks/front/plugin_anet_epacks.generate_odt_maintenance3.form.php b/plugins/anet_epacks/front/plugin_anet_epacks.generate_odt_maintenance3.form.php
index 1270eda..2adcc02 100644
--- a/plugins/anet_epacks/front/plugin_anet_epacks.generate_odt_maintenance3.form.php
+++ b/plugins/anet_epacks/front/plugin_anet_epacks.generate_odt_maintenance3.form.php
@@ -49,17 +49,17 @@ if(isset($_GET['cid'])) {
   $odf = new odf("abuledu" . $niveau . ".odt");
   setlocale(LC_TIME, "fr_FR");
   error_reporting(E_ALL);
-  $odf->setVars('date', strftime("%A %e %B %Y"));
+  $odf->setVars('date', strftime("%A %e %B %Y"), true, 'UTF-8');
 
   //Cas spécial des contrats de partenaires ENR
   if($_GET['niveau'] == "maintenance-enr-partenaire") {
 
   }
   else {
-    $odf->setVars('datedebut', strftime("%A %e %B %Y"));
+    $odf->setVars('datedebut', strftime("%A %e %B %Y"), true, 'UTF-8');
     //$odf->setVars('datefin', strftime("%A %e %B %Y", mktime(0,0,0,date("n")-1,date("j"),date("Y")+3)));
 
-    $odf->setVars('epacks', utf8_decode($epackstxt));
+    $odf->setVars('epacks', $epackstxt, true, 'UTF-8');
   }
 
   $query2="SELECT * FROM glpi_entities, glpi_entities_data WHERE glpi_entities.ID=FK_entities AND glpi_entities.ID='$fk_entitee';";
@@ -68,17 +68,17 @@ if(isset($_GET['cid'])) {
   $result2 = $DB->query($query2);
   $data2=$DB->fetch_array($result2);
   
-  $odf->setVars('cname',  utf8_decode($cname));
+  $odf->setVars('cname',  $cname, true, 'UTF-8');
   
-  $odf->setVars('client', utf8_decode($data2['name']));
-  $odf->setVars('clienttype', utf8_decode("____________________"));
-  $odf->setVars('clientcapital', utf8_decode("____________________"));
-  $odf->setVars('clientrcs', utf8_decode("____________________"));
-  $odf->setVars('clientsiret', utf8_decode("____________________"));
-  $odf->setVars('clientadresse', utf8_decode($data2['address']));
+  $odf->setVars('client', $data2['name'], true, 'UTF-8');
+  $odf->setVars('clienttype', "____________________", true, 'UTF-8');
+  $odf->setVars('clientcapital', "____________________", true, 'UTF-8');
+  $odf->setVars('clientrcs', "____________________", true, 'UTF-8');
+  $odf->setVars('clientsiret', "____________________", true, 'UTF-8');
+  $odf->setVars('clientadresse', $data2['address'], true, 'UTF-8');
   $odf->setVars('clientcp', $data2['postcode']);
-  $odf->setVars('clientville', utf8_decode($data2['town']));
-  $odf->setVars('clientcontact', utf8_decode("____________________"));
+  $odf->setVars('clientville', $data2['town'], true, 'UTF-8');
+  $odf->setVars('clientcontact', "____________________", true, 'UTF-8');
   
   //On créé un fichier local pour archive ...
   $fichier = "contrats/" . date("Y-m-d") . "-abuledu-maintenance-" . $cname . ".odt";
diff --git a/plugins/anet_epacks/front/plugin_anet_epacks.generate_odt_revendeur2.form.php b/plugins/anet_epacks/front/plugin_anet_epacks.generate_odt_revendeur2.form.php
index df21699..0311f7b 100644
--- a/plugins/anet_epacks/front/plugin_anet_epacks.generate_odt_revendeur2.form.php
+++ b/plugins/anet_epacks/front/plugin_anet_epacks.generate_odt_revendeur2.form.php
@@ -36,7 +36,7 @@ $odf->setVars('password', $data['password']);
 
 
 setlocale(LC_TIME, "fr_FR");
-$odf->setVars('date', strftime("%A %e %B %Y"));
+$odf->setVars('date', strftime("%A %e %B %Y"), true, 'UTF-8');
 
 //Les coordonnées du client
 $fk_entitee = $_POST['FK_entitee'];
@@ -46,10 +46,10 @@ $query2="SELECT * FROM glpi_entities, glpi_entities_data WHERE glpi_entities.ID=
 $result2 = $DB->query($query2);
 $data2=$DB->fetch_array($result2);
 
-$odf->setVars('correspondant', utf8_decode($data2['name']));
-$odf->setVars('adresse', utf8_decode($data2['address']));
+$odf->setVars('correspondant', $data2['name'], true, 'UTF-8');
+$odf->setVars('adresse', $data2['address'], true, 'UTF-8');
 $odf->setVars('cp', $data2['postcode']);
-$odf->setVars('ville', utf8_decode($data2['town']));
+$odf->setVars('ville', $data2['town'], true, 'UTF-8');
 
 //On "grille" le epack pour eviter de l'affecter a qqn d'autre
 $query3="UPDATE glpi_plugin_anet_epacks set FK_clientderyxeo='$fk_entitee',creation_date='" . date("Y-m-d") . "' WHERE ID='" . $data['ID'] . "';";
