Test Setup Failed
Pull Request — master (#190)
by
unknown
11:48 queued 03:14
created
lib/org/openpsa/sales/handler/list.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -113,7 +113,8 @@
 block discarded – undo
113 113
         try {
114 114
             $this->_request_data['customer'] = new org_openpsa_contacts_group_dba($guid);
115 115
             $qb->add_constraint('customer', '=', $this->_request_data['customer']->id);
116
-        } catch (midcom_error $e) {
116
+        }
117
+        catch (midcom_error $e) {
117 118
             $this->_request_data['customer'] = new org_openpsa_contacts_person_dba($guid);
118 119
             $qb->add_constraint('customerContact', '=', $this->_request_data['customer']->id);
119 120
         }
Please login to merge, or discard this patch.
lib/org/openpsa/contacts/midcom/indexer.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
  */
14 14
 class org_openpsa_contacts_midcom_indexer extends midcom_helper_datamanager2_indexer_client
15 15
 {
16
-    public function prepare_document(midcom_services_indexer_document &$document, midcom_helper_datamanager2_datamanager $dm)
16
+    public function prepare_document(midcom_services_indexer_document & $document, midcom_helper_datamanager2_datamanager $dm)
17 17
     {
18 18
         if (is_a($dm->storage->object, 'org_openpsa_contacts_person_dba')) {
19 19
             $document->title = $dm->storage->object->name;
Please login to merge, or discard this patch.
lib/org/openpsa/contacts/handler/person/view.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
         $invoices_url = $siteconfig->get_node_full_url('org.openpsa.invoices');
111 111
         $user_url = $siteconfig->get_node_full_url('org.openpsa.user');
112 112
 
113
-        if (   $invoices_url
113
+        if ($invoices_url
114 114
             && midcom::get()->auth->can_user_do('midgard:create', null, 'org_openpsa_invoices_invoice_dba')
115 115
             && $this->_contact->can_do('midgard:update')) {
116 116
             $buttons[] = $workflow->get_button($invoices_url . "billingdata/" . $this->_contact->guid . '/', array(
@@ -118,8 +118,8 @@  discard block
 block discarded – undo
118 118
             ));
119 119
         }
120 120
 
121
-        if (   $user_url
122
-            && (   midcom_connection::get_user() == $this->_contact->id
121
+        if ($user_url
122
+            && (midcom_connection::get_user() == $this->_contact->id
123 123
                 || midcom::get()->auth->can_user_do('org.openpsa.user:access', null, 'org_openpsa_user_interface'))) {
124 124
             $buttons[] = array(
125 125
                 MIDCOM_TOOLBAR_URL => $user_url . "view/{$this->_contact->guid}/",
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
      */
198 198
     public function _show_group_memberships($handler_id, array &$data)
199 199
     {
200
-        if (   count($data['organizations']) == 0
200
+        if (count($data['organizations']) == 0
201 201
             && count($data['groups']) == 0) {
202 202
             midcom_show_style('show-person-groups-empty');
203 203
         } else {
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -216,7 +216,8 @@
 block discarded – undo
216 216
         foreach ($this->_request_data[$identifier] as $member) {
217 217
             try {
218 218
                 $this->_request_data['group'] = org_openpsa_contacts_group_dba::get_cached($member->gid);
219
-            } catch (midcom_error $e) {
219
+            }
220
+            catch (midcom_error $e) {
220 221
                 $e->log();
221 222
                 continue;
222 223
             }
Please login to merge, or discard this patch.
lib/org/openpsa/contacts/handler/person/admin.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@
 block discarded – undo
59 59
     {
60 60
         $this->_load_schemadb();
61 61
         $this->_controller = midcom_helper_datamanager2_controller::create('simple');
62
-        $this->_controller->schemadb =& $this->_schemadb;
62
+        $this->_controller->schemadb = & $this->_schemadb;
63 63
         $this->_controller->set_storage($this->_contact, $this->_schema);
64 64
         if (!$this->_controller->initialize()) {
65 65
             throw new midcom_error("Failed to initialize a DM2 controller instance for contact {$this->_contact->id}.");
Please login to merge, or discard this patch.
lib/org/openpsa/contacts/handler/group/view.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
             );
59 59
         }
60 60
 
61
-        if (   midcom::get()->auth->can_user_do('midgard:create', null, 'org_openpsa_contacts_person_dba')
61
+        if (midcom::get()->auth->can_user_do('midgard:create', null, 'org_openpsa_contacts_person_dba')
62 62
             && $this->group->can_do('midgard:create')) {
63 63
             $buttons[] = $workflow->get_button("person/create/{$this->group->guid}/", array(
64 64
                 MIDCOM_TOOLBAR_LABEL => $this->_l10n->get('create person'),
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 
69 69
         $siteconfig = org_openpsa_core_siteconfig::get_instance();
70 70
         $user_url = $siteconfig->get_node_full_url('org.openpsa.user');
71
-        if (   $user_url
71
+        if ($user_url
72 72
             && midcom::get()->auth->can_user_do('org.openpsa.user:access', null, 'org_openpsa_user_interface')) {
73 73
             $buttons[] = array(
74 74
                 MIDCOM_TOOLBAR_URL => $user_url . "group/{$this->group->guid}/",
Please login to merge, or discard this patch.
lib/org/openpsa/reports/handler/base.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
     public function _handler_generator_get($handler_id, array $args, array &$data)
43 43
     {
44 44
         midcom::get()->auth->require_valid_user();
45
-        if (   !array_key_exists('org_openpsa_reports_query_data', $_REQUEST)
45
+        if (!array_key_exists('org_openpsa_reports_query_data', $_REQUEST)
46 46
             || !is_array($_REQUEST['org_openpsa_reports_query_data'])) {
47 47
             throw new midcom_error('query data not present or invalid');
48 48
         }
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
     private function _load_edit_controller()
90 90
     {
91 91
         $this->_controller = midcom_helper_datamanager2_controller::create('simple');
92
-        $this->_controller->schemadb =& $this->_schemadb;
92
+        $this->_controller->schemadb = & $this->_schemadb;
93 93
         $this->_controller->set_storage($this->_request_data['query'], 'default');
94 94
         if (!$this->_controller->initialize()) {
95 95
             throw new midcom_error("Failed to initialize a DM2 controller instance for document {$this->_document->id}.");
@@ -132,9 +132,9 @@  discard block
 block discarded – undo
132 132
     {
133 133
         $this->_load_schemadb();
134 134
         $this->_controller = midcom_helper_datamanager2_controller::create('create');
135
-        $this->_controller->schemadb =& $this->_schemadb;
135
+        $this->_controller->schemadb = & $this->_schemadb;
136 136
         $this->_controller->schemaname = 'default';
137
-        $this->_controller->callback_object =& $this;
137
+        $this->_controller->callback_object = & $this;
138 138
         if (!$this->_controller->initialize()) {
139 139
             throw new midcom_error("Failed to initialize a DM2 create controller.");
140 140
         }
@@ -172,9 +172,9 @@  discard block
 block discarded – undo
172 172
         $this->_request_data['datamanager'] = $this->_datamanagers[$this->module];
173 173
 
174 174
         if (isset($data['query'])) {
175
-            $breadcrumb_label =  sprintf($this->_l10n->get('edit report %s'), $data['query']->title);
175
+            $breadcrumb_label = sprintf($this->_l10n->get('edit report %s'), $data['query']->title);
176 176
         } else {
177
-            $breadcrumb_label =  $this->_l10n->get('define custom report');
177
+            $breadcrumb_label = $this->_l10n->get('define custom report');
178 178
         }
179 179
         $this->add_breadcrumb("", $breadcrumb_label);
180 180
     }
Please login to merge, or discard this patch.
lib/org/openpsa/reports/handler/sales/report.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -71,7 +71,8 @@
 block discarded – undo
71 71
             $owner = org_openpsa_contacts_person_dba::get_cached($salesproject->owner);
72 72
             $row['index_owner'] = $owner->name;
73 73
             $row['owner'] = org_openpsa_widgets_contact::get($owner->guid)->show_inline();
74
-        } catch (midcom_error $e) {
74
+        }
75
+        catch (midcom_error $e) {
75 76
             $e->log();
76 77
         }
77 78
         $row['amount'] = $object->pricePerUnit * $object->units;
Please login to merge, or discard this patch.
lib/org/openpsa/helpers/list.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -69,7 +69,8 @@
 block discarded – undo
69 69
         if (empty(self::$_seen[$company_id])) {
70 70
             try {
71 71
                 $company = new org_openpsa_contacts_group_dba($company_id);
72
-            } catch (midcom_error $e) {
72
+            }
73
+            catch (midcom_error $e) {
73 74
                 return;
74 75
             }
75 76
             self::$_seen[$company->id] = true;
Please login to merge, or discard this patch.
lib/org/openpsa/widgets/contact.php 2 patches
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -114,7 +114,8 @@  discard block
 block discarded – undo
114 114
 
115 115
         try {
116 116
             $person = org_openpsa_contacts_person_dba::get_cached($src);
117
-        } catch (midcom_error $e) {
117
+        }
118
+        catch (midcom_error $e) {
118 119
             $widget = new self();
119 120
             $cache[$src] = $widget;
120 121
             return $widget;
@@ -323,7 +324,8 @@  discard block
 block discarded – undo
323 324
         foreach ($memberships as $data) {
324 325
             try {
325 326
                 $group = org_openpsa_contacts_group_dba::get_cached($data['gid']);
326
-            } catch (midcom_error $e) {
327
+            }
328
+            catch (midcom_error $e) {
327 329
                 $e->log();
328 330
                 continue;
329 331
             }
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
      */
133 133
     private function read_object($person)
134 134
     {
135
-        if (   !is_object($person)
135
+        if (!is_object($person)
136 136
             || !midcom::get()->dbfactory->is_a($person, 'midcom_db_person')) {
137 137
             // Given $person is not one
138 138
             return false;
@@ -156,12 +156,12 @@  discard block
 block discarded – undo
156 156
             }
157 157
         }
158 158
 
159
-        if (   $this->_config->get('jabber_enable_presence')
159
+        if ($this->_config->get('jabber_enable_presence')
160 160
             && $person->get_parameter('org.openpsa.jabber', 'jid')) {
161 161
             $this->contact_details['jid'] = $person->get_parameter('org.openpsa.jabber', 'jid');
162 162
         }
163 163
 
164
-        if (   $this->_config->get('skype_enable_presence')
164
+        if ($this->_config->get('skype_enable_presence')
165 165
             && $person->get_parameter('org.openpsa.skype', 'name')) {
166 166
             $this->contact_details['skype'] = $person->get_parameter('org.openpsa.skype', 'name');
167 167
         }
@@ -236,7 +236,7 @@  discard block
 block discarded – undo
236 236
 
237 237
         // Show picture
238 238
         // TODO: Implement photo also in local way
239
-        if (   $this->_config->get('gravatar_enable')
239
+        if ($this->_config->get('gravatar_enable')
240 240
             && !empty($this->contact_details['email'])) {
241 241
             $size = $this->_config->get('gravatar_size');
242 242
             $gravatar_url = "http://www.gravatar.com/avatar.php?gravatar_id=" . md5($this->contact_details['email']) . "&size=" . $size;
@@ -310,7 +310,7 @@  discard block
 block discarded – undo
310 310
 
311 311
     private function _show_groups()
312 312
     {
313
-        if (   !$this->show_groups
313
+        if (!$this->show_groups
314 314
             || empty($this->contact_details['id'])) {
315 315
             return;
316 316
         }
@@ -376,7 +376,7 @@  discard block
 block discarded – undo
376 376
                     $cards_to_show[] = $cardname;
377 377
                 }
378 378
             } else {
379
-                if (    $customer->$property
379
+                if ($customer->$property
380 380
                     || ($customer->street && !$inherited_cards_only && !$default_shown)) {
381 381
                     $inherited_cards_only = false;
382 382
                     $multiple_addresses = true;
@@ -398,8 +398,8 @@  discard block
 block discarded – undo
398 398
 
399 399
         foreach ($cards_to_show as $cardname) {
400 400
             echo '<div class="vcard">';
401
-            if (   $multiple_addresses
402
-                || (   $cardname != 'visiting'
401
+            if ($multiple_addresses
402
+                || ($cardname != 'visiting'
403 403
                     && !$inherited_cards_only)) {
404 404
                 echo '<div style="text-align:center"><em>' . midcom::get()->i18n->get_string($cardname . ' address', 'org.openpsa.contacts') . "</em></div>\n";
405 405
             }
Please login to merge, or discard this patch.