layout = JRequest :: getString('layout', self :: HTML); $this->funder = JRequest :: getString('funder', NULL); $this -> projectId = JRequest :: getString('projectId'); $this -> size = JRequest :: getInt('size'); $locale = JFactory :: getLanguage() -> getTag(); $projectId = JRequest :: getString('projectId'); $model = $this -> getModel(self :: MODEL); $this -> organizationId=JRequest :: getString('organizationId'); $this -> organizationId=($this -> organizationId==='')?NULL:$this -> organizationId; if($this -> organizationId!==null){ $this -> participantAcronyms=JRequest :: getString('participantAcronyms'); $this -> organization = $model -> getOrganization($this -> organizationId, $locale); $this -> result=array(); $this -> totalProjects= sizeof($this -> organization -> projects); $this -> totalPublications = 0; // $i=0; if($this->funder==null){ foreach ($this -> organization -> projects as $project) { //just to get the total num :/ $result = $model -> browsePublications(NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 1, $locale, $project -> id, NULL, FALSE); if($result -> totalPublications>0){ if($this -> totalPublications!=0){ //no title in answer $url='search?action=search&sTransformer=results_openaire&query=(oaftype+exact+result)+and+(resulttypeid+exact+publication)+and+(relprojectid+exact+'.$project -> id.')&page=1&size='.$result -> totalPublications.'&locale=en_GB&format=publication_csv_notitle'; }else{ $url='search?action=search&sTransformer=results_openaire&query=(oaftype+exact+result)+and+(resulttypeid+exact+publication)+and+(relprojectid+exact+'.$project -> id.')&page=1&size='.$result -> totalPublications.'&locale=en_GB&format='.$this -> layout; } $this -> totalPublications+= $result -> totalPublications; //now get all of them $result = $model -> browsePublicationsRaw($url); $this -> result[]=$result; } /*$i++; if($i>=10){ break; }*/ } }else{ foreach ($this -> organization -> projects as $project) { if($project->funders[$this->funder]!=null){ //just to get the total num :/ $result = $model -> browsePublications(NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 1, $locale, $project -> id, NULL, FALSE); if($result -> totalPublications>0){ if($this -> totalPublications!=0){ //no title in answer $url='search?action=search&sTransformer=results_openaire&query=(oaftype+exact+result)+and+(resulttypeid+exact+publication)+and+(relprojectid+exact+'.$project -> id.')&page=1&size='.$result -> totalPublications.'&locale=en_GB&format=publication_csv_notitle'; }else{ $url='search?action=search&sTransformer=results_openaire&query=(oaftype+exact+result)+and+(resulttypeid+exact+publication)+and+(relprojectid+exact+'.$project -> id.')&page=1&size='.$result -> totalPublications.'&locale=en_GB&format='.$this -> layout; } $this -> totalPublications+= $result -> totalPublications; //now get all of them $result = $model -> browsePublicationsRaw($url); $this -> result[]=$result; } } /*$i++; if($i>=10){ break; }*/ } } if($this -> totalPublications===0){ $this -> result=0; } }else{ $this -> project = $model -> getProject($projectId, $locale); /* if($this -> layout==='html'){ $result = $model -> browsePublications(NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, $this -> size, $locale, $projectId, NULL,FALSE); $this -> publications = $result -> publications; }else{*/ //$url='search?action=search&sTransformer=results_openaire&rTransformer=results_openaire_browse&query=%28objIdentifier=od_______908::64da1cf1a1fd143bf958011be8ec857f%29&format=csv'; $url='search?action=search&sTransformer=results_openaire&query=(oaftype+exact+result)+and+(resulttypeid+exact+publication)+and+(relprojectid+exact+'.$this -> projectId.')&page=1&size='.$this -> size.'&locale=en_GB&format='.$this -> layout; $this ->result=0; if($this -> size!==0){ $this ->result = $model -> browsePublicationsRaw($url); } //} if (count($errors = $this -> get('Errors')) > 0) { JLog :: add('Error viewing publications: ' . implode("\n", $errors), JLog :: ERROR, self :: LOG); return FALSE; } } parent :: display($template); } }