add enoperm js function

This commit is contained in:
Andrew Bauer
2020-09-13 11:04:04 -05:00
parent 096f4a446f
commit 54e8d1352a
2 changed files with 23 additions and 1 deletions

View File

@@ -808,7 +808,7 @@ function getENoPermHTML() {
$result .= '<p>' .translate('ContactAdmin'). '</p>'.PHP_EOL;
$result .= '</div>'.PHP_EOL;
$result .= '<div class="modal-footer">'.PHP_EOL;
$result .= '<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>'.PHP_EOL;
$result .= '<button type="button" id="enpCloseBtn" class="btn btn-secondary" data-dismiss="modal">Close</button>'.PHP_EOL;
$result .= '</div>'.PHP_EOL;
$result .= '</div>'.PHP_EOL;
$result .= '</div>'.PHP_EOL;

View File

@@ -720,3 +720,25 @@ function reminderClickFunction() {
});
});
}
// Load then show the "You No Permission" error modal
function enoperm() {
$j.getJSON(thisUrl + '?request=modal&modal=enoperm')
.done(function(data) {
if ( $j('#ENoPerm').length ) {
$j('#ENoPerm').replaceWith(data.html);
} else {
$j("body").append(data.html);
}
$j('#ENoPerm').modal('show');
// Manage the CLOSE optionhelp modal button
document.getElementById("enpCloseBtn").addEventListener("click", function onENPCloseClick(evt) {
$j('#ENoPerm').modal('hide');
});
})
.fail(function(jqxhr, textStatus, error) {
console.log("Request Failed: " + textStatus + ", " + error);
console.log("Response Text: " + jqxhr.responseText);
});
}