<!-- BEGIN [% component.name %] -->
    [% # INCLUDE dumper.tt dump = token %]
    [% cfg = c.cfg('settings'); # PROCESS dumper.tt dump = cfg %]

    <table class="tree">
        <tr>
            <td>
				[% div_name = 'lab'; INCLUDE site/snippets/toggleview.tt type = 'folder' %]
            </td>
            <td>
                <span class="title">Lab functions</span>
            </td>
        </tr>
    </table>

    <div class='itemhidden' id="[% div_name %]">
        <table style="margin-left: 30px">
            [%
                IF c.is_lab_staff;
                    INCLUDE row class_function = 'resources/dashboard'
                        title = 'Dashboard view';
                END;

                IF c.user_can('modify_results');
                    INCLUDE row class_function = 'result/export_test_results'
                        title = 'Export test results';
                END;

                IF c.user_can('modify_results') AND cfg.xtr_96_addr;
                    INCLUDE row class_function = 'storage/read_xtr_96'
                        title = 'Import Fluidx XTR-96 data';
                    INCLUDE row class_function = 'storage/remove_storage_plate'
                        title = 'Remove Fluidx plate from storage';
                END;

                IF c.is_lab_staff;
                    INCLUDE row class_function = 'search/deleted_record'
                        title = 'Deleted records search';
                END;

                IF c.user_can('register');
                    INCLUDE row class_function = 'referral-source'
                        title = 'Referrers & referral sources';
                END;

                IF c.user_can('patient_merge') %]
                    <tr>
                      <td><img alt="" src="/images/text.gif" class="text" /></td>
                      <td>
                          <a class="nav" href="[% app_url %]/admin/patient_merge"
                                target="_blank">
                            Merge patients
                          </a>
                      </td>
                    </tr>
                [% END %]
                [%
					want_rfc = 0;
                    IF c.is_lab_staff AND cfg.item('_centre') == cfg.sysadmin_centre;
						want_rfc = 1;
					ELSIF cfg.item('_centre').match('genomics') AND c.user_can('do_admin');
						want_rfc = 1;
					END;
					IF want_rfc;
                        base_addr = url_base.replace(':8000', '') %]
                    <tr>
                      <td><img alt="" src="/images/text.gif" class="text" /></td>
                      <td>
                          <a class="nav" href="[% base_addr %]/script/cgi/rfc.cgi?u=[%
							token.username %]&c=[% token.centre %]" target="_blank">HILIS RfC</a>
                      </td>
                    </tr>
                [% END %]
                [% IF cfg.item('_centre').match('^bristol$')
                        AND c.user_can('do_admin');
                    USE date; manip = date.manip;
                    INCLUDE row class_function = 'resources/resend_hl7'
                        title = 'Resend HL7 data from '
                            _ manip.UnixDate("Yesterday", "%a %d.%b.%Y");
                    END;
                %]
                [% IF cfg.have_general_comms_log;
                    base_addr = url_base.replace(':8000', '') %]
                    <tr>
                      <td><img alt="" src="/images/text.gif" class="text" /></td>
                      <td>
                          <a class="nav" href="[% base_addr %]/comms_log?_sid=[%
							c.session.id %]" target="_new">General Comms Log</a>
                      </td>
                    </tr>
                [% END %]
        </table>
    </div>
<!-- END [% component.name %] -->
