@@ -137,14 +137,14 @@ discard block |
||
137 | 137 | if(isset($mbox) && count($mbox)>0){ |
138 | 138 | $mboxTable .= "<tr><td colspan='5'><b>" .count($mbox) ." ". $mod_strings['LBL_MAILBOX_CHECK_WIZ_GOOD']." </b>.</td></tr>"; |
139 | 139 | $mboxTable .= "<tr class='listViewHRS1'><td width='20%'><b>".$mod_strings['LBL_MAILBOX_NAME']."</b></td>" |
140 | - . " <td width='20%'><b>".$mod_strings['LBL_LOGIN']."</b></td>" |
|
141 | - . " <td width='20%'><b>".$mod_strings['LBL_MAILBOX']."</b></td>" |
|
142 | - . " <td width='20%'><b>".$mod_strings['LBL_SERVER_URL']."</b></td>" |
|
143 | - . " <td width='20%'><b>".$mod_strings['LBL_LIST_STATUS']."</b></td></tr>"; |
|
140 | + . " <td width='20%'><b>".$mod_strings['LBL_LOGIN']."</b></td>" |
|
141 | + . " <td width='20%'><b>".$mod_strings['LBL_MAILBOX']."</b></td>" |
|
142 | + . " <td width='20%'><b>".$mod_strings['LBL_SERVER_URL']."</b></td>" |
|
143 | + . " <td width='20%'><b>".$mod_strings['LBL_LIST_STATUS']."</b></td></tr>"; |
|
144 | 144 | $colorclass=' '; |
145 | 145 | foreach($mbox as $details){ |
146 | 146 | |
147 | - if( $colorclass == "class='evenListRowS1'"){ |
|
147 | + if( $colorclass == "class='evenListRowS1'"){ |
|
148 | 148 | $colorclass= "class='oddListRowS1'"; |
149 | 149 | }else{ |
150 | 150 | $colorclass= "class='evenListRowS1'"; |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | /**************************** WIZARD UI DIV Stuff *******************/ |
176 | 176 | |
177 | 177 | // this is the wizard control script that resides in page |
178 | - $divScript = <<<EOQ |
|
178 | + $divScript = <<<EOQ |
|
179 | 179 | <script type="text/javascript" language="javascript"> |
180 | 180 | |
181 | 181 | //this function toggles visibility of fields based on selected options |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | $query = "SELECT description FROM notes WHERE file_mime_type = 'messsage/rfc822' AND parent_type='Emails' AND parent_id = '".$email->id."' AND deleted=0"; |
57 | 57 | $rs = $GLOBALS['db']->query($query); |
58 | 58 | while ($row = $GLOBALS['db']->fetchByAssoc($rs)) |
59 | - $contents .= $row['description']; |
|
59 | + $contents .= $row['description']; |
|
60 | 60 | |
61 | 61 | return $contents; |
62 | 62 | } |
@@ -162,80 +162,80 @@ discard block |
||
162 | 162 | |
163 | 163 | function campaign_process_bounced_emails(&$email, &$email_header) |
164 | 164 | { |
165 | - global $sugar_config; |
|
166 | - $emailFromAddress = $email_header->fromaddress; |
|
167 | - $email_description = $email->raw_source; |
|
165 | + global $sugar_config; |
|
166 | + $emailFromAddress = $email_header->fromaddress; |
|
167 | + $email_description = $email->raw_source; |
|
168 | 168 | |
169 | - //if raw_source is empty, try using the description instead |
|
170 | - if (empty($email_description)){ |
|
171 | - $email_description = $email->description; |
|
172 | - } |
|
169 | + //if raw_source is empty, try using the description instead |
|
170 | + if (empty($email_description)){ |
|
171 | + $email_description = $email->description; |
|
172 | + } |
|
173 | 173 | |
174 | 174 | $email_description .= retrieveErrorReportAttachment($email); |
175 | 175 | |
176 | - if (preg_match('/MAILER-DAEMON|POSTMASTER/i',$emailFromAddress)) |
|
177 | - { |
|
178 | - $email_description=quoted_printable_decode($email_description); |
|
179 | - $matches=array(); |
|
176 | + if (preg_match('/MAILER-DAEMON|POSTMASTER/i',$emailFromAddress)) |
|
177 | + { |
|
178 | + $email_description=quoted_printable_decode($email_description); |
|
179 | + $matches=array(); |
|
180 | 180 | |
181 | - //do we have the identifier tag in the email? |
|
182 | - $identifierScanResults = checkBouncedEmailForIdentifier($email_description); |
|
181 | + //do we have the identifier tag in the email? |
|
182 | + $identifierScanResults = checkBouncedEmailForIdentifier($email_description); |
|
183 | 183 | |
184 | - if ( $identifierScanResults['found'] ) |
|
185 | - { |
|
186 | - $matches = $identifierScanResults['matches']; |
|
187 | - $identifiers = $identifierScanResults['identifiers']; |
|
188 | - |
|
189 | - if (!empty($identifiers)) |
|
190 | - { |
|
191 | - //array should have only one element in it. |
|
192 | - $identifier = trim($identifiers[0]); |
|
193 | - $row = getExistingCampaignLogEntry($identifier); |
|
184 | + if ( $identifierScanResults['found'] ) |
|
185 | + { |
|
186 | + $matches = $identifierScanResults['matches']; |
|
187 | + $identifiers = $identifierScanResults['identifiers']; |
|
188 | + |
|
189 | + if (!empty($identifiers)) |
|
190 | + { |
|
191 | + //array should have only one element in it. |
|
192 | + $identifier = trim($identifiers[0]); |
|
193 | + $row = getExistingCampaignLogEntry($identifier); |
|
194 | 194 | |
195 | - //Found entry |
|
196 | - if (!empty($row)) |
|
197 | - { |
|
198 | - //do not create another campaign_log record is we already have an |
|
199 | - //invalid email or send error entry for this tracker key. |
|
200 | - $query_log = "select * from campaign_log where target_tracker_key='{$row['target_tracker_key']}'"; |
|
201 | - $query_log .=" and (activity_type='invalid email' or activity_type='send error')"; |
|
195 | + //Found entry |
|
196 | + if (!empty($row)) |
|
197 | + { |
|
198 | + //do not create another campaign_log record is we already have an |
|
199 | + //invalid email or send error entry for this tracker key. |
|
200 | + $query_log = "select * from campaign_log where target_tracker_key='{$row['target_tracker_key']}'"; |
|
201 | + $query_log .=" and (activity_type='invalid email' or activity_type='send error')"; |
|
202 | 202 | $targeted = new CampaignLog(); |
203 | - $result_log=$targeted->db->query($query_log); |
|
204 | - $row_log=$targeted->db->fetchByAssoc($result_log); |
|
205 | - |
|
206 | - if (empty($row_log)) |
|
207 | - { |
|
208 | - $return_id = createBouncedCampaignLogEntry($row, $email, $email_description); |
|
209 | - return TRUE; |
|
210 | - } |
|
211 | - else |
|
212 | - { |
|
213 | - $GLOBALS['log']->debug("Warning: campaign log entry already exists for identifier $identifier"); |
|
214 | - return FALSE; |
|
215 | - } |
|
216 | - } |
|
217 | - else |
|
218 | - { |
|
219 | - $GLOBALS['log']->info("Warning: skipping bounced email with this tracker_key(identifier) in the message body: ".$identifier); |
|
220 | - return FALSE; |
|
221 | - } |
|
222 | - } |
|
223 | - else |
|
224 | - { |
|
225 | - $GLOBALS['log']->info("Warning: Empty identifier for campaign log."); |
|
226 | - return FALSE; |
|
227 | - } |
|
228 | - } |
|
229 | - else |
|
230 | - { |
|
231 | - $GLOBALS['log']->info("Warning: skipping bounced email because it does not have the removeme link."); |
|
232 | - return FALSE; |
|
233 | - } |
|
234 | - } |
|
235 | - else |
|
236 | - { |
|
237 | - $GLOBALS['log']->info("Warning: skipping bounced email because the sender is not MAILER-DAEMON."); |
|
238 | - return FALSE; |
|
239 | - } |
|
203 | + $result_log=$targeted->db->query($query_log); |
|
204 | + $row_log=$targeted->db->fetchByAssoc($result_log); |
|
205 | + |
|
206 | + if (empty($row_log)) |
|
207 | + { |
|
208 | + $return_id = createBouncedCampaignLogEntry($row, $email, $email_description); |
|
209 | + return TRUE; |
|
210 | + } |
|
211 | + else |
|
212 | + { |
|
213 | + $GLOBALS['log']->debug("Warning: campaign log entry already exists for identifier $identifier"); |
|
214 | + return FALSE; |
|
215 | + } |
|
216 | + } |
|
217 | + else |
|
218 | + { |
|
219 | + $GLOBALS['log']->info("Warning: skipping bounced email with this tracker_key(identifier) in the message body: ".$identifier); |
|
220 | + return FALSE; |
|
221 | + } |
|
222 | + } |
|
223 | + else |
|
224 | + { |
|
225 | + $GLOBALS['log']->info("Warning: Empty identifier for campaign log."); |
|
226 | + return FALSE; |
|
227 | + } |
|
228 | + } |
|
229 | + else |
|
230 | + { |
|
231 | + $GLOBALS['log']->info("Warning: skipping bounced email because it does not have the removeme link."); |
|
232 | + return FALSE; |
|
233 | + } |
|
234 | + } |
|
235 | + else |
|
236 | + { |
|
237 | + $GLOBALS['log']->info("Warning: skipping bounced email because the sender is not MAILER-DAEMON."); |
|
238 | + return FALSE; |
|
239 | + } |
|
240 | 240 | } |
241 | 241 | ?> |
@@ -59,11 +59,11 @@ discard block |
||
59 | 59 | //if (!is_admin($current_user)) sugar_die("Unauthorized access to administration."); |
60 | 60 | //account for use within wizards |
61 | 61 | if(!isset($_REQUEST['inline']) || $_REQUEST['inline'] != 'inline'){ |
62 | - $params = array(); |
|
63 | - $params[] = "<a href='index.php?module=Campaigns&action=index'>{$mod_strings['LBL_MODULE_NAME']}</a>"; |
|
64 | - $params[] = $mod_strings['LBL_CAMPAIGN_DIAGNOSTICS']; |
|
62 | + $params = array(); |
|
63 | + $params[] = "<a href='index.php?module=Campaigns&action=index'>{$mod_strings['LBL_MODULE_NAME']}</a>"; |
|
64 | + $params[] = $mod_strings['LBL_CAMPAIGN_DIAGNOSTICS']; |
|
65 | 65 | |
66 | - echo getClassicModuleTitle('Campaigns', $params, true); |
|
66 | + echo getClassicModuleTitle('Campaigns', $params, true); |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | global $theme; |
@@ -110,10 +110,10 @@ discard block |
||
110 | 110 | if(isset($mbox) && count($mbox)>0){ |
111 | 111 | $mboxTable .= "<tr><td colspan='5' style='text-align: left;'><b>" .count($mbox) ." ". $mod_strings['LBL_MAILBOX_CHECK1_GOOD']." </b>.</td></tr>"; |
112 | 112 | $mboxTable .= "<tr><th scope='col' width='20%'><b>".$mod_strings['LBL_MAILBOX_NAME']."</b></th>" |
113 | - . " <th scope='col' width='20%'><b>".$mod_strings['LBL_LOGIN']."</b></th>" |
|
114 | - . " <th scope='col' width='20%'><b>".$mod_strings['LBL_MAILBOX']."</b></th>" |
|
115 | - . " <th scope='col' width='20%'><b>".$mod_strings['LBL_SERVER_URL']."</b></th>" |
|
116 | - . " <th scope='col' width='20%'><b>".$mod_strings['LBL_LIST_STATUS']."</b></th></tr>"; |
|
113 | + . " <th scope='col' width='20%'><b>".$mod_strings['LBL_LOGIN']."</b></th>" |
|
114 | + . " <th scope='col' width='20%'><b>".$mod_strings['LBL_MAILBOX']."</b></th>" |
|
115 | + . " <th scope='col' width='20%'><b>".$mod_strings['LBL_SERVER_URL']."</b></th>" |
|
116 | + . " <th scope='col' width='20%'><b>".$mod_strings['LBL_LIST_STATUS']."</b></th></tr>"; |
|
117 | 117 | |
118 | 118 | foreach($mbox as $details){ |
119 | 119 | $mboxTable .= "<tr><td>".$details['name']."</td>"; |
@@ -144,11 +144,11 @@ discard block |
||
144 | 144 | }else{ |
145 | 145 | $conf_msg .= "<tr><td colspan = '5'><b> ".$mod_strings['LBL_MAILBOX_CHECK2_GOOD']."</b></td></tr>"; |
146 | 146 | $conf_msg .= "<tr><th scope='col' width='20%'><b>".$mod_strings['LBL_WIZ_FROM_NAME']."</b></th>" |
147 | - . " <th scope='col' width='20%'><b>".$mod_strings['LBL_WIZ_FROM_ADDRESS']."</b></th>" |
|
148 | - . " <th scope='col' width='20%'><b>".$mod_strings['LBL_MAIL_SENDTYPE']."</b></th>"; |
|
147 | + . " <th scope='col' width='20%'><b>".$mod_strings['LBL_WIZ_FROM_ADDRESS']."</b></th>" |
|
148 | + . " <th scope='col' width='20%'><b>".$mod_strings['LBL_MAIL_SENDTYPE']."</b></th>"; |
|
149 | 149 | if($focus->settings['mail_sendtype']=='SMTP'){ |
150 | - $conf_msg .= " <th scope='col' width='20%'><b>".$mod_strings['LBL_MAIL_SMTPSERVER']."</b></th>" |
|
151 | - . " <th scope='col' width='20%'><b>".$mod_strings['LBL_MAIL_SMTPUSER']."</b></th></tr>"; |
|
150 | + $conf_msg .= " <th scope='col' width='20%'><b>".$mod_strings['LBL_MAIL_SMTPSERVER']."</b></th>" |
|
151 | + . " <th scope='col' width='20%'><b>".$mod_strings['LBL_MAIL_SMTPUSER']."</b></th></tr>"; |
|
152 | 152 | |
153 | 153 | }else{$conf_msg .= "</tr>";} |
154 | 154 | |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | $conf_msg .= "<tr><td>".$focus->settings['notify_fromname']."</td>"; |
158 | 158 | $conf_msg .= "<td>".$focus->settings['notify_fromaddress']."</td>"; |
159 | 159 | $conf_msg .= "<td>".$focus->settings['mail_sendtype']."</td>"; |
160 | - if($focus->settings['mail_sendtype']=='SMTP'){ |
|
160 | + if($focus->settings['mail_sendtype']=='SMTP'){ |
|
161 | 161 | $conf_msg .= "<td>".$focus->settings['mail_smtpserver']."</td>"; |
162 | 162 | $conf_msg .= "<td>".$focus->settings['mail_smtpuser']."</td></tr>"; |
163 | 163 | |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | //build the table rows for scheduler display |
199 | 199 | while ($sched_row = $focus->db->fetchByAssoc($sched_res)){$scheds[] = $sched_row;} |
200 | 200 | foreach ($scheds as $funct){ |
201 | - if( ($funct['job']==$check_sched1) || ($funct['job']==$check_sched2)){ |
|
201 | + if( ($funct['job']==$check_sched1) || ($funct['job']==$check_sched2)){ |
|
202 | 202 | $sched_mes = 'use'; |
203 | 203 | $sched_mes_body .= "<tr><td style='text-align: left;'>".$funct['name']."</td>"; |
204 | 204 | $sched_mes_body .= "<td style='text-align: left;'>".$funct['status']."</td></tr>"; |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | $check_sched2 ="found"; |
209 | 209 | } |
210 | 210 | |
211 | - } |
|
211 | + } |
|
212 | 212 | } |
213 | 213 | |
214 | 214 | //determine which table header to use, based on whether or not schedulers were found |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | if($sched_mes == 'use'){ |
217 | 217 | $sched_mes = "<h5>".$mod_strings['LBL_SCHEDULER_CHECK_GOOD']."</h5><br><table class='other view' cellspacing='1'>"; |
218 | 218 | $sched_mes .= "<tr><th scope='col' width='40%'><b>".$mod_strings['LBL_SCHEDULER_NAME']."</b></tH>" |
219 | - . " <th scope='col' width='60%'><b>".$mod_strings['LBL_SCHEDULER_STATUS']."</b></tH></tr>"; |
|
219 | + . " <th scope='col' width='60%'><b>".$mod_strings['LBL_SCHEDULER_STATUS']."</b></tH></tr>"; |
|
220 | 220 | |
221 | 221 | }else{ |
222 | 222 | $sched_mes = "<table class='other view' cellspacing='1'>"; |
@@ -238,7 +238,7 @@ discard block |
||
238 | 238 | if (is_admin($current_user)){ |
239 | 239 | $admin_sched_link="<a href='index.php?module=Schedulers&action=index'>".$mod_strings['LBL_SCHEDULER_LINK']."</a>"; |
240 | 240 | }else{ |
241 | - $admin_sched_link=$mod_strings['LBL_NON_ADMIN_ERROR_MSG']; |
|
241 | + $admin_sched_link=$mod_strings['LBL_NON_ADMIN_ERROR_MSG']; |
|
242 | 242 | } |
243 | 243 | } |
244 | 244 | |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | /********** FINAL END OF PAGE UI Stuff ********/ |
252 | 252 | if(!isset($_REQUEST['inline']) || $_REQUEST['inline'] != 'inline'){ |
253 | 253 | |
254 | - $ss->display('modules/Campaigns/CampaignDiagnostic.html'); |
|
254 | + $ss->display('modules/Campaigns/CampaignDiagnostic.html'); |
|
255 | 255 | } |
256 | 256 | |
257 | 257 | /** |
@@ -272,7 +272,7 @@ discard block |
||
272 | 272 | }elseif($num == 0){ |
273 | 273 | //if health number is zero, then all checks passed, set green image |
274 | 274 | //green |
275 | - return SugarThemeRegistry::current()->getImage('green_camp', "align='absmiddle'", null, null, ".gif", $mod_strings['LBL_VALID']); |
|
275 | + return SugarThemeRegistry::current()->getImage('green_camp', "align='absmiddle'", null, null, ".gif", $mod_strings['LBL_VALID']); |
|
276 | 276 | |
277 | 277 | |
278 | 278 | }else{ |
@@ -65,8 +65,8 @@ discard block |
||
65 | 65 | } |
66 | 66 | |
67 | 67 | }else{ |
68 | - //default to just saving and exiting wizard |
|
69 | - $master = 'save'; |
|
68 | + //default to just saving and exiting wizard |
|
69 | + $master = 'save'; |
|
70 | 70 | } |
71 | 71 | |
72 | 72 | |
@@ -90,17 +90,17 @@ discard block |
||
90 | 90 | } |
91 | 91 | |
92 | 92 | foreach ($_REQUEST as $key => $val) { |
93 | - if((strstr($key, $prefix )) && (strpos($key, $prefix )== 0)){ |
|
94 | - $newkey =substr($key, strlen($prefix)) ; |
|
95 | - $_REQUEST[$newkey] = $val; |
|
96 | - } |
|
93 | + if((strstr($key, $prefix )) && (strpos($key, $prefix )== 0)){ |
|
94 | + $newkey =substr($key, strlen($prefix)) ; |
|
95 | + $_REQUEST[$newkey] = $val; |
|
96 | + } |
|
97 | 97 | } |
98 | 98 | |
99 | 99 | foreach ($_REQUEST as $key => $val) { |
100 | - if((strstr($key, $prefix )) && (strpos($key, $prefix )== 0)){ |
|
101 | - $newkey =substr($key, strlen($prefix)) ; |
|
102 | - $_REQUEST[$newkey] = $val; |
|
103 | - } |
|
100 | + if((strstr($key, $prefix )) && (strpos($key, $prefix )== 0)){ |
|
101 | + $newkey =substr($key, strlen($prefix)) ; |
|
102 | + $_REQUEST[$newkey] = $val; |
|
103 | + } |
|
104 | 104 | } |
105 | 105 | |
106 | 106 | if(!empty($_REQUEST['meridiem'])){ |
@@ -108,9 +108,9 @@ discard block |
||
108 | 108 | } |
109 | 109 | |
110 | 110 | if(empty($_REQUEST['time_start'])) { |
111 | - $_REQUEST['date_start'] = $_REQUEST['date_start'] . ' 00:00'; |
|
111 | + $_REQUEST['date_start'] = $_REQUEST['date_start'] . ' 00:00'; |
|
112 | 112 | } else { |
113 | - $_REQUEST['date_start'] = $_REQUEST['date_start'] . ' ' . $_REQUEST['time_start']; |
|
113 | + $_REQUEST['date_start'] = $_REQUEST['date_start'] . ' ' . $_REQUEST['time_start']; |
|
114 | 114 | } |
115 | 115 | |
116 | 116 | foreach($marketing->column_fields as $field) |
@@ -180,8 +180,8 @@ discard block |
||
180 | 180 | $_REQUEST['record'] =$marketing->campaign_id; |
181 | 181 | $_POST['record']=$marketing->campaign_id; |
182 | 182 | $_REQUEST['mode'] = $master; |
183 | - $_POST['mode'] = $master; |
|
184 | - $_REQUEST['from_wiz']= 'true'; |
|
183 | + $_POST['mode'] = $master; |
|
184 | + $_REQUEST['from_wiz']= 'true'; |
|
185 | 185 | require_once('modules/Campaigns/QueueCampaign.php'); |
186 | 186 | } |
187 | 187 |
@@ -46,19 +46,19 @@ |
||
46 | 46 | * Contributor(s): ______________________________________.. |
47 | 47 | ********************************************************************************/ |
48 | 48 | $fields_array['EmailTemplate'] = array ('column_fields' => Array("id" |
49 | - , "date_entered" |
|
50 | - , "date_modified" |
|
51 | - , "modified_user_id" |
|
52 | - , "created_by" |
|
53 | - , "description" |
|
54 | - , "subject" |
|
55 | - , "body" |
|
56 | - , "body_html" |
|
57 | - , "name" |
|
58 | - , "published" |
|
59 | - ), |
|
49 | + , "date_entered" |
|
50 | + , "date_modified" |
|
51 | + , "modified_user_id" |
|
52 | + , "created_by" |
|
53 | + , "description" |
|
54 | + , "subject" |
|
55 | + , "body" |
|
56 | + , "body_html" |
|
57 | + , "name" |
|
58 | + , "published" |
|
59 | + ), |
|
60 | 60 | 'list_fields' => Array('id', 'name', 'description','date_modified' |
61 | - ), |
|
61 | + ), |
|
62 | 62 | 'required_fields' => array("name"=>1), |
63 | 63 | ); |
64 | 64 | ?> |
65 | 65 | \ No newline at end of file |
@@ -38,10 +38,10 @@ discard block |
||
38 | 38 | * display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM". |
39 | 39 | ********************************************************************************/ |
40 | 40 | |
41 | - //Request object must have these property values: |
|
42 | - // Module: module name, this module should have a file called TreeData.php |
|
43 | - // Function: name of the function to be called in TreeData.php, the function will be called statically. |
|
44 | - // PARAM prefixed properties: array of these property/values will be passed to the function as parameter. |
|
41 | + //Request object must have these property values: |
|
42 | + // Module: module name, this module should have a file called TreeData.php |
|
43 | + // Function: name of the function to be called in TreeData.php, the function will be called statically. |
|
44 | + // PARAM prefixed properties: array of these property/values will be passed to the function as parameter. |
|
45 | 45 | |
46 | 46 | |
47 | 47 | require_once('include/JSON.php'); |
@@ -56,27 +56,27 @@ discard block |
||
56 | 56 | $ret = array(); |
57 | 57 | |
58 | 58 | foreach($_FILES as $k => $file) { |
59 | - if(in_array(strtolower($_FILES[$k]['type']), $imgType) && $_FILES[$k]['size'] > 0) { |
|
60 | - $upload_file = new UploadFile($k); |
|
61 | - // check the file |
|
62 | - if($upload_file->confirm_upload()) { |
|
63 | - $dest = $cachedir.basename($upload_file->get_stored_file_name()); // target name |
|
64 | - $guid = create_guid(); |
|
65 | - if($upload_file->final_move($guid)) { // move to uploads |
|
66 | - $path = $upload_file->get_upload_path($guid); |
|
67 | - // if file is OK, copy to cache |
|
68 | - if(verify_uploaded_image($path) && copy($path, $dest)) { |
|
69 | - $ret[] = $dest; |
|
70 | - } |
|
71 | - // remove temp file |
|
72 | - unlink($path); |
|
73 | - } |
|
74 | - } |
|
75 | - } |
|
59 | + if(in_array(strtolower($_FILES[$k]['type']), $imgType) && $_FILES[$k]['size'] > 0) { |
|
60 | + $upload_file = new UploadFile($k); |
|
61 | + // check the file |
|
62 | + if($upload_file->confirm_upload()) { |
|
63 | + $dest = $cachedir.basename($upload_file->get_stored_file_name()); // target name |
|
64 | + $guid = create_guid(); |
|
65 | + if($upload_file->final_move($guid)) { // move to uploads |
|
66 | + $path = $upload_file->get_upload_path($guid); |
|
67 | + // if file is OK, copy to cache |
|
68 | + if(verify_uploaded_image($path) && copy($path, $dest)) { |
|
69 | + $ret[] = $dest; |
|
70 | + } |
|
71 | + // remove temp file |
|
72 | + unlink($path); |
|
73 | + } |
|
74 | + } |
|
75 | + } |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | if (!empty($ret)) { |
79 | - $json = getJSONobj(); |
|
80 | - echo $json->encode($ret); |
|
81 | - //return the parameters |
|
79 | + $json = getJSONobj(); |
|
80 | + echo $json->encode($ret); |
|
81 | + //return the parameters |
|
82 | 82 | } |
@@ -50,38 +50,38 @@ |
||
50 | 50 | |
51 | 51 | $focus = new EmailTemplate(); |
52 | 52 | if($_REQUEST['from'] == 'DetailView') { |
53 | - if(!isset($_REQUEST['record'])) |
|
54 | - sugar_die("A record number must be specified to delete the template."); |
|
55 | - $focus->retrieve($_REQUEST['record']); |
|
56 | - if(check_email_template_in_use($focus)) { |
|
57 | - echo 'true'; |
|
58 | - return; |
|
59 | - } |
|
60 | - echo 'false'; |
|
53 | + if(!isset($_REQUEST['record'])) |
|
54 | + sugar_die("A record number must be specified to delete the template."); |
|
55 | + $focus->retrieve($_REQUEST['record']); |
|
56 | + if(check_email_template_in_use($focus)) { |
|
57 | + echo 'true'; |
|
58 | + return; |
|
59 | + } |
|
60 | + echo 'false'; |
|
61 | 61 | } else if($_REQUEST['from'] == 'ListView') { |
62 | - $returnString = ''; |
|
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 . ','; |
|
68 | - } |
|
69 | - } |
|
70 | - } |
|
71 | - $returnString = substr($returnString, 0, -1); |
|
72 | - echo $returnString; |
|
62 | + $returnString = ''; |
|
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 . ','; |
|
68 | + } |
|
69 | + } |
|
70 | + } |
|
71 | + $returnString = substr($returnString, 0, -1); |
|
72 | + echo $returnString; |
|
73 | 73 | } else { |
74 | - echo ''; |
|
74 | + echo ''; |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | function check_email_template_in_use($focus) |
78 | 78 | { |
79 | - if($focus->is_used_by_email_marketing()) { |
|
80 | - return true; |
|
81 | - } |
|
82 | - $system = $GLOBALS['sugar_config']['passwordsetting']; |
|
83 | - if($focus->id == $system['generatepasswordtmpl'] || $focus->id == $system['lostpasswordtmpl']) { |
|
84 | - return true; |
|
85 | - } |
|
79 | + if($focus->is_used_by_email_marketing()) { |
|
80 | + return true; |
|
81 | + } |
|
82 | + $system = $GLOBALS['sugar_config']['passwordsetting']; |
|
83 | + if($focus->id == $system['generatepasswordtmpl'] || $focus->id == $system['lostpasswordtmpl']) { |
|
84 | + return true; |
|
85 | + } |
|
86 | 86 | return false; |
87 | 87 | } |
@@ -1,29 +1,29 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
3 | 3 | |
4 | - global $db; |
|
4 | + global $db; |
|
5 | 5 | |
6 | - $even_id = $_GET['event']; |
|
7 | - $delegate_id = $_GET['delegate']; |
|
8 | - $type = $_GET['type']; |
|
9 | - $response = $_GET['response']; |
|
6 | + $even_id = $_GET['event']; |
|
7 | + $delegate_id = $_GET['delegate']; |
|
8 | + $type = $_GET['type']; |
|
9 | + $response = $_GET['response']; |
|
10 | 10 | |
11 | - //get event |
|
11 | + //get event |
|
12 | 12 | $event = new FP_events(); |
13 | 13 | $event->retrieve($even_id); |
14 | 14 | |
15 | 15 | if($type == 'c'){ |
16 | 16 | |
17 | - $event->load_relationship('fp_events_contacts'); // get related contacts |
|
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 | - $check = $db->getOne($check_q); |
|
24 | - //update contact to accepted |
|
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'){ |
|
23 | + $check = $db->getOne($check_q); |
|
24 | + //update contact to accepted |
|
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'){ |
|
27 | 27 | |
28 | 28 | if(!IsNullOrEmptyString($event->accept_redirect)){ |
29 | 29 | |
@@ -33,17 +33,17 @@ discard block |
||
33 | 33 | else{ |
34 | 34 | echo 'Thank you for accepting'; |
35 | 35 | } |
36 | - } |
|
37 | - else { |
|
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 | - } |
|
40 | - } |
|
41 | - else if($response == 'decline'){ |
|
42 | - //check to see if they have already responded to the email |
|
36 | + } |
|
37 | + else { |
|
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 | + } |
|
40 | + } |
|
41 | + else if($response == 'decline'){ |
|
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 | - $check = $db->getOne($check_q); |
|
44 | + $check = $db->getOne($check_q); |
|
45 | 45 | //update contact to accepted |
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"'; |
|
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 | 48 | if($db->query($query) && $check != '1'){ |
49 | 49 | |
@@ -56,24 +56,24 @@ discard block |
||
56 | 56 | else{ |
57 | 57 | echo 'Thank you for declining'; |
58 | 58 | } |
59 | - } |
|
60 | - else { |
|
61 | - 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.'; |
|
62 | - } |
|
63 | - } |
|
59 | + } |
|
60 | + else { |
|
61 | + 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.'; |
|
62 | + } |
|
63 | + } |
|
64 | 64 | } |
65 | 65 | if($type == 't'){ |
66 | 66 | |
67 | - $event->load_relationship('fp_events_prospects_1'); //get related targets |
|
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 | - $check = $db->getOne($check_q); |
|
72 | + $check = $db->getOne($check_q); |
|
73 | 73 | |
74 | - //update contact to accepted |
|
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'){ |
|
74 | + //update contact to accepted |
|
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'){ |
|
77 | 77 | |
78 | 78 | if(!IsNullOrEmptyString($event->accept_redirect)){ |
79 | 79 | |
@@ -87,14 +87,14 @@ discard block |
||
87 | 87 | else { |
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 | - } |
|
91 | - else if($response == 'decline'){ |
|
90 | + } |
|
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 | - $check = $db->getOne($check_q); |
|
95 | - //update contact to accepted |
|
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'){ |
|
94 | + $check = $db->getOne($check_q); |
|
95 | + //update contact to accepted |
|
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'){ |
|
98 | 98 | |
99 | 99 | if(!IsNullOrEmptyString($event->decline_redirect)){ |
100 | 100 | |
@@ -109,19 +109,19 @@ discard block |
||
109 | 109 | else { |
110 | 110 | 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.'; |
111 | 111 | } |
112 | - } |
|
112 | + } |
|
113 | 113 | } |
114 | 114 | if($type == 'l'){ |
115 | 115 | |
116 | - $event->load_relationship('fp_events_leads_1'); //get related leads |
|
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 | - $check = $db->getOne($check_q); |
|
122 | - //update contact to accepted |
|
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'){ |
|
121 | + $check = $db->getOne($check_q); |
|
122 | + //update contact to accepted |
|
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'){ |
|
125 | 125 | |
126 | 126 | if(!IsNullOrEmptyString($event->accept_redirect)){ |
127 | 127 | |
@@ -135,15 +135,15 @@ discard block |
||
135 | 135 | else { |
136 | 136 | echo 'There was a problem with the link please contact the sender of the invite'; |
137 | 137 | } |
138 | - } |
|
139 | - else if($response == 'decline'){ |
|
140 | - //check to see if they have already responded to the email |
|
138 | + } |
|
139 | + else if($response == 'decline'){ |
|
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 | - $check = $db->getOne($check_q); |
|
142 | + $check = $db->getOne($check_q); |
|
143 | 143 | //update contact to accepted |
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"'; |
|
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 | 148 | if(!IsNullOrEmptyString($event->decline_redirect)){ |
149 | 149 | |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | else { |
159 | 159 | echo 'There was a problem with the link please contact the sender of the invite'; |
160 | 160 | } |
161 | - } |
|
161 | + } |
|
162 | 162 | } |
163 | 163 | // Function for basic field validation (present and neither empty nor only white space nor just 'http://') |
164 | 164 | function IsNullOrEmptyString($question){ |
@@ -70,7 +70,7 @@ |
||
70 | 70 | } |
71 | 71 | }else{ |
72 | 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 | - SugarApplication::redirect($meetingBean->join_url); |
|
73 | + SugarApplication::redirect($meetingBean->join_url); |
|
74 | 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'; |