@@ -1,5 +1,5 @@ discard block |
||
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. |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | * All Rights Reserved. |
46 | 46 | * Contributor(s): ______________________________________.. |
47 | 47 | ********************************************************************************/ |
48 | -$fields_array['EmailTemplate'] = array ('column_fields' => Array("id" |
|
48 | +$fields_array['EmailTemplate'] = array('column_fields' => Array("id" |
|
49 | 49 | , "date_entered" |
50 | 50 | , "date_modified" |
51 | 51 | , "modified_user_id" |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | , "name" |
58 | 58 | , "published" |
59 | 59 | ), |
60 | - 'list_fields' => Array('id', 'name', 'description','date_modified' |
|
60 | + 'list_fields' => Array('id', 'name', 'description', 'date_modified' |
|
61 | 61 | ), |
62 | 62 | 'required_fields' => array("name"=>1), |
63 | 63 | ); |
@@ -1,5 +1,5 @@ discard block |
||
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. |
@@ -55,17 +55,17 @@ discard block |
||
55 | 55 | |
56 | 56 | $ret = array(); |
57 | 57 | |
58 | -foreach($_FILES as $k => $file) { |
|
59 | - if(in_array(strtolower($_FILES[$k]['type']), $imgType) && $_FILES[$k]['size'] > 0) { |
|
58 | +foreach ($_FILES as $k => $file) { |
|
59 | + if (in_array(strtolower($_FILES[$k]['type']), $imgType) && $_FILES[$k]['size'] > 0) { |
|
60 | 60 | $upload_file = new UploadFile($k); |
61 | 61 | // check the file |
62 | - if($upload_file->confirm_upload()) { |
|
62 | + if ($upload_file->confirm_upload()) { |
|
63 | 63 | $dest = $cachedir.basename($upload_file->get_stored_file_name()); // target name |
64 | 64 | $guid = create_guid(); |
65 | - if($upload_file->final_move($guid)) { // move to uploads |
|
65 | + if ($upload_file->final_move($guid)) { // move to uploads |
|
66 | 66 | $path = $upload_file->get_upload_path($guid); |
67 | 67 | // if file is OK, copy to cache |
68 | - if(verify_uploaded_image($path) && copy($path, $dest)) { |
|
68 | + if (verify_uploaded_image($path) && copy($path, $dest)) { |
|
69 | 69 | $ret[] = $dest; |
70 | 70 | } |
71 | 71 | // remove temp file |
@@ -74,9 +74,9 @@ discard block |
||
74 | 74 | $GLOBALS['log']->info("EmailTemplate detail view"); |
75 | 75 | |
76 | 76 | if ($has_campaign || $inboundEmail) { |
77 | - $xtpl = new XTemplate ('modules/EmailTemplates/EditView.html'); |
|
77 | + $xtpl = new XTemplate('modules/EmailTemplates/EditView.html'); |
|
78 | 78 | } else { |
79 | - $xtpl = new XTemplate ('modules/EmailTemplates/EditViewMain.html'); |
|
79 | + $xtpl = new XTemplate('modules/EmailTemplates/EditViewMain.html'); |
|
80 | 80 | } // else |
81 | 81 | $xtpl->assign("MOD", $mod_strings); |
82 | 82 | $xtpl->assign("APP", $app_strings); |
@@ -128,13 +128,13 @@ discard block |
||
128 | 128 | require_once('include/QuickSearchDefaults.php'); |
129 | 129 | $qsd = QuickSearchDefaults::getQuickSearchDefaults(); |
130 | 130 | $sqs_objects = array('EditView_assigned_user_name' => $qsd->getQSUser()); |
131 | -$quicksearch_js = '<script type="text/javascript" language="javascript">sqs_objects = ' . $json->encode($sqs_objects) . '; enableQS();</script>'; |
|
131 | +$quicksearch_js = '<script type="text/javascript" language="javascript">sqs_objects = '.$json->encode($sqs_objects).'; enableQS();</script>'; |
|
132 | 132 | |
133 | 133 | $xtpl->assign("CANCEL_SCRIPT", $cancel_script); |
134 | -$xtpl->assign("PRINT_URL", "index.php?" . $GLOBALS['request_string']); |
|
135 | -$xtpl->assign("JAVASCRIPT", get_set_focus_js() . $quicksearch_js); |
|
134 | +$xtpl->assign("PRINT_URL", "index.php?".$GLOBALS['request_string']); |
|
135 | +$xtpl->assign("JAVASCRIPT", get_set_focus_js().$quicksearch_js); |
|
136 | 136 | |
137 | -if (!is_file(sugar_cached('jsLanguage/') . $GLOBALS['current_language'] . '.js')) { |
|
137 | +if (!is_file(sugar_cached('jsLanguage/').$GLOBALS['current_language'].'.js')) { |
|
138 | 138 | require_once('include/language/jsLanguage.php'); |
139 | 139 | jsLanguage::createAppStringsCache($GLOBALS['current_language']); |
140 | 140 | } |
@@ -183,18 +183,18 @@ discard block |
||
183 | 183 | $record = $_REQUEST['record']; |
184 | 184 | } |
185 | 185 | |
186 | - $xtpl->assign("ADMIN_EDIT", "<a href='index.php?action=index&module=DynamicLayout&from_action=" . $_REQUEST['action'] . "&from_module=" . $_REQUEST['module'] . "&record=" . $record . "'>" . SugarThemeRegistry::current()->getImage("EditLayout", "border='0' align='bottom'", null, null, '.gif', $mod_strings['LBL_EDIT_LAYOUT']) . "</a>"); |
|
186 | + $xtpl->assign("ADMIN_EDIT", "<a href='index.php?action=index&module=DynamicLayout&from_action=".$_REQUEST['action']."&from_module=".$_REQUEST['module']."&record=".$record."'>".SugarThemeRegistry::current()->getImage("EditLayout", "border='0' align='bottom'", null, null, '.gif', $mod_strings['LBL_EDIT_LAYOUT'])."</a>"); |
|
187 | 187 | |
188 | 188 | } |
189 | 189 | if (isset($focus->parent_type) && $focus->parent_type != "") { |
190 | - $change_parent_button = "<input title='" . $app_strings['LBL_SELECT_BUTTON_TITLE'] . "' |
|
191 | -tabindex='3' type='button' class='button' value='" . $app_strings['LBL_SELECT_BUTTON_LABEL'] . "' name='button' LANGUAGE=javascript onclick='return |
|
190 | + $change_parent_button = "<input title='".$app_strings['LBL_SELECT_BUTTON_TITLE']."' |
|
191 | +tabindex='3' type='button' class='button' value='" . $app_strings['LBL_SELECT_BUTTON_LABEL']."' name='button' LANGUAGE=javascript onclick='return |
|
192 | 192 | window.open(\"index.php?module=\"+ document.EditView.parent_type.value + |
193 | 193 | \"&action=Popup&html=Popup_picker&form=TasksEditView\",\"test\",\"width=600,height=400,resizable=1,scrollbars=1\");'>"; |
194 | 194 | $xtpl->assign("CHANGE_PARENT_BUTTON", $change_parent_button); |
195 | 195 | } |
196 | 196 | if ($focus->parent_type == "Account") { |
197 | - $xtpl->assign("DEFAULT_SEARCH", "&query=true&account_id=$focus->parent_id&account_name=" . urlencode($focus->parent_name)); |
|
197 | + $xtpl->assign("DEFAULT_SEARCH", "&query=true&account_id=$focus->parent_id&account_name=".urlencode($focus->parent_name)); |
|
198 | 198 | } |
199 | 199 | |
200 | 200 | $xtpl->assign("DESCRIPTION", $focus->description); |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | // If it's campaign then hide the Account. |
252 | 252 | if ($has_campaign) { |
253 | 253 | $dropdown = "<option value='Contacts'> |
254 | - " . $lblContactAndOthers . " |
|
254 | + " . $lblContactAndOthers." |
|
255 | 255 | </option>"; |
256 | 256 | $xtpl->assign("DROPDOWN", $dropdown); |
257 | 257 | $xtpl->assign("DEFAULT_MODULE", 'Contacts'); |
@@ -285,13 +285,13 @@ discard block |
||
285 | 285 | if (empty($the_note->filename)) { |
286 | 286 | continue; |
287 | 287 | } |
288 | - $secureLink = 'index.php?entryPoint=download&id=' . $the_note->id . '&type=Notes'; |
|
289 | - $attachments .= '<input type="checkbox" name="remove_attachment[]" value="' . $the_note->id . '"> ' . $app_strings['LNK_REMOVE'] . ' '; |
|
290 | - $attachments .= '<a href="' . $secureLink . '" target="_blank">' . $the_note->filename . '</a><br>'; |
|
288 | + $secureLink = 'index.php?entryPoint=download&id='.$the_note->id.'&type=Notes'; |
|
289 | + $attachments .= '<input type="checkbox" name="remove_attachment[]" value="'.$the_note->id.'"> '.$app_strings['LNK_REMOVE'].' '; |
|
290 | + $attachments .= '<a href="'.$secureLink.'" target="_blank">'.$the_note->filename.'</a><br>'; |
|
291 | 291 | } |
292 | 292 | } |
293 | 293 | $attJs = '<script type="text/javascript">'; |
294 | - $attJs .= 'var lnk_remove = "' . $app_strings['LNK_REMOVE'] . '";'; |
|
294 | + $attJs .= 'var lnk_remove = "'.$app_strings['LNK_REMOVE'].'";'; |
|
295 | 295 | $attJs .= '</script>'; |
296 | 296 | $xtpl->assign('ATTACHMENTS', $attachments); |
297 | 297 | $xtpl->assign('ATTACHMENTS_JAVASCRIPT', $attJs); |
@@ -1,5 +1,5 @@ discard block |
||
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. |
@@ -49,22 +49,22 @@ discard block |
||
49 | 49 | require_once('modules/EmailTemplates/EmailTemplate.php'); |
50 | 50 | |
51 | 51 | $focus = new EmailTemplate(); |
52 | -if($_REQUEST['from'] == 'DetailView') { |
|
53 | - if(!isset($_REQUEST['record'])) |
|
52 | +if ($_REQUEST['from'] == 'DetailView') { |
|
53 | + if (!isset($_REQUEST['record'])) |
|
54 | 54 | sugar_die("A record number must be specified to delete the template."); |
55 | 55 | $focus->retrieve($_REQUEST['record']); |
56 | - if(check_email_template_in_use($focus)) { |
|
56 | + if (check_email_template_in_use($focus)) { |
|
57 | 57 | echo 'true'; |
58 | 58 | return; |
59 | 59 | } |
60 | 60 | echo 'false'; |
61 | -} else if($_REQUEST['from'] == 'ListView') { |
|
61 | +} else if ($_REQUEST['from'] == 'ListView') { |
|
62 | 62 | $returnString = ''; |
63 | 63 | $idArray = explode(',', $_REQUEST['records']); |
64 | - foreach($idArray as $key => $value) { |
|
65 | - if($focus->retrieve($value)) { |
|
66 | - if(check_email_template_in_use($focus)) { |
|
67 | - $returnString .= $focus->name . ','; |
|
64 | + foreach ($idArray as $key => $value) { |
|
65 | + if ($focus->retrieve($value)) { |
|
66 | + if (check_email_template_in_use($focus)) { |
|
67 | + $returnString .= $focus->name.','; |
|
68 | 68 | } |
69 | 69 | } |
70 | 70 | } |
@@ -76,11 +76,11 @@ discard block |
||
76 | 76 | |
77 | 77 | function check_email_template_in_use($focus) |
78 | 78 | { |
79 | - if($focus->is_used_by_email_marketing()) { |
|
79 | + if ($focus->is_used_by_email_marketing()) { |
|
80 | 80 | return true; |
81 | 81 | } |
82 | 82 | $system = $GLOBALS['sugar_config']['passwordsetting']; |
83 | - if($focus->id == $system['generatepasswordtmpl'] || $focus->id == $system['lostpasswordtmpl']) { |
|
83 | + if ($focus->id == $system['generatepasswordtmpl'] || $focus->id == $system['lostpasswordtmpl']) { |
|
84 | 84 | return true; |
85 | 85 | } |
86 | 86 | return false; |
@@ -46,8 +46,8 @@ discard block |
||
46 | 46 | require_once($beanFiles[$beanList[$key]]); |
47 | 47 | $focus = new $beanList[$key]; |
48 | 48 | $loopControl[$key][$key] = $focus; |
49 | - $prefixes[$key] = strtolower($focus->object_name) . '_'; |
|
50 | - if ($focus->object_name == 'Case') $prefixes[$key] = 'a' . strtolower($focus->object_name) . '_'; |
|
49 | + $prefixes[$key] = strtolower($focus->object_name).'_'; |
|
50 | + if ($focus->object_name == 'Case') $prefixes[$key] = 'a'.strtolower($focus->object_name).'_'; |
|
51 | 51 | } |
52 | 52 | } |
53 | 53 | |
@@ -125,16 +125,16 @@ discard block |
||
125 | 125 | if (isset($beanList[$key]) && isset($beanFiles[$beanList[$key]]) && !str_begin($key, 'AOW_') && !str_begin($key, 'zr2_')) { |
126 | 126 | |
127 | 127 | if ($key == 'Contacts') { |
128 | - $dropdown .= "<option value='" . $key . "'> |
|
129 | - " . $lblContactAndOthers . " |
|
128 | + $dropdown .= "<option value='".$key."'> |
|
129 | + " . $lblContactAndOthers." |
|
130 | 130 | </option>"; |
131 | 131 | } else if (isset($app_list_strings['moduleListSingular'][$key])) { |
132 | - $dropdown .= "<option value='" . $key . "'> |
|
133 | - " . $app_list_strings['moduleListSingular'][$key] . " |
|
132 | + $dropdown .= "<option value='".$key."'> |
|
133 | + " . $app_list_strings['moduleListSingular'][$key]." |
|
134 | 134 | </option>"; |
135 | 135 | } else { |
136 | - $dropdown .= "<option value='" . $key . "'> |
|
137 | - " . $app_list_strings['moduleList'][$key] . " |
|
136 | + $dropdown .= "<option value='".$key."'> |
|
137 | + " . $app_list_strings['moduleList'][$key]." |
|
138 | 138 | </option>"; |
139 | 139 | } |
140 | 140 | } |
@@ -7,7 +7,7 @@ |
||
7 | 7 | */ |
8 | 8 | |
9 | 9 | |
10 | -if( |
|
10 | +if ( |
|
11 | 11 | (isset($_SESSION['screen_height']) ? $_SESSION['screen_height'] : null) != (isset($_POST['height']) ? $_POST['height'] : null) || |
12 | 12 | (isset($_SESSION['screen_width']) ? $_SESSION['screen_width'] : null) != (isset($_POST['width']) ? $_POST['width'] : null)) { |
13 | 13 | $_SESSION['screen_height'] = $_POST['height']; |
@@ -1,5 +1,5 @@ discard block |
||
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 | global $db; |
5 | 5 | |
@@ -12,25 +12,25 @@ discard block |
||
12 | 12 | $event = new FP_events(); |
13 | 13 | $event->retrieve($even_id); |
14 | 14 | |
15 | - if($type == 'c'){ |
|
15 | + if ($type == 'c') { |
|
16 | 16 | |
17 | 17 | $event->load_relationship('fp_events_contacts'); // get related contacts |
18 | 18 | |
19 | - if($response == 'accept'){ |
|
19 | + if ($response == 'accept') { |
|
20 | 20 | |
21 | 21 | //check to see if they have already responded to the email |
22 | 22 | $check_q = 'SELECT email_responded FROM fp_events_contacts_c WHERE fp_events_contactsfp_events_ida="'.$event->id.'" AND fp_events_contactscontacts_idb="'.$delegate_id.'"'; |
23 | 23 | $check = $db->getOne($check_q); |
24 | 24 | //update contact to accepted |
25 | 25 | $query = 'UPDATE fp_events_contacts_c SET accept_status="Accepted", email_responded="1" WHERE fp_events_contactsfp_events_ida="'.$event->id.'" AND fp_events_contactscontacts_idb="'.$delegate_id.'" AND email_responded="0"'; |
26 | - if($db->query($query) && $check != '1'){ |
|
26 | + if ($db->query($query) && $check != '1') { |
|
27 | 27 | |
28 | - if(!IsNullOrEmptyString($event->accept_redirect)){ |
|
28 | + if (!IsNullOrEmptyString($event->accept_redirect)) { |
|
29 | 29 | |
30 | 30 | $url = $event->accept_redirect; |
31 | - header('Location: ' . $url); |
|
31 | + header('Location: '.$url); |
|
32 | 32 | } |
33 | - else{ |
|
33 | + else { |
|
34 | 34 | echo 'Thank you for accepting'; |
35 | 35 | } |
36 | 36 | } |
@@ -38,22 +38,22 @@ discard block |
||
38 | 38 | echo 'You have already responded to the invitation or there was a problem with the link. Please contact the sender of the invite for help.'; |
39 | 39 | } |
40 | 40 | } |
41 | - else if($response == 'decline'){ |
|
41 | + else if ($response == 'decline') { |
|
42 | 42 | //check to see if they have already responded to the email |
43 | 43 | $check_q = 'SELECT email_responded FROM fp_events_contacts_c WHERE fp_events_contactsfp_events_ida="'.$event->id.'" AND fp_events_contactscontacts_idb="'.$delegate_id.'"'; |
44 | 44 | $check = $db->getOne($check_q); |
45 | 45 | //update contact to accepted |
46 | 46 | $query = 'UPDATE fp_events_contacts_c SET accept_status="Declined", email_responded="1" WHERE fp_events_contactsfp_events_ida="'.$event->id.'" AND fp_events_contactscontacts_idb="'.$delegate_id.'" AND email_responded="0"'; |
47 | 47 | |
48 | - if($db->query($query) && $check != '1'){ |
|
48 | + if ($db->query($query) && $check != '1') { |
|
49 | 49 | |
50 | - if(!IsNullOrEmptyString($event->decline_redirect)){ |
|
50 | + if (!IsNullOrEmptyString($event->decline_redirect)) { |
|
51 | 51 | |
52 | 52 | $url = $event->decline_redirect; |
53 | - header('Location: ' . $url); |
|
53 | + header('Location: '.$url); |
|
54 | 54 | |
55 | 55 | } |
56 | - else{ |
|
56 | + else { |
|
57 | 57 | echo 'Thank you for declining'; |
58 | 58 | } |
59 | 59 | } |
@@ -62,25 +62,25 @@ discard block |
||
62 | 62 | } |
63 | 63 | } |
64 | 64 | } |
65 | - if($type == 't'){ |
|
65 | + if ($type == 't') { |
|
66 | 66 | |
67 | 67 | $event->load_relationship('fp_events_prospects_1'); //get related targets |
68 | 68 | |
69 | - if($response == 'accept'){ |
|
69 | + if ($response == 'accept') { |
|
70 | 70 | //check to see if they have already responded to the email |
71 | 71 | $check_q = 'SELECT email_responded FROM fp_events_prospects_1_c WHERE fp_events_prospects_1fp_events_ida="'.$event->id.'" AND fp_events_prospects_1prospects_idb="'.$delegate_id.'"'; |
72 | 72 | $check = $db->getOne($check_q); |
73 | 73 | |
74 | 74 | //update contact to accepted |
75 | 75 | $query = 'UPDATE fp_events_prospects_1_c SET accept_status="Accepted", email_responded="1" WHERE fp_events_prospects_1fp_events_ida="'.$event->id.'" AND fp_events_prospects_1prospects_idb="'.$delegate_id.'" AND email_responded="0"'; |
76 | - if($db->query($query) && $check != '1'){ |
|
76 | + if ($db->query($query) && $check != '1') { |
|
77 | 77 | |
78 | - if(!IsNullOrEmptyString($event->accept_redirect)){ |
|
78 | + if (!IsNullOrEmptyString($event->accept_redirect)) { |
|
79 | 79 | |
80 | 80 | $url = $event->accept_redirect; |
81 | - header('Location: ' . $url); |
|
81 | + header('Location: '.$url); |
|
82 | 82 | } |
83 | - else{ |
|
83 | + else { |
|
84 | 84 | echo 'Thank you for accepting'; |
85 | 85 | } |
86 | 86 | } |
@@ -88,21 +88,21 @@ discard block |
||
88 | 88 | echo 'You have already responded to the invitation or there was a problem with the link. Please contact the sender of the invite for help.'; |
89 | 89 | } |
90 | 90 | } |
91 | - else if($response == 'decline'){ |
|
91 | + else if ($response == 'decline') { |
|
92 | 92 | //check to see if they have already responded to the email |
93 | 93 | $check_q = 'SELECT email_responded FROM fp_events_prospects_1_c WHERE fp_events_prospects_1fp_events_ida="'.$event->id.'" AND fp_events_prospects_1prospects_idb="'.$delegate_id.'"'; |
94 | 94 | $check = $db->getOne($check_q); |
95 | 95 | //update contact to accepted |
96 | 96 | $query = 'UPDATE fp_events_prospects_1_c SET accept_status="Declined", email_responded="1" WHERE fp_events_prospects_1fp_events_ida="'.$event->id.'" AND fp_events_prospects_1prospects_idb="'.$delegate_id.'" AND email_responded="0"'; |
97 | - if($db->query($query) && $check != '1'){ |
|
97 | + if ($db->query($query) && $check != '1') { |
|
98 | 98 | |
99 | - if(!IsNullOrEmptyString($event->decline_redirect)){ |
|
99 | + if (!IsNullOrEmptyString($event->decline_redirect)) { |
|
100 | 100 | |
101 | 101 | $url = $event->decline_redirect; |
102 | - header('Location: ' . $url); |
|
102 | + header('Location: '.$url); |
|
103 | 103 | |
104 | 104 | } |
105 | - else{ |
|
105 | + else { |
|
106 | 106 | echo 'Thank you for declining'; |
107 | 107 | } |
108 | 108 | } |
@@ -111,24 +111,24 @@ discard block |
||
111 | 111 | } |
112 | 112 | } |
113 | 113 | } |
114 | - if($type == 'l'){ |
|
114 | + if ($type == 'l') { |
|
115 | 115 | |
116 | 116 | $event->load_relationship('fp_events_leads_1'); //get related leads |
117 | 117 | |
118 | - if($response == 'accept'){ |
|
118 | + if ($response == 'accept') { |
|
119 | 119 | //check to see if they have already responded to the email |
120 | 120 | $check_q = 'SELECT email_responded FROM fp_events_leads_1_c WHERE ffp_events_leads_1fp_events_ida="'.$event->id.'" AND fp_events_leads_1leads_idb="'.$delegate_id.'"'; |
121 | 121 | $check = $db->getOne($check_q); |
122 | 122 | //update contact to accepted |
123 | 123 | $query = 'UPDATE fp_events_leads_1_c SET accept_status="Accepted", email_responded="1" WHERE fp_events_leads_1fp_events_ida="'.$event->id.'" AND fp_events_leads_1leads_idb="'.$delegate_id.'" AND email_responded="0"'; |
124 | - if($db->query($query) && $check != '1'){ |
|
124 | + if ($db->query($query) && $check != '1') { |
|
125 | 125 | |
126 | - if(!IsNullOrEmptyString($event->accept_redirect)){ |
|
126 | + if (!IsNullOrEmptyString($event->accept_redirect)) { |
|
127 | 127 | |
128 | 128 | $url = $event->accept_redirect; |
129 | - header('Location: ' . $url); |
|
129 | + header('Location: '.$url); |
|
130 | 130 | } |
131 | - else{ |
|
131 | + else { |
|
132 | 132 | echo 'Thank you for accepting'; |
133 | 133 | } |
134 | 134 | } |
@@ -136,22 +136,22 @@ discard block |
||
136 | 136 | echo 'There was a problem with the link please contact the sender of the invite'; |
137 | 137 | } |
138 | 138 | } |
139 | - else if($response == 'decline'){ |
|
139 | + else if ($response == 'decline') { |
|
140 | 140 | //check to see if they have already responded to the email |
141 | 141 | $check_q = 'SELECT email_responded FROM fp_events_leads_1_c WHERE fp_events_leads_1fp_events_ida="'.$event->id.'" AND fp_events_leads_1leads_idb="'.$delegate_id.'"'; |
142 | 142 | $check = $db->getOne($check_q); |
143 | 143 | //update contact to accepted |
144 | 144 | $query = 'UPDATE fp_events_leads_1_c SET accept_status="Declined", email_responded="1" WHERE fp_events_leads_1fp_events_ida="'.$event->id.'" AND fp_events_leads_1leads_idb="'.$delegate_id.'" AND email_responded="0"'; |
145 | 145 | |
146 | - if($db->query($query) && $check != '1'){ |
|
146 | + if ($db->query($query) && $check != '1') { |
|
147 | 147 | |
148 | - if(!IsNullOrEmptyString($event->decline_redirect)){ |
|
148 | + if (!IsNullOrEmptyString($event->decline_redirect)) { |
|
149 | 149 | |
150 | 150 | $url = $event->decline_redirect; |
151 | - header('Location: ' . $url); |
|
151 | + header('Location: '.$url); |
|
152 | 152 | |
153 | 153 | } |
154 | - else{ |
|
154 | + else { |
|
155 | 155 | echo 'Thank you for declining'; |
156 | 156 | } |
157 | 157 | } |
@@ -161,8 +161,8 @@ discard block |
||
161 | 161 | } |
162 | 162 | } |
163 | 163 | // Function for basic field validation (present and neither empty nor only white space nor just 'http://') |
164 | - function IsNullOrEmptyString($question){ |
|
165 | - return (!isset($question) || trim($question)==='' || $question =='http://'); |
|
164 | + function IsNullOrEmptyString($question) { |
|
165 | + return (!isset($question) || trim($question) === '' || $question == 'http://'); |
|
166 | 166 | } |
167 | 167 | |
168 | 168 | ?> |
@@ -1,5 +1,5 @@ discard block |
||
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. |
@@ -47,40 +47,40 @@ discard block |
||
47 | 47 | |
48 | 48 | global $db, $current_user, $mod_strings, $app_strings, $app_list_strings; |
49 | 49 | |
50 | -$ret = $db->query("SELECT id FROM meetings_users WHERE meeting_id = '".$db->quote($_REQUEST['meeting_id'])."' AND user_id = '".$current_user->id."' AND deleted = 0",true); |
|
50 | +$ret = $db->query("SELECT id FROM meetings_users WHERE meeting_id = '".$db->quote($_REQUEST['meeting_id'])."' AND user_id = '".$current_user->id."' AND deleted = 0", true); |
|
51 | 51 | $row = $db->fetchByAssoc($ret); |
52 | 52 | |
53 | 53 | $meetingBean = loadBean('Meetings'); |
54 | 54 | $meetingBean->retrieve($_REQUEST['meeting_id']); |
55 | 55 | |
56 | -if ( $_REQUEST['host_meeting'] == '1' ) { |
|
57 | - if($meetingBean->assigned_user_id == $GLOBALS['current_user']->id || is_admin($GLOBALS['current_user']) || is_admin_for_module($GLOBALS['current_user'],'Meetings')){ |
|
56 | +if ($_REQUEST['host_meeting'] == '1') { |
|
57 | + if ($meetingBean->assigned_user_id == $GLOBALS['current_user']->id || is_admin($GLOBALS['current_user']) || is_admin_for_module($GLOBALS['current_user'], 'Meetings')) { |
|
58 | 58 | SugarApplication::redirect($meetingBean->host_url); |
59 | - }else{ |
|
59 | + } else { |
|
60 | 60 | //since they are now the owner of the meeting nor an Admin they cannot start the meeting. |
61 | 61 | $tplFile = 'modules/Meetings/tpls/extMeetingNoStart.tpl'; |
62 | - if ( file_exists('custom/'.$tplFile) ) { |
|
62 | + if (file_exists('custom/'.$tplFile)) { |
|
63 | 63 | $tplFile = 'custom/'.$tplFile; |
64 | 64 | } |
65 | 65 | |
66 | 66 | $ss = new Sugar_Smarty(); |
67 | - $ss->assign('current_user',$current_user); |
|
68 | - $ss->assign('bean',$meetingBean->toArray()); |
|
67 | + $ss->assign('current_user', $current_user); |
|
68 | + $ss->assign('bean', $meetingBean->toArray()); |
|
69 | 69 | $ss->display($tplFile); |
70 | 70 | } |
71 | -}else{ |
|
72 | - if(isset($row['id']) || $meetingBean->assigned_user_id == $GLOBALS['current_user']->id || is_admin($GLOBALS['current_user']) || is_admin_for_module($GLOBALS['current_user'],'Meetings')){ |
|
71 | +} else { |
|
72 | + if (isset($row['id']) || $meetingBean->assigned_user_id == $GLOBALS['current_user']->id || is_admin($GLOBALS['current_user']) || is_admin_for_module($GLOBALS['current_user'], 'Meetings')) { |
|
73 | 73 | SugarApplication::redirect($meetingBean->join_url); |
74 | - }else{ |
|
74 | + } else { |
|
75 | 75 | //if the user is not invited or the owner of the meeting or an admin then they cannot join the meeting. |
76 | 76 | $tplFile = 'modules/Meetings/tpls/extMeetingNotInvited.tpl'; |
77 | - if ( file_exists('custom/'.$tplFile) ) { |
|
77 | + if (file_exists('custom/'.$tplFile)) { |
|
78 | 78 | $tplFile = 'custom/'.$tplFile; |
79 | 79 | } |
80 | 80 | |
81 | 81 | $ss = new Sugar_Smarty(); |
82 | - $ss->assign('current_user',$current_user); |
|
83 | - $ss->assign('bean',$meetingBean->toArray()); |
|
82 | + $ss->assign('current_user', $current_user); |
|
83 | + $ss->assign('bean', $meetingBean->toArray()); |
|
84 | 84 | $ss->display($tplFile); |
85 | 85 | } |
86 | 86 | } |
87 | 87 | \ No newline at end of file |
@@ -1,5 +1,5 @@ discard block |
||
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. |
@@ -55,13 +55,13 @@ discard block |
||
55 | 55 | |
56 | 56 | $this->ss->assign("STATUS_OPTIONS", get_select_options_with_id($app_list_strings['meeting_status_dom'], $app_list_strings['meeting_status_default'])); |
57 | 57 | $this->ss->assign("CALENDAR_DATEFORMAT", $timedate->get_cal_date_format()); |
58 | - $this->ss->assign("TIME_FORMAT", '('. $timedate->get_user_time_format().')'); |
|
59 | - $this->ss->assign("USER_DATEFORMAT", '('. $timedate->get_user_date_format().')'); |
|
58 | + $this->ss->assign("TIME_FORMAT", '('.$timedate->get_user_time_format().')'); |
|
59 | + $this->ss->assign("USER_DATEFORMAT", '('.$timedate->get_user_date_format().')'); |
|
60 | 60 | |
61 | 61 | |
62 | 62 | |
63 | 63 | |
64 | - if($this->viaAJAX) { // override for ajax call |
|
64 | + if ($this->viaAJAX) { // override for ajax call |
|
65 | 65 | $this->ss->assign('saveOnclick', "onclick='if(check_form(\"meetingsQuickCreate\")) return SUGAR.subpanelUtils.inlineSave(this.form.id, \"activities\"); else return false;'"); |
66 | 66 | $this->ss->assign('cancelOnclick', "onclick='return SUGAR.subpanelUtils.cancelCreate(\"subpanel_activities\")';"); |
67 | 67 | } |
@@ -83,14 +83,14 @@ discard block |
||
83 | 83 | $focus->duration_hours = "1"; |
84 | 84 | |
85 | 85 | |
86 | - $date_start_array=explode(" ",trim($focus->date_start)); |
|
87 | - if (count($date_start_array)==2) { |
|
86 | + $date_start_array = explode(" ", trim($focus->date_start)); |
|
87 | + if (count($date_start_array) == 2) { |
|
88 | 88 | $focus->time_start = $timedate->to_db_time($date_start_array[1], false); |
89 | 89 | //$focus->date_start = $date_start_array[0]; |
90 | 90 | } |
91 | 91 | |
92 | 92 | $this->ss->assign("DATE_START", $focus->date_start); |
93 | - $this->ss->assign("TIME_START", substr($focus->time_start,0,5)); |
|
93 | + $this->ss->assign("TIME_START", substr($focus->time_start, 0, 5)); |
|
94 | 94 | $time_start_hour = intval(substr($focus->time_start, 0, 2)); |
95 | 95 | $time_start_minutes = substr($focus->time_start, 3, 5); |
96 | 96 | |
@@ -110,12 +110,12 @@ discard block |
||
110 | 110 | |
111 | 111 | |
112 | 112 | // We default the to assume that the time preference is set to 11:00 (i.e. without meridiem) |
113 | - $hours_arr = array (); |
|
113 | + $hours_arr = array(); |
|
114 | 114 | $num_of_hours = 24; |
115 | 115 | $start_at = 0; |
116 | 116 | |
117 | 117 | $time_pref = $timedate->get_time_format(); |
118 | - if(strpos($time_pref, 'a') || strpos($time_pref, 'A')) { |
|
118 | + if (strpos($time_pref, 'a') || strpos($time_pref, 'A')) { |
|
119 | 119 | $num_of_hours = 13; |
120 | 120 | $start_at = 1; |
121 | 121 | } |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | } |
129 | 129 | */ |
130 | 130 | |
131 | - for ($i = $start_at; $i < $num_of_hours; $i ++) { |
|
131 | + for ($i = $start_at; $i < $num_of_hours; $i++) { |
|
132 | 132 | $i = $i.""; |
133 | 133 | if (strlen($i) == 1) { |
134 | 134 | $i = "0".$i; |
@@ -141,18 +141,18 @@ discard block |
||
141 | 141 | $this->ss->assign("DURATION_HOURS", $focus->duration_hours); |
142 | 142 | $this->ss->assign("DURATION_MINUTES_OPTIONS", get_select_options_with_id($focus->minutes_values, $focus->duration_minutes)); |
143 | 143 | // Test to see if time format is 11:00am; otherwise it's 11:00AM |
144 | - if($num_of_hours == 13) { |
|
144 | + if ($num_of_hours == 13) { |
|
145 | 145 | |
146 | 146 | if (strpos($time_pref, 'a')) { |
147 | 147 | |
148 | - if(!isset($focus->meridiem_am_values)) { |
|
148 | + if (!isset($focus->meridiem_am_values)) { |
|
149 | 149 | $focus->meridiem_am_values = array('am'=>'am', 'pm'=>'pm'); |
150 | 150 | } |
151 | 151 | |
152 | 152 | $this->ss->assign("TIME_MERIDIEM", get_select_options_with_id($focus->meridiem_am_values, $time_start_hour < 12 ? 'am' : 'pm')); |
153 | 153 | |
154 | 154 | } else { |
155 | - if(!isset($focus->meridiem_AM_values)) { |
|
155 | + if (!isset($focus->meridiem_AM_values)) { |
|
156 | 156 | $focus->meridiem_AM_values = array('AM'=>'AM', 'PM'=>'PM'); |
157 | 157 | } |
158 | 158 |