Project

General

Profile

« Previous | Next » 

Revision 31245

fixed issue #704

View differences:

search.php
3797 3797
				throw new Exception('error parsing publication');
3798 3798
            if (($fundingNodes = $xpath -> query('./field[@name = "funding"]', $projectNode)) == FALSE)
3799 3799
				throw new Exception('error parsing publication');
3800
		    
3800
		   
3801 3801
			
3802 3802
			$project = new JObject();
3803 3803
			$project -> id = (($idNode = $idNodes -> item(0)) == NULL) ? NULL : trim($idNode -> nodeValue);
......
3807 3807
            $project -> inferred = (($inferredNode = $inferredNodes -> item(0)) == NULL) ? NULL : trim($inferredNode -> nodeValue)=="true"?true:false;
3808 3808
			$project -> trust = (($trustNode = $trustNodes -> item(0)) == NULL) ? NULL : trim($trustNode -> nodeValue);
3809 3809
            $project -> provenance = (($provenanceNode = $provenanceNodes -> item(0)) == NULL) ? NULL : trim($provenanceNode -> nodeValue);
3810
            $project -> funding = new JObject();
3810
         /*   $project -> funding = new JObject();
3811 3811
			if (($fundingNode = $fundingNodes -> item(0)) == NULL) ;
3812 3812
			else
3813 3813
			{
3814 3814
			    if (($funding0Nodes = $xpath -> query('./field[@name = "funding_level_0"]/@value', $fundingNode)) == FALSE)
3815 3815
				    throw new Exception('error parsing publication test');
3816 3816
			    $project -> funding->funding_level_0 = (($funding0Node = $funding0Nodes -> item(0)) == NULL) ? NULL : trim($funding0Node -> nodeValue);
3817
			}*/
3818
			
3819
			$project -> funding = new JObject();
3820
			$project -> funding->funding_level_0 = NULL;
3821
			$project -> funding->funding_level_1 = NULL;
3822
			$project -> funding->funding_level_2 = NULL;
3823
			
3824
			if (($fundingNode = $fundingNodes -> item(0)) == NULL);		
3825
			else{
3826
				if (($funding0Nodes = $xpath -> query('./field[@name = "funding_level_0"]', $fundingNode)) == FALSE)
3827
					throw new Exception('error parsing project');
3828
				if (($funding1Nodes = $xpath -> query('./field[@name = "funding_level_1"]', $fundingNode)) == FALSE)
3829
					throw new Exception('error parsing project');
3830
				if (($funding2Nodes = $xpath -> query('./field[@name = "funding_level_2"]', $fundingNode)) == FALSE)
3831
					throw new Exception('error parsing project');						
3832
				if (($funding0Node = $funding0Nodes -> item(0)) == NULL) ;
3833
				else
3834
				{
3835
					if (($funding0NameNodes = $xpath -> query('./@value_original', $funding0Node)) == FALSE)
3836
						throw new Exception('error parsing publication test');
3837
					$project -> funding -> funding_level_0 = (($funding0NameNode = $funding0NameNodes -> item(0)) == NULL) ? NULL : trim($funding0NameNode -> nodeValue);
3838
					$array=explode("::",$project -> funding -> funding_level_0 );
3839
					$project -> funding -> funding_level_0 =$array[sizeof($array)-1];
3840
				}
3841
				if (($funding1Node = $funding1Nodes -> item(0)) == NULL) ;
3842
				else
3843
				{
3844
					if (($funding1NameNodes = $xpath -> query('./@value_original', $funding1Node)) == FALSE)
3845
						throw new Exception('error parsing publication test');
3846
					$project -> funding -> funding_level_1 = (($funding1NameNode = $funding1NameNodes -> item(0)) == NULL) ? NULL : trim($funding1NameNode -> nodeValue);
3847
					$array=explode("::",$project -> funding -> funding_level_1 );
3848
					$project -> funding -> funding_level_1 =$array[sizeof($array)-1];
3849
				}
3850
				if (($funding2Node = $funding2Nodes -> item(0)) == NULL) ;
3851
				else
3852
				{
3853
					if (($funding2NameNodes = $xpath -> query('./@value_original', $funding2Node)) == FALSE)
3854
						throw new Exception('error parsing publication test');
3855
					$project -> funding -> funding_level_2 = (($funding2NameNode = $funding2NameNodes -> item(0)) == NULL) ? NULL : trim($funding2NameNode -> nodeValue);
3856
					$array=explode("::",$project -> funding -> funding_level_2 );
3857
					$project -> funding -> funding_level_2 =$array[sizeof($array)-1];
3858
				}	
3817 3859
			}
3860
			//!!!!
3818 3861
			
3819 3862
			if (($project -> id != NULL) || ($project -> acronym != NULL) || ($project -> title != NULL) || ($project -> code != NULL))
3820 3863
				$publication -> projects[] = $project;

Also available in: Unified diff