@@ -27,7 +27,8 @@ |
||
27 | 27 | } |
28 | 28 | $contact = new org_openpsa_widgets_contact($editor); |
29 | 29 | echo "<li class=\"updated-{$class}\"><a href=\"{$url}\"{$onclick}>{$document->title}</a> <div class=\"metadata\">" . $formatter->datetime($document->edited) . " (" . $contact->show_inline() . ")</div></li>\n"; |
30 | - } catch (midcom_error) { |
|
30 | + } |
|
31 | + catch (midcom_error) { |
|
31 | 32 | } |
32 | 33 | } |
33 | 34 | echo "</ul></div>\n"; |
@@ -94,7 +94,8 @@ |
||
94 | 94 | $customer = new org_openpsa_contacts_group_dba($customer_id); |
95 | 95 | $customer_label = $customer->official; |
96 | 96 | $customer = $customer_id; |
97 | - } catch (midcom_error) { |
|
97 | + } |
|
98 | + catch (midcom_error) { |
|
98 | 99 | } |
99 | 100 | } |
100 | 101 | } |
@@ -103,7 +103,8 @@ discard block |
||
103 | 103 | foreach ($hours as $guid => $row) { |
104 | 104 | try { |
105 | 105 | $task = org_openpsa_projects_task_dba::get_cached($row['task']); |
106 | - } catch (midcom_error) { |
|
106 | + } |
|
107 | + catch (midcom_error) { |
|
107 | 108 | // Task couldn't be loaded, probably because of ACL |
108 | 109 | continue; |
109 | 110 | } |
@@ -116,7 +117,8 @@ discard block |
||
116 | 117 | $person_object = midcom_db_person::get_cached($row['person']); |
117 | 118 | $person_label = $this->_get_list_link($person_object->name, person_id: $row['person']); |
118 | 119 | $person_name = $person_object->name; |
119 | - } catch (midcom_error) { |
|
120 | + } |
|
121 | + catch (midcom_error) { |
|
120 | 122 | $person_label = $this->_l10n->get('no person'); |
121 | 123 | $person_name = ''; |
122 | 124 | } |
@@ -31,7 +31,8 @@ discard block |
||
31 | 31 | if ($data['contacts_url']) { |
32 | 32 | $row['customer'] = "<a href=\"{$data['contacts_url']}group/{$customer->guid}/\">{$label}</a>"; |
33 | 33 | } |
34 | - } catch (midcom_error $e) { |
|
34 | + } |
|
35 | + catch (midcom_error $e) { |
|
35 | 36 | $e->log(); |
36 | 37 | } |
37 | 38 | } |
@@ -44,7 +45,8 @@ discard block |
||
44 | 45 | $contact_widget = org_openpsa_widgets_contact::get($salesproject->customerContact); |
45 | 46 | $row['index_customerContact'] = $customer->get_label(); |
46 | 47 | $row['customerContact'] = $contact_widget->show_inline(); |
47 | - } catch (midcom_error $e) { |
|
48 | + } |
|
49 | + catch (midcom_error $e) { |
|
48 | 50 | $e->log(); |
49 | 51 | } |
50 | 52 | } |
@@ -56,7 +58,8 @@ discard block |
||
56 | 58 | $owner_widget = org_openpsa_widgets_contact::get($salesproject->owner); |
57 | 59 | $row['index_owner'] = $owner->rname; |
58 | 60 | $row['owner'] = $owner_widget->show_inline(); |
59 | - } catch (midcom_error) { |
|
61 | + } |
|
62 | + catch (midcom_error) { |
|
60 | 63 | $row['index_owner'] = ''; |
61 | 64 | $row['owner'] = ''; |
62 | 65 | } |
@@ -31,7 +31,8 @@ discard block |
||
31 | 31 | try { |
32 | 32 | $agreement = new org_openpsa_sales_salesproject_deliverable_dba($agreement); |
33 | 33 | $agreement->update_units(); |
34 | - } catch (midcom_error $e) { |
|
34 | + } |
|
35 | + catch (midcom_error $e) { |
|
35 | 36 | $e->log(); |
36 | 37 | } |
37 | 38 | } |
@@ -49,7 +50,8 @@ discard block |
||
49 | 50 | |
50 | 51 | try { |
51 | 52 | $deliverable = new org_openpsa_sales_salesproject_deliverable_dba($args['deliverable']); |
52 | - } catch (midcom_error $e) { |
|
53 | + } |
|
54 | + catch (midcom_error $e) { |
|
53 | 55 | $handler->print_error("Deliverable {$args['deliverable']} not found: " . $e->getMessage()); |
54 | 56 | return false; |
55 | 57 | } |
@@ -69,7 +71,8 @@ discard block |
||
69 | 71 | } |
70 | 72 | try { |
71 | 73 | $deliverable = new org_openpsa_sales_salesproject_deliverable_dba($args['deliverable']); |
72 | - } catch (midcom_error) { |
|
74 | + } |
|
75 | + catch (midcom_error) { |
|
73 | 76 | $handler->print_error('no deliverable with passed GUID: ' . $args['deliverable'] . ', aborting'); |
74 | 77 | return false; |
75 | 78 | } |
@@ -77,7 +80,8 @@ discard block |
||
77 | 80 | //get the owner of the salesproject the deliverable belongs to |
78 | 81 | try { |
79 | 82 | $project = new org_openpsa_sales_salesproject_dba($deliverable->salesproject); |
80 | - } catch (midcom_error $e) { |
|
83 | + } |
|
84 | + catch (midcom_error $e) { |
|
81 | 85 | $handler->print_error('Failed to load salesproject: ' . $e->getMessage()); |
82 | 86 | return false; |
83 | 87 | } |
@@ -95,7 +95,8 @@ |
||
95 | 95 | try { |
96 | 96 | $this->_request_data['customer'] = new org_openpsa_contacts_group_dba($guid); |
97 | 97 | $qb->add_constraint('customer', '=', $this->_request_data['customer']->id); |
98 | - } catch (midcom_error) { |
|
98 | + } |
|
99 | + catch (midcom_error) { |
|
99 | 100 | $this->_request_data['customer'] = new org_openpsa_contacts_person_dba($guid); |
100 | 101 | $qb->add_constraint('customerContact', '=', $this->_request_data['customer']->id); |
101 | 102 | } |
@@ -45,7 +45,8 @@ |
||
45 | 45 | } |
46 | 46 | try { |
47 | 47 | $this->_request_data['product'] = org_openpsa_products_product_dba::get_cached($this->_deliverable->product); |
48 | - } catch (midcom_error) { |
|
48 | + } |
|
49 | + catch (midcom_error) { |
|
49 | 50 | $this->_request_data['product'] = false; |
50 | 51 | } |
51 | 52 | } |
@@ -43,7 +43,8 @@ |
||
43 | 43 | } |
44 | 44 | try { |
45 | 45 | $resource = org_openpsa_calendar_resource_dba::get_cached($this->resource); |
46 | - } catch (midcom_error) { |
|
46 | + } |
|
47 | + catch (midcom_error) { |
|
47 | 48 | debug_add("Cannot fetch resource #{$this->resource} returning false", MIDCOM_LOG_INFO); |
48 | 49 | return false; |
49 | 50 | } |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | |
26 | 26 | public function _on_creating() : bool |
27 | 27 | { |
28 | - if ( $this->invoice |
|
28 | + if ($this->invoice |
|
29 | 29 | && $this->position == 0) { |
30 | 30 | $invoice = org_openpsa_invoices_invoice_dba::get_cached($this->invoice); |
31 | 31 | $this->position = count($invoice->get_invoice_items()) + 1; |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | } catch (midcom_error) { |
76 | 76 | } |
77 | 77 | } |
78 | - if ( $url == '' |
|
78 | + if ($url == '' |
|
79 | 79 | && $sales_url) { |
80 | 80 | try { |
81 | 81 | $deliverable = org_openpsa_sales_salesproject_deliverable_dba::get_cached($this->deliverable); |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | $invoice = new org_openpsa_invoices_invoice_dba($this->invoice); |
98 | 98 | $old_sum = $invoice->sum; |
99 | 99 | self::update_invoice($invoice); |
100 | - if ( $old_sum != $invoice->sum |
|
100 | + if ($old_sum != $invoice->sum |
|
101 | 101 | && !empty($this->deliverable)) { |
102 | 102 | $deliverable = new org_openpsa_sales_salesproject_deliverable_dba($this->deliverable); |
103 | 103 | self::update_deliverable($deliverable); |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | |
136 | 136 | if ($invoiced != $deliverable->invoiced) { |
137 | 137 | $deliverable->invoiced = $invoiced; |
138 | - if ( $deliverable->orgOpenpsaObtype !== org_openpsa_products_product_dba::DELIVERY_SUBSCRIPTION |
|
138 | + if ($deliverable->orgOpenpsaObtype !== org_openpsa_products_product_dba::DELIVERY_SUBSCRIPTION |
|
139 | 139 | && $deliverable->state < org_openpsa_sales_salesproject_deliverable_dba::STATE_INVOICED) { |
140 | 140 | $deliverable->state = org_openpsa_sales_salesproject_deliverable_dba::STATE_INVOICED; |
141 | 141 | } |
@@ -72,7 +72,8 @@ discard block |
||
72 | 72 | try { |
73 | 73 | $task = org_openpsa_projects_task_dba::get_cached($this->task); |
74 | 74 | $url = $projects_url . 'task/' . $task->guid . '/'; |
75 | - } catch (midcom_error) { |
|
75 | + } |
|
76 | + catch (midcom_error) { |
|
76 | 77 | } |
77 | 78 | } |
78 | 79 | if ( $url == '' |
@@ -80,7 +81,8 @@ discard block |
||
80 | 81 | try { |
81 | 82 | $deliverable = org_openpsa_sales_salesproject_deliverable_dba::get_cached($this->deliverable); |
82 | 83 | $url = $sales_url . 'deliverable/' . $deliverable->guid . '/'; |
83 | - } catch (midcom_error) { |
|
84 | + } |
|
85 | + catch (midcom_error) { |
|
84 | 86 | } |
85 | 87 | } |
86 | 88 | if ($url != '') { |
@@ -102,7 +104,8 @@ discard block |
||
102 | 104 | $deliverable = new org_openpsa_sales_salesproject_deliverable_dba($this->deliverable); |
103 | 105 | self::update_deliverable($deliverable); |
104 | 106 | } |
105 | - } catch (midcom_error $e) { |
|
107 | + } |
|
108 | + catch (midcom_error $e) { |
|
106 | 109 | $e->log(); |
107 | 110 | } |
108 | 111 | } |