RSS Git Download  Clone
Raw Blame History
<!-- BEGIN site/report_link_options.tt -->
    [% # set Report link:
        specimen = specimen_map.item(data.id).sample_code.join(' ');
        report_link = specimen.match('CMP') AND c.cfg('settings').have_outreach
            ? 'outreach' : 'report';
    %]
    
	[% IF # unscreened:
      NOT has_optional.initial_screen
      AND c.user_can('screen') %]
		<a href="[% app_url %]/screen/=/[% data.id %]">Screen</a>
    
	[% ELSIF # screened but not reported:
      has_optional.initial_screen
      AND c.user_can('report')
      AND NOT history.reported.user %]
    <a href="[% app_url %]/[% report_link %]/=/[% data.id %]">[% report_link | ucfirst %]</a>
    
	[% ELSIF # reported but not authorised (if 'authorise' option active):
      has_optional.report 
      AND c.user_can('report') 
      AND NOT history.authorised.user
      AND NOT data.status_option.description.match('complete')
      AND status_options.authorised.is_active.match('yes') %]
    <a href="[% app_url %]/report/authorise/[% data.id %]">Authorise</a>
    
  [% ELSIF # reported & authorised but still incomplete:
      has_optional.report 
      AND c.user_can('report') 
      # AND NOT data.status_option.description.match('complete')
      AND NOT is_locked %]
    <a href="[% app_url %]/[% report_link %]/=/[% data.id %]">[% report_link | ucfirst %]</a>

	[% ELSE %]
		Report
	[% END %]
<!-- END site/report_link_options.tt -->