<!-- BEGIN [% template.title %] -->
  [% META title = 'Worklist &raquo; Outreach Report Labels' -%]

    [% # PROCESS dumper.tt dump = requests %]
    
  [% # define some data structures:
    headers = [ 'LabNo' 'Name' 'Date' 'Location' 'Authorised' 'Enter' ];
  %]
  
  <h3 class="header">
    Print Outreach report labels for requests authorised
        [% IF dates.begin.ymd.match(dates.end.ymd) # single date %]
            on [% dates.begin.strftime('%A %d.%b.%Y') %]
        [% ELSE %]
            between [% dates.begin.strftime('%a %d.%b.%Y') %]
            and [% dates.end.strftime('%a %d.%b.%Y') %]
        [% END %]
  </h3>

  [% IF requests.size %]
  <form method="post" action="[% app_url %]/outreach/do_report_labels">
    <table class="indent">
      <tr>
        <td>&nbsp;</td>
        [% FOREACH item IN headers %]
          <th scope="">[% item | html_line_break %]</th>
        [% END %]
      </tr>
  
      [% FOREACH data IN requests; # PROCESS dumper.tt dump = data %]
      <tr>
        <td>[% loop.count %]
        <td>[% INCLUDE site/lab_number.tt want_url = 1 %]</td>
        <td>
           [% data.last_name  | upper %],
           [% data.first_name | ucfirst %]
        </td>
        <td>[% data.created_at.strftime('%d.%b.%Y') %]</td>
        <td>[% data.location %]</td>
        <td>[% data.authorised.strftime('%d.%b.%Y') %]</td>
        <td align="center">
          <input type="checkbox" name="patient_id" value="[% data.patient_id %]"
            checked />
        </td>
      </tr>
      [% END %]
      <tr class="borderless">
        <td colspan="7" align="center">
          [% site.html.back_button %]
          [% site.html.submit %]
          [% site.html.reset %]
        </td>
      </tr>
    </table>
  </form>
  
  [% ELSE %]
    <p class="info indent">No Outreach report labels due</p>
  [% END %]  
<!-- END [% template.title %] -->
