// JavaScript Document // This is used for debugging the javascript portion of the site // It will popup a window with the value in () // - // alert (get_ch); function clearForm() { // document.displayForm.from_year.value = ""; // document.displayForm.from_month.value = ""; // document.displayForm.from_date.value = ""; // document.displayForm.partno.value = ""; // document.displayForm.salesorder.value = ""; // document.displayForm.to_year.value = ""; // document.displayForm.to_month.value = ""; // document.displayForm.to_date.value = ""; // document.displayForm.productcategory[0].selected = true; // document.displayForm.po.value = ""; } // This is where the dynamic code for select all needs to go, however // I Could not get it to pick up the var's correctly under ie function updateSelectedGroup(bundles,select_all,outer_sort, inner_sort) { // alert(bundles); // alert(select_all); // alert(outer_sort); // alert(inner_sort); // var toggle; // var bundle; // var t; // toggle = "user_select_all_" + outer_sort + "_toggle"; // t = "user_select_all_2_toggle"; // bundle = "/" + outer_sort + "_BUNDLE_" + inner_sort + "/"; // var form_re = new RegExp(".*request"); // var ell_re = new RegExp(t); // var bundle_re = new RegExp(bundle); // var op = 'op'; // var partner = 'partner_id'; // var clear = 'clear_navs'; // alert(toggle); // alert(bundle); // var image; // var myForm; // alert(document.forms.length); // alert(document.forms[document.forms.length-1]); // for (form in document.forms){ // var formName = document.forms[form].name; // if(formName){ // if(formName.match(/request/)){ // alert("TCP4: " + form); // alert("TCP4: " + document.forms[form].elements[op].value); // alert("TCP4: " + document.forms[form].elements[partner].value); // // alert("TCP4.1: " + document.forms[form].elements.length); // // // if(document.forms[form].elements){ // for (ell in document.forms[form].elements){ // var element = document.forms[form].elements[ell]; // if(element){ // var type = element.type; // if(type){ // if(type.match(/text/) || type.match(/hidden/)){ // var name = element.name; // var value = element.value; // alert("1: " + ell + "\n" // + "2: " + name + "\n" // + "3: " + type + "\n" // + "4: " + value + "\n" // + "5: " + element + "\n" // // ); // if(ell.match(bundle)){ // alert (formName + "->" + ellName); // } // } // } // } // } // } // } // } // } // image = this.form.toggle.src; // image = this.form.user_select_all_2_toggle.src; // alert(image); //function swapImage(elem) { //intImage = elem.id; //switch (intImage) { //case "0": //elem.src = "http://example.com/images/flag_0.jpg"; //elem.id = 1; //return(false); //case "1": //elem.src = "http://example.com/images/flag_1.jpg"; //elem.id = 2; //return(false); //case "2": //elem.src = "http://example.com/images/flag_2.jpg"; //elem.id = 0; //return(false); //} } function clr_search() { if (typeof document.cust_search.cc_name != "undefined") { document.cust_search.cc_name.value = ""; } if (typeof document.cust_search.cc_ident != "undefined") { document.cust_search.cc_ident.value = ""; } if (typeof document.cust_search.arc_ident != "undefined") { document.cust_search.arc_ident.value = ""; } if (typeof document.cust_search.arc_loc != "undefined") { document.cust_search.arc_loc.value = ""; } if (typeof document.cust_search.arc_pcat != "undefined") { document.cust_search.arc_pcat.value = ""; } if (typeof document.cust_search.arc_desc != "undefined") { document.cust_search.arc_desc.value = ""; } if (typeof document.cust_search.arc_hid != "undefined") { document.cust_search.arc_hid.value = ""; } if (typeof document.cust_search.arid != "undefined") { document.cust_search.arid.value = ""; } if (typeof document.cust_search.act_rec != "undefined") { document.cust_search.act_rec.value = ""; } } function change_report_selection(reports_list_str) { var report_type = document.reports.report_type; var report = document.reports.report_name; var reports_list = reports_list_str.split(/,/); // report[oList.length]= new Option("Please Select"); var optionNumber = 0; for (var i = 0; i < reports_list.length; i= i + 3){ if (reports_list[i] == report_type.value){ report.options[optionNumber] = new Option(reports_list[i + 2], reports_list[i + 1]); optionNumber++; } //report.size=report.length //You need to comment out this line of the function if you use this mod } report.length = optionNumber; // TCP: I don't know what the code here does, so I will leave commented // out for now. //A quick mod here, I changed the ==0 to ==1 so that the length //takes into account the Please select option from above. // if (reporte.options.length == 1){ // report.options[oList.options.length] = new Option(":: No SubCategories Available ::"); // } report.selectedIndex = 0; } function openPrinterFriendly(report_name,printer_friendly_format) { var url; url = "openPrinterFriendly.html?report_name="+report_name+"&printer_friendly_format="+printer_friendly_format; window.open(url,"","location=no,menubar=yes,toolbar=yes,scrollbars=yes,resizable=yes"); } function setValue(browse_url) { } function show_form(url) { document.cust_search.action = url; document.cust_search.method ="post"; document.cust_search.submit(); } function assign(form,total) { var serverid=0; if (total==1) { if(form.apprecord.checked) serverid=form.apprecord.value; } else { for (Count = 0; Count < total; Count++) { if (form.apprecord[Count].checked) { serverid=form.apprecord[Count].value; break; }}} if(serverid) { document.cust_search.action = "/server/assign.html?server_id="+serverid; document.cust_search.method="post"; document.cust_search.submit(); } } function assign_swa(form,total){ var serverid=0; if(total == 1){ if(form.apprecord.checked) serverid = form.apprecord.value; } else { for(Count = 0; Count < total; Count++){ if (form.apprecord[Count].checked){ serverid = form.apprecord[Count].value; break; } } } if(serverid){ document.cust_search.action = "/server/assign_PoS_swa.html?server_id=" + serverid; document.cust_search.method = "post"; document.cust_search.submit(); } } function view_lic(form,total) { var serverid=0; if (total==1) { if(form.apprecord.checked) serverid=form.apprecord.value; } else { for (Count = 0; Count < total; Count++) { if (form.apprecord[Count].checked) { serverid=form.apprecord[Count].value; break; }}} if(serverid) { document.cust_search.action = "/server/unassign.html?server_id="+serverid; document.cust_search.method="post"; document.cust_search.submit(); } } function create_app(path,companyid) { path=path+"&company_id="+companyid+"&action=Auto-Fill"; document.cust_search.action = path; document.cust_search.method ="post"; document.cust_search.submit(); } function expand_row(path,cust_id,order) { window.submitted = '4'; var url = path+"#"+cust_id; document.cust_search.customerid.value=cust_id; document.cust_search.order.value=order; document.cust_search.action = url; document.cust_search.method="post"; document.cust_search.submit(); } function expand_quote(path,cust_id,quote_num,order) { window.submitted = '4'; var url = path+"#"+cust_id; document.cust_view.customerid.value=cust_id; document.cust_view.quotenum.value=quote_num; document.cust_view.quote_expanded.value=1; document.cust_view.order.value=order; document.cust_view.action = url; document.cust_view.method="post"; document.cust_view.submit(); } function enable(path,cust_id,server_id,order) { var url = path+"#"+server_id; document.cust_search.customerid.value=cust_id; document.cust_search.serverid.value=server_id; document.cust_search.order.value=order; document.cust_search.action = url; document.cust_search.method="post"; document.cust_search.submit(); } function enable_custid(path,cust_id,order) { document.cust_search.customerid.value=cust_id; document.cust_search.testid.value=1; document.cust_search.order.value=order; document.cust_search.action = path+'#'+cust_id; document.cust_search.method="post"; document.cust_search.submit(); } function enable_customer(path,cust_id,order) { document.cust_view.customerid.value=cust_id; document.cust_view.order.value=order; document.cust_view.action = path+'#'+cust_id; document.cust_view.method="post"; document.cust_view.submit(); } function request_quote(path,companyid,whitelabel) { path=path+"&company_id="+companyid+"&white_label="+whitelabel; document.cust_view.action = path; document.cust_view.method ="post"; document.cust_view.submit(); } function change_order(path,order) { // alert ("path is "+path); // alert ("order is "+ order); if (order == 1) { document.cust_search.order.value=0; } else { document.cust_search.order.value=1; } document.cust_search.action = path; document.cust_search.method="post"; document.cust_search.submit(); } // On Click Plus image -- to open sub users of a partner function check_toggle(id) { var key = document.form_search.search_key.value; var url = "partner.html?search_key="+key+"&id="+id; document.form_result.action = url; document.form_result.method="post"; document.form_result.submit(); } //to retirn to the partner account from edit.html function Ret_to() { document.location="/search/partner.html?search_key=partner_on_partner_name&nid=1&ch=0"; } // to clear the aotohandler form function clearForm1() { document.form_search.search_word.value = ""; document.form_search.sap_id.value = ""; } // on click create account button function create_account() { var url = "/partner/create.html"; document.form_search.action = url; document.form_search.method="post"; document.form_search.submit(); } // Partner selection radio button function partner_selection(key) { // This is for debugging // alert("**" + key + "**"); // alert("*NID*" + NID + "**"); // alert("*PPID*" + PPID + "**"); // alert("*PID*" + PID + "**"); /// alert("*BC*" + BC + "**"); // window.location.hash="PARTNER_" + partner_id; // document.form_result.selected_partner.value = partner_id; if(key != 1){ key--; } var url = document.form_result.action + "#show" + key; document.form_result.action = url; document.form_result.method="post"; document.form_result.submit(); } function change_order_partner(field_name,direction) { //alert ("field name is "+ field_name); //alert ("direction is "+ direction); if (direction == "ASC") { document.form_result.field_name.value = field_name; document.form_result.direction.value = "DESC"; } else { document.form_result.field_name.value = field_name; document.form_result.direction.value = "ASC"; } var key = document.form_search.search_key.value; var url = "partner.html?search_key="+key; document.form_result.action = url; document.form_result.method="post"; document.form_result.submit(); } function change_order_licence(direction) { // alert("hello" + direction); if (direction == "ASC") { document.order_product.direction.value = "DESC"; } else { document.order_product.direction.value = "ASC"; } } function warp_to(url) { document.location = url; } function back_to_coverage_form() { document.pos_swa_form.op.value = 'displayCoverageForm'; document.pos_swa_form.method="post"; document.pos_swa_form.submit(); }