function __construct() { global $messages; global $event; $this->load_related_event(); if (isset($_GET['act']) && !in_array($_GET['act'], array('new_event', 'browse', 'geocode', 'browse_act', 'browse_intervention', 'add_act_full'))) { $_GET['eid'] = isset($_GET['eid']) ? $_GET['eid'] : $_SESSION['eid']; if (!isset($_GET['eid'])) { shnMessageQueue::addInformation($messages['select_event']); set_redirect_header('events', 'browse'); exit; } $event = new Event(); $event->LoadFromRecordNumber($_GET['eid']); //if event does not exists if ($event->event_record_number != $_GET['eid'] || $event->event_record_number == '') { shnMessageQueue::addError($messages['event_not_found']); set_redirect_header('events', 'browse'); exit; } $this->event = $event; $this->event_id = $event->event_record_number; $_SESSION['eid'] = $_GET['eid']; set_url_args('eid', $this->event->event_record_number); } $this->createArgumentEncoder(); }
function __construct() { global $messages; $this->load_related_person(); if (isset($_GET['act']) && $_GET['act'] != 'new_person' && $_GET['act'] != 'browse' && $_GET['act'] != 'browse_biography') { $_GET['pid'] = isset($_GET['pid']) ? $_GET['pid'] : $_SESSION['pid']; $this->pid = $_GET['pid']; if (!isset($_GET['pid'])) { shnMessageQueue::addInformation($messages['select_person']); set_redirect_header('person', 'browse'); exit; } $this->person = new Person(); $this->person->LoadFromRecordNumber($_GET['pid']); $this->person->LoadRelationships(); $this->person->LoadAddresses(); $this->person->LoadPicture(); //if person does not exist if ($this->person->person_record_number != $_GET['pid']) { shnMessageQueue::addError($messages['person_not_found']); set_redirect_header('person', 'browse'); exit; } $_SESSION['pid'] = $_GET['pid']; set_url_args('pid', $this->person->person_record_number); } global $person; //hack for the permission card list; need to replaced with proper code $person = $this->person; $this->createArgumentEncoder(); }
function act_default() { if (acl_is_mod_allowed('events')) { set_redirect_header('events', 'browse'); } else { if (acl_is_mod_allowed('person')) { set_redirect_header('person', 'browse'); } else { if (acl_is_mod_allowed('docu')) { set_redirect_header('docu', 'browse'); } else { if (acl_is_mod_allowed('analysis')) { set_redirect_header('analysis', 'adv_search'); } else { if (acl_is_mod_allowed('events')) { set_redirect_header('admin', 'field_customization'); } else { shnMessageQueue::addInformation(_t('IF_YOU_REACH_THIS_PAGE_IT_MEANS_YOU_DO_NOT_HAVE_ACCESS_TO_ANY_OF_THE_MODULES_IN_OPENEVSYS__PLEASE_CONTACT_THE_SYSTEM_ADMINISTRATOR_FOR_MORE_DETAILS_')); } } } } } }
?> <div id="browse"> <?php if (acl_is_mod_allowed('person')) { ?> <a href="<?php get_url('person', 'new_person', null, null); ?> " class="btn btn-primary"> <i class="icon-plus icon-white"></i> <?php echo _t('ADD_NEW_PERSON'); ?> </a> <br/><br/> <?php } if (isset($_GET['filter']) || count($columnValues)) { if ($columnValues != null && count($columnValues)) { $result_pager->render_pages(); } shn_form_get_html_filter_table($columnNames, $columnValues, $htmlFields, $argumentEncoder); if ($columnValues != null && count($columnValues)) { $result_pager->render_pages(); } ?> </div> <br /> <?php } else { shnMessageQueue::addInformation(_t('THERE_IS_NO_PERSON_INFORMATION_YET__YOU_SHOULD_ADD_SOME_')); }
<?php if (isset($_GET['filter']) || count($columnValues)) { ?> <div id="browse" > <?php if ($columnValues != null && count($columnValues)) { $result_pager->render_pages(); } shn_form_get_html_filter_table($columnNames, $columnValues, $htmlFields); if ($columnValues != null && count($columnValues)) { $result_pager->render_pages(); } ?> </div> <br /> <?php } else { shnMessageQueue::addInformation(_t('THERE_IS_NO_INTERVENTION_INFORMATION_YET__YOU_SHOULD_ADD_SOME___CLICK_THE__ADD_NEW_EVENT__BUTTON_TO_ADD_A_NEW_EVENT_')); }
public function act_download() { //get file id //load document detaild $supporting_docs_meta = new SupportingDocsMeta(); $supporting_docs_meta->LoadfromRecordNumber($_GET['doc_id']); $supporting_docs_meta->LoadRelationships(); $supporting_docs = new SupportingDocs(); $supporting_docs->LoadfromRecordNumber($_GET['doc_id']); //set headers if ($supporting_docs->uri != null) { //echo $supporting_docs->uri; $ext = shn_file_findexts($supporting_docs->uri); //fetch document //stream document $title = $supporting_docs_meta->title; $file_name = str_replace(" ", "_", $title); header("Content-Type: application/{$ext}"); header("Content-Disposition: filename=" . urlencode("{$file_name}.{$ext}")); header("Content-Length: " . filesize($supporting_docs->uri)); $fp = fopen($supporting_docs->uri, 'rb'); fpassthru($fp); //inthis case we dont need to go to the templates so exit from the script } else { shnMessageQueue::addInformation('No attachment found to this document.'); set_redirect_header('docu', 'view_document', null, null); } exit; }
protected function searchResult() { require_once APPROOT . 'mod/analysis/analysisModule.class.php'; $analysisModule = new analysisModule(); $dataArray = array(); //assign post search queries to get foreach ($_REQUEST as $key => $element) { if ($_REQUEST[$key] != null) { $_GET[$key] = $_REQUEST[$key]; } } $sqlStatement = $analysisModule->generateSqlforEntity('person', null, $_REQUEST, 'search'); $entity_type_form_results = generate_formarray('person', 'search_view'); $entity_type_form_results['person_record_number']['type'] = 'text'; $field_list = array(); foreach ($entity_type_form_results as $field_name => $field) { $field_list[$field['map']['field']] = $field['label']; } foreach ($entity_type_form_results as $fieldName => &$field) { $field['extra_opts']['help'] = null; $field['label'] = null; $field['extra_opts']['clari'] = null; $field['extra_opts']['value'] = $_GET[$fieldName]; $field['extra_opts']['required'] = null; } $entity_fields_html = shn_form_get_html_fields($entity_type_form_results); $htmlFields = array(); //iterate through the search fields, checking input values foreach ($entity_type_form_results as $field_name => $x) { // Generates the view's Label list $htmlFields[$field_name] = $entity_fields_html[$field_name]; } $result_pager = Browse::getExecuteSql($sqlStatement); $columnValues = $result_pager->get_page_data(); $columnValues = set_links_in_recordset($columnValues, 'person'); set_huriterms_in_record_array($entity_type_form_results, $columnValues); //rendering the view $columnNames = $field_list; $this->htmlFields = $htmlFields; if ($columnValues != null && count($columnValues)) { $result_pager->render_pages(); shn_form_get_html_person_search_ctrl($columnNames, $columnValues, $htmlFields, $_GET['mod'], $_GET['act']); $result_pager->render_pages(); } else { shnMessageQueue::addInformation(_t('NO_RECORDS_WERE_FOUND_')); echo shnMessageQueue::renderMessages(); } }
protected function searchResult() { include_once APPROOT . 'inc/lib_form.inc'; require_once APPROOT . 'mod/analysis/analysisModule.class.php'; $analysisModule = new analysisModule(); $sqlStatement = $analysisModule->generateSqlforEntity('supporting_docs_meta', null, $_POST, 'search'); $entity_type_form_results = generate_formarray('supporting_docs_meta', 'browse'); $entity_type_form_results['doc_id']['type'] = 'text'; $field_list = array(); foreach ($entity_type_form_results as $field_name => $field) { $field_list[$field['map']['field']] = $field['label']; } foreach ($entity_type_form_results as $fieldName => &$field) { $field['extra_opts']['help'] = null; $field['label'] = null; $field['extra_opts']['clari'] = null; $field['extra_opts']['value'] = $_GET[$fieldName]; $field['extra_opts']['required'] = null; } $entity_fields_html = shn_form_get_html_fields($entity_type_form_results); $htmlFields = array(); //iterate through the search fields, checking input values foreach ($entity_type_form_results as $field_name => $x) { // Generates the view's Label list $htmlFields[$field_name] = $entity_fields_html[$field_name]; } $result_pager = Browse::getExecuteSql($sqlStatement); $columnValues = $result_pager->get_page_data(); $columnValues = set_links_in_recordset($columnValues, 'supporting_docs_meta'); set_huriterms_in_record_array($entity_type_form_results, $columnValues); //rendering the view $columnNames = $field_list; $this->htmlFields = $htmlFields; if ($columnValues != null && count($columnValues)) { $result_pager->render_post_pages(); shn_form_get_html_doc_search_ctrl($columnNames, $columnValues, $htmlFields); $result_pager->render_post_pages(); } else { shnMessageQueue::addInformation(_t('NO_RECORDS_WERE_FOUND_')); echo shnMessageQueue::renderMessages(); } }
if (isset($_GET['filter']) || count($columnValues)) { ?> <div id="browse"> <?php if (acl_is_mod_allowed('docu')) { ?> <a href="<?php get_url('docu', 'new_document', null, null); ?> " class="btn btn-primary"> <i class="icon-plus icon-white"></i> <?php echo _t('ADD_NEW_DOCUMENT'); ?> </a> <br/><br/> <?php } if ($columnValues != null && count($columnValues)) { $result_pager->render_pages(); } shn_form_get_html_filter_table($columnNames, $columnValues, $htmlFields, $argumentEncoder); if ($columnValues != null && count($columnValues)) { $result_pager->render_pages(); } ?> </div> <br /> <?php } else { shnMessageQueue::addInformation(_t('THERE_ARE_NO_DOCUMENTS_YET__YOU_SHOULD_ADD_SOME_')); }
</td> <td><?php echo get_mt_term($record['degree_of_involvement']); ?> </td> </tr> <?php } ?> </tbody> </table> <?php } } else { shnMessageQueue::addInformation(_t('NO_RECORDS_WERE_SELECTED_')); echo shnMessageQueue::renderMessages(); } ?> <center> <a class="btn" href="<?php echo get_url('events', 'vp_list', null, array('eid' => $event_id)); ?> "><i class="icon-chevron-left"></i> <?php echo _t('BACK'); ?> </a> </center> <br /> </div>
echo _t('DOWNLOAD_DOCUMENT'); ?> </a> <?php } ?> <a class="btn btn-grey" href="<?php echo get_url('docu', 'delete_document', null, array('doc_id' => $_GET['doc_id'])); ?> "><i class="icon-trash"></i> <?php echo _t('DELETE_DOCUMENT'); ?> </a> <?php if ($supporting_docs->uri == null) { shnMessageQueue::addInformation('No attachment found to this Document.'); } ?> <br /><br /> <?php $document_form = document_form('view'); $document_form['file_size'] = array('type' => 'text', 'label' => 'File Size', 'map' => array('entity' => 'supporting_docs_meta', 'field' => 'file_size')); popuate_formArray($document_form, $supporting_docs_meta); shn_form_get_html_labels($document_form, false); ?> </div> </div> <?php
?> </fieldset> <?php } ?> </div> </form> </div> <script language='javascript'> field_set_to_tab('search_panel'); </script> <div id="browse" > <h3><?php echo _t('SEARCH_RESULTS'); ?> </h3> <?php if ($columnValues != null && count($columnValues) > 0) { $result_pager->render_pages(); shn_form_get_html_table($columnNames, $columnValues); $result_pager->render_pages(); } else { shnMessageQueue::addInformation(_t('NO_RECORDS_WERE_FOUND_')); echo shnMessageQueue::renderMessages(); } ?> </div>
public function act_delete_query() { if (isset($_POST['delete_yes']) && is_array($_POST['sq'])) { $saveQuery = new SaveQuery(); foreach ($_POST['sq'] as $query) { $saveQuery->DeleteFromRecordNumber($query); } shnMessageQueue::addInformation(_t('QUERIES_DELETED_SUCCESSFULLY_')); } set_redirect_header('analysis', 'search_query'); }
echo $record['created_by']; ?> </td> <td><?php echo $types[$record['query_type']]; ?> </td> </tr> <?php } ?> <tr class='actions' > <td></td> <td colspan='6'> <button type='submit' class='btn btn-grey' name='delete' ><i class="icon-trash"></i> <?php echo _t('DELETE'); ?> </button> </tr> </tbody> </table> <?php $query_result_pager->render_pages(); } else { shnMessageQueue::addInformation(_t('NO_QUERIES_SAVED_YET_')); } ?> </form> </div>