<?xml version="1.0" encoding="utf-8"?>

<workflow xmlns="http://eprints.org/ep3/workflow" xmlns:epc="http://eprints.org/ep3/control">

<flow>
	<epc:foreach expr="$config{hefce_oa}{item_types}" iterator="item_type">
        	<epc:if test="( type = $item_type ) and $STAFF_ONLY = 'TRUE' )" required_by="hefce_oa">
                	<stage ref="hefce_oa" />
	        </epc:if>
    	</epc:foreach>
</flow>

<stage name="hefce_oa">
    <!--
    <component type="Field::Multi">
        <title>Dates</title>
        <field ref="hoa_date_acc"/>
        <field ref="hoa_date_pub"/>
    </component>
    -->
    <component>
      <field ref="hoa_exclude"/>
    </component>
    <component><field ref="hoa_emb_len"/></component>
    <component><field ref="hoa_ref_pan"/></component>
    <component type="Field::Multi">
        <title>Deposit Exceptions</title>
        <field ref="hoa_ex_dep"/>
        <field ref="hoa_ex_dep_txt"/>
    </component>
    <component type="Field::Multi">
        <title>Access Exceptions</title>
        <field ref="hoa_ex_acc"/>
        <field ref="hoa_ex_acc_txt"/>
    </component>
    <component type="Field::Multi">
        <title>Technical Exceptions</title>
        <field ref="hoa_ex_tec"/>
        <field ref="hoa_ex_tec_txt"/>
    </component>
    <component type="Field::Multi">
        <title>Other Exceptions</title>
        <field ref="hoa_ex_oth"/>
        <epc:choose>
            <epc:when test="hoa_ex_oth and hoa_ex_oth = 'TRUE'">
                <field ref="hoa_ex_oth_txt" required="yes"/>
            </epc:when>
            <epc:otherwise>
                <field ref="hoa_ex_oth_txt"/>
            </epc:otherwise>
        </epc:choose>
    </component>
</stage>

</workflow>

