@@ -77,9 +77,9 @@ |
||
77 | 77 | $filter_id = $this->_identifier . '_' . $filtername; |
78 | 78 | $user = midcom::get()->auth->user->get_storage(); |
79 | 79 | |
80 | - if ( isset($_POST['unset_filter']) |
|
80 | + if (isset($_POST['unset_filter']) |
|
81 | 81 | && $_POST['unset_filter'] == $filter_id) { |
82 | - if ( $user->get_parameter("org_openpsa_core_filter", $filter_id) |
|
82 | + if ($user->get_parameter("org_openpsa_core_filter", $filter_id) |
|
83 | 83 | && !$user->delete_parameter("org_openpsa_core_filter", $filter_id)) { |
84 | 84 | $message_content = sprintf( |
85 | 85 | $l10n->get('the handed filter for %s could not be set as parameter'), |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | |
233 | 233 | private function _convert_to_localdata() |
234 | 234 | { |
235 | - return "var " . $this->_grid->get_identifier() . '_entries = ' . json_encode($this->get_rows()) . ";\n"; |
|
235 | + return "var " . $this->_grid->get_identifier() . '_entries = ' . json_encode($this->get_rows()) . ";\n"; |
|
236 | 236 | } |
237 | 237 | |
238 | 238 | private function _render_json() |
@@ -266,7 +266,7 @@ discard block |
||
266 | 266 | $this->_sort_field = $query['sidx']; |
267 | 267 | $this->_sort_direction = strtoupper($query['sord']); |
268 | 268 | } |
269 | - if ( !empty($query['_search']) |
|
269 | + if (!empty($query['_search']) |
|
270 | 270 | && $query['_search'] === 'true') { |
271 | 271 | foreach ($query as $field => $value) { |
272 | 272 | if (in_array($field, array('_search', 'nd', 'page', 'rows', 'sidx', 'sord'))) { |
@@ -291,7 +291,7 @@ discard block |
||
291 | 291 | |
292 | 292 | $this->_total_rows = $qb->count(); |
293 | 293 | |
294 | - if ( $this->_datatype == 'json' |
|
294 | + if ($this->_datatype == 'json' |
|
295 | 295 | && !empty($this->_results_per_page)) { |
296 | 296 | $qb->set_limit($this->_results_per_page); |
297 | 297 | if (!empty($this->_offset)) { |
@@ -37,8 +37,8 @@ discard block |
||
37 | 37 | $config = array_merge($defaults, $config); |
38 | 38 | |
39 | 39 | $node_url = $siteconfig->get_node_full_url($component); |
40 | - if ( $node_url |
|
41 | - && ( !$user_id |
|
40 | + if ($node_url |
|
41 | + && (!$user_id |
|
42 | 42 | || midcom::get()->auth->acl->can_do_byguid('midgard:read', $siteconfig->get_node_guid($component), 'midcom_db_topic', $user_id))) { |
43 | 43 | $providers[] = array( |
44 | 44 | 'placeholder' => midcom::get()->i18n->get_string('search title', $component), |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | echo '<div id="tabs">'; |
115 | 115 | echo "\n<ul>\n"; |
116 | 116 | foreach ($tabdata as $key => $tab) { |
117 | - echo "<li><a id='key_" . $key ."' class='tabs_link' href='" . $prefix . $tab['url'] . "' ><span> " . $tab['title'] . "</span></a></li>"; |
|
117 | + echo "<li><a id='key_" . $key . "' class='tabs_link' href='" . $prefix . $tab['url'] . "' ><span> " . $tab['title'] . "</span></a></li>"; |
|
118 | 118 | } |
119 | 119 | echo "\n</ul>\n"; |
120 | 120 | echo "</div>\n"; |
@@ -102,12 +102,12 @@ |
||
102 | 102 | if (null !== $guid) { |
103 | 103 | //pass the urls & titles for the tabs |
104 | 104 | $tabdata[] = array( |
105 | - 'url' => '__mfa/org.openpsa.relatedto/journalentry/' . $guid . '/', |
|
106 | - 'title' => midcom::get()->i18n->get_string('journal entries', 'org.openpsa.relatedto'), |
|
105 | + 'url' => '__mfa/org.openpsa.relatedto/journalentry/' . $guid . '/', |
|
106 | + 'title' => midcom::get()->i18n->get_string('journal entries', 'org.openpsa.relatedto'), |
|
107 | 107 | ); |
108 | 108 | $tabdata[] = array( |
109 | - 'url' => '__mfa/org.openpsa.relatedto/render/' . $guid . '/both/', |
|
110 | - 'title' => midcom::get()->i18n->get_string('related objects', 'org.openpsa.relatedto'), |
|
109 | + 'url' => '__mfa/org.openpsa.relatedto/render/' . $guid . '/both/', |
|
110 | + 'title' => midcom::get()->i18n->get_string('related objects', 'org.openpsa.relatedto'), |
|
111 | 111 | ); |
112 | 112 | } |
113 | 113 |
@@ -35,31 +35,31 @@ |
||
35 | 35 | return $output; |
36 | 36 | } |
37 | 37 | |
38 | - /** |
|
39 | - * @param midcom_core_dbaobject $object The object we're working on |
|
40 | - * @param string $field The schema field name |
|
41 | - * @return midcom_db_attachment[] List of attachments, indexed by identifier |
|
42 | - */ |
|
43 | - public static function get_dm2_attachments($object, $field) |
|
44 | - { |
|
45 | - $attachments = array(); |
|
46 | - $identifiers = explode(',', $object->get_parameter('midcom.helper.datamanager2.type.blobs', 'guids_' . $field)); |
|
47 | - if (empty($identifiers)) { |
|
48 | - return $attachments; |
|
49 | - } |
|
50 | - foreach ($identifiers as $identifier) { |
|
51 | - $parts = explode(':', $identifier); |
|
52 | - if (sizeof($parts) != 2) { |
|
53 | - continue; |
|
54 | - } |
|
55 | - $guid = $parts[1]; |
|
56 | - try { |
|
57 | - $attachments[$parts[0]] = midcom_db_attachment::get_cached($guid); |
|
58 | - } catch (midcom_error $e) { |
|
59 | - $e->log(); |
|
60 | - } |
|
61 | - } |
|
38 | + /** |
|
39 | + * @param midcom_core_dbaobject $object The object we're working on |
|
40 | + * @param string $field The schema field name |
|
41 | + * @return midcom_db_attachment[] List of attachments, indexed by identifier |
|
42 | + */ |
|
43 | + public static function get_dm2_attachments($object, $field) |
|
44 | + { |
|
45 | + $attachments = array(); |
|
46 | + $identifiers = explode(',', $object->get_parameter('midcom.helper.datamanager2.type.blobs', 'guids_' . $field)); |
|
47 | + if (empty($identifiers)) { |
|
48 | + return $attachments; |
|
49 | + } |
|
50 | + foreach ($identifiers as $identifier) { |
|
51 | + $parts = explode(':', $identifier); |
|
52 | + if (sizeof($parts) != 2) { |
|
53 | + continue; |
|
54 | + } |
|
55 | + $guid = $parts[1]; |
|
56 | + try { |
|
57 | + $attachments[$parts[0]] = midcom_db_attachment::get_cached($guid); |
|
58 | + } catch (midcom_error $e) { |
|
59 | + $e->log(); |
|
60 | + } |
|
61 | + } |
|
62 | 62 | |
63 | - return $attachments; |
|
64 | - } |
|
63 | + return $attachments; |
|
64 | + } |
|
65 | 65 | } |
@@ -55,7 +55,8 @@ |
||
55 | 55 | $guid = $parts[1]; |
56 | 56 | try { |
57 | 57 | $attachments[$parts[0]] = midcom_db_attachment::get_cached($guid); |
58 | - } catch (midcom_error $e) { |
|
58 | + } |
|
59 | + catch (midcom_error $e) { |
|
59 | 60 | $e->log(); |
60 | 61 | } |
61 | 62 | } |
@@ -35,7 +35,8 @@ |
||
35 | 35 | try { |
36 | 36 | midcom::get()->dbfactory->get_object_by_guid($param->name); |
37 | 37 | $tried[$param->name] = true; |
38 | - } catch (midcom_error $e) { |
|
38 | + } |
|
39 | + catch (midcom_error $e) { |
|
39 | 40 | $tried[$param->name] = false; |
40 | 41 | } |
41 | 42 | } |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | */ |
46 | 46 | public function merge($obj1, $obj2, $merge_mode) |
47 | 47 | { |
48 | - if ( $merge_mode !== 'all' |
|
48 | + if ($merge_mode !== 'all' |
|
49 | 49 | && $merge_mode !== 'future') { |
50 | 50 | debug_add("invalid mode {$merge_mode}", MIDCOM_LOG_ERROR); |
51 | 51 | throw new midcom_error('invalid merge mode'); |
@@ -87,9 +87,9 @@ discard block |
||
87 | 87 | if (!empty($conf['duplicate_check'])) { |
88 | 88 | $dup = $this->check_duplicate($results, $result, $conf['duplicate_check']); |
89 | 89 | |
90 | - if ( is_object($dup) |
|
90 | + if (is_object($dup) |
|
91 | 91 | || $dup === false) { |
92 | - if ( !is_object($dup) |
|
92 | + if (!is_object($dup) |
|
93 | 93 | || !array_key_exists($dup->id, $todelete)) { |
94 | 94 | $todelete[$result->id] = $result; |
95 | 95 | } |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | } |
99 | 99 | } |
100 | 100 | } |
101 | - if ( $needs_update |
|
101 | + if ($needs_update |
|
102 | 102 | && !$result->update()) { |
103 | 103 | throw new midcom_error("Failed to update {$classname} #{$result->id}, errstr: " . midcom_connection::get_error_string()); |
104 | 104 | } |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | } |
148 | 148 | |
149 | 149 | foreach ($results as $result) { |
150 | - if ( $result->$field === $object->$field |
|
150 | + if ($result->$field === $object->$field |
|
151 | 151 | && $result->id !== $object->id) { |
152 | 152 | return $result; |
153 | 153 | } |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | $changed = false; |
166 | 166 | foreach ($person2 as $property => $value) { |
167 | 167 | // Copy only simple properties not marked to be skipped missing from person1 |
168 | - if ( empty($person2->$property) |
|
168 | + if (empty($person2->$property) |
|
169 | 169 | || !empty($person1->$property) |
170 | 170 | || isset($skip_properties[$property]) |
171 | 171 | || !is_scalar($value)) { |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | |
32 | 32 | public function __set($name, $value) |
33 | 33 | { |
34 | - if ( $name == 'homepage' |
|
34 | + if ($name == 'homepage' |
|
35 | 35 | && !empty($value) |
36 | 36 | && $value != $this->homepage) { |
37 | 37 | $this->_register_prober = true; |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | |
78 | 78 | public function __get($property) |
79 | 79 | { |
80 | - if ( $property == 'invoice_label' |
|
80 | + if ($property == 'invoice_label' |
|
81 | 81 | || $property == 'postal_label') { |
82 | 82 | if (!isset($this->_address_extras[$property])) { |
83 | 83 | $this->_get_address_extra($property); |
@@ -55,7 +55,7 @@ |
||
55 | 55 | { |
56 | 56 | $my_company_guid = $this->_config->get('owner_organization'); |
57 | 57 | |
58 | - if ( empty($my_company_guid) |
|
58 | + if (empty($my_company_guid) |
|
59 | 59 | || !mgd_is_guid($my_company_guid)) { |
60 | 60 | if (midcom::get()->auth->admin) { |
61 | 61 | midcom::get()->uimessages->add( |
@@ -30,7 +30,8 @@ |
||
30 | 30 | $member->require_do('midgard:update'); |
31 | 31 | $member->extra = $_POST['title']; |
32 | 32 | $response->status = $member->update(); |
33 | - } catch (midcom_error $e) { |
|
33 | + } |
|
34 | + catch (midcom_error $e) { |
|
34 | 35 | $e->log(); |
35 | 36 | } |
36 | 37 | $response->message = midcom_connection::get_error_string(); |
@@ -23,7 +23,7 @@ |
||
23 | 23 | $response = new midcom_response_json; |
24 | 24 | $response->status = false; |
25 | 25 | |
26 | - if ( !empty($_POST['guid']) |
|
26 | + if (!empty($_POST['guid']) |
|
27 | 27 | && array_key_exists('title', $_POST)) { |
28 | 28 | try { |
29 | 29 | $member = new midcom_db_member($_POST['guid']); |