This commit is contained in:
2024-04-27 09:23:34 +02:00
commit 11e713ca6f
11884 changed files with 3263371 additions and 0 deletions

228
modules/ACL/ACLController.php Executable file
View File

@@ -0,0 +1,228 @@
<?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('modules/ACLActions/actiondefs.php');
require_once('modules/ACL/ACLJSController.php');
class ACLController {
function checkAccess($category, $action, $is_owner=false, $type='module'){
global $current_user;
if(is_admin($current_user))return true;
//calendar is a special case since it has 3 modules in it (calls, meetings, tasks)
if($category == 'Calendar'){
return ACLAction::userHasAccess($current_user->id, 'Calls', $action,$type, $is_owner) || ACLAction::userHasAccess($current_user->id, 'Meetings', $action,'module', $is_owner) || ACLAction::userHasAccess($current_user->id, 'Tasks', $action,'module', $is_owner);
}
if($category == 'Activities'){
return ACLAction::userHasAccess($current_user->id, 'Calls', $action,$type, $is_owner) || ACLAction::userHasAccess($current_user->id, 'Meetings', $action,'module', $is_owner) || ACLAction::userHasAccess($current_user->id, 'Tasks', $action,'module', $is_owner)|| ACLAction::userHasAccess($current_user->id, 'Emails', $action,'module', $is_owner)|| ACLAction::userHasAccess($current_user->id, 'Notes', $action,'module', $is_owner);
}
return ACLAction::userHasAccess($current_user->id, $category, $action,$type, $is_owner);
}
function requireOwner($category, $value, $type='module'){
global $current_user;
if(is_admin($current_user))return false;
return ACLAction::userNeedsOwnership($current_user->id, $category, $value,$type);
}
function filterModuleList(&$moduleList, $by_value=true){
global $aclModuleList, $current_user;
$actions = ACLAction::getUserActions($current_user->id, false);
$compList = array();
if($by_value){
foreach($moduleList as $key=>$value){
$compList[$value]= $key;
}
}else{
$compList =& $moduleList;
}
foreach($actions as $action_name=>$action){
if(!empty($action['module'])){
$aclModuleList[$action_name] = $action_name;
if(isset($compList[$action_name])){
if($action['module']['access']['aclaccess'] < ACL_ALLOW_ENABLED){
if($by_value){
unset($moduleList[$compList[$action_name]]);
}else{
unset($moduleList[$action_name]);
}
}
}
}
}
if(isset($compList['Calendar']) &&
!( ACLController::checkModuleAllowed('Calls', $actions) || ACLController::checkModuleAllowed('Meetings', $actions) || ACLController::checkModuleAllowed('Tasks', $actions)))
{
if($by_value){
unset($moduleList[$compList['Calendar']]);
}else{
unset($moduleList['Calendar']);
}
if(isset($compList['Activities']) &&
!( ACLController::checkModuleAllowed('Notes', $actions) || ACLController::checkModuleAllowed('Notes', $actions))){
if($by_value){
unset($moduleList[$compList['Activities']]);
}else{
unset($moduleList['Activities']);
}
}
}
}
/**
* Check to see if the module is available for this user.
*
* @param String $module_name
* @return true if they are allowed. false otherwise.
*/
function checkModuleAllowed($module_name, $actions)
{
if(!empty($actions[$module_name]['module']['access']['aclaccess']) &&
ACL_ALLOW_ENABLED == $actions[$module_name]['module']['access']['aclaccess'])
{
return true;
}
return false;
}
function disabledModuleList($moduleList, $by_value=true,$view='list'){
global $aclModuleList, $current_user;
$actions = ACLAction::getUserActions($current_user->id, false);
$disabled = array();
$compList = array();
if($by_value){
foreach($moduleList as $key=>$value){
$compList[$value]= $key;
}
}else{
$compList =& $moduleList;
}
if(isset($moduleList['ProductTemplates'])){
$moduleList['Products'] ='Products';
}
foreach($actions as $action_name=>$action){
if(!empty($action['module'])){
$aclModuleList[$action_name] = $action_name;
if(isset($compList[$action_name])){
if($action['module']['access']['aclaccess'] < ACL_ALLOW_ENABLED || $action['module'][$view]['aclaccess'] < 0){
if($by_value){
$disabled[$compList[$action_name]] =$compList[$action_name] ;
}else{
$disabled[$action_name] = $action_name;
}
}
}
}
}
if(isset($compList['Calendar']) && !( ACL_ALLOW_ENABLED == $actions['Calls']['module']['access']['aclaccess'] || ACL_ALLOW_ENABLED == $actions['Meetings']['module']['access']['aclaccess'] || ACL_ALLOW_ENABLED == $actions['Tasks']['module']['access']['aclaccess'])){
if($by_value){
$disabled[$compList['Calendar']] = $compList['Calendar'];
}else{
$disabled['Calendar'] = 'Calendar';
}
if(isset($compList['Activities']) &&!( ACL_ALLOW_ENABLED == $actions['Notes']['module']['access']['aclaccess'] || ACL_ALLOW_ENABLED == $actions['Notes']['module']['access']['aclaccess'] )){
if($by_value){
$disabled[$compList['Activities']] = $compList['Activities'];
}else{
$disabled['Activities'] = 'Activities';
}
}
}
if(isset($disabled['Products'])){
$disabled['ProductTemplates'] = 'ProductTemplates';
}
return $disabled;
}
function addJavascript($category,$form_name='', $is_owner=false){
$jscontroller = new ACLJSController($category, $form_name, $is_owner);
echo $jscontroller->getJavascript();
}
function moduleSupportsACL($module){
static $checkModules = array();
global $beanFiles, $beanList;
if(isset($checkModules[$module])){
return $checkModules[$module];
}
if(!isset($beanList[$module])){
$checkModules[$module] = false;
}else{
$class = $beanList[$module];
require_once($beanFiles[$class]);
$mod = new $class();
if(!is_subclass_of($mod, 'SugarBean')){
$checkModules[$module] = false;
}else{
$checkModules[$module] = $mod->bean_implements('ACL');
}
}
return $checkModules[$module] ;
}
function displayNoAccess($redirect_home = false){
echo '<script>function set_focus(){}</script><p class="error" style="color:red;">' . translate('LBL_NO_ACCESS', 'ACL') . '</p>';
if($redirect_home)echo 'Redirect to Home in <span id="seconds_left">3</span> seconds<script> function redirect_countdown(left){document.getElementById("seconds_left").innerHTML = left; if(left == 0){document.location.href = "index.php";}else{left--; setTimeout("redirect_countdown("+ left+")", 1000)}};setTimeout("redirect_countdown(3)", 1000)</script>';
}
}
?>

177
modules/ACL/ACLJSController.php Executable file
View File

@@ -0,0 +1,177 @@
<?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 ACLJSController{
function ACLJSController($module,$form='', $is_owner=false){
$this->module = $module;
$this->is_owner = $is_owner;
$this->form = $form;
}
function getJavascript(){
global $action;
if(!ACLController::moduleSupportsACL($this->module)){
return '';
}
$script = "<SCRIPT>\n//BEGIN ACL JAVASCRIPT\n";
if($action == 'DetailView'){
if(!ACLController::checkAccess($this->module,'edit', $this->is_owner)){
$script .= <<<EOQ
if(typeof(document.DetailView) != 'undefined'){
if(typeof(document.DetailView.elements['Edit']) != 'undefined'){
document.DetailView.elements['Edit'].disabled = 'disabled';
}
if(typeof(document.DetailView.elements['Duplicate']) != 'undefined'){
document.DetailView.elements['Duplicate'].disabled = 'disabled';
}
}
EOQ;
}
if(!ACLController::checkAccess($this->module,'delete', $this->is_owner)){
$script .= <<<EOQ
if(typeof(document.DetailView) != 'undefined'){
if(typeof(document.DetailView.elements['Delete']) != 'undefined'){
document.DetailView.elements['Delete'].disabled = 'disabled';
}
}
EOQ;
}
}
if(file_exists('modules/'. $this->module . '/metadata/acldefs.php')){
include('modules/'. $this->module . '/metadata/acldefs.php');
foreach($acldefs[$this->module]['forms'] as $form_name=>$form){
foreach($form as $field_name=>$field){
if($field['app_action'] == $action){
switch($form_name){
case 'by_id':
$script .= $this->getFieldByIdScript($field_name, $field);
break;
case 'by_name':
$script .= $this->getFieldByNameScript($field_name, $field);
break;
default:
$script .= $this->getFieldByFormScript($form_name, $field_name, $field);
break;
}
}
}
}
}
$script .= '</SCRIPT>';
return $script;
}
function getHTMLValues($def){
$return_array = array();
switch($def['display_option']){
case 'clear_link':
$return_array['href']= "#";
$return_array['className']= "nolink";
break;
default;
$return_array[$def['display_option']] = $def['display_option'];
break;
}
return $return_array;
}
function getFieldByIdScript($name, $def){
$script = '';
if(!ACLController::checkAccess($def['module'], $def['action_option'], true)){
foreach($this->getHTMLValues($def) as $key=>$value){
$script .= "\nif(document.getElementById('$name'))document.getElementById('$name')." . $key . '="' .$value. '";'. "\n";
}
}
return $script;
}
function getFieldByNameScript($name, $def){
$script = '';
if(!ACLController::checkAccess($def['module'], $def['action_option'], true)){
foreach($this->getHTMLValues($def) as $key=>$value){
$script .= <<<EOQ
var aclfields = document.getElementsByName('$name');
for(var i in aclfields){
aclfields[i].$key = '$value';
}
EOQ;
}
}
return $script;
}
function getFieldByFormScript($form, $name, $def){
$script = '';
if(!ACLController::checkAccess($def['module'], $def['action_option'], true)){
foreach($this->getHTMLValues($def) as $key=>$value){
$script .= "\nif(typeof(document.$form.$name.$key) != 'undefined')\n document.$form.$name.".$key . '="' .$value. '";';
}
}
return $script;
}
}
?>

0
modules/ACL/Forms.php Executable file
View File

45
modules/ACL/List.php Executable file
View File

@@ -0,0 +1,45 @@
<?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".
********************************************************************************/
if($_REQUEST['submodule'] == 'Roles'){
require_once('modules/ACL/Roles/ListView.php');
}
if($_REQUEST['submodule'] == 'Users'){
require_once('modules/ACL/Roles/ListUsers.php');
}
?>

43
modules/ACL/Menu.php Executable file
View File

@@ -0,0 +1,43 @@
<?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;
$module_menu = Array(
Array("index.php?module=ACLRoles&action=index", $mod_strings['LIST_ROLES'],"Roles"),
Array("index.php?module=ACLRoles&action=ListUsers", $mod_strings['LIST_ROLES_BY_USER'],"Roles"),
);
?>

39
modules/ACL/Save.php Executable file
View File

@@ -0,0 +1,39 @@
<?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('modules/ACL/Roles/Save.php');
?>

75
modules/ACL/install_actions.php Executable file
View File

@@ -0,0 +1,75 @@
<?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 $current_user,$beanList, $beanFiles, $mod_strings;
$installed_classes = array();
$ACLbeanList=$beanList;
if(is_admin($current_user)){
foreach($ACLbeanList as $module=>$class){
if(empty($installed_classes[$class]) && isset($beanFiles[$class]) && file_exists($beanFiles[$class])){
if($class == 'Tracker'){
} else {
require_once($beanFiles[$class]);
$mod = new $class();
if($mod->bean_implements('ACL') && empty($mod->acl_display_only)){
// BUG 10339: do not display messages for upgrade wizard
if(!isset($_REQUEST['upgradeWizard'])){
echo translate('LBL_ADDING','ACL','') . $mod->module_dir . '<br>';
}
if(!empty($mod->acltype)){
ACLAction::addActions($mod->module_dir, $mod->acltype);
}else{
ACLAction::addActions($mod->module_dir);
}
$installed_classes[$class] = true;
}
}
}
}
}
?>

View File

@@ -0,0 +1,52 @@
<?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_ALLOW_ALL'=>'All',
'LBL_ALLOW_NONE'=>'None',
'LBL_ALLOW_OWNER'=>'Owner',
'LBL_ROLE'=>'Role',
'LBL_NAME'=>'Name',
'LBL_DESCRIPTION'=>'Description',
'LIST_ROLES'=>'List Roles',
'LBL_USERS_SUBPANEL_TITLE'=>'Users',
'LIST_ROLES_BY_USER'=>'List Roles By User',
'LBL_ROLES_SUBPANEL_TITLE'=>'User Roles',
'LBL_SEARCH_FORM_TITLE'=>'Search',
'LBL_NO_ACCESS'=>'You do not have access to this area. Contact your site administrator to obtain access.',
'LBL_ADDING'=>'Adding for ',
)
?>

View File

@@ -0,0 +1,47 @@
<?PHP
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* The contents of this file are subject to the SugarCRM Public License Version
* 1.1.3 ("License"); You may not use this file except in compliance with the
* License. You may obtain a copy of the License at http://www.sugarcrm.com/SPL
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* 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.
*
* The Original Code is: SugarCRM Open Source
* The Initial Developer of the Original Code is SugarCRM, Inc.
* Portions created by SugarCRM are Copyright (C) 2004-2005 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): ______________________________________..
********************************************************************************/
$mod_strings = array (
'LBL_ALLOW_ALL'=>'Wszystko',
'LBL_ALLOW_NONE'=>'Nic',
'LBL_ALLOW_OWNER'=>'Właściciel',
'LBL_ROLE'=>'Zależność',
'LBL_NAME'=>'Nazwa',
'LBL_DESCRIPTION'=>'Opis',
'LIST_ROLES'=>'Lista zależności',
'LBL_USERS_SUBPANEL_TITLE'=>'Użytkownicy',
'LIST_ROLES_BY_USER'=>'Lista Zalezności użytkowników',
'LBL_ROLES_SUBPANEL_TITLE'=>'Zależności użytkowników',
'LBL_SEARCH_FORM_TITLE'=>'Szukaj',
'LBL_NO_ACCESS'=>'Nie masz dostępu do tej części systemu. Skontaktuj się z administratorem, jeśli sądzisz, że powinieneś mieć.',
'LBL_ADDING'=>'Dodano dla ',
)
?>

View File

@@ -0,0 +1,72 @@
<?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".
********************************************************************************/
$layout_defs['ACL'] = array(
// sets up which panels to show, in which order, and with what linked_fields
'subpanel_setup' => array(
'users' => array(
'top_buttons' => array( array('widget_class' => 'SubPanelTopSubModuleSelectButton', 'popup_module' => 'Users'),),
'order' => 20,
'module' => 'Users',
'subpanel_name' => 'ForSubModules',
'get_subpanel_data' => 'users',
'add_subpanel_data' => 'user_id',
'title_key' => 'LBL_USERS_SUBPANEL_TITLE',
),
),
);
$layout_defs['UserRoles'] = array(
// sets up which panels to show, in which order, and with what linked_fields
'subpanel_setup' => array(
'acl' => array(
'top_buttons' => array(array('widget_class' => 'SubPanelTopSubModuleSelectButton', 'popup_module' => 'ACL'),),
'order' => 20,
'module' => 'ACL',
'subpanel_def_path'=>'modules/ACL/Roles/subpanels/default.php',
'subpanel_name' => 'default',
'get_subpanel_data' => 'roles',
'add_subpanel_data' => 'role_id',
'title_key' => 'LBL_ROLES_SUBPANEL_TITLE',
),
),
);
?>

57
modules/ACL/remove_actions.php Executable file
View File

@@ -0,0 +1,57 @@
<?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 $current_user,$beanList, $beanFiles;
$actionarr = ACLAction::getDefaultActions();
if(is_admin($current_user)){
$foundOne = false;
foreach($actionarr as $actionobj){
if(!isset($beanList[$actionobj->category]) || !file_exists($beanFiles[$beanList[$actionobj->category]])){
if(!isset($_REQUEST['upgradeWizard'])){
echo 'Removing for ' . $actionobj->category . '<br>';
}
$foundOne = true;
ACLAction::removeActions($actionobj->category);
}
}
if(!$foundOne)
echo 'No ACL modules found that needed to be removed';
}
?>

40
modules/ACL/vardefs.php Executable file
View File

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

509
modules/ACLActions/ACLAction.php Executable file
View File

@@ -0,0 +1,509 @@
<?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('modules/ACLActions/actiondefs.php');
class ACLAction extends SugarBean{
var $module_dir = 'ACLActions';
var $object_name = 'ACLAction';
var $table_name = 'acl_actions';
var $new_schema = true;
function ACLAction(){
parent::SugarBean();
}
/**
* static addActions($category, $type='module')
* Adds all default actions for a category/type
*
* @param STRING $category - the category (e.g module name - Accounts, Contacts)
* @param STRING $type - the type (e.g. 'module', 'field')
*/
function addActions($category, $type='module'){
global $ACLActions;
$db = DBManagerFactory::getInstance();
if(isset($ACLActions[$type])){
foreach($ACLActions[$type]['actions'] as $action_name =>$action_def){
$action = new ACLAction();
$query = "SELECT * FROM " . $action->table_name . " WHERE name='$action_name' AND category = '$category' AND acltype='$type' AND deleted=0 ";
$result = $db->query($query);
//only add if an action with that name and category don't exist
$row=$db->fetchByAssoc($result);
if ($row == null) {
$action->name = $action_name;
$action->category = $category;
$action->aclaccess = $action_def['default'];
$action->acltype = $type;
$action->modified_user_id = 1;
$action->created_by = 1;
$action->save();
}
}
}else{
sugar_die("FAILED TO ADD: $category : $name - TYPE $type NOT DEFINED IN modules/ACLActions/actiondefs.php");
}
}
/**
* static removeActions($category, $type='module')
* Removes all default actions for a category/type
*
* @param STRING $category - the category (e.g module name - Accounts, Contacts)
* @param STRING $type - the type (e.g. 'module', 'field')
*/
function removeActions($category, $type='module'){
global $ACLActions;
$db = DBManagerFactory::getInstance();
if(isset($ACLActions[$type])){
foreach($ACLActions[$type]['actions'] as $action_name =>$action_def){
$action = new ACLAction();
$query = "SELECT * FROM " . $action->table_name . " WHERE name='$action_name' AND category = '$category' AND acltype='$type' and deleted=0";
$result = $db->query($query);
//only add if an action with that name and category don't exist
$row=$db->fetchByAssoc($result);
if ($row != null) {
$action->mark_deleted($row['id']);
}
}
}else{
sugar_die("FAILED TO REMOVE: $category : $name - TYPE $type NOT DEFINED IN modules/ACLActions/actiondefs.php");
}
}
/**
* static AccessColor($access)
*
* returns the color associated with an access level
* these colors exist in the definitions in modules/ACLActions/actiondefs.php
* @param INT $access - the access level you want the color for
* @return the color either name or hex representation or false if the level does not exist
*/
function AccessColor($access){
global $ACLActionAccessLevels;
if(isset($ACLActionAccessLevels[$access])){
return $ACLActionAccessLevels[$access]['color'];
}
return false;
}
/**
* static AccessName($access)
*
* returns the translated name associated with an access level
* these label definitions exist in the definitions in modules/ACLActions/actiondefs.php
* @param INT $access - the access level you want the color for
* @return the translated access level name or false if the level does not exist
*/
function AccessName($access){
global $ACLActionAccessLevels;
if(isset($ACLActionAccessLevels[$access])){
return translate($ACLActionAccessLevels[$access]['label'], 'ACLActions');
}
return false;
}
/**
* static AccessLabel($access)
*
* returns the label associated with an access level
* these label definitions exist in the definitions in modules/ACLActions/actiondefs.php
* @param INT $access - the access level you want the color for
* @return the access level label or false if the level does not exist
*/
function AccessLabel($access){
global $ACLActionAccessLevels;
if(isset($ACLActionAccessLevels[$access])){
$label=preg_replace('/(LBL_ACCESS_)(.*)/', '$2', $ACLActionAccessLevels[$access]['label']);
return strtolower($label);
}
return false;
}
/**
* static getAccessOptions()
* this is used for building select boxes
* @return array containg access levels (ints) as keys and access names as values
*/
function getAccessOptions( $action, $type='module'){
global $ACLActions;
$options = array();
if(empty($ACLActions[$type]['actions'][$action]['aclaccess']))return $options;
foreach($ACLActions[$type]['actions'][$action]['aclaccess'] as $action){
$options[$action] = ACLAction::AccessName($action);
}
return $options;
}
/**
* function static getDefaultActions()
* This function will return a list of acl actions with their default access levels
*
*
*/
function getDefaultActions($type='module', $action=''){
$query = "SELECT * FROM acl_actions WHERE deleted=0 ";
if(!empty($type)){
$query .= " AND acltype='$type'";
}
if(!empty($action)){
$query .= "AND name='$action'";
}
$query .= " ORDER BY category";
$db = DBManagerFactory::getInstance();
$result = $db->query($query);
$default_actions = array();
while($row = $db->fetchByAssoc($result) ){
$acl = new ACLAction();
$acl->populateFromRow($row);
$default_actions[] = $acl;
}
return $default_actions;
}
/**
* static getUserActions($user_id,$refresh=false, $category='', $action='')
* returns a list of user actions
* @param GUID $user_id
* @param BOOLEAN $refresh
* @param STRING $category
* @param STRING $action
* @return ARRAY of ACLActionsArray
*/
function getUserActions($user_id,$refresh=false, $category='',$type='', $action=''){
//check in the session if we already have it loaded
if(!$refresh && !empty($_SESSION['ACL'][$user_id])){
if(empty($category) && empty($action)){
return $_SESSION['ACL'][$user_id];
}else{
if(!empty($category) && isset($_SESSION['ACL'][$user_id][$category])){
if(empty($action)){
if(empty($type)){
return $_SESSION['ACL'][$user_id][$category];
}
return $_SESSION['ACL'][$user_id][$category][$type];
}else if(!empty($type) && isset($_SESSION['ACL'][$user_id][$category][$type][$action])){
return $_SESSION['ACL'][$user_id][$category][$type][$action];
}
}
}
}
//if we don't have it loaded then lets check against the db
$additional_where = '';
$db = DBManagerFactory::getInstance();
if(!empty($category)){
$additional_where .= " AND $this->table_name.category = '$category' ";
}
if(!empty($action)){
$additional_where .= " AND $this->table_name.name = '$action' ";
}
if(!empty($type)){
$additional_where .= " AND $this->table_name.acltype = '$type' ";
}
$query=null;
if ($db->dbType == 'oci8') {
}
if (empty($query)) {
$query = "SELECT acl_actions .*, acl_roles_actions.access_override
FROM acl_actions
LEFT JOIN acl_roles_users ON acl_roles_users.user_id = '$user_id' AND acl_roles_users.deleted = 0
LEFT JOIN acl_roles_actions ON acl_roles_actions.role_id = acl_roles_users.role_id AND acl_roles_actions.action_id = acl_actions.id AND acl_roles_actions.deleted=0
WHERE acl_actions.deleted=0 $additional_where ORDER BY category,name";
}
$result = $db->query($query);
$selected_actions = array();
while($row = $db->fetchByAssoc($result) ){
$acl = new ACLAction();
$isOverride = false;
$acl->populateFromRow($row);
if(!empty($row['access_override'])){
$acl->aclaccess = $row['access_override'];
$isOverride = true;
}
if(!isset($selected_actions[$acl->category])){
$selected_actions[$acl->category] = array();
}
if(!isset($selected_actions[$acl->category][$acl->acltype][$acl->name])
|| ($selected_actions[$acl->category][$acl->acltype][$acl->name]['aclaccess'] > $acl->aclaccess
&& $isOverride
)
||
(!empty($selected_actions[$acl->category][$acl->acltype][$acl->name]['isDefault'])
&& $isOverride
)
)
{
$selected_actions[$acl->category][$acl->acltype][$acl->name] = $acl->toArray();
$selected_actions[$acl->category][$acl->acltype][$acl->name]['isDefault'] = !$isOverride;
}
}
//only set the session variable if it was a full list;
if(empty($category) && empty($action)){
if(!isset($_SESSION['ACL'])){
$_SESSION['ACL'] = array();
}
$_SESSION['ACL'][$user_id] = $selected_actions;
}else{
if(empty($action) && !empty($category)){
if(!empty($type)){
$_SESSION['ACL'][$user_id][$category][$type] = $selected_actions[$category][$type];}
$_SESSION['ACL'][$user_id][$category] = $selected_actions[$category];
}else{
if(!empty($action) && !empty($category) && !empty($type)){
$_SESSION['ACL'][$user_id][$category][$type][$action] = $selected_actions[$category][$action];
}
}
}
return $selected_actions;
}
/**
* (static/ non-static)function hasAccess($is_owner= false , $access = 0)
* checks if a user has access to this acl if the user is an owner it will check if owners have access
*
* This function may either be used statically or not. If used staticlly a user must pass in an access level not equal to zero
* @param boolean $is_owner
* @param int $access
* @return true or false
*/
function hasAccess($is_owner=false, $access = 0){
if($access != 0 && $access == ACL_ALLOW_ALL || ($is_owner && $access == ACL_ALLOW_OWNER))return true;
if(isset($this) && isset($this->aclaccess)){
if($this->aclaccess == ACL_ALLOW_ALL || ($is_owner && $this->aclaccess == ACL_ALLOW_OWNER))
return true;
}
return false;
}
/**
* static function userHasAccess($user_id, $category, $action, $is_owner = false)
*
* @param GUID $user_id the user id who you want to check access for
* @param STRING $category the category you would like to check access for
* @param STRING $action the action of that category you would like to check access for
* @param BOOLEAN OPTIONAL $is_owner if the object is owned by the user you are checking access for
*/
function userHasAccess($user_id, $category, $action,$type='module', $is_owner = false){
global $current_user;
if(is_admin_for_module($current_user,$category)&& !isset($_SESSION['ACL'][$user_id][$category][$type][$action]['aclaccess'])){
return true;
}
//check if we don't have it set in the cache if not lets reload the cache
if(ACLAction::getUserAccessLevel($user_id, $category, 'access', $type) < ACL_ALLOW_ENABLED) return false;
if(empty($_SESSION['ACL'][$user_id][$category][$type][$action])){
ACLAction::getUserActions($user_id, false);
}
if(!empty($_SESSION['ACL'][$user_id][$category][$type][$action])){
return ACLAction::hasAccess($is_owner, $_SESSION['ACL'][$user_id][$category][$type][$action]['aclaccess']);
}
return false;
}
/**
* function getUserAccessLevel($user_id, $category, $action,$type='module')
* returns the access level for a given category and action
*
* @param GUID $user_id
* @param STRING $category
* @param STRING $action
* @param STRING $type
* @return INT (ACCESS LEVEL)
*/
function getUserAccessLevel($user_id, $category, $action,$type='module'){
if(empty($_SESSION['ACL'][$user_id][$category][$type][$action])){
ACLAction::getUserActions($user_id, false);
}
if(!empty($_SESSION['ACL'][$user_id][$category][$type][$action])){
return $_SESSION['ACL'][$user_id][$category][$type][$action]['aclaccess'];
}
}
/**
* STATIC function userNeedsOwnership($user_id, $category, $action,$type='module')
* checks if a user should have ownership to do an action
*
* @param GUID $user_id
* @param STRING $category
* @param STRING $action
* @param STRING $type
* @return boolean
*/
function userNeedsOwnership($user_id, $category, $action,$type='module'){
//check if we don't have it set in the cache if not lets reload the cache
if(empty($_SESSION['ACL'][$user_id][$category][$type][$action])){
ACLAction::getUserActions($user_id, false);
}
if(!empty($_SESSION['ACL'][$user_id][$category][$type][$action])){
return $_SESSION['ACL'][$user_id][$category][$type][$action]['aclaccess'] == ACL_ALLOW_OWNER;
}
return false;
}
/**
*
* static pass by ref setupCategoriesMatrix(&$categories)
* takes in an array of categories and modifes them adding display information
*
* @param unknown_type $categories
*/
function setupCategoriesMatrix(&$categories){
global $ACLActions, $current_user;
$names = array();
$disabled = array();
foreach($categories as $cat_name=>$category){
foreach($category as $type_name=>$type){
foreach($type as $act_name=>$action){
$names[$act_name] = translate($ACLActions[$type_name]['actions'][$act_name]['label'], 'ACLActions');
$categories[$cat_name][$type_name][$act_name]['accessColor'] = ACLAction::AccessColor($action['aclaccess']);
if($type_name== 'module'){
if($act_name != 'aclaccess' && $categories[$cat_name]['module']['access']['aclaccess'] == ACL_ALLOW_DISABLED){
$categories[$cat_name][$type_name][$act_name]['accessColor'] = 'darkgray';
$disabled[] = $cat_name;
}
}
$categories[$cat_name][$type_name][$act_name]['accessName'] = ACLAction::AccessName($action['aclaccess']);
$categories[$cat_name][$type_name][$act_name]['accessLabel'] = ACLAction::AccessLabel($action['aclaccess']);
if($cat_name=='Users'&& $act_name=='admin'){
$categories[$cat_name][$type_name][$act_name]['accessOptions'][ACL_ALLOW_DEFAULT]=ACLAction::AccessName(ACL_ALLOW_DEFAULT);;
$categories[$cat_name][$type_name][$act_name]['accessOptions'][ACL_ALLOW_DEV]=ACLAction::AccessName(ACL_ALLOW_DEV);;
}
else{
$categories[$cat_name][$type_name][$act_name]['accessOptions'] = ACLAction::getAccessOptions($act_name, $type_name);
}
}
}
}
if(!is_admin($current_user)){
foreach($disabled as $cat_name){
unset($categories[$cat_name]);
}
}
return $names;
}
/**
* function toArray()
* returns this acl as an array
*
* @return array of fields with id, name, access and category
*/
function toArray(){
$array_fields = array('id', 'aclaccess');
$arr = array();
foreach($array_fields as $field){
$arr[$field] = $this->$field;
}
return $arr;
}
/**
* function fromArray($arr)
* converts an array into an acl mapping name value pairs into files
*
* @param Array $arr
*/
function fromArray($arr){
foreach($arr as $name=>$value){
$this->$name = $value;
}
}
/**
* function clearSessionCache()
* clears the session variable storing the cache information for acls
*
*/
function clearSessionCache(){
unset($_SESSION['ACL']);
}
}
?>

0
modules/ACLActions/Forms.php Executable file
View File

43
modules/ACLActions/Menu.php Executable file
View File

@@ -0,0 +1,43 @@
<?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;
$module_menu = Array(
Array("index.php?module=ACLRoles&action=index", $mod_strings['LIST_ROLES'],"Roles"),
Array("index.php?module=ACLRoles&action=ListUsers", $mod_strings['LIST_ROLES_BY_USER'],"Roles"),
);
?>

125
modules/ACLActions/actiondefs.php Executable file
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".
********************************************************************************/
if(!defined('ACL_ALLOW_NONE')){
define('ACL_ALLOW_ADMIN_DEV', 100);
define('ACL_ALLOW_ADMIN', 99);
define('ACL_ALLOW_ALL', 90);
define('ACL_ALLOW_ENABLED', 89);
define('ACL_ALLOW_OWNER', 75);
define('ACL_ALLOW_NORMAL', 1);
define('ACL_ALLOW_DEFAULT', 0);
define('ACL_ALLOW_DISABLED', -98);
define('ACL_ALLOW_NONE', -99);
define('ACL_ALLOW_DEV', 95);
}
/**
* $GLOBALS['ACLActionAccessLevels
* these are rendering descriptions for Access Levels giving information such as the label, color, and text color to use when rendering the access level
*/
$GLOBALS['ACLActionAccessLevels'] = array(
ACL_ALLOW_ALL=>array('color'=>'#008000', 'label'=>'LBL_ACCESS_ALL', 'text_color'=>'white'),
ACL_ALLOW_OWNER=>array('color'=>'#6F6800', 'label'=>'LBL_ACCESS_OWNER', 'text_color'=>'white'),
ACL_ALLOW_NONE=>array('color'=>'#FF0000', 'label'=>'LBL_ACCESS_NONE', 'text_color'=>'white'),
ACL_ALLOW_ENABLED=>array('color'=>'#008000', 'label'=>'LBL_ACCESS_ENABLED', 'text_color'=>'white'),
ACL_ALLOW_DISABLED=>array('color'=>'#FF0000', 'label'=>'LBL_ACCESS_DISABLED', 'text_color'=>'white'),
ACL_ALLOW_ADMIN=>array('color'=>'#0000FF', 'label'=>'LBL_ACCESS_ADMIN', 'text_color'=>'white'),
ACL_ALLOW_NORMAL=>array('color'=>'#008000', 'label'=>'LBL_ACCESS_NORMAL', 'text_color'=>'white'),
ACL_ALLOW_DEFAULT=>array('color'=>'#008000', 'label'=>'LBL_ACCESS_DEFAULT', 'text_color'=>'white'),
ACL_ALLOW_DEV=>array('color'=>'#0000FF', 'label'=>'LBL_ACCESS_DEV', 'text_color'=>'white'),
ACL_ALLOW_ADMIN_DEV=>array('color'=>'#0000FF', 'label'=>'LBL_ACCESS_ADMIN_DEV', 'text_color'=>'white'),
);
/**
* $GLOBALS['ACLActions
* These are the actions for a given type. It includes the ACCESS Levels for that action and the label for that action. Every an object of the category (e.g. module) is added all associated actions are added for that object
*/
$GLOBALS['ACLActions'] = array(
'module'=>array('actions'=>
array(
'access'=>
array(
'aclaccess'=>array(ACL_ALLOW_ENABLED,ACL_ALLOW_DEFAULT, ACL_ALLOW_DISABLED),
'label'=>'LBL_ACTION_ACCESS',
'default'=>ACL_ALLOW_ENABLED,
),
'view'=>
array(
'aclaccess'=>array(ACL_ALLOW_ALL,ACL_ALLOW_OWNER,ACL_ALLOW_DEFAULT, ACL_ALLOW_NONE),
'label'=>'LBL_ACTION_VIEW',
'default'=>ACL_ALLOW_ALL,
),
'list'=>
array(
'aclaccess'=>array(ACL_ALLOW_ALL,ACL_ALLOW_OWNER,ACL_ALLOW_DEFAULT, ACL_ALLOW_NONE),
'label'=>'LBL_ACTION_LIST',
'default'=>ACL_ALLOW_ALL,
),
'edit'=>
array(
'aclaccess'=>array(ACL_ALLOW_ALL,ACL_ALLOW_OWNER,ACL_ALLOW_DEFAULT, ACL_ALLOW_NONE),
'label'=>'LBL_ACTION_EDIT',
'default'=>ACL_ALLOW_ALL,
),
'delete'=>
array(
'aclaccess'=>array(ACL_ALLOW_ALL,ACL_ALLOW_OWNER,ACL_ALLOW_DEFAULT, ACL_ALLOW_NONE),
'label'=>'LBL_ACTION_DELETE',
'default'=>ACL_ALLOW_ALL,
),
'import'=>
array(
'aclaccess'=>array(ACL_ALLOW_ALL,ACL_ALLOW_DEFAULT, ACL_ALLOW_NONE),
'label'=>'LBL_ACTION_IMPORT',
'default'=>ACL_ALLOW_ALL,
),
'export'=>
array(
'aclaccess'=>array(ACL_ALLOW_ALL,ACL_ALLOW_OWNER,ACL_ALLOW_DEFAULT, ACL_ALLOW_NONE),
'label'=>'LBL_ACTION_EXPORT',
'default'=>ACL_ALLOW_ALL,
),
),),
);
?>

View File

@@ -0,0 +1,64 @@
<?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_ACCESS_ALL'=>'All',
'LBL_ACCESS_NONE'=>'None',
'LBL_ACCESS_OWNER'=>'Owner',
'LBL_ACCESS_NORMAL'=>'Normal',
'LBL_ACCESS_ADMIN'=>'Admin',
'LBL_ACCESS_ENABLED'=>'Enabled',
'LBL_ACCESS_DISABLED'=>'Disabled',
'LBL_ACCESS_DEV'=>'Developer',
'LBL_ACCESS_ADMIN_DEV'=>'Admin & Developer',
'LBL_NAME'=>'Name',
'LBL_DESCRIPTION'=>'Description',
'LIST_ROLES'=>'List Roles',
'LBL_USERS_SUBPANEL_TITLE'=>'Users',
'LIST_ROLES_BY_USER'=>'List Roles By User',
'LBL_ROLES_SUBPANEL_TITLE'=>'User Roles',
'LBL_SEARCH_FORM_TITLE'=>'Search',
'LBL_ACTION_VIEW'=>'View',
'LBL_ACTION_EDIT'=>'Edit',
'LBL_ACTION_DELETE'=>'Delete',
'LBL_ACTION_IMPORT'=>'Import',
'LBL_ACTION_EXPORT'=>'Export',
'LBL_ACTION_LIST'=>'List',
'LBL_ACTION_ACCESS'=>'Access',
'LBL_ACTION_ADMIN'=>'Access Type',
'LBL_ACCESS_DEFAULT'=>'Not Set',
)
?>

View File

@@ -0,0 +1,59 @@
<?PHP
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* The contents of this file are subject to the SugarCRM Public License Version
* 1.1.3 ("License"); You may not use this file except in compliance with the
* License. You may obtain a copy of the License at http://www.sugarcrm.com/SPL
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* 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.
*
* The Original Code is: SugarCRM Open Source
* The Initial Developer of the Original Code is SugarCRM, Inc.
* Portions created by SugarCRM are Copyright (C) 2004-2005 SugarCRM, Inc.;
* All Rights Reserved.
* Contributor(s): ______________________________________.
********************************************************************************/
/*********************************************************************************
* pl_pl.lang.ext.php,v for SugarCRM 4.5-->>
* Translator: Krzysztof Morawski
* All Rights Reserved.
* Any bugs report welcome: krzysiek<at>kmmgroup<dot>pl
* Contributor(s): ______________________________________..
********************************************************************************/
$mod_strings = array (
'LBL_ACCESS_ALL'=>'Wszyscy',
'LBL_ACCESS_NONE'=>'Żaden',
'LBL_ACCESS_OWNER'=>'Właściciel',
'LBL_ACCESS_NORMAL'=>'Normalne',
'LBL_ACCESS_ADMIN'=>'Administrator',
'LBL_ACCESS_ENABLED'=>'Włączone',
'LBL_ACCESS_DISABLED'=>'Wyłączone',
'LBL_ACCESS_DEV'=>'Programista',
'LBL_ACCESS_ADMIN_DEV'=>'Admin & Programista',
'LBL_NAME'=>'Nazwa',
'LBL_DESCRIPTION'=>'Opis',
'LIST_ROLES'=>'Lista zależności',
'LBL_USERS_SUBPANEL_TITLE'=>'Użytkownicy',
'LIST_ROLES_BY_USER'=>'Lista ról użytkowników',
'LBL_ROLES_SUBPANEL_TITLE'=>'ról użytkowników',
'LBL_SEARCH_FORM_TITLE'=>'Szukaj',
'LBL_ACTION_VIEW'=>'Widok',
'LBL_ACTION_EDIT'=>'Edytuj',
'LBL_ACTION_DELETE'=>'Usuń',
'LBL_ACTION_IMPORT'=>'Import',
'LBL_ACTION_EXPORT'=>'Eksport',
'LBL_ACTION_LIST'=>'Lista',
'LBL_ACTION_ACCESS'=>'Dostęp',
'LBL_ACTION_ADMIN'=>'Typ dostępu',
'LBL_ACCESS_DEFAULT'=>'Nie określono',
)
?>

View File

@@ -0,0 +1,72 @@
<?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".
********************************************************************************/
$layout_defs['ACL'] = array(
// sets up which panels to show, in which order, and with what linked_fields
'subpanel_setup' => array(
'users' => array(
'top_buttons' => array( array('widget_class' => 'SubPanelTopSubModuleSelectButton', 'popup_module' => 'Users'),),
'order' => 20,
'module' => 'Users',
'subpanel_name' => 'ForSubModules',
'get_subpanel_data' => 'users',
'add_subpanel_data' => 'user_id',
'title_key' => 'LBL_USERS_SUBPANEL_TITLE',
),
),
);
$layout_defs['UserRoles'] = array(
// sets up which panels to show, in which order, and with what linked_fields
'subpanel_setup' => array(
'acl' => array(
'top_buttons' => array(array('widget_class' => 'SubPanelTopSubModuleSelectButton', 'popup_module' => 'ACL'),),
'order' => 20,
'module' => 'ACL',
'subpanel_def_path'=>'modules/ACL/Roles/subpanels/default.php',
'subpanel_name' => 'default',
'get_subpanel_data' => 'roles',
'add_subpanel_data' => 'role_id',
'title_key' => 'LBL_ROLES_SUBPANEL_TITLE',
),
),
);
?>

153
modules/ACLActions/vardefs.php Executable file
View File

@@ -0,0 +1,153 @@
<?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['ACLAction'] = array('table' => 'acl_actions', 'comment' => 'Determine the allowable actions available to users'
,'fields' => array (
'id' =>
array (
'name' => 'id',
'vname' => 'LBL_ID',
'required'=>true,
'type' => 'id',
'reportable'=>false,
'comment' => 'Unique identifier'
),
'date_entered' =>
array (
'name' => 'date_entered',
'vname' => 'LBL_DATE_ENTERED',
'type' => 'datetime',
'required'=>true,
'comment' => 'Date record created'
),
'date_modified' =>
array (
'name' => 'date_modified',
'vname' => 'LBL_DATE_MODIFIED',
'type' => 'datetime',
'required'=>true,
'comment' => 'Date record last modified'
),
'modified_user_id' =>
array (
'name' => 'modified_user_id',
'rname' => 'user_name',
'id_name' => 'modified_user_id',
'vname' => 'LBL_MODIFIED',
'type' => 'assigned_user_name',
'table' => 'modified_user_id_users',
'isnull' => 'false',
'dbType' => 'id',
'required'=> false,
'len' => 36,
'reportable'=>true,
'comment' => 'User who last modified record'
),
'created_by' =>
array (
'name' => 'created_by',
'rname' => 'user_name',
'id_name' => 'created_by',
'vname' => 'LBL_CREATED',
'type' => 'assigned_user_name',
'table' => 'created_by_users',
'isnull' => 'false',
'dbType' => 'id',
'len' => 36,
'comment' => 'User ID who created record'
),
'name' =>
array (
'name' => 'name',
'type' => 'varchar',
'vname' => 'LBL_NAME',
'len' => 150,
'comment' => 'Name of the allowable action (view, list, delete, edit)'
),
'category' =>
array (
'name' => 'category',
'vname' => 'LBL_CATEGORY',
'type' => 'varchar',
'len' =>100,
'reportable'=>true,
'comment' => 'Category of the allowable action (usually the name of a module)'
),
'acltype' =>
array (
'name' => 'acltype',
'vname' => 'LBL_TYPE',
'type' => 'varchar',
'len' =>100,
'reportable'=>true,
'comment' => 'Specifier for Category, usually "module"'
),
'aclaccess' =>
array (
'name' => 'aclaccess',
'vname' => 'LBL_ACCESS',
'type' => 'int',
'len'=>3,
'reportable'=>true,
'comment' => 'Number specifying access priority; highest access "wins"'
),
'deleted' =>
array (
'name' => 'deleted',
'vname' => 'LBL_DELETED',
'type' => 'bool',
'reportable'=>false,
'comment' => 'Record deletion indicator'
),
'roles' =>
array (
'name' => 'roles',
'type' => 'link',
'relationship' => 'acl_roles_actions',
'source'=>'non-db',
'vname'=>'LBL_USERS',
),
),
'indices' => array (
array('name' =>'aclactionid', 'type' =>'primary', 'fields'=>array('id')),
array('name' =>'idx_aclaction_id_del', 'type' =>'index', 'fields'=>array('id', 'deleted')),
array('name' =>'idx_category_name', 'type' =>'index', 'fields'=>array('category', 'name')), )
);
?>

View File

@@ -0,0 +1,41 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* The contents of this file are subject to the SugarCRM Professional Subscription
* Agreement ("License") which can be viewed at
* http://www.sugarcrm.com/crm/products/sugar-professional-eula.html
* By installing or using this file, You have unconditionally agreed to the
* terms and conditions of the License, and You may not use this file except in
* compliance with the License. Under the terms of the license, You shall not,
* among other things: 1) sublicense, resell, rent, lease, redistribute, assign
* or otherwise transfer Your rights to the Software, and 2) use the Software
* for timesharing or service bureau purposes such as hosting the Software for
* commercial gain and/or for the benefit of a third party. Use of the Software
* may be subject to applicable fees and any use of the Software without first
* paying applicable fees is strictly prohibited. You do not have the right to
* remove SugarCRM copyrights from the source code or user interface.
*
* All copies of the Covered Code must include on each user interface screen:
* (i) the "Powered by SugarCRM" logo and
* (ii) the SugarCRM copyright notice
* in the same form as they appear in the distribution. See full license for
* requirements.
*
* Your Warranty, Limitations of liability and Indemnity are expressly stated
* in the License. Please refer to the License for the specific language
* governing these rights and limitations under the License. Portions created
* by SugarCRM are Copyright (C) 2004-2007 SugarCRM, Inc.; All Rights Reserved.
********************************************************************************/
$mod_strings = array (
'LBL_DEFAULT'=>'Nie ustawiono',
'LBL_READ_WRITE'=>'Odczyt/Zapis',
'LBL_READ_OWNER_WRITE'=>'Odczyt/Właściciel Zapis',
'LBL_READ_ONLY'=>'Tylko do Odczytu',
'LBL_OWNER_READ_WRITE'=>'Odczyt/Właściciel Odczyt/Zapis',
'LBL_ALLOW_NONE'=>'Nic',
'LBL_FIELDS'=>'Pole praw',
)
?>

274
modules/ACLRoles/ACLRole.php Executable file
View File

@@ -0,0 +1,274 @@
<?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 ACLRole extends SugarBean{
var $module_dir = 'ACLRoles';
var $object_name = 'ACLRole';
var $table_name = 'acl_roles';
var $new_schema = true;
var $disable_row_level_security = true;
var $relationship_fields = array(
'user_id'=>'users'
);
var $created_by;
function ACLRole(){
parent::SugarBean();
}
// bug 16790 - missing get_summary_text method led Tracker to display SugarBean's "base implementation"
function get_summary_text()
{
return "$this->name";
}
/**
* function setAction($role_id, $action_id, $access)
*
* Sets the relationship between a role and an action and sets the access level of that relationship
*
* @param GUID $role_id - the role id
* @param GUID $action_id - the ACL Action id
* @param int $access - the access level ACL_ALLOW_ALL ACL_ALLOW_NONE ACL_ALLOW_OWNER...
*/
function setAction($role_id, $action_id, $access){
$relationship_data = array('role_id'=>$role_id, 'action_id'=>$action_id,);
$additional_data = array('access_override'=>$access);
$this->set_relationship('acl_roles_actions',$relationship_data,true, true,$additional_data);
}
/**
* static getUserRoles($user_id)
* returns a list of ACLRoles for a given user id
*
* @param GUID $user_id
* @return a list of ACLRole objects
*/
function getUserRoles($user_id, $getAsNameArray = true){
//if we don't have it loaded then lets check against the db
$additional_where = '';
$query = "SELECT acl_roles.* ".
"FROM acl_roles ".
"INNER JOIN acl_roles_users ON acl_roles_users.user_id = '$user_id' ".
"AND acl_roles_users.role_id = acl_roles.id AND acl_roles_users.deleted = 0 ".
"WHERE acl_roles.deleted=0 ";
$result = $GLOBALS['db']->query($query);
$user_roles = array();
while($row = $GLOBALS['db']->fetchByAssoc($result) ){
$role = new ACLRole();
$role->populateFromRow($row);
if($getAsNameArray)
$user_roles[] = $role->name;
else
$user_roles[] = $role;
}
return $user_roles;
}
/**
* static getUserRoleNames($user_id)
* returns a list of Role names for a given user id
*
* @param GUID $user_id
* @return a list of ACLRole Names
*/
function getUserRoleNames($user_id){
$user_roles = sugar_cache_retrieve("RoleMembershipNames_".$user_id);
if(!$user_roles){
//if we don't have it loaded then lets check against the db
$additional_where = '';
$query = "SELECT acl_roles.* ".
"FROM acl_roles ".
"INNER JOIN acl_roles_users ON acl_roles_users.user_id = '$user_id' ".
"AND acl_roles_users.role_id = acl_roles.id AND acl_roles_users.deleted = 0 ".
"WHERE acl_roles.deleted=0 ";
$result = $GLOBALS['db']->query($query);
$user_roles = array();
while($row = $GLOBALS['db']->fetchByAssoc($result) ){
$user_roles[] = $row['name'];
}
sugar_cache_put("RoleMembershipNames_".$user_id, $user_roles);
}
return $user_roles;
}
/**
* static getAllRoles($returnAsArray = false)
*
* @param boolean $returnAsArray - should it return the results as an array of arrays or as an array of ACLRoles
* @return either an array of array representations of acl roles or an array of ACLRoles
*/
function getAllRoles($returnAsArray = false){
$db = DBManagerFactory::getInstance();
$query = "SELECT acl_roles.* FROM acl_roles
WHERE acl_roles.deleted=0 ORDER BY name";
$result = $db->query($query);
$roles = array();
while($row = $db->fetchByAssoc($result) ){
$role = new ACLRole();
$role->populateFromRow($row);
if($returnAsArray){
$roles[] = $role->toArray();
}else{
$roles[] = $role;
}
}
return $roles;
}
/**
* static getRoleActions($role_id)
*
* gets the actions of a given role
*
* @param GUID $role_id
* @return array of actions
*/
function getRoleActions($role_id, $type='module'){
global $beanList;
//if we don't have it loaded then lets check against the db
$additional_where = '';
$db = DBManagerFactory::getInstance();
$query = "SELECT acl_actions.*";
//only if we have a role id do we need to join the table otherwise lets use the ones defined in acl_actions as the defaults
if(!empty($role_id)){
$query .=" ,acl_roles_actions.access_override ";
}
$query .=" FROM acl_actions ";
if(!empty($role_id)){
$query .= " LEFT JOIN acl_roles_actions ON acl_roles_actions.role_id = '$role_id' AND acl_roles_actions.action_id = acl_actions.id AND acl_roles_actions.deleted = 0";
}
$query .= " WHERE acl_actions.deleted=0 ORDER BY acl_actions.category, acl_actions.name";
$result = $db->query($query);
$role_actions = array();
while($row = $db->fetchByAssoc($result) ){
$action = new ACLAction();
$action->populateFromRow($row);
if(!empty($row['access_override'])){
$action->aclaccess = $row['access_override'];
}else{
$action->aclaccess = ACL_ALLOW_DEFAULT;
}
//#27877 . If there is no this module in beanlist , we will not show them in UI, no matter this module was deleted or not in ACL_ACTIONS table.
if(empty($beanList[$action->category])){
continue;
}
//end
if(!isset($role_actions[$action->category])){
$role_actions[$action->category] = array();
}
$role_actions[$action->category][$action->acltype][$action->name] = $action->toArray();
}
return $role_actions;
}
/**
* function mark_relationships_deleted($id)
*
* special case to delete acl_roles_actions relationship
*
* @param ACLRole GUID $id
*/
function mark_relationships_deleted($id){
//we need to delete the actions relationship by hand (special case)
$date_modified = db_convert("'".gmdate($GLOBALS['timedate']->get_db_date_time_format())."'", 'datetime');
$query = "UPDATE acl_roles_actions SET deleted=1 , date_modified=$date_modified WHERE role_id = '$id' AND deleted=0";
$this->db->query($query);
parent::mark_relationships_deleted($id);
}
/**
* toArray()
* returns this role as an array
*
* @return array of fields with id, name, description
*/
function toArray(){
$array_fields = array('id', 'name', 'description');
$arr = array();
foreach($array_fields as $field){
if(isset($this->$field)){
$arr[$field] = $this->$field;
}else{
$arr[$field] = '';
}
}
return $arr;
}
/**
* fromArray($arr)
* converts an array into an role mapping name value pairs into files
*
* @param Array $arr
*/
function fromArray($arr){
foreach($arr as $name=>$value){
$this->$name = $value;
}
}
}
?>

View File

@@ -0,0 +1,36 @@
/*********************************************************************************
* 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".
********************************************************************************/
var aclviewer=function(){var lastDisplay='';return{view:function(role_id,role_module){YAHOO.util.Connect.asyncRequest('POST','index.php',{'success':aclviewer.display,'failure':aclviewer.failed},'module=ACLRoles&action=EditRole&record='+role_id+'&category_name='+role_module);ajaxStatus.showStatus(SUGAR.language.get('app_strings','LBL_REQUEST_PROCESSED'));},save:function(form_name){var formObject=document.getElementById(form_name);YAHOO.util.Connect.setForm(formObject);YAHOO.util.Connect.asyncRequest('POST','index.php',{'success':aclviewer.postSave,'failure':aclviewer.failed});ajaxStatus.showStatus(SUGAR.language.get('app_strings','LBL_SAVING'));},postSave:function(o){eval(o.responseText);aclviewer.view(result['role_id'],result['module']);},display:function(o){aclviewer.lastDisplay='';ajaxStatus.flashStatus('Done');document.getElementById('category_data').innerHTML=o.responseText;},failed:function(){ajax.flashStatus('Could Not Connect');},toggleDisplay:function(id){if(aclviewer.lastDisplay!=''&&typeof(aclviewer.lastDisplay)!='undefined'){aclviewer.hideDisplay(aclviewer.lastDisplay);}
if(aclviewer.lastDisplay!=id){aclviewer.showDisplay(id);aclviewer.lastDisplay=id;}else{aclviewer.lastDisplay='';}},hideDisplay:function(id){document.getElementById(id).style.display='none';document.getElementById(id+'link').style.display='';},showDisplay:function(id){document.getElementById(id).style.display='';document.getElementById(id+'link').style.display='none';}};}();

45
modules/ACLRoles/Delete.php Executable file
View File

@@ -0,0 +1,45 @@
<?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".
********************************************************************************/
$role = new ACLRole();
if(isset($_REQUEST['record'])){
$role->mark_deleted($_REQUEST['record']);
}
require_once('include/formbase.php');
handleRedirect();
?>

View File

@@ -0,0 +1,91 @@
<?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 $app_list_strings, $app_strings, $current_user;
$mod_strings = return_module_language($GLOBALS['current_language'], 'Users');
$focus = new User();
$focus->retrieve($_REQUEST['record']);
$sugar_smarty = new Sugar_Smarty();
$sugar_smarty->assign('MOD', $mod_strings);
$sugar_smarty->assign('APP', $app_strings);
$sugar_smarty->assign('APP_LIST', $app_list_strings);
$categories = ACLAction::getUserActions($_REQUEST['record'],true);
//clear out any removed tabs from user display
if(!is_admin($current_user)&& !is_admin_for_module($GLOBALS['current_user'],'Users')){
$tabs = $focus->getPreference('display_tabs');
global $modInvisList, $modInvisListActivities;
if(!empty($tabs)){
foreach($categories as $key=>$value){
if(!in_array($key, $tabs) && !in_array($key, $modInvisList) && !in_array($key, $modInvisListActivities) ){
unset($categories[$key]);
}
}
}
}
$names = array();
$names = ACLAction::setupCategoriesMatrix($categories);
if(!empty($names))$tdwidth = 100 / sizeof($names);
$sugar_smarty->assign('APP', $app_list_strings);
$sugar_smarty->assign('CATEGORIES', $categories);
$sugar_smarty->assign('TDWIDTH', $tdwidth);
$sugar_smarty->assign('ACTION_NAMES', $names);
$title = get_module_title( '',$mod_strings['LBL_ROLES_SUBPANEL_TITLE'], '');
$sugar_smarty->assign('TITLE', $title);
$sugar_smarty->assign('USER_ID', $focus->id);
$sugar_smarty->assign('LAYOUT_DEF_KEY', 'UserRoles');
echo $sugar_smarty->fetch('modules/ACLRoles/DetailViewUser.tpl');
//this gets its layout_defs.php file from the user not from ACLRoles so look in modules/Users for the layout defs
require_once('include/SubPanel/SubPanelTiles.php');
$modules_exempt_from_availability_check=array('Users'=>'Users','ACLRoles'=>'ACLRoles',);
$subpanel = new SubPanelTiles($focus, 'UserRoles');
echo $subpanel->display(true,true);

98
modules/ACLRoles/DetailView.php Executable file
View File

@@ -0,0 +1,98 @@
<?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 $modInvisList;
$sugar_smarty = new Sugar_Smarty();
$sugar_smarty->assign('MOD', $mod_strings);
$sugar_smarty->assign('APP', $app_strings);
//nsingh bug: 21669. Messes up localization
/*foreach($modInvisList as $modinvisname){
if(empty($app_list_strings['moduleList'][$modinvisname])){
$app_list_strings['moduleList'][$modinvisname] = $modinvisname;
}
}*/
$sugar_smarty->assign('APP_LIST', $app_list_strings);
/*foreach($modInvisList as $modinvisname){
unset($app_list_strings['moduleList'][$modinvisname]);
}*/
$role = new ACLRole();
$role->retrieve($_REQUEST['record']);
$categories = ACLRole::getRoleActions($_REQUEST['record']);
$names = ACLAction::setupCategoriesMatrix($categories);
$categories2 = array();
$categories2=$categories;
$hidden_categories = array(
"KBDocuments", "Campaigns","Forecasts","ForecastSchedule",
"Emails","EmailTemplates","EmailMarketing","Reports");
foreach($hidden_categories as $v){
if (isset($categories2[$v])) {
unset($categories2[$v]);
}
}
if(!empty($names))$tdwidth = 100 / sizeof($names);
$sugar_smarty->assign('ROLE', $role->toArray());
$sugar_smarty->assign('CATEGORIES', $categories);
$sugar_smarty->assign('CATEGORIES2', $categories2);
$sugar_smarty->assign('TDWIDTH', $tdwidth);
$sugar_smarty->assign('ACTION_NAMES', $names);
$return= array('module'=>'ACLRoles', 'action'=>'DetailView', 'record'=>$role->id);
$sugar_smarty->assign('RETURN', $return);
$params = array();
$params[] = "<a href='index.php?module=ACLRoles&action=index'>{$mod_strings['LBL_MODULE_NAME']}</a>";
$params[] = $role->get_summary_text();
echo getClassicModuleTitle("ACLRoles", $params, true);
//$sugar_smarty->assign('TITLE', $title);
$hide_hide_supanels = true;
echo $sugar_smarty->fetch('modules/ACLRoles/DetailView.tpl');
//for subpanels the variable must be named focus;
$focus =& $role;
$_REQUEST['module'] = 'ACLRoles';
require_once('include/SubPanel/SubPanelTiles.php');
$subpanel = new SubPanelTiles($role, 'ACLRoles');
echo $subpanel->display();
?>

69
modules/ACLRoles/DetailView.tpl Executable file
View File

@@ -0,0 +1,69 @@
{*
/*********************************************************************************
* 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".
********************************************************************************/
*}
<form action="index.php" method="post" name="DetailView" id="form">
<input type="hidden" name="module" value="ACLRoles">
<input type="hidden" name="user_id" value="">
<input type="hidden" name="record" value="{$ROLE.id}">
<input type="hidden" name="isDuplicate" value=''>
<input type='hidden' name='return_record' value='{$RETURN.record}'>
<input type='hidden' name='return_action' value='{$RETURN.action}'>
<input type='hidden' name='return_module' value='{$RETURN.module}'>
<input type="hidden" name="action">
<input title="{$APP.LBL_EDIT_BUTTON_TITLE}" accessKey="{$APP.LBL_EDIT_BUTTON_KEY}" class="button primary" onclick="this.form.action.value='EditView'" type="submit" name="button" value=" {$APP.LBL_EDIT_BUTTON} "> <input title="{$APP.LBL_DUPLICATE_BUTTON_TITLE}" accessKey="{$APP.LBL_DUPLICATE_BUTTON_KEY}" class="button" onclick="this.form.isDuplicate.value='1'; this.form.action.value='EditView'" type="submit" name="button" value=" {$APP.LBL_DUPLICATE_BUTTON} "> <input title="{$APP.LBL_DELETE_BUTTON_TITLE}" accessKey="{$APP.LBL_DELETE_BUTTON_KEY}" class="button" onclick="this.form.return_module.value='ACLRoles'; this.form.return_action.value='index'; this.form.action.value='Delete'; return confirm('{$APP.NTC_DELETE_CONFIRMATION}')" type="submit" name="button" value=" {$APP.LBL_DELETE_BUTTON} ">
</form>
</p>
<p>
<TABLE width='100%' class='detail view' border='0' cellpadding=0 cellspacing = 1 >
<TR>
<td valign='top' width='15%' align='right'><b>{$MOD.LBL_NAME}:</b></td><td width='85%' colspan='3'>{$ROLE.name}</td>
</tr
><TR>
<td valign='top' width='15%' align='right'><b>{$MOD.LBL_DESCRIPTION}:</b></td><td colspan='3' valign='top' width='85%' align='left'>{$ROLE.description | nl2br}</td>
</tr></table>
</p>
<p>
{include file="modules/ACLRoles/EditViewBody.tpl" }

View File

@@ -0,0 +1,91 @@
{*
/*********************************************************************************
* 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".
********************************************************************************/
*}
<TABLE width='100%' class='detail view' border='0' cellpadding=0 cellspacing = 1 >
<TR>
<td style="background: transparent;"></td>
{foreach from=$ACTION_NAMES item="ACTION_NAME" }
<td style="text-align: center;" scope="row"><b>{$ACTION_NAME}</b></td>
{foreachelse}
<td colspan="2">&nbsp;</td>
{/foreach}
</TR>
{foreach from=$CATEGORIES item="TYPES" key="CATEGORY_NAME"}
{if $APP_LIST.moduleList[$CATEGORY_NAME]!='Users'}
<TR>
{if $APP_LIST.moduleList[$CATEGORY_NAME]=='Users'}
<td nowrap width='1%' scope="row"><b>{$MOD.LBL_USER_NAME_FOR_ROLE}</b></td>
{else}
<td nowrap width='1%' scope="row"><b>{$APP_LIST.moduleList[$CATEGORY_NAME]}</b></td>
{/if}
{foreach from=$ACTION_NAMES item="ACTION_LABEL" key="ACTION_NAME"}
{assign var='ACTION_FIND' value='false'}
{foreach from=$TYPES item="ACTIONS" key="TYPE_NAME"}
{foreach from=$ACTIONS item="ACTION" key="ACTION_NAME_ACTIVE"}
{if $ACTION_NAME==$ACTION_NAME_ACTIVE}
{assign var='ACTION_FIND' value='true'}
<td width='{$TDWIDTH}%' align='center'><div align='center' class="acl{$ACTION.accessLabel|capitalize}"><b>{$ACTION.accessName}</b></div></td>
{/if}
{/foreach}
{/foreach}
{if $ACTION_FIND=='false'}
<td nowrap width='{$TDWIDTH}%' style="text-align: center;">
<div><font color='red'>N/A</font></div>
</td>
{/if}
{/foreach}
</TR>
{/if}
{foreachelse}
<tr> <td colspan="2">No Actions</td></tr>
{/foreach}
</TABLE>

View File

@@ -0,0 +1,45 @@
{*
/*********************************************************************************
* 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".
********************************************************************************/
*}
{include file="modules/ACLRoles/DetailViewBody.tpl" }

126
modules/ACLRoles/EditAllBody.tpl Executable file
View File

@@ -0,0 +1,126 @@
{*
/*********************************************************************************
* 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".
********************************************************************************/
*}
<form method='POST' name='EditView' id='ACLEditView'>
<input type='hidden' name='record' value='{$ROLE.id}'>
<input type='hidden' name='module' value='ACLRoles'>
<input type='hidden' name='action' value='Save'>
<input type='hidden' name='return_record' value='{$RETURN.record}'>
<input type='hidden' name='return_action' value='{$RETURN.action}'>
<input type='hidden' name='return_module' value='{$RETURN.module}'>
<input title="{$APP.LBL_SAVE_BUTTON_TITLE}" accessKey="{$APP.LBL_SAVE_BUTTON_KEY}" class="button" onclick="this.form.action.value='Save';aclviewer.save('ACLEditView');return false;" type="button" name="button" value=" {$APP.LBL_SAVE_BUTTON_LABEL} " > &nbsp;
<input title="{$APP.LBL_CANCEL_BUTTON_TITLE}" class='button' accessKey="{$APP.LBL_CANCEL_BUTTON_KEY}" type='button' name='save' value=" {$APP.LBL_CANCEL_BUTTON_LABEL} " class='button' onclick='aclviewer.view("{$ROLE.id}", "All");'>
</p>
<p>
</p>
<TABLE width='100%' class='detail view' border='0' cellpadding=0 cellspacing = 1 >
<TR>
<td></td>
{foreach from=$ACTION_NAMES item="ACTION_NAME" }
<td align='center'><div align='center'><b>{$ACTION_NAME}</b></div></td>
{foreachelse}
<td colspan="2">&nbsp;</td>
{/foreach}
</TR>
{literal}
{/literal}
{foreach from=$CATEGORIES item="TYPES" key="CATEGORY_NAME"}
{if $APP_LIST.moduleList[$CATEGORY_NAME]!='Users'}
<TR>
<td nowrap width='1%'><b>
{if $APP_LIST.moduleList[$CATEGORY_NAME]=='Users'}
{$MOD.LBL_USER_NAME_FOR_ROLE}
{elseif !empty($APP_LIST.moduleList[$CATEGORY_NAME])}
{$APP_LIST.moduleList[$CATEGORY_NAME]}
{else}
{$CATEGORY_NAME}
{/if}
</b></td>
{foreach from=$ACTION_NAMES item="ACTION_LABEL" key="ACTION_NAME"}
{assign var='ACTION_FIND' value='false'}
{foreach from=$TYPES item="ACTIONS"}
{foreach from=$ACTIONS item="ACTION" key="ACTION_NAME_ACTIVE"}
{if $ACTION_NAME==$ACTION_NAME_ACTIVE}
<td nowrap width='{$TDWIDTH}%' style="text-align: center;">
<div style="display: none" id="{$ACTION.id}">
{if $APP_LIST.moduleList[$CATEGORY_NAME]==$APP_LIST.moduleList.Users && $ACTION_LABEL !='Access Type'}
<select DISABLED name='act_guid{$ACTION.id}' id = 'act_guid{$ACTION.id}' onblur="document.getElementById('{$ACTION.id}link').innerHTML=this.options[this.selectedIndex].text; aclviewer.toggleDisplay('{$ACTION.id}');" >
{html_options options=$ACTION.accessOptions selected=$ACTION.aclaccess }
</select>
{else}
<select name='act_guid{$ACTION.id}' id = 'act_guid{$ACTION.id}' onblur="document.getElementById('{$ACTION.id}link').innerHTML=this.options[this.selectedIndex].text; aclviewer.toggleDisplay('{$ACTION.id}');" >
{html_options options=$ACTION.accessOptions selected=$ACTION.aclaccess }
</select>
{/if}
</div>
{if $ACTION.accessLabel == 'dev' || $ACTION.accessLabel == 'admin_dev'}
<div class="aclAdmin" id="{$ACTION.id}link" onclick="aclviewer.toggleDisplay('{$ACTION.id}')">{$ACTION.accessName}</div>
{else}
<div class="acl{$ACTION.accessName}" id="{$ACTION.id}link" onclick="aclviewer.toggleDisplay('{$ACTION.id}')">{$ACTION.accessName}</div>
{/if}
</td>
{assign var='ACTION_FIND' value='true'}
{/if}
{/foreach}
{/foreach}
{if $ACTION_FIND=='false'}
<td nowrap width='{$TDWIDTH}%' style="text-align: center;">
<div><font color='red'>N/A</font></div>
</td>
{/if}
{/foreach}
</TR>
{/if}
{foreachelse}
<tr> <td colspan="2">No Actions Defined</td></tr>
{/foreach}
</TABLE>
<div style="padding-top:10px;">
&nbsp;<input title="{$APP.LBL_SAVE_BUTTON_TITLE}" accessKey="{$APP.LBL_SAVE_BUTTON_KEY}" class="button" onclick="this.form.action.value='Save';aclviewer.save('ACLEditView');return false;" type="button" name="button" value=" {$APP.LBL_SAVE_BUTTON_LABEL} " > &nbsp;
<input title="{$APP.LBL_CANCEL_BUTTON_TITLE}" class='button' accessKey="{$APP.LBL_CANCEL_BUTTON_KEY}" type='button' name='save' value=" {$APP.LBL_CANCEL_BUTTON_LABEL} " class='button' onclick='aclviewer.view("{$ROLE.id}", "All");'>
</div>
</form>

102
modules/ACLRoles/EditRole.php Executable file
View File

@@ -0,0 +1,102 @@
<?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 $app_list_strings;// $modInvisList
$sugar_smarty = new Sugar_Smarty();
$sugar_smarty->assign('MOD', $mod_strings);
$sugar_smarty->assign('APP', $app_strings);
//mass localization
/*foreach($modInvisList as $modinvisname){
$app_list_strings['moduleList'][$modinvisname] = $modinvisname;
}*/
$sugar_smarty->assign('APP_LIST', $app_list_strings);
/*foreach($modInvisList as $modinvisname){
unset($app_list_strings['moduleList'][$modinvisname]);
}*/
$role = new ACLRole();
$role_name = '';
$return= array('module'=>'ACLRoles', 'action'=>'index', 'record'=>'');
if(!empty($_REQUEST['record'])){
$role->retrieve($_REQUEST['record']);
$categories = ACLRole::getRoleActions($_REQUEST['record']);
$role_name = $role->name;
if(!empty($_REQUEST['isDuplicate'])){
//role id is stripped here in duplicate so anything using role id after this will not have it
$role->id = '';
}else{
$return['record']= $role->id;
$return['action']='DetailView';
}
}else{
$categories = ACLRole::getRoleActions('');
}
$sugar_smarty->assign('ROLE', $role->toArray());
$tdwidth = 10;
if(isset($_REQUEST['return_module'])){
$return['module']=$_REQUEST['return_module'];
if(isset($_REQUEST['return_action']))$return['action']=$_REQUEST['return_action'];
if(isset($_REQUEST['return_record']))$return['record']=$_REQUEST['return_record'];
}
$sugar_smarty->assign('RETURN', $return);
$names = ACLAction::setupCategoriesMatrix($categories);
if(!empty($names))$tdwidth = 100 / sizeof($names);
$sugar_smarty->assign('CATEGORIES', $categories);
$sugar_smarty->assign('CATEGORY_NAME', $_REQUEST['category_name']);
$sugar_smarty->assign('TDWIDTH', $tdwidth);
$sugar_smarty->assign('ACTION_NAMES', $names);
$actions = $categories[$_REQUEST['category_name']]['module'];
$sugar_smarty->assign('ACTIONS', $actions);
ob_clean();
if($_REQUEST['category_name'] == 'All'){
echo $sugar_smarty->fetch('modules/ACLRoles/EditAllBody.tpl');
}else{
//WDong Bug 23195: Strings not localized in Role Management.
echo get_module_title($_REQUEST['category_name'],$app_list_strings['moduleList'][$_REQUEST['category_name']], false);
echo $sugar_smarty->fetch('modules/ACLRoles/EditRole.tpl');
echo '</form>';
}
sugar_cleanup(true);

95
modules/ACLRoles/EditRole.tpl Executable file
View File

@@ -0,0 +1,95 @@
{*
/*********************************************************************************
* 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".
********************************************************************************/
*}
<form method='POST' name='EditView' id='ACLEditView'>
<input type='hidden' name='record' value='{$ROLE.id}'>
<input type='hidden' name='module' value='ACLRoles'>
<input type='hidden' name='action' value='Save'>
<input type='hidden' name='return_record' value='{$RETURN.record}'>
<input type='hidden' name='return_action' value='{$RETURN.action}'>
<input type='hidden' name='return_module' value='{$RETURN.module}'>
<input title="{$APP.LBL_SAVE_BUTTON_TITLE}" accessKey="{$APP.LBL_SAVE_BUTTON_KEY}" class="button" onclick="this.form.action.value='Save';aclviewer.save('ACLEditView');return false;" type="button" name="button" value="{$APP.LBL_SAVE_BUTTON_LABEL}" > &nbsp;
<input title="{$APP.LBL_CANCEL_BUTTON_TITLE}" class='button' accessKey="{$APP.LBL_CANCEL_BUTTON_KEY}" type='button' name='save' value="{$APP.LBL_CANCEL_BUTTON_LABEL}" class='button' onclick='aclviewer.view("{$ROLE.id}", "All");'>
<br>
<TABLE width='100%' class='detail view' border='0' cellpadding=0 cellspacing = 1 >
{if !empty($CATEGORIES[$CATEGORY_NAME])}
<TR>
{foreach from=$ACTION_NAMES item="ACTION_LABEL" key="ACTION_NAME"}
{foreach from=$CATEGORIES[$CATEGORY_NAME] item="ACTIONS"}
{foreach from=$ACTIONS item="ACTION" key="ACTION_NAME_ACTIVE"}
{if $ACTION_NAME==$ACTION_NAME_ACTIVE}
<td align='center'><div align='center'><b>{$ACTION_LABEL}</b></div></td>
{/if}
{/foreach}
{/foreach}
{foreachelse}
<td colspan="2">&nbsp;</td>
{/foreach}
</TR>
<TR>
{foreach from=$ACTION_NAMES item="ACTION_LABEL" key="ACTION_NAME"}
{foreach from=$CATEGORIES[$CATEGORY_NAME] item="ACTIONS"}
{foreach from=$ACTIONS item="ACTION" key="ACTION_NAME_ACTIVE"}
{if $ACTION_NAME==$ACTION_NAME_ACTIVE}
<td nowrap width='{$TDWIDTH}%' style="text-align: center;" >
<div style="display: none" id="{$ACTION.id}">
{if $APP_LIST.moduleList[$CATEGORY_NAME]==$APP_LIST.moduleList.Users && $ACTION_LABEL !='Access Type'}
<select DISABLED class="acl{$ACTION.accessName}" name='act_guid{$ACTION.id}' id = 'act_guid{$ACTION.id}' onblur="document.getElementById('{$ACTION.id}link').innerHTML=this.options[this.selectedIndex].text; aclviewer.toggleDisplay('{$ACTION.id}');" >
{html_options options=$ACTION.accessOptions selected=$ACTION.aclaccess }
</select>
{else}
<select class="acl{$ACTION.accessName}" name='act_guid{$ACTION.id}' id = 'act_guid{$ACTION.id}' onblur="document.getElementById('{$ACTION.id}link').innerHTML=this.options[this.selectedIndex].text; aclviewer.toggleDisplay('{$ACTION.id}');" >
{html_options options=$ACTION.accessOptions selected=$ACTION.aclaccess }
</select>
{/if}
</div>
<div class="acl{$ACTION.accessName}" id="{$ACTION.id}link" onclick="aclviewer.toggleDisplay('{$ACTION.id}')">{$ACTION.accessName}</div>
</td>
{/if}
{/foreach}
{/foreach}
{foreachelse}
<td colspan="2">&nbsp;</td>
{/foreach}
</TR>
{else}
<tr> <td colspan="2">No Actions Defined</td></tr>
{/if}
</TABLE>

107
modules/ACLRoles/EditView.php Executable file
View File

@@ -0,0 +1,107 @@
<?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 $app_list_strings;// $modInvisList;
$sugar_smarty = new Sugar_Smarty();
$sugar_smarty->assign('MOD', $mod_strings);
$sugar_smarty->assign('APP', $app_strings);
$sugar_smarty->assign('ISDUPLICATE', '');
$duplicateString='';
//mass localization
/*foreach($modInvisList as $modinvisname){
$app_list_strings['moduleList'][$modinvisname] = $modinvisname;
}*/
$sugar_smarty->assign('APP_LIST', $app_list_strings);
/*foreach($modInvisList as $modinvisname){
unset($app_list_strings['moduleList'][$modinvisname]);
}*/
$role = new ACLRole();
$role_name = '';
$return= array('module'=>'ACLRoles', 'action'=>'index', 'record'=>'');
if(!empty($_REQUEST['record'])){
$role->retrieve($_REQUEST['record']);
$categories = ACLRole::getRoleActions($_REQUEST['record']);
$role_name = $role->name;
if(!empty($_REQUEST['isDuplicate'])){
//role id is stripped here in duplicate so anything using role id after this will not have it
$role->id = '';
$sugar_smarty->assign('ISDUPLICATE', $_REQUEST['record']);
$duplicateString=translate('LBL_DUPLICATE_OF', 'ACLRoles');
}else{
$return['record']= $role->id;
$return['action']='DetailView';
}
}else{
$categories = ACLRole::getRoleActions('');
}
$sugar_smarty->assign('ROLE', $role->toArray());
$tdwidth = 10;
if(isset($_REQUEST['return_module'])){
$return['module']=$_REQUEST['return_module'];
if(isset($_REQUEST['return_id']))$return['record']=$_REQUEST['return_id'];
if(isset($_REQUEST['return_record'])){$return['record']=$_REQUEST['return_record'];}
if(isset($_REQUEST['return_action'])){$return['action']=$_REQUEST['return_action'];}
if ( !empty($return['record']) ) {
$return['action'] = 'DetailView';
}
}
$sugar_smarty->assign('RETURN', $return);
$names = ACLAction::setupCategoriesMatrix($categories);
$sugar_smarty->assign('CATEGORIES', $categories);
$sugar_smarty->assign('TDWIDTH', $tdwidth);
$sugar_smarty->assign('ACTION_NAMES', $names);
$params = array();
$params[] = "<a href='index.php?module=ACLRoles&action=index'>{$mod_strings['LBL_MODULE_NAME']}</a>";
if(empty($role->id)){
$params[] = $GLOBALS['app_strings']['LBL_CREATE_BUTTON_LABEL'];
}else{
$params[] = "<a href='index.php?module=ACLRoles&action=DetailView&record={$role->id}'>".$role->get_summary_text()."</a>";
$params[] = $GLOBALS['app_strings']['LBL_EDIT_BUTTON_LABEL'];
}
echo getClassicModuleTitle("ACLRoles", $params, true);
echo $sugar_smarty->fetch('modules/ACLRoles/EditView.tpl');
?>

84
modules/ACLRoles/EditView.tpl Executable file
View File

@@ -0,0 +1,84 @@
{*
/*********************************************************************************
* 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".
********************************************************************************/
*}
<script>
{literal}
function set_focus(){
document.getElementById('name').focus();
}
{/literal}
</script>
<form method='POST' name='EditView' action='index.php'>
<TABLE width='100%' border='0' cellpadding=0 cellspacing = 0 class="actionsContainer">
<tbody>
<tr>
<td>
<input type='hidden' name='record' value='{$ROLE.id}'>
<input type='hidden' name='module' value='ACLRoles'>
<input type='hidden' name='action' value='Save'>
<input type='hidden' name='isduplicate' value='{$ISDUPLICATE}'>
<input type='hidden' name='return_record' value='{$RETURN.record}'>
<input type='hidden' name='return_action' value='{$RETURN.action}'>
<input type='hidden' name='return_module' value='{$RETURN.module}'> &nbsp;
<input title="{$APP.LBL_SAVE_BUTTON_TITLE}" id='save_button' accessKey="{$APP.LBL_SAVE_BUTTON_KEY}" class="button primary" onclick="this.form.action.value='Save';return check_form('EditView');" type="submit" name="button" value="{$APP.LBL_SAVE_BUTTON_LABEL}" >
<input title="{$APP.LBL_CANCEL_BUTTON_TITLE}" class='cancel_button' accessKey="{$APP.LBL_CANCEL_BUTTON_KEY}" type='submit' name='save' value="{$APP.LBL_CANCEL_BUTTON_LABEL}" class='button' onclick='document.EditView.action.value="{$RETURN.action}";document.EditView.module.value="{$RETURN.module}";document.EditView.record.value="{$RETURN.record}";document.EditView.submit();'>
</td>
</tr>
</tbody>
</table>
<TABLE width='100%' class="edit view" border='0' cellpadding=0 cellspacing = 0 >
<TR>
<td scope="row" align='right'>{$MOD.LBL_NAME}:<span class="required">{$APP.LBL_REQUIRED_SYMBOL}</span></td><td >
<input id='name' name='name' type='text' value='{$ROLE.name}'>
</td><td>&nbsp;</td><td>&nbsp;</td>
</tr>
<tr>
<td scope="row" align='right'>{$MOD.LBL_DESCRIPTION}:</td>
<td ><textarea name='description' cols="80" rows="8">{$ROLE.description}</textarea></td>
</tr>
</table>
</form>
<script type="text/javascript">
addToValidate('EditView', 'name', 'varchar', true, '{$MOD.LBL_NAME}');
</script>

View File

@@ -0,0 +1,47 @@
{*
/*********************************************************************************
* 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".
********************************************************************************/
*}
<script src="modules/ACLRoles/ACLRoles.js"></script>
<b>{$MOD.LBL_EDIT_VIEW_DIRECTIONS}</b>
<table width='100%'><tr>
<td width= '100%' valign='top'>
<div id='category_data'>
{include file='modules/ACLRoles/EditAllBody.tpl'}
</div>
</td></tr>
</table>

0
modules/ACLRoles/Forms.php Executable file
View File

70
modules/ACLRoles/ListUsers.php Executable file
View File

@@ -0,0 +1,70 @@
<?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".
********************************************************************************/
if(!is_admin($current_user)&&!is_admin_for_module($GLOBALS['current_user'],'Users')){
sugar_die('No Access');
}
$record = '';
if(isset($_REQUEST['record'])) $record = $_REQUEST['record'];
?>
<form action="index.php" method="post" name="DetailView" id="form">
<input type="hidden" name="module" value="Users">
<input type="hidden" name="user_id" value="">
<input type="hidden" name="record" value="<?php echo $record; ?>">
<input type="hidden" name="isDuplicate" value=''>
<input type="hidden" name="action">
</form>
<?php
$users = get_user_array(true, "Active", $record);
echo get_module_title($mod_strings['LBL_MODULE_NAME'],$mod_strings['LBL_MODULE_NAME'], true);
echo "<form name='Users'>
<input type='hidden' name='action' value='ListRoles'>
<input type='hidden' name='module' value='Users'>
<select name='record' onchange='document.Users.submit();'>";
echo get_select_options_with_id($users, $record);
echo "</select></form>";
if(!empty($record)){
$hideTeams = true; // to not show the teams subpanel in the following file
require_once('modules/ACLRoles/DetailUserRole.php');
}
?>

44
modules/ACLRoles/Menu.php Executable file
View File

@@ -0,0 +1,44 @@
<?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;
$module_menu = Array(
Array("index.php?module=ACLRoles&action=EditView", $mod_strings['LBL_CREATE_ROLE'],"CreateRoles"),
Array("index.php?module=ACLRoles&action=index", $mod_strings['LIST_ROLES'],"Roles"),
Array("index.php?module=ACLRoles&action=ListUsers", $mod_strings['LIST_ROLES_BY_USER'],"Roles"),
);
?>

View File

@@ -0,0 +1,107 @@
<!--
/*********************************************************************************
* 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".
********************************************************************************/
-->
<!-- BEGIN: main -->
<!-- BEGIN: SearchHeader -->
<script type="text/javascript" src="include/JSON.js?s={SUGAR_VERSION}&c={JS_CUSTOM_VERSION}"></script>
<script type="text/javascript" src="include/javascript/popup_helper.js?s={SUGAR_VERSION}&c={JS_CUSTOM_VERSION}"></script>
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="edit view">
<tr>
<td>
xxxxx
<form action="index.php" method="post" name="popup_query_form" id="popup_query_form">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td scope="row" nowrap="nowrap">{MOD.LBL_NAME}</td>
<td ><input type="text" size="10" tabindex='1' name="name" value="{NAME}" /></td>
<td rowspan='2' valign="top" align="right">
<input type="hidden" name="module" value="{MODULE_NAME}" />
<input type="hidden" name="action" value="Popup" />
<input type="hidden" name="query" value="true" />
<input type="hidden" name="func_name" value="" />
<input type="hidden" name="request_data" value="{request_data}" />
<input type="hidden" name="populate_parent" value="false" />
<input type="hidden" name="refresh_page" value="true" />
<input type="hidden" name="record_id" value="" />
<input type="submit" name="button" class="button"
title="{APP.LBL_SEARCH_BUTTON_TITLE}"
accessKey="{APP.LBL_SEARCH_BUTTON_KEY}"
value="{APP.LBL_SEARCH_BUTTON_LABEL}" />
<input type="hidden" name="mode" value="{MULTI_SELECT}" />
</td>
</tr>
</table>
</form>
</td>
</tr>
</table>
<script type="text/javascript">
<!--
/* initialize the popup request from the parent */
if(window.document.forms['popup_query_form'].request_data.value == "")
{
window.document.forms['popup_query_form'].request_data.value
= JSON.stringify(window.opener.get_popup_request_data());
}
-->
</script>
<!-- END: SearchHeader -->
<table cellpadding="0" cellspacing="0" width="100%" border="0" class="list view">
<!-- BEGIN: list_nav_row -->
{PAGINATION}
<!-- END: list_nav_row -->
<tr height="20" >
<td scope="col" NOWRAP>{CHECKALL}</td>
<td scope="col" width="50%" nowrap="nowrap"><a href="{ORDER_BY}name" class="listViewThLinkS1">{MOD.LBL_NAME}{arrow_start}{name_arrow}{arrow_end}</a></td>
<td scope="col" width="50%" nowrap="nowrap"><a href="{ORDER_BY}description" class="listViewThLinkS1" >{MOD.LBL_DESCRIPTION}{arrow_start}{description_arrow}{arrow_end}</a></td>
</tr>
<!-- BEGIN: row -->
<tr height="20" class="{ROW_COLOR}S1">
<td valign='top'>{PREROW}</td>
<td scope='row' valign="top"><a href="#" onclick="send_back('ACLRoles','{ROLE.ID}');" >{ROLE.NAME}</a></td>
<td valign="top">{ROLE.DESCRIPTION}</td>
</tr>
<!-- END: row -->
</table>
{ASSOCIATED_JAVASCRIPT_DATA}
<!-- END: main -->

146
modules/ACLRoles/Popup_picker.php Executable file
View File

@@ -0,0 +1,146 @@
<?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 Popup_Picker
{
/*
*
*/
function Popup_Picker()
{
;
}
/*
*
*/
function _get_where_clause()
{
$where = '';
if(isset($_REQUEST['query']))
{
$where_clauses = array();
append_where_clause($where_clauses, "name", "acl_roles.name");
$where = generate_where_statement($where_clauses);
}
return $where;
}
/**
*
*/
function process_page()
{
global $mod_strings;
global $app_strings;
global $currentModule;
global $sugar_version, $sugar_config;
$output_html = '';
$where = '';
$where = $this->_get_where_clause();
$name = empty($_REQUEST['name']) ? '' : $_REQUEST['name'];
$request_data = empty($_REQUEST['request_data']) ? '' : $_REQUEST['request_data'];
$hide_clear_button = empty($_REQUEST['hide_clear_button']) ? false : true;
$button = "<form action='index.php' method='post' name='form' id='form'>\n";
if(!$hide_clear_button)
{
$button .= "<input type='button' name='button' class='button' onclick=\"send_back('','');\" title='"
.$app_strings['LBL_CLEAR_BUTTON_TITLE']."' accesskey='"
.$app_strings['LBL_CLEAR_BUTTON_KEY']."' value=' "
.$app_strings['LBL_CLEAR_BUTTON_LABEL']." ' />\n";
}
$button .= "<input type='submit' name='button' class='button' onclick=\"window.close();\" title='"
.$app_strings['LBL_CANCEL_BUTTON_TITLE']."' accesskey='"
.$app_strings['LBL_CANCEL_BUTTON_KEY']."' value=' "
.$app_strings['LBL_CANCEL_BUTTON_LABEL']." ' />\n";
$button .= "</form>\n";
$form = new XTemplate('modules/ACLRoles/Popup_picker.html');
$form->assign('MOD', $mod_strings);
$form->assign('APP', $app_strings);
$form->assign('MODULE_NAME', $currentModule);
$form->assign('NAME', $name);
$form->assign('request_data', $request_data);
ob_start();
insert_popup_header();
$output_html .= ob_get_contents();
ob_end_clean();
$output_html .= get_form_header($mod_strings['LBL_SEARCH_FORM_TITLE'], '', false);
$form->parse('main.SearchHeader');
$output_html .= $form->text('main.SearchHeader');
// Reset the sections that are already in the page so that they do not print again later.
$form->reset('main.SearchHeader');
// create the listview
$seed_bean = new ACLRole();
$ListView = new ListView();
$ListView->show_export_button = false;
$ListView->process_for_popups = true;
$ListView->setXTemplate($form);
$ListView->setHeaderTitle($mod_strings['LBL_ROLE']);
$ListView->setHeaderText($button);
$ListView->setQuery($where, '', 'name', 'ROLE');
$ListView->setModStrings($mod_strings);
ob_start();
$ListView->processListView($seed_bean, 'main', 'ROLE');
$output_html .= ob_get_contents();
ob_end_clean();
$output_html .= insert_popup_footer();
return $output_html;
}
} // end of class Popup_Picker
?>

74
modules/ACLRoles/Save.php Executable file
View File

@@ -0,0 +1,74 @@
<?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".
********************************************************************************/
$role = new ACLRole();
if(isset($_REQUEST['record']))$role->id = $_POST['record'];
if(!empty($_REQUEST['name'])){
$role->name = $_POST['name'];
$role->description = $_POST['description'];
$role->save();
//if duplicate
if(isset($_REQUEST['isduplicate']) && !empty($_REQUEST['isduplicate'])){
//duplicate actions
$role_actions=$role->getRoleActions($_REQUEST['isduplicate']);
foreach($role_actions as $module){
foreach($module as $type){
foreach($type as $act){
$role->setAction($role->id, $act['id'], $act['aclaccess']);
}
}
}
}
}else{
ob_clean();
$flc_module = 'All';
foreach($_POST as $name=>$value){
if(substr_count($name, 'act_guid') > 0){
$name = str_replace('act_guid', '', $name);
$role->setAction($role->id,$name, $value);
}
}
echo "result = {role_id:'$role->id', module:'$flc_module'}";
sugar_cleanup(true);
}
header("Location: index.php?module=ACLRoles&action=DetailView&record=". $role->id);
?>

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".
********************************************************************************/
$mod_strings = array (
'LBL_MODULE_NAME' => 'Roles',
'LBL_MODULE_TITLE' => 'Roles: Home',
'LBL_ROLE'=>'Role',
'LBL_NAME'=>'Name',
'LBL_DESCRIPTION'=>'Description',
'LIST_ROLES'=>'List Roles',
'LBL_USERS_SUBPANEL_TITLE'=>'Users',
'LIST_ROLES_BY_USER'=>'List Roles By User',
'LBL_LIST_FORM_TITLE' => 'Roles',
'LBL_ROLES_SUBPANEL_TITLE'=>'User Roles',
'LBL_SEARCH_FORM_TITLE'=>'Search',
'LBL_CREATE_ROLE'=>'Create Role',
'LBL_EDIT_VIEW_DIRECTIONS'=>'Double click on a cell to change value.',
'LBL_ACCESS_DEFAULT'=>'Not Set',
'LBL_ALL'=>'All',
'LBL_DUPLICATE_OF'=>'Duplicate Of ',
)
?>

View File

@@ -0,0 +1,51 @@
<?PHP
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* The contents of this file are subject to the SugarCRM Public License Version
* 1.1.3 ("License"); You may not use this file except in compliance with the
* License. You may obtain a copy of the License at http://www.sugarcrm.com/SPL
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* 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.
*
* The Original Code is: SugarCRM Open Source
* The Initial Developer of the Original Code is SugarCRM, Inc.
* Portions created by SugarCRM are Copyright (C) 2004-2005 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): ______________________________________..
********************************************************************************/
$mod_strings = array (
'LBL_MODULE_NAME' => 'Role',
'LBL_MODULE_TITLE' => 'Role: Strona główna',
'LBL_ROLE'=>'Role',
'LBL_NAME'=>'Nazwa',
'LBL_DESCRIPTION'=>'Opis',
'LIST_ROLES'=>'Lista ról',
'LBL_USERS_SUBPANEL_TITLE'=>'Użytkownicy',
'LIST_ROLES_BY_USER'=>'Lista ról użytkowników',
'LBL_ROLES_SUBPANEL_TITLE'=>'ról użytkowników',
'LBL_SEARCH_FORM_TITLE'=>'Szukaj',
'LBL_CREATE_ROLE'=>'Utwórz rolę',
'LBL_EDIT_VIEW_DIRECTIONS'=>'Aby zmienić wartość kliknij dwukrotnie w komórkę',
'LBL_ACCESS_DEFAULT'=>'Nie ustawiono',
'LBL_ALL'=>'Wszystko',
'LBL_DUPLICATE_OF'=>'Duplikat ',
'LBL_USER_NAME_FOR_ROLE'=>'Użytkownicy/Zespół/Role',
)
?>

View File

@@ -0,0 +1,41 @@
<?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".
********************************************************************************/
$searchFields['ACLRoles'] =
array (
'name' => array( 'query_type'=>'default'),
);
?>

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".
********************************************************************************/
$listViewDefs['ACLRoles'] = array(
'NAME' => array(
'width' => '20',
'label' => 'LBL_NAME',
'link' => true,
'default' => true),
'DESCRIPTION' => array(
'width' => '80',
'label' => 'LBL_DESCRIPTION',
'default' => true),
);

View File

@@ -0,0 +1,49 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
global $mod_strings;
$popupMeta = array('moduleMain' => 'ACLRole',
'varName' => 'ROLE',
'listTitle' => $mod_strings['LBL_ROLE'],
'orderBy' => 'name',
'whereClauses' => array('name' => 'acl_roles.name'),
'searchInputs' => array('name'),
'searchdefs' => array('name' => array('name' => 'name', 'label' => 'LBL_NAME',),)
);
?>

View File

@@ -0,0 +1,54 @@
<?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".
********************************************************************************/
/*
* Created on May 29, 2007
*
* To change the template for this generated file go to
* Window - Preferences - PHPeclipse - PHP - Code Templates
*/
$searchdefs['ACLRoles'] = array(
'templateMeta' => array(
'maxColumns' => '3',
'widths' => array('label' => '10', 'field' => '30'),
),
'layout' => array(
'basic_search' => array(
'name' => array('name' => 'name', 'label' => 'LBL_NAME',),
),
'advanced_search' => array(),
),
);
?>

View File

@@ -0,0 +1,75 @@
<?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".
********************************************************************************/
$layout_defs['ACLRoles'] = array(
// sets up which panels to show, in which order, and with what linked_fields
'subpanel_setup' => array(
'users' => array(
'top_buttons' => array( array('widget_class' => 'SubPanelTopSelectButton', 'mode' => 'MultiSelect', 'popup_module' => 'Users'),),
'order' => 20,
'module' => 'Users',
'sort_by' => 'user_name',
'sort_order' => 'asc',
'subpanel_name' => 'default',
'get_subpanel_data' => 'users',
'add_subpanel_data' => 'user_id',
'title_key' => 'LBL_USERS_SUBPANEL_TITLE',
),
),
);
$layout_defs['UserRoles'] = array(
// sets up which panels to show, in which order, and with what linked_fields
'subpanel_setup' => array(
'aclroles' => array(
'top_buttons' => array(array('widget_class' => 'SubPanelTopSelectButton', 'mode' => 'MultiSelect','popup_module' => 'ACLRoles'),),
'order' => 20,
'module' => 'ACLRoles',
'sort_by' => 'name',
'sort_order' => 'asc',
'subpanel_name' => 'default',
'get_subpanel_data' => 'aclroles',
'add_subpanel_data' => 'role_id',
'title_key' => 'LBL_ROLES_SUBPANEL_TITLE',
),
),
);
?>

View File

@@ -0,0 +1,74 @@
<?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".
********************************************************************************/
$subpanel_layout = array(
'top_buttons' => array(
array('widget_class' => 'SubPanelTopCreateButton'),
array('widget_class' => 'SubPanelTopSelectButton'),
),
'where' => '',
'default_order_by' => '',
'list_fields' => array(
'name'=>array(
'vname' => 'LBL_NAME',
'widget_class' => 'SubPanelDetailViewLink',
'width' => '25%',
),
'description'=>array(
'vname' => 'LBL_DESCRIPTION',
'width' => '60%',
'sortable'=>false,
),
'edit_button'=>array(
'vname' => 'LBL_EDIT_BUTTON',
'widget_class' => 'SubPanelEditButton',
'module' => 'Contacts',
'width' => '5%',
),
'remove_button'=>array(
'vname' => 'LBL_REMOVE',
'widget_class' => 'SubPanelRemoveButton',
'module' => 'Contacts',
'width' => '5%',
'refresh_page'=>true,
),
),
);
?>

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".
********************************************************************************/
$subpanel_layout = array(
'top_buttons' => array(
array('widget_class' => 'SubPanelTopCreateButton'),
array('widget_class' => 'SubPanelTopSelectButton'),
),
'where' => '',
'list_fields' => array(
'name'=>array(
'vname' => 'LBL_NAME',
'width' => '25%',
),
'description'=>array(
'vname' => 'LBL_DESCRIPTION',
'width' => '70%',
'sortable'=>false,
),
/*
'edit_button'=>array(
'vname' => 'LBL_EDIT_BUTTON',
'widget_class' => 'SubPanelEditButton',
'module' => 'Contacts',
'width' => '5%',
),
'remove_button'=>array(
'vname' => 'LBL_REMOVE',
'widget_class' => 'SubPanelRemoveButton',
'module' => 'Contacts',
'width' => '5%',
'refresh_page'=>true,
),
*/
),
);
?>

76
modules/ACLRoles/popup.tpl Executable file
View File

@@ -0,0 +1,76 @@
<!--
/*********************************************************************************
* 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".
********************************************************************************/
/*********************************************************************************
********************************************************************************/
-->
<script type="text/javascript" src="include/JSON.js"></script>
<script type="text/javascript" src="include/javascript/popup_helper.js"></script>
<script type="text/javascript">
<!--
/* initialize the popup request from the parent */
{literal}
{/literal}
-->
</script>
<table cellpadding="0" cellspacing="0" width="100%" border="0" class="list view">
<tr height="20">
<td scope="col" width="1%" >{$CHECKALL}&nbsp;</td>
<td scope="col" width="20%" nowrap><slot>{$MOD.LBL_NAME}</slot></td>
<td scope="col" width="10%" nowrap><slot>{$MOD.LBL_DESCRIPTION}</slot></td>
</tr>
{foreach from=$ROLES item="ROLE"}
<tr height="20" >
<td>{$PREROW}&nbsp;</td>
<td valign=TOP ><slot><a href="#" onclick="send_back('Users','{$ROLE.id}');">{$ROLE.name}</a></slot></td>
<td valign=TOP ><slot>{$ROLE.description}</slot></td>
</tr>
{foreachelse}
<tr>
<td colspan="2">No Roles</td>
</tr>
{/foreach}
</table>
{$ASSOCIATED_JAVASCRIPT_DATA}

143
modules/ACLRoles/vardefs.php Executable file
View File

@@ -0,0 +1,143 @@
<?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['ACLRole'] = array('table' => 'acl_roles', 'comment' => 'ACL Role definition'
,'fields' => array (
'id' =>
array (
'name' => 'id',
'vname' => 'LBL_ID',
'required'=>true,
'type' => 'id',
'reportable'=>false,
'comment' => 'Unique identifier'
),
'date_entered' =>
array (
'name' => 'date_entered',
'vname' => 'LBL_DATE_ENTERED',
'type' => 'datetime',
'required'=>true,
'comment' => 'Date record created'
),
'date_modified' =>
array (
'name' => 'date_modified',
'vname' => 'LBL_DATE_MODIFIED',
'type' => 'datetime',
'required'=>true,
'comment' => 'Date record last modified'
),
'modified_user_id' =>
array (
'name' => 'modified_user_id',
'rname' => 'user_name',
'id_name' => 'modified_user_id',
'vname' => 'LBL_MODIFIED',
'type' => 'assigned_user_name',
'table' => 'modified_user_id_users',
'isnull' => 'false',
'dbType' => 'id',
'required'=> false,
'len' => 36,
'reportable'=>true,
'comment' => 'User who last modified record'
),
'created_by' =>
array (
'name' => 'created_by',
'rname' => 'user_name',
'id_name' => 'created_by',
'vname' => 'LBL_CREATED',
'type' => 'assigned_user_name',
'table' => 'created_by_users',
'isnull' => 'false',
'dbType' => 'id',
'len' => 36,
'comment' => 'User who created record'
),
'name' =>
array (
'name' => 'name',
'type' => 'varchar',
'vname' => 'LBL_NAME',
'len' => 150,
'comment' => 'The role name'
),
'description' =>
array (
'name' => 'description',
'vname' => 'LBL_DESCRIPTION',
'type' => 'text',
'comment' => 'The role description'
),
'deleted' =>
array (
'name' => 'deleted',
'vname' => 'LBL_DELETED',
'type' => 'bool',
'reportable'=>false,
'comment' => 'Record deletion indicator'
),
'users' =>
array (
'name' => 'users',
'type' => 'link',
'relationship' => 'acl_roles_users',
'source'=>'non-db',
'vname'=>'LBL_USERS',
),
'actions' =>
array (
'name' => 'actions',
'type' => 'link',
'relationship' => 'acl_roles_actions',
'source'=>'non-db',
'vname'=>'LBL_USERS',
),
)
, 'indices' => array (
array('name' =>'aclrolespk', 'type' =>'primary', 'fields'=>array('id')),
array('name' =>'idx_aclrole_id_del', 'type' =>'index', 'fields'=>array('id', 'deleted')),
)
);
?>

View File

@@ -0,0 +1,50 @@
<?php
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
require_once('include/MVC/View/views/view.list.php');
class ACLRolesViewList extends ViewList
{
public function preDisplay()
{
if (!is_admin($GLOBALS['current_user'])&& !is_admin_for_module($GLOBALS['current_user'],'Users'))
sugar_die('No Access');
$this->lv = new ListViewSmarty();
$this->lv->export = false;
$this->lv->showMassupdateFields = false;
}
}

View File

@@ -0,0 +1,68 @@
/*********************************************************************************
* 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".
********************************************************************************/
function open_contact_popup(module_name,width,height,initial_filter,close_popup,hide_clear_button,popup_request_data,popup_mode,create,metadata)
{window.document.popup_request_data=popup_request_data;window.document.close_popup=close_popup;URL='index.php?mode=MultiSelect&'
+'module='+module_name
+'&action=ContactAddressPopup';if(initial_filter!='')
{URL+='&query=true'+initial_filter;}
if(hide_clear_button)
{URL+='&hide_clear_button=true';}
windowName='popup_window';windowFeatures='width='+width
+',height='+height
+',resizable=1,scrollbars=1';if(popup_mode==''&&popup_mode=='undefined'){popup_mode='single';}
URL+='&mode='+popup_mode;if(create==''&&create=='undefined'){create='false';}
URL+='&create='+create;if(metadata!=''&&metadata!='undefined'){URL+='&metadata='+metadata;}
win=window.open(URL,windowName,windowFeatures);if(window.focus)
{win.focus();}
return win;}
function set_focus(){document.getElementById('name').focus();}
function addEvent(object,eventName,do_function) {
if(typeof(object) == "string") object = document.getElementById(object);
if(!object) { alert('No object in function addEvent!'); return; }
if(object.addEventListener) {
object.addEventListener(eventName, do_function, false);
} else {
object.attachEvent('on'+eventName, do_function);
}
}
addEvent(
window,
'load',
function () {
if (document.forms.EditView.record.value=='')
document.getElementById("document_bank_account").options[0].selected=true;
});

View File

@@ -0,0 +1,895 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 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 Account SugarBean Account entity with the necessary
* methods and variables.
********************************************************************************/
require_once("include/SugarObjects/templates/company/Company.php");
// Account is used to store account information.
class Account extends Company {
var $field_name_map = array();
// Stored fields
var $date_entered;
var $date_modified;
var $modified_user_id;
var $assigned_user_id;
var $annual_revenue;
var $billing_address_street;
var $billing_address_city;
var $billing_address_state;
var $billing_address_country;
var $billing_address_postalcode;
var $billing_address_street_2;
var $billing_address_street_3;
var $billing_address_street_4;
var $description;
var $email1;
var $email2;
var $email_opt_out;
var $invalid_email;
var $employees;
var $id;
var $industry;
var $name;
var $ownership;
var $parent_id;
var $phone_alternate;
var $phone_fax;
var $phone_office;
var $rating;
var $shipping_address_street;
var $shipping_address_city;
var $shipping_address_state;
var $shipping_address_country;
var $shipping_address_postalcode;
var $shipping_address_street_2;
var $shipping_address_street_3;
var $shipping_address_street_4;
var $campaign_id;
var $sic_code;
var $ticker_symbol;
var $account_type;
var $website;
var $custom_fields;
var $created_by;
var $created_by_name;
var $modified_by_name;
var $iln;
// These are for related fields
var $opportunity_id;
var $case_id;
var $contact_id;
var $task_id;
var $note_id;
var $meeting_id;
var $call_id;
var $email_id;
var $member_id;
var $parent_name;
var $assigned_user_name;
var $account_id = '';
var $account_name = '';
var $bug_id ='';
var $module_dir = 'Accounts';
var $emailAddress;
var $table_name = "accounts";
var $object_name = "Account";
var $importable = true;
var $new_schema = true;
// This is used to retrieve related fields from form posts.
var $additional_column_fields = Array('assigned_user_name', 'assigned_user_id', 'opportunity_id', 'bug_id', 'case_id', 'contact_id', 'task_id', 'note_id', 'meeting_id', 'call_id', 'email_id', 'parent_name', 'member_id'
);
var $relationship_fields = Array('opportunity_id'=>'opportunities', 'bug_id' => 'bugs', 'case_id'=>'cases',
'contact_id'=>'contacts', 'task_id'=>'tasks', 'note_id'=>'notes',
'meeting_id'=>'meetings', 'call_id'=>'calls', 'email_id'=>'emails','member_id'=>'members',
'project_id'=>'project',
);
//Meta-Data Framework fields
var $push_billing;
var $push_shipping;
function Account() {
parent::Company();
$this->setupCustomFields('Accounts');
foreach ($this->field_defs as $field)
{
if(isset($field['name']))
{
$this->field_name_map[$field['name']] = $field;
}
}
//Email logic
if (!empty($_REQUEST['parent_id']) && !empty($_REQUEST['parent_type']) && $_REQUEST['parent_type'] == 'Emails'
&& !empty($_REQUEST['return_module']) && $_REQUEST['return_module'] == 'Emails') {
$_REQUEST['parent_name'] = '';
$_REQUEST['parent_id'] = '';
}
}
function get_summary_text()
{
return $this->name;
}
function get_contacts() {
return $this->get_linked_beans('contacts','Contact');
}
function clear_account_case_relationship($account_id='', $case_id='')
{
if (empty($case_id)) $where = '';
else $where = " and id = '$case_id'";
$query = "UPDATE cases SET account_name = '', account_id = '' WHERE account_id = '$account_id' AND deleted = 0 " . $where;
$this->db->query($query,true,"Error clearing account to case relationship: ");
}
/**
* This method is used to provide backward compatibility with old data that was prefixed with http://
* We now automatically prefix http://
* @deprecated.
*/
function remove_redundant_http()
{ /*
if(preg_match("@http://@", $this->website))
{
$this->website = substr($this->website, 7);
}
*/
}
function fill_in_additional_list_fields()
{
parent::fill_in_additional_list_fields();
// Fill in the assigned_user_name
// $this->assigned_user_name = get_assigned_user_name($this->assigned_user_id);
}
function fill_in_additional_detail_fields()
{
parent::fill_in_additional_detail_fields();
//rrs bug: 28184 - instead of removing this code altogether just adding this check to ensure that if the parent_name
//is empty then go ahead and fill it.
if(empty($this->parent_name) && !empty($this->id)){
$query = "SELECT a1.name from accounts a1, accounts a2 where a1.id = a2.parent_id and a2.id = '$this->id' and a1.deleted=0";
$result = $this->db->query($query,true," Error filling in additional detail fields: ");
// Get the id and the name.
$row = $this->db->fetchByAssoc($result);
if($row != null)
{
$this->parent_name = $row['name'];
}
else
{
$this->parent_name = '';
}
}
// Set campaign name if there is a campaign id
if( !empty($this->campaign_id)){
$camp = new Campaign();
$where = "campaigns.id='{$this->campaign_id}'";
$campaign_list = $camp->get_full_list("campaigns.name", $where, true);
$this->campaign_name = $campaign_list[0]->name;
}
require_once("include/ECM/EcmFormatPhoneNumber/EcmFormatPhoneNumber.php");
if($_REQUEST['action']=="DetailView"){
$this->phone_office = EcmFormatPhoneNumber($this->phone_office, "Account", "Accounts", $this->id);
$this->phone_alternate = EcmFormatPhoneNumber($this->phone_alternate, "Account", "Accounts", $this->id);
}
//create link to google maps
global $mod_strings;
$billing = '<a target="new" href="https://maps.google.com/?q='.$this->billing_address_country.'+'.$this->billing_address_city.'+'.$this->billing_address_street.'">'.substr($mod_strings['LBL_BILLING_ADDRESS'],0,strlen($mod_strings['LBL_BILLING_ADDRESS'])-1).'</a>';
$shippping = '<a target="new" href="https://maps.google.com/?q='.$this->shipping_address_country.'+'.$this->shipping_address_city.'+'.$this->shipping_address_street.'">'.substr($mod_strings['LBL_SHIPPING_ADDRESS'],0,strlen($mod_strings['LBL_SHIPPING_ADDRESS'])-1).'</a>';
$this->maps = $billing.'<br>'.$shippping;
}
function get_email_addresses($id,$module){
$w=mysql_query("select email_addresses.email_address as addr from email_addresses inner join email_addr_bean_rel on email_addresses.id=email_addr_bean_rel.email_address_id where email_addr_bean_rel.bean_module='".$module."' and email_addr_bean_rel.bean_id='".$id."' and email_addr_bean_rel.deleted='0'");
while($r=mysql_fetch_array($w)){
$addrs[]=$r['addr'];
}
return $addrs;
}
function get_list_view_data(){
$temp_array = parent::get_list_view_data();
$temp_array["ENCODED_NAME"] = $this->name;
if(!empty($this->billing_address_state))
{
$temp_array["CITY"] = $this->billing_address_city . ', '. $this->billing_address_state;
}
else
{
$temp_array["CITY"] = $this->billing_address_city;
}
$temp_array["BILLING_ADDRESS_STREET"] = $this->billing_address_street;
$temp_array["SHIPPING_ADDRESS_STREET"] = $this->shipping_address_street;
require_once("include/ECM/EcmFormatPhoneNumber/EcmFormatPhoneNumber.php");
if($_REQUEST['action']!="Popup"){
$temp_array['PHONE_OFFICE'] = EcmFormatPhoneNumber($temp_array['PHONE_OFFICE'], "Account", "Accounts", $this->id);
$temp_array['PHONE_ALTERNATE'] = EcmFormatPhoneNumber($temp_array['PHONE_ALTERNATE'], "Account", "Accounts", $this->id);
}
if($_REQUEST['action']!="Popup"){
$temp_array['NAME']="<a target='_blank' href='index.php?module=Accounts&action=DetailView&record=".$this->id."'>".$this->name."</a>";
}
return $temp_array;
}
/**
builds a generic search based on the query string using or
do not include any $this-> because this is called on without having the class instantiated
*/
function build_generic_where_clause ($the_query_string) {
$where_clauses = Array();
$the_query_string = $this->db->quote($the_query_string);
array_push($where_clauses, "accounts.name like '$the_query_string%'");
if (is_numeric($the_query_string)) {
array_push($where_clauses, "accounts.phone_alternate like '%$the_query_string%'");
array_push($where_clauses, "accounts.phone_fax like '%$the_query_string%'");
array_push($where_clauses, "accounts.phone_office like '%$the_query_string%'");
}
$the_where = "";
foreach($where_clauses as $clause)
{
if(!empty($the_where)) $the_where .= " or ";
$the_where .= $clause;
}
return $the_where;
}
function create_export_query(&$order_by, &$where, $relate_link_join='')
{
$custom_join = $this->getCustomJoin(true, true, $where);
$custom_join['join'] .= $relate_link_join;
$query = "SELECT
accounts.*,email_addresses.email_address email_address,
accounts.name as account_name,
users.user_name as assigned_user_name ";
$query .= $custom_join['select'];
$query .= " FROM accounts ";
$query .= "LEFT JOIN users
ON accounts.assigned_user_id=users.id ";
//join email address table too.
$query .= ' LEFT JOIN email_addr_bean_rel on accounts.id = email_addr_bean_rel.bean_id and email_addr_bean_rel.bean_module=\'Accounts\' and email_addr_bean_rel.deleted=0 and email_addr_bean_rel.primary_address=1 ';
$query .= ' LEFT JOIN email_addresses on email_addresses.id = email_addr_bean_rel.email_address_id ' ;
$query .= $custom_join['join'];
$where_auto = "( accounts.deleted IS NULL OR accounts.deleted=0 )";
if($where != "")
$query .= "where ($where) AND ".$where_auto;
else
$query .= "where ".$where_auto;
if(!empty($order_by))
$query .= " ORDER BY ". $this->process_order_by($order_by, null);
return $query;
}
function set_notification_body($xtpl, $account)
{
$xtpl->assign("ACCOUNT_NAME", $account->name);
$xtpl->assign("ACCOUNT_TYPE", $account->account_type);
$xtpl->assign("ACCOUNT_DESCRIPTION", $account->description);
return $xtpl;
}
function bean_implements($interface){
switch($interface){
case 'ACL':return true;
}
return false;
}
function get_unlinked_email_query($type=array()) {
return get_unlinked_email_query($type, $this);
}
//start managing addresses
function savePositions($pl) {
global $current_user;
$exists = array();
foreach ($pl as $p) {
if (!isset($p['name']) || $p['name']=='') continue;
if (isset($p['id']) && $p['id']!='') {
//update exists
$q = "
UPDATE account_addresses set
name = '".addslashes($p['name'])."',
date_modified = '".date("Y-m-d H:i:s")."',
modified_user_id = '".$current_user->id."',
street = '".addslashes($p['street'])."',
postalcode = '".addslashes($p['postalcode'])."',
city = '".addslashes($p['city'])."',
country = '".addslashes($p['country'])."',
position = '".addslashes($p['position'])."',
phone = '".addslashes($p['phone'])."',
fax = '".addslashes($p['fax'])."'
WHERE id = '".$p['id']."'
";
$GLOBALS['db']->query($q);
$exists[] = $p['id'];
} else {
//insert new record
$id = create_guid();
$t = array(
$id,
$this->id,
addslashes($p['name']),
date("Y-m-d H:i:s"),
date("Y-m-d H:i:s"),
$current_user->id,
$current_user->id,
addslashes($p['street']),
addslashes($p['postalcode']),
addslashes($p['city']),
addslashes($p['country']),
addslashes($p['position']),
'0',
addslashes($p['phone']),
addslashes($p['fax']),
);
$q = "INSERT INTO account_addresses VALUES ('".implode("','", $t)."')";
$GLOBALS['db']->query($q);
$exists[] = $id;
}
}
//delete old
$GLOBALS['db']->query("UPDATE account_addresses SET deleted='1', modified_user_id='".$current_user->id."',date_modified = '".date("Y-m-d H:i:s")."' WHERE account_id='".$this->id."' AND id NOT IN ('".implode("','",$exists)."')");
}
function getPositionList($array = false) {
if(isset($this->id) && $this->id != '') {
$query = "SELECT * FROM account_addresses WHERE account_id='".$this->id."' AND deleted='0' ORDER BY position";
$r = $this->db->query($query);
$return_array = array();
if($r) {
while($w = $this->db->fetchByAssoc($r)) {
$return_array [] = $w;
}
$json = getJSONobj();
return $array ? $return_array : $json->encode($return_array);
}
}
return $array ? false : '[]';
}
function showPositions(){
$arr=$this->getPositionList(true);
global $mod_strings;
if(count($arr)>0){
$table='
<table cellpadding="0" cellspacing="0" border="0" class="list view">
<tr class="oddListRowS1">
<th><b>'.$mod_strings['LBL_ADDRESS_POSITION'].'</b></td>
<th><b>'.$mod_strings['LBL_ADDRESS_NAME'].'</b></td>
<th><b>'.$mod_strings['LBL_ADDRESS_STREET'].'</b></td>
<th><b>'.$mod_strings['LBL_ADDRESS_CITY'].'</b></td>
<th><b>'.$mod_strings['LBL_ADDRESS_POSTALCODE'].'</b></td>
<th><b>'.$mod_strings['LBL_ADDRESS_COUNTRY'].'</b></td>
<th><b>'.$mod_strings['LBL_ADDRESS_PHONE'].'</b></td>
<th><b>'.$mod_strings['LBL_ADDRESS_FAX'].'</b></td>
</tr>
';
$i == 0;
foreach($arr as $a){
$i++;
//create link to google map
$name = '<a target="new" href="https://maps.google.com/?q='.$a['country'].'+'.$a['city'].'+'.$a['street'].'">'.$a['name'].'</a>';
$table.='
<tr class="oddListRowS1">
<td valign="top" class="oddListRowS1" style="padding:5px !important;border-bottom:1px solid #cccccc;vertical-align:top;">'.$a['position'].'</td>
<td valign="top" class="oddListRowS1" style="padding:5px !important;border-bottom:1px solid #cccccc;vertical-align:top;">'.$name.'</td>
<td valign="top" class="oddListRowS1" style="padding:5px !important;border-bottom:1px solid #cccccc;vertical-align:top;">'.$a['street'].'</td>
<td valign="top" class="oddListRowS1" style="padding:5px !important;border-bottom:1px solid #cccccc;vertical-align:top;">'.$a['city'].'</td>
<td valign="top" class="oddListRowS1" style="padding:5px !important;border-bottom:1px solid #cccccc;vertical-align:top;">'.$a['postalcode'].'</td>
<td valign="top" class="oddListRowS1" style="padding:5px !important;border-bottom:1px solid #cccccc;vertical-align:top;">'.$a['country'].'</td>
<td valign="top" class="oddListRowS1" style="padding:5px !important;border-bottom:1px solid #cccccc;vertical-align:top;">'.$a['phone'].'</td>
<td valign="top" class="oddListRowS1" style="padding:5px !important;border-bottom:1px solid #cccccc;vertical-align:top;">'.$a['fax'].'</td>
';
}
$table.='</table>';
}
return $table;
}
function getAddresses($account_id) {
$db = $GLOBALS['db'];
$res = $db->query("SELECT id, name FROM account_addresses WHERE account_id='$account_id' AND deleted='0' ORDER BY position");
if ($res->num_rows==0) return 0;
//echo "SELECT id, name FROM account_addresses WHERE account_id='$account_id' ORDER BY position";
$options = '<select id="address_id" onchange="getAddress();">';
$options .= '<option value=\'\'></option>';
while ($row = $db->fetchByAssoc($res)) {
$options.='<option value="'.$row['id'].'">'.$row['name'].'</option>';
}
$options.='</select>';
return $options;
}
function getPayers($account_id) {
$db = $GLOBALS['db'];
$res = $db->query("SELECT id, name FROM account_addresses WHERE account_id='$account_id' AND deleted='0' ORDER BY position");
if ($res->num_rows==0) return 0;
//echo "SELECT id, name FROM account_addresses WHERE account_id='$account_id' ORDER BY position";
$options = '<select id="payer_id" onchange="getPayer();">';
$options .= '<option value=\'\'></option>';
while ($row = $db->fetchByAssoc($res)) {
$options.='<option value="'.$row['id'].'">'.$row['name'].'</option>';
}
$options.='</select>';
return $options;
}
function getAddress($id) {
$db = $GLOBALS['db'];
$row = $db->fetchByAssoc($db->query("SELECT a.name as description , a.street, a.postalcode, a.city,ac.to_vatid as nip,a.country FROM account_addresses a inner join accounts ac on ac.id=a.account_id WHERE a.id='$id'"));
$ret[] = $row;
return $ret;
}
//end managing addresses
function savePositions55($pl) {
global $current_user;
$exists = array();
foreach ($pl as $p) {
if (!isset($p['product_group']) || $p['product_group']=='') continue;
if (isset($p['id']) && $p['id']!='') {
//update exists
$q = "
UPDATE ecmmailingcategories_relation set
parent_id = '".addslashes($this->id)."',
ecmmailingcategoriy_id= '".addslashes($p['cat_id'])."',
available = '".addslashes($p['discount'])."',
parent_type = 'Account',
parent_name = '".addslashes($p['product_group'])."'
WHERE id = '".$p['id']."'
";
//$GLOBALS['db']->query("INSERT INTO log VALUES ('".addslashes($q)."')");
$GLOBALS['db']->query($q);
$exists[] = $p['id'];
} else {
//insert new record
$id = create_guid();
$t = array(
$id,
addslashes($p['cat_id']),
'0',
addslashes($p['discount']),
$this->id,
addslashes($p['product_group']),
'Account'
);
$q = "INSERT INTO ecmmailingcategories_relation VALUES ('".implode("','", $t)."')";
$GLOBALS['db']->query($q);
$exists[] = $id;
}
}
//delete old
$GLOBALS['db']->query("UPDATE ecmmailingcategories_relation SET deleted='1' WHERE parent_id='".$this->id."' AND id NOT IN ('".implode("','",$exists)."')");
}
//start managing discounts
function savePositions2($pl) {
global $current_user;
$exists = array();
foreach ($pl as $p) {
if (!isset($p['product_group']) || $p['product_group']=='') continue;
if (!isset($p['discount']) || $p['discount']=='' || floatval($p['discount'])==0) continue;
if (isset($p['id']) && $p['id']!='') {
//update exists
$q = "
UPDATE accounts_discounts set
date_modified = '".date("Y-m-d H:i:s")."',
modified_user_id = '".$current_user->id."',
account_id = '".addslashes($this->id)."',
discount = '".addslashes($p['discount'])."',
product_group = '".addslashes($p['product_group'])."'
WHERE id = '".$p['id']."'
";
//$GLOBALS['db']->query("INSERT INTO log VALUES ('".addslashes($q)."')");
$GLOBALS['db']->query($q);
$exists[] = $p['id'];
} else {
//insert new record
$id = create_guid();
$t = array(
$id,
$this->id,
addslashes($p['product_group']),
addslashes($p['discount']),
date("Y-m-d H:i:s"),
$current_user->id,
'0'
);
$q = "INSERT INTO accounts_discounts VALUES ('".implode("','", $t)."')";
$GLOBALS['db']->query($q);
$exists[] = $id;
}
}
//delete old
$GLOBALS['db']->query("UPDATE accounts_discounts SET deleted='1', modified_user_id='".$current_user->id."',date_modified = '".date("Y-m-d H:i:s")."' WHERE account_id='".$this->id."' AND id NOT IN ('".implode("','",$exists)."')");
}
function getPositionList2($array = false) {
if(isset($this->id) && $this->id != '') {
$query = "SELECT * FROM accounts_discounts WHERE account_id='".$this->id."' AND deleted='0'";
$r = $this->db->query($query);
$return_array = array();
if($r) {
while($w = $this->db->fetchByAssoc($r)) {
$return_array [] = $w;
}
$json = getJSONobj();
return $array ? $return_array : $json->encode($return_array);
}
}
return $array ? false : '[]';
}
function showPositions2(){
$arr=$this->getPositionList2(true);
global $mod_strings;
if(count($arr)>0){
$table='
<table cellpadding="0" cellspacing="0" border="0" class="list view" width="40%">
<tr class="oddListRowS1">
<th><b>'.$mod_strings['LBL_PRODUCT_GROUP'].'</b></td>
<th><b>'.$mod_strings['LBL_DISCOUNT'].'</b></td>
</tr>
';
$i == 0;
foreach($arr as $a){
$i++;
$table.='
<tr class="oddListRowS1">
<td valign="top" class="oddListRowS1" style="padding:5px !important;border-bottom:1px solid #cccccc;vertical-align:top;">'.$a['product_group'].'</td>
<td valign="top" class="oddListRowS1" style="padding:5px !important;border-bottom:1px solid #cccccc;vertical-align:top;">'.$a['discount'].'</td>
';
}
$table.='</table>';
}
return $table;
}
//start managing categories
function savePositions3($pl) {
global $current_user;
$exists = array();
//$GLOBALS['db']->query("INSERT INTO log VALUES ('".addslashes(json_encode($pl))."')");
foreach ($pl as $p) {
if (!isset($p['ecmaccountcategory_id']) || $p['ecmaccountcategory_id']=='') continue;
if (isset($p['id']) && $p['id']!='') {
//update exists
$q = "
UPDATE ecmaccountcategories_bean set
date_modified = '".date("Y-m-d H:i:s")."',
modified_user_id = '".$current_user->id."',
bean_id = '".addslashes($this->id)."',
ecmaccountcategory_id = '".addslashes($p['ecmaccountcategory_id'])."'
WHERE id = '".$p['id']."'
";
//$GLOBALS['db']->query("INSERT INTO log VALUES ('".addslashes($q)."')");
$GLOBALS['db']->query($q);
$exists[] = $p['id'];
} else {
//insert new record
$id = create_guid();
$t = array(
$id,
addslashes($p['ecmaccountcategory_id']),
$this->id,
"Accounts",
date("Y-m-d H:i:s"),
date("Y-m-d H:i:s"),
$current_user->id,
$current_user->id,
'0'
);
$q = "INSERT INTO ecmaccountcategories_bean VALUES ('".implode("','", $t)."')";
$GLOBALS['db']->query($q);
$exists[] = $id;
}
}
//delete old
$GLOBALS['db']->query("UPDATE ecmaccountcategories_bean SET deleted='1', modified_user_id='".$current_user->id."',date_modified = '".date("Y-m-d H:i:s")."' WHERE bean_id='".$this->id."' AND id NOT IN ('".implode("','",$exists)."')");
}
function showPositions55(){
$arr=$this->getPositionList55(true);
global $mod_strings;
if(count($arr)>0){
$table='
<table cellpadding="0" cellspacing="0" border="0" class="list view" width="40%">
<tr class="oddListRowS1">
<th><b>Nazwa grupy</b></td>
<th><b>Aktywna</b></td>
</tr>
';
$i == 0;
foreach($arr as $a){
$i++;
$table.='
<tr class="oddListRowS1">
<td valign="top" class="oddListRowS1" style="padding:5px !important;border-bottom:1px solid #cccccc;vertical-align:top;"><a href="index.php?module=EcmMailingCategories&action=DetailView&record='.$a['cat_id'].'">'.$a['product_group'].'</a></td>
<td valign="top" class="oddListRowS1" style="padding:5px !important;border-bottom:1px solid #cccccc;vertical-align:top;">'.($a['discount']==1 ? 'Tak' : "Nie").'</td>
';
}
$table.='</table>';
}
return $table;
}
function getPositionList55($array = false) {
if(isset($this->id) && $this->id != '') {
$query = "SELECT * FROM ecmmailingcategories_relation WHERE parent_id='".$this->id."' AND deleted='0' AND parent_type='Account'";
$r = $this->db->query($query);
$return_array = array();
if($r) {
while($w = $this->db->fetchByAssoc($r)) {
//get category name && assigned_file
$n = $GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("SELECT name FROM ecmmailingcategories WHERE id='".$w['ecmmailingcategoriy_id']."'"));
$w['product_group'] = $n['name'];
$w['cat_id'] =$w['ecmmailingcategoriy_id'];
$w['discount'] =$w['available'];
$return_array [] = $w;
}
$json = getJSONobj();
return $array ? $return_array : $json->encode($return_array);
}
}
return $array ? false : '[]';
}
function getPositionList3($array = false) {
if(isset($this->id) && $this->id != '') {
$query = "SELECT * FROM ecmaccountcategories_bean WHERE bean_id='".$this->id."' AND deleted='0' AND bean_name='Accounts'";
$r = $this->db->query($query);
$return_array = array();
if($r) {
while($w = $this->db->fetchByAssoc($r)) {
//get category name && assigned_file
$n = $GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("SELECT name, assigned_file FROM ecmaccountcategories WHERE id='".$w['ecmaccountcategory_id']."'"));
$w['ecmaccountcategory_name'] = $n['name'];
$w['assigned_file'] = $n['assigned_file'];
$return_array [] = $w;
}
$json = getJSONobj();
return $array ? $return_array : $json->encode($return_array);
}
}
return $array ? false : '[]';
}
function showPositions3(){
$arr=$this->getPositionList3(true);
global $mod_strings;
if(count($arr)>0){
$table='
<table cellpadding="0" cellspacing="0" border="0" class="list view" width="40%">
<tr class="oddListRowS1">
<th><b>'.$mod_strings['LBL_CATEGORY_NAME'].'</b></td>
<th><b>'.$mod_strings['LBL_CATEGORY_ASSIGNED_FILE'].'</b></td>
</tr>
';
$i == 0;
foreach($arr as $a){
$i++;
//assigned file
if ($a['assigned_file']!="" && $a['assigned_file']) {
$tmp = explode(".", $a['assigned_file']);
if (end($tmp) == 'jpeg' || end($tmp) == 'jpg' || end($tmp) == 'png' || end($tmp) == 'bmp')
$af = '<img src="modules/EcmAccountCategories/files/'.$a['assigned_file'].'"/>';
else
$af = '<a href="modules/EcmAccountCategories/files/'.$a['assigned_file'].'" target="new">'.$a['assigned_file'].'</a>';
}
$table.='
<tr class="oddListRowS1">
<td valign="top" class="oddListRowS1" style="padding:5px !important;border-bottom:1px solid #cccccc;vertical-align:top;"><a href="index.php?module=EcmAccountCategories&action=DetailView&record='.$a['ecmaccountcategory_id'].'">'.$a['ecmaccountcategory_name'].'</a></td>
<td valign="top" class="oddListRowS1" style="padding:5px !important;border-bottom:1px solid #cccccc;vertical-align:top;">'.$af.'</td>
';
}
$table.='</table>';
}
return $table;
}
//end managing categories
function AddGoogleContact() {
global $current_user;
if (!$current_user->google_login || $current_user->google_login=='' || !$current_user->google_p || $current_user->google_p=='') return -1;
require_once 'Zend/Loader.php';
Zend_Loader::loadClass('Zend_Gdata');
Zend_Loader::loadClass('Zend_Gdata_ClientLogin');
Zend_Loader::loadClass('Zend_Http_Client');
Zend_Loader::loadClass('Zend_Gdata_Query');
Zend_Loader::loadClass('Zend_Gdata_Feed');
try {
// perform login and set protocol version to 3.0
$client = Zend_Gdata_ClientLogin::getHttpClient($current_user->google_login, $current_user->google_p, 'cp');
$gdata = new Zend_Gdata($client);
$gdata->setMajorProtocolVersion(3);
//return serialize($gdata);
// create new entry
$doc = new DOMDocument();
$doc->formatOutput = true;
$entry = $doc->createElement('atom:entry');
$entry->setAttributeNS('http://www.w3.org/2000/xmlns/' , 'xmlns:atom', 'http://www.w3.org/2005/Atom');
$entry->setAttributeNS('http://www.w3.org/2000/xmlns/' ,'xmlns:gd', 'http://schemas.google.com/g/2005');
$doc->appendChild($entry);
// add name element
$name = $doc->createElement('gd:name');
$entry->appendChild($name);
$fullName = $doc->createElement('gd:fullName', $this->name);
$name->appendChild($fullName);
// add email element
$email = $doc->createElement('gd:email');
$email->setAttribute('address' ,$this->emailAddress->getPrimaryAddress($this));
$email->setAttribute('rel' ,'http://schemas.google.com/g/2005#home');
$entry->appendChild($email);
// add org name element
$org = $doc->createElement('gd:organization');
$org->setAttribute('rel' ,'http://schemas.google.com/g/2005#work');
$entry->appendChild($org);
$orgName = $doc->createElement('gd:orgName', $this->name);
$org->appendChild($orgName);
if ($this->phone_office) {
$phone = $doc->createElement('gd:phoneNumber', $this->phone_office);
$phone->setAttribute('rel' ,'http://schemas.google.com/g/2005#work');
$entry->appendChild($phone);
//$phoneName = $doc->createElement('gd:phoneNumberName', $this->phone_office);
//$phone->appendChild($phoneName);
}
// insert entry
$entryResult = $gdata->insertEntry($doc->saveXML(), 'https://www.google.com/m8/feeds/contacts/default/full');
return 1;
} catch (Exception $e) {
//return 4;
return $e->getMessage();
//return 0;
}
return 1;
}
}

View File

@@ -0,0 +1,569 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 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: base form for account
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
********************************************************************************/
class AccountFormBase{
function checkForDuplicates($prefix){
require_once('include/formbase.php');
$focus = new Account();
$query = '';
$baseQuery = 'select id, name, website, billing_address_city from accounts where deleted!=1 and ';
if(!empty($_POST[$prefix.'name'])){
$query = $baseQuery ." name like '".$_POST[$prefix.'name']."%'";
}
if(!empty($_POST[$prefix.'billing_address_city']) || !empty($_POST[$prefix.'shipping_address_city'])){
$temp_query = '';
if(!empty($_POST[$prefix.'billing_address_city'])){
if(empty($temp_query)){
$temp_query = " billing_address_city like '".$_POST[$prefix.'billing_address_city']."%'";
}else {
$temp_query .= "or billing_address_city like '".$_POST[$prefix.'billing_address_city']."%'";
}
}
if(!empty($_POST[$prefix.'shipping_address_city'])){
if(empty($temp_query)){
$temp_query = " shipping_address_city like '".$_POST[$prefix.'shipping_address_city']."%'";
}else {
$temp_query .= "or shipping_address_city like '".$_POST[$prefix.'shipping_address_city']."%'";
}
}
if(empty($query)){
$query .= $baseQuery;
}else{
$query .= ' AND ';
}
$query .= ' ('. $temp_query . ' ) ';
}
if(!empty($query)){
$rows = array();
global $db;
$result = $db->query($query);
$i=-1;
while(($row=$db->fetchByAssoc($result)) != null) {
$i++;
$rows[$i] = $row;
}
if ($i==-1) return null;
return $rows;
}
return null;
}
function buildTableForm($rows, $mod='Accounts'){
if(!ACLController::checkAccess('Accounts', 'edit', true)){
return '';
}
global $action;
if(!empty($mod)){
global $current_language;
$mod_strings = return_module_language($current_language, $mod);
}else global $mod_strings;
global $app_strings;
$cols = sizeof($rows[0]) * 2 + 1;
if ($action != 'ShowDuplicates')
{
$form = "<form action='index.php' method='post' id='dupAccounts' name='dupAccounts'><input type='hidden' name='selectedAccount' value=''>";
$form .= '<table width="100%"><tr><td>'.$mod_strings['MSG_DUPLICATE']. '</td></tr><tr><td height="20"></td></tr></table>';
unset($_POST['selectedAccount']);
}
else
{
$form = '<table width="100%"><tr><td>'.$mod_strings['MSG_SHOW_DUPLICATES']. '</td></tr><tr><td height="20"></td></tr></table>';
}
if(isset($_POST['return_action']) && $_POST['return_action'] == 'SubPanelViewer') {
$_POST['return_action'] = 'DetailView';
}
if(isset($_POST['return_action']) && $_POST['return_action'] == 'DetailView' && empty($_REQUEST['return_id'])) {
unset($_POST['return_action']);
}
$form .= "<table width='100%' cellpadding='0' cellspacing='0' class='list view' border='0'><tr class='pagination'><td colspan='$cols'><table width='100%' cellspacing='0' cellpadding='0' border='0'><tr><td>";
// handle buttons
if ($action == 'ShowDuplicates') {
$return_action = 'ListView'; // cn: bug 6658 - hardcoded return action break popup -> create -> duplicate -> cancel
$return_action = (isset($_REQUEST['return_action']) && !empty($_REQUEST['return_action'])) ? $_REQUEST['return_action'] : $return_action;
$form .= "<input type='hidden' name='selectedAccount' id='selectedAccount' value=''><input title='${app_strings['LBL_SAVE_BUTTON_TITLE']}' accessKey='${app_strings['LBL_SAVE_BUTTON_KEY']}' class='button' onclick=\"this.form.action.value='Save';\" type='submit' name='button' value=' ${app_strings['LBL_SAVE_BUTTON_LABEL']} '>\n";
if (!empty($_REQUEST['return_module']) && !empty($_REQUEST['return_action']) && !empty($_REQUEST['return_id']))
$form .= "<input title='${app_strings['LBL_CANCEL_BUTTON_TITLE']}' accessKey='${app_strings['LBL_CANCEL_BUTTON_KEY']}' class='button' onclick=\"this.form.module.value='".$_REQUEST['return_module']."';this.form.action.value='".$_REQUEST['return_action']."';this.form.record.value='".$_REQUEST['return_id']."'\" type='submit' name='button' value=' ${app_strings['LBL_CANCEL_BUTTON_LABEL']} '>";
else if (!empty($_POST['return_module']) && !empty($_POST['return_action']))
$form .= "<input title='${app_strings['LBL_CANCEL_BUTTON_TITLE']}' accessKey='${app_strings['LBL_CANCEL_BUTTON_KEY']}' class='button' onclick=\"this.form.module.value='".$_POST['return_module']."';this.form.action.value='". $_POST['return_action']."';\" type='submit' name='button' value=' ${app_strings['LBL_CANCEL_BUTTON_LABEL']} '>";
else
$form .= "<input title='${app_strings['LBL_CANCEL_BUTTON_TITLE']}' accessKey='${app_strings['LBL_CANCEL_BUTTON_KEY']}' class='button' onclick=\"this.form.action.value='ListView';\" type='submit' type='submit' name='button' value=' ${app_strings['LBL_CANCEL_BUTTON_LABEL']} '>";
} else {
$form .= "<input type='submit' class='button' name='ContinueAccount' value='${mod_strings['LNK_NEW_ACCOUNT']}'>\n";
}
$form .= "</td></tr></table></td></tr><tr>";
if ($action != 'ShowDuplicates')
{
$form .= "<th> &nbsp;</th>";
}
require_once('include/formbase.php');
$form .= getPostToForm();
if(isset($rows[0])){
foreach ($rows[0] as $key=>$value){
if($key != 'id'){
$form .= "<th>". $mod_strings[$mod_strings['db_'.$key]]. "</th>";
}}
$form .= "</tr>";
}
$rowColor = 'oddListRowS1';
foreach($rows as $row){
$form .= "<tr class='$rowColor'>";
if ($action != 'ShowDuplicates')
{
$form .= "<td width='1%' nowrap><a href='javascript:void(0)' onclick='document.dupAccounts.selectedAccount.value=\"${row['id']}\"; document.dupAccounts.submit(); '>[${app_strings['LBL_SELECT_BUTTON_LABEL']}]</a>&nbsp;&nbsp;</td>\n";
}
foreach ($row as $key=>$value){
if($key != 'id'){
if(isset($_POST['popup']) && $_POST['popup']==true){
$form .= "<td scope='row'><a href='javascript:void(0)' onclick=\"window.opener.location='index.php?module=Accounts&action=DetailView&record=${row['id']}'\">$value</a></td>\n";
}
else
$form .= "<td><a target='_blank' href='index.php?module=Accounts&action=DetailView&record=${row['id']}'>$value</a></td>\n";
}}
if($rowColor == 'evenListRowS1'){
$rowColor = 'oddListRowS1';
}else{
$rowColor = 'evenListRowS1';
}
$form .= "</tr>";
}
$form .= "<tr class='pagination'><td colspan='$cols'><table width='100%' cellspacing='0' cellpadding='0' border='0'><tr><td>";
// handle buttons
if ($action == 'ShowDuplicates') {
$return_action = 'ListView'; // cn: bug 6658 - hardcoded return action break popup -> create -> duplicate -> cancel
$return_action = (isset($_REQUEST['return_action']) && !empty($_REQUEST['return_action'])) ? $_REQUEST['return_action'] : $return_action;
$form .= "<input type='hidden' name='selectedAccount' id='selectedAccount' value=''><input title='${app_strings['LBL_SAVE_BUTTON_TITLE']}' class='button' onclick=\"this.form.action.value='Save';\" type='submit' name='button' value=' ${app_strings['LBL_SAVE_BUTTON_LABEL']} '>\n";
if (!empty($_REQUEST['return_module']) && !empty($_REQUEST['return_action']) && !empty($_REQUEST['return_id']))
$form .= "<input title='${app_strings['LBL_CANCEL_BUTTON_TITLE']}' class='button' onclick=\"this.form.module.value='".$_REQUEST['return_module']."';this.form.action.value='".$_REQUEST['return_action']."';this.form.record.value='".$_REQUEST['return_id']."'\" type='submit' name='button' value=' ${app_strings['LBL_CANCEL_BUTTON_LABEL']} '>";
else if (!empty($_POST['return_module']) && !empty($_POST['return_action']))
$form .= "<input title='${app_strings['LBL_CANCEL_BUTTON_TITLE']}' class='button' onclick=\"this.form.module.value='".$_POST['return_module']."';this.form.action.value='". $_POST['return_action']."';\" type='submit' name='button' value=' ${app_strings['LBL_CANCEL_BUTTON_LABEL']} '>";
else
$form .= "<input title='${app_strings['LBL_CANCEL_BUTTON_TITLE']}' class='button' onclick=\"this.form.action.value='ListView';\" type='submit' name='button' value=' ${app_strings['LBL_CANCEL_BUTTON_LABEL']} '>";
} else {
$form .= "<input type='submit' class='button' name='ContinueAccount' value='${mod_strings['LNK_NEW_ACCOUNT']}'></form>\n";
}
$form .= "</td></tr></table></td></tr></table>";
return $form;
}
function getForm($prefix, $mod='', $form=''){
if(!ACLController::checkAccess('Accounts', 'edit', true)){
return '';
}
if(!empty($mod)){
global $current_language;
$mod_strings = return_module_language($current_language, $mod);
}else global $mod_strings;
global $app_strings;
$lbl_save_button_title = $app_strings['LBL_SAVE_BUTTON_TITLE'];
$lbl_save_button_key = $app_strings['LBL_SAVE_BUTTON_KEY'];
$lbl_save_button_label = $app_strings['LBL_SAVE_BUTTON_LABEL'];
$the_form = get_left_form_header($mod_strings['LBL_NEW_FORM_TITLE']);
$the_form .= <<<EOQ
<form name="${prefix}AccountSave" onSubmit="return check_form('${prefix}AccountSave');" method="POST" action="index.php">
<input type="hidden" name="${prefix}module" value="Accounts">
<input type="hidden" name="${prefix}action" value="Save">
EOQ;
$the_form .= $this->getFormBody($prefix, $mod, $prefix."AccountSave");
$the_form .= <<<EOQ
<p><input title="$lbl_save_button_title" accessKey="$lbl_save_button_key" class="button" type="submit" name="button" value=" $lbl_save_button_label " ></p>
</form>
EOQ;
$the_form .= get_left_form_footer();
$the_form .= get_validate_record_js();
return $the_form;
}
function getFormBody($prefix,$mod='', $formname=''){
if(!ACLController::checkAccess('Accounts', 'edit', true)){
return '';
}
global $mod_strings;
$temp_strings = $mod_strings;
if(!empty($mod)){
global $current_language;
$mod_strings = return_module_language($current_language, $mod);
}
global $app_strings;
global $current_user;
$lbl_required_symbol = $app_strings['LBL_REQUIRED_SYMBOL'];
$lbl_account_name = $mod_strings['LBL_ACCOUNT_NAME'];
$lbl_phone = $mod_strings['LBL_PHONE'];
$lbl_website = $mod_strings['LBL_WEBSITE'];
$lbl_save_button_title = $app_strings['LBL_SAVE_BUTTON_TITLE'];
$lbl_save_button_key = $app_strings['LBL_SAVE_BUTTON_KEY'];
$lbl_save_button_label = $app_strings['LBL_SAVE_BUTTON_LABEL'];
$user_id = $current_user->id;
$form = <<<EOQ
<p><input type="hidden" name="record" value="">
<input type="hidden" name="email1" value="">
<input type="hidden" name="email2" value="">
<input type="hidden" name="assigned_user_id" value='${user_id}'>
<input type="hidden" name="action" value="Save">
EOQ;
$form .= "$lbl_account_name&nbsp;<span class='required'>$lbl_required_symbol</span><br><input name='name' type='text' value=''><br>";
$form .= "$lbl_phone<br><input name='phone_office' type='text' value=''><br>";
$form .= "$lbl_website<br><input name='website' type='text' value='http://'><br>";
$form .='</p>';
$javascript = new javascript();
$javascript->setFormName($formname);
$javascript->setSugarBean(new Account());
$javascript->addRequiredFields($prefix);
$form .=$javascript->getScript();
$mod_strings = $temp_strings;
return $form;
}
function getWideFormBody($prefix, $mod='',$formname='', $contact=''){
if(!ACLController::checkAccess('Accounts', 'edit', true)){
return '';
}
if(empty($contact)){
$contact = new Contact();
}
global $mod_strings;
$temp_strings = $mod_strings;
if(!empty($mod)){
global $current_language;
$mod_strings = return_module_language($current_language, $mod);
}
global $app_strings;
global $current_user;
$account = new Account();
$lbl_required_symbol = $app_strings['LBL_REQUIRED_SYMBOL'];
$lbl_account_name = $mod_strings['LBL_ACCOUNT_NAME'];
$lbl_phone = $mod_strings['LBL_PHONE'];
$lbl_website = $mod_strings['LBL_WEBSITE'];
if (isset($contact->assigned_user_id)) {
$user_id=$contact->assigned_user_id;
} else {
$user_id = $current_user->id;
}
//Retrieve Email address and set email1, email2
$sugarEmailAddress = new SugarEmailAddress();
$sugarEmailAddress->handleLegacyRetrieve($contact);
if(!isset($contact->email1)){
$contact->email1 = '';
}
if(!isset($contact->email2)){
$contact->email2 = '';
}
if(!isset($contact->email_opt_out)){
$contact->email_opt_out = '';
}
$form="";
$default_desc="";
if (!empty($contact->description)) {
$default_desc=$contact->description;
}
$form .= <<<EOQ
<input type="hidden" name="${prefix}record" value="">
<input type="hidden" name="${prefix}phone_fax" value="{$contact->phone_fax}">
<input type="hidden" name="${prefix}phone_other" value="{$contact->phone_other}">
<input type="hidden" name="${prefix}email1" value="{$contact->email1}">
<input type="hidden" name="${prefix}email2" value="{$contact->email2}">
<input type='hidden' name='${prefix}billing_address_street' value='{$contact->primary_address_street}'><input type='hidden' name='${prefix}billing_address_city' value='{$contact->primary_address_city}'><input type='hidden' name='${prefix}billing_address_state' value='{$contact->primary_address_state}'><input type='hidden' name='${prefix}billing_address_postalcode' value='{$contact->primary_address_postalcode}'><input type='hidden' name='${prefix}billing_address_country' value='{$contact->primary_address_country}'>
<input type='hidden' name='${prefix}shipping_address_street' value='{$contact->alt_address_street}'><input type='hidden' name='${prefix}shipping_address_city' value='{$contact->alt_address_city}'><input type='hidden' name='${prefix}shipping_address_state' value='{$contact->alt_address_state}'><input type='hidden' name='${prefix}shipping_address_postalcode' value='{$contact->alt_address_postalcode}'><input type='hidden' name='${prefix}shipping_address_country' value='{$contact->alt_address_country}'>
<input type="hidden" name="${prefix}assigned_user_id" value='${user_id}'>
<input type='hidden' name='${prefix}do_not_call' value='{$contact->do_not_call}'>
<input type='hidden' name='${prefix}email_opt_out' value='{$contact->email_opt_out}'>
<table width='100%' border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="20%" nowrap scope="row">$lbl_account_name&nbsp;<span class="required">$lbl_required_symbol</span></td>
<TD width="80%" nowrap scope="row">{$mod_strings['LBL_DESCRIPTION']}</TD>
</tr>
<tr>
<td nowrap ><input name='{$prefix}name' type="text" value="$contact->account_name"></td>
<TD rowspan="5" ><textarea name='{$prefix}description' rows='6' cols='50' >$default_desc</textarea></TD>
</tr>
<tr>
<td nowrap scope="row">$lbl_phone</td>
</tr>
<tr>
<td nowrap ><input name='{$prefix}phone_office' type="text" value="$contact->phone_work"></td>
</tr>
<tr>
<td nowrap scope="row">$lbl_website</td>
</tr>
<tr>
<td nowrap ><input name='{$prefix}website' type="text" value="http://"></td>
</tr>
EOQ;
//carry forward custom lead fields common to accounts during Lead Conversion
$tempAccount = new Account();
if (method_exists($contact, 'convertCustomFieldsForm')) $contact->convertCustomFieldsForm($form, $tempAccount, $prefix);
unset($tempAccount);
$form .= <<<EOQ
</TABLE>
EOQ;
$javascript = new javascript();
$javascript->setFormName($formname);
$javascript->setSugarBean(new Account());
$javascript->addRequiredFields($prefix);
$form .=$javascript->getScript();
$mod_strings = $temp_strings;
return $form;
}
function handleSave($prefix,$redirect=true, $useRequired=false){
require_once('include/formbase.php');
$focus = new Account();
if($useRequired && !checkRequired($prefix, array_keys($focus->required_fields))){
return null;
}
$focus = populateFromPost($prefix, $focus);
if (isset($GLOBALS['check_notify'])) {
$check_notify = $GLOBALS['check_notify'];
}
else {
$check_notify = FALSE;
}
if (empty($_POST['record']) && empty($_POST['dup_checked'])) {
$duplicateAccounts = $this->checkForDuplicates($prefix);
if(isset($duplicateAccounts)){
$location='module=Accounts&action=ShowDuplicates';
$get = '';
// Bug 25311 - Add special handling for when the form specifies many-to-many relationships
if(isset($_POST['relate_to']) && !empty($_POST['relate_to'])) {
$get .= '&Accountsrelate_to='.$_POST['relate_to'];
}
if(isset($_POST['relate_id']) && !empty($_POST['relate_id'])) {
$get .= '&Accountsrelate_id='.$_POST['relate_id'];
}
//add all of the post fields to redirect get string
foreach ($focus->column_fields as $field)
{
if (!empty($focus->$field) && !is_object($focus->$field))
{
$get .= "&Accounts$field=".urlencode($focus->$field);
}
}
foreach ($focus->additional_column_fields as $field)
{
if (!empty($focus->$field))
{
$get .= "&Accounts$field=".urlencode($focus->$field);
}
}
if($focus->hasCustomFields()) {
foreach($focus->field_defs as $name=>$field) {
if (!empty($field['source']) && $field['source'] == 'custom_fields')
{
$get .= "&Accounts$name=".urlencode($focus->$name);
}
}
}
$emailAddress = new SugarEmailAddress();
$get .= $emailAddress->getFormBaseURL($focus);
//create list of suspected duplicate account id's in redirect get string
$i=0;
foreach ($duplicateAccounts as $account)
{
$get .= "&duplicate[$i]=".$account['id'];
$i++;
}
//add return_module, return_action, and return_id to redirect get string
$get .= '&return_module=';
if(!empty($_POST['return_module'])) $get .= $_POST['return_module'];
else $get .= 'Accounts';
$get .= '&return_action=';
if(!empty($_POST['return_action'])) $get .= $_POST['return_action'];
//else $get .= 'DetailView';
if(!empty($_POST['return_id'])) $get .= '&return_id='.$_POST['return_id'];
if(!empty($_POST['popup'])) $get .= '&popup='.$_POST['popup'];
if(!empty($_POST['create'])) $get .= '&create='.$_POST['create'];
$_SESSION['SHOW_DUPLICATES'] = $get;
//now redirect the post to modules/Accounts/ShowDuplicates.php
if (!empty($_POST['is_ajax_call']) && $_POST['is_ajax_call'] == '1')
{
ob_clean();
$json = getJSONobj();
echo $json->encode(array('status' => 'dupe', 'get' => $location));
}
else if(!empty($_REQUEST['ajax_load']))
{
echo "<script>SUGAR.ajaxUI.loadContent('index.php?$location');</script>";
}
else {
if(!empty($_POST['to_pdf']))
$location .= '&to_pdf='.$_POST['to_pdf'];
header("Location: index.php?$location");
}
return null;
}
}
if(!$focus->ACLAccess('Save')){
ACLController::displayNoAccess(true);
sugar_cleanup(true);
}
if ($focus->shop_user!='none')
$focus->website_update = 1;
//save addresses
$focus->savePositions($_POST['position_list']);
//save discounts
$focus->savePositions2($_POST['position_list2']);
//save categories
$focus->savePositions3($_POST['position_list3']);
$focus->savePositions55($_POST['position_list55']);
$focus->to_vatid_unformated = str_replace("-","", $focus->to_vatid);
$focus->save($check_notify);
$return_id = $focus->id;
$GLOBALS['log']->debug("Saved record with id of ".$return_id);
if (!empty($_POST['is_ajax_call']) && $_POST['is_ajax_call'] == '1') {
$json = getJSONobj();
echo $json->encode(array('status' => 'success',
'get' => ''));
$trackerManager = TrackerManager::getInstance();
$timeStamp = TimeDate::getInstance()->nowDb();
if($monitor = $trackerManager->getMonitor('tracker')){
$monitor->setValue('action', 'detailview');
$monitor->setValue('user_id', $GLOBALS['current_user']->id);
$monitor->setValue('module_name', 'Accounts');
$monitor->setValue('date_modified', $timeStamp);
$monitor->setValue('visible', 1);
if (!empty($this->bean->id)) {
$monitor->setValue('item_id', $return_id);
$monitor->setValue('item_summary', $focus->get_summary_text());
}
$trackerManager->saveMonitor($monitor, true, true);
}
return null;
}
if(isset($_POST['popup']) && $_POST['popup'] == 'true') {
$get = '&module=';
if(!empty($_POST['return_module'])) $get .= $_POST['return_module'];
else $get .= 'Accounts';
$get .= '&action=';
if(!empty($_POST['return_action'])) $get .= $_POST['return_action'];
else $get .= 'Popup';
if(!empty($_POST['return_id'])) $get .= '&return_id='.$_POST['return_id'];
if(!empty($_POST['popup'])) $get .= '&popup='.$_POST['popup'];
if(!empty($_POST['create'])) $get .= '&create='.$_POST['create'];
if(!empty($_POST['to_pdf'])) $get .= '&to_pdf='.$_POST['to_pdf'];
$get .= '&name=' . $focus->name;
$get .= '&query=true';
header("Location: index.php?$get");
return;
}
if($redirect){
handleRedirect($return_id,'Accounts');
}else{
return $focus;
}
}
}
?>

View File

@@ -0,0 +1,69 @@
<?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/EditView/QuickCreate.php');
class AccountsQuickCreate extends QuickCreate {
var $javascript;
function process() {
global $current_user, $timedate, $app_list_strings, $current_language, $mod_strings;
$mod_strings = return_module_language($current_language, 'Accounts');
parent::process();
if($this->viaAJAX) { // override for ajax call
$this->ss->assign('saveOnclick', "onclick='if(check_form(\"accountsQuickCreate\")) return SUGAR.subpanelUtils.inlineSave(this.form.id, \"accounts\"); else return false;'");
$this->ss->assign('cancelOnclick', "onclick='return SUGAR.subpanelUtils.cancelCreate(\"subpanel_accounts\")';");
}
$this->ss->assign('viaAJAX', $this->viaAJAX);
$this->javascript = new javascript();
$this->javascript->setFormName('accountsQuickCreate');
$focus = new Account();
$this->javascript->setSugarBean($focus);
$this->javascript->addAllFields('');
$this->ss->assign('additionalScripts', $this->javascript->getScript(false));
}
}
?>

View File

@@ -0,0 +1,9 @@
<?php
if (!$_REQUEST['record'] || $_REQUEST['record']=='') {
echo '5'; return;
}
$a = new Account();
$a->retrieve($_REQUEST['record']);
echo $a->AddGoogleContact();
return;

View File

@@ -0,0 +1,306 @@
//addresses
function saveItems(){
document.getElementById('position_list').value = ItemsList(true);
}
function doRequest(where,post,doFunction,error) {
this.Display = function(result) { doFunction(result.responseText); }
this.Fail = function(result){ if(error) alert(error);}
YAHOO.util.Connect.asyncRequest('POST',where,{success:this.Display,failure:this.Fail},post);
}
function changeValidateRequired(formname,name,required) {
for(var i=0; i<validate[formname].length; i++)
if(validate[formname][i][0] == name) { validate[formname][i][2] = required; break; }
}
function addEvent(object,eventName,do_function) {
if(typeof(object) == "string") object = document.getElementById(object);
if(!object) { alert('No object in function addEvent!'); return; }
if(object.addEventListener) {
object.addEventListener(eventName, do_function, false);
} else {
object.attachEvent('on'+eventName, do_function);
}
}
var tbody_;
var ItemListSave;
var ItemListClear;
var ItemListFil;
var FillText;
addEvent(
window,
'load',
function() {
var paramsTable = new paramsMT('itemsTable');
paramsTable.onCreateRow = function(row) {
row.newPos = false;
row.noAddNew = true;
row.ondblclick = function() {}
row.onSelect = function() {
//for(var i=0; i<this.myTable.colCount(); i++)
//this.cells.item(i).change(!this.newPos);
//this.cells.item(0).change(true);
}
row.onDeselect = function() {
}
}
paramsTable.onCreateCell = function(cell) {
var i = cell.index;
cell.change = function(select) {};
if(i == 0) {
cell.setData = function(data) {
if(data.position) cell.firstChild.value = data.position;
if (data.id)
cell.getElementsByTagName('input')[1].value = data.id;
};
cell.getData = function(data) {
data.position = cell.firstChild.value;
data.id = cell.getElementsByTagName('input')[1].value;
}
//cell.select = function() { this.selectNext(); }
//cell.selectNext = function() { var row = this.parentNode.selectNext(); row.select(); row.cells.item(i).select(); };
var edit = document.createElement('input');
edit.setAttribute('type','text');
edit.setAttribute('readonly','readonly');
edit.setAttribute('tabIndex',1);
edit.className = 'inputs';
cell.appendChild(edit);
var edit = document.createElement('input');
edit.setAttribute('type','hidden');
edit.setAttribute('readonly','readonly');
edit.setAttribute('tabIndex',1);
edit.className = 'inputs';
cell.appendChild(edit);
}
if(i == 1) {
cell.setData = function(data) {
if(data.name) {
cell.firstChild.value = data.name;
}
};
cell.getData = function(data) {
data.name = cell.firstChild.value;
}
cell.onDeselect = function() {
ERROR = false;
var data = new Object();
this.getData(data);
if(!ERROR) {
data.name = data.name;
this.setData(data);
}
}
//cell.select = function() { this.selectNext(); }
//cell.selectNext = function() { var row = this.parentNode.selectNext(); row.select(); row.cells.item(i).select(); };
var edit = document.createElement('input');
edit.setAttribute('type','text');
edit.setAttribute('tabIndex',1);
edit.className = 'inputs';
cell.appendChild(edit);
}
if(i == 2) {
cell.setData = function(data) {
if (data.street)
cell.getElementsByTagName('input')[0].value = data.street;
};
cell.getData = function(data) {
data.street = cell.firstChild.value;
}
var edit = document.createElement('input');
edit.setAttribute('type','text');
edit.setAttribute('tabIndex',1);
edit.className = 'inputs';
cell.appendChild(edit);
}
if(i == 3) {
cell.setData = function(data) {
if(data.city) cell.firstChild.value = data.city;
};
cell.getData = function(data) {
data.city = cell.firstChild.value;
}
var edit = document.createElement('input');
edit.setAttribute('type','text');
edit.setAttribute('tabIndex',1);
edit.className = 'inputs';
cell.appendChild(edit);
}
if(i == 4) {
cell.setData = function(data) {
if(data.postalcode) cell.firstChild.value = data.postalcode;
};
cell.getData = function(data) {
data.postalcode = cell.firstChild.value;
}
var edit = document.createElement('input');
edit.setAttribute('type','text');
edit.setAttribute('tabIndex',1);
edit.className = 'inputs';
cell.appendChild(edit);
}
if(i == 5) {
cell.setData = function(data) {
if(data.country) cell.firstChild.value = data.country;
};
cell.getData = function(data) {
data.country = cell.firstChild.value;
}
var edit = document.createElement('input');
edit.setAttribute('type','text');
edit.setAttribute('tabIndex',1);
edit.className = 'inputs';
cell.appendChild(edit);
}
if(i == 6) {
cell.setData = function(data) {
if(data.phone) cell.firstChild.value = data.phone;
};
cell.getData = function(data) {
data.phone = cell.firstChild.value;
}
var edit = document.createElement('input');
edit.setAttribute('type','text');
edit.setAttribute('tabIndex',1);
edit.className = 'inputs';
cell.appendChild(edit);
}
if(i == 7) {
cell.setData = function(data) {
if(data.fax) cell.firstChild.value = data.fax;
};
cell.getData = function(data) {
data.fax = cell.firstChild.value;
}
var edit = document.createElement('input');
edit.setAttribute('type','text');
edit.setAttribute('tabIndex',1);
edit.className = 'inputs';
cell.appendChild(edit);
}
if(i == 8) {
var img;
cell.style.padding="auto auto auto auto";
//insert
img = document.createElement('img');
img.setAttribute('alt',MOD['LBL_INSERT_NEW_ROW']);
img.setAttribute('src','modules/EcmQuotes/images/insertrow.gif');
img.style.cursor = 'pointer';
img.onclick = function() {
this.parentNode.myTable.addRow(this.parentNode.parentNode.index+1);
refreshPositionIndex();
};
//delete
cell.appendChild(img);
cell.appendChild(document.createTextNode(" "));
img = document.createElement('img');
img.setAttribute('alt',MOD['LBL_DELETE_ROW']);
img.setAttribute('src','modules/EcmQuotes/images/deleterow.gif');
img.style.cursor = 'pointer';
img.onclick = function() { this.parentNode.parentNode.deleteRow(); refreshPositionIndex();};
cell.appendChild(img);
cell.appendChild(document.createTextNode(" "));
cell.appendChild(document.createElement('br'));
//move up
img = document.createElement('img');
img.setAttribute('alt',MOD['LBL_MOVE_ROW_UP']);
img.setAttribute('src','modules/EcmQuotes/images/moverowup.gif');
img.style.cursor = 'pointer';
img.onclick = function() { this.parentNode.parentNode.moveUp(); refreshPositionIndex();};
cell.appendChild(img);
cell.appendChild(document.createTextNode(" "));
//move down
img = document.createElement('img');
img.setAttribute('alt',MOD['LBL_MOVE_ROW_DOWN']);
img.setAttribute('src','modules/EcmQuotes/images/moverowdown.gif');
img.style.cursor = 'pointer';
img.onclick = function() { this.parentNode.parentNode.moveDown();refreshPositionIndex(); }
cell.appendChild(img);
}
}
refreshPositionIndex = function() {
for(var i=0; i<paramsTable.rowCount(); i++) {
var data = paramsTable.row(i).getData();
data.position = i+1;
paramsTable.row(i).setData(data);
}
}
ItemsList = function(json) {
var data = '';
for(var i=0; i<paramsTable.rowCount(); i++) {
data = data + '||||' + JSON.stringifyNoSecurity(paramsTable.row(i).getData());
}
return data;
}
if(paramsTable.rowCount() == 0) {paramsTable.addRow(); refreshPositionIndex();};
paramsTable.onSetCellData = function(row,cell,data) {
if(cell.innerHTML == '') cell.innerHTML = '&nbsp;';
}
ItemListSave = function(json,el) {
var data = new Object();
var tmp;
for(var i=0; i<paramsTable.rowCount(); i++) {
data[i.toString()] = paramsTable.row(i).getData();
}
paramsOptions = data;
var r = JSON.stringifyNoSecurity(paramsOptions);
doRequest(
'index.php',
'module=Accounts&action=price_conditionSave&to_pdf=1&paramslist='+r+'&record='+document.forms.EditView.record.value,
function(result) {
if(result.indexOf("Saved") >= 0) alert("Zapisano!"); else alert("Błąd podczas zapisywania!");
}
);
}
ItemListClear = function(noNew,save) {
if(typeof(save)=="string") ItemListSave(null,save);
while(paramsTable.rowCount()>0) paramsTable.row(0).deleteRow(noNew);
refreshPositionIndex();
}
ItemListFill = function() {
var pl;
pl = document.getElementById('position_list').value;
if(pl && pl != '') {
try {
pl = eval(pl);
for(x in pl) { var pl_row = pl[x]; if (pl_row.template=='') continue; paramsTable.addRow().setData(pl_row); }
} catch(err) { pl = null; };
}
refreshPositionIndex();
}
ItemListClear();
ItemListFill();
}
);

View File

@@ -0,0 +1,191 @@
//categories
function saveItems3(){
document.getElementById('position_list3').value = ItemsList3(true);
}
function doRequest(where,post,doFunction,error) {
this.Display = function(result) { doFunction(result.responseText); }
this.Fail = function(result){ if(error) alert(error);}
YAHOO.util.Connect.asyncRequest('POST',where,{success:this.Display,failure:this.Fail},post);
}
function addEvent(object,eventName,do_function) {
if(typeof(object) == "string") object = document.getElementById(object);
if(!object) { alert('No object in function addEvent!'); return; }
if(object.addEventListener) {
object.addEventListener(eventName, do_function, false);
} else {
object.attachEvent('on'+eventName, do_function);
}
}
var tbody_;
var ItemListSave3;
var ItemListClear3;
var ItemListFil3;
var FillText;
addEvent(
window,
'load',
function() {
var paramsTable3 = new paramsMT('itemsTable3');
paramsTable3.onCreateRow = function(row) {
row.newPos = false;
row.noAddNew = true;
row.ondblclick = function() {}
row.onSelect = function() {
}
row.onDeselect = function() {
}
}
paramsTable3.onCreateCell = function(cell) {
var i = cell.index;
if(i == 0) {
cell.setData = function(data) {
console.log(data);
if(data.ecmaccountcategory_name) {
cell.firstChild.value = data.ecmaccountcategory_name;
cell.getElementsByTagName('input')[1].value = data.ecmaccountcategory_id;
if (data.id)
cell.getElementsByTagName('input')[2].value = data.id;
}
};
cell.getData = function(data) {
data.ecmaccountcategory_name = cell.firstChild.value;
data.ecmaccountcategory_id = cell.getElementsByTagName('input')[1].value;
data.id = cell.getElementsByTagName('input')[2].value;
}
cell.onSelect = function() {
var cn = this.getElementsByTagName('input');
cn[0].name = 'name_p';
cn[0].id = 'name_p';
cn[1].name = 'id_p';
cn[1].id = 'id_p';
}
cell.onDeselect = function() {
ERROR = false;
var data = new Object();
this.getData(data);
if(!ERROR) {
this.setData(data);
}
var cn = this.getElementsByTagName('input');
cn[0].name = '';
cn[0].id = '';
cn[1].name = '';
cn[1].id = '';
}
//cell.select = function() { this.selectNext(); }
//cell.selectNext = function() { var row = this.parentNode.selectNext(); row.select(); row.cells.item(i).select(); };
var edit = document.createElement('input');
edit.setAttribute('type','text');
edit.setAttribute('tabIndex',1);
edit.className = 'inputs';
cell.appendChild(edit);
var edit = document.createElement('input');
edit.setAttribute('type','hidden');
edit.setAttribute('readonly','readonly');
edit.setAttribute('tabIndex',1);
edit.className = 'inputs';
cell.appendChild(edit);
var edit = document.createElement('input');
edit.setAttribute('type','hidden');
edit.setAttribute('readonly','readonly');
edit.setAttribute('tabIndex',1);
edit.className = 'inputs';
cell.appendChild(edit);
var img = document.createElement('img');
img.setAttribute('alt',MOD['LBL_IMG_SEARCH']);
img.setAttribute('src','modules/EcmQuotes/images/search.gif');
img.style.cursor = 'pointer';
img.onclick = function() {
var ecmpopup = open_popup( "EcmAccountCategories", 600, 400, "", true, false, {"call_back_function":"set_return","form_name":"EditView","field_to_name_array":{"id":"id_p","name":"name_p"}}, "single", true );
setTimeout(function(){ecmpopup.focus();},200);
}
cell.appendChild(img);
}
if(i == 1) {
var img;
cell.style.padding="auto auto auto auto";
//insert
img = document.createElement('img');
img.setAttribute('alt',MOD['LBL_INSERT_NEW_ROW']);
img.setAttribute('src','modules/EcmQuotes/images/insertrow.gif');
img.style.cursor = 'pointer';
img.onclick = function() {
this.parentNode.myTable.addRow(this.parentNode.parentNode.index+1);
refreshPositionIndex();
};
//delete
cell.appendChild(img);
cell.appendChild(document.createTextNode(" "));
img = document.createElement('img');
img.setAttribute('alt',MOD['LBL_DELETE_ROW']);
img.setAttribute('src','modules/EcmQuotes/images/deleterow.gif');
img.style.cursor = 'pointer';
img.onclick = function() { this.parentNode.parentNode.deleteRow(); refreshPositionIndex();};
cell.appendChild(img);
cell.appendChild(document.createTextNode(" "));
cell.appendChild(document.createElement('br'));
//move up
img = document.createElement('img');
img.setAttribute('alt',MOD['LBL_MOVE_ROW_UP']);
img.setAttribute('src','modules/EcmQuotes/images/moverowup.gif');
img.style.cursor = 'pointer';
img.onclick = function() { this.parentNode.parentNode.moveUp(); refreshPositionIndex();};
cell.appendChild(img);
cell.appendChild(document.createTextNode(" "));
//move down
img = document.createElement('img');
img.setAttribute('alt',MOD['LBL_MOVE_ROW_DOWN']);
img.setAttribute('src','modules/EcmQuotes/images/moverowdown.gif');
img.style.cursor = 'pointer';
img.onclick = function() { this.parentNode.parentNode.moveDown();refreshPositionIndex(); }
cell.appendChild(img);
}
}
ItemsList3 = function(json) {
var data = '';
for(var i=0; i<paramsTable3.rowCount(); i++) {
data = data + '||||' + JSON.stringifyNoSecurity(paramsTable3.row(i).getData());
}
return data;
}
if(paramsTable3.rowCount() == 0) {paramsTable3.addRow();};
paramsTable3.onSetCellData = function(row,cell,data) {
if(cell.innerHTML == '') cell.innerHTML = '&nbsp;';
}
ItemListFill3 = function() {
var pl;
pl = document.getElementById('position_list3').value;
console.log(pl);
if(pl && pl != '') {
try {
pl = eval(pl);
for(x in pl) { var pl_row = pl[x]; if (pl_row.template=='') continue; paramsTable3.addRow().setData(pl_row); }
} catch(err) { pl = null; };
}
}
ItemListClear3 = function(noNew,save) {
if(typeof(save)=="string") ItemListSave(null,save);
while(paramsTable3.rowCount()>0) paramsTable3.row(0).deleteRow(noNew);
}
ItemListClear3();
ItemListFill3();
}
);

View File

@@ -0,0 +1,98 @@
<?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 $current_user;
$dashletData['MyAccountsDashlet']['searchFields'] = array('date_entered' => array('default' => ''),
'account_type' => array('default' => ''),
'industry' => array('default' => ''),
'billing_address_country' => array('default'=>''),
'assigned_user_id' => array('type' => 'assigned_user_name',
'default' => $current_user->name,
'label' => 'LBL_ASSIGNED_TO'));
$dashletData['MyAccountsDashlet']['columns'] = array('name' => array('width' => '40',
'label' => 'LBL_LIST_ACCOUNT_NAME',
'link' => true,
'default' => true),
'website' => array('width' => '8',
'label' => 'LBL_WEBSITE',
'default' => true),
'phone_office' => array('width' => '15',
'label' => 'LBL_LIST_PHONE',
'default' => true),
'phone_fax' => array('width' => '8',
'label' => 'LBL_PHONE_FAX'),
'phone_alternate' => array('width' => '8',
'label' => 'LBL_OTHER_PHONE'),
'billing_address_city' => array('width' => '8',
'label' => 'LBL_BILLING_ADDRESS_CITY'),
'billing_address_street' => array('width' => '8',
'label' => 'LBL_BILLING_ADDRESS_STREET'),
'billing_address_state' => array('width' => '8',
'label' => 'LBL_BILLING_ADDRESS_STATE'),
'billing_address_postalcode' => array('width' => '8',
'label' => 'LBL_BILLING_ADDRESS_POSTALCODE'),
'billing_address_country' => array('width' => '8',
'label' => 'LBL_BILLING_ADDRESS_COUNTRY',
'default' => true),
'shipping_address_city' => array('width' => '8',
'label' => 'LBL_SHIPPING_ADDRESS_CITY'),
'shipping_address_street' => array('width' => '8',
'label' => 'LBL_SHIPPING_ADDRESS_STREET'),
'shipping_address_state' => array('width' => '8',
'label' => 'LBL_SHIPPING_ADDRESS_STATE'),
'shipping_address_postalcode' => array('width' => '8',
'label' => 'LBL_SHIPPING_ADDRESS_POSTALCODE'),
'shipping_address_country' => array('width' => '8',
'label' => 'LBL_SHIPPING_ADDRESS_COUNTRY'),
'email1' => array('width' => '8',
'label' => 'LBL_EMAIL_ADDRESS_PRIMARY'),
'account_name' => array('width' => '15',
'label' => 'LBL_MEMBER_OF',
'sortable' => false),
'date_entered' => array('width' => '15',
'label' => 'LBL_DATE_ENTERED'),
'date_modified' => array('width' => '15',
'label' => 'LBL_DATE_MODIFIED'),
'created_by' => array('width' => '8',
'label' => 'LBL_CREATED'),
'assigned_user_name' => array('width' => '8',
'label' => 'LBL_LIST_ASSIGNED_USER'),
);
?>

View File

@@ -0,0 +1,47 @@
<?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 $app_strings;
$dashletMeta['MyAccountsDashlet'] = array('module' => 'Accounts',
'title' => translate('LBL_HOMEPAGE_TITLE', 'Accounts'),
'description' => 'A customizable view into Accounts',
'category' => 'Module Views',
'hidden' => true);
?>

View File

@@ -0,0 +1,78 @@
<?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/Dashlets/DashletGeneric.php');
class MyAccountsDashlet extends DashletGeneric {
function MyAccountsDashlet($id, $def = null) {
global $current_user, $app_strings;
require('modules/Accounts/Dashlets/MyAccountsDashlet/MyAccountsDashlet.data.php');
parent::DashletGeneric($id, $def);
if(empty($def['title'])) $this->title = translate('LBL_HOMEPAGE_TITLE', 'Accounts');
$this->searchFields = $dashletData['MyAccountsDashlet']['searchFields'];
$this->columns = $dashletData['MyAccountsDashlet']['columns'];
$this->seedBean = new Account();
}
/**
* Overrides the generic process to include custom logic for email addresses,
* since they are no longer stored in a list view friendly manner.
* (A record may have an undetermined number of email addresses).
*
* @param array $lvsParams
*/
function process($lvsParams = array()) {
if (isset($this->displayColumns) && array_search('email1', $this->displayColumns) !== false) {
$lvsParams['custom_select'] = ', email_address as email1';
$lvsParams['custom_from'] = "LEFT JOIN email_addr_bean_rel eabr ON eabr.deleted = 0 AND bean_module = 'Accounts' "
. "AND eabr.bean_id = accounts.id AND primary_address = 1 "
. "LEFT JOIN email_addresses ea ON ea.deleted = 0 AND ea.id = eabr.email_address_id";
}
parent::process($lvsParams);
}
}
?>

View File

@@ -0,0 +1,185 @@
//addresses
function saveItems2(){
document.getElementById('position_list2').value = ItemsList2(true);
}
function doRequest(where,post,doFunction,error) {
this.Display = function(result) { doFunction(result.responseText); }
this.Fail = function(result){ if(error) alert(error);}
YAHOO.util.Connect.asyncRequest('POST',where,{success:this.Display,failure:this.Fail},post);
}
function addEvent(object,eventName,do_function) {
if(typeof(object) == "string") object = document.getElementById(object);
if(!object) { alert('No object in function addEvent!'); return; }
if(object.addEventListener) {
object.addEventListener(eventName, do_function, false);
} else {
object.attachEvent('on'+eventName, do_function);
}
}
var tbody_;
var ItemListSave2;
var ItemListClear2;
var ItemListFil2;
var FillText;
addEvent(
window,
'load',
function() {
var paramsTable2 = new paramsMT('itemsTable2');
paramsTable2.onCreateRow = function(row) {
row.newPos = false;
row.noAddNew = true;
row.ondblclick = function() {}
row.onSelect = function() {
}
row.onDeselect = function() {
}
}
paramsTable2.onCreateCell = function(cell) {
var i = cell.index;
cell.change = function(select) {};
if(i == 0) {
cell.setData = function(data) {
if(data.product_group) {
cell.firstChild.value = data.product_group;
if (data.id)
cell.getElementsByTagName('input')[1].value = data.id;
}
};
cell.getData = function(data) {
data.product_group = cell.firstChild.value;
data.id = cell.getElementsByTagName('input')[1].value;
}
cell.onDeselect = function() {
ERROR = false;
var data = new Object();
this.getData(data);
if(!ERROR) {
data.product_group = data.product_group;
this.setData(data);
}
}
//cell.select = function() { this.selectNext(); }
//cell.selectNext = function() { var row = this.parentNode.selectNext(); row.select(); row.cells.item(i).select(); };
var edit = document.createElement('input');
edit.setAttribute('type','text');
edit.setAttribute('tabIndex',1);
edit.className = 'inputs';
cell.appendChild(edit);
var edit = document.createElement('input');
edit.setAttribute('type','hidden');
edit.setAttribute('readonly','readonly');
edit.setAttribute('tabIndex',1);
edit.className = 'inputs';
cell.appendChild(edit);
}
if(i == 1) {
cell.setData = function(data) {
if (data.discount)
cell.getElementsByTagName('input')[0].value = NumberToUserFormatNumber(data.discount);
};
cell.getData = function(data) {
data.discount = UserFormatNumberToNumber(cell.firstChild.value);
}
cell.onDeselect = function() {
ERROR = false;
var data = new Object();
this.getData(data);
if(!ERROR) {
data.discount = data.discount;
this.setData(data);
}
}
var edit = document.createElement('input');
edit.setAttribute('type','text');
edit.setAttribute('tabIndex',1);
edit.className = 'inputs';
edit.value = NumberToUserFormatNumber(0);
cell.appendChild(edit);
}
if(i == 2) {
var img;
cell.style.padding="auto auto auto auto";
//insert
img = document.createElement('img');
img.setAttribute('alt',MOD['LBL_INSERT_NEW_ROW']);
img.setAttribute('src','modules/EcmQuotes/images/insertrow.gif');
img.style.cursor = 'pointer';
img.onclick = function() {
this.parentNode.myTable.addRow(this.parentNode.parentNode.index+1);
refreshPositionIndex();
};
//delete
cell.appendChild(img);
cell.appendChild(document.createTextNode(" "));
img = document.createElement('img');
img.setAttribute('alt',MOD['LBL_DELETE_ROW']);
img.setAttribute('src','modules/EcmQuotes/images/deleterow.gif');
img.style.cursor = 'pointer';
img.onclick = function() { this.parentNode.parentNode.deleteRow(); refreshPositionIndex();};
cell.appendChild(img);
cell.appendChild(document.createTextNode(" "));
cell.appendChild(document.createElement('br'));
//move up
img = document.createElement('img');
img.setAttribute('alt',MOD['LBL_MOVE_ROW_UP']);
img.setAttribute('src','modules/EcmQuotes/images/moverowup.gif');
img.style.cursor = 'pointer';
img.onclick = function() { this.parentNode.parentNode.moveUp(); refreshPositionIndex();};
cell.appendChild(img);
cell.appendChild(document.createTextNode(" "));
//move down
img = document.createElement('img');
img.setAttribute('alt',MOD['LBL_MOVE_ROW_DOWN']);
img.setAttribute('src','modules/EcmQuotes/images/moverowdown.gif');
img.style.cursor = 'pointer';
img.onclick = function() { this.parentNode.parentNode.moveDown();refreshPositionIndex(); }
cell.appendChild(img);
}
}
ItemsList2 = function(json) {
var data = '';
for(var i=0; i<paramsTable2.rowCount(); i++) {
data = data + '||||' + JSON.stringifyNoSecurity(paramsTable2.row(i).getData());
}
return data;
}
if(paramsTable2.rowCount() == 0) {paramsTable2.addRow();};
paramsTable2.onSetCellData = function(row,cell,data) {
if(cell.innerHTML == '') cell.innerHTML = '&nbsp;';
}
ItemListFill2 = function() {
var pl;
pl = document.getElementById('position_list2').value;
console.log(pl);
if(pl && pl != '') {
try {
pl = eval(pl);
for(x in pl) { var pl_row = pl[x]; if (pl_row.template=='') continue; paramsTable2.addRow().setData(pl_row); }
} catch(err) { pl = null; };
}
}
ItemListClear2 = function(noNew,save) {
if(typeof(save)=="string") ItemListSave(null,save);
while(paramsTable2.rowCount()>0) paramsTable2.row(0).deleteRow(noNew);
}
ItemListClear2();
ItemListFill2();
}
);

View File

@@ -0,0 +1,57 @@
<?php
$pl = $this->bean->getPositionList();
$this->ss->assign('POSITION_LIST', $pl);
$pl2 = $this->bean->getPositionList2();
$this->ss->assign('POSITION_LIST2', $pl2);
$pl3 = $this->bean->getPositionList3();
$this->ss->assign('POSITION_LIST3', $pl3);
$pl55 = $this->bean->getPositionList55();
$this->ss->assign('POSITION_LIST55', $pl55);
global $mod_strings;
$json = getJSONobj();
//opt
$file = 'modules/EcmGroupSales/EcmGroupSale.php';
if(file_exists($file)) {
$cc = array();
require_once($file);
$cc = EcmGroupSale::loadSettings();
}
$OPT = array();
$OPT['row_item_height'] = $cc['row_item_height'];
$OPT['row_item_height_selected'] = $cc['row_item_height_selected'];
$OPT['rows_on_item_list'] = $cc['rows_on_item_list'];
$OPT['position_table_height'] = $OPT['row_item_height']*$OPT['rows_on_item_list']+40+$OPT['rows_on_item_list']*4;
$OPT['quick_product_item_adding'] = $cc['quick_product_item_adding'];
global $current_user;
$tmp = $current_user->getPreference('num_grp_sep');
if(!isset($tmp) || $tmp == '' || $tmp == NULL) $tmp = $sugar_config['default_number_grouping_seperator'];
$OPT['sep_1000'] = $tmp;
$tmp = $current_user->getPreference('dec_sep');
if(!isset($tmp) || $tmp == '' || $tmp == NULL) $tmp = $sugar_config['default_decimal_seperator'];
$OPT['dec_sep'] = $tmp;
$tmp = $current_user->getPreference('default_currency_significant_digits');
if(!isset($tmp) || $tmp == '' || $tmp == NULL) $tmp = $sugar_config['default_currency_significant_digits'];
$OPT['dec_len'] = $tmp;
echo '
<script language="javascript">
var OPT = '.str_replace('&quot;','\"',$json->encode($OPT)).';
var MOD = '.str_replace('&quot;','\"',$json->encode($mod_strings)).';
</script>';
global $app_strings;
$this->ss->assign('LBL_SAVE', $app_strings['LBL_SAVE_BUTTON_LABEL']);

View File

@@ -0,0 +1,322 @@
//addresses
function saveItems55() {
document.getElementById('position_list55').value = ItemsList55(true);
}
function doRequest(where, post, doFunction, error) {
this.Display = function(result) {
doFunction(result.responseText);
}
this.Fail = function(result) {
if (error)
alert(error);
}
YAHOO.util.Connect.asyncRequest('POST', where, {
success : this.Display,
failure : this.Fail
}, post);
}
function addEvent(object, eventName, do_function) {
if (typeof (object) == "string")
object = document.getElementById(object);
if (!object) {
alert('No object in function addEvent!');
return;
}
if (object.addEventListener) {
object.addEventListener(eventName, do_function, false);
} else {
object.attachEvent('on' + eventName, do_function);
}
}
var tbody_;
var ItemListSave2;
var ItemListClear2;
var ItemListFil2;
var FillText;
addEvent(
window,
'load',
function() {
var paramsTable2 = new paramsMT('itemsTable55');
paramsTable2.onCreateRow = function(row) {
row.newPos = false;
row.noAddNew = true;
row.ondblclick = function() {
}
row.onSelect = function() {
}
row.onDeselect = function() {
}
}
paramsTable2.onCreateCell = function(cell) {
var i = cell.index;
cell.change = function(select) {
};
if (i == 0) {
cell.setData = function(data) {
console.log(data);
if(data.product_group) {
cell.firstChild.value = data.product_group;
cell.getElementsByTagName('input')[1].value = data.cat_id;
if (data.id)
cell.getElementsByTagName('input')[2].value = data.id;
}
};
cell.getData = function(data) {
data.product_group = cell.firstChild.value;
data.cat_id = cell.getElementsByTagName('input')[1].value;
data.id = cell.getElementsByTagName('input')[2].value;
}
cell.onDeselect = function() {
ERROR = false;
var data = new Object();
this.getData(data);
if (!ERROR) {
this.setData(data);
}
var cn = this.getElementsByTagName('input');
cn[0].name = '';
cn[0].id = '';
cn[1].name = '';
cn[1].id = '';
}
cell.onSelect = function() {
var cn = this.getElementsByTagName('input');
cn[0].name = 'name_mailinggroup';
cn[0].id = 'name_mailinggroup';
cn[1].name = 'id_mailinggroup';
cn[1].id = 'id_mailinggroup';
}
// cell.select = function() { this.selectNext(); }
// cell.selectNext = function() { var row =
// this.parentNode.selectNext(); row.select();
// row.cells.item(i).select(); };
var edit = document.createElement('input');
edit.setAttribute('type', 'text');
edit.setAttribute('tabIndex', 1);
edit.className = 'inputs';
cell.appendChild(edit);
var edit = document.createElement('input');
edit.setAttribute('type', 'hidden');
edit.setAttribute('readonly', 'readonly');
edit.setAttribute('tabIndex', 1);
edit.className = 'inputs';
cell.appendChild(edit);
var edit = document.createElement('input');
edit.setAttribute('type', 'hidden');
edit.setAttribute('readonly', 'readonly');
edit.setAttribute('tabIndex', 1);
edit.className = 'inputs';
cell.appendChild(edit);
var img = document.createElement('img');
img.setAttribute('alt', 'Search');
img.setAttribute('src',
'modules/EcmQuotes/images/search.gif');
img.style.cursor = 'pointer';
if(module_sugar_grp1=='Accounts'){
var formType='Accounts';
}
if(module_sugar_grp1=='Leads'){
var formType='Accounts';
}
if(module_sugar_grp1=='Contacts'){
var formType='Contacts';
}
if(module_sugar_grp1=='ContactLeads'){
var formType='Contacts';
}
img.onclick = function() {
var ecmpopup = open_popup("EcmMailingCategories", 600,
400, "&type_advanced="+formType, true, false, {
"call_back_function" : "set_return",
"form_name" : "EditView",
"field_to_name_array" : {
"id" : "id_mailinggroup",
"name" : "name_mailinggroup"
}
}, "single", true);
setTimeout(function() {
ecmpopup.focus();
}, 200);
}
cell.appendChild(img);
}
if (i == 1) {
cell.setData = function(data) {
if (data.discount!=1){
cell.getElementsByTagName('input')[0].checked = false;
}
};
cell.getData = function(data) {
data.discount = UserFormatNumberToNumber(cell.firstChild.value);
}
cell.onDeselect = function() {
ERROR = false;
var data = new Object();
this.getData(data);
if (!ERROR) {
data.discount = data.discount;
this.setData(data);
}
}
var edit = document.createElement('input');
edit.setAttribute('type', 'checkbox');
edit.setAttribute('tabIndex', 1);
edit.className = 'inputs';
edit.checked = true;
edit.value = 1;
cell.appendChild(edit);
}
if (i == 2) {
var img;
cell.style.padding = "auto auto auto auto";
// insert
img = document.createElement('img');
img.setAttribute('alt','ADD');
img.setAttribute('src',
'modules/EcmQuotes/images/insertrow.gif');
img.style.cursor = 'pointer';
img.onclick = function() {
this.parentNode.myTable
.addRow(this.parentNode.parentNode.index + 1);
refreshPositionIndex();
};
// delete
cell.appendChild(img);
cell.appendChild(document.createTextNode(" "));
img = document.createElement('img');
img.setAttribute('alt', 'DELETE');
img.setAttribute('src',
'modules/EcmQuotes/images/deleterow.gif');
img.style.cursor = 'pointer';
img.onclick = function() {
this.parentNode.parentNode.deleteRow();
refreshPositionIndex();
};
cell.appendChild(img);
cell.appendChild(document.createTextNode(" "));
cell.appendChild(document.createElement('br'));
// move up
img = document.createElement('img');
img.setAttribute('alt','UP');
img.setAttribute('src',
'modules/EcmQuotes/images/moverowup.gif');
img.style.cursor = 'pointer';
img.onclick = function() {
this.parentNode.parentNode.moveUp();
refreshPositionIndex();
};
cell.appendChild(img);
cell.appendChild(document.createTextNode(" "));
// move down
img = document.createElement('img');
img.setAttribute('alt', 'DOWN');
img.setAttribute('src',
'modules/EcmQuotes/images/moverowdown.gif');
img.style.cursor = 'pointer';
img.onclick = function() {
this.parentNode.parentNode.moveDown();
refreshPositionIndex();
}
cell.appendChild(img);
}
}
ItemsList55 = function(json) {
var data = '';
for (var i = 0; i < paramsTable2.rowCount(); i++) {
var a=0;
var data2=new Object();
$(paramsTable2.row(i)).find("td input").each(function() {
if(a==3){
if($(this).prop("checked")==true){
data2.discount=1;
} else {
data2.discount=0;
}
}
if(a==0){
data2.product_group=$(this).val();
}
if(a==1){
data2.cat_id=$(this).val();
}
if(a==2){
data2.id=$(this).val();
}
a++;
});
data = data
+ '||||'
+ JSON.stringifyNoSecurity(data2);
}
return data;
}
if (paramsTable2.rowCount() == 0) {
paramsTable2.addRow();
}
;
paramsTable2.onSetCellData = function(row, cell, data) {
if (cell.innerHTML == '')
cell.innerHTML = '&nbsp;';
}
ItemListFill2 = function() {
var pl;
pl = document.getElementById('position_list55').value;
console.log(pl);
if (pl && pl != '') {
try {
pl = eval(pl);
for (x in pl) {
var pl_row = pl[x];
if (pl_row.template == '')
continue;
paramsTable2.addRow().setData(pl_row);
}
} catch (err) {
pl = null;
}
;
}
}
ItemListClear2 = function(noNew, save) {
if (typeof (save) == "string")
ItemListSave(null, save);
while (paramsTable2.rowCount() > 0)
paramsTable2.row(0).deleteRow(noNew);
}
ItemListClear2();
ItemListFill2();
});

53
modules/Accounts/Menu.php Executable file
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".
********************************************************************************/
/*********************************************************************************
* Description: TODO To be written.
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
********************************************************************************/
global $mod_strings, $app_strings, $sugar_config;
if(ACLController::checkAccess('Accounts', 'edit', true))$module_menu[]=Array("index.php?module=Accounts&action=EditView&return_module=Accounts&return_action=index", $mod_strings['LNK_NEW_ACCOUNT'],"CreateAccounts", 'Accounts');
if(ACLController::checkAccess('Accounts', 'list', true))$module_menu[]=Array("index.php?module=Accounts&action=index&return_module=Accounts&return_action=DetailView", $mod_strings['LNK_ACCOUNT_LIST'],"Accounts", 'Accounts');
if(ACLController::checkAccess('Accounts', 'import', true))$module_menu[]=Array("index.php?module=Import&action=Step1&import_module=Accounts&return_module=Accounts&return_action=index", $mod_strings['LNK_IMPORT_ACCOUNTS'],"Import", 'Accounts');
if(ACLController::checkAccess('Accounts', 'import', true))$module_menu[]=Array("index.php?module=Accounts&action=voip_test", "VOIP STATUS","VOIP STATUS", 'Accounts');
?>

View File

@@ -0,0 +1,135 @@
<?php
ini_set('display_errors',1);
$db=$GLOBALS['db'];
function escape($value) {
$return = '';
for($i = 0; $i < strlen($value); ++$i) {
$char = $value[$i];
$ord = ord($char);
if($char !== "'" && $char !== "\"" && $char !== '\\' && $ord >= 32 && $ord <= 126)
$return .= $char;
else
$return .= '\\x' . dechex($ord);
}
return $return;
}
if($_GET['record']!=''){
// id nie jest puste? jedziemy i szukamy accountsa ...
$r=$db->query("select contact_id,id,date_modified,deleted from accounts_contacts where account_id='".$_GET['record']."'");
if($r->num_rows>0){
// o jest kontakt!
while($row=$db->fetchByAssoc($r)){
// wybieranie ścierwa
$ct=$db->query("select * from contacts where id='".$row['contact_id']."'");
while($row2=$db->fetchByAssoc($ct)){
// przenoszenie ścierwa ...
$db->query("delete from contactleads where id='".$row2['id']."'");
$db->query("INSERT INTO `contactleads` VALUES('".implode("','",array_map('escape', $row2))."')");
// echo "INSERT INTO `contacts` VALUES('".implode("','",$row2)."')";
// usuwanie starego ścierwa ...
$db->query("delete from contacts where id='".$row2['id']."'");
// szukanie emaili...
$mail=$db->query("select * from email_addr_bean_rel where bean_id='".$row2['id']."'");
if($mail->num_rows>0){
// o jest email!
while($mu=$db->fetchByAssoc($mail)){
// podmianka relacji na kontakt
$db->query("update email_addr_bean_rel set bean_module='contacts' where id='".$mu['id']."'");
}
}
}
}
}
// die();
// asasa$$$
$l=$db->query("select * from accounts where id='".$_GET['record']."'");
$pola=array();
$wartosci=array();
while($daj=$db->fetchByAssoc($l)){
foreach ($daj as $pole=>$wartosc){
if($pole=='account_type')$pole='lead_type';
if($pole=='ecmprice_id')continue;
if($pole=='website_update')continue;
if($pole=='document_recipient_code')continue;
if($pole=='document_parent_order_no')continue;
if($pole=='document_delivery_address')continue;
if($pole=='invoice_to_ownership')continue;
if($pole=='document_parent_iln')continue;
if($pole=='document_parent_nip')continue;
if($pole=='document_shipping_iln')continue;
if($pole=='document_shipping_nip')continue;
if($pole=='document_bank_account')continue;
if($pole=='document_parent_code')continue;
if($pole=='document_ean')continue;
$pola[]=$pole;
$wartosci[]=$wartosc;
}
$r=$db->query("select * from leads where id='".$_GET['record']."'");
if($r->num_rows==1)$db->query("delete from leads where id='".$_GET['record']."'");
$db->query("INSERT INTO `leads` (".implode(",",$pola).") VALUES ('".implode("','",$wartosci)."')");
$db->query("update accounts set deleted='1' where id='".$daj['id']."'");
}
// notatki
$n1=$db->query("select * from notes where parent_id='".$_GET['record']."'");
if($n1->num_rows>0){
while($nt=$db->fetchByAssoc($n1)){
$db->query("update notes set parent_type='Accounts' where id='".$nt['id']."'");
}
}
// przenoszenie emaila
$mail=$db->query("select * from email_addr_bean_rel where bean_id='".$_GET['record']."'");
if($mail->num_rows>0){
// o jest email!
while($mu=$db->fetchByAssoc($mail)){
// podmianka relacji na kontrahenta
$db->query("update email_addr_bean_rel set bean_module='Accounts' where bean_id='".$_GET['record']."'");
}
}
$mail=$db->query("select * from ecmaccountcategories_bean where bean_id='".$_GET['record']."'");
if($mail->num_rows>0){
// o jest email!
while($mu=$db->fetchByAssoc($mail)){
// podmianka relacji na kontrahenta
$db->query("update ecmaccountcategories_bean set bean_name='Accounts' where bean_id='".$_GET['record']."'");
}
}
// relacja kontrahent kontakt
$rr=$db->query("SELECT * FROM accounts_contacts where account_id='".$_GET['record']."'");
if($rr->num_rows>0){
// o jest email!
while($re=$db->fetchByAssoc($rr)){
$re['deleted']='0';
$db->query("delete from leads_contactleads where lead_id='".$re['id']."'");
$db->query("INSERT INTO `leads_contactleads` VALUES('".implode("','",$re)."')");
$db->query("delete from accounts_contacts where account_id='".$_GET['record']."'");
}
}
// relacja adresy
$ad=$db->query("SELECT * FROM account_addresses where account_id='".$_GET['record']."'");
if($ad->num_rows>0){
// o jest email!
while($re=$db->fetchByAssoc($ad)){
// podmianka relacji na kontrahenta
$db->query("delete from lead_addresses where lead_id='".$re['id']."'");
$db->query("INSERT INTO `lead_addresses` VALUES('".implode("','",$re)."')");
$db->query("delete from account_addresses where account_id='".$_GET['record']."'");
}
}
// szukanie kontaktów
header("Location: index.php?module=Leads&action=DetailView&record=".$_GET['record']);
}
?>

2308
modules/Accounts/MyTable.js Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,139 @@
<!--
/*********************************************************************************
* 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".
********************************************************************************/
-->
<!-- BEGIN: main -->
<!-- BEGIN: SearchHeader -->
<script type="text/javascript" src="include/JSON.js?s={SUGAR_VERSION}&c={JS_CUSTOM_VERSION}"></script>
<script type="text/javascript" src="include/javascript/popup_helper.js?s={SUGAR_VERSION}&c={JS_CUSTOM_VERSION}"></script>
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="edit view">
<tr>
<td>
<form action="index.php" method="post" name="popup_query_form" id="popup_query_form">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td scope="row" nowrap="nowrap">{MOD.LBL_ACCOUNT_NAME}</td>
<td nowrap="nowrap"><input type="text" size="20" name="name" value="{NAME}" /></td>
<td scope="row" nowrap="nowrap">{MOD.LBL_CITY}</td>
<td nowrap="nowrap"><input type="text" size="20" name="billing_address_city" value="{BILLING_ADDRESS_CITY}" /></td>
</tr>
<tr>
<td scope="row" nowrap="nowrap">{MOD.LBL_PHONE_OFFICE}</td>
<td nowrap="nowrap"><input type="text" size="20" name="phone_office" value="{PHONE_OFFICE}" /></td>
<td>
</td>
<td width="20%" align="right">
<input type="hidden" name="module" value="{MODULE_NAME}" />
<input type="hidden" name="action" value="Popup" />
<input type="hidden" name="query" value="true" />
<input type="hidden" name="func_name" value="" />
<input type="hidden" name="request_data" value="{request_data}" />
<input type="hidden" name="populate_parent" value="false" />
<input type="hidden" name="hide_clear_button" value="true" />
<input type="hidden" name="record_id" value="" />
<input type="submit" name="button" class="button"
title="{APP.LBL_SEARCH_BUTTON_TITLE}"
accessKey="{APP.LBL_SEARCH_BUTTON_KEY}"
value="{APP.LBL_SEARCH_BUTTON_LABEL}" />
<input type="hidden" name="mode" value="{MULTI_SELECT}" />
<input type="hidden" name="create" value="{CREATE}">
</td>
</tr>
</table>
</form>
</td>
</tr>
</table>
<script type="text/javascript">
<!--
/* initialize the popup request from the parent */
if(window.document.forms['popup_query_form'].request_data.value == "")
{
window.document.forms['popup_query_form'].request_data.value
= JSON.stringify(window.opener.get_popup_request_data());
}
-->
</script>
<p>
<div id='addformlink'>{CREATEBUTTON}</div>
<div id='addform' style='display:none;position:relative;z-index:2;left:0px;top:0px;'>
<form name="AccountSave" onsubmit="return check_form('AccountSave');" method="post" action="index.php">
{ADDFORMHEADER}
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="edit view">
<tr>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><td>
<input type="hidden" name="module" value="{MODULE_NAME}" />
<input type="hidden" name="action" value="Popup" />
<input type="hidden" name="doAction" value="save" />
<input type="hidden" name="query" value="true" />
{ADDFORM}
</td></tr>
</table></td></tr></table>
</form>
</div>
</p>
<!-- END: SearchHeader -->
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="list view">
<!-- BEGIN: list_nav_row -->
{PAGINATION}
<!-- END: list_nav_row -->
<tr height="20">
<th scope="col" nowrap="nowrap">{CHECKALL}</th>
<th scope="col" width="45%"><a href="{ORDER_BY}name">{MOD.LBL_LIST_ACCOUNT_NAME}{arrow_start}{name_arrow}{arrow_end}</a></th>
<th scope="col" width="35%"><a href="{ORDER_BY}BILLING_ADDRESS_CITY">{MOD.LBL_LIST_CITY}{arrow_start}{BILLING_ADDRESS_CITY_arrow}{arrow_end}</a></th>
<th scope="col" width="30%"><a href="{ORDER_BY}PHONE_OFFICE">{MOD.LBL_PHONE_OFFICE}{arrow_start}{PHONE_OFFICE_arrow}{arrow_end}</a></th>
</tr>
<!-- BEGIN: row -->
<tr height="20" class="{ROW_COLOR}S1">
<td valign='top'>{PREROW}</td>
<td scope='row' valign="top"><{TAG_TYPE} href="#" onclick="send_back('Accounts','{ACCOUNT.ID}');" >{ACCOUNT.NAME}</{TAG_TYPE}></td>
<td valign="top">{ACCOUNT.CITY}</td>
<td valign="top">{ACCOUNT.PHONE_OFFICE}</td>
</tr>
<!-- END: row -->
{PAGINATION}
</table>
{ASSOCIATED_JAVASCRIPT_DATA}
<!-- END: main -->

94
modules/Accounts/Save.php Normal file
View File

@@ -0,0 +1,94 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 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: Saves an Account record and then redirects the browser to the
* defined return URL.
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
********************************************************************************/
$json = getJSONobj();
$pll = array();
$exp=explode("||||",$_POST['position_list']);
foreach($exp as $ep){
if($ep){
$pll[] = $json->decode(htmlspecialchars_decode($ep));
}
}
$_POST['position_list'] = $pll;
$pll = array();
$exp=explode("||||",$_POST['position_list2']);
foreach($exp as $ep){
if($ep){
$pll[] = $json->decode(htmlspecialchars_decode($ep));
}
}
$_POST['position_list2'] = $pll;
//categories
$pll = array();
$exp=explode("||||",$_POST['position_list3']);
foreach($exp as $ep){
if($ep){
$pll[] = $json->decode(htmlspecialchars_decode($ep));
}
}
$_POST['position_list3'] = $pll;
global $current_user;
//categories
$pll = array();
$exp=explode("||||",$_POST['position_list55']);
foreach($exp as $ep){
if($ep){
$pll[] = $json->decode(htmlspecialchars_decode($ep));
}
}
$_POST['position_list55'] = $pll;
require_once('modules/Accounts/AccountFormBase.php');
$accountForm = new AccountFormBase();
$prefix = empty($_REQUEST['dup_checked']) ? '' : 'Accounts';
$accountForm->handleSave($prefix, true, false);
?>

View File

@@ -0,0 +1,72 @@
<!--
/*********************************************************************************
* 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".
********************************************************************************/
/*********************************************************************************
* {APP.LBL_CURRENCY_SYM}Header: /cvsroot/sugarcrm/sugarcrm/modules/Contacts/EditView.html,v 1.22 2004/07/16 04:04:42 sugarclint Exp {APP.LBL_CURRENCY_SYM}
********************************************************************************/
-->
<!-- BEGIN: main -->
<!-- BEGIN: error -->
<span class="color">{ERROR}</span>
<!-- END: error -->
<form action='index.php' method='post' name='Save'>
<input type="hidden" name="module" value="Accounts">
<input type="hidden" name="return_module" value="{RETURN_MODULE}">
<input type="hidden" name="return_action" value="{RETURN_ACTION}">
<input type="hidden" name="return_id" value="{RETURN_ID}">
<input type="hidden" name="dup_checked" value="true">
<input type="hidden" name="action" value="">
{INPUT_FIELDS}
<p>
<table class='{TABLECLASS}' cellpadding="0" cellspacing="0" width="100%" border="0" >
<tr><td>
<table cellpadding="0" cellspacing="0" width="100%" border="0">
<tr>
<td valign='top' align='left' border='0' class="{CLASS}">
<h4 class="{CLASS}">{FORMHEADER}</h4>
</td>
</tr>
<tr>
<td valign='top' align='left'>
{FORMBODY}{FORMFOOTER}{POSTFORM}
</td>
</tr>
</table>
</td></tr>
</table>
</p>
<!-- END: main -->

View File

@@ -0,0 +1,147 @@
<?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".
********************************************************************************/
// retrieve $_POST values out of the $_SESSION variable - placed in there by AccountFormBase to avoid the length limitations on URLs implicit with GETS
//$GLOBALS['log']->debug('ShowDuplicates.php: _POST = '.print_r($_SESSION['SHOW_DUPLICATES'],true));
parse_str($_SESSION['SHOW_DUPLICATES'],$_POST);
unset($_SESSION['SHOW_DUPLICATES']);
//$GLOBALS['log']->debug('ShowDuplicates.php: _POST = '.print_r($_POST,true));
global $app_strings;
global $app_list_strings;
$error_msg = '';
global $current_language;
$mod_strings = return_module_language($current_language, 'Accounts');
echo get_module_title($mod_strings['LBL_MODULE_NAME'], $mod_strings['LBL_MODULE_NAME'].": ".$mod_strings['LBL_SAVE_ACCOUNT'], true);
$xtpl=new XTemplate ('modules/Accounts/ShowDuplicates.html');
$xtpl->assign("MOD", $mod_strings);
$xtpl->assign("APP", $app_strings);
$xtpl->assign("PRINT_URL", "index.php?".$GLOBALS['request_string']);
$xtpl->assign("MODULE", $_REQUEST['module']);
if ($error_msg != '')
{
$xtpl->assign("ERROR", $error_msg);
$xtpl->parse("main.error");
}
if((isset($_REQUEST['popup']) && $_REQUEST['popup'] == 'true') ||(isset($_POST['popup']) && $_POST['popup']==true)) insert_popup_header($theme);
$account = new Account();
require_once('modules/Accounts/AccountFormBase.php');
$accountForm = new AccountFormBase();
$GLOBALS['check_notify'] = FALSE;
$query = 'select id, name, website, billing_address_city from accounts where deleted=0 ';
$duplicates = $_POST['duplicate'];
$count = count($duplicates);
if ($count > 0)
{
$query .= "and (";
$first = true;
foreach ($duplicates as $duplicate_id)
{
if (!$first) $query .= ' OR ';
$first = false;
$query .= "id='$duplicate_id' ";
}
$query .= ')';
}
$duplicateAccounts = array();
$db = DBManagerFactory::getInstance();
$result = $db->query($query);
$i=-1;
while(($row=$db->fetchByAssoc($result)) != null) {
$i++;
$duplicateAccounts[$i] = $row;
}
$xtpl->assign('FORMBODY', $accountForm->buildTableForm($duplicateAccounts, 'Accounts'));
$input = '';
foreach ($account->column_fields as $field)
{
if (!empty($_POST['Accounts'.$field])) {
$value = urldecode($_POST['Accounts'.$field]);
$input .= "<input type='hidden' name='$field' value='{$value}'>\n";
}
}
foreach ($account->additional_column_fields as $field)
{
if (!empty($_POST['Accounts'.$field])) {
$value = urldecode($_POST['Accounts'.$field]);
$input .= "<input type='hidden' name='$field' value='{$value}'>\n";
}
}
$emailAddress = new SugarEmailAddress();
$input .= $emailAddress->getEmailAddressWidgetDuplicatesView($account);
$get = '';
if(!empty($_POST['return_module'])) $xtpl->assign('RETURN_MODULE', $_POST['return_module']);
else $get .= "Accounts";
$get .= "&return_action=";
if(!empty($_POST['return_action'])) $xtpl->assign('RETURN_ACTION', $_POST['return_action']);
else $get .= "DetailView";
if(!empty($_POST['return_id'])) $xtpl->assign('RETURN_ID', $_POST['return_id']);
if(!empty($_POST['popup']))
$input .= '<input type="hidden" name="popup" value="'.$_POST['popup'].'">';
else
$input .= '<input type="hidden" name="popup" value="false">';
if(!empty($_POST['to_pdf']))
$input .= '<input type="hidden" name="to_pdf" value="'.$_POST['to_pdf'].'">';
else
$input .= '<input type="hidden" name="to_pdf" value="false">';
if(!empty($_POST['create']))
$input .= '<input type="hidden" name="create" value="'.$_POST['create'].'">';
else
$input .= '<input type="hidden" name="create" value="false">';
$xtpl->assign('INPUT_FIELDS',$input);
$xtpl->parse('main');
$xtpl->out('main');
?>

View File

@@ -0,0 +1,11 @@
<?php
class CustomAccountsController extends SugarController
{
public function action_showMap() {
if ( !empty($_REQUEST['uid']) ) {
header('Location: index.php?module=Accounts&action=showMap');
}
sugar_die('');
}
}

View File

@@ -0,0 +1,207 @@
<?php
$db=$GLOBALS['db'];
$not_in =
"UPPER(name) NOT LIKE 'MARCPOL%' AND
UPPER(name) NOT LIKE 'KAUFLAND%' AND
UPPER(name) NOT LIKE 'EURO%NET%' AND
UPPER(name) NOT LIKE 'CARREFOUR%' AND
UPPER(name) NOT LIKE 'MEDIA EXPERT%' AND
UPPER(name) NOT LIKE 'AMAZON%' AND
UPPER(name) NOT LIKE '%CZERWONA%' AND
UPPER(name) NOT LIKE 'AGD MARKET%' AND
UPPER(name) NOT LIKE 'DROGERIA NATURA%' AND
UPPER(name) NOT LIKE 'POLOMARKET%' AND
UPPER(name) NOT LIKE 'NORAUTO%'";
$acc = $db->query("SELECT * FROM accounts WHERE deleted='0' AND ".$not_in." order by date_entered");
$accounts = array();
while ($a = $db->fetchByAssoc($acc)) {
$docs = false;
$doc = $db->query("SELECT id FROM ecminvoiceouts where parent_id='".$a['id']."'");
if ($doc->num_rows>0) {
$docs = true;
//echo $a['name'].' FV<br>';
} else $no_inv = true;
$doc = $db->query("SELECT id FROM ecmpurchaseorders where parent_id='".$a['id']."'");
if ($doc->num_rows>0) {
$docs = true;
//echo $a['name'].' PO<br>';
}
$doc = $db->query("SELECT id FROM documents where parent_id='".$a['id']."'");
if ($doc->num_rows>0) {
$docs = true;
//echo $a['name'].' DMS<br>';
}
$doc = $db->query("SELECT id FROM ecmsales where parent_id='".$a['id']."'");
if ($doc->num_rows>0) {
$so = true;
//echo $a['name'].' ZS<br>';
}
$doc = $db->query("SELECT id FROM ecmstockdocouts where parent_id='".$a['id']."'");
if ($doc->num_rows>0) {
$docs = true;
//echo $a['name'].' WZ<br>';
} else $no_wz = true;
$doc = $db->query("SELECT id FROM ecmstockdocins where parent_id='".$a['id']."'");
if ($doc->num_rows>0) {
$docs = true;
//echo $a['name'].' PZ<br>';
}
if ($docs) {
continue;
}
if ($no_inv && $no_wz && $so) {
echo $a['name'].'<br>';
$accounts[] = $a['id'];
}
}
echo sizeof($accounts);
return;
foreach ($accounts as $id) {
// copyAccount($id);
/*
$res = $db->query("SELECT * FROM ecmaccountcategories_bean WHERE bean_id='$id'");
if ($res->num_rows > 0) {
$a = new Account();
$a->retrieve($id);
echo $a->name.'<br>';
unset($a);
}
*/
}
return;
function copyAccount($id) {
$db=$GLOBALS['db'];
$_GET['record'] = $id;
if($_GET['record']!=''){
// id nie jest puste? jedziemy i szukamy leadsa ...
$r=$db->query("select contact_id,id,date_modified,deleted from accounts_contacts where account_id='".$_GET['record']."' and deleted='0'");
if($r->num_rows>0){
while($row=$db->fetchByAssoc($r)){
$ct=$db->query("select * from contacts where id='".$row['contact_id']."' and deleted='0'");
while($row2=$db->fetchByAssoc($ct)){
$db->query("update accounts_contacts set deleted='1' where id='".$row2['id']."' and deleted='0'");
$mail=$db->query("select * from email_addr_bean_rel where bean_id='".$row2['id']."' and deleted='0'");
if($mail->num_rows>0){
while($mu=$db->fetchByAssoc($mail)){
$db->query("update email_addr_bean_rel set bean_module='Contacts' where id='".$mu['id']."' and deleted='0'");
}
}
}
}
}
$l=$db->query("select * from accounts where id='".$_GET['record']."' and deleted='0'");
$l2=$db->query("describe leads");
$pola2=array();
while($daj2=$db->fetchByAssoc($l2)){
$pola2[]=$daj2['Field'];
}
$pola=array();
$wartosci=array();
while($daj=$db->fetchByAssoc($l)){
foreach ($daj as $pole=>$wartosc){
if($pole=='account_type')$pole='lead_type';
if(in_array($pole,$pola2)==false)continue;
if($pole=='ecmprice_id')continue;
if($pole=='website_update')continue;
if($pole=='document_recipient_code')continue;
if($pole=='document_parent_order_no')continue;
if($pole=='document_delivery_address')continue;
if($pole=='invoice_to_ownership')continue;
if($pole=='shop_number')continue;
if($pole=='krs')continue;
if($pole=='regon')continue;
if($pole=='document_parent_iln' || $pole=='document_shipping_iln' || $pole=='document_bank_account' || $pole=='document_parent_code' || $pole=='document_ean')continue;
$pola[]=$pole;
$wartosci[]=$wartosc;
}
$db->query("INSERT INTO `leads` (".implode(",",$pola).") VALUES ('".implode("','",$wartosci)."')");
$db->query("update accounts set deleted='1' where id='".$daj['id']."'");
}
// notatki
$n1=$db->query("select * from notes where parent_id='".$_GET['record']."' and deleted='0'");
if($n1->num_rows>0){
while($nt=$db->fetchByAssoc($n1)){
$db->query("update notes set parent_type='Leads' where id='".$nt['id']."'");
}
}
//oferty
$n1=$db->query("select * from ecmquotes where parent_id='".$_GET['record']."' and deleted='0'");
if($n1->num_rows>0){
while($nt=$db->fetchByAssoc($n1)){
$db->query("update ecmquotes set parent_type='Leads' where id='".$nt['id']."'");
}
}
//calls
$n1=$db->query("select * from calls where parent_id='".$_GET['record']."' and deleted='0'");
if($n1->num_rows>0){
while($nt=$db->fetchByAssoc($n1)){
$db->query("update calls set parent_type='Leads' where id='".$nt['id']."'");
}
}
//tasks
$n1=$db->query("select * from tasks where parent_id='".$_GET['record']."' and deleted='0'");
if($n1->num_rows>0){
while($nt=$db->fetchByAssoc($n1)){
$db->query("update tasks set parent_type='Leads' where id='".$nt['id']."'");
}
}
//meetings
$n1=$db->query("select * from meetings where parent_id='".$_GET['record']."' and deleted='0'");
if($n1->num_rows>0){
while($nt=$db->fetchByAssoc($n1)){
$db->query("update meetings set parent_type='Leads' where id='".$nt['id']."'");
}
}
//kategorie kontaktów
$n1=$db->query("select * from ecmaccountcategories_bean where bean_id='".$_GET['record']."' and deleted='0'");
if($n1->num_rows>0){
while($nt=$db->fetchByAssoc($n1)){
$db->query("update ecmaccountcategories_bean set bean_name='Leads' where id='".$nt['id']."'");
}
}
// przenoszenie emaila
$mail=$db->query("select * from email_addr_bean_rel where bean_id='".$_GET['record']."' and deleted='0'");
if($mail->num_rows>0){
// o jest email!
while($mu=$db->fetchByAssoc($mail)){
// podmianka relacji na kontrahenta
$db->query("update email_addr_bean_rel set bean_module='Leads' where bean_id='".$_GET['record']."'");
}
}
// relacja kontrahent kontakt
$rr=$db->query("SELECT * FROM accounts_contacts where account_id='".$_GET['record']."' and deleted='0'");
if($rr->num_rows>0){
// o jest email!
while($re=$db->fetchByAssoc($rr)){
// podmianka relacji na kontrahenta
$db->query("INSERT INTO `leads_contactleads` VALUES('".implode("','",$re)."')");
$db->query("update accounts_contacts set deleted='1' where lead_id='".$_GET['record']."'");
}
}
// relacja adresy
$ad=$db->query("SELECT * FROM account_addresses where account_id='".$_GET['record']."' and deleted='0'");
if($ad->num_rows>0){
// o jest email!
while($re=$db->fetchByAssoc($ad)){
// podmianka relacji na kontrahenta
$db->query("INSERT INTO `lead_addresses` VALUES('".implode("','",$re)."')");
$db->query("update account_addresses set deleted='1' where account_id='".$_GET['record']."'");
}
}
}
}
?>

View File

@@ -0,0 +1,93 @@
<?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: Contains field arrays that are used for caching
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
********************************************************************************/
$fields_array['Account'] = array ('column_fields' => Array(
"annual_revenue"
,"billing_address_street"
,"billing_address_city"
,"billing_address_state"
,"billing_address_postalcode"
,"billing_address_country"
,"date_entered"
,"date_modified"
,"modified_user_id"
,"assigned_user_id"
,"description"
,"email1"
,"email2"
,"employees"
,"id"
,"industry"
,"name"
,"ownership"
,"parent_id"
,"phone_alternate"
,"phone_fax"
,"phone_office"
,"rating"
,"shipping_address_street"
,"shipping_address_city"
,"shipping_address_state"
,"shipping_address_postalcode"
,"shipping_address_country"
,"sic_code"
,"ticker_symbol"
,"account_type"
,"website"
, "created_by"
),
'list_fields' => Array('id', 'name', 'website', 'phone_office', 'assigned_user_name', 'assigned_user_id'
, 'billing_address_street'
, 'billing_address_city'
, 'billing_address_state'
, 'billing_address_postalcode'
, 'billing_address_country'
, 'shipping_address_street'
, 'shipping_address_city'
, 'shipping_address_state'
, 'shipping_address_postalcode'
, 'shipping_address_country'
),
'required_fields' => array("name"=>1),
);
?>

View File

@@ -0,0 +1,10 @@
<?php
include_once("modules/Accounts/Account.php");
$a=new Account();
if ($_GET['id']) {
$id = $_GET['id'];
$json = getJSONobj();
echo $json->encode($a->getAddress($id));
} else echo 0;
?>

View File

@@ -0,0 +1,8 @@
<?php
include_once("modules/Accounts/Account.php");
$a=new Account();
if ($_GET['account_id']) {
$account_id = $_GET['account_id'];
echo $a->getAddresses($account_id);
} else echo 0;
?>

View File

@@ -0,0 +1,43 @@
$(document)
.ready(
function() {
var mapProp = {
center : new google.maps.LatLng(52.05, 19.45),
zoom : 6,
mapTypeId : google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document
.getElementById("googleMapContainer"), mapProp);
var markers = JSON.parse(b64_to_utf8($('#googleMapMarkers')
.val()));
$.each(markers, function(index, m) {
var marker = new google.maps.Marker({
position : new google.maps.LatLng(m.lat, m.lng),
url : '/',
animation : google.maps.Animation.DROP,
customInfo : m.info,
title : m.title,
map : map
});
google.maps.event.addListener(marker, 'click',
markerClickFunction);
});
function markerClickFunction() {
infowindow = new google.maps.InfoWindow({
content : this.customInfo
});
infowindow.open(map, this);
closeInfoWindow(infowindow);
}
function closeInfoWindow(infoWindow) {
setTimeout(function() {
infoWindow.close();
}, 8000);
}
});
function b64_to_utf8(str) {
return decodeURIComponent(escape(window.atob(str)));
}

View File

@@ -0,0 +1,247 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
/*********************************************************************************
* Description: Defines the English language pack for the base application.
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
********************************************************************************/
$mod_strings = array (
//add mz
'LBL_KRS' => 'KRS',
'LBL_REGON' => 'REGON',
'LBL_SHOP_NUMBER' => 'Shop number',
'LBL_DOCUMENT_BANK_ACCOUNT' => 'Bank account',
'LBL_PANEL_DOC_SETTINGS' => 'Document settings',
'LBL_INVOICE_TO_OWNERSHIP' => 'Invoice to ownership',
'LBL_DOCUMENT_DELIVERY_ADDRESS' => 'Required delivery address',
'LBL_DOCUMENT_RECIPIENT_CODE' => 'Required recipient code',
'LBL_DOCUMENT_PARENT_ORDER_NO' => 'Required buyer order number',
'LBL_DOCUMENT_PARENT_ILN' => 'Required ILN number',
'LBL_DOCUMENT_SHIPPING_ILN' => 'Required shipping ILN number',
'LBL_DOCUMENT_PARENT_NIP' => 'Required VATID number',
'LBL_DOCUMENT_SHIPPING_NIP' => 'Required shipping VATID number',
'LBL_DOCUMENT_PARENT_CODE' => 'Required account recipient code',
'LBL_DOCUMENT_EAN' => 'Required EAN',
'LBL_PRICE' => 'Default price',
'LBL_PRIORITY' => 'Priority',
'LBL_ASSIGNED_CATEGORIES' => 'Assigned categories',
'LBL_STREET' => 'Street',
'LBL_EMAIL_ADDRESS' => 'E-mail',
'LBL_SHOP_PANEL' => 'Shop online',
'LBL_SHOP_USER' => 'Shop user',
'LBL_PRICEBOOK' => 'Online Shop Pricebook',
'LBL_ECMQUOTES_SUBPANEL_TITLE' => 'Quotes',
'LBL_ECMSALES_SUBPANEL_TITLE' => 'Sales',
'LBL_ECMINVOICEOUTS_SUBPANEL_TITLE' => 'Invoices',
'LBL_PANEL_DELIVERY_ADDRESSES' => 'Delivery addresses',
'LBL_ADDRESS_NAME' => 'Name',
'LBL_ADDRESS_POSITION' => 'Pos.',
'LBL_ADDRESS_STREET' => 'Street',
'LBL_ADDRESS_CITY' => 'City',
'LBL_ADDRESS_POSTALCODE' => 'Postalcode',
'LBL_ADDRESS_COUNTRY' => 'Country',
'LBL_ADDRESS_PHONE' => 'Phone',
'LBL_ADDRESS_FAX' => 'Fax',
'LBL_PAYMENTCONDITION_NAME' => 'Payment Conditions',
'LBL_DELIVERYCONDITION_NAME' => 'Delivery Conditions',
'LBL_PANEL_DISCOUNTS' => 'Discounts',
'LBL_PRODUCT_GROUP' => 'Products group',
'LBL_DISCOUNT' => 'Disciunt (%)',
'LBL_TO_VATID' => 'VAT ID',
'LBL_SUPPLIER_CODE' => 'Supplier code',
'LBL_ILN' => 'Iln',
'LBL_AUTO_INVOICE' => 'Auto invoice',
'LBL_SAVE_TO_GOOGLE' => 'Save to my Google Contacts',
'LBL_GOOGLE_ERROR' => 'No Google Account informations (See User pereferences)',
'LBL_MAPS' => 'Maps',
'LBL_CURRENCY' => 'Currency',
'LBL_INVOICE_TYPE' => 'Invoice type',
'LBL_PANEL_CATEGORIES' => 'Categories',
'LBL_CATEGORY_NAME' => 'Category',
'LBL_CATEGORY_ASSIGNED_FILE' => 'Assigned file',
//end mz
// DON'T CONVERT THESE THEY ARE MAPPINGS
'db_name' => 'LBL_LIST_ACCOUNT_NAME',
'db_website' => 'LBL_LIST_WEBSITE',
'db_billing_address_city' => 'LBL_LIST_CITY',
// END DON'T CONVERT
'LBL_DOCUMENTS_SUBPANEL_TITLE' => 'Documents',
// Dashlet Categories
'LBL_CHARTS' => 'Charts',
'LBL_DEFAULT' => 'Views',
'LBL_MISC' => 'Misc',
'LBL_UTILS' => 'Utils',
// END Dashlet Categories
'ACCOUNT_REMOVE_PROJECT_CONFIRM' => 'Are you sure you want to remove this account from the project?',
'ERR_DELETE_RECORD' => 'You must specify a record number in order to delete the account.',
'LBL_ACCOUNT_INFORMATION' => 'Overview',
'LBL_ACCOUNT_NAME' => 'Account Name:',
'LBL_ACCOUNT' => 'Account:',
'LBL_ACTIVITIES_SUBPANEL_TITLE'=>'Activities',
'LBL_ADDRESS_INFORMATION' => 'Address Information',
'LBL_ANNUAL_REVENUE' => 'Annual Revenue:',
'LBL_ANY_ADDRESS' => 'Any Address:',
'LBL_ANY_EMAIL' => 'Any Email:',
'LBL_ANY_PHONE' => 'Any Phone:',
'LBL_ASSIGNED_TO_NAME' => 'Assigned to:',
'LBL_ASSIGNED_TO_ID' => 'Assigned User:',
'LBL_BILLING_ADDRESS_CITY' => 'Billing City:',
'LBL_BILLING_ADDRESS_COUNTRY' => 'Billing Country:',
'LBL_BILLING_ADDRESS_POSTALCODE' => 'Billing Postal Code:',
'LBL_BILLING_ADDRESS_STATE' => 'Billing State:',
'LBL_BILLING_ADDRESS_STREET_2' =>'Billing Street 2',
'LBL_BILLING_ADDRESS_STREET_3' =>'Billing Street 3',
'LBL_BILLING_ADDRESS_STREET_4' =>'Billing Street 4',
'LBL_BILLING_ADDRESS_STREET' => 'Billing Street:',
'LBL_BILLING_ADDRESS' => 'Billing Address:',
'LBL_BUG_FORM_TITLE' => 'Accounts',
'LBL_BUGS_SUBPANEL_TITLE' => 'Bugs',
'LBL_CALLS_SUBPANEL_TITLE' => 'Calls',
'LBL_CAMPAIGN_ID' => 'Campaign ID',
'LBL_CASES_SUBPANEL_TITLE' => 'Cases',
'LBL_CITY' => 'City:',
'LBL_CONTACTS_SUBPANEL_TITLE' => 'Contacts',
'LBL_COUNTRY' => 'Country:',
'LBL_DATE_ENTERED' => 'Date Created:',
'LBL_DATE_MODIFIED' => 'Date Modified:',
'LBL_MODIFIED_ID'=>'Modified By Id',
'LBL_DEFAULT_SUBPANEL_TITLE' => 'Accounts',
'LBL_DESCRIPTION_INFORMATION' => 'Description Information',
'LBL_DESCRIPTION' => 'Description:',
'LBL_DUPLICATE' => 'Possible Duplicate Account',
'LBL_EMAIL' => 'Email Address:',
'LBL_EMAIL_OPT_OUT' => 'Email Opt Out:',
'LBL_EMAIL_ADDRESSES' => 'Email Addresses',
'LBL_EMPLOYEES' => 'Employees:',
'LBL_FAX' => 'Fax:',
'LBL_HISTORY_SUBPANEL_TITLE'=>'History',
'LBL_HOMEPAGE_TITLE' => 'My Accounts',
'LBL_INDUSTRY' => 'Industry:',
'LBL_INVALID_EMAIL'=>'Invalid Email:',
'LBL_INVITEE' => 'Contacts',
'LBL_LEADS_SUBPANEL_TITLE' => 'Leads',
'LBL_LIST_ACCOUNT_NAME' => 'Name',
'LBL_LIST_CITY' => 'City',
'LBL_LIST_CONTACT_NAME' => 'Contact Name',
'LBL_LIST_EMAIL_ADDRESS' => 'Email Address',
'LBL_LIST_FORM_TITLE' => 'Account List',
'LBL_LIST_PHONE' => 'Phone',
'LBL_LIST_STATE' => 'State',
'LBL_LIST_WEBSITE' => 'Website',
'LBL_MEETINGS_SUBPANEL_TITLE' => 'Meetings',
'LBL_MEMBER_OF' => 'Member of:',
'LBL_MEMBER_ORG_FORM_TITLE' => 'Member Organizations',
'LBL_MEMBER_ORG_SUBPANEL_TITLE'=>'Member Organizations',
'LBL_MODULE_NAME' => 'Accounts',
'LBL_MODULE_TITLE' => 'Accounts: Home',
'LBL_MODULE_ID'=> 'Accounts',
'LBL_NAME'=>'Name:',
'LBL_NEW_FORM_TITLE' => 'New Account',
'LBL_OPPORTUNITIES_SUBPANEL_TITLE' => 'Opportunities',
'LBL_OTHER_EMAIL_ADDRESS' => 'Other Email:',
'LBL_OTHER_PHONE' => 'Other Phone:',
'LBL_OWNERSHIP' => 'Ownership:',
'LBL_PARENT_ACCOUNT_ID' => 'Parent Account ID',
'LBL_PHONE_ALT' => 'Alternate Phone:',
'LBL_PHONE_FAX' => 'Phone Fax:',
'LBL_PHONE_OFFICE' => 'Office Phone:',
'LBL_PHONE' => 'Phone:',
'LBL_POSTAL_CODE' => 'Postal Code:',
'LBL_PRODUCTS_TITLE'=>'Products',
'LBL_PROJECTS_SUBPANEL_TITLE' => 'Projects',
'LBL_PUSH_BILLING' => 'Push Billing',
'LBL_PUSH_CONTACTS_BUTTON_LABEL' => 'Copy to Contacts',
'LBL_PUSH_CONTACTS_BUTTON_TITLE' => 'Copy...',
'LBL_PUSH_SHIPPING' => 'Push Shipping',
'LBL_RATING' => 'Rating:',
'LBL_SAVE_ACCOUNT' => 'Save Account',
'LBL_SEARCH_FORM_TITLE' => 'Account Search',
'LBL_SHIPPING_ADDRESS_CITY' => 'Shipping City:',
'LBL_SHIPPING_ADDRESS_COUNTRY' => 'Shipping Country:',
'LBL_SHIPPING_ADDRESS_POSTALCODE' => 'Shipping Postal Code:',
'LBL_SHIPPING_ADDRESS_STATE' => 'Shipping State:',
'LBL_SHIPPING_ADDRESS_STREET_2' => 'Shipping Street 2',
'LBL_SHIPPING_ADDRESS_STREET_3' => 'Shipping Street 3',
'LBL_SHIPPING_ADDRESS_STREET_4' => 'Shipping Street 4',
'LBL_SHIPPING_ADDRESS_STREET' => 'Shipping Street:',
'LBL_SHIPPING_ADDRESS' => 'Shipping Address:',
'LBL_SIC_CODE' => 'SIC Code:',
'LBL_STATE' => 'State:',
'LBL_TASKS_SUBPANEL_TITLE' => 'Tasks',
'LBL_TEAMS_LINK'=>'Teams',
'LBL_TICKER_SYMBOL' => 'Ticker Symbol:',
'LBL_TYPE' => 'Type:',
'LBL_USERS_ASSIGNED_LINK'=>'Assigned Users',
'LBL_USERS_CREATED_LINK'=>'Created By Users',
'LBL_USERS_MODIFIED_LINK'=>'Modified Users',
'LBL_VIEW_FORM_TITLE' => 'Account View',
'LBL_WEBSITE' => 'Website:',
'LBL_CREATED_ID'=>'Created By Id',
'LBL_CAMPAIGNS' =>'Campaigns',
'LNK_ACCOUNT_LIST' => 'View Accounts',
'LNK_NEW_ACCOUNT' => 'Create Account',
'LNK_IMPORT_ACCOUNTS' => 'Import Accounts',
'MSG_DUPLICATE' => 'The account record you are about to create might be a duplicate of an account record that already exists. Account records containing similar names are listed below.<br>Click Create Account to continue creating this new account, or select an existing account listed below.',
'MSG_SHOW_DUPLICATES' => 'The account record you are about to create might be a duplicate of an account record that already exists. Account records containing similar names are listed below.<br>Click Save to continue creating this new account, or click Cancel to return to the module without creating the account.',
'NTC_COPY_BILLING_ADDRESS' => 'Copy billing address to shipping address',
'NTC_COPY_BILLING_ADDRESS2' => 'Copy to shipping',
'NTC_COPY_SHIPPING_ADDRESS' => 'Copy shipping address to billing address',
'NTC_COPY_SHIPPING_ADDRESS2' => 'Copy to billing',
'NTC_DELETE_CONFIRMATION' => 'Are you sure you want to delete this record?',
'NTC_REMOVE_ACCOUNT_CONFIRMATION' => 'Are you sure you want to remove this record?',
'NTC_REMOVE_MEMBER_ORG_CONFIRMATION' => 'Are you sure you want to remove this record as a member organization?',
'LBL_ASSIGNED_USER_NAME' => 'Assigned to:',
'LBL_PROSPECT_LIST' => 'Prospect List',
'LBL_ACCOUNTS_SUBPANEL_TITLE'=>'Accounts',
'LBL_PROJECT_SUBPANEL_TITLE' => 'Projects',
'LBL_COPY' => 'Copy' /*for 508 compliance fix*/,
//For export labels
'LBL_ACCOUNT_TYPE' => 'Account Type',
'LBL_CAMPAIGN_ID' => 'Campaign ID',
'LBL_PARENT_ID' => 'Parent ID',
'LBL_PHONE_ALTERNATE' => 'Phone Alternate',
'LBL_EXPORT_ASSIGNED_USER_NAME' => 'Assigned User Name',
// SNIP
'LBL_CONTACT_HISTORY_SUBPANEL_TITLE' => 'Related Contacts\' Emails',
'LBL_ECMPAYMENTS_PANEL' => 'Payment States',
);
?>

View File

@@ -0,0 +1,47 @@
<!--
/*********************************************************************************
* 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-2007 SugarCRM, Inc.; All Rights Reserved.
********************************************************************************/
/*********************************************************************************
********************************************************************************/
-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<h1>Strona szczegółów konta klienta</h1>
<p>Zobacz szczegoły dotyczące konta klienta, takie jak adres, powiązane działania, historia i temtay. Możesz tworzyć i zarządzać dowolnymi informacjami, z właściwego dla nich panelu.</p>
<ul>
<li>Aby edytować informacje o kliencie, kliknij<span class="helpButton">Edytuj</span>, wprowadź niezbędne dane i kliknij <span class="helpButton">Zachowaj</span>. </li>
<li>Aby skopiować dane do innego klienta, kliknij <span class="helpButton">Duplikuj</span>. Możesz także modyfikować rekordy i zapisywać je jako inne. System wyświetla nowe rekordy w liście klientów na stronie głównej modułu.</li>
<li>To delete an account, click <span class="helpButton">Delete</span>.</li>
<li>Aby wyszukać i połączyć zduplikowane rekordy klientów, kliknij <span class="helpButton">Znajdź duplikaty</span>.</li>
<li>Aby śledzić zmiany dotyczące konta klienta w czasie, kliknij link<span class="helpButton">Zobacz dziennik zmian</span>.</li>

View File

@@ -0,0 +1,82 @@
<!--
/*********************************************************************************
* 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-2007 SugarCRM, Inc.; All Rights Reserved.
********************************************************************************/
/*********************************************************************************
********************************************************************************/
-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<h1>Klienci</h1>
<p>Aby utworzyć nowe konto klienta, wprowadź następujące informacje:</p>
<span class="helpButton">Informacje o kliencie:</span>
<ul>
<li><span class="helpButton">Nazwa:</span>. Wprowadź nazwę dla nowego konta klienta.</li>
<li><span class="helpButton">Telefon.</span> Wpisz numer telefonu organizacji.</li>
<li><span class="helpButton">Fax</span>. Wpisz numer faxu organizacji.</li>
<li><span class="helpButton">Inny telefon</span>. Wprowadź dodatkowy numer telefonu klienta, jeśli istnieje.</li>
<li><span class="helpButton">Email</span>. Wprowadź adres poczty elektronicznej dla organizacji.</li>
<li><span class="helpButton">Inny Email</span>. Wprowadź dodatkowy adres poczty elektronicznej dla organizacji.</li>
<li><span class="helpButton">WWW</span>. Wpisz adres strony internetowej klienta.</li>
<li><span class="helpButton">Symbol unikalny:</span>. Nadaj unikalny numer konta klientowi.</li>
<li><span class="helpButton">Jest własnością (członkiem)</span>. Wprowadź nazwy kont organizacji powiązanej z tworzonym kontem.</li>
<li><span class="helpButton">Pracownicy</span>. Podaj liczbę pracowników organizacji.</li>
<li><span class="helpButton">Właściciel</span>. Określ informacje o właścicielu.</li>
<li><span class="helpButton">Rating</span>. Określ rating organizacji w brażny.</li>
<li><span class="helpButton">Branża</span>. Wybierz z listy rozwijalnej sektor przemysłu do którego zalicza się klient.</li>
<li><span class="helpButton">Typ</span>. Określ kategorię klienta, taką jak Klient lub Partner.</li>
<li><span class="helpButton">Rocznye przychody</span>. Określ roczne przychody dla organizacji.</li>
<li><span class="helpButton">Zespół</span>. Wprowadź nazwę zespołu, który ma prawo do wglądu do konta. Aby wybrać istniejący zespół, kliknij <span class="helpButton">wybierz</span>, I wybierz odpowiedni zespół z listy.</li>
<li><span class="helpButton">Przydzielone do </span>. Wprowadź nazwę użytkownika, który jest odpowiedzialny za kontakty z tym klientem. Aby wybrać istniejącego użytkownika, naciśnij przycisk <span class="helpButton">Wybierz</span>, i wybierz osobę z listy użytkowników. Domyślnie, rekord jest przydzielony do Ciebie.<li>
</ul>
<p><span class="helpButton">Informacje adresowe:</span></p>
<ul>
<li><span class="helpButton">Adres faktur./span>. Adres główny siedziby klineta (adres do fakturowania).</li>
<li><span class="helpButton">Miasto</span>. Nazwa miasta.</li>
<li><span class="helpButton">Województwo</span>. Województwo, w którym jest miasto z siedzibą klienta.</li>
<li><span class="helpButton">Kod pocztowy</span>. Kod pocztowy adresu klienta.</li>
<li><span class="helpButton">Kraj</span>. Kraj, w którym mieści się siedziba klienta.</li>
<li><span class="helpButton">Adres dostawy</span>. Adres dostawy do klienta. Użyj strzałek >> aby skopiować dane z pól adresu fakturowania.</li> Aby skopiować dane z jednej sekcji do drugiej, wystarczy wprowadzić dane tylko w jednej sekcji.
</ul>
<p><span class="helpButton">Adres(y) email:</span>
<br>Wprowadź jedne lub więcej adresów poczty elektronicznej dla organizjacji i Twoich kontaktów i grup docelowych kampanii. Jeżeli któryś z nich jest niewłaściwy, zaznacz pole <span class="helpButton">Niepoprawny</span>, aby to uwidocznić. If you sent out campaign emails this contact and the individual chose to opt-out of receiving them, select <span class="helpButton">Opted Out</span>.
<p><span class="helpButton">Opis</span>.
<br>Napisz krótką informację o kliencie.</p>
<p>Kliknij <span class="helpButton">Zapisz</span> aby zachować dane o nowym kliencie; kliknij <span class="helpButton">Skasuj</span> aby oupścić formularz, bez zapisywania danych.</p>

View File

@@ -0,0 +1,68 @@
<!--
/*********************************************************************************
* 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.
********************************************************************************/
/*********************************************************************************
********************************************************************************/
-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<h1>Klienci</h1>
<p>
Modułu Klienci używa się podczas tworzenia i zarządzania kontami Klientów dla Twojej organizacji.</p>
<p>Strona główna modułu wyświetla następujące informacje:</p>
<ul>
<li>Subpanel wyszukiwania, gdzie możesz wprowadzić nazwę klienta, aby wyszukać konkretne konto,</li>
<ul>
<li>Aby wyszukać tylko konta przydzielone do Ciebie, wybierz <span class="helpButton">Tylko moje elementy</span>.</li>
<li>Aby przeprowadzić zaawansowane wyszukiwanie, użyj dodatkowych pól, klikając na zakładce <span class="helpButton">Wyszukiwanie zaawansowane</span>.</li>
<li>Aby stworzyć i zapisać własne wyglądy wyszukiwania i wyniki, kliknij na link <span class="helpButton">Zapisz wyniki wyszukiwania i wygląd</span> na zakładce Wyszukiwanie zaawansowane.
Aby obejrzeć kolumnę w wynikach wyszukiwania, przenieś ją do listy <b>Wyświetl kolumny</b>, używająć lewej strzałki. Możesz również zmienić sposób, wyświetlania się rezultatów od rosnącej na malejącą. Wprowadź nazwę dla wyników wyszukiwania w polu <b>Zapisz wynik wyszukiawania jako </b> and click <span class="helpButton">Zapisz</span>.</li>
<p>
</ul>
<li>Lista aktualnych kont klientów, wraz z połączonymi informacjami, takimi jak nazwy i numery telefonow.</li>
<li>Aby zobaczyć szczegóły konta klienta, kliknij na nazwę lub ikonę <span class="helpButton">Edytuj</span> znajdującą się na panelu, obok nazwy użytkownika.</li>
<li>Aby edytować szczegóły konta klienta, kliknij na nazwę lub ikonę Edytuj, znajdującą się na panelu, obok nazwy użytkownika; lub kliknij <span class="helpButton">Edit</span> na stronie widoku szczegółów.</li>
<li>Aby zmienić właściwości, lub usunąć więcej niż jedno konto, wybierz je z listy, a następnie użyj funkcji Masowa aktualizacja, znajdującej się na subpanelu poniżej.</li>
<li>W celu wyeksportowania jednego lub więcej kont klienta, kliknij klawisz<span class="helpButton">Wyeksportuj</span>, umieszczony ponad nazwami klientów.
<li>W celu połączenia duplikatów w jeden rekord, wybierz rekordy i kliknij przycisk <span class="helpButton">Połącz duplikaty</span>.
<li>Sekcja skrótów umożliwia wywołanie następujących funkcji:
<ul>
<li><span class="helpShortcut">Utwórz klienta</span>. Kliknij, w celu utworzenia nowego konta klienta.</li>
<li><span class="helpShortcut">Klienci</span>. Kliknij, aby powrócić z widoku szczegółowego konta klienta do strony głównej modułu.</li>
<li><span class="helpShortcut">Raporty klientów</span>. Użyj tej opcji, aby zobaczyć istniejące raporty wykonane na bazie kont Twoich klientów, lub w celu utworzenia nowego raportu.</li>
<li><span class="helpShortcut">Import</span>. Użyj tej opcji, aby zaimportować informacje o klientach z zewnętrznej aplikacji, lub pliku.
</ul>
<li>Formatka szybkiego tworzenia - Dodaj klienta jest wykorzystywana w celu szybkiego utworzenia konta klienta, zawierającego wyłącznie niezbędne (wymagane) informacjie. Po zapisaniu możesz później wprowadzić dodatkowe dane.</p>
</ul>

View File

@@ -0,0 +1,217 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*+******************************************************************************
* Zasady użytkowania znajdują się na stronie: http://opensaas.pl/kontakt/regulamin.html
********************************************************************************
* Language : Język polski
* Version : 6.5.x
* Author : OpenSaaS Sp. z o.o.
* Website : www.opensaas.pl
******************************************************************************+*/
$mod_strings = array (
//add mz
'LBL_KRS' => 'KRS',
'LBL_REGON' => 'REGON',
'LBL_SHOP_NUMBER' => 'Numer sklepu',
'LBL_DOCUMENT_BANK_ACCOUNT' => 'Konto bankowe',
'LBL_PANEL_DOC_SETTINGS' => 'Ustawienia dokumentów',
'LBL_INVOICE_TO_OWNERSHIP' => 'Fakturuj właściciela (ownership)',
'LBL_DOCUMENT_DELIVERY_ADDRESS' => 'Obowiązkowy adres dostawy',
'LBL_DOCUMENT_RECIPIENT_CODE' => 'Obowiązkowy kod towaru',
'LBL_DOCUMENT_PARENT_ORDER_NO' => 'Obowiązkowy numer zamówienia klienta',
'LBL_DOCUMENT_PARENT_ILN' => 'Obowiązkowy numer ILN',
'LBL_DOCUMENT_SHIPPING_ILN' => 'Obowiązkowy numer ILN miejsca dostawy',
'LBL_DOCUMENT_PARENT_NIP' => 'Obowiązkowy numer NIP',
'LBL_DOCUMENT_SHIPPING_NIP' => 'Obowiązkowy numer NIP miejsca dostawy',
'LBL_DOCUMENT_PARENT_CODE' => 'Obowiązkowy kod dostawcy',
'LBL_DOCUMENT_EAN' => 'Obowiązkowy EAN',
'LBL_PRICE' => 'Domyślne ceny',
'LBL_PRIORITY' => 'Priorytet',
'LBL_ASSIGNED_CATEGORIES' => 'Przypisane kategorie',
'LBL_STREET' => 'Ulica',
'LBL_PANEL_MAILINGGROUPS'=>'Grupy mailingowe',
'LBL_MAILINGGROUP_NAME'=>"Nazwa grupy",
'LBL_MAILINGGROUP_AVAILABLE'=>"Aktywna",
'LBL_EMAIL_ADDRESS' => 'E-mail',
'LBL_SHOP_PANEL' => 'Sklep online',
'LBL_SHOP_USER' => 'Użytkownik online',
'LBL_PRICEBOOK' => 'Cennik sklepu online',
'LBL_ECMQUOTES_SUBPANEL_TITLE' => 'Oferty',
'LBL_ECMSALES_SUBPANEL_TITLE' => 'Zamówienia Sprzedaży',
'LBL_ECMINVOICEOUTS_SUBPANEL_TITLE' => 'Faktury',
'LBL_PANEL_DELIVERY_ADDRESSES' => 'Adresy dostawy',
'LBL_ADDRESS_NAME' => 'Nazwa',
'LBL_ADDRESS_POSITION' => 'Poz.',
'LBL_ADDRESS_STREET' => 'Ulica',
'LBL_ADDRESS_CITY' => 'Miasto',
'LBL_ADDRESS_POSTALCODE' => 'Kod pocztowy',
'LBL_ADDRESS_COUNTRY' => 'Kraj',
'LBL_ADDRESS_PHONE' => 'Telefon',
'LBL_ADDRESS_FAX' => 'Fax',
'LBL_PAYMENTCONDITION_NAME' => 'Warunki płatności',
'LBL_DELIVERYCONDITION_NAME' => 'Warunki dostawy',
'LBL_PANEL_DISCOUNTS' => 'Upusty',
'LBL_PRODUCT_GROUP' => 'Grupa produktów',
'LBL_DISCOUNT' => 'Upust (%)',
'LBL_TO_VATID' => 'NIP',
'LBL_SUPPLIER_CODE' => 'Kod dostawcy',
'LBL_ILN' => 'Iln',
'LBL_AUTO_INVOICE' => 'Automatycznie wystawiaj FV',
'LBL_SAVE_TO_GOOGLE' => 'Zapisz w moich kontaktach Google',
'LBL_GOOGLE_ERROR' => 'Brak informacji o koncie Google (Sprawdź ustawienia użytkownika)',
'LBL_MAPS' => 'Mapy',
'LBL_CURRENCY' => 'Waluta',
'LBL_INVOICE_TYPE' => 'Typ faktury',
'LBL_PANEL_CATEGORIES' => 'Kategoryzacja',
'LBL_CATEGORY_NAME' => 'Nazwa kategori',
'LBL_EDITTABLE_OPTIONS' => 'Opc.',
'LBL_CATEGORY_ASSIGNED_FILE' => 'Załącznik',
//end mz
// DON'T CONVERT THESE THEY ARE MAPPINGS
'db_name' => 'LBL_LIST_ACCOUNT_NAME',
'db_website' => 'LBL_LIST_WEBSITE',
'db_billing_address_city' => 'LBL_LIST_CITY',
// END DON'T CONVERT
'LBL_DOCUMENTS_SUBPANEL_TITLE' => 'Dokumenty',
// Dashlet Categories
'LBL_CHARTS' => 'Wykresy',
'LBL_DEFAULT' => 'Widoki',
'LBL_MISC' => 'Inne',
'LBL_UTILS' => 'Narzędzia',
// END Dashlet Categories
'ACCOUNT_REMOVE_PROJECT_CONFIRM' => 'Czy na pewno chcesz usunąć Kontrahenta z projektu?',
'ERR_DELETE_RECORD' => 'Aby usunąć Kontrahenta musisz określić numer rekordu.',
'LBL_ACCOUNT_INFORMATION' => 'Szczegóły Kontrahenta',
'LBL_ACCOUNT_NAME' => 'Nazwa Kontrahenta:',
'LBL_ACCOUNT' => 'Kontrahent:',
'LBL_ACTIVITIES_SUBPANEL_TITLE'=>'Wydarzenia',
'LBL_ADDRESS_INFORMATION' => 'Informacje adresowe',
'LBL_ANNUAL_REVENUE' => 'Roczne dochody:',
'LBL_ANY_ADDRESS' => 'Dodatkowy Adres:',
'LBL_ANY_EMAIL' => 'Email:',
'LBL_ANY_PHONE' => 'Telefon:',
'LBL_ASSIGNED_TO_NAME' => 'Przydzielony do:',
'LBL_ASSIGNED_TO_ID' => 'Przypisany Użytkownik:',
'LBL_BILLING_ADDRESS_CITY' => 'Adres korespondencyjny - Miasto:',
'LBL_BILLING_ADDRESS_COUNTRY' => 'Adres korespondencyjny - Kraj:',
'LBL_BILLING_ADDRESS_POSTALCODE' => 'Adres korespondencyjny - Kod pocztowy:',
'LBL_BILLING_ADDRESS_STATE' => 'Adres korespondencyjny - Województwo:',
'LBL_BILLING_ADDRESS_STREET_2' =>'Adres korespondencyjny - Ulica 2',
'LBL_BILLING_ADDRESS_STREET_3' =>'Adres korespondencyjny - Ulica 3',
'LBL_BILLING_ADDRESS_STREET_4' =>'Adres korespondencyjny - Ulica 4',
'LBL_BILLING_ADDRESS_STREET' => 'Adres korespondencyjny - Ulica:',
'LBL_BILLING_ADDRESS' => 'Adres korespondencyjny:',
'LBL_BUG_FORM_TITLE' => 'Kontrahenci',
'LBL_BUGS_SUBPANEL_TITLE' => 'Błędy',
'LBL_CALLS_SUBPANEL_TITLE' => 'Połączenia telefoniczne',
'LBL_CAMPAIGN_ID' => 'ID Kampanii reklamowej',
'LBL_CASES_SUBPANEL_TITLE' => 'Zgłoszenia',
'LBL_CITY' => 'Miasto:',
'LBL_CONTACTS_SUBPANEL_TITLE' => 'Kontakty',
'LBL_COUNTRY' => 'Kraj:',
'LBL_DATE_ENTERED' => 'Data utworzenia:',
'LBL_DATE_MODIFIED' => 'Data modyfikacji:',
'LBL_MODIFIED_ID'=>'Zmodyfikowane przez: ',
'LBL_DEFAULT_SUBPANEL_TITLE' => 'Kontrahenci',
'LBL_DESCRIPTION_INFORMATION' => 'Dodatkowe informacje',
'LBL_DESCRIPTION' => 'Opis:',
'LBL_DUPLICATE' => 'Znaleziono rekord o podobnych danych',
'LBL_EMAIL' => 'E-mail:',
'LBL_EMAIL_OPT_OUT' => 'Czy wyłączyć system powiadomień?',
'LBL_EMAIL_ADDRESSES' => 'Adresy e-mail',
'LBL_EMPLOYEES' => 'Liczba pracowników:',
'LBL_FAX' => 'Fax:',
'LBL_HISTORY_SUBPANEL_TITLE'=>'Historia',
'LBL_HOMEPAGE_TITLE' => 'Moi Kontrahenci',
'LBL_INDUSTRY' => 'Branża:',
'LBL_INVALID_EMAIL'=>'Niepoprawny adres email',
'LBL_INVITEE' => 'Kontakty',
'LBL_LEADS_SUBPANEL_TITLE' => 'Potencjalni Klienci',
'LBL_LIST_ACCOUNT_NAME' => 'Nazwa Kontrahenta',
'LBL_LIST_CITY' => 'Miasto',
'LBL_LIST_CONTACT_NAME' => 'Nazwa kontaktu',
'LBL_LIST_EMAIL_ADDRESS' => 'Adresy e-mail',
'LBL_LIST_FORM_TITLE' => 'Lista Kontrahentów',
'LBL_LIST_PHONE' => 'Telefon',
'LBL_LIST_STATE' => 'Województwo',
'LBL_LIST_WEBSITE' => 'Strona WWW',
'LBL_MEETINGS_SUBPANEL_TITLE' => 'Spotkania',
'LBL_MEMBER_OF' => 'Podlega pod:',
'LBL_MEMBER_ORG_FORM_TITLE' => 'Organizacje członkowskie',
'LBL_MEMBER_ORG_SUBPANEL_TITLE'=>'Członek organizacji',
'LBL_MODULE_NAME' => 'Kontrahenci',
'LBL_MODULE_TITLE' => 'Kontrahenci: Strona główna',
'LBL_MODULE_ID'=> 'Kontrahenci',
'LBL_NAME'=>'Nazwa:',
'LBL_NEW_FORM_TITLE' => 'Utwórz Kontrahenta',
'LBL_OPPORTUNITIES_SUBPANEL_TITLE' => 'Szanse Sprzedaży',
'LBL_OTHER_EMAIL_ADDRESS' => 'Dodatkowy adres email:',
'LBL_OTHER_PHONE' => 'Dodatkowy numer telefonu:',
'LBL_OWNERSHIP' => 'Właściciel:',
'LBL_PARENT_ACCOUNT_ID' => 'ID Kontrahenta nadrzędnego',
'LBL_PHONE_ALT' => 'Alternatywny telefon:',
'LBL_PHONE_FAX' => 'Fax:',
'LBL_PHONE_OFFICE' => 'Telefon do biura:',
'LBL_PHONE' => 'Telefon:',
'LBL_POSTAL_CODE' => 'Kod pocztowy:',
'LBL_PRODUCTS_TITLE'=>'Produkty',
'LBL_PROJECTS_SUBPANEL_TITLE' => 'Projekty',
'LBL_PUSH_BILLING' => 'Kopiuj adres korespond.',
'LBL_PUSH_CONTACTS_BUTTON_LABEL' => 'Kopiuj do kontaktów',
'LBL_PUSH_CONTACTS_BUTTON_TITLE' => 'Kopiuj...',
'LBL_PUSH_SHIPPING' => 'Kopiuj adres dostawy',
'LBL_RATING' => 'Ocena:',
'LBL_SAVE_ACCOUNT' => 'Zapisz kontrahenta',
'LBL_SEARCH_FORM_TITLE' => 'Wyszukiwanie kontrahenta',
'LBL_SHIPPING_ADDRESS_CITY' => 'Adres dostawy - Miasto:',
'LBL_SHIPPING_ADDRESS_COUNTRY' => 'Adres dostawy - Kraj:',
'LBL_SHIPPING_ADDRESS_POSTALCODE' => 'Adres dostawy - Kod pocztowy:',
'LBL_SHIPPING_ADDRESS_STATE' => 'Adres dostawy - Województwo:',
'LBL_SHIPPING_ADDRESS_STREET_2' => 'Adres dostawy - Ulica 2',
'LBL_SHIPPING_ADDRESS_STREET_3' => 'Adres dostawy - Ulica 3',
'LBL_SHIPPING_ADDRESS_STREET_4' => 'Adres dostawy - Ulica 4',
'LBL_SHIPPING_ADDRESS_STREET' => 'Adres dostawy - Ulica:',
'LBL_SHIPPING_ADDRESS' => 'Adres dostawy:',
'LBL_SIC_CODE' => 'Kod GLN:',
'LBL_STATE' => 'Województwo:',
'LBL_TASKS_SUBPANEL_TITLE' => 'Zadania',
'LBL_TEAMS_LINK'=>'Zespoły',
'LBL_TICKER_SYMBOL' => 'Symbol giełdowy:',
'LBL_TYPE' => 'Rodzaj Kontrahenta:',
'LBL_USERS_ASSIGNED_LINK'=>'Przydzieleni użytkownicy',
'LBL_USERS_CREATED_LINK'=>'Utworzone przez użytkowników',
'LBL_USERS_MODIFIED_LINK'=>'Zmodyfikowane przez użytkowników',
'LBL_VIEW_FORM_TITLE' => 'Podgląd Kontrahenta',
'LBL_WEBSITE' => 'Strona WWW:',
'LBL_CREATED_ID'=>'Utworzone przez',
'LBL_CAMPAIGNS' =>'Kampanie reklamowe',
'LNK_ACCOUNT_LIST' => 'Lista kontrahentów',
'LNK_NEW_ACCOUNT' => 'Utwórz Kontrahenta',
'LNK_IMPORT_ACCOUNTS' => 'Import Kontrahentów',
'MSG_DUPLICATE' => 'Kontrahent o podobnych dany już istnieje w systemie. Lista z podobnymi danymi znajduje się poniżej.<br>Kliknij przycisk Zapisz, aby kontynuować tworzenie, lub przycisk Anuluj lub przycisk Anuluj aby przerwać tworzenie.',
'MSG_SHOW_DUPLICATES' => 'Kontrahent o podobnych dany już istnieje w systemie. Lista z podobnymi danymi znajduje się poniżej.<br>Kliknij przycisk Zapisz, aby kontynuować tworzenie nowego Kontrahenta, lub przycisk Anuluj aby przerwać tworzenie.',
'NTC_COPY_BILLING_ADDRESS' => 'Kopiuj adres Korespondencyjny do adresu Wysyłki',
'NTC_COPY_BILLING_ADDRESS2' => 'Kopiuj do adresu wysyłki',
'NTC_COPY_SHIPPING_ADDRESS' => 'Kopiuj adres wysyłki do adresu Korespondencyjnego',
'NTC_COPY_SHIPPING_ADDRESS2' => 'Kopiuj do adresu Korespondencyjnego',
'NTC_DELETE_CONFIRMATION' => 'Czy na pewno chcesz usunąć ten rekord?',
'NTC_REMOVE_ACCOUNT_CONFIRMATION' => 'Czy na pewno chcesz usunąć ten rekord?',
'NTC_REMOVE_MEMBER_ORG_CONFIRMATION' => 'Czy na pewno chcesz usunąć informacje o członkostwie?',
'LBL_ASSIGNED_USER_NAME' => 'Przypisane do:',
'LBL_PROSPECT_LIST' => 'Grupy docelowe',
'LBL_ACCOUNTS_SUBPANEL_TITLE'=>'Kontrahenci',
'LBL_PROJECT_SUBPANEL_TITLE' => 'Projekty',
'LBL_COPY' => 'Kopiuj' /*for 508 compliance fix*/,
//For export labels
'LBL_ACCOUNT_TYPE' => 'Rodzaj Kontrahenta',
'LBL_CAMPAIGN_ID' => 'ID Kampanii reklamowej',
'LBL_PARENT_ID' => 'Identyfikator rodzica',
'LBL_PHONE_ALTERNATE' => 'Alternatywny telefon',
'LBL_EXPORT_ASSIGNED_USER_NAME' => 'Przydzielony do Użytkownika',
// SNIP
'LBL_CONTACT_HISTORY_SUBPANEL_TITLE' => 'Powiązane Kontakty \ Wiadomości e-mail',
'LBL_ECMPAYMENTS_PANEL' => 'Rozrachunki',
);
?>

View File

@@ -0,0 +1,43 @@
$(document)
.ready(
function() {
var mapProp = {
center : new google.maps.LatLng(52.05, 19.45),
zoom : 6,
mapTypeId : google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document
.getElementById("googleMapContainer"), mapProp);
var markers = JSON.parse(b64_to_utf8($('#googleMapMarkers')
.val()));
$.each(markers, function(index, m) {
var marker = new google.maps.Marker({
position : new google.maps.LatLng(m.lat, m.lng),
url : '/',
animation : google.maps.Animation.DROP,
customInfo : m.info,
title : m.title,
map : map
});
google.maps.event.addListener(marker, 'click',
markerClickFunction);
});
function markerClickFunction() {
infowindow = new google.maps.InfoWindow({
content : this.customInfo
});
infowindow.open(map, this);
closeInfoWindow(infowindow);
}
function closeInfoWindow(infoWindow) {
setTimeout(function() {
infoWindow.close();
}, 8000);
}
});
function b64_to_utf8(str) {
return decodeURIComponent(escape(window.atob(str)));
}

View File

@@ -0,0 +1,86 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 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".
********************************************************************************/
$searchFields['Accounts'] =
array (
'name' => array( 'query_type'=>'default'),
'account_type'=> array('query_type'=>'default', 'options' => 'account_type_dom', 'template_var' => 'ACCOUNT_TYPE_OPTIONS'),
'industry'=> array('query_type'=>'default', 'options' => 'industry_dom', 'template_var' => 'INDUSTRY_OPTIONS'),
'annual_revenue'=> array('query_type'=>'default'),
'address_street'=> array('query_type'=>'default','db_field'=>array('billing_address_street','shipping_address_street')),
'address_city'=> array('query_type'=>'default','db_field'=>array('billing_address_city','shipping_address_city'), 'vname' =>'LBL_CITY'),
'address_state'=> array('query_type'=>'default','db_field'=>array('billing_address_state','shipping_address_state'), 'vname' =>'LBL_STATE'),
'address_postalcode'=> array('query_type'=>'default','db_field'=>array('billing_address_postalcode','shipping_address_postalcode'), 'vname' =>'LBL_POSTAL_CODE'),
'address_country'=> array('query_type'=>'default','db_field'=>array('billing_address_country','shipping_address_country'), 'vname' =>'LBL_COUNTRY'),
'rating'=> array('query_type'=>'default'),
'phone'=> array('query_type'=>'default','db_field'=>array('phone_office'),'vname' =>'LBL_ANY_PHONE'),
'email'=> array(
'query_type' => 'default',
'operator' => 'subquery',
'subquery' => 'SELECT eabr.bean_id FROM email_addr_bean_rel eabr JOIN email_addresses ea ON (ea.id = eabr.email_address_id) WHERE eabr.deleted=0 AND ea.email_address LIKE',
'db_field' => array(
'id',
),
'vname' =>'LBL_ANY_EMAIL',
),
'category_name'=> array(
'query_type' => 'default',
'operator' => 'subquery',
'subquery' => 'SELECT b2.bean_id FROM ecmaccountcategories_bean as b2
join ecmaccountcategories as c2 on(b2.ecmaccountcategory_id=c2.id) where b2.bean_name="Accounts" AND b2.bean_id!="" and c2.name like',
'db_field' => array(
'id',
),
'vname' =>'LBL_ANY_EMAIL',
),
'website'=> array('query_type'=>'default'),
'ownership'=> array('query_type'=>'default'),
'employees'=> array('query_type'=>'default'),
'sic_code'=> array('query_type'=>'default'),
'ticker_symbol'=> array('query_type'=>'default'),
'current_user_only'=> array('query_type'=>'default','db_field'=>array('assigned_user_id'),'my_items'=>true, 'vname' => 'LBL_CURRENT_USER_FILTER', 'type' => 'bool'),
'assigned_user_id'=> array('query_type'=>'default'),
//Range Search Support
'range_date_entered' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true),
'start_range_date_entered' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true),
'end_range_date_entered' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true),
'range_date_modified' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true),
'start_range_date_modified' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true),
'end_range_date_modified' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true),
//Range Search Support
);
?>

View File

@@ -0,0 +1,61 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 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: 2005-10-19 11:16:08
$acldefs['Accounts'] = array (
'forms' =>
array (
'by_name' =>
array (
'btn1' =>
array (
'display_option' => 'disabled',
'action_option' => 'list',
'app_action' => 'EditView',
'module' => 'Accounts',
),
),
),
'form_names' =>
array (
'by_id' => 'by_id',
'by_name' => 'by_name',
'DetailView' => 'DetailView',
'EditView' => 'EditView',
),
);
?>

View File

@@ -0,0 +1,84 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 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".
********************************************************************************/
function additionalDetailsAccount($fields) {
static $mod_strings;
global $app_strings;
if(empty($mod_strings)) {
global $current_language;
$mod_strings = return_module_language($current_language, 'Accounts');
}
$overlib_string = '';
if(!empty($fields['BILLING_ADDRESS_STREET']) || !empty($fields['BILLING_ADDRESS_CITY']) ||
!empty($fields['BILLING_ADDRESS_STATE']) || !empty($fields['BILLING_ADDRESS_POSTALCODE']) ||
!empty($fields['BILLING_ADDRESS_COUNTRY']))
$overlib_string .= '<b>' . $mod_strings['LBL_BILLING_ADDRESS'] . '</b><br>';
if(!empty($fields['BILLING_ADDRESS_STREET'])) $overlib_string .= $fields['BILLING_ADDRESS_STREET'] . '<br>';
if(!empty($fields['BILLING_ADDRESS_STREET_2'])) $overlib_string .= $fields['BILLING_ADDRESS_STREET_2'] . '<br>';
if(!empty($fields['BILLING_ADDRESS_STREET_3'])) $overlib_string .= $fields['BILLING_ADDRESS_STREET_3'] . '<br>';
if(!empty($fields['BILLING_ADDRESS_STREET_4'])) $overlib_string .= $fields['BILLING_ADDRESS_STREET_4'] . '<br>';
if(!empty($fields['BILLING_ADDRESS_CITY'])) $overlib_string .= $fields['BILLING_ADDRESS_CITY'] . ', ';
if(!empty($fields['BILLING_ADDRESS_STATE'])) $overlib_string .= $fields['BILLING_ADDRESS_STATE'] . ' ';
if(!empty($fields['BILLING_ADDRESS_POSTALCODE'])) $overlib_string .= $fields['BILLING_ADDRESS_POSTALCODE'] . ' ';
if(!empty($fields['BILLING_ADDRESS_COUNTRY'])) $overlib_string .= $fields['BILLING_ADDRESS_COUNTRY'] . '<br>';
if(strlen($overlib_string) > 0 && !(strrpos($overlib_string, '<br>') == strlen($overlib_string) - 4))
$overlib_string .= '<br>';
if(!empty($fields['PHONE_FAX'])) $overlib_string .= '<b>'. $mod_strings['LBL_FAX'] . '</b> <span class="phone">' . $fields['PHONE_FAX'] . '</span><br>';
if(!empty($fields['PHONE_ALTERNATE'])) $overlib_string .= '<b>'. $mod_strings['LBL_OTHER_PHONE'] . '</b> <span class="phone">' . $fields['PHONE_ALTERNATE'] . '</span><br>';
if(!empty($fields['WEBSITE']))
$overlib_string .= '<a target=_blank href=http://'. $fields['WEBSITE'] . '>' . $fields['WEBSITE'] . '</a><br>';
if(!empty($fields['INDUSTRY'])) $overlib_string .= '<b>'. $mod_strings['LBL_INDUSTRY'] . '</b> ' . $fields['INDUSTRY'] . '<br>';
if(!empty($fields['DESCRIPTION'])) {
$overlib_string .= '<b>'. $mod_strings['LBL_DESCRIPTION'] . '</b> ' . substr($fields['DESCRIPTION'], 0, 300);
if(strlen($fields['DESCRIPTION']) > 300) $overlib_string .= '...';
}
return array('fieldToAddTo' => 'NAME',
'string' => $overlib_string,
'editLink' => "index.php?action=EditView&module=Accounts&return_module=Accounts&record={$fields['ID']}",
'viewLink' => "index.php?action=DetailView&module=Accounts&return_module=Accounts&record={$fields['ID']}");
}
?>

View File

@@ -0,0 +1,364 @@
<?php
/*********************************************************************************
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 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".
********************************************************************************/
$viewdefs['Accounts']['DetailView'] = array(
'templateMeta' => array('form' => array('buttons'=>array(
0 => 'EDIT',
1 => 'DUPLICATE',
2 => 'DELETE',
3 => 'FIND_DUPLICATES',
4 => array (
'customCode' => '<input type="submit" name="save" class="button" value="{$LBL_SAVE_TO_GOOGLE}" onclick="AddGoogleContact(); return;" />'
),
5 => array (
'customCode' => '{$MOVE}'
)
)),
'maxColumns' => '2',
'widths' => array(
array('label' => '10', 'field' => '30'),
array('label' => '10', 'field' => '30')
),
'includes'=> array(
array('file'=>'modules/Accounts/Account.js'),
array('file'=>'modules/Accounts/AccountDetailView.js'),
),
),
'panels' =>
array (
'lbl_account_information' =>
array (
array (
array (
'name' => 'name',
'comment' => 'Name of the Company',
'label' => 'LBL_NAME',
'displayParams' =>
array (
'enableConnectors' => true,
'module' => 'Accounts',
'connectors' =>
array (
0 => 'ext_rest_linkedin',
),
),
),
array (
'name' => 'phone_office',
'comment' => 'The office phone number',
'label' => 'LBL_PHONE_OFFICE',
),
),
array (
array (
'name' => 'website',
'type' => 'link',
'label' => 'LBL_WEBSITE',
'displayParams' =>
array (
'link_target' => '_blank',
),
),
array (
'name' => 'phone_fax',
'comment' => 'The fax phone number of this company',
'label' => 'LBL_FAX',
),
),
array ('to_vatid', 'ecmpaymentcondition_name'),
array(
'vat_payer',
'natural_person'
),
array (
array (
'name' => 'billing_address_street',
'label' => 'LBL_BILLING_ADDRESS',
'type' => 'address',
'displayParams' =>
array (
'key' => 'billing',
),
),
array (
'name' => 'shipping_address_street',
'label' => 'LBL_SHIPPING_ADDRESS',
'type' => 'address',
'displayParams' =>
array (
'key' => 'shipping',
),
),
),
array ('maps'),
array (
array (
'name' => 'email1',
'studio' => 'false',
'label' => 'LBL_EMAIL',
),
),
array (
array (
'name' => 'description',
'comment' => 'Full text of the note',
'label' => 'LBL_DESCRIPTION',
),
'priority',
),
array (
'ecmprice_name',
),
),
'LBL_SHOP_PANEL' => array (
array(
'shop_user',
'ecmpricebook_name',
),
),
'LBL_ECMPAYMENTS_PANEL' => array (
array (
array (
'name' => 'saldo_nierozliczone',
'customCode' => '{$SUMN}',
),
array (
'name' => 'saldo_razem',
'customCode' => '{$SUMR}',
),
),
array(
array (
'name' => 'url_links_e',
'customCode' => '{$URL_ECMPAY}',
),
),
),
'LBL_PANEL_DELIVERY_ADDRESSES' =>
array (
0 =>
array (
0 =>
array (
'name' => 'items_list_panel',
'allCols' => true,
'hideLabel' => true,
'customCode' => '{$POSITIONS}',
),
),
),
'LBL_PANEL_ADVANCED' =>
array (
array (
array (
'name' => 'account_type',
'comment' => 'The Company is of this type',
'label' => 'LBL_TYPE',
),
array (
'name' => 'industry',
'comment' => 'The company belongs in this industry',
'label' => 'LBL_INDUSTRY',
),
),
array (
array (
'name' => 'annual_revenue',
'comment' => 'Annual revenue for this company',
'label' => 'LBL_ANNUAL_REVENUE',
),
array (
'name' => 'employees',
'comment' => 'Number of employees, varchar to accomodate for both number (100) or range (50-100)',
'label' => 'LBL_EMPLOYEES',
),
),
array (
array (
'name' => 'sic_code',
'comment' => 'SIC code of the account',
'label' => 'LBL_SIC_CODE',
),
array (
'name' => 'ticker_symbol',
'comment' => 'The stock trading (ticker) symbol for the company',
'label' => 'LBL_TICKER_SYMBOL',
),
),
array (
array (
'name' => 'parent_name',
'label' => 'LBL_MEMBER_OF',
),
array (
'name' => 'ownership',
'comment' => '',
'label' => 'LBL_OWNERSHIP',
),
),
array (
'campaign_name',
array (
'name' => 'rating',
'comment' => 'An arbitrary rating for this company for use in comparisons with others',
'label' => 'LBL_RATING',
),
),
array (
'shop_number',
'ecmdeliverycondition_name',
),
array (
'supplier_code',
'iln',
),
array (
'krs',
'regon',
),
array (
array('name'=>'currency_id','label'=>'LBL_CURRENCY'), '',
),
),
'LBL_PANEL_DISCOUNTS' =>
array (
0 =>
array (
0 =>
array (
'name' => 'items_list_panel',
'allCols' => true,
'hideLabel' => true,
'customCode' => '{$POSITIONS2}',
),
),
),
'LBL_PANEL_CATEGORIES' =>
array (
0 =>
array (
0 =>
array (
'name' => 'items_list_panel',
'allCols' => true,
'hideLabel' => true,
'customCode' => '{$POSITIONS3}',
),
),
),
'LBL_PANEL_MAILINGGROUPS' =>
array (
0 =>
array (
0 =>
array (
'name' => 'items_list_panel',
'allCols' => true,
'hideLabel' => true,
'customCode' => '{$POSITIONS55}',
),
),
),
'LBL_PANEL_DOC_SETTINGS' => array (
array (
'invoice_to_ownership',
'document_delivery_address',
),
array (
'document_recipient_code',
'document_parent_order_no',
),
array (
'auto_invoice',
'invoice_type',
),
array (
'document_parent_iln',
'document_shipping_iln',
),
array (
'document_parent_code',
'document_ean',
),
array (
'document_parent_nip',
'document_shipping_nip'
),
array(
'document_bank_account', ''
),
),
'LBL_PANEL_ASSIGNMENT' =>
array (
array (
array (
'name' => 'assigned_user_name',
'label' => 'LBL_ASSIGNED_TO',
),
array (
'name' => 'date_modified',
'label' => 'LBL_DATE_MODIFIED',
'customCode' => '{$fields.date_modified.value} {$APP.LBL_BY} {$fields.modified_by_name.value}',
),
),
array (
array (
'name' => 'date_entered',
'customCode' => '{$fields.date_entered.value} {$APP.LBL_BY} {$fields.created_by_name.value}',
),
),
),
)
);
?>

View File

@@ -0,0 +1,371 @@
<?php
/*********************************************************************************
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 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".
********************************************************************************/
$viewdefs ['Accounts'] ['EditView'] = array (
'templateMeta' => array (
'form' => array (
'buttons' => array (
0 => array (
'customCode' => '<input type="submit" name="save" class="button" value="{$LBL_SAVE}" onclick="saveItems(true);saveItems2(true);saveItems3(true);saveItems55(true);this.form.action.value=\'Save\';return check_form(\'EditView\');" />'
),
1 => 'CANCEL'
)
),
'maxColumns' => '2',
'widths' => array (
array (
'label' => '10',
'field' => '30'
),
array (
'label' => '10',
'field' => '30'
)
),
'includes' => array (
array (
'file' => 'modules/Accounts/Account.js'
),
array (
'file' => 'modules/Accounts/MailingGroups.js'
),
array (
'file' => 'include/JSON.js'
),
array (
'file' => 'modules/Accounts/Addresses.js'
),
array (
'file' => 'modules/Accounts/Discounts.js'
),
array (
'file' => 'modules/Accounts/Categories.js'
),
array (
'file' => 'modules/Accounts/MyTable.js'
),
array (
'file' => 'modules/Accounts/paramsMT.js'
)
)
),
'panels' => array (
'lbl_account_information' => array (
array (
array (
'name' => 'name',
'label' => 'LBL_NAME',
'displayParams' => array (
'required' => true
)
),
array (
'name' => 'phone_office',
'label' => 'LBL_PHONE_OFFICE'
)
),
array (
array (
'name' => 'website',
'type' => 'link',
'label' => 'LBL_WEBSITE'
),
array (
'name' => 'phone_fax',
'label' => 'LBL_FAX'
)
),
array (
'to_vatid',
'ecmpaymentcondition_name'
),
array(
'vat_payer',
'natural_person'
),
array (
array (
'name' => 'billing_address_street',
'hideLabel' => true,
'type' => 'address',
'displayParams' => array (
'key' => 'billing',
'rows' => 2,
'cols' => 30,
'maxlength' => 150
)
),
array (
'name' => 'shipping_address_street',
'hideLabel' => true,
'type' => 'address',
'displayParams' => array (
'key' => 'shipping',
'copy' => 'billing',
'rows' => 2,
'cols' => 30,
'maxlength' => 150
)
)
),
array (
array (
'name' => 'email1',
'studio' => 'false',
'label' => 'LBL_EMAIL'
)
),
array (
array (
'name' => 'description',
'label' => 'LBL_DESCRIPTION'
),
'priority'
),
array (
'ecmprice_name'
)
),
'LBL_SHOP_PANEL' => array (
array (
'shop_user',
'ecmpricebook_name'
)
),
'LBL_PANEL_DELIVERY_ADDRESSES' => array (
array (
array (
'name' => 'items_list_panel',
'allCols' => true,
'hideLabel' => true,
'customCode' => '
<input type="hidden" name="position_list" id="position_list" value=\'{$POSITION_LIST}\'>
<link rel="stylesheet" type="text/css" href="modules/Accounts/MyTable.css" />
<div style="width:100%;border: 1px solid rgb(48,192,255);background-color:white;height:{$OPT.position_table_height}px;max-height:{$OPT.position_table_height}px;overflow:auto;" id="itemsTableDIV">
<table class="positions" style="width:100%;" id="itemsTable">
<thead id="head">
<tr id="tr">
<td width="3%">{$MOD.LBL_ADDRESS_POSITION}</td>
<td width="8%">{$MOD.LBL_ADDRESS_NAME}</td>
<td width="20%">{$MOD.LBL_ADDRESS_STREET}</td>
<td width="10%">{$MOD.LBL_ADDRESS_CITY}</td>
<td width="10%">{$MOD.LBL_ADDRESS_POSTALCODE}</td>
<td width="10%">{$MOD.LBL_ADDRESS_COUNTRY}</td>
<td width="10%">{$MOD.LBL_ADDRESS_PHONE}</td>
<td width="10%">{$MOD.LBL_ADDRESS_FAX}</td>
<td width="10%"></td>
</tr>
</thead>
<tbody id="tbody">
</tbody>
</table>
</div><br>'
)
)
),
'LBL_PANEL_ADVANCED' => array (
array (
'account_type',
'industry'
),
array (
'annual_revenue',
'employees'
),
array (
'sic_code',
'ticker_symbol'
),
array (
'parent_name',
'ownership'
),
array (
'campaign_name',
'rating'
),
array (
'shop_number',
'ecmdeliverycondition_name'
),
array (
'supplier_code',
'iln'
),
array (
'krs',
'regon',
),
array (
array (
'name' => 'currency_id',
'label' => 'LBL_CURRENCY'
),
''
)
),
'LBL_PANEL_DISCOUNTS' => array (
array (
array (
'name' => 'items_list_panel',
'allCols' => true,
'hideLabel' => true,
'customCode' => '
<input type="hidden" name="position_list2" id="position_list2" value=\'{$POSITION_LIST2}\'>
<link rel="stylesheet" type="text/css" href="modules/Accounts/MyTable.css" />
<div style="width:30%;border: 1px solid rgb(48,192,255);background-color:white;height:{$OPT.position_table_height}px;max-height:{$OPT.position_table_height}px;overflow:auto;" id="itemsTableDIV2">
<table class="positions" style="width:100%;" id="itemsTable2">
<thead id="head">
<tr id="tr">
<td width="70%">{$MOD.LBL_PRODUCT_GROUP}</td>
<td width="20%">{$MOD.LBL_DISCOUNT}</td>
<td width="10%">{$MOD.LBL_EDITTABLE_OPTIONS}</td>
</tr>
</thead>
<tbody id="tbody">
</tbody>
</table>
</div><br>'
)
)
),
'LBL_PANEL_CATEGORIES' => array (
array (
array (
'name' => 'items_list_panel',
'allCols' => true,
'hideLabel' => true,
'customCode' => '
<input type="hidden" name="position_list3" id="position_list3" value=\'{$POSITION_LIST3}\'>
<link rel="stylesheet" type="text/css" href="modules/Accounts/MyTable.css" />
<div style="width:30%;border: 1px solid rgb(48,192,255);background-color:white;height:{$OPT.position_table_height}px;max-height:{$OPT.position_table_height}px;overflow:auto;" id="itemsTableDIV3">
<table class="positions" style="width:100%;" id="itemsTable3">
<thead id="head">
<tr id="tr">
<td width="90%">{$MOD.LBL_CATEGORY_NAME}</td>
<td width="10%">{$MOD.LBL_EDITTABLE_OPTIONS}</td>
</tr>
</thead>
<tbody id="tbody">
</tbody>
</table>
</div><br>'
)
)
),
'LBL_PANEL_MAILINGGROUPS' => array (
array (
array (
'name' => 'items_list_panel',
'allCols' => true,
'hideLabel' => true,
'customCode' => '
<input type="hidden" name="position_list55" id="position_list55" value=\'{$POSITION_LIST55}\'>
<link rel="stylesheet" type="text/css" href="modules/Accounts/MyTable.css" />
<div style="width:30%;border: 1px solid rgb(48,192,255);background-color:white;height:{$OPT.position_table_height}px;max-height:{$OPT.position_table_height}px;overflow:auto;" id="itemsTableDIV2">
<table class="positions" style="width:100%;" id="itemsTable55">
<thead id="head">
<tr id="tr">
<td width="70%">{$MOD.LBL_MAILINGGROUP_NAME}</td>
<td width="20%">{$MOD.LBL_MAILINGGROUP_AVAILABLE}</td>
<td width="10%">{$MOD.LBL_EDITTABLE_OPTIONS}</td>
</tr>
</thead>
<tbody id="tbody">
</tbody>
</table>
</div><br>'
)
)
),
'LBL_PANEL_DOC_SETTINGS' => array (
array (
'invoice_to_ownership',
'document_delivery_address'
),
array (
'document_recipient_code',
'document_parent_order_no'
),
array (
'auto_invoice',
'invoice_type'
),
array (
'document_parent_iln',
'document_shipping_iln'
),
array (
'document_parent_nip',
'document_shipping_nip'
),
array (
'document_parent_code',
'document_ean'
),
array (
'document_bank_account'
)
),
'LBL_PANEL_ASSIGNMENT' => array (
array (
array (
'name' => 'assigned_user_name',
'label' => 'LBL_ASSIGNED_TO'
)
)
)
)
);
?>

View File

@@ -0,0 +1,38 @@
<?php
/*********************************************************************************
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 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,208 @@
<?php
if (! defined ( 'sugarEntry' ) || ! sugarEntry)
die ( 'Not A Valid Entry Point' );
/**
* *******************************************************************************
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc.
* Copyright (C) 2004-2013 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".
* ******************************************************************************
*/
$listViewDefs ['Accounts'] = array (
'NAME' => array (
'width' => '20%',
'label' => 'LBL_LIST_ACCOUNT_NAME',
'link' => true,
'default' => true
),
'PRIORITY' => array (
'width' => '5%',
'label' => 'LBL_PRIORITY',
'link' => false,
'default' => true,
),
'BILLING_ADDRESS_CITY' => array (
'width' => '10%',
'label' => 'LBL_LIST_CITY',
'default' => true
),
'BILLING_ADDRESS_COUNTRY' => array (
'width' => '10%',
'label' => 'LBL_COUNTRY',
'default' => true
),
'SHOP_NUMBER' => array (
'width' => '10%',
'label' => 'LBL_SHOP_NUMBER',
'default' => true
),
'WEBSITE' => array (
'width' => '10%',
'label' => 'LBL_LIST_WEBSITE',
'default' => true,
'customCode'=>' <a href="http://{$WEBSITE}" target="_blank">{$WEBSITE}</a>'
),
'PHONE_OFFICE' => array (
'width' => '10%',
'label' => 'LBL_LIST_PHONE',
'default' => true
),
'EMAIL1' =>
array(
'width' => '14%',
'label' => 'LBL_EMAIL_ADDRESS',
'sortable' => false,
'link' => true,
'customCode' => '{$EMAIL1_LINK}{$EMAIL1}</a>',
'default' => true
),
'ASSIGNED_USER_NAME' => array (
'width' => '10%',
'label' => 'LBL_LIST_ASSIGNED_USER',
'module' => 'Employees',
'id' => 'ASSIGNED_USER_ID',
'default' => true
),
'ACCOUNT_TYPE' => array (
'width' => '10%',
'label' => 'LBL_TYPE',
'default' => false
),
'INDUSTRY' => array (
'width' => '10%',
'label' => 'LBL_INDUSTRY',
'default' => false
),
'ANNUAL_REVENUE' => array (
'width' => '10%',
'label' => 'LBL_ANNUAL_REVENUE',
'default' => false
),
'PHONE_FAX' => array (
'width' => '10%',
'label' => 'LBL_PHONE_FAX',
'default' => false
),
'BILLING_ADDRESS_STREET' => array (
'width' => '15%',
'label' => 'LBL_BILLING_ADDRESS_STREET',
'default' => false
),
'BILLING_ADDRESS_STATE' => array (
'width' => '7%',
'label' => 'LBL_BILLING_ADDRESS_STATE',
'default' => false
),
'BILLING_ADDRESS_POSTALCODE' => array (
'width' => '10%',
'label' => 'LBL_BILLING_ADDRESS_POSTALCODE',
'default' => false
),
'SHIPPING_ADDRESS_STREET' => array (
'width' => '15%',
'label' => 'LBL_SHIPPING_ADDRESS_STREET',
'default' => false
),
'SHIPPING_ADDRESS_CITY' => array (
'width' => '10%',
'label' => 'LBL_SHIPPING_ADDRESS_CITY',
'default' => false
),
'SHIPPING_ADDRESS_STATE' => array (
'width' => '7%',
'label' => 'LBL_SHIPPING_ADDRESS_STATE',
'default' => false
),
'SHIPPING_ADDRESS_POSTALCODE' => array (
'width' => '10%',
'label' => 'LBL_SHIPPING_ADDRESS_POSTALCODE',
'default' => false
),
'SHIPPING_ADDRESS_COUNTRY' => array (
'width' => '10%',
'label' => 'LBL_SHIPPING_ADDRESS_COUNTRY',
'default' => false
),
'RATING' => array (
'width' => '10%',
'label' => 'LBL_RATING',
'default' => false
),
'PHONE_ALTERNATE' => array (
'width' => '10%',
'label' => 'LBL_OTHER_PHONE',
'default' => false
),
'OWNERSHIP' => array (
'width' => '10%',
'label' => 'LBL_OWNERSHIP',
'default' => false
),
'EMPLOYEES' => array (
'width' => '10%',
'label' => 'LBL_EMPLOYEES',
'default' => false
),
'SIC_CODE' => array (
'width' => '10%',
'label' => 'LBL_SIC_CODE',
'default' => false
),
'TICKER_SYMBOL' => array (
'width' => '10%',
'label' => 'LBL_TICKER_SYMBOL',
'default' => false
),
'DATE_MODIFIED' => array (
'width' => '5%',
'label' => 'LBL_DATE_MODIFIED',
'default' => false
),
'CREATED_BY_NAME' => array (
'width' => '10%',
'label' => 'LBL_CREATED',
'default' => false
),
'MODIFIED_BY_NAME' => array (
'width' => '10%',
'label' => 'LBL_MODIFIED',
'default' => false
),
'DATE_ENTERED' => array (
'width' => '5%',
'label' => 'LBL_DATE_ENTERED',
'default' => true
)
);
?>

View File

@@ -0,0 +1,52 @@
<?php
/*********************************************************************************
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 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 on Jun 1, 2007
*
* To change the template for this generated file go to
* Window - Preferences - PHPeclipse - PHP - Code Templates
*/
$metafiles['Accounts'] = array(
'detailviewdefs' => 'modules/Accounts/metadata/detailviewdefs.php',
'editviewdefs' => 'modules/Accounts/metadata/editviewdefs.php',
'listviewdefs' => 'modules/Accounts/metadata/listviewdefs.php',
'searchdefs' => 'modules/Accounts/metadata/searchdefs.php',
'popupdefs' => 'modules/Accounts/metadata/popupdefs.php',
'searchfields' => 'modules/Accounts/metadata/SearchFields.php',
);
?>

View File

@@ -0,0 +1,163 @@
<?php
if (! defined ( 'sugarEntry' ) || ! sugarEntry)
die ( 'Not A Valid Entry Point' );
/**
* *******************************************************************************
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc.
* Copyright (C) 2004-2013 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;
$popupMeta = array (
'moduleMain' => 'Account',
'varName' => 'ACCOUNT',
'orderBy' => 'name',
'whereClauses' => array (
'name' => 'accounts.name',
'billing_address_city' => 'accounts.billing_address_city',
'phone_office' => 'accounts.phone_office',
'shop_number' => 'accounts.shop_number'
),
'searchInputs' => array (
'name',
'billing_address_city',
'phone_office',
'shop_number'
),
'create' => array (
'formBase' => 'AccountFormBase.php',
'formBaseClass' => 'AccountFormBase',
'getFormBodyParams' => array (
'',
'',
'AccountSave'
),
'createButton' => 'LNK_NEW_ACCOUNT'
),
'listviewdefs' => array (
'NAME' => array (
'width' => '40',
'label' => 'LBL_LIST_ACCOUNT_NAME',
'link' => true,
'default' => true
),
'SHOP_NUMBER' => array (
'width' => '15',
'label' => 'LBL_SHOP_NUMBER',
'link' => false,
'default' => true
),
'BILLING_ADDRESS_STREET' => array (
'width' => '10',
'label' => 'LBL_BILLING_ADDRESS_STREET',
'default' => false
),
'BILLING_ADDRESS_CITY' => array (
'width' => '10',
'label' => 'LBL_LIST_CITY',
'default' => true
),
'BILLING_ADDRESS_STATE' => array (
'width' => '7',
'label' => 'LBL_STATE',
'default' => false
),
'BILLING_ADDRESS_COUNTRY' => array (
'width' => '10',
'label' => 'LBL_COUNTRY',
'default' => false
),
'BILLING_ADDRESS_POSTALCODE' => array (
'width' => '10',
'label' => 'LBL_BILLING_ADDRESS_POSTALCODE',
'default' => false
),
'SHIPPING_ADDRESS_STREET' => array (
'width' => '10',
'label' => 'LBL_SHIPPING_ADDRESS_STREET',
'default' => false
),
'SHIPPING_ADDRESS_CITY' => array (
'width' => '10',
'label' => 'LBL_LIST_CITY',
'default' => false
),
'SHIPPING_ADDRESS_STATE' => array (
'width' => '7',
'label' => 'LBL_STATE',
'default' => false
),
'SHIPPING_ADDRESS_COUNTRY' => array (
'width' => '10',
'label' => 'LBL_COUNTRY',
'default' => false
),
'SHIPPING_ADDRESS_POSTALCODE' => array (
'width' => '10',
'label' => 'LBL_SHIPPING_ADDRESS_POSTALCODE',
'default' => false
),
'ASSIGNED_USER_NAME' => array (
'width' => '2',
'label' => 'LBL_LIST_ASSIGNED_USER',
'default' => true
),
'PHONE_OFFICE' => array (
'width' => '10',
'label' => 'LBL_LIST_PHONE',
'default' => false
)
),
'searchdefs' => array (
'name',
'billing_address_city',
'billing_address_state',
'billing_address_country',
'email',
array (
'name' => 'assigned_user_id',
'label' => 'LBL_ASSIGNED_TO',
'type' => 'enum',
'function' => array (
'name' => 'get_user_array',
'params' => array (
false
)
)
)
)
);
?>

View File

@@ -0,0 +1,126 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 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".
********************************************************************************/
/*********************************************************************************
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
********************************************************************************/
$viewdefs ['Accounts'] =
array (
'QuickCreate' =>
array (
'templateMeta' =>
array (
'form' =>
array (
'buttons' =>
array (
'SAVE',
'CANCEL',
),
),
'maxColumns' => '2',
'widths' =>
array (
array (
'label' => '10',
'field' => '30',
),
array (
'label' => '10',
'field' => '30',
),
),
'includes' =>
array (
array (
'file' => 'modules/Accounts/Account.js',
),
),
),
'panels' =>
array (
'default' =>
array (
array (
array (
'name' => 'name',
'displayParams' =>
array (
'required' => true,
),
),
),
array (
array (
'name' => 'website',
),
array (
'name' => 'phone_office',
),
),
array (
array (
'name' => 'email1',
),
array (
'name' => 'phone_fax',
),
),
array (
array (
'name' => 'industry',
),
array (
'name' => 'account_type',
),
),
array (
array (
'name' => 'assigned_user_name',
),
),
),
),
),
);
?>

View File

@@ -0,0 +1,180 @@
<?php
/*********************************************************************************
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 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 on May 29, 2007
*
* To change the template for this generated file go to
* Window - Preferences - PHPeclipse - PHP - Code Templates
*/
$searchdefs['Accounts'] = array(
'templateMeta' => array(
'maxColumns' => '3',
'maxColumnsBasic' => '4',
'widths' => array('label' => '10', 'field' => '30'),
),
'layout' =>
array (
'basic_search' =>
array (
'name' =>
array (
'name' => 'name',
'default' => true,
'width' => '10%',
),
'to_vatid_unformated',
'current_user_only' =>
array (
'name' => 'current_user_only',
'label' => 'LBL_CURRENT_USER_FILTER',
'type' => 'bool',
'default' => true,
'width' => '10%',
),
'ownership',
),
'advanced_search' =>
array (
'name' =>
array (
'name' => 'name',
'default' => true,
'width' => '10%',
),
'website' =>
array (
'name' => 'website',
'default' => true,
'width' => '10%',
),
'phone' =>
array (
'name' => 'phone',
'label' => 'LBL_ANY_PHONE',
'type' => 'name',
'default' => true,
'width' => '10%',
),
'email' =>
array (
'name' => 'email',
'label' => 'LBL_ANY_EMAIL',
'type' => 'name',
'default' => true,
'width' => '10%',
),
'address_street' =>
array (
'name' => 'address_street',
'label' => 'LBL_ANY_ADDRESS',
'type' => 'name',
'default' => true,
'width' => '10%',
),
'address_city' =>
array (
'name' => 'address_city',
'label' => 'LBL_CITY',
'type' => 'name',
'default' => true,
'width' => '10%',
),
'address_state' =>
array (
'name' => 'address_state',
'label' => 'LBL_STATE',
'type' => 'name',
'default' => true,
'width' => '10%',
),
'address_postalcode' =>
array (
'name' => 'address_postalcode',
'label' => 'LBL_POSTAL_CODE',
'type' => 'name',
'default' => true,
'width' => '10%',
),
'billing_address_country' =>
array (
'name' => 'billing_address_country',
'label' => 'LBL_COUNTRY',
'type' => 'name',
'options' => 'countries_dom',
'default' => true,
'width' => '10%',
),
'account_type' =>
array (
'name' => 'account_type',
'default' => true,
'width' => '10%',
),
'invoice_type',
'industry' =>
array (
'name' => 'industry',
'default' => true,
'width' => '10%',
),
'category_name',
'assigned_user_id' =>
array (
'name' => 'assigned_user_id',
'type' => 'enum',
'label' => 'LBL_ASSIGNED_TO',
'function' =>
array (
'name' => 'get_user_array',
'params' =>
array (
0 => false,
),
),
'default' => true,
'width' => '10%',
),
'to_vatid_unformated',
'priority',
'krs', 'regon'
),
),
);
?>

View File

@@ -0,0 +1,66 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 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".
********************************************************************************/
$GLOBALS['studioDefs']['Accounts'] = array(
'LBL_DETAILVIEW'=>array(
'template'=>'xtpl',
'template_file'=>'modules/Accounts/DetailView.html',
'php_file'=>'modules/Accounts/DetailView.php',
'type'=>'DetailView',
),
'LBL_EDITVIEW'=>array(
'template'=>'xtpl',
'template_file'=>'modules/Accounts/EditView.html',
'php_file'=>'modules/Accounts/EditView.php',
'type'=>'EditView',
),
'LBL_LISTVIEW'=>array(
'template'=>'listview',
'meta_file'=>'modules/Accounts/listviewdefs.php',
'type'=>'ListView',
),
'LBL_SEARCHFORM'=>array(
'template'=>'xtpl',
'template_file'=>'modules/Accounts/SearchForm.html',
'php_file'=>'modules/Accounts/ListView.php',
'type'=>'SearchForm',
),
);

View File

@@ -0,0 +1,245 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 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".
********************************************************************************/
$layout_defs['Accounts'] = array(
// list of what Subpanels to show in the DetailView
'subpanel_setup' => array(
'activities' => array(
'order' => 10,
'sort_order' => 'desc',
'sort_by' => 'date_start',
'title_key' => 'LBL_ACTIVITIES_SUBPANEL_TITLE',
'type' => 'collection',
'subpanel_name' => 'activities', //this values is not associated with a physical file.
'header_definition_from_subpanel'=> 'meetings',
'module'=>'Activities',
'top_buttons' => array(
array('widget_class' => 'SubPanelTopCreateTaskButton'),
array('widget_class' => 'SubPanelTopScheduleMeetingButton'),
array('widget_class' => 'SubPanelTopScheduleCallButton'),
),
'collection_list' => array(
'tasks' => array(
'module' => 'Tasks',
'subpanel_name' => 'ForActivities',
'get_subpanel_data' => 'tasks',
),
'meetings' => array(
'module' => 'Meetings',
'subpanel_name' => 'ForActivities',
'get_subpanel_data' => 'meetings',
),
'calls' => array(
'module' => 'Calls',
'subpanel_name' => 'ForActivities',
'get_subpanel_data' => 'calls',
),
)
),
'history' => array(
'order' => 20,
'sort_order' => 'desc',
'sort_by' => 'date_modified',
'title_key' => 'LBL_HISTORY_SUBPANEL_TITLE',
'type' => 'collection',
'subpanel_name' => 'history', //this values is not associated with a physical file.
'header_definition_from_subpanel'=> 'meetings',
'module'=>'History',
'top_buttons' => array(
array('widget_class' => 'SubPanelTopCreateNoteButton'),
array('widget_class' => 'SubPanelTopArchiveEmailButton'),
array('widget_class' => 'SubPanelTopSummaryButton'),
array('widget_class' => 'SubPanelTopHistoryFilterInputButton'),
),
'collection_list' => array(
'tasks' => array(
'module' => 'Tasks',
'subpanel_name' => 'ForHistory',
'get_subpanel_data' => 'tasks',
),
'meetings' => array(
'module' => 'Meetings',
'subpanel_name' => 'ForHistory',
'get_subpanel_data' => 'meetings',
),
'calls' => array(
'module' => 'Calls',
'subpanel_name' => 'ForHistory',
'get_subpanel_data' => 'calls',
),
'notes' => array(
'module' => 'Notes',
'subpanel_name' => 'ForHistory',
'get_subpanel_data' => 'notes',
),
'linkedemails' => array(
'module' => 'Emails',
'subpanel_name' => 'ForHistory',
'get_subpanel_data' => 'function:get_unlinked_email_query',
'generate_select'=>true,
'function_parameters' => array('return_as_array'=>'true'),
),
)
),
'documents' => array(
'order' => 130,
'module' => 'Documents',
'subpanel_name' => 'default',
'get_subpanel_data' => 'documents',
'title_key' => 'Dokumenty',
),
'notes' => array(
'order' => 110,
'module' => 'Notes',
'sort_order' => 'asc',
'sort_by' => 'date_entered',
'subpanel_name' => 'default',
'get_subpanel_data' => 'notes',
'add_subpanel_data' => 'note_id',
'title_key' => 'LBL_NOTES_SUBPANEL_TITLE',
'top_buttons' => array(
array('widget_class' => 'SubPanelTopCreateButton'),
),
),
'contacts' => array(
'order' => 40,
'module' => 'Contacts',
'sort_order' => 'asc',
'sort_by' => 'last_name, first_name',
'subpanel_name' => 'ForAccounts',
'get_subpanel_data' => 'contacts',
'add_subpanel_data' => 'contact_id',
'title_key' => 'LBL_CONTACTS_SUBPANEL_TITLE',
'top_buttons' => array(
//array('widget_class' => 'SubPanelTopCreateAccountNameButton'),
array('widget_class' => 'SubPanelTopSelectButton', 'mode'=>'MultiSelect'),
array('widget_class' => 'SubPanelTopCreateButton')
),
),
'accounts' => array(
'order' => 50,
'sort_order' => 'asc',
'sort_by' => 'name',
'module' => 'Accounts',
'subpanel_name' => 'default',
'get_subpanel_data' => 'members',
'add_subpanel_data' => 'member_id',
'title_key' => 'LBL_MAINPRODUCT_SUBPANEL',
'top_buttons' => array(
array('widget_class' => 'SubPanelTopButtonQuickCreate'),
array('widget_class' => 'SubPanelTopSelectButton', 'mode'=>'MultiSelect')
),
),
'ecmquotes' => array(
'order' => 60,
'module' => 'EcmQuotes',
'subpanel_name' => 'default',
'get_subpanel_data' => 'ecmquotes',
'add_subpanel_data' => 'ecmquote_id',
'title_key' => 'LBL_ECMQUOTES_SUBPANEL_TITLE',
'top_buttons' => array(
array('widget_class' => 'SubPanelTopCreateButton'),
),
),
/*
'documents' => array(
'order' => 90,
'module' => 'Documents',
'subpanel_name' => 'default',
'get_subpanel_data' => 'documents',
'title_key' => 'Dokumenty',
'top_buttons' => array(
array('widget_class' => 'SubPanelTopCreateButton'),
),
), */
'ecmsales' => array(
'order' => 70,
'module' => 'EcmSales',
'subpanel_name' => 'default',
'get_subpanel_data' => 'ecmsales',
//'add_subpanel_data' => 'ecmsale_id',
'title_key' => 'LBL_ECMSALES_SUBPANEL_TITLE',
'top_buttons' => array(
array('widget_class' => 'SubPanelTopCreateButton'),
),
),
'ecmstockdocouts' => array(
'order' => 80,
'module' => 'EcmStockDocOuts',
'subpanel_name' => 'default',
'get_subpanel_data' => 'ecmstockdocouts',
'add_subpanel_data' => 'ecmstockdocout_id',
'title_key' => 'Magazyn WZ',
'top_buttons' => array(
array('widget_class' => 'SubPanelTopCreateButton'),
),
),
'ecminvoiceouts' => array(
'order' => 5,
'module' => 'EcmInvoiceOuts',
'subpanel_name' => 'default',
'get_subpanel_data' => 'ecminvoiceouts',
'add_subpanel_data' => 'ecminvoiceout_id',
'title_key' => 'LBL_ECMINVOICEOUTS_SUBPANEL_TITLE',
'top_buttons' => array(
array('widget_class' => 'SubPanelTopCreateButton'),
),
),
),
);
?>

View File

@@ -0,0 +1,76 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 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".
********************************************************************************/
$subpanel_layout = array(
'top_buttons' => array(
array('widget_class' => 'SubPanelTopCreateButton'),
array('widget_class' => 'SubPanelTopSelectButton', 'popup_module' => 'Accounts'),
),
'where' => '',
'list_fields' => array(
'name' => array(
'vname' => 'LBL_LIST_ACCOUNT_NAME',
'widget_class' => 'SubPanelDetailViewLink',
'width' => '45%',
),
'billing_address_city' => array(
'vname' => 'LBL_LIST_CITY',
'width' => '27%',
),
'phone_office' => array(
'vname' => 'LBL_LIST_PHONE',
'width' => '20%',
),
'edit_button' => array(
'vname' => 'LBL_EDIT_BUTTON',
'widget_class' => 'SubPanelEditButton',
'width' => '4%',
),
'remove_button' => array(
'vname' => 'LBL_REMOVE',
'widget_class' => 'SubPanelRemoveButton',
'width' => '4%',
),
),
);
?>

View File

@@ -0,0 +1,81 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 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".
********************************************************************************/
$subpanel_layout = array(
'top_buttons' => array(
array('widget_class' => 'SubPanelTopCreateButton'),
array('widget_class' => 'SubPanelTopSelectButton', 'popup_module' => 'Accounts'),
),
'where' => '',
'list_fields' => array(
'name' => array(
'vname' => 'LBL_LIST_NAME',
'widget_class' => 'SubPanelDetailViewLink',
'width' => '25%',
),
'phone_office' => array(
'vname' => 'LBL_LIST_PHONE',
'width' => '20%',
),
'email1' => array(
'vname' => 'LBL_LIST_EMAIL',
'widget_class' => 'SubPanelEmailLink',
'width' => '20%',
),
'assigned_user_name' => array(
'vname' => 'LBL_ASSIGNED_TO',
'width' => '20%',
),
'edit_button' => array(
'vname' => 'LBL_EDIT_BUTTON',
'widget_class' => 'SubPanelEditButton',
'width' => '4%',
),
'remove_button' => array(
'vname' => 'LBL_REMOVE',
'widget_class' => 'SubPanelRemoveButton',
'width' => '4%',
),
),
);
?>

Some files were not shown because too many files have changed in this diff Show More