1
|
|
|
<?php |
2
|
|
|
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
3
|
|
|
|
4
|
|
|
require_once('XTemplate/xtpl.php'); |
5
|
|
|
require_once('modules/SecurityGroups/SecurityGroupUserRelationship.php'); |
6
|
|
|
require_once('modules/SecurityGroups/Forms.php'); |
7
|
|
|
require_once('include/utils.php'); |
8
|
|
|
|
9
|
|
|
global $app_strings; |
10
|
|
|
global $app_list_strings; |
11
|
|
|
global $mod_strings; |
12
|
|
|
global $sugar_version, $sugar_config; |
13
|
|
|
|
14
|
|
|
$focus = new SecurityGroupUserRelationship(); |
15
|
|
|
|
16
|
|
|
if(isset($_REQUEST['record'])) { |
17
|
|
|
$focus->retrieve($_REQUEST['record']); |
18
|
|
|
} |
19
|
|
|
|
20
|
|
|
if(isset($_REQUEST['isDuplicate']) && $_REQUEST['isDuplicate'] == 'true') { |
21
|
|
|
$focus->id = ""; |
22
|
|
|
} |
23
|
|
|
|
24
|
|
|
// Prepopulate either side of the relationship if passed in. |
25
|
|
|
safe_map('user_name', $focus); |
26
|
|
|
safe_map('user_id', $focus); |
27
|
|
|
safe_map('securitygroup_name', $focus); |
28
|
|
|
safe_map('securitygroup_id', $focus); |
29
|
|
|
safe_map('noninheritable', $focus); |
30
|
|
|
safe_map('primary_group', $focus); |
31
|
|
|
|
32
|
|
|
|
33
|
|
|
$theme_path="themes/".$theme."/"; |
34
|
|
|
$image_path=$theme_path."images/"; |
35
|
|
|
require_once($theme_path.'layout_utils.php'); |
36
|
|
|
|
37
|
|
|
$GLOBALS['log']->info("SecurityGroup User relationship"); |
38
|
|
|
|
39
|
|
|
$json = getJSONobj(); |
40
|
|
|
require_once('include/QuickSearchDefaults.php'); |
41
|
|
|
$qsd = new QuickSearchDefaults(); |
42
|
|
|
$sqs_objects = array('user_name' => $qsd->getQSParent()); |
43
|
|
|
$sqs_objects['user_name']['populate_list'] = array('user_name', 'user_id'); |
44
|
|
|
$quicksearch_js = $qsd->getQSScripts(); |
45
|
|
|
$quicksearch_js .= '<script type="text/javascript" language="javascript">sqs_objects = ' . $json->encode($sqs_objects) . '</script>'; |
46
|
|
|
echo $quicksearch_js; |
47
|
|
|
|
48
|
|
|
$xtpl=new XTemplate ('modules/SecurityGroups/SecurityGroupUserRelationshipEdit.html'); |
49
|
|
|
$xtpl->assign("MOD", $mod_strings); |
50
|
|
|
$xtpl->assign("APP", $app_strings); |
51
|
|
|
|
52
|
|
|
$xtpl->assign("RETURN_URL", "&return_module=$currentModule&return_action=DetailView&return_id=$focus->id"); |
53
|
|
|
$xtpl->assign("RETURN_MODULE", $_REQUEST['return_module']); |
54
|
|
|
$xtpl->assign("RETURN_ACTION", $_REQUEST['return_action']); |
55
|
|
|
$xtpl->assign("RETURN_ID", $_REQUEST['return_id']); |
56
|
|
|
$xtpl->assign("THEME", $theme); |
57
|
|
|
$xtpl->assign("IMAGE_PATH", $image_path);$xtpl->assign("PRINT_URL", "index.php?".$GLOBALS['request_string']); |
58
|
|
|
$xtpl->assign("ID", $focus->id); |
59
|
|
|
$xtpl->assign("SECURITYGROUP",$securityGroup = Array("NAME" => $focus->securitygroup_name, "ID" => $focus->securitygroup_id)); |
60
|
|
|
$xtpl->assign("USER",$user = Array("NAME" => $focus->user_name, "ID" => $focus->user_id)); |
61
|
|
|
|
62
|
|
|
echo "\n<p>\n"; |
63
|
|
|
echo get_module_title($mod_strings['LBL_MODULE_NAME'], $mod_strings['LBL_SECURITYGROUP_USER_FORM_TITLE'].": ".$securityGroup['NAME'] . " - ". $user['NAME'], true); |
|
|
|
|
64
|
|
|
echo "\n</p>\n"; |
65
|
|
|
|
66
|
|
|
// noninheritable |
67
|
|
|
$noninheritable = ''; |
68
|
|
|
if(isset($focus->noninheritable) && $focus->noninheritable == true) { |
69
|
|
|
$noninheritable = 'CHECKED'; |
70
|
|
|
} |
71
|
|
|
$xtpl->assign('noninheritable', $noninheritable); |
72
|
|
|
|
73
|
|
|
// primary_group |
74
|
|
|
$primary_group = ''; |
75
|
|
|
if(isset($focus->primary_group) && $focus->primary_group == true) { |
76
|
|
|
$primary_group = 'CHECKED'; |
77
|
|
|
} |
78
|
|
|
$xtpl->assign('primary_group', $primary_group); |
79
|
|
|
|
80
|
|
|
$xtpl->parse("main"); |
81
|
|
|
|
82
|
|
|
$xtpl->out("main"); |
83
|
|
|
|
84
|
|
|
require_once('include/javascript/javascript.php'); |
85
|
|
|
$javascript = new javascript(); |
86
|
|
|
$javascript->setFormName('EditView'); |
87
|
|
|
$javascript->setSugarBean($focus); |
88
|
|
|
$javascript->addToValidateBinaryDependency('user_name', 'alpha', $app_strings['ERR_SQS_NO_MATCH_FIELD'] . $mod_strings['LBL_USER_NAME'], 'false', '', 'user_id'); |
89
|
|
|
echo $javascript->getScript(); |
90
|
|
|
|
91
|
|
|
|
92
|
|
|
?> |
93
|
|
|
|
This function has been deprecated. The supplier of the file has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the function will be removed from the class and what other function to use instead.