@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | return new midcom_response_relocate($this->router->generate('task_view', ['guid' => $guid])); |
65 | 65 | } |
66 | 66 | |
67 | - if ( $request->request->has('save') |
|
67 | + if ($request->request->has('save') |
|
68 | 68 | && $prospects = $request->request->get('org_openpsa_projects_prospects')) { |
69 | 69 | $qb = org_openpsa_projects_task_resource_dba::new_query_builder(); |
70 | 70 | $qb->add_constraint('guid', 'IN', array_keys($prospects)); |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | // create relatedto |
96 | 96 | org_openpsa_relatedto_plugin::create($event, 'org.openpsa.calendar', $this->_task, 'org.openpsa.projects'); |
97 | 97 | } |
98 | - if ( $update_prospect |
|
98 | + if ($update_prospect |
|
99 | 99 | && !$prospect->update()) { |
100 | 100 | debug_add('Failed to update prospect: ' . midcom_connection::get_error_string(), MIDCOM_LOG_ERROR); |
101 | 101 | } |
@@ -36,7 +36,8 @@ discard block |
||
36 | 36 | // Add person to campaign |
37 | 37 | try { |
38 | 38 | $campaign = new org_openpsa_directmarketing_campaign_dba($add_to); |
39 | - } catch (midcom_error $e) { |
|
39 | + } |
|
40 | + catch (midcom_error $e) { |
|
40 | 41 | // FIXME: More informative error message |
41 | 42 | $this->notify('Failed adding person %s to campaign %s', $add_to, 'error'); |
42 | 43 | return; |
@@ -86,7 +87,8 @@ discard block |
||
86 | 87 | try { |
87 | 88 | $campaigns[$membership->campaign] = new org_openpsa_directmarketing_campaign_dba($membership->campaign); |
88 | 89 | $campaign_membership_map[$membership->campaign] = $membership; |
89 | - } catch (midcom_error $e) { |
|
90 | + } |
|
91 | + catch (midcom_error $e) { |
|
90 | 92 | debug_add('Failed to load campaign ' . $membership->campaign . ', reason: ' . $e->getMessage()); |
91 | 93 | } |
92 | 94 | } |
@@ -105,7 +105,8 @@ |
||
105 | 105 | if ($request->request->has('midcom_helper_datamanager2_save')) { |
106 | 106 | try { |
107 | 107 | $rules = $this->_load_rules(); |
108 | - } catch (midcom_error $e) { |
|
108 | + } |
|
109 | + catch (midcom_error $e) { |
|
109 | 110 | midcom::get()->uimessages->add('org.openpsa.directmarketing', $this->_l10n->get($e->getMessage()), 'error'); |
110 | 111 | return; |
111 | 112 | } |
@@ -89,7 +89,8 @@ |
||
89 | 89 | } elseif ((int) $group > 0) { |
90 | 90 | try { |
91 | 91 | $this->parent = new org_openpsa_products_product_group_dba((int) $group); |
92 | - } catch (midcom_error $e) { |
|
92 | + } |
|
93 | + catch (midcom_error $e) { |
|
93 | 94 | $e->log(); |
94 | 95 | } |
95 | 96 | } |
@@ -29,7 +29,8 @@ |
||
29 | 29 | $member->require_do('midgard:update'); |
30 | 30 | $member->extra = $request->request->get('title'); |
31 | 31 | $response->status = $member->update(); |
32 | - } catch (midcom_error $e) { |
|
32 | + } |
|
33 | + catch (midcom_error $e) { |
|
33 | 34 | $e->log(); |
34 | 35 | } |
35 | 36 | $response->message = midcom_connection::get_error_string(); |
@@ -44,7 +44,7 @@ |
||
44 | 44 | if ($query->has('start')) { |
45 | 45 | $defaults['start'] = strtotime($query->get('start')); |
46 | 46 | if ($query->has('end')) { |
47 | - $defaults['end']= strtotime($query->get('end')); |
|
47 | + $defaults['end'] = strtotime($query->get('end')); |
|
48 | 48 | } else { |
49 | 49 | $defaults['end'] = $defaults['start'] + 3600; |
50 | 50 | } |
@@ -96,13 +96,13 @@ discard block |
||
96 | 96 | } |
97 | 97 | |
98 | 98 | $mimetype = $request->request->get('midgard_admin_asgard_mimetype'); |
99 | - if ( !empty($mimetype) |
|
99 | + if (!empty($mimetype) |
|
100 | 100 | && $local_file->mimetype != $mimetype) { |
101 | 101 | $local_file->mimetype = $mimetype; |
102 | 102 | $needs_update = true; |
103 | 103 | } |
104 | 104 | |
105 | - if ( $needs_update |
|
105 | + if ($needs_update |
|
106 | 106 | && !$local_file->update()) { |
107 | 107 | return false; |
108 | 108 | } |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | $this->bind_view_to_object($this->_file); |
244 | 244 | |
245 | 245 | $filename = $this->_process_form($request); |
246 | - if ( $filename |
|
246 | + if ($filename |
|
247 | 247 | && $filename != $data['filename']) { |
248 | 248 | return $this->relocate_to_file($filename); |
249 | 249 | } |
@@ -58,7 +58,7 @@ |
||
58 | 58 | midcom::get()->uimessages->add($this->_l10n->get('midgard.admin.user'), $this->_l10n_midcom->get('updated')); |
59 | 59 | return new midcom_response_relocate($this->router->generate('group_edit', ['guid' => $guid])); |
60 | 60 | } |
61 | - debug_add('Failed to update the group, last error was '. midcom_connection::get_error_string(), MIDCOM_LOG_ERROR); |
|
61 | + debug_add('Failed to update the group, last error was ' . midcom_connection::get_error_string(), MIDCOM_LOG_ERROR); |
|
62 | 62 | debug_print_r('We operated on this object', $data['group'], MIDCOM_LOG_ERROR); |
63 | 63 | |
64 | 64 | throw new midcom_error('Failed to update the group, see error level log for details'); |
@@ -348,7 +348,8 @@ |
||
348 | 348 | $result = $this->router->match($url); |
349 | 349 | $this->_prepare_handler($result); |
350 | 350 | return $this->_handler; |
351 | - } catch (ResourceNotFoundException $e) { |
|
351 | + } |
|
352 | + catch (ResourceNotFoundException $e) { |
|
352 | 353 | // No match |
353 | 354 | return false; |
354 | 355 | } |
@@ -328,7 +328,7 @@ discard block |
||
328 | 328 | $prefix = midcom_core_context::get()->get_key(MIDCOM_CONTEXT_ANCHORPREFIX); |
329 | 329 | |
330 | 330 | // Check if we need to start up a plugin. |
331 | - if ( count($argv) > 1 |
|
331 | + if (count($argv) > 1 |
|
332 | 332 | && array_key_exists($argv[0], self::$_plugin_namespace_config) |
333 | 333 | && array_key_exists($argv[1], self::$_plugin_namespace_config[$argv[0]])) { |
334 | 334 | $namespace = array_shift($argv); |
@@ -375,7 +375,7 @@ discard block |
||
375 | 375 | */ |
376 | 376 | private function _prepare_handler(array $request) |
377 | 377 | { |
378 | - $this->_handler =& $request; |
|
378 | + $this->_handler = & $request; |
|
379 | 379 | $args = []; |
380 | 380 | foreach ($request as $name => $value) { |
381 | 381 | if (substr($name, 0, 1) !== '_') { |