109 lines
3.2 KiB
JavaScript
109 lines
3.2 KiB
JavaScript
function InitPage()
|
|
{
|
|
$("#tobeltdiv").hide();
|
|
$("#btntransfer").hide();
|
|
$("#transfering").hide();
|
|
}
|
|
function ChangeMode()
|
|
{
|
|
$("#tobeltdiv").toggle();
|
|
$("#btntransfer").toggle();
|
|
}
|
|
function TransferColony(FormId)
|
|
{
|
|
var toBelt=document.getElementById("selbeltto");
|
|
validate(toBelt,'t','');
|
|
setHFList("collist");
|
|
if(checkForm())
|
|
{
|
|
if($("#hfdelstat").val()!='')
|
|
{
|
|
startTransfer(toBelt);
|
|
}
|
|
else
|
|
{
|
|
CallMessage('VLFRM:error:Please select colonies to transfer.',3000,200,300);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
return false;
|
|
}
|
|
}
|
|
function startTransfer(toBelt)
|
|
{
|
|
|
|
var QueryStr="to="+toBelt.value+"&uid="+$("#usid").val()+"&cols="+$("#hfdelstat").val()+"&bid="+$("#bid").val();
|
|
$("#btntransfer").hide();
|
|
$("#transfering").show();
|
|
RunAjax("GET","transfercolony",QueryStr,1);
|
|
}
|
|
function showColonyInfo(colid,beltid)
|
|
{
|
|
QueryStr="cid="+colid+"&suuid="+$("#suuid").val();
|
|
MatrixFrameDialog.open("colonymgmt?"+QueryStr, "Colony Details", {width: "720px", height: "560px"}).then(function(retVal) {
|
|
if(retVal && retVal!="")
|
|
{
|
|
$("#crtcolname"+colid).html(retVal.split(ColDelim)[0]);
|
|
$("#pinc"+colid).html(retVal.split(ColDelim)[2]);
|
|
$("#zone"+colid).html(retVal.split(ColDelim)[3]);
|
|
$("#city"+colid).html(retVal.split(ColDelim)[4]);
|
|
$("#belt"+colid).html('<div id="crtbeltname'+retVal.split(ColDelim)[5]+'" class="linkbutton" style="float:left;font-size:inherit;font-weight:normal" onclick="showBeltInfo('+retVal.split(ColDelim)[5]+')" title="Edit details">'+retVal.split(ColDelim)[1]+'</div>');
|
|
}
|
|
});
|
|
}
|
|
function showBeltInfo(beltid)
|
|
{
|
|
QueryStr="bid="+beltid+"&suuid="+$("#suuid").val();
|
|
MatrixFrameDialog.open("beltinfo?"+QueryStr, "Belt Details", {width: "640px", height: "440px"}).then(function(retVal) {
|
|
if(retVal && retVal!="")
|
|
{
|
|
var tmpHtml=$("#selbeltto").html();
|
|
tmpHtml=tmpHtml.replace(/selected>/g,">");
|
|
$("#selbeltto").html(tmpHtml+retVal);
|
|
}
|
|
});
|
|
}
|
|
function AfterResponse(AjaxResponse,OprID)
|
|
{
|
|
if(OprID==1)
|
|
{
|
|
if(AjaxResponse.search("success:")==0)
|
|
{
|
|
CallMessage('COLTRANS:info:Colony(s) transferred successfully.',3000,200,300);
|
|
}
|
|
else
|
|
{
|
|
AjaxResponse.replace('failed:','');
|
|
CallMessage('COLTRANS:error:Colony(s) transfer failed. '+AjaxResponse,3000,200,300);
|
|
}
|
|
$("#btntransfer").show();
|
|
$("#transfering").hide();
|
|
}
|
|
}
|
|
function ValidateSubmitColony()
|
|
{
|
|
validate(document.getElementById("clocation"),'t','SplInstruction');
|
|
validate(document.getElementById("carea"),'f','SplInstruction');
|
|
validate(document.getElementById("czone"),'t','AlphaNumeric');
|
|
validate(document.getElementById("pincode"),'t','Pincode');
|
|
validate(document.getElementById("ccity"),'t','');
|
|
validate(document.getElementById("beltid"),'t','');
|
|
validate(document.getElementById("isactive"),'t','');
|
|
if(checkForm())
|
|
{
|
|
SubmitForm('updcolony','_parent','colony');
|
|
}
|
|
}
|
|
function CloseDialog()
|
|
{
|
|
var retval='';
|
|
retval=retval+($("#clocation").val())+ColDelim;
|
|
retval=retval+($("#beltid option:selected").text())+ColDelim;
|
|
retval=retval+($("#pincode").val())+ColDelim;
|
|
retval=retval+($("#czone").val())+ColDelim;
|
|
retval=retval+($("#ccity").val())+ColDelim;
|
|
retval=retval+($("#beltid").val());
|
|
MatrixDialog.close(retval);
|
|
}
|