Add php files

This commit is contained in:
2025-05-12 15:44:39 +00:00
parent c951760058
commit 82d5804ac4
9534 changed files with 2638137 additions and 0 deletions

49
modules/MergeRecords/Menu.php Executable file
View File

@@ -0,0 +1,49 @@
<?php
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* 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): ______________________________________..
********************************************************************************/
global $mod_strings, $app_strings;
$module_menu = Array(
//Nothing here yet
);
?>

View File

@@ -0,0 +1,334 @@
<?php
if (!defined('sugarEntry') || !sugarEntry)
die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* 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): ______________________________________..
********************************************************************************/
class MergeRecord extends SugarBean {
var $object_name = 'MergeRecord';
var $module_dir = 'MergeRecords';
var $acl_display_only = true;
var $merge_module;
var $merge_bean_class;
var $merge_bean_file_path;
var $merge_module2;
var $merge_bean_class2;
var $merge_bean_file_path2;
var $master_id;
//these arrays store the fields and params to search on
var $field_search_params = Array ();
//this is a object for the bean you are merging on
var $merge_bean;
var $merge_bean2;
//store a copy of the merge bean related strings
var $merge_bean_strings = Array ();
function MergeRecord($merge_module = '', $merge_id = '') {
global $sugar_config;
//parent :: SugarBean();
if ($merge_module != '')
$this->load_merge_bean($merge_module, $merge_id);
}
function retrieve($id) {
if (isset ($_REQUEST['action']) && $_REQUEST['action'] == 'Step2')
$this->load_merge_bean($this->merge_bean, false, $id);
else
parent :: retrieve($id);
}
function load_merge_bean($merge_module, $load_module_strings = false, $merge_id = '') {
global $moduleList;
global $beanList;
global $beanFiles;
global $current_language;
$this->merge_module = $merge_module;
$this->merge_bean_class = $beanList[$this->merge_module];
$this->merge_bean_file_path = $beanFiles[$this->merge_bean_class];
require_once ($this->merge_bean_file_path);
$this->merge_bean = new $this->merge_bean_class();
if ($merge_id != '')
$this->merge_bean->retrieve($merge_id);
//load master module strings
if ($load_module_strings)
$this->merge_bean_strings = return_module_language($current_language, $merge_module);
}
// Bug 22994, when the search key words are in other module, there needs to be another merge_bean.
function load_merge_bean2($merge_module, $load_module_strings = false, $merge_id = '') {
global $moduleList;
global $beanList;
global $beanFiles;
global $current_language;
$this->merge_module2 = $merge_module;
$this->merge_bean_class2 = $beanList[$this->merge_module2];
$this->merge_bean_file_path2 = $beanFiles[$this->merge_bean_class2];
require_once ($this->merge_bean_file_path2);
$this->merge_bean2 = new $this->merge_bean_class2();
if ($merge_id != '')
$this->merge_bean2->retrieve($merge_id);
//load master module strings
if ($load_module_strings)
$this->merge_bean_strings2 = return_module_language($current_language, $merge_module);
}
var $new_schema = true;
//-----------------------------------------------------------------------
//-------------Wrapping Necessary Merge Bean Calls-----------------------
//-----------------------------------------------------------------------
function fill_in_additional_list_fields() {
return $this->merge_bean->fill_in_additional_list_fields();
}
function fill_in_additional_detail_fields() {
return $this->merge_bean->fill_in_additional_detail_fields();
}
function get_summary_text() {
return $this->merge_bean->get_summary_text();
}
function get_list_view_data() {
return $this->merge_bean->get_list_view_data();
}
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
/**
builds a generic search based on the query string using or
do not include any $this-> because this is called on without having the class instantiated
*/
function build_generic_where_clause($the_query_string) {
return $this->merge_bean->build_generic_where_clause($the_query_string);
}
//adding in 4.0+ acl function for possible acl stuff down the line
function bean_implements($interface) {
switch ($interface) {
case 'ACL' :
return true;
}
return false;
}
function ACLAccess($view,$is_owner='not_set'){
global $current_user;
//if the module doesn't implement ACLS or is empty
if(empty($this->merge_bean) || !$this->merge_bean->bean_implements('ACL'))
{
return true;
}
if($is_owner == 'not_set'){
$is_owner = $this->merge_bean->isOwner($current_user->id);
}
return ACLController::checkAccess($this->merge_bean->module_dir,'edit', true);
}
//keep save function to handle anything special on merges
function save($check_notify = FALSE) {
//something here
return parent :: save($check_notify);
}
function populate_search_params($search_params) {
foreach ($this->merge_bean->field_defs as $key=>$value) {
$searchFieldString=$key.'SearchField';
$searchTypeString=$key.'SearchType';
if (isset($search_params[$searchFieldString]) ) {
if (isset($search_params[$searchFieldString]) == '') {
$this->field_search_params[$key]['value']='NULL';
} else {
$this->field_search_params[$key]['value']=$search_params[$searchFieldString];
}
if (isset ($search_params[$searchTypeString])) {
$this->field_search_params[$key]['search_type'] = $search_params[$searchTypeString];
} else {
$this->field_search_params[$key]['search_type'] = 'Exact';
}
//add field_def to the array.
$this->field_search_params[$key] = array_merge($value,$this->field_search_params[$key] );
}
}
}
function get_inputs_for_search_params($search_params)
{
$returnString = '';
foreach ($this->merge_bean->field_defs as $key=>$value) {
$searchFieldString=$key.'SearchField';
$searchTypeString=$key.'SearchType';
if (isset($search_params[$searchFieldString]) ) {
$returnString .= "<input type='hidden' name='$searchFieldString' value='{$search_params[$searchFieldString]}' />\n";
$returnString .= "<input type='hidden' name='$searchTypeString' value='{$search_params[$searchTypeString]}' />\n";
}
}
return $returnString;
}
function email_addresses_query($table, $module, $bean_id) {
$query = $table.".id IN (SELECT ear.bean_id FROM email_addresses ea
LEFT JOIN email_addr_bean_rel ear ON ea.id = ear.email_address_id
WHERE ear.bean_module = '{$module}'
AND ear.bean_id != '{$bean_id}'
AND ear.deleted = 0";
return $query;
}
function release_name_query($search_type, $value) {
$this->load_merge_bean2('Releases');
if($search_type=='like') {
$where = "releases.name LIKE '%".$GLOBALS['db']->quote($value)."%'";
}
elseif($search_type=='start'){
$where = "releases.name LIKE '".$GLOBALS['db']->quote($value)."%'";
}
else {
$where = "releases.name = '".$GLOBALS['db']->quote($value)."'";
}
$list=$this->merge_bean2->get_releases(false,'Active',$where);
foreach($list as $key => $value){
$list_to_join[]="'".$GLOBALS['db']->quote($key)."'";
}
$in=implode(', ', $list_to_join);
return $in;
}
function create_where_statement() {
$where_clauses = array ();
foreach ($this->field_search_params as $merge_field => $vDefArray) {
if (isset ($vDefArray['source']) && $vDefArray['source'] == 'custom_fields') {
$table_name = $this->merge_bean->table_name."_cstm";
} else {
$table_name = $this->merge_bean->table_name;
}
//Should move these if's into a central location for extensibility and addition for other search filters
//Must do the same for pulling values in js dropdown
if (isset ($vDefArray['search_type']) && $vDefArray['search_type'] == 'like') {
if ($merge_field != "email1" && $merge_field != "email2" && $merge_field !="release_name") {
array_push($where_clauses, $table_name.".".$merge_field." LIKE '%".$GLOBALS['db']->quote($vDefArray['value'])."%'");
}
elseif($merge_field =="release_name"){
if(isset($vDefArray['value'])){
$in = $this->release_name_query('like',$vDefArray['value']);
array_push($where_clauses, $table_name.".found_in_release IN ($in)");
}
}
else {
$query = $this->email_addresses_query($table_name, $this->merge_module, $this->merge_bean->id);
$query .= " AND ea.email_address LIKE '%".$GLOBALS['db']->quote($vDefArray['value'])."%')";
$where_clauses[] = $query;
}
}
elseif (isset ($vDefArray['search_type']) && $vDefArray['search_type'] == 'start') {
if ($merge_field != "email1" && $merge_field != "email2" && $merge_field !="release_name") {
array_push($where_clauses, $table_name.".".$merge_field." LIKE '".$GLOBALS['db']->quote($vDefArray['value'])."%'");
}
elseif($merge_field =="release_name"){
if(isset($vDefArray['value'])){
$in = $this->release_name_query('start',$vDefArray['value']);
array_push($where_clauses, $table_name.".found_in_release IN ($in)");
}
}
else {
$query = $this->email_addresses_query($table_name, $this->merge_module, $this->merge_bean->id);
$query .= " AND ea.email_address LIKE '".$GLOBALS['db']->quote($vDefArray['value'])."%')";
$where_clauses[] = $query;
}
}
else {
if ($merge_field != "email1" && $merge_field != "email2" && $merge_field !="release_name") {
array_push($where_clauses, $table_name.".".$merge_field."='".$GLOBALS['db']->quote($vDefArray['value'])."'");
}
elseif($merge_field =="release_name"){
if(isset($vDefArray['value'])){
$in = $this->release_name_query('exact',$vDefArray['value']);
array_push($where_clauses, $table_name.".found_in_release IN ($in)");
}
}
else {
$query = $this->email_addresses_query($table_name, $this->merge_module, $this->merge_bean->id);
$query .= " AND ea.email_address = '".$GLOBALS['db']->quote($vDefArray['value'])."')";
$where_clauses[] = $query;
}
}
}
array_push($where_clauses, $this->merge_bean->table_name.".id !='".$GLOBALS['db']->quote($this->merge_bean->id)."'");
return $where_clauses;
}
//duplicating utils function for now for possiblity of future or/and and
//other functionality
function generate_where_statement($where_clauses) {
$where = '';
foreach ($where_clauses as $clause) {
if ($where != "")
$where .= " AND ";
$where .= $clause;
}
return $where;
}
}
?>

View File

@@ -0,0 +1,218 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* 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)
{
if(isset($_POST[$field]))
{
$value = $_POST[$field];
if(is_array($value) && !empty($focus->merge_bean->field_defs[$field]->properties['isMultiSelect'])) {
if(empty($value[0])) {
unset($value[0]);
}
$value = encodeMultienumValue($value);
}
$focus->merge_bean->$field = $value;
}
}
global $check_notify;
$_REQUEST['useEmailWidget'] = true;
$focus->merge_bean->save($check_notify);
unset($_REQUEST['useEmailWidget']);
$return_id = $focus->merge_bean->id;
$return_module = $focus->merge_module;
$return_action = 'DetailView';
//handle realated data.
$linked_fields=$focus->merge_bean->get_linked_fields();
$exclude = explode(',', $_REQUEST['merged_links']);
if (is_array($_POST['merged_ids'])) {
foreach ($_POST['merged_ids'] as $id) {
require_once ($focus->merge_bean_file_path);
$mergesource = new $focus->merge_bean_class();
$mergesource->retrieve($id);
//kbrill Bug #13826
foreach ($linked_fields as $name => $properties) {
if ($properties['name']=='modified_user_link' || in_array($properties['name'], $exclude))
{
continue;
}
if (isset($properties['duplicate_merge'])) {
if ($properties['duplicate_merge']=='disabled' or
$properties['duplicate_merge']=='false' or
$properties['name']=='assigned_user_link') {
continue;
}
}
if ($name == 'accounts' && $focus->merge_bean->module_dir == 'Opportunities')
continue;
if ($mergesource->load_relationship($name)) {
//check to see if loaded relationship is with email address
$relName=$mergesource->$name->getRelatedModuleName();
if (!empty($relName) and strtolower($relName)=='emailaddresses'){
//handle email address merge
handleEmailMerge($focus,$name,$mergesource->$name->get());
}else{
$data=$mergesource->$name->get();
if (is_array($data)) {
if ($focus->merge_bean->load_relationship($name) ) {
foreach ($data as $related_id) {
//add to primary bean
$focus->merge_bean->$name->add($related_id);
}
}
}
}
}
}
//END Bug #13826
//delete the child bean, this action will cascade into related data too.
$mergesource->mark_deleted($mergesource->id);
}
}
$GLOBALS['log']->debug("Merged record with id of ".$return_id);
header("Location: index.php?action=$return_action&module=$return_module&record=$return_id");
//This function will compare the email addresses to be merged and only add the email id's
//of the email addresses that are not duplicates.
//$focus - Merge Bean
//$name - name of relationship (email_addresses)
//$data - array of email id's that will be merged into existing bean.
function handleEmailMerge($focus,$name,$data){
$mrgArray = array();
//get the email id's to merge
$existingData=$data;
//make sure id's to merge exist and are in array format
//get the existing email id's
$focus->merge_bean->load_relationship($name);
$exData=$focus->merge_bean->$name->get();
if (!is_array($existingData) || empty($existingData)) {
return ;
}
//query email and retrieve existing email address
$exEmailQuery = 'Select id, email_address from email_addresses where id in (';
$first = true;
foreach($exData as $id){
if($first){
$exEmailQuery .= " '$id' ";
$first = false;
}else{
$exEmailQuery .= ", '$id' ";
$first = false;
}
}
$exEmailQuery .= ')';
$exResult = $focus->merge_bean->db->query($exEmailQuery);
while(($row=$focus->merge_bean->db->fetchByAssoc($exResult))!= null) {
$existingEmails[$row['id']]=$row['email_address'];
}
//query email and retrieve email address to be linked.
$newEmailQuery = 'Select id, email_address from email_addresses where id in (';
$first = true;
foreach($existingData as $id){
if($first){
$newEmailQuery .= " '$id' ";
$first = false;
}else{
$newEmailQuery .= ", '$id' ";
$first = false;
}
}
$newEmailQuery .= ')';
$newResult = $focus->merge_bean->db->query($newEmailQuery);
while(($row=$focus->merge_bean->db->fetchByAssoc($newResult))!= null) {
$newEmails[$row['id']]=$row['email_address'];
}
//compare the two arrays and remove duplicates
foreach($newEmails as $k=>$n){
if(!in_array($n,$existingEmails)){
$mrgArray[$k] = $n;
}
}
//add email id's.
foreach ($mrgArray as $related_id=>$related_val) {
//add to primary bean
$focus->merge_bean->$name->add($related_id);
}
}
?>

188
modules/MergeRecords/Step1.php Executable file
View File

@@ -0,0 +1,188 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* 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): ______________________________________..
********************************************************************************/
require_once('include/JSON.php');
global $app_strings;
global $mod_strings;
global $app_list_strings;
global $current_language;
global $currentModule;
global $theme;
$json=new JSON(JSON_LOOSE_TYPE);
$current_module_strings = return_module_language($current_language, 'MergeRecords');
if (!isset($where)) $where = "";
$focus = new MergeRecord();
////////////////////////////////////////////////////////////
//get instance of master record and retrieve related record
//and items
////////////////////////////////////////////////////////////
$focus->merge_module = $_REQUEST['return_module'];
$focus->load_merge_bean($focus->merge_module, true, $_REQUEST['record']);
//get all available column fields
//TO DO: add custom field handling
$avail_fields=array();
$sel_fields=array();
$temp_field_array = $focus->merge_bean->field_defs;
$bean_data=array();
foreach($temp_field_array as $field_array)
{
if (isset($field_array['merge_filter'])
) {
if (strtolower($field_array['merge_filter'])=='enabled' or strtolower($field_array['merge_filter'])=='selected') {
$col_name = $field_array['name'];
if(!isset($focus->merge_bean_strings[$field_array['vname']])) {
$col_label = $col_name;
}
else {
$col_label = str_replace(':', '', $focus->merge_bean_strings[$field_array['vname']]);
}
if (strtolower($field_array['merge_filter'])=='selected') {
$sel_fields[$col_name]=$col_label;
} else {
$avail_fields[$col_name] = $col_label;
}
$bean_data[$col_name]=$focus->merge_bean->$col_name;
}
}
}
/////////////////////////////////////////////////////////
//Print the master record header to the page
$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_LBL_MERGE_RECORDS_STEP_1'];
echo getClassicModuleTitle($focus->merge_bean->module_dir, $params, true);
$xtpl = new XTemplate ('modules/MergeRecords/Step1.html');
$xtpl->assign("MOD", $mod_strings);
$xtpl->assign("APP", $app_strings);
$xtpl->assign("BEANDATA",$json->encode($bean_data));
//This is for the implemetation of finding all dupes for a module, not just
//dupes for a particular record
//commenting this out for now
//$choose_master_by_options = array('First Record Found', 'Most Recent Record', 'Oldest Record', 'Record Containing Most Data');
//$xtpl->assign("CHOOSE_MASTER_BY_OPTIONS", get_select_options_with_id($choose_master_by_options, 'First Record Found'));
$xtpl->assign("MERGE_MODULE", $focus->merge_module);
$xtpl->assign("ID", $focus->merge_bean->id);
$xtpl->assign("FIELD_AVAIL_OPTIONS", get_select_options_with_id($avail_fields,''));
$xtpl->assign("LBL_ADD_BUTTON", translate('LBL_ADD_BUTTON'));
if(isset($_REQUEST['return_id'])) $xtpl->assign("RETURN_ID", $_REQUEST['return_id']);
$xtpl->assign("RETURN_ACTION", $_REQUEST['return_action']);
$xtpl->assign("RETURN_MODULE", $_REQUEST['return_module']);
//set the url
$port=null;
if(isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] != 80 && $_SERVER['SERVER_PORT'] != 443) {
$port = $_SERVER['SERVER_PORT'];
}
$xtpl->assign("URL", appendPortToHost($sugar_config['site_url'], $port));
//set images
$xtpl->assign("RIGHTARROW_BIG_IMAGE", SugarThemeRegistry::current()->getImageURL('rightarrow_big.gif'));
$xtpl->assign("DELETE_INLINE_IMAGE", SugarThemeRegistry::current()->getImageURL('delete_inline.gif'));
//process preloaded filter.
$pre_loaded=null;
foreach ($sel_fields as $colName=>$colLabel) {
$pre_loaded.=addFieldRow($colName,$colLabel,$bean_data[$colName]);
}
$xtpl->assign("PRE_LOADED_FIELDS",$pre_loaded);
$xtpl->assign("OPERATOR_OPTIONS",$json->encode($app_list_strings['merge_operators_dom']));
$xtpl->parse("main.field_select_block");
$xtpl->parse("main");
$xtpl->out("main");
/**
* This function is equivalent of AddFieldRow in merge.js. is being used to
* preload the filter criteria based on the vardef.
* <span><table><tr><td></td><td></td><td></td></tr></table></span>
*/
function addFieldRow($colName,$colLabel,$colValue) {
global $theme, $app_list_strings;
static $operator_options;
if (empty($operator_options)) {
$operator_options= get_select_options_with_id($app_list_strings['merge_operators_dom'],'');
}
$LBL_REMOVE = translate('LBL_REMOVE');
$deleteInlineImage = SugarThemeRegistry::current()->getImageURL('delete_inline.gif');
$snippet=<<<EOQ
<span id=filter_{$colName} style='visibility:visible' value="{$colLabel}" valueId="{$colName}">
<table width='100%' border='0' cellpadding='0'>
<tr>
<td width='2%'><a class="listViewTdToolsS1" href="javascript:remove_filter('filter_{$colName}')"><img src='{$deleteInlineImage}' align='absmiddle' alt='{$LBL_REMOVE}' border='0' height='12' width='12'>&nbsp;</a></td>
<td width='20%'>{$colLabel}:&nbsp;</td>
<td width='10%'><select name='{$colName}SearchType'>{$operator_options}</select></td>
<td width='68%'><input value="{$colValue}" id="{$colName}SearchField" name="{$colName}SearchField" type="text"></td>
</tr>
</table>
</span>
EOQ;
return $snippet;
}

213
modules/MergeRecords/Step2.php Executable file
View File

@@ -0,0 +1,213 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* 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): ______________________________________..
********************************************************************************/
require_once('include/ListView/ListViewSmarty.php');
require_once('include/MVC/View/views/view.list.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']);
$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[] = "<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_STEP2_FORM_TITLE'];
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->select = 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');
if(!empty($metafiles[$module]['listviewdefs'])){
$metadataFile = $metafiles[$module]['listviewdefs'];
$foundViewDefs = true;
}
}elseif(file_exists('modules/'.$module.'/metadata/metafiles.php')){
require_once('modules/'.$module.'/metadata/metafiles.php');
if(!empty($metafiles[$module]['listviewdefs'])){
$metadataFile = $metafiles[$module]['listviewdefs'];
$foundViewDefs = true;
}
}
}
if(!$foundViewDefs && file_exists('modules/'.$module.'/metadata/listviewdefs.php')){
$metadataFile = 'modules/'.$module.'/metadata/listviewdefs.php';
}
require_once($metadataFile);
$displayColumns = array();
if(!empty($_REQUEST['displayColumns'])) {
foreach(explode('|', $_REQUEST['displayColumns']) as $num => $col) {
if(!empty($listViewDefs[$module][$col]))
$displayColumns[$col] = $listViewDefs[$module][$col];
}
}
else {
foreach($listViewDefs[$module] as $col => $params) {
if(!empty($params['default']) && $params['default'])
$displayColumns[$col] = $params;
}
}
$params = array('massupdate' => true, 'export' => false, 'handleMassupdate' => false );
$ListView->displayColumns = $displayColumns;
$ListView->lvd->listviewName = $focus->merge_module; //27633, this will make the $module to be merge_module instead of 'MergeRecords'. Then the key of offset and orderby will be correct.
$where = $focus->generate_where_statement($focus->create_where_statement());
$ListView->setup($this->bean, 'include/ListView/ListViewGeneric.tpl', $where, $params);
$ListView->force_mass_update=true;
$ListView->show_mass_update_form=false;
$ListView->show_export_button=false;
$ListView->keep_mass_update_form_open=true;
$return_id = $_REQUEST['record'];
$merge_module = $focus->merge_module;
$button_title = $current_module_strings['LBL_PERFORM_MERGE_BUTTON_TITLE'];
$button_key = $current_module_strings['LBL_PERFORM_MERGE_BUTTON_KEY'];
$button_label = $current_module_strings['LBL_PERFORM_MERGE_BUTTON_LABEL'];
$cancel_title=$app_strings['LBL_CANCEL_BUTTON_TITLE'];
$cancel_key=$app_strings['LBL_CANCEL_BUTTON_KEY'];
$cancel_label=$app_strings['LBL_CANCEL_BUTTON_LABEL'];
echo ($ListView->display());
$error_select=$current_module_strings['LBL_SELECT_ERROR'];
$form_top = <<<EOQ
<input type="hidden" id="selectCount" name="selectCount[]" value=0>
<input type="hidden" name="merge_module" value="$merge_module">
<input type="hidden" name="record" value="$return_id">
<input type="hidden" name="return_module" value="$focus->merge_module">
<input type="hidden" name="return_id" value="$return_id">
<input type="hidden" name="return_action" value="DetailView">
<input title="$button_title" accessKey="$button_key" class="button" onclick="return verify_selection(this);" type="submit" name="button" value=" $button_label " >
<input title="$cancel_title" accessKey="$cancel_key" class="button" onclick="this.form.action.value='DetailView';this.form.module.value='$focus->merge_module';this.form.module.record='$return_id'" type="submit" name="button" value=" $cancel_label " >
</form>
<script>
function verify_selection(theElement) {
theElement.form.action.value='Step3';
var selcount=document.getElementById('selectCount');
if (parseInt(selcount.value) >0 ) {
return true;
} else {
alert("$error_select");
return false;
}
}
sugarListView.prototype.order_checks = function(order,orderBy,moduleString){
checks = sugarListView.get_checks();
eval('document.MassUpdate.' + moduleString + '.value = orderBy');
document.MassUpdate.lvso.value = order;
if(typeof document.MassUpdate.massupdate != 'undefined') {
document.MassUpdate.massupdate.value = 'false';
}
document.MassUpdate.return_module.value='';
document.MassUpdate.return_action.value='';
document.MassUpdate.submit();
return !checks;
}
sugarListView.prototype.save_checks = function(offset, moduleString) {
checks = sugarListView.get_checks();
eval('document.MassUpdate.' + moduleString + '.value = offset');
if(typeof document.MassUpdate.massupdate != 'undefined') {
document.MassUpdate.massupdate.value = 'false';
}
document.MassUpdate.return_module.value='';
document.MassUpdate.return_action.value='';
document.MassUpdate.submit();
return !checks;
}
</script>
EOQ;
echo $form_top;
?>

544
modules/MergeRecords/Step3.php Executable file
View File

@@ -0,0 +1,544 @@
<?php
if (!defined('sugarEntry') || !sugarEntry)
die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* 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): ______________________________________..
********************************************************************************/
require_once ('include/JSON.php');
$timedate = new TimeDate();
global $app_strings;
global $mod_strings;
global $app_list_strings;
global $current_language;
global $urlPrefix;
global $currentModule;
global $theme;
global $filter_for_valid_editable_attributes;
//filter condition for fields in vardefs that can participate in merge.
$filter_for_valid_editable_attributes =
array(
array('type'=>'datetimecombo','source'=>'db'),
array('type'=>'datetime','source'=>'db'),
array('type'=>'varchar','source'=>'db'),
array('type'=>'enum','source'=>'db'),
array('type'=>'multienum','source'=>'db'),
array('type'=>'text','source'=>'db'),
array('type'=>'date','source'=>'db'),
array('type'=>'time','source'=>'db'),
array('type'=>'int','source'=>'db'),
array('type'=>'long','source'=>'db'),
array('type'=>'double','source'=>'db'),
array('type'=>'float','source'=>'db'),
array('type'=>'short','source'=>'db'),
array('dbType'=>'varchar','source'=>'db'),
array('dbType'=>'double','source'=>'db'),
array('type'=>'relate'),
);
$filter_for_valid_related_attributes = array( array('type'=>'link'),);
$filter_for_invalid_related_attributes = array(array('type'=>'link','link_type'=>'one'));
//following attributes will be ignored from the merge process.
$invalid_attribute_by_name= array('date_entered'=>'date_entered','date_modified'=>'date_modified','modified_user_id'=>'modified_user_id', 'created_by'=>'created_by','deleted'=>'deleted');
$merge_ids_array = array ();
if (isset($_REQUEST['change_parent']) && $_REQUEST['change_parent']=='1') {
$base_id=$_REQUEST['change_parent_id'];
foreach ($_REQUEST['merged_ids'] as $id) {
if ($id != $base_id) {
$merge_ids_array[] = $id;
}
}
//add the existing parent to merged_id array.
$merge_ids_array[] = $_REQUEST['record'];
} 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();
$records++;
$merged_ids.="<input type='hidden' name='merged_ids[]' value='$id'>";
}
$col_width=floor(80/$records).'%';
global $max_data_length;
$max_data_length=floor(65/$records);
global $xtpl;
$xtpl = new XTemplate("modules/MergeRecords/Step3.html");
$xtpl->assign("MOD", $mod_strings);
$xtpl->assign("APP", $app_strings);
$xtpl->assign("ID", $focus->merge_bean->id);
$xtpl->assign("MERGE_MODULE", $focus->merge_module);
$xtpl->assign("MERGED_IDS", $merged_ids);
//set return parameters.
if (!empty ($_REQUEST['return_module'])) {
$xtpl->assign("RETURN_MODULE", $_REQUEST['return_module']);
}
if (!empty ($_REQUEST['return_action'])) {
$xtpl->assign("RETURN_ACTION", $_REQUEST['return_action']);
}
if (!empty ($_REQUEST['return_id'])) {
$xtpl->assign("RETURN_ID", $_REQUEST['return_id']);
}
$temp_field_array = $focus->merge_bean->field_defs;
$field_count = 1;
$json = new JSON(JSON_LOOSE_TYPE);
$diff_field_count=0;
foreach ($temp_field_array as $field_array) {
if (show_field($field_array)
) {
$select_row_curr_field_value = null;
$b_values_different = false;
$section_name='merge_row_similar';
//Prcoess locaton of the field. if values are different show field in first section. else 2nd.
$select_row_curr_field_value = $focus->merge_bean->$field_array['name'];
foreach ($merge_ids_array as $id) {
if (($mergeBeanArray[$id]-> $field_array['name']=='' and $select_row_curr_field_value =='') or $mergeBeanArray[$id]-> $field_array['name'] == $select_row_curr_field_value ) {
$section_name='merge_row_similar';
} else {
$section_name='merge_row_diff';
$diff_field_count++;
break; //foreach
}
}
//check for vname in mod strings first, then app, else just display name
$col_name = $field_array['name'];
if (isset ($focus->merge_bean_strings[$field_array['vname']]) && $focus->merge_bean_strings[$field_array['vname']] != '')
$xtpl->assign("FIELD_LABEL", $focus->merge_bean_strings[$field_array['vname']]);
elseif (isset ($app_strings[$field_array['vname']]) && $app_strings[$field_array['vname']] != '') $xtpl->assign("FIELD_LABEL", $app_strings[$field_array['vname']]);
else
$xtpl->assign("FIELD_LABEL", $field_array['name']);
//if required add signage.
if (!empty($focus->merge_bean->required_fields[$col_name]) or $col_name=='team_name') {
$xtpl->assign("REQUIRED_SYMBOL","<span class='required'>".$app_strings['LBL_REQUIRED_SYMBOL']."</span>");
} else {
$xtpl->assign("REQUIRED_SYMBOL","");
}
$xtpl->assign("CELL_WIDTH", "20%");
$xtpl->parse("main.".$section_name.".merge_cell_label");
if (isset ($field_array['custom_type']) && $field_array['custom_type'] != '')
$field_check = $field_array['custom_type'];
else
$field_check = $field_array['type'];
if(preg_match('/.*?_address_street$/', $field_array['name'])) {
$field_check = 'text';
}
$xtpl->assign("EDIT_FIELD_NAME", $field_array['name']);
$xtpl->assign("TAB_INDEX", $field_count);
switch ($field_check) {
case ('name') :
case ('varchar') :
case ('phone') :
case ('num') :
case ('email') :
case ('custom_fields') :
case ('url') :
case ('int') :
case ('float') :
case ('double') :
case ('currency') :
$xtpl->assign("EDIT_FIELD_VALUE", $select_row_curr_field_value);
$xtpl->assign("CELL_WIDTH", $col_width);
$xtpl->parse("main.".$section_name.".merge_cell_edit_text");
break;
case ('text') :
$xtpl->assign("EDIT_FIELD_VALUE", $select_row_curr_field_value);
$xtpl->assign("CELL_WIDTH", $col_width);
$xtpl->parse("main.".$section_name.".merge_cell_edit_textarea");
break;
case ('enum') :
$xtpl->assign("SELECT_OPTIONS", get_select_options_with_id($app_list_strings[$field_array['options']], $select_row_curr_field_value));
$xtpl->assign("CELL_WIDTH",$col_width);
$xtpl->parse("main.".$section_name.".merge_cell_edit_dropdown");
break;
case ('multienum') :
$select_row_curr_field_value = unencodeMultienum($select_row_curr_field_value);
$xtpl->assign("SELECT_OPTIONS", get_select_options_with_id($app_list_strings[$field_array['options']], $select_row_curr_field_value));
$xtpl->assign("CELL_WIDTH",$col_width);
$xtpl->parse("main.".$section_name.".merge_cell_edit_multidropdown");
break;
//popup fields need to be fixed.., cant automate with vardefs
case ('relate') :
if(!empty($field_array['link'])) {
$exclude[$field_array['link']] = $field_array['link'];
}
case ('link') :
//get_related_name
if (empty($select_row_curr_field_value)) {
$related_name=get_related_name($field_array,$focus->merge_bean->$field_array['id_name']);
if ($related_name !== false ) {
$select_row_curr_field_value=$related_name;
}
}
if($field_check == 'link') {//relate type should not enter this.
$exclude[$field_array['name']] = $field_array['name'];
}
$xtpl->assign("POPUP_ID_FIELD", $field_array['id_name']);
$xtpl->assign("POPUP_NAME_FIELD", $field_array['name']);
$xtpl->assign("POPUP_NAME_VALUE", $select_row_curr_field_value);
$xtpl->assign("POPUP_ID_VALUE", $focus->merge_bean-> $field_array['id_name']);
$xtpl->assign("POPUP_MODULE", $field_array['module']);
$xtpl->assign("CELL_WIDTH", $col_width);
$xtpl->assign("MERGED_LINKS", implode(',', $exclude));
$popup_data = array ('call_back_function' => 'set_return', 'form_name' => 'EditView', 'field_to_name_array' => array ('id' => $field_array['id_name'], 'name' => $field_array['name'],),);
$xtpl->assign('ENCODED_POPUP_DATA', $json->encode($popup_data));
$xtpl->parse("main.".$section_name.".merge_cell_edit_popup");
break;
case ('bool') :
if (($select_row_curr_field_value == '1' || $select_row_curr_field_value == 'yes' || $select_row_curr_field_value == 'on') && !empty($select_row_curr_field_value))
$xtpl->assign("EDIT_FIELD_VALUE", " checked");
else
$xtpl->assign("EDIT_FIELD_VALUE", "");
$xtpl->assign("CELL_WIDTH", $col_width);
$xtpl->parse("main.".$section_name.".merge_cell_edit_checkbox");
break;
case ('date') :
case ('datetime') :
$xtpl->assign("CALENDAR_LANG", "en");
$xtpl->assign("USER_DATEFORMAT", '('.$timedate->get_user_date_format().')');
$xtpl->assign("CALENDAR_DATEFORMAT", $timedate->get_cal_date_format());
$xtpl->assign("EDIT_FIELD_VALUE", $select_row_curr_field_value);
$xtpl->assign("CELL_WIDTH", $col_width);
$xtpl->assign("THEME", $theme);
$xtpl->parse("main.".$section_name.".merge_cell_edit_date");
break;
case ('datetimecombo') :
$xtpl->assign("CALENDAR_LANG", "en");
$xtpl->assign("USER_DATEFORMAT", $timedate->get_user_time_format());
$xtpl->assign("CALENDAR_DATEFORMAT", $timedate->get_cal_date_format());
$xtpl->assign("EDIT_FIELD_VALUE", $select_row_curr_field_value);
$xtpl->assign("CELL_WIDTH", $col_width);
$xtpl->assign("THEME", $theme);
$xtpl->parse("main.".$section_name.".merge_cell_edit_datetime");
break;
default :
break;
}
//render a column for each selected record to merge
foreach ($merge_ids_array as $id) {
$xtpl->assign("CELL_WIDTH", $col_width);
$field_name=null;
switch ($field_check) {
case ('bool') :
if (($mergeBeanArray[$id]->$field_array['name'] == '1' || $mergeBeanArray[$id]->$field_array['name'] == 'yes' || $mergeBeanArray[$id]->$field_array['name'] == 'on') && !empty($mergeBeanArray[$id]->$field_array['name'])) {
$xtpl->assign("FIELD_VALUE", " checked");
} else {
$xtpl->assign("FIELD_VALUE", "");
}
$field_name="main.".$section_name.".merge_cell_field_value_checkbox";
break;
case ('enum') :
if ($mergeBeanArray[$id]-> $field_array['name'] != '' and isset($field_array['options']) and isset($app_list_strings[$field_array['options']][$mergeBeanArray[$id]-> $field_array['name']])) {
display_field_value( $app_list_strings[$field_array['options']][$mergeBeanArray[$id]-> $field_array['name']]);
} else {
display_field_value($mergeBeanArray[$id]-> $field_array['name']);
}
$field_name="main.".$section_name.".merge_cell_field_value";
break;
case ('multienum') :
if ($mergeBeanArray[$id]-> $field_array['name'] != '' and isset($field_array['options']) and isset($app_list_strings[$field_array['options']][$mergeBeanArray[$id]-> $field_array['name']])) {
display_field_value(str_replace("^","",$app_list_strings[$field_array['options']][$mergeBeanArray[$id]-> $field_array['name']]));
} else {
display_field_value(str_replace("^","",$mergeBeanArray[$id]-> $field_array['name']));
}
$field_name="main.".$section_name.".merge_cell_field_value";
break;
case ('relate') :
case ('link') :
$related_name=false;
if (empty($mergeBeanArray[$id]-> $field_array['name']) && !empty($mergeBeanArray[$id]-> $field_array['id_name'])) {
$related_name=get_related_name($field_array,$mergeBeanArray[$id]-> $field_array['id_name']);
if ($related_name !== false) {
$mergeBeanArray[$id]-> $field_array['name']=$related_name;
}
}
display_field_value($mergeBeanArray[$id]-> $field_array['name']);
$field_name="main.".$section_name.".merge_cell_field_value";
break;
default :
display_field_value($mergeBeanArray[$id]-> $field_array['name']);
$field_name="main.".$section_name.".merge_cell_field_value";
break;
}
$json_data = array ('field_name' => $field_array['name'], 'field_type' => $field_check,);
//add an array of fields/values to the json array
//for setting all the values for merge
if ($field_check == 'relate' or $field_check == 'link') {
$temp_array = Array ();
$json_data['popup_fields'] = Array ($field_array['name'] => $mergeBeanArray[$id]-> $field_array['name'], $field_array['id_name'] => $mergeBeanArray[$id]-> $field_array['id_name'],);
} else if($field_check == 'teamset') {
$json_data['field_value'] = TeamSetManager::getCommaDelimitedTeams($mergeBeanArray[$id]->team_set_id, $mergeBeanArray[$id]->team_id, true);
$json_data['field_value2'] = TeamSetManager::getTeamsFromSet($mergeBeanArray[$id]->team_set_id);
$json_data['field_value3'] = $mergeBeanArray[$id]->team_set_id;
} else if($field_check == 'multienum') {
$json_data['field_value'] = unencodeMultienum($mergeBeanArray[$id]-> $field_array['name']);
} else {
$json_data['field_value'] = $mergeBeanArray[$id]-> $field_array['name'];
}
$encoded_json_data = $json->encode($json_data);
$xtpl->assign('ENCODED_JSON_DATA', $encoded_json_data);
$xtpl->parse($field_name);
}
$xtpl->parse("main.".$section_name);
$field_count ++;
}
}
$header_cols= array();
foreach ($merge_ids_array as $id) {
$td="<td width='$col_width' valign='top' class='dataLabel' align='left'><input type='button' class='button' id='$id' onclick=\"change_primary(this,'{$id}');\" value='<<'>&nbsp;{$mod_strings['LBL_CHANGE_PARENT']}";
if (count($merge_ids_array) > 1) {
$td.="&nbsp;|<a id='remove_$id' onclick=\"remove_me(this,'{$id}');\" href='#' >{$mod_strings['LBL_REMOVE_FROM_MERGE']}</a>";
}
$td.="</td>";
$header_cols[]=$td;
}
if ($diff_field_count>0) {
$xtpl->assign("DIFF_HEADER","<tr height='20'><td colspan=2><strong>{$mod_strings['LBL_DIFF_COL_VALUES']}</strong></td>".implode(' ',$header_cols)."</tr>");
$xtpl->assign("SIMILAR_HEADER","<tr height='20'><td colspan=20><strong>{$mod_strings['LBL_SAME_COL_VALUES']}</strong></td></tr>");
$xtpl->assign("GROUP_PARTITION","<tr height=3><td colspan=20' class='listViewHRS1'></td></tr>");
} else {
$xtpl->assign("SIMILAR_HEADER","<tr height='20'><td colspan=2><strong>{$mod_strings['LBL_SAME_COL_VALUES']}</strong></td>".implode(' ',$header_cols)."</tr>");
}
$merge_verify=$mod_strings['LBL_DELETE_MESSAGE'].'\\n';
foreach ($merge_records_names as $name) {
$merge_verify.= $name."\\n";
}
$merge_verify.='\\n'.$mod_strings['LBL_PROCEED'];
$xtpl->assign("MERGE_VERIFY",$merge_verify);
global $beanList;
//Jenny - Bug 8386 - The object_name couldn't be found because it was searching for
// 'Case' instead of 'aCase'.
if ($focus->merge_bean->object_name == 'Case') {
$focus->merge_bean->object_name = 'aCase';
}
$mod=array_search($focus->merge_bean->object_name,$beanList);
$mod_strings = return_module_language($current_language, $mod);
//add javascript for required fields enforcement.
$javascript = new javascript();
$javascript->setFormName('EditView');
$javascript->setSugarBean($focus->merge_bean);
$javascript->addAllFields('');
if (isset($focus->merge_bean->field_defs['team_name'])) {
$javascript->addFieldGeneric('team_name', 'varchar', $app_strings['LBL_TEAM'] ,'true');
}
$xtpl->assign("VALIDATION_JS", $javascript->getScript());
$xtpl->parse("main");
$xtpl->out("main");
/*
* function truncates values to max_data_legth and adds the complete value as hover text.
*/
function display_field_value($value) {
global $xtpl, $max_data_length, $mod_strings;
if (strlen($value)-$max_data_length > 3) {
$xtpl->assign("FIELD_VALUE", substr($value,0,$max_data_length).'...');
} else {
$xtpl->assign("FIELD_VALUE", $value);
}
$xtpl->assign("HOVER_TEXT", $mod_strings['LBL_MERGE_VALUE_OVER'] .': ' . $value);
}
/*
* implements the rules that decide which fields will participate in a merge.
*/
function show_field($field_def) {
global $filter_for_valid_editable_attributes,$invalid_attribute_by_name;
//field in invalid attributes list?
if (isset($invalid_attribute_by_name[$field_def['name']])) {
return false;
}
//field has 'duplicate_merge property set to disabled?'
if (isset($field_def['duplicate_merge']) ) {
if ($field_def['duplicate_merge']=='disabled' or $field_def['duplicate_merge']==false) {
return false;
}
if ($field_def['duplicate_merge']=='enabled' or $field_def['duplicate_merge']==true) {
return true;
}
}
//field has auto_increment set to true do not participate in merge.
//we have a unique index on that field.
if (isset($field_def['auto_increment']) and $field_def['auto_increment']==true) {
return false;
}
//set required attribute values in $field_def
if (!isset($field_def['source']) or empty($field_def['source'])) {
$field_def['source']='db';
}
if (!isset($field_def['dbType']) or empty($field_def['dbType']) and isset($field_def['type'])) {
$field_def['dbType']=$field_def['type'];
}
foreach ($filter_for_valid_editable_attributes as $attribute_set) {
$b_all=false;
foreach ($attribute_set as $attr=>$value) {
if (isset($field_def[$attr]) and $field_def[$attr]==$value) {
$b_all=true;
} else {
$b_all=false;
break;
}
}
if ($b_all) {
return true;
}
}
return false;
}
/* if the attribute of type relate and name is empty fetch using the vardef entries.
*
*/
function get_related_name($field_def,$id_value) {
if (!empty($field_def['rname']) && !empty($field_def['id_name']) && !empty($field_def['table'])) {
if (!empty($id_value)) {
//default the column name to rname in vardefs
$col_name = $field_def['rname'];
//if this module is non db and has a module set, then check to see if this field should be concatenated
if (!empty($field_def['module']) && $field_def['source'] == 'non-db'){
global $beanList, $beanFiles;
//get the bean field defs based on the module param
$bean = $beanList[$field_def['module']];
require_once ($beanFiles[$bean]);
$focus = new $bean();
if(!empty( $focus->field_defs[$field_def['rname']])){
$related_def = $focus->field_defs[$field_def['rname']];
//if field defs has concat field array set, then concatenate values
if(isset($related_def['db_concat_fields']) && !empty($related_def['db_concat_fields'])){
$temp_str = '';
if ( ( $focus->db->dbType == 'mysql' ) || ( $focus->db->dbType == 'oci8' ) ){
foreach($related_def['db_concat_fields'] as $vals){
if(empty($temp_str)){
$temp_str .= ' concat('. $vals;
}else{
$temp_str .= ", ' ', " .$vals;
}
}
$temp_str .= ')';
}else{
foreach($related_def['db_concat_fields'] as $vals){
if(empty($temp_str)){
$temp_str .= $vals;
}else{
$temp_str .= " + ' ' + " .$vals;
}
}
}
$col_name = $temp_str;
}
}
}
$query = "select ".$col_name." from " .$field_def['table'] ." where id='$id_value'";
$result=$GLOBALS['db']->query($query);
$row=$GLOBALS['db']->fetchByAssoc($result);
if (!empty($row[$field_def['rname']])) {
return $row[$field_def['rname']];
}
}
}
return false;
}
?>

View File

@@ -0,0 +1,49 @@
<?php
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* 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".
********************************************************************************/
require_once('include/MVC/Controller/SugarController.php');
class MergeRecordsController extends SugarController
{
/**
* Override default method so we don't load a bean class automatically
*
* @see SugarController::loadBean()
*/
public function loadBean()
{
}
}

96
modules/MergeRecords/index.php Executable file
View File

@@ -0,0 +1,96 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* 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): ______________________________________..
********************************************************************************/
if (isset($_REQUEST['uid'])) {
$merge_ids = explode(',',$_REQUEST['uid']);
//redirect to step3.
$_REQUEST['record']=$merge_ids[0];
$_REQUEST['merge_module']=$_REQUEST['action_module'];
unset($merge_ids[0]);
$_REQUEST['mass']=$merge_ids;
}
else {
global $beanList;
global $beanFiles;
$merge_ids = array();
$bean = $beanList[$_REQUEST['return_module']];
require_once($beanFiles[$bean]);
$focus = new $bean();
if(isset($_SESSION['export_where']) && !empty($_SESSION['export_where'])) { // bug 4679
$where = $_SESSION['export_where'];
$whereArr = explode (" ", trim($where));
if ($whereArr[0] == trim('where')) {
$whereClean = array_shift($whereArr);
}
$where = implode(" ", $whereArr);
}
else {
$where = '';
}
if(empty($order_by))$order_by = '';
$query = $focus->create_export_query($order_by,$where);
$result = $focus->db->query($query,true);
/*
$query = 'select * from '.$focus->table_name.' where deleted=0';
$result = $focus->db->query($query, true, "");
*/
$row = $focus->db->fetchByAssoc($result);
while ($row != null) {
//$beanObj = new $bean;
array_push($merge_ids, $row['id']);
$row = $focus->db->fetchByAssoc($result);
}
$_REQUEST['record']=$merge_ids[0];
$_REQUEST['action']='index.php';
$_REQUEST['merge_module']=$_REQUEST['return_module'];
unset($merge_ids[0]);
$_REQUEST['mass']=$merge_ids;
}
require('modules/MergeRecords/Step3.php');
?>

View File

@@ -0,0 +1,83 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* 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: Defines the English language pack for the base application.
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
********************************************************************************/
$mod_strings = array (
'LBL_MODULE_NAME' => 'Merge Records',
'LBL_MODULE_TITLE' => 'Merge Records: Home',
'LBL_SEARCH_FORM_TITLE' => 'Merge Search',
'LBL_LIST_FORM_TITLE' => 'Merge List',
'LBL_LBL_MERGE_RECORDS_STEP_1' => 'Find Search Records to Merge With',
'LBL_AVAIL_FIELDS' => 'Available Fields',
'LBL_FILTER_COND' => 'Filter Condition',
'LBL_SELECTED_FIELDS' => 'Selected Fields',
'LBL_MERGE_RECORDS_WITH' => 'Merge Records With',
'LBL_MERGE_VALUE_OVER' => 'Merge value over',
'LBL_NEXT_STEP_TITLE' => 'Move to Next Step[Ctrl+N]',
'LBL_NEXT_STEP_BUTTON_KEY' => 'N',
'LBL_NEXT_STEP_BUTTON_LABEL' => 'Next Step >',
'LBL_PERFORM_MERGE_BUTTON_TITLE' => 'Perform Merge[Ctrl+P]',
'LBL_PERFORM_MERGE_BUTTON_KEY' => 'P',
'LBL_PERFORM_MERGE_BUTTON_LABEL' => 'Perform Merge',
'LBL_SAVE_MERGED_RECORD_BUTTON_TITLE' => 'Save Merge[Ctrl+S]',
'LBL_SAVE_MERGED_RECORD_BUTTON_KEY' => 'S',
'LBL_SAVE_MERGED_RECORD_BUTTON_LABEL' => 'Save Merge',
'LBL_STEP2_FORM_TITLE' => 'Records Found To Merge With',
'LBL_SELECT_ERROR'=>'You must make a selection before you can proceed.',
'LBL_SELECT_PRIMARY'=>'Select primary record for the merge.',
'LBL_CHANGE_PARENT'=>'Set as primary',
'LBL_REMOVE_FROM_MERGE'=>'Remove',
'LBL_DIFF_COL_VALUES'=>'Columns whose value in primary row differs from value in merging rows:',
'LBL_SAME_COL_VALUES'=>'Columns whose value is similar across all rows:',
'ERR_EXCEEDS_MAX'=>'You are only allowed to merge a maximum of 5 records. Records exceeding the limit were ignored.',
'LBL_DELETE_MESSAGE'=>'This action will delete following record(s):',
'LBL_PROCEED'=>'Proceed ?',
'LBL_STEP1_DIRECTIONS' => 'Find possible duplicate records. If possible duplicates are found, you can select which records to merge with the current record.',
);
?>

View File

@@ -0,0 +1,74 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* The contents of this file are subject to the SugarCRM Professional End User
* License Agreement ("License") which can be viewed at
* http://www.sugarcrm.com/crm/products/sugar-professional-eula.html
* By installing or using this file, You have unconditionally agreed to the
* terms and conditions of the License, and You may not use this file except in
* compliance with the License. Under the terms of the license, You shall not,
* among other things: 1) sublicense, resell, rent, lease, redistribute, assign
* or otherwise transfer Your rights to the Software, and 2) use the Software
* for timesharing or service bureau purposes such as hosting the Software for
* commercial gain and/or for the benefit of a third party. Use of the Software
* may be subject to applicable fees and any use of the Software without first
* paying applicable fees is strictly prohibited. You do not have the right to
* remove SugarCRM copyrights from the source code or user interface.
*
* All copies of the Covered Code must include on each user interface screen:
* (i) the "Powered by SugarCRM" logo and
* (ii) the SugarCRM copyright notice
* in the same form as they appear in the distribution. See full license for
* requirements.
*
* Your Warranty, Limitations of liability and Indemnity are expressly stated
* in the License. Please refer to the License for the specific language
* governing these rights and limitations under the License. Portions created
* by SugarCRM are Copyright (C) 2004-2006 SugarCRM, Inc.; All Rights Reserved.
********************************************************************************/
/*********************************************************************************
* Description: Defines the English language pack for the base application.
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
********************************************************************************/
$mod_strings = array (
'LBL_MODULE_NAME' => 'Scalaj rekordy',
'LBL_MODULE_TITLE' => 'Scalanie Rekordów: Strona główna',
'LBL_SEARCH_FORM_TITLE' => 'Szukaj scalonych',
'LBL_LIST_FORM_TITLE' => 'Lista scalonych',
'LBL_LBL_MERGE_RECORDS_STEP_1' => 'Krok 1: Znajdź rekordy przeznaczone do scalenia ze sobą',
'LBL_AVAIL_FIELDS' => 'Dostępne pola',
'LBL_FILTER_COND' => 'Warunki filtrowania',
'LBL_SELECTED_FIELDS' => 'Wybrane pola',
'LBL_MERGE_RECORDS_WITH' => 'Scal rekordy',
'LBL_MERGE_VALUE_OVER' => 'Scal wartości',
'LBL_NEXT_STEP_TITLE' => 'Przejdź do nastepnego kroku[Ctrl+N]',
'LBL_NEXT_STEP_BUTTON_KEY' => 'N',
'LBL_NEXT_STEP_BUTTON_LABEL' => 'Nastepny krok >',
'LBL_PERFORM_MERGE_BUTTON_TITLE' => 'Przeprowadź scalanie[Ctrl+P]',
'LBL_PERFORM_MERGE_BUTTON_KEY' => 'P',
'LBL_PERFORM_MERGE_BUTTON_LABEL' => 'Przeprowadź scalanie',
'LBL_SAVE_MERGED_RECORD_BUTTON_TITLE' => 'Zapisz scalone rekordy[Ctrl+S]',
'LBL_SAVE_MERGED_RECORD_BUTTON_KEY' => 'S',
'LBL_SAVE_MERGED_RECORD_BUTTON_LABEL' => 'Zapisz scalone',
'LBL_STEP2_FORM_TITLE' => 'Rekordy przeznaczone do scalenia ze sobą:',
'LBL_SELECT_ERROR'=>'Musisz dokonać wyboru przed kontynuacją.',
'LBL_SELECT_PRIMARY'=>'Wybierz główny rekord do połączenia',
'LBL_CHANGE_PARENT'=>'Ustaw jako główny',
'LBL_REMOVE_FROM_MERGE'=>'Usuń',
'LBL_DIFF_COL_VALUES'=>'Kolumny, które są porównywane w głównym wierszu różnią sie od przyłączanych wierszy:',
'LBL_SAME_COL_VALUES'=>'Kolumny, które mają tę samą zawartość we wszystkich wierszach:',
'ERR_EXCEEDS_MAX'=>'Możesz połączyć maksymalnie 5 rekordów. Wiersze powyżej tego limitu nie zostaną połączone.',
'LBL_DELETE_MESSAGE'=>'To działanie spowoduje usunięcie następujących rekordów:',
'LBL_PROCEED'=>'Kontynuować?',
);
?>

View File

@@ -0,0 +1,49 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* 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:
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc. All Rights
* Reserved. Contributor(s): ______________________________________..
* *******************************************************************************/
$dictionary['MergeRecord'] = array(
'table'=>'does_not_exist',
'fields' => array (),
);
?>