<configure xmlns="http://namespaces.zope.org/zope"
           xmlns:browser="http://namespaces.zope.org/browser"
           i18n_domain="senaite.core">

  <!-- Instrument QC Failures Viewlet -->
  <browser:viewlet
      for="*"
      name="bika.lims.instrument_qc_failures_viewlet"
      class="bika.lims.browser.viewlets.InstrumentQCFailuresViewlet"
      manager="plone.app.layout.viewlets.interfaces.IAboveContent"
      template="templates/instrument_qc_failures_viewlet.pt"
      permission="senaite.core.permissions.ManageBika"
      layer="bika.lims.interfaces.IBikaLIMS"
      />

  <!-- Invalid Analysis Request viewlet -->
  <browser:viewlet
      for="bika.lims.interfaces.IAnalysisRequest"
      name="bika.lims.invalid_ar_viewlet"
      class=".analysisrequest.InvalidAnalysisRequestViewlet"
      manager="plone.app.layout.viewlets.interfaces.IAboveContent"
      template="templates/invalid_ar_viewlet.pt"
      permission="zope2.View"
      layer="bika.lims.interfaces.IBikaLIMS"
      />

  <!-- Retest Analysis Request viewlet -->
  <browser:viewlet
      for="bika.lims.interfaces.IAnalysisRequest"
      name="bika.lims.retest_ar_viewlet"
      class=".analysisrequest.RetestAnalysisRequestViewlet"
      manager="plone.app.layout.viewlets.interfaces.IAboveContent"
      template="templates/retest_ar_viewlet.pt"
      permission="zope2.View"
      layer="bika.lims.interfaces.IBikaLIMS"
      />

  <!-- Primary Analysis Request viewlet -->
  <browser:viewlet
    for="bika.lims.interfaces.IAnalysisRequestWithPartitions"
    name="bika.lims.primary_ar_viewlet"
    class=".analysisrequest.PrimaryAnalysisRequestViewlet"
    manager="plone.app.layout.viewlets.interfaces.IAboveContent"
    template="templates/primary_ar_viewlet.pt"
    permission="zope2.View"
    layer="bika.lims.interfaces.IBikaLIMS"
  />

  <!-- Partition Analysis Request viewlet -->
  <browser:viewlet
    for="bika.lims.interfaces.IAnalysisRequestPartition"
    name="bika.lims.partition_ar_viewlet"
    class=".analysisrequest.PartitionAnalysisRequestViewlet"
    manager="plone.app.layout.viewlets.interfaces.IAboveContent"
    template="templates/partition_ar_viewlet.pt"
    permission="zope2.View"
    layer="bika.lims.interfaces.IBikaLIMS"
  />

  <!-- Dettached partition viewlet -->
  <browser:viewlet
    for="bika.lims.interfaces.IAnalysisRequest"
    name="bika.lims.detached_partition_viewlet"
    class=".analysisrequest.DetachedPartitionViewlet"
    manager="plone.app.layout.viewlets.interfaces.IAboveContent"
    template="templates/detached_partition_viewlet.pt"
    permission="zope2.View"
    layer="bika.lims.interfaces.IBikaLIMS"
  />

  <!-- ResultsRanges Out-of-date viewlet
  Viewlet that displays if results ranges from Sample are different from
  results ranges initially set through Specifications field. If so, this means
  the Specification initially set has changed since it was assigned to the
  Sample and for new analyses, the ranges defined in the initial specification
  will be used instead of the new ones.
  -->
  <browser:viewlet
    for="bika.lims.interfaces.IAnalysisRequest"
    name="bika.lims.resultsranges_out_of_date_viewlet"
    class=".analysisrequest.ResultsRangesOutOfDateViewlet"
    manager="plone.app.layout.viewlets.interfaces.IAboveContent"
    template="templates/resultsranges_out_of_date_viewlet.pt"
    permission="zope2.View"
    layer="bika.lims.interfaces.IBikaLIMS" />

  <!-- Specification non-compliant viewlet
  Viewlet displayed when the Sample contains analyses that are not compliant
  the Specification initially set (stored in Sample's ResultsRange field). If
  so, this means that user changed the results ranges of the analyses manually,
  either by adding new ones or by modifying the existing ones via "Manage
  analyses" view. And results range for those analyses are different from the
  Specification initially set.
  -->
  <browser:viewlet
    for="bika.lims.interfaces.IAnalysisRequest"
    name="bika.lims.specification_non_compliant_viewlet"
    class=".analysisrequest.SpecificationNotCompliantViewlet"
    manager="plone.app.layout.viewlets.interfaces.IAboveContent"
    template="templates/specification_non_compliant_viewlet.pt"
    permission="zope2.View"
    layer="bika.lims.interfaces.IBikaLIMS" />

  <!-- Secondary Analysis Request viewlet -->
  <browser:viewlet
      for="bika.lims.interfaces.IAnalysisRequestSecondary"
      name="bika.lims.secondary_ar_viewlet"
      class=".analysisrequest.SecondaryAnalysisRequestViewlet"
      manager="plone.app.layout.viewlets.interfaces.IAboveContent"
      template="templates/secondary_ar_viewlet.pt"
      permission="zope2.View"
      layer="bika.lims.interfaces.IBikaLIMS"
      />

  <!-- Rejected Analysis Request viewlet -->
  <browser:viewlet
      for="bika.lims.interfaces.IAnalysisRequest"
      name="bika.lims.rejected_ar_viewlet"
      class=".analysisrequest.RejectedAnalysisRequestViewlet"
      manager="plone.app.layout.viewlets.interfaces.IAboveContent"
      template="templates/rejected_ar_viewlet.pt"
      permission="zope2.View"
      layer="bika.lims.interfaces.IBikaLIMS"
      />

  <!-- Dynamic Specifications viewlet for AnalysisSpec.
  Displays an informative message when the specification has a dynamic
  specification assigned, so ranges might be overriden by the ranges provided in
  the xls file from the Dynamic Specification -->
  <browser:viewlet
    for="bika.lims.interfaces.IAnalysisSpec"
    name="bika.lims.dynamic_spec_viewlet"
    class=".dynamic_specs.DynamicSpecsViewlet"
    manager="plone.app.layout.viewlets.interfaces.IAboveContent"
    template="templates/dynamic_specs_viewlet.pt"
    permission="zope2.View"
    layer="bika.lims.interfaces.IBikaLIMS"
  />

  <!-- Dynamic Specifications viewlet for Sample.
  Displays an informative message when the
  specification assigned to the Sample has a dynamic specification assigned -->
  <browser:viewlet
    for="bika.lims.interfaces.IAnalysisRequest"
    name="bika.lims.sample_dynamic_spec_viewlet"
    class=".dynamic_specs.SampleDynamicSpecsViewlet"
    manager="plone.app.layout.viewlets.interfaces.IAboveContent"
    template="templates/sample_dynamic_specs_viewlet.pt"
    permission="zope2.View"
    layer="bika.lims.interfaces.IBikaLIMS"
  />

</configure>
