Your IP : 3.137.171.96


Current Path : /home/bitrix/ext_www/klimatlend.ua/bitrix/activities/bitrix/stateactivity/
Upload File :
Current File : /home/bitrix/ext_www/klimatlend.ua/bitrix/activities/bitrix/stateactivity/stateactivity.min.js

StateActivity=function(){var e=new BizProcActivity;e.Type="StateActivity";e.Draw=function(t){e.main=t.appendChild(document.createElement("TABLE"));e.main.cellPadding=0;e.main.width="220";e.main.cellSpacing=0;e.main.style.fontSize="12px";e.main.style.textAlign="left";var i=e.main.insertRow(-1);i.id=e.Name;var n=i.insertCell(-1);n.width="5";n.style.background="url(/bitrix/images/bizproc/stat_hl.gif)";var r=i.insertCell(-1);r.noWrap="nowrap";r.style.background="url(/bitrix/images/bizproc/stat_hbg.gif)";r.style.height="24px";n=i.insertCell(-1);n.width="5";n.style.background="url(/bitrix/images/bizproc/stat_hr.gif)";var a=r.appendChild(document.createElement("TABLE"));a.width="100%";a.cellPadding=0;a.cellSpacing=0;a.style.fontSize="12px";i=a.insertRow(-1);n=i.insertCell(-1);var l=n.appendChild(document.createElement("DIV"));l.innerHTML="<b>"+HTMLEncode(e["Properties"]["Title"])+"</b>";l.style.padding="5px";l.style.marginLeft="5px";l.style.width="160px";l.style.overflow="hidden";l.style.whiteSpace="nowrap";l.title=e["Properties"]["Title"];l.align="left";n=i.insertCell(-1);n.className="statset";n.onclick=e.OnSettingsClick;n=i.insertCell(-1);n.className="statdel";n.onclick=e.OnRemoveClick;i=e.main.insertRow(-1);n=i.insertCell(-1);n.style.background="url(/bitrix/images/bizproc/stat_l.gif) left top repeat-y";var c=i.insertCell(-1);n=i.insertCell(-1);n.style.background="url(/bitrix/images/bizproc/stat_r.gif) right top repeat-y";c.style.backgroundColor="#ffffff";c.style.padding="5px";e.commandTable=c.appendChild(_crt(1,1));e.commandTable.cellPadding="4";e.commandTable.rows[0].cells[0].align="left";e.commandTable.rows[0].cells[0].style.fontSize="12px";var o=e.commandTable.rows[0].cells[0].appendChild(jsUtils.CreateElement("A",{href:"javascript:void(0)"}));o.onclick=e.ShowAddMenu;o.style.textDecoration="none";o.innerHTML=BPMESS["STATEACT_ADD"]+' <img src="/bitrix/images/bizproc/add.gif" border="0">';for(var s=0;s<e.childActivities.length;s++){var d,v=e.commandTable.insertRow(-1),p=v.insertCell(-1),m;if(e.childActivities[s]["Type"]=="EventDrivenActivity"){d=e.childActivities[s].childActivities[0]["Properties"]["Title"];if(e.childActivities[s].childActivities[0].Type!="DelayActivity")m="cmd";else m="delay"}else{if(e.childActivities[s]["Properties"]["Title"])d=e.childActivities[s]["Properties"]["Title"];if(e.childActivities[s].Type=="StateFinalizationActivity")m="fin";else m="init"}v.id=e.childActivities[s].Name;var A=p.appendChild(document.createElement("TABLE")),h=A.insertRow(-1),y=h.insertCell(-1);A.style.fontSize="12px";A.width="100%";y.width=12;y.height=12;y.style.background="url(/bitrix/images/bizproc/state"+m+".gif) center center no-repeat";y=h.insertCell(-1);y.innerHTML=HTMLEncode(d);y.onclick=e.clickrow;y.title=BPMESS["STATEACT_EDITBP"];y=h.insertCell(-1);y.width=20;y.height=12;y.style.background="url(/bitrix/images/bizproc/state_set.gif) center center no-repeat";y.title=BPMESS["STATEACT_SETT"];y.onclick=e.settings;y=h.insertCell(-1);y.width=12;y.height=12;y.style.background="url(/bitrix/images/bizproc/state_del.gif) center center no-repeat";y.title=BPMESS["STATEACT_DEL"];y.onclick=e.remove;p.style.borderTop="1px solid #e5e5e5";p.style.fontSize="12px";p.style.cursor="pointer";p.onmouseover=function(e){this.style.backgroundColor="#f7f7f7"};p.onmouseout=function(e){this.style.backgroundColor="#FFFFFF"}}i=e.main.insertRow(-1);n=i.insertCell(-1);n.width="5";n.style.background="url(/bitrix/images/bizproc/stat_bl.gif)";n=i.insertCell(-1);n.style.background="url(/bitrix/images/bizproc/stat_b.gif)";n.height="5";n=i.insertCell(-1);n.width="5";n.style.background="url(/bitrix/images/bizproc/stat_br.gif)"};e.OnRemoveClick=function(){e.parentActivity.RemoveChild(e)};e.remove=function(t){var i=this.parentNode.parentNode.parentNode.parentNode.parentNode.id;for(var n in e.childActivities){if(!e.childActivities.hasOwnProperty(n)){continue}if(e.childActivities[n]["Name"]==i){e.commandTable.deleteRow(parseInt(n)+1);e.RemoveChild(e.childActivities[n]);e.parentActivity.DrawLines();break}}};e.settings=function(t){var i=this.parentNode.parentNode.parentNode.parentNode.parentNode.id;for(var n in e.childActivities){if(!e.childActivities.hasOwnProperty(n)){continue}if(e.childActivities[n]["Name"]==i){if(e.childActivities[n].Type=="EventDrivenActivity")e.childActivities[n].childActivities[0].Settings();else e.childActivities[n].Settings();break}}};e.clickrow=function(t){var i=this.parentNode.parentNode.parentNode.parentNode.parentNode.id;for(var n in e.childActivities){if(!e.childActivities.hasOwnProperty(n)){continue}if(e.childActivities[n]["Name"]==i){e.SequentialShow(e.childActivities[n]);break}}};e.HideRows=function(){for(var t=0;t<e.parentActivity.__l.length;t++)for(var i=0;i<5;i++)e.parentActivity.__l[t][i].style.display="none"};e.SequentialShow=function(t){rootActivity._redrawObject=t;e.parentActivity.Table.style.display="none";e.HideRows();e.__header=e.parentActivity.Table.parentNode.appendChild(document.createElement("DIV"));e.__header.style.fontSize="12px";var i=e.__header.appendChild(document.createElement("A"));i.href="javascript:void(0)";i.onclick=e.SequentialHide;i.innerHTML=HTMLEncode(e.Properties["Title"]);var n=e.__header.appendChild(document.createElement("span"));n.innerHTML=" - "+(t.Type!="EventDrivenActivity"?HTMLEncode(t.Properties["Title"]):HTMLEncode(t.childActivities[0].Properties["Title"]));e.__seq=e.parentActivity.Table.parentNode.appendChild(document.createElement("DIV"));e.__footer=e.parentActivity.Table.parentNode.appendChild(document.createElement("DIV"));var r=e.__footer.appendChild(jsUtils.CreateElement("INPUT",{type:"button",value:BPMESS["STATEACT_BACK"]}));r.onclick=e.SequentialHide;r.style.margin="15px";if(document.getElementById("bizprocsavebuttons"))document.getElementById("bizprocsavebuttons").style.display="none";t.Draw(e.__seq)};e.SequentialHide=function(){try{e.parentActivity.Table.style.display="table"}catch(t){e.parentActivity.Table.style.display="block"}e.__header.parentNode.removeChild(e.__header);e.__seq.parentNode.removeChild(e.__seq);e.__footer.parentNode.removeChild(e.__footer);if(document.getElementById("bizprocsavebuttons"))document.getElementById("bizprocsavebuttons").style.display="block";rootActivity._redrawObject=null;arWorkflowTemplate=rootActivity.Serialize();ReDraw()};e.AddInitialize=function(){var t=e.commandTable.insertRow(1);var i=t.insertCell(-1);i.innerHTML="";var n=CreateActivity("StateInitializationActivity");e.childActivities.push(n);n.parentActivity=e;e.SequentialShow(n)};e.AddCommand=function(){var t=CreateActivity("EventDrivenActivity");var i=CreateActivity("HandleExternalEventActivity");t.childActivities.push(i);i.parentActivity=t;var n=e.commandTable.insertRow(1);var r=n.insertCell(-1);r.innerHTML="";e.childActivities.push(t);t.parentActivity=e;i.Settings()};e.AddDelayActivity=function(){var t=CreateActivity("EventDrivenActivity");var i=CreateActivity("DelayActivity");t.childActivities.push(i);i.parentActivity=t;var n=e.commandTable.insertRow(1);var r=n.insertCell(-1);r.innerHTML="";e.childActivities.push(t);t.parentActivity=e;i.Settings()};e.AddFinilize=function(){var t=e.commandTable.insertRow(1);var i=t.insertCell(-1);i.innerHTML="";var n=CreateActivity("StateFinalizationActivity");e.childActivities.push(n);n.parentActivity=e;e.SequentialShow(n)};e.ShowAddMenu=function(t){e.menu=new PopupMenu("state_float_menu");e.menu.Create(2e3);if(e.menu.IsVisible())return;var i=false,n=false;for(var r=0;r<e.childActivities.length;r++){if(e.childActivities[r].Type=="StateInitializationActivity")i=true;if(e.childActivities[r].Type=="StateFinalizationActivity")n=true}e.menuItems=new Array;e.menuItems.push({ID:"2",TEXT:BPMESS["STATEACT_MENU_COMMAND"],ONCLICK:"__StateActivityAdd('command', '"+e.Name+"')"});e.menuItems.push({ID:"3",TEXT:BPMESS["STATEACT_MENU_DELAY"],ONCLICK:"__StateActivityAdd('delay', '"+e.Name+"')"});if(!i)e.menuItems.push({ID:"1",TEXT:BPMESS["STATEACT_MENU_INIT"],ONCLICK:"__StateActivityAdd('init', '"+e.Name+"')"});if(!n)e.menuItems.push({ID:"5",TEXT:BPMESS["STATEACT_MENU_FIN"],ONCLICK:"__StateActivityAdd('finish', '"+e.Name+"')"});e.menu.SetItems(e.menuItems);e.menu.BuildItems();var a=jsUtils.GetRealPos(this);a["bottom"]+=1;e.menu.PopupShow(a)};e.RemoveResources=function(){e.main.parentNode.removeChild(e.main)};return e};__StateActivityAdd=function(e,t){var i;for(var n=0;n<rootActivity.childActivities.length;n++){if(rootActivity.childActivities[n]["Name"]==t){i=rootActivity.childActivities[n];switch(e){case"init":i.AddInitialize();break;case"command":i.AddCommand();break;case"delay":i.AddDelayActivity();break;case"finish":i.AddFinilize();break}break}}};