From 4e1417eb53292f35f42aa96a070fdd126e7f2dbd Mon Sep 17 00:00:00 2001 From: Maximilien Bersoult <mbersoult@centreon.com> Date: Mon, 9 Apr 2018 12:20:29 +0200 Subject: [PATCH] fix(api): Fix coding style * Fix bad comment * Split line to be less of 120 characters --- .../class/centreon_administration_widget.class.php | 2 +- www/api/class/centreon_clapi.class.php | 2 +- .../class/centreon_configuration_objects.class.php | 2 +- www/api/class/centreon_home_customview.class.php | 2 +- www/api/class/centreon_keepalive.class.php | 2 +- www/api/class/centreon_metric.class.php | 2 +- www/api/class/centreon_proxy.class.php | 2 +- www/api/class/centreon_realtime_base.class.php | 2 +- www/api/class/centreon_results_acceptor.class.php | 2 +- www/api/class/centreon_wiki.class.php | 2 +- www/api/class/webService.class.php | 2 +- .../configuration/configObject/contact/DB-Func.php | 11 ++++++++--- .../configObject/contact/formContact.ihtml | 8 +++++++- 13 files changed, 26 insertions(+), 15 deletions(-) diff --git a/www/api/class/centreon_administration_widget.class.php b/www/api/class/centreon_administration_widget.class.php index 2cc4d810aa..4f6ba0a7c4 100644 --- a/www/api/class/centreon_administration_widget.class.php +++ b/www/api/class/centreon_administration_widget.class.php @@ -81,7 +81,7 @@ class CentreonAdministrationWidget extends CentreonWebService * @param string $action The action name * @param array $user The current user * @param boolean $isInternal If the api is call in internal - * @return boolean If the has access to the action + * @return boolean If the user has access to the action */ public function authorize($action, $user, $isInternal) { diff --git a/www/api/class/centreon_clapi.class.php b/www/api/class/centreon_clapi.class.php index 1e506c7238..53075b85e7 100644 --- a/www/api/class/centreon_clapi.class.php +++ b/www/api/class/centreon_clapi.class.php @@ -196,7 +196,7 @@ class CentreonClapi extends CentreonWebService * @param string $action The action name * @param array $user The current user * @param boolean $isInternal If the api is call in internal - * @return boolean If the has access to the action + * @return boolean If the user has access to the action */ public function authorize($action, $user, $isInternal) { diff --git a/www/api/class/centreon_configuration_objects.class.php b/www/api/class/centreon_configuration_objects.class.php index 6146bf3569..6d3e4685fd 100644 --- a/www/api/class/centreon_configuration_objects.class.php +++ b/www/api/class/centreon_configuration_objects.class.php @@ -277,7 +277,7 @@ class CentreonConfigurationObjects extends CentreonWebService * @param string $action The action name * @param array $user The current user * @param boolean $isInternal If the api is call in internal - * @return boolean If the has access to the action + * @return boolean If the user has access to the action */ public function authorize($action, $user, $isInternal) { diff --git a/www/api/class/centreon_home_customview.class.php b/www/api/class/centreon_home_customview.class.php index ff90db6ae0..3aa5d7b461 100644 --- a/www/api/class/centreon_home_customview.class.php +++ b/www/api/class/centreon_home_customview.class.php @@ -170,7 +170,7 @@ class CentreonHomeCustomview extends CentreonWebService * @param string $action The action name * @param array $user The current user * @param boolean $isInternal If the api is call in internal - * @return boolean If the has access to the action + * @return boolean If the user has access to the action */ public function authorize($action, $user, $isInternal) { diff --git a/www/api/class/centreon_keepalive.class.php b/www/api/class/centreon_keepalive.class.php index e08d0c64be..bc1b9d15d8 100644 --- a/www/api/class/centreon_keepalive.class.php +++ b/www/api/class/centreon_keepalive.class.php @@ -66,7 +66,7 @@ class CentreonKeepalive extends CentreonWebService * @param string $action The action name * @param array $user The current user * @param boolean $isInternal If the api is call in internal - * @return boolean If the has access to the action + * @return boolean If the user has access to the action */ public function authorize($action, $user, $isInternal) { diff --git a/www/api/class/centreon_metric.class.php b/www/api/class/centreon_metric.class.php index 925355b0ac..5ca9701cd8 100644 --- a/www/api/class/centreon_metric.class.php +++ b/www/api/class/centreon_metric.class.php @@ -682,7 +682,7 @@ class CentreonMetric extends CentreonWebService * @param string $action The action name * @param array $user The current user * @param boolean $isInternal If the api is call in internal - * @return boolean If the has access to the action + * @return boolean If the user has access to the action */ public function authorize($action, $user, $isInternal) { diff --git a/www/api/class/centreon_proxy.class.php b/www/api/class/centreon_proxy.class.php index a047e8b4b3..13980cfbad 100644 --- a/www/api/class/centreon_proxy.class.php +++ b/www/api/class/centreon_proxy.class.php @@ -33,7 +33,7 @@ class CentreonProxy extends CentreonWebService * @param string $action The action name * @param array $user The current user * @param boolean $isInternal If the api is call in internal - * @return boolean If the has access to the action + * @return boolean If the user has access to the action */ public function authorize($action, $user, $isInternal) { diff --git a/www/api/class/centreon_realtime_base.class.php b/www/api/class/centreon_realtime_base.class.php index d0c8637022..f2a589789f 100644 --- a/www/api/class/centreon_realtime_base.class.php +++ b/www/api/class/centreon_realtime_base.class.php @@ -254,7 +254,7 @@ class CentreonRealtimeBase extends CentreonWebService * @param string $action The action name * @param array $user The current user * @param boolean $isInternal If the api is call in internal - * @return boolean If the has access to the action + * @return boolean If the user has access to the action */ public function authorize($action, $user, $isInternal) { diff --git a/www/api/class/centreon_results_acceptor.class.php b/www/api/class/centreon_results_acceptor.class.php index 52bef36428..d80a32ba82 100644 --- a/www/api/class/centreon_results_acceptor.class.php +++ b/www/api/class/centreon_results_acceptor.class.php @@ -243,7 +243,7 @@ class CentreonResultsAcceptor extends CentreonConfigurationObjects * @param string $action The action name * @param array $user The current user * @param boolean $isInternal If the api is call in internal - * @return boolean If the has access to the action + * @return boolean If the user has access to the action */ public function authorize($action, $user, $isInternal) { diff --git a/www/api/class/centreon_wiki.class.php b/www/api/class/centreon_wiki.class.php index 338e397314..675118177d 100644 --- a/www/api/class/centreon_wiki.class.php +++ b/www/api/class/centreon_wiki.class.php @@ -85,7 +85,7 @@ class CentreonWiki extends CentreonWebService * @param string $action The action name * @param array $user The current user * @param boolean $isInternal If the api is call in internal - * @return boolean If the has access to the action + * @return boolean If the user has access to the action */ public function authorize($action, $user, $isInternal) { diff --git a/www/api/class/webService.class.php b/www/api/class/webService.class.php index 1488790a1b..169385ce83 100644 --- a/www/api/class/webService.class.php +++ b/www/api/class/webService.class.php @@ -127,7 +127,7 @@ class CentreonWebService * @param string $action The action name * @param array $user The current user * @param boolean $isInternal If the api is call in internal - * @return boolean If the has access to the action + * @return boolean If the user has access to the action */ public function authorize($action, $user, $isInternal = false) { diff --git a/www/include/configuration/configObject/contact/DB-Func.php b/www/include/configuration/configObject/contact/DB-Func.php index b30970d297..29caaf98c9 100644 --- a/www/include/configuration/configObject/contact/DB-Func.php +++ b/www/include/configuration/configObject/contact/DB-Func.php @@ -395,7 +395,8 @@ function insertContact($ret = array()) "`contact_id` , `timeperiod_tp_id` , `timeperiod_tp_id2` , `contact_name` , " . "`contact_alias` , `contact_autologin_key` , `contact_passwd` , `contact_lang` , `contact_template_id`, " . "`contact_host_notification_options` , `contact_service_notification_options` , " . - "`contact_email` , `contact_pager` , `contact_comment` , `contact_oreon`, `reach_api`, `reach_api_rt`, `contact_register`, `contact_enable_notifications` , " . + "`contact_email` , `contact_pager` , `contact_comment` , `contact_oreon`, `reach_api`, `reach_api_rt`, " . + "`contact_register`, `contact_enable_notifications` , " . "`contact_admin` , `contact_type_msg`, `contact_activate`, `contact_auth_type`, " . "`contact_ldap_dn`, `contact_location`, `contact_address1`, `contact_address2`, " . "`contact_address3`, `contact_address4`, `contact_address5`, `contact_address6`)" . @@ -439,7 +440,9 @@ function insertContact($ret = array()) isset($ret["contact_oreon"]["contact_oreon"]) && $ret["contact_oreon"]["contact_oreon"] != null ? $rq .= "'" . $ret["contact_oreon"]["contact_oreon"] . "', " : $rq .= " '1', "; } isset($ret["reach_api"]["reach_api"]) && $ret["reach_api"]["reach_api"] != null ? $rq .= $ret["reach_api"]["reach_api"] . ", " : $rq .= " 0, "; - isset($ret["reach_api_rt"]["reach_api_rt"]) && $ret["reach_api_rt"]["reach_api_rt"] != null ? $rq .= $ret["reach_api_rt"]["reach_api_rt"] . ", " : $rq .= " 0, "; + isset($ret["reach_api_rt"]["reach_api_rt"]) && $ret["reach_api_rt"]["reach_api_rt"] != null + ? $rq .= $ret["reach_api_rt"]["reach_api_rt"] . ", " + : $rq .= " 0, "; isset($ret["contact_register"]) && $ret["contact_register"] != null ? $rq .= "'" . $ret["contact_register"] . "', " : $rq .= " '1', "; isset($ret["contact_enable_notifications"]["contact_enable_notifications"]) && $ret["contact_enable_notifications"]["contact_enable_notifications"] != null ? $rq .= "'" . $ret["contact_enable_notifications"]["contact_enable_notifications"] . "', " : $rq .= "NULL, "; isset($ret["contact_admin"]["contact_admin"]) && $ret["contact_admin"]["contact_admin"] != null ? $rq .= "'" . $ret["contact_admin"]["contact_admin"] . "', " : $rq .= "'0', "; @@ -533,7 +536,9 @@ function updateContact($contact_id = null, $from_MC = false) $rq .= "reach_api = "; isset($ret["reach_api"]["reach_api"]) && $ret["reach_api"]["reach_api"] != null ? $rq .= "'" . $ret["reach_api"]["reach_api"] . "', " : $rq .= "NULL, "; $rq .= "reach_api_rt = "; - isset($ret["reach_api_rt"]["reach_api_rt"]) && $ret["reach_api_rt"]["reach_api_rt"] != null ? $rq .= "'" . $ret["reach_api_rt"]["reach_api_rt"] . "', " : $rq .= "NULL, "; + isset($ret["reach_api_rt"]["reach_api_rt"]) && $ret["reach_api_rt"]["reach_api_rt"] != null + ? $rq .= "'" . $ret["reach_api_rt"]["reach_api_rt"] . "', " + : $rq .= "NULL, "; $rq .= "contact_enable_notifications = "; isset($ret["contact_enable_notifications"]["contact_enable_notifications"]) && $ret["contact_enable_notifications"]["contact_enable_notifications"] != null ? $rq .= "'" . $ret["contact_enable_notifications"]["contact_enable_notifications"] . "', " : $rq .= "NULL, "; $rq .= "contact_admin = "; diff --git a/www/include/configuration/configObject/contact/formContact.ihtml b/www/include/configuration/configObject/contact/formContact.ihtml index 29f99daae6..6291be53dd 100644 --- a/www/include/configuration/configObject/contact/formContact.ihtml +++ b/www/include/configuration/configObject/contact/formContact.ihtml @@ -118,7 +118,13 @@ {if $displayAdminFlag == 1} <tr class="list_two"><td class="FormRowField"><img class="helpTooltip" name="admin"> {$form.contact_admin.label}</td><td class="FormRowValue">{$form.contact_admin.html}</td></tr> <tr class="list_one"><td class="FormRowField"><img class="helpTooltip" name="reach_api"> {$form.reach_api.label}</td><td class="FormRowValue">{$form.reach_api.html}</td></tr> - <tr class="list_two"><td class="FormRowField"><img class="helpTooltip" name="reach_api_rt"> {$form.reach_api_rt.label}</td><td class="FormRowValue">{$form.reach_api_rt.html}</td></tr> + <tr class="list_two"> + <td class="FormRowField"> + <img class="helpTooltip" name="reach_api_rt"> + {$form.reach_api_rt.label} + </td> + <td class="FormRowValue">{$form.reach_api_rt.html}</td> + </tr> {/if} <tr class="list_lvl_1"> <td class="ListColLvl1_name" colspan="2"> -- GitLab