public function testcreate_where_statement() { //unset and reconnect Db to resolve mysqli fetch exeception global $db; unset($db->database); $db->checkConnection(); $mergeRecord = new MergeRecord(); $mergeRecord->load_merge_bean('Contacts'); $mergeRecord->populate_search_params(array('nameSearchField' => 'test', 'idSearchField' => '1')); $expected = array("contacts.id='1'", "contacts.name='test'", "contacts.id !=''"); $actual = $mergeRecord->create_where_statement(); $this->assertSame($expected, $actual); }
require_once 'include/ListView/ListView.php'; global $app_strings; global $app_list_strings; global $current_language; global $urlPrefix; global $currentModule; global $theme; $current_module_strings = return_module_language($current_language, 'MergeRecords'); $focus = new MergeRecord(); $focus->load_merge_bean($_REQUEST['merge_module'], true, $_REQUEST['record']); echo "\n<p>\n"; echo get_module_title($mod_strings['LBL_MODULE_NAME'], $current_module_strings['LBL_STEP2_FORM_TITLE'] . ' ' . $focus->merge_bean->name, true); echo "\n</p>\n"; $focus->populate_search_params($_REQUEST); $where_clauses = array(); $where_clauses = $focus->create_where_statement(); $where = $focus->generate_where_statement($where_clauses); $ListView = new ListView(); $ListView->force_mass_update = true; $ListView->show_mass_update_form = false; $ListView->show_export_button = false; $ListView->keep_mass_update_form_open = true; $bean_list_template_path = 'modules/' . $focus->merge_bean->module_dir . '/ListView.html'; $bean_list_template_var = strtoupper($app_list_strings['moduleListSingular'][$focus->merge_module]); // Bug 7706: bean_list_template_var is being mapped to BUG TRACKER from the app_list_strings // and it should be BUG to accommodate for the ListView if ($bean_list_template_var == 'BUG TRACKER') { $bean_list_template_var = 'BUG'; } $ListView->initNewXTemplate($bean_list_template_path, $focus->merge_bean_strings); $ListView->setHeaderTitle($focus->merge_bean->name);
$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 { if (file_exists('custom/modules/' . $module . '/metadata/metafiles.php')) { require_once 'custom/modules/' . $module . '/metadata/metafiles.php';