public function act_browse()
 {
     global $conf;
     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, $_GET, 'browse');
     $entity_type_form_results = generate_formarray('supporting_docs_meta', 'browse');
     $entity_type_form_results['doc_id']['type'] = 'text';
     if (isset($entity_type_form_results['format'])) {
         $entity_type_form_results['format']['type'] = 'text';
     }
     $field_list = array();
     foreach ($entity_type_form_results as $field_name => $field) {
         // Generates the view's Label list
         $field_list[$field['map']['field']] = $field['label'];
     }
     if (is_array($conf['browsefields']['supporting_docs_meta']) && in_array("eventslinks", $conf['browsefields']['supporting_docs_meta'])) {
         $field_list['eventslinks'] = _t('LINKS');
     }
     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;
         $field['extra_opts']['class'] = "input-block-level";
     }
     $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];
     }
     $this->result_pager = Browse::getExecuteSql($sqlStatement);
     $this->result_pager->setArgumentEncoder($this->argumentEncoder);
     $this->columnValues = $this->result_pager->get_page_data();
     $this->columnValues = set_links_in_recordset($this->columnValues, 'supporting_docs_meta');
     set_huriterms_in_record_array($entity_type_form_results, $this->columnValues);
     foreach ($this->columnValues as $k => $v) {
         $linksa = array();
         $links = Browse::getDocumentLinks($v['doc_id'], 'event');
         foreach ($links as $record) {
             $linksa[] = "<a href=\"" . get_record_url($record['record_number'], "event") . "\" >" . $record['record_number'] . "</a>";
         }
         $this->columnValues[$k]['eventslinks'] = implode("<br/>", $linksa);
     }
     //rendering the view
     $this->columnNames = $field_list;
     $this->htmlFields = $htmlFields;
     //var_dump($this->columnNames , $this->columnValues , $htmlFields	);
 }
 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();
     }
 }
 public function act_export_spreadsheet()
 {
     include_once APPROOT . 'inc/lib_form_util.inc';
     global $global;
     if (isset($_GET['shuffle_results'])) {
         if ($_GET['shuffle_results'] != 'all') {
             $sqlStatement = $this->generateSqlforEntity($this->main_entity, true);
         } else {
             $sqlStatement = $this->generateSqlforEntity($this->main_entity);
         }
     } else {
         $sqlStatement = $this->generateSqlforEntity($this->search_entity);
     }
     define('ADODB_FETCH_BOTH', 3);
     $global['db']->SetFetchMode(ADODB_FETCH_BOTH);
     $res = $global['db']->Execute($sqlStatement);
     $entity_type_form_results = generate_formarray($this->search_entity, 'search_view');
     $displayEntity = get_table_for_entity($this->search_entity);
     $res = set_links_in_recordset($res, $displayEntity);
     set_huriterms_in_record_array($entity_type_form_results, $res);
     $field_list = array();
     foreach ($entity_type_form_results as $field_name => $field) {
         $field_list[$field['map']['field']] = $field['label'];
     }
     $filename = 'openevsys_results_' . date('Ymd-His') . '.xls';
     header("Pragma: public");
     header("Content-Type: application/x-msexcel");
     header("Content-Disposition: attachment; filename={$filename};");
     if ($res) {
         $count = 1;
         foreach ($res as $record) {
             if ($count == 1) {
                 foreach ($record as $key => $value) {
                     if ($field_list[$key] != null) {
                         echo '"' . str_replace('"', '""', $field_list[$key]) . '"';
                         echo "\t";
                     }
                 }
                 $count++;
                 echo "\n";
             }
             foreach ($record as $key => $value) {
                 if ($field_list[$key] != null) {
                     $value = str_replace('<ul><li>', '', $value);
                     $value = str_replace('</li><li>', ',', $value);
                     $value = str_replace('</li></ul>', '', $value);
                     echo '"' . str_replace('"', '""', $value) . '"';
                     echo "\t";
                 }
             }
             echo "\n";
         }
     }
     exit;
 }
 public function act_doc_list()
 {
     $sqlStatement = Browse::getEventsDocList($this->event_id, $_GET);
     include_once APPROOT . 'inc/lib_form.inc';
     $entity_type_form_results = array('doc_id' => array('type' => 'text', 'label' => 'Document ID', 'map' => array('entity' => 'supporting_docs_meta', 'field' => 'doc_id')), 'entity_type' => array('type' => 'text', 'label' => 'Entity', 'map' => array('entity' => 'supporting_docs_meta', 'field' => 'entity_type')), 'title' => array('type' => 'text', 'label' => 'Document Title', 'map' => array('entity' => 'supporting_docs_meta', 'field' => 'title')), 'type' => array('type' => 'mt_select', 'label' => 'Type', 'map' => array('entity' => 'supporting_docs_meta', 'field' => 'type', 'mt' => 16)), 'format' => array('type' => 'text', 'label' => 'Format', 'map' => array('entity' => 'supporting_docs_meta', 'field' => 'format')));
     $field_list = array();
     foreach ($entity_type_form_results as $field_name => $field) {
         // Generates the view's Label list
         $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;
         $field['extra_opts']['class'] = "input-block-level";
     }
     $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];
     }
     $this->result_pager = Browse::getExecuteSql($sqlStatement);
     $this->columnValues = $this->result_pager->get_page_data();
     $this->columnValues = set_links_in_recordset($this->columnValues, 'supporting_docs_meta');
     $recordArray = array();
     foreach ($this->columnValues as $key => $columnValue) {
         foreach ($columnValue as $val => $value) {
             if ($val == 'entity_type') {
                 $recordArray[$key]['entity_record_url'] = get_record_url($columnValue['record_number'], $columnValue['entity_type']);
                 $recordArray[$key][$val] = ucfirst($columnValue['entity_type']);
             } else {
                 $recordArray[$key][$val] = $value;
             }
         }
     }
     $this->columnValues = $recordArray;
     set_huriterms_in_record_array($entity_type_form_results, $this->columnValues);
     //rendering the view
     $this->columnNames = $field_list;
     $this->htmlFields = $htmlFields;
 }
 public function act_browse_biography()
 {
     include_once APPROOT . 'inc/lib_form.inc';
     //$notIn = acl_list_acts_permissons();
     $notIn = 'allowed_records';
     // passed to generateSql function to use the temporary table to find the allowed records
     require_once APPROOT . 'mod/analysis/analysisModule.class.php';
     $analysisModule = new analysisModule();
     $sqlStatement = $analysisModule->generateSqlforEntity('biographic_details', null, $_GET, 'browse');
     $entity_type_form_results = generate_formarray('biographic_details', 'browse');
     $entity_type_form_results['biographic_details_record_number']['type'] = 'text';
     $field_list = array();
     foreach ($entity_type_form_results as $field_name => $field) {
         // Generates the view's Label list
         $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;
         $field['extra_opts']['class'] = "input-block-level";
     }
     $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];
     }
     //var_dump($sqlStatement);
     $this->result_pager = Browse::getExecuteSql($sqlStatement);
     $this->columnValues = $this->result_pager->get_page_data();
     $additionalurlfields = array();
     $additionalurlfields["person"] = array("entity" => "person", "val" => "person");
     $additionalurlfields["related_person"] = array("entity" => "person", "val" => "person");
     $additionalurlfields["biographic_details_record_number"] = array("entity" => "biographic_details", "val" => "biographic_details_record_number");
     $this->columnValues = set_links_in_recordset($this->columnValues, 'biographic_details', $additionalurlfields);
     // var_dump($this->columnValues);exit;
     set_huriterms_in_record_array($entity_type_form_results, $this->columnValues);
     //rendering the view
     $this->columnNames = $field_list;
     $this->htmlFields = $htmlFields;
 }