Test Failed
Push — CI ( 785a66...02428e )
by Adam
54:23
created
modules/Meetings/SubPanelViewInvitees.php 3 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
2
+if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
3 3
 /*********************************************************************************
4 4
  * SugarCRM Community Edition is a customer relationship management program developed by
5 5
  * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
@@ -79,14 +79,14 @@  discard block
 block discarded – undo
79 79
 
80 80
 // Stick the form header out there.
81 81
 echo get_form_header($mod_strings['LBL_INVITEE'], $button, false);
82
-$xtpl=new XTemplate ('modules/Meetings/SubPanelViewInvitees.html');
82
+$xtpl = new XTemplate('modules/Meetings/SubPanelViewInvitees.html');
83 83
 $xtpl->assign("MOD", $mod_strings);
84 84
 $xtpl->assign("APP", $app_strings);
85 85
 $xtpl->assign("RETURN_URL", "&return_module=$currentModule&return_action=DetailView&return_id=$focus->id");
86 86
 $xtpl->assign("MEETING_ID", $focus->id);
87 87
 
88 88
 $oddRow = true;
89
-foreach($focus_users_list as $user)
89
+foreach ($focus_users_list as $user)
90 90
 {
91 91
 	$user_fields = array(
92 92
 		'USER_NAME' => $user->user_name,
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 
99 99
 	$xtpl->assign("USER", $user_fields);
100 100
 
101
-	if($oddRow)
101
+	if ($oddRow)
102 102
     {
103 103
         //todo move to themes
104 104
 		$xtpl->assign("ROW_COLOR", 'oddListRow');
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
 $xtpl->out("users");
119 119
 
120 120
 $oddRow = true;
121
-foreach($focus_contacts_list as $contact)
121
+foreach ($focus_contacts_list as $contact)
122 122
 {
123 123
 	$contact_fields = array(
124 124
 		'FIRST_NAME' => $contact->first_name,
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
 
132 132
 	$xtpl->assign("CONTACT", $contact_fields);
133 133
 
134
-	if($oddRow)
134
+	if ($oddRow)
135 135
     {
136 136
         //todo move to themes
137 137
 		$xtpl->assign("ROW_COLOR", 'oddListRow');
Please login to merge, or discard this patch.
Indentation   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -88,29 +88,29 @@  discard block
 block discarded – undo
88 88
 $oddRow = true;
89 89
 foreach($focus_users_list as $user)
90 90
 {
91
-	$user_fields = array(
92
-		'USER_NAME' => $user->user_name,
93
-		'FULL_NAME' => $locale->getLocaleFormattedName($user->first_name, $user->last_name),
94
-		'ID' => $user->id,
95
-		'EMAIL' => $user->email1,
96
-		'PHONE_WORK' => $user->phone_work
97
-	);
91
+    $user_fields = array(
92
+        'USER_NAME' => $user->user_name,
93
+        'FULL_NAME' => $locale->getLocaleFormattedName($user->first_name, $user->last_name),
94
+        'ID' => $user->id,
95
+        'EMAIL' => $user->email1,
96
+        'PHONE_WORK' => $user->phone_work
97
+    );
98 98
 
99
-	$xtpl->assign("USER", $user_fields);
99
+    $xtpl->assign("USER", $user_fields);
100 100
 
101
-	if($oddRow)
101
+    if($oddRow)
102 102
     {
103 103
         //todo move to themes
104
-		$xtpl->assign("ROW_COLOR", 'oddListRow');
104
+        $xtpl->assign("ROW_COLOR", 'oddListRow');
105 105
     }
106 106
     else
107 107
     {
108 108
         //todo move to themes
109
-		$xtpl->assign("ROW_COLOR", 'evenListRow');
109
+        $xtpl->assign("ROW_COLOR", 'evenListRow');
110 110
     }
111 111
     $oddRow = !$oddRow;
112 112
 
113
-	$xtpl->parse("users.row");
113
+    $xtpl->parse("users.row");
114 114
 // Put the rows in.
115 115
 }
116 116
 
@@ -120,30 +120,30 @@  discard block
 block discarded – undo
120 120
 $oddRow = true;
121 121
 foreach($focus_contacts_list as $contact)
122 122
 {
123
-	$contact_fields = array(
124
-		'FIRST_NAME' => $contact->first_name,
125
-		'LAST_NAME' => $contact->last_name,
126
-		'ACCOUNT_NAME' => $contact->account_name,
127
-		'ID' => $contact->id,
128
-		'EMAIL' => $contact->email1,
129
-		'PHONE_WORK' => $contact->phone_work
130
-	);
131
-
132
-	$xtpl->assign("CONTACT", $contact_fields);
133
-
134
-	if($oddRow)
123
+    $contact_fields = array(
124
+        'FIRST_NAME' => $contact->first_name,
125
+        'LAST_NAME' => $contact->last_name,
126
+        'ACCOUNT_NAME' => $contact->account_name,
127
+        'ID' => $contact->id,
128
+        'EMAIL' => $contact->email1,
129
+        'PHONE_WORK' => $contact->phone_work
130
+    );
131
+
132
+    $xtpl->assign("CONTACT", $contact_fields);
133
+
134
+    if($oddRow)
135 135
     {
136 136
         //todo move to themes
137
-		$xtpl->assign("ROW_COLOR", 'oddListRow');
137
+        $xtpl->assign("ROW_COLOR", 'oddListRow');
138 138
     }
139 139
     else
140 140
     {
141 141
         //todo move to themes
142
-		$xtpl->assign("ROW_COLOR", 'evenListRow');
142
+        $xtpl->assign("ROW_COLOR", 'evenListRow');
143 143
     }
144 144
     $oddRow = !$oddRow;
145 145
 
146
-	$xtpl->parse("contacts.row");
146
+    $xtpl->parse("contacts.row");
147 147
 // Put the rows in.
148 148
 }
149 149
 
Please login to merge, or discard this patch.
Braces   +13 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,5 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
2
+if(!defined('sugarEntry') || !sugarEntry) {
3
+    die('Not A Valid Entry Point');
4
+}
3 5
 /*********************************************************************************
4 6
  * SugarCRM Community Edition is a customer relationship management program developed by
5 7
  * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
@@ -65,14 +67,19 @@  discard block
 block discarded – undo
65 67
 
66 68
 $button  = "<table cellspacing='0' cellpadding='1' border='0'><form border='0' action='index.php' method='post' name='form' id='form'>\n";
67 69
 $button .= "<input type='hidden' name='module' value='Contacts'>\n";
68
-if ($currentModule == 'Accounts') $button .= "<input type='hidden' name='account_id' value='$focus->id'>\n<input type='hidden' name='account_name' value='$focus->name'>\n";
70
+if ($currentModule == 'Accounts') {
71
+    $button .= "<input type='hidden' name='account_id' value='$focus->id'>\n<input type='hidden' name='account_name' value='$focus->name'>\n";
72
+}
69 73
 $button .= "<input type='hidden' name='return_module' value='".$currentModule."'>\n";
70 74
 $button .= "<input type='hidden' name='return_action' value='".$action."'>\n";
71 75
 $button .= "<input type='hidden' name='return_id' value='".$focus->id."'>\n";
72 76
 $button .= "<input type='hidden' name='action'>\n";
73 77
 $button .= "<tr><td>&nbsp;</td>";
74
-if ($focus->parent_type == "Accounts") $button .= "<td><input title='".$app_strings['LBL_SELECT_CONTACT_BUTTON_TITLE']."' type='button' class='button' value='".$app_strings['LBL_SELECT_CONTACT_BUTTON_LABEL']."' name='button' LANGUAGE=javascript onclick='window.open(\"index.php?module=Contacts&action=Popup&html=Popup_picker&form=DetailView&form_submit=true&query=true&account_id=$focus->parent_id&account_name=".urlencode($focus->parent_name)."\",\"new\",\"width=600,height=400,resizable=1,scrollbars=1\");'></td>\n";
75
-else $button .= "<td><input title='".$app_strings['LBL_SELECT_CONTACT_BUTTON_TITLE']."'  type='button' class='button' value='".$app_strings['LBL_SELECT_CONTACT_BUTTON_LABEL']."' name='button' LANGUAGE=javascript onclick='window.open(\"index.php?module=Contacts&action=Popup&html=Popup_picker&form=DetailView&form_submit=true\",\"new\",\"width=600,height=400,resizable=1,scrollbars=1\");'></td>\n";
78
+if ($focus->parent_type == "Accounts") {
79
+    $button .= "<td><input title='".$app_strings['LBL_SELECT_CONTACT_BUTTON_TITLE']."' type='button' class='button' value='".$app_strings['LBL_SELECT_CONTACT_BUTTON_LABEL']."' name='button' LANGUAGE=javascript onclick='window.open(\"index.php?module=Contacts&action=Popup&html=Popup_picker&form=DetailView&form_submit=true&query=true&account_id=$focus->parent_id&account_name=".urlencode($focus->parent_name)."\",\"new\",\"width=600,height=400,resizable=1,scrollbars=1\");'></td>\n";
80
+} else {
81
+    $button .= "<td><input title='".$app_strings['LBL_SELECT_CONTACT_BUTTON_TITLE']."'  type='button' class='button' value='".$app_strings['LBL_SELECT_CONTACT_BUTTON_LABEL']."' name='button' LANGUAGE=javascript onclick='window.open(\"index.php?module=Contacts&action=Popup&html=Popup_picker&form=DetailView&form_submit=true\",\"new\",\"width=600,height=400,resizable=1,scrollbars=1\");'></td>\n";
82
+}
76 83
 $button .= "<td><input title='".$app_strings['LBL_SELECT_USER_BUTTON_TITLE']."'  type='button' class='button' value='".$app_strings['LBL_SELECT_USER_BUTTON_LABEL']."' name='button' LANGUAGE=javascript onclick='window.open(\"index.php?module=Users&action=Popup&html=Popup_picker&form=DetailView&form_submit=true\",\"new\",\"width=600,height=400,resizable=1,scrollbars=1\");'></td>\n";
77 84
 $button .= "</tr></form></table>\n";
78 85
 
@@ -102,8 +109,7 @@  discard block
 block discarded – undo
102 109
     {
103 110
         //todo move to themes
104 111
 		$xtpl->assign("ROW_COLOR", 'oddListRow');
105
-    }
106
-    else
112
+    } else
107 113
     {
108 114
         //todo move to themes
109 115
 		$xtpl->assign("ROW_COLOR", 'evenListRow');
@@ -135,8 +141,7 @@  discard block
 block discarded – undo
135 141
     {
136 142
         //todo move to themes
137 143
 		$xtpl->assign("ROW_COLOR", 'oddListRow');
138
-    }
139
-    else
144
+    } else
140 145
     {
141 146
         //todo move to themes
142 147
 		$xtpl->assign("ROW_COLOR", 'evenListRow');
Please login to merge, or discard this patch.
modules/Meetings/Meeting.php 4 patches
Indentation   +633 added lines, -633 removed lines patch added patch discarded remove patch
@@ -40,136 +40,136 @@  discard block
 block discarded – undo
40 40
 
41 41
 
42 42
 class Meeting extends SugarBean {
43
-	// Stored fields
44
-	var $id;
45
-	var $date_entered;
46
-	var $date_modified;
47
-	var $assigned_user_id;
48
-	var $modified_user_id;
49
-	var $created_by;
50
-	var $created_by_name;
51
-	var $modified_by_name;
52
-	var $description;
53
-	var $name;
54
-	var $location;
55
-	var $status;
56
-	var $type;
57
-	var $date_start;
58
-	var $time_start;
59
-	var $date_end;
60
-	var $duration_hours;
61
-	var $duration_minutes;
62
-	var $time_meridiem;
63
-	var $parent_type;
64
-	var $parent_type_options;
65
-	var $parent_id;
66
-	var $field_name_map;
67
-	var $contact_id;
68
-	var $user_id;
69
-	var $meeting_id;
70
-	var $reminder_time;
71
-	var $reminder_checked;
72
-	var $email_reminder_time;
73
-	var $email_reminder_checked;
74
-	var $email_reminder_sent;
75
-	var $required;
76
-	var $accept_status;
77
-	var $parent_name;
78
-	var $contact_name;
79
-	var $contact_phone;
80
-	var $contact_email;
81
-	var $account_id;
82
-	var $opportunity_id;
83
-	var $case_id;
84
-	var $assigned_user_name;
85
-	var $outlook_id;
86
-	var $sequence;
87
-	var $syncing = false;
88
-	var $recurring_source;
89
-
90
-	var $update_vcal = true;
91
-	var $contacts_arr;
92
-	var $users_arr;
93
-	var $meetings_arr;
94
-	// when assoc w/ a user/contact:
95
-	var $minutes_value_default = 15;
96
-	var $minutes_values = array('0'=>'00','15'=>'15','30'=>'30','45'=>'45');
97
-	var $table_name = "meetings";
98
-	var $rel_users_table = "meetings_users";
99
-	var $rel_contacts_table = "meetings_contacts";
100
-	var $rel_leads_table = "meetings_leads";
101
-	var $module_dir = "Meetings";
102
-	var $object_name = "Meeting";
103
-
104
-	var $importable = true;
105
-	// This is used to retrieve related fields from form posts.
106
-	var $additional_column_fields = array('assigned_user_name', 'assigned_user_id', 'contact_id', 'user_id', 'contact_name', 'accept_status');
107
-	var $relationship_fields = array('account_id'=>'accounts','opportunity_id'=>'opportunity','case_id'=>'case',
108
-									 'assigned_user_id'=>'users','contact_id'=>'contacts', 'user_id'=>'users', 'meeting_id'=>'meetings');
109
-	// so you can run get_users() twice and run query only once
110
-	var $cached_get_users = null;
111
-	var $new_schema = true;
43
+    // Stored fields
44
+    var $id;
45
+    var $date_entered;
46
+    var $date_modified;
47
+    var $assigned_user_id;
48
+    var $modified_user_id;
49
+    var $created_by;
50
+    var $created_by_name;
51
+    var $modified_by_name;
52
+    var $description;
53
+    var $name;
54
+    var $location;
55
+    var $status;
56
+    var $type;
57
+    var $date_start;
58
+    var $time_start;
59
+    var $date_end;
60
+    var $duration_hours;
61
+    var $duration_minutes;
62
+    var $time_meridiem;
63
+    var $parent_type;
64
+    var $parent_type_options;
65
+    var $parent_id;
66
+    var $field_name_map;
67
+    var $contact_id;
68
+    var $user_id;
69
+    var $meeting_id;
70
+    var $reminder_time;
71
+    var $reminder_checked;
72
+    var $email_reminder_time;
73
+    var $email_reminder_checked;
74
+    var $email_reminder_sent;
75
+    var $required;
76
+    var $accept_status;
77
+    var $parent_name;
78
+    var $contact_name;
79
+    var $contact_phone;
80
+    var $contact_email;
81
+    var $account_id;
82
+    var $opportunity_id;
83
+    var $case_id;
84
+    var $assigned_user_name;
85
+    var $outlook_id;
86
+    var $sequence;
87
+    var $syncing = false;
88
+    var $recurring_source;
89
+
90
+    var $update_vcal = true;
91
+    var $contacts_arr;
92
+    var $users_arr;
93
+    var $meetings_arr;
94
+    // when assoc w/ a user/contact:
95
+    var $minutes_value_default = 15;
96
+    var $minutes_values = array('0'=>'00','15'=>'15','30'=>'30','45'=>'45');
97
+    var $table_name = "meetings";
98
+    var $rel_users_table = "meetings_users";
99
+    var $rel_contacts_table = "meetings_contacts";
100
+    var $rel_leads_table = "meetings_leads";
101
+    var $module_dir = "Meetings";
102
+    var $object_name = "Meeting";
103
+
104
+    var $importable = true;
105
+    // This is used to retrieve related fields from form posts.
106
+    var $additional_column_fields = array('assigned_user_name', 'assigned_user_id', 'contact_id', 'user_id', 'contact_name', 'accept_status');
107
+    var $relationship_fields = array('account_id'=>'accounts','opportunity_id'=>'opportunity','case_id'=>'case',
108
+                                        'assigned_user_id'=>'users','contact_id'=>'contacts', 'user_id'=>'users', 'meeting_id'=>'meetings');
109
+    // so you can run get_users() twice and run query only once
110
+    var $cached_get_users = null;
111
+    var $new_schema = true;
112 112
     var $date_changed = false;
113 113
 
114
-	/**
115
-	 * sole constructor
116
-	 */
117
-	function Meeting() {
118
-		parent::SugarBean();
119
-		$this->setupCustomFields('Meetings');
120
-		foreach($this->field_defs as $field) {
121
-			$this->field_name_map[$field['name']] = $field;
122
-		}
114
+    /**
115
+     * sole constructor
116
+     */
117
+    function Meeting() {
118
+        parent::SugarBean();
119
+        $this->setupCustomFields('Meetings');
120
+        foreach($this->field_defs as $field) {
121
+            $this->field_name_map[$field['name']] = $field;
122
+        }
123 123
 //		$this->fill_in_additional_detail_fields();
124 124
         if(!empty($GLOBALS['app_list_strings']['duration_intervals'])) {
125 125
             $this->minutes_values = $GLOBALS['app_list_strings']['duration_intervals'];
126 126
         }
127
-	}
128
-
129
-	/**
130
-	 * Disable edit if meeting is recurring and source is not Sugar. It should be edited only from Outlook.
131
-	 * @param $view string
132
-	 * @param $is_owner bool
133
-	 */
134
-	function ACLAccess($view,$is_owner='not_set',$in_group='not_set'){
135
-		// don't check if meeting is being synced from Outlook
136
-		if($this->syncing == false){
137
-			$view = strtolower($view);
138
-			switch($view){
139
-				case 'edit':
140
-				case 'save':
141
-				case 'editview':
142
-				case 'delete':
143
-					if(!empty($this->recurring_source) && $this->recurring_source != "Sugar"){
144
-						return false;
145
-					}
146
-			}
147
-		}
148
-		return parent::ACLAccess($view,$is_owner,$in_group);
149
-	}
150
-
151
-	/**
152
-	 * Stub for integration
153
-	 * @return bool
154
-	 */
155
-	function hasIntegratedMeeting() {
156
-		return false;
157
-	}
158
-
159
-	// save date_end by calculating user input
160
-	// this is for calendar
161
-	function save($check_notify = FALSE) {
162
-		global $timedate;
163
-		global $current_user;
164
-
165
-		global $disable_date_format;
127
+    }
128
+
129
+    /**
130
+     * Disable edit if meeting is recurring and source is not Sugar. It should be edited only from Outlook.
131
+     * @param $view string
132
+     * @param $is_owner bool
133
+     */
134
+    function ACLAccess($view,$is_owner='not_set',$in_group='not_set'){
135
+        // don't check if meeting is being synced from Outlook
136
+        if($this->syncing == false){
137
+            $view = strtolower($view);
138
+            switch($view){
139
+                case 'edit':
140
+                case 'save':
141
+                case 'editview':
142
+                case 'delete':
143
+                    if(!empty($this->recurring_source) && $this->recurring_source != "Sugar"){
144
+                        return false;
145
+                    }
146
+            }
147
+        }
148
+        return parent::ACLAccess($view,$is_owner,$in_group);
149
+    }
150
+
151
+    /**
152
+     * Stub for integration
153
+     * @return bool
154
+     */
155
+    function hasIntegratedMeeting() {
156
+        return false;
157
+    }
158
+
159
+    // save date_end by calculating user input
160
+    // this is for calendar
161
+    function save($check_notify = FALSE) {
162
+        global $timedate;
163
+        global $current_user;
164
+
165
+        global $disable_date_format;
166 166
 
167 167
         if(isset($this->date_start))
168 168
         {
169 169
             $td = $timedate->fromDb($this->date_start);
170 170
             if(!$td){
171
-            		$this->date_start = $timedate->to_db($this->date_start);
172
-            		$td = $timedate->fromDb($this->date_start);
171
+                    $this->date_start = $timedate->to_db($this->date_start);
172
+                    $td = $timedate->fromDb($this->date_start);
173 173
             }
174 174
             if($td)
175 175
             {
@@ -185,30 +185,30 @@  discard block
 block discarded – undo
185 185
             }
186 186
         }
187 187
 
188
-		$check_notify =(!empty($_REQUEST['send_invites']) && $_REQUEST['send_invites'] == '1') ? true : false;
189
-		if(empty($_REQUEST['send_invites'])) {
190
-			if(!empty($this->id)) {
191
-				$old_record = new Meeting();
192
-				$old_record->retrieve($this->id);
193
-				$old_assigned_user_id = $old_record->assigned_user_id;
194
-			}
195
-			if((empty($this->id) && isset($_REQUEST['assigned_user_id']) && !empty($_REQUEST['assigned_user_id']) && $GLOBALS['current_user']->id != $_REQUEST['assigned_user_id']) || (isset($old_assigned_user_id) && !empty($old_assigned_user_id) && isset($_REQUEST['assigned_user_id']) && !empty($_REQUEST['assigned_user_id']) && $old_assigned_user_id != $_REQUEST['assigned_user_id']) ){
196
-				$this->special_notification = true;
197
-				$check_notify = true;
188
+        $check_notify =(!empty($_REQUEST['send_invites']) && $_REQUEST['send_invites'] == '1') ? true : false;
189
+        if(empty($_REQUEST['send_invites'])) {
190
+            if(!empty($this->id)) {
191
+                $old_record = new Meeting();
192
+                $old_record->retrieve($this->id);
193
+                $old_assigned_user_id = $old_record->assigned_user_id;
194
+            }
195
+            if((empty($this->id) && isset($_REQUEST['assigned_user_id']) && !empty($_REQUEST['assigned_user_id']) && $GLOBALS['current_user']->id != $_REQUEST['assigned_user_id']) || (isset($old_assigned_user_id) && !empty($old_assigned_user_id) && isset($_REQUEST['assigned_user_id']) && !empty($_REQUEST['assigned_user_id']) && $old_assigned_user_id != $_REQUEST['assigned_user_id']) ){
196
+                $this->special_notification = true;
197
+                $check_notify = true;
198 198
                 if(isset($_REQUEST['assigned_user_name'])) {
199 199
                     $this->new_assigned_user_name = $_REQUEST['assigned_user_name'];
200 200
                 }
201
-			}
202
-		}
203
-		/*nsingh 7/3/08  commenting out as bug #20814 is invalid
201
+            }
202
+        }
203
+        /*nsingh 7/3/08  commenting out as bug #20814 is invalid
204 204
 		if($current_user->getPreference('reminder_time')!= -1 &&  isset($_POST['reminder_checked']) && isset($_POST['reminder_time']) && $_POST['reminder_checked']==0  && $_POST['reminder_time']==-1){
205 205
 			$this->reminder_checked = '1';
206 206
 			$this->reminder_time = $current_user->getPreference('reminder_time');
207 207
 		}*/
208 208
 
209
-		// prevent a mass mailing for recurring meetings created in Calendar module
210
-		if(empty($this->id) && !empty($_REQUEST['module']) && $_REQUEST['module'] == "Calendar" && !empty($_REQUEST['repeat_type']) && !empty($this->repeat_parent_id))
211
-			$check_notify = false;
209
+        // prevent a mass mailing for recurring meetings created in Calendar module
210
+        if(empty($this->id) && !empty($_REQUEST['module']) && $_REQUEST['module'] == "Calendar" && !empty($_REQUEST['repeat_type']) && !empty($this->repeat_parent_id))
211
+            $check_notify = false;
212 212
 
213 213
         if (empty($this->status) ) {
214 214
             $this->status = $this->getDefaultStatus();
@@ -229,8 +229,8 @@  discard block
 block discarded – undo
229 229
         }
230 230
 
231 231
         if (empty($this->type)) {
232
-			$this->type = 'Sugar';
233
-		}
232
+            $this->type = 'Sugar';
233
+        }
234 234
 
235 235
         if ( isset($api) && is_a($api,'WebMeeting') && empty($this->in_relationship_update) ) {
236 236
             // Make sure the API initialized and it supports Web Meetings
@@ -258,175 +258,175 @@  discard block
 block discarded – undo
258 258
             $api->logoff();
259 259
         }
260 260
 
261
-		$return_id = parent::save($check_notify);
261
+        $return_id = parent::save($check_notify);
262 262
 
263
-		if($this->update_vcal) {
264
-			vCal::cache_sugar_vcal($current_user);
265
-		}
263
+        if($this->update_vcal) {
264
+            vCal::cache_sugar_vcal($current_user);
265
+        }
266 266
 
267
-		if(isset($_REQUEST['reminders_data'])) {
268
-			Reminder::saveRemindersDataJson('Meetings', $return_id, html_entity_decode($_REQUEST['reminders_data']));
269
-		}
267
+        if(isset($_REQUEST['reminders_data'])) {
268
+            Reminder::saveRemindersDataJson('Meetings', $return_id, html_entity_decode($_REQUEST['reminders_data']));
269
+        }
270 270
 
271 271
 
272
-		return $return_id;
273
-	}
272
+        return $return_id;
273
+    }
274 274
 
275
-	// this is for calendar
276
-	function mark_deleted($id) {
275
+    // this is for calendar
276
+    function mark_deleted($id) {
277 277
 
278
-		require_once("modules/Calendar/CalendarUtils.php");
279
-		CalendarUtils::correctRecurrences($this, $id);		
278
+        require_once("modules/Calendar/CalendarUtils.php");
279
+        CalendarUtils::correctRecurrences($this, $id);		
280 280
 		
281
-		global $current_user;
281
+        global $current_user;
282 282
 
283
-		parent::mark_deleted($id);
283
+        parent::mark_deleted($id);
284 284
 
285
-		if($this->update_vcal) {
286
-			vCal::cache_sugar_vcal($current_user);
287
-		}
288
-	}
285
+        if($this->update_vcal) {
286
+            vCal::cache_sugar_vcal($current_user);
287
+        }
288
+    }
289 289
 
290
-	function get_summary_text() {
291
-		return "$this->name";
292
-	}
290
+    function get_summary_text() {
291
+        return "$this->name";
292
+    }
293 293
 
294 294
     function create_export_query($order_by, $where, $relate_link_join='')
295 295
     {
296 296
         $custom_join = $this->getCustomJoin(true, true, $where);
297 297
         $custom_join['join'] .= $relate_link_join;
298
-		$contact_required = stristr($where, "contacts");
298
+        $contact_required = stristr($where, "contacts");
299 299
 
300
-		if($contact_required) {
301
-			$query = "SELECT meetings.*, contacts.first_name, contacts.last_name, contacts.assigned_user_id contact_name_owner, users.user_name as assigned_user_name   ";
300
+        if($contact_required) {
301
+            $query = "SELECT meetings.*, contacts.first_name, contacts.last_name, contacts.assigned_user_id contact_name_owner, users.user_name as assigned_user_name   ";
302 302
             $query .= $custom_join['select'];
303
-			$query .= " FROM contacts, meetings, meetings_contacts ";
304
-			$where_auto = " meetings_contacts.contact_id = contacts.id AND meetings_contacts.meeting_id = meetings.id AND meetings.deleted=0 AND contacts.deleted=0";
305
-		} else {
306
-			$query = 'SELECT meetings.*, users.user_name as assigned_user_name  ';
303
+            $query .= " FROM contacts, meetings, meetings_contacts ";
304
+            $where_auto = " meetings_contacts.contact_id = contacts.id AND meetings_contacts.meeting_id = meetings.id AND meetings.deleted=0 AND contacts.deleted=0";
305
+        } else {
306
+            $query = 'SELECT meetings.*, users.user_name as assigned_user_name  ';
307 307
             $query .= $custom_join['select'];
308
-			$query .= ' FROM meetings ';
309
-			$where_auto = "meetings.deleted=0";
310
-		}
311
-		$query .= "  LEFT JOIN users ON meetings.assigned_user_id=users.id ";
308
+            $query .= ' FROM meetings ';
309
+            $where_auto = "meetings.deleted=0";
310
+        }
311
+        $query .= "  LEFT JOIN users ON meetings.assigned_user_id=users.id ";
312 312
 
313 313
         $query .= $custom_join['join'];
314 314
 
315
-		if($where != "")
316
-			$query .= " where $where AND ".$where_auto;
317
-		else
318
-			$query .= " where ".$where_auto;
315
+        if($where != "")
316
+            $query .= " where $where AND ".$where_auto;
317
+        else
318
+            $query .= " where ".$where_auto;
319 319
 
320 320
         $order_by = $this->process_order_by($order_by);
321 321
         if (!empty($order_by)) {
322 322
             $query .= ' ORDER BY ' . $order_by;
323 323
         }
324 324
 
325
-		return $query;
326
-	}
327
-
328
-
329
-
330
-	function fill_in_additional_detail_fields() {
331
-		global $locale;
332
-		// Fill in the assigned_user_name
333
-		$this->assigned_user_name = get_assigned_user_name($this->assigned_user_id);
334
-
335
-		if (!empty($this->contact_id)) {
336
-			$query  = "SELECT first_name, last_name FROM contacts ";
337
-			$query .= "WHERE id='$this->contact_id' AND deleted=0";
338
-			$result = $this->db->limitQuery($query,0,1,true," Error filling in additional detail fields: ");
325
+        return $query;
326
+    }
339 327
 
340
-			// Get the contact name.
341
-			$row = $this->db->fetchByAssoc($result);
342
-			$GLOBALS['log']->info("additional call fields $query");
343
-			if($row != null)
344
-			{
345
-				$this->contact_name = $locale->getLocaleFormattedName($row['first_name'], $row['last_name'], '', '');
346
-				$GLOBALS['log']->debug("Call($this->id): contact_name = $this->contact_name");
347
-				$GLOBALS['log']->debug("Call($this->id): contact_id = $this->contact_id");
348
-			}
349
-		}
350 328
 
351 329
 
330
+    function fill_in_additional_detail_fields() {
331
+        global $locale;
332
+        // Fill in the assigned_user_name
333
+        $this->assigned_user_name = get_assigned_user_name($this->assigned_user_id);
352 334
 
353
-		$this->created_by_name = get_assigned_user_name($this->created_by);
354
-		$this->modified_by_name = get_assigned_user_name($this->modified_user_id);
355
-		$this->fill_in_additional_parent_fields();
335
+        if (!empty($this->contact_id)) {
336
+            $query  = "SELECT first_name, last_name FROM contacts ";
337
+            $query .= "WHERE id='$this->contact_id' AND deleted=0";
338
+            $result = $this->db->limitQuery($query,0,1,true," Error filling in additional detail fields: ");
356 339
 
357
-		if (!isset($this->time_hour_start)) {
358
-			$this->time_start_hour = intval(substr($this->time_start, 0, 2));
359
-		} //if-else
340
+            // Get the contact name.
341
+            $row = $this->db->fetchByAssoc($result);
342
+            $GLOBALS['log']->info("additional call fields $query");
343
+            if($row != null)
344
+            {
345
+                $this->contact_name = $locale->getLocaleFormattedName($row['first_name'], $row['last_name'], '', '');
346
+                $GLOBALS['log']->debug("Call($this->id): contact_name = $this->contact_name");
347
+                $GLOBALS['log']->debug("Call($this->id): contact_id = $this->contact_id");
348
+            }
349
+        }
360 350
 
361
-		if (isset($this->time_minute_start)) {
362
-			$time_start_minutes = $this->time_minute_start;
363
-		} else {
364
-			$time_start_minutes = substr($this->time_start, 3, 5);
365
-			if ($time_start_minutes > 0 && $time_start_minutes < 15) {
366
-				$time_start_minutes = "15";
367
-			} else if ($time_start_minutes > 15 && $time_start_minutes < 30) {
368
-				$time_start_minutes = "30";
369
-			} else if ($time_start_minutes > 30 && $time_start_minutes < 45) {
370
-				$time_start_minutes = "45";
371
-			} else if ($time_start_minutes > 45) {
372
-				$this->time_start_hour += 1;
373
-				$time_start_minutes = "00";
374
-		    } //if-else
375
-		} //if-else
376 351
 
377 352
 
378
-		if (isset($this->time_hour_start)) {
379
-			$time_start_hour = $this->time_hour_start;
380
-		} else {
381
-			$time_start_hour = intval(substr($this->time_start, 0, 2));
382
-		}
353
+        $this->created_by_name = get_assigned_user_name($this->created_by);
354
+        $this->modified_by_name = get_assigned_user_name($this->modified_user_id);
355
+        $this->fill_in_additional_parent_fields();
356
+
357
+        if (!isset($this->time_hour_start)) {
358
+            $this->time_start_hour = intval(substr($this->time_start, 0, 2));
359
+        } //if-else
360
+
361
+        if (isset($this->time_minute_start)) {
362
+            $time_start_minutes = $this->time_minute_start;
363
+        } else {
364
+            $time_start_minutes = substr($this->time_start, 3, 5);
365
+            if ($time_start_minutes > 0 && $time_start_minutes < 15) {
366
+                $time_start_minutes = "15";
367
+            } else if ($time_start_minutes > 15 && $time_start_minutes < 30) {
368
+                $time_start_minutes = "30";
369
+            } else if ($time_start_minutes > 30 && $time_start_minutes < 45) {
370
+                $time_start_minutes = "45";
371
+            } else if ($time_start_minutes > 45) {
372
+                $this->time_start_hour += 1;
373
+                $time_start_minutes = "00";
374
+            } //if-else
375
+        } //if-else
376
+
377
+
378
+        if (isset($this->time_hour_start)) {
379
+            $time_start_hour = $this->time_hour_start;
380
+        } else {
381
+            $time_start_hour = intval(substr($this->time_start, 0, 2));
382
+        }
383 383
 
384
-		global $timedate;
384
+        global $timedate;
385 385
         $this->time_meridiem = $timedate->AMPMMenu('', $this->time_start, 'onchange="SugarWidgetScheduler.update_time();"');
386
-		$hours_arr = array ();
387
-		$num_of_hours = 13;
388
-		$start_at = 1;
389
-
390
-		if (empty ($time_meridiem)) {
391
-			$num_of_hours = 24;
392
-			$start_at = 0;
393
-		} //if
394
-
395
-		for ($i = $start_at; $i < $num_of_hours; $i ++) {
396
-			$i = $i."";
397
-			if (strlen($i) == 1) {
398
-				$i = "0".$i;
399
-			}
400
-			$hours_arr[$i] = $i;
401
-		} //for
386
+        $hours_arr = array ();
387
+        $num_of_hours = 13;
388
+        $start_at = 1;
389
+
390
+        if (empty ($time_meridiem)) {
391
+            $num_of_hours = 24;
392
+            $start_at = 0;
393
+        } //if
394
+
395
+        for ($i = $start_at; $i < $num_of_hours; $i ++) {
396
+            $i = $i."";
397
+            if (strlen($i) == 1) {
398
+                $i = "0".$i;
399
+            }
400
+            $hours_arr[$i] = $i;
401
+        } //for
402 402
 
403 403
         if (!isset($this->duration_minutes)) {
404
-			$this->duration_minutes = $this->minutes_value_default;
405
-		}
404
+            $this->duration_minutes = $this->minutes_value_default;
405
+        }
406 406
 
407 407
         //setting default date and time
408
-		if (is_null($this->date_start))
409
-			$this->date_start = $timedate->now();
410
-		if (is_null($this->time_start))
411
-			$this->time_start = $timedate->to_display_time(TimeDate::getInstance()->nowDb(), true);
412
-		if (is_null($this->duration_hours)) {
413
-			$this->duration_hours = "0";
414
-		}
415
-		if (is_null($this->duration_minutes))
416
-			$this->duration_minutes = "1";
417
-
418
-		if(empty($this->id) && !empty($_REQUEST['date_start'])){
419
-			$this->date_start = $_REQUEST['date_start'];
420
-		}
408
+        if (is_null($this->date_start))
409
+            $this->date_start = $timedate->now();
410
+        if (is_null($this->time_start))
411
+            $this->time_start = $timedate->to_display_time(TimeDate::getInstance()->nowDb(), true);
412
+        if (is_null($this->duration_hours)) {
413
+            $this->duration_hours = "0";
414
+        }
415
+        if (is_null($this->duration_minutes))
416
+            $this->duration_minutes = "1";
417
+
418
+        if(empty($this->id) && !empty($_REQUEST['date_start'])){
419
+            $this->date_start = $_REQUEST['date_start'];
420
+        }
421 421
         if(!empty($this->date_start))
422 422
         {
423 423
             $td = SugarDateTime::createFromFormat($GLOBALS['timedate']->get_date_time_format(),$this->date_start);
424 424
             if (!empty($td)) 
425 425
             {
426
-    	        if (!empty($this->duration_hours) && $this->duration_hours != '')
426
+                if (!empty($this->duration_hours) && $this->duration_hours != '')
427 427
                 {
428
-		            $td = $td->modify("+{$this->duration_hours} hours");
429
-		        }
428
+                    $td = $td->modify("+{$this->duration_hours} hours");
429
+                }
430 430
                 if (!empty($this->duration_minutes) && $this->duration_minutes != '')
431 431
                 {
432 432
                     $td = $td->modify("+{$this->duration_minutes} mins");
@@ -437,77 +437,77 @@  discard block
 block discarded – undo
437 437
             {
438 438
                 $GLOBALS['log']->fatal("Meeting::save: Bad date {$this->date_start} for format ".$GLOBALS['timedate']->get_date_time_format());
439 439
             }
440
-		}
441
-
442
-		global $app_list_strings;
443
-		$parent_types = $app_list_strings['record_type_display'];
444
-		$disabled_parent_types = ACLController::disabledModuleList($parent_types,false, 'list');
445
-		foreach($disabled_parent_types as $disabled_parent_type){
446
-			if($disabled_parent_type != $this->parent_type){
447
-				unset($parent_types[$disabled_parent_type]);
448
-			}
449
-		}
450
-
451
-		$this->parent_type_options = get_select_options_with_id($parent_types, $this->parent_type);
452
-		if (empty($this->reminder_time)) {
453
-			$this->reminder_time = -1;
454
-		}
455
-
456
-		if ( empty($this->id) ) {
457
-		    $reminder_t = $GLOBALS['current_user']->getPreference('reminder_time');
458
-		    if ( isset($reminder_t) )
459
-		        $this->reminder_time = $reminder_t;
460
-		}
461
-		$this->reminder_checked = $this->reminder_time == -1 ? false : true;
462
-
463
-		if (empty($this->email_reminder_time)) {
464
-			$this->email_reminder_time = -1;
465
-		}
466
-		if(empty($this->id)){ 
467
-			$reminder_t = $GLOBALS['current_user']->getPreference('email_reminder_time');
468
-			if(isset($reminder_t))
469
-		    		$this->email_reminder_time = $reminder_t;
470
-		}
471
-		$this->email_reminder_checked = $this->email_reminder_time == -1 ? false : true;
472
-
473
-		if (isset ($_REQUEST['parent_type']) && empty($this->parent_type)) {
474
-			$this->parent_type = $_REQUEST['parent_type'];
475
-		} elseif (is_null($this->parent_type)) {
476
-			$this->parent_type = $app_list_strings['record_type_default_key'];
477
-		}
478
-
479
-	}
480
-
481
-	function get_list_view_data() {
482
-		$meeting_fields = $this->get_list_view_array();
483
-
484
-		global $app_list_strings, $focus, $action, $currentModule;
485
-		if(isset($this->parent_type))
486
-			$meeting_fields['PARENT_MODULE'] = $this->parent_type;
487
-		if($this->status == "Planned") {
488
-			//cn: added this if() to deal with sequential Closes in Meetings.	this is a hack to a hack(formbase.php->handleRedirect)
489
-			if(empty($action))
490
-			     $action = "index";
440
+        }
441
+
442
+        global $app_list_strings;
443
+        $parent_types = $app_list_strings['record_type_display'];
444
+        $disabled_parent_types = ACLController::disabledModuleList($parent_types,false, 'list');
445
+        foreach($disabled_parent_types as $disabled_parent_type){
446
+            if($disabled_parent_type != $this->parent_type){
447
+                unset($parent_types[$disabled_parent_type]);
448
+            }
449
+        }
450
+
451
+        $this->parent_type_options = get_select_options_with_id($parent_types, $this->parent_type);
452
+        if (empty($this->reminder_time)) {
453
+            $this->reminder_time = -1;
454
+        }
455
+
456
+        if ( empty($this->id) ) {
457
+            $reminder_t = $GLOBALS['current_user']->getPreference('reminder_time');
458
+            if ( isset($reminder_t) )
459
+                $this->reminder_time = $reminder_t;
460
+        }
461
+        $this->reminder_checked = $this->reminder_time == -1 ? false : true;
462
+
463
+        if (empty($this->email_reminder_time)) {
464
+            $this->email_reminder_time = -1;
465
+        }
466
+        if(empty($this->id)){ 
467
+            $reminder_t = $GLOBALS['current_user']->getPreference('email_reminder_time');
468
+            if(isset($reminder_t))
469
+                    $this->email_reminder_time = $reminder_t;
470
+        }
471
+        $this->email_reminder_checked = $this->email_reminder_time == -1 ? false : true;
472
+
473
+        if (isset ($_REQUEST['parent_type']) && empty($this->parent_type)) {
474
+            $this->parent_type = $_REQUEST['parent_type'];
475
+        } elseif (is_null($this->parent_type)) {
476
+            $this->parent_type = $app_list_strings['record_type_default_key'];
477
+        }
478
+
479
+    }
480
+
481
+    function get_list_view_data() {
482
+        $meeting_fields = $this->get_list_view_array();
483
+
484
+        global $app_list_strings, $focus, $action, $currentModule;
485
+        if(isset($this->parent_type))
486
+            $meeting_fields['PARENT_MODULE'] = $this->parent_type;
487
+        if($this->status == "Planned") {
488
+            //cn: added this if() to deal with sequential Closes in Meetings.	this is a hack to a hack(formbase.php->handleRedirect)
489
+            if(empty($action))
490
+                    $action = "index";
491 491
             $setCompleteUrl = "<a id='{$this->id}' onclick='SUGAR.util.closeActivityPanel.show(\"{$this->module_dir}\",\"{$this->id}\",\"Held\",\"listview\",\"1\");'>";
492
-			if ($this->ACLAccess('edit')) {
492
+            if ($this->ACLAccess('edit')) {
493 493
                 $meeting_fields['SET_COMPLETE'] = $setCompleteUrl . SugarThemeRegistry::current()->getImage("close_inline"," border='0'",null,null,'.gif',translate('LBL_CLOSEINLINE'))."</a>";
494 494
             } else {
495 495
                 $meeting_fields['SET_COMPLETE'] = '';
496 496
             }
497
-		}
498
-		global $timedate;
499
-		$today = $timedate->nowDb();
500
-		$nextday = $timedate->asDbDate($timedate->getNow()->get("+1 day"));
501
-		$mergeTime = $meeting_fields['DATE_START']; //$timedate->merge_date_time($meeting_fields['DATE_START'], $meeting_fields['TIME_START']);
502
-		$date_db = $timedate->to_db($mergeTime);
503
-		if($date_db	< $today	) {
504
-			$meeting_fields['DATE_START']= "<font class='overdueTask'>".$meeting_fields['DATE_START']."</font>";
505
-		}else if($date_db	< $nextday) {
506
-			$meeting_fields['DATE_START'] = "<font class='todaysTask'>".$meeting_fields['DATE_START']."</font>";
507
-		} else {
508
-			$meeting_fields['DATE_START'] = "<font class='futureTask'>".$meeting_fields['DATE_START']."</font>";
509
-		}
510
-		$this->fill_in_additional_detail_fields();
497
+        }
498
+        global $timedate;
499
+        $today = $timedate->nowDb();
500
+        $nextday = $timedate->asDbDate($timedate->getNow()->get("+1 day"));
501
+        $mergeTime = $meeting_fields['DATE_START']; //$timedate->merge_date_time($meeting_fields['DATE_START'], $meeting_fields['TIME_START']);
502
+        $date_db = $timedate->to_db($mergeTime);
503
+        if($date_db	< $today	) {
504
+            $meeting_fields['DATE_START']= "<font class='overdueTask'>".$meeting_fields['DATE_START']."</font>";
505
+        }else if($date_db	< $nextday) {
506
+            $meeting_fields['DATE_START'] = "<font class='todaysTask'>".$meeting_fields['DATE_START']."</font>";
507
+        } else {
508
+            $meeting_fields['DATE_START'] = "<font class='futureTask'>".$meeting_fields['DATE_START']."</font>";
509
+        }
510
+        $this->fill_in_additional_detail_fields();
511 511
 
512 512
         // make sure we grab the localized version of the contact name, if a contact is provided
513 513
         if (!empty($this->contact_id))
@@ -523,342 +523,342 @@  discard block
 block discarded – undo
523 523
 
524 524
         $meeting_fields['CONTACT_ID'] = $this->contact_id;
525 525
         $meeting_fields['CONTACT_NAME'] = $this->contact_name;
526
-		$meeting_fields['PARENT_NAME'] = $this->parent_name;
526
+        $meeting_fields['PARENT_NAME'] = $this->parent_name;
527 527
         $meeting_fields['REMINDER_CHECKED'] = $this->reminder_time==-1 ? false : true;
528 528
         $meeting_fields['EMAIL_REMINDER_CHECKED'] = $this->email_reminder_time==-1 ? false : true;
529 529
 
530 530
 
531
-		return $meeting_fields;
532
-	}
533
-
534
-	function set_notification_body($xtpl, &$meeting) {
535
-		global $sugar_config;
536
-		global $app_list_strings;
537
-		global $current_user;
538
-		global $timedate;
539
-
540
-
541
-		// cn: bug 9494 - passing a contact breaks this call
542
-		$notifyUser =($meeting->current_notify_user->object_name == 'User') ? $meeting->current_notify_user : $current_user;
543
-		// cn: bug 8078 - fixed call to $timedate
544
-		if(strtolower(get_class($meeting->current_notify_user)) == 'contact') {
545
-			$xtpl->assign("ACCEPT_URL", $sugar_config['site_url'].
546
-							'/index.php?entryPoint=acceptDecline&module=Meetings&contact_id='.$meeting->current_notify_user->id.'&record='.$meeting->id);
547
-		} elseif(strtolower(get_class($meeting->current_notify_user)) == 'lead') {
548
-			$xtpl->assign("ACCEPT_URL", $sugar_config['site_url'].
549
-							'/index.php?entryPoint=acceptDecline&module=Meetings&lead_id='.$meeting->current_notify_user->id.'&record='.$meeting->id);
550
-		} else {
551
-			$xtpl->assign("ACCEPT_URL", $sugar_config['site_url'].
552
-							'/index.php?entryPoint=acceptDecline&module=Meetings&user_id='.$meeting->current_notify_user->id.'&record='.$meeting->id);
553
-		}
554
-		$xtpl->assign("MEETING_TO", $meeting->current_notify_user->new_assigned_user_name);
555
-		$xtpl->assign("MEETING_SUBJECT", trim($meeting->name));
556
-		$xtpl->assign("MEETING_STATUS",(isset($meeting->status)? $app_list_strings['meeting_status_dom'][$meeting->status]:""));
557
-		$typekey = strtolower($meeting->type);
558
-		if(isset($meeting->type)) {
559
-		    if(!empty($app_list_strings['eapm_list'][$typekey])) {
560
-    		    $typestring = $app_list_strings['eapm_list'][$typekey];
561
-	    	} else {
562
-		        $typestring = $app_list_strings['meeting_type_dom'][$meeting->type];
563
-		    }
564
-		}
565
-		$xtpl->assign("MEETING_TYPE", isset($meeting->type)? $typestring:"");
566
-		$startdate = $timedate->fromDb($meeting->date_start);
567
-		$xtpl->assign("MEETING_STARTDATE", $timedate->asUser($startdate, $notifyUser)." ".TimeDate::userTimezoneSuffix($startdate, $notifyUser));
568
-		$enddate = $timedate->fromDb($meeting->date_end);
569
-		$xtpl->assign("MEETING_ENDDATE", $timedate->asUser($enddate, $notifyUser)." ".TimeDate::userTimezoneSuffix($enddate, $notifyUser));		
570
-		$xtpl->assign("MEETING_HOURS", $meeting->duration_hours);
571
-		$xtpl->assign("MEETING_MINUTES", $meeting->duration_minutes);
572
-		$xtpl->assign("MEETING_DESCRIPTION", $meeting->description);
531
+        return $meeting_fields;
532
+    }
533
+
534
+    function set_notification_body($xtpl, &$meeting) {
535
+        global $sugar_config;
536
+        global $app_list_strings;
537
+        global $current_user;
538
+        global $timedate;
539
+
540
+
541
+        // cn: bug 9494 - passing a contact breaks this call
542
+        $notifyUser =($meeting->current_notify_user->object_name == 'User') ? $meeting->current_notify_user : $current_user;
543
+        // cn: bug 8078 - fixed call to $timedate
544
+        if(strtolower(get_class($meeting->current_notify_user)) == 'contact') {
545
+            $xtpl->assign("ACCEPT_URL", $sugar_config['site_url'].
546
+                            '/index.php?entryPoint=acceptDecline&module=Meetings&contact_id='.$meeting->current_notify_user->id.'&record='.$meeting->id);
547
+        } elseif(strtolower(get_class($meeting->current_notify_user)) == 'lead') {
548
+            $xtpl->assign("ACCEPT_URL", $sugar_config['site_url'].
549
+                            '/index.php?entryPoint=acceptDecline&module=Meetings&lead_id='.$meeting->current_notify_user->id.'&record='.$meeting->id);
550
+        } else {
551
+            $xtpl->assign("ACCEPT_URL", $sugar_config['site_url'].
552
+                            '/index.php?entryPoint=acceptDecline&module=Meetings&user_id='.$meeting->current_notify_user->id.'&record='.$meeting->id);
553
+        }
554
+        $xtpl->assign("MEETING_TO", $meeting->current_notify_user->new_assigned_user_name);
555
+        $xtpl->assign("MEETING_SUBJECT", trim($meeting->name));
556
+        $xtpl->assign("MEETING_STATUS",(isset($meeting->status)? $app_list_strings['meeting_status_dom'][$meeting->status]:""));
557
+        $typekey = strtolower($meeting->type);
558
+        if(isset($meeting->type)) {
559
+            if(!empty($app_list_strings['eapm_list'][$typekey])) {
560
+                $typestring = $app_list_strings['eapm_list'][$typekey];
561
+            } else {
562
+                $typestring = $app_list_strings['meeting_type_dom'][$meeting->type];
563
+            }
564
+        }
565
+        $xtpl->assign("MEETING_TYPE", isset($meeting->type)? $typestring:"");
566
+        $startdate = $timedate->fromDb($meeting->date_start);
567
+        $xtpl->assign("MEETING_STARTDATE", $timedate->asUser($startdate, $notifyUser)." ".TimeDate::userTimezoneSuffix($startdate, $notifyUser));
568
+        $enddate = $timedate->fromDb($meeting->date_end);
569
+        $xtpl->assign("MEETING_ENDDATE", $timedate->asUser($enddate, $notifyUser)." ".TimeDate::userTimezoneSuffix($enddate, $notifyUser));		
570
+        $xtpl->assign("MEETING_HOURS", $meeting->duration_hours);
571
+        $xtpl->assign("MEETING_MINUTES", $meeting->duration_minutes);
572
+        $xtpl->assign("MEETING_DESCRIPTION", $meeting->description);
573 573
         if ( !empty($meeting->join_url) ) {
574 574
             $xtpl->assign('MEETING_URL', $meeting->join_url);
575 575
             $xtpl->parse('Meeting.Meeting_External_API');
576 576
         }
577 577
 
578
-		return $xtpl;
579
-	}
578
+        return $xtpl;
579
+    }
580 580
 	
581
-	/**
582
-	 * Redefine method to attach ics file to notification email
583
-	 */
584
-	public function create_notification_email($notify_user){
581
+    /**
582
+     * Redefine method to attach ics file to notification email
583
+     */
584
+    public function create_notification_email($notify_user){
585 585
         // reset acceptance status for non organizer if date is changed
586 586
         if (($notify_user->id != $GLOBALS['current_user']->id) && $this->date_changed) {
587 587
             $this->set_accept_status($notify_user, 'none');
588 588
         }
589 589
 
590
-		$notify_mail = parent::create_notification_email($notify_user);
590
+        $notify_mail = parent::create_notification_email($notify_user);
591 591
 						
592
-		$path = SugarConfig::getInstance()->get('upload_dir','upload/') . $this->id;
592
+        $path = SugarConfig::getInstance()->get('upload_dir','upload/') . $this->id;
593 593
 
594
-		require_once("modules/vCals/vCal.php");
595
-		$content = vCal::get_ical_event($this, $GLOBALS['current_user']);
594
+        require_once("modules/vCals/vCal.php");
595
+        $content = vCal::get_ical_event($this, $GLOBALS['current_user']);
596 596
 				
597
-		if(file_put_contents($path,$content)){
598
-			$notify_mail->AddAttachment($path, 'meeting.ics', 'base64', 'text/calendar');
599
-		}
600
-		return $notify_mail;		
601
-	}
597
+        if(file_put_contents($path,$content)){
598
+            $notify_mail->AddAttachment($path, 'meeting.ics', 'base64', 'text/calendar');
599
+        }
600
+        return $notify_mail;		
601
+    }
602 602
 	
603
-	/**
604
-	 * Redefine method to remove ics after email is sent
605
-	 */
606
-	public function send_assignment_notifications($notify_user, $admin){
607
-		parent::send_assignment_notifications($notify_user, $admin);
603
+    /**
604
+     * Redefine method to remove ics after email is sent
605
+     */
606
+    public function send_assignment_notifications($notify_user, $admin){
607
+        parent::send_assignment_notifications($notify_user, $admin);
608 608
 		
609
-		$path = SugarConfig::getInstance()->get('upload_dir','upload/') . $this->id;
610
-		unlink($path);
611
-	}
612
-
613
-	function get_meeting_users() {
614
-		$template = new User();
615
-		// First, get the list of IDs.
616
-		$query = "SELECT meetings_users.required, meetings_users.accept_status, meetings_users.user_id from meetings_users where meetings_users.meeting_id='$this->id' AND meetings_users.deleted=0";
617
-		$GLOBALS['log']->debug("Finding linked records $this->object_name: ".$query);
618
-		$result = $this->db->query($query, true);
619
-		$list = Array();
620
-
621
-		while($row = $this->db->fetchByAssoc($result)) {
622
-			$template = new User(); // PHP 5 will retrieve by reference, always over-writing the "old" one
623
-			$record = $template->retrieve($row['user_id']);
624
-			$template->required = $row['required'];
625
-			$template->accept_status = $row['accept_status'];
626
-
627
-			if($record != null) {
628
-				// this copies the object into the array
629
-				$list[] = $template;
630
-			}
631
-		}
632
-		return $list;
633
-	}
634
-
635
-	function get_invite_meetings(&$user) {
636
-		$template = $this;
637
-		// First, get the list of IDs.
638
-		$GLOBALS['log']->debug("Finding linked records $this->object_name: ".$query);
639
-		$query = "SELECT meetings_users.required, meetings_users.accept_status, meetings_users.meeting_id from meetings_users where meetings_users.user_id='$user->id' AND( meetings_users.accept_status IS NULL OR	meetings_users.accept_status='none') AND meetings_users.deleted=0";
640
-		$result = $this->db->query($query, true);
641
-		$list = Array();
642
-
643
-		while($row = $this->db->fetchByAssoc($result)) {
644
-			$record = $template->retrieve($row['meeting_id']);
645
-			$template->required = $row['required'];
646
-			$template->accept_status = $row['accept_status'];
647
-
648
-
649
-			if($record != null)
650
-			{
651
-			// this copies the object into the array
652
-			$list[] = $template;
653
-			}
654
-		}
655
-		return $list;
656
-	}
657
-
658
-
659
-	function set_accept_status(&$user,$status)
660
-	{
661
-		if($user->object_name == 'User')
662
-		{
663
-			$relate_values = array('user_id'=>$user->id,'meeting_id'=>$this->id);
664
-			$data_values = array('accept_status'=>$status);
665
-			$this->set_relationship($this->rel_users_table, $relate_values, true, true,$data_values);
666
-			global $current_user;
667
-
668
-			if($this->update_vcal)
669
-			{
670
-				vCal::cache_sugar_vcal($user);
671
-			}
672
-		}
673
-		else if($user->object_name == 'Contact')
674
-		{
675
-			$relate_values = array('contact_id'=>$user->id,'meeting_id'=>$this->id);
676
-			$data_values = array('accept_status'=>$status);
677
-			$this->set_relationship($this->rel_contacts_table, $relate_values, true, true,$data_values);
678
-		}
609
+        $path = SugarConfig::getInstance()->get('upload_dir','upload/') . $this->id;
610
+        unlink($path);
611
+    }
612
+
613
+    function get_meeting_users() {
614
+        $template = new User();
615
+        // First, get the list of IDs.
616
+        $query = "SELECT meetings_users.required, meetings_users.accept_status, meetings_users.user_id from meetings_users where meetings_users.meeting_id='$this->id' AND meetings_users.deleted=0";
617
+        $GLOBALS['log']->debug("Finding linked records $this->object_name: ".$query);
618
+        $result = $this->db->query($query, true);
619
+        $list = Array();
620
+
621
+        while($row = $this->db->fetchByAssoc($result)) {
622
+            $template = new User(); // PHP 5 will retrieve by reference, always over-writing the "old" one
623
+            $record = $template->retrieve($row['user_id']);
624
+            $template->required = $row['required'];
625
+            $template->accept_status = $row['accept_status'];
626
+
627
+            if($record != null) {
628
+                // this copies the object into the array
629
+                $list[] = $template;
630
+            }
631
+        }
632
+        return $list;
633
+    }
634
+
635
+    function get_invite_meetings(&$user) {
636
+        $template = $this;
637
+        // First, get the list of IDs.
638
+        $GLOBALS['log']->debug("Finding linked records $this->object_name: ".$query);
639
+        $query = "SELECT meetings_users.required, meetings_users.accept_status, meetings_users.meeting_id from meetings_users where meetings_users.user_id='$user->id' AND( meetings_users.accept_status IS NULL OR	meetings_users.accept_status='none') AND meetings_users.deleted=0";
640
+        $result = $this->db->query($query, true);
641
+        $list = Array();
642
+
643
+        while($row = $this->db->fetchByAssoc($result)) {
644
+            $record = $template->retrieve($row['meeting_id']);
645
+            $template->required = $row['required'];
646
+            $template->accept_status = $row['accept_status'];
647
+
648
+
649
+            if($record != null)
650
+            {
651
+            // this copies the object into the array
652
+            $list[] = $template;
653
+            }
654
+        }
655
+        return $list;
656
+    }
657
+
658
+
659
+    function set_accept_status(&$user,$status)
660
+    {
661
+        if($user->object_name == 'User')
662
+        {
663
+            $relate_values = array('user_id'=>$user->id,'meeting_id'=>$this->id);
664
+            $data_values = array('accept_status'=>$status);
665
+            $this->set_relationship($this->rel_users_table, $relate_values, true, true,$data_values);
666
+            global $current_user;
667
+
668
+            if($this->update_vcal)
669
+            {
670
+                vCal::cache_sugar_vcal($user);
671
+            }
672
+        }
673
+        else if($user->object_name == 'Contact')
674
+        {
675
+            $relate_values = array('contact_id'=>$user->id,'meeting_id'=>$this->id);
676
+            $data_values = array('accept_status'=>$status);
677
+            $this->set_relationship($this->rel_contacts_table, $relate_values, true, true,$data_values);
678
+        }
679 679
         else if($user->object_name == 'Lead')
680
-		{
681
-			$relate_values = array('lead_id'=>$user->id,'meeting_id'=>$this->id);
682
-			$data_values = array('accept_status'=>$status);
683
-			$this->set_relationship($this->rel_leads_table, $relate_values, true, true,$data_values);
684
-		}
685
-	}
680
+        {
681
+            $relate_values = array('lead_id'=>$user->id,'meeting_id'=>$this->id);
682
+            $data_values = array('accept_status'=>$status);
683
+            $this->set_relationship($this->rel_leads_table, $relate_values, true, true,$data_values);
684
+        }
685
+    }
686 686
 
687 687
 
688
-	function get_notification_recipients() {
689
-		if($this->special_notification) {
690
-			return parent::get_notification_recipients();
691
-		}
688
+    function get_notification_recipients() {
689
+        if($this->special_notification) {
690
+            return parent::get_notification_recipients();
691
+        }
692 692
 
693
-		$list = array();
694
-		if(!is_array($this->contacts_arr)) {
695
-			$this->contacts_arr =	array();
696
-		}
693
+        $list = array();
694
+        if(!is_array($this->contacts_arr)) {
695
+            $this->contacts_arr =	array();
696
+        }
697 697
 
698
-		if(!is_array($this->users_arr)) {
699
-			$this->users_arr =	array();
700
-		}
698
+        if(!is_array($this->users_arr)) {
699
+            $this->users_arr =	array();
700
+        }
701 701
 
702 702
         if(!is_array($this->leads_arr)) {
703
-			$this->leads_arr =	array();
704
-		}
705
-
706
-		foreach($this->users_arr as $user_id) {
707
-			$notify_user = new User();
708
-			$notify_user->retrieve($user_id);
709
-			$notify_user->new_assigned_user_name = $notify_user->full_name;
710
-			$GLOBALS['log']->info("Notifications: recipient is $notify_user->new_assigned_user_name");
711
-			$list[$notify_user->id] = $notify_user;
712
-		}
713
-
714
-		foreach($this->contacts_arr as $contact_id) {
715
-			$notify_user = new Contact();
716
-			$notify_user->retrieve($contact_id);
717
-			$notify_user->new_assigned_user_name = $notify_user->full_name;
718
-			$GLOBALS['log']->info("Notifications: recipient is $notify_user->new_assigned_user_name");
719
-			$list[$notify_user->id] = $notify_user;
720
-		}
703
+            $this->leads_arr =	array();
704
+        }
705
+
706
+        foreach($this->users_arr as $user_id) {
707
+            $notify_user = new User();
708
+            $notify_user->retrieve($user_id);
709
+            $notify_user->new_assigned_user_name = $notify_user->full_name;
710
+            $GLOBALS['log']->info("Notifications: recipient is $notify_user->new_assigned_user_name");
711
+            $list[$notify_user->id] = $notify_user;
712
+        }
713
+
714
+        foreach($this->contacts_arr as $contact_id) {
715
+            $notify_user = new Contact();
716
+            $notify_user->retrieve($contact_id);
717
+            $notify_user->new_assigned_user_name = $notify_user->full_name;
718
+            $GLOBALS['log']->info("Notifications: recipient is $notify_user->new_assigned_user_name");
719
+            $list[$notify_user->id] = $notify_user;
720
+        }
721 721
 
722 722
         foreach($this->leads_arr as $lead_id) {
723
-			$notify_user = new Lead();
724
-			$notify_user->retrieve($lead_id);
725
-			$notify_user->new_assigned_user_name = $notify_user->full_name;
726
-			$GLOBALS['log']->info("Notifications: recipient is $notify_user->new_assigned_user_name");
727
-			$list[$notify_user->id] = $notify_user;
728
-		}
729
-
730
-		global $sugar_config;
731
-		if(isset($sugar_config['disable_notify_current_user']) && $sugar_config['disable_notify_current_user']) {
732
-			global $current_user;
733
-			if(isset($list[$current_user->id]))
734
-				unset($list[$current_user->id]);
735
-		}
736
-		return $list;
737
-	}
738
-
739
-
740
-	function bean_implements($interface) {
741
-		switch($interface) {
742
-			case 'ACL':return true;
743
-		}
744
-		return false;
745
-	}
746
-
747
-	function listviewACLHelper() {
748
-		$array_assign = parent::listviewACLHelper();
749
-		$is_owner = false;
750
-		$in_group = false; //SECURITY GROUPS
751
-		if(!empty($this->parent_name)) {
752
-
753
-			if(!empty($this->parent_name_owner)) {
754
-				global $current_user;
755
-				$is_owner = $current_user->id == $this->parent_name_owner;
756
-			}
757
-			/* BEGIN - SECURITY GROUPS */
758
-			//parent_name_owner not being set for whatever reason so we need to figure this out
759
-			else if(!empty($this->parent_type) && !empty($this->parent_id)) {
760
-				global $current_user;
723
+            $notify_user = new Lead();
724
+            $notify_user->retrieve($lead_id);
725
+            $notify_user->new_assigned_user_name = $notify_user->full_name;
726
+            $GLOBALS['log']->info("Notifications: recipient is $notify_user->new_assigned_user_name");
727
+            $list[$notify_user->id] = $notify_user;
728
+        }
729
+
730
+        global $sugar_config;
731
+        if(isset($sugar_config['disable_notify_current_user']) && $sugar_config['disable_notify_current_user']) {
732
+            global $current_user;
733
+            if(isset($list[$current_user->id]))
734
+                unset($list[$current_user->id]);
735
+        }
736
+        return $list;
737
+    }
738
+
739
+
740
+    function bean_implements($interface) {
741
+        switch($interface) {
742
+            case 'ACL':return true;
743
+        }
744
+        return false;
745
+    }
746
+
747
+    function listviewACLHelper() {
748
+        $array_assign = parent::listviewACLHelper();
749
+        $is_owner = false;
750
+        $in_group = false; //SECURITY GROUPS
751
+        if(!empty($this->parent_name)) {
752
+
753
+            if(!empty($this->parent_name_owner)) {
754
+                global $current_user;
755
+                $is_owner = $current_user->id == $this->parent_name_owner;
756
+            }
757
+            /* BEGIN - SECURITY GROUPS */
758
+            //parent_name_owner not being set for whatever reason so we need to figure this out
759
+            else if(!empty($this->parent_type) && !empty($this->parent_id)) {
760
+                global $current_user;
761 761
                 $parent_bean = BeanFactory::getBean($this->parent_type,$this->parent_id);
762 762
                 if($parent_bean !== false) {
763
-                	$is_owner = $current_user->id == $parent_bean->assigned_user_id;
763
+                    $is_owner = $current_user->id == $parent_bean->assigned_user_id;
764 764
                 }
765
-			}
766
-			require_once("modules/SecurityGroups/SecurityGroup.php");
767
-			$in_group = SecurityGroup::groupHasAccess($this->parent_type, $this->parent_id, 'view'); 
768
-        	/* END - SECURITY GROUPS */
769
-		}
770
-
771
-		/* BEGIN - SECURITY GROUPS */
772
-		/**
765
+            }
766
+            require_once("modules/SecurityGroups/SecurityGroup.php");
767
+            $in_group = SecurityGroup::groupHasAccess($this->parent_type, $this->parent_id, 'view'); 
768
+            /* END - SECURITY GROUPS */
769
+        }
770
+
771
+        /* BEGIN - SECURITY GROUPS */
772
+        /**
773 773
 		if(!ACLController::moduleSupportsACL($this->parent_type) || ACLController::checkAccess($this->parent_type, 'view', $is_owner)) {
774
-		*/
775
-		if(!ACLController::moduleSupportsACL($this->parent_type) || ACLController::checkAccess($this->parent_type, 'view', $is_owner, 'module', $in_group)){
774
+         */
775
+        if(!ACLController::moduleSupportsACL($this->parent_type) || ACLController::checkAccess($this->parent_type, 'view', $is_owner, 'module', $in_group)){
776 776
         /* END - SECURITY GROUPS */
777
-			$array_assign['PARENT'] = 'a';
778
-		} else {
779
-			$array_assign['PARENT'] = 'span';
780
-		}
781
-
782
-		$is_owner = false;
783
-		$in_group = false; //SECURITY GROUPS
784
-
785
-		if(!empty($this->contact_name)) {
786
-			if(!empty($this->contact_name_owner)) {
787
-				global $current_user;
788
-				$is_owner = $current_user->id == $this->contact_name_owner;
789
-			}
790
-			/* BEGIN - SECURITY GROUPS */
791
-			//contact_name_owner not being set for whatever reason so we need to figure this out
792
-			else {
793
-				global $current_user;
777
+            $array_assign['PARENT'] = 'a';
778
+        } else {
779
+            $array_assign['PARENT'] = 'span';
780
+        }
781
+
782
+        $is_owner = false;
783
+        $in_group = false; //SECURITY GROUPS
784
+
785
+        if(!empty($this->contact_name)) {
786
+            if(!empty($this->contact_name_owner)) {
787
+                global $current_user;
788
+                $is_owner = $current_user->id == $this->contact_name_owner;
789
+            }
790
+            /* BEGIN - SECURITY GROUPS */
791
+            //contact_name_owner not being set for whatever reason so we need to figure this out
792
+            else {
793
+                global $current_user;
794 794
                 $parent_bean = BeanFactory::getBean('Contacts',$this->contact_id);
795 795
                 if($parent_bean !== false) {
796
-                	$is_owner = $current_user->id == $parent_bean->assigned_user_id;
796
+                    $is_owner = $current_user->id == $parent_bean->assigned_user_id;
797 797
                 }
798
-			}
799
-			require_once("modules/SecurityGroups/SecurityGroup.php");
800
-			$in_group = SecurityGroup::groupHasAccess('Contacts', $this->contact_id, 'view'); 
801
-        	/* END - SECURITY GROUPS */
802
-		}
803
-
804
-		/* BEGIN - SECURITY GROUPS */
805
-		/**
798
+            }
799
+            require_once("modules/SecurityGroups/SecurityGroup.php");
800
+            $in_group = SecurityGroup::groupHasAccess('Contacts', $this->contact_id, 'view'); 
801
+            /* END - SECURITY GROUPS */
802
+        }
803
+
804
+        /* BEGIN - SECURITY GROUPS */
805
+        /**
806 806
 		if(ACLController::checkAccess('Contacts', 'view', $is_owner)) {
807
-		*/
808
-		if(ACLController::checkAccess('Contacts', 'view', $is_owner, 'module', $in_group)) {
807
+         */
808
+        if(ACLController::checkAccess('Contacts', 'view', $is_owner, 'module', $in_group)) {
809 809
         /* END - SECURITY GROUPS */
810
-			$array_assign['CONTACT'] = 'a';
811
-		} else {
812
-			$array_assign['CONTACT'] = 'span';
813
-		}
814
-		return $array_assign;
815
-	}
816
-
817
-
818
-	function save_relationship_changes($is_update, $exclude = array()) {
819
-	    if(empty($this->in_workflow)) {
820
-           if(empty($this->in_import)){//if a meeting is being imported then contact_id  should not be excluded
821
-           //if the global soap_server_object variable is not empty (as in from a soap/OPI call), then process the assigned_user_id relationship, otherwise
822
-           //add assigned_user_id to exclude list and let the logic from MeetingFormBase determine whether assigned user id gets added to the relationship
823
-           	if(!empty($GLOBALS['soap_server_object'])){
824
-           		$exclude = array('contact_id', 'user_id');
825
-           	}else{
826
-	    		$exclude = array('contact_id', 'user_id','assigned_user_id');
827
-           	}
828
-           }
829
-           else{
830
-           	$exclude = array('user_id');
831
-           }
832
-        }
833
-       parent::save_relationship_changes($is_update, $exclude);
834
-	}
835
-
836
-
837
-	/**
838
-	 * @see SugarBean::afterImportSave()
839
-	 */
840
-	public function afterImportSave()
841
-	{
842
-	    if ( $this->parent_type == 'Contacts' ) {
843
-	        $this->load_relationship('contacts');
844
-	        if ( !$this->contacts->relationship_exists('contacts',array('id'=>$this->parent_id)) )
845
-	            $this->contacts->add($this->parent_id);
846
-	    }
847
-	    elseif ( $this->parent_type == 'Leads' ) {
848
-	        $this->load_relationship('leads');
849
-	        if ( !$this->leads->relationship_exists('leads',array('id'=>$this->parent_id)) )
850
-	            $this->leads->add($this->parent_id);
851
-	    }
852
-
853
-	    parent::afterImportSave();
854
-	}
810
+            $array_assign['CONTACT'] = 'a';
811
+        } else {
812
+            $array_assign['CONTACT'] = 'span';
813
+        }
814
+        return $array_assign;
815
+    }
816
+
817
+
818
+    function save_relationship_changes($is_update, $exclude = array()) {
819
+        if(empty($this->in_workflow)) {
820
+            if(empty($this->in_import)){//if a meeting is being imported then contact_id  should not be excluded
821
+            //if the global soap_server_object variable is not empty (as in from a soap/OPI call), then process the assigned_user_id relationship, otherwise
822
+            //add assigned_user_id to exclude list and let the logic from MeetingFormBase determine whether assigned user id gets added to the relationship
823
+                if(!empty($GLOBALS['soap_server_object'])){
824
+                    $exclude = array('contact_id', 'user_id');
825
+                }else{
826
+                $exclude = array('contact_id', 'user_id','assigned_user_id');
827
+                }
828
+            }
829
+            else{
830
+                $exclude = array('user_id');
831
+            }
832
+        }
833
+        parent::save_relationship_changes($is_update, $exclude);
834
+    }
835
+
836
+
837
+    /**
838
+     * @see SugarBean::afterImportSave()
839
+     */
840
+    public function afterImportSave()
841
+    {
842
+        if ( $this->parent_type == 'Contacts' ) {
843
+            $this->load_relationship('contacts');
844
+            if ( !$this->contacts->relationship_exists('contacts',array('id'=>$this->parent_id)) )
845
+                $this->contacts->add($this->parent_id);
846
+        }
847
+        elseif ( $this->parent_type == 'Leads' ) {
848
+            $this->load_relationship('leads');
849
+            if ( !$this->leads->relationship_exists('leads',array('id'=>$this->parent_id)) )
850
+                $this->leads->add($this->parent_id);
851
+        }
852
+
853
+        parent::afterImportSave();
854
+    }
855 855
 
856 856
     public function getDefaultStatus()
857 857
     {
858
-         $def = $this->field_defs['status'];
859
-         if (isset($def['default'])) {
860
-             return $def['default'];
861
-         } else {
858
+            $def = $this->field_defs['status'];
859
+            if (isset($def['default'])) {
860
+                return $def['default'];
861
+            } else {
862 862
             $app = return_app_list_strings_language($GLOBALS['current_language']);
863 863
             if (isset($def['options']) && isset($app[$def['options']])) {
864 864
                 $keys = array_keys($app[$def['options']]);
@@ -874,9 +874,9 @@  discard block
 block discarded – undo
874 874
 //TODO: do we really need focus, name and view params for this function
875 875
 function getMeetingsExternalApiDropDown($focus = null, $name = null, $value = null, $view = null)
876 876
 {
877
-	global $dictionary, $app_list_strings;
877
+    global $dictionary, $app_list_strings;
878 878
 
879
-	$cacheKeyName = 'meetings_type_drop_down';
879
+    $cacheKeyName = 'meetings_type_drop_down';
880 880
 
881 881
     $apiList = sugar_cache_retrieve($cacheKeyName);
882 882
     if ($apiList === null)
@@ -888,17 +888,17 @@  discard block
 block discarded – undo
888 888
         sugar_cache_put($cacheKeyName, $apiList);
889 889
     }
890 890
 
891
-	if(!empty($value) && empty($apiList[$value]))
892
-	{
893
-		$apiList[$value] = $value;
891
+    if(!empty($value) && empty($apiList[$value]))
892
+    {
893
+        $apiList[$value] = $value;
894 894
     }
895
-	//bug 46294: adding list of options to dropdown list (if it is not the default list)
895
+    //bug 46294: adding list of options to dropdown list (if it is not the default list)
896 896
     if ($dictionary['Meeting']['fields']['type']['options'] != "eapm_list")
897 897
     {
898 898
         $apiList = array_merge(getMeetingTypeOptions($dictionary, $app_list_strings), $apiList);
899 899
     }
900 900
 
901
-	return $apiList;
901
+    return $apiList;
902 902
 }
903 903
 
904 904
 /**
@@ -909,20 +909,20 @@  discard block
 block discarded – undo
909 909
  */
910 910
 function getMeetingTypeOptions($dictionary, $app_list_strings)
911 911
 {
912
-	$result = array();
912
+    $result = array();
913 913
 
914 914
     // getting name of meeting type to fill dropdown list by its values
915 915
     if (isset($dictionary['Meeting']['fields']['type']['options']))
916
-	{
917
-    	$typeName = $dictionary['Meeting']['fields']['type']['options'];
916
+    {
917
+        $typeName = $dictionary['Meeting']['fields']['type']['options'];
918 918
 
919 919
         if (!empty($app_list_strings[$typeName]))
920
-		{
921
-        	$typeList = $app_list_strings[$typeName];
920
+        {
921
+            $typeList = $app_list_strings[$typeName];
922 922
 
923 923
             foreach ($typeList as $key => $value)
924
-			{
925
-				$result[$value] = $value;
924
+            {
925
+                $result[$value] = $value;
926 926
             }
927 927
         }
928 928
     }
Please login to merge, or discard this patch.
Spacing   +123 added lines, -123 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
2
+if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
3 3
 /*********************************************************************************
4 4
  * SugarCRM Community Edition is a customer relationship management program developed by
5 5
  * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 	var $meetings_arr;
94 94
 	// when assoc w/ a user/contact:
95 95
 	var $minutes_value_default = 15;
96
-	var $minutes_values = array('0'=>'00','15'=>'15','30'=>'30','45'=>'45');
96
+	var $minutes_values = array('0'=>'00', '15'=>'15', '30'=>'30', '45'=>'45');
97 97
 	var $table_name = "meetings";
98 98
 	var $rel_users_table = "meetings_users";
99 99
 	var $rel_contacts_table = "meetings_contacts";
@@ -104,8 +104,8 @@  discard block
 block discarded – undo
104 104
 	var $importable = true;
105 105
 	// This is used to retrieve related fields from form posts.
106 106
 	var $additional_column_fields = array('assigned_user_name', 'assigned_user_id', 'contact_id', 'user_id', 'contact_name', 'accept_status');
107
-	var $relationship_fields = array('account_id'=>'accounts','opportunity_id'=>'opportunity','case_id'=>'case',
108
-									 'assigned_user_id'=>'users','contact_id'=>'contacts', 'user_id'=>'users', 'meeting_id'=>'meetings');
107
+	var $relationship_fields = array('account_id'=>'accounts', 'opportunity_id'=>'opportunity', 'case_id'=>'case',
108
+									 'assigned_user_id'=>'users', 'contact_id'=>'contacts', 'user_id'=>'users', 'meeting_id'=>'meetings');
109 109
 	// so you can run get_users() twice and run query only once
110 110
 	var $cached_get_users = null;
111 111
 	var $new_schema = true;
@@ -117,11 +117,11 @@  discard block
 block discarded – undo
117 117
 	function Meeting() {
118 118
 		parent::SugarBean();
119 119
 		$this->setupCustomFields('Meetings');
120
-		foreach($this->field_defs as $field) {
120
+		foreach ($this->field_defs as $field) {
121 121
 			$this->field_name_map[$field['name']] = $field;
122 122
 		}
123 123
 //		$this->fill_in_additional_detail_fields();
124
-        if(!empty($GLOBALS['app_list_strings']['duration_intervals'])) {
124
+        if (!empty($GLOBALS['app_list_strings']['duration_intervals'])) {
125 125
             $this->minutes_values = $GLOBALS['app_list_strings']['duration_intervals'];
126 126
         }
127 127
 	}
@@ -131,21 +131,21 @@  discard block
 block discarded – undo
131 131
 	 * @param $view string
132 132
 	 * @param $is_owner bool
133 133
 	 */
134
-	function ACLAccess($view,$is_owner='not_set',$in_group='not_set'){
134
+	function ACLAccess($view, $is_owner = 'not_set', $in_group = 'not_set') {
135 135
 		// don't check if meeting is being synced from Outlook
136
-		if($this->syncing == false){
136
+		if ($this->syncing == false) {
137 137
 			$view = strtolower($view);
138
-			switch($view){
138
+			switch ($view) {
139 139
 				case 'edit':
140 140
 				case 'save':
141 141
 				case 'editview':
142 142
 				case 'delete':
143
-					if(!empty($this->recurring_source) && $this->recurring_source != "Sugar"){
143
+					if (!empty($this->recurring_source) && $this->recurring_source != "Sugar") {
144 144
 						return false;
145 145
 					}
146 146
 			}
147 147
 		}
148
-		return parent::ACLAccess($view,$is_owner,$in_group);
148
+		return parent::ACLAccess($view, $is_owner, $in_group);
149 149
 	}
150 150
 
151 151
 	/**
@@ -164,14 +164,14 @@  discard block
 block discarded – undo
164 164
 
165 165
 		global $disable_date_format;
166 166
 
167
-        if(isset($this->date_start))
167
+        if (isset($this->date_start))
168 168
         {
169 169
             $td = $timedate->fromDb($this->date_start);
170
-            if(!$td){
170
+            if (!$td) {
171 171
             		$this->date_start = $timedate->to_db($this->date_start);
172 172
             		$td = $timedate->fromDb($this->date_start);
173 173
             }
174
-            if($td)
174
+            if ($td)
175 175
             {
176 176
                 if (isset($this->duration_hours) && $this->duration_hours != '')
177 177
                 {
@@ -185,17 +185,17 @@  discard block
 block discarded – undo
185 185
             }
186 186
         }
187 187
 
188
-		$check_notify =(!empty($_REQUEST['send_invites']) && $_REQUEST['send_invites'] == '1') ? true : false;
189
-		if(empty($_REQUEST['send_invites'])) {
190
-			if(!empty($this->id)) {
188
+		$check_notify = (!empty($_REQUEST['send_invites']) && $_REQUEST['send_invites'] == '1') ? true : false;
189
+		if (empty($_REQUEST['send_invites'])) {
190
+			if (!empty($this->id)) {
191 191
 				$old_record = new Meeting();
192 192
 				$old_record->retrieve($this->id);
193 193
 				$old_assigned_user_id = $old_record->assigned_user_id;
194 194
 			}
195
-			if((empty($this->id) && isset($_REQUEST['assigned_user_id']) && !empty($_REQUEST['assigned_user_id']) && $GLOBALS['current_user']->id != $_REQUEST['assigned_user_id']) || (isset($old_assigned_user_id) && !empty($old_assigned_user_id) && isset($_REQUEST['assigned_user_id']) && !empty($_REQUEST['assigned_user_id']) && $old_assigned_user_id != $_REQUEST['assigned_user_id']) ){
195
+			if ((empty($this->id) && isset($_REQUEST['assigned_user_id']) && !empty($_REQUEST['assigned_user_id']) && $GLOBALS['current_user']->id != $_REQUEST['assigned_user_id']) || (isset($old_assigned_user_id) && !empty($old_assigned_user_id) && isset($_REQUEST['assigned_user_id']) && !empty($_REQUEST['assigned_user_id']) && $old_assigned_user_id != $_REQUEST['assigned_user_id'])) {
196 196
 				$this->special_notification = true;
197 197
 				$check_notify = true;
198
-                if(isset($_REQUEST['assigned_user_name'])) {
198
+                if (isset($_REQUEST['assigned_user_name'])) {
199 199
                     $this->new_assigned_user_name = $_REQUEST['assigned_user_name'];
200 200
                 }
201 201
 			}
@@ -207,23 +207,23 @@  discard block
 block discarded – undo
207 207
 		}*/
208 208
 
209 209
 		// prevent a mass mailing for recurring meetings created in Calendar module
210
-		if(empty($this->id) && !empty($_REQUEST['module']) && $_REQUEST['module'] == "Calendar" && !empty($_REQUEST['repeat_type']) && !empty($this->repeat_parent_id))
210
+		if (empty($this->id) && !empty($_REQUEST['module']) && $_REQUEST['module'] == "Calendar" && !empty($_REQUEST['repeat_type']) && !empty($this->repeat_parent_id))
211 211
 			$check_notify = false;
212 212
 
213
-        if (empty($this->status) ) {
213
+        if (empty($this->status)) {
214 214
             $this->status = $this->getDefaultStatus();
215 215
         }
216 216
 
217 217
         // Do any external API saving
218 218
         // Clear out the old external API stuff if we have changed types
219
-        if (isset($this->fetched_row) && $this->fetched_row['type'] != $this->type ) {
219
+        if (isset($this->fetched_row) && $this->fetched_row['type'] != $this->type) {
220 220
             $this->join_url = '';
221 221
             $this->host_url = '';
222 222
             $this->external_id = '';
223 223
             $this->creator = '';
224 224
         }
225 225
 
226
-        if (!empty($this->type) && $this->type != 'Sugar' ) {
226
+        if (!empty($this->type) && $this->type != 'Sugar') {
227 227
             require_once('include/externalAPI/ExternalAPIFactory.php');
228 228
             $api = ExternalAPIFactory::loadAPI($this->type);
229 229
         }
@@ -232,27 +232,27 @@  discard block
 block discarded – undo
232 232
 			$this->type = 'Sugar';
233 233
 		}
234 234
 
235
-        if ( isset($api) && is_a($api,'WebMeeting') && empty($this->in_relationship_update) ) {
235
+        if (isset($api) && is_a($api, 'WebMeeting') && empty($this->in_relationship_update)) {
236 236
             // Make sure the API initialized and it supports Web Meetings
237 237
             // Also make suer we have an ID, the external site needs something to reference
238
-            if ( !isset($this->id) || empty($this->id) ) {
238
+            if (!isset($this->id) || empty($this->id)) {
239 239
                 $this->id = create_guid();
240 240
                 $this->new_with_id = true;
241 241
             }
242 242
             $response = $api->scheduleMeeting($this);
243
-            if ( $response['success'] == TRUE ) {
243
+            if ($response['success'] == TRUE) {
244 244
                 // Need to send out notifications
245
-                if ( $api->canInvite ) {
245
+                if ($api->canInvite) {
246 246
                     $notifyList = $this->get_notification_recipients();
247
-                    foreach($notifyList as $person) {
248
-                        $api->inviteAttendee($this,$person,$check_notify);
247
+                    foreach ($notifyList as $person) {
248
+                        $api->inviteAttendee($this, $person, $check_notify);
249 249
                     }
250 250
 
251 251
                 }
252 252
             } else {
253 253
                 // Generic Message Provides no value to End User - Log the issue with message detail and continue
254 254
                 // SugarApplication::appendErrorMessage($GLOBALS['app_strings']['ERR_EXTERNAL_API_SAVE_FAIL']);
255
-                $GLOBALS['log']->warn('ERR_EXTERNAL_API_SAVE_FAIL' . ": " . $this->type . " - " .  $response['errorMessage']);
255
+                $GLOBALS['log']->warn('ERR_EXTERNAL_API_SAVE_FAIL'.": ".$this->type." - ".$response['errorMessage']);
256 256
             }
257 257
 
258 258
             $api->logoff();
@@ -260,11 +260,11 @@  discard block
 block discarded – undo
260 260
 
261 261
 		$return_id = parent::save($check_notify);
262 262
 
263
-		if($this->update_vcal) {
263
+		if ($this->update_vcal) {
264 264
 			vCal::cache_sugar_vcal($current_user);
265 265
 		}
266 266
 
267
-		if(isset($_REQUEST['reminders_data'])) {
267
+		if (isset($_REQUEST['reminders_data'])) {
268 268
 			Reminder::saveRemindersDataJson('Meetings', $return_id, html_entity_decode($_REQUEST['reminders_data']));
269 269
 		}
270 270
 
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
 
283 283
 		parent::mark_deleted($id);
284 284
 
285
-		if($this->update_vcal) {
285
+		if ($this->update_vcal) {
286 286
 			vCal::cache_sugar_vcal($current_user);
287 287
 		}
288 288
 	}
@@ -291,13 +291,13 @@  discard block
 block discarded – undo
291 291
 		return "$this->name";
292 292
 	}
293 293
 
294
-    function create_export_query($order_by, $where, $relate_link_join='')
294
+    function create_export_query($order_by, $where, $relate_link_join = '')
295 295
     {
296 296
         $custom_join = $this->getCustomJoin(true, true, $where);
297 297
         $custom_join['join'] .= $relate_link_join;
298 298
 		$contact_required = stristr($where, "contacts");
299 299
 
300
-		if($contact_required) {
300
+		if ($contact_required) {
301 301
 			$query = "SELECT meetings.*, contacts.first_name, contacts.last_name, contacts.assigned_user_id contact_name_owner, users.user_name as assigned_user_name   ";
302 302
             $query .= $custom_join['select'];
303 303
 			$query .= " FROM contacts, meetings, meetings_contacts ";
@@ -312,14 +312,14 @@  discard block
 block discarded – undo
312 312
 
313 313
         $query .= $custom_join['join'];
314 314
 
315
-		if($where != "")
315
+		if ($where != "")
316 316
 			$query .= " where $where AND ".$where_auto;
317 317
 		else
318 318
 			$query .= " where ".$where_auto;
319 319
 
320 320
         $order_by = $this->process_order_by($order_by);
321 321
         if (!empty($order_by)) {
322
-            $query .= ' ORDER BY ' . $order_by;
322
+            $query .= ' ORDER BY '.$order_by;
323 323
         }
324 324
 
325 325
 		return $query;
@@ -335,12 +335,12 @@  discard block
 block discarded – undo
335 335
 		if (!empty($this->contact_id)) {
336 336
 			$query  = "SELECT first_name, last_name FROM contacts ";
337 337
 			$query .= "WHERE id='$this->contact_id' AND deleted=0";
338
-			$result = $this->db->limitQuery($query,0,1,true," Error filling in additional detail fields: ");
338
+			$result = $this->db->limitQuery($query, 0, 1, true, " Error filling in additional detail fields: ");
339 339
 
340 340
 			// Get the contact name.
341 341
 			$row = $this->db->fetchByAssoc($result);
342 342
 			$GLOBALS['log']->info("additional call fields $query");
343
-			if($row != null)
343
+			if ($row != null)
344 344
 			{
345 345
 				$this->contact_name = $locale->getLocaleFormattedName($row['first_name'], $row['last_name'], '', '');
346 346
 				$GLOBALS['log']->debug("Call($this->id): contact_name = $this->contact_name");
@@ -383,7 +383,7 @@  discard block
 block discarded – undo
383 383
 
384 384
 		global $timedate;
385 385
         $this->time_meridiem = $timedate->AMPMMenu('', $this->time_start, 'onchange="SugarWidgetScheduler.update_time();"');
386
-		$hours_arr = array ();
386
+		$hours_arr = array();
387 387
 		$num_of_hours = 13;
388 388
 		$start_at = 1;
389 389
 
@@ -392,7 +392,7 @@  discard block
 block discarded – undo
392 392
 			$start_at = 0;
393 393
 		} //if
394 394
 
395
-		for ($i = $start_at; $i < $num_of_hours; $i ++) {
395
+		for ($i = $start_at; $i < $num_of_hours; $i++) {
396 396
 			$i = $i."";
397 397
 			if (strlen($i) == 1) {
398 398
 				$i = "0".$i;
@@ -415,12 +415,12 @@  discard block
 block discarded – undo
415 415
 		if (is_null($this->duration_minutes))
416 416
 			$this->duration_minutes = "1";
417 417
 
418
-		if(empty($this->id) && !empty($_REQUEST['date_start'])){
418
+		if (empty($this->id) && !empty($_REQUEST['date_start'])) {
419 419
 			$this->date_start = $_REQUEST['date_start'];
420 420
 		}
421
-        if(!empty($this->date_start))
421
+        if (!empty($this->date_start))
422 422
         {
423
-            $td = SugarDateTime::createFromFormat($GLOBALS['timedate']->get_date_time_format(),$this->date_start);
423
+            $td = SugarDateTime::createFromFormat($GLOBALS['timedate']->get_date_time_format(), $this->date_start);
424 424
             if (!empty($td)) 
425 425
             {
426 426
     	        if (!empty($this->duration_hours) && $this->duration_hours != '')
@@ -441,9 +441,9 @@  discard block
 block discarded – undo
441 441
 
442 442
 		global $app_list_strings;
443 443
 		$parent_types = $app_list_strings['record_type_display'];
444
-		$disabled_parent_types = ACLController::disabledModuleList($parent_types,false, 'list');
445
-		foreach($disabled_parent_types as $disabled_parent_type){
446
-			if($disabled_parent_type != $this->parent_type){
444
+		$disabled_parent_types = ACLController::disabledModuleList($parent_types, false, 'list');
445
+		foreach ($disabled_parent_types as $disabled_parent_type) {
446
+			if ($disabled_parent_type != $this->parent_type) {
447 447
 				unset($parent_types[$disabled_parent_type]);
448 448
 			}
449 449
 		}
@@ -453,9 +453,9 @@  discard block
 block discarded – undo
453 453
 			$this->reminder_time = -1;
454 454
 		}
455 455
 
456
-		if ( empty($this->id) ) {
456
+		if (empty($this->id)) {
457 457
 		    $reminder_t = $GLOBALS['current_user']->getPreference('reminder_time');
458
-		    if ( isset($reminder_t) )
458
+		    if (isset($reminder_t))
459 459
 		        $this->reminder_time = $reminder_t;
460 460
 		}
461 461
 		$this->reminder_checked = $this->reminder_time == -1 ? false : true;
@@ -463,9 +463,9 @@  discard block
 block discarded – undo
463 463
 		if (empty($this->email_reminder_time)) {
464 464
 			$this->email_reminder_time = -1;
465 465
 		}
466
-		if(empty($this->id)){ 
466
+		if (empty($this->id)) { 
467 467
 			$reminder_t = $GLOBALS['current_user']->getPreference('email_reminder_time');
468
-			if(isset($reminder_t))
468
+			if (isset($reminder_t))
469 469
 		    		$this->email_reminder_time = $reminder_t;
470 470
 		}
471 471
 		$this->email_reminder_checked = $this->email_reminder_time == -1 ? false : true;
@@ -482,15 +482,15 @@  discard block
 block discarded – undo
482 482
 		$meeting_fields = $this->get_list_view_array();
483 483
 
484 484
 		global $app_list_strings, $focus, $action, $currentModule;
485
-		if(isset($this->parent_type))
485
+		if (isset($this->parent_type))
486 486
 			$meeting_fields['PARENT_MODULE'] = $this->parent_type;
487
-		if($this->status == "Planned") {
487
+		if ($this->status == "Planned") {
488 488
 			//cn: added this if() to deal with sequential Closes in Meetings.	this is a hack to a hack(formbase.php->handleRedirect)
489
-			if(empty($action))
489
+			if (empty($action))
490 490
 			     $action = "index";
491 491
             $setCompleteUrl = "<a id='{$this->id}' onclick='SUGAR.util.closeActivityPanel.show(\"{$this->module_dir}\",\"{$this->id}\",\"Held\",\"listview\",\"1\");'>";
492 492
 			if ($this->ACLAccess('edit')) {
493
-                $meeting_fields['SET_COMPLETE'] = $setCompleteUrl . SugarThemeRegistry::current()->getImage("close_inline"," border='0'",null,null,'.gif',translate('LBL_CLOSEINLINE'))."</a>";
493
+                $meeting_fields['SET_COMPLETE'] = $setCompleteUrl.SugarThemeRegistry::current()->getImage("close_inline", " border='0'", null, null, '.gif', translate('LBL_CLOSEINLINE'))."</a>";
494 494
             } else {
495 495
                 $meeting_fields['SET_COMPLETE'] = '';
496 496
             }
@@ -500,9 +500,9 @@  discard block
 block discarded – undo
500 500
 		$nextday = $timedate->asDbDate($timedate->getNow()->get("+1 day"));
501 501
 		$mergeTime = $meeting_fields['DATE_START']; //$timedate->merge_date_time($meeting_fields['DATE_START'], $meeting_fields['TIME_START']);
502 502
 		$date_db = $timedate->to_db($mergeTime);
503
-		if($date_db	< $today	) {
504
-			$meeting_fields['DATE_START']= "<font class='overdueTask'>".$meeting_fields['DATE_START']."</font>";
505
-		}else if($date_db	< $nextday) {
503
+		if ($date_db < $today) {
504
+			$meeting_fields['DATE_START'] = "<font class='overdueTask'>".$meeting_fields['DATE_START']."</font>";
505
+		} else if ($date_db < $nextday) {
506 506
 			$meeting_fields['DATE_START'] = "<font class='todaysTask'>".$meeting_fields['DATE_START']."</font>";
507 507
 		} else {
508 508
 			$meeting_fields['DATE_START'] = "<font class='futureTask'>".$meeting_fields['DATE_START']."</font>";
@@ -524,8 +524,8 @@  discard block
 block discarded – undo
524 524
         $meeting_fields['CONTACT_ID'] = $this->contact_id;
525 525
         $meeting_fields['CONTACT_NAME'] = $this->contact_name;
526 526
 		$meeting_fields['PARENT_NAME'] = $this->parent_name;
527
-        $meeting_fields['REMINDER_CHECKED'] = $this->reminder_time==-1 ? false : true;
528
-        $meeting_fields['EMAIL_REMINDER_CHECKED'] = $this->email_reminder_time==-1 ? false : true;
527
+        $meeting_fields['REMINDER_CHECKED'] = $this->reminder_time == -1 ? false : true;
528
+        $meeting_fields['EMAIL_REMINDER_CHECKED'] = $this->email_reminder_time == -1 ? false : true;
529 529
 
530 530
 
531 531
 		return $meeting_fields;
@@ -539,12 +539,12 @@  discard block
 block discarded – undo
539 539
 
540 540
 
541 541
 		// cn: bug 9494 - passing a contact breaks this call
542
-		$notifyUser =($meeting->current_notify_user->object_name == 'User') ? $meeting->current_notify_user : $current_user;
542
+		$notifyUser = ($meeting->current_notify_user->object_name == 'User') ? $meeting->current_notify_user : $current_user;
543 543
 		// cn: bug 8078 - fixed call to $timedate
544
-		if(strtolower(get_class($meeting->current_notify_user)) == 'contact') {
544
+		if (strtolower(get_class($meeting->current_notify_user)) == 'contact') {
545 545
 			$xtpl->assign("ACCEPT_URL", $sugar_config['site_url'].
546 546
 							'/index.php?entryPoint=acceptDecline&module=Meetings&contact_id='.$meeting->current_notify_user->id.'&record='.$meeting->id);
547
-		} elseif(strtolower(get_class($meeting->current_notify_user)) == 'lead') {
547
+		} elseif (strtolower(get_class($meeting->current_notify_user)) == 'lead') {
548 548
 			$xtpl->assign("ACCEPT_URL", $sugar_config['site_url'].
549 549
 							'/index.php?entryPoint=acceptDecline&module=Meetings&lead_id='.$meeting->current_notify_user->id.'&record='.$meeting->id);
550 550
 		} else {
@@ -553,16 +553,16 @@  discard block
 block discarded – undo
553 553
 		}
554 554
 		$xtpl->assign("MEETING_TO", $meeting->current_notify_user->new_assigned_user_name);
555 555
 		$xtpl->assign("MEETING_SUBJECT", trim($meeting->name));
556
-		$xtpl->assign("MEETING_STATUS",(isset($meeting->status)? $app_list_strings['meeting_status_dom'][$meeting->status]:""));
556
+		$xtpl->assign("MEETING_STATUS", (isset($meeting->status) ? $app_list_strings['meeting_status_dom'][$meeting->status] : ""));
557 557
 		$typekey = strtolower($meeting->type);
558
-		if(isset($meeting->type)) {
559
-		    if(!empty($app_list_strings['eapm_list'][$typekey])) {
558
+		if (isset($meeting->type)) {
559
+		    if (!empty($app_list_strings['eapm_list'][$typekey])) {
560 560
     		    $typestring = $app_list_strings['eapm_list'][$typekey];
561 561
 	    	} else {
562 562
 		        $typestring = $app_list_strings['meeting_type_dom'][$meeting->type];
563 563
 		    }
564 564
 		}
565
-		$xtpl->assign("MEETING_TYPE", isset($meeting->type)? $typestring:"");
565
+		$xtpl->assign("MEETING_TYPE", isset($meeting->type) ? $typestring : "");
566 566
 		$startdate = $timedate->fromDb($meeting->date_start);
567 567
 		$xtpl->assign("MEETING_STARTDATE", $timedate->asUser($startdate, $notifyUser)." ".TimeDate::userTimezoneSuffix($startdate, $notifyUser));
568 568
 		$enddate = $timedate->fromDb($meeting->date_end);
@@ -570,7 +570,7 @@  discard block
 block discarded – undo
570 570
 		$xtpl->assign("MEETING_HOURS", $meeting->duration_hours);
571 571
 		$xtpl->assign("MEETING_MINUTES", $meeting->duration_minutes);
572 572
 		$xtpl->assign("MEETING_DESCRIPTION", $meeting->description);
573
-        if ( !empty($meeting->join_url) ) {
573
+        if (!empty($meeting->join_url)) {
574 574
             $xtpl->assign('MEETING_URL', $meeting->join_url);
575 575
             $xtpl->parse('Meeting.Meeting_External_API');
576 576
         }
@@ -581,7 +581,7 @@  discard block
 block discarded – undo
581 581
 	/**
582 582
 	 * Redefine method to attach ics file to notification email
583 583
 	 */
584
-	public function create_notification_email($notify_user){
584
+	public function create_notification_email($notify_user) {
585 585
         // reset acceptance status for non organizer if date is changed
586 586
         if (($notify_user->id != $GLOBALS['current_user']->id) && $this->date_changed) {
587 587
             $this->set_accept_status($notify_user, 'none');
@@ -589,12 +589,12 @@  discard block
 block discarded – undo
589 589
 
590 590
 		$notify_mail = parent::create_notification_email($notify_user);
591 591
 						
592
-		$path = SugarConfig::getInstance()->get('upload_dir','upload/') . $this->id;
592
+		$path = SugarConfig::getInstance()->get('upload_dir', 'upload/').$this->id;
593 593
 
594 594
 		require_once("modules/vCals/vCal.php");
595 595
 		$content = vCal::get_ical_event($this, $GLOBALS['current_user']);
596 596
 				
597
-		if(file_put_contents($path,$content)){
597
+		if (file_put_contents($path, $content)) {
598 598
 			$notify_mail->AddAttachment($path, 'meeting.ics', 'base64', 'text/calendar');
599 599
 		}
600 600
 		return $notify_mail;		
@@ -603,10 +603,10 @@  discard block
 block discarded – undo
603 603
 	/**
604 604
 	 * Redefine method to remove ics after email is sent
605 605
 	 */
606
-	public function send_assignment_notifications($notify_user, $admin){
606
+	public function send_assignment_notifications($notify_user, $admin) {
607 607
 		parent::send_assignment_notifications($notify_user, $admin);
608 608
 		
609
-		$path = SugarConfig::getInstance()->get('upload_dir','upload/') . $this->id;
609
+		$path = SugarConfig::getInstance()->get('upload_dir', 'upload/').$this->id;
610 610
 		unlink($path);
611 611
 	}
612 612
 
@@ -618,13 +618,13 @@  discard block
 block discarded – undo
618 618
 		$result = $this->db->query($query, true);
619 619
 		$list = Array();
620 620
 
621
-		while($row = $this->db->fetchByAssoc($result)) {
621
+		while ($row = $this->db->fetchByAssoc($result)) {
622 622
 			$template = new User(); // PHP 5 will retrieve by reference, always over-writing the "old" one
623 623
 			$record = $template->retrieve($row['user_id']);
624 624
 			$template->required = $row['required'];
625 625
 			$template->accept_status = $row['accept_status'];
626 626
 
627
-			if($record != null) {
627
+			if ($record != null) {
628 628
 				// this copies the object into the array
629 629
 				$list[] = $template;
630 630
 			}
@@ -640,13 +640,13 @@  discard block
 block discarded – undo
640 640
 		$result = $this->db->query($query, true);
641 641
 		$list = Array();
642 642
 
643
-		while($row = $this->db->fetchByAssoc($result)) {
643
+		while ($row = $this->db->fetchByAssoc($result)) {
644 644
 			$record = $template->retrieve($row['meeting_id']);
645 645
 			$template->required = $row['required'];
646 646
 			$template->accept_status = $row['accept_status'];
647 647
 
648 648
 
649
-			if($record != null)
649
+			if ($record != null)
650 650
 			{
651 651
 			// this copies the object into the array
652 652
 			$list[] = $template;
@@ -656,54 +656,54 @@  discard block
 block discarded – undo
656 656
 	}
657 657
 
658 658
 
659
-	function set_accept_status(&$user,$status)
659
+	function set_accept_status(&$user, $status)
660 660
 	{
661
-		if($user->object_name == 'User')
661
+		if ($user->object_name == 'User')
662 662
 		{
663
-			$relate_values = array('user_id'=>$user->id,'meeting_id'=>$this->id);
663
+			$relate_values = array('user_id'=>$user->id, 'meeting_id'=>$this->id);
664 664
 			$data_values = array('accept_status'=>$status);
665
-			$this->set_relationship($this->rel_users_table, $relate_values, true, true,$data_values);
665
+			$this->set_relationship($this->rel_users_table, $relate_values, true, true, $data_values);
666 666
 			global $current_user;
667 667
 
668
-			if($this->update_vcal)
668
+			if ($this->update_vcal)
669 669
 			{
670 670
 				vCal::cache_sugar_vcal($user);
671 671
 			}
672 672
 		}
673
-		else if($user->object_name == 'Contact')
673
+		else if ($user->object_name == 'Contact')
674 674
 		{
675
-			$relate_values = array('contact_id'=>$user->id,'meeting_id'=>$this->id);
675
+			$relate_values = array('contact_id'=>$user->id, 'meeting_id'=>$this->id);
676 676
 			$data_values = array('accept_status'=>$status);
677
-			$this->set_relationship($this->rel_contacts_table, $relate_values, true, true,$data_values);
677
+			$this->set_relationship($this->rel_contacts_table, $relate_values, true, true, $data_values);
678 678
 		}
679
-        else if($user->object_name == 'Lead')
679
+        else if ($user->object_name == 'Lead')
680 680
 		{
681
-			$relate_values = array('lead_id'=>$user->id,'meeting_id'=>$this->id);
681
+			$relate_values = array('lead_id'=>$user->id, 'meeting_id'=>$this->id);
682 682
 			$data_values = array('accept_status'=>$status);
683
-			$this->set_relationship($this->rel_leads_table, $relate_values, true, true,$data_values);
683
+			$this->set_relationship($this->rel_leads_table, $relate_values, true, true, $data_values);
684 684
 		}
685 685
 	}
686 686
 
687 687
 
688 688
 	function get_notification_recipients() {
689
-		if($this->special_notification) {
689
+		if ($this->special_notification) {
690 690
 			return parent::get_notification_recipients();
691 691
 		}
692 692
 
693 693
 		$list = array();
694
-		if(!is_array($this->contacts_arr)) {
695
-			$this->contacts_arr =	array();
694
+		if (!is_array($this->contacts_arr)) {
695
+			$this->contacts_arr = array();
696 696
 		}
697 697
 
698
-		if(!is_array($this->users_arr)) {
699
-			$this->users_arr =	array();
698
+		if (!is_array($this->users_arr)) {
699
+			$this->users_arr = array();
700 700
 		}
701 701
 
702
-        if(!is_array($this->leads_arr)) {
703
-			$this->leads_arr =	array();
702
+        if (!is_array($this->leads_arr)) {
703
+			$this->leads_arr = array();
704 704
 		}
705 705
 
706
-		foreach($this->users_arr as $user_id) {
706
+		foreach ($this->users_arr as $user_id) {
707 707
 			$notify_user = new User();
708 708
 			$notify_user->retrieve($user_id);
709 709
 			$notify_user->new_assigned_user_name = $notify_user->full_name;
@@ -711,7 +711,7 @@  discard block
 block discarded – undo
711 711
 			$list[$notify_user->id] = $notify_user;
712 712
 		}
713 713
 
714
-		foreach($this->contacts_arr as $contact_id) {
714
+		foreach ($this->contacts_arr as $contact_id) {
715 715
 			$notify_user = new Contact();
716 716
 			$notify_user->retrieve($contact_id);
717 717
 			$notify_user->new_assigned_user_name = $notify_user->full_name;
@@ -719,7 +719,7 @@  discard block
 block discarded – undo
719 719
 			$list[$notify_user->id] = $notify_user;
720 720
 		}
721 721
 
722
-        foreach($this->leads_arr as $lead_id) {
722
+        foreach ($this->leads_arr as $lead_id) {
723 723
 			$notify_user = new Lead();
724 724
 			$notify_user->retrieve($lead_id);
725 725
 			$notify_user->new_assigned_user_name = $notify_user->full_name;
@@ -728,9 +728,9 @@  discard block
 block discarded – undo
728 728
 		}
729 729
 
730 730
 		global $sugar_config;
731
-		if(isset($sugar_config['disable_notify_current_user']) && $sugar_config['disable_notify_current_user']) {
731
+		if (isset($sugar_config['disable_notify_current_user']) && $sugar_config['disable_notify_current_user']) {
732 732
 			global $current_user;
733
-			if(isset($list[$current_user->id]))
733
+			if (isset($list[$current_user->id]))
734 734
 				unset($list[$current_user->id]);
735 735
 		}
736 736
 		return $list;
@@ -738,7 +738,7 @@  discard block
 block discarded – undo
738 738
 
739 739
 
740 740
 	function bean_implements($interface) {
741
-		switch($interface) {
741
+		switch ($interface) {
742 742
 			case 'ACL':return true;
743 743
 		}
744 744
 		return false;
@@ -748,18 +748,18 @@  discard block
 block discarded – undo
748 748
 		$array_assign = parent::listviewACLHelper();
749 749
 		$is_owner = false;
750 750
 		$in_group = false; //SECURITY GROUPS
751
-		if(!empty($this->parent_name)) {
751
+		if (!empty($this->parent_name)) {
752 752
 
753
-			if(!empty($this->parent_name_owner)) {
753
+			if (!empty($this->parent_name_owner)) {
754 754
 				global $current_user;
755 755
 				$is_owner = $current_user->id == $this->parent_name_owner;
756 756
 			}
757 757
 			/* BEGIN - SECURITY GROUPS */
758 758
 			//parent_name_owner not being set for whatever reason so we need to figure this out
759
-			else if(!empty($this->parent_type) && !empty($this->parent_id)) {
759
+			else if (!empty($this->parent_type) && !empty($this->parent_id)) {
760 760
 				global $current_user;
761
-                $parent_bean = BeanFactory::getBean($this->parent_type,$this->parent_id);
762
-                if($parent_bean !== false) {
761
+                $parent_bean = BeanFactory::getBean($this->parent_type, $this->parent_id);
762
+                if ($parent_bean !== false) {
763 763
                 	$is_owner = $current_user->id == $parent_bean->assigned_user_id;
764 764
                 }
765 765
 			}
@@ -772,7 +772,7 @@  discard block
 block discarded – undo
772 772
 		/**
773 773
 		if(!ACLController::moduleSupportsACL($this->parent_type) || ACLController::checkAccess($this->parent_type, 'view', $is_owner)) {
774 774
 		*/
775
-		if(!ACLController::moduleSupportsACL($this->parent_type) || ACLController::checkAccess($this->parent_type, 'view', $is_owner, 'module', $in_group)){
775
+		if (!ACLController::moduleSupportsACL($this->parent_type) || ACLController::checkAccess($this->parent_type, 'view', $is_owner, 'module', $in_group)) {
776 776
         /* END - SECURITY GROUPS */
777 777
 			$array_assign['PARENT'] = 'a';
778 778
 		} else {
@@ -782,8 +782,8 @@  discard block
 block discarded – undo
782 782
 		$is_owner = false;
783 783
 		$in_group = false; //SECURITY GROUPS
784 784
 
785
-		if(!empty($this->contact_name)) {
786
-			if(!empty($this->contact_name_owner)) {
785
+		if (!empty($this->contact_name)) {
786
+			if (!empty($this->contact_name_owner)) {
787 787
 				global $current_user;
788 788
 				$is_owner = $current_user->id == $this->contact_name_owner;
789 789
 			}
@@ -791,8 +791,8 @@  discard block
 block discarded – undo
791 791
 			//contact_name_owner not being set for whatever reason so we need to figure this out
792 792
 			else {
793 793
 				global $current_user;
794
-                $parent_bean = BeanFactory::getBean('Contacts',$this->contact_id);
795
-                if($parent_bean !== false) {
794
+                $parent_bean = BeanFactory::getBean('Contacts', $this->contact_id);
795
+                if ($parent_bean !== false) {
796 796
                 	$is_owner = $current_user->id == $parent_bean->assigned_user_id;
797 797
                 }
798 798
 			}
@@ -805,7 +805,7 @@  discard block
 block discarded – undo
805 805
 		/**
806 806
 		if(ACLController::checkAccess('Contacts', 'view', $is_owner)) {
807 807
 		*/
808
-		if(ACLController::checkAccess('Contacts', 'view', $is_owner, 'module', $in_group)) {
808
+		if (ACLController::checkAccess('Contacts', 'view', $is_owner, 'module', $in_group)) {
809 809
         /* END - SECURITY GROUPS */
810 810
 			$array_assign['CONTACT'] = 'a';
811 811
 		} else {
@@ -816,17 +816,17 @@  discard block
 block discarded – undo
816 816
 
817 817
 
818 818
 	function save_relationship_changes($is_update, $exclude = array()) {
819
-	    if(empty($this->in_workflow)) {
820
-           if(empty($this->in_import)){//if a meeting is being imported then contact_id  should not be excluded
819
+	    if (empty($this->in_workflow)) {
820
+           if (empty($this->in_import)) {//if a meeting is being imported then contact_id  should not be excluded
821 821
            //if the global soap_server_object variable is not empty (as in from a soap/OPI call), then process the assigned_user_id relationship, otherwise
822 822
            //add assigned_user_id to exclude list and let the logic from MeetingFormBase determine whether assigned user id gets added to the relationship
823
-           	if(!empty($GLOBALS['soap_server_object'])){
823
+           	if (!empty($GLOBALS['soap_server_object'])) {
824 824
            		$exclude = array('contact_id', 'user_id');
825
-           	}else{
826
-	    		$exclude = array('contact_id', 'user_id','assigned_user_id');
825
+           	} else {
826
+	    		$exclude = array('contact_id', 'user_id', 'assigned_user_id');
827 827
            	}
828 828
            }
829
-           else{
829
+           else {
830 830
            	$exclude = array('user_id');
831 831
            }
832 832
         }
@@ -839,14 +839,14 @@  discard block
 block discarded – undo
839 839
 	 */
840 840
 	public function afterImportSave()
841 841
 	{
842
-	    if ( $this->parent_type == 'Contacts' ) {
842
+	    if ($this->parent_type == 'Contacts') {
843 843
 	        $this->load_relationship('contacts');
844
-	        if ( !$this->contacts->relationship_exists('contacts',array('id'=>$this->parent_id)) )
844
+	        if (!$this->contacts->relationship_exists('contacts', array('id'=>$this->parent_id)))
845 845
 	            $this->contacts->add($this->parent_id);
846 846
 	    }
847
-	    elseif ( $this->parent_type == 'Leads' ) {
847
+	    elseif ($this->parent_type == 'Leads') {
848 848
 	        $this->load_relationship('leads');
849
-	        if ( !$this->leads->relationship_exists('leads',array('id'=>$this->parent_id)) )
849
+	        if (!$this->leads->relationship_exists('leads', array('id'=>$this->parent_id)))
850 850
 	            $this->leads->add($this->parent_id);
851 851
 	    }
852 852
 
@@ -888,7 +888,7 @@  discard block
 block discarded – undo
888 888
         sugar_cache_put($cacheKeyName, $apiList);
889 889
     }
890 890
 
891
-	if(!empty($value) && empty($apiList[$value]))
891
+	if (!empty($value) && empty($apiList[$value]))
892 892
 	{
893 893
 		$apiList[$value] = $value;
894 894
     }
Please login to merge, or discard this patch.
Braces   +48 added lines, -39 removed lines patch added patch discarded remove patch
@@ -1,5 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
2
+if(!defined('sugarEntry') || !sugarEntry) {
3
+    die('Not A Valid Entry Point');
4
+}
3 5
 /*********************************************************************************
4 6
  * SugarCRM Community Edition is a customer relationship management program developed by
5 7
  * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
@@ -207,8 +209,9 @@  discard block
 block discarded – undo
207 209
 		}*/
208 210
 
209 211
 		// prevent a mass mailing for recurring meetings created in Calendar module
210
-		if(empty($this->id) && !empty($_REQUEST['module']) && $_REQUEST['module'] == "Calendar" && !empty($_REQUEST['repeat_type']) && !empty($this->repeat_parent_id))
211
-			$check_notify = false;
212
+		if(empty($this->id) && !empty($_REQUEST['module']) && $_REQUEST['module'] == "Calendar" && !empty($_REQUEST['repeat_type']) && !empty($this->repeat_parent_id)) {
213
+					$check_notify = false;
214
+		}
212 215
 
213 216
         if (empty($this->status) ) {
214 217
             $this->status = $this->getDefaultStatus();
@@ -312,10 +315,11 @@  discard block
 block discarded – undo
312 315
 
313 316
         $query .= $custom_join['join'];
314 317
 
315
-		if($where != "")
316
-			$query .= " where $where AND ".$where_auto;
317
-		else
318
-			$query .= " where ".$where_auto;
318
+		if($where != "") {
319
+					$query .= " where $where AND ".$where_auto;
320
+		} else {
321
+					$query .= " where ".$where_auto;
322
+		}
319 323
 
320 324
         $order_by = $this->process_order_by($order_by);
321 325
         if (!empty($order_by)) {
@@ -405,15 +409,18 @@  discard block
 block discarded – undo
405 409
 		}
406 410
 
407 411
         //setting default date and time
408
-		if (is_null($this->date_start))
409
-			$this->date_start = $timedate->now();
410
-		if (is_null($this->time_start))
411
-			$this->time_start = $timedate->to_display_time(TimeDate::getInstance()->nowDb(), true);
412
+		if (is_null($this->date_start)) {
413
+					$this->date_start = $timedate->now();
414
+		}
415
+		if (is_null($this->time_start)) {
416
+					$this->time_start = $timedate->to_display_time(TimeDate::getInstance()->nowDb(), true);
417
+		}
412 418
 		if (is_null($this->duration_hours)) {
413 419
 			$this->duration_hours = "0";
414 420
 		}
415
-		if (is_null($this->duration_minutes))
416
-			$this->duration_minutes = "1";
421
+		if (is_null($this->duration_minutes)) {
422
+					$this->duration_minutes = "1";
423
+		}
417 424
 
418 425
 		if(empty($this->id) && !empty($_REQUEST['date_start'])){
419 426
 			$this->date_start = $_REQUEST['date_start'];
@@ -432,8 +439,7 @@  discard block
 block discarded – undo
432 439
                     $td = $td->modify("+{$this->duration_minutes} mins");
433 440
                 }
434 441
                 $this->date_end = $td->format($GLOBALS['timedate']->get_date_time_format());
435
-            } 
436
-            else 
442
+            } else 
437 443
             {
438 444
                 $GLOBALS['log']->fatal("Meeting::save: Bad date {$this->date_start} for format ".$GLOBALS['timedate']->get_date_time_format());
439 445
             }
@@ -455,8 +461,9 @@  discard block
 block discarded – undo
455 461
 
456 462
 		if ( empty($this->id) ) {
457 463
 		    $reminder_t = $GLOBALS['current_user']->getPreference('reminder_time');
458
-		    if ( isset($reminder_t) )
459
-		        $this->reminder_time = $reminder_t;
464
+		    if ( isset($reminder_t) ) {
465
+		    		        $this->reminder_time = $reminder_t;
466
+		    }
460 467
 		}
461 468
 		$this->reminder_checked = $this->reminder_time == -1 ? false : true;
462 469
 
@@ -465,8 +472,9 @@  discard block
 block discarded – undo
465 472
 		}
466 473
 		if(empty($this->id)){ 
467 474
 			$reminder_t = $GLOBALS['current_user']->getPreference('email_reminder_time');
468
-			if(isset($reminder_t))
469
-		    		$this->email_reminder_time = $reminder_t;
475
+			if(isset($reminder_t)) {
476
+					    		$this->email_reminder_time = $reminder_t;
477
+			}
470 478
 		}
471 479
 		$this->email_reminder_checked = $this->email_reminder_time == -1 ? false : true;
472 480
 
@@ -482,12 +490,14 @@  discard block
 block discarded – undo
482 490
 		$meeting_fields = $this->get_list_view_array();
483 491
 
484 492
 		global $app_list_strings, $focus, $action, $currentModule;
485
-		if(isset($this->parent_type))
486
-			$meeting_fields['PARENT_MODULE'] = $this->parent_type;
493
+		if(isset($this->parent_type)) {
494
+					$meeting_fields['PARENT_MODULE'] = $this->parent_type;
495
+		}
487 496
 		if($this->status == "Planned") {
488 497
 			//cn: added this if() to deal with sequential Closes in Meetings.	this is a hack to a hack(formbase.php->handleRedirect)
489
-			if(empty($action))
490
-			     $action = "index";
498
+			if(empty($action)) {
499
+						     $action = "index";
500
+			}
491 501
             $setCompleteUrl = "<a id='{$this->id}' onclick='SUGAR.util.closeActivityPanel.show(\"{$this->module_dir}\",\"{$this->id}\",\"Held\",\"listview\",\"1\");'>";
492 502
 			if ($this->ACLAccess('edit')) {
493 503
                 $meeting_fields['SET_COMPLETE'] = $setCompleteUrl . SugarThemeRegistry::current()->getImage("close_inline"," border='0'",null,null,'.gif',translate('LBL_CLOSEINLINE'))."</a>";
@@ -502,7 +512,7 @@  discard block
 block discarded – undo
502 512
 		$date_db = $timedate->to_db($mergeTime);
503 513
 		if($date_db	< $today	) {
504 514
 			$meeting_fields['DATE_START']= "<font class='overdueTask'>".$meeting_fields['DATE_START']."</font>";
505
-		}else if($date_db	< $nextday) {
515
+		} else if($date_db	< $nextday) {
506 516
 			$meeting_fields['DATE_START'] = "<font class='todaysTask'>".$meeting_fields['DATE_START']."</font>";
507 517
 		} else {
508 518
 			$meeting_fields['DATE_START'] = "<font class='futureTask'>".$meeting_fields['DATE_START']."</font>";
@@ -669,14 +679,12 @@  discard block
 block discarded – undo
669 679
 			{
670 680
 				vCal::cache_sugar_vcal($user);
671 681
 			}
672
-		}
673
-		else if($user->object_name == 'Contact')
682
+		} else if($user->object_name == 'Contact')
674 683
 		{
675 684
 			$relate_values = array('contact_id'=>$user->id,'meeting_id'=>$this->id);
676 685
 			$data_values = array('accept_status'=>$status);
677 686
 			$this->set_relationship($this->rel_contacts_table, $relate_values, true, true,$data_values);
678
-		}
679
-        else if($user->object_name == 'Lead')
687
+		} else if($user->object_name == 'Lead')
680 688
 		{
681 689
 			$relate_values = array('lead_id'=>$user->id,'meeting_id'=>$this->id);
682 690
 			$data_values = array('accept_status'=>$status);
@@ -730,8 +738,9 @@  discard block
 block discarded – undo
730 738
 		global $sugar_config;
731 739
 		if(isset($sugar_config['disable_notify_current_user']) && $sugar_config['disable_notify_current_user']) {
732 740
 			global $current_user;
733
-			if(isset($list[$current_user->id]))
734
-				unset($list[$current_user->id]);
741
+			if(isset($list[$current_user->id])) {
742
+							unset($list[$current_user->id]);
743
+			}
735 744
 		}
736 745
 		return $list;
737 746
 	}
@@ -822,11 +831,10 @@  discard block
 block discarded – undo
822 831
            //add assigned_user_id to exclude list and let the logic from MeetingFormBase determine whether assigned user id gets added to the relationship
823 832
            	if(!empty($GLOBALS['soap_server_object'])){
824 833
            		$exclude = array('contact_id', 'user_id');
825
-           	}else{
834
+           	} else{
826 835
 	    		$exclude = array('contact_id', 'user_id','assigned_user_id');
827 836
            	}
828
-           }
829
-           else{
837
+           } else{
830 838
            	$exclude = array('user_id');
831 839
            }
832 840
         }
@@ -841,13 +849,14 @@  discard block
 block discarded – undo
841 849
 	{
842 850
 	    if ( $this->parent_type == 'Contacts' ) {
843 851
 	        $this->load_relationship('contacts');
844
-	        if ( !$this->contacts->relationship_exists('contacts',array('id'=>$this->parent_id)) )
845
-	            $this->contacts->add($this->parent_id);
846
-	    }
847
-	    elseif ( $this->parent_type == 'Leads' ) {
852
+	        if ( !$this->contacts->relationship_exists('contacts',array('id'=>$this->parent_id)) ) {
853
+	        	            $this->contacts->add($this->parent_id);
854
+	        }
855
+	    } elseif ( $this->parent_type == 'Leads' ) {
848 856
 	        $this->load_relationship('leads');
849
-	        if ( !$this->leads->relationship_exists('leads',array('id'=>$this->parent_id)) )
850
-	            $this->leads->add($this->parent_id);
857
+	        if ( !$this->leads->relationship_exists('leads',array('id'=>$this->parent_id)) ) {
858
+	        	            $this->leads->add($this->parent_id);
859
+	        }
851 860
 	    }
852 861
 
853 862
 	    parent::afterImportSave();
Please login to merge, or discard this patch.
Doc Comments   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
 
129 129
 	/**
130 130
 	 * Disable edit if meeting is recurring and source is not Sugar. It should be edited only from Outlook.
131
-	 * @param $view string
131
+	 * @param string $view string
132 132
 	 * @param $is_owner bool
133 133
 	 */
134 134
 	function ACLAccess($view,$is_owner='not_set',$in_group='not_set'){
@@ -656,6 +656,9 @@  discard block
 block discarded – undo
656 656
 	}
657 657
 
658 658
 
659
+	/**
660
+	 * @param string $status
661
+	 */
659 662
 	function set_accept_status(&$user,$status)
660 663
 	{
661 664
 		if($user->object_name == 'User')
Please login to merge, or discard this patch.
modules/Meetings/metadata/additionalDetails.php 2 patches
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
2
+if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
3 3
 /*********************************************************************************
4 4
  * SugarCRM Community Edition is a customer relationship management program developed by
5 5
  * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 function additionalDetailsMeeting($fields) {
43 43
     global $timedate;
44 44
     static $mod_strings;
45
-    if(empty($mod_strings)) {
45
+    if (empty($mod_strings)) {
46 46
         global $current_language;
47 47
         $mod_strings = return_module_language($current_language, 'Meetings');
48 48
     }
@@ -50,51 +50,51 @@  discard block
 block discarded – undo
50 50
 //    print_r($fields);
51 51
     $overlib_string = '';
52 52
     $overlib_string .= '<input id="type" type="hidden" value="Meeting"/>';
53
-    if(!empty($fields['ID'])) {
54
-        $overlib_string .= '<input id="id" type="hidden" value="'. $fields['ID'];
53
+    if (!empty($fields['ID'])) {
54
+        $overlib_string .= '<input id="id" type="hidden" value="'.$fields['ID'];
55 55
         $overlib_string .= '"/>';
56 56
     }
57 57
 
58
-    $overlib_string .= '<h2><img src="index.php?entryPoint=getImage&themeName=' . SugarThemeRegistry::current()->name .'&imageName=Meetings.gif"/> '.$mod_strings['LBL_MEETING'].'</h2>';
58
+    $overlib_string .= '<h2><img src="index.php?entryPoint=getImage&themeName='.SugarThemeRegistry::current()->name.'&imageName=Meetings.gif"/> '.$mod_strings['LBL_MEETING'].'</h2>';
59 59
 
60
-    if(!empty($fields['NAME'])) {
61
-        $overlib_string .= '<b>'.$mod_strings['LBL_SUBJECT'].'</b> <a href="index.php?action=DetailView&module=Meetings&record='.$fields['ID'].'">'. $fields['NAME'] . '</a>';
60
+    if (!empty($fields['NAME'])) {
61
+        $overlib_string .= '<b>'.$mod_strings['LBL_SUBJECT'].'</b> <a href="index.php?action=DetailView&module=Meetings&record='.$fields['ID'].'">'.$fields['NAME'].'</a>';
62 62
         $overlib_string .= '<br>';
63 63
     }
64
-    if(!empty($fields['DATE_START']))  {
64
+    if (!empty($fields['DATE_START'])) {
65 65
         // Make it easy to select for sorting in schedule bar
66 66
         $data_date = $timedate->fromUser($fields['DATE_START'])->format('Y-m-d H:i:s');
67 67
         $overlib_string .= '<span data-field="DATE_START" data-date="'.$data_date.'">';
68
-        $overlib_string .= '<b>'. $mod_strings['LBL_DATE_TIME'] . '</b> ' . $fields['DATE_START'] . ' <br>';
68
+        $overlib_string .= '<b>'.$mod_strings['LBL_DATE_TIME'].'</b> '.$fields['DATE_START'].' <br>';
69 69
         $overlib_string .= '</span>';
70 70
     }
71 71
 
72
-    if(isset($fields['DURATION_HOURS']) || isset($fields['DURATION_MINUTES'])) {
73
-        $overlib_string .= '<b>'. $mod_strings['LBL_DURATION'] . '</b> ';
74
-        if(isset($fields['DURATION_HOURS'])) {
75
-            $overlib_string .= $fields['DURATION_HOURS'] . $mod_strings['LBL_HOURS_ABBREV'] . ' ';
72
+    if (isset($fields['DURATION_HOURS']) || isset($fields['DURATION_MINUTES'])) {
73
+        $overlib_string .= '<b>'.$mod_strings['LBL_DURATION'].'</b> ';
74
+        if (isset($fields['DURATION_HOURS'])) {
75
+            $overlib_string .= $fields['DURATION_HOURS'].$mod_strings['LBL_HOURS_ABBREV'].' ';
76 76
         }
77
-        if(isset($fields['DURATION_MINUTES'])) {
78
-            $overlib_string .=  $fields['DURATION_MINUTES'] . $mod_strings['LBL_MINSS_ABBREV'];
77
+        if (isset($fields['DURATION_MINUTES'])) {
78
+            $overlib_string .= $fields['DURATION_MINUTES'].$mod_strings['LBL_MINSS_ABBREV'];
79 79
         }
80
-        $overlib_string .=  '<br>';
80
+        $overlib_string .= '<br>';
81 81
     }
82 82
     if (!empty($fields['PARENT_ID']))
83 83
     {
84
-        $overlib_string .= "<b>". $mod_strings['LBL_RELATED_TO'] . "</b> ".
84
+        $overlib_string .= "<b>".$mod_strings['LBL_RELATED_TO']."</b> ".
85 85
             "<a href='index.php?module=".$fields['PARENT_TYPE']."&action=DetailView&record=".$fields['PARENT_ID']."'>".
86
-            $fields['PARENT_TYPE'] .' - '. $fields['PARENT_NAME'] . "</a>";
86
+            $fields['PARENT_TYPE'].' - '.$fields['PARENT_NAME']."</a>";
87 87
         $overlib_string .= '<br>';
88 88
     }
89 89
 
90
-    if(!empty($fields['STATUS'])) {
91
-        $overlib_string .= '<b>'. $mod_strings['LBL_STATUS'] . '</b> ' . $fields['STATUS'];
90
+    if (!empty($fields['STATUS'])) {
91
+        $overlib_string .= '<b>'.$mod_strings['LBL_STATUS'].'</b> '.$fields['STATUS'];
92 92
         $overlib_string .= '<br>';
93 93
     }
94 94
 
95
-    if(!empty($fields['DESCRIPTION'])) {
96
-        $overlib_string .= '<b>'. $mod_strings['LBL_DESCRIPTION'] . '</b> ' . substr($fields['DESCRIPTION'], 0, 300);
97
-        if(strlen($fields['DESCRIPTION']) > 300) $overlib_string .= '...';
95
+    if (!empty($fields['DESCRIPTION'])) {
96
+        $overlib_string .= '<b>'.$mod_strings['LBL_DESCRIPTION'].'</b> '.substr($fields['DESCRIPTION'], 0, 300);
97
+        if (strlen($fields['DESCRIPTION']) > 300) $overlib_string .= '...';
98 98
         $overlib_string .= '<br>';
99 99
     }
100 100
     $overlib_string .= '<br>';
Please login to merge, or discard this patch.
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,5 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
2
+if(!defined('sugarEntry') || !sugarEntry) {
3
+    die('Not A Valid Entry Point');
4
+}
3 5
 /*********************************************************************************
4 6
  * SugarCRM Community Edition is a customer relationship management program developed by
5 7
  * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
@@ -94,7 +96,9 @@  discard block
 block discarded – undo
94 96
 
95 97
     if(!empty($fields['DESCRIPTION'])) {
96 98
         $overlib_string .= '<b>'. $mod_strings['LBL_DESCRIPTION'] . '</b> ' . substr($fields['DESCRIPTION'], 0, 300);
97
-        if(strlen($fields['DESCRIPTION']) > 300) $overlib_string .= '...';
99
+        if(strlen($fields['DESCRIPTION']) > 300) {
100
+            $overlib_string .= '...';
101
+        }
98 102
         $overlib_string .= '<br>';
99 103
     }
100 104
     $overlib_string .= '<br>';
Please login to merge, or discard this patch.
modules/Meetings/metadata/editviewdefs.php 2 patches
Indentation   +82 added lines, -82 removed lines patch added patch discarded remove patch
@@ -39,134 +39,134 @@  discard block
 block discarded – undo
39 39
 
40 40
 $viewdefs ['Meetings'] =
41 41
 array (
42
-  'EditView' =>
43
-  array (
42
+    'EditView' =>
43
+    array (
44 44
     'templateMeta' =>
45 45
     array (
46 46
         'includes' => array(
47 47
             array('file' => 'modules/Reminders/Reminders.js'),
48 48
         ),
49
-      'maxColumns' => '2',
50
-      'form' =>
51
-      array (
49
+        'maxColumns' => '2',
50
+        'form' =>
51
+        array (
52 52
         'hidden' =>
53 53
         array (
54
-          0 => '<input type="hidden" name="isSaveAndNew" value="false">',
54
+            0 => '<input type="hidden" name="isSaveAndNew" value="false">',
55 55
         ),
56 56
         'buttons' =>
57 57
         array (
58
-          0 =>
59
-          array (
60
-			'customCode' => '<input title="{$APP.LBL_SAVE_BUTTON_TITLE}" id ="SAVE_HEADER" accessKey="{$APP.LBL_SAVE_BUTTON_KEY}" class="button primary" onclick="SUGAR.meetings.fill_invitees();document.EditView.action.value=\'Save\'; document.EditView.return_action.value=\'DetailView\'; {if isset($smarty.request.isDuplicate) && $smarty.request.isDuplicate eq "true"}document.EditView.return_id.value=\'\'; {/if} formSubmitCheck();"type="button" name="button" value="{$APP.LBL_SAVE_BUTTON_LABEL}">',
61
-		  ),
62
-          1 => 'CANCEL',
63
-          2 =>
64
-          array (
65
-             'customCode' => '<input title="{$MOD.LBL_SEND_BUTTON_TITLE}" id="save_and_send_invites_header" class="button" onclick="document.EditView.send_invites.value=\'1\';SUGAR.meetings.fill_invitees();document.EditView.action.value=\'Save\';document.EditView.return_action.value=\'EditView\';document.EditView.return_module.value=\'{$smarty.request.return_module}\'; formSubmitCheck();"type="button" name="button" value="{$MOD.LBL_SEND_BUTTON_LABEL}">',
66
-		  ),
67
-          3 => 
68
-          array (
58
+            0 =>
59
+            array (
60
+            'customCode' => '<input title="{$APP.LBL_SAVE_BUTTON_TITLE}" id ="SAVE_HEADER" accessKey="{$APP.LBL_SAVE_BUTTON_KEY}" class="button primary" onclick="SUGAR.meetings.fill_invitees();document.EditView.action.value=\'Save\'; document.EditView.return_action.value=\'DetailView\'; {if isset($smarty.request.isDuplicate) && $smarty.request.isDuplicate eq "true"}document.EditView.return_id.value=\'\'; {/if} formSubmitCheck();"type="button" name="button" value="{$APP.LBL_SAVE_BUTTON_LABEL}">',
61
+            ),
62
+            1 => 'CANCEL',
63
+            2 =>
64
+            array (
65
+                'customCode' => '<input title="{$MOD.LBL_SEND_BUTTON_TITLE}" id="save_and_send_invites_header" class="button" onclick="document.EditView.send_invites.value=\'1\';SUGAR.meetings.fill_invitees();document.EditView.action.value=\'Save\';document.EditView.return_action.value=\'EditView\';document.EditView.return_module.value=\'{$smarty.request.return_module}\'; formSubmitCheck();"type="button" name="button" value="{$MOD.LBL_SEND_BUTTON_LABEL}">',
66
+            ),
67
+            3 => 
68
+            array (
69 69
             'customCode' => '{if $fields.status.value != "Held"}<input title="{$APP.LBL_CLOSE_AND_CREATE_BUTTON_TITLE}" id="close_and_create_new_header" class="button" onclick="SUGAR.meetings.fill_invitees(); document.EditView.status.value=\'Held\'; document.EditView.action.value=\'Save\'; document.EditView.return_module.value=\'Meetings\'; document.EditView.isDuplicate.value=true; document.EditView.isSaveAndNew.value=true; document.EditView.return_action.value=\'EditView\'; document.EditView.return_id.value=\'{$fields.id.value}\'; formSubmitCheck();"type="button" name="button" value="{$APP.LBL_CLOSE_AND_CREATE_BUTTON_LABEL}">{/if}',
70
-           ),
70
+            ),
71 71
         ),
72 72
         'headerTpl' => 'modules/Meetings/tpls/header.tpl',
73 73
 
74
-          'buttons_footer' =>
74
+            'buttons_footer' =>
75 75
         array (
76
-          0 =>
77
-          array (
78
-			'customCode' => '<input title="{$APP.LBL_SAVE_BUTTON_TITLE}" id ="SAVE_FOOTER" accessKey="{$APP.LBL_SAVE_BUTTON_KEY}" class="button primary" onclick="SUGAR.meetings.fill_invitees();document.EditView.action.value=\'Save\'; document.EditView.return_action.value=\'DetailView\'; {if isset($smarty.request.isDuplicate) && $smarty.request.isDuplicate eq "true"}document.EditView.return_id.value=\'\'; {/if} formSubmitCheck();"type="button" name="button" value="{$APP.LBL_SAVE_BUTTON_LABEL}">',
79
-		  ),
80
-          1 => 'CANCEL',
81
-          2 =>
82
-          array (
83
-             'customCode' => '<input title="{$MOD.LBL_SEND_BUTTON_TITLE}" id="save_and_send_invites_footer" class="button" onclick="document.EditView.send_invites.value=\'1\';SUGAR.meetings.fill_invitees();document.EditView.action.value=\'Save\';document.EditView.return_action.value=\'EditView\';document.EditView.return_module.value=\'{$smarty.request.return_module}\'; formSubmitCheck();"type="button" name="button" value="{$MOD.LBL_SEND_BUTTON_LABEL}">',
84
-		  ),
85
-          3 =>
86
-          array (
76
+            0 =>
77
+            array (
78
+            'customCode' => '<input title="{$APP.LBL_SAVE_BUTTON_TITLE}" id ="SAVE_FOOTER" accessKey="{$APP.LBL_SAVE_BUTTON_KEY}" class="button primary" onclick="SUGAR.meetings.fill_invitees();document.EditView.action.value=\'Save\'; document.EditView.return_action.value=\'DetailView\'; {if isset($smarty.request.isDuplicate) && $smarty.request.isDuplicate eq "true"}document.EditView.return_id.value=\'\'; {/if} formSubmitCheck();"type="button" name="button" value="{$APP.LBL_SAVE_BUTTON_LABEL}">',
79
+            ),
80
+            1 => 'CANCEL',
81
+            2 =>
82
+            array (
83
+                'customCode' => '<input title="{$MOD.LBL_SEND_BUTTON_TITLE}" id="save_and_send_invites_footer" class="button" onclick="document.EditView.send_invites.value=\'1\';SUGAR.meetings.fill_invitees();document.EditView.action.value=\'Save\';document.EditView.return_action.value=\'EditView\';document.EditView.return_module.value=\'{$smarty.request.return_module}\'; formSubmitCheck();"type="button" name="button" value="{$MOD.LBL_SEND_BUTTON_LABEL}">',
84
+            ),
85
+            3 =>
86
+            array (
87 87
             'customCode' => '{if $fields.status.value != "Held"}<input title="{$APP.LBL_CLOSE_AND_CREATE_BUTTON_TITLE}" id="close_and_create_new_footer" class="button" onclick="SUGAR.meetings.fill_invitees(); document.EditView.status.value=\'Held\'; document.EditView.action.value=\'Save\'; document.EditView.return_module.value=\'Meetings\'; document.EditView.isDuplicate.value=true; document.EditView.isSaveAndNew.value=true; document.EditView.return_action.value=\'EditView\'; document.EditView.return_id.value=\'{$fields.id.value}\'; formSubmitCheck();"type="button" name="button" value="{$APP.LBL_CLOSE_AND_CREATE_BUTTON_LABEL}">{/if}',
88
-           ),
88
+            ),
89 89
         ),
90 90
         'footerTpl' => 'modules/Meetings/tpls/footer.tpl',
91
-      ),
92
-      'widths' =>
93
-      array (
91
+        ),
92
+        'widths' =>
93
+        array (
94 94
         0 =>
95 95
         array (
96
-          'label' => '10',
97
-          'field' => '30',
96
+            'label' => '10',
97
+            'field' => '30',
98 98
         ),
99 99
         1 =>
100 100
         array (
101
-          'label' => '10',
102
-          'field' => '30',
101
+            'label' => '10',
102
+            'field' => '30',
103
+        ),
103 104
         ),
104
-      ),
105
-      'javascript' => '<script type="text/javascript">{$JSON_CONFIG_JAVASCRIPT}</script>
105
+        'javascript' => '<script type="text/javascript">{$JSON_CONFIG_JAVASCRIPT}</script>
106 106
 {sugar_getscript file="cache/include/javascript/sugar_grp_jsolait.js"}
107 107
 <script>toggle_portal_flag();function toggle_portal_flag()  {ldelim} {$TOGGLE_JS} {rdelim} 
108 108
 function formSubmitCheck(){ldelim}if(check_form(\'EditView\')){ldelim}document.EditView.submit();{rdelim}{rdelim}</script>',
109
-      'useTabs' => false,
109
+        'useTabs' => false,
110 110
     ),
111 111
     'panels' =>
112 112
     array (
113
-      'lbl_meeting_information' =>
114
-      array (
113
+        'lbl_meeting_information' =>
115 114
         array (
116
-          array (
115
+        array (
116
+            array (
117 117
             'name' => 'name',
118 118
 
119
-          ),
120
-          array (
119
+            ),
120
+            array (
121 121
             'name' => 'status',
122 122
             'fields' =>
123 123
             array (
124
-              array (
124
+                array (
125 125
                 'name' => 'status',
126
-              ),
126
+                ),
127
+            ),
127 128
             ),
128
-         ),
129
-      ),
129
+        ),
130 130
       
131 131
       
132
-      array (
133
-          array (
132
+        array (
133
+            array (
134 134
             'name' => 'date_start',
135 135
             'type' => 'datetimecombo',
136 136
             'displayParams' =>
137 137
             array (
138
-              'required' => true,
139
-              'updateCallback' => 'SugarWidgetScheduler.update_time();',
138
+                'required' => true,
139
+                'updateCallback' => 'SugarWidgetScheduler.update_time();',
140
+            ),
140 141
             ),
141
-          ),
142 142
           
143
-          array (
143
+            array (
144 144
             'name' => 'parent_name',
145 145
             'label' => 'LBL_LIST_RELATED_TO',
146
-          ),
146
+            ),
147 147
         ),
148 148
         
149 149
         
150
-      array (
151
-          array (
150
+        array (
151
+            array (
152 152
             'name' => 'date_end',
153 153
             'type' => 'datetimecombo',
154 154
             'displayParams' =>
155 155
             array (
156
-              'required' => true,
157
-              'updateCallback' => 'SugarWidgetScheduler.update_time();',
156
+                'required' => true,
157
+                'updateCallback' => 'SugarWidgetScheduler.update_time();',
158
+            ),
158 159
             ),
159
-          ),
160 160
           
161
-          array (
161
+            array (
162 162
             'name' => 'location',
163 163
             'comment' => 'Meeting location',
164 164
             'label' => 'LBL_LOCATION',
165
-          ),
165
+            ),
166 166
         ),      
167 167
         
168 168
         array(        
169
-          array (
169
+            array (
170 170
             'name' => 'duration',
171 171
             'customCode' => '
172 172
                 @@FIELD@@
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
                 </script>            
185 185
             ',
186 186
             'customCodeReadOnly' => '{$fields.duration_hours.value}{$MOD.LBL_HOURS_ABBREV} {$fields.duration_minutes.value}{$MOD.LBL_MINSS_ABBREV} ',
187
-          ),
187
+            ),
188 188
         ),
189 189
 //        array (
190 190
 //          array (
@@ -193,31 +193,31 @@  discard block
 block discarded – undo
193 193
 //            'label' => 'LBL_REMINDER',
194 194
 //          ),
195 195
 //        ),
196
-          array(
197
-              array (
198
-                  'name' => 'reminders',
199
-                  'customCode' => '{include file="modules/Reminders/tpls/reminders.tpl"}',
200
-                  'label' => 'LBL_REMINDERS',
201
-              ),
202
-          ),
196
+            array(
197
+                array (
198
+                    'name' => 'reminders',
199
+                    'customCode' => '{include file="modules/Reminders/tpls/reminders.tpl"}',
200
+                    'label' => 'LBL_REMINDERS',
201
+                ),
202
+            ),
203 203
         array (
204
-          array (
204
+            array (
205 205
             'name' => 'description',
206 206
             'comment' => 'Full text of the note',
207 207
             'label' => 'LBL_DESCRIPTION',
208
-          ),
208
+            ),
209
+        ),
209 210
         ),
210
-      ),
211
-      'LBL_PANEL_ASSIGNMENT' =>
212
-      array (
211
+        'LBL_PANEL_ASSIGNMENT' =>
213 212
         array (
214
-          array (
213
+        array (
214
+            array (
215 215
             'name' => 'assigned_user_name',
216 216
             'label' => 'LBL_ASSIGNED_TO_NAME',
217
-          ),
217
+            ),
218 218
         ),
219
-      ),
219
+        ),
220
+    ),
220 221
     ),
221
-  ),
222 222
 );
223 223
 ?>
Please login to merge, or discard this patch.
Spacing   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -38,66 +38,66 @@  discard block
 block discarded – undo
38 38
  ********************************************************************************/
39 39
 
40 40
 $viewdefs ['Meetings'] =
41
-array (
41
+array(
42 42
   'EditView' =>
43
-  array (
43
+  array(
44 44
     'templateMeta' =>
45
-    array (
45
+    array(
46 46
         'includes' => array(
47 47
             array('file' => 'modules/Reminders/Reminders.js'),
48 48
         ),
49 49
       'maxColumns' => '2',
50 50
       'form' =>
51
-      array (
51
+      array(
52 52
         'hidden' =>
53
-        array (
53
+        array(
54 54
           0 => '<input type="hidden" name="isSaveAndNew" value="false">',
55 55
         ),
56 56
         'buttons' =>
57
-        array (
57
+        array(
58 58
           0 =>
59
-          array (
59
+          array(
60 60
 			'customCode' => '<input title="{$APP.LBL_SAVE_BUTTON_TITLE}" id ="SAVE_HEADER" accessKey="{$APP.LBL_SAVE_BUTTON_KEY}" class="button primary" onclick="SUGAR.meetings.fill_invitees();document.EditView.action.value=\'Save\'; document.EditView.return_action.value=\'DetailView\'; {if isset($smarty.request.isDuplicate) && $smarty.request.isDuplicate eq "true"}document.EditView.return_id.value=\'\'; {/if} formSubmitCheck();"type="button" name="button" value="{$APP.LBL_SAVE_BUTTON_LABEL}">',
61 61
 		  ),
62 62
           1 => 'CANCEL',
63 63
           2 =>
64
-          array (
64
+          array(
65 65
              'customCode' => '<input title="{$MOD.LBL_SEND_BUTTON_TITLE}" id="save_and_send_invites_header" class="button" onclick="document.EditView.send_invites.value=\'1\';SUGAR.meetings.fill_invitees();document.EditView.action.value=\'Save\';document.EditView.return_action.value=\'EditView\';document.EditView.return_module.value=\'{$smarty.request.return_module}\'; formSubmitCheck();"type="button" name="button" value="{$MOD.LBL_SEND_BUTTON_LABEL}">',
66 66
 		  ),
67 67
           3 => 
68
-          array (
68
+          array(
69 69
             'customCode' => '{if $fields.status.value != "Held"}<input title="{$APP.LBL_CLOSE_AND_CREATE_BUTTON_TITLE}" id="close_and_create_new_header" class="button" onclick="SUGAR.meetings.fill_invitees(); document.EditView.status.value=\'Held\'; document.EditView.action.value=\'Save\'; document.EditView.return_module.value=\'Meetings\'; document.EditView.isDuplicate.value=true; document.EditView.isSaveAndNew.value=true; document.EditView.return_action.value=\'EditView\'; document.EditView.return_id.value=\'{$fields.id.value}\'; formSubmitCheck();"type="button" name="button" value="{$APP.LBL_CLOSE_AND_CREATE_BUTTON_LABEL}">{/if}',
70 70
            ),
71 71
         ),
72 72
         'headerTpl' => 'modules/Meetings/tpls/header.tpl',
73 73
 
74 74
           'buttons_footer' =>
75
-        array (
75
+        array(
76 76
           0 =>
77
-          array (
77
+          array(
78 78
 			'customCode' => '<input title="{$APP.LBL_SAVE_BUTTON_TITLE}" id ="SAVE_FOOTER" accessKey="{$APP.LBL_SAVE_BUTTON_KEY}" class="button primary" onclick="SUGAR.meetings.fill_invitees();document.EditView.action.value=\'Save\'; document.EditView.return_action.value=\'DetailView\'; {if isset($smarty.request.isDuplicate) && $smarty.request.isDuplicate eq "true"}document.EditView.return_id.value=\'\'; {/if} formSubmitCheck();"type="button" name="button" value="{$APP.LBL_SAVE_BUTTON_LABEL}">',
79 79
 		  ),
80 80
           1 => 'CANCEL',
81 81
           2 =>
82
-          array (
82
+          array(
83 83
              'customCode' => '<input title="{$MOD.LBL_SEND_BUTTON_TITLE}" id="save_and_send_invites_footer" class="button" onclick="document.EditView.send_invites.value=\'1\';SUGAR.meetings.fill_invitees();document.EditView.action.value=\'Save\';document.EditView.return_action.value=\'EditView\';document.EditView.return_module.value=\'{$smarty.request.return_module}\'; formSubmitCheck();"type="button" name="button" value="{$MOD.LBL_SEND_BUTTON_LABEL}">',
84 84
 		  ),
85 85
           3 =>
86
-          array (
86
+          array(
87 87
             'customCode' => '{if $fields.status.value != "Held"}<input title="{$APP.LBL_CLOSE_AND_CREATE_BUTTON_TITLE}" id="close_and_create_new_footer" class="button" onclick="SUGAR.meetings.fill_invitees(); document.EditView.status.value=\'Held\'; document.EditView.action.value=\'Save\'; document.EditView.return_module.value=\'Meetings\'; document.EditView.isDuplicate.value=true; document.EditView.isSaveAndNew.value=true; document.EditView.return_action.value=\'EditView\'; document.EditView.return_id.value=\'{$fields.id.value}\'; formSubmitCheck();"type="button" name="button" value="{$APP.LBL_CLOSE_AND_CREATE_BUTTON_LABEL}">{/if}',
88 88
            ),
89 89
         ),
90 90
         'footerTpl' => 'modules/Meetings/tpls/footer.tpl',
91 91
       ),
92 92
       'widths' =>
93
-      array (
93
+      array(
94 94
         0 =>
95
-        array (
95
+        array(
96 96
           'label' => '10',
97 97
           'field' => '30',
98 98
         ),
99 99
         1 =>
100
-        array (
100
+        array(
101 101
           'label' => '10',
102 102
           'field' => '30',
103 103
         ),
@@ -109,19 +109,19 @@  discard block
 block discarded – undo
109 109
       'useTabs' => false,
110 110
     ),
111 111
     'panels' =>
112
-    array (
112
+    array(
113 113
       'lbl_meeting_information' =>
114
-      array (
115
-        array (
116
-          array (
114
+      array(
115
+        array(
116
+          array(
117 117
             'name' => 'name',
118 118
 
119 119
           ),
120
-          array (
120
+          array(
121 121
             'name' => 'status',
122 122
             'fields' =>
123
-            array (
124
-              array (
123
+            array(
124
+              array(
125 125
                 'name' => 'status',
126 126
               ),
127 127
             ),
@@ -129,36 +129,36 @@  discard block
 block discarded – undo
129 129
       ),
130 130
       
131 131
       
132
-      array (
133
-          array (
132
+      array(
133
+          array(
134 134
             'name' => 'date_start',
135 135
             'type' => 'datetimecombo',
136 136
             'displayParams' =>
137
-            array (
137
+            array(
138 138
               'required' => true,
139 139
               'updateCallback' => 'SugarWidgetScheduler.update_time();',
140 140
             ),
141 141
           ),
142 142
           
143
-          array (
143
+          array(
144 144
             'name' => 'parent_name',
145 145
             'label' => 'LBL_LIST_RELATED_TO',
146 146
           ),
147 147
         ),
148 148
         
149 149
         
150
-      array (
151
-          array (
150
+      array(
151
+          array(
152 152
             'name' => 'date_end',
153 153
             'type' => 'datetimecombo',
154 154
             'displayParams' =>
155
-            array (
155
+            array(
156 156
               'required' => true,
157 157
               'updateCallback' => 'SugarWidgetScheduler.update_time();',
158 158
             ),
159 159
           ),
160 160
           
161
-          array (
161
+          array(
162 162
             'name' => 'location',
163 163
             'comment' => 'Meeting location',
164 164
             'label' => 'LBL_LOCATION',
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
         ),      
167 167
         
168 168
         array(        
169
-          array (
169
+          array(
170 170
             'name' => 'duration',
171 171
             'customCode' => '
172 172
                 @@FIELD@@
@@ -194,14 +194,14 @@  discard block
 block discarded – undo
194 194
 //          ),
195 195
 //        ),
196 196
           array(
197
-              array (
197
+              array(
198 198
                   'name' => 'reminders',
199 199
                   'customCode' => '{include file="modules/Reminders/tpls/reminders.tpl"}',
200 200
                   'label' => 'LBL_REMINDERS',
201 201
               ),
202 202
           ),
203
-        array (
204
-          array (
203
+        array(
204
+          array(
205 205
             'name' => 'description',
206 206
             'comment' => 'Full text of the note',
207 207
             'label' => 'LBL_DESCRIPTION',
@@ -209,9 +209,9 @@  discard block
 block discarded – undo
209 209
         ),
210 210
       ),
211 211
       'LBL_PANEL_ASSIGNMENT' =>
212
-      array (
213
-        array (
214
-          array (
212
+      array(
213
+        array(
214
+          array(
215 215
             'name' => 'assigned_user_name',
216 216
             'label' => 'LBL_ASSIGNED_TO_NAME',
217 217
           ),
Please login to merge, or discard this patch.
modules/Meetings/metadata/searchdefs.php 2 patches
Indentation   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -39,85 +39,85 @@
 block discarded – undo
39 39
 
40 40
 $searchdefs ['Meetings'] = 
41 41
 array (
42
-  'layout' => 
43
-  array (
42
+    'layout' => 
43
+    array (
44 44
     'basic_search' => 
45 45
     array (
46
-      'name' => 
47
-      array (
46
+        'name' => 
47
+        array (
48 48
         'name' => 'name',
49 49
         'default' => true,
50 50
         'width' => '10%',
51
-      ),
52
-      'current_user_only' => 
53
-      array (
51
+        ),
52
+        'current_user_only' => 
53
+        array (
54 54
         'name' => 'current_user_only',
55 55
         'label' => 'LBL_CURRENT_USER_FILTER',
56 56
         'type' => 'bool',
57 57
         'default' => true,
58 58
         'width' => '10%',
59
-      ),
60
-      array ('name' => 'open_only', 'label' => 'LBL_OPEN_ITEMS', 'type' => 'bool', 'default' => false, 'width' => '10%'),
61
-      array ('name' => 'favorites_only','label' => 'LBL_FAVORITES_FILTER','type' => 'bool',),
59
+        ),
60
+        array ('name' => 'open_only', 'label' => 'LBL_OPEN_ITEMS', 'type' => 'bool', 'default' => false, 'width' => '10%'),
61
+        array ('name' => 'favorites_only','label' => 'LBL_FAVORITES_FILTER','type' => 'bool',),
62 62
     ),
63 63
     'advanced_search' => 
64 64
     array (
65
-      'name' => 
66
-      array (
65
+        'name' => 
66
+        array (
67 67
         'name' => 'name',
68 68
         'default' => true,
69 69
         'width' => '10%',
70
-      ),
71
-      'parent_name' => 
72
-      array (
70
+        ),
71
+        'parent_name' => 
72
+        array (
73 73
         'type' => 'parent',
74 74
         'label' => 'LBL_LIST_RELATED_TO',
75 75
         'width' => '10%',
76 76
         'default' => true,
77 77
         'name' => 'parent_name',
78
-      ),
79
-      'current_user_only' => 
80
-      array (
78
+        ),
79
+        'current_user_only' => 
80
+        array (
81 81
         'name' => 'current_user_only',
82 82
         'label' => 'LBL_CURRENT_USER_FILTER',
83 83
         'type' => 'bool',
84 84
         'default' => true,
85 85
         'width' => '10%',
86
-      ),
87
-      'status' => 
88
-      array (
86
+        ),
87
+        'status' => 
88
+        array (
89 89
         'name' => 'status',
90 90
         'default' => true,
91 91
         'width' => '10%',
92
-      ),
93
-      'assigned_user_id' => 
94
-      array (
92
+        ),
93
+        'assigned_user_id' => 
94
+        array (
95 95
         'name' => 'assigned_user_id',
96 96
         'type' => 'enum',
97 97
         'label' => 'LBL_ASSIGNED_TO',
98 98
         'function' => 
99 99
         array (
100
-          'name' => 'get_user_array',
101
-          'params' => 
102
-          array (
100
+            'name' => 'get_user_array',
101
+            'params' => 
102
+            array (
103 103
             0 => false,
104
-          ),
104
+            ),
105 105
         ),
106 106
         'default' => true,
107 107
         'width' => '10%',
108
-      ),
108
+        ),
109 109
       
110 110
     ),
111
-  ),
112
-  'templateMeta' => 
113
-  array (
111
+    ),
112
+    'templateMeta' => 
113
+    array (
114 114
     'maxColumns' => '3',
115 115
     'maxColumnsBasic' => '4', 
116 116
     'widths' => 
117 117
     array (
118
-      'label' => '10',
119
-      'field' => '30',
118
+        'label' => '10',
119
+        'field' => '30',
120
+    ),
120 121
     ),
121
-  ),
122 122
 );
123 123
 ?>
Please login to merge, or discard this patch.
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -38,38 +38,38 @@  discard block
 block discarded – undo
38 38
  ********************************************************************************/
39 39
 
40 40
 $searchdefs ['Meetings'] = 
41
-array (
41
+array(
42 42
   'layout' => 
43
-  array (
43
+  array(
44 44
     'basic_search' => 
45
-    array (
45
+    array(
46 46
       'name' => 
47
-      array (
47
+      array(
48 48
         'name' => 'name',
49 49
         'default' => true,
50 50
         'width' => '10%',
51 51
       ),
52 52
       'current_user_only' => 
53
-      array (
53
+      array(
54 54
         'name' => 'current_user_only',
55 55
         'label' => 'LBL_CURRENT_USER_FILTER',
56 56
         'type' => 'bool',
57 57
         'default' => true,
58 58
         'width' => '10%',
59 59
       ),
60
-      array ('name' => 'open_only', 'label' => 'LBL_OPEN_ITEMS', 'type' => 'bool', 'default' => false, 'width' => '10%'),
61
-      array ('name' => 'favorites_only','label' => 'LBL_FAVORITES_FILTER','type' => 'bool',),
60
+      array('name' => 'open_only', 'label' => 'LBL_OPEN_ITEMS', 'type' => 'bool', 'default' => false, 'width' => '10%'),
61
+      array('name' => 'favorites_only', 'label' => 'LBL_FAVORITES_FILTER', 'type' => 'bool',),
62 62
     ),
63 63
     'advanced_search' => 
64
-    array (
64
+    array(
65 65
       'name' => 
66
-      array (
66
+      array(
67 67
         'name' => 'name',
68 68
         'default' => true,
69 69
         'width' => '10%',
70 70
       ),
71 71
       'parent_name' => 
72
-      array (
72
+      array(
73 73
         'type' => 'parent',
74 74
         'label' => 'LBL_LIST_RELATED_TO',
75 75
         'width' => '10%',
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
         'name' => 'parent_name',
78 78
       ),
79 79
       'current_user_only' => 
80
-      array (
80
+      array(
81 81
         'name' => 'current_user_only',
82 82
         'label' => 'LBL_CURRENT_USER_FILTER',
83 83
         'type' => 'bool',
@@ -85,21 +85,21 @@  discard block
 block discarded – undo
85 85
         'width' => '10%',
86 86
       ),
87 87
       'status' => 
88
-      array (
88
+      array(
89 89
         'name' => 'status',
90 90
         'default' => true,
91 91
         'width' => '10%',
92 92
       ),
93 93
       'assigned_user_id' => 
94
-      array (
94
+      array(
95 95
         'name' => 'assigned_user_id',
96 96
         'type' => 'enum',
97 97
         'label' => 'LBL_ASSIGNED_TO',
98 98
         'function' => 
99
-        array (
99
+        array(
100 100
           'name' => 'get_user_array',
101 101
           'params' => 
102
-          array (
102
+          array(
103 103
             0 => false,
104 104
           ),
105 105
         ),
@@ -110,11 +110,11 @@  discard block
 block discarded – undo
110 110
     ),
111 111
   ),
112 112
   'templateMeta' => 
113
-  array (
113
+  array(
114 114
     'maxColumns' => '3',
115 115
     'maxColumnsBasic' => '4', 
116 116
     'widths' => 
117
-    array (
117
+    array(
118 118
       'label' => '10',
119 119
       'field' => '30',
120 120
     ),
Please login to merge, or discard this patch.
modules/Meetings/metadata/SearchFields.php 3 patches
Indentation   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -40,21 +40,21 @@  discard block
 block discarded – undo
40 40
 global $current_user;
41 41
 $module_name = "Meetings";
42 42
 $searchFields['Meetings'] = 
43
-	array (
44
-		'name' => array( 'query_type'=>'default'),
43
+    array (
44
+        'name' => array( 'query_type'=>'default'),
45 45
         'contact_name' => array( 'query_type'=>'default','db_field'=>array('contacts.first_name','contacts.last_name')),        
46 46
         'date_start' => array( 'query_type'=>'default'),
47 47
         'current_user_only'=> array('query_type'=>'default','db_field'=>array('assigned_user_id'),'my_items'=>true, 'vname' => 'LBL_CURRENT_USER_FILTER', 'type' => 'bool'),
48 48
         'assigned_user_id'=> array('query_type'=>'default'),
49 49
         'status'=> array('query_type'=>'default', 'options' => 'meeting_status_dom', 'template_var' => 'STATUS_FILTER'),
50 50
         
51
-		'open_only' => array(
52
-			'query_type'=>'default',
53
-			'db_field'=>array('status'),
54
-			'operator'=>'not in',
55
-			'closed_values' => array('Held', 'Not Held'),
56
-			'type'=>'bool',
57
-		),		
51
+        'open_only' => array(
52
+            'query_type'=>'default',
53
+            'db_field'=>array('status'),
54
+            'operator'=>'not in',
55
+            'closed_values' => array('Held', 'Not Held'),
56
+            'type'=>'bool',
57
+        ),		
58 58
         'favorites_only' => array(
59 59
             'query_type'=>'format',
60 60
             'operator' => 'subquery',
@@ -63,19 +63,19 @@  discard block
 block discarded – undo
63 63
 			                        and favorites.parent_type = "'.$module_name.'"
64 64
 			                        and favorites.assigned_user_id = "' .$current_user->id . '") OR NOT ({0}',
65 65
             'db_field'=>array('id')),
66
-		//Range Search Support
67
-	   'range_date_entered' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true),
68
-	   'start_range_date_entered' => array ('query_type' => 'default',  'enable_range_search' => true, 'is_date_field' => true),
69
-	   'end_range_date_entered' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true),
70
-	   'range_date_modified' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true),
71
-	   'start_range_date_modified' => array ('query_type' => 'default',  'enable_range_search' => true, 'is_date_field' => true),
72
-       'end_range_date_modified' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true),
73
-	   'range_date_start' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true),
74
-	   'start_range_date_start' => array ('query_type' => 'default',  'enable_range_search' => true, 'is_date_field' => true),
75
-	   'end_range_date_start' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true),
76
-	   'range_date_end' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true),
77
-	   'start_range_date_end' => array ('query_type' => 'default',  'enable_range_search' => true, 'is_date_field' => true),
78
-       'end_range_date_end' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true),	
79
-	    //Range Search Support 				
80
-	);
66
+        //Range Search Support
67
+        'range_date_entered' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true),
68
+        'start_range_date_entered' => array ('query_type' => 'default',  'enable_range_search' => true, 'is_date_field' => true),
69
+        'end_range_date_entered' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true),
70
+        'range_date_modified' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true),
71
+        'start_range_date_modified' => array ('query_type' => 'default',  'enable_range_search' => true, 'is_date_field' => true),
72
+        'end_range_date_modified' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true),
73
+        'range_date_start' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true),
74
+        'start_range_date_start' => array ('query_type' => 'default',  'enable_range_search' => true, 'is_date_field' => true),
75
+        'end_range_date_start' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true),
76
+        'range_date_end' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true),
77
+        'start_range_date_end' => array ('query_type' => 'default',  'enable_range_search' => true, 'is_date_field' => true),
78
+        'end_range_date_end' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true),	
79
+        //Range Search Support 				
80
+    );
81 81
 ?>
Please login to merge, or discard this patch.
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
2
+if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
3 3
 /*********************************************************************************
4 4
  * SugarCRM Community Edition is a customer relationship management program developed by
5 5
  * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
@@ -40,11 +40,11 @@  discard block
 block discarded – undo
40 40
 global $current_user;
41 41
 $module_name = "Meetings";
42 42
 $searchFields['Meetings'] = 
43
-	array (
44
-		'name' => array( 'query_type'=>'default'),
45
-        'contact_name' => array( 'query_type'=>'default','db_field'=>array('contacts.first_name','contacts.last_name')),        
46
-        'date_start' => array( 'query_type'=>'default'),
47
-        'current_user_only'=> array('query_type'=>'default','db_field'=>array('assigned_user_id'),'my_items'=>true, 'vname' => 'LBL_CURRENT_USER_FILTER', 'type' => 'bool'),
43
+	array(
44
+		'name' => array('query_type'=>'default'),
45
+        'contact_name' => array('query_type'=>'default', 'db_field'=>array('contacts.first_name', 'contacts.last_name')),        
46
+        'date_start' => array('query_type'=>'default'),
47
+        'current_user_only'=> array('query_type'=>'default', 'db_field'=>array('assigned_user_id'), 'my_items'=>true, 'vname' => 'LBL_CURRENT_USER_FILTER', 'type' => 'bool'),
48 48
         'assigned_user_id'=> array('query_type'=>'default'),
49 49
         'status'=> array('query_type'=>'default', 'options' => 'meeting_status_dom', 'template_var' => 'STATUS_FILTER'),
50 50
         
@@ -61,21 +61,21 @@  discard block
 block discarded – undo
61 61
             'subquery' => 'SELECT favorites.parent_id FROM favorites
62 62
 			                    WHERE favorites.deleted = 0
63 63
 			                        and favorites.parent_type = "'.$module_name.'"
64
-			                        and favorites.assigned_user_id = "' .$current_user->id . '") OR NOT ({0}',
64
+			                        and favorites.assigned_user_id = "' .$current_user->id.'") OR NOT ({0}',
65 65
             'db_field'=>array('id')),
66 66
 		//Range Search Support
67
-	   'range_date_entered' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true),
68
-	   'start_range_date_entered' => array ('query_type' => 'default',  'enable_range_search' => true, 'is_date_field' => true),
69
-	   'end_range_date_entered' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true),
70
-	   'range_date_modified' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true),
71
-	   'start_range_date_modified' => array ('query_type' => 'default',  'enable_range_search' => true, 'is_date_field' => true),
72
-       'end_range_date_modified' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true),
73
-	   'range_date_start' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true),
74
-	   'start_range_date_start' => array ('query_type' => 'default',  'enable_range_search' => true, 'is_date_field' => true),
75
-	   'end_range_date_start' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true),
76
-	   'range_date_end' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true),
77
-	   'start_range_date_end' => array ('query_type' => 'default',  'enable_range_search' => true, 'is_date_field' => true),
78
-       'end_range_date_end' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true),	
67
+	   'range_date_entered' => array('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true),
68
+	   'start_range_date_entered' => array('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true),
69
+	   'end_range_date_entered' => array('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true),
70
+	   'range_date_modified' => array('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true),
71
+	   'start_range_date_modified' => array('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true),
72
+       'end_range_date_modified' => array('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true),
73
+	   'range_date_start' => array('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true),
74
+	   'start_range_date_start' => array('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true),
75
+	   'end_range_date_start' => array('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true),
76
+	   'range_date_end' => array('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true),
77
+	   'start_range_date_end' => array('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true),
78
+       'end_range_date_end' => array('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true),	
79 79
 	    //Range Search Support 				
80 80
 	);
81 81
 ?>
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,7 @@
 block discarded – undo
1 1
 <?php
2
-if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
2
+if(!defined('sugarEntry') || !sugarEntry) {
3
+    die('Not A Valid Entry Point');
4
+}
3 5
 /*********************************************************************************
4 6
  * SugarCRM Community Edition is a customer relationship management program developed by
5 7
  * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
Please login to merge, or discard this patch.
modules/Meetings/metadata/detailviewdefs.php 2 patches
Indentation   +75 added lines, -75 removed lines patch added patch discarded remove patch
@@ -39,56 +39,56 @@  discard block
 block discarded – undo
39 39
 
40 40
 $viewdefs ['Meetings'] = 
41 41
 array (
42
-  'DetailView' => 
43
-  array (
42
+    'DetailView' => 
43
+    array (
44 44
     'templateMeta' => 
45 45
     array (
46 46
         'includes' => array(
47 47
             array('file' => 'modules/Reminders/Reminders.js'),
48 48
         ),
49
-      'form' => 
50
-      array (
49
+        'form' => 
50
+        array (
51 51
         'buttons' => 
52 52
         array (
53
-          0 => 'EDIT',
54
-          1 => 'DUPLICATE',
55
-          2 => 'DELETE',
56
-          3 => 
57
-          array (
53
+            0 => 'EDIT',
54
+            1 => 'DUPLICATE',
55
+            2 => 'DELETE',
56
+            3 => 
57
+            array (
58 58
             'customCode' => '{if $fields.status.value != "Held" && $bean->aclAccess("edit")} <input type="hidden" name="isSaveAndNew" value="false">  <input type="hidden" name="status" value="">  <input type="hidden" name="isSaveFromDetailView" value="true">  <input title="{$APP.LBL_CLOSE_AND_CREATE_BUTTON_TITLE}"   class="button"  onclick="this.form.status.value=\'Held\'; this.form.action.value=\'Save\';this.form.return_module.value=\'Meetings\';this.form.isDuplicate.value=true;this.form.isSaveAndNew.value=true;this.form.return_action.value=\'EditView\'; this.form.isDuplicate.value=true;this.form.return_id.value=\'{$fields.id.value}\';" id="close_create_button" name="button"  value="{$APP.LBL_CLOSE_AND_CREATE_BUTTON_TITLE}"  type="submit">{/if}',
59
-              //Bug#51778: The custom code will be replaced with sugar_html. customCode will be deplicated.
60
-              'sugar_html' => array(
61
-                  'type' => 'submit',
62
-                  'value' => '{$APP.LBL_CLOSE_AND_CREATE_BUTTON_TITLE}',
63
-                  'htmlOptions' => array(
64
-                      'title' => '{$APP.LBL_CLOSE_AND_CREATE_BUTTON_TITLE}',
65
-                      'name' => '{$APP.LBL_CLOSE_AND_CREATE_BUTTON_TITLE}',
66
-                      'class' => 'button',
67
-                      'id' => 'close_create_button',
68
-                      'onclick' => 'this.form.isSaveFromDetailView.value=true; this.form.status.value=\'Held\'; this.form.action.value=\'Save\';this.form.return_module.value=\'Meetings\';this.form.isDuplicate.value=true;this.form.isSaveAndNew.value=true;this.form.return_action.value=\'EditView\'; this.form.isDuplicate.value=true;this.form.return_id.value=\'{$fields.id.value}\';',
59
+                //Bug#51778: The custom code will be replaced with sugar_html. customCode will be deplicated.
60
+                'sugar_html' => array(
61
+                    'type' => 'submit',
62
+                    'value' => '{$APP.LBL_CLOSE_AND_CREATE_BUTTON_TITLE}',
63
+                    'htmlOptions' => array(
64
+                        'title' => '{$APP.LBL_CLOSE_AND_CREATE_BUTTON_TITLE}',
65
+                        'name' => '{$APP.LBL_CLOSE_AND_CREATE_BUTTON_TITLE}',
66
+                        'class' => 'button',
67
+                        'id' => 'close_create_button',
68
+                        'onclick' => 'this.form.isSaveFromDetailView.value=true; this.form.status.value=\'Held\'; this.form.action.value=\'Save\';this.form.return_module.value=\'Meetings\';this.form.isDuplicate.value=true;this.form.isSaveAndNew.value=true;this.form.return_action.value=\'EditView\'; this.form.isDuplicate.value=true;this.form.return_id.value=\'{$fields.id.value}\';',
69 69
 
70
-                  ),
71
-                  'template' => '{if $fields.status.value != "Held" && $bean->aclAccess("edit")}[CONTENT]{/if}',
72
-              ),
73
-          ),
74
-          4 => 
75
-          array (
70
+                    ),
71
+                    'template' => '{if $fields.status.value != "Held" && $bean->aclAccess("edit")}[CONTENT]{/if}',
72
+                ),
73
+            ),
74
+            4 => 
75
+            array (
76 76
             'customCode' => '{if $fields.status.value != "Held" && $bean->aclAccess("edit")} <input type="hidden" name="isSave" value="false">  <input title="{$APP.LBL_CLOSE_BUTTON_TITLE}"  accesskey="{$APP.LBL_CLOSE_BUTTON_KEY}"  class="button"  onclick="this.form.status.value=\'Held\'; this.form.action.value=\'Save\';this.form.return_module.value=\'Meetings\';this.form.isSave.value=true;this.form.return_action.value=\'DetailView\'; this.form.return_id.value=\'{$fields.id.value}\'"  id="close_button" name="button1"  value="{$APP.LBL_CLOSE_BUTTON_TITLE}"  type="submit">{/if}',
77
-              //Bug#51778: The custom code will be replaced with sugar_html. customCode will be deplicated.
78
-              'sugar_html' => array(
79
-                  'type' => 'submit',
80
-                  'value' => '{$APP.LBL_CLOSE_BUTTON_TITLE}',
81
-                  'htmlOptions' => array(
82
-                      'title' => '{$APP.LBL_CLOSE_BUTTON_TITLE}',
83
-                      'accesskey' => '{$APP.LBL_CLOSE_BUTTON_KEY}',
84
-                      'class' => 'button',
85
-                      'onclick' => 'this.form.status.value=\'Held\'; this.form.action.value=\'Save\';this.form.return_module.value=\'Meetings\';this.form.isSave.value=true;this.form.return_action.value=\'DetailView\'; this.form.return_id.value=\'{$fields.id.value}\';',
86
-                      'name' => '{$APP.LBL_CLOSE_BUTTON_TITLE}',
87
-                      'id' => 'close_button',
88
-                  ),
89
-                  'template' => '{if $fields.status.value != "Held" && $bean->aclAccess("edit")}[CONTENT]{/if}',
90
-              ),
91
-          ),
77
+                //Bug#51778: The custom code will be replaced with sugar_html. customCode will be deplicated.
78
+                'sugar_html' => array(
79
+                    'type' => 'submit',
80
+                    'value' => '{$APP.LBL_CLOSE_BUTTON_TITLE}',
81
+                    'htmlOptions' => array(
82
+                        'title' => '{$APP.LBL_CLOSE_BUTTON_TITLE}',
83
+                        'accesskey' => '{$APP.LBL_CLOSE_BUTTON_KEY}',
84
+                        'class' => 'button',
85
+                        'onclick' => 'this.form.status.value=\'Held\'; this.form.action.value=\'Save\';this.form.return_module.value=\'Meetings\';this.form.isSave.value=true;this.form.return_action.value=\'DetailView\'; this.form.return_id.value=\'{$fields.id.value}\';',
86
+                        'name' => '{$APP.LBL_CLOSE_BUTTON_TITLE}',
87
+                        'id' => 'close_button',
88
+                    ),
89
+                    'template' => '{if $fields.status.value != "Held" && $bean->aclAccess("edit")}[CONTENT]{/if}',
90
+                ),
91
+            ),
92 92
         ),
93 93
         'hidden' => array(
94 94
             '<input type="hidden" name="isSaveAndNew">',
@@ -97,50 +97,50 @@  discard block
 block discarded – undo
97 97
             '<input type="hidden" name="isSave">',
98 98
         ),
99 99
         'headerTpl' => 'modules/Meetings/tpls/detailHeader.tpl',
100
-      ),
101
-      'maxColumns' => '2',
102
-      'widths' => 
103
-      array (
100
+        ),
101
+        'maxColumns' => '2',
102
+        'widths' => 
103
+        array (
104 104
         0 => 
105 105
         array (
106
-          'label' => '10',
107
-          'field' => '30',
106
+            'label' => '10',
107
+            'field' => '30',
108 108
         ),
109 109
         1 => 
110 110
         array (
111
-          'label' => '10',
112
-          'field' => '30',
111
+            'label' => '10',
112
+            'field' => '30',
113
+        ),
113 114
         ),
114
-      ),
115
-      'useTabs' => false,
115
+        'useTabs' => false,
116 116
     ),
117 117
     'panels' => 
118 118
     array (
119
-      'lbl_meeting_information' => 
120
-      array (
119
+        'lbl_meeting_information' => 
120
+        array (
121 121
         array (
122
-          array (
122
+            array (
123 123
             'name' => 'name',
124 124
             'label' => 'LBL_SUBJECT',
125
-          ),
126
-          'status',
125
+            ),
126
+            'status',
127 127
         ),
128 128
         array (
129
-          array (
129
+            array (
130 130
             'name' => 'date_start',
131 131
             'label' => 'LBL_DATE_TIME',
132
-          ),
132
+            ),
133 133
         ),
134 134
         array (
135
-          array (
135
+            array (
136 136
             'name' => 'duration',
137 137
             'customCode' => '{$fields.duration_hours.value}{$MOD.LBL_HOURS_ABBREV} {$fields.duration_minutes.value}{$MOD.LBL_MINSS_ABBREV} ',
138 138
             'label' => 'LBL_DURATION',
139
-          ),
140
-          array (
139
+            ),
140
+            array (
141 141
             'name' => 'parent_name',
142 142
             'customLabel' => '{sugar_translate label=\'LBL_MODULE_NAME\' module=$fields.parent_type.value}',
143
-          ),
143
+            ),
144 144
         ),
145 145
         array (
146 146
 //          array(
@@ -148,38 +148,38 @@  discard block
 block discarded – undo
148 148
 //            'customCode' => '{include file="modules/Meetings/tpls/reminders.tpl"}',
149 149
 //            'label' => 'LBL_REMINDER',
150 150
 //            ),
151
-          array(
151
+            array(
152 152
             'name' => 'reminders',
153 153
             'label' => 'LBL_REMINDERS',
154 154
             ),
155
-          'location',
155
+            'location',
156 156
         ),
157 157
         array (
158
-          'description',
158
+            'description',
159
+        ),
159 160
         ),
160
-      ),
161
-      'LBL_PANEL_ASSIGNMENT' => 
162
-      array (
161
+        'LBL_PANEL_ASSIGNMENT' => 
163 162
         array (
164
-          array (
163
+        array (
164
+            array (
165 165
             'name' => 'assigned_user_name',
166 166
             'label' => 'LBL_ASSIGNED_TO',
167
-          ),
168
-          array (
167
+            ),
168
+            array (
169 169
             'name' => 'date_modified',
170 170
             'label' => 'LBL_DATE_MODIFIED',
171 171
             'customCode' => '{$fields.date_modified.value} {$APP.LBL_BY} {$fields.modified_by_name.value}',
172
-          ),
172
+            ),
173 173
 
174 174
         ),
175 175
         array (
176
-          array (
176
+            array (
177 177
             'name' => 'date_entered',
178 178
             'customCode' => '{$fields.date_entered.value} {$APP.LBL_BY} {$fields.created_by_name.value}',
179
-          ),
179
+            ),
180 180
         ),
181
-      ),
181
+        ),
182
+    ),
182 183
     ),
183
-  ),
184 184
 );
185 185
 ?>
Please login to merge, or discard this patch.
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -38,23 +38,23 @@  discard block
 block discarded – undo
38 38
  ********************************************************************************/
39 39
 
40 40
 $viewdefs ['Meetings'] = 
41
-array (
41
+array(
42 42
   'DetailView' => 
43
-  array (
43
+  array(
44 44
     'templateMeta' => 
45
-    array (
45
+    array(
46 46
         'includes' => array(
47 47
             array('file' => 'modules/Reminders/Reminders.js'),
48 48
         ),
49 49
       'form' => 
50
-      array (
50
+      array(
51 51
         'buttons' => 
52
-        array (
52
+        array(
53 53
           0 => 'EDIT',
54 54
           1 => 'DUPLICATE',
55 55
           2 => 'DELETE',
56 56
           3 => 
57
-          array (
57
+          array(
58 58
             'customCode' => '{if $fields.status.value != "Held" && $bean->aclAccess("edit")} <input type="hidden" name="isSaveAndNew" value="false">  <input type="hidden" name="status" value="">  <input type="hidden" name="isSaveFromDetailView" value="true">  <input title="{$APP.LBL_CLOSE_AND_CREATE_BUTTON_TITLE}"   class="button"  onclick="this.form.status.value=\'Held\'; this.form.action.value=\'Save\';this.form.return_module.value=\'Meetings\';this.form.isDuplicate.value=true;this.form.isSaveAndNew.value=true;this.form.return_action.value=\'EditView\'; this.form.isDuplicate.value=true;this.form.return_id.value=\'{$fields.id.value}\';" id="close_create_button" name="button"  value="{$APP.LBL_CLOSE_AND_CREATE_BUTTON_TITLE}"  type="submit">{/if}',
59 59
               //Bug#51778: The custom code will be replaced with sugar_html. customCode will be deplicated.
60 60
               'sugar_html' => array(
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
               ),
73 73
           ),
74 74
           4 => 
75
-          array (
75
+          array(
76 76
             'customCode' => '{if $fields.status.value != "Held" && $bean->aclAccess("edit")} <input type="hidden" name="isSave" value="false">  <input title="{$APP.LBL_CLOSE_BUTTON_TITLE}"  accesskey="{$APP.LBL_CLOSE_BUTTON_KEY}"  class="button"  onclick="this.form.status.value=\'Held\'; this.form.action.value=\'Save\';this.form.return_module.value=\'Meetings\';this.form.isSave.value=true;this.form.return_action.value=\'DetailView\'; this.form.return_id.value=\'{$fields.id.value}\'"  id="close_button" name="button1"  value="{$APP.LBL_CLOSE_BUTTON_TITLE}"  type="submit">{/if}',
77 77
               //Bug#51778: The custom code will be replaced with sugar_html. customCode will be deplicated.
78 78
               'sugar_html' => array(
@@ -100,14 +100,14 @@  discard block
 block discarded – undo
100 100
       ),
101 101
       'maxColumns' => '2',
102 102
       'widths' => 
103
-      array (
103
+      array(
104 104
         0 => 
105
-        array (
105
+        array(
106 106
           'label' => '10',
107 107
           'field' => '30',
108 108
         ),
109 109
         1 => 
110
-        array (
110
+        array(
111 111
           'label' => '10',
112 112
           'field' => '30',
113 113
         ),
@@ -115,34 +115,34 @@  discard block
 block discarded – undo
115 115
       'useTabs' => false,
116 116
     ),
117 117
     'panels' => 
118
-    array (
118
+    array(
119 119
       'lbl_meeting_information' => 
120
-      array (
121
-        array (
122
-          array (
120
+      array(
121
+        array(
122
+          array(
123 123
             'name' => 'name',
124 124
             'label' => 'LBL_SUBJECT',
125 125
           ),
126 126
           'status',
127 127
         ),
128
-        array (
129
-          array (
128
+        array(
129
+          array(
130 130
             'name' => 'date_start',
131 131
             'label' => 'LBL_DATE_TIME',
132 132
           ),
133 133
         ),
134
-        array (
135
-          array (
134
+        array(
135
+          array(
136 136
             'name' => 'duration',
137 137
             'customCode' => '{$fields.duration_hours.value}{$MOD.LBL_HOURS_ABBREV} {$fields.duration_minutes.value}{$MOD.LBL_MINSS_ABBREV} ',
138 138
             'label' => 'LBL_DURATION',
139 139
           ),
140
-          array (
140
+          array(
141 141
             'name' => 'parent_name',
142 142
             'customLabel' => '{sugar_translate label=\'LBL_MODULE_NAME\' module=$fields.parent_type.value}',
143 143
           ),
144 144
         ),
145
-        array (
145
+        array(
146 146
 //          array(
147 147
 //            'name' => 'reminder_time',
148 148
 //            'customCode' => '{include file="modules/Meetings/tpls/reminders.tpl"}',
@@ -154,26 +154,26 @@  discard block
 block discarded – undo
154 154
             ),
155 155
           'location',
156 156
         ),
157
-        array (
157
+        array(
158 158
           'description',
159 159
         ),
160 160
       ),
161 161
       'LBL_PANEL_ASSIGNMENT' => 
162
-      array (
163
-        array (
164
-          array (
162
+      array(
163
+        array(
164
+          array(
165 165
             'name' => 'assigned_user_name',
166 166
             'label' => 'LBL_ASSIGNED_TO',
167 167
           ),
168
-          array (
168
+          array(
169 169
             'name' => 'date_modified',
170 170
             'label' => 'LBL_DATE_MODIFIED',
171 171
             'customCode' => '{$fields.date_modified.value} {$APP.LBL_BY} {$fields.modified_by_name.value}',
172 172
           ),
173 173
 
174 174
         ),
175
-        array (
176
-          array (
175
+        array(
176
+          array(
177 177
             'name' => 'date_entered',
178 178
             'customCode' => '{$fields.date_entered.value} {$APP.LBL_BY} {$fields.created_by_name.value}',
179 179
           ),
Please login to merge, or discard this patch.
modules/Meetings/metadata/quickcreatedefs.php 2 patches
Indentation   +61 added lines, -61 removed lines patch added patch discarded remove patch
@@ -39,119 +39,119 @@  discard block
 block discarded – undo
39 39
 
40 40
 $viewdefs ['Meetings'] =
41 41
 array (
42
-  'QuickCreate' =>
43
-  array (
42
+    'QuickCreate' =>
43
+    array (
44 44
     'templateMeta' =>
45 45
     array (
46 46
         'includes' => array(
47 47
             array('file' => 'modules/Reminders/Reminders.js'),
48 48
         ),
49
-      'maxColumns' => '2',
50
-      'form' =>
51
-      array (
49
+        'maxColumns' => '2',
50
+        'form' =>
51
+        array (
52 52
         'hidden' =>
53 53
         array (
54
-           '<input type="hidden" name="isSaveAndNew" value="false">',
55
-           '<input type="hidden" name="is_ajax_call" value="1">',
54
+            '<input type="hidden" name="isSaveAndNew" value="false">',
55
+            '<input type="hidden" name="is_ajax_call" value="1">',
56 56
         ),
57 57
         'buttons' =>
58 58
         array (
59 59
 
60
-          array (
60
+            array (
61 61
             'customCode' => '<input title="{$APP.LBL_SAVE_BUTTON_TITLE}" accessKey="{$APP.LBL_SAVE_BUTTON_KEY}" class="button" onclick="SUGAR.meetings.fill_invitees();this.form.action.value=\'Save\'; this.form.return_action.value=\'DetailView\'; {if isset($smarty.request.isDuplicate) && $smarty.request.isDuplicate eq "true"}this.form.return_id.value=\'\'; {/if}return check_form(\'EditView\');" type="submit" name="button" value="{$APP.LBL_SAVE_BUTTON_LABEL}">',
62
-          ),
63
-           'CANCEL',
62
+            ),
63
+            'CANCEL',
64 64
 
65
-          array (
65
+            array (
66 66
             'customCode' => '<input title="{$MOD.LBL_SEND_BUTTON_TITLE}" class="button" onclick="this.form.send_invites.value=\'1\';SUGAR.meetings.fill_invitees();this.form.action.value=\'Save\';this.form.return_action.value=\'EditView\';this.form.return_module.value=\'{$smarty.request.return_module}\';return check_form(\'EditView\');" type="submit" name="button" value="{$MOD.LBL_SEND_BUTTON_LABEL}">',
67
-          ),
67
+            ),
68 68
 
69
-          array (
69
+            array (
70 70
             'customCode' => '{if $fields.status.value != "Held"}<input title="{$APP.LBL_CLOSE_AND_CREATE_BUTTON_TITLE}" accessKey="{$APP.LBL_CLOSE_AND_CREATE_BUTTON_KEY}" class="button" onclick="SUGAR.meetings.fill_invitees(); this.form.status.value=\'Held\'; this.form.action.value=\'Save\'; this.form.return_module.value=\'Meetings\'; this.form.isDuplicate.value=true; this.form.isSaveAndNew.value=true; this.form.return_action.value=\'EditView\'; this.form.return_id.value=\'{$fields.id.value}\'; return check_form(\'EditView\');" type="submit" name="button" value="{$APP.LBL_CLOSE_AND_CREATE_BUTTON_LABEL}">{/if}',
71
-          ),
71
+            ),
72
+        ),
72 73
         ),
73
-      ),
74
-      'widths' =>
75
-      array (
74
+        'widths' =>
75
+        array (
76 76
 
77 77
         array (
78
-          'label' => '10',
79
-          'field' => '30',
78
+            'label' => '10',
79
+            'field' => '30',
80 80
         ),
81 81
 
82 82
         array (
83
-          'label' => '10',
84
-          'field' => '30',
83
+            'label' => '10',
84
+            'field' => '30',
85
+        ),
85 86
         ),
86
-      ),
87
-      'javascript' => '<script type="text/javascript">{$JSON_CONFIG_JAVASCRIPT}</script>
87
+        'javascript' => '<script type="text/javascript">{$JSON_CONFIG_JAVASCRIPT}</script>
88 88
 {sugar_getscript file="cache/include/javascript/sugar_grp_jsolait.js"}
89 89
 <script>toggle_portal_flag();function toggle_portal_flag()  {literal} { {/literal} {$TOGGLE_JS} {literal} } {/literal} </script>',
90
-      'useTabs' => false,
90
+        'useTabs' => false,
91 91
     ),
92 92
     'panels' =>
93 93
     array (
94
-      'default' =>
95
-      array (
94
+        'default' =>
95
+        array (
96 96
 
97 97
         array (
98 98
 
99
-          array (
99
+            array (
100 100
             'name' => 'name',
101 101
             'displayParams' =>
102 102
             array (
103
-              'required' => true,
103
+                'required' => true,
104
+            ),
104 105
             ),
105
-          ),
106 106
 
107
-          array (
107
+            array (
108 108
             'name' => 'status',
109 109
             'fields' =>
110 110
             array (
111 111
 
112
-              array (
112
+                array (
113 113
                 'name' => 'status',
114
-              ),
114
+                ),
115
+            ),
115 116
             ),
116
-          ),
117 117
         ),
118 118
         array (
119 119
 
120
-          array (
120
+            array (
121 121
             'name' => 'date_start',
122 122
             'type' => 'datetimecombo',
123 123
             'displayParams' =>
124 124
             array (
125
-              'required' => true,
126
-              'updateCallback' => 'SugarWidgetScheduler.update_time();',
125
+                'required' => true,
126
+                'updateCallback' => 'SugarWidgetScheduler.update_time();',
127
+            ),
127 128
             ),
128
-          ),
129 129
 
130
-          array (
130
+            array (
131 131
             'name' => 'parent_name',
132 132
             'label' => 'LBL_LIST_RELATED_TO',
133
-          ),
133
+            ),
134 134
         ),
135 135
         
136 136
         array (
137
-          array (
137
+            array (
138 138
             'name' => 'date_end',
139 139
             'type' => 'datetimecombo',
140 140
             'displayParams' =>
141 141
             array (
142
-              'required' => true,
143
-              'updateCallback' => 'SugarWidgetScheduler.update_time();',
142
+                'required' => true,
143
+                'updateCallback' => 'SugarWidgetScheduler.update_time();',
144 144
             ),
145
-          ),
146
-          array (
145
+            ),
146
+            array (
147 147
             'name' => 'location',
148 148
             'comment' => 'Meeting location',
149 149
             'label' => 'LBL_LOCATION',
150
-          ),
150
+            ),
151 151
         ),
152 152
         
153 153
         array(        
154
-          array (
154
+            array (
155 155
             'name' => 'duration',
156 156
             'customCode' => '
157 157
                 @@FIELD@@
@@ -168,37 +168,37 @@  discard block
 block discarded – undo
168 168
                     {/literal}
169 169
                 </script>            
170 170
             ',
171
-          ),          
171
+            ),          
172 172
 //          array (
173 173
 //            'name' => 'reminder_time',
174 174
 //            'customCode' => '{include file="modules/Meetings/tpls/reminders.tpl"}',
175 175
 //            'label' => 'LBL_REMINDER',
176 176
 //          ),
177
-              array (
178
-                  'name' => 'reminders',
179
-                  'customCode' => '{include file="modules/Reminders/tpls/reminders.tpl"}',
180
-                  'label' => 'LBL_REMINDERS',
181
-              ),
182
-       ),
183
-
184
-         array (
185
-         	 array (
177
+                array (
178
+                    'name' => 'reminders',
179
+                    'customCode' => '{include file="modules/Reminders/tpls/reminders.tpl"}',
180
+                    'label' => 'LBL_REMINDERS',
181
+                ),
182
+        ),
183
+
184
+            array (
185
+                array (
186 186
             'name' => 'assigned_user_name',
187 187
             'label' => 'LBL_ASSIGNED_TO_NAME',
188
-          ),
188
+            ),
189 189
 
190 190
         ),
191 191
 
192 192
         array (
193 193
 
194
-          array (
194
+            array (
195 195
             'name' => 'description',
196 196
             'comment' => 'Full text of the note',
197 197
             'label' => 'LBL_DESCRIPTION',
198
-          ),
198
+            ),
199 199
         ),
200
-      ),
200
+        ),
201
+    ),
201 202
     ),
202
-  ),
203 203
 );
204 204
 ?>
Please login to merge, or discard this patch.
Spacing   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -38,48 +38,48 @@  discard block
 block discarded – undo
38 38
  ********************************************************************************/
39 39
 
40 40
 $viewdefs ['Meetings'] =
41
-array (
41
+array(
42 42
   'QuickCreate' =>
43
-  array (
43
+  array(
44 44
     'templateMeta' =>
45
-    array (
45
+    array(
46 46
         'includes' => array(
47 47
             array('file' => 'modules/Reminders/Reminders.js'),
48 48
         ),
49 49
       'maxColumns' => '2',
50 50
       'form' =>
51
-      array (
51
+      array(
52 52
         'hidden' =>
53
-        array (
53
+        array(
54 54
            '<input type="hidden" name="isSaveAndNew" value="false">',
55 55
            '<input type="hidden" name="is_ajax_call" value="1">',
56 56
         ),
57 57
         'buttons' =>
58
-        array (
58
+        array(
59 59
 
60
-          array (
60
+          array(
61 61
             'customCode' => '<input title="{$APP.LBL_SAVE_BUTTON_TITLE}" accessKey="{$APP.LBL_SAVE_BUTTON_KEY}" class="button" onclick="SUGAR.meetings.fill_invitees();this.form.action.value=\'Save\'; this.form.return_action.value=\'DetailView\'; {if isset($smarty.request.isDuplicate) && $smarty.request.isDuplicate eq "true"}this.form.return_id.value=\'\'; {/if}return check_form(\'EditView\');" type="submit" name="button" value="{$APP.LBL_SAVE_BUTTON_LABEL}">',
62 62
           ),
63 63
            'CANCEL',
64 64
 
65
-          array (
65
+          array(
66 66
             'customCode' => '<input title="{$MOD.LBL_SEND_BUTTON_TITLE}" class="button" onclick="this.form.send_invites.value=\'1\';SUGAR.meetings.fill_invitees();this.form.action.value=\'Save\';this.form.return_action.value=\'EditView\';this.form.return_module.value=\'{$smarty.request.return_module}\';return check_form(\'EditView\');" type="submit" name="button" value="{$MOD.LBL_SEND_BUTTON_LABEL}">',
67 67
           ),
68 68
 
69
-          array (
69
+          array(
70 70
             'customCode' => '{if $fields.status.value != "Held"}<input title="{$APP.LBL_CLOSE_AND_CREATE_BUTTON_TITLE}" accessKey="{$APP.LBL_CLOSE_AND_CREATE_BUTTON_KEY}" class="button" onclick="SUGAR.meetings.fill_invitees(); this.form.status.value=\'Held\'; this.form.action.value=\'Save\'; this.form.return_module.value=\'Meetings\'; this.form.isDuplicate.value=true; this.form.isSaveAndNew.value=true; this.form.return_action.value=\'EditView\'; this.form.return_id.value=\'{$fields.id.value}\'; return check_form(\'EditView\');" type="submit" name="button" value="{$APP.LBL_CLOSE_AND_CREATE_BUTTON_LABEL}">{/if}',
71 71
           ),
72 72
         ),
73 73
       ),
74 74
       'widths' =>
75
-      array (
75
+      array(
76 76
 
77
-        array (
77
+        array(
78 78
           'label' => '10',
79 79
           'field' => '30',
80 80
         ),
81 81
 
82
-        array (
82
+        array(
83 83
           'label' => '10',
84 84
           'field' => '30',
85 85
         ),
@@ -90,60 +90,60 @@  discard block
 block discarded – undo
90 90
       'useTabs' => false,
91 91
     ),
92 92
     'panels' =>
93
-    array (
93
+    array(
94 94
       'default' =>
95
-      array (
95
+      array(
96 96
 
97
-        array (
97
+        array(
98 98
 
99
-          array (
99
+          array(
100 100
             'name' => 'name',
101 101
             'displayParams' =>
102
-            array (
102
+            array(
103 103
               'required' => true,
104 104
             ),
105 105
           ),
106 106
 
107
-          array (
107
+          array(
108 108
             'name' => 'status',
109 109
             'fields' =>
110
-            array (
110
+            array(
111 111
 
112
-              array (
112
+              array(
113 113
                 'name' => 'status',
114 114
               ),
115 115
             ),
116 116
           ),
117 117
         ),
118
-        array (
118
+        array(
119 119
 
120
-          array (
120
+          array(
121 121
             'name' => 'date_start',
122 122
             'type' => 'datetimecombo',
123 123
             'displayParams' =>
124
-            array (
124
+            array(
125 125
               'required' => true,
126 126
               'updateCallback' => 'SugarWidgetScheduler.update_time();',
127 127
             ),
128 128
           ),
129 129
 
130
-          array (
130
+          array(
131 131
             'name' => 'parent_name',
132 132
             'label' => 'LBL_LIST_RELATED_TO',
133 133
           ),
134 134
         ),
135 135
         
136
-        array (
137
-          array (
136
+        array(
137
+          array(
138 138
             'name' => 'date_end',
139 139
             'type' => 'datetimecombo',
140 140
             'displayParams' =>
141
-            array (
141
+            array(
142 142
               'required' => true,
143 143
               'updateCallback' => 'SugarWidgetScheduler.update_time();',
144 144
             ),
145 145
           ),
146
-          array (
146
+          array(
147 147
             'name' => 'location',
148 148
             'comment' => 'Meeting location',
149 149
             'label' => 'LBL_LOCATION',
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
         ),
152 152
         
153 153
         array(        
154
-          array (
154
+          array(
155 155
             'name' => 'duration',
156 156
             'customCode' => '
157 157
                 @@FIELD@@
@@ -174,24 +174,24 @@  discard block
 block discarded – undo
174 174
 //            'customCode' => '{include file="modules/Meetings/tpls/reminders.tpl"}',
175 175
 //            'label' => 'LBL_REMINDER',
176 176
 //          ),
177
-              array (
177
+              array(
178 178
                   'name' => 'reminders',
179 179
                   'customCode' => '{include file="modules/Reminders/tpls/reminders.tpl"}',
180 180
                   'label' => 'LBL_REMINDERS',
181 181
               ),
182 182
        ),
183 183
 
184
-         array (
185
-         	 array (
184
+         array(
185
+         	 array(
186 186
             'name' => 'assigned_user_name',
187 187
             'label' => 'LBL_ASSIGNED_TO_NAME',
188 188
           ),
189 189
 
190 190
         ),
191 191
 
192
-        array (
192
+        array(
193 193
 
194
-          array (
194
+          array(
195 195
             'name' => 'description',
196 196
             'comment' => 'Full text of the note',
197 197
             'label' => 'LBL_DESCRIPTION',
Please login to merge, or discard this patch.
modules/Meetings/metadata/listviewdefs.php 2 patches
Indentation   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -39,8 +39,8 @@  discard block
 block discarded – undo
39 39
 
40 40
 $listViewDefs ['Meetings'] = 
41 41
 array (
42
-  'SET_COMPLETE' => 
43
-  array (
42
+    'SET_COMPLETE' => 
43
+    array (
44 44
     'width' => '1%',
45 45
     'label' => 'LBL_LIST_CLOSE',
46 46
     'link' => true,
@@ -48,18 +48,18 @@  discard block
 block discarded – undo
48 48
     'default' => true,
49 49
     'related_fields' => 
50 50
     array (
51
-      0 => 'status',
51
+        0 => 'status',
52
+    ),
52 53
     ),
53
-  ),
54
-  'NAME' => 
55
-  array (
54
+    'NAME' => 
55
+    array (
56 56
     'width' => '40%',
57 57
     'label' => 'LBL_LIST_SUBJECT',
58 58
     'link' => true,
59 59
     'default' => true,
60
-  ),
61
-  'CONTACT_NAME' => 
62
-  array (
60
+    ),
61
+    'CONTACT_NAME' => 
62
+    array (
63 63
     'width' => '20%',
64 64
     'label' => 'LBL_LIST_CONTACT',
65 65
     'link' => true,
@@ -67,9 +67,9 @@  discard block
 block discarded – undo
67 67
     'module' => 'Contacts',
68 68
     'default' => true,
69 69
     'ACLTag' => 'CONTACT',
70
-  ),
71
-  'PARENT_NAME' => 
72
-  array (
70
+    ),
71
+    'PARENT_NAME' => 
72
+    array (
73 73
     'width' => '20%',
74 74
     'label' => 'LBL_LIST_RELATED_TO',
75 75
     'dynamic_module' => 'PARENT_TYPE',
@@ -80,47 +80,47 @@  discard block
 block discarded – undo
80 80
     'ACLTag' => 'PARENT',
81 81
     'related_fields' => 
82 82
     array (
83
-      0 => 'parent_id',
84
-      1 => 'parent_type',
83
+        0 => 'parent_id',
84
+        1 => 'parent_type',
85 85
     ),
86
-  ),
87
-  'DATE_START' => 
88
-  array (
86
+    ),
87
+    'DATE_START' => 
88
+    array (
89 89
     'width' => '15%',
90 90
     'label' => 'LBL_LIST_DATE',
91 91
     'link' => false,
92 92
     'default' => true,
93 93
     'related_fields' => 
94 94
     array (
95
-      0 => 'time_start',
95
+        0 => 'time_start',
96 96
     ),
97
-  ),
98
-  'ASSIGNED_USER_NAME' => 
99
-  array (
97
+    ),
98
+    'ASSIGNED_USER_NAME' => 
99
+    array (
100 100
     'width' => '2%',
101 101
     'label' => 'LBL_LIST_ASSIGNED_TO_NAME',
102 102
     'module' => 'Employees',
103 103
     'id' => 'ASSIGNED_USER_ID',
104 104
     'default' => true,
105
-  ),
106
-  'DIRECTION' => 
107
-  array (
105
+    ),
106
+    'DIRECTION' => 
107
+    array (
108 108
     'type' => 'enum',
109 109
     'label' => 'LBL_LIST_DIRECTION',
110 110
     'width' => '10%',
111 111
     'default' => false,
112
-  ),
113
-  'STATUS' => 
114
-  array (
112
+    ),
113
+    'STATUS' => 
114
+    array (
115 115
     'width' => '10%',
116 116
     'label' => 'LBL_LIST_STATUS',
117 117
     'link' => false,
118 118
     'default' => false,
119
-  ),
120
-  'DATE_ENTERED' => array (
121
-	'width' => '10%',
122
-	'label' => 'LBL_DATE_ENTERED',
123
-	'default' => true
124
-  ),  
119
+    ),
120
+    'DATE_ENTERED' => array (
121
+    'width' => '10%',
122
+    'label' => 'LBL_DATE_ENTERED',
123
+    'default' => true
124
+    ),  
125 125
 );
126 126
 ?>
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -38,28 +38,28 @@  discard block
 block discarded – undo
38 38
  ********************************************************************************/
39 39
 
40 40
 $listViewDefs ['Meetings'] = 
41
-array (
41
+array(
42 42
   'SET_COMPLETE' => 
43
-  array (
43
+  array(
44 44
     'width' => '1%',
45 45
     'label' => 'LBL_LIST_CLOSE',
46 46
     'link' => true,
47 47
     'sortable' => false,
48 48
     'default' => true,
49 49
     'related_fields' => 
50
-    array (
50
+    array(
51 51
       0 => 'status',
52 52
     ),
53 53
   ),
54 54
   'NAME' => 
55
-  array (
55
+  array(
56 56
     'width' => '40%',
57 57
     'label' => 'LBL_LIST_SUBJECT',
58 58
     'link' => true,
59 59
     'default' => true,
60 60
   ),
61 61
   'CONTACT_NAME' => 
62
-  array (
62
+  array(
63 63
     'width' => '20%',
64 64
     'label' => 'LBL_LIST_CONTACT',
65 65
     'link' => true,
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
     'ACLTag' => 'CONTACT',
70 70
   ),
71 71
   'PARENT_NAME' => 
72
-  array (
72
+  array(
73 73
     'width' => '20%',
74 74
     'label' => 'LBL_LIST_RELATED_TO',
75 75
     'dynamic_module' => 'PARENT_TYPE',
@@ -79,24 +79,24 @@  discard block
 block discarded – undo
79 79
     'sortable' => false,
80 80
     'ACLTag' => 'PARENT',
81 81
     'related_fields' => 
82
-    array (
82
+    array(
83 83
       0 => 'parent_id',
84 84
       1 => 'parent_type',
85 85
     ),
86 86
   ),
87 87
   'DATE_START' => 
88
-  array (
88
+  array(
89 89
     'width' => '15%',
90 90
     'label' => 'LBL_LIST_DATE',
91 91
     'link' => false,
92 92
     'default' => true,
93 93
     'related_fields' => 
94
-    array (
94
+    array(
95 95
       0 => 'time_start',
96 96
     ),
97 97
   ),
98 98
   'ASSIGNED_USER_NAME' => 
99
-  array (
99
+  array(
100 100
     'width' => '2%',
101 101
     'label' => 'LBL_LIST_ASSIGNED_TO_NAME',
102 102
     'module' => 'Employees',
@@ -104,20 +104,20 @@  discard block
 block discarded – undo
104 104
     'default' => true,
105 105
   ),
106 106
   'DIRECTION' => 
107
-  array (
107
+  array(
108 108
     'type' => 'enum',
109 109
     'label' => 'LBL_LIST_DIRECTION',
110 110
     'width' => '10%',
111 111
     'default' => false,
112 112
   ),
113 113
   'STATUS' => 
114
-  array (
114
+  array(
115 115
     'width' => '10%',
116 116
     'label' => 'LBL_LIST_STATUS',
117 117
     'link' => false,
118 118
     'default' => false,
119 119
   ),
120
-  'DATE_ENTERED' => array (
120
+  'DATE_ENTERED' => array(
121 121
 	'width' => '10%',
122 122
 	'label' => 'LBL_DATE_ENTERED',
123 123
 	'default' => true
Please login to merge, or discard this patch.