예제 #1
0
 public function testget_inputs_for_search_params()
 {
     error_reporting(E_ERROR | E_PARSE);
     //unset and reconnect Db to resolve mysqli fetch exeception
     global $db;
     unset($db->database);
     $db->checkConnection();
     $mergeRecord = new MergeRecord();
     $mergeRecord->load_merge_bean('Meetings');
     $expected = "<input type='hidden' name='idSearchField' value='1' />\n<input type='hidden' name='idSearchType' value='' />\n<input type='hidden' name='nameSearchField' value='test' />\n<input type='hidden' name='nameSearchType' value='' />\n";
     $result = $mergeRecord->get_inputs_for_search_params(array('nameSearchField' => 'test', 'idSearchField' => '1'));
     $this->assertSame($expected, $result);
 }
예제 #2
0
global $theme;
$current_module_strings = return_module_language($current_language, 'MergeRecords');
$focus = new MergeRecord();
$focus->load_merge_bean($_REQUEST['merge_module'], true, $_REQUEST['record']);
$this->bean = $focus->merge_bean;
$params = array();
$params[] = "<a href='index.php?module={$focus->merge_bean->module_dir}&action=index'>{$GLOBALS['app_list_strings']['moduleList'][$focus->merge_bean->module_dir]}</a>";
$params[] = $mod_strings['LBL_STEP2_FORM_TITLE'];
$params[] = $focus->merge_bean->name;
echo getClassicModuleTitle($focus->merge_bean->module_dir, $params, true);
$order_by_name = $focus->merge_module . '2_' . strtoupper($focus->merge_bean->object_name) . '_ORDER_BY';
$lvso = isset($_REQUEST['lvso']) ? $_REQUEST['lvso'] : "";
$request_order_by_name = isset($_REQUEST[$order_by_name]) ? $_REQUEST[$order_by_name] : "";
echo '<form onsubmit="return check_form(\'MassUpdate\');" id="MassUpdate" name="MassUpdate" method="post" action="index.php">' . '<input type="hidden" value="Step2" name="action"/>' . '<input type="hidden" value="true" name="massupdate"/>' . '<input type="hidden" value="false" name="delete"/>' . '<input type="hidden" value="false" name="merge"/>' . '<input type="hidden" value="MergeRecords" name="module"/>' . "<input type='hidden' name='lvso' value='{$lvso}' />" . "<input type='hidden' name='{$order_by_name}' value='{$request_order_by_name}' />";
$focus->populate_search_params($_REQUEST);
echo $focus->get_inputs_for_search_params($_REQUEST);
$where_clauses = array();
$where_clauses = $focus->create_where_statement();
$where = $focus->generate_where_statement($where_clauses);
$ListView = new ListViewSmarty();
$ListView->should_process = true;
$ListView->mergeduplicates = false;
$ListView->export = false;
$ListView->delete = false;
$module = $_REQUEST['merge_module'];
$metadataFile = null;
$foundViewDefs = false;
if (file_exists('custom/modules/' . $module . '/metadata/listviewdefs.php')) {
    $metadataFile = 'custom/modules/' . $module . '/metadata/listviewdefs.php';
    $foundViewDefs = true;
} else {