/** The constructor * @access public * @param array $options * @return void */ public function __construct(array $options = null) { parent::__construct($options); $authors = new Publications(); $authorList = $authors->getAuthors(); $this->setName('addreference'); $author = new Zend_Form_Element_Select('authors'); $author->setRequired(true)->setLabel('Principal authors: ')->addFilters(array('StripTags', 'StringTrim'))->setRegisterInArrayValidator(false)->setAttribs(array('class' => 'span8 selectpicker show-menu-arrow'))->addMultiOptions(array(null => 'Choose an author or authors', 'Available authors' => $authorList)); $title = new Zend_Form_Element_Select('pubID'); $title->setLabel('Publication title: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->setAttribs(array('class' => 'span8 selectpicker show-menu-arrow'))->addMultiOptions(array(null => 'Choose a title once you have chosen an author or authors'))->setRegisterInArrayValidator(false); $pages = new Zend_Form_Element_Text('pages_plates'); $pages->setLabel('Pages or plate number: ')->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 9); $reference = new Zend_Form_Element_Text('reference'); $reference->setLabel('Reference number: ')->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 15); //Submit button $submit = new Zend_Form_Element_Submit('submit'); $this->addElements(array($title, $author, $pages, $reference, $submit)); $this->addDisplayGroup(array('authors', 'pubID', 'pages_plates', 'reference'), 'details'); $this->details->setLegend('Reference details: '); $this->addDisplayGroup(array('submit'), 'buttons'); parent::init(); }
/** 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 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); } }
<? header( 'Content-Type: text/html;charset=UTF-8' ); require_once "includes/classes/clsPublications.php"; require_once "includes/generic_functions.php"; require_once("includes/settings.php");//holds paths to pdfs, images, etc. $cls_publications = new Publications(); $subcategory_id = "14";//we could write a function that searchs for the sonnaflow subcategory_id $arr_titles = $cls_publications->lookupSubCategoryTitles($subcategory_id); $int_num_titles = count($arr_titles["publication_titles.id"])-1; ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <head> <meta http-equiv="Content-Type" content="text/html;charset=utf-8"> <meta http-equiv="Content-Language" content="en"> <meta name="description" content="Sonnax"> <meta name="keywords" content="Sonnax"> <meta name="author" content="Sonnax"> <meta name="copyright" content="Sonnax"> <meta name="robots" content="all"> <link rel="contents" href="#" title="Sonnax"> <link rel="stylesheet" type="text/css" href="css/style.css" media="all"> <title>Sonnax - SonnaFlow®</title> <!--[if IE]> <style type="text/css" media="screen"> #menu{float:none;} /* IE Menu CSS */ body{behavior:url(css/csshover.htc);
<? header( 'Content-Type: text/html;charset=UTF-8' ); require_once "includes/classes/clsPublications.php"; require_once "includes/generic_functions.php"; require_once("includes/settings.php");//holds paths to pdfs, images, etc. $cls_publications = new Publications(); $arr_publications = $cls_publications->lookupPublicationCategories(); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <head> <meta http-equiv="Content-Type" content="text/html;charset=utf-8"> <meta http-equiv="Content-Language" content="en"> <meta name="description" content="Sonnax"> <meta name="keywords" content="Sonnax"> <meta name="author" content="Sonnax"> <meta name="copyright" content="Sonnax"> <meta name="robots" content="all"> <link rel="contents" href="#" title="Sonnax"> <link rel="stylesheet" type="text/css" href="css/style.css" media="all"> <title>Sonnax - Technical Information</title> <!--[if IE]> <style type="text/css" media="screen"> #menu{float:none;} /* IE Menu CSS */ body{behavior:url(css/csshover.htc); font-size:100%; }
/** Delete publication details */ public function deleteAction() { if ($this->_getParam('id', false)) { if ($this->_request->isPost()) { $id = (int) $this->_request->getPost('id'); $del = $this->_request->getPost('del'); if ($del == 'Yes' && $id > 0) { $publications = new Publications(); $where = array(); $where = $publications->getAdapter()->quoteInto('id = ?', $this->_getParam('id')); $this->_flashMessenger->addMessage('Record deleted!'); $publications->delete($where); $this->_helper->solrUpdater->deleteById('beopublications', $id); } $this->_redirect(self::REDIRECT); } else { $id = (int) $this->_request->getParam('id'); if ($id > 0) { $publications = new Publications(); $this->view->publication = $publications->fetchRow('id= ' . (int) $this->_getParam('id')); } } } else { throw new Pas_Exception_Param($this->_missingParameter); } }
public function publicationtitleAction() { $publications = new Publications(); $pubjson = $publications->getTitles(urlencode($this->_getParam('q'))); echo Zend_Json::encode($pubjson); }
/** Get the publications as json * @access public */ public function publicationsAction() { if ($this->getParam('term', false)) { $publication = new Publications(); $json = $publication->getTitles($this->getParam('term')); } else { $json = array(null => 'You must choose an author first'); } echo Zend_Json::encode($json); }
/** 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); } }
<? header( 'Content-Type: text/html;charset=UTF-8' ); error_reporting (E_ALL ^ E_NOTICE); require_once "../includes/classes/clsDataConn.php"; require_once "../includes/classes/clsAdminLogin.php"; require_once "../includes/classes/clsPublications.php"; require_once "../includes/generic_functions.php"; require_once "../includes/settings.php";//holds paths to pdfs, images, etc. require_once "includes/inc_admin_validate.php"; $message = $_GET["message"]; $cls_publications = new Publications(); $subcategory_id = $_GET["subcategory_id"]; $title = $_GET["title"]; $arr_titles = $cls_publications->titleSearch($title); $int_num_titles = count($arr_titles["publication_titles.id"])-1; $subcategory_title = $cls_publications->getSubcategoryName($subcategory_id); $url_start .= (($_SERVER['HTTPS'] != '') ? "https://" : "http://"); //get protocol $rd = $url_start . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']; ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <head> <meta http-equiv="Content-Type" content="text/html;charset=utf-8"> <meta http-equiv="Content-Language" content="en">
/** 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); } }
<? header( 'Content-Type: text/html;charset=UTF-8' ); require_once "includes/classes/clsPublications.php"; require_once "includes/classes/clsPublicationCategory.php"; require_once "includes/classes/clsPublicationSubCategory.php"; require_once "includes/generic_functions.php"; require_once "includes/settings.php";//holds paths to pdfs, images, etc. $cls_publications = new Publications(); $category_id = $_GET["category_id"]; $subcategory_id = $_GET["subcategory_id"]; $sort = $_GET["sort"]; if (empty($sort)) { $sort = 'title'; } $arr_titles = $cls_publications->lookupSubCategoryTitles($subcategory_id, $sort); $int_num_titles = count($arr_titles["publication_titles.id"])-1; $subcategory_name = $cls_publications->getSubcategoryName($subcategory_id); $clsPublicationCategory = new PublicationCategory($category_id); $clsSubPublicationCategory = new PublicationSubCategory($subcategory_id); $instructions = (strlen($clsSubPublicationCategory->instructions) > 0) ? $clsSubPublicationCategory->instructions : $clsPublicationCategory->instructions; $titleColumnName = (strlen($clsSubPublicationCategory->titleColumnName) > 0) ? $clsSubPublicationCategory->titleColumnName : $clsPublicationCategory->titleColumnName; $authorColumnName = (strlen($clsSubPublicationCategory->authorColumnName) > 0) ? $clsSubPublicationCategory->authorColumnName : $clsPublicationCategory->authorColumnName; $dateColumnName = (strlen($clsSubPublicationCategory->dateColumnName) > 0) ? $clsSubPublicationCategory->dateColumnName : $clsPublicationCategory->dateColumnName; $volumeColumnName = (strlen($clsSubPublicationCategory->volumeColumnName) > 0) ? $clsSubPublicationCategory->volumeColumnName : $clsPublicationCategory->volumeColumnName; ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html>
public function getUpdateData($core, $id) { if (in_array($core, $this->_cores)) { switch ($core) { case 'beowulf': $model = new Finds(); break; case 'beopeople': $model = new Peoples(); break; case 'beocontent': $model = new Content(); break; case 'beobiblio': $model = new Bibliography(); break; case 'beoimages': $model = new Slides(); break; case 'beopublications': $model = new Publications(); break; default: throw new Exception('Your core does not exist', 500); break; } $data = $model->getSolrData($id); // Zend_Debug::dump($data); // exit; $cleanData = $this->cleanData($data[0]); return $cleanData; } else { throw new Exception('That core does not exist', 500); } }
/** Edit a reference entity * @access public * @return void */ public function editAction() { $form = new ReferenceFindForm(); $this->view->form = $form; if ($this->_request->isPost()) { $formData = $this->_request->getPost(); if ($form->isValid($formData)) { unset($formData['authors']); unset($formData['submit']); $where = array(); $where[] = $this->_bibliography->getAdapter()->quoteInto('id = ?', $this->getParam('id')); $this->_bibliography->update($formData, $where); $this->getFlash()->addMessage('Reference details updated!'); $this->redirect($this->getRedirect() . 'record/id/' . $this->getParam('findID')); } else { $form->populate($this->_request->getPost()); } } else { $id = (int) $this->_request->getParam('id', 0); if ($id > 0) { $bib = $this->_bibliography->fetchFindBook($id, $this->getController()); $form->populate($bib['0']); $pubs = new Publications(); $titles = $pubs->getTitlesPairs($bib[0]['authors']); $form->pubID->addMultiOptions($titles); $form->pubID->setValue($bib[0]['pubID']); } } }