2017-05-19 01:50:56 +08:00
|
|
|
function newGroup() {
|
|
|
|
createPopup( '?view=group', 'zmGroup', 'group' );
|
2008-07-14 21:54:50 +08:00
|
|
|
}
|
|
|
|
|
2017-10-01 02:19:32 +08:00
|
|
|
function setGroup( element ) {
|
2017-05-19 01:50:56 +08:00
|
|
|
var form = element.form;
|
|
|
|
form.action.value = 'setgroup';
|
|
|
|
form.submit();
|
2008-07-14 21:54:50 +08:00
|
|
|
}
|
|
|
|
|
2020-04-03 02:13:28 +08:00
|
|
|
function editGroup( element ) {
|
|
|
|
var gid = element.getAttribute('data-group-id');
|
|
|
|
if ( !gid ) {
|
|
|
|
console.log('No group id found in editGroup');
|
|
|
|
} else {
|
|
|
|
createPopup('?view=group&gid='+gid, 'zmGroup'+gid, 'group');
|
|
|
|
}
|
2008-07-14 21:54:50 +08:00
|
|
|
}
|
|
|
|
|
2017-05-19 01:50:56 +08:00
|
|
|
function deleteGroup( element ) {
|
|
|
|
var form = element.form;
|
|
|
|
form.view.value = currentView;
|
|
|
|
form.action.value = 'delete';
|
|
|
|
form.submit();
|
2008-07-14 21:54:50 +08:00
|
|
|
}
|
|
|
|
|
2017-05-19 01:50:56 +08:00
|
|
|
function configureButtons( element ) {
|
|
|
|
if ( canEditGroups ) {
|
|
|
|
var form = element.form;
|
|
|
|
if ( element.checked ) {
|
|
|
|
form.deleteBtn.disabled = (element.value == 0);
|
2008-07-14 21:54:50 +08:00
|
|
|
}
|
2017-05-19 01:50:56 +08:00
|
|
|
}
|
2008-07-14 21:54:50 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
window.focus();
|