<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge" />
	<link rel="stylesheet" type="text/css" href="../../../theme/css/censusmain.css"/>
	<script type="text/javascript" src="../../js/workflow/tmplgroups.js"></script>
	<script type="text/javascript" src="../../js/workflow/tmplcondition.js"></script>
	<script type="text/javascript" src="../../js/workflow/tmplworkflow.js"></script>
	<script type="text/javascript" src="../../js/workflow/ruleconstants.js"></script>
	<script type="text/javascript" src="../../../js/files.js"></script>
	<script type="text/javascript" src="../../../js/strings.js"></script>
	<script type="text/javascript" src="../../../js/images.js"></script>
	<script type="text/javascript" src="../../../js/window.js"></script>
	<script type="text/javascript" src="../../../js/popupmenu/hm_var.js"></script>
	<script type="text/javascript" src="../../js/workflow/cmqrulevalidation.js"></script>
	<script type="text/javascript" src="../../js/workflow/cmquielements.js"></script>
	<script type="text/javascript" src="../../js/workflow/tmplmenu.js"></script>	
	<script type="text/javascript" src="../../js/workflow/cmqrulemgr.js"></script>
	<script type="text/javascript" src="../../js/workflow/cmqactionmgr.js"></script>
	<script type="text/javascript" src="../../js/workflow/hm_arrays.js"></script>
	<script type="text/javascript" src="../../js/workflow/hm_loader.js"></script>
	<script type="text/javascript" src="../../../js/cmqtreeutils.js"></script>
	<script type="text/javascript" src="../../../js/cmqstring.js"></script>
	<script type="text/javascript" src="../../../js/mqsysutils.js"></script>
	<script type="text/javascript" src="../../../js/cmqsysmsg.js"></script>
	
	<script type="text/javascript" src="../../../js/mqloaddata.js"></script>
	<script type="text/javascript" src="../../../js/cmqlookupitemint.js"></script>
	<script type="text/javascript" src="../../../js/initlookupitemint.js"></script>
	
	<script type="text/javascript" src="../../../js/codebasegrid/dhtmlxcommon.js"></script>
	<script type="text/javascript" src="../../../js/codebasegrid/dhtmlxgrid.js"></script>
	<script type="text/javascript" src="../../../js/codebasegrid/dhtmlxgridcell.js"></script>
	<link rel="stylesheet" type="text/css" href="../../../js/codebasegrid/dhtmlxgrid.css">
	<link rel="stylesheet" type="text/css" href="../../../js/codebasegrid/skins/dhtmlxgrid_dhx_skyblue.css">
	
	<link rel="stylesheet" type="text/css" href="../../../js/JQUERY/jquery-ui-1.10.2.custom.css"/>
	
	<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.2.0/css/all.css">
	
	<link rel="stylesheet" href="../../../js/jquery/jquery.ui.all.css">		
	<script type="text/javascript" src="../../../js/jquery/jquery-1.7.1.js"></script>
	<script type="text/javascript" src="../../../js/jquery/jquery.bgiframe-2.1.2.js"></script>
	<script type="text/javascript" src="../../../js/jquery/jquery.ui.core.js"></script>
	<script type="text/javascript" src="../../../js/jquery/jquery.ui.widget.js"></script>
	<script type="text/javascript" src="../../../js/jquery/jquery.ui.mouse.js"></script>
	<script type="text/javascript" src="../../../js/jquery/jquery.ui.draggable.js"></script>
	<script type="text/javascript" src="../../../js/jquery/jquery.ui.position.js"></script>
	<script type="text/javascript" src="../../../js/jquery/jquery.ui.resizable.js"></script>
	<script type="text/javascript" src="../../../js/jquery/jquery.ui.dialog.js"></script>
	
<style type="text/css">
 div.gridbox_dhx_skyblue table.obj tr.rowselected td{
	background-color:#FFF1CC;
 }
 
 div.gridbox_dhx_skyblue table.obj tr.rowselected td.cellselected {
	background-color:#FFF1CC;
}
</style>

	<script type="text/javascript">
		// always define this object for the system messages
		var objSysMsg = new CMqSysMsg;
		var m_objMqButton=new MqButton();
		var m_objLoadDataMgr;
		var File= new MqFiles;
		var objRuleValidation = new CMqRuleValidation;
		var objUIElements = new CMqUIElements;
		var objRuleMgr = new CMqRuleMgr;
		var objActionMgr = new CMqActionMgr;
		var m_arrTabs=new Array();
		var m_objMqTreeUtils=new CMqTreeUtils;
		var m_objCondMgr=new CMqCondMgr;
		var objString = new CMqString;
		var initialized=true;
		m_objCondMgr.Window=window;
		var tmplTree;
		var tmplGrid;
		var rulesGrid;
		var m_strWinID=parseInt( Math.random() * 1000);
		var m_objLookupItemInfoColl=new Array();
		var m_strPathToAdminHTML = "../../../HTML/";
	</script>
	
</head>

<body class="RecordBody" id="bdWorkflow" onload="loaded=true;onLoadForm();" 
	leftmargin=0 topmargin=0 onunload="OnBeforeNavigate();" onresize="ResizeForm()" style="overflow-y:scroll;">
	<div id="wait" style="position:absolute;width=100%;height=100%;cursor=wait;visibility=hidden"></div>

	<form name="frmWorkflow">
	<!--open table for top part of screen-->

		<script type="text/javascript">
																
			function onLoadForm(){
				ResizeForm();
				
				initialize();
																						
				objActionMgr.ActionWindow=document.Params;
				
				objActionMgr.LoadActions(0,0);
				
				setTimeout("HM_f_StartIt()",10);
			}
			function ConfirmResetAll () {
				if(confirm(g_MqRef.RESX['WORKFLOW_MSG_CONFIRM_RESET'])) {
					 objRuleMgr.ResetAll();
				} else {
					
				}
			}
		</script>
	<table height="30" width="100%" cellpadding="0" cellspacing="0" border="0" style="padding-top:20px"><!--open table for top-->
		<tr height="30">
			<td style="padding-left:10px" align="left" width="10%">
				<input type="hidden" name="txtSaveVals" >
				<input type="hidden" name="txtSelectedParamTab" >
				<input type="hidden" name="txtConditions" >
				<input type="hidden" name="txtParam1" >
				<input type="hidden" name="txtParam2">
				<input type="hidden" name="txtConditionFields" >
				<input type="hidden" name="txtParam2Fields">
				<input type="hidden" name="txtConditionValues" >
				<input type="hidden" name="txtParam1Values" >
				<input type="hidden" name="txtParam2Values">
				<input type="hidden" name="txtParam1ChoiceValues">
							
				<font class="DialogLabel">Project:</font>
			</td>
			<td width="65%">
			    <select size="1" name="lstProjects" id="lstProjects" onchange="OnChangeProject();" style="width:100%">	
					<WC@PROJECTS></WC@PROJECTS>
				</select>
			</td>
			<!-- NC-Bookmark -->
	   		<td style="position:relative; left:35px; top:5px;">
				<script type="text/javascript">
					m_objMqButton.WriteTextButtonHTML("Apply", "Apply", "CallWhileWait('ApplyWorkflow()');", "", 30, "", g_MqRef.RESX["BUTTON_APPLY"], 165);
				</script>
			</td>
				
			
			<td width="35" style="padding-left:50px" valign="top" align="right">
				<IMG height="25" alt ="Please Wait." src="../../../Theme/images/spacer.gif" width="25" border=0 name=imgbusy >
			</td>
		</tr>
	</table><!--close table for top-->

	
	<div id="DivRightSide" style="width:85%;position:absolute;padd-ing-left:10px;padding-top:10px; padding-right:15px">
				
		<table cellpadding="0" cellspacing="0" border="0" width="100%" style="padding-bottom:20px; border-bottom:1px solid grey;">
					
			<!--Box Top Border -->
			<tr height="20" style="display:none;">
				<td width="14" ><div class="BoxTLeft"></div></td>
				<td class="BoxTCenter">&nbsp;</td>
				<td width="14" ><div class="BoxTRight"></div></td>
			</tr>
			<!--End of Box Top Border -->
			<!--Box Middle w/table-->
			<tr>
				<td width="14" class="BoxMLeft" style="display:none;">&nbsp;</td>
				<td width="100%" class="BoxMCenter" style="background-image:none;">
					<table class="BoxMCenter" width="100%" height="100%" cellpadding="0" cellspacing="0" border="0" style="background-image:none;">
					<!-- Contents -->
														
						<tr valign="top">
							<td style="padding-bottom:10px">
								<font class="toolbar">Business Rules</font>
								<br /><br />
								<font class="DialogLabel">Business rules can be used to filter possible values, set dependent values, make fields required, disabled or hidden, or hide tabs. Select the business rule you would like to edit, or add a new one.</font>
								
							</td>
						</tr>
						<tr>
							<td width="100%" valign="top">
								<div id="tmpl_grid" style="width:800px;height:290px; background-color:white;border:1px solid #666666; border-radius: 4px; "></div>
									<script type="text/javascript">
										<!--
										WriteTemplatesGrid();	
										//-->
									</script>
								</td>
							
							<td valign="top" style="padding-left:10px">
							
								<script type="text/javascript">
									var strButtons=GetTextButtonHTML("OnMenuClick(MNU_NEW_GROUP)", "Add1", g_MqRef.RESX['WORKFLOW_BTN_ADD'], g_MqRef.RESX['WORKFLOW_CAPTION_ADD_RULE']);
									strButtons+=GetTextButtonHTML("OnMenuClick(MNU_RENAME_GROUP)", "Edit", g_MqRef.RESX['WORKFLOW_BTN_EDIT'], g_MqRef.RESX['WORKFLOW_CAPTION_EDIT_RULE']);
									strButtons+=GetTextButtonHTML("OnMenuClick(MNU_COPY_GROUP)", "Copy", g_MqRef.RESX['WORKFLOW_BTN_COPY'], g_MqRef.RESX['WORKFLOW_CAPTION_COPY_RULE']);
									strButtons+=GetTextButtonHTML("OnMenuClick(MNU_REMOVE_GROUP)", "Remove1", g_MqRef.RESX['WORKFLOW_BTN_REMOVE'], g_MqRef.RESX['WORKFLOW_CAPTION_REMOVE_RULE']);
									document.write(strButtons);
								</script>
								<span style="padding-left:10px">
									<script type="text/javascript">document.write(writeImageAlt("up","../../../Theme/images/buttons/","js:InterchangeOrder(true);",16,16,false,"Move up"));</script>
									&nbsp;&nbsp;&nbsp;&nbsp;
									<script type="text/javascript">document.write(writeImageAlt("down","../../../Theme/images/buttons/","js:InterchangeOrder(false);",16,16,false,"Move down"));</script>
								</span>
							</td>						
						</tr>
								
						<!-- End of Contents -->
					</table>
				</td>
				<td width="14" class="BoxMRight" style="display:none;">&nbsp;</td>
			</tr>
			<!--End of Box Middle w/table-->

			<!--Box Bottom Border -->
			<tr height="20" style="display:none;">
				<td width="14" ><div class="BoxBLeft"></div></td>
				<td class="BoxBCenter">&nbsp;</td>
				<td width="14" ><div class="BoxBRight"></div></td>
			</tr>
			<!--End of Box Bottom Border -->
												
		</table>	
		
		<iframe border="0" frameborder="0" name="ParamsTabs" 
						height="0" width="100%" src="tmplParamTabs.htm"  
						framespacing=0 marginheight=0 marginwidth=0>
		</iframe>
		<table cellpadding="0" cellspacing="0" border="0" width="100%" style="padding-top:15px;">
					
			<!--Box Top Border -->
			<tr height="20" style="display:none;">
				<td width="14" ><div class="BoxTLeft"></div></td>
				<td class="BoxTCenter">&nbsp;</td>
				<td width="14" ><div class="BoxTRight"></div></td>
			</tr>
			<!--End of Box Top Border -->
			<!--Box Middle w/table-->
			<tr>
				<td width="14" class="BoxMLeft" style="display:none;">&nbsp;</td>
				<td width="100%" class="BoxMCenter" style="background-image:none;">
					<table class="BoxMCenter" width="100%" height="100%" cellpadding="0" cellspacing="0" border="0" style="background-image:none;">
					<!-- Contents -->
												
						<tr valign="top">
							<td width="100%" style="padding-bottom:10px">
								<span id="ActTitle" class="toolbar">Conditions & Actions</span>
								<br /><br />
								<font class="DialogLabel">Select a row and click on a cell to update the values used in the conditions and actions.</font>
							</td>
						</tr>
						<tr>
							<td width="100%" valign="top">
								<div id="rules_grid" style="width:800px;height:420px; background-color:white;border:1px solid #666666; border-radius: 4px; "></div>
									<script type="text/javascript">
										<!--
										WriteRulesGrid();	
										//-->
									</script></td>
								</td>
								<td valign="top" style="padding-left:10px">
							
								<script type="text/javascript">
									var strButtons=GetTextButtonHTML("OnMenuClick(MNU_NEW_RULE)", "Add2", g_MqRef.RESX['WORKFLOW_BTN_ADD'], g_MqRef.RESX['WORKFLOW_CAPTION_ADD_COND_ACTION']);
									strButtons+=GetTextButtonHTML("OnMenuClick(MNU_COPY_RULE)", "Copy2", g_MqRef.RESX['WORKFLOW_BTN_COPY'], g_MqRef.RESX['WORKFLOW_CAPTION_COPY_COND_ACTION']);
									strButtons+=GetTextButtonHTML("OnMenuClick(MNU_REMOVE_RULE)", "Remove2", g_MqRef.RESX['WORKFLOW_BTN_REMOVE'], g_MqRef.RESX['WORKFLOW_CAPTION_REMOVE_COND_ACTION']);
									document.write(strButtons);
								</script>
								
							</td>			
						</tr>
						<!-- End of Contents -->
					</table>
				</td>
				<td width="14" class="BoxMRight" style="display:none;">&nbsp;</td>
			</tr>
			<!--End of Box Middle w/table-->

			<!--Box Bottom Border -->
			<tr height="20" style="display:none;">
				<td width="14" ><div class="BoxBLeft"></div></td>
				<td class="BoxBCenter">&nbsp;</td>
				<td width="14" ><div class="BoxBRight"></div></td>
			</tr>
			<!--End of Box Bottom Border -->
			<tr>
				<td>
					<div style="padding:10px; width:100%; bottom:-80px; right:-10px; position:absolute; padding-bottom:10px; margin:20px 0 0 0;">
						<script>m_objMqButton.WriteTextButtonHTML(g_MqRef.RESX['WORKFLOW_BTN_RESET_ALL_WORKFLOWS'], g_MqRef.RESX['WORKFLOW_BTN_RESET_ALL_WORKFLOWS'], "ConfirmResetAll();", "", 32, "", g_MqRef.RESX['WORKFLOW_CAPTION_RESET_ALL_WORKFLOWS'], 184);</script>
					</div>
				</td>
			</tr>							
		</table>							
					
	</div>

	<font class="DialogLabel" id="DialogLabel">
		<div style="position:absolute;border:1px black groove; background-color:#fafad2;padding:10px; width:10%; top:65px; right:20px; border-radius:5px;">
	      <a onclick="document.getElementById('DialogLabel').style.display = 'none';" style="cursor:pointer;"><i class="fas fa-times" style="position:relative; float:right;"></i></a>
		  <b>Note:</b> If you change the conditions or actions, all Web views of the project are updated.
	      
	      <br /><br />The order in which the business rules are shown is the order in which they will be used in the Web views.
	      
	      <br /><br />Click Apply to update the Web views with the current business rules.
		  
		  <br/><br/>If you want to reset all the Workflows to their defaults, click the Reset all workflows button.
	    </div>
    </font>
	
	</form>
	
	<div style="visibility: hidden;display:none">
		<div id="dialog-modal" style="width:100%;height:100%;padding:0px;margin:0px;overflow:hidden">
			<iframe id="dialog-modal-url" width="100%" height="100%" marginWidth="0" marginHeight="0" frameBorder="0" scrolling="no"></iframe>
		</div>
		<div id="dialog-modal-orig-width" name="dialog-modal-orig-width" style="display:none"></div>
		<div id="dialog-modal-orig-height" name="dialog-modal-orig-height" style="display:none"></div>
	</div>
	
</body>
</html>
