public function get_by_entity($entity_id) { $browse = new Browse(); $sql = "SELECT vocab_number FROM {$this->subformat_name} WHERE `record_number` = '{$entity_id}'"; $ids = $browse->ExecuteQuery($sql); $subformats = array(); $fields = generate_formarray($this->subformat_name, 'all', false, true); foreach ($ids as $id) { $subformat = $this->get_one($id["vocab_number"]); $subformat = $this->fill_relations($subformat, $fields); array_push($subformats, $subformat); } return $subformats; }
protected function searchResult($data) { require_once APPROOT . 'mod/analysis/analysisModule.class.php'; $analysisModule = new analysisModule(); $dataArray = array(); $_REQUEST['search_type'] = "event"; //var_dump($_REQUEST); foreach ($_REQUEST as $key => $element) { if ($_REQUEST[$key] != null) { $_GET[$key] = $_REQUEST[$key]; } } $sqlStatement = $analysisModule->generateSqlforEntity('event', null, $_REQUEST, 'search'); $entity_type_form_results = generate_formarray('event', 'search_view'); $entity_type_form_results['event_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, 'event'); 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_event_search_ctrl($columnNames, $columnValues, $htmlFields, $_GET['mod'], $_GET['act']); $result_pager->render_pages(); } else { shnMessageQueue::addInformation(_t('NO_RECORDS_WERE_FOUND_')); echo shnMessageQueue::renderMessages(); } }
public function act_subformat_edit() { $this->subformat_name = $_GET['subformat']; $this->subid = $_GET['subid']; $subformats_model = new SubformatsModel($this->subformat_name); if (isset($_POST['save'])) { $subformat = $subformats_model->fill_from_post('edit'); $subformat->record_number = $this->get_entity_id(); $subformat->_saved = true; $subformat->SaveAll(); set_redirect_header($_GET['mod'], 'subformat_list', null, array(subformat => $this->subformat_name)); } $this->fields = generate_formarray($this->subformat_name, 'edit', false, true); $subformat = $subformats_model->get_one($_GET['subid']); popuate_formArray($this->fields, $subformat); foreach ($data as $key => $value) { $this->fields[$key]['extra_opts']['value'] = $value; } }
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 ); }
?> </a><?php echo '<br />'; echo '<br />'; $source_form = person_form('view'); popuate_formArray($source_form, $source); shn_form_get_html_labels($source_form, false); break; case 'information': echo "<h3>" . _t('VIEW_INFORMATION_RECORD') . "</h3>"; ?> <br /> <a class="btn " href="<?php echo get_url('events', 'edit_information', null, array('eid' => $event_id, 'information_id' => $_GET['information_id'])); ?> "><i class="icon-edit"></i> <?php echo _t('EDIT_THIS_INFORMATION'); ?> </a> <br /><br /> <?php $information_form = generate_formarray('information', 'view'); popuate_formArray($information_form, $information); shn_form_get_html_labels($information_form, false); break; } } ?> </div>
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(); } }
<div ><a class="btn" href="<?php echo get_url('events', 'vp_list', null, array('eid' => $event_id, 'act_id' => $_GET['act_id'], 'row' => $_GET['row'], 'type' => 'act')); ?> "><i class="icon-remove-circle"></i> <?php echo _t('CANCEL'); ?> </a> <button type='submit' class='btn btn-primary' ><i class="icon-chevron-right icon-white"></i> <?php echo _t('NEXT'); ?> </button> </div></div></div> <?php } else { $ad_form = generate_formarray($ad_type, 'edit'); popuate_formArray($ad_form, $ad); $fields = shn_form_get_html_fields($ad_form); place_form_elements($ad_form, $fields); ?> <input type="hidden" name="ad_type" value='<?php echo $ad_type; ?> ' /> <div class="control-group"> <div > <a class="btn" href="<?php echo get_url('events', 'vp_list', null, array('eid' => $event_id, 'act_id' => $_GET['act_id'], 'row' => $_GET['row'], 'type' => 'act')); ?> "><i class="icon-remove-circle"></i> <?php echo _t('CANCEL');
public function getFormArray($secEntity, $option) { include_once APPROOT . 'inc/lib_form_util.inc'; $entities = $this->getEntityList($secEntity); $formArrays = array(); //var_dump('entities',$entities); foreach ($entities as $entity) { // get form array for each entity in secondary entities $formArray = null; $formArray = generate_formarray($entity['entity'], null, true); //var_dump('formArray Ori' , $formArray); $entityFieldList = array(); $entityFieldListRS = $this->getFieldListForEntity($secEntity, $option, $entity['entity']); foreach ($entityFieldListRS as $entityField) { $entityFieldList[] = $entityField['field_name']; } //var_dump('entity field list', $entityFieldList); $unsetKeys = array(); foreach ($formArray as $key => $field) { if (in_array($field['map']['field'], $entityFieldList) == false) { $unsetKeys[] = $key; } } foreach ($unsetKeys as $unsetKey) { unset($formArray[$unsetKey]); } //var_dump('formArray',$formArray); foreach ($formArray as $fieldArray) { $formArrays[] = $fieldArray; } } //var_dump($formArrays); return $formArrays; }
echo get_url('events', 'vp_list', null, array('eid' => $event_id)); ?> "><i class="icon-remove-circle"></i> <?php echo _t('CANCEL'); ?> </a> <button type="submit" class="btn btn-primary" name='set_type' ><i class="icon-chevron-right icon-white"></i> <?php echo _t('NEXT'); ?> </button> </div></div> <?php } else { ?> <?php $ad_form = generate_formarray($type, 'new'); ?> <?php $fields = shn_form_get_html_fields($ad_form); ?> <?php place_form_elements($ad_form, $fields); ?> <input type="hidden" name="type" value='<?php echo $type; ?> ' /> <div class="control-group"> <div > <a class="btn" href="<?php
public function act_field_customization() { global $conf; include_once APPROOT . 'mod/admin/lib_form_customization.inc'; $this->entity_select = $_REQUEST['entity_select']; $this->sub_act = isset($_REQUEST['sub_act']) ? $_REQUEST['sub_act'] : 'label'; $_REQUEST['sub_act'] = $this->sub_act; $this->browse_needed = false; if ($this->entity_select == 'event' || $this->entity_select == 'person' || $this->entity_select == 'supporting_docs_meta') { $this->browse_needed = true; } if ($this->entity_select == 'biographic_details' && $conf['menus']['biography_list']) { $this->browse_needed = true; } include_once APPROOT . 'mod/admin/customization_form.inc'; //include select entity form $this->customization_form = $customization_form; //if the locale is changed need to display extra column in label customization //if(is_locale_changed()) $this->locale = $conf['locale']; include_once APPROOT . 'inc/i18n/lib_l10n.inc'; $this->locales = l10n_get_locals(); if (isset($this->entity_select)) { if ($this->sub_act == 'help') { if ($_POST['save_help']) { form_customization_update_help($_POST, $this->entity_select); } $this->help_texts = Browse::getHelpText($this->entity_select, $this->locales); return; } elseif ($this->sub_act == 'order' && isset($_POST['itemsorder'])) { form_customization_update_fields_order($this->entity_select); } else { //if update is sent save data //OES-28. By pressing enter forms submited. if there no reset nor update - entered data will be lost. //so better to save changes. update by default //if($_POST['update']){ if ('POST' == $_SERVER['REQUEST_METHOD']) { form_customization_process_entity_form($this->entity_select); } /* if (isset($_POST['reset'])) { form_customization_reset_all($this->entity_select); } */ // OES-28 /* $reset_fields = form_customization_get_reset_fields(); foreach ($reset_fields as $post_value => $table_field) { if (isset($_POST[$post_value])) { form_customization_reset_field($this->entity_select, $table_field); } } */ } //include field form include_once APPROOT . 'mod/admin/entity_form.inc'; $this->entity_form = $entity_form; if ($this->sub_act == 'label') { $this->res = Browse::getFieldsTranslations($this->entity_select, $this->locales); } else { $this->res = form_customization_get_field_table($this->entity_select); } if ($this->sub_act == 'visibility') { $fields_form = generate_formarray($this->entity_select, "new"); $fields_form2 = array(); foreach ($fields_form as $k => $f) { if ($f["type"] == 'mt_tree' || $f['type'] == 'mt_select' || $f['type'] == 'radio') { $fields_form2[$k] = $f; } } $this->fields_form = $fields_form2; $res = Browse::getFields($this->entity_select); $fields = array(); $field_numbers = array(); foreach ($res as $record) { if ($record['enabled'] == 'y' && $record['visible_new'] == 'y' && ($record['field_type'] == 'mt_tree' || $record['field_type'] == 'mt_select' || $record['field_type'] == 'radio')) { $fields[$record['field_number']] = $record; } $field_numbers[] = $record['field_number']; } $this->fields_for_hide = $fields; $browse = new Browse(); $sql = "SELECT * from data_dict_visibility where field_number in ('" . implode("','", $field_numbers) . "') order by field_number,field_number2"; $this->visibility_fields = $browse->ExecuteQuery($sql); } } }
echo $record['event_title']; ?> </td> <td><?php echo get_mt_term(get_chaintype_reverse($record['type_of_chain_of_events'])); ?> </td> </tr> <?php } ?> </tbody> </table> <?php $coe_form = generate_formarray('chain_of_events', 'view'); $coe = new ChainOfEvents(); foreach ($related_events as $key => $record) { echo '<br /><h3>' . _t('CHANE_OF_EVENTS_') . ++$key . ' : ' . get_mt_term($record['type_of_chain_of_events']) . '</h3>'; echo '<h3>' . _t('RELATED_EVENT') . $key . ' : ' . $record['event_title'] . '</h3><br />'; //print victim details $coe->LoadFromRecordNumber($record['coe_id']); $coe->LoadRelationships(); popuate_formArray($coe_form, $coe); shn_form_get_html_labels($coe_form, false); echo "<br class='page_break' />"; } } ?> </div> <?php
public function generateSqlforEntity($entity_type, $shuffle = false, $dataArrayO = null, $search_type = null, $notIn = null) { if ($search_type == null) { $search_type = 'search'; } if ($dataArrayO == null) { $dataArray = $_GET; } else { $dataArray = $dataArrayO; } $dataArray = array_map('addslashes_deep', $dataArray); $sqlArray = array('select' => array(), 'from' => null, 'join' => array(), 'where' => array(), 'orderby' => array(), 'groupby' => array()); $sqlStatement = "SELECT * FROM {$entity_type}"; $sqlArray['from'] = $entity_type; $keyValue = ''; //" , {$entity_type}_record_number as keyValue"; switch ($entity_type) { case 'event': $sqlStatement = "SELECT * {$keyValue} FROM {$entity_type}"; $entity_type_form = generate_formarray('event', $search_type); break; case 'person': $sqlStatement = "SELECT * {$keyValue} FROM {$entity_type}"; $entity_type_form = generate_formarray('person', $search_type); break; case 'victim': $sqlArray['from'] = 'person'; $sqlArray['join'][] = array('table' => 'act', 'jointype' => null, 'field1' => 'victim', 'field2' => 'person_record_number', 'as' => null); $sqlStatement = "SELECT * {$keyValue} FROM person JOIN act ON victim = person_record_number "; $entity_type_form = generate_formarray('victim', $search_type); break; case 'perpetrator': $sqlArray['from'] = 'person'; $sqlArray['join'][] = array('table' => 'involvement', 'jointype' => null, 'field1' => 'perpetrator', 'field2' => 'person_record_number', 'as' => null); $sqlStatement = "SELECT * {$keyValue} FROM person JOIN involvement ON perpetrator = person_record_number "; //$entity_type = 'person'; $entity_type_form = generate_formarray('perpetrator', $search_type); break; case 'source': $sqlArray['from'] = 'person'; $sqlArray['join'][] = array('table' => 'information', 'jointype' => null, 'field1' => 'source', 'field2' => 'person_record_number', 'as' => null); $sqlStatement = "SELECT * {$keyValue} FROM person JOIN information ON source = person_record_number "; //$entity_type = 'person'; $entity_type_form = generate_formarray('source', $search_type); break; case 'intervening_party': $sqlArray['from'] = 'person'; $sqlArray['join'][] = array('table' => 'intervention', 'jointype' => null, 'field1' => 'intervening_party', 'field2' => 'person_record_number', 'as' => null); $sqlStatement = "SELECT * {$keyValue} FROM person JOIN intervention ON intervening_party = person_record_number "; //$entity_type = 'person'; $entity_type_form = generate_formarray('intervening_party', $search_type); break; default: $entity_type_form = generate_formarray($entity_type, $search_type); break; } //var_dump('person address' , $dataArray ) ; if (get_table_for_entity($entity_type) == 'person' && isset($dataArray['person_addresses'])) { $sqlArray['join'][] = array('table' => 'address', 'jointype' => 'LEFT', 'field1' => 'person_record_number', 'field2' => 'person', 'as' => null); $sqlArray['select'][] = 'address.*'; $sqlStatement = $sqlStatement . " LEFT JOIN address ON person_record_number= person "; } //SHUFFLE if ($shuffle == true) { $this->getShuffelSql($entity_type, $this->search_entity, $sqlArray); } //END SHUFFLE $sqlend = $this->generateSqlWhereforEntity($entity_type, $entity_type_form, $shuffleJoin, $dataArrayO, $sqlArray); $sqlStatement .= $sqlend; $view_type = $search_type == 'browse' ? 'browse' : 'search_view'; if ($shuffle == false) { $view_entity = $entity_type; } else { $view_entity = $this->search_entity; } $entity_type_form_results = generate_formarray($view_entity, $view_type); //Generate select terms and join for mlt search VIEW $mtJoins = array(); foreach ($entity_type_form_results as $field_name => $field) { //iterate through the search fields, checking input values $fieldName = $this->getSelectFieldName($field, $sqlArray); if ($fieldName != null) { $sqlArray['select'][] = $fieldName; //management data dosent appear in the $entity table ** FIX TO HANDLE THAT } if ($field['map']['mlt'] == true && $field['type'] != "user_select") { $isMLTpresent = true; // this is only mlt present in VIEW, could have been searched too $mtJoinArray = $this->generateMtJoin($field, $dataArray, $field_name, $sqlArray); $mtJoins['select'] .= " , " . $mtJoinArray['select']; if ($this->isInSearchArray($entity_type_form, $field_name) == false || is_array($dataArray[$field_name]) == false) { $mtJoins['join'] .= $mtJoinArray['join']; } //var_dump($mtJoinArray); } } //add Primary key if not exists $pkOfEntity = $this->tableOfEntity($view_entity) . '.' . get_primary_key($view_entity); if (in_array($pkOfEntity, $sqlArray['select']) == false) { $sqlArray['select'][] = $this->tableOfEntity($view_entity) . '.' . get_primary_key($view_entity); } //var_dump($mtJoins); //put the join ahead of the WHERE statement $whereIndex = stripos($sqlStatement, " WHERE"); if ($whereIndex == false) { $sqlStatement .= $mtJoins['join']; } else { $sqlStatement = substr_replace($sqlStatement, $mtJoins['join'], $whereIndex, 0); } $sqlStatement = substr_replace($sqlStatement, $mtJoins['select'], 9, 0); //var_dump($sqlStatement); //echo $sqlStatement; // GROUP BY //if($isMLTpresent == true){ $pkField = get_primary_key($this->tableOfEntity($entity_type)); $sqlArray['groupby'][] = $pkField; $sqlStatement .= " GROUP BY {$pkField} "; //} //END GROUP BY //SORT include_once APPROOT . 'inc/lib_util.inc'; $pk = get_primary_key($entity_type); if (isset($dataArray['sort'])) { foreach ($entity_type_form_results as $orderbykey => $orderbyField) { if ($dataArray['sort'] == $orderbyField['map']['field']) { $sortKey = $orderbykey; } } $sortField = $entity_type_form_results[$sortKey]['map']['field']; } else { $sortField = $pk; } if ($sortField == $pk) { $naturalSort = ' + 0 '; } $sortOrder = $dataArray['sortorder'] == 'desc' ? ' DESC ' : ' ASC '; $sqlArray['orderby'][] = "{$sortField} {$naturalSort} {$sortOrder}"; $sqlStatement .= " ORDER BY {$sortField} {$naturalSort} {$sortOrder}"; //} SORT END //NotIn if (is_array($notIn)) { $sqlArray['where'][] = " {$pkOfEntity} NOT IN( '" . implode("','", $notIn) . "')"; } if ($notIn == 'allowed_records') { $sqlArray['where'][] = " {$pkOfEntity} NOT IN( SELECT id FROM (SELECT * from allowed_records GROUP BY id\nHAVING order_id = min( order_id ) ) as ori WHERE allowed = 0 )"; } //var_dump($sqlArray); $sqlStatement = $this->sqlArrayToSql($entity_type, $sqlArray); //echo $sqlStatement; return $sqlStatement; }
public function act_edit_ad() { $this->vp_list = Browse::getVpList($this->event_id); //if an involvement is requested if (isset($_GET['act_id'])) { $this->set_act(); } $ad_types = array('killing' => _t('KILLING'), 'destruction' => _t('DESTRUCTION'), 'arrest' => _t('ARREST'), 'torture' => _t('TORTURE')); $this->ad_types = $ad_types; foreach ($ad_types as $ad_type => $ad_name) { $class = ucfirst($ad_type); $ad = new $class(); $record_number = $ad_type . '_record_number'; $ad->LoadFromRecordNumber($this->act->act_record_number); $ad->LoadRelationships(); if (isset($ad->{$record_number})) { $this->ad_type = $ad_type; $this->ad_name = $ad_name; $this->ad = $ad; break; } } if (isset($_POST['ad_type']) && array_key_exists($_POST['ad_type'], $ad_types)) { $this->ad_type = $_POST['ad_type']; } if (isset($_POST['update']) && isset($this->ad_type)) { $class = ucfirst($this->ad_type); $ad = new $class(); $ad_form = generate_formarray($this->ad_type, 'edit'); $ad->LoadFromRecordNumber($this->act->act_record_number); $ad->LoadManagementData(); $ad->LoadRelationships(); $rec_number = $this->ad_type . '_record_number'; $ad->{$rec_number} = $this->act->act_record_number; form_objects($ad_form, $ad); $ad->SaveAll(); set_redirect_header('events', 'vp_list', null, array('act_id' => $this->act->act_record_number, 'type' => 'act')); } //check if ad exists }
echo $record['initial_date']; ?> </td> <td><?php echo $record['final_date']; ?> </td> </tr> <?php } ?> </tbody> </table> <?php $bio_form = generate_formarray('biographic_details', 'view'); $bio = new BiographicDetail(); foreach ($biographics as $key => $record) { echo '<br /><h3>' . ++$key . '. ' . _t('PERSON_NAME') . ' : ' . $record['person_name'] . '</h3><br />'; //print victim details $person->LoadFromRecordNumber($record['related_person']); $person->LoadRelationships(); $bio->LoadFromRecordNumber($record['biographic_details_record_number']); $bio->LoadRelationships(); popuate_formArray($bio_form, $bio); shn_form_get_html_labels($bio_form, false); echo '<br />'; } foreach ($biographics_reverse as $key => $record) { echo '<br /><h3>' . ++$key . '. ' . _t('PERSON_NAME') . ' : ' . $record['person_name'] . '</h3><br />'; //print victim details
</div> <?php } } ?> <?php echo "<br />"; echo "<br />"; $act_form = act_form('view'); popuate_formArray($act_form, $act); shn_form_get_html_labels($act_form, false); if (isset($ad)) { echo "<br />"; echo "<br />"; echo "<h3>" . _t('ADDITIONAL_DETAILS') . "</h3> "; $ad_form = generate_formarray($ad_type, 'view'); popuate_formArray($ad_form, $ad); shn_form_get_html_labels($ad_form, false); } break; case 'inv': echo "<h3>" . _t('VIEW_INVOLVEMENT_RECORD') . "</h3> "; echo "<br />"; ?> <a class="btn" href="<?php echo get_url('events', 'edit_involvement', null, array('eid' => $_GET['eid'], 'row' => $_GET['row'], 'inv_id' => $_GET['inv_id'])); ?> "><i class="icon-edit"></i> <?php echo _t('EDIT_THIS_INVOLVEMENT'); ?> </a><?php
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; }