@@ -39,8 +39,8 @@ discard block |
||
| 39 | 39 | $config = array_merge($defaults, $config); |
| 40 | 40 | |
| 41 | 41 | $node_url = $siteconfig->get_node_full_url($component); |
| 42 | - if ( $node_url |
|
| 43 | - && ( !$user_id |
|
| 42 | + if ($node_url |
|
| 43 | + && (!$user_id |
|
| 44 | 44 | || midcom::get()->auth->acl->can_do_byguid('midgard:read', $siteconfig->get_node_guid($component), midcom_db_topic::class, $user_id))) { |
| 45 | 45 | $providers[] = [ |
| 46 | 46 | 'placeholder' => midcom::get()->i18n->get_string('search title', $component), |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | echo '<div id="tabs">'; |
| 116 | 116 | echo "\n<ul>\n"; |
| 117 | 117 | foreach ($tabdata as $key => $tab) { |
| 118 | - echo "<li><a id='key_" . $key ."' class='tabs_link' href='" . $prefix . $tab['url'] . "' ><span> " . $tab['title'] . "</span></a></li>"; |
|
| 118 | + echo "<li><a id='key_" . $key . "' class='tabs_link' href='" . $prefix . $tab['url'] . "' ><span> " . $tab['title'] . "</span></a></li>"; |
|
| 119 | 119 | } |
| 120 | 120 | echo "\n</ul>\n"; |
| 121 | 121 | echo "</div>\n"; |
@@ -103,12 +103,12 @@ |
||
| 103 | 103 | if (!empty($guid)) { |
| 104 | 104 | //pass the urls & titles for the tabs |
| 105 | 105 | $tabdata[] = [ |
| 106 | - 'url' => '__mfa/org.openpsa.relatedto/journalentry/' . $guid . '/', |
|
| 107 | - 'title' => midcom::get()->i18n->get_string('journal entries', 'org.openpsa.relatedto'), |
|
| 106 | + 'url' => '__mfa/org.openpsa.relatedto/journalentry/' . $guid . '/', |
|
| 107 | + 'title' => midcom::get()->i18n->get_string('journal entries', 'org.openpsa.relatedto'), |
|
| 108 | 108 | ]; |
| 109 | 109 | $tabdata[] = [ |
| 110 | - 'url' => '__mfa/org.openpsa.relatedto/render/' . $guid . '/both/', |
|
| 111 | - 'title' => midcom::get()->i18n->get_string('related objects', 'org.openpsa.relatedto'), |
|
| 110 | + 'url' => '__mfa/org.openpsa.relatedto/render/' . $guid . '/both/', |
|
| 111 | + 'title' => midcom::get()->i18n->get_string('related objects', 'org.openpsa.relatedto'), |
|
| 112 | 112 | ]; |
| 113 | 113 | } |
| 114 | 114 | |
@@ -32,11 +32,11 @@ |
||
| 32 | 32 | $object = $dm->get_storage()->get_value(); |
| 33 | 33 | |
| 34 | 34 | $document = $indexer->new_document($dm); |
| 35 | - if ( $config->get('enable_scheduling') |
|
| 35 | + if ($config->get('enable_scheduling') |
|
| 36 | 36 | && is_a($object, org_openpsa_products_product_dba::class)) { |
| 37 | 37 | // Check start/end for products |
| 38 | - if ( $object->start > time() |
|
| 39 | - || ( $object->end != 0 |
|
| 38 | + if ($object->start > time() |
|
| 39 | + || ($object->end != 0 |
|
| 40 | 40 | && $object->end < time())) { |
| 41 | 41 | // Not in market, remove from index |
| 42 | 42 | $indexer->delete($document->RI); |
@@ -103,7 +103,8 @@ |
||
| 103 | 103 | try { |
| 104 | 104 | midcom_db_topic::get_cached($node_guid); |
| 105 | 105 | $available_generators[$component] = midcom::get()->i18n->get_string($component, $component); |
| 106 | - } catch (midcom_error $e) { |
|
| 106 | + } |
|
| 107 | + catch (midcom_error $e) { |
|
| 107 | 108 | debug_add("topic for component '{$component}' not found or accessible"); |
| 108 | 109 | } |
| 109 | 110 | } |
@@ -17,7 +17,7 @@ |
||
| 17 | 17 | { |
| 18 | 18 | $toolbar = new midcom_helper_toolbar(); |
| 19 | 19 | $buttons = []; |
| 20 | - if ( midcom::get()->auth->user |
|
| 20 | + if (midcom::get()->auth->user |
|
| 21 | 21 | && $comment->status < net_nehmer_comments_comment::MODERATED) { |
| 22 | 22 | if (!$comment->can_do('net.nehmer.comments:moderation')) { |
| 23 | 23 | // Regular users can only report abuse |
@@ -76,7 +76,8 @@ |
||
| 76 | 76 | } else { |
| 77 | 77 | try { |
| 78 | 78 | $this->initialize_index_article($topic); |
| 79 | - } catch (midcom_error $e) { |
|
| 79 | + } |
|
| 80 | + catch (midcom_error $e) { |
|
| 80 | 81 | // Could not create index |
| 81 | 82 | $topic->delete(); |
| 82 | 83 | throw $e; |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | $prefix = $nap->get_node($this->_topic->id)[MIDCOM_NAV_ABSOLUTEURL]; |
| 35 | 35 | |
| 36 | 36 | $tree = new org_openpsa_widgets_tree(org_openpsa_contacts_group_dba::class, 'owner'); |
| 37 | - $tree->link_callback = function ($guid) use ($prefix) { |
|
| 37 | + $tree->link_callback = function($guid) use ($prefix) { |
|
| 38 | 38 | return $prefix . 'group/' . $guid . '/'; |
| 39 | 39 | }; |
| 40 | 40 | $tree->constraints[] = ['orgOpenpsaObtype', '<', org_openpsa_contacts_group_dba::MYCONTACTS]; |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | { |
| 53 | 53 | $my_company_guid = $this->_config->get('owner_organization'); |
| 54 | 54 | |
| 55 | - if ( empty($my_company_guid) |
|
| 55 | + if (empty($my_company_guid) |
|
| 56 | 56 | || !mgd_is_guid($my_company_guid)) { |
| 57 | 57 | if (midcom::get()->auth->admin) { |
| 58 | 58 | midcom::get()->uimessages->add( |
@@ -64,7 +64,7 @@ |
||
| 64 | 64 | |
| 65 | 65 | if ($path === '') { |
| 66 | 66 | // Infinite loop, set an UI message and stop executing |
| 67 | - if ( !isset($schema['extends']['name']) |
|
| 67 | + if (!isset($schema['extends']['name']) |
|
| 68 | 68 | || $schema['extends']['name'] === $schema_name) { |
| 69 | 69 | throw new midcom_error('schema ' . $path . ':' . $schema_name . ' extends itself'); |
| 70 | 70 | } |
@@ -111,7 +111,7 @@ |
||
| 111 | 111 | $request = $request->withHeader('User-Agent', 'Midgard/' . substr(mgd_version(), 0, 4)); |
| 112 | 112 | |
| 113 | 113 | // Handle basic auth |
| 114 | - if ( !empty($username) |
|
| 114 | + if (!empty($username) |
|
| 115 | 115 | && !empty($password)) { |
| 116 | 116 | // Set basic auth |
| 117 | 117 | $request = $request->withHeader('Authorization', 'Basic ' . base64_encode($username . ':' . $password)); |
@@ -121,7 +121,8 @@ |
||
| 121 | 121 | |
| 122 | 122 | try { |
| 123 | 123 | $response = $client->send($request); |
| 124 | - } catch (Exception $e) { |
|
| 124 | + } |
|
| 125 | + catch (Exception $e) { |
|
| 125 | 126 | $this->error = $e->getMessage(); |
| 126 | 127 | debug_add("Got error '{$this->error}' from HTTP request", MIDCOM_LOG_INFO); |
| 127 | 128 | return false; |
@@ -115,7 +115,8 @@ |
||
| 115 | 115 | MIDCOM_TOOLBAR_GLYPHICON => 'money', |
| 116 | 116 | ]; |
| 117 | 117 | } |
| 118 | - } catch (midcom_error $e) { |
|
| 118 | + } |
|
| 119 | + catch (midcom_error $e) { |
|
| 119 | 120 | } |
| 120 | 121 | } |
| 121 | 122 | |
@@ -67,7 +67,7 @@ |
||
| 67 | 67 | MIDCOM_TOOLBAR_ACCESSKEY => 'e', |
| 68 | 68 | ]); |
| 69 | 69 | |
| 70 | - if ( $this->task->reportedHours == 0 |
|
| 70 | + if ($this->task->reportedHours == 0 |
|
| 71 | 71 | && $this->task->can_do('midgard:delete')) { |
| 72 | 72 | $delete_workflow = $this->get_workflow('delete', ['object' => $this->task]); |
| 73 | 73 | $buttons[] = $delete_workflow->get_button($this->router->generate('task_delete', ['guid' => $this->task->guid])); |