Skip to content

Commit 3157cb8

Browse files
authored
Merge pull request #26 from tomolimo/2.0
Fixed issue with non-existant dyn_forward html element
2 parents ca9299b + 7b2db9f commit 3157cb8

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?php
22
if (!defined('PM_VERSION')) {
3-
define("PM_VERSION", "3.3.0-community-RE-2.1");
4-
define("PM_BUILD_VERSION", "3.3.0-community-RE-2.1");
3+
define("PM_VERSION", "3.3.0-community-RE-2.2");
4+
define("PM_BUILD_VERSION", "3.3.0-community-RE-2.2");
55
}

workflow/public_html/glpi/glpi.js

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,8 @@ pm_glpi = {
203203

204204
// hide dyn_forward_assign when it is the last step in the task
205205
let dyn_forward_assign = document.querySelector('a[id*="dyn_forward" i][href="cases_Step?TYPE=ASSIGN_TASK&UID=-1&POSITION=10000&ACTION=ASSIGN"]');
206-
if (dyn_forward_assign) {
207-
dyn_forward_assign.outerHTML = '';
206+
if (dyn_forward_assign && dyn_forward_assign.style.display != 'none') {
207+
dyn_forward_assign.style.display = 'none';
208208
}
209209

210210
if (dyn_forward_assign && document.querySelector('html').postmessage.data.message == 'parentready') {
@@ -257,16 +257,18 @@ pm_glpi = {
257257

258258
// hide Next Step button, this button is displayed by Output Document form
259259
let next_step = document.getElementById('form[NEXT_STEP]');
260-
if (next_step) {
261-
next_step.outerHTML = '';
260+
if (next_step && next_step.style.display != 'none') {
261+
next_step.style.display = 'none';
262262
}
263263

264264
let cancelButton = document.getElementById('form[BTN_CANCEL]');
265-
if (cancelButton) {
266-
cancelButton.outerHTML = '';
265+
if (cancelButton && cancelButton.style.display != 'none') {
266+
cancelButton.style.display = 'none';
267267
let claimButton = document.getElementById('form[BTN_CATCH]');
268-
if (claimButton && GLPI_DATA.glpi_hide_claim_button) {
269-
claimButton.outerHTML = '';
268+
if (claimButton
269+
&& claimButton.style.display != 'none'
270+
&& GLPI_DATA.glpi_hide_claim_button) {
271+
claimButton.style.display = 'none';
270272
}
271273
}
272274

0 commit comments

Comments
 (0)