Skip to content

Commit

Permalink
Merge branch 'release/1.8.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
cedric-anne committed Jan 27, 2021
2 parents fe00eba + 7aed1d2 commit 9f37232
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 14 deletions.
26 changes: 13 additions & 13 deletions inc/alert.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,10 @@ public function rawSearchOptions() {
public static function findAllToNotify($params = []) {
global $DB;

$p['show_only_login_alerts'] = false;
$p['show_hidden_alerts'] = false;
$p['show_helpdesk_alerts'] = false;
$p['entities_id'] = false;
$p['show_only_login_alerts'] = false;
$p['show_hidden_alerts'] = false;
$p['show_only_helpdesk_alerts'] = false;
$p['entities_id'] = false;
foreach ($params as $key => $value) {
$p[$key] = $value;
}
Expand Down Expand Up @@ -236,7 +236,7 @@ public static function findAllToNotify($params = []) {

//If the alert must be displayed on helpdesk form : filter by ticket's entity
//and not the current entity
if ($p['show_helpdesk_alerts']) {
if ($p['show_only_helpdesk_alerts']) {
$show_helpdesk_sql = " AND `$table`.`is_displayed_onhelpdesk`='1'";
}
if (!$p['show_only_login_alerts']) {
Expand Down Expand Up @@ -416,7 +416,7 @@ public function showForm($ID, $options = []) {

static function displayOnCentral() {
echo "<tr><th colspan='2'>";
self::displayAlerts(['show_only_login_alerts' => false]);
self::displayAlerts(['show_only_helpdesk_alerts' => Session::getCurrentInterface() == 'helpdesk']);
echo "</th></tr>";
}

Expand All @@ -430,10 +430,10 @@ static function displayOnLogin() {
static function displayAlerts($params = []) {
global $CFG_GLPI;

$p['show_only_login_alerts'] = false;
$p['show_hidden_alerts'] = false;
$p['show_helpdesk_alerts'] = false;
$p['entities_id'] = false;
$p['show_only_login_alerts'] = false;
$p['show_hidden_alerts'] = false;
$p['show_only_helpdesk_alerts'] = false;
$p['entities_id'] = false;
foreach ($params as $key => $value) {
$p[$key] = $value;
}
Expand Down Expand Up @@ -502,9 +502,9 @@ static function preItemForm($params = []) {
$entities_id = isset($params['item']->fields['entities_id'])
? $params['item']->fields['entities_id']
: false; // false to use current entity
self::displayAlerts(['show_helpdesk_alerts' => true,
'show_hidden_alerts' => false,
'entities_id' => $entities_id
self::displayAlerts(['show_only_helpdesk_alerts' => true,
'show_hidden_alerts' => false,
'entities_id' => $entities_id
]);
echo "</br>";
}
Expand Down
5 changes: 5 additions & 0 deletions plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ Fonctionnalités
<author>TECLIB'</author>
</authors>
<versions>
<version>
<num>1.8.2</num>
<compatibility>~9.5.0</compatibility>
<download_url>https://github.com/pluginsGLPI/news/releases/download/1.8.2/glpi-news-1.8.2.tar.bz2</download_url>
</version>
<version>
<num>1.8.1</num>
<compatibility>~9.5.0</compatibility>
Expand Down
2 changes: 1 addition & 1 deletion setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
--------------------------------------------------------------------------
*/

define ('PLUGIN_NEWS_VERSION', '1.8.1');
define ('PLUGIN_NEWS_VERSION', '1.8.2');

// Minimal GLPI version, inclusive
define("PLUGIN_NEWS_MIN_GLPI", "9.5");
Expand Down

0 comments on commit 9f37232

Please sign in to comment.