@@ -25,7 +25,7 @@ |
||
| 25 | 25 | { |
| 26 | 26 | // workaround for weird mgd API behavior where setting empty (i.e. deleting) a |
| 27 | 27 | // nonexistent parameter returns false |
| 28 | - if ( ($this->value === false || $this->value === null || $this->value === "") |
|
| 28 | + if (($this->value === false || $this->value === null || $this->value === "") |
|
| 29 | 29 | && $this->load() === null) { |
| 30 | 30 | return true; |
| 31 | 31 | } |
@@ -72,7 +72,7 @@ |
||
| 72 | 72 | |
| 73 | 73 | $this->_group = new org_openpsa_contacts_group_dba(); |
| 74 | 74 | |
| 75 | - if ( $this->_type == 'organization' |
|
| 75 | + if ($this->_type == 'organization' |
|
| 76 | 76 | && $this->_parent_group) { |
| 77 | 77 | $this->_group->owner = $this->_parent_group->id; |
| 78 | 78 | } else { |
@@ -50,6 +50,6 @@ |
||
| 50 | 50 | $indexer = new org_openpsa_documents_midcom_indexer($this->_topic); |
| 51 | 51 | $indexer->index($controller->get_datamanager()); |
| 52 | 52 | |
| 53 | - return $controller->get_datamanager()->get_storage()->get_value()->name. "/"; |
|
| 53 | + return $controller->get_datamanager()->get_storage()->get_value()->name . "/"; |
|
| 54 | 54 | } |
| 55 | 55 | } |
@@ -130,13 +130,13 @@ |
||
| 130 | 130 | */ |
| 131 | 131 | private function modify_schema(schema $schema) |
| 132 | 132 | { |
| 133 | - $vat_field =& $schema->get_field('vat'); |
|
| 134 | - $pdf_field =& $schema->get_field('pdf_file'); |
|
| 135 | - $due_field =& $schema->get_field('due'); |
|
| 136 | - $sent_field =& $schema->get_field('sent'); |
|
| 137 | - $paid_field =& $schema->get_field('paid'); |
|
| 138 | - $customer_field =& $schema->get_field('customer'); |
|
| 139 | - $contact_field =& $schema->get_field('customerContact'); |
|
| 133 | + $vat_field = & $schema->get_field('vat'); |
|
| 134 | + $pdf_field = & $schema->get_field('pdf_file'); |
|
| 135 | + $due_field = & $schema->get_field('due'); |
|
| 136 | + $sent_field = & $schema->get_field('sent'); |
|
| 137 | + $paid_field = & $schema->get_field('paid'); |
|
| 138 | + $customer_field = & $schema->get_field('customer'); |
|
| 139 | + $contact_field = & $schema->get_field('customerContact'); |
|
| 140 | 140 | |
| 141 | 141 | // Fill VAT select |
| 142 | 142 | $vat_array = explode(',', $this->_config->get('vat_percentages')); |
@@ -48,7 +48,8 @@ discard block |
||
| 48 | 48 | // We're creating invoice for chosen customer |
| 49 | 49 | try { |
| 50 | 50 | $this->customer = new org_openpsa_contacts_group_dba($company); |
| 51 | - } catch (midcom_error $e) { |
|
| 51 | + } |
|
| 52 | + catch (midcom_error $e) { |
|
| 52 | 53 | $contact = new org_openpsa_contacts_person_dba($company); |
| 53 | 54 | $this->contact_id = $contact->id; |
| 54 | 55 | } |
@@ -155,7 +156,8 @@ discard block |
||
| 155 | 156 | if (!empty($this->invoice->customer)) { |
| 156 | 157 | try { |
| 157 | 158 | $this->customer = org_openpsa_contacts_group_dba::get_cached($this->invoice->customer); |
| 158 | - } catch (midcom_error $e) { |
|
| 159 | + } |
|
| 160 | + catch (midcom_error $e) { |
|
| 159 | 161 | $customer_field['hidden'] = true; |
| 160 | 162 | $e->log(); |
| 161 | 163 | } |
@@ -9,11 +9,11 @@ |
||
| 9 | 9 | use midcom\datamanager\indexer\client; |
| 10 | 10 | use midcom\datamanager\datamanager; |
| 11 | 11 | |
| 12 | - /** |
|
| 13 | - * Indexer client class |
|
| 14 | - * |
|
| 15 | - * @package org.openpsa.invoices |
|
| 16 | - */ |
|
| 12 | + /** |
|
| 13 | + * Indexer client class |
|
| 14 | + * |
|
| 15 | + * @package org.openpsa.invoices |
|
| 16 | + */ |
|
| 17 | 17 | class org_openpsa_invoices_midcom_indexer extends client |
| 18 | 18 | { |
| 19 | 19 | public function prepare_document(midcom_services_indexer_document &$document, datamanager $dm) |
@@ -30,7 +30,8 @@ |
||
| 30 | 30 | $this->config = $config; |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | - protected function cast($value) { |
|
| 33 | + protected function cast($value) |
|
| 34 | + { |
|
| 34 | 35 | if ($this->config['type'] == 'number' && !is_numeric($value)) { |
| 35 | 36 | $value = (float) $value; |
| 36 | 37 | } |
@@ -52,7 +52,7 @@ |
||
| 52 | 52 | foreach ($this->schemadb->all() as $schema) { |
| 53 | 53 | $schema->set('operations', $operations); |
| 54 | 54 | if ($schema->has_field('title')) { |
| 55 | - $field =& $schema->get_field('title'); |
|
| 55 | + $field = & $schema->get_field('title'); |
|
| 56 | 56 | $field['hidden'] = true; |
| 57 | 57 | } |
| 58 | 58 | } |
@@ -22,7 +22,7 @@ |
||
| 22 | 22 | |
| 23 | 23 | // Get the calendar root event |
| 24 | 24 | if ($root_event = org_openpsa_calendar_interface::find_root_event()) { |
| 25 | - $field =& $schemadb->get('default')->get_field('calendar'); |
|
| 25 | + $field = & $schemadb->get('default')->get_field('calendar'); |
|
| 26 | 26 | $field['type_config']['privilege_object'] = $root_event; |
| 27 | 27 | $field['type_config']['assignee'] = 'group:' . $group->guid; |
| 28 | 28 | } |
@@ -22,7 +22,7 @@ |
||
| 22 | 22 | |
| 23 | 23 | // Get the calendar root event |
| 24 | 24 | if ($root_event = org_openpsa_calendar_interface::find_root_event()) { |
| 25 | - $field =& $schemadb->get('default')->get_field('calendar'); |
|
| 25 | + $field = & $schemadb->get('default')->get_field('calendar'); |
|
| 26 | 26 | $field['type_config']['privilege_object'] = $root_event; |
| 27 | 27 | $field['type_config']['assignee'] = 'user:' . $person->guid; |
| 28 | 28 | } |