Add php files
This commit is contained in:
57
modules/Roles/Delete.php
Executable file
57
modules/Roles/Delete.php
Executable 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".
|
||||
********************************************************************************/
|
||||
/*********************************************************************************
|
||||
|
||||
* Description: TODO: To be written.
|
||||
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
|
||||
* All Rights Reserved.
|
||||
* Contributor(s): ______________________________________..
|
||||
********************************************************************************/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$focus = new Role();
|
||||
|
||||
if(!isset($_REQUEST['record']))
|
||||
sugar_die("A record number must be specified to delete the role.");
|
||||
|
||||
$focus->mark_deleted($_REQUEST['record']);
|
||||
|
||||
header("Location: index.php?module=".$_REQUEST['return_module']."&action=".$_REQUEST['return_action']."&record=".$_REQUEST['return_id']);
|
||||
?>
|
||||
61
modules/Roles/DeleteUserRelationship.php
Executable file
61
modules/Roles/DeleteUserRelationship.php
Executable 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): ______________________________________..
|
||||
********************************************************************************/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$focus = new Role();
|
||||
|
||||
$focus->retrieve($_REQUEST['record']);
|
||||
|
||||
$focus->clear_user_relationship($focus->id, $_REQUEST['user_id']);
|
||||
|
||||
$header_URL = "Location: index.php?action={$_REQUEST['return_action']}&module={$_REQUEST['return_module']}&record={$_REQUEST['return_id']}";
|
||||
$GLOBALS['log']->debug("about to post header URL of: $header_URL");
|
||||
|
||||
header($header_URL);
|
||||
?>
|
||||
|
||||
152
modules/Roles/DetailView.php
Executable file
152
modules/Roles/DetailView.php
Executable file
@@ -0,0 +1,152 @@
|
||||
<?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('modules/Roles/Forms.php');
|
||||
require_once('include/DetailView/DetailView.php');
|
||||
|
||||
global $mod_strings;
|
||||
global $app_strings;
|
||||
global $app_list_strings;
|
||||
global $current_user;
|
||||
|
||||
if (!is_admin($current_user)) sugar_die("Unauthorized access to administration.");
|
||||
|
||||
$focus = new Role();
|
||||
|
||||
$detailView = new DetailView();
|
||||
$offset=0;
|
||||
if (isset($_REQUEST['offset']) or isset($_REQUEST['record'])) {
|
||||
$result = $detailView->processSugarBean("ROLE", $focus, $offset);
|
||||
if($result == null) {
|
||||
sugar_die($app_strings['ERROR_NO_RECORD']);
|
||||
}
|
||||
$focus=$result;
|
||||
} else {
|
||||
header("Location: index.php?module=Accounts&action=index");
|
||||
}
|
||||
echo get_module_title($mod_strings['LBL_MODULE_NAME'], $mod_strings['LBL_MODULE_NAME']. ": " . $focus->get_summary_text(), true);
|
||||
|
||||
|
||||
$GLOBALS['log']->info("Role detail view");
|
||||
|
||||
$xtpl=new XTemplate ('modules/Roles/DetailView.html');
|
||||
$xtpl->assign("MOD", $mod_strings);
|
||||
$xtpl->assign("APP", $app_strings);
|
||||
$xtpl->assign("GRIDLINE", $gridline);
|
||||
$xtpl->assign("PRINT_URL", "index.php?".$GLOBALS['request_string']);
|
||||
$xtpl->assign("ID", $focus->id);
|
||||
$xtpl->assign("RETURN_MODULE", "Roles");
|
||||
$xtpl->assign("RETURN_ACTION", "DetailView");
|
||||
$xtpl->assign("ACTION", "EditView");
|
||||
|
||||
$xtpl->assign("NAME", $focus->name);
|
||||
$xtpl->assign("DESCRIPTION", nl2br(url2html($focus->description)));
|
||||
|
||||
$detailView->processListNavigation($xtpl, "ROLE", $offset);
|
||||
|
||||
require_once("include/templates/TemplateGroupChooser.php");
|
||||
require_once("modules/MySettings/TabController.php");
|
||||
|
||||
$chooser = new TemplateGroupChooser();
|
||||
$controller = new TabController();
|
||||
$chooser->args['id'] = 'edit_tabs';
|
||||
|
||||
if(isset($_REQUEST['record']))
|
||||
{
|
||||
$chooser->args['values_array'][0] = $focus->query_modules(1);
|
||||
$chooser->args['values_array'][1] = $focus->query_modules(0);
|
||||
|
||||
foreach ($chooser->args['values_array'][0] as $key=>$value)
|
||||
{
|
||||
$chooser->args['values_array'][0][$value] = $app_list_strings['moduleList'][$value];
|
||||
unset($chooser->args['values_array'][0][$key]);
|
||||
}
|
||||
|
||||
foreach ($chooser->args['values_array'][1] as $key=>$value)
|
||||
{
|
||||
$chooser->args['values_array'][1][$value] = $app_list_strings['moduleList'][$value];
|
||||
unset($chooser->args['values_array'][1][$key]);
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$chooser->args['values_array'] = $controller->get_tabs_system();
|
||||
foreach ($chooser->args['values_array'][0] as $key=>$value)
|
||||
{
|
||||
$chooser->args['values_array'][0][$key] = $app_list_strings['moduleList'][$key];
|
||||
}
|
||||
foreach ($chooser->args['values_array'][1] as $key=>$value)
|
||||
{
|
||||
$chooser->args['values_array'][1][$key] = $app_list_strings['moduleList'][$key];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$chooser->args['left_name'] = 'display_tabs';
|
||||
$chooser->args['right_name'] = 'hide_tabs';
|
||||
$chooser->args['left_label'] = $mod_strings['LBL_ALLOWED_MODULES'];
|
||||
$chooser->args['right_label'] = $mod_strings['LBL_DISALLOWED_MODULES'];
|
||||
$chooser->args['title'] = $mod_strings['LBL_ASSIGN_MODULES'];
|
||||
|
||||
$chooser->args['disable'] = true;
|
||||
$xtpl->assign("TAB_CHOOSER", $chooser->display());
|
||||
|
||||
$xtpl->parse("main");
|
||||
$xtpl->out("main");
|
||||
|
||||
$sub_xtpl = $xtpl;
|
||||
$old_contents = ob_get_contents();
|
||||
ob_end_clean();
|
||||
ob_start();
|
||||
echo $old_contents;
|
||||
|
||||
require_once('include/SubPanel/SubPanelTiles.php');
|
||||
$subpanel = new SubPanelTiles($focus, 'Roles');
|
||||
echo $subpanel->display();
|
||||
?>
|
||||
144
modules/Roles/EditView.php
Executable file
144
modules/Roles/EditView.php
Executable file
@@ -0,0 +1,144 @@
|
||||
<?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('modules/Roles/Forms.php');
|
||||
|
||||
global $app_strings;
|
||||
global $app_list_strings;
|
||||
global $mod_strings;
|
||||
global $current_user;
|
||||
|
||||
$focus = new Role();
|
||||
|
||||
if(isset($_REQUEST['record'])) {
|
||||
$focus->retrieve($_REQUEST['record']);
|
||||
}
|
||||
if(isset($_REQUEST['isDuplicate']) && $_REQUEST['isDuplicate'] == '1') {
|
||||
$focus->id = "";
|
||||
unset($_REQUEST['record']);
|
||||
}
|
||||
global $theme;
|
||||
|
||||
|
||||
|
||||
$GLOBALS['log']->info("Role Edit View");
|
||||
echo get_module_title($mod_strings['LBL_MODULE_NAME'], $mod_strings['LBL_MODULE_NAME'].": ".$focus->name, true);
|
||||
$xtpl=new XTemplate ('modules/Roles/EditView.html');
|
||||
$xtpl->assign("MOD", $mod_strings);
|
||||
$xtpl->assign("APP", $app_strings);
|
||||
|
||||
if (isset($_REQUEST['return_module'])) $xtpl->assign("RETURN_MODULE", $_REQUEST['return_module']);
|
||||
if (isset($_REQUEST['return_action'])) $xtpl->assign("RETURN_ACTION", $_REQUEST['return_action']);
|
||||
if (isset($_REQUEST['return_id'])) $xtpl->assign("RETURN_ID", $_REQUEST['return_id']);
|
||||
// handle Create $module then Cancel
|
||||
if (empty($_REQUEST['return_id'])) {
|
||||
$xtpl->assign("RETURN_ACTION", 'index');
|
||||
}
|
||||
$xtpl->assign("PRINT_URL", "index.php?".$GLOBALS['request_string']);
|
||||
$xtpl->assign("JAVASCRIPT", get_set_focus_js() . get_chooser_js() . get_validate_record_js());
|
||||
$xtpl->assign("ID", $focus->id);
|
||||
$xtpl->assign("NAME", $focus->name);
|
||||
$xtpl->assign("DESCRIPTION", $focus->description);
|
||||
|
||||
require_once("include/templates/TemplateGroupChooser.php");
|
||||
require_once("modules/MySettings/TabController.php");
|
||||
|
||||
$chooser = new TemplateGroupChooser();
|
||||
$controller = new TabController();
|
||||
$chooser->args['id'] = 'edit_tabs';
|
||||
|
||||
if(isset($_REQUEST['record']))
|
||||
{
|
||||
$chooser->args['values_array'][0] = $focus->query_modules(1);
|
||||
$chooser->args['values_array'][1] = $focus->query_modules(0);
|
||||
|
||||
foreach ($chooser->args['values_array'][0] as $key=>$value)
|
||||
{
|
||||
$chooser->args['values_array'][0][$value] = $app_list_strings['moduleList'][$value];
|
||||
unset($chooser->args['values_array'][0][$key]);
|
||||
}
|
||||
|
||||
foreach ($chooser->args['values_array'][1] as $key=>$value)
|
||||
{
|
||||
$chooser->args['values_array'][1][$value] = $app_list_strings['moduleList'][$value];
|
||||
unset($chooser->args['values_array'][1][$key]);
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$chooser->args['values_array'] = $controller->get_tabs_system();
|
||||
foreach ($chooser->args['values_array'][0] as $key=>$value)
|
||||
{
|
||||
$chooser->args['values_array'][0][$key] = $app_list_strings['moduleList'][$key];
|
||||
}
|
||||
foreach ($chooser->args['values_array'][1] as $key=>$value)
|
||||
{
|
||||
$chooser->args['values_array'][1][$key] = $app_list_strings['moduleList'][$key];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$chooser->args['left_name'] = 'display_tabs';
|
||||
$chooser->args['right_name'] = 'hide_tabs';
|
||||
$chooser->args['left_label'] = $mod_strings['LBL_ALLOWED_MODULES'];
|
||||
$chooser->args['right_label'] = $mod_strings['LBL_DISALLOWED_MODULES'];
|
||||
$chooser->args['title'] = $mod_strings['LBL_ASSIGN_MODULES'];
|
||||
|
||||
$xtpl->assign("TAB_CHOOSER", $chooser->display());
|
||||
|
||||
$xtpl->parse("main");
|
||||
$xtpl->out("main");
|
||||
|
||||
$javascript = new javascript();
|
||||
$javascript->setFormName('EditView');
|
||||
$javascript->setSugarBean($focus);
|
||||
$javascript->addAllFields('');
|
||||
echo $javascript->getScript();
|
||||
|
||||
|
||||
?>
|
||||
127
modules/Roles/Forms.php
Executable file
127
modules/Roles/Forms.php
Executable file
@@ -0,0 +1,127 @@
|
||||
<?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 a variety of utility functions specific to this module.
|
||||
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
|
||||
* All Rights Reserved.
|
||||
* Contributor(s): ______________________________________..
|
||||
********************************************************************************/
|
||||
|
||||
|
||||
function get_validate_record_js () {
|
||||
global $mod_strings;
|
||||
global $app_strings;
|
||||
|
||||
$err_missing_required_fields = $app_strings['ERR_MISSING_REQUIRED_FIELDS'];
|
||||
|
||||
$the_script = <<<EOQ
|
||||
|
||||
<script type="text/javascript" language="Javascript">
|
||||
<!-- to hide script contents from old browsers
|
||||
|
||||
function trim(s) {
|
||||
while (s.substring(0,1) == " ") {
|
||||
s = s.substring(1, s.length);
|
||||
}
|
||||
while (s.substring(s.length-1, s.length) == ' ') {
|
||||
s = s.substring(0,s.length-1);
|
||||
}
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
function verify_data(form) {
|
||||
var isError = false;
|
||||
var errorMessage = "";
|
||||
|
||||
if (isError == true) {
|
||||
alert("$err_missing_required_fields" + errorMessage);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// end hiding contents from old browsers -->
|
||||
</script>
|
||||
|
||||
EOQ;
|
||||
|
||||
return $the_script;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
function get_chooser_js()
|
||||
{
|
||||
$the_script = <<<EOQ
|
||||
|
||||
<script type="text/javascript" language="Javascript">
|
||||
<!-- to hide script contents from old browsers
|
||||
|
||||
function set_chooser()
|
||||
{
|
||||
|
||||
var display_tabs_def = '';
|
||||
var hide_tabs_def = '';
|
||||
|
||||
for(i=0; i < object_refs['display_tabs'].options.length ;i++)
|
||||
{
|
||||
display_tabs_def += object_refs['display_tabs'].options[i].value+":::";
|
||||
}
|
||||
|
||||
for(i=0; i < object_refs['hide_tabs'].options.length ;i++)
|
||||
{
|
||||
hide_tabs_def += object_refs['hide_tabs'].options[i].value+":::";
|
||||
}
|
||||
|
||||
|
||||
document.EditView.display_tabs_def.value = display_tabs_def;
|
||||
document.EditView.hide_tabs_def.value = hide_tabs_def;
|
||||
|
||||
|
||||
}
|
||||
// end hiding contents from old browsers -->
|
||||
</script>
|
||||
EOQ;
|
||||
|
||||
return $the_script;
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
49
modules/Roles/Menu.php
Executable file
49
modules/Roles/Menu.php
Executable 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;
|
||||
|
||||
$module_menu = Array(
|
||||
|
||||
Array("index.php?module=Roles&action=EditView&return_module=Roles&return_action=index", $mod_strings['LNK_NEW_ROLE'],"CreateRoles"),
|
||||
Array("index.php?module=Roles&action=index", $mod_strings['LNK_ROLES'],"Roles"),
|
||||
|
||||
);
|
||||
|
||||
?>
|
||||
201
modules/Roles/Role.php
Executable file
201
modules/Roles/Role.php
Executable file
@@ -0,0 +1,201 @@
|
||||
<?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:
|
||||
********************************************************************************/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
class Role extends SugarBean {
|
||||
|
||||
var $field_name_map;
|
||||
|
||||
var $id;
|
||||
var $deleted;
|
||||
var $date_entered;
|
||||
var $date_modified;
|
||||
var $modified_user_id;
|
||||
var $created_by;
|
||||
var $name;
|
||||
var $description;
|
||||
var $modules;
|
||||
var $disable_row_level_security = true;
|
||||
|
||||
var $table_name = 'roles';
|
||||
var $rel_module_table = 'roles_modules';
|
||||
var $object_name = 'Role';
|
||||
var $module_dir = 'Roles';
|
||||
var $new_schema = true;
|
||||
|
||||
function Role()
|
||||
{
|
||||
parent::SugarBean();
|
||||
}
|
||||
|
||||
function get_summary_text()
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
function create_export_query($order_by, $where)
|
||||
{
|
||||
return $this->create_new_list_query($order_by, $where);
|
||||
}
|
||||
|
||||
function query_modules($allow = 1)
|
||||
{
|
||||
$query = "SELECT module_id FROM roles_modules WHERE ";
|
||||
$query .= "role_id = '$this->id' AND allow = '$allow' AND deleted=0";
|
||||
$result = $this->db->query($query);
|
||||
|
||||
$return_array = array();
|
||||
|
||||
while($row = $this->db->fetchByAssoc($result))
|
||||
{
|
||||
array_push($return_array, $row['module_id']);
|
||||
}
|
||||
|
||||
return $return_array;
|
||||
}
|
||||
function set_module_relationship($role_id, &$mod_ids, $allow)
|
||||
{
|
||||
foreach($mod_ids as $mod_id)
|
||||
{
|
||||
if($mod_id != '')
|
||||
$this->set_relationship('roles_modules', array( 'module_id'=>$mod_id, 'role_id'=>$role_id, 'allow'=>$allow ));
|
||||
}
|
||||
}
|
||||
|
||||
function clear_module_relationship($role_id)
|
||||
{
|
||||
$query = "DELETE FROM roles_modules WHERE role_id='$role_id'";
|
||||
$this->db->query($query);
|
||||
}
|
||||
|
||||
function set_user_relationship($role_id, &$user_ids)
|
||||
{
|
||||
foreach($user_ids as $user_id)
|
||||
{
|
||||
if($user_id != '')
|
||||
$this->set_relationship('roles_users', array( 'user_id'=>$user_id, 'role_id'=>$role_id ));
|
||||
}
|
||||
}
|
||||
|
||||
function clear_user_relationship($role_id, $user_id)
|
||||
{
|
||||
$query = "DELETE FROM roles_users WHERE role_id='$role_id' AND user_id='$user_id'";
|
||||
$this->db->query($query);
|
||||
}
|
||||
|
||||
function query_user_allowed_modules($user_id)
|
||||
{
|
||||
$userArray = array();
|
||||
global $app_list_strings;
|
||||
|
||||
|
||||
|
||||
$sql = "SELECT role_id FROM roles_users WHERE user_id='$user_id'";
|
||||
|
||||
$result = $this->db->query($sql);
|
||||
|
||||
while($row = $this->db->fetchByAssoc($result))
|
||||
{
|
||||
$role_id = $row["role_id"];
|
||||
$sql = "SELECT module_id FROM roles_modules WHERE role_id='$role_id' AND allow='1'";
|
||||
$res = $this->db->query($sql);
|
||||
|
||||
while($col = $this->db->fetchByAssoc($res))
|
||||
{
|
||||
$key = $col['module_id'];
|
||||
if(!(array_key_exists($key, $userArray)))
|
||||
{
|
||||
$userArray[$key] = $app_list_strings['moduleList'][$key];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $userArray;
|
||||
}
|
||||
|
||||
function query_user_disallowed_modules($user_id, &$allowed)
|
||||
{
|
||||
global $moduleList;
|
||||
|
||||
$returnArray = array();
|
||||
|
||||
foreach($moduleList as $key=>$val)
|
||||
{
|
||||
if(array_key_exists($val, $allowed))
|
||||
continue;
|
||||
$returnArray[$val] = $val;
|
||||
}
|
||||
|
||||
return $returnArray;
|
||||
|
||||
}
|
||||
|
||||
function get_users()
|
||||
{
|
||||
// First, get the list of IDs.
|
||||
|
||||
|
||||
|
||||
$query = "SELECT user_id as id FROM roles_users WHERE role_id='$this->id' AND deleted=0";
|
||||
|
||||
return $this->build_related_list($query, new User());
|
||||
}
|
||||
|
||||
function check_user_role_count($user_id)
|
||||
{
|
||||
$query = "SELECT count(*) AS num FROM roles_users WHERE ";
|
||||
$query .= "user_id='$user_id' AND deleted=0";
|
||||
$result = $this->db->query($query);
|
||||
|
||||
$row = $this->db->fetchByAssoc($result);
|
||||
|
||||
return $row['num'];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
89
modules/Roles/Save.php
Executable file
89
modules/Roles/Save.php
Executable file
@@ -0,0 +1,89 @@
|
||||
<?php
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
/*********************************************************************************
|
||||
* SugarCRM is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero General Public License version 3 as published by the
|
||||
* Free Software Foundation with the addition of the following permission added
|
||||
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
|
||||
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
|
||||
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License along with
|
||||
* this program; if not, see http://www.gnu.org/licenses or write to the Free
|
||||
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA.
|
||||
*
|
||||
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
|
||||
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "Powered by
|
||||
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
|
||||
* technical reasons, the Appropriate Legal Notices must display the words
|
||||
* "Powered by SugarCRM".
|
||||
********************************************************************************/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$focus = new Role();
|
||||
|
||||
$tabs_def = urldecode($_REQUEST['display_tabs_def']);
|
||||
$tabs_hide = urldecode($_REQUEST['hide_tabs_def']);
|
||||
|
||||
$allow_modules = explode(':::', $tabs_def);
|
||||
$disallow_modules = explode(':::', $tabs_hide);
|
||||
|
||||
$focus->retrieve($_POST['record']);
|
||||
print_r($_POST);
|
||||
unset($_POST['id']);
|
||||
|
||||
|
||||
foreach($focus->column_fields as $field)
|
||||
{
|
||||
if(isset($_POST[$field]))
|
||||
{
|
||||
$value = $_POST[$field];
|
||||
$focus->$field = $value;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$check_notify = FALSE;
|
||||
|
||||
$focus->save($check_notify);
|
||||
$return_id = $focus->id;
|
||||
|
||||
$focus->clear_module_relationship($return_id);
|
||||
$focus->set_module_relationship($return_id, $allow_modules, 1);
|
||||
$focus->set_module_relationship($return_id, $disallow_modules, 0);
|
||||
|
||||
|
||||
|
||||
if(isset($_POST['return_module']) && $_POST['return_module'] != "") $return_module = $_POST['return_module'];
|
||||
else $return_module = "Roles";
|
||||
if(isset($_POST['return_action']) && $_POST['return_action'] != "") $return_action = $_POST['return_action'];
|
||||
else $return_action = "DetailView";
|
||||
if(isset($_POST['return_id']) && $_POST['return_id'] != "") $return_id = $_POST['return_id'];
|
||||
|
||||
$GLOBALS['log']->debug("Saved record with id of ".$return_id);
|
||||
header("Location: index.php?action=$return_action&module=$return_module&record=$return_id");
|
||||
|
||||
|
||||
?>
|
||||
68
modules/Roles/SaveUserRelationship.php
Executable file
68
modules/Roles/SaveUserRelationship.php
Executable file
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
/*********************************************************************************
|
||||
* SugarCRM is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero General Public License version 3 as published by the
|
||||
* Free Software Foundation with the addition of the following permission added
|
||||
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
|
||||
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
|
||||
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License along with
|
||||
* this program; if not, see http://www.gnu.org/licenses or write to the Free
|
||||
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA.
|
||||
*
|
||||
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
|
||||
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "Powered by
|
||||
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
|
||||
* technical reasons, the Appropriate Legal Notices must display the words
|
||||
* "Powered by SugarCRM".
|
||||
********************************************************************************/
|
||||
/*********************************************************************************
|
||||
|
||||
* Description: TODO: To be written.
|
||||
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
|
||||
* All Rights Reserved.
|
||||
* Contributor(s): ______________________________________..
|
||||
********************************************************************************/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$focus = new Role();
|
||||
|
||||
$focus->retrieve($_REQUEST['record']);
|
||||
|
||||
$focus->set_user_relationship($focus->id, $_REQUEST['mass']);
|
||||
|
||||
|
||||
$header_URL = $sugar_config["site_url"] . "/index.php?action=PopupUsers&form=UsersForm&module=Users&record={$_REQUEST['record']}";
|
||||
$GLOBALS['log']->debug("about to post header URL of: $header_URL");
|
||||
|
||||
echo "<script language=javascript>\n";
|
||||
echo "<!-- //\n";
|
||||
echo " window.opener.location.reload();\n";
|
||||
echo " window.location=\"{$header_URL}\";\n";
|
||||
echo "// -->\n";
|
||||
echo "</script>";
|
||||
|
||||
?>
|
||||
|
||||
98
modules/Roles/SubPanelViewUsers.php
Executable file
98
modules/Roles/SubPanelViewUsers.php
Executable 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".
|
||||
********************************************************************************/
|
||||
/*********************************************************************************
|
||||
|
||||
* Description: TODO: To be written.
|
||||
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
|
||||
* All Rights Reserved.
|
||||
* Contributor(s): ______________________________________..
|
||||
********************************************************************************/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
global $app_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, 'Users');
|
||||
|
||||
global $currentModule;
|
||||
|
||||
global $theme;
|
||||
global $focus;
|
||||
global $action;
|
||||
|
||||
|
||||
|
||||
|
||||
// focus_list is the means of passing data to a SubPanelView.
|
||||
global $focus_list;
|
||||
|
||||
$button = "<form action='index.php' method='post' name='UsersForm' id='UsersForm'>\n";
|
||||
$button .= "<input type='hidden' name='module' value='Users'>\n";
|
||||
if ($currentModule == 'Roles') {
|
||||
$button .= "<input type='hidden' name='record' value='$focus->id'>\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 type='hidden' name='report_module'>\n";
|
||||
$button .= "<input type='hidden' name='id'>\n";
|
||||
|
||||
if ($currentModule == 'Roles')
|
||||
$button .= "<input title='".$app_strings['LBL_SELECT_BUTTON_TITLE']." ' accessKey='".$app_strings['LBL_SELECT_BUTTON_KEY']."' type='button' class='button' value=' ".$app_strings['LBL_SELECT_BUTTON_LABEL']." ' name='button' LANGUAGE=javascript onclick='window.open(\"index.php?module=Users&action=PopupUsers&html=Popup_Users_picker&form=UsersForm&record=".$focus->id."&form_submit=true&query=true\",\"new\",\"width=600,height=400,resizable=1,scrollbars=1\");'>\n";
|
||||
|
||||
$button .= "</form>\n";
|
||||
|
||||
|
||||
|
||||
$ListView = new ListView();
|
||||
$ListView->initNewXTemplate('modules/Roles/SubPanelViewUsers.html', $current_module_strings);
|
||||
|
||||
$ListView->xTemplateAssign("ROLE_RECORD", $focus->id);
|
||||
$ListView->xTemplateAssign("EDIT_INLINE_PNG", SugarThemeRegistry::current()->getImage('edit_inline','align="absmiddle" alt="'.$app_strings['LNK_EDIT'].'" border="0"'));
|
||||
$ListView->xTemplateAssign("REMOVE_INLINE_PNG", SugarThemeRegistry::current()->getImage('delete_inline','align="absmiddle" alt="'.$app_strings['LNK_REMOVE'].'" border="0"'));
|
||||
|
||||
$ListView->xTemplateAssign("RETURN_URL", "&return_module=".$currentModule."&return_action=DetailView&return_id=".$focus->id);
|
||||
$ListView->setHeaderTitle($current_module_strings['LBL_MODULE_NAME'] );
|
||||
$ListView->setQuery("", "", "user_name", "USER");
|
||||
$ListView->setHeaderText($button);
|
||||
$ListView->processListView($focus_list, "main", "USER");
|
||||
|
||||
?>
|
||||
56
modules/Roles/field_arrays.php
Executable file
56
modules/Roles/field_arrays.php
Executable file
@@ -0,0 +1,56 @@
|
||||
<?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['Role'] = array ('column_fields' => array (
|
||||
'id', 'date_entered', 'date_modified',
|
||||
'modified_user_id', 'created_by', 'name',
|
||||
'description',
|
||||
),
|
||||
'list_fields' => array (
|
||||
'id','name','description',
|
||||
),
|
||||
'required_fields' => array (
|
||||
'name'=>1,
|
||||
),
|
||||
);
|
||||
?>
|
||||
59
modules/Roles/language/en_us.lang.php
Executable file
59
modules/Roles/language/en_us.lang.php
Executable file
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
/*********************************************************************************
|
||||
* SugarCRM is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero General Public License version 3 as published by the
|
||||
* Free Software Foundation with the addition of the following permission added
|
||||
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
|
||||
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
|
||||
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License along with
|
||||
* this program; if not, see http://www.gnu.org/licenses or write to the Free
|
||||
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA.
|
||||
*
|
||||
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
|
||||
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "Powered by
|
||||
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
|
||||
* technical reasons, the Appropriate Legal Notices must display the words
|
||||
* "Powered by SugarCRM".
|
||||
********************************************************************************/
|
||||
|
||||
|
||||
|
||||
$mod_strings = array (
|
||||
'LBL_ROLE' => 'Role: ',
|
||||
'LBL_LANGUAGE' => 'Language: ',
|
||||
'LBL_MODULE_NAME' => 'Roles',
|
||||
'LBL_MODULE_TITLE' => 'Roles: Home',
|
||||
'LBL_SEARCH_FORM_TITLE' => 'Role Search',
|
||||
'LBL_LIST_FORM_TITLE' => 'Role List',
|
||||
'LNK_NEW_ROLE' => 'Create Role',
|
||||
'LNK_ROLES' => 'Roles',
|
||||
'LBL_NAME' => 'Name: ',
|
||||
'LBL_DESCRIPTION' => 'Description: ',
|
||||
'LBL_ALLOWED_MODULES' => 'Allowed Modules: ',
|
||||
'LBL_DISALLOWED_MODULES' => 'Disallowed Modules: ',
|
||||
'LBL_ASSIGN_MODULES' => 'Edit Modules: ',
|
||||
'LBL_DEFAULT_SUBPANEL_TITLE' => 'Roles',
|
||||
'LBL_USERS'=>'Users',
|
||||
|
||||
'LBL_USERS_SUBPANEL_TITLE' => 'Users',
|
||||
);
|
||||
?>
|
||||
54
modules/Roles/language/pl_pl.lang.php
Executable file
54
modules/Roles/language/pl_pl.lang.php
Executable file
@@ -0,0 +1,54 @@
|
||||
<?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.php,v for SugarCRM 4.5.1-->>
|
||||
* Translator: Krzysztof Morawski
|
||||
* All Rights Reserved.
|
||||
* Any bugs report welcome: krzysiek<at>kmmgroup<dot>pl
|
||||
* Contributor(s): ______________________________________..
|
||||
********************************************************************************/
|
||||
//** W 5.2 nie istnieje **//
|
||||
|
||||
|
||||
$mod_strings = array (
|
||||
'LBL_ROLE' => '>Zależności: ',
|
||||
'LBL_LANGUAGE' => 'Język: ',
|
||||
'LBL_MODULE_NAME' => 'Zależności',
|
||||
'LBL_MODULE_TITLE' => 'Zależności: Strona główna',
|
||||
'LBL_SEARCH_FORM_TITLE' => 'Szukaj zależności',
|
||||
'LBL_LIST_FORM_TITLE' => 'Lista zależności',
|
||||
'LNK_NEW_ROLE' => 'Utwórz zależność',
|
||||
'LNK_ROLES' => 'Zależności',
|
||||
'LBL_NAME' => 'Nazwa: ',
|
||||
'LBL_DESCRIPTION' => 'Opis: ',
|
||||
'LBL_ALLOWED_MODULES' => 'Dozwolone moduły: ',
|
||||
'LBL_DISALLOWED_MODULES' => 'Niedozwolone moduły: ',
|
||||
'LBL_ASSIGN_MODULES' => 'Edytuj moduły: ',
|
||||
'LBL_DEFAULT_SUBPANEL_TITLE' => 'Zależności',
|
||||
'LBL_USERS'=>'Użytkownicy',
|
||||
|
||||
'LBL_USERS_SUBPANEL_TITLE' => 'Użytkownicy',
|
||||
);
|
||||
?>
|
||||
41
modules/Roles/metadata/SearchFields.php
Executable file
41
modules/Roles/metadata/SearchFields.php
Executable 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['Roles'] =
|
||||
array (
|
||||
'name' => array( 'query_type'=>'default'),
|
||||
);
|
||||
?>
|
||||
50
modules/Roles/metadata/listviewdefs.php
Executable file
50
modules/Roles/metadata/listviewdefs.php
Executable 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['Roles'] = array(
|
||||
'NAME' => array(
|
||||
'width' => '20',
|
||||
'label' => 'LBL_NAME',
|
||||
'link' => true,
|
||||
'default' => true),
|
||||
'DESCRIPTION' => array(
|
||||
'width' => '80',
|
||||
'label' => 'LBL_DESCRIPTION',
|
||||
'default' => true),
|
||||
);
|
||||
54
modules/Roles/metadata/searchdefs.php
Executable file
54
modules/Roles/metadata/searchdefs.php
Executable 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['Roles'] = 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(),
|
||||
),
|
||||
);
|
||||
?>
|
||||
58
modules/Roles/metadata/subpaneldefs.php
Executable file
58
modules/Roles/metadata/subpaneldefs.php
Executable 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".
|
||||
********************************************************************************/
|
||||
|
||||
|
||||
|
||||
$layout_defs['Roles'] = array(
|
||||
// list of what Subpanels to show in the DetailView
|
||||
'subpanel_setup' => array(
|
||||
'users' => array(
|
||||
'top_buttons' => array(
|
||||
array('widget_class' => 'SubPanelTopSelectButton', 'popup_module' => 'Users'),
|
||||
),
|
||||
'order' => 10,
|
||||
'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',
|
||||
),
|
||||
),
|
||||
);
|
||||
?>
|
||||
60
modules/Roles/metadata/subpanels/default.php
Executable file
60
modules/Roles/metadata/subpanels/default.php
Executable file
@@ -0,0 +1,60 @@
|
||||
<?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',
|
||||
'widget_class' => 'SubPanelDetailViewLink',
|
||||
'width' => '9999%',
|
||||
),
|
||||
'description'=>array(
|
||||
'vname' => 'LBL_DESCRIPTION',
|
||||
'width' => '9999%',
|
||||
),
|
||||
),
|
||||
);
|
||||
?>
|
||||
129
modules/Roles/vardefs.php
Executable file
129
modules/Roles/vardefs.php
Executable file
@@ -0,0 +1,129 @@
|
||||
<?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['Role'] = array('table' => 'roles'
|
||||
,'fields' => array (
|
||||
'id' =>
|
||||
array (
|
||||
'name' => 'id',
|
||||
'vname' => 'LBL_ID',
|
||||
'required'=>true,
|
||||
'type' => 'id',
|
||||
'reportable'=>false,
|
||||
),
|
||||
'date_entered' =>
|
||||
array (
|
||||
'name' => 'date_entered',
|
||||
'vname' => 'LBL_DATE_ENTERED',
|
||||
'type' => 'datetime',
|
||||
'required'=>true
|
||||
),
|
||||
'date_modified' =>
|
||||
array (
|
||||
'name' => 'date_modified',
|
||||
'vname' => 'LBL_DATE_MODIFIED',
|
||||
'type' => 'datetime',
|
||||
'required'=>true,
|
||||
),
|
||||
'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,
|
||||
),
|
||||
'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,
|
||||
),
|
||||
'name' =>
|
||||
array (
|
||||
'name' => 'name',
|
||||
'type' => 'varchar',
|
||||
'vname' => 'LBL_NAME',
|
||||
'len' => 150,
|
||||
'importable' => 'required',
|
||||
),
|
||||
'description' =>
|
||||
array (
|
||||
'name' => 'description',
|
||||
'vname' => 'LBL_DESCRIPTION',
|
||||
'type' => 'text',
|
||||
),
|
||||
'modules' =>
|
||||
array (
|
||||
'name' => 'modules',
|
||||
'vname' => 'LBL_MODULES',
|
||||
'type' => 'text',
|
||||
),
|
||||
'deleted' =>
|
||||
array (
|
||||
'name' => 'deleted',
|
||||
'vname' => 'LBL_DELETED',
|
||||
'type' => 'bool',
|
||||
'reportable'=>false,
|
||||
),
|
||||
'users' =>
|
||||
array (
|
||||
'name' => 'users',
|
||||
'type' => 'link',
|
||||
'relationship' => 'roles_users',
|
||||
'source'=>'non-db',
|
||||
'vname'=>'LBL_USERS',
|
||||
),
|
||||
)
|
||||
, 'indices' => array (
|
||||
array('name' =>'rolespk', 'type' =>'primary', 'fields'=>array('id')),
|
||||
array('name' =>'idx_role_id_del', 'type' =>'index', 'fields'=>array('id', 'deleted')),
|
||||
)
|
||||
|
||||
);
|
||||
?>
|
||||
47
modules/Roles/views/view.list.php
Executable file
47
modules/Roles/views/view.list.php
Executable file
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
/*********************************************************************************
|
||||
* SugarCRM is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero General Public License version 3 as published by the
|
||||
* Free Software Foundation with the addition of the following permission added
|
||||
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
|
||||
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
|
||||
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License along with
|
||||
* this program; if not, see http://www.gnu.org/licenses or write to the Free
|
||||
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA.
|
||||
*
|
||||
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
|
||||
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "Powered by
|
||||
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
|
||||
* technical reasons, the Appropriate Legal Notices must display the words
|
||||
* "Powered by SugarCRM".
|
||||
********************************************************************************/
|
||||
|
||||
require_once('include/MVC/View/views/view.list.php');
|
||||
|
||||
class RolesViewList extends ViewList
|
||||
{
|
||||
public function preDisplay()
|
||||
{
|
||||
$this->lv = new ListViewSmarty();
|
||||
$this->lv->showMassupdateFields = false;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user