function editCategoryForm(cattitleid, currvalue) { var catid = cattitleid.substring(14); var form = '
'; document.getElementById(cattitleid).innerHTML=form; } /* function addDistrictUser(newid) { var callback = { success: function(o) { if(o.responseText != "") { var newDistrcitSpan = document.getElementById(newid); newDistrcitSpan.innerHTML=o.responseText; var index=newid.substring(newid.indexOf('_')+1); var newLocalSpan = document.getElementById('addLocal_'+index); newLocalSpan.innerHTML="Add School User"; } }, failure: function(o) { alert("AJAX doesnt work"); //FAILURE } } var catid=newid.substring(12); var ajaxurl = "includes/staffList.ajaxprocess.php?what=genereteDistrictStaffList&catid="+catid+"&sessionid=5c99f3a2cb9f0811744ba77e8618a89b"; var transaction = YAHOO.util.Connect.asyncRequest("GET", ajaxurl, callback, null); var catid=newid.substring(12); var ajaxurl = "includes/staffList.ajaxprocess.php?what=genereteDistrictStaffList&catid="+catid+"&sessionid=5c99f3a2cb9f0811744ba77e8618a89b"; $.ajax({ url: ajaxurl, type:'POST', success: function(o) { if(o != "") { var newDistrcitSpan = document.getElementById(newid); newDistrcitSpan.innerHTML=o.responseText; var index=newid.substring(newid.indexOf('_')+1); var newLocalSpan = document.getElementById('addLocal_'+index); newLocalSpan.innerHTML="Add School User"; } }, failure: function(o) { alert("AJAX doesnt work"); //FAILURE } }); } */ /* function addLocalUser(newid) { var callback = { success: function(o) { if(o.responseText != "") { var newLocalSpan = document.getElementById(newid); newLocalSpan.innerHTML=o.responseText; var index=newid.substring(newid.indexOf('_')+1); var newDistrictSpan = document.getElementById('addDistrict_'+index); newDistrictSpan.innerHTML="Add District User"; } }, failure: function(o) { alert("AJAX doesnt work"); //FAILURE } } var catid=newid.substring(9); var ajaxurl = "includes/staffList.ajaxprocess.php?what=generateLocalStaffList&catid="+catid+"&sessionid=5c99f3a2cb9f0811744ba77e8618a89b"; var transaction = YAHOO.util.Connect.asyncRequest("GET", ajaxurl, callback, null); var catid=newid.substring(9); var ajaxurl = "includes/staffList.ajaxprocess.php?what=generateLocalStaffList&catid="+catid+"&sessionid=5c99f3a2cb9f0811744ba77e8618a89b"; $.ajax({ url: ajaxurl, type:'POST', success: function(o) { if(o != "") { var newLocalSpan = document.getElementById(newid); newLocalSpan.innerHTML=o.responseText; var index=newid.substring(newid.indexOf('_')+1); var newDistrictSpan = document.getElementById('addDistrict_'+index); newDistrictSpan.innerHTML="Add District User"; } }, failure: function(o) { alert("AJAX doesnt work"); //FAILURE } }); } */ function insertUser(uid, catid) { /* var callback = { success: function(o) { if(o.responseText == "success") { //alert("Success, redirect here"); //window.location.reload() window.location = "staffListSimplified.phtml?sessionid=5c99f3a2cb9f0811744ba77e8618a89b&msg=User+Added"; } }, failure: function(o) { alert("AJAX doesnt work"); //FAILURE } } var ajaxurl = "includes/staffList.ajaxprocess.php?what=insertUser&uid="+uid+"&catid="+catid+"&sessionid=5c99f3a2cb9f0811744ba77e8618a89b"; var transaction = YAHOO.util.Connect.asyncRequest("GET", ajaxurl, callback, null); */ $.ajax({ url: "includes/staffList.ajaxprocess.php?what=insertUser&uid="+uid+"&catid="+catid+"&sessionid=5c99f3a2cb9f0811744ba77e8618a89b", type:'POST', success: function(o) { if(o == "success") { //alert("Success, redirect here"); //window.location.reload() window.location = "staffListSimplified.phtml?sessionid=5c99f3a2cb9f0811744ba77e8618a89b&msg=User+Added"; } }, failure: function(o) { alert("AJAX doesnt work"); //FAILURE } }); } var categorylist = ''; function displayMenu(span, uid, catid) { /* var callback = { success: function(o) { //var link1 = 'Hide from Org'; //var link2 = 'Hide Globally'; //var link3 = 'Uncategorized'; var categorylist = ''; span.parentNode.style.border='#808080 2px dashed'; span.parentNode.style.padding='3px'; //span.innerHTML=link1+" | "+link2+" | "+link3+" | "+categorylist; span.innerHTML=categorylist; }, failure: function(o) { alert("AJAX doesnt work"); //FAILURE } } var ajaxurl = "includes/staffList.ajaxprocess.php?what=getCategoryOptions&sessionid=5c99f3a2cb9f0811744ba77e8618a89b"; var transaction = YAHOO.util.Connect.asyncRequest("GET", ajaxurl, callback, null); */ if (categorylist=='') { $.ajax({ url: "includes/staffList.ajaxprocess.php?what=getCategoryOptions&sessionid=5c99f3a2cb9f0811744ba77e8618a89b", type:'POST', success: function(o) { //var link1 = 'Hide from Org'; //var link2 = 'Hide Globally'; //var link3 = 'Uncategorized'; categorylist = ''; //span.innerHTML=link1+" | "+link2+" | "+link3+" | "+categorylist; span.parentNode.style.border='#808080 2px dashed'; span.parentNode.style.padding='3px'; span.innerHTML=categorylist; }, failure: function(o) { alert("AJAX doesnt work"); //FAILURE } }); } else { span.parentNode.style.border='#808080 2px dashed'; span.parentNode.style.padding='3px'; span.innerHTML=categorylist; } } function removeUser(uid, catid, type) { /* var callback = { success: function(o) { if(o.responseText == "success") { //alert("Success, redirect here"); //window.location.reload() window.location = "staffListSimplified.phtml?sessionid=5c99f3a2cb9f0811744ba77e8618a89b&msg=User+Removed"; } }, failure: function(o) { alert("AJAX doesnt work"); //FAILURE } } var ajaxurl = "includes/staffList.ajaxprocess.php?what=removeUser&type="+type+"&uid="+uid+"&catid="+catid+"&sessionid=5c99f3a2cb9f0811744ba77e8618a89b"; var transaction = YAHOO.util.Connect.asyncRequest("GET", ajaxurl, callback, null); */ $.ajax({ url: "includes/staffList.ajaxprocess.php?what=removeUser&type="+type+"&uid="+uid+"&catid="+catid+"&sessionid=5c99f3a2cb9f0811744ba77e8618a89b", type:'POST', success: function(o) { if(o == "success") { //alert("Success, redirect here"); //window.location.reload() window.location = "staffListSimplified.phtml?sessionid=5c99f3a2cb9f0811744ba77e8618a89b&msg=User+Removed"; } }, failure: function(o) { alert("AJAX doesnt work"); //FAILURE } }); } function moveUser(uid, newcatid, oldcatid) { /* var callback = { success: function(o) { if(o.responseText == "success") { //alert("Success, redirect here"); //window.location.reload() window.location = "staffListSimplified.phtml?sessionid=5c99f3a2cb9f0811744ba77e8618a89b&msg=User+Moved"; } }, failure: function(o) { alert("AJAX doesnt work"); //FAILURE } } var ajaxurl = "includes/staffList.ajaxprocess.php?what=moveUser&uid="+uid+"&newcatid="+newcatid+"&oldcatid="+oldcatid+"&sessionid=5c99f3a2cb9f0811744ba77e8618a89b"; var transaction = YAHOO.util.Connect.asyncRequest("GET", ajaxurl, callback, null); */ $.ajax({ url: "includes/staffList.ajaxprocess.php?what=moveUser&uid="+uid+"&newcatid="+newcatid+"&oldcatid="+oldcatid+"&sessionid=5c99f3a2cb9f0811744ba77e8618a89b", type:'POST', success: function(o) { if(o == "success") { //alert("Success, redirect here"); //window.location.reload() window.location = "staffListSimplified.phtml?sessionid=5c99f3a2cb9f0811744ba77e8618a89b&msg=User+Moved"; } else { alert(o); } }, failure: function(o) { alert("AJAX doesnt work"); //FAILURE } }); } function getElementsByClass(searchClass,node,tag) { var classElements = new Array(); if ( node == null ) node = document; if ( tag == null ) tag = '*'; var els = node.getElementsByTagName(tag); var elsLen = els.length; var pattern = new RegExp("(^|\\s)"+searchClass+"(\\s|$)"); for (i = 0, j = 0; i < elsLen; i++) { if ( pattern.test(els[i].className) ) { classElements[j] = els[i]; j++; } } return classElements; } function collapseCategory(obj, collapselink,catcount) { if(obj.style.height=='24px') { //Currently closed, opening obj.style.height=''; obj.style.overflow=''; obj.style.position='relative'; collapselink.innerHTML='- '; document.getElementById(catcount).innerHTML=""; } else { //Currently open, close obj.style.height='24px'; obj.style.overflow='hidden'; obj.style.position='relative'; var staffcount = getElementsByClass("liquidUserContainer", obj, "div").length; collapselink.innerHTML='+ '; document.getElementById(catcount).innerHTML= " ("+staffcount+")"; } return false; }