This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
khosb/themes/default_admin/view-advanced.js
2011-05-03 09:49:04 +10:00

180 lines
4.3 KiB
JavaScript

function view_hideAll() {
if (! elements || ! elements.length)
return;
for (i=0; i<elements.length; i++)
document.getElementById(elements[i]).style.display='none';
showIFrame('iframe',0,0,'themes/'+THEME_NAME+'/IEFrameWarningBypass.htm');
}
function view_show(element) {
if (element == 'collapse')
view_hideAll();
else if (document.getElementById(element).style.display == 'none')
view_hideAll();
document.getElementById(element).style.display='block';
document.getElementById('tab').value = element;
}
function view_Jump(account_id) {
var action = document.getElementById('Jump').value;
switch (action) {
case 'approve':
if (module != 'invoice')
break;
pApproveVoid(id,1)
break;
case 'become':
document.location = URL+'?_page=account:account&id='+account_id+'&account_id='+account_id+'&do[]=account:user_login&tid='+THEME_NAME;
break;
case 'bill_force':
if (module != 'invoice')
break;
window.location.href = '?_page=invoice:view&id='+id+'&invoice_id='+id+'&do[]=invoice:autobill&ids='+ids+'&area=billing';
break;
case 'email':
showIFrame('iframe',getPageWidth(600),350,'?_page=account:mail_one&mail_account_id='+account_id);
break;
case 'force_queue':
if (module != 'service')
break;
document.location = '?_page='+module+':view&do[]=service:queue&id='+id;
break;
case 'generate_invoice':
if (module == 'service')
alert("Not enabled yet");
if (module != 'account')
break;
document.location = URL+'admin.php?_page='+module+':view&do[]=invoice:generateinvoice_account&account_id='+account_id+'&id='+account_id+'&_page_current='+module+':view';
break;
case 'merge':
if (module != 'account')
break;
showIFrame('iframe',getPageWidth(600),350,'?_page='+module+':merge&id='+account_id);
break;
case 'modify':
if (module != 'service')
break;
window.location.href = '?_page='+module+':modify&account_id='+account_id+'&service_id='+id;
break;
case 'pdf':
if (module != 'invoice')
break;
printView(id);
break;
case 'pw':
if (module != 'account')
break;
showIFrame('iframe',getPageWidth(600),350,'?_page=core:blank&_escape=1&do[]='+module+':send_password_email&id='+account_id);
break;
case 'reconcile':
if (module != 'invoice')
break;
showReconcile('0');
break;
case 'refresh':
window.location.href = '?_page='+module+':view&id='+id;
break;
case 'refund':
if (module != 'invoice')
break;
showRefund('0');
break;
case 'resend_email':
if (module != 'service')
break;
view_hideAll();
showIFrame('iframe',getPageWidth(600),350,'?_page=core:blank&do[]='+module+':resend_hosting_email&id='+id+'&account_id='+account_id);
break;
case 'suspend':
if (module != 'account')
break;
document.getElementById('view').account_status.value='0';
document.getElementById('view').submit();
break;
case 'unsuspend':
if (module != 'account')
break;
document.getElementById('view').account_status.value='1';
document.getElementById('view').submit();
break;
case 'verify_email':
if (module != 'account')
break;
showIFrame('iframe',getPageWidth(600),350,'?_page=core:blank&_escape=1&do[]='+module+':send_verify_email&id='+account_id);
break;
case 'void':
if (module != 'invoice')
break;
pApproveVoid(id,0)
break;
default:
alert("Unknown action: "+action+" for module: "+module);
}
document.getElementById('Jump').value = '';
}
function view_JumpView(account_id) {
var jump = document.getElementById('JumpView').value;
document.getElementById('JumpView').value = '';
document.location = '?_page=core:search&module='+jump+'&_next_page_one=view&'+jump+'_account_id='+account_id;
}
function view_JumpAdd(account_id) {
var jump = document.getElementById('JumpAdd').value;
document.getElementById('JumpAdd').value = '';
if (jump == 'discount')
url = '?_page='+jump+':add&'+jump+'_avail_account_id='+account_id;
else
url = '?_page='+jump+':add&'+jump+'_account_id='+account_id;
//view_show('collapse');
showIFrame('iframe',getPageWidth(600),500,url);
//document.location = url;
}
function view_Memos() {
view_hideAll();
var url = '?_page=core:search&module='+module+'_memo&_next_page_one=view&'+module+'_memo_'+module+'_id='+id;
showIFrame('iframe',getPageWidth(600),350,url);
}