Add php files

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

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">' . 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".
********************************************************************************/
?>

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

@@ -0,0 +1,475 @@
<?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;
}
}
}
?>

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();
?>

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);

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');
?>

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"),
);
?>

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,
),
*/
),
);
?>

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;
}
}

1229
modules/Accounts/Account.php Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,587 @@
<?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.'register_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.'register_address_city'])){
if(empty($temp_query)){
$temp_query = " register_address_city like '".$_POST[$prefix.'register_address_city']."%'";
}else {
$temp_query .= "or register_address_city like '".$_POST[$prefix.'register_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}register_address_street' value='{$contact->alt_address_street}'><input type='hidden' name='${prefix}register_address_city' value='{$contact->alt_address_city}'><input type='hidden' name='${prefix}register_address_state' value='{$contact->alt_address_state}'><input type='hidden' name='${prefix}register_address_postalcode' value='{$contact->alt_address_postalcode}'><input type='hidden' name='${prefix}register_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'];
echo '1';
return '';
}
return null;
}
}
if(!$focus->ACLAccess('Save')){
ACLController::displayNoAccess(true);
sugar_cleanup(true);
}
if($focus->ks_account==''){
$zap=$GLOBALS['db']->query('select ks_account from accounts where deleted=0 and invoice_type="'.$focus->invoice_type.'" order by ks_account desc limit 1');
$wyn=$GLOBALS['db']->fetchByAssoc($zap);
$focus->ks_account= (((int)$wyn['ks_account'])+1);
if($focus->invoice_type=='K'){
$focus->ks_account= sprintf('%04d', $focus->ks_account);
}
if($focus->invoice_type=='U'){
$focus->ks_account= sprintf('%03d', $focus->ks_account);
}
if($focus->invoice_type=='E'){
$focus->ks_account= sprintf('%03d', $focus->ks_account);
}
}
$focus->to_vatid_unformated = str_replace("-","", $focus->to_vatid);
$focus->save($check_notify);
$return_id = $focus->id;
//save addresses
$focus->savePositions($_POST['position_list']);
//save discounts
$focus->savePositions2($_POST['position_list2']);
//save categories
$focus->savePositions3($_POST['position_list3']);
//save banks
$focus->savePositions4($_POST['position_list4']);
$focus->saveWebSitesList($_POST['websites']);
$focus->saveTelephonesList($_POST['telephones']);
$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,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),
'register_address_city' => array('width' => '8',
'label' => 'LBL_REGISTER_ADDRESS_CITY'),
'register_address_street' => array('width' => '8',
'label' => 'LBL_REGISTER_ADDRESS_STREET'),
'register_address_state' => array('width' => '8',
'label' => 'LBL_REGISTER_ADDRESS_STATE'),
'register_address_postalcode' => array('width' => '8',
'label' => 'LBL_REGISTER_ADDRESS_POSTALCODE'),
'register_address_country' => array('width' => '8',
'label' => 'LBL_REGISTER_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,46 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
global $app_strings;
$dashletMeta['MyAccountsDashlet'] = array('module' => 'Accounts',
'title' => translate('LBL_HOMEPAGE_TITLE', 'Accounts'),
'description' => 'A customizable view into Accounts',
'category' => 'Module Views');
?>

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,81 @@
<?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);
$pl4 = $this->bean->getPositionList4();
$this->ss->assign('POSITION_LIST4', $pl4);
$ws = $this->bean->getWebSitesList();
$this->ss->assign('WEBSITES_LIST', $ws);
$ws2 = $this->bean->getTelephonesList();
$this->ss->assign('TELEPHONES_LIST', $ws2);
//$this->ss->assign('WEBSITES_LIST', 'Websites.tpl');
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'];
if ($_REQUEST['IamPopup'])
$OPT['IamPopup'] = '1';
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>';
require_once('modules/EcmSysInfos/EcmSysInfo.php');
$EcmSysInfo = new EcmSysInfo();
$lista = $EcmSysInfo->getBankAccoutnsList();
$bacc = '<select id="bankaccounts" onchange="$(\'#invoice_bank_account\').val(this.value)">';
foreach ($lista as $ba) {
$bacc.='<option value="'.$ba.'"';
if ($ba == $this->bean->invoice_bank_account) $bacc.=' selected ';
$bacc.=' >'.$ba.'</option>';
}
$bacc.='<input type="hidden" id="invoice_bank_account" name="invoice_bank_account" value="'.$this->bean->invoice_bank_account.'"/>';
$this->ss->assign('BANKACCOUNTS', $bacc);
global $app_strings;
$this->ss->assign('LBL_SAVE', $app_strings['LBL_SAVE_BUTTON_LABEL']);
//loading view
echo '<link rel="stylesheet" type="text/css" href="modules/EcmInvoiceOuts/javascript/helper.css" media="screen" /><div class="loading_panel"></div>';

52
modules/Accounts/Menu.php Normal file
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".
********************************************************************************/
/*********************************************************************************
* 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');
?>

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

@@ -0,0 +1,109 @@
<?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;
//konta bankowe
$pll = array();
$exp=explode("||||",$_POST['position_list4']);
foreach($exp as $ep){
if($ep){
$pll[] = $json->decode(htmlspecialchars_decode($ep));
}
}
$_POST['position_list4'] = $pll;
// web sites
$pll = array();
foreach($_POST['websites'] as $key=>$value){
$pll[$key]['id'] = $_POST['websites_id'][$key];
$pll[$key]['www'] = $_POST['websites'][$key];
}
$_POST['websites'] = $pll;
$pll = array();
foreach($_POST['telephones'] as $key=>$value){
$pll[$key]['id'] = $_POST['telephones_id'][$key];
$pll[$key]['telephone'] = $_POST['telephones'][$key];
}
$_POST['telephones'] = $pll;
require_once('modules/Accounts/AccountFormBase.php');
$accountForm = new AccountFormBase();
$prefix = empty($_REQUEST['dup_checked']) ? '' : 'Accounts';
$a = $accountForm->handleSave($prefix, false, false);
if($a->id!=''){
echo $a->id;
}
return;
?>

View File

@@ -0,0 +1,59 @@
<?php
if (!defined('sugarEntry') || !sugarEntry)
die('Not A Valid Entry Point');
if(!isset($_REQUEST['uid']))
die('Nie wybrano kontrahentów');
$accounts=explode(",",$_REQUEST['uid']);
$account_list=array();
$emails;
$error=0;
foreach ($accounts as $account){
$ac= new Account();
$ac->retrieve($account);
if($ac->id=='')continue;
$addTmp=array();
$addTmp['name']=$ac->name;
$sea = new SugarEmailAddress();
$addresses = $sea->getAddressesByGUID($ac->id, 'Accounts');
foreach ($addresses as $address) {
if ($address['email_address'] != '' && $address['opt_out'] == 1) {
$emails[]=$address['email_address'];
$addTmp['emails'][]= $address['email_address'];
}
}
$account_list[]=$addTmp;
}
$success='';
if(isset($_POST['submit'])){
if($_POST['body']!='' && $_POST['title']!='' && $_POST['uid']!=''){
require_once 'include/ECM/EcmSendPdfButton/EcmSendPdfButton.inc';
$t = new EcmSendPdfButton('Users', $usr_id,$itemail,$type);
foreach ($emails as $email){
$t->setBcc($email);
}
$t->setSubject($_REQUEST['title']);
$t->setBody($_REQUEST['body']);
$success = 0;
$success= $t->sendEmail();
} else {
$error=1;
}
}
$ss = new Sugar_Smarty();
$ss->assign('uid',$_REQUEST['uid']);
$ss->assign('body',$_REQUEST['body']);
$ss->assign('error',$error);
$ss->assign('success',$success);
$ss->assign('title',$_REQUEST['title']);
$ss->assign('account_list',$account_list);
$content = $ss->fetch('modules/Accounts/tpls/SendEmail.tpl');
echo $content;
?>

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
if (!$_REQUEST['nip'] || trim($_REQUEST['nip'])=="") return;
$nip = trim($_REQUEST['nip']);
$unip = str_replace('-', '', trim($_REQUEST['nip']));
$db = $GLOBALS['db'];
$r = $db->query("SELECT id FROM accounts WHERE to_vatid='$nip' OR to_vatid_unformated='$unip' AND deleted='0'");
echo $r->num_rows;
return;

145
modules/Accounts/ee.php Normal file
View File

@@ -0,0 +1,145 @@
<?php
ini_set('display_errors',1);
require_once 'include/ECM/GusApiSugar/vendor/autoload.php';
use GusApi\GusApi;
use GusApi\RegonConstantsInterface;
use GusApi\Exception\InvalidUserKeyException;
use GusApi\ReportTypes;
class GusApiSugar
{
private $key = 'eb11f76c0aee4c6e8501';
private $gus;
private $cuser;
private $array = null;
public function __construct ()
{
$this->gus = new GusApi($this->key,
new \GusApi\Adapter\Soap\SoapAdapter(
RegonConstantsInterface::BASE_WSDL_URL,
RegonConstantsInterface::BASE_WSDL_ADDRESS));
global $current_user;
$this->cuser = $current_user;
}
public function validate ($code)
{
$_SESSION['checkedgus'] = $this->gus->checkCaptcha($_SESSION['sigusd'],
$code);
var_dump($_SESSION['checkedgus']);
}
public function getRaport ($gusReport)
{
if ($gusReport->type == 'f') {
$nr = null;
foreach ($gusReport->silo as $val) {
if ($val != '') {
$nr = $val;
}
}
switch ($nr) {
case 0:
return $this->gus->getFullReport($_SESSION['sid'], $gusReport,
ReportTypes::REPORT_ACTIVITY_PHYSIC_PERSON);
break;
case 1:
return $this->gus->getFullReport($_SESSION['sid'], $gusReport,
ReportTypes::REPORT_ACTIVITY_PHYSIC_CEGID);
break;
case 2:
return $this->gus->getFullReport($_SESSION['sid'], $gusReport,
ReportTypes::REPORT_ACTIVITY_PHYSIC_AGRO);
break;
case 3:
return $this->gus->getFullReport($_SESSION['sid'], $gusReport,
ReportTypes::REPORT_ACTIVITY_PHYSIC_OTHER_PUBLIC);
break;
case 4:
return $this->gus->getFullReport($_SESSION['sid'], $gusReport,
ReportTypes::REPORT_ACTIVITY_LOCAL_PHYSIC_WKR_PUBLIC);
break;
}
} else {
return $this->gus->getFullReport($_SESSION['sid'], $gusReport,
ReportTypes::REPORT_PUBLIC_LAW);
}
}
public function getData ($nip)
{
$array = null;
try {
$gusReport = $this->gus->getByNip($_SESSION['sigusd'], $nip);
$array['type']=$gusReport->type;
$array[] = $this->getRaport($gusReport);
} catch (\GusApi\Exception\NotFoundException $e) {
$error = $this->gus->getResultSearchMessage();
if ('Wymagane pobranie i sprawdzenie kodu Captcha' == $error) {
$_SESSION['checkedgus'] = false;
$_SESSION['sigusd'] = '';
$this->doLogin();
return;
} else {
return array(
'error' => 'tak',
$error
);
}
}
if($array==null){
$this->doLogin();
return;
}
return $array;
}
public function doLogin ($code = null, $img = null)
{
if ($this->gus->serviceStatus() ===
RegonConstantsInterface::SERVICE_AVAILABLE) {
if (! isset($_SESSION['sigusd']) ||
! $this->gus->isLogged($_SESSION['sigusd'])) {
$_SESSION['sigusd'] = $this->gus->login();
$_SESSION['checkedgus'] = false;
}
if (isset($img)) {
$_SESSION['checkedgus'] = $this->gus->checkCaptcha($_SESSION['sigusd'],
$img);
}
if (! $_SESSION['checkedgus']) {
$image = fopen("upload/captcha" . $this->cuser->id . ".jpeg", 'w+');
$captcha = $this->gus->getCaptcha($_SESSION['sigusd']);
fwrite($image, base64_decode($captcha));
fclose($image);
return array(
'cuserid' => $this->cuser->id
);
} else {
return $this->getData($code);
}
} else {
return array(
'error' => 'tak'
);
}
}
}
$g= new GusApiSugar();
$back=$g->doLogin('5030056367');
?>

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"
,"register_address_street"
,"register_address_city"
,"register_address_state"
,"register_address_postalcode"
,"register_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'
, 'register_address_street'
, 'register_address_city'
, 'register_address_state'
, 'register_address_postalcode'
, 'register_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,235 @@
<?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_VAT_PAYER' => 'Active VAT payer',
'LBL_PAYMENT_METHOD' => 'Default payment method',
'LBL_DAYS' => 'Payment days',
'LBL_NIP_EXIST' => 'INFO: This VATID exist in Accounts database',
'LBL_INVOICE_BANK_ACCOUNT' => 'Default bank account',
'LBL_ASSIGNED_CATEGORIES' => 'Assigned categories',
'LBL_STREET' => 'Street',
'LBL_EMAIL_ADDRESS' => 'E-mail',
'LBL_SHOP_PANEL' => 'Shop online',
'LBL_SHOP_USER' => 'Shop user',
'LBL_ECMCOMMUNE' =>"Commune",
'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_REGISTER' => 'Push Shipping',
'LBL_RATING' => 'Rating:',
'LBL_SAVE_ACCOUNT' => 'Save Account',
'LBL_SEARCH_FORM_TITLE' => 'Account Search',
'LBL_REGISTER_ADDRESS_CITY' => 'Shipping City:',
'LBL_REGISTER_ADDRESS_COUNTRY' => 'Shipping Country:',
'LBL_REGISTER_ADDRESS_POSTALCODE' => 'Shipping Postal Code:',
'LBL_REGISTER_ADDRESS_STATE' => 'Shipping State:',
'LBL_REGISTER_ADDRESS_STREET_2' => 'Shipping Street 2',
'LBL_REGISTER_ADDRESS_STREET_3' => 'Shipping Street 3',
'LBL_REGISTER_ADDRESS_STREET_4' => 'Shipping Street 4',
'LBL_REGISTER_ADDRESS_STREET' => 'Shipping Street:',
'LBL_REGISTER_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 register address',
'NTC_COPY_BILLING_ADDRESS2' => 'Copy to register',
'NTC_COPY_REGISTER_ADDRESS' => 'Copy register address to billing address',
'NTC_COPY_REGISTER_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',
);
?>

View File

@@ -0,0 +1,240 @@
<?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(
'LBL_SALES_CHART_NAME' => 'Nazwa',
'LBL_SALES_CHART_NETTO' => 'Sprzedaż',
'LBL_SALES_CHART_BUY' => 'Zakup',
'LBL_SALES_CHART_INCOME' => 'Dochód',
'LBL_SALES_CHART_NARZUT' => 'Narzut',
'LBL_SALES_CHART_INCOME_PERCENT' => 'Marża %',
'LBL_SALES_CHART_NOPE' => 'Brak sprzedaży w ostatnim roku.',
'LBL_SALES_CHART_SUMMARY' => 'Suma',
'LBL_PANEL_SALES' => 'Wykres sprzedaży',
'LBL_VAT_PAYER' => 'Czynny płatnik VAT',
'LBL_PAYMENT_METHOD' => 'Forma płatności',
'LBL_DAYS' => 'Liczba dni do płatności',
'LBL_NIP_EXIST' => 'Informacja: Kontrahent o podanym numerze NIP istnieje w bazie danych',
'LBL_INVOICE_BANK_ACCOUNT' => 'Domyślne konto bankowe',
'LBL_SYNTHETICACCOUNTS' => 'Konto jakies tam',
'HELP_LBL_SYNTHETICACCOUNTS_BUTTON' => 'Dodaj kolejne konto',
'HELP_LBL_SYNTHETICACCOUNTS_BUTTONDEL' => 'Usuń',
'LBL_WITHOUT_HISTORY' => 'Bez historii',
'LBL_ADDRESS_NIP' =>'NIP',
'LBL_ADDRESS_ILN'=>'ILN',
//add mz
'LBL_PANEL_DISCOUNTACCOUNT'=>'Upusty od obrotu',
'LBL_ECMCOMMUNE' =>"Gmina",
'LBL_REGISTER_COMMUNE' => 'Gmina',
'LBL_ASSIGNED_CATEGORIES' => 'Przypisane kategorie',
'LBL_STREET' => 'Ulica',
'LBL_INDEX' => "Indeks",
'LBL_PANEL_BANK_ACCOUNTS' => 'Konta Bankowe',
'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',
'LBL_REGISTER_ADDRESS_LIST' => 'Adres',
'LBL_ADDRESS_NAME' => 'Nazwa',
'LBL_WEBSITE_NAME' => 'Strona WWW',
'LBL_REGON' => 'Regon',
'LBL_KRS' => 'KRS',
'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_PAYMENTCONDITION_ID' => 'Warunki płatności',
'LBL_DELIVERYCONDITION_NAME' => 'Warunki dostawy',
'LBL_DELIVERYCONDITION_ID' => '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_LIST_POSTALCODE' => 'Kod pocztowy',
'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',
'LBL_NATURAL_PERSON' => 'Osoba Fizyczna',
// Dashlet Categories
'LBL_CHARTS' => 'Wykresy',
'LBL_TYPE_2' => 'Typ konrahenta',
'LBL_DEFAULT' => 'Widoki',
'LBL_MISC' => 'Inne',
'LBL_UTILS' => 'Narzędzia',
// END Dashlet Categories
// BANK ACCOUNTS
'LBL_BANK_POSITION' => 'Poz.',
'LBL_BANK_NAME' => 'Nazwa',
'LBL_BANK_ACCOUNT' => 'Numer konta',
// END
'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: <br><br><br>Gmina:',
'LBL_BILLING_ADDRESS2' => '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:',
'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_REGISTER' => 'Kopiuj Adres rejestrowy',
'LBL_RATING' => 'Ocena:',
'LBL_SAVE_ACCOUNT' => 'Zapisz kontrahenta',
'LBL_SEARCH_FORM_TITLE' => 'Wyszukiwanie kontrahenta',
'LBL_REGISTER_ADDRESS_CITY' => 'Adres rejestrowy - Miasto:',
'LBL_REGISTER_ADDRESS_COUNTRY' => 'Adres rejestrowy - Kraj:',
'LBL_REGISTER_ADDRESS_POSTALCODE' => 'Adres rejestrowy - Kod pocztowy:',
'LBL_REGISTER_ADDRESS_STATE' => 'Adres rejestrowy - Województwo:',
'LBL_REGISTER_ADDRESS_STREET_2' => 'Adres rejestrowy - Ulica 2',
'LBL_REGISTER_ADDRESS_STREET_3' => 'Adres rejestrowy - Ulica 3',
'LBL_REGISTER_ADDRESS_STREET_4' => 'Adres rejestrowy - Ulica 4',
'LBL_REGISTER_ADDRESS_STREET' => 'Adres rejestrowy - Ulica:',
'LBL_REGISTER_ADDRESS' => 'Adres rejestrowy:<br><br><br>Gmina:',
'LBL_REGISTER_ADDRESS2' => 'Adres rejestrowy:',
'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 #1:',
'LBL_WEBSITE2' => 'Strona WWW #2:',
'LBL_WEBSITE3' => 'Strona WWW #3:',
'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_REGISTER_ADDRESS' => 'Kopiuj adres wysyłki do adresu Korespondencyjnego',
'NTC_COPY_REGISTER_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',
);
?>

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".
********************************************************************************/
$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','register_address_street')),
'address_city'=> array('query_type'=>'default','db_field'=>array('billing_address_city','register_address_city'), 'vname' =>'LBL_CITY'),
'address_state'=> array('query_type'=>'default','db_field'=>array('billing_address_state','register_address_state'), 'vname' =>'LBL_STATE'),
'address_postalcode'=> array('query_type'=>'default','db_field'=>array('billing_address_postalcode','register_address_postalcode'), 'vname' =>'LBL_POSTAL_CODE'),
'address_country'=> array('query_type'=>'default','db_field'=>array('billing_address_country','register_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',
),
'website'=> 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
'without_history'=> array('query_type'=>'default','db_field'=>array('without_history'),'my_items'=>true, 'vname' => 'LBL_WITHOUT_HISTORY', 'type' => 'bool'),
);
?>

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,336 @@
<?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 => 'DELETE'
)
),
'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' => 'index_dbf',
'label' => 'LBL_INDEX'
)
),
array(
'to_vatid',
'regon'
),
array(
'krs',
'natural_person'
),
array(
'ks_account',
'vat_payer',
),
array(
array(
'name' => 'shop_number',
'label' => 'Numer sklepu'
),
'supplier_code',
),
array(
'iln',
'parent_name',
),
array(
array(
'name' => 'register_address_street',
'label' => 'LBL_REGISTER_ADDRESS',
'type' => 'address',
'displayParams' => array(
'key' => 'register'
)
),
array(
'name' => 'billing_address_street',
'label' => 'LBL_BILLING_ADDRESS',
'type' => 'address',
'displayParams' => array(
'key' => 'billing'
)
)
),
array(
'maps',
'isHidden'
),
array(
array(
'name' => 'email1',
'studio' => 'false',
'label' => 'LBL_EMAIL'
),
array(
'name' => 'items_list_panel',
'hideLabel' => false,
'label' => 'LBL_WEBSITE_NAME',
'customCode' => "
{include file='modules/Accounts/tpls/Websites_DetailView.tpl'}"
/*
<input type="hidden" name="websites_list" id="websites_list" value=\'{$WEBSITES_LIST}\'>
<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">
</div><br>', */
)
),
array(
array(
),
array(
'name' => 'items_list_panel',
'hideLabel' => false,
'label' => 'Telefony',
'customCode' => "
{include file='modules/Accounts/tpls/Telephones_DetailView.tpl'}"
/*
<input type="hidden" name="websites_list" id="websites_list" value=\'{$WEBSITES_LIST}\'>
<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">
</div><br>', */
)
),
array(
array(
'name' => 'description',
'comment' => 'Full text of the note',
'label' => 'LBL_DESCRIPTION'
),
array(
'name' => 'pdf_text',
'comment' => 'Full text of the note',
'label' => 'Uwagi na fakturze'
)
),
array(
array(
'name' => 'phone_office',
'comment' => 'The office phone number',
'label' => 'LBL_PHONE_OFFICE'
),
array(
'name' => 'phone_fax',
'comment' => 'The fax phone number of this company',
'label' => 'LBL_FAX'
)
),
array(
array(
'name' => 'account_type',
'comment' => 'The Company is of this type',
'label' => 'LBL_TYPE'
),
array(
'name' => 'account_type2',
'comment' => 'The Company is of this type',
'label' => 'LBL_TYPE_2'
)
),
array(
'invoice_type',
'ecmdeliverycondition_name'
),
array(
'',
array(
'name' => 'currency_id',
'label' => 'LBL_CURRENCY'
)
),
array(
'payment_method',
'invoice_bank_account'
),
array(
'payment_date_days',
''
)
),
'LBL_SHOP_PANEL' => array(
array(
'shop_user',
'isAllegroUser'
)
),
'Rozrachunki' => array(
array(
array(
'name' => 'saldo',
'label' => 'Saldo',
'customCode' => '{$saldo}'
),
/*
array(
'name' => 'today_saldo',
'label' => 'Saldo na dziś',
'customCode' => '{$today_saldo}'
) */
),
array('allow_prevent','allow_debt_collection'
),
array(
array(
'name' => 'rozrachunki',
'allCols' => true,
'hideLabel' => true,
'customCode' => '<a href="index.php?module=EcmPaymentStates&action=AccountPaymentStates&account_id={$fields.id.value}">Sprawdź</a>'
)
)
),
'LBL_PANEL_DELIVERY_ADDRESSES' => array(
0 => array(
0 => array(
'name' => 'items_list_panel',
'allCols' => true,
'hideLabel' => true,
'customCode' => '{$POSITIONS}'
)
)
),
'LBL_PANEL_BANK_ACCOUNTS' => array(
0 => array(
0 => array(
'name' => 'items_list_panel',
'allCols' => true,
'hideLabel' => true,
'customCode' => '{$POSITIONS4}'
)
)
),
'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_SALES' => array(
0 => array(
0 => array(
'name' => 'sales_chart_panel',
'allCols' => true,
'hideLabel' => true,
'customCode' => '{include file="modules/Accounts/tpls/SalesChart.tpl"}'
)
)
),
'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,406 @@
<?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(
array(
'customCode' => '<input type="submit" name="save" class="button" value="{$LBL_SAVE}" onclick="saveItems(true);saveItems2(true);saveItems3(true);saveItems4(true);this.form.action.value=\'Save\';return check_form_(\'EditView\');" />'
),
'CANCEL',
array(
'customCode' => '<link rel="stylesheet" href="modules/Accounts/css/jquery-ui.css">'
)
)
),
'maxColumns' => '2',
'widths' => array(
array(
'label' => '10',
'field' => '30'
),
array(
'label' => '10',
'field' => '30'
)
),
'includes' => array(
array(
'file' => 'modules/Accounts/jquery.min.js'
),
array(
'file' => 'modules/Accounts/jquery_ui.js'
),
array(
'file' => 'modules/Accounts/Account.js'
),
array(
'file' => 'modules/Accounts/Banks.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/js/Websites.js'
),
array(
'file' => 'modules/Accounts/js/Telephones.js'
),
array(
'file' => 'modules/Accounts/js/States.js'
),
array(
'file' => 'modules/Accounts/MyTable.js'
),
array(
'file' => 'modules/Accounts/paramsMT.js'
),
array(
'file' => 'include/ECM/GusApiSugar/GusApiSugar.js'
)
)
),
'panels' => array(
'lbl_account_information' => array(
array(
array(
'name' => 'name',
'label' => 'LBL_NAME',
'displayParams' => array(
'required' => true,
'rows' => 4,
'cols' => 50
)
),
array(
'name' => 'index_dbf',
'label' => 'LBL_INDEX'
)
),
array(
array(
'name' => 'to_vatid',
'label' => 'LBL_TO_VATID',
'customCode' => '<input value="{$fields.to_vatid.value}" name="to_vatid" id="to_vatid" type="text"/><input type="button" onClick="GusApiInit();" value="Szukaj w GUS"><div id="GusApiSearch" style="display:none"><div><p id="nip_exist" style="display:none">{$MOD.LBL_NIP_EXIST}</p>'
),
'regon'
),
array(
'vat_payer',
'iln'
),
array(
'krs',
'natural_person'
),
array(
array(
'name' => 'shop_number',
'label' => 'Numer sklepu'
),
'supplier_code',
),
array(
'parent_name',
'isHidden'
),
array(
array(
'name' => 'register_address_street',
'hideLabel' => true,
'type' => 'address',
'displayParams' => array(
'key' => 'register',
'rows' => 2,
'cols' => 50,
'maxlength' => 150
)
),
array(
'name' => 'billing_address_street',
'hideLabel' => true,
'type' => 'address',
'displayParams' => array(
'key' => 'billing',
'rows' => 2,
'cols' => 50,
'maxlength' => 150
)
)
),
array(
array(
'name' => 'email1',
'studio' => 'false',
'label' => 'LBL_EMAIL'
),
array(
'name' => 'items_list_panel',
'hideLabel' => false,
'label' => 'LBL_WEBSITE_NAME',
'customCode' => "
{include file='modules/Accounts/tpls/Websites_EditView.tpl'}"
/*
<input type="hidden" name="websites_list" id="websites_list" value=\'{$WEBSITES_LIST}\'>
<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">
</div><br>', */
)
),
array(
array(),
array(
'name' => 'items_list_panel',
'hideLabel' => false,
'label' => 'Telefony',
'customCode' => "
{include file='modules/Accounts/tpls/Telephones_EditView.tpl'}"
/*
<input type="hidden" name="websites_list" id="websites_list" value=\'{$WEBSITES_LIST}\'>
<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">
</div><br>', */
)
),
array(
array(
'name' => 'phone_office',
'label' => 'LBL_PHONE_OFFICE'
),
array(
'name' => 'phone_fax',
'label' => 'LBL_FAX'
)
),
array(
'account_type',
'account_type2'
),
array(
'invoice_type',
'ecmdeliverycondition_name'
),
array(),
array(
array(
'name' => 'description',
'label' => 'LBL_DESCRIPTION',
'displayParams' => array(
'rows' => 4,
'cols' => 50
)
),
array(
'name' => 'pdf_text',
'label' => 'Uwagi na fakturze',
'displayParams' => array(
'rows' => 4,
'cols' => 50
)
)
),
array(
'payment_method',
array(
'name' => 'bankaccount',
'label' => 'LBL_INVOICE_BANK_ACCOUNT',
'customCode' => '{$BANKACCOUNTS}'
)
),
array(
'payment_date_days',
'ks_account',
),
array(
'',
array(
'name' => 'currency_id',
'label' => 'LBL_CURRENCY'
)
),
array(
'allow_prevent', 'allow_debt_collection'
),
),
'LBL_SHOP_PANEL' => array(
array(
'shop_user',
'isAllegroUser'
)
),
'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:1100px;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:1100px;" id="itemsTable">
<thead id="head">
<tr id="tr">
<td width="3%">{$MOD.LBL_ADDRESS_POSITION}</td>
<td width="12%">{$MOD.LBL_ADDRESS_NAME}</td>
<td width="12%">{$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_NIP}</td>
<td width="10%">{$MOD.LBL_ADDRESS_ILN}</td>
<td width="2%"></td>
</tr>
</thead>
<tbody id="tbody">
</tbody>
</table>
</div><br>'
)
)
),
'LBL_PANEL_BANK_ACCOUNTS' => array(
array(
array(
'name' => 'items_list_panel',
'allCols' => true,
'hideLabel' => true,
'customCode' => '
<input type="hidden" name="position_list4" id="position_list4" value=\'{$POSITION_LIST4}\'>
<link rel="stylesheet" type="text/css" href="modules/Accounts/MyTable.css" />
<div style="width:1100px;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:1100px;" id="itemsTable4">
<thead id="head">
<tr id="tr">
<td width="3%">{$MOD.LBL_BANK_POSITION}</td>
<td width="12%">{$MOD.LBL_BANK_NAME}</td>
<td width="12%">{$MOD.LBL_BANK_ACCOUNT}</td>
<td width="2%"></td>
</tr>
</thead>
<tbody id="tbody">
</tbody>
</table>
</div><br>'
)
)
),
'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_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,217 @@
<?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(
'INDEX_DBF' => array(
'width' => '3%',
'label' => 'LBL_INDEX',
'link' => true,
'default' => true
),
'NAME' => array(
'width' => '20%',
'label' => 'LBL_LIST_ACCOUNT_NAME',
'link' => true,
'default' => true
),
'REGISTER_ADDRESS_CITY' => array(
'width' => '5%',
'label' => 'LBL_LIST_CITY',
'default' => true
),
'REGISTER_ADDRESS_POSTALCODE' => array(
'width' => '10%',
'label' => 'LBL_REGISTER_ADDRESS_POSTALCODE',
'default' => true
),
'REGISTER_ADDRESS_STREET' => array(
'width' => '15%',
'label' => 'LBL_REGISTER_ADDRESS_STREET',
'default' => true
),
'TO_VATID' => array(
'width' => '5%',
'label' => 'LBL_TO_VATID',
'default' => true
),
'INVOICE_TYPE' => array(
'width' => '5%',
'label' => 'LBL_INVOICE_TYPE',
'default' => true
),
'CURRENCY_ID' => array(
'width' => '2%',
'label' => 'LBL_CURRENCY',
'default' => true
),
'ASSIGNED_USER_NAME' => array(
'width' => '10%',
'label' => 'LBL_LIST_ASSIGNED_USER',
'module' => 'Employees',
'id' => 'ASSIGNED_USER_ID',
'default' => false
),
'ACCOUNT_TYPE' => array(
'width' => '10%',
'label' => 'LBL_ACCOUNT_TYPE',
'default' => true
),
'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
),
'REGISTER_ADDRESS_STATE' => array(
'width' => '7%',
'label' => 'LBL_REGISTER_ADDRESS_STATE',
'default' => false
),
'REGISTER_ADDRESS_COUNTRY' => array(
'width' => '10%',
'label' => 'LBL_REGISTER_ADDRESS_COUNTRY',
'default' => false
),
'RATING' => array(
'width' => '10%',
'label' => 'LBL_RATING',
'default' => false
),
'PHONE_ALTERNATE' => array(
'width' => '10%',
'label' => 'LBL_OTHER_PHONE',
'default' => false
),
'WEBSITE' => array(
'width' => '10%',
'label' => 'LBL_WEBSITE',
'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' => false
),
'REGON' => array(
'width' => '5%',
'label' => 'LBL_REGON',
'default' => false
),
'KS_ACCOUNT' => array(
'width' => '5%',
'label' => 'Konto KS',
'default' => false
),
'SHOP_NUMBER' => array (
'width' => '5%',
'label' => 'Numer sklepu',
'default' => true
),
'SUPPLIER_CODE' => array (
'width' => '5%',
'label' => 'Kod dostawcy',
'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,109 @@
<?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',
'register_address_city' => 'accounts.register_address_city',
'phone_office' => 'accounts.phone_office'
),
'searchInputs' => array('name', 'register_address_city', 'phone_office'),
'listviewdefs' => array(
'NAME' => array(
'width' => '40',
'label' => 'LBL_LIST_ACCOUNT_NAME',
'link' => true,
'default' => true,
),
'REGISTER_ADDRESS_CITY' => array(
'width' => '10',
'label' => 'LBL_LIST_CITY',
'default' => true,
),
'REGISTER_ADDRESS_STATE' => array(
'width' => '15',
'label' => 'LBL_STATE',
'default' => true,
),
'REGISTER_ADDRESS_COUNTRY' => array(
'width' => '10',
'label' => 'LBL_COUNTRY',
'default' => true,
),
'REGISTER_ADDRESS_POSTALCODE' => array(
'width' => '8',
'label' => 'Kod',
'default' => true,
),
'ACCOUNT_TYPE' => array(
'width' => '2',
'label' => 'LBL_ACCOUNT_TYPE',
'default' => true,
),
),
'searchdefs' => array(
'name'=> array (
'name' => 'name',
'label' => 'LBL_NAME',
'displayParams' =>
array (
'required' => true,
'rows' => 1,
'cols' => 50,
),
),
'index_dbf',
'to_vatid',
'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,146 @@
<?php
/* * *******************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2007 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU 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 General Public License for more
* details.
*
* You should have received a copy of the GNU 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 General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
* ****************************************************************************** */
$searchdefs['Accounts'] = array(
'templateMeta' => array(
'maxColumns' => '3',
'widths' => array(
'label' => '5',
'field' => '25'
),
),
'layout' => array(
'basic_search' => array(
'name' =>
array(
'name' => 'name',
'type' => 'name',
),
'account_type',
'index_dbf',
'to_vatid',
'current_user_only' =>
array(
'name' => 'current_user_only',
'label' => 'LBL_CURRENT_USER_FILTER',
'type' => 'bool',
),
'isHidden' =>
array(
'name' => 'isHidden',
'label' => 'Pokaż ukryte',
'type' => 'bool',
),
),
'advanced_search' => array(
'name' =>
array(
'name' => 'name',
'type' => 'name',
),
'index_dbf',
'to_vatid',
'account_type',
'register_address_city' =>
array(
'name' => 'register_address_city',
'label' => 'LBL_LIST_CITY',
),
'register_address_postalcode' =>
array(
'name' => 'register_address_postalcode',
'label' => 'LBL_LIST_POSTALCODE',
),
'register_address_ecmcommune_name' =>
array(
'name' => 'register_address_ecmcommune_name',
'label' => 'LBL_ECMCOMMUNE',
),
'isHidden' =>
array(
'name' => 'isHidden',
'label' => 'Pokaż ukryte',
'type' => 'bool',
),
'assigned_user_name',
'without_history' => array(
'name' => 'without_history',
'label' => 'LBL_WITHOUT_HISTORY',
'type' => 'bool',
),
'iln'
),
),
);
?>

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,267 @@
<?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 (
'contacts' => array (
'order' => 10,
'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' => 'Kontakty',
'top_buttons' => array (
// array('widget_class' => 'SubPanelTopCreateAccountNameButton'),
array (
'widget_class' => 'SubPanelTopSelectButton',
'mode' => 'MultiSelect'
),
array (
'widget_class' => 'SubPanelTopCreateButton'
)
)
),
'activities' => array (
'order' => 40,
'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'
)
),
'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' => 30,
'module' => 'Documents',
'subpanel_name' => 'default',
'get_subpanel_data' => 'documents',
'title_key' => 'Dokumenty',
'top_buttons' => array(
array('widget_class' => 'SubPanelTopCreateButton'),
),
),
*/
'documents' => array (
'order' => 130,
'module' => 'Documents',
'subpanel_name' => 'default',
'get_subpanel_data' => 'documents',
'title_key' => 'Dokumenty'
),
'ecmproducts' => array (
'order' => 120,
'module' => 'EcmProducts',
'subpanel_name' => 'ForAccountsSale',
'get_subpanel_data' => 'function:get_unlinked_product_query',
'title_key' => 'Zakupione produkty',
'generate_select' => true,
'function_parameters' => array (
'return_as_array' => 'true'
)
),
'ecminvoiceouts' => array (
'order' => 60,
'module' => 'EcmInvoiceOuts',
'subpanel_name' => 'default',
'get_subpanel_data' => 'ecminvoiceouts',
'add_subpanel_data' => 'ecminvoiceout_id',
'sort_order' => 'desc',
'sort_by' => 'register_date',
'title_key' => 'Faktury',
'top_buttons' => array (
array (
'widget_class' => 'SubPanelTopCreateButton'
)
)
),
'ecmprepaymentinvoices' => array (
'order' => 70,
'module' => 'EcmPrepaymentInvoices',
'subpanel_name' => 'default',
'get_subpanel_data' => 'ecmprepaymentinvoices',
'title_key' => 'Faktury zaliczkowe',
'top_buttons' => array (
array (
'widget_class' => 'SubPanelTopCreateButton'
)
)
),
'ecmquotes' => array (
'order' => 80,
'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'
)
)
),
'ecmstockdocins' => array (
'order' => 100,
'module' => 'EcmStockDocIns',
'subpanel_name' => 'default',
'get_subpanel_data' => 'ecmstockdocins',
'add_subpanel_data' => 'ecmstockdocin_id',
'title_key' => 'Dokument PZ',
'top_buttons' => array (
array (
'widget_class' => 'SubPanelTopCreateButton'
)
)
),
'ecmsales' => array (
'order' => 90,
'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'
)
)
)
)
);
?>

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%',
),
),
);
?>

View File

@@ -0,0 +1,93 @@
<?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%',
'default' => true,
),
'billing_address_city' =>
array (
'vname' => 'LBL_LIST_CITY',
'width' => '20%',
'default' => true,
),
'billing_address_country' =>
array (
'type' => 'varchar',
'vname' => 'LBL_BILLING_ADDRESS_COUNTRY',
'width' => '7%',
'default' => true,
),
'phone_office' =>
array (
'vname' => 'LBL_LIST_PHONE',
'width' => '20%',
'default' => true,
),
'edit_button' =>
array (
'vname' => 'LBL_EDIT_BUTTON',
'widget_class' => 'SubPanelEditButton',
'width' => '4%',
'default' => true,
),
'remove_button' =>
array (
'vname' => 'LBL_REMOVE',
'widget_class' => 'SubPanelRemoveButton',
'width' => '4%',
'default' => true,
),
)
);
?>

View File

@@ -0,0 +1,13 @@
<?php
$db=$GLOBALS['db'];
$number=1001;
$query="select id from accounts where deleted=0";
$zap=$db->query($query);
while($dane=$db->fetchByAssoc($zap)){
$a = new Account();
$a->retrieve($dane['id']);
$a->ks_account=$number;
$a->save();
$number++;
}
?>

View File

@@ -0,0 +1,85 @@
<?php
error_reporting(E_PARSE | E_WARNING);
$json = getJSONobj();
$pll = array();
$i = 0;
while (isset($_POST['p_' . $i])) {
$pll[] = $json->decode(htmlspecialchars_decode($_POST['p_' . $i]));
$_POST['p_' . $i] = '';
$i++;
}
$_POST = $json->decode(htmlspecialchars_decode($_POST['otherFormData']));
$_POST['position_list'] = $pll;
if (isset($_REQUEST['record']) && $_REQUEST['record'] != '' && $_REQUEST['cache'] != "fromJava") {
require_once("modules/Accounts/Account.php");
$focus = new Account();
$method = (isset($_REQUEST['method']) && $_REQUEST['method'] != '') ? $_REQUEST['method'] : 'D';
$focus->getPDF($_REQUEST['record'], $method, null, @$_REQUEST['type']);
} else
if ($_REQUEST['cache'] == "fromJava" && $_GET['from'] != "EcmInvoiceOuts") {
$_SESSION['PDF_ECMINVOICEOUTS'] = $_POST;
} else
if ($_GET['from'] == "EcmInvoiceOuts") {
require_once("modules/EcmInvoiceOuts/EcmInvoiceOut.php");
$focus = new EcmInvoiceOut();
if (isset($_SESSION['PDF_ECMINVOICEOUTS']['record']) && $_SESSION['PDF_ECMINVOICEOUTS']['record'] != '') {
$focus->retrieve($_SESSION['PDF_ECMINVOICEOUTS']['record']);
}
if (!$focus->ACLAccess('Save')) {
ACLController::displayNoAccess(true);
sugar_cleanup(true);
}
foreach ($focus->column_fields as $field) {
if (isset($_SESSION['PDF_ECMINVOICEOUTS'][$field])) {
$value = $_SESSION['PDF_ECMINVOICEOUTS'][$field];
$focus->$field = $value;
}
}
foreach ($focus->additional_column_fields as $field) {
if (isset($_SESSION['PDF_ECMINVOICEOUTS'][$field])) {
$value = $_SESSION['PDF_ECMINVOICEOUTS'][$field];
$focus->$field = $value;
}
}
if (isset($_SESSION['PDF_ECMINVOICEOUTS']['to_is_vat_free']) && $_SESSION['PDF_ECMINVOICEOUTS']['to_is_vat_free'])
$focus->to_is_vat_free = 1;
else
$focus->to_is_vat_free = 0;
$json = getJSONobj();
$pl = $_SESSION['PDF_ECMINVOICEOUTS']['position_list'];
$focus->position_list = $pl;
$focus->document_no = $_SESSION['PDF_ECMINVOICEOUTS']['document_no'];
$focus->wz_id = $_SESSION['PDF_ECMINVOICEOUTS']['out_id'];
$focus->ecmpaymentcondition_text = EcmInvoiceOut::getTranslation('EcmPaymentConditions', $focus->ecmpaymentcondition_id, $focus->ecmlanguage);
//die();
$focus->getPDF();
}

View File

@@ -0,0 +1,22 @@
<?php
$query = "SELECT id, name FROM ecmproducts";
$result = $GLOBALS['db']->query($query);
$ile =0;
$ile_nie =0;
while ($row=$GLOBALS['db']->fetchByAssoc($result)) {
$name = $row['name'];
if (strlen($name) % 2 == 0) {
$start = substr($name, 0, strlen($name)/2);
$end = substr($name, strlen($name)/2, strlen($name)/2);
if ($start == $end) {
$query2 = "UPDATE ecmproducts SET name = '".$start."' WHERE id ='".$row['id']."';";
//$GLOBALS['db']->query($query2);
echo $query2."<br>";
}
}
}
echo "koniec";
?>

133
modules/Accounts/share.php Normal file
View File

@@ -0,0 +1,133 @@
<?php
if (! defined('sugarEntry') || ! sugarEntry)
die('Not A Valid Entry Point');
if (! isset($_REQUEST['uid']))
die('Nie wybrano kontrahentów');
$users = array();
$accounts = explode(",", $_REQUEST['uid']);
$account_list = array();
$error = '';
$db = $GLOBALS['db'];
global $sugar_config, $current_user;
$arr=array('421173b5deee25c1329ab6b5877534e2','d711ec8a23fbf72cf82ea4edd60f0d27','4267b9fbbf8c0676ef9f947951dad3c3','d711ec8a23fbf72cf82ea4edd60f0d27','da619dbb95ec3b7a8c177947a6912a9b',
'819d323467218194d783f397118d4c59'
);
if(in_array($current_user->id,$arr)){
$users = array(
'preDb_41665e296294da87d5ccf525912d9f55' => array(
'name' => 'Asaj Sp. z o.o.',
'dbasename' => 'preDb_41665e296294da87d5ccf525912d9f55'
),
'preDb_3406858f996aa369f185d5885f57a3ab' => array(
'name' => 'Foto Land sp. j.',
'dbasename' => 'preDb_3406858f996aa369f185d5885f57a3ab'
),
'preDb_49d2729a9cef4fbd51f87c458da576fa' => array(
'name' => 'B. Licht GmbH',
'dbasename' => 'preDb_49d2729a9cef4fbd51f87c458da576fa'
),
'preDb_5d907e51714c4030c6454a19a5403cf3' => array(
'name' => 'Patio Dystrybucja sp. zo.o.',
'dbasename'=>'preDb_5d907e51714c4030c6454a19a5403cf3'
),
'preDb_9865dd27d666f40fa4742496ec188187' => array(
'name' => 'ASTRA S.A.',
'dbasename'=>'preDb_9865dd27d666f40fa4742496ec188187'
)
);
}
else {
$users = array(
'preDb_577bab27048e83121574ddb97f22be59' => array(
'name' => 'E5 Polska sp. z o.o.',
'dbasename' => 'preDb_577bab27048e83121574ddb97f22be59'
),
'preDb_5b474e6d65c1f57c0b93064febee44c7' => array(
'name' => 'Klanad sp. z o.o.',
'dbasename' => 'preDb_5b474e6d65c1f57c0b93064febee44c7'
),
'preDb_a8fb05ea688ef8d7d0385b1e535e9dba' => array(
'name' => 'BDG Maria Daniszewska',
'dbasename' => 'preDb_a8fb05ea688ef8d7d0385b1e535e9dba'
),
'preDb_b6959b21151eecc7295367a46fdaf586' => array(
'name' => 'PPH Tektor s.c. A.J.J. Zjawiony',
'dbasename'=>'preDb_b6959b21151eecc7295367a46fdaf586'
)
);
}
foreach ($accounts as $account) {
$ac = new Account();
$ac->retrieve($account);
if ($ac->id == '')
continue;
$addTmp = array();
$addTmp['name'] = $ac->name;
$addTmp['id'] = $ac->id;
$account_list[] = $addTmp;
}
$added='';
if (isset($_POST['submit'])) {
if (count($_POST['users']) > 0) {
foreach ($_POST['users'] as $user) {
if ($user != '' && $users[$user]['dbasename']==$user) {
foreach ($account_list as $key => $val) {
if ($val['id'] != '') {
$zap = $db->query(
"select * from accounts where id='" . $val['id'] .
"'");
$dane = $db->fetchByAssoc($zap);
$toinst = array();
$name=$dane['name'];
$id=$dane['id'];
foreach ($dane as $klucz => $wartosc) {
$toinst[] = $wartosc;
}
$insert = "insert into accounts values ('" .
implode("','", $toinst) . "')";
$link = mysql_connect(
$sugar_config['dbconfig']['db_host_name'],
$sugar_config['dbconfig']['db_user_name'],
$sugar_config['dbconfig']['db_password']);
mysql_select_db($user,
$link);
$res2=mysql_query('select id from accounts where id="'.$id.'"',$link);
if(!(mysql_num_rows($res2)>0)){
$added=1;
$res = mysql_query($insert, $link);
} else {
echo "<span style='color:red'>Kontrahent jest juz udostępniony ".$dane['name'].' w firmie '.$users[$user]['name'].'</span><br>';
}
mysql_close($link);
}
}
}
}
} else {
$error = 1;
}
}
$ss = new Sugar_Smarty();
$ss->assign('uid', $_REQUEST['uid']);
$ss->assign('body', $_REQUEST['body']);
$ss->assign('error', $error);
$ss->assign('success', $success);
$ss->assign('added', $added);
$ss->assign('users', $users);
$ss->assign('account_list', $account_list);
$content = $ss->fetch('modules/Accounts/tpls/share.tpl');
echo $content;

View File

@@ -0,0 +1,30 @@
<?php
//map container
echo '<div id="googleMapContainer" style="width:750px;height:570px;"></div>';
//load Script
echo '<script type="text/javascript" src="modules/Accounts/js/showMap.js"></script>';
echo '<script src="https://maps.googleapis.com/maps/api/js"></script>';
$ids = explode(",",$_REQUEST['uid']);
//get Data
$markers = array();
foreach ($ids as $id) {
$a = new Account();
$a->retrieve($id);
$addr = $a->register_address_street." ".$a->register_address_postalcode." ".$a->register_address_city." ".$a->register_address_country;
$cor = getCoordinates($addr);
$tmp = array();
$tmp['lat'] = $cor[0];
$tmp['lng'] = $cor[1];
$tmp['title'] = html_entity_decode(trim($a->name));
$tmp['info'] = '<a href="index.php?module=Accounts&action=DetailView&record='.$a->id.'" target="new">'.html_entity_decode(trim($a->name)).'</a><br>'.$a->register_address_street.'<br>'.$a->register_address_postalcode.'<br>'.$a->register_address_city.'<br>'.$a->register_address_country;
$markers[] = $tmp;
}
echo '<input value="'.base64_encode(json_encode($markers)).'" id="googleMapMarkers" type="hidden"></input>';
function getCoordinates($address){
$address = str_replace(" ", "+", $address); // replace all the white space with "+" sign to match with google search pattern
$url = "http://maps.google.com/maps/api/geocode/json?sensor=false&address=$address";
$response = file_get_contents($url);
$json = json_decode($response,TRUE); //generate array object from the response from the web
return array ($json['results'][0]['geometry']['location']['lat'],$json['results'][0]['geometry']['location']['lng']);
}
?>

383
modules/Accounts/test.php Normal file
View File

@@ -0,0 +1,383 @@
<?php
echo 'dupcia';
ini_set('display_errors',1);
error_reporting(E_ALL);
echo 'error!';
class Mailing {
public $db;
public $pdfMerge;
public $contentTpl = 'modules/EcmAgreements/tpl/emailContent.html';
public $accounts;
public function __construct() {
$this->db = $GLOBALS ['db'];
$this->pdfMerge = new PDFMerger ();
}
public function getAccounts() {
$r = $this->db->query ( "select parent_id from ecminvoiceouts where payment_date<='" . date ( "Y-m-t" ) . "' and payment_date>='" . date ( "Y-m-01" ) . "' group by parent_id" );
$this->accounts = array();
while ( $dane = $this->db->fetchByAssoc ( $r ) ) {
$this->accounts [] = $dane;
}
}
public function generateEmails() {
foreach ( $this->accounts as $account ) {
$acc = new Account ();
$acc->retrieve ( $account );
if ($acc->only_invoice == 1) {
$transactions = $this->getOnlyInvoiceTransactions ( $account );
$saldo = null;
} else {
$transactions = $this->getAccountTransactions ( $account );
$saldo = $this->getPdfForAccount ( $transactions, $acc );
}
$invoiceFiles = $this->getInvoiceFiles ( $account );
$endingAgreements = $this->getEndingAgreements ( $account );
$this->sendMessage ( $acc, $transactions, $invoiceFiles, $endingAgreements, $saldo );
}
}
public function getPdfForAccount($transactions, $acc) {
$total_w_war = 0;
$total_w_nieroz = 0;
$total_w_roz = 0;
foreach ( $transactions as $transaction ) {
$total_w_war = $total_w_war + $transaction ['value'];
$total_w_nieroz = $total_w_nieroz + ($transaction ['value'] - $transaction ['total_settled']);
$total_w_roz = $total_w_roz + $transaction ['total_settled'];
}
$ss = new Sugar_Smarty ();
global $mod_strings;
$ss->assign ( "MOD", $mod_strings );
global $app_strings;
$ss->assign ( "APP", $app_strings );
$ss->assign ( 'SUM', $sum );
$ss->assign ( 'umowy', getAgreements ( $account_id ) );
$ss->assign ( 'umowa_sel', $umowa_id );
$ss->assign ( 'SWITCH_SHOW', $_REQUEST ['switch_show'] );
$ss->assign ( 'PROCESS', '1' );
$ss->assign ( 'ACCOUNT', array (
'ID' => $acc->id,
'NAME' => $acc->name
) );
$ss->assign ( 'total_w_war', $total_w_war );
$ss->assign ( 'total_w_nieroz', $total_w_nieroz );
$ss->assign ( 'total_w_roz', $total_w_roz );
$ss->assign ( 'WINIEN', $transactions );
ob_clean ();
$output = $ss->fetch ( 'modules/EcmPaymentStates/tpls/PDF/AccountPaymentStatespdf.tpl' );
include_once ("include/MPDF57/mpdf.php");
unset ( $smarty );
$p = new mPDF ( '', 'A4', null, 'helvetica', 10, 10, 25, 10, 5, 5 );
// $p->setFooter('Strona {PAGENO} z {nbpg}');
$p->SetHTMLHeader ( '<table style="width:100%;"><tr><td style="text-align:left;font-size: 10px;width:50%;">BILANS B. Pietras E. Pietras Spółka Jawna<br>
Rozrachunki: ' . $a->name . '<br>Data wydruku: ' . date ( "d.m.Y" ) . '<br>Strona {PAGENO} z {nbpg}</td>
<td style="text-align:left;font-size: 10px;width:50%;">' . $a->name . '<br>' . $a->register_address_street . '
<br>' . $a->register_address_postalcode . ',
' . $a->register_address_city . '<br>NIP: ' . $a->to_vatid . '</td></tr></table>' );
// $p->setTitle($mod_strings["LBL_REPORT_STOCKS_DOCS"]);
// echo $output;
$p->writeHTML ( $output );
if (count ( $transactions ) > 0) {
$p->Output ( 'upload/rozrachunki.pdf', 'F' );
return 'upload/rozrachunki.pdf';
} else {
return null;
}
}
public function getOnlyInvoiceTransactions($id) {
$ecmInvoiceOut = new EcmInvoiceout ();
$results = $ecmInvoiceOut->get_full_list ( null, "parent_id='" . $id . "' and payment_date>='" . date ( "Y-m-01" ) . "' and payment_date<='" . date ( "Y-m-t" ) . "'" );
$ids = array();
$agreement = array();
foreach ( $results as $result ) {
$ids [] = $result->id;
$agreement [] = $result->agreement_id;
}
$zap = "select payment_date,ecmagreement_id from ecmagreementitems where deleted=0 and ecmagreement_id in ('" . implode ( "','", $agreement ) . "') and payment_date>='" . date ( "Y-m-01" ) . "' and payment_date<='" . date ( "Y-m-t" ) . "'";
$z = $this->db->query ( $zap );
$raty_kap = array();
while ( $r = $this->db->fetchByAssoc ( $z ) ) {
$rr = $this->db->query ( "select id from ecmtransactions where record_id='" . $r ['ecmagreement_id'] . "' and deleted=0 and name like 'Rata kapitałowa do umowy:%' and payment_date='" . $r ['payment_date'] . "'" );
$dane = $this->db->fetchByAssoc ( $rr );
$raty_kap [] = $dane ['id'];
}
if (count ( $raty_kap ) > 0) {
$kap = "id in ('" . implode ( "','", $raty_kap ) . "')";
} else {
$kap = "";
}
$query = "select * from ecmtransactions where record_id in ('" . implode ( "','", $ids ) . "') " . $kap . " and deleted=0 group by id";
$res = $this->db->query ( $query );
$transactions = array();
$transactions = array();
while ( $r = $this->db->fetchByAssoc ( $res ) ) {
$r ['total_settled'] = 0;
$r = $this->getSettledTransactionsValue ( $r );
$transactions [] = $r;
}
return $transactions;
}
public function getInvoiceFiles($id) {
include_once "modules/EcmInvoiceOuts/createPDF.php";
$ecmInvoiceOut = new EcmInvoiceout ();
$results = $ecmInvoiceOut->get_full_list ( null, "parent_id='" . $id . "' and payment_date>='" . date ( "Y-m-01" ) . "' and payment_date<='" . date ( "Y-m-t" ) . "'" );
$files = array();
foreach ( $results as $result ) {
$path = 'upload/fk_' . str_replace ( '/', '', (str_replace ( ' ', '', $result->document_no )) ) . '.pdf';
$name = createEcmInvoiceOutPdf ( $result->id, 'FILE' );
$files [] = $name;
}
return $files;
}
function dateV($format, $timestamp = null) {
$to_convert = array (
'l' => array (
'dat' => 'N',
'str' => array (
'Poniedziałek',
'Wtorek',
'Środa',
'Czwartek',
'Piątek',
'Sobota',
'Niedziela'
)
),
'F' => array (
'dat' => 'n',
'str' => array (
'styczeń',
'luty',
'marzec',
'kwiecień',
'maj',
'czerwiec',
'lipiec',
'sierpień',
'wrzesień',
'październik',
'listopad',
'grudzień'
)
),
'f' => array (
'dat' => 'n',
'str' => array (
'stycznia',
'lutego',
'marca',
'kwietnia',
'maja',
'czerwca',
'lipca',
'sierpnia',
'września',
'października',
'listopada',
'grudnia'
)
)
);
if ($pieces = preg_split ( '#[:/.\-, ]#', $format )) {
if ($timestamp === null) {
$timestamp = time ();
}
foreach ( $pieces as $datepart ) {
if (array_key_exists ( $datepart, $to_convert )) {
$replace [] = $to_convert [$datepart] ['str'] [(date ( $to_convert [$datepart] ['dat'], $timestamp ) - 1)];
} else {
$replace [] = date ( $datepart, $timestamp );
}
}
$result = strtr ( $format, array_combine ( $pieces, $replace ) );
return $result;
}
}
public function getEmailTitle($acc) {
return $title = "Faktury za m-c " . $this->dateV ( 'F', strtotime ( date ( 'Y-m-t' ) ) ) . ' ' . $acc->parent_name . ' - BILANS B. Pietras E. Pietras Spółka Jawna';
}
public function calculateTotal($transactions){
$total=0;
foreach ($transactions as $transaction){
$total=$total+($transaction ['value'] - $transaction ['total_settled']);
}
return $total;
}
public function getEmailContent($acc,$transactions) {
$ss = new Sugar_Smarty ();
$ss->assign("transactions",$transactions);
$ss->assign("mc",$this->dateV ( 'F', strtotime ( date ( 'Y-m-t' ) ) ));
$ss->assign("year",date('Y'));
$ss->assign("total",$this->calculateTotal($transactions));
$content = $ss->fetch($this->contentTpl);
return $content;
}
public function sendMessage($acc, $transactions, $files, $endingAgreements, $saldo) {
require_once ("mailer/PHPMailerAutoload.php");
$mailClassS = new PHPMailer ();
$mailClassS->isSMTP (); // Set mailer to use SMTP
$mailClassS->Host = '77.55.64.229'; // Specify main and backup server
$mailClassS->SMTPAuth = true; // Enable SMTP authentication
$mailClassS->Username = 'faktury@e-bilans.info'; // SMTP username
$mailClassS->Password = 'FakturyInfo^'; // SMTP password
$mailClassS->SMTPSecure = 'tls'; // Enable encryption, 'ssl' also accepted
$mailClassS->Port = 587; // Set the SMTP port number - 587 for
/*
* foreach ($to as $ad=>$tit){
*
* $mailClassS->addAddress ($ad,$tit); // Add a
*
* }
*/
$addressCC = "outtervision@gmail.com";
$mailClassS->addBCC ( $addressCC, 'Dominik Brzóska' );
/*
* $mailClassS->addCC('borkowskak@matbud-torun.pl', 'Katarzyna Borkowska');
* $mailClassS->addCC('bogdanpietras@matbud-torun.pl', 'Bogdan Pietras');
* $mailClassS->addCC('fakturywyslane@e-bilans.info', 'Faktury wysłane');
*/
$mailClassS->Sender = 'faktury@e-bilans.info';
$mailClassS->From = 'faktury@e-bilans.info';
$mailClassS->FromName = 'BILANS B. Pietras E. Pietras Spółka Jawna';
$mailClassS->WordWrap = 50; // Set word wrap to 50 characters
$mailClassS->isHTML ( true ); // Set email format to HTML
$mailClassS->Subject = $this->getEmailTitle ( $acc );
$mailClassS->Body = $this->getEmailContent($acc,$transactions);
foreach ( $files as $path ) {
if (file_exists ( '/var/www/html/crm/' . $path )) {
$mailClassS->addAttachment ( '/var/www/html/crm/' . $path );
}
}
if ($saldo != null) {
if (file_exists ( '/var/www/html/crm/' . $saldo )) {
$mailClassS->addAttachment ( '/var/www/html/crm/' . $saldo );
}
}
if (! $mailClassS->send ()) {
return false;
}
}
public function getEndingAgreements($id) {
$ecmAgreement = new EcmAgreement ();
$results = $ecmAgreement->get_full_list ( null, "date_end>='" . date ( "Y-m-01" ) . "' and date_end<='" . date ( "Y-m-t" ) . "'" );
return $results;
}
public function getAccountTransactions($id) {
$query = "
SELECT * FROM ecmtransactions
WHERE deleted='0' AND
parent_id='" . $id . "'
AND type='0' AND (settled='0' or settled=null)
AND register_date > '2011-12-31' and payment_date <= '" . date ( "Y-m-t" ) . "'
ORDER BY payment_date desc";
$res = $this->db->query ( $query );
$transactions = array();
while ( $r = $this->db->fetchByAssoc ( $res ) ) {
$r ['total_settled'] = 0;
$r = $this->getSettledTransactionsValue ( $r );
$transactions [] = $r;
}
return $transactions;
}
public function getSettledTransactionsValue($record) {
$rel = $this->db->query ( "SELECT * FROM ecmtransactions_rel WHERE ecmtransaction_a_id='" . $r ['id'] . "' OR ecmtransaction_b_id='" . $r ['id'] . "'" );
while ( $rr = $this->db->fetchByAssoc ( $rel ) ) {
if ($rr ['ecmtransaction_a_id'] == $r ['id'])
$rel_id = $rr ['ecmtransaction_b_id'];
else
$rel_id = $rr ['ecmtransaction_a_id'];
$t = $this->db->fetchByAssoc ( $this->db->query ( "SELECT * FROM ecmtransactions WHERE id='$rel_id' and deleted=0" ) );
$tmp2 = array ();
$tmp2 ['name'] = $t ['name'];
$tmp2 ['trans_id'] = $t ['id'];
$tmp2 ['value'] = $rr ['value'];
if ($t ['type'] == 0 && $rel->num_rows == 1) {
if (abs ( $rr ['value'] ) == abs ( $r ['value'] )) {
if ($r ['value'] > 0) {
$rr ['value'] = abs ( $rr ['value'] );
} else {
$v = - 1 * abs ( $rr ['value'] );
$rr ['value'] = $v;
}
} else {
if ($r ['value'] > 0) {
$rr ['value'] = abs ( $rr ['value'] );
} else {
$v = - 1 * abs ( $rr ['value'] );
$rr ['value'] = $v;
}
}
} else {
if (abs ( $rr ['value'] ) == abs ( $r ['value'] )) {
if ($r ['value'] > 0) {
$rr ['value'] = abs ( $rr ['value'] );
} else {
$v = - 1 * abs ( $rr ['value'] );
$rr ['value'] = $v;
}
} else {
if ($r ['value'] > 0) {
$rr ['value'] = abs ( $rr ['value'] );
}
}
}
if ($t ['id'] == "")
continue;
$record ['total_settled'] += floatval ( $rr ['value'] );
}
return $record;
}
}
echo 'error!';
?>

1074
modules/Accounts/vardefs.php Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,260 @@
<?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".
********************************************************************************/
require_once('include/MVC/View/views/view.detail.php');
class AccountsViewDetail extends ViewDetail {
function AccountsViewDetail(){
parent::ViewDetail();
}
/**
* display
* Override the display method to support customization for the buttons that display
* a popup and allow you to copy the account's address into the selected contacts.
* The custom_code_billing and custom_code_register Smarty variables are found in
* include/SugarFields/Fields/Address/DetailView.tpl (default). If it's a English U.S.
* locale then it'll use file include/SugarFields/Fields/Address/en_us.DetailView.tpl.
*/
function display(){
if(empty($this->bean->id)){
global $app_strings;
sugar_die($app_strings['ERROR_NO_RECORD']);
}
global $mod_strings;
//add mz
$pl = $this->bean->showPositions();
$pl2 = $this->bean->showPositions2();
$pl3 = $this->bean->showPositions3();
$pl4 = $this->bean->showPositions4();
$ws = $this->bean->ShowWebSitesList();
$ws2 = $this->bean->ShowTelephonesList();
$this->ss->assign('WEBSITES_LIST', $ws);
$this->ss->assign('TELEPHONES_LIST', $ws2);
$this->ss->assign('POSITIONS', $pl);
$this->ss->assign('POSITIONS2', $pl2);
$this->ss->assign('POSITIONS3', $pl3);
$this->ss->assign('POSITIONS4', $pl4);
$this->ss->assign('LBL_PHONE', $app_strings['LBL_PHONE']);
$this->ss->assign('LBL_FAX', $app_strings['LBL_FAX']);
$this->ss->assign('LBL_SAVE_TO_GOOGLE', $mod_strings['LBL_SAVE_TO_GOOGLE']);
$datachart = AnalysisProductSale($this->bean->id);
//var_dump($data);
$rows = array();
foreach ($datachart as $key => $value) {
$rows['netto'][] = $value['total_netto'];
// $rows['total_brutto'][] = $value['total_brutto'];
$rows['kupno'][] = $value['total_purchase'];
$rows['marza'][] = $value['total_netto'] - $value['total_purchase'];
$rows['marzaprocent'][] = (($value['total_netto'] - $value['total_purchase']) * 100) / $value['total_netto'];
}
$this->ss->assign("DATACHART", $datachart);
$this->ss->assign("ROWS", $rows);
//get salda ;)
$saldo = $this->bean->getSalda(8);
$today_saldo = $this->bean->getSalda(9);
//end get salda
if($saldo<0)$ss="<span style='color:red'>";$se="</span>";
if($today_saldo<0)$ss="<span style='color:red'>";$se="</span>";
$this->ss->assign('saldo', $ss.format_number($saldo).$se);
$this->ss->assign('today_saldo', $ss.format_number($today_saldo).$se);
//end mz
$this->dv->process();
global $mod_strings;
if(ACLController::checkAccess('Contacts', 'edit', true)) {
$push_billing = '<span class="id-ff"><button class="button btn_copy" title="' . $mod_strings['LBL_PUSH_CONTACTS_BUTTON_LABEL'] .
'" type="button" onclick=\'open_contact_popup("Contacts", 600, 600, "&account_name=' .
urlencode($this->bean->name) . '&html=change_address' .
'&primary_address_street=' . str_replace(array("\rn", "\r", "\n"), array('','','<br>'), urlencode($this->bean->billing_address_street)) .
'&primary_address_city=' . $this->bean->billing_address_city .
'&primary_address_state=' . $this->bean->billing_address_state .
'&primary_address_postalcode=' . $this->bean->billing_address_postalcode .
'&primary_address_country=' . $this->bean->billing_address_country .
'", true, false);\' value="' . $mod_strings['LBL_PUSH_CONTACTS_BUTTON_TITLE']. '">'.
SugarThemeRegistry::current()->getImage("id-ff-copy","",null,null,'.png',$mod_strings["LBL_COPY"]).
'</button></span>';
$push_register = '<span class="id-ff"><button class="button btn_copy" title="' . $mod_strings['LBL_PUSH_CONTACTS_BUTTON_LABEL'] .
'" type="button" onclick=\'open_contact_popup("Contacts", 600, 600, "&account_name=' .
urlencode($this->bean->name) . '&html=change_address' .
'&primary_address_street=' . str_replace(array("\rn", "\r", "\n"), array('','','<br>'), urlencode($this->bean->register_address_street)) .
'&primary_address_city=' . $this->bean->register_address_city .
'&primary_address_state=' . $this->bean->register_address_state .
'&primary_address_postalcode=' . $this->bean->register_address_postalcode .
'&primary_address_country=' . $this->bean->register_address_country .
'", true, false);\' value="' . $mod_strings['LBL_PUSH_CONTACTS_BUTTON_TITLE'] . '">'.
SugarThemeRegistry::current()->getImage("id-ff-copy",'',null,null,'.png',$mod_strings['LBL_COPY']).
'</button></span>';
} else {
$push_billing = '';
$push_register = '';
}
$this->ss->assign("custom_code_billing", $push_billing);
$this->ss->assign("custom_code_register", $push_register);
if(empty($this->bean->id)){
global $app_strings;
sugar_die($app_strings['ERROR_NO_RECORD']);
}
echo $this->dv->display();
}
}
function AnalysisProductSale($account_id) {
global $db;
try {
$tmp = new DateTime(date('Y-m-31'));
$tmp2 = new DateTime(date('Y-m-01'));
$tmp2->sub(new DateInterval('P11M'));
$register_date_to = $tmp->format('Y-m-d');
$register_date_from = $tmp2->format('Y-m-d');
} catch (Exception $e) {
echo $e->getMessage();
exit(1);
}
$query = "
SELECT
p.id,
p.old_ecminvoiceoutitem_id,
p.quantity_corrected,
p.total_brutto_corrected,
p.total_netto_corrected,
p.ecminvoiceout_id,
p.ecmproduct_id,
p.code, p.name,
p.total_netto,
p.total_brutto,
p.price_purchase,
p.quantity,
i.register_date,
i.type,
i.currency_value,
i.currency_value_nbp,
i.currency_id
FROM
ecminvoiceoutitems p,
ecminvoiceouts i
WHERE
i.canceled=0
AND i.deleted=0
AND i.register_date <= '" . $register_date_to . "'
AND i.register_date >= '" . $register_date_from . "'
AND p.ecminvoiceout_id = i.id
AND i.parent_id='" . $account_id ."'
ORDER BY
i.register_date;" ;
//die(1);
//echo $query;
//echo $query;
$result = $db->query($query);
$result2 = $db->query($query);
if ($result2->num_rows > 0) {
while ($row = $result2->fetch_assoc()) {
$tmparray[$row['id']] = $row;
}
}
if ($result->num_rows > 0) {
while ($row = $result->fetch_assoc()) {
$currency = 1;
if($row['type']!='K'){
if($row['currency_value']!=''&& $row['currency_value']!='0'){
$currency = $row['currency_value'];
}elseif($row['currency_value_nbp']!=''){
$currency = $row['currency_value_nbp'];
}
}
if($row['type']=='normal'){
$return[substr($row['register_date'], 0, 7)]['total_purchase'] += round($row['price_purchase']* $row['quantity'],2);
$return[substr($row['register_date'], 0, 7)]['total_netto'] += $row['total_netto']* $currency;
}else{
$return[substr($row['register_date'], 0, 7)]['total_purchase'] += round($tmparray[$row['old_ecminvoiceoutitem_id']]['price_purchase'] * $row['quantity_corrected'] ,2);
$return[substr($row['register_date'], 0, 7)]['total_netto'] += $row['total_netto_corrected']* $currency;
}
}
} else {
return NULL;
}
global $current_user;
if(count($return)<12){
try {
$currentDate = new DateTime(date('Y-m-01'));
$date = new DateTime(date('Y-m-01'));
$date->sub(new DateInterval('P11M'));
$register_date_fill = $date->format('Y-m');
} catch (Exception $e) {
echo $e->getMessage();
exit(1);
}
while(count($return)<12){
// echo $date->format('Y-m').'<br>';
if(!isset($return[$register_date_fill])){
$return[$register_date_fill]['total_purchase'] = 0;
$return[$register_date_fill]['total_netto'] = 0;
}
$date->add(new DateInterval('P1M'));
$register_date_fill = $date->format('Y-m');
}
}
ksort($return);
$formated_return;
foreach ($return as $data => $row){
$split = split("-",$data);
$formated_return[$split[1] .".".$split[0]] = $row;
}
return $formated_return;
}
?>

View File

@@ -0,0 +1,53 @@
<?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".
********************************************************************************/
require_once('include/MVC/View/views/view.edit.php');
class AccountsViewEdit extends ViewEdit
{
public function preDisplay() {
require_once('modules/Accounts/EditView.php');
parent::preDisplay();
}
public function display()
{
parent::display();
}
}

36
modules/Activities/Forms.php Executable file
View File

@@ -0,0 +1,36 @@
<?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('modules/Calendar/Forms.php');

61
modules/Activities/Menu.php Executable file
View File

@@ -0,0 +1,61 @@
<?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;
global $mod_strings;
//if(ACLController::checkAccess('Calls', 'edit', true))$module_menu[]=Array("index.php?module=Calls&action=EditView&return_module=Calls&return_action=DetailView", $mod_strings['LNK_NEW_CALL'],"CreateCalls");
//if(ACLController::checkAccess('Meetings', 'edit', true))$module_menu[]=Array("index.php?module=Meetings&action=EditView&return_module=Meetings&return_action=DetailView", $mod_strings['LNK_NEW_MEETING'],"CreateMeetings");
if(ACLController::checkAccess('Tasks', 'edit', true))$module_menu[]=Array("index.php?module=Tasks&action=EditView&return_module=Tasks&return_action=DetailView", $mod_strings['LNK_NEW_TASK'],"CreateTasks");
//if(ACLController::checkAccess('Notes', 'edit', true))$module_menu[]=Array("index.php?module=Notes&action=EditView&return_module=Notes&return_action=DetailView", $mod_strings['LNK_NEW_NOTE'],"CreateNotes");
//if(ACLController::checkAccess('Calls', 'list', true))$module_menu[]=Array("index.php?module=Calls&action=index&return_module=Calls&return_action=DetailView", $mod_strings['LNK_CALL_LIST'],"Calls");
//if(ACLController::checkAccess('Meetings', 'list', true))$module_menu[]=Array("index.php?module=Meetings&action=index&return_module=Meetings&return_action=DetailView", $mod_strings['LNK_MEETING_LIST'],"Meetings");
if(ACLController::checkAccess('Tasks', 'list', true))$module_menu[]=Array("index.php?module=Tasks&action=index&return_module=Tasks&return_action=DetailView", $mod_strings['LNK_TASK_LIST'],"Tasks");
//if(ACLController::checkAccess('Notes', 'list', true))$module_menu[]=Array("index.php?module=Notes&action=index&return_module=Notes&return_action=DetailView", $mod_strings['LNK_NOTE_LIST'],"Notes");
if(ACLController::checkAccess('Calendar', 'list', true))$module_menu[]=Array("index.php?module=Calendar&action=index&view=day", $mod_strings['LNK_VIEW_CALENDAR'],"Calendar");
//if(ACLController::checkAccess('Calls', 'import', true))$module_menu[]=Array("index.php?module=Import&action=Step1&import_module=Calls&return_module=Calls&return_action=index", $mod_strings['LNK_IMPORT_CALLS'],"Import", 'Calls');
//if(ACLController::checkAccess('Meetings', 'import', true))$module_menu[]=Array("index.php?module=Import&action=Step1&import_module=Meetings&return_module=Meetings&return_action=index", $mod_strings['LNK_IMPORT_MEETINGS'],"Import", 'Meetings');
//if(ACLController::checkAccess('Tasks', 'import', true))$module_menu[]=Array("index.php?module=Import&action=Step1&import_module=Tasks&return_module=Tasks&return_action=index", $mod_strings['LNK_IMPORT_TASKS'],"Import", 'Tasks');
//if(ACLController::checkAccess('Notes', 'import', true))$module_menu[]=Array("index.php?module=Import&action=Step1&import_module=Notes&return_module=Notes&return_action=index", $mod_strings['LNK_IMPORT_NOTES'],"Import", 'Notes');
?>

View File

@@ -0,0 +1,341 @@
<?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/Activities/config.php');
require_once('include/json_config.php');
$json_config = new json_config();
// cn:
global $currentModule, $theme, $focus, $action, $open_status;
global $app_strings;
global $current_language;
global $odd_bg;
global $even_bg;
global $hilite_bg;
global $click_bg;
global $sugar_version, $sugar_config;
$focus_meetings_list = array();
$focus_calls_list = array();
$focus_tasks_list = array();
global $timedate;
//we don't want the parent module's string file, but rather the string file specifc to this subpanel
$current_module_strings = return_module_language($current_language, 'Activities');
///////////////////////////////////////////////////////////////////////////////
//// START LOGIC
if (empty($_REQUEST['appointment_filter'])) {
if ($current_user->getPreference('appointment_filter') == '') {
$appointment_filter = 'today';
} else {
$appointment_filter = $current_user->getPreference('appointment_filter');
}
} else {
$appointment_filter = $_REQUEST['appointment_filter'];
$current_user->setPreference('appointment_filter', $_REQUEST['appointment_filter']);
}
if ($appointment_filter == 'last this_month') {
$next_month = strftime("%B %Y", strtotime("+1 month"));
$first_day = strftime("%d %B %Y", strtotime("1 $next_month"));
$appt_filter = strftime("%d %B %Y", strtotime("-1 day", strtotime($first_day)));
} elseif ($appointment_filter == 'last next_month') {
$next_month = strftime("%B %Y", strtotime("+2 month"));
$first_day = strftime("%d %B %Y", strtotime("1 $next_month"));
$appt_filter = strftime("%d %B %Y", strtotime("-1 day", strtotime($first_day)));
$GLOBALS['log']->debug("next_month is '$next_month'; first_day is '$first_day';");
} else {
$appt_filter = $appointment_filter;
}
$gm_later = gmdate($GLOBALS['timedate']->get_db_date_time_format(), strtotime($appt_filter));
$later = $timedate->handle_offset($gm_later, $timedate->dbDayFormat, true);
$db_later = $timedate->handle_offset($gm_later, $timedate->dbDayFormat, true);
$laterWhere = $timedate->handleOffsetMax($later, $timedate->dbDayFormat, false);
$GLOBALS['log']->debug("appt_filter is '$appt_filter'; later is '$later'");
if(ACLController::checkAccess('Meetings', 'list', true)){
$meeting = new Meeting();
$where = '(';
$or = false;
foreach ($open_status as $status) {
if ($or) $where .= ' OR ';
$or = true;
$where .= " meetings.status = '$status' ";
}
$where .= ") ";
$where .= " AND meetings_users.user_id='$current_user->id' ";
$where .= " AND meetings_users.accept_status != 'decline'";
// allow for differences between MySQL and Oracle 9
if($sugar_config["dbconfig"]["db_type"] == "mysql") {
$where .= " HAVING datetime <= '".$laterWhere["date"]." ".$laterWhere["time"]."' ";
} elseif ($sugar_config["dbconfig"]["db_type"] == "oci8") {
}
else if ($sugar_config["dbconfig"]["db_type"] == "mssql")
{
$where .= " AND meetings.date_start + ' ' + meetings.time_start <= '".$laterWhere["date"]." ".$laterWhere["time"]."' ";
}
else {
$GLOBALS['log']->fatal("No database type identified.");
}
$meeting->disable_row_level_security = true;
$focus_meetings_list = $meeting->get_full_list("time_start", $where);
}
if(ACLController::checkAccess('Calls', 'list', true)) {
$call = new Call();
$where = '(';
$or = false;
foreach ($open_status as $status) {
if ($or) $where .= ' OR ';
$or = true;
$where .= " calls.status = '$status' ";
}
$where .= ") ";
$where .= " AND calls_users.user_id='$current_user->id' ";
$where .= " AND calls_users.accept_status != 'decline'";
// allow for differences between MySQL and Oracle 9
if($sugar_config["dbconfig"]["db_type"] == "mysql") {
$where .= " HAVING datetime <= '".$laterWhere["date"]." ".$laterWhere["time"]."' ";
} elseif ($sugar_config["dbconfig"]["db_type"] == "oci8") {
}else if ($sugar_config["dbconfig"]["db_type"] == "mssql")
{
//add condition for MS Sql server.
$where .= " AND calls.date_start + ' ' + calls.time_start <= '".$laterWhere["date"]." ".$laterWhere["time"]."' ";
} else {
$GLOBALS['log']->fatal("No database type identified.");
}
$call->disable_row_level_security = true;
$focus_calls_list = $call->get_full_list("time_start", $where);
}
$open_activity_list = array();
if(count($focus_meetings_list)>0) {
foreach ($focus_meetings_list as $meeting) {
$td = $timedate->merge_date_time(from_db_convert($meeting->date_start,'date'),from_db_convert($meeting->time_start, 'time'));
$tag = 'span';
if($meeting->ACLAccess('view', $meeting->isOwner($current_user->id))){
$tag = 'a';
}
$open_activity_list[] = array(
'name' => $meeting->name,
'id' => $meeting->id,
'type' => 'Meeting',
'module' => 'Meetings',
'status' => $meeting->status,
'parent_id' => $meeting->parent_id,
'parent_type' => $meeting->parent_type,
'parent_name' => $meeting->parent_name,
'contact_id' => $meeting->contact_id,
'contact_name' => $meeting->contact_name,
'normal_date_start' => $meeting->date_start,
'date_start' => $timedate->to_display_date($td),
'normal_time_start' => $meeting->time_start,
'time_start' => $timedate->to_display_time($td,true),
'required' => $meeting->required,
'accept_status' => $meeting->accept_status,
'tag' => $tag,
);
}
}
if (count($focus_calls_list)>0) {
foreach ($focus_calls_list as $call) {
$td = $timedate->merge_date_time(from_db_convert($call->date_start,'date'),from_db_convert($call->time_start, 'time'));
$tag = 'span';
if($call->ACLAccess('view', $call->isOwner($current_user->id))) {
$tag = 'a';
}
$open_activity_list[] = array(
'name' => $call->name,
'id' => $call->id,
'type' => 'Call',
'module' => 'Calls',
'status' => $call->status,
'parent_id' => $call->parent_id,
'parent_type' => $call->parent_type,
'parent_name' => $call->parent_name,
'contact_id' => $call->contact_id,
'contact_name' => $call->contact_name,
'date_start' => $timedate->to_display_date($td),
'normal_date_start' => $call->date_start,
'normal_time_start' => $call->time_start,
'time_start' => $timedate->to_display_time($td,true),
'required' => $call->required,
'accept_status' => $call->accept_status,
'tag' => $tag,
);
}
}
///////////////////////////////////////////////////////////////////////////////
//// START OUTPUT
$xtpl=new XTemplate ('modules/Activities/OpenListView.html');
$xtpl->assign("MOD", $current_module_strings);
$xtpl->assign("APP", $app_strings);
$xtpl->assign('JSON_CONFIG_JAVASCRIPT', $json_config->get_static_json_server());
$xtpl->assign("SUGAR_VERSION", $sugar_version);
$xtpl->assign("JS_CUSTOM_VERSION", $sugar_config['js_custom_version']);
// Stick the form header out there.
$filter = get_select_options_with_id($current_module_strings['appointment_filter_dom'], $appointment_filter );
echo "<form method='POST' action='index.php'>\n";
echo "<input type='hidden' name='module' value='Home'>\n";
echo "<input type='hidden' name='action' value='index'>\n";
$day_filter = "<select name='appointment_filter' language='JavaScript' onchange='this.form.submit();'>$filter</select>";
echo get_form_header($current_module_strings['LBL_UPCOMING'], $current_module_strings['LBL_TODAY'].$day_filter.' ('.$timedate->to_display_date($later, false).') ', false);
echo "</form>\n";
$xtpl->assign("RETURN_URL", "&return_module=$currentModule&return_action=DetailView&return_id=" . ((is_object($focus) && ! empty($focus->id)) ? $focus->id : ""));
$oddRow = true;
if(count($open_activity_list) > 0) {
$open_activity_list = array_csort($open_activity_list, 'normal_date_start', 'normal_time_start', SORT_ASC);
}
$today = $timedate->handle_offset('today', $timedate->dbDayFormat.' '.$timedate->dbTimeFormat, false);
$todayOffset = $timedate->handleOffsetMax('today', $timedate->dbDayFormat.' '.$timedate->dbTimeFormat, true);
foreach($open_activity_list as $activity) {
$concatActDate = $activity['normal_date_start'].' '.$activity['normal_time_start'];
if($concatActDate < $today) {
$time = "<font class='overdueTask'>".$activity['date_start'].' '.$activity['time_start']."</font>";
} elseif(($concatActDate >= $todayOffset['min']) && ($concatActDate <= $todayOffset['max'])) {
$time = "<font class='todaysTask'>".$activity['date_start'].' '.$activity['time_start']."</font>";
} else {
$time = "<font class='futureTask'>".$activity['date_start'].' '.$activity['time_start']."</font>";
}
$activity_fields = array(
'ID' => $activity['id'],
'NAME' => $activity['name'],
'TYPE' => $activity['type'],
'MODULE' => $activity['module'],
'STATUS' => $activity['status'],
'CONTACT_NAME' => $activity['contact_name'],
'CONTACT_ID' => $activity['contact_id'],
'PARENT_TYPE' => $activity['parent_type'],
'PARENT_NAME' => $activity['parent_name'],
'PARENT_ID' => $activity['parent_id'],
'TIME' => $time,
'TAG' => $activity['tag'],
);
switch ($activity['parent_type']) {
case 'Accounts':
$activity_fields['PARENT_MODULE'] = 'Accounts';
break;
case 'Cases':
$activity_fields['PARENT_MODULE'] = 'Cases';
break;
case 'Opportunities':
$activity_fields['PARENT_MODULE'] = 'Opportunities';
break;
case 'Quotes':
$activity_fields['PARENT_MODULE'] = 'Quotes';
break;
}
switch ($activity['type']) {
case 'Call':
$activity_fields['SET_COMPLETE'] = "<a href='index.php?return_module=$currentModule&return_action=$action&return_id=" . ((is_object($focus) && ! empty($focus->id)) ? $focus->id : "")."&action=EditView&module=Calls&status=Held&record=".$activity['id']."&status=Held'>".SugarThemeRegistry::current()->getImage("close_inline","title=".translate('LBL_LIST_CLOSE','Activities')." border='0'")."</a>";
break;
case 'Meeting':
$activity_fields['SET_COMPLETE'] = "<a href='index.php?return_module=$currentModule&return_action=$action&return_id=" . ((is_object($focus) && ! empty($focus->id)) ? $focus->id : "")."&action=EditView&module=Meetings&status=Held&record=".$activity['id']."&status=Held'>".SugarThemeRegistry::current()->getImage("close_inline","title=".translate('LBL_LIST_CLOSE','Activities')." border='0'")."</a>";
break;
}
if (! empty($activity['accept_status'])) {
if ( $activity['accept_status'] == 'none') {
$activity_fields['SET_ACCEPT_LINKS'] = "<div id=\"accept".$activity['id']."\"><a title=\"".$app_list_strings['dom_meeting_accept_options']['accept']."\" href=\"javascript:setAcceptStatus('".$activity_fields['MODULE']."','".$activity['id']."','accept');\">". SugarThemeRegistry::current()->getImage("accept_inline","title='".$app_list_strings['dom_meeting_accept_options']['accept']."' border='0'"). "</a>&nbsp;<a title=\"".$app_list_strings['dom_meeting_accept_options']['tentative']."\" href=\"javascript:setAcceptStatus('".$activity_fields['MODULE']."','".$activity['id']."','tentative');\">".SugarThemeRegistry::current()->getImage("tentative_inline","alt='".$app_list_strings['dom_meeting_accept_options']['tentative']."' border='0'")."</a>&nbsp;<a title=\"".$app_list_strings['dom_meeting_accept_options']['decline']."\" href=\"javascript:setAcceptStatus('".$activity_fields['MODULE']."','".$activity['id']."','decline');\">".SugarThemeRegistry::current()->getImage("decline_inline","alt='".$app_list_strings['dom_meeting_accept_options']['decline']."' border='0'")."</a></div>";
} else {
$activity_fields['SET_ACCEPT_LINKS'] = $app_list_strings['dom_meeting_accept_status'][$activity['accept_status']];
}
}
$activity_fields['TITLE'] = '';
if (!empty($activity['contact_name'])) {
$activity_fields['TITLE'] .= $current_module_strings['LBL_LIST_CONTACT'].": ".$activity['contact_name'];
}
if (!empty($activity['parent_name'])) {
$activity_fields['TITLE'] .= "\n".$app_list_strings['record_type_display'][$activity['parent_type']].": ".$activity['parent_name'];
}
$xtpl->assign("ACTIVITY_MODULE_PNG", SugarThemeRegistry::current()->getImage($activity_fields['MODULE'].'','border="0" alt="'.$activity_fields['NAME'].'"'));
$xtpl->assign("ACTIVITY", $activity_fields);
$xtpl->assign("BG_HILITE", $hilite_bg);
$xtpl->assign("BG_CLICK", $click_bg);
if($oddRow) {
$xtpl->assign("ROW_COLOR", 'oddListRow');
$xtpl->assign("BG_COLOR", $odd_bg);
} else {
$xtpl->assign("ROW_COLOR", 'evenListRow');
$xtpl->assign("BG_COLOR", $even_bg);
}
$oddRow = !$oddRow;
$xtpl->parse("open_activity.row");
} // END FOREACH()
$xtpl->parse("open_activity");
if (count($open_activity_list)>0) $xtpl->out("open_activity");
else echo "<i>".$current_module_strings['NTC_NONE_SCHEDULED']."</i>";
?>

View File

@@ -0,0 +1,448 @@
<?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/upload_file.php");
require_once('include/utils/db_utils.php');
global $currentModule;
global $focus;
global $action;
global $app_strings;
global $app_list_strings;
//we don't want the parent module's string file, but rather the string file specifc to this subpanel
global $current_language,$beanList,$beanFiles;
$current_module_strings = return_module_language($current_language, 'Activities');
// history_list is the means of passing data to a SubPanelView.
$bean = $beanList[$_REQUEST['module_name']];
require_once($beanFiles[$bean]);
$focus = new $bean;
class Popup_Picker
{
/**
* sole constructor
*/
function Popup_Picker() {
}
/**
*
*/
function process_page() {
global $focus;
global $mod_strings;
global $app_strings;
global $app_list_strings;
global $currentModule;
global $odd_bg;
global $even_bg;
global $timedate;
$history_list = array();
if(!empty($_REQUEST['record'])) {
$result = $focus->retrieve($_REQUEST['record']);
if($result == null)
{
sugar_die($app_strings['ERROR_NO_RECORD']);
}
}
$activitiesRels = array('tasks' => 'Task', 'meetings' => 'Meeting', 'calls' => 'Call', 'emails' => 'Email', 'notes' => 'Note');
//Setup the arrays to store the linked records.
foreach($activitiesRels as $relMod => $beanName) {
$varname = "focus_" . $relMod . "_list";
$$varname = array();
}
foreach($focus->get_linked_fields() as $field => $def) {
if ($focus->load_relationship($field)) {
$relTable = $focus->$field->getRelatedTableName();
if (in_array($relTable, array_keys($activitiesRels)))
{
$varname = "focus_" . $relTable . "_list";
$$varname = sugarArrayMerge($$varname, $focus->get_linked_beans($field,$activitiesRels[$relTable]));
}
}
}
foreach ($focus_tasks_list as $task) {
$sort_date_time='';
if ($task->date_due == '0000-00-00') {
$date_due = '';
}
else {
$date_due = $task->date_due;
}
if (!empty($task->date_due) and !empty($task->time_due)) {
$sort_date_time=$timedate->to_db_date_time($task->date_due,$task->time_due);
$sort_date_time=implode(' ', $sort_date_time);
// kbrill - Bug #16714
//$sort_date_time=$timedate->handle_offset($sort_date_time,'Y-m-d H:i:s',true);
}
if ($task->status != "Not Started" && $task->status != "In Progress" && $task->status != "Pending Input") {
$history_list[] = array('name' => $task->name,
'id' => $task->id,
'type' => "Task",
'direction' => '',
'module' => "Tasks",
'status' => $task->status,
'parent_id' => $task->parent_id,
'parent_type' => $task->parent_type,
'parent_name' => $task->parent_name,
'contact_id' => $task->contact_id,
'contact_name' => $task->contact_name,
'date_modified' => $date_due,
'description' => $this->getTaskDetails($task),
'date_type' => $app_strings['DATA_TYPE_DUE'],
'sort_value' => $sort_date_time
);
} else {
$open_activity_list[] = array('name' => $task->name,
'id' => $task->id,
'type' => "Task",
'direction' => '',
'module' => "Tasks",
'status' => $task->status,
'parent_id' => $task->parent_id,
'parent_type' => $task->parent_type,
'parent_name' => $task->parent_name,
'contact_id' => $task->contact_id,
'contact_name' => $task->contact_name,
'date_due' => $date_due,
'description' => $this->getTaskDetails($task),
'date_type' => $app_strings['DATA_TYPE_DUE']
);
}
} // end Tasks
foreach ($focus_meetings_list as $meeting) {
if ($meeting->status != "Planned") {
$sort_date_time='';
if (!empty($meeting->date_start) and !empty($meeting->time_start)) {
$sort_date_time=$timedate->to_db_date_time($meeting->date_start,$meeting->time_start);
$sort_date_time=implode(' ', $sort_date_time);
// kbrill - Bug #16714
//$sort_date_time=$timedate->handle_offset($sort_date_time,'Y-m-d H:i:s',true);
}
$history_list[] = array('name' => $meeting->name,
'id' => $meeting->id,
'type' => "Meeting",
'direction' => '',
'module' => "Meetings",
'status' => $meeting->status,
'parent_id' => $meeting->parent_id,
'parent_type' => $meeting->parent_type,
'parent_name' => $meeting->parent_name,
'contact_id' => $meeting->contact_id,
'contact_name' => $meeting->contact_name,
'date_modified' => $meeting->date_start,
'description' => $this->formatDescription($meeting->description),
'date_type' => $app_strings['DATA_TYPE_START'],
'sort_value' => $sort_date_time
);
} else {
$open_activity_list[] = array('name' => $meeting->name,
'id' => $meeting->id,
'type' => "Meeting",
'direction' => '',
'module' => "Meetings",
'status' => $meeting->status,
'parent_id' => $meeting->parent_id,
'parent_type' => $meeting->parent_type,
'parent_name' => $meeting->parent_name,
'contact_id' => $meeting->contact_id,
'contact_name' => $meeting->contact_name,
'date_due' => $meeting->date_start,
'description' => $this->formatDescription($meeting->description),
'date_type' => $app_strings['DATA_TYPE_START']
);
}
} // end Meetings
foreach ($focus_calls_list as $call) {
if ($call->status != "Planned") {
$sort_date_time='';
if (!empty($call->date_start) and !empty($call->time_start)) {
$sort_date_time=$timedate->to_db_date_time($call->date_start,$call->time_start);
$sort_date_time=implode(' ', $sort_date_time);
// kbrill - Bug #16714
//$sort_date_time=$timedate->handle_offset($sort_date_time,'Y-m-d H:i:s',true);
}
elseif(!empty($call->date_start) && empty($call->time_start))
{
//jc - Bug#19862
//for some reason the calls module does not populate the time_start variable in
//this case, so the date_start attribute contains the information we need
//to determine where in the history this call belongs.
//using swap_formats to get from the format '03/31/2008 09:45pm' to the format
//'2008-03-31 09:45:00'
$sort_date_time = $timedate->swap_formats($call->date_start, $timedate->get_date_time_format(), $timedate->get_db_date_time_format());
}
$history_list[] = array('name' => $call->name,
'id' => $call->id,
'type' => "Call",
'direction' => $call->direction,
'module' => "Calls",
'status' => $call->status,
'parent_id' => $call->parent_id,
'parent_type' => $call->parent_type,
'parent_name' => $call->parent_name,
'contact_id' => $call->contact_id,
'contact_name' => $call->contact_name,
'date_modified' => $call->date_start,
'description' => $this->formatDescription($call->description),
'date_type' => $app_strings['DATA_TYPE_START'],
'sort_value' => $sort_date_time
);
} else {
$open_activity_list[] = array('name' => $call->name,
'id' => $call->id,
'direction' => $call->direction,
'type' => "Call",
'module' => "Calls",
'status' => $call->status,
'parent_id' => $call->parent_id,
'parent_type' => $call->parent_type,
'parent_name' => $call->parent_name,
'contact_id' => $call->contact_id,
'contact_name' => $call->contact_name,
'date_due' => $call->date_start,
'description' => $this->formatDescription($call->description),
'date_type' => $app_strings['DATA_TYPE_START']
);
}
} // end Calls
foreach ($focus_emails_list as $email) {
$sort_date_time='';
if (!empty($email->date_start) and !empty($email->time_start)) {
$sort_date_time=$timedate->to_db_date_time($email->date_start,$email->time_start);
$sort_date_time=implode(' ', $sort_date_time);
// kbrill - Bug #16714
//$sort_date_time=$timedate->handle_offset($sort_date_time,'Y-m-d H:i:s',true);
}
$history_list[] = array('name' => $email->name,
'id' => $email->id,
'type' => "Email",
'direction' => '',
'module' => "Emails",
'status' => '',
'parent_id' => $email->parent_id,
'parent_type' => $email->parent_type,
'parent_name' => $email->parent_name,
'contact_id' => $email->contact_id,
'contact_name' => $email->contact_name,
'date_modified' => $email->date_start." ".$email->time_start,
'description' => $this->getEmailDetails($email),
'date_type' => $app_strings['DATA_TYPE_SENT'],
'sort_value' => $sort_date_time
);
} //end Emails
foreach ($focus_notes_list as $note) {
if (!empty($note->date_modified)) {
$sort_date_time = $timedate->swap_formats($note->date_modified, $timedate->get_date_time_format(), $timedate->get_db_date_time_format());
}
$history_list[] = array('name' => $note->name,
'id' => $note->id,
'type' => "Note",
'direction' => '',
'module' => "Notes",
'status' => '',
'parent_id' => $note->parent_id,
'parent_type' => $note->parent_type,
'parent_name' => $note->parent_name,
'contact_id' => $note->contact_id,
'contact_name' => $note->contact_name,
'date_modified' => $note->date_modified,
'description' => $this->formatDescription($note->description),
'date_type' => $app_strings['DATA_TYPE_MODIFIED'],
'sort_value' => $sort_date_time
);
if(!empty($note->filename)) {
$count = count($history_list);
$count--;
$history_list[$count]['filename'] = $note->filename;
$history_list[$count]['fileurl'] = UploadFile::get_url($note->filename,$note->id);
}
} // end Notes
$xtpl=new XTemplate ('modules/Activities/Popup_picker.html');
$xtpl->assign('MOD', $mod_strings);
$xtpl->assign('APP', $app_strings);
insert_popup_header();
//output header
echo "<table width='100%' cellpadding='0' cellspacing='0'><tr><td>";
echo get_module_title($focus->module_dir, translate('LBL_MODULE_NAME', $focus->module_dir).": ".$focus->name, false);
echo "</td><td align='right' class='moduleTitle'>";
echo "<A href='javascript:print();' class='utilsLink'><img src='".SugarThemeRegistry::current()->getImageURL("print.gif")."' width='13' height='13' alt='".$app_strings['LNK_PRINT']."' border='0' align='absmiddle'></a>&nbsp;<A href='javascript:print();' class='utilsLink'>".$app_strings['LNK_PRINT']."</A>\n";
echo "</td></tr></table>";
$oddRow = true;
if (count($history_list) > 0) $history_list = array_csort($history_list, 'sort_value', SORT_DESC);
foreach($history_list as $activity)
{
$activity_fields = array(
'ID' => $activity['id'],
'NAME' => $activity['name'],
'MODULE' => $activity['module'],
'CONTACT_NAME' => $activity['contact_name'],
'CONTACT_ID' => $activity['contact_id'],
'PARENT_TYPE' => $activity['parent_type'],
'PARENT_NAME' => $activity['parent_name'],
'PARENT_ID' => $activity['parent_id'],
'DATE' => $activity['date_modified'],
'DESCRIPTION' => $activity['description'],
'DATE_TYPE' => $activity['date_type']
);
if (empty($activity['direction'])) {
$activity_fields['TYPE'] = $app_list_strings['activity_dom'][$activity['type']];
}
else {
$activity_fields['TYPE'] = $app_list_strings['call_direction_dom'][$activity['direction']].' '.$app_list_strings['activity_dom'][$activity['type']];
}
switch ($activity['type']) {
case 'Call':
$activity_fields['STATUS'] = $app_list_strings['call_status_dom'][$activity['status']];
break;
case 'Meeting':
$activity_fields['STATUS'] = $app_list_strings['meeting_status_dom'][$activity['status']];
break;
case 'Task':
$activity_fields['STATUS'] = $app_list_strings['task_status_dom'][$activity['status']];
break;
}
if (isset($activity['location'])) $activity_fields['LOCATION'] = $activity['location'];
if (isset($activity['filename'])) {
$activity_fields['ATTACHMENT'] = "<a href='index.php?entryPoint=download&id=".$activity['id']."&type=Notes' target='_blank'>".SugarThemeRegistry::current()->getImage("attachment","alt='".$activity['filename']."' border='0' align='absmiddle'")."</a>";
}
if (isset($activity['parent_type'])) $activity_fields['PARENT_MODULE'] = $activity['parent_type'];
$xtpl->assign("ACTIVITY", $activity_fields);
$xtpl->assign("ACTIVITY_MODULE_PNG", SugarThemeRegistry::current()->getImage($activity_fields['MODULE'].'','border="0" alt="'.$activity_fields['NAME'].'"'));
if($oddRow)
{
//todo move to themes
$xtpl->assign("ROW_COLOR", 'oddListRow');
$xtpl->assign("BG_COLOR", $odd_bg);
}
else
{
//todo move to themes
$xtpl->assign("ROW_COLOR", 'evenListRow');
$xtpl->assign("BG_COLOR", $even_bg);
}
$oddRow = !$oddRow;
$xtpl->parse("history.row");
// Put the rows in.
}
$xtpl->parse("history");
$xtpl->out("history");
insert_popup_footer();
}
function getEmailDetails($email){
$details = "";
if(!empty($email->to_addrs)){
$details .= "To: ".$email->to_addrs."<br>";
}
if(!empty($email->from_addr)){
$details .= "From: ".$email->from_addr."<br>";
}
if(!empty($email->cc_addrs)){
$details .= "CC: ".$email->cc_addrs."<br>";
}
if(!empty($email->from_addr) || !empty($email->cc_addrs) || !empty($email->to_addrs)){
$details .= "<br>";
}
// cn: bug 8433 - history does not distinguish b/t text/html emails
$details .= empty($email->description_html)
? $this->formatDescription($email->description)
: $this->formatDescription(strip_tags(br2nl(from_html($email->description_html))));
return $details;
}
function getTaskDetails($task){
global $app_strings;
$details = "";
if($task->date_start != '0000-00-00'){
$details .= $app_strings['DATA_TYPE_START'].$task->date_start."<br>";
}
if(($task->date_start != '0000-00-00')){
$details .= "<br>";
}
$details .= $this->formatDescription($task->description);
return $details;
}
function formatDescription($description){
return nl2br($description);
}
} // end of class Popup_Picker
?>

View File

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

View File

@@ -0,0 +1,455 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
/*********************************************************************************
* Description: TODO: To be written.
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
********************************************************************************/
require_once("include/upload_file.php");
global $currentModule;
global $theme;
global $focus;
global $action;
global $app_strings;
global $app_list_strings;
//we don't want the parent module's string file, but rather the string file specifc to this subpanel
global $current_language;
$current_module_strings = return_module_language($current_language, 'Activities');
global $timedate;
// history_list is the means of passing data to a SubPanelView.
global $focus_tasks_list;
global $focus_meetings_list;
global $focus_calls_list;
global $focus_emails_list;
$open_activity_list = Array();
$history_list = Array();
foreach ($focus_tasks_list as $task) {
if ($task->status != "Not Started" && $task->status != "In Progress" && $task->status != "Pending Input") {
$history_list[] = Array('name' => $task->name,
'id' => $task->id,
'type' => "Task",
'direction' => '',
'module' => "Tasks",
'status' => $task->status,
'parent_id' => $task->parent_id,
'parent_type' => $task->parent_type,
'parent_name' => $task->parent_name,
'contact_id' => $task->contact_id,
'contact_name' => $task->contact_name,
'date_modified' => $timedate->to_display_date($task->date_modified, true),
);
}
else {
if ($task->date_due == '0000-00-00') $date_due = '';
else {
$date_due = $task->date_due;
}
$open_activity_list[] = Array('name' => $task->name,
'id' => $task->id,
'type' => "Task",
'direction' => '',
'module' => "Tasks",
'status' => $task->status,
'parent_id' => $task->parent_id,
'parent_type' => $task->parent_type,
'parent_name' => $task->parent_name,
'contact_id' => $task->contact_id,
'contact_name' => $task->contact_name,
'date_due' => $date_due
);
}
}
foreach ($focus_meetings_list as $meeting) {
if ($meeting->status != "Planned") {
$history_list[] = Array('name' => $meeting->name,
'id' => $meeting->id,
'type' => "Meeting",
'direction' => '',
'module' => "Meetings",
'status' => $meeting->status,
'parent_id' => $meeting->parent_id,
'parent_type' => $meeting->parent_type,
'parent_name' => $meeting->parent_name,
'contact_id' => $meeting->contact_id,
'contact_name' => $meeting->contact_name,
'date_modified' => $meeting->date_modified
);
}
else {
$open_activity_list[] = Array('name' => $meeting->name,
'id' => $meeting->id,
'type' => "Meeting",
'direction' => '',
'module' => "Meetings",
'status' => $meeting->status,
'parent_id' => $meeting->parent_id,
'parent_type' => $meeting->parent_type,
'parent_name' => $meeting->parent_name,
'contact_id' => $meeting->contact_id,
'contact_name' => $meeting->contact_name,
'date_due' => $meeting->date_start
);
}
}
foreach ($focus_calls_list as $call) {
if ($call->status != "Planned") {
$history_list[] = Array('name' => $call->name,
'id' => $call->id,
'type' => "Call",
'direction' => $call->direction,
'module' => "Calls",
'status' => $call->status,
'parent_id' => $call->parent_id,
'parent_type' => $call->parent_type,
'parent_name' => $call->parent_name,
'contact_id' => $call->contact_id,
'contact_name' => $call->contact_name,
'date_modified' => $call->date_modified
);
}
else {
$open_activity_list[] = Array('name' => $call->name,
'id' => $call->id,
'direction' => $call->direction,
'type' => "Call",
'module' => "Calls",
'status' => $call->status,
'parent_id' => $call->parent_id,
'parent_type' => $call->parent_type,
'parent_name' => $call->parent_name,
'contact_id' => $call->contact_id,
'contact_name' => $call->contact_name,
'date_due' => $call->date_start
);
}
}
foreach ($focus_emails_list as $email) {
$history_list[] = Array('name' => $email->name,
'id' => $email->id,
'type' => "Email",
'direction' => '',
'module' => "Emails",
'status' => '',
'parent_id' => $email->parent_id,
'parent_type' => $email->parent_type,
'parent_name' => $email->parent_name,
'contact_id' => $email->contact_id,
'contact_name' => $email->contact_name,
'date_modified' => $email->date_start." ".$email->time_start
);
}
foreach ($focus_notes_list as $note) {
$history_list[] = Array('name' => $note->name,
'id' => $note->id,
'type' => "Note",
'direction' => '',
'module' => "Notes",
'status' => '',
'parent_id' => $note->parent_id,
'parent_type' => $note->parent_type,
'parent_name' => $note->parent_name,
'contact_id' => $note->contact_id,
'contact_name' => $note->contact_name,
'date_modified' => $note->date_modified
);
if (!empty($note->filename))
{
$count = count($history_list);
$count--;
$history_list[$count]['filename'] = $note->filename;
$history_list[$count]['fileurl'] = UploadFile::get_url($note->filename,$note->id);
}
}
if ($currentModule == 'Contacts')
{
$xtpl=new XTemplate ('modules/Activities/SubPanelViewContacts.html');
$xtpl->assign("CONTACT_ID", $focus->id);
}
else
{
$xtpl=new XTemplate ('modules/Activities/SubPanelView.html');
}
$xtpl->assign("DELETE_INLINE_PNG", SugarThemeRegistry::current()->getImage('delete_inline','align="absmiddle" alt="'.$app_strings['LNK_DELETE'].'" border="0"'));
$xtpl->assign("EDIT_INLINE_PNG", SugarThemeRegistry::current()->getImage('edit_inline','align="absmiddle" alt="'.$app_strings['LNK_EDIT'].'" border="0"'));
$xtpl->assign("MOD", $current_module_strings);
$xtpl->assign("APP", $app_strings);
$button = "<form border='0' action='index.php' method='post' name='form' id='form'>\n";
$button .= "<input type='hidden' name='module'>\n";
$button .= "<input type='hidden' name='type'>\n";
if ($currentModule == 'Accounts')
{
$button .= "<input type='hidden' name='parent_type' value='Accounts'>\n<input type='hidden' name='parent_id' value='$focus->id'>\n<input type='hidden' name='parent_name' value='$focus->name'>\n";
}
elseif ($currentModule == 'Opportunities')
{
$button .= "<input type='hidden' name='parent_type' value='Opportunities'>\n<input type='hidden' name='parent_id' value='$focus->id'>\n<input type='hidden' name='parent_name' value='$focus->name'>\n";
}
elseif ($currentModule == 'Cases')
{
$button .= "<input type='hidden' name='parent_type' value='Cases'>\n<input type='hidden' name='parent_id' value='$focus->id'>\n<input type='hidden' name='parent_name' value='$focus->name'>\n";
}
elseif ($currentModule == 'Contacts')
{
$button .= "<input type='hidden' name='contact_id' value='$focus->id'>\n<input type='hidden' name='contact_name' value='$focus->first_name $focus->last_name'>\n";
$button .= "<input type='hidden' name='parent_type' value='Accounts'>\n<input type='hidden' name='parent_id' value='$focus->account_id'>\n<input type='hidden' name='parent_name' value='$focus->account_name'>\n";
$button .= "<input type='hidden' name='to_email_addrs' value='$focus->email1'>\n";
}
else
{
$button .= "<input type='hidden' name='parent_type' value='$currentModule'>\n<input type='hidden' name='parent_id' value='$focus->id'>\n<input type='hidden' name='parent_name' value='$focus->name'>\n";
}
$button .= "<input type='hidden' name='return_module' value='".$currentModule."'>\n";
$button .= "<input type='hidden' name='return_action' value='".$action."'>\n";
$button .= "<input type='hidden' name='return_id' value='".$focus->id."'>\n";
$button .= "<input type='hidden' name='type' value='out'>\n";
$button .= "<input type='hidden' name='action'>\n";
if($currentModule != 'Project' && $currentModule != 'ProjectTask')
{
$button .= "<input title='".$current_module_strings['LBL_NEW_TASK_BUTTON_TITLE']."' accessKey='".$current_module_strings['LBL_NEW_TASK_BUTTON_KEY']."' class='button' onclick=\"this.form.action.value='EditView';this.form.module.value='Tasks'\" type='submit' name='button' value='".$current_module_strings['LBL_NEW_TASK_BUTTON_LABEL']."'>\n";
}
$button .= "<input title='".$current_module_strings['LBL_SCHEDULE_MEETING_BUTTON_TITLE']."' accessKey='".$current_module_strings['LBL_SCHEDULE_MEETING_BUTTON_KEY']."' class='button' onclick=\"this.form.action.value='EditView';this.form.module.value='Meetings'\" type='submit' name='button' value='".$current_module_strings['LBL_SCHEDULE_MEETING_BUTTON_LABEL']."'>\n";
$button .= "<input title='".$current_module_strings['LBL_SCHEDULE_CALL_BUTTON_LABEL']."' accessKey='".$current_module_strings['LBL_SCHEDULE_CALL_BUTTON_KEY']."' class='button' onclick=\"this.form.action.value='EditView';this.form.module.value='Calls'\" type='submit' name='button' value='".$current_module_strings['LBL_SCHEDULE_CALL_BUTTON_LABEL']."'>\n";
$button .= "<input title='".$app_strings['LBL_COMPOSE_EMAIL_BUTTON_TITLE']."' accessKey='".$app_strings['LBL_COMPOSE_EMAIL_BUTTON_KEY']."' class='button' onclick=\"this.form.type.value='out';this.form.action.value='EditView';this.form.module.value='Emails';\" type='submit' name='button' value='".$app_strings['LBL_COMPOSE_EMAIL_BUTTON_LABEL']."'>\n";
$button .= "</form>\n";
// Stick the form header out there.
echo get_form_header($current_module_strings['LBL_OPEN_ACTIVITIES'], $button, false);
$xtpl->assign("RETURN_URL", "&return_module=$currentModule&return_action=DetailView&return_id=$focus->id");
$oddRow = true;
if (count($open_activity_list) > 0) $open_activity_list = array_csort($open_activity_list, 'date_due', SORT_DESC);
foreach($open_activity_list as $activity)
{
$activity_fields = array(
'ID' => $activity['id'],
'NAME' => $activity['name'],
'MODULE' => $activity['module'],
'CONTACT_NAME' => $activity['contact_name'],
'CONTACT_ID' => $activity['contact_id'],
'PARENT_TYPE' => $activity['parent_type'],
'PARENT_NAME' => $activity['parent_name'],
'PARENT_ID' => $activity['parent_id'],
'DATE' => $activity['date_due']
);
if (empty($activity['direction'])) {
$activity_fields['TYPE'] = $app_list_strings['activity_dom'][$activity['type']];
}
else {
$activity_fields['TYPE'] = $app_list_strings['call_direction_dom'][$activity['direction']].' '.$app_list_strings['activity_dom'][$activity['type']];
}
if (isset($activity['parent_type'])) $activity_fields['PARENT_MODULE'] = $activity['parent_type'];
switch ($activity['type']) {
case 'Call':
$activity_fields['SET_COMPLETE'] = "<a href='index.php?return_module=$currentModule&return_action=$action&return_id=$focus->id&action=EditView&module=Calls&status=Held&record=".$activity['id']."&status=Held'>".SugarThemeRegistry::current()->getImage("close_inline","title=".translate('LBL_LIST_CLOSE','Activities')." border='0'")."</a>";
$activity_fields['STATUS'] = $app_list_strings['call_status_dom'][$activity['status']];
break;
case 'Meeting':
$activity_fields['SET_COMPLETE'] = "<a href='index.php?return_module=$currentModule&return_action=$action&return_id=$focus->id&action=EditView&module=Meetings&status=Held&record=".$activity['id']."&status=Held'>".SugarThemeRegistry::current()->getImage("close_inline","title=".translate('LBL_LIST_CLOSE','Activities')." border='0'")."</a>";
$activity_fields['STATUS'] = $app_list_strings['meeting_status_dom'][$activity['status']];
break;
case 'Task':
$activity_fields['SET_COMPLETE'] = "<a href='index.php?return_module=$currentModule&return_action=$action&return_id=$focus->id&action=EditView&module=Tasks&status=Completed&record=".$activity['id']."&status=Completed'>".SugarThemeRegistry::current()->getImage("close_inline","title=".translate('LBL_LIST_CLOSE','Activities')." border='0'")."</a>";
$activity_fields['STATUS'] = $app_list_strings['task_status_dom'][$activity['status']];
break;
}
global $odd_bg;
global $even_bg;
global $hilite_bg;
global $click_bg;
$xtpl->assign("BG_HILITE", $hilite_bg);
$xtpl->assign("BG_CLICK", $click_bg);
$xtpl->assign("ACTIVITY_MODULE_PNG", SugarThemeRegistry::current()->getImage($activity_fields['MODULE'].'','border="0" alt="'.$activity_fields['NAME'].'"'));
$xtpl->assign("ACTIVITY", $activity_fields);
if($oddRow)
{
//todo move to themes
$xtpl->assign("ROW_COLOR", 'oddListRow');
$xtpl->assign("BG_COLOR", $odd_bg);
}
else
{
//todo move to themes
$xtpl->assign("ROW_COLOR", 'evenListRow');
$xtpl->assign("BG_COLOR", $even_bg);
}
$oddRow = !$oddRow;
$xtpl->parse("open_activity.row");
// Put the rows in.
}
$xtpl->parse("open_activity");
$xtpl->out("open_activity");
echo "<BR>";
//requestdata
$popup_request_data = array(
'call_back_function' => 'set_return',
'form_name' => 'EditView',
'field_to_name_array' => array(),
);
$json = getJSONobj();
$encoded_popup_request_data = $json->encode($popup_request_data);
$button = "<form border='0' action='index.php' method='post' name='form' id='form'>\n";
$button .= "<input type='hidden' name='module'>\n";
$button .= "<input type='hidden' name='type' value='archived'>\n";
if ($currentModule == 'Accounts') $button .= "<input type='hidden' name='parent_type' value='Accounts'>\n<input type='hidden' name='parent_id' value='$focus->id'>\n<input type='hidden' name='parent_name' value='$focus->name'>\n";
if ($currentModule == 'Opportunities') $button .= "<input type='hidden' name='parent_type' value='Opportunities'>\n<input type='hidden' name='parent_id' value='$focus->id'>\n<input type='hidden' name='parent_name' value='$focus->name'>\n";
elseif ($currentModule == 'Cases') $button .= "<input type='hidden' name='parent_type' value='Cases'>\n<input type='hidden' name='parent_id' value='$focus->id'>\n<input type='hidden' name='parent_name' value='$focus->name'>\n";
elseif ($currentModule == 'Contacts') {
$button .= "<input type='hidden' name='contact_id' value='$focus->id'>\n<input type='hidden' name='contact_name' value='$focus->first_name $focus->last_name'>\n";
$button .= "<input type='hidden' name='to_email_addrs' value='$focus->email1'>\n";
$button .= "<input type='hidden' name='parent_type' value='Accounts'>\n<input type='hidden' name='parent_id' value='$focus->account_id'>\n<input type='hidden' name='parent_name' value='$focus->account_name'>\n";
}else{
$button .= "<input type='hidden' name='parent_type' value='$currentModule'>\n<input type='hidden' name='parent_id' value='$focus->id'>\n<input type='hidden' name='parent_name' value='$focus->name'>\n";
}
$button .= "<input type='hidden' name='return_module' value='".$currentModule."'>\n";
$button .= "<input type='hidden' name='return_action' value='".$action."'>\n";
$button .= "<input type='hidden' name='return_id' value='".$focus->id."'>\n";
$button .= "<input type='hidden' name='action'>\n";
$button .= "<input title='".$current_module_strings['LBL_NEW_NOTE_BUTTON_TITLE']."' accessKey='".$current_module_strings['LBL_NEW_NOTE_BUTTON_KEY']."' class='button' onclick=\"this.form.action.value='EditView';this.form.module.value='Notes'\" type='submit' name='button' value='".$current_module_strings['LBL_NEW_NOTE_BUTTON_LABEL']."'>\n";
$button .= "<input title='".$current_module_strings['LBL_TRACK_EMAIL_BUTTON_TITLE']."' accessKey='".$current_module_strings['LBL_TRACK_EMAIL_BUTTON_KEY']."' class='button' onclick=\"this.form.type.value='archived';this.form.action.value='EditView';this.form.module.value='Emails'\" type='submit' name='button' value='".$current_module_strings['LBL_TRACK_EMAIL_BUTTON_LABEL']."'>\n";
$button .= "<input title='".$current_module_strings['LBL_ACCUMULATED_HISTORY_BUTTON_TITLE']."' accessKey='".$current_module_strings['LBL_ACCUMULATED_HISTORY_BUTTON_KEY']."' class='button' type='button' onclick='open_popup(\"Activities\", \"600\", \"400\", \"&record=$focus->id&module_name=$currentModule\", true, false, $encoded_popup_request_data);' name='button' value='".$current_module_strings['LBL_ACCUMULATED_HISTORY_BUTTON_LABEL']."'>\n";
$button .= "</form>\n";
// Stick the form header out there.
echo get_form_header($current_module_strings['LBL_HISTORY'], $button, false);
$xtpl->assign("RETURN_URL", "&return_module=$currentModule&return_action=DetailView&return_id=$focus->id");
$oddRow = true;
if (count($history_list) > 0) $history_list = array_csort($history_list, 'date_modified', SORT_DESC);
foreach($history_list as $activity)
{
$activity_fields = array(
'ID' => $activity['id'],
'NAME' => $activity['name'],
'MODULE' => $activity['module'],
'CONTACT_NAME' => $activity['contact_name'],
'CONTACT_ID' => $activity['contact_id'],
'PARENT_TYPE' => $activity['parent_type'],
'PARENT_NAME' => $activity['parent_name'],
'PARENT_ID' => $activity['parent_id'],
'DATE' => $activity['date_modified'],
);
if (empty($activity['direction'])) {
$activity_fields['TYPE'] = $app_list_strings['activity_dom'][$activity['type']];
}
else {
$activity_fields['TYPE'] = $app_list_strings['call_direction_dom'][$activity['direction']].' '.$app_list_strings['activity_dom'][$activity['type']];
}
switch ($activity['type']) {
case 'Call':
$activity_fields['STATUS'] = $app_list_strings['call_status_dom'][$activity['status']];
break;
case 'Meeting':
$activity_fields['STATUS'] = $app_list_strings['meeting_status_dom'][$activity['status']];
break;
case 'Task':
$activity_fields['STATUS'] = $app_list_strings['task_status_dom'][$activity['status']];
break;
}
if (isset($activity['location'])) $activity_fields['LOCATION'] = $activity['location'];
if (isset($activity['filename'])) {
$activity_fields['ATTACHMENT'] = "<a href='".$activity['fileurl']."' target='_blank'>".SugarThemeRegistry::current()->getImage("attachment","alt='".$activity['filename']."' border='0' align='absmiddle'")."</a>";
}
if (isset($activity['parent_type'])) $activity_fields['PARENT_MODULE'] = $activity['parent_type'];
$xtpl->assign("ACTIVITY", $activity_fields);
$xtpl->assign("ACTIVITY_MODULE_PNG", SugarThemeRegistry::current()->getImage($activity_fields['MODULE'].'','border="0" alt="'.$activity_fields['NAME'].'"'));
if($oddRow)
{
//todo move to themes
$xtpl->assign("ROW_COLOR", 'oddListRow');
$xtpl->assign("BG_COLOR", $odd_bg);
}
else
{
//todo move to themes
$xtpl->assign("ROW_COLOR", 'evenListRow');
$xtpl->assign("BG_COLOR", $even_bg);
}
$oddRow = !$oddRow;
$xtpl->parse("history.row");
// Put the rows in.
}
$xtpl->parse("history");
$xtpl->out("history");
?>

45
modules/Activities/config.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".
********************************************************************************/
/*********************************************************************************
********************************************************************************/
//defines the call and meeting status. Values are keys, not translated strings
$open_status[] = "Planned";
?>

View File

@@ -0,0 +1,130 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
/*********************************************************************************
* Description: Defines the English language pack for the base application.
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
********************************************************************************/
$mod_strings = array (
'LBL_MODULE_NAME' => 'Activities',
'LBL_MODULE_TITLE' => 'Activities: Home',
'LBL_SEARCH_FORM_TITLE' => 'Activities Search',
'LBL_LIST_FORM_TITLE' => 'Activities List',
'LBL_LIST_SUBJECT' => 'Subject',
'LBL_LIST_CONTACT' => 'Contact',
'LBL_LIST_RELATED_TO' => 'Related to',
'LBL_LIST_DATE' => 'Date',
'LBL_LIST_TIME' => 'Start Time',
'LBL_LIST_CLOSE' => 'Close',
'LBL_SUBJECT' => 'Subject:',
'LBL_STATUS' => 'Status:',
'LBL_LOCATION' => 'Location:',
'LBL_DATE_TIME' => 'Start Date & Time:',
'LBL_DATE' => 'Start Date:',
'LBL_TIME' => 'Start Time:',
'LBL_DURATION' => 'Duration:',
'LBL_DURATION_MINUTES' => 'Duration Minutes:',
'LBL_HOURS_MINS' => '(hours/minutes)',
'LBL_CONTACT_NAME' => 'Contact Name: ',
'LBL_MEETING' => 'Meeting:',
'LBL_DESCRIPTION_INFORMATION' => 'Description Information',
'LBL_DESCRIPTION' => 'Description:',
'LBL_COLON' => ':',
'LBL_DEFAULT_STATUS' => 'Planned',
'LNK_NEW_CALL' => 'Log Call',
'LNK_NEW_MEETING' => 'Schedule Meeting',
'LNK_NEW_TASK' => 'Create Task',
'LNK_NEW_NOTE' => 'Create Note or Add Attachment',
'LNK_NEW_EMAIL' => 'Create Archived Email',
'LNK_CALL_LIST' => 'View Calls',
'LNK_MEETING_LIST' => 'View Meetings',
'LNK_TASK_LIST' => 'View Tasks',
'LNK_NOTE_LIST' => 'View Notes',
'LNK_EMAIL_LIST' => 'View Emails',
'ERR_DELETE_RECORD' => 'You must specify a record number to delete the account.',
'NTC_REMOVE_INVITEE' => 'Are you sure you want to remove this invitee from the meeting?',
'LBL_INVITEE' => 'Invitees',
'LBL_LIST_DIRECTION' => 'Direction',
'LBL_DIRECTION' => 'Direction',
'LNK_NEW_APPOINTMENT' => 'New Appointment',
'LNK_VIEW_CALENDAR' => 'View Calendar',
'LBL_OPEN_ACTIVITIES' => 'Open Activities',
'LBL_HISTORY' => 'History',
'LBL_UPCOMING' => 'My Upcoming Appointments',
'LBL_TODAY' => 'through ',
'LBL_NEW_TASK_BUTTON_TITLE' => 'Create Task [Alt+N]',
'LBL_NEW_TASK_BUTTON_KEY' => 'N',
'LBL_NEW_TASK_BUTTON_LABEL' => 'Create Task',
'LBL_SCHEDULE_MEETING_BUTTON_TITLE' => 'Schedule Meeting [Alt+M]',
'LBL_SCHEDULE_MEETING_BUTTON_KEY' => 'M',
'LBL_SCHEDULE_MEETING_BUTTON_LABEL' => 'Schedule Meeting',
'LBL_SCHEDULE_CALL_BUTTON_TITLE' => 'Log Call [Alt+C]',
'LBL_SCHEDULE_CALL_BUTTON_KEY' => 'C',
'LBL_SCHEDULE_CALL_BUTTON_LABEL' => 'Log Call',
'LBL_NEW_NOTE_BUTTON_TITLE' => 'Create Note or Attachment [Alt+T]',
'LBL_NEW_NOTE_BUTTON_KEY' => 'T',
'LBL_NEW_NOTE_BUTTON_LABEL' => 'Create Note or Attachment',
'LBL_TRACK_EMAIL_BUTTON_TITLE' => 'Archive Email [Alt+K]',
'LBL_TRACK_EMAIL_BUTTON_KEY' => 'K',
'LBL_TRACK_EMAIL_BUTTON_LABEL' => 'Archive Email',
'LBL_LIST_STATUS' => 'Status',
'LBL_LIST_DUE_DATE' => 'Due Date',
'LBL_LIST_LAST_MODIFIED' => 'Last Modified',
'NTC_NONE_SCHEDULED' => 'None scheduled.',
'appointment_filter_dom' => array(
'today' => 'today'
,'tomorrow' => 'tomorrow'
,'this Saturday' => 'this week'
,'next Saturday' => 'next week'
,'last this_month' => 'this month'
,'last next_month' => 'next month'
),
'LNK_IMPORT_CALLS'=>'Import Calls',
'LNK_IMPORT_MEETINGS'=>'Import Meetings',
'LNK_IMPORT_TASKS'=>'Import Tasks',
'LNK_IMPORT_NOTES'=>'Import Notes',
'NTC_NONE'=>'None',
'LBL_ACCEPT_THIS'=>'Accept?',
'LBL_DEFAULT_SUBPANEL_TITLE' => 'Open Activities',
'LBL_LIST_ASSIGNED_TO_NAME' => 'Assigned User',
);
?>

View File

@@ -0,0 +1,116 @@
<?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' => 'Działania',
'LBL_MODULE_TITLE' => 'Działania: Strona główna',
'LBL_SEARCH_FORM_TITLE' => 'Wyszukaj działania',
'LBL_LIST_FORM_TITLE' => 'Lista działań',
'LBL_LIST_SUBJECT' => 'Temat',
'LBL_LIST_CONTACT' => 'Osoba kontaktowa',
'LBL_LIST_RELATED_TO' => 'Przydzielone do',
'LBL_LIST_DATE' => 'Data',
'LBL_LIST_TIME' => 'Czas rozp.',
'LBL_LIST_DATE_MODIFIED' => 'Data Modyfikacji',
'LBL_LIST_CLOSE' => 'Zamknij',
'LBL_SUBJECT' => 'Temat:',
'LBL_STATUS' => 'Status:',
'LBL_LOCATION' => 'Położenie:',
'LBL_DATE_TIME' => 'Data i czas rozpoczęcia:',
'LBL_DATE' => 'Data rozp.:',
'LBL_TIME' => 'Czas rozp.:',
'LBL_DURATION' => 'Czas trwania:',
'LBL_DURATION_MINUTES' => 'Czas trwania (minuty):',
'LBL_HOURS_MINS' => '(godziny/minuty)',
'LBL_CONTACT_NAME' => 'Osoba kontaktowa: ',
'LBL_MEETING' => 'Spotkanie:',
'LBL_DESCRIPTION_INFORMATION' => 'Informacje dodatkowe',
'LBL_DESCRIPTION' => 'Opis:',
'LBL_COLON' => ':',
'LBL_DEFAULT_STATUS' => 'Planowane',
'LNK_NEW_CALL' => 'Dodaj rozmowę tel.',
'LNK_NEW_MEETING' => 'Delegacja',
'LNK_NEW_TASK' => 'Utwórz zadanie',
'LNK_NEW_NOTE' => 'Napisz notatkę',
'LNK_NEW_EMAIL' => 'Napiszj e-mail',
'LNK_CALL_LIST' => 'Rozmowy tel.',
'LNK_MEETING_LIST' => 'Spotkania',
'LNK_TASK_LIST' => 'Zadania',
'LNK_NOTE_LIST' => 'Notatki',
'LNK_EMAIL_LIST' => 'Poczta',
'ERR_DELETE_RECORD' => 'Określ rekord, który chcesz usunąć.',
'NTC_REMOVE_INVITEE' => 'Czy na pewno chcesz usunąć uczestnika spotkania?',
'LBL_INVITEE' => 'Uczestnicy',
'LBL_LIST_DIRECTION' => 'Wytyczne',
'LBL_DIRECTION' => 'Wytyczne',
'LNK_NEW_APPOINTMENT' => 'Nowy termin spotkania',
'LNK_VIEW_CALENDAR' => 'Dzisiaj',
'LBL_OPEN_ACTIVITIES' => 'Bieżące działania',
'LBL_HISTORY' => 'Historia',
'LBL_UPCOMING' => 'Moje przyszłe działania',
'LBL_TODAY' => 'w dniu: ',
'LBL_NEW_TASK_BUTTON_TITLE' => 'Zadanie inne [Alt+N]',
'LBL_NEW_TASK_BUTTON_KEY' => 'N',
'LBL_NEW_TASK_BUTTON_LABEL' => 'Zadanie inne',
'LBL_SCHEDULE_MEETING_BUTTON_TITLE' => 'Kalendarz spotkań [Alt+M]',
'LBL_SCHEDULE_MEETING_BUTTON_KEY' => 'M',
'LBL_SCHEDULE_MEETING_BUTTON_LABEL' => 'Kalendarz spotkań',
'LBL_SCHEDULE_CALL_BUTTON_TITLE' => 'Kalendarz rozmów tel. [Alt+C]',
'LBL_SCHEDULE_CALL_BUTTON_KEY' => 'C',
'LBL_SCHEDULE_CALL_BUTTON_LABEL' => 'Kalendarz rozmów tel.',
'LBL_NEW_NOTE_BUTTON_TITLE' => 'Dodaj notatkę [Alt+T]',
'LBL_NEW_NOTE_BUTTON_KEY' => 'T',
'LBL_NEW_NOTE_BUTTON_LABEL' => 'Dodaj notatkę',
'LBL_TRACK_EMAIL_BUTTON_TITLE' => 'Archiwum e-mail [Alt+K]',
'LBL_TRACK_EMAIL_BUTTON_KEY' => 'K',
'LBL_TRACK_EMAIL_BUTTON_LABEL' => 'Archiwum e-mail',
'LBL_LIST_STATUS' => 'Status',
'LBL_LIST_DUE_DATE' => 'Data zakończenia',
'LBL_LIST_LAST_MODIFIED' => 'Ostatnio modyfikowane',
'NTC_NONE_SCHEDULED' => 'Kalendarz jest pusty.',
'appointment_filter_dom' => array(
'today' => 'dziś'
,'tomorrow' => 'jutro'
,'this Saturday' => 'w tym tygodniu'
,'next Saturday' => 'w przyszłym tygodniu'
,'last this_month' => 'w tym miesiącu'
,'last next_month' => 'w przyszłym miesiącu'
),
'LNK_IMPORT_NOTES'=>'Import notatek',
'NTC_NONE'=>'Nic',
'LBL_ACCEPT_THIS'=>'Akceptujesz?',
'LBL_DEFAULT_SUBPANEL_TITLE' => 'Otwórz działania',
'LBL_LIST_ASSIGNED_TO_NAME' => 'Przydzielony użytkownik',
);
?>

View File

@@ -0,0 +1,251 @@
<?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['Activities'] = array( // the key to the layout_defs must be the name of the module dir
'default_subpanel_define' => array(
'subpanel_title' => 'LBL_DEFAULT_SUBPANEL_TITLE',
'top_buttons' => array(
array('widget_class' => 'SubPanelTopCreateTaskButton'),
array('widget_class' => 'SubPanelTopScheduleMeetingButton'),
array('widget_class' => 'SubPanelTopScheduleCallButton'),
array('widget_class' => 'SubPanelTopComposeEmailButton'),
),
'list_fields' => array(
'Meetings' => array(
'columns' => array(
array(
//TODO remove name=nothing and make it safe
//TODO update layout editor to match new file structure
'name' => 'nothing',
'widget_class' => 'SubPanelIcon',
'module' => 'Meetings',
'width' => '2%',
),
array(
'name' => 'nothing',
'widget_class' => 'SubPanelCloseButton',
'module' => 'Meetings',
'vname' => 'LBL_LIST_CLOSE',
'width' => '6%',
),
array(
'name' => 'name',
'vname' => 'LBL_LIST_SUBJECT',
'widget_class' => 'SubPanelDetailViewLink',
'width' => '30%',
),
array(
'name' => 'status',
'widget_class' => 'SubPanelActivitiesStatusField',
'vname' => 'LBL_LIST_STATUS',
'width' => '15%',
),
array(
'name' => 'contact_name',
'module' => 'Contacts',
'widget_class' => 'SubPanelDetailViewLink',
'target_record_key' => 'contact_id',
'target_module' => 'Contacts',
'vname' => 'LBL_LIST_CONTACT',
'width' => '11%',
),
array(
'name' => 'parent_name',
'module' => 'Meetings',
'vname' => 'LBL_LIST_RELATED_TO',
'width' => '22%',
),
array(
'name' => 'date_start',
//'db_alias_to' => 'the_date',
'vname' => 'LBL_LIST_DUE_DATE',
'width' => '10%',
),
array(
'name' => 'nothing',
'widget_class' => 'SubPanelEditButton',
'module' => 'Meetings',
'width' => '2%',
),
array(
'name' => 'nothing',
'widget_class' => 'SubPanelRemoveButton',
'linked_field' => 'meetings',
'module' => 'Meetings',
'width' => '2%',
),
),
'where' => "(meetings.status='Planned')",
'order_by' => 'meetings.date_start',
),
'Tasks' => array(
'columns' => array(
array(
'name' => 'nothing',
'widget_class' => 'SubPanelIcon',
'module' => 'Tasks',
'width' => '2%',
),
array(
'name' => 'nothing',
'widget_class' => 'SubPanelCloseButton',
'module' => 'Tasks',
'vname' => 'LBL_LIST_CLOSE',
'width' => '6%',
),
array(
'name' => 'name',
'vname' => 'LBL_LIST_SUBJECT',
'widget_class' => 'SubPanelDetailViewLink',
'width' => '30%',
),
array(
'name' => 'status',
'widget_class' => 'SubPanelActivitiesStatusField',
'vname' => 'LBL_LIST_STATUS',
'width' => '15%',
),
array(
'name' => 'contact_name',
'module' => 'Contacts',
'widget_class' => 'SubPanelDetailViewLink',
'target_record_key' => 'contact_id',
'target_module' => 'Contacts',
'vname' => 'LBL_LIST_CONTACT',
'width' => '11%',
),
array(
'name' => 'parent_name',
'module' => 'Tasks',
'vname' => 'LBL_LIST_RELATED_TO',
'width' => '22%',
),
array(
'name' => 'date_start',
//'db_alias_to' => 'the_date',
'vname' => 'LBL_LIST_DUE_DATE',
'width' => '10%',
),
array(
'name' => 'nothing',
'widget_class' => 'SubPanelEditButton',
'module' => 'Tasks',
'width' => '2%',
),
array(
'name' => 'nothing',
'widget_class' => 'SubPanelRemoveButton',
'linked_field' => 'tasks',
'module' => 'Tasks',
'width' => '2%',
),
),
'where' => "(tasks.status='Not Started' OR tasks.status='In Progress' OR tasks.status='Pending Input')",
'order_by' => 'tasks.date_start',
),
'Calls' => array(
'columns' => array(
array(
'name' => 'nothing',
'widget_class' => 'SubPanelIcon',
'module' => 'Calls',
'width' => '2%',
),
array(
'name' => 'nothing',
'widget_class' => 'SubPanelCloseButton',
'module' => 'Calls',
'vname' => 'LBL_LIST_CLOSE',
'width' => '6%',
),
array(
'name' => 'name',
'vname' => 'LBL_LIST_SUBJECT',
'widget_class' => 'SubPanelDetailViewLink',
'width' => '30%',
),
array(
'name' => 'status',
'widget_class' => 'SubPanelActivitiesStatusField',
'vname' => 'LBL_LIST_STATUS',
'width' => '15%',
),
array(
'name' => 'contact_name',
'module' => 'Contacts',
'widget_class' => 'SubPanelDetailViewLink',
'target_record_key' => 'contact_id',
'target_module' => 'Contacts',
'vname' => 'LBL_LIST_CONTACT',
'width' => '11%',
),
array(
'name' => 'parent_name',
'module' => 'Calls',
'vname' => 'LBL_LIST_RELATED_TO',
'width' => '20%',
),
array(
'name' => 'date_start',
//'db_alias_to' => 'the_date',
'vname'=>'LBL_LIST_DUE_DATE',
'width' => '22%',
),
array(
'name' => 'nothing',
'widget_class' => 'SubPanelEditButton',
'module' => 'Calls',
'width' => '2%',
),
array(
'name' => 'nothing',
'widget_class' => 'SubPanelRemoveButton',
'linked_field' => 'calls',
'module' => 'Calls',
'width' => '2%',
),
),
'where' => "(calls.status='Planned')",
'order_by' => 'calls.date_start',
),
),
),
);
?>

View File

@@ -0,0 +1,46 @@
<?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 ActivitiesViewList extends ViewList
{
public function display()
{
$GLOBALS['mod_strings'] = return_module_language($GLOBALS['current_language'], 'Calendar');
require_once('modules/Calendar/index.php');
}
}

View File

@@ -0,0 +1,55 @@
<?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.modulelistmenu.php');
class ActivitiesViewModulelistmenu extends ViewModulelistmenu
{
public function display()
{
//last viewed
$tracker = new Tracker();
$history = $tracker->get_recently_viewed($GLOBALS['current_user']->id, array('Calls','Meetings','Tasks','Notes','Emails'));
foreach ( $history as $key => $row ) {
$history[$key]['item_summary_short'] = getTrackerSubstring($row['item_summary']);
$history[$key]['image'] = SugarThemeRegistry::current()
->getImage($row['module_name'],'border="0" align="absmiddle" alt="'.$row['item_summary'].'"');
}
$this->ss->assign('LAST_VIEWED',$history);
$this->ss->display('include/MVC/View/tpls/modulelistmenu.tpl');
}
}
?>

View File

@@ -0,0 +1,169 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
/*********************************************************************************
* Description: TODO: To be written.
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
********************************************************************************/
require_once('data/SugarBean.php');
require_once('include/OutboundEmail/OutboundEmail.php');
class Administration extends SugarBean {
var $settings;
var $table_name = "config";
var $object_name = "Administration";
var $new_schema = true;
var $module_dir = 'Administration';
var $config_categories = array(
// 'mail', // cn: moved to include/OutboundEmail
'disclosure', // appended to all outbound emails
'notify',
'system',
'portal',
'proxy',
'massemailer',
'ldap',
'captcha',
'sugarpdf',
);
var $checkbox_fields = Array("notify_send_by_default", "mail_smtpauth_req", "notify_on", 'portal_on', 'skypeout_on', 'system_mailmerge_on', 'proxy_auth', 'proxy_on', 'system_ldap_enabled','captcha_on');
function Administration() {
parent::SugarBean();
$this->setupCustomFields('Administration');
}
function retrieveSettings($category = FALSE, $clean=false) {
// declare a cache for all settings
// $settings_cache = sugar_cache_retrieve('admin_settings_cache');
if($clean) {
$settings_cache = array();
}
// Check for a cache hit
if(!empty($settings_cache)) {
$this->settings = $settings_cache;
return $this;
}
$query = "SELECT category, name, value FROM {$this->table_name}";
$result = $this->db->query($query, true, "Unable to retrieve system settings");
if(empty($result)) {
return NULL;
}
while($row = $this->db->fetchByAssoc($result, -1, true)) {
if($row['category']."_".$row['name'] == 'ldap_admin_password' || $row['category']."_".$row['name'] == 'proxy_password')
$this->settings[$row['category']."_".$row['name']] = $this->decrypt_after_retrieve($row['value']);
else
$this->settings[$row['category']."_".$row['name']] = $row['value'];
}
// outbound email settings
$oe = new OutboundEmail();
$oe->getSystemMailerSettings();
foreach($oe->field_defs as $def) {
if(strpos($def, "mail_") !== false)
$this->settings[$def] = $oe->$def;
}
// At this point, we have built a new array that should be cached.
sugar_cache_put('admin_settings_cache',$this->settings);
return $this;
}
function saveConfig() {
// outbound email settings
$oe = new OutboundEmail();
foreach($_POST as $key => $val) {
$prefix = $this->get_config_prefix($key);
if(in_array($prefix[0], $this->config_categories)) {
if(is_array($val)){
$val=implode(",",$val);
}
$this->saveSetting($prefix[0], $prefix[1], $val);
}
if(strpos($key, "mail_") !== false) {
if(in_array($key, $oe->field_defs)) {
$oe->$key = $val;
}
}
}
//saving outbound email from here is probably redundant, adding a check to make sure
//smtpserver name is set.
if (!empty($oe->mail_smtpserver)) {
$oe->saveSystem();
}
$this->retrieveSettings(false, true);
}
function saveSetting($category, $key, $value) {
$result = $this->db->query("SELECT count(*) AS the_count FROM config WHERE category = '{$category}' AND name = '{$key}'");
$row = $this->db->fetchByAssoc( $result, -1, true );
$row_count = $row['the_count'];
if($category."_".$key == 'ldap_admin_password' || $category."_".$key == 'proxy_password')
$value = $this->encrpyt_before_save($value);
if( $row_count == 0){
$result = $this->db->query("INSERT INTO config (value, category, name) VALUES ('$value','$category', '$key')");
}
else{
$result = $this->db->query("UPDATE config SET value = '{$value}' WHERE category = '{$category}' AND name = '{$key}'");
}
return $this->db->getAffectedRowCount();
}
function get_config_prefix($str) {
return Array(substr($str, 0, strpos($str, "_")), substr($str, strpos($str, "_")+1));
}
}
?>

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