{{{_fulltext%width=220px&height=100px}}} </div> <br style="clear: both;"/> <div style="float: right; margin-left: 20px;">{{{reset%label=Reset}}}</div> <div style="float: right;">{{{submit%label=Search}}}</div> {{{/form}}} <div class='clearfix'></div> </div> </div><!--end col-sm-8--> <div class="col-sm-6"> <div class="exhibitions"> <h1>Glenstone Exhibitions</h1> <?php $o_exhibition_search = new OccurrenceSearch(); $o_exhibition_search->setTypeRestrictions(array('exhibition')); $qr_exhibitions = $o_exhibition_search->search("*", array('checkAccess' => $va_access_values, 'sort' => 'ca_occurrences.exh_dates', 'sort_direction' => 'desc')); if ($qr_exhibitions->numHits()) { while ($qr_exhibitions->nextHit()) { print "<div class='exhibition'>" . caNavLink($this->request, $qr_exhibitions->get('ca_occurrences.preferred_labels'), '', '', 'Detail', 'occurrences/' . $qr_exhibitions->get('ca_occurrences.occurrence_id')) . "</div>"; } } ?> </div> </div> <!--end col-sm-4--> </div><!--end row--> </div> <!--end container-->
* http://www.CollectiveAccess.org * * ---------------------------------------------------------------------- */ $t_entity = $this->getVar('t_item'); $vn_entity_id = $t_entity->getPrimaryKey(); $vs_title = $this->getVar('label'); $va_access_values = $this->getVar('access_values'); require_once __CA_LIB_DIR__ . '/ca/Search/OccurrenceSearch.php'; # --- get all actions associated with the entity so can visualize in chronology timeline JavascriptLoadManager::register('jcarousel'); $t_list = new ca_lists(); $vn_action_type_id = $t_list->getItemIDFromList('occurrence_types', 'action'); $vn_context_type_id = $t_list->getItemIDFromList('occurrence_types', 'context'); $o_search = new OccurrenceSearch(); $o_search->setTypeRestrictions(array($vn_context_type_id, $vn_action_type_id)); $o_search->addResultFilter("ca_occurrences.access", "IN", join(',', $va_access_values)); $qr_res = $o_search->search("ca_entities.entity_id:{$vn_entity_id}", array('sort' => 'ca_occurrences.date.dates_value', 'sort_direction' => 'asc')); $va_actions = array(); $va_action_map = array(); if ($qr_res->numHits() > 0) { $t_occ = new ca_occurrences(); $i = 0; while ($qr_res->nextHit() && $i <= 25) { $va_silos = array(); $va_projects = array(); $t_occ->load($qr_res->get('ca_occurrences.occurrence_id')); $va_silos = $t_occ->get("ca_collections", array("restrictToTypes" => array("silo"), "returnAsArray" => 1, 'checkAccess' => $va_access_values)); $va_projects = $t_occ->get("ca_collections", array("restrictToTypes" => array("project"), "returnAsArray" => 1, 'checkAccess' => $va_access_values)); if (!($vs_date = trim($qr_res->get('ca_occurrences.date.dates_value', array('dateFormat' => 'delimited'))))) { continue;
/** * */ private function _getActionsCollection($pn_collection_id, $pn_start = 0, $pn_num_actions = 10) { $o_search = new OccurrenceSearch(); $o_search->setTypeRestrictions(array($this->opn_context_type_id, $this->opn_action_type_id)); $o_search->addResultFilter("ca_occurrences.access", "IN", join(',', $this->opa_access_values)); $qr_res = $o_search->search("ca_collections.collection_id:{$pn_collection_id}", array('sort' => 'ca_occurrences.date.dates_value', 'sort_direction' => 'asc')); $qr_res->seek($pn_start); $va_actions = array(); $vn_c = 0; $t_occ = new ca_occurrences(); while ($qr_res->nextHit()) { if (!($vs_date = trim($qr_res->get('ca_occurrences.date.dates_value', array('dateFormat' => 'delimited'))))) { continue; } if ($vs_date == 'present') { continue; } $va_silos = array(); $va_projects = array(); $t_occ->load($qr_res->get('ca_occurrences.occurrence_id')); $va_silos = $t_occ->get("ca_collections", array("restrictToTypes" => array("silo"), "returnAsArray" => 1, 'checkAccess' => $this->opa_access_values)); # --- format silo icons here $vs_silos = ""; if (is_array($va_silos) && sizeof($va_silos) > 0) { $vs_silos = "<div class='actionSiloIcons'>"; foreach ($va_silos as $vn_i => $va_silo_info) { $vs_bgColor = ""; switch ($va_silo_info["collection_id"]) { case $this->request->config->get('silo_strawberry_flag'): $vs_bgColor = $this->request->config->get('silo_strawberry_flag_bg'); break; # -------------------------------------- # -------------------------------------- case $this->request->config->get('silo_silver_water'): $vs_bgColor = $this->request->config->get('silo_silver_water_bg'); break; # -------------------------------------- # -------------------------------------- default: $vs_bgColor = "#000000"; break; } $vs_silos .= caNavLink($this->request, "<div class='actionSiloIcon siloIcon" . $va_silo_info["collection_id"] . "' style='background-color:" . $vs_bgColor . "'><!-- empty --></div>", '', 'Detail', 'Collection', 'Show', array('collection_id' => $va_silo_info["collection_id"]), array("title" => $va_silo_info["label"])); } $vs_silos .= "</div>"; } $va_projects = $t_occ->get("ca_collections", array("restrictToTypes" => array("project"), "returnAsArray" => 1, 'checkAccess' => $this->opa_access_values)); $va_timestamps = array_shift($qr_res->get('ca_occurrences.date.dates_value', array('rawDate' => true, 'returnAsArray' => true))); $va_actions[$vn_id = $qr_res->get('ca_occurrences.occurrence_id')] = array('occurrence_id' => $vn_id, 'label' => $qr_res->get('ca_occurrences.preferred_labels.name'), 'idno' => $qr_res->get('ca_occurrences.idno'), 'date' => $vs_date, 'timestamp' => $va_timestamps['start'], 'location' => $qr_res->get('ca_occurrences.georeference.geocode'), 'silos' => $va_silos, 'silos_formatted' => $vs_silos, 'projects' => $va_projects); $vn_c++; if ($vn_c >= $pn_num_actions) { break; } } return $va_actions; }
<?php require_once __CA_MODELS_DIR__ . '/ca_occurrences.php'; require_once __CA_LIB_DIR__ . '/ca/Search/OccurrenceSearch.php'; $va_access_values = caGetUserAccessValues($this->request); $o_search = new OccurrenceSearch(); $o_search->setTypeRestrictions(array('report')); $qr_res = $o_search->search("*", array('checkAccess' => $va_access_values)); # ------------------------------------------------------- # Media attribute bundle download # ------------------------------------------------------- /** * Initiates user download of media stored in a media attribute, returning file in response to request. * Adds download output to response directly. No view is used. * * @param array $pa_options Array of options passed through to _initView */ if (!function_exists("caDownloadAttributeMedia")) { function caDownloadAttributeMedia($po_request, $po_response, $pn_occurrence_id, $ps_version, $pa_options = null) { $o_view = new View($po_request, $po_request->getViewsDirectoryPath() . '/bundles/'); $t_occurrence = new ca_occurrences($pn_occurrence_id); if (!$t_occurrence->getPrimaryKey()) { return null; } $vs_path = $t_occurrence->get('ca_occurrences.report_file', array('version' => $ps_version, 'return' => 'path')); $vs_path_ext = pathinfo($vs_path, PATHINFO_EXTENSION); if (!($vs_title = trim($t_occurrence->get('ca_occurrences.preferred_labels.name')))) { $vs_title = "report"; } $vs_name = _t(preg_replace('![^A-Za-z0-9\\,\\/\\?\\"\']+!', '_', $vs_title) . ".{$vs_path_ext}");