Test Failed
Push — CI ( 0f01dd...c95a04 )
by Adam
55:13
created
modules/AOR_Fields/vardefs.php 1 patch
Indentation   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -1,32 +1,32 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Advanced OpenReports, SugarCRM Reporting.
4
- * @package Advanced OpenReports for SugarCRM
5
- * @copyright SalesAgility Ltd http://www.salesagility.com
6
- *
7
- * This program is free software; you can redistribute it and/or modify
8
- * it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by
9
- * the Free Software Foundation; either version 3 of the License, or
10
- * (at your option) any later version.
11
- *
12
- * This program is distributed in the hope that it will be useful,
13
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
- * GNU General Public License for more details.
16
- *
17
- * You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
18
- * along with this program; if not, see http://www.gnu.org/licenses
19
- * or write to the Free Software Foundation,Inc., 51 Franklin Street,
20
- * Fifth Floor, Boston, MA 02110-1301  USA
21
- *
22
- * @author SalesAgility <[email protected]>
23
- */
3
+     * Advanced OpenReports, SugarCRM Reporting.
4
+     * @package Advanced OpenReports for SugarCRM
5
+     * @copyright SalesAgility Ltd http://www.salesagility.com
6
+     *
7
+     * This program is free software; you can redistribute it and/or modify
8
+     * it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by
9
+     * the Free Software Foundation; either version 3 of the License, or
10
+     * (at your option) any later version.
11
+     *
12
+     * This program is distributed in the hope that it will be useful,
13
+     * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
+     * GNU General Public License for more details.
16
+     *
17
+     * You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
18
+     * along with this program; if not, see http://www.gnu.org/licenses
19
+     * or write to the Free Software Foundation,Inc., 51 Franklin Street,
20
+     * Fifth Floor, Boston, MA 02110-1301  USA
21
+     *
22
+     * @author SalesAgility <[email protected]>
23
+     */
24 24
 
25 25
 $dictionary['AOR_Field'] = array(
26
-	'table'=>'aor_fields',
27
-	'audited'=>false,
28
-	'duplicate_merge'=>true,
29
-	'fields'=>array (
26
+    'table'=>'aor_fields',
27
+    'audited'=>false,
28
+    'duplicate_merge'=>true,
29
+    'fields'=>array (
30 30
         'aor_report_id' =>
31 31
         array (
32 32
             'required' => false,
@@ -338,8 +338,8 @@  discard block
 block discarded – undo
338 338
             'fields' => array('aor_report_id'),
339 339
         ),
340 340
     ),
341
-	'optimistic_locking'=>true,
342
-		'unified_search'=>true,
341
+    'optimistic_locking'=>true,
342
+        'unified_search'=>true,
343 343
 );
344 344
 if (!class_exists('VardefManager')){
345 345
         require_once('include/SugarObjects/VardefManager.php');
Please login to merge, or discard this patch.
modules/Reminders_Invitees/Reminder_Invitee.php 1 patch
Indentation   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -67,12 +67,12 @@  discard block
 block discarded – undo
67 67
         return false;
68 68
     }
69 69
 
70
-	/**
71
-	 * Save multiple reminders invitees data.
72
-	 * 
73
-	 * @param string $reminderId Related Reminder GUID
74
-	 * @param array $inviteesData Invitees Data
75
-	 */
70
+    /**
71
+     * Save multiple reminders invitees data.
72
+     * 
73
+     * @param string $reminderId Related Reminder GUID
74
+     * @param array $inviteesData Invitees Data
75
+     */
76 76
     public static function saveRemindersInviteesData($reminderId, $inviteesData) {
77 77
         $savedInviteeIds = array();
78 78
         foreach($inviteesData as $k => $inviteeData) {
@@ -98,16 +98,16 @@  discard block
 block discarded – undo
98 98
         self::deleteRemindersInviteesMultiple($reminderId, $savedInviteeIds);
99 99
     }
100 100
 	
101
-	/**
102
-	 * Load reminders invitees data.
103
-	 * 
104
-	 * @param string $reminderId Related Reminder GUID
105
-	 * @return array Invitees data
106
-	 */
107
-	public static function loadRemindersInviteesData($reminderId, $isDuplicate = false) {
108
-		$ret = array();
109
-		$reminderInviteeBeen = new Reminder_Invitee();
110
-		$reminderInvitees = $reminderInviteeBeen->get_full_list("reminders_invitees.date_entered", "reminders_invitees.reminder_id = '$reminderId'");
101
+    /**
102
+     * Load reminders invitees data.
103
+     * 
104
+     * @param string $reminderId Related Reminder GUID
105
+     * @return array Invitees data
106
+     */
107
+    public static function loadRemindersInviteesData($reminderId, $isDuplicate = false) {
108
+        $ret = array();
109
+        $reminderInviteeBeen = new Reminder_Invitee();
110
+        $reminderInvitees = $reminderInviteeBeen->get_full_list("reminders_invitees.date_entered", "reminders_invitees.reminder_id = '$reminderId'");
111 111
         if($reminderInvitees) {
112 112
             foreach ($reminderInvitees as $reminderInvitee) {
113 113
                 $ret[] = array(
@@ -118,8 +118,8 @@  discard block
 block discarded – undo
118 118
                 );
119 119
             }
120 120
         }
121
-		return $ret;
122
-	}
121
+        return $ret;
122
+    }
123 123
 
124 124
     private static function getInviteeName($module, $moduleId) {
125 125
         $retValue = "unknown";
@@ -147,12 +147,12 @@  discard block
 block discarded – undo
147 147
         return $retValue;
148 148
     }
149 149
 
150
-	/**
151
-	 * Delete reminders invitees multiple.
152
-	 * 
153
-	 * @param string $reminderId Related Reminder GUID
154
-	 * @param array $inviteeIds (optional) Exluded Invitees GUIDs, the invitee will not deleted if this argument contains that. Default is empty array.
155
-	 */
150
+    /**
151
+     * Delete reminders invitees multiple.
152
+     * 
153
+     * @param string $reminderId Related Reminder GUID
154
+     * @param array $inviteeIds (optional) Exluded Invitees GUIDs, the invitee will not deleted if this argument contains that. Default is empty array.
155
+     */
156 156
     public static function deleteRemindersInviteesMultiple($reminderId, $inviteeIds = array()) {
157 157
         $invitees = BeanFactory::getBean('Reminders_Invitees')->get_full_list("", "reminders_invitees.reminder_id = '$reminderId'");
158 158
         if($invitees) {
Please login to merge, or discard this patch.
modules/AOP_Case_Updates/AOP_Case_Updates_sugar.php 1 patch
Indentation   +51 added lines, -51 removed lines patch added patch discarded remove patch
@@ -1,26 +1,26 @@  discard block
 block discarded – undo
1 1
 <?PHP
2 2
 /**
3
- *
4
- * @package Advanced OpenPortal
5
- * @copyright SalesAgility Ltd http://www.salesagility.com
6
- *
7
- * This program is free software; you can redistribute it and/or modify
8
- * it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by
9
- * the Free Software Foundation; either version 3 of the License, or
10
- * (at your option) any later version.
11
- *
12
- * This program is distributed in the hope that it will be useful,
13
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
- * GNU General Public License for more details.
16
- *
17
- * You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
18
- * along with this program; if not, see http://www.gnu.org/licenses
19
- * or write to the Free Software Foundation,Inc., 51 Franklin Street,
20
- * Fifth Floor, Boston, MA 02110-1301  USA
21
- *
22
- * @author Salesagility Ltd <[email protected]>
23
- */
3
+     *
4
+     * @package Advanced OpenPortal
5
+     * @copyright SalesAgility Ltd http://www.salesagility.com
6
+     *
7
+     * This program is free software; you can redistribute it and/or modify
8
+     * it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by
9
+     * the Free Software Foundation; either version 3 of the License, or
10
+     * (at your option) any later version.
11
+     *
12
+     * This program is distributed in the hope that it will be useful,
13
+     * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
+     * GNU General Public License for more details.
16
+     *
17
+     * You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
18
+     * along with this program; if not, see http://www.gnu.org/licenses
19
+     * or write to the Free Software Foundation,Inc., 51 Franklin Street,
20
+     * Fifth Floor, Boston, MA 02110-1301  USA
21
+     *
22
+     * @author Salesagility Ltd <[email protected]>
23
+     */
24 24
 
25 25
 /**
26 26
  * THIS CLASS IS GENERATED BY MODULE BUILDER
@@ -30,37 +30,37 @@  discard block
 block discarded – undo
30 30
 
31 31
 
32 32
 class AOP_Case_Updates_sugar extends Basic {
33
-	var $new_schema = true;
34
-	var $module_dir = 'AOP_Case_Updates';
35
-	var $object_name = 'AOP_Case_Updates';
36
-	var $table_name = 'aop_case_updates';
37
-	var $tracker_visibility = false;
38
-	var $importable = false;
39
-	var $disable_row_level_security = true ; // to ensure that modules created and deployed under CE will continue to function under team security if the instance is upgraded to PRO
40
-		var $id;
41
-		var $name;
42
-		var $date_entered;
43
-		var $date_modified;
44
-		var $modified_user_id;
45
-		var $modified_by_name;
46
-		var $created_by;
47
-		var $created_by_name;
48
-		var $description;
49
-		var $deleted;
50
-		var $created_by_link;
51
-		var $modified_user_link;
52
-		var $assigned_user_id;
53
-		var $assigned_user_name;
54
-		var $assigned_user_link;
55
-		function AOP_Case_Updates_sugar(){	
56
-		parent::Basic();
57
-	}
33
+    var $new_schema = true;
34
+    var $module_dir = 'AOP_Case_Updates';
35
+    var $object_name = 'AOP_Case_Updates';
36
+    var $table_name = 'aop_case_updates';
37
+    var $tracker_visibility = false;
38
+    var $importable = false;
39
+    var $disable_row_level_security = true ; // to ensure that modules created and deployed under CE will continue to function under team security if the instance is upgraded to PRO
40
+        var $id;
41
+        var $name;
42
+        var $date_entered;
43
+        var $date_modified;
44
+        var $modified_user_id;
45
+        var $modified_by_name;
46
+        var $created_by;
47
+        var $created_by_name;
48
+        var $description;
49
+        var $deleted;
50
+        var $created_by_link;
51
+        var $modified_user_link;
52
+        var $assigned_user_id;
53
+        var $assigned_user_name;
54
+        var $assigned_user_link;
55
+        function AOP_Case_Updates_sugar(){	
56
+        parent::Basic();
57
+    }
58 58
 	
59
-	function bean_implements($interface){
60
-		switch($interface){
61
-			case 'ACL': return true;
62
-		}
63
-		return false;
59
+    function bean_implements($interface){
60
+        switch($interface){
61
+            case 'ACL': return true;
62
+        }
63
+        return false;
64 64
 }
65 65
 		
66 66
 }
Please login to merge, or discard this patch.
modules/SchedulersJobs/field_arrays.php 1 patch
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -40,23 +40,23 @@
 block discarded – undo
40 40
 
41 41
 
42 42
 $fields_array['Schedulers_jobs'] = array (
43
-	'column_fields' => array (
44
-		'id',
45
-		'deleted',
46
-		'date_entered',
47
-		'date_modified',
48
-		'job_id',
49
-		'execute_time',
50
-		'status',
51
-	),
52
-	'list_fields' => array (
53
-		'id',
54
-		'job_id',
55
-		'execute_time'
56
-	),
57
-	'required_fields' => array (
58
-		'job_id' => 1,
59
-		'execute_time' => 1
60
-	)
43
+    'column_fields' => array (
44
+        'id',
45
+        'deleted',
46
+        'date_entered',
47
+        'date_modified',
48
+        'job_id',
49
+        'execute_time',
50
+        'status',
51
+    ),
52
+    'list_fields' => array (
53
+        'id',
54
+        'job_id',
55
+        'execute_time'
56
+    ),
57
+    'required_fields' => array (
58
+        'job_id' => 1,
59
+        'execute_time' => 1
60
+    )
61 61
 );
62 62
 ?>
Please login to merge, or discard this patch.
modules/SchedulersJobs/SchedulersJob.php 1 patch
Indentation   +207 added lines, -207 removed lines patch added patch discarded remove patch
@@ -55,17 +55,17 @@  discard block
 block discarded – undo
55 55
     const JOB_FAILURE = 'failure';
56 56
 
57 57
     // schema attributes
58
-	public $id;
59
-	public $name;
60
-	public $deleted;
61
-	public $date_entered;
62
-	public $date_modified;
63
-	public $scheduler_id;
64
-	public $execute_time; // when to execute
58
+    public $id;
59
+    public $name;
60
+    public $deleted;
61
+    public $date_entered;
62
+    public $date_modified;
63
+    public $scheduler_id;
64
+    public $execute_time; // when to execute
65 65
     public $status;
66 66
     public $resolution;
67 67
     public $message;
68
-	public $target; // URL or function name
68
+    public $target; // URL or function name
69 69
     public $data; // Data set
70 70
     public $requeue; // Requeue on failure?
71 71
     public $retry_count;
@@ -76,61 +76,61 @@  discard block
 block discarded – undo
76 76
     public $execute_time_db;
77 77
     public $percent_complete; // how much of the job is done
78 78
 
79
-	// standard SugarBean child attrs
80
-	var $table_name		= "job_queue";
81
-	var $object_name		= "SchedulersJob";
82
-	var $module_dir		= "SchedulersJobs";
83
-	var $new_schema		= true;
84
-	var $process_save_dates = true;
85
-	// related fields
86
-	var $job_name;	// the Scheduler's 'name' field
87
-	var $job;		// the Scheduler's 'job' field
88
-	// object specific attributes
89
-	public $user; // User object
90
-	var $scheduler; // Scheduler parent
91
-	public $min_interval = 30; // minimal interval for job reruns
92
-	protected $job_done = true;
79
+    // standard SugarBean child attrs
80
+    var $table_name		= "job_queue";
81
+    var $object_name		= "SchedulersJob";
82
+    var $module_dir		= "SchedulersJobs";
83
+    var $new_schema		= true;
84
+    var $process_save_dates = true;
85
+    // related fields
86
+    var $job_name;	// the Scheduler's 'name' field
87
+    var $job;		// the Scheduler's 'job' field
88
+    // object specific attributes
89
+    public $user; // User object
90
+    var $scheduler; // Scheduler parent
91
+    public $min_interval = 30; // minimal interval for job reruns
92
+    protected $job_done = true;
93 93
     protected $old_user;
94 94
 
95
-	/**
96
-	 * Job constructor.
97
-	 */
98
-	function SchedulersJob()
99
-	{
95
+    /**
96
+     * Job constructor.
97
+     */
98
+    function SchedulersJob()
99
+    {
100 100
         parent::Basic();
101 101
         if(!empty($GLOBALS['sugar_config']['jobs']['min_retry_interval'])) {
102 102
             $this->min_interval = $GLOBALS['sugar_config']['jobs']['min_retry_interval'];
103 103
         }
104
-	}
104
+    }
105 105
 
106
-	public function check_date_relationships_load()
107
-	{
106
+    public function check_date_relationships_load()
107
+    {
108 108
         // Hack to work around the mess with dates being auto-converted to user format on retrieve
109
-	    $this->execute_time_db = $this->db->fromConvert($this->execute_time, 'datetime');
110
-	    parent::check_date_relationships_load();
109
+        $this->execute_time_db = $this->db->fromConvert($this->execute_time, 'datetime');
110
+        parent::check_date_relationships_load();
111 111
     }
112
-	/**
112
+    /**
113 113
      * handleDateFormat
114 114
      *
115
-	 * This function handles returning a datetime value.  It allows a user instance to be passed in, but will default to the
115
+     * This function handles returning a datetime value.  It allows a user instance to be passed in, but will default to the
116 116
      * user member variable instance if none is found.
117 117
      *
118
-	 * @param string $date String value of the date to calculate, defaults to 'now'
119
-	 * @param object $user The User instance to use in calculating the time value, if empty, it will default to user member variable
120
-	 * @param boolean $user_format Boolean indicating whether or not to convert to user's time format, defaults to false
118
+     * @param string $date String value of the date to calculate, defaults to 'now'
119
+     * @param object $user The User instance to use in calculating the time value, if empty, it will default to user member variable
120
+     * @param boolean $user_format Boolean indicating whether or not to convert to user's time format, defaults to false
121 121
      *
122
-	 * @return string Formatted datetime value
123
-	 */
124
-	function handleDateFormat($date='now', $user=null, $user_format=false) {
125
-		global $timedate;
122
+     * @return string Formatted datetime value
123
+     */
124
+    function handleDateFormat($date='now', $user=null, $user_format=false) {
125
+        global $timedate;
126 126
 
127
-		if(!isset($timedate) || empty($timedate))
127
+        if(!isset($timedate) || empty($timedate))
128 128
         {
129
-			$timedate = new TimeDate();
130
-		}
129
+            $timedate = new TimeDate();
130
+        }
131 131
 
132
-		// get user for calculation
133
-		$user = (empty($user)) ? $this->user : $user;
132
+        // get user for calculation
133
+        $user = (empty($user)) ? $this->user : $user;
134 134
 
135 135
         if($date == 'now')
136 136
         {
@@ -141,109 +141,109 @@  discard block
 block discarded – undo
141 141
 
142 142
         // if $user_format is set to true then just return as th user's time format, otherwise, return as database format
143 143
         return $user_format ? $dbTime : $timedate->fromUser($dbTime, $user)->asDb();
144
-	}
145
-
146
-
147
-	///////////////////////////////////////////////////////////////////////////
148
-	////	SCHEDULERSJOB HELPER FUNCTIONS
149
-
150
-	/**
151
-	 * This function takes a passed URL and cURLs it to fake multi-threading with another httpd instance
152
-	 * @param	$job		String in URI-clean format
153
-	 * @param	$timeout	Int value in secs for cURL to timeout. 30 default.
154
-	 */
155
-	public function fireUrl($job, $timeout=30)
156
-	{
157
-	// TODO: figure out what error is thrown when no more apache instances can be spun off
158
-	    // cURL inits
159
-		$ch = curl_init();
160
-		curl_setopt($ch, CURLOPT_URL, $job); // set url
161
-		curl_setopt($ch, CURLOPT_FAILONERROR, true); // silent failure (code >300);
162
-		curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); // do not follow location(); inits - we always use the current
163
-		curl_setopt($ch, CURLOPT_FORBID_REUSE, 1);
164
-		curl_setopt($ch, CURLOPT_DNS_USE_GLOBAL_CACHE, false);  // not thread-safe
165
-		curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // return into a variable to continue program execution
166
-		curl_setopt($ch, CURLOPT_TIMEOUT, $timeout); // never times out - bad idea?
167
-		curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5); // 5 secs for connect timeout
168
-		curl_setopt($ch, CURLOPT_FRESH_CONNECT, true);  // open brand new conn
169
-		curl_setopt($ch, CURLOPT_HEADER, true); // do not return header info with result
170
-		curl_setopt($ch, CURLOPT_NOPROGRESS, true); // do not have progress bar
171
-		$urlparts = parse_url($job);
172
-		if(empty($urlparts['port'])) {
173
-		    if($urlparts['scheme'] == 'https'){
174
-				$urlparts['port'] = 443;
175
-			} else {
176
-				$urlparts['port'] = 80;
177
-			}
178
-		}
179
-		curl_setopt($ch, CURLOPT_PORT, $urlparts['port']); // set port as reported by Server
180
-		//TODO make the below configurable
181
-		curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); // most customers will not have Certificate Authority account
182
-		curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // most customers will not have Certificate Authority account
183
-
184
-		curl_setopt($ch, CURLOPT_NOSIGNAL, true); // ignore any cURL signals to PHP (for multi-threading)
185
-		$result = curl_exec($ch);
186
-		$cInfo = curl_getinfo($ch);	//url,content_type,header_size,request_size,filetime,http_code
187
-									//ssl_verify_result,total_time,namelookup_time,connect_time
188
-									//pretransfer_time,size_upload,size_download,speed_download,
189
-									//speed_upload,download_content_length,upload_content_length
190
-									//starttransfer_time,redirect_time
191
-		if(curl_errno($ch)) {
192
-		    $this->errors .= curl_errno($ch)."\n";
193
-		}
194
-		curl_close($ch);
195
-
196
-		if($result !== FALSE && $cInfo['http_code'] < 400) {
197
-			$GLOBALS['log']->debug("----->Firing was successful: $job");
198
-			$GLOBALS['log']->debug('----->WTIH RESULT: '.strip_tags($result).' AND '.strip_tags(print_r($cInfo, true)));
199
-			return true;
200
-		} else {
201
-			$GLOBALS['log']->fatal("Job failed: $job");
202
-			return false;
203
-		}
204
-	}
205
-	////	END SCHEDULERSJOB HELPER FUNCTIONS
206
-	///////////////////////////////////////////////////////////////////////////
207
-
208
-
209
-	///////////////////////////////////////////////////////////////////////////
210
-	////	STANDARD SUGARBEAN OVERRIDES
211
-	/**
212
-	 * This function gets DB data and preps it for ListViews
213
-	 */
214
-	function get_list_view_data()
215
-	{
216
-		global $mod_strings;
217
-
218
-		$temp_array = $this->get_list_view_array();
219
-		$temp_array['JOB_NAME'] = $this->job_name;
220
-		$temp_array['JOB']		= $this->job;
221
-
222
-    	return $temp_array;
223
-	}
224
-
225
-	/** method stub for future customization
226
-	 *
227
-	 */
228
-	function fill_in_additional_list_fields()
229
-	{
230
-		$this->fill_in_additional_detail_fields();
231
-	}
232
-
233
-
234
-	/**
235
-	 * Mark this job as failed
236
-	 * @param string $message
237
-	 */
144
+    }
145
+
146
+
147
+    ///////////////////////////////////////////////////////////////////////////
148
+    ////	SCHEDULERSJOB HELPER FUNCTIONS
149
+
150
+    /**
151
+     * This function takes a passed URL and cURLs it to fake multi-threading with another httpd instance
152
+     * @param	$job		String in URI-clean format
153
+     * @param	$timeout	Int value in secs for cURL to timeout. 30 default.
154
+     */
155
+    public function fireUrl($job, $timeout=30)
156
+    {
157
+    // TODO: figure out what error is thrown when no more apache instances can be spun off
158
+        // cURL inits
159
+        $ch = curl_init();
160
+        curl_setopt($ch, CURLOPT_URL, $job); // set url
161
+        curl_setopt($ch, CURLOPT_FAILONERROR, true); // silent failure (code >300);
162
+        curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); // do not follow location(); inits - we always use the current
163
+        curl_setopt($ch, CURLOPT_FORBID_REUSE, 1);
164
+        curl_setopt($ch, CURLOPT_DNS_USE_GLOBAL_CACHE, false);  // not thread-safe
165
+        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // return into a variable to continue program execution
166
+        curl_setopt($ch, CURLOPT_TIMEOUT, $timeout); // never times out - bad idea?
167
+        curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5); // 5 secs for connect timeout
168
+        curl_setopt($ch, CURLOPT_FRESH_CONNECT, true);  // open brand new conn
169
+        curl_setopt($ch, CURLOPT_HEADER, true); // do not return header info with result
170
+        curl_setopt($ch, CURLOPT_NOPROGRESS, true); // do not have progress bar
171
+        $urlparts = parse_url($job);
172
+        if(empty($urlparts['port'])) {
173
+            if($urlparts['scheme'] == 'https'){
174
+                $urlparts['port'] = 443;
175
+            } else {
176
+                $urlparts['port'] = 80;
177
+            }
178
+        }
179
+        curl_setopt($ch, CURLOPT_PORT, $urlparts['port']); // set port as reported by Server
180
+        //TODO make the below configurable
181
+        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); // most customers will not have Certificate Authority account
182
+        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // most customers will not have Certificate Authority account
183
+
184
+        curl_setopt($ch, CURLOPT_NOSIGNAL, true); // ignore any cURL signals to PHP (for multi-threading)
185
+        $result = curl_exec($ch);
186
+        $cInfo = curl_getinfo($ch);	//url,content_type,header_size,request_size,filetime,http_code
187
+                                    //ssl_verify_result,total_time,namelookup_time,connect_time
188
+                                    //pretransfer_time,size_upload,size_download,speed_download,
189
+                                    //speed_upload,download_content_length,upload_content_length
190
+                                    //starttransfer_time,redirect_time
191
+        if(curl_errno($ch)) {
192
+            $this->errors .= curl_errno($ch)."\n";
193
+        }
194
+        curl_close($ch);
195
+
196
+        if($result !== FALSE && $cInfo['http_code'] < 400) {
197
+            $GLOBALS['log']->debug("----->Firing was successful: $job");
198
+            $GLOBALS['log']->debug('----->WTIH RESULT: '.strip_tags($result).' AND '.strip_tags(print_r($cInfo, true)));
199
+            return true;
200
+        } else {
201
+            $GLOBALS['log']->fatal("Job failed: $job");
202
+            return false;
203
+        }
204
+    }
205
+    ////	END SCHEDULERSJOB HELPER FUNCTIONS
206
+    ///////////////////////////////////////////////////////////////////////////
207
+
208
+
209
+    ///////////////////////////////////////////////////////////////////////////
210
+    ////	STANDARD SUGARBEAN OVERRIDES
211
+    /**
212
+     * This function gets DB data and preps it for ListViews
213
+     */
214
+    function get_list_view_data()
215
+    {
216
+        global $mod_strings;
217
+
218
+        $temp_array = $this->get_list_view_array();
219
+        $temp_array['JOB_NAME'] = $this->job_name;
220
+        $temp_array['JOB']		= $this->job;
221
+
222
+        return $temp_array;
223
+    }
224
+
225
+    /** method stub for future customization
226
+     *
227
+     */
228
+    function fill_in_additional_list_fields()
229
+    {
230
+        $this->fill_in_additional_detail_fields();
231
+    }
232
+
233
+
234
+    /**
235
+     * Mark this job as failed
236
+     * @param string $message
237
+     */
238 238
     public function failJob($message = null)
239 239
     {
240 240
         return $this->resolveJob(self::JOB_FAILURE, $message);
241 241
     }
242 242
 
243
-	/**
244
-	 * Mark this job as success
245
-	 * @param string $message
246
-	 */
243
+    /**
244
+     * Mark this job as success
245
+     * @param string $message
246
+     */
247 247
     public function succeedJob($message = null)
248 248
     {
249 249
         return $this->resolveJob(self::JOB_SUCCESS, $message);
@@ -413,28 +413,28 @@  discard block
 block discarded – undo
413 413
     {
414 414
         switch($errno)
415 415
         {
416
-    		case E_USER_WARNING:
417
-    		case E_COMPILE_WARNING:
418
-    		case E_CORE_WARNING:
419
-    		case E_WARNING:
420
-    			$type = "Warning";
421
-    			break;
422
-    		case E_USER_ERROR:
423
-    		case E_COMPILE_ERROR:
424
-    		case E_CORE_ERROR:
425
-    		case E_ERROR:
426
-    			$type = "Fatal Error";
427
-	    		break;
428
-    		case E_PARSE:
429
-    			$type = "Parse Error";
430
-	    		break;
431
-    		case E_RECOVERABLE_ERROR:
432
-    			$type = "Recoverable Error";
433
-	    		break;
434
-		    default:
435
-		        // Ignore errors we don't know about
436
-		        return;
437
-    	}
416
+            case E_USER_WARNING:
417
+            case E_COMPILE_WARNING:
418
+            case E_CORE_WARNING:
419
+            case E_WARNING:
420
+                $type = "Warning";
421
+                break;
422
+            case E_USER_ERROR:
423
+            case E_COMPILE_ERROR:
424
+            case E_CORE_ERROR:
425
+            case E_ERROR:
426
+                $type = "Fatal Error";
427
+                break;
428
+            case E_PARSE:
429
+                $type = "Parse Error";
430
+                break;
431
+            case E_RECOVERABLE_ERROR:
432
+                $type = "Recoverable Error";
433
+                break;
434
+            default:
435
+                // Ignore errors we don't know about
436
+                return;
437
+        }
438 438
         $errstr = strip_tags($errstr);
439 439
         $this->errors .= sprintf(translate('ERR_PHP', 'SchedulersJobs'), $type, $errno, $errstr, $errfile, $errline)."\n";
440 440
     }
@@ -451,13 +451,13 @@  discard block
 block discarded – undo
451 451
             session_destroy();
452 452
         }
453 453
         if(!headers_sent()) {
454
-    		session_start();
454
+            session_start();
455 455
             session_regenerate_id();
456 456
         }
457 457
         $_SESSION['is_valid_session']= true;
458
-    	$_SESSION['user_id'] = $user->id;
459
-    	$_SESSION['type'] = 'user';
460
-    	$_SESSION['authenticated_user_id'] = $user->id;
458
+        $_SESSION['user_id'] = $user->id;
459
+        $_SESSION['type'] = 'user';
460
+        $_SESSION['authenticated_user_id'] = $user->id;
461 461
     }
462 462
 
463 463
     /**
@@ -509,48 +509,48 @@  discard block
 block discarded – undo
509 509
             if(!$this->setJobUser()) {
510 510
                 return false;
511 511
             }
512
-    		$func = $exJob[1];
513
-			$GLOBALS['log']->debug("----->SchedulersJob calling function: $func");
512
+            $func = $exJob[1];
513
+            $GLOBALS['log']->debug("----->SchedulersJob calling function: $func");
514 514
             set_error_handler(array($this, "errorHandler"), E_ALL & ~E_NOTICE & ~E_STRICT);
515
-			if(!is_callable($func)) {
516
-			    $this->resolveJob(self::JOB_FAILURE, sprintf(translate('ERR_CALL', 'SchedulersJobs'), $func));
517
-			}
518
-			$data = array($this);
519
-			if(!empty($this->data)) {
520
-			    $data[] = $this->data;
521
-			}
515
+            if(!is_callable($func)) {
516
+                $this->resolveJob(self::JOB_FAILURE, sprintf(translate('ERR_CALL', 'SchedulersJobs'), $func));
517
+            }
518
+            $data = array($this);
519
+            if(!empty($this->data)) {
520
+                $data[] = $this->data;
521
+            }
522 522
             $res = call_user_func_array($func, $data);
523 523
             restore_error_handler();
524 524
             $this->restoreJobUser();
525
-			if($this->status == self::JOB_STATUS_RUNNING) {
526
-			    // nobody updated the status yet - job function could do that
527
-    			if($res) {
528
-    			    $this->resolveJob(self::JOB_SUCCESS);
529
-    				return true;
530
-    			} else {
531
-    			    $this->resolveJob(self::JOB_FAILURE);
532
-    			    return false;
533
-    			}
534
-			} else {
535
-			    return $this->resolution != self::JOB_FAILURE;
536
-			}
537
-		} elseif($exJob[0] == 'url') {
538
-			if(function_exists('curl_init')) {
539
-				$GLOBALS['log']->debug('----->SchedulersJob firing URL job: '.$exJob[1]);
525
+            if($this->status == self::JOB_STATUS_RUNNING) {
526
+                // nobody updated the status yet - job function could do that
527
+                if($res) {
528
+                    $this->resolveJob(self::JOB_SUCCESS);
529
+                    return true;
530
+                } else {
531
+                    $this->resolveJob(self::JOB_FAILURE);
532
+                    return false;
533
+                }
534
+            } else {
535
+                return $this->resolution != self::JOB_FAILURE;
536
+            }
537
+        } elseif($exJob[0] == 'url') {
538
+            if(function_exists('curl_init')) {
539
+                $GLOBALS['log']->debug('----->SchedulersJob firing URL job: '.$exJob[1]);
540 540
                 set_error_handler(array($this, "errorHandler"), E_ALL & ~E_NOTICE & ~E_STRICT);
541
-				if($this->fireUrl($exJob[1])) {
541
+                if($this->fireUrl($exJob[1])) {
542 542
                     restore_error_handler();
543 543
                     $this->resolveJob(self::JOB_SUCCESS);
544
-					return true;
545
-				} else {
544
+                    return true;
545
+                } else {
546 546
                     restore_error_handler();
547
-				    $this->resolveJob(self::JOB_FAILURE);
548
-					return false;
549
-				}
550
-			} else {
551
-			    $this->resolveJob(self::JOB_FAILURE, translate('ERR_CURL', 'SchedulersJobs'));
552
-			}
553
-		} elseif ($exJob[0] == 'class') {
547
+                    $this->resolveJob(self::JOB_FAILURE);
548
+                    return false;
549
+                }
550
+            } else {
551
+                $this->resolveJob(self::JOB_FAILURE, translate('ERR_CURL', 'SchedulersJobs'));
552
+            }
553
+        } elseif ($exJob[0] == 'class') {
554 554
             $tmpJob = new $exJob[1]();
555 555
             if($tmpJob instanceof RunnableSchedulerJob)
556 556
             {
@@ -579,9 +579,9 @@  discard block
 block discarded – undo
579 579
             }
580 580
         }
581 581
         else {
582
-		    $this->resolveJob(self::JOB_FAILURE, sprintf(translate('ERR_JOBTYPE', 'SchedulersJobs'), strip_tags($this->target)));
583
-		}
584
-		return false;
582
+            $this->resolveJob(self::JOB_FAILURE, sprintf(translate('ERR_JOBTYPE', 'SchedulersJobs'), strip_tags($this->target)));
583
+        }
584
+        return false;
585 585
     }
586 586
 
587 587
 }  // end class Job
Please login to merge, or discard this patch.
modules/Import/maps/ImportMapOutlook.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -49,11 +49,11 @@  discard block
 block discarded – undo
49 49
 
50 50
 class ImportMapOutlook extends ImportMapOther
51 51
 {
52
-	/**
52
+    /**
53 53
      * String identifier for this import
54 54
      */
55 55
     public $name = 'outlook';
56
-	/**
56
+    /**
57 57
      * Field delimiter
58 58
      */
59 59
     public $delimiter = ',';
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
      * Field enclosure
62 62
      */
63 63
     public $enclosure = '"';
64
-	/**
64
+    /**
65 65
      * Do we have a header?
66 66
      */
67 67
     public $has_header = true;
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
      * @param  string $module
73 73
      * @return array field mappings
74 74
      */
75
-	public function getMapping(
75
+    public function getMapping(
76 76
         $module
77 77
         )
78 78
     {
Please login to merge, or discard this patch.
modules/Import/maps/ImportMapGoogle.php 1 patch
Indentation   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 
45 45
 class ImportMapGoogle extends ImportMapOther
46 46
 {
47
-	/**
47
+    /**
48 48
      * String identifier for this import
49 49
      */
50 50
     public $name = 'google';
@@ -55,38 +55,38 @@  discard block
 block discarded – undo
55 55
      * @param  string $module
56 56
      * @return array field mappings
57 57
      */
58
-	public function getMapping($module)
58
+    public function getMapping($module)
59 59
     {
60
-         $return_array = array(
61
-             'first_name' => array('sugar_key' => 'first_name', 'sugar_label' => '', 'default_label' => 'Given Name'),
62
-             'last_name' => array('sugar_key' => 'last_name', 'sugar_label' => '', 'default_label' => 'Family Name'),
63
-             'birthday' => array('sugar_key' => 'birthdate', 'sugar_label' => '', 'default_label' => 'Birthday'),
64
-             'title' => array('sugar_key' => 'title', 'sugar_label' => '', 'default_label' => 'Title'),
65
-             'notes' => array('sugar_key' => 'description', 'sugar_label' => '', 'default_label' => 'Notes'),
60
+            $return_array = array(
61
+                'first_name' => array('sugar_key' => 'first_name', 'sugar_label' => '', 'default_label' => 'Given Name'),
62
+                'last_name' => array('sugar_key' => 'last_name', 'sugar_label' => '', 'default_label' => 'Family Name'),
63
+                'birthday' => array('sugar_key' => 'birthdate', 'sugar_label' => '', 'default_label' => 'Birthday'),
64
+                'title' => array('sugar_key' => 'title', 'sugar_label' => '', 'default_label' => 'Title'),
65
+                'notes' => array('sugar_key' => 'description', 'sugar_label' => '', 'default_label' => 'Notes'),
66 66
 
67
-             'alt_address_street' => array('sugar_key' => 'alt_address_street', 'sugar_label' => '', 'default_label' => 'Home Street'),
68
-             'alt_address_postcode' => array('sugar_key' => 'alt_address_postalcode', 'sugar_label' => '', 'default_label' => 'Home Postcode'),
69
-             'alt_address_city' => array('sugar_key' => 'alt_address_city', 'sugar_label' => '', 'default_label' => 'Home City'),
70
-             'alt_address_state' => array('sugar_key' => 'alt_address_state', 'sugar_label' => '', 'default_label' => 'Home State'),
71
-             'alt_address_country' => array('sugar_key' => 'alt_address_country', 'sugar_label' => '', 'default_label' => 'Home Country'),
67
+                'alt_address_street' => array('sugar_key' => 'alt_address_street', 'sugar_label' => '', 'default_label' => 'Home Street'),
68
+                'alt_address_postcode' => array('sugar_key' => 'alt_address_postalcode', 'sugar_label' => '', 'default_label' => 'Home Postcode'),
69
+                'alt_address_city' => array('sugar_key' => 'alt_address_city', 'sugar_label' => '', 'default_label' => 'Home City'),
70
+                'alt_address_state' => array('sugar_key' => 'alt_address_state', 'sugar_label' => '', 'default_label' => 'Home State'),
71
+                'alt_address_country' => array('sugar_key' => 'alt_address_country', 'sugar_label' => '', 'default_label' => 'Home Country'),
72 72
 
73
-             'primary_address_street' => array('sugar_key' => 'primary_address_street', 'sugar_label' => '', 'default_label' => 'Work Street'),
74
-             'primary_address_postcode' => array('sugar_key' => 'primary_address_postalcode', 'sugar_label' => '', 'default_label' => 'Work Postcode'),
75
-             'primary_address_city' => array('sugar_key' => 'primary_address_city', 'sugar_label' => '', 'default_label' => 'Work City'),
76
-             'primary_address_state' => array('sugar_key' => 'primary_address_state', 'sugar_label' => '', 'default_label' => 'Work State'),
77
-             'primary_address_country' => array('sugar_key' => 'primary_address_country', 'sugar_label' => '', 'default_label' => 'Work Country'),
73
+                'primary_address_street' => array('sugar_key' => 'primary_address_street', 'sugar_label' => '', 'default_label' => 'Work Street'),
74
+                'primary_address_postcode' => array('sugar_key' => 'primary_address_postalcode', 'sugar_label' => '', 'default_label' => 'Work Postcode'),
75
+                'primary_address_city' => array('sugar_key' => 'primary_address_city', 'sugar_label' => '', 'default_label' => 'Work City'),
76
+                'primary_address_state' => array('sugar_key' => 'primary_address_state', 'sugar_label' => '', 'default_label' => 'Work State'),
77
+                'primary_address_country' => array('sugar_key' => 'primary_address_country', 'sugar_label' => '', 'default_label' => 'Work Country'),
78 78
 
79
-             'phone_main' => array('sugar_key' => 'phone_other', 'sugar_label' => '', 'default_label' => 'Main Phone'),
80
-             'phone_mobile' => array('sugar_key' => 'phone_mobile', 'sugar_label' => '', 'default_label' => 'Mobile Phone'),
81
-             'phone_home' => array('sugar_key' => 'phone_home', 'sugar_label' => '', 'default_label' => 'Home phone'),
82
-             'phone_work' => array('sugar_key' => 'phone_work', 'sugar_label' => '', 'default_label' => 'Work phone'),
83
-             'phone_fax' => array('sugar_key' => 'phone_fax', 'sugar_label' => '', 'default_label' => 'Fax phone'),
79
+                'phone_main' => array('sugar_key' => 'phone_other', 'sugar_label' => '', 'default_label' => 'Main Phone'),
80
+                'phone_mobile' => array('sugar_key' => 'phone_mobile', 'sugar_label' => '', 'default_label' => 'Mobile Phone'),
81
+                'phone_home' => array('sugar_key' => 'phone_home', 'sugar_label' => '', 'default_label' => 'Home phone'),
82
+                'phone_work' => array('sugar_key' => 'phone_work', 'sugar_label' => '', 'default_label' => 'Work phone'),
83
+                'phone_fax' => array('sugar_key' => 'phone_fax', 'sugar_label' => '', 'default_label' => 'Fax phone'),
84 84
 
85
-             'email1' => array('sugar_key' => 'email1', 'sugar_label' => 'LBL_EMAIL_ADDRESS', 'default_label' => 'Email Address'),
86
-             'email2' => array('sugar_key' => 'email2', 'sugar_label' => 'LBL_OTHER_EMAIL_ADDRESS', 'default_label' => 'Other Email'),
85
+                'email1' => array('sugar_key' => 'email1', 'sugar_label' => 'LBL_EMAIL_ADDRESS', 'default_label' => 'Email Address'),
86
+                'email2' => array('sugar_key' => 'email2', 'sugar_label' => 'LBL_OTHER_EMAIL_ADDRESS', 'default_label' => 'Other Email'),
87 87
 
88
-             'assigned_user_name' => array('sugar_key' => 'assigned_user_name', 'sugar_help_key' => 'LBL_EXTERNAL_ASSIGNED_TOOLTIP', 'sugar_label' => 'LBL_ASSIGNED_TO_NAME', 'default_label' => 'Assigned To'),
89
-             'team_name' => array('sugar_key' => 'team_name', 'sugar_help_key' => 'LBL_EXTERNAL_TEAM_TOOLTIP','sugar_label' => 'LBL_TEAMS', 'default_label' => 'Teams'),
88
+                'assigned_user_name' => array('sugar_key' => 'assigned_user_name', 'sugar_help_key' => 'LBL_EXTERNAL_ASSIGNED_TOOLTIP', 'sugar_label' => 'LBL_ASSIGNED_TO_NAME', 'default_label' => 'Assigned To'),
89
+                'team_name' => array('sugar_key' => 'team_name', 'sugar_help_key' => 'LBL_EXTERNAL_TEAM_TOOLTIP','sugar_label' => 'LBL_TEAMS', 'default_label' => 'Teams'),
90 90
             );
91 91
 
92 92
         if($module == 'Users')
Please login to merge, or discard this patch.
modules/Import/maps/ImportMapSalesforce.php 1 patch
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -49,11 +49,11 @@  discard block
 block discarded – undo
49 49
 
50 50
 class ImportMapSalesforce extends ImportMapOther
51 51
 {
52
-	/**
52
+    /**
53 53
      * String identifier for this import
54 54
      */
55 55
     public $name = 'salesforce';
56
-	/**
56
+    /**
57 57
      * Field delimiter
58 58
      */
59 59
     public $delimiter = ',';
@@ -61,18 +61,18 @@  discard block
 block discarded – undo
61 61
      * Field enclosure
62 62
      */
63 63
     public $enclosure = '"';
64
-	/**
64
+    /**
65 65
      * Do we have a header?
66 66
      */
67 67
     public $has_header = true;
68 68
 
69
-	/**
69
+    /**
70 70
      * Gets the default mapping for a module
71 71
      *
72 72
      * @param  string $module
73 73
      * @return array field mappings
74 74
      */
75
-	public function getMapping(
75
+    public function getMapping(
76 76
         $module
77 77
         )
78 78
     {
@@ -151,15 +151,15 @@  discard block
 block discarded – undo
151 151
         }
152 152
     }
153 153
 	
154
-	/**
155
-	* @see ImportMapOther::getIgnoredFields()
154
+    /**
155
+     * @see ImportMapOther::getIgnoredFields()
156 156
      */
157
-	public function getIgnoredFields(
158
-		$module
159
-		)
160
-	{
161
-		return array_merge(parent::getIgnoredFields($module),array('id'));
162
-	}
157
+    public function getIgnoredFields(
158
+        $module
159
+        )
160
+    {
161
+        return array_merge(parent::getIgnoredFields($module),array('id'));
162
+    }
163 163
 }
164 164
 
165 165
 
Please login to merge, or discard this patch.
modules/Import/maps/ImportMapOther.php 1 patch
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -47,11 +47,11 @@  discard block
 block discarded – undo
47 47
 
48 48
 class ImportMapOther
49 49
 {
50
-	/**
50
+    /**
51 51
      * String identifier for this import
52 52
      */
53 53
     public $name = 'other';
54
-	/**
54
+    /**
55 55
      * Field delimiter
56 56
      */
57 57
     public $delimiter;
@@ -59,18 +59,18 @@  discard block
 block discarded – undo
59 59
      * Field enclosure
60 60
      */
61 61
     public $enclosure;
62
-	/**
62
+    /**
63 63
      * Do we have a header?
64 64
      */
65 65
     public $has_header = true;
66 66
 
67
-	/**
67
+    /**
68 68
      * Gets the default mapping for a module
69 69
      *
70 70
      * @param  string $module
71 71
      * @return array field mappings
72 72
      */
73
-	public function getMapping(
73
+    public function getMapping(
74 74
         $module
75 75
         )
76 76
     {
@@ -142,18 +142,18 @@  discard block
 block discarded – undo
142 142
         }
143 143
     }
144 144
 	
145
-	/**
145
+    /**
146 146
      * Returns a list of fields that should be ignorred for the module during import
147 147
      *
148 148
      * @param  string $module
149 149
      * @return array of fields to ignor
150 150
      */
151
-	public function getIgnoredFields(
152
-		$module
153
-		)
154
-	{
155
-		return array();
156
-	}
151
+    public function getIgnoredFields(
152
+        $module
153
+        )
154
+    {
155
+        return array();
156
+    }
157 157
 }
158 158
 
159 159
 
Please login to merge, or discard this patch.