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
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'); }
public function act_coe_list() { $this->related_events = Browse::getChainOfEvents($this->event->event_record_number); $this->related_events_reverse = Browse::getChainOfEventsReverse($this->event->event_record_number); if (isset($_GET['coe_id'])) { global $messages; $coe = new ChainOfEvents(); $coe->LoadFromRecordNumber($_GET['coe_id']); if ($_GET['reverse']) { $coe->reverse(); } $coe->LoadRelationships(); if ($coe->chain_of_events_record_number != $_GET['coe_id'] || $coe->chain_of_events_record_number == '') { shnMessageQueue::addError($messages['coe_not_found']); unset($_GET['type']); } else { $this->coe = $coe; } } switch ($_GET['type']) { case 'coe': $this->related_event = new Event(); $this->related_event->LoadFromRecordNumber($coe->related_event); $this->related_event->LoadRelationships(); break; } }
include_section('menu'); ?> <?php /*include_section('top_menu'); */ ?> <div id="container" class="container-fluid"> <?php if ($action != "print") { include_section('breadcrumb'); } ?> <div class="row-fluid"> <?php $messages = shnMessageQueue::renderMessages(); echo $messages; ?> </div> <div class="row-fluid"> <?php include_section('mod_sidebar'); ?> <?php if ($action != "print") { include_section('mod_menu'); } ?>
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>
public function act_permissions() { $gacl_api = acl_get_gacl_api(); $this->roles = acl_get_roles(); if (isset($_POST['update'])) { foreach ($this->roles as $role_val => $role_name) { if ($role_val == 'admin') { continue; } $acl_id = $gacl_api->search_acl('access', 'access', FALSE, FALSE, $role_name, 'person', $this->person->person_record_number, FALSE, FALSE); if (isset($_POST['roles']) && in_array($role_val, $_POST['roles'])) { if (count($acl_id) == 0) { $aro_grp = $gacl_api->get_group_id($role_val, $role_name, 'ARO'); $return = $gacl_api->add_acl(array('access' => array('access')), null, array($aro_grp), array('person' => array($this->person->person_record_number)), null, 1); } } else { $gacl_api->del_acl($acl_id[0]); } } set_redirect_header('person', 'permissions'); } if (isset($_POST['add_user']) && $_POST['add_user'] != '') { $username = $_POST['add_user']; if (UserHelper::isUser($username)) { $return = $gacl_api->add_acl(array('access' => array('access')), array("users" => array($username)), null, array('person' => array($this->person->person_record_number)), null, 1); } else { shnMessageQueue::addError(_t('USERID_DOES_NOT_EXISTS_')); } } if (isset($_POST['remove_user'])) { $acl_id = $gacl_api->search_acl('access', 'access', 'users', $_POST['remove_user'], FALSE, 'person', $this->person->person_record_number, FALSE, FALSE); if (isset($acl_id[0])) { $gacl_api->del_acl($acl_id[0]); } } //populate checkboxes $this->value = array(); foreach ($this->roles as $role_val => $role_name) { $acl_id = $gacl_api->search_acl('access', 'access', FALSE, FALSE, $role_name, 'person', $this->person->person_record_number, FALSE, FALSE); if (count($acl_id) > 0) { $this->value[$role_val] = $role_val; } } //get users with permissions $this->users = acl_get_allowed_users($this->person->person_record_number, $type = 'person'); }