Skip to content
This repository has been archived by the owner on Dec 13, 2022. It is now read-only.

Commit

Permalink
Removed animation effect option in account parameters (#10329)
Browse files Browse the repository at this point in the history
* add commented line 140 of formMyAccount.php

* remove js effects animation occurences

* fixed error on myFormAccount.php

* add statement to delete contact_js_effects column and fixed psr format

* File restored

* restored files

* delete alter table contact statement

* add sql update script

* edit sql file

* updated sql statement
  • Loading branch information
AssanDiomande authored Oct 21, 2021
1 parent e81c635 commit b3f2d45
Show file tree
Hide file tree
Showing 12 changed files with 4 additions and 59 deletions.
7 changes: 0 additions & 7 deletions tests/clapi_export/clapi-configuration.txt
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,6 @@ ENGINECFG;setparam;Centreon Engine Central;broker_module;/usr/lib64/centreon-eng
CONTACTTPL;ADD;contact_template;contact_template;;md5__d41d8cd98f00b204e9800998ecf8427e;0;1;;local
CONTACTTPL;setparam;contact_template;hostnotifopt;n
CONTACTTPL;setparam;contact_template;servicenotifopt;n
CONTACTTPL;setparam;contact_template;contact_js_effects;0
CONTACTTPL;setparam;contact_template;timezone;0
CONTACTTPL;setparam;contact_template;reach_api;0
CONTACTTPL;setparam;contact_template;reach_api_rt;0
Expand All @@ -621,7 +620,6 @@ CONTACTTPL;setparam;contact_template;enable_one_click_export;0
CONTACTTPL;ADD;test_name;test_contact-template;;md5__b0e52a1510c9012ebae9e9dc1ae0c46e;0;1;;local
CONTACTTPL;setparam;test_contact-template;hostnotifopt;n
CONTACTTPL;setparam;test_contact-template;servicenotifopt;n
CONTACTTPL;setparam;test_contact-template;contact_js_effects;0
CONTACTTPL;setparam;test_contact-template;timezone;0
CONTACTTPL;setparam;test_contact-template;reach_api;0
CONTACTTPL;setparam;test_contact-template;reach_api_rt;0
Expand All @@ -637,7 +635,6 @@ CONTACT;setparam;admin;hostnotifperiod;24x7
CONTACT;setparam;admin;svcnotifperiod;24x7
CONTACT;setparam;admin;hostnotifopt;n
CONTACT;setparam;admin;servicenotifopt;n
CONTACT;setparam;admin;contact_js_effects;0
CONTACT;setparam;admin;timezone;0
CONTACT;setparam;admin;reach_api;0
CONTACT;setparam;admin;reach_api_rt;0
Expand All @@ -655,7 +652,6 @@ CONTACT;setparam;guest;hostnotifperiod;24x7
CONTACT;setparam;guest;svcnotifperiod;24x7
CONTACT;setparam;guest;hostnotifopt;n
CONTACT;setparam;guest;servicenotifopt;n
CONTACT;setparam;guest;contact_js_effects;0
CONTACT;setparam;guest;timezone;0
CONTACT;setparam;guest;reach_api;0
CONTACT;setparam;guest;reach_api_rt;0
Expand All @@ -671,7 +667,6 @@ CONTACT;setparam;guest;svcnotifcmd;service-notify-by-email
CONTACT;ADD;Jean-Pierre;jeanpierre;Jean-Pierre@hotmail.fr;md5__d41d8cd98f00b204e9800998ecf8427e;0;1;browser;local
CONTACT;setparam;jeanpierre;hostnotifopt;n
CONTACT;setparam;jeanpierre;servicenotifopt;n
CONTACT;setparam;jeanpierre;contact_js_effects;0
CONTACT;setparam;jeanpierre;timezone;0
CONTACT;setparam;jeanpierre;reach_api;0
CONTACT;setparam;jeanpierre;reach_api_rt;0
Expand All @@ -685,7 +680,6 @@ CONTACT;setparam;jeanpierre;enable_one_click_export;0
CONTACT;ADD;test_contact;test_contact;test@localhost;md5__b0e52a1510c9012ebae9e9dc1ae0c46e;0;0;en_US.UTF-8;local
CONTACT;setparam;test_contact;hostnotifopt;n
CONTACT;setparam;test_contact;servicenotifopt;n
CONTACT;setparam;test_contact;contact_js_effects;0
CONTACT;setparam;test_contact;timezone;0
CONTACT;setparam;test_contact;reach_api;0
CONTACT;setparam;test_contact;reach_api_rt;0
Expand All @@ -701,7 +695,6 @@ CONTACT;setparam;user;hostnotifperiod;24x7
CONTACT;setparam;user;svcnotifperiod;24x7
CONTACT;setparam;user;hostnotifopt;n
CONTACT;setparam;user;servicenotifopt;n
CONTACT;setparam;user;contact_js_effects;0
CONTACT;setparam;user;timezone;0
CONTACT;setparam;user;reach_api;0
CONTACT;setparam;user;reach_api_rt;0
Expand Down
2 changes: 0 additions & 2 deletions www/class/centreon-clapi/centreonAPI.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,6 @@ public function initXML()
*/
public function launchAction($exit = true)
{

$action = strtoupper($this->action);

/**
Expand Down Expand Up @@ -871,7 +870,6 @@ public function export($withoutClose = false)
if ($this->objectTable[$splits[0]]->getObjectId($name, CentreonObject::MULTIPLE_VALUE) == 0) {
echo "Unknown object : $splits[0];$splits[1]\n";
$this->setReturnCode(1);

if ($withoutClose === false) {
$this->close();
} else {
Expand Down
30 changes: 0 additions & 30 deletions www/class/centreonUser.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ class CentreonUser
public $version;
public $admin;
public $limit;
public $js_effects;
public $num;
public $gmt;
public $is_admin;
Expand Down Expand Up @@ -96,7 +95,6 @@ public function __construct($user = array())
$this->version = 3;
$this->default_page = $user["default_page"] ?? CentreonAuth::DEFAULT_PAGE;
$this->gmt = $user["contact_location"];
$this->js_effects = $user["contact_js_effects"];
$this->showDeprecatedPages = (bool) $user["show_deprecated_pages"];
$this->is_admin = null;
/*
Expand Down Expand Up @@ -296,25 +294,6 @@ public function setShowDeprecatedPages(bool $showDeprecatedPages)
$this->showDeprecatedPages = $showDeprecatedPages;
}

/**
*
* @global type $pearDB
* @return type
*/
public function get_js_effects()
{
global $pearDB;

$DBRESULT = $pearDB->query('SELECT contact_js_effects FROM contact WHERE contact_id = ' . $this->user_id);
if (($jsEffectsEnabled = $DBRESULT->fetch()) && isset($jsEffectsEnabled['contact_js_effects'])) {
$this->js_effects = $jsEffectsEnabled['contact_js_effects'];
} else {
$this->js_effects = 0;
}

return $this->js_effects;
}

// Set

/**
Expand Down Expand Up @@ -371,15 +350,6 @@ public function set_version($version)
$this->version = $version;
}

/**
*
* @param type $js_effects
*/
public function set_js_effects($js_effects)
{
$this->js_effects = $js_effects;
}

/**
*
* @return type
Expand Down
2 changes: 0 additions & 2 deletions www/include/Administration/myAccount/DB-Func.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ function updateContact($contact_id = null)
'contact_email = :contactEmail, ' .
'contact_pager = :contactPager, ' .
'default_page = :defaultPage, ' .
'contact_js_effects = :contactJsEffects, ' .
'show_deprecated_pages = :showDeprecatedPages, ' .
'contact_autologin_key = :contactAutologinKey, ' .
'enable_one_click_export = :enableOneClickExport';
Expand Down Expand Up @@ -185,7 +184,6 @@ function updateContact($contact_id = null)
\PDO::PARAM_INT
);
$stmt->bindValue(':defaultPage', !empty($ret['default_page']) ? $ret['default_page'] : null, \PDO::PARAM_INT);
$stmt->bindValue(':contactJsEffects', isset($ret['contact_js_effects']) ? 1 : 0, \PDO::PARAM_STR);
$stmt->bindValue(':showDeprecatedPages', isset($ret['show_deprecated_pages']) ? 1 : 0, \PDO::PARAM_STR);
$stmt->bindValue(':enableOneClickExport', isset($ret['enable_one_click_export']) ? '1' : '0', \PDO::PARAM_STR);
$stmt->bindValue(':contactId', $contact_id, \PDO::PARAM_INT);
Expand Down
1 change: 0 additions & 1 deletion www/include/Administration/myAccount/formMyAccount.ihtml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
</tr>
<tr class="list_two"><td class="FormRowField">{$form.default_page.label}</td><td class="FormRowValue">{$form.default_page.html}</td></tr>
<tr class="list_one"><td class="FormRowField"><img class="helpTooltip" name="show_deprecated_pages">{$form.show_deprecated_pages.label}</td><td class="FormRowValue">{$form.show_deprecated_pages.html}</td></tr>
<tr class="list_two"><td class="FormRowField">{$form.contact_js_effects.label}</td><td class="FormRowValue">{$form.contact_js_effects.html}</td></tr>
{if $contactIsAdmin}
<tr class="list_one"><td class="FormRowField">{$form.enable_one_click_export.label}</td><td class="FormRowValue">{$form.enable_one_click_export.html}</td></tr>
{/if}
Expand Down
3 changes: 1 addition & 2 deletions www/include/Administration/myAccount/formMyAccount.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
$cct = array();
if ($o == "c") {
$query = "SELECT contact_id, contact_name, contact_alias, contact_lang, contact_email, contact_pager,
contact_js_effects, contact_autologin_key, default_page, show_deprecated_pages, contact_auth_type,
contact_autologin_key, default_page, show_deprecated_pages, contact_auth_type,
enable_one_click_export
FROM contact WHERE contact_id = :id";
$DBRESULT = $pearDB->prepare($query);
Expand Down Expand Up @@ -137,7 +137,6 @@
);
$form->addElement('select', 'contact_lang', _("Language"), $langs);
$form->addElement('checkbox', 'show_deprecated_pages', _("Use deprecated pages"), null, $attrsText);
$form->addElement('checkbox', 'contact_js_effects', _("Animation effects"), null, $attrsText);
$form->addElement(
'checkbox',
'enable_one_click_export',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@
'contact_admin' => $contact->isAdmin(),
'contact_lang' => null,
'contact_passwd' => null,
'contact_js_effects' => null,
'contact_autologin_key' => null,
'contact_location' => null,
'reach_api' => $contact->hasAccessToApiConfiguration(),
Expand Down
3 changes: 1 addition & 2 deletions www/include/configuration/configGenerate/xml/moveFiles.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@
'contact_admin' => $contact->isAdmin(),
'contact_lang' => null,
'contact_passwd' => null,
'contact_js_effects' => null,
'contact_autologin_key' => null,
'contact_location' => null,
'reach_api' => $contact->hasAccessToApiConfiguration(),
Expand Down Expand Up @@ -279,7 +278,7 @@ function log_error($errno, $errstr, $errfile, $errline)
/*
* Check if monitoring engine's configuration directory existss
*/
$dbResult = $pearDB->query("
$dbResult = $pearDB->query("
SELECT cfg_dir FROM cfg_nagios, nagios_server
WHERE nagios_server.id = cfg_nagios.nagios_server_id
AND nagios_server.localhost = '1'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@
'contact_admin' => $contact->isAdmin(),
'contact_lang' => null,
'contact_passwd' => null,
'contact_js_effects' => null,
'contact_autologin_key' => null,
'contact_location' => null,
'reach_api' => $contact->hasAccessToApiConfiguration(),
Expand Down
11 changes: 1 addition & 10 deletions www/include/monitoring/status/Common/commonJS.php
Original file line number Diff line number Diff line change
Expand Up @@ -947,15 +947,6 @@ function set_page(page) {
}

jQuery('.popup_volante .container-load').empty();
<?php if ($centreon->user->get_js_effects() > 0) { ?>
jQuery('.popup_volante').stop(true, true).animate(
{
width: jQuery('#' + target_element).width(),
height: jQuery('#' + target_element).height(),
top: (jQuery(window).height() / 2) - (jQuery('#' + target_element).height() / 2)
}, 25);
jQuery('#' + target_element).stop(true, true).fadeIn(1000);
<?php } else { ?>

jQuery('.popup_volante').css('left', jQuery('#' + target_element).attr('left'));

Expand All @@ -977,7 +968,7 @@ function set_page(page) {
}
jQuery('.popup_volante').css('top', positionY);
jQuery('#' + target_element).show();
<?php } ?>

formatDateMoment();
};

Expand Down
1 change: 0 additions & 1 deletion www/install/createTables.sql
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,6 @@ CREATE TABLE `contact` (
`contact_address5` varchar(200) DEFAULT NULL,
`contact_address6` varchar(200) DEFAULT NULL,
`contact_comment` text,
`contact_js_effects` enum('0','1') DEFAULT '0',
`contact_location` int(11) DEFAULT '0',
`contact_oreon` enum('0','1') DEFAULT NULL,
`reach_api` int(11) DEFAULT '0',
Expand Down
1 change: 1 addition & 0 deletions www/install/sql/centreon/Update-DB-21.10.0-beta.2.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE `contact` DROP COLUMN `contact_js_effects`;

0 comments on commit b3f2d45

Please sign in to comment.