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

Commit

Permalink
Merge release-21.10.next into 21.10.x (#240)
Browse files Browse the repository at this point in the history
* fix pipeline (#165)

* enh(provider): easyvista - rename provider + proxy configuration (#171)

* chore(php): manage php 8 compatibility (#172)

Refs: MON-7343

* enh(chore): automate dependabot ticket creation (#174)

* fix(chore): old dependabot's PR ticket creation (#175)

* enh(chore): issueType, feature_team and issue description (#177)

* align jenkinsfile

* chore(install): update version to 21.10.0-beta.2 (#178)

* chore(install): update version to 21.10.0-beta.2

* Update www/modules/centreon-open-tickets/conf.php

Co-authored-by: Kevin Duret <kduret@centreon.com>

* chore(install): update version to 21.10.0-rc1 (#179)

* chore(install): update version to 21.10.0-rc1

* Update www/modules/centreon-open-tickets/conf.php

Co-authored-by: Kevin Duret <kduret@centreon.com>

* chore(install): update version to 21.10.0 (#180)

* chore(ci): update qa branch of serie 21.10 (#182)

* fix(lint): fix linting of const in easyvista provider

* fix(chore): use github action env usage (#194)

* fix(build): disable centos8 packaging

* fix(chore): dependabot github automation (#196)

* enable el8 build and packaging dev-21.10.x (#198)

* enable el8 build and packaging dev-21.10.x

* Update Jenkinsfile

* providers: email provider title issue + bump phpmailer + code sanitize (#206)

* fix(install): manage different name for database centreon_storage (#207)

* fix(widget): display the state type for service and not for host (#208)

* enh(provider): preselect if only 1 choice in list selection (#209)

* enh(acknowledgement): use default options (#210)

* enh(provider): manage phpmailer exception (#211)

* enh(provider): can use user name in smarty popup (#212)

* enh(widget): add duration filter (#213)

* enh(provider): add schedule check option (#214)

* fix(jira): update fields with new keys (#185)

Refs: MON-12560

Co-authored-by: Kevin Duret <kduret@centreon.com>

* upgrade version to 21.10.1

Co-authored-by: Zakaria Guennoune <83596451+zguennoune02@users.noreply.github.com>
Co-authored-by: qgarnier <garnier.quentin@gmail.com>
Co-authored-by: Kevin Duret <kduret@centreon.com>
Co-authored-by: sc979 <34628915+sc979@users.noreply.github.com>
Co-authored-by: Zakaria Guennoune <zguennoune@centreon.com>
Co-authored-by: Adrien Morais <amorais@centreon.com>
Co-authored-by: ponchoh <hmorales@centreon.com>
  • Loading branch information
8 people authored Jul 22, 2022
1 parent 431a804 commit 94674e4
Show file tree
Hide file tree
Showing 35 changed files with 6,841 additions and 5,478 deletions.
4 changes: 2 additions & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import groovy.json.JsonSlurper
*/
properties([buildDiscarder(logRotator(numToKeepStr: '50'))])
def serie = '21.10'
def maintenanceBranch = "${serie}.x"
def stableBranch = "${serie}.x"
if (env.BRANCH_NAME.startsWith('release-')) {
env.BUILD = 'RELEASE'
} else if ((env.BRANCH_NAME == 'master') || (env.BRANCH_NAME == maintenanceBranch)) {
} else if (env.BRANCH_NAME == stableBranch) {
env.BUILD = 'REFERENCE'
} else {
env.BUILD = 'CI'
Expand Down
1 change: 1 addition & 0 deletions widgets/open-tickets/configs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<preference label="Display Warning" name="svc_warning" defaultValue="1" type="boolean"/>
<preference label="Display Critical" name="svc_critical" defaultValue="1" type="boolean"/>
<preference label="Display Unknown" name="svc_unknown" defaultValue="1" type="boolean"/>
<preference label="Duration Filter (seconds)" name="duration_filter" defaultValue="" type="compare"/>
<preference label="Criticities Filters (criticities name separated by ',')" name="criticality_filter" defaultValue="" type="text"/>
<preference label="Acknowledgement Filter" name="acknowledgement_filter" defaultValue="all" type="list">
<option value="ack" label="Acknowledged"/>
Expand Down
9 changes: 5 additions & 4 deletions widgets/open-tickets/src/action.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,14 @@ function format_popup()

$result = $rule->getFormatPopupProvider(
$preferences['rule'],
array(
[
'title' => $title,
'user' => array(
'user' => [
'name' => $centreon->user->name,
'alias' => $centreon->user->alias,
'email' => $centreon->user->email
)
),
]
],
$widgetId,
$uniq_id,
$_REQUEST['cmd'],
Expand Down
34 changes: 32 additions & 2 deletions widgets/open-tickets/src/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
s.service_id,
s.description,
s.state AS s_state,
h.state_type AS state_type,
s.state_type AS state_type,
s.last_hard_state,
s.output,
s.scheduled_downtime_depth AS s_scheduled_downtime_depth,
Expand Down Expand Up @@ -223,7 +223,7 @@
);
}
}
$stateTab = array();
$stateTab = [];
if (isset($preferences['svc_warning']) && $preferences['svc_warning']) {
$stateTab[] = 1;
}
Expand All @@ -237,6 +237,36 @@
if (count($stateTab)) {
$query = CentreonUtils::conditionBuilder($query, " s.state IN (" . implode(',', $stateTab) . ")");
}

if (! empty($preferences['duration_filter'])) {
$tab = explode(" ", $preferences['duration_filter']);
if (
count($tab) >= 2
&& ! empty($tab[0])
&& is_numeric($tab[1])
) {
$op = $tab[0];
if ($op === 'gt') {
$op = 'lt';
} elseif ($op === 'lt') {
$op = 'gt';
} elseif ($op === 'gte') {
$op = 'lte';
} elseif ($op === 'lte') {
$op = 'gte';
}
$op = CentreonUtils::operandToMysqlFormat($op);

$durationValue = time() - $tab[1];
if (! empty($op)) {
$query = CentreonUtils::conditionBuilder(
$query,
"s.last_state_change " . $op . " " . $durationValue
);
}
}
}

if (isset($preferences['hide_down_host']) && $preferences['hide_down_host']) {
$query = CentreonUtils::conditionBuilder($query, " h.state != 1 ");
}
Expand Down
6 changes: 3 additions & 3 deletions widgets/open-tickets/src/templates/acknowledge.ihtml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@
<td class="FormRowValue"><input type='checkbox' name='processServices' {$process_service_checked}/></td>
</tr>
{/if}
<!--<tr>
<tr>
<td class="FormRowField">{$forceCheckLabel}</td>
<td class="FormRowValue"><input type='checkbox' name='forcecheck' {$force_active_checked}/></td>
</tr>-->
</tr>
</table>
<div id="validForm">
<input type='hidden' name='selection' value='{$selection}' />
Expand Down Expand Up @@ -79,4 +79,4 @@ function serviceAck() {
jQuery(function() {
});
</script>
{/literal}
{/literal}
4 changes: 2 additions & 2 deletions www/modules/centreon-open-tickets/conf.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

$module_conf['centreon-open-tickets']["rname"] = "Centreon Open Tickets";
$module_conf['centreon-open-tickets']["name"] = "centreon-open-tickets";
$module_conf['centreon-open-tickets']["mod_release"] = "21.10.0";
$module_conf['centreon-open-tickets']["mod_release"] = "21.10.1";
$module_conf['centreon-open-tickets']["infos"] = "Centreon Open Tickets is a community module developed to " .
"create tickets to your favorite ITSM tools using API.
Expand All @@ -37,7 +37,7 @@
$module_conf['centreon-open-tickets']["is_removeable"] = "1";
$module_conf['centreon-open-tickets']["author"] = "Centreon";
$module_conf['centreon-open-tickets']["stability"] = "stable";
$module_conf['centreon-open-tickets']["last_update"] = "2021-10-29";
$module_conf['centreon-open-tickets']["last_update"] = "2022-7-19";
$module_conf['centreon-open-tickets']["release_note"] =
"https://docs.centreon.com/21.10/en/releases/centreon-os-extensions.html";
$module_conf['centreon-open-tickets']["images"] = [
Expand Down
Loading

0 comments on commit 94674e4

Please sign in to comment.