Completed
Push — master ( 309357...7ad46f )
by Andreas
18:00
created
lib/org/openpsa/calendar/event/resource.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -42,7 +42,8 @@
 block discarded – undo
42 42
         }
43 43
         try {
44 44
             $resource = org_openpsa_calendar_resource_dba::get_cached($this->resource);
45
-        } catch (midcom_error $e) {
45
+        }
46
+        catch (midcom_error $e) {
46 47
             debug_add("Cannot fetch resource #{$this->resource} returning false", MIDCOM_LOG_INFO);
47 48
             return false;
48 49
         }
Please login to merge, or discard this patch.
lib/org/openpsa/invoices/scheduler.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
         }
84 84
 
85 85
         // TODO: Warehouse management: create new order
86
-        if (   $this->_deliverable->end < $next_cycle_start
86
+        if ($this->_deliverable->end < $next_cycle_start
87 87
             && $this->_deliverable->end != 0) {
88 88
             debug_add('Do not register next cycle, the contract ends before');
89 89
             return $this->_deliverable->end_subscription();
@@ -306,7 +306,7 @@  discard block
 block discarded – undo
306 306
         if ($this->_deliverable->unit != 'd') {
307 307
             //If previous cycle was run at the end of the month, the new one should be at the end of the month as well
308 308
             $date = new DateTime(gmdate('Y-m-d', $time), new DateTimeZone('GMT'));
309
-            if (   $date->format('t') == $date->format('j')
309
+            if ($date->format('t') == $date->format('j')
310 310
                 && $new_date->format('t') != $new_date->format('j')) {
311 311
                 $new_date->setDate((int) $new_date->format('Y'), (int) $new_date->format('m'), (int) $new_date->format('t'));
312 312
             }
@@ -372,11 +372,11 @@  discard block
 block discarded – undo
372 372
                 break;
373 373
             case 'q':
374 374
                 // Quarterly recurring subscription
375
-                $identifier = ceil(((int)$date->format('n')) / 4) . 'Q' . $date->format('y');
375
+                $identifier = ceil(((int) $date->format('n')) / 4) . 'Q' . $date->format('y');
376 376
                 break;
377 377
             case 'hy':
378 378
                 // Half-yearly recurring subscription
379
-                $identifier = ceil(((int)$date->format('n')) / 6) . '/' . $date->format('Y');
379
+                $identifier = ceil(((int) $date->format('n')) / 6) . '/' . $date->format('Y');
380 380
                 break;
381 381
             case 'y':
382 382
                 // Yearly recurring subscription
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -126,7 +126,8 @@
 block discarded – undo
126 126
         $salesproject = org_openpsa_sales_salesproject_dba::get_cached($this->_deliverable->salesproject);
127 127
         try {
128 128
             $owner = midcom_db_person::get_cached($salesproject->owner);
129
-        } catch (midcom_error $e) {
129
+        }
130
+        catch (midcom_error $e) {
130 131
             $e->log();
131 132
             return;
132 133
         }
Please login to merge, or discard this patch.
lib/org/openpsa/invoices/invoice/item.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 
19 19
     public function _on_creating()
20 20
     {
21
-        if (   $this->invoice
21
+        if ($this->invoice
22 22
             && $this->position == 0) {
23 23
             $invoice = org_openpsa_invoices_invoice_dba::get_cached($this->invoice);
24 24
             $this->position = count($invoice->get_invoice_items()) + 1;
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
             } catch (midcom_error $e) {
70 70
             }
71 71
         }
72
-        if (   $url == ''
72
+        if ($url == ''
73 73
             && $sales_url) {
74 74
             try {
75 75
                 $deliverable = org_openpsa_sales_salesproject_deliverable_dba::get_cached($this->deliverable);
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
                 $invoice = new org_openpsa_invoices_invoice_dba($this->invoice);
92 92
                 $old_sum = $invoice->sum;
93 93
                 self::update_invoice($invoice);
94
-                if (   $old_sum != $invoice->sum
94
+                if ($old_sum != $invoice->sum
95 95
                     && !empty($this->deliverable)) {
96 96
                     $deliverable = new org_openpsa_sales_salesproject_deliverable_dba($this->deliverable);
97 97
                     self::update_deliverable($deliverable);
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
 
132 132
         if ($invoiced != $deliverable->invoiced) {
133 133
             $deliverable->invoiced = $invoiced;
134
-            if (   $deliverable->orgOpenpsaObtype !== org_openpsa_products_product_dba::DELIVERY_SUBSCRIPTION
134
+            if ($deliverable->orgOpenpsaObtype !== org_openpsa_products_product_dba::DELIVERY_SUBSCRIPTION
135 135
                 && $deliverable->state < org_openpsa_sales_salesproject_deliverable_dba::STATE_INVOICED) {
136 136
                 $deliverable->state = org_openpsa_sales_salesproject_deliverable_dba::STATE_INVOICED;
137 137
             }
Please login to merge, or discard this patch.
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -66,7 +66,8 @@  discard block
 block discarded – undo
66 66
             try {
67 67
                 $task = org_openpsa_projects_task_dba::get_cached($this->task);
68 68
                 $url = $projects_url . 'task/' . $task->guid . '/';
69
-            } catch (midcom_error $e) {
69
+            }
70
+            catch (midcom_error $e) {
70 71
             }
71 72
         }
72 73
         if (   $url == ''
@@ -74,7 +75,8 @@  discard block
 block discarded – undo
74 75
             try {
75 76
                 $deliverable = org_openpsa_sales_salesproject_deliverable_dba::get_cached($this->deliverable);
76 77
                 $url = $sales_url . 'deliverable/' . $deliverable->guid . '/';
77
-            } catch (midcom_error $e) {
78
+            }
79
+            catch (midcom_error $e) {
78 80
             }
79 81
         }
80 82
         if ($url != '') {
@@ -96,7 +98,8 @@  discard block
 block discarded – undo
96 98
                     $deliverable = new org_openpsa_sales_salesproject_deliverable_dba($this->deliverable);
97 99
                     self::update_deliverable($deliverable);
98 100
                 }
99
-            } catch (midcom_error $e) {
101
+            }
102
+            catch (midcom_error $e) {
100 103
                 $e->log();
101 104
             }
102 105
         }
Please login to merge, or discard this patch.
lib/org/openpsa/documents/handler/document/view.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -92,7 +92,7 @@
 block discarded – undo
92 92
             $entry['mimetype'] = org_openpsa_documents_document_dba::get_file_type($att->mimetype);
93 93
         }
94 94
 
95
-        $title = '<a class="tab_escape" href="' .$prefix . 'document/' . $document->guid .'/"><img src="' . $icon . '"';
95
+        $title = '<a class="tab_escape" href="' . $prefix . 'document/' . $document->guid . '/"><img src="' . $icon . '"';
96 96
         $title .= 'alt="' . $alt . '" style="border: 0px; height: 16px; vertical-align: middle" /> ' . $document->title . '</a>';
97 97
 
98 98
         $entry['title'] = $title;
Please login to merge, or discard this patch.
lib/org/openpsa/directmarketing/importer.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
                 }
129 129
             }
130 130
 
131
-            if (   !$person
131
+            if (!$person
132 132
                 && !empty($subscriber['person']['handphone'])) {
133 133
                 // Perform a simple cell phone test. More complicated duplicate checking is best left to the o.o.contacts duplicate checker
134 134
                 $qb = org_openpsa_contacts_person_dba::new_query_builder();
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
             // User is or has been subscriber earlier, update status
175 175
             $member = $members[0];
176 176
 
177
-            if (   $member->orgOpenpsaObtype == org_openpsa_directmarketing_campaign_member_dba::UNSUBSCRIBED
177
+            if ($member->orgOpenpsaObtype == org_openpsa_directmarketing_campaign_member_dba::UNSUBSCRIBED
178 178
                 || $member->orgOpenpsaObtype == org_openpsa_directmarketing_campaign_member_dba::NORMAL) {
179 179
                 $this->_import_status['already_subscribed']++;
180 180
                 return;
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
 
215 215
             $qb = org_openpsa_contacts_group_dba::new_query_builder();
216 216
 
217
-            if (   array_key_exists('company_id', $this->_schemadbs['organization']['default']->fields)
217
+            if (array_key_exists('company_id', $this->_schemadbs['organization']['default']->fields)
218 218
                 && !empty($subscriber['organization']['company_id'])) {
219 219
                 // Imported data has a company id, we use that instead of name
220 220
                 $qb->add_constraint($this->_schemadbs['organization']['default']->fields['company_id']['storage']['location'], '=', $subscriber['organization']['company_id']);
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
                 // Seek by official name
223 223
                 $qb->add_constraint('official', '=', $subscriber['organization']['official']);
224 224
 
225
-                if (   array_key_exists('city', $this->_schemadbs['organization']['default']->fields)
225
+                if (array_key_exists('city', $this->_schemadbs['organization']['default']->fields)
226 226
                     && !empty($subscriber['organization']['city'])) {
227 227
                     // Imported data has a city, we use also that for matching
228 228
                     $qb->add_constraint($this->_schemadbs['organization']['default']->fields['city']['storage']['location'], '=', $subscriber['organization']['city']);
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -300,7 +300,8 @@
 block discarded – undo
300 300
                     $organization = $this->_import_subscribers_organization($subscriber);
301 301
                     $this->_import_subscribers_organization_member($subscriber, $person, $organization);
302 302
                 }
303
-            } catch (midcom_error $e) {
303
+            }
304
+            catch (midcom_error $e) {
304 305
                 $e->log();
305 306
                 // Clean up possibly created data
306 307
                 $this->_clean_new_objects();
Please login to merge, or discard this patch.
lib/org/openpsa/directmarketing/handler/campaign/rules.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -107,7 +107,8 @@
 block discarded – undo
107 107
         if (!empty($_POST['midcom_helper_datamanager2_save'])) {
108 108
             try {
109 109
                 $rules = $this->_load_rules();
110
-            } catch (midcom_error $e) {
110
+            }
111
+            catch (midcom_error $e) {
111 112
                 midcom::get()->uimessages->add('org.openpsa.directmarketing', $this->_l10n->get($e->getMessage()), 'error');
112 113
                 return;
113 114
             }
Please login to merge, or discard this patch.
lib/org/openpsa/expenses/handler/index.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -125,7 +125,7 @@
 block discarded – undo
125 125
             }
126 126
 
127 127
             $date_identifier = date('Y-m-d', $row['date']);
128
-            $row_identifier = $task->id . '-' .  $row['person'];
128
+            $row_identifier = $task->id . '-' . $row['person'];
129 129
 
130 130
             if (!isset($reports[$row_identifier])) {
131 131
                 try {
Please login to merge, or discard this patch.
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -32,7 +32,8 @@  discard block
 block discarded – undo
32 32
         }
33 33
         try {
34 34
             $date = new DateTime($requested_time);
35
-        } catch (Exception $e) {
35
+        }
36
+        catch (Exception $e) {
36 37
             return false;
37 38
         }
38 39
         $offset = $date->format('N') - 1;
@@ -119,7 +120,8 @@  discard block
 block discarded – undo
119 120
         foreach ($hours as $guid => $row) {
120 121
             try {
121 122
                 $task = org_openpsa_projects_task_dba::get_cached($row['task']);
122
-            } catch (midcom_error $e) {
123
+            }
124
+            catch (midcom_error $e) {
123 125
                 // Task couldn't be loaded, probably because of ACL
124 126
                 continue;
125 127
             }
@@ -132,7 +134,8 @@  discard block
 block discarded – undo
132 134
                     $person_object = org_openpsa_contacts_person_dba::get_cached($row['person']);
133 135
                     $person_label = $this->_get_list_link($person_object->name, null, null, $row['person']);
134 136
                     $person_name = $person_object->name;
135
-                } catch (midcom_error $e) {
137
+                }
138
+                catch (midcom_error $e) {
136 139
                     $person_label = $this->_l10n->get('no person');
137 140
                     $person_name = '';
138 141
                 }
Please login to merge, or discard this patch.
lib/org/openpsa/mail/backend/bouncer.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,8 @@
 block discarded – undo
23 23
         foreach ($this->_try_backends as $backend) {
24 24
             try {
25 25
                 $this->_backend = org_openpsa_mail_backend::get($backend, $params);
26
-            } catch (midcom_error $e) {
26
+            }
27
+            catch (midcom_error $e) {
27 28
                 debug_add('Failed to load backend ' . $backend . ', message:' . $e->getMessage());
28 29
             }
29 30
         }
Please login to merge, or discard this patch.
lib/org/openpsa/mail/backend.php 2 patches
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -42,7 +42,8 @@  discard block
 block discarded – undo
42 42
                     $object = self::_load_backend($backend, $params);
43 43
                     debug_add('Using backend ' . $backend);
44 44
                     return $object;
45
-                } catch (midcom_error $e) {
45
+                }
46
+                catch (midcom_error $e) {
46 47
                     debug_add('Failed to load backend ' . $backend . ', message:' . $e->getMessage());
47 48
                 }
48 49
             }
@@ -67,7 +68,8 @@  discard block
 block discarded – undo
67 68
             $ret = $this->mail($message);
68 69
             $this->error = false;
69 70
             return $ret;
70
-        } catch (Exception $e) {
71
+        }
72
+        catch (Exception $e) {
71 73
             $this->error = $e->getMessage();
72 74
             return false;
73 75
         }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -79,7 +79,7 @@
 block discarded – undo
79 79
             return false;
80 80
         }
81 81
 
82
-        if (   is_string($this->error)
82
+        if (is_string($this->error)
83 83
             && !empty($this->error)) {
84 84
             return $this->error;
85 85
         }
Please login to merge, or discard this patch.