itemId = JRequest :: getUInt('Itemid', NULL); $user = JFactory :: getUser(); $claimModel = $this->getModel(self :: CLAIM_MODEL); $searchModel = $this->getModel(self :: SEARCH_MODEL); $application = JFactory :: getApplication(); $this->source = JRequest :: getString('source', self :: OPENAIRE); $this->claiminline = JRequest :: getString('claiminline', 'false'); $this->targetType = JRequest :: getString('targetType', 'publication'); $this->activeId = JRequest :: getString('activeId'); $this->sourceType = JRequest :: getString('sourceType'); $this->keyword = JRequest :: getString('keyword'); $this->format = JRequest :: getString('format'); $this->tmpl = JRequest :: getString('tmpl'); $this->page = JRequest :: getUInt('page', self :: PAGE); $this->size = JRequest :: getUInt('size', self :: SIZE); $locale = JFactory :: getLanguage()->getTag(); $publicationId = JRequest :: getString('publicationId'); $publicationSource = JRequest :: getString('publicationSource'); $projectId = JRequest :: getString('projectId'); $conceptId = JRequest :: getString('conceptId'); $this->resultsType = JRequest :: getString('resultsType', 'publication'); $this->complete = false; $this->error = false; if (JFactory :: getUser()->guest) { $redirectUrl = base64_encode(JRoute :: _('index.php?option=com_openaire&view=claim1'.(($this->itemId!==null)?'&Itemid=' . $this->itemId:''), FALSE)); if ($this->claiminline === 'true') { $redirectUrl = base64_encode(JRoute :: _('index.php?option=com_openaire&view=claim2'.(($this->itemId!==null)?'&Itemid=' . $this->itemId:'') .'&tmpl='.$this->tmpl . '&source=' . $this->source . '&claiminline=' . $this->claiminline . '&targetType=' . $this->targetType . '&activeId=' . $this->activeId . '&sourceType=' . $this->sourceType . '&keyword=' . $this->keyword, FALSE)); } JFactory :: getApplication()->redirect(JRoute :: _('index.php?option=com_users&view=login'.(($this->claiminline === 'true')?'&tmpl=modal':'').(($this->itemId!==null)?'&Itemid=' . $this->itemId:''). '&return=' . $redirectUrl, FALSE)); return TRUE; } switch (JRequest :: getString('action')) { case 'submitInline': if ($this->sourceType === 'dataset') { $publication = $searchModel->getDataset($this->activeId, $locale); } else { $publication = $searchModel->getPublication($this->activeId, $locale); } if ($publication == null) { $this->error = true; $this->complete = true; parent :: display($template); return TRUE; } $this->error = $claimModel->claimSelectedPublications($user, OpenAireModelClaim::CLAIMINLINE2, $publication, $this->activeId, $this->sourceType); $this->complete = true; $claimModel->emptySelectedPublications(OpenAireModelClaim::CLAIMINLINE2 . $this->activeId); parent :: display($template); return TRUE; /* case self :: REMOVE_PUBLICATION: $claimModel -> removeSelectedPublication($publicationSource, $publicationId); $application -> redirect(JRoute :: _('index.php?option=com_openaire&view=claim2&Itemid=' . $this -> itemId . '&source=' . $this -> source . '&keyword=' . $this -> keyword . '&page=' . $this -> page, FALSE)); return TRUE; case self :: REMOVE_PROJECT: $claimModel -> removeSelectedProject($projectId); $application -> redirect(JRoute :: _('index.php?option=com_openaire&view=claim2&Itemid=' . $this -> itemId . '&source=' . $this -> source . '&keyword=' . $this -> keyword . '&page=' . $this -> page, FALSE)); return TRUE; case self :: REMOVE_CONCEPT: $claimModel -> removeSelectedConcept($conceptId); $application -> redirect(JRoute :: _('index.php?option=com_openaire&view=claim2&Itemid=' . $this -> itemId . '&source=' . $this -> source . '&keyword=' . $this -> keyword . '&page=' . $this -> page, FALSE)); return TRUE; */ } if ($this->claiminline === 'false') { $this->selectedProjects = $claimModel->getSelectedProjects(); $this->selectedConcepts = $claimModel->getSelectedConcepts(); if ($this->selectedProjects === NULL && $this->selectedConcepts === NULL) { $application->redirect(JRoute :: _('index.php?option=com_openaire&view=claim1'.(($this->itemId!==null)?'&Itemid=' . $this->itemId:''), FALSE)); return TRUE; } } /* $this -> selectedPublications = $claimModel -> getSelectedPublications(); if (count($errors = $this -> get('Errors')) > 0) { JLog :: add('Error viewing claim2: ' . implode("\n", $errors), JLog :: ERROR, self :: LOG); return FALSE; } */ parent :: display($template); } }