/** Display individual record * @access public * @return void */ public function recordAction() { if ($this->getParam('id', false)) { $this->view->recordID = $this->getParam('id'); $id = $this->getParam('id'); $finds = $this->getFinds()->getAllData($id); $this->_helper->availableOrNot($finds); $this->view->finds = $finds; $coins = new Coins(); $this->view->coins = $coins->getCoinData($id); $coinRefs = new CoinClassifications(); $this->view->coinrefs = $coinRefs->getAllClasses($id); $thumbs = new Slides(); $this->view->thumbs = $thumbs->getThumbnails($id, 'artefacts'); $refs = new Publications(); $this->view->refs = $refs->getReferences($id); $this->view->comments = $this->getComments()->getFindComments($id); $models = new SketchFab(); $this->view->sketchfab = $models->getModels($id); } else { throw new Pas_Exception_Param($this->_missingParameter, 500); } }
/** Display a report in pdf format */ public function reportAction() { if ($this->_getParam('id', false)) { $this->view->recordID = $this->_getParam('id'); $id = $this->_getParam('id'); $finds = new Finds(); $findsdata = $finds->getIndividualFind($id, $this->getRole()); if (count($findsdata)) { $this->view->finds = $findsdata; } else { throw new Pas_Exception_NotAuthorised('You are not authorised to view this record'); } $findsdata = new Finds(); $this->view->findsdata = $findsdata->getFindData($id); $this->view->findsmaterial = $findsdata->getFindMaterials($id); $this->view->temporals = $findsdata->getFindTemporalData($id); $this->view->peoples = $findsdata->getPersonalData($id); $rallyfind = new Rallies(); $this->view->rallyfind = $rallyfind->getFindRallyNames($id); $coins = new Coins(); $this->view->coins = $coins->getCoinData($id); $thumbs = new Slides(); $this->view->thumbs = $thumbs->getThumbnails($id); $refs = new Publications(); $this->view->refs = $refs->getReferences($id); $findspotsdata = new Findspots(); $this->view->findspots = $findspotsdata->getFindSpotData($id); } else { throw new Pas_Exception_Param($this->_missingParameter, 500); } }
/** Display individual hoard record * @access public * @return void * @throws Pas_Exception_NotAuthorised * @throws Pas_Exception_Param */ public function recordAction() { if ($this->getParam('id', false)) { // Check there is a hoardID in the URL $id = $this->getParam('id'); $hoardsdata = $this->getHoards()->getBasicHoardData($id); $this->_helper->availableOrNot(array($hoardsdata)); if (!empty($hoardsdata)) { $this->view->hoards = $hoardsdata; $this->view->multipleKnownAs = $this->getHoards()->getKnownAs($id); $this->view->temporals = $this->getHoards()->getChronology($id); $this->view->coinChronology = $this->getHoards()->getCoinChronology($id); $this->view->hoardDescription = $this->getHoards()->getHoardDescription($id); $this->view->coinDataQuality = $this->getHoards()->getQualityRating($id); $this->view->subsequentActions = $this->getHoards()->getSubsequentActions($id); $this->view->treasureDetails = $this->getHoards()->getTreasureDetails($id); $this->view->hoardMaterials = $this->getHoards()->getMaterials($id); $this->view->linkedCoins = $this->getHoards()->getLinkedCoins($id); $this->view->linkedArtefacts = $this->getHoards()->getLinkedArtefacts($id); $this->view->linkedContainers = $this->getHoards()->getLinkedContainers($id); $this->view->recordersIdentifiers = $this->getHoards()->getRecordersIdentifiers($id); $this->view->finders = $this->getHoards()->getFinders($id); $this->view->discoverySummary = $this->getHoards()->getDiscoverySummary($id); $this->view->referenceNumbers = $this->getHoards()->getReferenceNumbers($id); $this->view->quantities = $this->getHoards()->getQuantities($id); $coinSummary = new CoinSummary(); $this->view->coinSummary = $coinSummary->getCoinSummary($id); $this->view->findspots = $this->getFindspots()->getFindSpotData($id, 'hoards'); $archaeology = new Archaeology(); $this->view->archaeologicalContext = $archaeology->getArchaeologyData($id); $refs = new Publications(); $this->view->refs = $refs->getReferences($id, 'hoards'); } else { throw new Pas_Exception_NotAuthorised('You are not authorised to view this record', 401); } } else { throw new Pas_Exception_Param($this->_missingParameter, 500); } }
/** Display individual record * @todo move comment functionality to a model */ public function recordAction() { if ($this->_getParam('id', false)) { $this->view->recordID = $this->_getParam('id'); $id = $this->_getParam('id'); $findsdata = $this->_finds->getIndividualFind($id, $this->getRole()); if ($findsdata) { $this->view->finds = $findsdata; } else { throw new Pas_Exception_NotAuthorised('You are not authorised to view this record'); } $contexts = array('xml', 'rss', 'json', 'atom', 'kml', 'georss', 'ics', 'rdf', 'xcs', 'vcf', 'csv', 'pdf'); if (!in_array($this->_cs->getCurrentContext(), $contexts)) { $this->view->findsdata = $this->_finds->getFindData($id); $this->view->findsmaterial = $this->_finds->getFindMaterials($id); $this->view->temporals = $this->_finds->getFindTemporalData($id); $this->view->nexts = $this->_finds->getNextObject($id); $this->view->recordsprior = $this->_finds->getPreviousObject($id); $this->view->peoples = $this->_finds->getPersonalData($id); $this->view->findotherrefs = $this->_finds->getFindOtherRefs($id); $findspotsdata = new Findspots(); $this->view->findspots = $findspotsdata->getFindSpotData($id); $rallyfind = new Rallies(); $this->view->rallyfind = $rallyfind->getFindToRallyNames($id); $coins = new Coins(); $this->view->coins = $coins->getCoinData($id); $coinrefs = new Coinclassifications(); $this->view->coinrefs = $coinrefs->getAllClasses($id); $thumbs = new Slides(); $this->view->thumbs = $thumbs->getThumbnails($id); $refs = new Publications(); $this->view->refs = $refs->getReferences($id); $comments = new Comments(); $this->view->comments = $comments->getFindComments($id); $response = $this->getResponse(); if (in_array($this->getRole(), $this->_higherLevel) && !in_array($this->_cs->getCurrentContext(), array('xml', 'json', 'qrcode'))) { $wform = new WorkflowStageForm(); $wform->id->setValue($id); $wform->submit->setLabel('Change workflow'); $this->view->wform = $wform; $response->insert('workflow', $this->view->render('structure/workflow.phtml')); } else { $findspotsdata = new Findspots(); $this->view->findspots = $findspotsdata->getFindSpotData($id); } $form = new CommentFindForm(); $form->submit->setLabel('Add a new comment'); $this->view->form = $form; if ($this->getRequest()->isPost() && $form->isValid($this->_request->getPost())) { if ($form->isValid($form->getValues())) { $data = $form->getValues(); if ($this->getHelper->getAkismet()->isSpam($data)) { $data['comment_approved'] = 'spam'; } else { $data['comment_approved'] = 'moderation'; } $comments = new Comments(); $insert = $comments->insert($data); $this->_flashMessenger->addMessage('Your comment has been entered and will appear shortly!'); $this->_redirect(self::REDIRECT . 'record/id/' . $this->_getParam('id')); $this->_request->setMethod('GET'); } else { $this->_flashMessenger->addMessage('There are problems with your comment submission'); $form->populate($formData); } } } else { $this->_helper->layout->disableLayout(); //disable layout $record = $this->_finds->getAllData($id); if ($this->_auth->hasIdentity()) { $user = $this->_auth->getIdentity(); if (in_array($user->role, $this->_restricted)) { $record['0']['gridref'] = NULL; $record['0']['easting'] = NULL; $record['0']['northing'] = NULL; $record['0']['lat'] = NULL; $record['0']['lon'] = NULL; $record['0']['finder'] = NULL; $record['0']['address'] = NULL; $record['0']['postcode'] = NULL; $record['0']['findspotdescription'] = NULL; } } else { $record['0']['gridref'] = NULL; $record['0']['easting'] = NULL; $record['0']['northing'] = NULL; $record['0']['lat'] = NULL; $record['0']['lon'] = NULL; $record['0']['finder'] = NULL; $record['0']['address'] = NULL; $record['0']['postcode'] = NULL; $record['0']['findspotdescription'] = NULL; if (!is_null($record['0']['knownas'])) { $record['0']['parish'] = NULL; $record['0']['fourFigure'] = NULL; } } $this->view->record = $record; } } else { throw new Pas_Exception_Param($this->_missingParameter); } }