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

View File

@@ -0,0 +1,50 @@
<?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".
********************************************************************************/
class ConnectorRecord extends MergeRecord{
var $object_name = 'ConnectorRecord';
var $module_dir = 'Connector';
function ConnectorRecord($merge_module = '', $merge_id = '') {
parent::MergeRecord($merge_module, $merge_id);
}
}
?>

37
modules/Connectors/Forms.php Executable file
View File

@@ -0,0 +1,37 @@
<?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".
********************************************************************************/
?>

View File

@@ -0,0 +1,88 @@
<?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".
********************************************************************************/
$default_connectors = array (
'ext_rest_linkedin' =>
array (
'id' => 'ext_rest_linkedin',
'name' => 'LinkedIn&#169;',
'enabled' => true,
'directory' => 'modules/Connectors/connectors/sources/ext/rest/linkedin',
'modules' =>
array (
),
),
);
$default_modules_sources = array (
'Accounts' =>
array (
'ext_rest_linkedin' => 'ext_rest_linkedin',
),
'Contacts' =>
array (
'ext_rest_linkedin' => 'ext_rest_linkedin',
),
'Leads' =>
array (
'ext_rest_linkedin' => 'ext_rest_linkedin',
),
'Prospects' =>
array (
'ext_rest_linkedin' => 'ext_rest_linkedin',
),
);
if(!file_exists('custom/modules/Connectors/metadata')) {
mkdir_recursive('custom/modules/Connectors/metadata');
}
if(!write_array_to_file('connectors', $default_connectors, 'custom/modules/Connectors/metadata/connectors.php')) {
$GLOBALS['log']->fatal('Cannot write file custom/modules/Connectors/metadata/connectors.php');
}
if(!write_array_to_file('modules_sources', $default_modules_sources, 'custom/modules/Connectors/metadata/display_config.php')) {
$GLOBALS['log']->fatal('Cannot write file custom/modules/Connectors/metadata/display_config.php');
}
require_once('include/connectors/utils/ConnectorUtils.php');
if(!ConnectorUtils::updateMetaDataFiles()) {
$GLOBALS['log']->fatal('Cannot update metadata files for connectors');
}
?>

62
modules/Connectors/Menu.php Executable file
View File

@@ -0,0 +1,62 @@
<?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".
********************************************************************************/
global $mod_strings;
global $current_user;
$actions = array('ModifyProperties', 'ModifyDisplay',
'ModifyMapping', 'ConnectorSettings');
if(in_array($GLOBALS['action'], $actions)){
$module_menu[]=Array("index.php?module=Connectors&action=ConnectorSettings", $mod_strings['LBL_ADMINISTRATION_MAIN'],"icon_Connectors");
$module_menu[]=Array("index.php?module=Connectors&action=ModifyProperties", $mod_strings['LBL_MODIFY_PROPERTIES_TITLE'],"icon_ConnectorConfig_16");
$module_menu[]=Array("index.php?module=Connectors&action=ModifyDisplay", $mod_strings['LBL_MODIFY_DISPLAY_TITLE'],"icon_ConnectorEnable_16");
$module_menu[]=Array("index.php?module=Connectors&action=ModifyMapping", $mod_strings['LBL_MODIFY_MAPPING_TITLE'],"icon_ConnectorMap_16");
}
if(!empty($_REQUEST['merge_module']) && ($GLOBALS['action'] == 'Step1' || $GLOBALS['action'] == 'Step2')) {
$merge_module = $_REQUEST['merge_module'];
$GLOBALS['mod_strings'] = return_module_language($GLOBALS['current_language'], $merge_module);
if(file_exists("custom/modules/{$merge_module}/Menu.php")) {
require("custom/modules/{$merge_module}/Menu.php");
} else if(file_exists("modules/{$merge_module}/Menu.php")) {
require("modules/{$merge_module}/Menu.php");
}
$GLOBALS['mod_strings'] = return_module_language($GLOBALS['current_language'], $GLOBALS['module']);
}
?>

View File

@@ -0,0 +1,59 @@
<?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".
********************************************************************************/
$action_view_map['retrievesource']= 'retrievesource';
$action_view_map['step1']= 'step1';
$action_view_map['step2']= 'step2';
//Admin main page
$action_view_map['connectorsettings'] = 'connectorsettings';
//Admin pages for the connector properties
$action_view_map['modifyproperties'] = 'modifyproperties';
$action_view_map['sourceproperties']= 'sourceproperties';
//Admin pages to enable/disable connector for modules
$action_view_map['modifydisplay'] = 'modifydisplay';
$action_view_map['displayproperties'] = 'displayproperties';
//Admin pages to modify search field mapping for connectors
$action_view_map['modifysearch'] = 'modifysearch';
$action_view_map['searchproperties'] = 'searchproperties';
//Admin pages to modify field mapping for the connectors
$action_view_map['modifymapping'] = 'modifymapping';
$action_view_map['mappingproperties'] = 'mappingproperties';
?>

View File

@@ -0,0 +1,59 @@
<?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".
********************************************************************************/
require_once('include/connectors/formatters/default/formatter.php');
class ext_rest_linkedin_formatter extends default_formatter {
public function getDetailViewFormat() {
$mapping = $this->getSourceMapping();
$mapping_name = !empty($mapping['beans'][$this->_module]['name']) ? $mapping['beans'][$this->_module]['name'] : '';
if(!empty($mapping_name)) {
$this->_ss->assign('mapping_name', $mapping_name);
return $this->fetchSmarty();
}
$GLOBALS['log']->error($GLOBALS['app_strings']['ERR_MISSING_MAPPING_ENTRY_FORM_MODULE']);
return '';
}
public function getIconFilePath() {
return 'modules/Connectors/connectors/formatters/ext/rest/linkedin/tpls/linkedin.gif';
}
}
?>

View File

@@ -0,0 +1,46 @@
<?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".
********************************************************************************/
// created: 2008-10-03 14:31:59
$config = array (
'name' => 'LinkedIn&#169;',
'order' => 1,
'properties' =>
array (
'company_url'=>'http://www.linkedin.com/companyInsider?script&useBorder=no',
),
);
?>

View File

@@ -0,0 +1,55 @@
<?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): ______________________________________..
********************************************************************************/
$connector_strings = array (
//licensing information shown in config screen
'LBL_LICENSING_INFO' => '', //'LinkedIn&#169; licensing info...',
'LBL_NAME' => 'Company Name',
//Configuration labels
'company_url' => 'URL',
);
?>

View File

@@ -0,0 +1,48 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* The contents of this file are subject to the SugarCRM Enterprise Subscription
* Agreement ("License") which can be viewed at
* http://www.sugarcrm.com/crm/products/sugar-enterprise-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-2008 SugarCRM, Inc.; All Rights Reserved.
********************************************************************************/
/*********************************************************************************
* pl_pl.lang.ext.php,v for SugarCRM 4.5.1
* Translator: Krzysztof Morawski
* All Rights Reserved.
* Any bugs report welcome: krzysiek<at>kmmgroup<dot>pl
* Contributor(s): ______________________________________..
********************************************************************************/
$connector_strings = array (
//licensing information shown in config screen
'LBL_LICENSING_INFO' => '', //'LinkedIn&#169; licensing info...',
'LBL_NAME' => 'Nazwa firmy',
//Configuration labels
'company_url' => 'Adres URL',
);
?>

View File

@@ -0,0 +1,68 @@
<?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".
********************************************************************************/
require_once('include/connectors/sources/ext/rest/rest.php');
class ext_rest_linkedin extends ext_rest {
public function __construct(){
parent::__construct();
$this->_enable_in_wizard = false;
$this->_enable_in_hover = true;
}
/*
* getItem
*
* As the linked in connector does not have a true API call, we simply
* override this abstract method
*/
public function getItem($args=array(), $module=null){}
/*
* getList
*
* As the linked in connector does not have a true API call, we simply
* override this abstract method
*/
public function getList($args=array(), $module=null){}
public function __destruct(){
parent::__destruct();
}
}
?>

View File

@@ -0,0 +1,53 @@
<?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".
********************************************************************************/
$mapping = array(
'beans' => array (
'Accounts' => array (
'name'=>'name',
),
'Contacts' => array (
'name'=>'account_name',
),
'Leads' => array (
'name'=>'account_name',
),
'Prospects' => array(
'name'=>'account_name',
)
),
);
?>

View File

@@ -0,0 +1,58 @@
<?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".
********************************************************************************/
$dictionary['ext_rest_linkedin'] = array(
'comment' => 'vardefs for linkedin connector',
'fields' => array (
'id' =>
array (
'name' => 'id',
'vname' => 'LBL_ID',
'type' => 'id',
'comment' => 'Unique identifier',
'hidden' => true,
),
'name'=> array(
'name' => 'name',
'vname' => 'LBL_NAME',
'type' => 'varchar',
'hover' => true,
'comment' => 'The name of the company',
),
)
);
?>

View File

@@ -0,0 +1,77 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* The contents of this file are subject to the SugarCRM Enterprise Subscription
* Agreement ("License") which can be viewed at
* http://www.sugarcrm.com/crm/products/sugar-enterprise-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-2009 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): ______________________________________..
********************************************************************************/
/*********************************************************************************
* pl_pl.lang.ext.php,v for SugarCRM 4.5.1 -->>
* Translator: Krzysztof Morawski
* All Rights Reserved.
* Any bugs report welcome: krzysiek<at>kmmgroup<dot>pl
* Contributor(s): ______________________________________..
********************************************************************************/
$connector_strings = array (
//licensing information shown in config screen
'LBL_LICENSING_INFO' => '<table border="0" cellspacing="1"><tr><td valign="top" width="35%" class="dataLabel"><image src="' . getWebPath('modules/Connectors/connectors/sources/ext/rest/zoominfocompany/images/zoominfo.gif') . '" border="0"></td><td width="65%" valign="top" class="dataLabel">' .
'ZoomInfo&#169; dostarcza sporo informacji o ponad 45 milionach zatrudnionych w ponad 5 milionach przedsiębiorstw. Zobacz więcej na <a target="_blank" href="http://www.zoominfo.com/about">http://www.zoominfo.com/about</a></td></tr></table>',
'LBL_SEARCH_FIELDS_INFO' => 'Następujące pola są wspierane przez Zoominfo&#169 Firma; API: Nazwa firmy, Miasto, Wokjewództwo (stan) i kraj.',
//vardef labels
'LBL_COMPANY_ID' => 'ID',
'LBL_COMPANY_NAME' => 'Nazwa firmy',
'LBL_STREET' => 'Ulica',
'LBL_CITY' => 'Miasto',
'LBL_ZIP' => 'Kod pocztowy',
'LBL_STATE' => 'Województwo',
'LBL_COUNTRY' => 'Kraj',
'LBL_INDUSTRY' => 'Branża',
'LBL_WEBSITE' => 'Strona www',
'LBL_DESCRIPTION' => 'Opis',
//Configuration labels
'company_search_url' => 'Adres URL firmy',
'company_detail_url' => 'Adres URL szczegółów o firmie',
'api_key' => 'Klucz API',
//Other labels
'ERROR_LBL_CONNECTION_PROBLEM' => 'Błąd: Nie można połączyć się z serwerem Zoominfo - Company connector.',
);
?>

View File

@@ -0,0 +1,71 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* The contents of this file are subject to the SugarCRM Enterprise Subscription
* Agreement ("License") which can be viewed at
* http://www.sugarcrm.com/crm/products/sugar-enterprise-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-2009 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): ______________________________________..
********************************************************************************/
/*********************************************************************************
* pl_pl.lang.ext.php,v for SugarCRM 4.5.1 -->>
* Translator: Krzysztof Morawski
* All Rights Reserved.
* Any bugs report welcome: krzysiek<at>kmmgroup<dot>pl
* Contributor(s): ______________________________________..
********************************************************************************/
$connector_strings = array (
//licensing information shown in config screen
'LBL_LICENSING_INFO' => '<table border="0" cellspacing="1"><tr><td valign="top" width="35%" class="dataLabel"><image src="' . getWebPath('modules/Connectors/connectors/sources/ext/rest/zoominfoperson/images/zoominfo.gif') . '" border="0"></td><td width="65%" valign="top" class="dataLabel">' .
'ZoomInfo&#169; dostarcza sporo informacji o ponad 45 milionach zatrudnionych w ponad 5 milionach przedsiębiorstw. Zobacz więcej na <a target="_blank" href="http://www.zoominfo.com/about">http://www.zoominfo.com/about</a></td></tr></table>',
'LBL_SEARCH_FIELDS_INFO' => 'Następujące pola są wspierane przez Zoominfo&#169 Osoba; API: Imię, Nazwisko i adres email.',
//vardef labels
'LBL_ID' => 'ID',
'LBL_EMAIL' => 'Adres email',
'LBL_FIRST_NAME' => 'Imię',
'LBL_LAST_NAME' => 'Nazwisko',
'LBL_JOB_TITLE' => 'Stanowisko',
'LBL_IMAGE_URL' => 'Adres URL zdjęcia',
'LBL_SUMMARY_URL' => 'Adres URL podsumowania',
'LBL_COMPANY_NAME' => 'Nazwa firmy',
//Configuration labels
'url' => 'Adres URL',
'api_key' => 'Klucz API',
//Other labels
'ERROR_LBL_CONNECTION_PROBLEM' => 'Błąd: Nie można połączyć się z serwerem Zoominfo - Company connector.',
);
?>

View File

@@ -0,0 +1,78 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* The contents of this file are subject to the SugarCRM Enterprise Subscription
* Agreement ("License") which can be viewed at
* http://www.sugarcrm.com/crm/products/sugar-enterprise-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-2008 SugarCRM, Inc.; All Rights Reserved.
********************************************************************************/
/*********************************************************************************
* pl_pl.lang.ext.php,v for SugarCRM 4.5.1
* Translator: Krzysztof Morawski
* All Rights Reserved.
* Any bugs report welcome: krzysiek<at>kmmgroup<dot>pl
* Contributor(s): ______________________________________..
********************************************************************************/
$connector_strings = array (
//licensing information shown in config screen
'LBL_LICENSING_INFO' => '<table border="0" cellspacing="1"><tr><td valign="top" width="35%" class="dataLabel"><image src="' . getWebPath('modules/Connectors/connectors/sources/ext/soap/hoovers/images/hooversLogo.gif') . '" border="0"></td><td width="65%" valign="top" class="dataLabel">' .
'Hoovers&#169; dostarcza za darmo aktualnych informacji o przedsiębiorstwach dla użytkowników produktów SugarCRM. Aby zasięgnąć pełniejszych informacji i raportów na temat firm, fabryk i ich kierownictwa, wejdź na stronę <a href="http://www.hoovers.com" target="_blank">http://www.hoovers.com</a>.</td></tr></table>',
//search mapping information shown in config screen
'LBL_SEARCH_FIELDS_INFO' => 'Następujące pola są wspierane przez wyszukiwanie API Hoovers&#169: Nazwa firmy, Miasto, Województwo, Kraj i Kod pocztowy.',
//vardef labels
'LBL_ID' => 'ID',
'LBL_NAME' => 'Nazwa firmy',
/*
'LBL_DUNS' => 'DUNS',
'LBL_PARENT_DUNS' => 'Parent DUNS',
*/
'LBL_STREET' => 'Ulica',
'LBL_ADDRESS_STREET1' => 'Dodatkowa ulica',
'LBL_ADDRESS_STREET2' => 'Dodatkowa ulica',
'LBL_CITY' => 'Miasto',
'LBL_STATE' => 'Województwo',
'LBL_COUNTRY' => 'Kraj',
'LBL_ZIP' => 'Kod pocztowy',
'LBL_FINSALES' => 'Roczna sprzedaż',
'LBL_LOCATION_TYPE' => 'Typ lokalizacji',
'LBL_HQPHONE' => 'Telefon do biura',
'LBL_COMPANY_TYPE' => 'Typ firmy',
'LBL_TOTAL_EMPLOYEES' => 'Liczba zatrudnionych',
//Configuration labels
'hoovers_endpoint' => 'Endpoint URL',
'hoovers_wsdl' => 'Adres WSDL URL',
'hoovers_api_key' => 'Klucz API',
);
?>

View File

@@ -0,0 +1,79 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* The contents of this file are subject to the SugarCRM Enterprise Subscription
* Agreement ("License") which can be viewed at
* http://www.sugarcrm.com/crm/products/sugar-enterprise-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-2008 SugarCRM, Inc.; All Rights Reserved.
********************************************************************************/
/*********************************************************************************
* pl_pl.lang.ext.php,v for SugarCRM 4.5.1->>
* Translator: Krzysztof Morawski
* All Rights Reserved.
* Any bugs report welcome: krzysiek<at>kmmgroup<dot>pl
* Contributor(s: ______________________________________..
*******************************************************************************/
$connector_strings = array (
//licensing information shown in config screen
'LBL_LICENSING_INFO' => '<table border="0" cellspacing="1"><tr><td valign="top" width="35%" class="dataLabel"><image src="http://www.jigsaw.com/images/cornerstone/header/jigsawLogo.jpg" border="0"></td><td width="65%" class="dataLabel">' .
'Jigsaw&#169; dostarcza darmowych danych o firmach dla wszystkich użytkowników SugarCRM nie jest wymagana rejestracja! ' .
'Zarejestrowani użytkownicy mogą używać katalogu Jigsaw&#169;, zawierającego ponad 10 milionów kontaktów biznesowych, ' .
'każdy składający się z nazwy, tytułu, adresu email i numeru telefonu. ' .
'Przyłącz się na <a style="cursor:pointer" href="http://www.jigsaw.com" target="_blank">http://www.jigsaw.com</a>.</td></tr>',
//vardef labels
'LBL_ID' => 'ID firmy',
'LBL_COMPANY_NAME' => 'Nazwa firmy',
'LBL_CITY' => 'Miasto',
'LBL_STREET' => 'Ulica',
'LBL_STATE' => 'Województwo',
'LBL_ZIP' => 'Kod pocztowy',
'LBL_COUNTRY' => 'Kraj',
'LBL_PHONE' => 'Numer telefonu',
'LBL_SIC_CODE' => 'Kod SIC',
'LBL_REVENUE' => 'Roczny obrót',
'LBL_REVENUE_RANGE' => 'Spodziewany roczny obrót',
'LBL_OWNERSHIP' => 'Właściciel',
'LBL_WEBSITE' => 'Strona WWW',
'LBL_LINKED_IN_JIGSAW' => 'Strona firmy w Jigsaw',
'LBL_INDUSTRY1' => 'Podstawowa działalność',
'LBL_STOCK_SYMBOL' => 'Stock Symbol',
'LBL_STOCK_EXCHANGE' => 'Stock Exchange',
'LBL_CREATED_ON' => 'Data utworzenia profilu',
'LBL_EMPLOYEE_COUNT' => 'Liczba zatrudnionych',
'LBL_EMPLOYEE_RANGE' => 'Headcount Range',
//Error messages
'ERROR_API_CALL' => 'Błąd: ',
//Configuration labels
'range_end' => 'Osiągnięto maksymalną liczbę wyników na stronie',
'jigsaw_wsdl' => 'Adres WSDL URL',
'jigsaw_api_key' => 'Klucz API',
);
?>

633
modules/Connectors/controller.php Executable file
View File

@@ -0,0 +1,633 @@
<?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".
********************************************************************************/
require_once('include/connectors/sources/SourceFactory.php');
require_once('include/connectors/ConnectorFactory.php');
require_once('include/MVC/Controller/SugarController.php');
class ConnectorsController extends SugarController {
var $admin_actions = array('ConnectorSettings', 'DisplayProperties', 'MappingProperties', 'ModifyMapping', 'ModifyDisplay', 'ModifyProperties',
'ModifySearch', 'SearchProperties', 'SourceProperties',
'SavedModifyDisplay', 'SaveModifyProperties', 'SaveModifySearch');
function process() {
if(!is_admin($GLOBALS['current_user']) && in_array($this->action, $this->admin_actions)) {
$this->hasAccess = false;
}
parent::process();
}
/**
* When the user clicks the Search button, the form is posted back here and this action sets the
* search parameters in the session. Once this call returns, the tabs will then call RetrieveSource to load
* the data that was saved in the session.
*
*/
function action_SetSearch(){
if(empty($_REQUEST)) {
return;
}
$this->view = 'ajax';
require_once('include/connectors/utils/ConnectorUtils.php');
$searchdefs = ConnectorUtils::getSearchDefs();
$merge_module = $_REQUEST['merge_module'];
$record_id = $_REQUEST['record'];
$searchDefs = isset($searchdefs) ? $searchdefs : array();
unset($_SESSION['searchDefs'][$merge_module][$record_id]);
$sMap = array();
$search_source = $_REQUEST['source_id'];
$source_instance = ConnectorFactory::getInstance($search_source);
$source_map = $source_instance->getModuleMapping($merge_module);
$module_fields = array();
foreach($_REQUEST as $search_term => $val){
if(!empty($source_map[$search_term])){
$module_fields[$source_map[$search_term]] = $val;
}
}
foreach($module_fields as $search_term => $val){
foreach($searchDefs as $source => $modules){
if(empty($sMap[$source])){
$instance = ConnectorFactory::getInstance($source);
$sMap[$source] = array_flip($instance->getModuleMapping($merge_module));
}
if(!empty($sMap[$source][$search_term])){
$source_key = $sMap[$source][$search_term];
$_SESSION['searchDefs'][$merge_module][$record_id][$source][$source_key] = $val;
}
}
}
}
/**
* This action it meant to handle the hover action on the listview.
*
*/
function action_RetrieveSourceDetails() {
$this->view = 'ajax';
$source_id = $_REQUEST['source_id'];
$record_id = $_REQUEST['record_id'];
if(empty($source_id) || empty($record_id)) {
//display error here
return;
}
$source = ConnectorFactory::getInstance($source_id);
$module = $_SESSION['merge_module'];
$result = $source->fillBean(array('id' => $record_id), $module);
require_once('include/connectors/utils/ConnectorUtils.php');
$connector_strings = ConnectorUtils::getConnectorStrings($source_id);
$fields = $source->getModuleMapping($module);
$fieldDefs = $source->getFieldDefs();
$str = '';
foreach($fields as $key=>$field){
$label = $field;
if(isset($fieldDefs[$key])) {
$label = isset($connector_strings[$fieldDefs[$key]['vname']]) ? $connector_strings[$fieldDefs[$key]['vname']] : $label;
}
$val = $result->$field;
if(!empty($val)){
if(strlen($val) > 50) {
$val = substr($val, 0, 47) . '...';
}
$str .= $label . ': ' . $val.'<br/>';
}
}
global $theme;
$json = getJSONobj();
$retArray = array();
$retArray['body'] = !empty($str) ? str_replace(array("\rn", "\r", "\n"), array('','','<br />'), $str) : $GLOBALS['mod_strings']['ERROR_NO_ADDITIONAL_DETAIL'];
$retArray['caption'] = "<div style='float:left'>{$GLOBALS['app_strings']['LBL_ADDITIONAL_DETAILS']}</div>";
$retArray['width'] = (empty($results['width']) ? '300' : $results['width']);
$retArray['theme'] = $theme;
echo 'result = ' . $json->encode($retArray);
}
function action_GetSearchForm(){
$this->view = 'ajax';
if(!empty($_REQUEST['source_id'])){
//get the search fields and return the search form
$ss = new Sugar_Smarty();
require_once('include/connectors/utils/ConnectorUtils.php');
$searchdefs = ConnectorUtils::getSearchDefs();
$merge_module = $_REQUEST['merge_module'];
$seed = loadBean($merge_module);
$_searchDefs = isset($searchdefs) ? $searchdefs : array();
$_trueFields = array();
$source = $_REQUEST['source_id'];
$searchLabels = ConnectorUtils::getConnectorStrings($source);
$record = $_REQUEST['record'];
$sourceObj = SourceFactory::getSource($source);
$field_defs = $sourceObj->getFieldDefs();
if(!empty($_searchDefs[$source][$merge_module])) {
foreach($_searchDefs[$source][$merge_module] as $key) {
if(!empty($_SESSION['searchDefs'][$merge_module][$record][$source][$key])){
$_trueFields[$key]['value'] = $_SESSION['searchDefs'][$merge_module][$record][$source][$key];
}else{
$_trueFields[$key]['value'] = '';
}
if(!empty($field_defs[$key]) && isset($searchLabels[$field_defs[$key]['vname']])){
$_trueFields[$key]['label'] = $searchLabels[$field_defs[$key]['vname']];
}else{
$_trueFields[$key]['label'] = $key;
}
}//foreach
}//fi
$ss->assign('mod', $GLOBALS['mod_strings']);
$ss->assign('search_fields', $_trueFields);
$ss->assign('source_id', $source);
$ss->assign('fields', $seed->field_defs);
$ss->assign('module', $merge_module);
$ss->assign('RECORD', $record);
$ss->assign('APP', $GLOBALS['app_strings']);
$ss->assign('MOD', $GLOBALS['mod_strings']);
echo $ss->fetch('modules/Connectors/tpls/search_form.tpl');
}
}
function pre_save(){}
function post_save(){}
function action_CallRest() {
$this->view = 'ajax';
if(false === ($result=@file_get_contents($_REQUEST['url']))) {
echo '';
} else if(!empty($_REQUEST['xml'])){
$values = array();
$p = xml_parser_create();
xml_parse_into_struct($p, $result, $values);
xml_parser_free($p);
$json = getJSONobj();
echo $json->encode($values);
} else {
echo $result;
}
}
function action_CallSoap() {
$this->view = 'ajax';
$source_id = $_REQUEST['source_id'];
$module = $_REQUEST['module_id'];
$return_params = explode(',', $_REQUEST['fields']);
require_once('include/connectors/ConnectorFactory.php');
$component = ConnectorFactory::getInstance($source_id);
$beans = $component->fillBeans($_REQUEST, $module);
if(!empty($beans) && !empty($return_params)) {
$results = array();
$count = 0;
foreach($beans as $bean) {
foreach($return_params as $field) {
$results[$count][$field] = $bean->$field;
}
$count++;
}
$json = getJSONobj();
echo $json->encode($results);
} else {
echo '';
}
}
function action_DefaultSoapPopup() {
$this->view = 'ajax';
$source_id = $_REQUEST['source_id'];
$module = $_REQUEST['module_id'];
$id = $_REQUEST['record_id'];
$mapping = $_REQUEST['mapping'];
$mapping = explode(',', $mapping);
//Error checking
//Load bean
$bean = loadBean($module);
$bean->retrieve($id);
require_once('include/connectors/ConnectorFactory.php');
$component = ConnectorFactory::getInstance($source_id);
//Create arguments
$args = array();
$field_defs = $bean->getFieldDefinitions();
foreach($field_defs as $id=>$field) {
if(!empty($bean->$id)) {
$args[$id] = $bean->$id;
}
}
$beans = $component->fillBeans($args, $module);
if(!empty($beans) && !empty($mapping)) {
$results = array();
$count = 0;
foreach($beans as $bean) {
foreach($mapping as $field) {
$results[$count][$field] = $bean->$field;
}
$count++;
}
$json = getJSONobj();
echo $json->encode($results);
} else {
$GLOBALS['log']->error($GLOBALS['app_strings']['ERR_MISSING_MAPPING_ENTRY_FORM_MODULE']);
echo '';
}
}
function action_SaveModifyProperties() {
require_once('include/connectors/sources/SourceFactory.php');
$sources = array();
$properties = array();
foreach($_REQUEST as $name=>$value) {
if(preg_match("/^source[0-9]+$/", $name, $matches)) {
$source_id = $value;
$properties = array();
foreach($_REQUEST as $arg=>$val) {
if(preg_match("/^{$source_id}_(.*?)$/", $arg, $matches2)) {
$properties[$matches2[1]] = $val;
}
}
$source = SourceFactory::getSource($source_id);
if(!empty($properties)) {
$source->setProperties($properties);
$source->saveConfig();
}
}
}
require_once('include/connectors/utils/ConnectorUtils.php');
ConnectorUtils::updateMetaDataFiles();
// BEGIN SUGAR INT
if(empty($_REQUEST['from_unit_test'])) {
// END SUGAR INT
header("Location: index.php?action=ConnectorSettings&module=Connectors");
// BEGIN SUGAR INT
}
// END SUGAR INT
}
function action_SaveModifyDisplay() {
if(empty($_REQUEST['display_sources'])) {
return;
}
require_once('include/connectors/utils/ConnectorUtils.php');
require_once('include/connectors/sources/SourceFactory.php');
$connectors = ConnectorUtils::getConnectors();
$connector_keys = array_keys($connectors);
$modules_sources = ConnectorUtils::getDisplayConfig();
$sources = array();
$values = array();
$new_modules_sources = array();
if(!empty($_REQUEST['display_values'])) {
$display_values = explode(',', $_REQUEST['display_values']);
foreach($display_values as $value) {
$entry = explode(':', $value);
$new_modules_sources[$entry[1]][$entry[0]] = $entry[0];
}
}
//These are the sources that were modified.
//We only update entries for these sources that have been changed
$display_sources = explode(',', $_REQUEST['display_sources']);
foreach($display_sources as $source) {
$sources[$source] = $source;
} //foreach
$removedModules = array();
//Unset entries that have all sources removed
foreach($modules_sources as $module=>$source_entries) {
foreach($source_entries as $source_id) {
if(!empty($sources[$source_id]) && empty($new_modules_sources[$module][$source_id])) {
unset($modules_sources[$module][$source_id]);
$removedModules[$module] = true;
}
}
}
$removedModules = array_keys($removedModules);
foreach($removedModules as $key){
if(empty($new_modules_sources[$key])){
ConnectorUtils::cleanMetaDataFile($key);
}
}
//Update based on new_modules_sources
foreach($new_modules_sources as $module=>$enabled_sources) {
//If the module is not in $modules_sources add it there
if(empty($modules_sources[$module])) {
$modules_sources[$module] = $enabled_sources;
} else {
foreach($enabled_sources as $source_id) {
if(empty($modules_sources[$module][$source_id])) {
$modules_sources[$module][$source_id] = $source_id;
}
} //foreach
}
} //foreach
//Should we just remove entries where all sources are disabled?
$unset_modules = array();
foreach($modules_sources as $module=>$mapping) {
if(empty($mapping)) {
$unset_modules[] = $module;
}
}
foreach($unset_modules as $mod) {
unset($modules_sources[$mod]);
}
if(!write_array_to_file('modules_sources', $modules_sources, CONNECTOR_DISPLAY_CONFIG_FILE)) {
//Log error and return empty array
$GLOBALS['log']->fatal("Cannot write \$modules_sources to " . CONNECTOR_DISPLAY_CONFIG_FILE);
}
$sources_modules = array();
foreach($modules_sources as $module=>$source_entries) {
foreach($source_entries as $id) {
$sources_modules[$id][$module] = $module;
}
}
//Now update the searchdefs and field mapping entries accordingly
require('modules/Connectors/metadata/searchdefs.php');
$originalSearchDefs = $searchdefs;
$connectorSearchDefs = ConnectorUtils::getSearchDefs();
$searchdefs = array();
foreach($sources_modules as $source_id=>$modules) {
foreach($modules as $module) {
$searchdefs[$source_id][$module] = !empty($connectorSearchDefs[$source_id][$module]) ? $connectorSearchDefs[$source_id][$module] : (!empty($originalSearchDefs[$source_id][$module]) ? $originalSearchDefs[$source_id][$module] : array());
}
}
//Write the new searchdefs out
if(!write_array_to_file('searchdefs', $searchdefs, 'custom/modules/Connectors/metadata/searchdefs.php')) {
$GLOBALS['log']->fatal("Cannot write file custom/modules/Connectors/metadata/searchdefs.php");
}
//Unset the $_SESSION['searchDefs'] variable
if (isset($_SESSION['searchDefs'])) {
unset($_SESSION['searchDefs']);
}
//Clear mapping file if needed (this happens when all modules are removed from a source
foreach($sources as $id) {
if(empty($sources_modules[$source])) {
//Now write the new mapping entry to the custom folder
$dir = $connectors[$id]['directory'];
if(!preg_match('/^custom\//', $dir)) {
$dir = 'custom/' . $dir;
}
if(!file_exists("{$dir}")) {
mkdir_recursive("{$dir}");
}
if(!write_array_to_file('mapping', array('beans'=>array()), "{$dir}/mapping.php")) {
$GLOBALS['log']->fatal("Cannot write file {$dir}/mapping.php");
}
} //if
} //foreach
//Now update the field mapping entries
foreach($sources_modules as $id=>$modules) {
$source = SourceFactory::getSource($id);
$mapping = $source->getMapping();
$mapped_modules = array_keys($mapping['beans']);
foreach($mapped_modules as $module) {
if(empty($sources_modules[$id][$module])) {
unset($mapping['beans'][$module]);
}
}
//Remove modules from the mapping entries
foreach($modules as $module) {
if(empty($mapping['beans'][$module])) {
$originalMapping = $source->getOriginalMapping();
if(empty($originalMapping['beans'][$module])) {
$defs = $source->getFieldDefs();
$keys = array_keys($defs);
$new_mapping_entry = array();
foreach($keys as $key) {
$new_mapping_entry[$key] = '';
}
$mapping['beans'][$module] = $new_mapping_entry;
} else {
$mapping['beans'][$module] = $originalMapping['beans'][$module];
}
} //if
} //foreach
//Now write the new mapping entry to the custom folder
$dir = $connectors[$id]['directory'];
if(!preg_match('/^custom\//', $dir)) {
$dir = 'custom/' . $dir;
}
if(!file_exists("{$dir}")) {
mkdir_recursive("{$dir}");
}
if(!write_array_to_file('mapping', $mapping, "{$dir}/mapping.php")) {
$GLOBALS['log']->fatal("Cannot write file {$dir}/mapping.php");
}
} //foreach
ConnectorUtils::updateMetaDataFiles();
// BEGIN SUGAR INT
if(empty($_REQUEST['from_unit_test'])) {
// END SUGAR INT
header("Location: index.php?action=ConnectorSettings&module=Connectors");
// BEGIN SUGAR INT
}
// END SUGAR INT
}
/**
* action_SaveModifyMapping
*/
function action_SaveModifyMapping() {
$mapping_sources = !empty($_REQUEST['mapping_sources']) ? explode(',', $_REQUEST['mapping_sources']) : array();
$mapping_values = !empty($_REQUEST['mapping_values']) ? explode(',', $_REQUEST['mapping_values']) : array();
//Build the source->module->fields mapping
$source_modules_fields = array();
foreach($mapping_values as $id) {
$parts = explode(':', $id);
$key_vals = explode('=', $parts[2]);
//Note the strtolwer call... we are lowercasing the key values
$source_modules_fields[$parts[0]][$parts[1]][strtolower($key_vals[0])] = $key_vals[1];
} //foreach
foreach($mapping_sources as $source_id) {
if(empty($source_modules_fields[$source_id])) {
$source = SourceFactory::getSource($source_id);
$mapping = $source->getMapping();
foreach($mapping['beans'] as $module=>$entry) {
$source_modules_fields[$source_id][$module] = array();
}
}
} //foreach
require_once('include/connectors/utils/ConnectorUtils.php');
$source_entries = ConnectorUtils::getConnectors();
require_once('include/connectors/sources/SourceFactory.php');
foreach($source_modules_fields as $id=>$mapping_entry) {
//Insert the id mapping
foreach($mapping_entry as $module=>$entry) {
$mapping_entry[$module]['id'] = 'id';
}
$source = SourceFactory::getSource($id);
$mapping = $source->getMapping();
$mapping['beans'] = $mapping_entry;
//Now write the new mapping entry to the custom folder
$dir = $source_entries[$id]['directory'];
if(!preg_match('/^custom\//', $dir)) {
$dir = 'custom/' . $dir;
}
if(!file_exists("{$dir}")) {
mkdir_recursive("{$dir}");
}
if(!write_array_to_file('mapping', $mapping, "{$dir}/mapping.php")) {
$GLOBALS['log']->fatal("Cannot write file {$dir}/mapping.php");
}
}
//Rewrite the metadata files
ConnectorUtils::updateMetaDataFiles();
// BEGIN SUGAR INT
if(empty($_REQUEST['from_unit_test'])) {
// END SUGAR INT
header("Location: index.php?action=ConnectorSettings&module=Connectors");
// BEGIN SUGAR INT
}
// END SUGAR INT
}
function action_RunTest() {
$this->view = 'ajax';
$source_id = $_REQUEST['source_id'];
$source = SourceFactory::getSource($source_id);
$properties = array();
foreach($_REQUEST as $name=>$value) {
if(preg_match("/^{$source_id}_(.*?)$/", $name, $matches)) {
$properties[$matches[1]] = $value;
}
}
$source->setProperties($properties);
$source->saveConfig();
//Call again and call init
$source = SourceFactory::getSource($source_id);
$source->init();
global $mod_strings;
try {
if($source->isRequiredConfigFieldsForButtonSet() && $source->test()) {
echo $mod_strings['LBL_TEST_SOURCE_SUCCESS'];
} else {
echo $mod_strings['LBL_TEST_SOURCE_FAILED'];
}
} catch (Exception $ex) {
$GLOBALS['log']->fatal($ex->getMessage());
echo $ex->getMessage();
}
}
/**
* action_RetrieveSources
* Returns a JSON encoded format of the Connectors that are configured for the system
*
*/
function action_RetrieveSources() {
require_once('include/connectors/utils/ConnectorUtils.php');
$this->view = 'ajax';
$sources = ConnectorUtils:: getConnectors();
$results = array();
foreach($sources as $id=>$entry) {
$results[$id] = !empty($entry['name']) ? $entry['name'] : $id;
}
$json = getJSONobj();
echo $json->encode($results);
}
}
?>

View File

@@ -0,0 +1,117 @@
<?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".
********************************************************************************/
$mod_strings = array (
'LBL_ADD_MODULE' => 'Add',
'LBL_ADDRCITY' => 'City',
'LBL_ADDRCOUNTRY' => 'Country',
'LBL_ADDRCOUNTRY_ID' => 'Country Id',
'LBL_ADDRSTATEPROV' => 'State',
'LBL_ADMINISTRATION' => 'Connector Administration',
'LBL_ADMINISTRATION_MAIN' => 'Connector Settings',
'LBL_AVAILABLE' => 'Available',
'LBL_BACK' => '< Back',
'LBL_COMPANY_ID' => 'Company Id',
'LBL_CONFIRM_CONTINUE_SAVE' => 'Some required fields have been left blank. Proceed to save changes?',
'LBL_CONNECTOR' => 'Connector',
'LBL_CONNECTOR_FIELDS' => 'Connector Fields',
'LBL_DATA' => 'Data',
'LBL_DEFAULT' => 'Default',
'LBL_DELETE_MAPPING_ENTRY' => 'Are you sure you want to delete this entry?',
'LBL_DISABLED' => 'Disabled',
'LBL_DUNS' => 'DUNS',
'LBL_EMPTY_BEANS' => 'No matches were found for your search criteria.',
'LBL_ENABLED' => 'Enabled',
'LBL_FINSALES' => 'Finsales',
'LBL_MARKET_CAP' => 'Market Cap',
'LBL_MERGE' => 'Merge',
'LBL_MODIFY_DISPLAY_TITLE' => 'Enable Connectors',
'LBL_MODIFY_DISPLAY_DESC' => 'Select which modules are enabled for each connector.',
'LBL_MODIFY_DISPLAY_PAGE_TITLE' => 'Connector Settings: Enable Connectors',
'LBL_MODULE_FIELDS' => 'Module Fields',
'LBL_MODIFY_MAPPING_TITLE' => 'Map Connector Fields',
'LBL_MODIFY_MAPPING_DESC' => 'Map connector fields to module fields in order to determine what connector data can be viewed and merged into the module records.',
'LBL_MODIFY_MAPPING_PAGE_TITLE' => 'Connector Settings: Map Connector Fields',
'LBL_MODIFY_PROPERTIES_TITLE' => 'Set Connector Properties',
'LBL_MODIFY_PROPERTIES_DESC' => 'Configure the properties for each connector, including URLs and API keys.',
'LBL_MODIFY_PROPERTIES_PAGE_TITLE' => 'Connector Settings: Set Connector Properties',
'LBL_MODIFY_SEARCH_TITLE' => 'Manage Connector Search',
'LBL_MODIFY_SEARCH' => 'Search',
'LBL_MODIFY_SEARCH_DESC' => 'Select the connector fields to use to search for data for each module.',
'LBL_MODIFY_SEARCH_PAGE_TITLE' => 'Connector Settings: Manage Connector Search',
'LBL_MODULE_NAME' => 'Connectors',
'LBL_NO_PROPERTIES' => 'There are no configurable properties for this connector.',
'LBL_PARENT_DUNS' => 'Parent DUNS',
'LBL_PREVIOUS' => '< Back',
'LBL_QUOTE' => 'Quote',
'LBL_RECNAME' => 'Company Name',
'LBL_RESET_TO_DEFAULT' => 'Reset to Default',
'LBL_RESET_TO_DEFAULT_CONFIRM' => 'Are you sure you want to reset to the default configuration?',
'LBL_RESET_BUTTON_TITLE' => 'Reset [Alt+R]',
'LBL_RESULT_LIST' => 'Data List',
'LBL_RUN_WIZARD' => 'Run Wizard',
'LBL_SAVE' => 'Save',
'LBL_SEARCHING_BUTTON_LABEL' => 'Searching...',
'LBL_SHOW_IN_LISTVIEW' => 'Show In Merge Listview',
'LBL_SMART_COPY' => 'Smart Copy',
'LBL_SUMMARY' => 'Summary',
'LBL_STEP1' => 'Search and View Data',
'LBL_STEP2' => 'Merge Records with',
'LBL_TEST_SOURCE' => 'Test Connector',
'LBL_TEST_SOURCE_FAILED' => 'Test Failed',
'LBL_TEST_SOURCE_RUNNING' => 'Performing Test...',
'LBL_TEST_SOURCE_SUCCESS' => 'Test Successful',
'LBL_TITLE' => 'Data Merge',
'LBL_ULTIMATE_PARENT_DUNS' => 'Ultimate Parent DUNS',
'ERROR_RECORD_NOT_SELECTED' => 'Error: Please select a record from the list before proceeding.',
'ERROR_EMPTY_WRAPPER' => 'Error: Unable to retrieve wrapper instance for the source [{$source_id}]',
'ERROR_EMPTY_SOURCE_ID' => 'Error: Source Id not specified or empty.',
'ERROR_EMPTY_RECORD_ID' => 'Error: Record Id not specified or empty.',
'ERROR_NO_ADDITIONAL_DETAIL' => 'Error: No additional details were found for the record.',
'ERROR_NO_SEARCHDEFS_DEFINED' => 'No modules have been enabled for this connector. Select a module for this connector in the Enable Connectors page.',
'ERROR_NO_SEARCHDEFS_MAPPED' => 'Error: There are no connectors enabled that have search fields defined.',
'ERROR_NO_SOURCEDEFS_FILE' => 'Error: No sourcedefs.php file could be found.',
'ERROR_NO_SOURCEDEFS_SPECIFIED' => 'Error: No sources were specified from which to retrieve data.',
'ERROR_NO_CONNECTOR_DISPLAY_CONFIG_FILE' => 'Error: There are no connectors mapped to this module.',
'ERROR_NO_SEARCHDEFS_MAPPING' => 'Error: There are no search fields defined for the module and connector. Please contact the system administrator.',
'ERROR_NO_FIELDS_MAPPED' => 'Error: You must map at least one Connector field to a module field for each module entry.',
'ERROR_NO_DISPLAYABLE_MAPPED_FIELDS' => 'Error: There are no module fields that have been mapped for display in the results. Please contact the system administrator.',
);
?>

View File

@@ -0,0 +1,115 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* The contents of this file are subject to the SugarCRM Enterprise Subscription
* Agreement ("License") which can be viewed at
* http://www.sugarcrm.com/crm/products/sugar-enterprise-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-2008 SugarCRM, Inc.; All Rights Reserved.
********************************************************************************/
/*********************************************************************************
* pl_pl.lang.ext.php,v for SugarCRM 4.5.1-->>
* Translator: Krzysztof Morawski
* All Rights Reserved.
* Any bugs report welcome: krzysiek<at>kmmgroup<dot>pl
* Contributor(s): ______________________________________..
********************************************************************************/
$mod_strings = array (
'LBL_ADD_MODULE' => 'Dodaj',
'LBL_ADDRCITY' => 'Miasto',
'LBL_ADDRCOUNTRY' => 'Kraj',
'LBL_ADDRCOUNTRY_ID' => 'ID kraju',
'LBL_ADDRSTATEPROV' => 'Województwo',
'LBL_ADMINISTRATION' => 'Administracja łącznikami',
'LBL_ADMINISTRATION_MAIN' => 'Ustawienia łącznika',
'LBL_AVAILABLE' => 'Dostępne',
'LBL_BACK' => '< Z powrotem',
'LBL_COMPANY_ID' => 'ID przedsiębiorstwa',
'LBL_CONNECTOR' => 'Łącznik',
'LBL_CONNECTOR_FIELDS' => 'Pola łącznika',
'LBL_DATA' => 'Dane',
'LBL_DEFAULT' => 'Domyślne',
'LBL_DELETE_MAPPING_ENTRY' => 'Czy na pewno chcesz usunąć ten wpis?',
'LBL_DISABLED' => 'Niedostępne',
'LBL_DUNS' => 'DUNS',
'LBL_EMPTY_BEANS' => 'Nie znaleziono wyników pasujących do zadanych kryteriów wyszukiwania.',
'LBL_ENABLED' => 'Włączone',
'LBL_FINSALES' => 'Finsales',
'LBL_MARKET_CAP' => 'Market Cap',
'LBL_MERGE' => 'Połącz',
'LBL_MODIFY_DISPLAY_TITLE' => 'Włącz łączniki',
'LBL_MODIFY_DISPLAY_DESC' => 'Wybierz, które łączniki zostaną włączone dla których modułów.',
'LBL_MODIFY_DISPLAY_PAGE_TITLE' => 'Ustawienia łączników: Włączanie łączników',
'LBL_MODULE_FIELDS' => 'Pola modułu',
'LBL_MODIFY_MAPPING_TITLE' => 'Mapowanie pól łączników',
'LBL_MODIFY_MAPPING_DESC' => 'Mapuj pola łączników do pól modułów w celu określnia, które dane łącznika będą widoczne i połączone z rekordami modułu.',
'LBL_MODIFY_MAPPING_PAGE_TITLE' => 'Ustawienia łączników: Mapuj pola łączników',
'LBL_MODIFY_PROPERTIES_TITLE' => 'Konfiguracja właściwości łącznika',
'LBL_MODIFY_PROPERTIES_DESC' => 'Konfiguruj właściwości dla każdego łącznika, również adresy URL i klucze API.',
'LBL_MODIFY_PROPERTIES_PAGE_TITLE' => 'Ustawienia łączników: Ustawienia właściwości łącznika',
'LBL_MODIFY_SEARCH_TITLE' => 'Zarządzaj wyszukiwaniem w łącznikach',
'LBL_MODIFY_SEARCH' => 'Wyszukaj',
'LBL_MODIFY_SEARCH_DESC' => 'Wybierz pola łącznika, które będą przeszukiwane dla każdego modułu.',
'LBL_MODIFY_SEARCH_PAGE_TITLE' => 'Ustawienia łączników: Zarządzanie wyszukiwaniem w łącznikach',
'LBL_MODULE_NAME' => 'Łączniki',
'LBL_NO_PROPERTIES' => 'Nie ma konfigurowalnych właściwości dla tego łącznika.',
'LBL_PARENT_DUNS' => 'Nadrzędne DUNS',
'LBL_PREVIOUS' => '< Z powrotem',
'LBL_QUOTE' => 'Zapytanie',
'LBL_RECNAME' => 'Nazwa firmy',
'LBL_RESET_TO_DEFAULT' => 'Wróć do domyślnych ustawień',
'LBL_RESET_TO_DEFAULT_CONFIRM' => 'Czy na pewno chcesz powrócić do domyślnych ustawień?',
'LBL_RESET_BUTTON_TITLE' => 'Reset [Alt+R]',
'LBL_RESULT_LIST' => 'Lista danych',
'LBL_RUN_WIZARD' => 'Uruchom kreator',
'LBL_SAVE' => 'Zachowaj',
'LBL_SEARCHING_BUTTON_LABEL' => 'Wyszukiwanie...',
'LBL_SHOW_IN_LISTVIEW' => 'Pokaż w widoku scalania',
'LBL_SMART_COPY' => 'Sprytna kopia',
'LBL_SUMMARY' => 'Podsumowanie',
'LBL_STEP1' => 'Wyszukaj i pokaż dane',
'LBL_STEP2' => 'Scal rekordy z',
'LBL_TEST_SOURCE' => 'Sprawdź działanie łącznika',
'LBL_TEST_SOURCE_FAILED' => 'Test nie powiódł się',
'LBL_TEST_SOURCE_RUNNING' => 'Przeprowadzam test...',
'LBL_TEST_SOURCE_SUCCESS' => 'Test zakończony powodzeniem',
'LBL_TITLE' => 'Scalanie danych',
'LBL_ULTIMATE_PARENT_DUNS' => 'Ultimate Parent DUNS',
'ERROR_RECORD_NOT_SELECTED' => 'Błąd: Wybierz przed kontynuacją wybierz rekord z listy.',
'ERROR_EMPTY_WRAPPER' => 'Error: Unable to retrieve wrapper instance for the source [{$source_id}]',
'ERROR_EMPTY_SOURCE_ID' => 'Błąd: ID źródła nie określone, lub puste.',
'ERROR_EMPTY_RECORD_ID' => 'Błąd: ID Rekordu nie określone, lub puste.',
'ERROR_NO_ADDITIONAL_DETAIL' => 'Błąd: Nie znaleziono dodatkowych szczegółów dla tego rekordu.',
'ERROR_NO_SEARCHDEFS_DEFINED' => 'Żadne moduły nie zostały włączone dla tego łącznika. Wybierz moduł dla tego łącznika na stronie <b>Włączanie łączników</b>.',
'ERROR_NO_SOURCEDEFS_FILE' => 'Błąd: Nie odnaleziono pliku sourcedefs.php.',
'ERROR_NO_SOURCEDEFS_SPECIFIED' => 'Bład: Nie określono źródeł, z których należało pobrać dane.',
'ERROR_NO_CONNECTOR_DISPLAY_CONFIG_FILE' => 'Bład: Nie ma łączników zamapowanych do tego modułu.',
'ERROR_NO_SEARCHDEFS_MAPPING' => 'Bład: Nie ma zdefiniowanych pól wyszukiwania dla modułu i łącznika. Skontaktuj się z administratorem systemu.',
'ERROR_NO_FIELDS_MAPPED' => 'Błąd: Musisz zamapować co najmniej jedno pole łącznika do pola modułu dla każdego wybranego modułu.',
'ERROR_NO_DISPLAYABLE_MAPPED_FIELDS' => 'Bład: Nie ma zdefiniowanych pól modułu, które zostały zamapowane do wyświetlenia w wynikach . Skontaktuj się z administratorem systemu.',
);
?>

View File

@@ -0,0 +1,42 @@
<?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".
********************************************************************************/
$searchdefs = array(
)
?>

View File

@@ -0,0 +1,76 @@
<?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".
********************************************************************************/
class ViewConnectorSettings extends SugarView
{
/**
* @see SugarView::_getModuleTitleParams()
*/
protected function _getModuleTitleParams()
{
global $mod_strings;
return array(
"<a href='index.php?module=Administration&action=index'>".translate('LBL_MODULE_NAME','Administration')."</a>",
$mod_strings['LBL_ADMINISTRATION_MAIN']
);
}
/**
* @see SugarView::_getModuleTab()
*/
protected function _getModuleTab()
{
return 'Administration';
}
/**
* @see SugarView::display()
*/
public function display()
{
global $mod_strings, $app_strings;
echo $this->getModuleTitle();
$this->ss->assign('mod', $mod_strings);
$this->ss->assign('app', $app_strings);
$this->ss->assign('IMG', 'themes/default/images/');
$this->ss->display('modules/Connectors/tpls/administration.tpl');
}
}

View File

@@ -0,0 +1,111 @@
<?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".
********************************************************************************/
require_once('include/MVC/View/views/view.list.php');
require_once('include/connectors/sources/SourceFactory.php');
class ViewDisplayProperties extends ViewList
{
/**
* @see SugarView::process()
*/
public function process()
{
$this->options['show_all'] = false;
$this->options['show_javascript'] = true;
$this->options['show_footer'] = false;
$this->options['show_header'] = false;
parent::process();
}
/**
* @see SugarView::display()
*/
public function display()
{
require_once('include/connectors/utils/ConnectorUtils.php');
$source = $_REQUEST['source_id'];
$sources = ConnectorUtils::getConnectors();
$modules_sources = ConnectorUtils::getDisplayConfig();
//$json = getJSONobj();
$enabled_modules = array();
$disabled_modules = array();
//Find all modules this source has been enabled for
foreach($modules_sources as $module=>$mapping) {
foreach($modules_sources[$module] as $entry) {
if($entry == $source) {
$enabled_modules[$module] = $module;
}
}
}
global $moduleList, $beanList;
//Do filtering here?
$count = 0;
global $current_user;
$access = get_admin_modules_for_user($current_user);
$d = dir('modules');
while($e = $d->read()){
if(substr($e, 0, 1) == '.' || !is_dir('modules/' . $e))continue;
if(empty($enabled_modules[$e]) && file_exists('modules/' . $e . '/metadata/studio.php') && file_exists('modules/' . $e . '/metadata/detailviewdefs.php') && isset($GLOBALS [ 'beanList' ][$e]) && (in_array($e, $access) || is_admin($current_user))) // installed modules must also exist in the beanList
{
$disabled_modules[$e] = $e;
}
}
asort($enabled_modules);
asort($disabled_modules);
//$enabled = $json->encode($enabled_modules);
//$disabled = $json->encode($disabled_modules);
//$script = "addTable('{$module}', '{$enabled}', '{$disabled}', '{$source}', '{$GLOBALS['theme']}');\n";
//$this->ss->assign('new_modules_sources', $modules_sources);
//$this->ss->assign('dynamic_script', $script);
$this->ss->assign('enabled_modules', $enabled_modules);
$this->ss->assign('disabled_modules', $disabled_modules);
$this->ss->assign('source_id', $source);
$this->ss->assign('mod', $GLOBALS['mod_strings']);
$this->ss->assign('APP', $GLOBALS['app_strings']);
$this->ss->assign('theme', $GLOBALS['theme']);
echo $this->ss->fetch('modules/Connectors/tpls/display_properties.tpl');
}
}

View File

@@ -0,0 +1,157 @@
<?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".
********************************************************************************/
require_once('include/MVC/View/views/view.list.php');
require_once('include/connectors/sources/SourceFactory.php');
class ViewMappingProperties extends ViewList
{
/**
* @see SugarView::process()
*/
public function process()
{
$this->options['show_all'] = false;
$this->options['show_javascript'] = true;
$this->options['show_footer'] = false;
$this->options['show_header'] = false;
parent::process();
}
/**
* @see SugarView::display()
*/
public function display()
{
require_once('include/connectors/utils/ConnectorUtils.php');
require_once('include/connectors/sources/SourceFactory.php');
$connector_strings = ConnectorUtils::getConnectorStrings($_REQUEST['source_id']);
$sources = ConnectorUtils::getConnectors();
$source_id = $_REQUEST['source_id'];
$source = SourceFactory::getSource($source_id);
$is_enabled = ConnectorUtils::isSourceEnabled($source_id);
$script = '';
$display_data = array();
if($is_enabled) {
$mapping = $source->getMapping();
$source_defs = $source->getFieldDefs();
//Create the Javascript code to dynamically add the tables
$json = getJSONobj();
foreach($mapping['beans'] as $module=>$field_mapping) {
$mod_strings = return_module_language($GLOBALS['current_language'], $module);
$bean = loadBean($module);
if ( !is_object($bean) )
continue;
$field_defs = $bean->getFieldDefinitions();
$available_fields = array();
$labels = array();
$duplicate_labels = array();
foreach($field_defs as $id=>$def) {
//We are filtering out some fields here
if($def['type'] == 'relate' || $def['type'] == 'link' || (isset($def['dbType']) && $def['dbType'] == 'id')) {
continue;
}
if(isset($def['vname'])) {
$available_fields[$id] = !empty($mod_strings[$def['vname']]) ? $mod_strings[$def['vname']] : $id;
} else {
$available_fields[$id] = $id;
}
//Remove the ':' character in some labels
if(preg_match('/\:$/', $available_fields[$id])) {
$available_fields[$id] = substr($available_fields[$id], 0, strlen($available_fields[$id])-1);
}
if(isset($labels[$available_fields[$id]])) {
$duplicate_labels[$labels[$available_fields[$id]]] = $labels[$available_fields[$id]];
$duplicate_labels[$id] = $id;
} else {
$labels[$available_fields[$id]] = $id;
}
}
foreach($duplicate_labels as $id) {
$available_fields[$id] = $available_fields[$id] . " ({$id})";
}
asort($available_fields);
$field_keys = array();
$field_values = array();
$source_fields = array();
foreach($field_mapping as $id=>$field) {
if(!empty($source_defs[$id])) {
$source_fields[$id] = $source_defs[$id];
}
}
$source_fields = array_merge($source_fields, $source_defs);
foreach($source_fields as $id=>$def) {
if(empty($def['hidden'])){
$field_keys[strtolower($id)] = !empty($connector_strings[$source_fields[$id]['vname']]) ? $connector_strings[$source_fields[$id]['vname']] : $id;
$field_values[] = !empty($field_mapping[strtolower($id)]) ? $field_mapping[strtolower($id)] : '';
}
}
$display_data[$module] = array('field_keys' => $field_keys,
'field_values' => $field_values,
'available_fields' => $available_fields,
'field_mapping' => $field_mapping);
}
}
$this->ss->assign('display_data', $display_data);
$this->ss->assign('empty_mapping', empty($display_data) ? true : false);
$this->ss->assign('dynamic_script', $script);
$this->ss->assign('sources', $sources);
$this->ss->assign('mod', $GLOBALS['mod_strings']);
$this->ss->assign('APP', $GLOBALS['app_strings']);
$this->ss->assign('source_id', $source_id);
$this->ss->assign('source_name', $sources[$source_id]['name']);
$this->ss->assign('theme', $GLOBALS['theme']);
echo $this->ss->fetch('modules/Connectors/tpls/mapping_properties.tpl');
}
}

View File

@@ -0,0 +1,81 @@
<?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".
********************************************************************************/
require_once('include/MVC/View/SugarView.php');
require_once('include/connectors/sources/SourceFactory.php');
class ViewModifyDisplay extends SugarView
{
/**
* @see SugarView::_getModuleTitleParams()
*/
protected function _getModuleTitleParams()
{
global $mod_strings;
return array(
"<a href='index.php?module=Administration&action=index'>".translate('LBL_MODULE_NAME','Administration')."</a>",
"<a href='index.php?module=Connectors&action=ConnectorSettings'>".$mod_strings['LBL_ADMINISTRATION_MAIN']."</a>",
$mod_strings['LBL_MODIFY_DISPLAY_TITLE']
);
}
/**
* @see SugarView::_getModuleTab()
*/
protected function _getModuleTab()
{
return 'Administration';
}
/**
* @see SugarView::display()
*/
public function display()
{
require_once('include/connectors/utils/ConnectorUtils.php');
$sources = ConnectorUtils::getConnectors();
$this->ss->assign('SOURCES', $sources);
$this->ss->assign('mod', $GLOBALS['mod_strings']);
$this->ss->assign('APP', $GLOBALS['app_strings']);
$this->ss->assign('theme', $GLOBALS['theme']);
echo $this->getModuleTitle();
$this->ss->display('modules/Connectors/tpls/modify_display.tpl');
}
}

View File

@@ -0,0 +1,82 @@
<?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".
********************************************************************************/
require_once('include/MVC/View/SugarView.php');
require_once('include/connectors/sources/SourceFactory.php');
class ViewModifyMapping extends SugarView
{
/**
* @see SugarView::_getModuleTitleParams()
*/
protected function _getModuleTitleParams()
{
global $mod_strings;
return array(
"<a href='index.php?module=Administration&action=index'>".translate('LBL_MODULE_NAME','Administration')."</a>",
"<a href='index.php?module=Connectors&action=ConnectorSettings'>".$mod_strings['LBL_ADMINISTRATION_MAIN']."</a>",
$mod_strings['LBL_MODIFY_MAPPING_TITLE']
);
}
/**
* @see SugarView::_getModuleTab()
*/
protected function _getModuleTab()
{
return 'Administration';
}
/**
* @see SugarView::display()
*/
public function display()
{
require_once('include/connectors/utils/ConnectorUtils.php');
require_once('include/connectors/sources/SourceFactory.php');
global $mod_strings, $app_strings;
$this->ss->assign('mod', $mod_strings);
$this->ss->assign('APP', $app_strings);
$connectors = ConnectorUtils::getConnectors(true);
$this->ss->assign('SOURCES', $connectors);
echo $this->getModuleTitle();
$this->ss->display('modules/Connectors/tpls/modify_mapping.tpl');
}
}

View File

@@ -0,0 +1,95 @@
<?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".
********************************************************************************/
require_once('include/MVC/View/SugarView.php');
class ViewModifyProperties extends SugarView
{
/**
* @see SugarView::_getModuleTitleParams()
*/
protected function _getModuleTitleParams()
{
global $mod_strings;
return array(
"<a href='index.php?module=Administration&action=index'>".translate('LBL_MODULE_NAME','Administration')."</a>",
"<a href='index.php?module=Connectors&action=ConnectorSettings'>".$mod_strings['LBL_ADMINISTRATION_MAIN']."</a>",
$mod_strings['LBL_MODIFY_PROPERTIES_TITLE']
);
}
/**
* @see SugarView::_getModuleTab()
*/
protected function _getModuleTab()
{
return 'Administration';
}
/**
* @see SugarView::display()
*/
public function display()
{
global $mod_strings, $app_strings;
require_once('include/connectors/utils/ConnectorUtils.php');
require_once('include/connectors/sources/SourceFactory.php');
$this->ss->assign('mod', $mod_strings);
$this->ss->assign('APP', $app_strings);
$connectors = ConnectorUtils::getConnectors(true);
$required_fields = array();
//Get required fields for first connector only
foreach($connectors as $id=>$entry) {
$s = SourceFactory::getSource($id);
$connector_strings = ConnectorUtils::getConnectorStrings($id);
$fields = $s->getRequiredConfigFields();
foreach($fields as $field_id) {
$label = isset($connector_strings[$field_id]) ? $connector_strings[$field_id] : $field_id;
$required_fields[$id][$field_id]=$label;
}
break;
}
$this->ss->assign('SOURCES', $connectors);
$this->ss->assign('REQUIRED_FIELDS', $required_fields);
echo $this->getModuleTitle();
$this->ss->display('modules/Connectors/tpls/modify_properties.tpl');
}
}

View File

@@ -0,0 +1,89 @@
<?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".
********************************************************************************/
require_once('include/MVC/View/SugarView.php');
require_once('include/connectors/sources/SourceFactory.php');
class ViewModifySearch extends SugarView
{
/**
* @see SugarView::_getModuleTitleParams()
*/
protected function _getModuleTitleParams()
{
global $mod_strings;
return array(
"<a href='index.php?module=Administration&action=index'>".translate('LBL_MODULE_NAME','Administration')."</a>",
"<a href='index.php?module=Connectors&action=ConnectorSettings'>".$mod_strings['LBL_ADMINISTRATION_MAIN']."</a>",
$mod_strings['LBL_MODIFY_SEARCH_TITLE']
);
}
/**
* @see SugarView::_getModuleTab()
*/
protected function _getModuleTab()
{
return 'Administration';
}
/**
* @see SugarView::display()
*/
public function display()
{
require_once('include/connectors/utils/ConnectorUtils.php');
global $mod_strings, $app_strings;
$sugar_smarty = new Sugar_Smarty();
$this->ss->assign('mod', $mod_strings);
$this->ss->assign('APP', $app_strings);
$connectors = ConnectorUtils::getConnectors();
foreach($connectors as $id=>$source) {
$s = SourceFactory::getSource($id);
if(!$s->isEnabledInWizard()) {
unset($connectors[$id]);
}
}
$this->ss->assign('SOURCES', $connectors);
echo $this->getModuleTitle();
$this->ss->display('modules/Connectors/tpls/modify_search.tpl');
}
}

View File

@@ -0,0 +1,125 @@
<?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: This file is used to override the default Meta-data EditView behavior
* to provide customization specific to the Contacts module.
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
********************************************************************************/
require_once('include/MVC/View/views/view.list.php');
require_once('include/connectors/sources/SourceFactory.php');
class ViewSearchProperties extends ViewList
{
/**
* @see SugarView::process()
*/
public function process()
{
$this->options['show_all'] = false;
$this->options['show_javascript'] = true;
$this->options['show_footer'] = false;
$this->options['show_header'] = false;
parent::process();
}
/**
* @see SugarView::display()
*/
public function display()
{
require_once('include/connectors/utils/ConnectorUtils.php');
require_once('include/connectors/sources/SourceFactory.php');
$source_id = $_REQUEST['source_id'];
$connector_strings = ConnectorUtils::getConnectorStrings($source_id);
$is_enabled = ConnectorUtils::isSourceEnabled($source_id);
$modules_sources = array();
$sources = ConnectorUtils::getConnectors();
$display_data = array();
if($is_enabled) {
$searchDefs = ConnectorUtils::getSearchDefs();
$searchDefs = !empty($searchDefs[$_REQUEST['source_id']]) ? $searchDefs[$_REQUEST['source_id']] : array();
$source = SourceFactory::getSource($_REQUEST['source_id']);
$field_defs = $source->getFieldDefs();
//Create the Javascript code to dynamically add the tables
$json = getJSONobj();
foreach($searchDefs as $module=>$fields) {
$disabled = array();
$enabled = array();
$enabled_fields = array_flip($fields);
$field_keys = array_keys($field_defs);
foreach($field_keys as $index=>$key) {
if(!empty($field_defs[$key]['hidden']) || empty($field_defs[$key]['search'])) {
continue;
}
if(!isset($enabled_fields[$key])) {
$disabled[$key] = !empty($connector_strings[$field_defs[$key]['vname']]) ? $connector_strings[$field_defs[$key]['vname']] : $key;
} else {
$enabled[$key] = !empty($connector_strings[$field_defs[$key]['vname']]) ? $connector_strings[$field_defs[$key]['vname']] : $key;
}
}
$modules_sources[$module] = array_merge($enabled, $disabled);
asort($disabled);
$display_data[$module] = array('enabled' => $enabled, 'disabled' => $disabled);
}
}
$this->ss->assign('no_searchdefs_defined', !$is_enabled);
$this->ss->assign('display_data', $display_data);
$this->ss->assign('modules_sources', $modules_sources);
$this->ss->assign('sources', $sources);
$this->ss->assign('mod', $GLOBALS['mod_strings']);
$this->ss->assign('APP', $GLOBALS['app_strings']);
$this->ss->assign('source_id', $_REQUEST['source_id']);
$this->ss->assign('theme', $GLOBALS['theme']);
$this->ss->assign('connector_language', $connector_strings);
echo $this->ss->fetch('modules/Connectors/tpls/search_properties.tpl');
}
}

View File

@@ -0,0 +1,87 @@
<?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: This file is used to override the default Meta-data EditView behavior
* to provide customization specific to the Contacts module.
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
********************************************************************************/
require_once('include/MVC/View/views/view.list.php');
class ViewSourceProperties extends ViewList {
function ViewSourceProperties(){
parent::ViewList();
}
function process() {
parent::process();
}
function display() {
require_once('include/connectors/sources/SourceFactory.php');
require_once('include/connectors/utils/ConnectorUtils.php');
$source_id = $_REQUEST['source_id'];
$connector_language = ConnectorUtils::getConnectorStrings($source_id);
$source = SourceFactory::getSource($source_id);
$properties = $source->getProperties();
$required_fields = array();
$config_fields = $source->getRequiredConfigFields();
$fields = $source->getRequiredConfigFields();
foreach($fields as $field_id) {
$label = isset($connector_language[$field_id]) ? $connector_language[$field_id] : $field_id;
$required_fields[$field_id]=$label;
}
$this->ss->assign('required_properties', $required_fields);
$this->ss->assign('source_id', $source_id);
$this->ss->assign('properties', $properties);
$this->ss->assign('mod', $GLOBALS['mod_strings']);
$this->ss->assign('app', $GLOBALS['app_strings']);
$this->ss->assign('connector_language', $connector_language);
$this->ss->assign('hasTestingEnabled', $source->hasTestingEnabled());
echo $this->ss->fetch('modules/Connectors/tpls/source_properties.tpl');
}
}
?>