<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="responsor.aspx.cs" Inherits="view.flow.responsor" %>

<html><head>
  <meta http-equiv="X-UA-Compatible"content="IE=EmulateIE7"/>
  <meta http-equiv="Content-Type" content='text/html; charset=utf-8' />
  <title>workflow responsor</title>
  <link href='../skin/view.css' type='text/css' rel='stylesheet'>
  <script language=javascript>document.write("<script type='text/javaScript' src='../common/view"+location.search.substring(1)+".js'><\/script>");</script>
  <script type='text/javascript' src='../common/view.js'></script>
</head>

<body scroll=no>
<fieldset style='margin:10px 10px 0px 10px;'><legend><script language=javaScript>document.write(translate['responsor']);</script></legend>
<div style='height:390px;overflow:auto;' id=oUserList runat=server><div style="border-top:#ccc 1px solid;border-bottom:#ccc 1px solid;padding:2 0;margin:10px 0px;"><input type=checkbox name="{!responsorDivision}"><script language=javaScript>document.write(translate['lastProcResponsorDivisionOnly']);</script></div><div><input type=checkbox name="{!sender}"><img src="../images/userX10.gif" border=0> <script language=javaScript>document.write(translate['taskSender']);</script></div><div><input type=checkbox name="{!responsor}"><img src="../images/userX10.gif" border=0> <script language=javaScript>document.write(translate['lastProcResponsor']);</script></div><div><br>&nbsp;Expression <input type=text id=oExpression size=55></div></div></fieldset>
<script language=javaScript>
    workflowActionsShow('okCancel');
    var ec = document.getElementsByTagName('INPUT');
    if (dialogArguments.value.indexOf("$$") == 0) {
        document.getElementById('oExpression').value = dialogArguments.value.substr(2);
    }
    else {
        var sSource = ',' + dialogArguments.value;
        var e;
        for (var i = 0; i < ec.length; i++) {
            e = ec[i];
            if (e.type == 'checkbox' && sSource.indexOf(',' + e.name + ',') > -1)
                e.checked = true;
        }
    }
    function onActionBefore(nActionId, sName, bPostForm) {
        if (nActionId > 0) {
            if (document.getElementById('oExpression').value.length > 0)
                dialogArguments.value = "$$" + document.getElementById('oExpression').value;
            else {
                var s = '';
                for (var i = 0; i < ec.length; i++) {
                    e = ec[i];
                    if (e.type == 'checkbox' && e.name && e.checked)
                        s += e.name + ',';
                }
                dialogArguments.value = s;
            }
        }
        self.close();
        return 0; //prevent from submitting
    }
</script>
</body>
</html>