@@ -4,11 +4,11 @@ discard block |
||
4 | 4 | |
5 | 5 | class Jjwg_MapsViewGeocoded_Counts extends SugarView { |
6 | 6 | |
7 | - function Jjwg_MapsViewGeocoded_Counts() { |
|
8 | - parent::SugarView(); |
|
9 | - } |
|
7 | + function Jjwg_MapsViewGeocoded_Counts() { |
|
8 | + parent::SugarView(); |
|
9 | + } |
|
10 | 10 | |
11 | - function display() { |
|
11 | + function display() { |
|
12 | 12 | |
13 | 13 | echo '<div class="moduleTitle"><h2>'.$GLOBALS['mod_strings']['LBL_GEOCODED_COUNTS'].'</h2><div class="clear"></div></div>'; |
14 | 14 | echo '<div class="clear"></div>'; |
@@ -17,14 +17,14 @@ discard block |
||
17 | 17 | |
18 | 18 | // Display last status code, if set. |
19 | 19 | if (!empty($_REQUEST['last_status']) && preg_match('/[A-Z\_]/', $_REQUEST['last_status'])) { |
20 | - echo '<div><b>'.$GLOBALS['mod_strings']['LBL_MAP_LAST_STATUS'].': '.$_REQUEST['last_status'].'</b></div>'; |
|
21 | - echo '<br /><br />'; |
|
20 | + echo '<div><b>'.$GLOBALS['mod_strings']['LBL_MAP_LAST_STATUS'].': '.$_REQUEST['last_status'].'</b></div>'; |
|
21 | + echo '<br /><br />'; |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | echo '<table cellspacing="0" cellpadding="0" border="0" class="list view" style="width: 50% !important;"><tbody>'; |
25 | 25 | echo '<tr><th>'.$GLOBALS['mod_strings']['LBL_MODULE_HEADING'].'</th>'; |
26 | 26 | foreach ($this->bean->geocoded_headings as $heading) { |
27 | - echo '<th>'.$heading.'</th>'; |
|
27 | + echo '<th>'.$heading.'</th>'; |
|
28 | 28 | } |
29 | 29 | echo '<th>'.$GLOBALS['mod_strings']['LBL_MODULE_TOTAL_HEADING'].'</th>'; |
30 | 30 | echo '<th>'.$GLOBALS['mod_strings']['LBL_MODULE_RESET_HEADING'].'</th>'; |
@@ -32,17 +32,17 @@ discard block |
||
32 | 32 | |
33 | 33 | foreach ($GLOBALS['jjwg_config']['valid_geocode_modules'] as $module) { |
34 | 34 | |
35 | - $geocode_url = './index.php?module=jjwg_Maps&action=geocode_addresses&display_module='.$module; |
|
36 | - $reset_url = './index.php?module=jjwg_Maps&action=reset_geocoding&display_module='.$module; |
|
35 | + $geocode_url = './index.php?module=jjwg_Maps&action=geocode_addresses&display_module='.$module; |
|
36 | + $reset_url = './index.php?module=jjwg_Maps&action=reset_geocoding&display_module='.$module; |
|
37 | 37 | |
38 | - echo '<tr>'; |
|
39 | - echo '<td><strong><a href="'.htmlspecialchars($geocode_url).'">'.$GLOBALS['app_list_strings']['moduleList'][$module].'</a></strong></td>'; |
|
40 | - foreach ($this->bean->geocoded_headings as $heading) { |
|
38 | + echo '<tr>'; |
|
39 | + echo '<td><strong><a href="'.htmlspecialchars($geocode_url).'">'.$GLOBALS['app_list_strings']['moduleList'][$module].'</a></strong></td>'; |
|
40 | + foreach ($this->bean->geocoded_headings as $heading) { |
|
41 | 41 | echo '<td>'.$this->bean->geocoded_counts[$module][$heading].'</td>'; |
42 | - } |
|
43 | - echo '<td><strong>'.$this->bean->geocoded_module_totals[$module].'</strong></td>'; |
|
44 | - echo '<td><strong><a href="'.htmlspecialchars($reset_url).'">'.$GLOBALS['mod_strings']['LBL_MODULE_RESET_HEADING'].'</a.</strong></td>'; |
|
45 | - echo '</tr>'."\n"; |
|
42 | + } |
|
43 | + echo '<td><strong>'.$this->bean->geocoded_module_totals[$module].'</strong></td>'; |
|
44 | + echo '<td><strong><a href="'.htmlspecialchars($reset_url).'">'.$GLOBALS['mod_strings']['LBL_MODULE_RESET_HEADING'].'</a.</strong></td>'; |
|
45 | + echo '</tr>'."\n"; |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | echo '</tbody></table>'; |
@@ -87,6 +87,6 @@ discard block |
||
87 | 87 | $delete_url = './index.php?module=jjwg_Maps&action=delete_all_address_cache'; |
88 | 88 | echo '<a href="'.htmlspecialchars($delete_url).'">'.$GLOBALS['app_strings']['LBL_DELETE'].' - '.$GLOBALS['mod_strings']['LBL_ADDRESS_CACHE'].'</a>'; |
89 | 89 | |
90 | - } |
|
90 | + } |
|
91 | 91 | } |
92 | 92 |
@@ -4,30 +4,30 @@ discard block |
||
4 | 4 | |
5 | 5 | class VersionCheck { |
6 | 6 | |
7 | - function version_check($event, $arguments) |
|
8 | - { |
|
9 | - global $current_user; |
|
7 | + function version_check($event, $arguments) |
|
8 | + { |
|
9 | + global $current_user; |
|
10 | 10 | |
11 | - require_once('include/utils.php'); |
|
12 | - if(is_admin($current_user) && empty($_REQUEST['to_pdf']) && empty($_REQUEST['sugar_body_only'])) { |
|
13 | - //require_once('modules/SecurityGroups/SecurityGroup.php'); |
|
11 | + require_once('include/utils.php'); |
|
12 | + if(is_admin($current_user) && empty($_REQUEST['to_pdf']) && empty($_REQUEST['sugar_body_only'])) { |
|
13 | + //require_once('modules/SecurityGroups/SecurityGroup.php'); |
|
14 | 14 | |
15 | - //check to see if the securitysuite version |
|
16 | - //matches the sugar version. If not then display an error messag |
|
15 | + //check to see if the securitysuite version |
|
16 | + //matches the sugar version. If not then display an error messag |
|
17 | 17 | |
18 | - global $sugar_config; |
|
19 | - if(empty($sugar_config['securitysuite_version']) |
|
20 | - || $sugar_config['securitysuite_version'] != $sugar_config['sugar_version'] |
|
21 | - ) { |
|
22 | - $securitysuite_warning = "Warning! SecuritySuite no longer matches the version of Sugar that you are running. " |
|
23 | - . "SecuritySuite will not work correctly until updated to ".$sugar_config['sugar_version'].". " |
|
24 | - . "Upgrade now to "; |
|
18 | + global $sugar_config; |
|
19 | + if(empty($sugar_config['securitysuite_version']) |
|
20 | + || $sugar_config['securitysuite_version'] != $sugar_config['sugar_version'] |
|
21 | + ) { |
|
22 | + $securitysuite_warning = "Warning! SecuritySuite no longer matches the version of Sugar that you are running. " |
|
23 | + . "SecuritySuite will not work correctly until updated to ".$sugar_config['sugar_version'].". " |
|
24 | + . "Upgrade now to "; |
|
25 | 25 | |
26 | - global $sugar_config; |
|
27 | - $upgrade_url = "http://www.eggsurplus.com/version.php?version=".$sugar_config['sugar_version']; |
|
28 | - $upgrade_text = "SecuritySuite for ".$sugar_config['sugar_version']; |
|
29 | - $GLOBALS['log']->fatal($securitysuite_warning."<a href='$upgrade_url'>$upgrade_text</a>"); |
|
30 | - //echo $display_warning; |
|
26 | + global $sugar_config; |
|
27 | + $upgrade_url = "http://www.eggsurplus.com/version.php?version=".$sugar_config['sugar_version']; |
|
28 | + $upgrade_text = "SecuritySuite for ".$sugar_config['sugar_version']; |
|
29 | + $GLOBALS['log']->fatal($securitysuite_warning."<a href='$upgrade_url'>$upgrade_text</a>"); |
|
30 | + //echo $display_warning; |
|
31 | 31 | |
32 | 32 | |
33 | 33 | ?> |
@@ -50,10 +50,10 @@ discard block |
||
50 | 50 | </script> |
51 | 51 | <?php |
52 | 52 | |
53 | - } |
|
53 | + } |
|
54 | 54 | |
55 | - } //end if admin |
|
56 | - } |
|
55 | + } //end if admin |
|
56 | + } |
|
57 | 57 | |
58 | 58 | |
59 | 59 | } |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | and secr.module = '$module' |
55 | 55 | where secg.deleted = 0 |
56 | 56 | )"; |
57 | - */ |
|
57 | + */ |
|
58 | 58 | |
59 | 59 | //and secr.record_id = $table_name.id //not needed as the in clause takes care of this check |
60 | 60 | } |
@@ -376,7 +376,7 @@ discard block |
||
376 | 376 | //if(empty($parent_type) || empty($parent_id)) { |
377 | 377 | foreach($focus->field_name_map as $name=>$def) { |
378 | 378 | |
379 | - if($def['type']=='relate' && isset($def['id_name']) |
|
379 | + if($def['type']=='relate' && isset($def['id_name']) |
|
380 | 380 | && isset($def['module']) && strtolower($def['module']) != "users" ) { |
381 | 381 | |
382 | 382 | if(isset($_REQUEST[$def['id_name']])) { |
@@ -390,7 +390,7 @@ discard block |
||
390 | 390 | |
391 | 391 | SecurityGroup::inherit_parentQuery($focus, $relate_parent_type, $relate_parent_id, $focus_id, $focus_module_dir); |
392 | 392 | } |
393 | - } |
|
393 | + } |
|
394 | 394 | } |
395 | 395 | //} |
396 | 396 |
@@ -32,14 +32,14 @@ |
||
32 | 32 | |
33 | 33 | var $additional_column_fields = Array(); |
34 | 34 | var $field_defs = array ( |
35 | - 'id'=>array('name' =>'id', 'type' =>'char', 'len'=>'36', 'default'=>'') |
|
36 | - , 'securitygroup_id'=>array('name' =>'securitygroup_id', 'type' =>'char', 'len'=>'36', ) |
|
37 | - , 'user_id'=>array('name' =>'user_id', 'type' =>'char', 'len'=>'36',) |
|
38 | - , 'noninheritable'=>array('name' =>'noninheritable', 'type' =>'bool', 'len'=>'1') |
|
39 | - , 'primary_group'=>array('name' =>'primary_group', 'type' =>'bool', 'len'=>'1') |
|
40 | - , 'date_modified'=>array ('name' => 'date_modified','type' => 'datetime') |
|
41 | - , 'deleted'=>array('name' =>'deleted', 'type' =>'bool', 'len'=>'1', 'default'=>'0', 'required'=>true) |
|
42 | - ); |
|
35 | + 'id'=>array('name' =>'id', 'type' =>'char', 'len'=>'36', 'default'=>'') |
|
36 | + , 'securitygroup_id'=>array('name' =>'securitygroup_id', 'type' =>'char', 'len'=>'36', ) |
|
37 | + , 'user_id'=>array('name' =>'user_id', 'type' =>'char', 'len'=>'36',) |
|
38 | + , 'noninheritable'=>array('name' =>'noninheritable', 'type' =>'bool', 'len'=>'1') |
|
39 | + , 'primary_group'=>array('name' =>'primary_group', 'type' =>'bool', 'len'=>'1') |
|
40 | + , 'date_modified'=>array ('name' => 'date_modified','type' => 'datetime') |
|
41 | + , 'deleted'=>array('name' =>'deleted', 'type' =>'bool', 'len'=>'1', 'default'=>'0', 'required'=>true) |
|
42 | + ); |
|
43 | 43 | function SecurityGroupUserRelationship() { |
44 | 44 | $this->db = DBManagerFactory::getInstance(); |
45 | 45 | $this->dbManager = DBManagerFactory::getInstance(); |
@@ -2,169 +2,169 @@ |
||
2 | 2 | if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
3 | 3 | |
4 | 4 | class SecurityGroupMessage extends Basic { |
5 | - var $new_schema = true; |
|
6 | - var $module_dir = 'SecurityGroups'; |
|
7 | - var $object_name = 'SecurityGroupMessage'; |
|
8 | - var $table_name = 'securitygroups_message'; |
|
9 | - var $importable = false; |
|
5 | + var $new_schema = true; |
|
6 | + var $module_dir = 'SecurityGroups'; |
|
7 | + var $object_name = 'SecurityGroupMessage'; |
|
8 | + var $table_name = 'securitygroups_message'; |
|
9 | + var $importable = false; |
|
10 | 10 | |
11 | - var $id; |
|
12 | - var $name; |
|
13 | - var $date_entered; |
|
14 | - var $date_modified; |
|
15 | - var $modified_user_id; |
|
16 | - var $modified_by_name; |
|
17 | - var $created_by; |
|
18 | - var $created_by_name; |
|
19 | - var $description; |
|
20 | - var $deleted; |
|
21 | - var $created_by_link; |
|
22 | - var $modified_user_link; |
|
11 | + var $id; |
|
12 | + var $name; |
|
13 | + var $date_entered; |
|
14 | + var $date_modified; |
|
15 | + var $modified_user_id; |
|
16 | + var $modified_by_name; |
|
17 | + var $created_by; |
|
18 | + var $created_by_name; |
|
19 | + var $description; |
|
20 | + var $deleted; |
|
21 | + var $created_by_link; |
|
22 | + var $modified_user_link; |
|
23 | 23 | |
24 | 24 | |
25 | - var $additional_column_fields = Array(); |
|
26 | - var $field_defs = array ( |
|
27 | - 'id'=>array('name' =>'id', 'type' =>'char', 'len'=>'36', 'default'=>'') |
|
28 | - , 'name'=>array('name' =>'name', 'type' =>'varchar', 'len'=>'255', ) |
|
29 | - , 'date_entered'=>array ('name' => 'date_entered','type' => 'datetime') |
|
30 | - , 'date_modified'=>array ('name' => 'date_modified','type' => 'datetime') |
|
31 | - , 'modified_user_id'=>array('name' =>'modified_user_id', 'type' =>'char', 'len'=>'36',) |
|
32 | - , 'created_by'=>array('name' =>'created_by', 'type' =>'char', 'len'=>'36',) |
|
33 | - , 'description'=>array('name' =>'description', 'type' =>'text', 'len'=>'',) |
|
34 | - , 'deleted'=>array('name' =>'deleted', 'type' =>'bool', 'len'=>'1', 'default'=>'0', 'required'=>true) |
|
35 | - , 'securitygroup_id'=>array('name' =>'securitygroup_id', 'type' =>'char', 'len'=>'36',) |
|
25 | + var $additional_column_fields = Array(); |
|
26 | + var $field_defs = array ( |
|
27 | + 'id'=>array('name' =>'id', 'type' =>'char', 'len'=>'36', 'default'=>'') |
|
28 | + , 'name'=>array('name' =>'name', 'type' =>'varchar', 'len'=>'255', ) |
|
29 | + , 'date_entered'=>array ('name' => 'date_entered','type' => 'datetime') |
|
30 | + , 'date_modified'=>array ('name' => 'date_modified','type' => 'datetime') |
|
31 | + , 'modified_user_id'=>array('name' =>'modified_user_id', 'type' =>'char', 'len'=>'36',) |
|
32 | + , 'created_by'=>array('name' =>'created_by', 'type' =>'char', 'len'=>'36',) |
|
33 | + , 'description'=>array('name' =>'description', 'type' =>'text', 'len'=>'',) |
|
34 | + , 'deleted'=>array('name' =>'deleted', 'type' =>'bool', 'len'=>'1', 'default'=>'0', 'required'=>true) |
|
35 | + , 'securitygroup_id'=>array('name' =>'securitygroup_id', 'type' =>'char', 'len'=>'36',) |
|
36 | 36 | ); |
37 | 37 | |
38 | 38 | |
39 | - function SecurityGroupMessage(){ |
|
40 | - parent::Basic(); |
|
41 | - } |
|
39 | + function SecurityGroupMessage(){ |
|
40 | + parent::Basic(); |
|
41 | + } |
|
42 | 42 | |
43 | 43 | |
44 | - function get_list_view_data(){ |
|
45 | - $data = parent::get_list_view_data(); |
|
46 | - $delete = ''; |
|
44 | + function get_list_view_data(){ |
|
45 | + $data = parent::get_list_view_data(); |
|
46 | + $delete = ''; |
|
47 | 47 | |
48 | - $group_owner = false; |
|
49 | - $securitygroup_name = ""; |
|
50 | - if(empty($data['SECURITYGROUP_ID'])) { |
|
51 | - $securitygroup_name = "All"; |
|
52 | - } else { |
|
53 | - require_once('modules/SecurityGroups/SecurityGroup.php'); |
|
54 | - $securitygroup = new SecurityGroup(); |
|
55 | - $securitygroup->retrieve($data['SECURITYGROUP_ID']); |
|
56 | - $securitygroup_name = $securitygroup->name; |
|
48 | + $group_owner = false; |
|
49 | + $securitygroup_name = ""; |
|
50 | + if(empty($data['SECURITYGROUP_ID'])) { |
|
51 | + $securitygroup_name = "All"; |
|
52 | + } else { |
|
53 | + require_once('modules/SecurityGroups/SecurityGroup.php'); |
|
54 | + $securitygroup = new SecurityGroup(); |
|
55 | + $securitygroup->retrieve($data['SECURITYGROUP_ID']); |
|
56 | + $securitygroup_name = $securitygroup->name; |
|
57 | 57 | |
58 | - if($securitygroup->assigned_user_id == $GLOBALS['current_user']->id) { |
|
59 | - $group_owner = true; |
|
60 | - } |
|
61 | - } |
|
58 | + if($securitygroup->assigned_user_id == $GLOBALS['current_user']->id) { |
|
59 | + $group_owner = true; |
|
60 | + } |
|
61 | + } |
|
62 | 62 | |
63 | - if(is_admin($GLOBALS['current_user']) || $data['CREATED_BY'] == $GLOBALS['current_user']->id || $group_owner) { |
|
64 | - $delete = SugarThemeRegistry::current()->getImage( 'delete_inline', 'width="12" height="12" border="0" align="absmiddle" style="vertical-align: bottom;" onclick=\'Message.deleteMessage("'. $data['ID'] . '", "{this.id}")\'',null,null,'.gif',''); |
|
65 | - } |
|
63 | + if(is_admin($GLOBALS['current_user']) || $data['CREATED_BY'] == $GLOBALS['current_user']->id || $group_owner) { |
|
64 | + $delete = SugarThemeRegistry::current()->getImage( 'delete_inline', 'width="12" height="12" border="0" align="absmiddle" style="vertical-align: bottom;" onclick=\'Message.deleteMessage("'. $data['ID'] . '", "{this.id}")\'',null,null,'.gif',''); |
|
65 | + } |
|
66 | 66 | |
67 | - $username = ""; |
|
68 | - if(empty($data['CREATED_BY'])) { |
|
69 | - $username = "Unknown"; |
|
70 | - } else { |
|
71 | - require_once('modules/Users/User.php'); |
|
72 | - $user = new User(); |
|
73 | - $user->retrieve($data['CREATED_BY']); |
|
74 | - $username = $user->user_name; |
|
75 | - } |
|
67 | + $username = ""; |
|
68 | + if(empty($data['CREATED_BY'])) { |
|
69 | + $username = "Unknown"; |
|
70 | + } else { |
|
71 | + require_once('modules/Users/User.php'); |
|
72 | + $user = new User(); |
|
73 | + $user->retrieve($data['CREATED_BY']); |
|
74 | + $username = $user->user_name; |
|
75 | + } |
|
76 | 76 | |
77 | - $data['NAME'] = $data['DESCRIPTION']; |
|
78 | - $data['NAME'] = '<div class="list view" style="padding:5px;border:none;">' . html_entity_decode($data['NAME']); |
|
77 | + $data['NAME'] = $data['DESCRIPTION']; |
|
78 | + $data['NAME'] = '<div class="list view" style="padding:5px;border:none;">' . html_entity_decode($data['NAME']); |
|
79 | 79 | $data['NAME'] .= '<div class="byLineBox" style="padding-top: 2px"><span class="byLineLeft">'.$username.' ['.$securitygroup_name.']'; |
80 | - $data['NAME'] .= ' </span><span style="cursor: pointer;" class="byLineRight"> '. $this->getTimeLapse($data['DATE_ENTERED']) . ' ' .$delete. '</span></div>'; |
|
81 | - return $data ; |
|
82 | - } |
|
80 | + $data['NAME'] .= ' </span><span style="cursor: pointer;" class="byLineRight"> '. $this->getTimeLapse($data['DATE_ENTERED']) . ' ' .$delete. '</span></div>'; |
|
81 | + return $data ; |
|
82 | + } |
|
83 | 83 | |
84 | 84 | |
85 | - static function saveMessage($text, $securitygroup_id) { |
|
86 | - //if no security group id then must be admin. Otherwise, make sure the user is a member of the group |
|
87 | - global $current_user; |
|
88 | - if(empty($securitygroup_id) && !is_admin($current_user)) { |
|
89 | - return; |
|
90 | - } else if(empty($securitygroup_id)) { |
|
91 | - $securitygroup_id = null; //6.4.0 |
|
92 | - } |
|
93 | - $message = new SecurityGroupMessage(); |
|
94 | - if(empty($text)) return; // || !$feed->ACLAccess('save', true) )return; |
|
85 | + static function saveMessage($text, $securitygroup_id) { |
|
86 | + //if no security group id then must be admin. Otherwise, make sure the user is a member of the group |
|
87 | + global $current_user; |
|
88 | + if(empty($securitygroup_id) && !is_admin($current_user)) { |
|
89 | + return; |
|
90 | + } else if(empty($securitygroup_id)) { |
|
91 | + $securitygroup_id = null; //6.4.0 |
|
92 | + } |
|
93 | + $message = new SecurityGroupMessage(); |
|
94 | + if(empty($text)) return; // || !$feed->ACLAccess('save', true) )return; |
|
95 | 95 | |
96 | - $text = strip_tags($text); |
|
97 | - $message->name = ''; |
|
98 | - $message->description = $text; |
|
99 | - $message->securitygroup_id = $securitygroup_id; |
|
100 | - $message->save(); |
|
101 | - } |
|
96 | + $text = strip_tags($text); |
|
97 | + $message->name = ''; |
|
98 | + $message->description = $text; |
|
99 | + $message->securitygroup_id = $securitygroup_id; |
|
100 | + $message->save(); |
|
101 | + } |
|
102 | 102 | |
103 | - function getTimeLapse($startDate) |
|
104 | - { |
|
105 | - $startDate = $GLOBALS['timedate']->to_db($startDate); |
|
106 | - $start = array(); |
|
107 | - preg_match('/(\d+)\-(\d+)\-(\d+) (\d+)\:(\d+)\:(\d+)/', $startDate, $start); |
|
108 | - $end = gmdate('Y-m-d H:i:s'); |
|
109 | - $start_time = gmmktime($start[4],$start[5], $start[6], $start[2], $start[3], $start[1] ); |
|
110 | - $seconds = time()- $start_time; |
|
111 | - $minutes = $seconds/60; |
|
112 | - $seconds = $seconds % 60; |
|
113 | - $hours = floor( $minutes / 60); |
|
114 | - $minutes = $minutes % 60; |
|
115 | - $days = floor( $hours / 24); |
|
116 | - $hours = $hours % 24; |
|
117 | - $weeks = floor( $days / 7); |
|
118 | - $days = $days % 7; |
|
119 | - $result = ''; |
|
120 | - if($weeks == 1){ |
|
121 | - $result = translate('LBL_TIME_LAST_WEEK','SugarFeed').' '; |
|
122 | - return $result; |
|
123 | - }else if($weeks > 1){ |
|
124 | - $result .= $weeks . ' '.translate('LBL_TIME_WEEKS','SugarFeed').' '; |
|
125 | - if($days > 0) { |
|
103 | + function getTimeLapse($startDate) |
|
104 | + { |
|
105 | + $startDate = $GLOBALS['timedate']->to_db($startDate); |
|
106 | + $start = array(); |
|
107 | + preg_match('/(\d+)\-(\d+)\-(\d+) (\d+)\:(\d+)\:(\d+)/', $startDate, $start); |
|
108 | + $end = gmdate('Y-m-d H:i:s'); |
|
109 | + $start_time = gmmktime($start[4],$start[5], $start[6], $start[2], $start[3], $start[1] ); |
|
110 | + $seconds = time()- $start_time; |
|
111 | + $minutes = $seconds/60; |
|
112 | + $seconds = $seconds % 60; |
|
113 | + $hours = floor( $minutes / 60); |
|
114 | + $minutes = $minutes % 60; |
|
115 | + $days = floor( $hours / 24); |
|
116 | + $hours = $hours % 24; |
|
117 | + $weeks = floor( $days / 7); |
|
118 | + $days = $days % 7; |
|
119 | + $result = ''; |
|
120 | + if($weeks == 1){ |
|
121 | + $result = translate('LBL_TIME_LAST_WEEK','SugarFeed').' '; |
|
122 | + return $result; |
|
123 | + }else if($weeks > 1){ |
|
124 | + $result .= $weeks . ' '.translate('LBL_TIME_WEEKS','SugarFeed').' '; |
|
125 | + if($days > 0) { |
|
126 | 126 | $result .= $days . ' '.translate('LBL_TIME_DAYS','SugarFeed').' '; |
127 | 127 | } |
128 | - }else{ |
|
129 | - if($days == 1){ |
|
130 | - $result = translate('LBL_TIME_YESTERDAY','SugarFeed').' '; |
|
131 | - return $result; |
|
132 | - }else if($days > 1){ |
|
133 | - $result .= $days . ' '. translate('LBL_TIME_DAYS','SugarFeed').' '; |
|
134 | - }else{ |
|
135 | - if($hours == 1) { |
|
128 | + }else{ |
|
129 | + if($days == 1){ |
|
130 | + $result = translate('LBL_TIME_YESTERDAY','SugarFeed').' '; |
|
131 | + return $result; |
|
132 | + }else if($days > 1){ |
|
133 | + $result .= $days . ' '. translate('LBL_TIME_DAYS','SugarFeed').' '; |
|
134 | + }else{ |
|
135 | + if($hours == 1) { |
|
136 | 136 | $result .= $hours . ' '.translate('LBL_TIME_HOUR','SugarFeed').' '; |
137 | 137 | } else { |
138 | 138 | $result .= $hours . ' '.translate('LBL_TIME_HOURS','SugarFeed').' '; |
139 | 139 | } |
140 | - if($hours < 6){ |
|
141 | - if($minutes == 1) { |
|
140 | + if($hours < 6){ |
|
141 | + if($minutes == 1) { |
|
142 | 142 | $result .= $minutes . ' ' . translate('LBL_TIME_MINUTE','SugarFeed'). ' '; |
143 | 143 | } else { |
144 | 144 | $result .= $minutes . ' ' . translate('LBL_TIME_MINUTES','SugarFeed'). ' '; |
145 | 145 | } |
146 | - } |
|
147 | - if($hours == 0 && $minutes == 0) { |
|
146 | + } |
|
147 | + if($hours == 0 && $minutes == 0) { |
|
148 | 148 | if($seconds == 1 ) { |
149 | 149 | $result = $seconds . ' ' . translate('LBL_TIME_SECOND','SugarFeed'); |
150 | 150 | } else { |
151 | 151 | $result = $seconds . ' ' . translate('LBL_TIME_SECONDS','SugarFeed'); |
152 | 152 | } |
153 | 153 | } |
154 | - } |
|
155 | - } |
|
156 | - return $result . ' ' . translate('LBL_TIME_AGO','SugarFeed'); |
|
154 | + } |
|
155 | + } |
|
156 | + return $result . ' ' . translate('LBL_TIME_AGO','SugarFeed'); |
|
157 | 157 | |
158 | 158 | |
159 | 159 | |
160 | 160 | } |
161 | 161 | |
162 | - function bean_implements($interface){ |
|
163 | - switch($interface){ |
|
164 | - case 'ACL':return false; |
|
165 | - } |
|
166 | - return false; |
|
167 | - } |
|
162 | + function bean_implements($interface){ |
|
163 | + switch($interface){ |
|
164 | + case 'ACL':return false; |
|
165 | + } |
|
166 | + return false; |
|
167 | + } |
|
168 | 168 | |
169 | 169 | } |
170 | 170 | ?> |
171 | 171 | \ No newline at end of file |
@@ -2,39 +2,39 @@ |
||
2 | 2 | |
3 | 3 | |
4 | 4 | class SecurityGroup_sugar extends Basic { |
5 | - var $new_schema = true; |
|
6 | - var $module_dir = 'SecurityGroups'; |
|
7 | - var $object_name = 'SecurityGroup'; |
|
8 | - var $table_name = 'securitygroups'; |
|
9 | - var $id; |
|
10 | - var $name; |
|
11 | - var $date_entered; |
|
12 | - var $date_modified; |
|
13 | - var $modified_user_id; |
|
14 | - var $modified_by_name; |
|
15 | - var $created_by; |
|
16 | - var $created_by_name; |
|
17 | - var $description; |
|
18 | - var $deleted; |
|
19 | - var $created_by_link; |
|
20 | - var $modified_user_link; |
|
21 | - var $assigned_user_id; |
|
22 | - var $assigned_user_name; |
|
23 | - var $assigned_user_link; |
|
5 | + var $new_schema = true; |
|
6 | + var $module_dir = 'SecurityGroups'; |
|
7 | + var $object_name = 'SecurityGroup'; |
|
8 | + var $table_name = 'securitygroups'; |
|
9 | + var $id; |
|
10 | + var $name; |
|
11 | + var $date_entered; |
|
12 | + var $date_modified; |
|
13 | + var $modified_user_id; |
|
14 | + var $modified_by_name; |
|
15 | + var $created_by; |
|
16 | + var $created_by_name; |
|
17 | + var $description; |
|
18 | + var $deleted; |
|
19 | + var $created_by_link; |
|
20 | + var $modified_user_link; |
|
21 | + var $assigned_user_id; |
|
22 | + var $assigned_user_name; |
|
23 | + var $assigned_user_link; |
|
24 | 24 | |
25 | 25 | |
26 | 26 | |
27 | 27 | |
28 | 28 | |
29 | - function SecurityGroup_sugar(){ |
|
30 | - parent::Basic(); |
|
31 | - } |
|
29 | + function SecurityGroup_sugar(){ |
|
30 | + parent::Basic(); |
|
31 | + } |
|
32 | 32 | |
33 | - function bean_implements($interface){ |
|
34 | - switch($interface){ |
|
35 | - case 'ACL': return true; |
|
36 | - } |
|
37 | - return false; |
|
33 | + function bean_implements($interface){ |
|
34 | + switch($interface){ |
|
35 | + case 'ACL': return true; |
|
36 | + } |
|
37 | + return false; |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | } |
@@ -6,113 +6,113 @@ discard block |
||
6 | 6 | |
7 | 7 | function popup_select(&$bean, $event, $arguments) |
8 | 8 | { |
9 | - global $sugar_config; |
|
10 | - |
|
11 | - //only process if action is Save (meaning a user has triggered this event and not the portal or automated process) |
|
12 | - if(isset($_REQUEST['action']) && $_REQUEST['action'] == 'Save' |
|
13 | - && isset($sugar_config['securitysuite_popup_select']) && $sugar_config['securitysuite_popup_select'] == true |
|
14 | - && empty($bean->fetched_row['id']) && $bean->module_dir != "Users" && $bean->module_dir != "SugarFeed") { |
|
15 | - //Upload an attachment to an Email Template and save. If user with multi groups - popup select option |
|
16 | - //it will redirect to notes instead of EmailTemplate and relationship will fail...check below to avoid |
|
17 | - if(!empty($_REQUEST['module']) && $_REQUEST['module'] != $bean->module_dir) return; |
|
18 | - |
|
19 | - if(!empty($_REQUEST['securitygroup_list'])) { |
|
20 | - require_once('modules/SecurityGroups/SecurityGroup.php'); |
|
21 | - $groupFocus = new SecurityGroup(); |
|
22 | - $security_modules = $groupFocus->getSecurityModules(); |
|
23 | - //sanity check |
|
24 | - if(in_array($bean->module_dir,array_keys($security_modules))) { |
|
25 | - //add each group in securitygroup_list to new record |
|
26 | - $rel_name = $groupFocus->getLinkName($bean->module_dir,"SecurityGroups"); |
|
27 | - |
|
28 | - $bean->load_relationship($rel_name); |
|
29 | - foreach($_REQUEST['securitygroup_list'] as $group_id) { |
|
30 | - $bean->$rel_name->add($group_id); |
|
31 | - } |
|
32 | - } |
|
33 | - } else if(!empty($_REQUEST['dup_checked'])) { |
|
34 | - //well...ShowDuplicates doesn't pass through request vars unless they are defined in the module vardefs |
|
35 | - //so we are screwed here... |
|
36 | - global $current_language; |
|
37 | - $ss_mod_strings = return_module_language($current_language, 'SecurityGroups'); |
|
38 | - unset($_SESSION['securitysuite_error']); //to be safe |
|
39 | - $_SESSION['securitysuite_error'] = $ss_mod_strings['LBL_ERROR_DUPLICATE']; |
|
40 | - } |
|
41 | - } |
|
9 | + global $sugar_config; |
|
10 | + |
|
11 | + //only process if action is Save (meaning a user has triggered this event and not the portal or automated process) |
|
12 | + if(isset($_REQUEST['action']) && $_REQUEST['action'] == 'Save' |
|
13 | + && isset($sugar_config['securitysuite_popup_select']) && $sugar_config['securitysuite_popup_select'] == true |
|
14 | + && empty($bean->fetched_row['id']) && $bean->module_dir != "Users" && $bean->module_dir != "SugarFeed") { |
|
15 | + //Upload an attachment to an Email Template and save. If user with multi groups - popup select option |
|
16 | + //it will redirect to notes instead of EmailTemplate and relationship will fail...check below to avoid |
|
17 | + if(!empty($_REQUEST['module']) && $_REQUEST['module'] != $bean->module_dir) return; |
|
18 | + |
|
19 | + if(!empty($_REQUEST['securitygroup_list'])) { |
|
20 | + require_once('modules/SecurityGroups/SecurityGroup.php'); |
|
21 | + $groupFocus = new SecurityGroup(); |
|
22 | + $security_modules = $groupFocus->getSecurityModules(); |
|
23 | + //sanity check |
|
24 | + if(in_array($bean->module_dir,array_keys($security_modules))) { |
|
25 | + //add each group in securitygroup_list to new record |
|
26 | + $rel_name = $groupFocus->getLinkName($bean->module_dir,"SecurityGroups"); |
|
27 | + |
|
28 | + $bean->load_relationship($rel_name); |
|
29 | + foreach($_REQUEST['securitygroup_list'] as $group_id) { |
|
30 | + $bean->$rel_name->add($group_id); |
|
31 | + } |
|
32 | + } |
|
33 | + } else if(!empty($_REQUEST['dup_checked'])) { |
|
34 | + //well...ShowDuplicates doesn't pass through request vars unless they are defined in the module vardefs |
|
35 | + //so we are screwed here... |
|
36 | + global $current_language; |
|
37 | + $ss_mod_strings = return_module_language($current_language, 'SecurityGroups'); |
|
38 | + unset($_SESSION['securitysuite_error']); //to be safe |
|
39 | + $_SESSION['securitysuite_error'] = $ss_mod_strings['LBL_ERROR_DUPLICATE']; |
|
40 | + } |
|
41 | + } |
|
42 | 42 | |
43 | - else if(isset($sugar_config['securitysuite_user_popup']) && $sugar_config['securitysuite_user_popup'] == true |
|
44 | - && empty($bean->fetched_row['id']) && $bean->module_dir == "Users" |
|
45 | - && isset($_REQUEST['action']) && $_REQUEST['action'] != 'SaveSignature' ) { //Bug: 589 |
|
43 | + else if(isset($sugar_config['securitysuite_user_popup']) && $sugar_config['securitysuite_user_popup'] == true |
|
44 | + && empty($bean->fetched_row['id']) && $bean->module_dir == "Users" |
|
45 | + && isset($_REQUEST['action']) && $_REQUEST['action'] != 'SaveSignature' ) { //Bug: 589 |
|
46 | 46 | |
47 | - //$_REQUEST['return_module'] = $bean->module_dir; |
|
48 | - //$_REQUEST['return_action'] = "DetailView"; |
|
49 | - //$_REQUEST['return_id'] = $bean->id; |
|
47 | + //$_REQUEST['return_module'] = $bean->module_dir; |
|
48 | + //$_REQUEST['return_action'] = "DetailView"; |
|
49 | + //$_REQUEST['return_id'] = $bean->id; |
|
50 | 50 | |
51 | - //$_SESSION['securitygroups_popup_'.$bean->module_dir] = $bean->id; |
|
51 | + //$_SESSION['securitygroups_popup_'.$bean->module_dir] = $bean->id; |
|
52 | 52 | |
53 | - if(!isset($_SESSION['securitygroups_popup'])) { |
|
54 | - $_SESSION['securitygroups_popup'] = array(); |
|
55 | - } |
|
56 | - $_SESSION['securitygroups_popup'][] = array( |
|
57 | - 'module' => $bean->module_dir, |
|
58 | - 'id' => $bean->id |
|
59 | - ); |
|
60 | - } |
|
53 | + if(!isset($_SESSION['securitygroups_popup'])) { |
|
54 | + $_SESSION['securitygroups_popup'] = array(); |
|
55 | + } |
|
56 | + $_SESSION['securitygroups_popup'][] = array( |
|
57 | + 'module' => $bean->module_dir, |
|
58 | + 'id' => $bean->id |
|
59 | + ); |
|
60 | + } |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | |
64 | 64 | function popup_onload($event, $arguments) |
65 | 65 | { |
66 | - if(!empty($_REQUEST['to_pdf']) || !empty($_REQUEST['sugar_body_only'])) return; |
|
66 | + if(!empty($_REQUEST['to_pdf']) || !empty($_REQUEST['sugar_body_only'])) return; |
|
67 | 67 | |
68 | 68 | /** //test user popup |
69 | 69 | //always have this loaded |
70 | 70 | echo '<script type="text/javascript" src="modules/SecurityGroups/javascript/popup_relate.js"></script>'; |
71 | 71 | */ |
72 | - global $sugar_config; |
|
72 | + global $sugar_config; |
|
73 | 73 | |
74 | - $module = $_REQUEST['module']; |
|
75 | - $action = $_REQUEST['action']; |
|
74 | + $module = $_REQUEST['module']; |
|
75 | + $action = $_REQUEST['action']; |
|
76 | 76 | |
77 | - if(isset($action) && ($action == "Save" || $action == "SetTimezone")) return; |
|
77 | + if(isset($action) && ($action == "Save" || $action == "SetTimezone")) return; |
|
78 | 78 | |
79 | - if( ( |
|
80 | - //(isset($sugar_config['securitysuite_popup_select']) && $sugar_config['securitysuite_popup_select'] == true) |
|
81 | - //|| |
|
82 | - ($module == "Users" && isset($sugar_config['securitysuite_user_popup']) && $sugar_config['securitysuite_user_popup'] == true) |
|
83 | - ) |
|
79 | + if( ( |
|
80 | + //(isset($sugar_config['securitysuite_popup_select']) && $sugar_config['securitysuite_popup_select'] == true) |
|
81 | + //|| |
|
82 | + ($module == "Users" && isset($sugar_config['securitysuite_user_popup']) && $sugar_config['securitysuite_user_popup'] == true) |
|
83 | + ) |
|
84 | 84 | |
85 | - //&& isset($_SESSION['securitygroups_popup_'.$module]) && !empty($_SESSION['securitygroups_popup_'.$module]) |
|
86 | - && !empty($_SESSION['securitygroups_popup']) |
|
87 | - ) { |
|
88 | - |
|
89 | - foreach($_SESSION['securitygroups_popup'] as $popup_index => $popup) { |
|
90 | - $record_id = $popup['id']; |
|
91 | - $module = $popup['module']; |
|
92 | - unset($_SESSION['securitygroups_popup'][$popup_index]); |
|
85 | + //&& isset($_SESSION['securitygroups_popup_'.$module]) && !empty($_SESSION['securitygroups_popup_'.$module]) |
|
86 | + && !empty($_SESSION['securitygroups_popup']) |
|
87 | + ) { |
|
88 | + |
|
89 | + foreach($_SESSION['securitygroups_popup'] as $popup_index => $popup) { |
|
90 | + $record_id = $popup['id']; |
|
91 | + $module = $popup['module']; |
|
92 | + unset($_SESSION['securitygroups_popup'][$popup_index]); |
|
93 | 93 | |
94 | - require_once('modules/SecurityGroups/SecurityGroup.php'); |
|
95 | - $groupFocus = new SecurityGroup(); |
|
96 | - if($module == 'Users') { |
|
97 | - $rel_name = "SecurityGroups"; |
|
98 | - } else { |
|
99 | - $rel_name = $groupFocus->getLinkName($module,"SecurityGroups"); |
|
100 | - } |
|
101 | - |
|
102 | - //this only works if on the detail view of the record actually saved... |
|
103 | - //so ajaxui breaks this as it stays on the parent |
|
104 | - $auto_popup = <<<EOQ |
|
94 | + require_once('modules/SecurityGroups/SecurityGroup.php'); |
|
95 | + $groupFocus = new SecurityGroup(); |
|
96 | + if($module == 'Users') { |
|
97 | + $rel_name = "SecurityGroups"; |
|
98 | + } else { |
|
99 | + $rel_name = $groupFocus->getLinkName($module,"SecurityGroups"); |
|
100 | + } |
|
101 | + |
|
102 | + //this only works if on the detail view of the record actually saved... |
|
103 | + //so ajaxui breaks this as it stays on the parent |
|
104 | + $auto_popup = <<<EOQ |
|
105 | 105 | <script type="text/javascript" language="javascript"> |
106 | 106 | open_popup("SecurityGroups",600,400,"",true,true,{"call_back_function":"securitysuite_set_return_and_save_background","form_name":"DetailView","field_to_name_array":{"id":"subpanel_id"},"passthru_data":{"module":"$module","record":"$record_id","child_field":"$rel_name","return_url":"","link_field_name":"$rel_name","module_name":"$rel_name","refresh_page":"1"}},"MultiSelect",true); |
107 | 107 | </script> |
108 | 108 | EOQ; |
109 | 109 | |
110 | - echo $auto_popup; |
|
110 | + echo $auto_popup; |
|
111 | 111 | |
112 | - } |
|
113 | - unset($_SESSION['securitygroups_popup']); |
|
112 | + } |
|
113 | + unset($_SESSION['securitygroups_popup']); |
|
114 | 114 | |
115 | - } |
|
115 | + } |
|
116 | 116 | |
117 | 117 | } |
118 | 118 | |
@@ -121,37 +121,37 @@ discard block |
||
121 | 121 | $action = $_REQUEST['action']; |
122 | 122 | $module = $_REQUEST['module']; |
123 | 123 | |
124 | - $no_mass_assign_list = array("Emails"=>"Emails","ACLRoles"=>"ACLRoles"); //,"Users"=>"Users"); |
|
124 | + $no_mass_assign_list = array("Emails"=>"Emails","ACLRoles"=>"ACLRoles"); //,"Users"=>"Users"); |
|
125 | 125 | //check if security suite enabled |
126 | 126 | $action = strtolower($action); |
127 | 127 | if(isset($module) && ($action == "list" || $action == "index" || $action == "listview") |
128 | - && (!isset($_REQUEST['search_form_only']) || $_REQUEST['search_form_only'] != true) |
|
129 | - && !array_key_exists($module,$no_mass_assign_list) |
|
130 | - ) { |
|
131 | - global $current_user; |
|
132 | - if(is_admin($current_user) || ACLAction::getUserAccessLevel($current_user->id,"SecurityGroups", 'access') == ACL_ALLOW_ENABLED) { |
|
128 | + && (!isset($_REQUEST['search_form_only']) || $_REQUEST['search_form_only'] != true) |
|
129 | + && !array_key_exists($module,$no_mass_assign_list) |
|
130 | + ) { |
|
131 | + global $current_user; |
|
132 | + if(is_admin($current_user) || ACLAction::getUserAccessLevel($current_user->id,"SecurityGroups", 'access') == ACL_ALLOW_ENABLED) { |
|
133 | 133 | |
134 | - require_once('modules/SecurityGroups/SecurityGroup.php'); |
|
135 | - $groupFocus = new SecurityGroup(); |
|
136 | - $security_modules = $groupFocus->getSecurityModules(); |
|
137 | - //if(in_array($module,$security_modules)) { |
|
138 | - if(in_array($module,array_keys($security_modules))) { |
|
134 | + require_once('modules/SecurityGroups/SecurityGroup.php'); |
|
135 | + $groupFocus = new SecurityGroup(); |
|
136 | + $security_modules = $groupFocus->getSecurityModules(); |
|
137 | + //if(in_array($module,$security_modules)) { |
|
138 | + if(in_array($module,array_keys($security_modules))) { |
|
139 | 139 | |
140 | - global $app_strings; |
|
140 | + global $app_strings; |
|
141 | 141 | |
142 | - global $current_language; |
|
143 | - $current_module_strings = return_module_language($current_language, 'SecurityGroups'); |
|
142 | + global $current_language; |
|
143 | + $current_module_strings = return_module_language($current_language, 'SecurityGroups'); |
|
144 | 144 | |
145 | - $form_header = get_form_header($current_module_strings['LBL_MASS_ASSIGN'], '', false); |
|
145 | + $form_header = get_form_header($current_module_strings['LBL_MASS_ASSIGN'], '', false); |
|
146 | 146 | |
147 | - $groups = $groupFocus->get_list("name","",0,-99,-99); |
|
148 | - $options = array(""=>""); |
|
149 | - foreach($groups['list'] as $group) { |
|
150 | - $options[$group->id] = $group->name; |
|
151 | - } |
|
152 | - $group_options = get_select_options_with_id($options, ""); |
|
147 | + $groups = $groupFocus->get_list("name","",0,-99,-99); |
|
148 | + $options = array(""=>""); |
|
149 | + foreach($groups['list'] as $group) { |
|
150 | + $options[$group->id] = $group->name; |
|
151 | + } |
|
152 | + $group_options = get_select_options_with_id($options, ""); |
|
153 | 153 | |
154 | - $mass_assign = <<<EOQ |
|
154 | + $mass_assign = <<<EOQ |
|
155 | 155 | |
156 | 156 | <script type="text/javascript" language="javascript"> |
157 | 157 | function confirm_massassign(del,start_string, end_string) { |
@@ -264,16 +264,16 @@ discard block |
||
264 | 264 | EOQ; |
265 | 265 | |
266 | 266 | |
267 | - echo $mass_assign; |
|
268 | - } |
|
269 | - } |
|
267 | + echo $mass_assign; |
|
268 | + } |
|
269 | + } |
|
270 | 270 | } |
271 | 271 | |
272 | - //if after a save... |
|
273 | - if(!empty($_SESSION['securitysuite_error'])) { |
|
274 | - $lbl_securitysuite_error = $_SESSION['securitysuite_error']; |
|
275 | - unset($_SESSION['securitysuite_error']); |
|
276 | - echo <<<EOQ |
|
272 | + //if after a save... |
|
273 | + if(!empty($_SESSION['securitysuite_error'])) { |
|
274 | + $lbl_securitysuite_error = $_SESSION['securitysuite_error']; |
|
275 | + unset($_SESSION['securitysuite_error']); |
|
276 | + echo <<<EOQ |
|
277 | 277 | <script> |
278 | 278 | |
279 | 279 | |
@@ -287,7 +287,7 @@ discard block |
||
287 | 287 | document.body.insertBefore(oNewP, beforeMe); |
288 | 288 | </script> |
289 | 289 | EOQ; |
290 | - } |
|
290 | + } |
|
291 | 291 | } |
292 | 292 | |
293 | 293 | } |
@@ -57,12 +57,12 @@ |
||
57 | 57 | |
58 | 58 | foreach($focus->column_fields as $field) |
59 | 59 | { |
60 | - safe_map($field, $focus, true); |
|
60 | + safe_map($field, $focus, true); |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | foreach($focus->additional_column_fields as $field) |
64 | 64 | { |
65 | - safe_map($field, $focus, true); |
|
65 | + safe_map($field, $focus, true); |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | // send them to the edit screen. |
@@ -52,74 +52,74 @@ |
||
52 | 52 | |
53 | 53 | // Contact is used to store customer information. |
54 | 54 | class ContactOpportunityRelationship extends SugarBean { |
55 | - // Stored fields |
|
56 | - var $id; |
|
57 | - var $contact_id; |
|
58 | - var $contact_role; |
|
59 | - var $opportunity_id; |
|
60 | - |
|
61 | - // Related fields |
|
62 | - var $contact_name; |
|
63 | - var $opportunity_name; |
|
64 | - |
|
65 | - var $table_name = "opportunities_contacts"; |
|
66 | - var $object_name = "ContactOpportunityRelationship"; |
|
67 | - var $column_fields = Array("id" |
|
68 | - ,"contact_id" |
|
69 | - ,"opportunity_id" |
|
70 | - ,"contact_role" |
|
71 | - ,'date_modified' |
|
72 | - ); |
|
73 | - |
|
74 | - var $new_schema = true; |
|
55 | + // Stored fields |
|
56 | + var $id; |
|
57 | + var $contact_id; |
|
58 | + var $contact_role; |
|
59 | + var $opportunity_id; |
|
60 | + |
|
61 | + // Related fields |
|
62 | + var $contact_name; |
|
63 | + var $opportunity_name; |
|
64 | + |
|
65 | + var $table_name = "opportunities_contacts"; |
|
66 | + var $object_name = "ContactOpportunityRelationship"; |
|
67 | + var $column_fields = Array("id" |
|
68 | + ,"contact_id" |
|
69 | + ,"opportunity_id" |
|
70 | + ,"contact_role" |
|
71 | + ,'date_modified' |
|
72 | + ); |
|
73 | + |
|
74 | + var $new_schema = true; |
|
75 | 75 | |
76 | - var $additional_column_fields = Array(); |
|
77 | - var $field_defs = array ( |
|
78 | - 'id'=>array('name' =>'id', 'type' =>'char', 'len'=>'36', 'default'=>'') |
|
79 | - , 'contact_id'=>array('name' =>'contact_id', 'type' =>'char', 'len'=>'36', ) |
|
80 | - , 'opportunity_id'=>array('name' =>'opportunity_id', 'type' =>'char', 'len'=>'36',) |
|
81 | - , 'contact_role'=>array('name' =>'contact_role', 'type' =>'char', 'len'=>'50') |
|
82 | - , 'date_modified'=>array ('name' => 'date_modified','type' => 'datetime') |
|
83 | - , 'deleted'=>array('name' =>'deleted', 'type' =>'bool', 'len'=>'1', 'default'=>'0', 'required'=>true) |
|
84 | - ); |
|
85 | - function ContactOpportunityRelationship() { |
|
86 | - $this->db = DBManagerFactory::getInstance(); |
|
76 | + var $additional_column_fields = Array(); |
|
77 | + var $field_defs = array ( |
|
78 | + 'id'=>array('name' =>'id', 'type' =>'char', 'len'=>'36', 'default'=>'') |
|
79 | + , 'contact_id'=>array('name' =>'contact_id', 'type' =>'char', 'len'=>'36', ) |
|
80 | + , 'opportunity_id'=>array('name' =>'opportunity_id', 'type' =>'char', 'len'=>'36',) |
|
81 | + , 'contact_role'=>array('name' =>'contact_role', 'type' =>'char', 'len'=>'50') |
|
82 | + , 'date_modified'=>array ('name' => 'date_modified','type' => 'datetime') |
|
83 | + , 'deleted'=>array('name' =>'deleted', 'type' =>'bool', 'len'=>'1', 'default'=>'0', 'required'=>true) |
|
84 | + ); |
|
85 | + function ContactOpportunityRelationship() { |
|
86 | + $this->db = DBManagerFactory::getInstance(); |
|
87 | 87 | $this->dbManager = DBManagerFactory::getInstance(); |
88 | 88 | |
89 | - $this->disable_row_level_security =true; |
|
90 | - |
|
91 | - } |
|
92 | - |
|
93 | - function fill_in_additional_detail_fields() |
|
94 | - { |
|
95 | - global $locale; |
|
96 | - if(isset($this->contact_id) && $this->contact_id != "") |
|
97 | - { |
|
98 | - $query = "SELECT first_name, last_name from contacts where id='$this->contact_id' AND deleted=0"; |
|
99 | - $result =$this->db->query($query,true," Error filling in additional detail fields: "); |
|
100 | - // Get the id and the name. |
|
101 | - $row = $this->db->fetchByAssoc($result); |
|
102 | - |
|
103 | - if($row != null) |
|
104 | - { |
|
105 | - $this->contact_name = $locale->getLocaleFormattedName($row['first_name'], $row['last_name']); |
|
106 | - } |
|
107 | - } |
|
108 | - |
|
109 | - if(isset($this->opportunity_id) && $this->opportunity_id != "") |
|
110 | - { |
|
111 | - $query = "SELECT name from opportunities where id='$this->opportunity_id' AND deleted=0"; |
|
112 | - $result =$this->db->query($query,true," Error filling in additional detail fields: "); |
|
113 | - // Get the id and the name. |
|
114 | - $row = $this->db->fetchByAssoc($result); |
|
115 | - |
|
116 | - if($row != null) |
|
117 | - { |
|
118 | - $this->opportunity_name = $row['name']; |
|
119 | - } |
|
120 | - } |
|
121 | - |
|
122 | - } |
|
89 | + $this->disable_row_level_security =true; |
|
90 | + |
|
91 | + } |
|
92 | + |
|
93 | + function fill_in_additional_detail_fields() |
|
94 | + { |
|
95 | + global $locale; |
|
96 | + if(isset($this->contact_id) && $this->contact_id != "") |
|
97 | + { |
|
98 | + $query = "SELECT first_name, last_name from contacts where id='$this->contact_id' AND deleted=0"; |
|
99 | + $result =$this->db->query($query,true," Error filling in additional detail fields: "); |
|
100 | + // Get the id and the name. |
|
101 | + $row = $this->db->fetchByAssoc($result); |
|
102 | + |
|
103 | + if($row != null) |
|
104 | + { |
|
105 | + $this->contact_name = $locale->getLocaleFormattedName($row['first_name'], $row['last_name']); |
|
106 | + } |
|
107 | + } |
|
108 | + |
|
109 | + if(isset($this->opportunity_id) && $this->opportunity_id != "") |
|
110 | + { |
|
111 | + $query = "SELECT name from opportunities where id='$this->opportunity_id' AND deleted=0"; |
|
112 | + $result =$this->db->query($query,true," Error filling in additional detail fields: "); |
|
113 | + // Get the id and the name. |
|
114 | + $row = $this->db->fetchByAssoc($result); |
|
115 | + |
|
116 | + if($row != null) |
|
117 | + { |
|
118 | + $this->opportunity_name = $row['name']; |
|
119 | + } |
|
120 | + } |
|
121 | + |
|
122 | + } |
|
123 | 123 | } |
124 | 124 | |
125 | 125 |