[Glpi-dev] Patch for update computer DeviceControl

2011-02-07 Thread David DURIEUX
DeviceControl don't have "specificity" field and when you update
glpi_computers_devicecontrols you have a notice

This patch for GLPI 0.78.2 tets if $this->fields['specificity'] exist.


I have a little see in 0.80 and it seems same problem.


Thanks!

David Durieux # This patch file was generated by NetBeans IDE
# Following Index: paths are relative to: /Donnees/www/data-dist/glpi078/inc
# This patch can be applied using context Tools: Patch action on respective folder.
# It uses platform neutral UTF-8 encoding and \n newlines.
# Above lines and this line are ignored by the patching process.
Index: computer_device.class.php
--- computer_device.class.php Base (BASE)
+++ computer_device.class.php Locally Modified (Based On LOCAL)
@@ -497,7 +497,8 @@
 }
  }
   }
-  if ($this->fields['specificity'] == $this->input['specificity']) {
\ No newline at end of file
+  if (isset($this->fields['specificity'])
+  AND ($this->fields['specificity']== $this->input['specificity'])) {
\ No newline at end of file
  // No change
  return false;
   }
___
Glpi-dev mailing list
Glpi-dev@gna.org
https://mail.gna.org/listinfo/glpi-dev


Re: [Glpi-dev] notificationtemplate utf8 support and ticket slashes

2011-02-07 Thread MoYo

Hi,

denis could you try this patch  proposed here : 
http://www.glpi-project.org/forum/viewtopic.php?id=22834

which is based on yours.

Regards

Julien


|--- inc/notificationtemplate.class.php.orig 2011-01-24 01:52:54.0 
+0100
+++ inc/notificationtemplate.class.php  2011-02-04 10:02:13.0 +0100
@@ -208,7 +208,7 @@
 Plugin::loadLang(strtolower($plug['plugin']));
  }

- if ($template_datas = $this->getByLanguage($language)) {
+if ($template_datas = 
html_entity_decode_deep($this->getByLanguage($language))) {
 //Template processing
 // Decode html chars to have clean text
 $data = html_entity_decode_deep($data);
@@ -323,14 +323,13 @@


static function processIf($string, $data) {
-
-  if (preg_match_all("/##IF([a-z\.]*)[=]?([\w ]*)##/i",$string,$out)) {
+  if (preg_match_all("/##IF([a-z\.]*)[=]?(.*?)##/i",$string,$out)) {
  foreach ($out[1] as $key =>  $tag_infos) {
 $if_field = $tag_infos;
 //Get the field tag value (if one)
-$regex_if = "/##IF".$if_field."[=]?[\w 
]*##(.*)##ENDIF".$if_field."##/Uis";
+$regex_if = 
"/##IF".$if_field."[=]?.*##(.*)##ENDIF".$if_field."##/Uis";
 //Get the else tag value (if one)
-$regex_else = "/##ELSE".$if_field."[=]?[\w 
]*##(.*)##ENDELSE".$if_field."##/Uis";
+$regex_else = 
"/##ELSE".$if_field."[=]?.*##(.*)##ENDELSE".$if_field."##/Uis";
 if (empty($out[2][$key])){ // No = : check if ot empty or not null
if (isset($data['##'.$if_field.'##'])
   &&  $data['##'.$if_field.'##'] != ''
@@ -342,7 +341,7 @@
}
 } else { // check exact match
if (isset($data['##'.$if_field.'##'])
-&&  $data['##'.$if_field.'##'] == $out[2][$key]) {
+&&  html_entity_decode_deep($data['##'.$if_field.'##']) == $out[2][$key]) {
   $condition_ok=true;
} else {
   $condition_ok=false;|



___
Glpi-dev mailing list
Glpi-dev@gna.org
https://mail.gna.org/listinfo/glpi-dev