rpms/glpi/devel glpi-0.72.patch, NONE, 1.1 .cvsignore, 1.15, 1.16 glpi-config_path.php, 1.2, 1.3 glpi.spec, 1.25, 1.26 sources, 1.17, 1.18 glpi-check.patch, 1.1, NONE

Remi Collet remi at fedoraproject.org
Tue Aug 18 15:36:30 UTC 2009


Author: remi

Update of /cvs/extras/rpms/glpi/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv11653

Modified Files:
	.cvsignore glpi-config_path.php glpi.spec sources 
Added Files:
	glpi-0.72.patch 
Removed Files:
	glpi-check.patch 
Log Message:
update to 0.72.1 + svn patches

glpi-0.72.patch:
 ajax/comments.php                 |   14 +++----
 ajax/updateTrackingDeviceType.php |    5 +-
 config/define.php                 |    1 
 front/report.dynamic.php          |    3 -
 inc/central.function.php          |    8 +---
 inc/common.function.php           |    6 +--
 inc/contract.function.php         |    6 +--
 inc/display.function.php          |    4 +-
 inc/dropdown.function.php         |    9 +++--
 inc/ocsng.function.php            |    3 +
 inc/profile.class.php             |   11 +++---
 inc/rulesengine.class.php         |    8 ++--
 inc/rulesengine.function.php      |    9 ++---
 inc/search.constant.php           |    7 ++-
 inc/search.function.php           |   42 +++++++++++++++--------
 inc/tracking.function.php         |   67 ++++++++++++++++++++++++++++++++++----
 lib/vcardclass/classes-vcard.php  |    3 +
 17 files changed, 142 insertions(+), 64 deletions(-)

--- NEW FILE glpi-0.72.patch ---
diff -ru glpi/ajax/comments.php svn8743/ajax/comments.php
--- glpi/ajax/comments.php	2009-08-06 23:10:00.000000000 +0200
+++ svn8743/ajax/comments.php	2009-08-18 16:59:42.000000000 +0200
@@ -1,6 +1,6 @@
 <?php
 /*
- * @version $Id: comments.php 7936 2009-02-02 20:53:50Z moyo $
+ * @version $Id: comments.php 8708 2009-08-14 09:34:02Z remi $
  -------------------------------------------------------------------------
  GLPI - Gestionnaire Libre de Parc Informatique
  Copyright (C) 2003-2009 by the INDEPNET Development Team.
@@ -43,13 +43,13 @@
 
 checkLoginUser();
 
+if (isset($_POST["table"]) && isset($_POST["value"])) {	
 
-// Security
-if (! TableExists($_POST['table']) ){
-	exit();
-}
-
-if (isset($_POST["table"])&&isset($_POST["value"])){	
+   // Security
+   if (! TableExists($_POST['table']) ){
+      exit();
+   }
+   
 	switch ($_POST["table"]){
 		case "glpi_users":
 			if ($_POST['value']==0){
diff -ru glpi/ajax/updateTrackingDeviceType.php svn8743/ajax/updateTrackingDeviceType.php
--- glpi/ajax/updateTrackingDeviceType.php	2009-08-06 23:10:00.000000000 +0200
+++ svn8743/ajax/updateTrackingDeviceType.php	2009-08-18 16:59:42.000000000 +0200
@@ -1,6 +1,6 @@
 <?php
 /*
- * @version $Id: updateTrackingDeviceType.php 7762 2009-01-06 18:30:32Z moyo $
+ * @version $Id: updateTrackingDeviceType.php 8709 2009-08-14 10:27:25Z moyo $
  -------------------------------------------------------------------------
  GLPI - Gestionnaire Libre de Parc Informatique
  Copyright (C) 2003-2009 by the INDEPNET Development Team.
@@ -35,8 +35,9 @@
 
 
 	define('GLPI_ROOT','..');
-
+   
 	$AJAX_INCLUDE=1;
+   $NEEDED_ITEMS=array("tracking");
 	include (GLPI_ROOT."/inc/includes.php");
 	header("Content-Type: text/html; charset=UTF-8");
 	header_nocache();
diff -ru glpi/config/define.php svn8743/config/define.php
--- glpi/config/define.php	2009-08-06 23:10:00.000000000 +0200
+++ svn8743/config/define.php	2009-08-18 16:59:43.000000000 +0200
@@ -307,6 +307,7 @@
 			ENTERPRISE_TYPE => "front/enterprise.php",
 			CONTRACT_TYPE => "front/contract.php",
 			DOCUMENT_TYPE => "front/document.php",
+         OCSNG_TYPE => "front/setup.ocsng.php",
 		);
 
 	define("AUTH_DB_GLPI",1);
diff -ru glpi/front/report.dynamic.php svn8743/front/report.dynamic.php
--- glpi/front/report.dynamic.php	2009-08-06 23:10:00.000000000 +0200
+++ svn8743/front/report.dynamic.php	2009-08-18 16:59:42.000000000 +0200
@@ -1,6 +1,6 @@
 <?php
 /*
- * @version $Id: report.dynamic.php 7762 2009-01-06 18:30:32Z moyo $
+ * @version $Id: report.dynamic.php 8674 2009-08-10 10:57:50Z moyo $
  -------------------------------------------------------------------------
  GLPI - Gestionnaire Libre de Parc Informatique
  Copyright (C) 2003-2009 by the INDEPNET Development Team.
@@ -118,7 +118,6 @@
 				} 
 			}
 
-
 			manageGetValuesInSearch($_GET["item_type"]);
 
 			showList($_GET["item_type"],$_GET);
diff -ru glpi/inc/central.function.php svn8743/inc/central.function.php
--- glpi/inc/central.function.php	2009-08-06 23:10:00.000000000 +0200
+++ svn8743/inc/central.function.php	2009-08-18 16:59:45.000000000 +0200
@@ -1,6 +1,6 @@
 <?php
 /*
- * @version $Id: central.function.php 8026 2009-02-28 16:50:46Z moyo $
+ * @version $Id: central.function.php 8652 2009-08-07 12:11:52Z moyo $
  -------------------------------------------------------------------------
  GLPI - Gestionnaire Libre de Parc Informatique
  Copyright (C) 2003-2009 by the INDEPNET Development Team.
@@ -87,11 +87,7 @@
 	if ($_SESSION["glpijobs_at_login"]&&$showticket){
 		echo "<br>";
 
-		echo "<div class='center'><strong>";
-		echo $LANG['central'][10];
-		echo "</strong></div>";
-
-		showTrackingList($_SERVER['PHP_SELF'],0,"","","new");
+		showNewJobList();
 	}
 
 }
diff -ru glpi/inc/common.function.php svn8743/inc/common.function.php
--- glpi/inc/common.function.php	2009-08-06 23:10:00.000000000 +0200
+++ svn8743/inc/common.function.php	2009-08-18 16:59:45.000000000 +0200
@@ -1,6 +1,6 @@
 <?php
 /*
- * @version $Id: common.function.php 8493 2009-07-23 16:22:58Z moyo $
+ * @version $Id: common.function.php 8706 2009-08-14 08:36:44Z remi $
  -------------------------------------------------------------------------
  GLPI - Gestionnaire Libre de Parc Informatique
  Copyright (C) 2003-2009 by the INDEPNET Development Team.
@@ -954,8 +954,8 @@
  *@return clean value
  **/
 function cleanPostForTextArea($value){
-	$order   = array('\r\n', '\n', "\\'", '\"');
-	$replace = array("\n",   "\n", "'",   '"');
+   $order   = array('\r\n', '\n', "\\'", '\"', '\\\\');
+   $replace = array("\n",   "\n", "'",   '"',  "\\");
 	//echo rawurldecode($_POST["data"]);
 	return str_replace($order,$replace,$value);
 
diff -ru glpi/inc/contract.function.php svn8743/inc/contract.function.php
--- glpi/inc/contract.function.php	2009-08-06 23:10:00.000000000 +0200
+++ svn8743/inc/contract.function.php	2009-08-18 16:59:45.000000000 +0200
@@ -1,6 +1,6 @@
 <?php
 /*
- * @version $Id: contract.function.php 8465 2009-07-18 07:20:05Z remi $
+ * @version $Id: contract.function.php 8671 2009-08-09 17:21:21Z remi $
  -------------------------------------------------------------------------
  GLPI - Gestionnaire Libre de Parc Informatique
  Copyright (C) 2003-2009 by the INDEPNET Development Team.
@@ -668,9 +668,9 @@
 			echo "<tr class='tab_bg_1'><td class='center' colspan='5'>";
 			echo "<div class='software-instal'><input type='hidden' name='entID' value='$ID'>";
 			if ($ent->fields["recursive"]) {
-				dropdownContracts("conID",getEntitySons($ent->fields["FK_entities"]),$used);
+				dropdownContracts("conID",getEntitySons($ent->fields["FK_entities"]),$used,true);
 			} else {
-				dropdownContracts("conID",$ent->fields['FK_entities'],$used);
+				dropdownContracts("conID",$ent->fields['FK_entities'],$used,true);
 			}
 			echo "</div></td><td class='center'>";
 			echo "<input type='submit' name='addcontract' value=\"".$LANG['buttons'][8]."\" class='submit'>";
diff -ru glpi/inc/display.function.php svn8743/inc/display.function.php
--- glpi/inc/display.function.php	2009-08-06 23:10:00.000000000 +0200
+++ svn8743/inc/display.function.php	2009-08-18 16:59:45.000000000 +0200
@@ -1,6 +1,6 @@
 <?php
 /*
- * @version $Id: display.function.php 8398 2009-06-25 16:44:10Z moyo $
+ * @version $Id: display.function.php 8672 2009-08-10 10:49:02Z remi $
  -------------------------------------------------------------------------
  GLPI - Gestionnaire Libre de Parc Informatique
  Copyright (C) 2003-2009 by the INDEPNET Development Team.
@@ -1883,7 +1883,7 @@
 		$split=explode("&amp;",$parameters);
 		for ($i=0;$i<count($split);$i++){
 			$pos=strpos($split[$i],'=');
-			echo "<input type='hidden' name=\"".substr($split[$i],0,$pos)."\" value=\"".substr($split[$i],$pos+1)."\">";
+			echo "<input type='hidden' name=\"".substr($split[$i],0,$pos)."\" value=\"".urldecode(substr($split[$i],$pos+1))."\">";
 		}
 		echo "<select name='display_type'>";
 		echo "<option value='".PDF_OUTPUT_LANDSCAPE."'>".$LANG['buttons'][27]." ".$LANG['common'][68]."</option>";
diff -ru glpi/inc/dropdown.function.php svn8743/inc/dropdown.function.php
--- glpi/inc/dropdown.function.php	2009-08-06 23:10:00.000000000 +0200
+++ svn8743/inc/dropdown.function.php	2009-08-18 16:59:45.000000000 +0200
@@ -1,6 +1,6 @@
 <?php
 /*
- * @version $Id: dropdown.function.php 8541 2009-07-27 16:31:36Z moyo $
+ * @version $Id: dropdown.function.php 8671 2009-08-09 17:21:21Z remi $
  -------------------------------------------------------------------------
  GLPI - Gestionnaire Libre de Parc Informatique
  Copyright (C) 2003-2009 by the INDEPNET Development Team.
@@ -2620,11 +2620,12 @@
  * @param $name string : HTML select name
  * @param $entity_restrict Restrict to a defined entity
  * @param $alreadyused : already used contract, do not add to dropdown
+ * @param $nochecklimit : true to disable limit for nomber of device (for supplier)
  *
  *@return Nothing (display)
  *
  **/
-function dropdownContracts($name,$entity_restrict=-1,$alreadyused=array()){
+function dropdownContracts($name,$entity_restrict=-1,$alreadyused=array(),$nochecklimit=false){
 
 	global $DB;
 
@@ -2650,7 +2651,9 @@
 	$prev=-1;
 	while ($data=$DB->fetch_array($result)){
 
-		if ($data["device_countmax"]==0||$data["device_countmax"]>countElementsInTable("glpi_contract_device","FK_contract = '".$data['ID']."'" )){
+      if ($nochecklimit
+         || $data["device_countmax"]==0
+         ||$data["device_countmax"]>countElementsInTable("glpi_contract_device","FK_contract = '".$data['ID']."'" )){
 			if ($data["FK_entities"]!=$prev) {
 				if ($prev>=0) {
 					echo "</optgroup>";
diff -ru glpi/inc/ocsng.function.php svn8743/inc/ocsng.function.php
--- glpi/inc/ocsng.function.php	2009-08-06 23:10:00.000000000 +0200
+++ svn8743/inc/ocsng.function.php	2009-08-18 16:59:45.000000000 +0200
@@ -2,7 +2,7 @@
 
 
 /*
- * @version $Id: ocsng.function.php 8576 2009-07-30 15:57:22Z moyo $
+ * @version $Id: ocsng.function.php 8702 2009-08-14 07:11:48Z remi $
  -------------------------------------------------------------------------
  GLPI - Gestionnaire Libre de Parc Informatique
  Copyright (C) 2003-2009 by the INDEPNET Development Team.
@@ -3003,6 +3003,7 @@
 					//Software dictionnary
 					$rulecollection = new DictionnarySoftwareCollection;
 					$res_rule = $rulecollection->processAllRules(array("name"=>$name,"manufacturer"=>$manufacturer,"old_version"=>$version), array (), array());
+               $res_rule = addslashes_deep($res_rule);
 					
 					if (isset($res_rule["name"]))
 						$modified_name = $res_rule["name"];
diff -ru glpi/inc/profile.class.php svn8743/inc/profile.class.php
--- glpi/inc/profile.class.php	2009-08-06 23:10:00.000000000 +0200
+++ svn8743/inc/profile.class.php	2009-08-18 16:59:45.000000000 +0200
@@ -1,6 +1,6 @@
 <?php
 /*
- * @version $Id: profile.class.php 8583 2009-07-31 09:58:52Z moyo $
+ * @version $Id: profile.class.php 8743 2009-08-18 14:57:08Z remi $
  -------------------------------------------------------------------------
  GLPI - Gestionnaire Libre de Parc Informatique
  Copyright (C) 2003-2009 by the INDEPNET Development Team.
@@ -192,9 +192,12 @@
 	function currentUserHaveMoreRightThan($IDs=array()){
 		global $DB;
 
-		if (count($IDs)==0) {
-			return false;
-		}
+      if (count($IDs)==0) {
+         // Check all profiles (means more right than all possible profiles) 
+         return (countElementsInTable($this->table)
+              == countElementsInTable($this->table, $this->getUnderProfileRetrictRequest('')));
+      }
+
 		$under_profiles=array();
 		$query="SELECT * FROM glpi_profiles ".$this->getUnderProfileRetrictRequest("WHERE");
 		$result=$DB->query($query);
diff -ru glpi/inc/rulesengine.class.php svn8743/inc/rulesengine.class.php
--- glpi/inc/rulesengine.class.php	2009-08-06 23:10:00.000000000 +0200
+++ svn8743/inc/rulesengine.class.php	2009-08-18 16:59:45.000000000 +0200
@@ -1,6 +1,6 @@
 <?php
 /*
- * @version $Id: rulesengine.class.php 8307 2009-05-17 17:32:16Z jmd $
+ * @version $Id: rulesengine.class.php 8704 2009-08-14 07:44:59Z remi $
  -------------------------------------------------------------------------
  GLPI - Gestionnaire Libre de Parc Informatique
  Copyright (C) 2003-2009 by the INDEPNET Development Team.
@@ -2381,7 +2381,8 @@
 		$into_old="";
 		foreach($this->cache_params["input_value"] as $param => $value){
 			$into_old.="`".$value."`, ";
-			$old_values.="\"".$input[$param]."\", ";
+         // Input are slashes protected...
+         $old_values.="'".$input[$param]."', ";
 		}
 		
 		$into_new="";
@@ -2391,7 +2392,8 @@
 				$output[$param]="";
 			}
 			$into_new.=", `".$value."`";
-			$new_values.=" ,\"".$output[$param]."\"";
+         // Output are not slashes protected...
+         $new_values.=" ,'".addslashes($output[$param])."'";
 		}
 		$sql="INSERT INTO `".$this->cache_table."` (".$into_old."`rule_id`".$into_new.") VALUES (".$old_values.$output["_ruleid"].$new_values.")";
 		$DB->query($sql);
diff -ru glpi/inc/rulesengine.function.php svn8743/inc/rulesengine.function.php
--- glpi/inc/rulesengine.function.php	2009-08-06 23:10:00.000000000 +0200
+++ svn8743/inc/rulesengine.function.php	2009-08-18 16:59:45.000000000 +0200
@@ -1,6 +1,6 @@
 <?php
 /*
- * @version $Id: rulesengine.function.php 8026 2009-02-28 16:50:46Z moyo $
+ * @version $Id: rulesengine.function.php 8704 2009-08-14 07:44:59Z remi $
  -------------------------------------------------------------------------
  GLPI - Gestionnaire Libre de Parc Informatique
  Copyright (C) 2003-2009 by the INDEPNET Development Team.
@@ -49,9 +49,10 @@
 		return true;
 	}
 
-	// Trim for remove keyboard errors
-	$field=trim($field);
-	$pattern=trim($pattern);
+   // Trim for remove keyboard errors
+   // Input are slashed protected, not output.
+   $field=stripslashes(trim($field));
+   $pattern=trim($pattern);
 	if ($condition != REGEX_MATCH && $condition != REGEX_NOT_MATCH){
 		//Perform comparison with fields in lower case
 		$field = strtolower($field);
diff -ru glpi/inc/search.constant.php svn8743/inc/search.constant.php
--- glpi/inc/search.constant.php	2009-08-06 23:10:00.000000000 +0200
+++ svn8743/inc/search.constant.php	2009-08-18 16:59:45.000000000 +0200
@@ -1,6 +1,6 @@
 <?php
 /*
- * @version $Id: search.constant.php 8577 2009-07-30 15:58:07Z moyo $
+ * @version $Id: search.constant.php 8692 2009-08-13 12:12:51Z moyo $
  -------------------------------------------------------------------------
  GLPI - Gestionnaire Libre de Parc Informatique
  Copyright (C) 2003-2009 by the INDEPNET Development Team.
@@ -2078,8 +2078,9 @@
 $SEARCH_OPTION[SOFTWARE_TYPE][72]['linkfield']='';
 $SEARCH_OPTION[SOFTWARE_TYPE][72]['name']=$LANG['tracking'][29]." - ".$LANG['software'][19];
 $SEARCH_OPTION[SOFTWARE_TYPE][72]['forcegroupby']=true;
-$SEARCH_OPTION[SOFTWARE_TYPE][72]['usehaving']=true;
-$SEARCH_OPTION[SOFTWARE_TYPE][72]['datatype']='number';
+$SEARCH_OPTION[SOFTWARE_TYPE][72]['nosearch']=true;
+//$SEARCH_OPTION[SOFTWARE_TYPE][72]['usehaving']=true;
+//$SEARCH_OPTION[SOFTWARE_TYPE][72]['datatype']='number';
 
 
 $SEARCH_OPTION[SOFTWARE_TYPE]['versions']=$LANG['software'][5];
diff -ru glpi/inc/search.function.php svn8743/inc/search.function.php
--- glpi/inc/search.function.php	2009-08-06 23:10:00.000000000 +0200
+++ svn8743/inc/search.function.php	2009-08-18 16:59:45.000000000 +0200
@@ -1,6 +1,6 @@
 <?php
 /*
- * @version $Id: search.function.php 8628 2009-08-04 19:04:13Z remi $
+ * @version $Id: search.function.php 8700 2009-08-14 06:33:54Z remi $
  -------------------------------------------------------------------------
  GLPI - Gestionnaire Libre de Parc Informatique
  Copyright (C) 2003-2009 by the INDEPNET Development Team.
@@ -301,9 +301,11 @@
 				else $first_group=false;
 				echo "<optgroup label=\"$val\">";
 			}else {
-				echo "<option value=\"".$key."\"";
-				if(is_array($field)&&isset($field[$i]) && $key == $field[$i]) echo "selected";
-				echo ">". utf8_substr($val["name"],0,32) ."</option>\n";
+            if (!isset($val["nosearch"]) || !$val["nosearch"]){
+               echo "<option value=\"".$key."\"";
+               if(is_array($field)&&isset($field[$i]) && $key == $field[$i]) echo "selected";
+               echo ">". utf8_substr($val["name"],0,32) ."</option>\n";
+            }
 			}
 		}
 		if (!$first_group)
@@ -676,6 +678,7 @@
 	$WHERE="";
 	$HAVING="";
 
+
 	/// TODO do also having here / simplify view - all cases : duplicates
 	// Add search conditions
 	// If there is search items
@@ -754,7 +757,8 @@
 					$first2=true;
 					foreach ($toview as $key2 => $val2){
 						// Add Where clause if not to be done in HAVING CLAUSE
-						if (!isset($SEARCH_OPTION[$type][$val2]["usehaving"])){
+                  if (!isset($SEARCH_OPTION[$type][$val2]["usehaving"]) &&
+                      !isset($SEARCH_OPTION[$type][$val2]["nosearch"])){
 							$tmplink=$LINK;
 							if ($first2) {
 								$tmplink=" ";
@@ -808,7 +812,7 @@
 					foreach ($SEARCH_OPTION[$type] as $key2 => $val2)
 						if (is_array($val2)){
 							// Add Where clause if not to be done ine HAVING CLAUSE
-						if (!isset($val2["usehaving"])){
+                     if (!isset($val2["usehaving"]) && !isset($val2["nosearch"])){
 								$tmplink=$LINK;
 								if ($first2) {
 									$tmplink=" ";
@@ -1185,8 +1189,12 @@
 
 			// Display column Headers for toview items
 			foreach ($toview as $key => $val){
-				$linkto="$target?sort=".$val."&amp;order=".($order=="ASC"?"DESC":"ASC")."&amp;start=$start".$globallinkto;
-				echo displaySearchHeaderItem($output_type,$SEARCH_OPTION[$type][$val]["name"],$header_num,$linkto,$sort==$val,$order);
+            if (isset($SEARCH_OPTION[$type][$val]["nosearch"]) && $SEARCH_OPTION[$type][$val]["nosearch"]){
+              echo displaySearchHeaderItem($output_type,$SEARCH_OPTION[$type][$val]["name"],$header_num);	
+            } else {
+				  $linkto="$target?sort=".$val."&amp;order=".($order=="ASC"?"DESC":"ASC")."&amp;start=$start".$globallinkto;
+				  echo displaySearchHeaderItem($output_type,$SEARCH_OPTION[$type][$val]["name"],$header_num,$linkto,$sort==$val,$order);
+            }
 			}
 
 			// Display columns Headers for meta items
@@ -1788,7 +1796,8 @@
 			return " FLOOR( SUM($table$addtable.$field) * COUNT(DISTINCT $table$addtable.ID) / COUNT($table$addtable.ID) ) AS ".$NAME."_".$num.", MIN($table$addtable.$field) AS ".$NAME."_".$num."_2, ";
 		break;
 		case "glpi_inst_software.count" :
-			return " COUNT(DISTINCT glpi_inst_software$addtable.ID) AS ".$NAME."_".$num.", ";
+         return "";
+//			return " COUNT(DISTINCT glpi_inst_software$addtable.ID) AS ".$NAME."_".$num.", ";
 		break;
 		case "glpi_device_hdd.specif_default" :
 			return " SUM(DEVICE_".HDD_DEVICE.".specificity) / COUNT( DEVICE_".HDD_DEVICE.".ID) * COUNT( DISTINCT DEVICE_".HDD_DEVICE.".ID) AS ".$NAME."_".$num.", ";
@@ -2332,6 +2341,10 @@
 	$linkfield=$SEARCH_OPTION[$type][$ID]["linkfield"];
 
 	switch ($table.'.'.$field){
+		case "glpi_inst_software.count" :
+            
+            return countInstallationsForSoftware($data['ID']);
+
 		case "glpi_users.name" :		
 			// USER search case
 			if (!empty($linkfield)){
@@ -3024,8 +3037,9 @@
 			}
 		break;
 		case "glpi_inst_software":
-			$out=addLeftJoin($type,$rt,$already_link_tables,"glpi_softwareversions",$linkfield,$device_type,$meta,$meta_type);
-		return $out." LEFT JOIN $new_table $AS ON (glpi_softwareversions$addmetanum.ID = $nt.vID) ";
+//			$out=addLeftJoin($type,$rt,$already_link_tables,"glpi_softwareversions",$linkfield,$device_type,$meta,$meta_type);
+//		return $out." LEFT JOIN $new_table $AS ON (glpi_softwareversions$addmetanum.ID = $nt.vID) ";
+      return "";
 		break;
 		case "glpi_computer_device":
 			if ($device_type==0){
@@ -3086,7 +3100,7 @@
 			}
 
 			if (!empty($linkfield)){
-				return " LEFT JOIN $new_table $AS ON ($rt.$linkfield = $nt.ID) ";
+            return " LEFT JOIN $new_table $AS ON ($rt.$linkfield = $nt.ID) ";
 			} else {
 				return "";
 			}
@@ -3176,7 +3190,7 @@
 				case COMPUTER_TYPE :
 					array_push($already_link_tables2,$LINK_ID_TABLE[COMPUTER_TYPE]);
 					return " $LINK glpi_connect_wire AS conn_mon_$to_type ON (conn_mon_$to_type.end1=glpi_printers.ID  AND conn_mon_$to_type.type='".PRINTER_TYPE."') ".
-						" $LINK glpi_computers ON (conn_mon_$to_type.end2=glpi_computers.ID) ";
+						" $LINK glpi_computers ON (conn_mon_$to_type.end2=glpi_computers.ID ".getEntitiesRestrictRequest("AND",'glpi_computers').") ";
 
 					break;
 			}
@@ -3207,7 +3221,7 @@
 					array_push($already_link_tables2,$LINK_ID_TABLE[COMPUTER_TYPE]);
 					return " $LINK glpi_softwareversions as glpi_softwareversions_$to_type ON ( glpi_softwareversions_$to_type.sID = glpi_software.ID ) ".
 						" $LINK glpi_inst_software as inst_$to_type ON (inst_$to_type.vID = glpi_softwareversions_$to_type.ID) ".
-						" $LINK glpi_computers ON (inst_$to_type.cID = glpi_computers.ID)";
+						" $LINK glpi_computers ON (inst_$to_type.cID = glpi_computers.ID ".getEntitiesRestrictRequest("AND",'glpi_computers').")";
 
 					break;
 			}
Seulement dans svn8743/inc: search.function.php.orig
diff -ru glpi/inc/tracking.function.php svn8743/inc/tracking.function.php
--- glpi/inc/tracking.function.php	2009-08-06 23:10:00.000000000 +0200
+++ svn8743/inc/tracking.function.php	2009-08-18 16:59:45.000000000 +0200
@@ -1,6 +1,6 @@
 <?php
 /*
- * @version $Id: tracking.function.php 8640 2009-08-05 22:41:27Z moyo $
+ * @version $Id: tracking.function.php 8652 2009-08-07 12:11:52Z moyo $
  -------------------------------------------------------------------------
  GLPI - Gestionnaire Libre de Parc Informatique
  Copyright (C) 2003-2009 by the INDEPNET Development Team.
@@ -139,6 +139,10 @@
 	// $show_sort if 
 	$header_num=1;
 
+   // Force nolink on ajax :
+   if (strpos($target,'ajax')>0){
+      $nolink=true;
+   }
 
 	foreach (getTrackingSortOptions() as $key => $val){
 		$issort=0;
@@ -335,8 +339,8 @@
 
 	$query = "SELECT ".getCommonSelectForTrackingSearch()." 
 			FROM glpi_tracking ".getCommonLeftJoinForTrackingSearch()." 
-			WHERE (computer = '$item' and device_type= '$item_type') 
-				ORDER BY glpi_tracking.date_mod DESC LIMIT ".intval($_SESSION['glpilist_limit']);
+			WHERE (computer = '$item' and device_type= '$item_type') ".getEntitiesRestrictRequest("AND","glpi_tracking").
+				" ORDER BY glpi_tracking.date_mod DESC LIMIT ".intval($_SESSION['glpilist_limit']);
 
 	$result = $DB->query($query);
 
@@ -402,8 +406,8 @@
 
 	$query = "SELECT ".getCommonSelectForTrackingSearch()." 
 			FROM glpi_tracking ".getCommonLeftJoinForTrackingSearch()." 
-			WHERE (assign_ent = '$entID') 
-				ORDER BY glpi_tracking.date_mod DESC LIMIT ".intval($_SESSION['glpilist_limit']);
+			WHERE (assign_ent = '$entID') ".getEntitiesRestrictRequest("AND","glpi_tracking").
+				" ORDER BY glpi_tracking.date_mod DESC LIMIT ".intval($_SESSION['glpilist_limit']);
 
 	$result = $DB->query($query);
 
@@ -453,8 +457,8 @@
 
 	$query = "SELECT ".getCommonSelectForTrackingSearch()." 
 			FROM glpi_tracking ".getCommonLeftJoinForTrackingSearch()." 
-			WHERE (author = '$userID') 
-				ORDER BY glpi_tracking.date_mod DESC LIMIT ".intval($_SESSION['glpilist_limit']);
+			WHERE (author = '$userID') ".getEntitiesRestrictRequest("AND","glpi_tracking").
+				" ORDER BY glpi_tracking.date_mod DESC LIMIT ".intval($_SESSION['glpilist_limit']);
 
 	$result = $DB->query($query);
 
@@ -491,6 +495,55 @@
 	}
 }
 
+function showNewJobList() {
+	// $item is required
+	//affiche toutes les vielles intervention pour un $item donn� 
+
+	global $DB,$CFG_GLPI, $LANG;
+
+	if (!haveRight("show_all_ticket","1")) return false;
+
+	$where = "";	
+
+	$query = "SELECT ".getCommonSelectForTrackingSearch()." 
+			FROM glpi_tracking ".getCommonLeftJoinForTrackingSearch()." 
+			WHERE (status = 'new') ".getEntitiesRestrictRequest("AND","glpi_tracking").
+				" ORDER BY glpi_tracking.date_mod DESC LIMIT ".intval($_SESSION['glpilist_limit']);
+
+	$result = $DB->query($query);
+
+	$number = $DB->numrows($result);
+
+	if ($number > 0)
+	{
+		initNavigateListItems(TRACKING_TYPE);
+
+		echo "<div class='center'><table class='tab_cadre_fixe'>";
+		echo "<tr><th colspan='10'>".$LANG['central'][10]." ($number): &nbsp;";
+		echo "<a href='".$CFG_GLPI["root_doc"]."/front/tracking.php?reset=reset_before&amp;status=new'>".$LANG['buttons'][40]."</a>";
+		echo "</th></tr>";
+
+		
+		commonTrackingListHeader(HTML_OUTPUT,$_SERVER['PHP_SELF'],"","","",true);
+
+		while ($data=$DB->fetch_assoc($result)){
+			addToNavigateListItems(TRACKING_TYPE,$data["ID"]);
+			showJobShort($data, 0);
+		}
+		echo "</table></div>";
+	} 
+	else
+	{
+		echo "<div class='center'>";
+		echo "<table class='tab_cadre_fixe'>";
+		echo "<tr><th>".$LANG['joblist'][8]."</th></tr>";
+
+		echo "</table>";
+		echo "</div><br>";
+	}
+}
+
+
 function showJobShort($data, $followups,$output_type=HTML_OUTPUT,$row_num=0) {
 	// Prints a job in short form
 	// Should be called in a <table>-segment
Seulement dans glpi/install/mysql: glpi-0.72.1-empty.sql
diff -ru glpi/lib/vcardclass/classes-vcard.php svn8743/lib/vcardclass/classes-vcard.php
--- glpi/lib/vcardclass/classes-vcard.php	2009-08-06 23:10:00.000000000 +0200
+++ svn8743/lib/vcardclass/classes-vcard.php	2009-08-18 16:59:43.000000000 +0200
@@ -26,6 +26,8 @@
     return str_replace(";","\;",$string);
 }
 
+// Function provided in PHP >= 5.3.0
+if (!function_exists('quoted_printable_encode')) {
 // taken from PHP documentation comments
 function quoted_printable_encode($input, $line_max = 76) {
     $hex = array('0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F');
@@ -59,6 +61,7 @@
     }
     return trim($output);
 }
+}
 
 class vCard {
     var $properties;


Index: .cvsignore
===================================================================
RCS file: /cvs/extras/rpms/glpi/devel/.cvsignore,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -p -r1.15 -r1.16
--- .cvsignore	2 Jun 2009 15:23:56 -0000	1.15
+++ .cvsignore	18 Aug 2009 15:36:29 -0000	1.16
@@ -1 +1 @@
-glpi-0.71.6.tar.gz
+glpi-0.72.1.tar.gz


Index: glpi-config_path.php
===================================================================
RCS file: /cvs/extras/rpms/glpi/devel/glpi-config_path.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -p -r1.2 -r1.3
--- glpi-config_path.php	12 Jul 2008 07:21:33 -0000	1.2
+++ glpi-config_path.php	18 Aug 2009 15:36:30 -0000	1.3
@@ -11,6 +11,8 @@ define("GLPI_SESSION_DIR",    "/var/lib/
 define("GLPI_PLUGIN_DOC_DIR", "/var/lib/glpi/files/_plugins");
 define("GLPI_LOCK_DIR",       "/var/lib/glpi/files/_lock/");
 
-define("GLPI_CACHE_LITE_DIR", "Cache");
 define("GLPI_LOG_DIR",        "/var/log/glpi");
+
+define("GLPI_CACHE_LITE_DIR", "Cache");
+define("GLPI_PHPMAILER_DIR",  "PHPMailer");
 ?>


Index: glpi.spec
===================================================================
RCS file: /cvs/extras/rpms/glpi/devel/glpi.spec,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -p -r1.25 -r1.26
--- glpi.spec	25 Jul 2009 00:24:55 -0000	1.25
+++ glpi.spec	18 Aug 2009 15:36:30 -0000	1.26
@@ -5,8 +5,8 @@
 %endif
 
 Name:           glpi
-Version:        0.71.6
-Release:        2%{?dist}
+Version:        0.72.1
+Release:        1.svn8743%{?dist}
 Summary:        Free IT asset management software
 Summary(fr):    Gestion Libre de Parc Informatique
 
@@ -19,20 +19,16 @@ Source1:        glpi-httpd.conf
 Source2:        glpi-config_path.php
 Source3:        glpi-logrotate
 
-# Avoid SELinux AVC when testing write access to log file.
-# backport from 0.72 (Changeset 7208)
-Patch0:         glpi-check.patch
+# Upstream Patches up to 8743
+# see tools/make_release.sh 
+Patch0:         glpi-0.72.patch
 
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildArch:      noarch
 
-Requires:       php, php-mysql, httpd, php-gd, php-ldap, php-imap, php-mbstring
-%if 0%{?rhel} == 4
-Requires:       php-domxml
-%else
-Requires:       php-xml
+Requires:       php >= 5.0.0, php-mysql, httpd, php-gd, php-ldap, php-imap, php-mbstring, php-xml, php-json
 Requires:       php-pear(Cache_Lite) >= 1.7.4
-%endif
+Requires:       php-PHPMailer
 Requires:       %{_sysconfdir}/logrotate.d
 Requires(postun): /sbin/service
 Requires(post): /sbin/service
@@ -65,27 +61,27 @@ techniciens grâce à une maintenance pl
 %prep
 %setup -q -n glpi
 
-%patch0 -p0
-
-%if 0%{?rhel} == 4
-
-# use bundled lib
-mv lib/cache_lite/LICENSE   LICENSE.cache_lite
-grep -v GLPI_CACHE_LITE_DIR %{SOURCE2} >config/config_path.php 
-
-%else
+%patch0 -p1
 
 # Use system lib
 rm -rf lib/cache_lite
-cp %{SOURCE2} config/config_path.php 
+rm -rf lib/phpmailer
 
-%endif
+cp %{SOURCE2} config/config_path.php 
 
-mv lib/phpmailer/LICENSE    LICENSE.phpmailer
 mv lib/tiny_mce/license.txt LICENSE.tiny_mce
-dos2unix -o LICENSE.phpmailer LICENSE.tiny_mce
-iconv -f ISO-8859-15 -t UTF-8 LISEZMOI.txt >a && mv a LISEZMOI.txt
-iconv -f ISO-8859-15 -t UTF-8 README.txt   >a && mv a README.txt
+mv lib/extjs/license.txt    LICENSE.extjs
+rm lib/extjs/{CHANGES.html,INCLUDE_ORDER.txt}
+mv lib/icalcreator/lgpl.txt LICENSE.icalcreator
+mv lib/phpcas/COPYRIGHT     LICENSE.phpcas
+mv lib/phpcas/README        README.phpcas
+rm scripts/glpi_cron_curl.sh
+
+dos2unix -o LICENSE.tiny_mce
+for fic in LISEZMOI.txt README.txt
+do
+   iconv -f ISO-8859-15 -t UTF-8 $fic >a && mv a $fic
+done
 
 cat >cron <<EOF
 # GLPI core
@@ -103,9 +99,9 @@ rm -rf %{buildroot} 
 
 # ===== application =====
 mkdir -p %{buildroot}/%{_datadir}/%{name}
-cp -a *.php *.js %{buildroot}/%{_datadir}/%{name}/
+cp -a COPYING.txt *.php *.js %{buildroot}/%{_datadir}/%{name}/
 
-for i in ajax css front help inc install lib locales pics plugins scripts
+for i in ajax css front inc install lib locales pics plugins scripts
 do   cp -ar $i %{buildroot}/%{_datadir}/%{name}/$i
 done
 
@@ -164,10 +160,6 @@ rm -rf %{buildroot} 
 %post
 %if %{useselinux}
 (
-# Remove Selinux policy (from previous packaging)
-semodule -s targeted -r %{name} &>/dev/null
-# Remove old httpd_sys_script_rw_t
-semanage fcontext -d "%{_localstatedir}/log/glpi(/.*)?"
 # New File context
 semanage fcontext -a -s system_u -t httpd_sys_script_rw_t -r s0 "%{_sysconfdir}/glpi(/.*)?" 
 semanage fcontext -a -s system_u -t httpd_log_t           -r s0 "%{_localstatedir}/log/glpi(/.*)?"
@@ -198,7 +190,7 @@ fi
 
 %files -f %{name}.lang
 %defattr(-,root,root,-)
-%doc *.txt LICENSE.*
+%doc *.txt LICENSE.* README.*
 
 %attr(750,apache,root) %dir %{_sysconfdir}/%{name}
 %ghost %config(noreplace,missingok) %{_sysconfdir}/%{name}/config_db.php
@@ -213,11 +205,12 @@ fi
 %dir %{_datadir}/%{name}
 %{_datadir}/%{name}/*.php
 %{_datadir}/%{name}/*.js
+# License file required by installation process
+%{_datadir}/%{name}/COPYING.txt
 %{_datadir}/%{name}/ajax
 %{_datadir}/%{name}/config
 %{_datadir}/%{name}/css
 %{_datadir}/%{name}/front
-%{_datadir}/%{name}/help
 %{_datadir}/%{name}/inc
 %{_datadir}/%{name}/install
 %{_datadir}/%{name}/lib
@@ -229,6 +222,11 @@ fi
 
 
 %changelog
+* Tue Aug 18 2009 Remi Collet <Fedora at FamilleCollet.com> - 0.72.1-1.svn8743
+- update to 0.72.1 svn revision 8743
+- use system PHPMailer
+- now requires php > 5
+
 * Fri Jul 24 2009 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.71.6-2
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
 


Index: sources
===================================================================
RCS file: /cvs/extras/rpms/glpi/devel/sources,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -p -r1.17 -r1.18
--- sources	2 Jun 2009 15:23:56 -0000	1.17
+++ sources	18 Aug 2009 15:36:30 -0000	1.18
@@ -1 +1 @@
-d7137027c2a9f79cadd193bbe6ebab92  glpi-0.71.6.tar.gz
+8508b0cb6c459a3728c53f3cb04dd4e3  glpi-0.72.1.tar.gz


--- glpi-check.patch DELETED ---




More information about the scm-commits mailing list