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

  <!-- AR Add 2 -->
  <browser:page
      for="*"
      name="ar_add_manage"
      class="bika.lims.browser.analysisrequest.AnalysisRequestManageView"
      permission="senaite.core.permissions.ManageBika"
      layer="bika.lims.interfaces.IBikaLIMS"
      />

  <browser:page
      for="bika.lims.interfaces.IClient"
      name="ar_add"
      class="bika.lims.browser.analysisrequest.AnalysisRequestAddView"
      permission="senaite.core.permissions.AddAnalysisRequest"
      layer="bika.lims.interfaces.IBikaLIMS"
      />

  <browser:page
      for="bika.lims.interfaces.IAnalysisRequestsFolder"
      name="ar_add"
      class="bika.lims.browser.analysisrequest.AnalysisRequestAddView"
      permission="senaite.core.permissions.AddAnalysisRequest"
      layer="bika.lims.interfaces.IBikaLIMS"
      />

  <browser:page
      for="bika.lims.interfaces.IBatch"
      name="ar_add"
      class="bika.lims.browser.analysisrequest.AnalysisRequestAddView"
      permission="senaite.core.permissions.AddAnalysisRequest"
      layer="bika.lims.interfaces.IBikaLIMS"
      />

  <browser:page
      for="*"
      name="ajax_ar_add"
      class="bika.lims.browser.analysisrequest.ajaxAnalysisRequestAddView"
      permission="zope.Public"
      layer="bika.lims.interfaces.IBikaLIMS"
      />
  <!-- /AR Add 2 -->

  <adapter
      factory="bika.lims.browser.analysisrequest.ClientContactVocabularyFactory"
      provides="bika.lims.interfaces.IDisplayListVocabulary"
      for="bika.lims.interfaces.IAnalysisRequest"
      name="getContacts"
      />

  <adapter
      factory="bika.lims.browser.analysisrequest.JSONReadExtender"
      provides="bika.lims.interfaces.IJSONReadExtender"
      />

  <!-- Custom field adapters for sample header view -->
  <adapter
      for="bika.lims.interfaces.IAnalysisRequest"
      factory="bika.lims.browser.analysisrequest.mailto_link_from_contacts"
      provides="bika.lims.interfaces.IHeaderTableFieldRenderer"
      name="Contact"
      />
  <adapter
      for="bika.lims.interfaces.IAnalysisRequest"
      factory="bika.lims.browser.analysisrequest.mailto_link_from_contacts"
      provides="bika.lims.interfaces.IHeaderTableFieldRenderer"
      name="CCContact"
      />
  <adapter
      for="bika.lims.interfaces.IAnalysisRequest"
      factory="bika.lims.browser.analysisrequest.mailto_link_from_ccemails"
      provides="bika.lims.interfaces.IHeaderTableFieldRenderer"
      name="CCEmails"
      />

  <!-- AR Main View -->
  <browser:page
      for="bika.lims.interfaces.IAnalysisRequest"
      name="base_view"
      class="bika.lims.browser.analysisrequest.AnalysisRequestViewView"
      permission="senaite.core.permissions.ManageAnalysisRequests"
      layer="bika.lims.interfaces.IBikaLIMS"
      />

  <!-- Table Lab Analyses -->
  <browser:page
      for="bika.lims.interfaces.IAnalysisRequest"
      name="table_lab_analyses"
      class=".tables.LabAnalysesTable"
      permission="senaite.core.permissions.ManageAnalysisRequests"
      layer="bika.lims.interfaces.IBikaLIMS"
      />

  <!-- Table Field Analyses -->
  <browser:page
      for="bika.lims.interfaces.IAnalysisRequest"
      name="table_field_analyses"
      class=".tables.FieldAnalysesTable"
      permission="senaite.core.permissions.ManageAnalysisRequests"
      layer="bika.lims.interfaces.IBikaLIMS"
      />

  <!-- Table QC Analyses -->
  <browser:page
      for="bika.lims.interfaces.IAnalysisRequest"
      name="table_qc_analyses"
      class=".tables.QCAnalysesTable"
      permission="senaite.core.permissions.ManageAnalysisRequests"
      layer="bika.lims.interfaces.IBikaLIMS"
      />

  <!-- Manage Analyses View -->
  <browser:page
      for="bika.lims.interfaces.IAnalysisRequest"
      name="analyses"
      class="bika.lims.browser.analysisrequest.AnalysisRequestAnalysesView"
      permission="senaite.core.permissions.AddAnalysis"
      layer="bika.lims.interfaces.IBikaLIMS"
      />

  <browser:page
      for="bika.lims.interfaces.IAnalysisRequest"
      name="published_results"
      class="bika.lims.browser.analysisrequest.AnalysisRequestPublishedResults"
      permission="senaite.core.permissions.ManageAnalysisRequests"
      layer="bika.lims.interfaces.IBikaLIMS"
      />

  <browser:page
      for="bika.lims.interfaces.IAnalysisRequest"
      name="invoice"
      class="bika.lims.browser.analysisrequest.InvoiceView"
      permission="senaite.core.permissions.ManageInvoices"
      layer="bika.lims.interfaces.IBikaLIMS"
      />


  <browser:page
      for="bika.lims.interfaces.IAnalysisRequest"
      name="invoice_print"
      class="bika.lims.browser.analysisrequest.InvoicePrintView"
      permission="senaite.core.permissions.ManageInvoices"
      layer="bika.lims.interfaces.IBikaLIMS"
      />

  <browser:page
      for="bika.lims.interfaces.IAnalysisRequest"
      name="invoice_create"
      class="bika.lims.browser.analysisrequest.InvoiceCreate"
      permission="senaite.core.permissions.ManageInvoices"
      layer="bika.lims.interfaces.IBikaLIMS"
      />

  <!-- Sample (AR) Rejection View -->
  <browser:page
      for="*"
      name="reject_samples"
      class=".reject_samples.RejectSamplesView"
      permission="senaite.core.permissions.ManageAnalysisRequests"
      layer="bika.lims.interfaces.IBikaLIMS"
  />

</configure>
