@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | return; |
75 | 75 | } |
76 | 76 | $parent = $this->get_parent(); |
77 | - if ( $parent |
|
77 | + if ($parent |
|
78 | 78 | && $parent->component == 'org.openpsa.documents') { |
79 | 79 | midcom::get()->auth->request_sudo('org.openpsa.documents'); |
80 | 80 | |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | * if nothing matched so far and the subtype is alphanumeric, uppercase it on the theory |
171 | 171 | * that it's probably a file extension |
172 | 172 | */ |
173 | - if ( $st_orig == $subtype |
|
173 | + if ($st_orig == $subtype |
|
174 | 174 | && preg_match('/^[a-z0-9]+$/', $subtype)) { |
175 | 175 | $subtype = strtoupper($subtype); |
176 | 176 | } |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | $properties = $this->get_properties(); |
186 | 186 | // Copy current properties |
187 | 187 | foreach ($properties as $key) { |
188 | - if ( $key != 'guid' |
|
188 | + if ($key != 'guid' |
|
189 | 189 | && $key != 'id' |
190 | 190 | && $key != 'metadata') { |
191 | 191 | $backup->$key = $this->{$key}; |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | $backup_attachment = $backup->create_attachment($original_attachment->name, $original_attachment->title, $original_attachment->mimetype); |
218 | 218 | |
219 | 219 | $original_handle = $original_attachment->open('r'); |
220 | - if ( !$backup_attachment |
|
220 | + if (!$backup_attachment |
|
221 | 221 | || !$original_handle) { |
222 | 222 | // Failed to copy the attachment, abort |
223 | 223 | return $backup->delete(); |
@@ -93,8 +93,8 @@ |
||
93 | 93 | |
94 | 94 | private function prepare_url($url) |
95 | 95 | { |
96 | - if ( substr($url, 0, 1) != '/' |
|
97 | - && ! preg_match('|^https?://|', $url)) { |
|
96 | + if (substr($url, 0, 1) != '/' |
|
97 | + && !preg_match('|^https?://|', $url)) { |
|
98 | 98 | $url = midcom_core_context::get()->get_key(MIDCOM_CONTEXT_ANCHORPREFIX) . $url; |
99 | 99 | } |
100 | 100 | return '"' . $url . '"'; |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | $this->_salesproject->require_do('midgard:update'); |
35 | 35 | |
36 | 36 | $schemadb = schemadb::from_path($this->_config->get('schemadb_salesproject')); |
37 | - $field =& $schemadb->get('default')->get_field('customer'); |
|
37 | + $field = & $schemadb->get('default')->get_field('customer'); |
|
38 | 38 | $field['type_config']['options'] = org_openpsa_helpers_list::task_groups($this->_salesproject); |
39 | 39 | $dm = new datamanager($schemadb); |
40 | 40 | $dm->set_storage($this->_salesproject); |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | $schemadb = schemadb::from_path($this->_config->get('schemadb_salesproject')); |
64 | 64 | |
65 | 65 | if (!empty($args[0])) { |
66 | - $field =& $schemadb->get('default')->get_field('customer'); |
|
66 | + $field = & $schemadb->get('default')->get_field('customer'); |
|
67 | 67 | try { |
68 | 68 | $customer = new org_openpsa_contacts_group_dba($args[0]); |
69 | 69 | $field['type_config']['options'] = [0 => '', $customer->id => $customer->official]; |
@@ -69,7 +69,8 @@ |
||
69 | 69 | $field['type_config']['options'] = [0 => '', $customer->id => $customer->official]; |
70 | 70 | |
71 | 71 | $defaults['customer'] = $customer->id; |
72 | - } catch (midcom_error $e) { |
|
72 | + } |
|
73 | + catch (midcom_error $e) { |
|
73 | 74 | $customer = new org_openpsa_contacts_person_dba($args[0]); |
74 | 75 | $defaults['customerContact'] = $customer->id; |
75 | 76 | $field['type_config']['options'] = org_openpsa_helpers_list::task_groups(new org_openpsa_sales_salesproject_dba, 'id', [$customer->id => true]); |
@@ -38,7 +38,7 @@ |
||
38 | 38 | $at_entries = $mc->get_related_objects(); |
39 | 39 | |
40 | 40 | if (sizeof($at_entries) != 1) { |
41 | - if ( ( $this->_deliverable->continuous |
|
41 | + if (($this->_deliverable->continuous |
|
42 | 42 | || $this->_deliverable->end > time()) |
43 | 43 | && $this->_deliverable->state == org_openpsa_sales_salesproject_deliverable_dba::STATE_STARTED) { |
44 | 44 | $schema->get_field('next_cycle')['hidden'] = false; |
@@ -48,13 +48,13 @@ discard block |
||
48 | 48 | |
49 | 49 | if ($this->_product->delivery == org_openpsa_products_product_dba::DELIVERY_SUBSCRIPTION) { |
50 | 50 | $schema = 'subscription'; |
51 | - $field =& $schemadb->get('subscription')->get_field('start'); |
|
51 | + $field = & $schemadb->get('subscription')->get_field('start'); |
|
52 | 52 | $field['type_config']['min_date'] = strftime('%Y-%m-%d'); |
53 | 53 | } else { |
54 | - $end =& $schemadb->get('default')->get_field('end'); |
|
54 | + $end = & $schemadb->get('default')->get_field('end'); |
|
55 | 55 | $end['type_config']['min_date'] = strftime('%Y-%m-%d'); |
56 | 56 | if ($this->_product->costType == "%") { |
57 | - $costPerUnit =& $schemadb->get('default')->get_field('costPerUnit'); |
|
57 | + $costPerUnit = & $schemadb->get('default')->get_field('costPerUnit'); |
|
58 | 58 | $costPerUnit['title'] = $this->_l10n->get("cost per unit (percentage)"); |
59 | 59 | } |
60 | 60 | } |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | */ |
94 | 94 | public function _handler_add($handler_id, array $args, array &$data) |
95 | 95 | { |
96 | - if ( !array_key_exists('product', $_POST) |
|
96 | + if (!array_key_exists('product', $_POST) |
|
97 | 97 | && !array_key_exists('org_openpsa_sales', $_POST)) { |
98 | 98 | throw new midcom_error('No product specified, aborting.'); |
99 | 99 | } |
@@ -30,8 +30,8 @@ discard block |
||
30 | 30 | private function load_controller(org_openpsa_invoices_billing_data_dba $bd) |
31 | 31 | { |
32 | 32 | $schemadb = schemadb::from_path($this->_config->get('schemadb_billing_data')); |
33 | - $vat =& $schemadb->get('default')->get_field('vat'); |
|
34 | - $due =& $schemadb->get('default')->get_field('due'); |
|
33 | + $vat = & $schemadb->get('default')->get_field('vat'); |
|
34 | + $due = & $schemadb->get('default')->get_field('due'); |
|
35 | 35 | // Fill VAT select |
36 | 36 | $vat_array = explode(',', $this->_config->get('vat_percentages')); |
37 | 37 | if (!empty($vat_array)) { |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | $data['controller'] = $this->load_controller($bd); |
75 | 75 | |
76 | 76 | $workflow = $this->get_workflow('datamanager', ['controller' => $data['controller']]); |
77 | - if ( $mode == 'edit' |
|
77 | + if ($mode == 'edit' |
|
78 | 78 | && $bd->can_do('midgard:delete')) { |
79 | 79 | $delete = $this->get_workflow('delete', [ |
80 | 80 | 'object' => $bd, |
@@ -82,7 +82,7 @@ |
||
82 | 82 | } |
83 | 83 | |
84 | 84 | // OPML subscription list import support |
85 | - if ( array_key_exists('net_nemein_rss_manage_opml', $_FILES) |
|
85 | + if (array_key_exists('net_nemein_rss_manage_opml', $_FILES) |
|
86 | 86 | && is_uploaded_file($_FILES['net_nemein_rss_manage_opml']['tmp_name'])) { |
87 | 87 | $opml_file = $_FILES['net_nemein_rss_manage_opml']['tmp_name']; |
88 | 88 |
@@ -210,8 +210,7 @@ |
||
210 | 210 | { |
211 | 211 | $ret = []; |
212 | 212 | |
213 | - foreach ($this->storage as $field => $value) |
|
214 | - { |
|
213 | + foreach ($this->storage as $field => $value) { |
|
215 | 214 | $ret[$field] = $value->get_value(); |
216 | 215 | $config = $this->schema->get_field($field); |
217 | 216 | if (!empty($config['type_config']['allow_multiple'])) { |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | */ |
129 | 129 | public function set_storage(midcom_core_dbaobject $storage = null, $schema = null) |
130 | 130 | { |
131 | - if ( $schema === null |
|
131 | + if ($schema === null |
|
132 | 132 | && !empty($storage->id)) { |
133 | 133 | $schema = $storage->get_parameter('midcom.helper.datamanager2', 'schema_name'); |
134 | 134 | } |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | $name = 'midcom_helper_datamanager2'; |
216 | 216 | } |
217 | 217 | |
218 | - if ( $this->form === null |
|
218 | + if ($this->form === null |
|
219 | 219 | || $this->form->getName() != $name) { |
220 | 220 | $this->get_storage(); |
221 | 221 | $this->form = $this->schema->build_form(self::get_factory(), $this->storage, $name); |
@@ -287,7 +287,7 @@ discard block |
||
287 | 287 | { |
288 | 288 | $ret = true; |
289 | 289 | foreach ($this->storage as $field) { |
290 | - if ( $field instanceof recreateable |
|
290 | + if ($field instanceof recreateable |
|
291 | 291 | && !$field->recreate()) { |
292 | 292 | $ret = false; |
293 | 293 | } |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | |
42 | 42 | public function transform($input) |
43 | 43 | { |
44 | - if ( $input === false |
|
44 | + if ($input === false |
|
45 | 45 | || $input === null) { |
46 | 46 | return []; |
47 | 47 | } |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | |
75 | 75 | public function reverseTransform($array) |
76 | 76 | { |
77 | - if (!is_array($array) ) { |
|
77 | + if (!is_array($array)) { |
|
78 | 78 | throw new TransformationFailedException('Expected an array.'); |
79 | 79 | } |
80 | 80 |