示例#1
0
} elseif (isset($_REQUEST['remove']) && $_REQUEST['remove'] == '1') {
    $base_id = $_REQUEST['record'];
    $removed_id = $_REQUEST['remove_id'];
    foreach ($_REQUEST['merged_ids'] as $id) {
        if ($id != $removed_id) {
            $merge_ids_array[] = $id;
        }
    }
} else {
    $base_id = $_REQUEST['record'];
    foreach ($_REQUEST['mass'] as $id) {
        $merge_ids_array[] = $id;
    }
}
$focus = new MergeRecord();
$focus->load_merge_bean($_REQUEST['merge_module'], true, $base_id);
$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[] = "<a href='index.php?module={$focus->merge_bean->module_dir}&action=DetailView&record={$focus->merge_bean->id}'>{$focus->merge_bean->name}</a>";
$params[] = $mod_strings['LBL_MODULE_NAME'];
echo getClassicModuleTitle($focus->merge_bean->module_dir, $params, true);
$mergeBeanArray = array();
$records = 1;
//render a column for each record to merge
$merged_ids = '';
$merge_records_names = array();
foreach ($merge_ids_array as $id) {
    require_once $focus->merge_bean_file_path;
    $mergeBeanArray[$id] = new $focus->merge_bean_class();
    $mergeBeanArray[$id]->retrieve($id);
    $merge_records_names[] = $mergeBeanArray[$id]->get_summary_text();
示例#2
0
 * Section 5 of the GNU Affero General Public License version 3.
 * 
 * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
 * these Appropriate Legal Notices must retain the display of the "Powered by
 * SugarCRM" logo. If the display of the logo is not reasonably feasible for
 * technical reasons, the Appropriate Legal Notices must display the words
 * "Powered by SugarCRM".
 ********************************************************************************/
/*********************************************************************************
 * Description:  TODO: To be written.
 * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
 * All Rights Reserved.
 * Contributor(s): ______________________________________..
 ********************************************************************************/
$focus = new MergeRecord();
$focus->load_merge_bean($_REQUEST['merge_module'], true, $_REQUEST['record']);
foreach ($focus->merge_bean->column_fields as $field) {
    if (isset($_POST[$field])) {
        $value = $_POST[$field];
        if (is_array($value) && !empty($focus->merge_bean->field_defs[$field]['isMultiSelect'])) {
            if (empty($value[0])) {
                unset($value[0]);
            }
            $value = encodeMultienumValue($value);
        }
        $focus->merge_bean->{$field} = $value;
    } elseif (isset($focus->merge_bean->field_name_map[$field]['type']) && $focus->merge_bean->field_name_map[$field]['type'] == 'bool') {
        $focus->merge_bean->{$field} = 0;
    }
}
foreach ($focus->merge_bean->additional_column_fields as $field) {
示例#3
0
 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);
 }