@@ -23,7 +23,7 @@ |
||
23 | 23 | <th><?php echo $data['l10n']->get('type'); ?></th> |
24 | 24 | <?php |
25 | 25 | } ?> |
26 | -<?php if ( array_key_exists('invoiceable_filter', $query_data)) { |
|
26 | +<?php if (array_key_exists('invoiceable_filter', $query_data)) { |
|
27 | 27 | ?> |
28 | 28 | <th><?php echo midcom::get()->i18n->get_string('invoiceable', 'org.openpsa.projects'); ?></th> |
29 | 29 | <?php |
@@ -40,7 +40,7 @@ |
||
40 | 40 | $at_entries = $mc->get_related_objects(); |
41 | 41 | |
42 | 42 | if (empty($at_entries)) { |
43 | - if ( ( $this->_deliverable->continuous |
|
43 | + if (($this->_deliverable->continuous |
|
44 | 44 | || $this->_deliverable->end > time()) |
45 | 45 | && $this->_deliverable->state == org_openpsa_sales_salesproject_deliverable_dba::STATE_STARTED) { |
46 | 46 | $schema->get_field('next_cycle')['hidden'] = false; |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | |
44 | 44 | public function __construct($identifier = null) |
45 | 45 | { |
46 | - if ( midcom::get()->config->get('person_class') != 'midgard_person' |
|
46 | + if (midcom::get()->config->get('person_class') != 'midgard_person' |
|
47 | 47 | && midcom::get()->config->get('person_class') != 'openpsa_person') { |
48 | 48 | $this->__mgdschema_class_name__ = midcom::get()->config->get('person_class'); |
49 | 49 | } |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | |
53 | 53 | public function __set($name, $value) |
54 | 54 | { |
55 | - if ( $name == 'homepage' |
|
55 | + if ($name == 'homepage' |
|
56 | 56 | && !empty($value) |
57 | 57 | && $value != $this->homepage) { |
58 | 58 | $this->_register_prober = true; |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | |
46 | 46 | $this->_object = $object; |
47 | 47 | $this->get_object_path(); |
48 | - $this->_request_data =& $request_data; |
|
48 | + $this->_request_data = & $request_data; |
|
49 | 49 | |
50 | 50 | $this->root_types = midcom_helper_reflector_tree::get_root_classes(); |
51 | 51 | |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | // we go through the path bottom up and show the first root type we find |
60 | 60 | foreach (array_reverse($this->_object_path) as $node) { |
61 | 61 | foreach ($this->root_types as $root_type) { |
62 | - if ( is_a($node, $root_type) |
|
62 | + if (is_a($node, $root_type) |
|
63 | 63 | || midcom_helper_reflector::is_same_class($root_type, $node->__midcom_class_name__)) { |
64 | 64 | $this->expanded_root_types[] = $root_type; |
65 | 65 | break; |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | |
100 | 100 | protected function _is_collapsed($type, $total) |
101 | 101 | { |
102 | - return ( $total > $this->_config->get('max_navigation_entries') |
|
102 | + return ($total > $this->_config->get('max_navigation_entries') |
|
103 | 103 | && empty($_GET['show_all_' . $type])); |
104 | 104 | } |
105 | 105 | |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | foreach ($ref->get_child_classes() as $class) { |
116 | 116 | $qb = $ref->_child_objects_type_qb($class, $object, false); |
117 | 117 | |
118 | - if ( !$qb |
|
118 | + if (!$qb |
|
119 | 119 | || !($count = $qb->count_unchecked())) { |
120 | 120 | continue; |
121 | 121 | } |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | { |
164 | 164 | $qb = $ref->_root_objects_qb(false); |
165 | 165 | |
166 | - if ( !$qb |
|
166 | + if (!$qb |
|
167 | 167 | || !($total = $qb->count_unchecked())) { |
168 | 168 | return; |
169 | 169 | } |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | { |
199 | 199 | $ref = midcom_helper_reflector::get($type); |
200 | 200 | if (!empty($this->_object_path[$level])) { |
201 | - if ( $this->_object_path[$level]->__mgdschema_class_name__ == $type |
|
201 | + if ($this->_object_path[$level]->__mgdschema_class_name__ == $type |
|
202 | 202 | && !array_key_exists($this->_object_path[$level]->guid, $this->shown_objects)) { |
203 | 203 | $label = htmlspecialchars($ref->get_object_label($this->_object_path[$level])); |
204 | 204 | $this->_draw_element($this->_object_path[$level], $label, $level); |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | $label = html_entity_decode($label); |
234 | 234 | |
235 | 235 | echo "<a href=\"" . midcom_connection::get_url('self') . "__mfa/asgard/object/{$mode}/{$object->guid}/\" title=\"GUID: {$object->guid}, ID: {$object->id}\">{$icon}{$label}</a>\n"; |
236 | - if ( $selected |
|
236 | + if ($selected |
|
237 | 237 | || $autoexpand) { |
238 | 238 | $this->_list_child_elements($object, $level + 1); |
239 | 239 | } |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | continue; |
254 | 254 | } |
255 | 255 | |
256 | - if ( method_exists($class, 'navigation') |
|
256 | + if (method_exists($class, 'navigation') |
|
257 | 257 | && ($this->_request_data['plugin_name'] == "asgard_{$component}")) { |
258 | 258 | $this->_request_data['expanded'] = true; |
259 | 259 | midcom_show_style('midgard_admin_asgard_navigation_section_header'); |
@@ -287,13 +287,13 @@ discard block |
||
287 | 287 | if ($this->_is_selected($object)) { |
288 | 288 | $css_class .= ' selected'; |
289 | 289 | } |
290 | - if ( is_object($this->_object) |
|
291 | - && ( $object->guid == $this->_object->guid |
|
292 | - || ( is_a($this->_object, midcom_db_parameter::class) |
|
290 | + if (is_object($this->_object) |
|
291 | + && ($object->guid == $this->_object->guid |
|
292 | + || (is_a($this->_object, midcom_db_parameter::class) |
|
293 | 293 | && $object->guid == $this->_object->parentguid))) { |
294 | 294 | $css_class .= ' current'; |
295 | 295 | } |
296 | - if ( !$object->can_do('midgard:update')) { |
|
296 | + if (!$object->can_do('midgard:update')) { |
|
297 | 297 | $css_class .= ' readonly'; |
298 | 298 | } |
299 | 299 | } |
@@ -309,7 +309,7 @@ discard block |
||
309 | 309 | $types = []; |
310 | 310 | |
311 | 311 | // Get the types that might have special display conditions |
312 | - if ( $this->_config->get('midgard_types') |
|
312 | + if ($this->_config->get('midgard_types') |
|
313 | 313 | && preg_match_all('/\|([a-z0-9\.\-_]+)/', $this->_config->get('midgard_types'), $regs)) { |
314 | 314 | $types = $regs[1]; |
315 | 315 | } |
@@ -317,7 +317,7 @@ discard block |
||
317 | 317 | // Override with user selected |
318 | 318 | // @TODO: Should this just include to the configuration selection, although it would break the consistency |
319 | 319 | // of other similar preference sets, which simply override the global settings? |
320 | - if ( midgard_admin_asgard_plugin::get_preference('midgard_types') |
|
320 | + if (midgard_admin_asgard_plugin::get_preference('midgard_types') |
|
321 | 321 | && preg_match_all('/\|([a-z0-9\.\-_]+)/', midgard_admin_asgard_plugin::get_preference('midgard_types'), $regs)) { |
322 | 322 | $types = $regs[1]; |
323 | 323 | } |
@@ -349,7 +349,7 @@ discard block |
||
349 | 349 | $label_mapping = []; |
350 | 350 | foreach ($types as $root_type) { |
351 | 351 | // If the regular expression has been set, check which types should be shown |
352 | - if ( $regexp !== '//' |
|
352 | + if ($regexp !== '//' |
|
353 | 353 | && (boolean) preg_match($regexp, $root_type) == $exclude) { |
354 | 354 | continue; |
355 | 355 | } |
@@ -384,7 +384,7 @@ discard block |
||
384 | 384 | * click if nothing is expanded |
385 | 385 | */ |
386 | 386 | $types_shown = false; |
387 | - if ( !empty($expanded_types) |
|
387 | + if (!empty($expanded_types) |
|
388 | 388 | && midgard_admin_asgard_plugin::get_preference('navigation_type') === 'dropdown') { |
389 | 389 | $this->_draw_select_navigation(); |
390 | 390 | $types_shown = true; |
@@ -423,7 +423,7 @@ discard block |
||
423 | 423 | echo " <li class=\"mgdschema-type\">"; |
424 | 424 | |
425 | 425 | $dbaclass = midcom::get()->dbclassloader->get_midcom_class_name_for_mgdschema_object($type); |
426 | - if ( $dbaclass |
|
426 | + if ($dbaclass |
|
427 | 427 | && class_exists($dbaclass)) { |
428 | 428 | $object = new $dbaclass; |
429 | 429 | } else { |
@@ -278,7 +278,7 @@ discard block |
||
278 | 278 | } |
279 | 279 | |
280 | 280 | // Override requested root object properties |
281 | - if ( !empty($this->target->guid) |
|
281 | + if (!empty($this->target->guid) |
|
282 | 282 | && $target->guid === $this->target->guid) { |
283 | 283 | foreach ($this->root_object_values as $name => $value) { |
284 | 284 | $target->$name = $value; |
@@ -320,7 +320,7 @@ discard block |
||
320 | 320 | return false; |
321 | 321 | } |
322 | 322 | |
323 | - if ( !$this->_copy_data('parameters', $source, $target) |
|
323 | + if (!$this->_copy_data('parameters', $source, $target) |
|
324 | 324 | || !$this->_copy_data('metadata', $source, $target) |
325 | 325 | || !$this->_copy_data('attachments', $source, $target) |
326 | 326 | || !$this->_copy_data('privileges', $source, $target)) { |
@@ -342,7 +342,7 @@ discard block |
||
342 | 342 | { |
343 | 343 | if ($this->$type) { |
344 | 344 | $method = 'copy_' . $type; |
345 | - if ( !$this->$method($source, $target) |
|
345 | + if (!$this->$method($source, $target) |
|
346 | 346 | && $this->halt_on_errors) { |
347 | 347 | $this->errors[] = $this->_l10n->get('failed to copy ' . $type); |
348 | 348 | return false; |
@@ -88,7 +88,7 @@ |
||
88 | 88 | ]) |
89 | 89 | ->setRequired('object') |
90 | 90 | ->setAllowedTypes('object', midcom_core_dbaobject::class) |
91 | - ->setNormalizer('label', function ($options, $value) { |
|
91 | + ->setNormalizer('label', function($options, $value) { |
|
92 | 92 | if ($value === null) { |
93 | 93 | return midcom_helper_reflector::get_object_title($options['object']); |
94 | 94 | } |
@@ -36,7 +36,7 @@ |
||
36 | 36 | } |
37 | 37 | $result = []; |
38 | 38 | |
39 | - if ( !empty($array['file']) |
|
39 | + if (!empty($array['file']) |
|
40 | 40 | || !empty($array['identifier']) && substr($array['identifier'], 0, 8) === 'tmpfile-') { |
41 | 41 | $result['file'] = parent::reverseTransform($array); |
42 | 42 | } elseif (!empty($array['objects'])) { |
@@ -30,7 +30,7 @@ |
||
30 | 30 | return null; |
31 | 31 | } |
32 | 32 | |
33 | - if (! $input instanceof midcom_db_attachment) { |
|
33 | + if (!$input instanceof midcom_db_attachment) { |
|
34 | 34 | throw new UnexpectedTypeException($input, midcom_db_attachment::class); |
35 | 35 | } |
36 | 36 |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | 'customdata' => [] |
161 | 161 | ], $config)); |
162 | 162 | |
163 | - $normalize_widget = function (Options $options, $value) { |
|
163 | + $normalize_widget = function(Options $options, $value) { |
|
164 | 164 | if ($value == 'text') { |
165 | 165 | if (!empty($options['widget_config']['hideinput'])) { |
166 | 166 | return PasswordType::class; |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | return $value; |
186 | 186 | }; |
187 | 187 | |
188 | - $normalize_storage = function (Options $options, $value) use ($name) { |
|
188 | + $normalize_storage = function(Options $options, $value) use ($name) { |
|
189 | 189 | $default = [ |
190 | 190 | 'location' => 'parameter', |
191 | 191 | 'domain' => 'midcom.helper.datamanager2', |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | return $value; |
228 | 228 | }; |
229 | 229 | |
230 | - $normalize_validation = function (Options $options, $value) { |
|
230 | + $normalize_validation = function(Options $options, $value) { |
|
231 | 231 | $validation = []; |
232 | 232 | |
233 | 233 | foreach ((array) $value as $key => $rule) { |
@@ -239,7 +239,7 @@ discard block |
||
239 | 239 | $rule = ['type' => $rule]; |
240 | 240 | } elseif (!array_key_exists('type', $rule)) { |
241 | 241 | throw new midcom_error("Missing validation rule type for rule {$key} on field {$options['name']}, this is a required option."); |
242 | - } elseif ( $rule['type'] == 'compare' |
|
242 | + } elseif ($rule['type'] == 'compare' |
|
243 | 243 | && !array_key_exists('compare_with', $rule)) { |
244 | 244 | throw new midcom_error("Missing compare_with option for compare type rule {$key} on field {$options['name']}, this is a required option."); |
245 | 245 | } |