Control remove button behavior in Manage Attachments dialog
UI page->attachment:
function setRemoveButton(e) { var removeButton = gel("removeButton"); var deletedSysIdsElement = gel("deleted_sys_ids"); var deletedSysIds = new Array(); var deletedString = deletedSysIdsElement.value; if (deletedString) deletedSysIds = deletedString.split(";"); var thisId = e.name.substring(7); if (e.checked) { removeButton.disabled = ""; deletedSysIds.push(thisId); } else { var index = deletedSysIds.indexOf(thisId); deletedSysIds.splice(index, 1); // are there any left checked? var inputs = document.getElementsByTagName("input"); var nonechecked = true; var i = 0; while(i < inputs.length && nonechecked) { if (inputs[i].type == "checkbox" && inputs[i].name.substring(0, 7) == "sys_id_") if (inputs[i].checked) nonechecked = false; i++; } if (nonechecked) { removeButton.disabled = "true"; } } deletedSysIds = deletedSysIds.join(";"); deletedSysIdsElement.value = deletedSysIds; //Added by jason 2017/12/18 if(!g_user.hasRole('itil')){ removeButton.disabled = "true"; } }
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。