From 384b69a2fcd4a1e9fc19768d11f1badc9ce313d6 Mon Sep 17 00:00:00 2001
From: Tomas Cohen Arazi <tomascohen@theke.io>
Date: Tue, 11 Feb 2025 18:41:03 +0000
Subject: [PATCH] Bug 38340: Move templates
Content-Type: text/plain; charset=utf-8

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
---
 Koha/ILL/Backend/intra-includes/cancel.inc    |  16 ---
 Koha/ILL/Backend/intra-includes/confirm.inc   |  18 ---
 Koha/ILL/Backend/intra-includes/edititem.inc  |  94 -------------
 Koha/ILL/Backend/intra-includes/migrate.inc   | 123 ----------------
 Koha/ILL/Backend/opac-includes/create.inc     | 131 ------------------
 .../includes/ill/backends/Standard/cancel.inc |  16 +++
 .../ill/backends/Standard/confirm.inc         |  18 +++
 .../ill/backends/Standard}/create.inc         |   9 +-
 .../ill/backends/Standard/edititem.inc        |  93 +++++++++++++
 .../ill/backends/Standard}/illview.inc        |   0
 .../backends/Standard/inc}/custom_fields.inc  |  24 ++--
 .../Standard/inc}/form_input_helpers.inc      |   0
 .../backends/Standard/inc}/forms/article.inc  |   0
 .../ill/backends/Standard/inc}/forms/book.inc |   0
 .../backends/Standard/inc}/forms/chapter.inc  |   0
 .../Standard/inc}/forms/conference.inc        |   0
 .../ill/backends/Standard/inc}/forms/dvd.inc  |   0
 .../backends/Standard/inc}/forms/journal.inc  |   0
 .../backends/Standard/inc}/forms/other.inc    |   0
 .../backends/Standard/inc}/forms/resource.inc |   0
 .../backends/Standard/inc}/forms/thesis.inc   |   0
 .../ill/backends/Standard/inc}/shared.js      |   0
 .../ill/backends/Standard/migrate.inc         | 116 ++++++++++++++++
 .../includes/ill/backends/Standard/create.inc | 114 +++++++++++++++
 .../backends/Standard/inc/custom_fields.inc   |  34 +++++
 .../Standard/inc/form_input_helpers.inc       |  52 +++++++
 .../backends/Standard/inc/forms/article.inc   |  16 +++
 .../ill/backends/Standard/inc/forms/book.inc  |   6 +
 .../backends/Standard/inc/forms/chapter.inc   |  14 ++
 .../Standard/inc/forms/conference.inc         |  16 +++
 .../ill/backends/Standard/inc/forms/dvd.inc   |  12 ++
 .../backends/Standard/inc/forms/journal.inc   |   7 +
 .../ill/backends/Standard/inc/forms/other.inc |   0
 .../backends/Standard/inc/forms/resource.inc  |  17 +++
 .../backends/Standard/inc/forms/thesis.inc    |  10 ++
 .../ill/backends/Standard/inc/shared.js       |  44 ++++++
 36 files changed, 600 insertions(+), 400 deletions(-)
 delete mode 100644 Koha/ILL/Backend/intra-includes/cancel.inc
 delete mode 100644 Koha/ILL/Backend/intra-includes/confirm.inc
 delete mode 100644 Koha/ILL/Backend/intra-includes/edititem.inc
 delete mode 100644 Koha/ILL/Backend/intra-includes/migrate.inc
 delete mode 100644 Koha/ILL/Backend/opac-includes/create.inc
 create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/ill/backends/Standard/cancel.inc
 create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/ill/backends/Standard/confirm.inc
 rename {Koha/ILL/Backend/intra-includes => koha-tmpl/intranet-tmpl/prog/en/includes/ill/backends/Standard}/create.inc (96%)
 create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/ill/backends/Standard/edititem.inc
 rename {Koha/ILL/Backend/intra-includes => koha-tmpl/intranet-tmpl/prog/en/includes/ill/backends/Standard}/illview.inc (100%)
 rename {Koha/ILL/Backend/shared-includes => koha-tmpl/intranet-tmpl/prog/en/includes/ill/backends/Standard/inc}/custom_fields.inc (71%)
 rename {Koha/ILL/Backend/shared-includes => koha-tmpl/intranet-tmpl/prog/en/includes/ill/backends/Standard/inc}/form_input_helpers.inc (100%)
 rename {Koha/ILL/Backend/shared-includes => koha-tmpl/intranet-tmpl/prog/en/includes/ill/backends/Standard/inc}/forms/article.inc (100%)
 rename {Koha/ILL/Backend/shared-includes => koha-tmpl/intranet-tmpl/prog/en/includes/ill/backends/Standard/inc}/forms/book.inc (100%)
 rename {Koha/ILL/Backend/shared-includes => koha-tmpl/intranet-tmpl/prog/en/includes/ill/backends/Standard/inc}/forms/chapter.inc (100%)
 rename {Koha/ILL/Backend/shared-includes => koha-tmpl/intranet-tmpl/prog/en/includes/ill/backends/Standard/inc}/forms/conference.inc (100%)
 rename {Koha/ILL/Backend/shared-includes => koha-tmpl/intranet-tmpl/prog/en/includes/ill/backends/Standard/inc}/forms/dvd.inc (100%)
 rename {Koha/ILL/Backend/shared-includes => koha-tmpl/intranet-tmpl/prog/en/includes/ill/backends/Standard/inc}/forms/journal.inc (100%)
 rename {Koha/ILL/Backend/shared-includes => koha-tmpl/intranet-tmpl/prog/en/includes/ill/backends/Standard/inc}/forms/other.inc (100%)
 rename {Koha/ILL/Backend/shared-includes => koha-tmpl/intranet-tmpl/prog/en/includes/ill/backends/Standard/inc}/forms/resource.inc (100%)
 rename {Koha/ILL/Backend/shared-includes => koha-tmpl/intranet-tmpl/prog/en/includes/ill/backends/Standard/inc}/forms/thesis.inc (100%)
 rename {Koha/ILL/Backend/shared-includes => koha-tmpl/intranet-tmpl/prog/en/includes/ill/backends/Standard/inc}/shared.js (100%)
 create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/ill/backends/Standard/migrate.inc
 create mode 100644 koha-tmpl/opac-tmpl/bootstrap/en/includes/ill/backends/Standard/create.inc
 create mode 100644 koha-tmpl/opac-tmpl/bootstrap/en/includes/ill/backends/Standard/inc/custom_fields.inc
 create mode 100644 koha-tmpl/opac-tmpl/bootstrap/en/includes/ill/backends/Standard/inc/form_input_helpers.inc
 create mode 100644 koha-tmpl/opac-tmpl/bootstrap/en/includes/ill/backends/Standard/inc/forms/article.inc
 create mode 100644 koha-tmpl/opac-tmpl/bootstrap/en/includes/ill/backends/Standard/inc/forms/book.inc
 create mode 100644 koha-tmpl/opac-tmpl/bootstrap/en/includes/ill/backends/Standard/inc/forms/chapter.inc
 create mode 100644 koha-tmpl/opac-tmpl/bootstrap/en/includes/ill/backends/Standard/inc/forms/conference.inc
 create mode 100644 koha-tmpl/opac-tmpl/bootstrap/en/includes/ill/backends/Standard/inc/forms/dvd.inc
 create mode 100644 koha-tmpl/opac-tmpl/bootstrap/en/includes/ill/backends/Standard/inc/forms/journal.inc
 create mode 100644 koha-tmpl/opac-tmpl/bootstrap/en/includes/ill/backends/Standard/inc/forms/other.inc
 create mode 100644 koha-tmpl/opac-tmpl/bootstrap/en/includes/ill/backends/Standard/inc/forms/resource.inc
 create mode 100644 koha-tmpl/opac-tmpl/bootstrap/en/includes/ill/backends/Standard/inc/forms/thesis.inc
 create mode 100644 koha-tmpl/opac-tmpl/bootstrap/en/includes/ill/backends/Standard/inc/shared.js

diff --git a/Koha/ILL/Backend/intra-includes/cancel.inc b/Koha/ILL/Backend/intra-includes/cancel.inc
deleted file mode 100644
index 3d93a4e844..0000000000
--- a/Koha/ILL/Backend/intra-includes/cancel.inc
+++ /dev/null
@@ -1,16 +0,0 @@
-[% IF whole.error %]
-<p>Unhandled error</p>
-[% END %]
-
-[% IF whole.stage == "confirm" %]
-<h2>Cancel manual request</h2>
-<p>Proceeding with this action will set this request to 'Cancelled'.</p>
-<p>This means that actions have been taken to cancel this request at the source with whom the request was placed.</p>
-<p>If you can confirm this has been done, please proceed.</p>
-<p>
-  [% base_url = "/cgi-bin/koha/ill/ill-requests.pl" %]
-  [% proceed_url = base_url _ "?method=cancel&stage=confirm" _ "&illrequest_id=" _ request.illrequest_id %]
-  <a class="btn btn-sm btn-primary" href="[% proceed_url | url %]">Revert request</a>
-  <a class="btn btn-sm btn-default cancel" href="[% base_url | url %]">Cancel</a>
-</p>
-[% END %]
diff --git a/Koha/ILL/Backend/intra-includes/confirm.inc b/Koha/ILL/Backend/intra-includes/confirm.inc
deleted file mode 100644
index 21a307fcd0..0000000000
--- a/Koha/ILL/Backend/intra-includes/confirm.inc
+++ /dev/null
@@ -1,18 +0,0 @@
-[% IF whole.error %]
-<p>Unhandled error</p>
-[% END %]
-
-[% IF whole.stage == "confirm" %]
-<h2>Confirm manual request</h2>
-<p>Proceeding with this action will set this request to 'Requested'.</p>
-<p>This means that actions have been taken to request this request from a source.</p>
-<p>If you can confirm this has been done, please proceed.</p>
-<p>
-  [% base_url = "/cgi-bin/koha/ill/ill-requests.pl" %]
-  [% proceed_url = base_url _ "?method=confirm&stage=confirm" _ "&illrequest_id=" _ request.illrequest_id %]
-  <a class="btn btn-sm btn-primary" href="[% proceed_url | url %]">Confirm request</a>
-  <a class="btn btn-sm btn-default cancel" href="[% base_url | url %]">Cancel</a>
-</p>
-[% ELSE %]
-<p>Unknown stage.  This should not have happened.
-[% END %]
diff --git a/Koha/ILL/Backend/intra-includes/edititem.inc b/Koha/ILL/Backend/intra-includes/edititem.inc
deleted file mode 100644
index 20a694e804..0000000000
--- a/Koha/ILL/Backend/intra-includes/edititem.inc
+++ /dev/null
@@ -1,94 +0,0 @@
-[% cwd = whole.cwd %]
-[% PROCESS "${cwd}/shared-includes/form_input_helpers.inc" %]
-[% IF whole.error %]
-[% IF whole.status == 'missing_type' %]
-<p><em>Please note:</em> Mandatory field 'type' is missing.</p>
-[% ELSE %]
-<p>Unhandled error</p>
-[% END %]
-[% END %]
-
-[% IF whole.stage == "form" %]
-  <h2>Edit a manual ILL request</h2>
-  <form id="standard_edit_form" method="POST" action="">
-    [% INCLUDE 'csrf-token.inc' %]
-    <fieldset class="rows">
-      <legend>General details</legend>
-      <ol id="general-standard-fields">
-        <li>
-          <label class="required" for="type">Type:</label>
-          <select name="type" id="type">
-            <option value=""/>
-            [% IF whole.value.other.type.lower == "book" %]
-            <option value="book" selected="selected">Book</option>
-            [% ELSE %]
-            <option value="book">Book</option>
-            [% END %]
-            [% IF whole.value.other.type.lower == "chapter" %]
-            <option value="chapter" selected="selected">Chapter</option>
-            [% ELSE %]
-            <option value="chapter">Chapter</option>
-            [% END %]
-            [% IF whole.value.other.type.lower == "journal" %]
-            <option value="journal" selected="selected">Journal</option>
-            [% ELSE %]
-            <option value="journal">Journal</option>
-            [% END %]
-            [% IF whole.value.other.type.lower == "article" %]
-            <option value="article" selected="selected">Journal article</option>
-            [% ELSE %]
-            <option value="article">Journal article</option>
-            [% END %]
-            [% IF whole.value.other.type.lower == "thesis" %]
-            <option value="thesis" selected="selected">Thesis</option>
-            [% ELSE %]
-            <option value="thesis">Thesis</option>
-            [% END %]
-            [% IF whole.value.other.type.lower == "conference" %]
-            <option value="conference" selected="selected">Conference</option>
-            [% ELSE %]
-            <option value="conference">Conference</option>
-            [% END %]
-            [% IF whole.value.other.type.lower == "dvd" %]
-            <option value="dvd" selected="selected">DVD</option>
-            [% ELSE %]
-            <option value="dvd">DVD</option>
-            [% END %]
-            [% IF whole.value.other.type.lower == "other" %]
-            <option value="other" selected="selected">Other</option>
-            [% ELSE %]
-            <option value="other">Other</option>
-            [% END %]
-            [% IF whole.value.other.type.lower == "resource" %]
-            <option value="resource" selected="selected">Generic resource</option>
-            [% ELSE %]
-            <option value="resource">Generic resource</option>
-            [% END %]
-          </select>
-        </li>
-      </ol>
-    </fieldset>
-    [% type = whole.value.other.type %]
-    [% IF type %]
-        [% INCLUDE "${cwd}/shared-includes/forms/${type}.inc" %]
-    [% END %]
-    [% INCLUDE "${cwd}/shared-includes/custom_fields.inc" %]
-    <fieldset class="action">
-      <input id="ill-submit" class="btn btn-primary" type="submit" value="Update"/>
-      <a class="cancel" href="/cgi-bin/koha/ill/ill-requests.pl">Cancel</a>
-    </fieldset>
-    <input type="hidden" name="illrequest_id" value="[% whole.value.other.illrequest_id | html %]" />
-    <input type="hidden" name="op" value="cud-edititem" />
-    <input type="hidden" name="stage" value="form" />
-    <input type="hidden" name="backend" value="Standard" />
-  </form>
-  [% BLOCK backend_jsinclude %]
-  <script>
-      // <![CDATA[]
-      [% INCLUDE "${cwd}/shared-includes/shared.js" %]
-      // ]]>
-  </script>
-  [% END %]
-[% ELSE %]
-  <p>Unknown stage.  This should not have happened.
-[% END %]
diff --git a/Koha/ILL/Backend/intra-includes/migrate.inc b/Koha/ILL/Backend/intra-includes/migrate.inc
deleted file mode 100644
index 02bc61093f..0000000000
--- a/Koha/ILL/Backend/intra-includes/migrate.inc
+++ /dev/null
@@ -1,123 +0,0 @@
-[% IF whole.error %]
-[% IF whole.status == 'missing_identifier' %]
-<p><em>Please note:</em> Mandatory field Identifier is missing.</p>
-[% ELSIF whole.status == 'missing_branch' %]
-<p><em>Please note:</em> Library is a mandatory field.</p>
-[% ELSIF whole.status == 'invalid_borrower' %]
-<p><em>Please note:</em> The patrons details you entered are invalid.</p>
-[% ELSIF whole.status == 'invalid_branch' %]
-<p><em>Please note:</em> The library you chose is invalid.</p>
-[% ELSE %]
-<p>Unhandled error</p>
-[% END %]
-[% END %]
-
-[% IF whole.stage == "form" %]
-<h2>Migrating an ILL request</h2>
-<form id="standard_migrate_form" method="POST" action="">
-  <fieldset class="rows">
-    <legend>General details</legend>
-    <ol id="general-standard-fields">
-      <li>
-        <label class="required" for="type">Type:</label>
-        <select class="form-select" name="type" id="type">
-          <option value=""></option>
-          [% IF whole.value.other.type.lower == "book" %]
-          <option value="book" selected="selected">Book</option>
-          [% ELSE %]
-          <option value="book">Book</option>
-          [% END %]
-          [% IF whole.value.other.type.lower == "chapter" %]
-          <option value="chapter" selected="selected">Chapter</option>
-          [% ELSE %]
-          <option value="chapter">Chapter</option>
-          [% END %]
-          [% IF whole.value.other.type.lower == "journal" %]
-          <option value="journal" selected="selected">Journal</option>
-          [% ELSE %]
-          <option value="journal">Journal</option>
-          [% END %]
-          [% IF whole.value.other.type.lower == "article" %]
-          <option value="article" selected="selected">Journal article</option>
-          [% ELSE %]
-          <option value="article">Journal article</option>
-          [% END %]
-          [% IF whole.value.other.type.lower == "thesis" %]
-          <option value="thesis" selected="selected">Thesis</option>
-          [% ELSE %]
-          <option value="thesis">Thesis</option>
-          [% END %]
-          [% IF whole.value.other.type.lower == "conference" %]
-          <option value="conference" selected="selected">Conference</option>
-          [% ELSE %]
-          <option value="conference">Conference</option>
-          [% END %]
-          [% IF whole.value.other.type.lower == "dvd" %]
-          <option value="dvd" selected="selected">DVD/option>
-          [% ELSE %]
-          <option value="dvd">DVD</option>
-          [% END %]
-          [% IF whole.value.other.type.lower == "other" %]
-          <option value="other" selected="selected">Other</option>
-          [% ELSE %]
-          <option value="other">Other</option>
-          [% END %]
-          [% IF whole.value.other.type.lower == "resource" %]
-          <option value="resource" selected="selected">Generic resource</option>
-          [% ELSE %]
-          <option value="resource">Generic resource</option>
-          [% END %]
-        </select>
-        [% IF required %]
-            <div class="required_label required">Required</div>
-        [% END %]
-      </li>
-    </ol>
-  </fieldset>
-  [% cwd = whole.cwd %]
-  [% type = whole.value.other.type %]
-  [% IF type %]
-      [% INCLUDE "${cwd}/shared-includes/forms/${type}.inc" %]
-  [% END %]
-  [% INCLUDE "${cwd}/shared-includes/custom_fields.inc" %]
-  <fieldset class="rows">
-    <legend>Patron options</legend>
-    <ol>
-      <li>
-        <label class="required" for="cardnumber">
-          Card number or surname:
-        </label>
-        <input type="text" name="cardnumber" id="cardnumber" type="text" value="" />
-            <div class="required_label required">Required</div>
-      </li>
-      <li>
-        <label class="required" for="branchcode">Destination library:</label>xxx
-        <select id="branchcode" name="branchcode">
-          <option value=""></option>
-          [% FOREACH branch IN branches %]
-            <option value="[% branch.branchcode | html %]">
-              [% branch.branchname | html %]
-            </option>
-          [% END %]
-        </select>
-            <div class="required_label required">Required</div>
-      </li>
-    </ol>
-  </fieldset>
-  <fieldset class="action">
-    <input id="ill-submit" type="submit" value="Migrate"/>
-    <a class="cancel" href="/cgi-bin/koha/ill/ill-requests.pl">Cancel</a>
-  </fieldset>
-</form>
-[% BLOCK backend_jsinclude %]
-<script>
-    // <![CDATA[]
-    [% INCLUDE "${cwd}/shared-includes/shared.js" %]
-    // ]]>
-</script>
-[% END %]
-
-[% ELSE %]
-<p>Unknown stage.  This should not have happened.
-
-[% END %]
diff --git a/Koha/ILL/Backend/opac-includes/create.inc b/Koha/ILL/Backend/opac-includes/create.inc
deleted file mode 100644
index 3e8f5581c4..0000000000
--- a/Koha/ILL/Backend/opac-includes/create.inc
+++ /dev/null
@@ -1,131 +0,0 @@
-[% PROCESS 'i18n.inc' %]
-[% cwd = whole.cwd %]
-[% PROCESS "${cwd}/shared-includes/form_input_helpers.inc" %]
-[% IF whole.error %]
-[% IF whole.status == 'missing_identifier' %]
-    <div class="alert alert-warning">
-        <strong>Please note:</strong> Mandatory field Identifier is missing.
-    </div>
-[% ELSIF whole.status == 'missing_type' %]
-    <div class="alert alert-warning">
-        <strong>Please note:</strong> Type is a mandatory field.
-    </div>
-[% ELSIF whole.status == 'missing_branch' %]
-    <div class="alert alert-warning">
-        <strong>Please note:</strong> Library is a mandatory field.
-    </div>
-[% ELSIF whole.status == 'invalid_borrower' %]
-    <div class="alert alert-warning">
-        <strong>Please note:</strong> The patron details you entered are invalid.
-    </div>
-[% ELSIF whole.status == 'invalid_branch' %]
-    <div class="alert alert-warning">
-        <strong>Please note:</strong> The library you chose is invalid.
-    </div>
-[% ELSE %]
-<p>Unhandled error</p>
-[% END %]
-[% END %]
-[% SET opac = whole.value.other.opac %]
-
-[% IF whole.stage == "form" %]
-<h2>Create a manual ILL request</h2>
-<form id="create_form" method="POST" action="">
-  [% INCLUDE 'csrf-token.inc' %]
-    <fieldset class="rows">
-    <legend>Patron options</legend>
-    <ol>
-        [% WRAPPER ill_select_field required = 1 id = 'branchcode' label = t('Destination library') %]
-          <option value=""></option>
-          [% FOREACH branch IN branches %]
-            [% IF whole.value.other.branchcode && branch.branchcode == whole.value.other.branchcode %]
-            <option value="[% branch.branchcode | html %]" selected="selected">
-              [% branch.branchname | html %]
-            </option>
-            [% ELSE %]
-            <option value="[% branch.branchcode | html %]">
-              [% branch.branchname | html %]
-            </option>
-            [% END %]
-          [% END %]
-        [% END #ill_select_field %]
-    </ol>
-  </fieldset>
-  <fieldset class="rows">
-    <legend>General details</legend>
-    <ol id="general-standard-fields">
-        [% WRAPPER ill_select_field required = 1 id = 'type' label = t('Type') %]
-          <option value=""></option>
-          [% IF whole.value.other.type.lower == "book" %]
-          <option value="book" selected="selected">Book</option>
-          [% ELSE %]
-          <option value="book">Book</option>
-          [% END %]
-          [% IF whole.value.other.type.lower == "chapter" %]
-          <option value="chapter" selected="selected">Chapter</option>
-          [% ELSE %]
-          <option value="chapter">Chapter</option>
-          [% END %]
-          [% IF whole.value.other.type.lower == "journal" %]
-          <option value="journal" selected="selected">Journal</option>
-          [% ELSE %]
-          <option value="journal">Journal</option>
-          [% END %]
-          [% IF whole.value.other.type.lower == "article" %]
-          <option value="article" selected="selected">Journal article</option>
-          [% ELSE %]
-          <option value="article">Journal article</option>
-          [% END %]
-          [% IF whole.value.other.type.lower == "thesis" %]
-          <option value="thesis" selected="selected">Thesis</option>
-          [% ELSE %]
-          <option value="thesis">Thesis</option>
-          [% END %]
-          [% IF whole.value.other.type.lower == "conference" %]
-          <option value="conference" selected="selected">Conference</option>
-          [% ELSE %]
-          <option value="conference">Conference</option>
-          [% END %]
-          [% IF whole.value.other.type.lower == "dvd" %]
-          <option value="dvd" selected="selected">DVD</option>
-          [% ELSE %]
-          <option value="dvd">DVD</option>
-          [% END %]
-          [% IF whole.value.other.type.lower == "other" %]
-          <option value="other" selected="selected">Other</option>
-          [% ELSE %]
-          <option value="other">Other</option>
-          [% END %]
-          [% IF whole.value.other.type.lower == "resource" %]
-          <option value="resource" selected="selected">Generic resource</option>
-          [% ELSE %]
-          <option value="resource">Generic resource</option>
-          [% END %]
-        [% END #ill_select_field %]
-    </ol>
-  </fieldset>
-  [% type = whole.value.other.type %]
-  [% IF type %]
-      [% INCLUDE "${cwd}/shared-includes/forms/${type}.inc" %]
-  [% END %]
-  [% INCLUDE "${cwd}/shared-includes/custom_fields.inc" %]
-  <fieldset class="action">
-    <input id="ill-submit" class="btn btn-primary" type="submit" value="Create"/>
-    <a class="cancel" href="/cgi-bin/koha/opac-illrequests.pl">Cancel</a>
-  </fieldset>
-  <input type="hidden" name="op" value="cud-create" />
-  <input type="hidden" name="stage" value="form" />
-  <input type="hidden" name="backend" value="Standard" />
-</form>
-
-[% ELSE %]
-<p>Unknown stage.  This should not have happened.
-
-[% END %]
-[% BLOCK backend_jsinclude %]
-<script>
-    // <![CDATA[]
-    [% INCLUDE "${cwd}/shared-includes/shared.js" %]
-    // ]]>
-</script>
-[% END %]
diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/ill/backends/Standard/cancel.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/ill/backends/Standard/cancel.inc
new file mode 100644
index 0000000000..51ea0f1d0d
--- /dev/null
+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/ill/backends/Standard/cancel.inc
@@ -0,0 +1,16 @@
+[% IF whole.error %]
+    <p>Unhandled error</p>
+[% END %]
+
+[% IF whole.stage == "confirm" %]
+    <h2>Cancel manual request</h2>
+    <p>Proceeding with this action will set this request to 'Cancelled'.</p>
+    <p>This means that actions have been taken to cancel this request at the source with whom the request was placed.</p>
+    <p>If you can confirm this has been done, please proceed.</p>
+    <p>
+        [% base_url = "/cgi-bin/koha/ill/ill-requests.pl" %]
+        [% proceed_url = base_url _ "?method=cancel&stage=confirm" _ "&illrequest_id=" _ request.illrequest_id %]
+        <a class="btn btn-sm btn-primary" href="[% proceed_url | url %]">Revert request</a>
+        <a class="btn btn-sm btn-default cancel" href="[% base_url | url %]">Cancel</a>
+    </p>
+[% END %]
diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/ill/backends/Standard/confirm.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/ill/backends/Standard/confirm.inc
new file mode 100644
index 0000000000..d80ffdb8eb
--- /dev/null
+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/ill/backends/Standard/confirm.inc
@@ -0,0 +1,18 @@
+[% IF whole.error %]
+    <p>Unhandled error</p>
+[% END %]
+
+[% IF whole.stage == "confirm" %]
+    <h2>Confirm manual request</h2>
+    <p>Proceeding with this action will set this request to 'Requested'.</p>
+    <p>This means that actions have been taken to request this request from a source.</p>
+    <p>If you can confirm this has been done, please proceed.</p>
+    <p>
+        [% base_url = "/cgi-bin/koha/ill/ill-requests.pl" %]
+        [% proceed_url = base_url _ "?method=confirm&stage=confirm" _ "&illrequest_id=" _ request.illrequest_id %]
+        <a class="btn btn-sm btn-primary" href="[% proceed_url | url %]">Confirm request</a>
+        <a class="btn btn-sm btn-default cancel" href="[% base_url | url %]">Cancel</a>
+    </p>
+[% ELSE %]
+    <p>Unknown stage. This should not have happened. </p>
+[% END %]
diff --git a/Koha/ILL/Backend/intra-includes/create.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/ill/backends/Standard/create.inc
similarity index 96%
rename from Koha/ILL/Backend/intra-includes/create.inc
rename to koha-tmpl/intranet-tmpl/prog/en/includes/ill/backends/Standard/create.inc
index 2e9bfb837d..29e137b3bf 100644
--- a/Koha/ILL/Backend/intra-includes/create.inc
+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/ill/backends/Standard/create.inc
@@ -1,6 +1,5 @@
 [% SET koha_version = Koha.Version %]
-[% cwd = whole.cwd %]
-[% PROCESS "${cwd}/shared-includes/form_input_helpers.inc" %]
+[% PROCESS "ill/backends/Standard/inc/form_input_helpers.inc" %]
 [% IF whole.error %]
 [% IF whole.status == 'missing_identifier' %]
 <p><em>Please note:</em> Mandatory field Identifier is missing.</p>
@@ -77,9 +76,9 @@
   </fieldset>
   [% type = whole.value.other.type %]
   [% IF type %]
-      [% INCLUDE "${cwd}/shared-includes/forms/${type}.inc" %]
+      [% INCLUDE "ill/backends/Standard/inc/forms/${type}.inc" %]
   [% END %]
-  [% INCLUDE "${cwd}/shared-includes/custom_fields.inc" %]
+  [% INCLUDE "ill/backends/Standard/inc/custom_fields.inc" %]
   <fieldset class="rows">
     <legend>Patron options</legend>
     <ol>
@@ -119,7 +118,7 @@
 [% BLOCK backend_jsinclude %]
 <script>
     // <![CDATA[]
-    [% INCLUDE "${cwd}/shared-includes/shared.js" %]
+    [% INCLUDE "ill/backends/Standard/inc/shared.js" %]
     // Require a username and branch selection
     document.addEventListener('DOMContentLoaded', function(){
       let cardnumber_input = '#create_form #cardnumber';
diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/ill/backends/Standard/edititem.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/ill/backends/Standard/edititem.inc
new file mode 100644
index 0000000000..fe67493c35
--- /dev/null
+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/ill/backends/Standard/edititem.inc
@@ -0,0 +1,93 @@
+[% PROCESS "ill/backends/Standard/inc/form_input_helpers.inc" %]
+[% IF whole.error %]
+    [% IF whole.status == 'missing_type' %]
+        <p><em>Please note:</em> Mandatory field 'type' is missing.</p>
+    [% ELSE %]
+        <p>Unhandled error</p>
+    [% END %]
+[% END %]
+
+[% IF whole.stage == "form" %]
+    <h2>Edit a manual ILL request</h2>
+    <form id="standard_edit_form" method="POST" action="">
+        [% INCLUDE 'csrf-token.inc' %]
+        <fieldset class="rows">
+            <legend>General details</legend>
+            <ol id="general-standard-fields">
+                <li>
+                    <label class="required" for="type">Type:</label>
+                    <select name="type" id="type">
+                        <option value="" />
+                        [% IF whole.value.other.type.lower == "book" %]
+                            <option value="book" selected="selected">Book</option>
+                        [% ELSE %]
+                            <option value="book">Book</option>
+                        [% END %]
+                        [% IF whole.value.other.type.lower == "chapter" %]
+                            <option value="chapter" selected="selected">Chapter</option>
+                        [% ELSE %]
+                            <option value="chapter">Chapter</option>
+                        [% END %]
+                        [% IF whole.value.other.type.lower == "journal" %]
+                            <option value="journal" selected="selected">Journal</option>
+                        [% ELSE %]
+                            <option value="journal">Journal</option>
+                        [% END %]
+                        [% IF whole.value.other.type.lower == "article" %]
+                            <option value="article" selected="selected">Journal article</option>
+                        [% ELSE %]
+                            <option value="article">Journal article</option>
+                        [% END %]
+                        [% IF whole.value.other.type.lower == "thesis" %]
+                            <option value="thesis" selected="selected">Thesis</option>
+                        [% ELSE %]
+                            <option value="thesis">Thesis</option>
+                        [% END %]
+                        [% IF whole.value.other.type.lower == "conference" %]
+                            <option value="conference" selected="selected">Conference</option>
+                        [% ELSE %]
+                            <option value="conference">Conference</option>
+                        [% END %]
+                        [% IF whole.value.other.type.lower == "dvd" %]
+                            <option value="dvd" selected="selected">DVD</option>
+                        [% ELSE %]
+                            <option value="dvd">DVD</option>
+                        [% END %]
+                        [% IF whole.value.other.type.lower == "other" %]
+                            <option value="other" selected="selected">Other</option>
+                        [% ELSE %]
+                            <option value="other">Other</option>
+                        [% END %]
+                        [% IF whole.value.other.type.lower == "resource" %]
+                            <option value="resource" selected="selected">Generic resource</option>
+                        [% ELSE %]
+                            <option value="resource">Generic resource</option>
+                        [% END %]
+                    </select>
+                </li>
+            </ol>
+        </fieldset>
+        [% type = whole.value.other.type %]
+        [% IF type %]
+            [% INCLUDE "ill/backends/Standard/inc/forms/${type}.inc" %]
+        [% END %]
+        [% INCLUDE "ill/backends/Standard/inc/custom_fields.inc" %]
+        <fieldset class="action">
+            <input id="ill-submit" class="btn btn-primary" type="submit" value="Update" />
+            <a class="cancel" href="/cgi-bin/koha/ill/ill-requests.pl">Cancel</a>
+        </fieldset>
+        <input type="hidden" name="illrequest_id" value="[% whole.value.other.illrequest_id | html %]" />
+        <input type="hidden" name="op" value="cud-edititem" />
+        <input type="hidden" name="stage" value="form" />
+        <input type="hidden" name="backend" value="Standard" />
+    </form>
+    [% BLOCK backend_jsinclude %]
+        <script>
+            // <![CDATA[]
+            [% INCLUDE "ill/backends/Standard/inc/shared.js" %]
+            // ]]>
+        </script>
+    [% END %]
+[% ELSE %]
+    <p>Unknown stage. This should not have happened. </p>
+[% END %]
diff --git a/Koha/ILL/Backend/intra-includes/illview.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/ill/backends/Standard/illview.inc
similarity index 100%
rename from Koha/ILL/Backend/intra-includes/illview.inc
rename to koha-tmpl/intranet-tmpl/prog/en/includes/ill/backends/Standard/illview.inc
diff --git a/Koha/ILL/Backend/shared-includes/custom_fields.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/ill/backends/Standard/inc/custom_fields.inc
similarity index 71%
rename from Koha/ILL/Backend/shared-includes/custom_fields.inc
rename to koha-tmpl/intranet-tmpl/prog/en/includes/ill/backends/Standard/inc/custom_fields.inc
index 1badd2af78..e49b383263 100644
--- a/Koha/ILL/Backend/shared-includes/custom_fields.inc
+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/ill/backends/Standard/inc/custom_fields.inc
@@ -7,30 +7,28 @@
         [% FOREACH key IN keys %]
             <li class="form-horizontal">
                 [% IF opac %]
-                    <input type="text" placeholder="key" class="form-control input-fluid custom-field-input custom-name" name="custom_key" value="[% key | html %]">
-                    <input type="text" placeholder="value" class="form-control input-fluid custom-field-input" name="custom_value" id="custom-value" value="[% values.$i | html %]">
+                    <input type="text" placeholder="key" class="form-control input-fluid custom-field-input custom-name" name="custom_key" value="[% key | html %]" />
+                    <input type="text" placeholder="value" class="form-control input-fluid custom-field-input" name="custom_value" id="custom-value" value="[% values.$i | html %]" />
                 [% ELSE %]
-                    <input type="text" placeholder="key" class="custom-name" name="custom_key" value="[% key | html %]">
-                    <input type="text" placeholder="value" name="custom_value" id="custom-value" value="[% values.$i | html %]">
+                    <input type="text" placeholder="key" class="custom-name" name="custom_key" value="[% key | html %]" />
+                    <input type="text" placeholder="value" name="custom_value" id="custom-value" value="[% values.$i | html %]" />
                 [% END %]
-                <button value="[% i | html %]" name="custom_delete" type="submit" class="btn btn-danger btn-sm delete-new-field">
-                    <span class="fa fa-trash"></span> Delete
-                </button>
+                <button value="[% i | html %]" name="custom_delete" type="submit" class="btn btn-danger btn-sm delete-new-field"> <span class="fa fa-trash"></span> Delete </button>
             </li>
             [% i = i + 1 %]
         [% END %]
     </ol>
     <div id="custom-warning" style="display:none;margin:1em;" class="error required"></div>
-        <button type="button" id="add-new-fields" class="btn btn-default">
+    <button type="button" id="add-new-fields" class="btn btn-default">
         <span class="fa fa-plus"></span>
         Add new field
     </button>
 </fieldset>
 
 <style>
-.custom-field-input {
-    width: 25%;
-    display: inline-block;
-    margin-left: 0.5em;
-}
+    .custom-field-input {
+        width: 25%;
+        display: inline-block;
+        margin-left: 0.5em;
+    }
 </style>
diff --git a/Koha/ILL/Backend/shared-includes/form_input_helpers.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/ill/backends/Standard/inc/form_input_helpers.inc
similarity index 100%
rename from Koha/ILL/Backend/shared-includes/form_input_helpers.inc
rename to koha-tmpl/intranet-tmpl/prog/en/includes/ill/backends/Standard/inc/form_input_helpers.inc
diff --git a/Koha/ILL/Backend/shared-includes/forms/article.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/ill/backends/Standard/inc/forms/article.inc
similarity index 100%
rename from Koha/ILL/Backend/shared-includes/forms/article.inc
rename to koha-tmpl/intranet-tmpl/prog/en/includes/ill/backends/Standard/inc/forms/article.inc
diff --git a/Koha/ILL/Backend/shared-includes/forms/book.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/ill/backends/Standard/inc/forms/book.inc
similarity index 100%
rename from Koha/ILL/Backend/shared-includes/forms/book.inc
rename to koha-tmpl/intranet-tmpl/prog/en/includes/ill/backends/Standard/inc/forms/book.inc
diff --git a/Koha/ILL/Backend/shared-includes/forms/chapter.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/ill/backends/Standard/inc/forms/chapter.inc
similarity index 100%
rename from Koha/ILL/Backend/shared-includes/forms/chapter.inc
rename to koha-tmpl/intranet-tmpl/prog/en/includes/ill/backends/Standard/inc/forms/chapter.inc
diff --git a/Koha/ILL/Backend/shared-includes/forms/conference.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/ill/backends/Standard/inc/forms/conference.inc
similarity index 100%
rename from Koha/ILL/Backend/shared-includes/forms/conference.inc
rename to koha-tmpl/intranet-tmpl/prog/en/includes/ill/backends/Standard/inc/forms/conference.inc
diff --git a/Koha/ILL/Backend/shared-includes/forms/dvd.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/ill/backends/Standard/inc/forms/dvd.inc
similarity index 100%
rename from Koha/ILL/Backend/shared-includes/forms/dvd.inc
rename to koha-tmpl/intranet-tmpl/prog/en/includes/ill/backends/Standard/inc/forms/dvd.inc
diff --git a/Koha/ILL/Backend/shared-includes/forms/journal.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/ill/backends/Standard/inc/forms/journal.inc
similarity index 100%
rename from Koha/ILL/Backend/shared-includes/forms/journal.inc
rename to koha-tmpl/intranet-tmpl/prog/en/includes/ill/backends/Standard/inc/forms/journal.inc
diff --git a/Koha/ILL/Backend/shared-includes/forms/other.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/ill/backends/Standard/inc/forms/other.inc
similarity index 100%
rename from Koha/ILL/Backend/shared-includes/forms/other.inc
rename to koha-tmpl/intranet-tmpl/prog/en/includes/ill/backends/Standard/inc/forms/other.inc
diff --git a/Koha/ILL/Backend/shared-includes/forms/resource.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/ill/backends/Standard/inc/forms/resource.inc
similarity index 100%
rename from Koha/ILL/Backend/shared-includes/forms/resource.inc
rename to koha-tmpl/intranet-tmpl/prog/en/includes/ill/backends/Standard/inc/forms/resource.inc
diff --git a/Koha/ILL/Backend/shared-includes/forms/thesis.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/ill/backends/Standard/inc/forms/thesis.inc
similarity index 100%
rename from Koha/ILL/Backend/shared-includes/forms/thesis.inc
rename to koha-tmpl/intranet-tmpl/prog/en/includes/ill/backends/Standard/inc/forms/thesis.inc
diff --git a/Koha/ILL/Backend/shared-includes/shared.js b/koha-tmpl/intranet-tmpl/prog/en/includes/ill/backends/Standard/inc/shared.js
similarity index 100%
rename from Koha/ILL/Backend/shared-includes/shared.js
rename to koha-tmpl/intranet-tmpl/prog/en/includes/ill/backends/Standard/inc/shared.js
diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/ill/backends/Standard/migrate.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/ill/backends/Standard/migrate.inc
new file mode 100644
index 0000000000..af20a7fdb6
--- /dev/null
+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/ill/backends/Standard/migrate.inc
@@ -0,0 +1,116 @@
+[% IF whole.error %]
+    [% IF whole.status == 'missing_identifier' %]
+        <p><em>Please note:</em> Mandatory field Identifier is missing.</p>
+    [% ELSIF whole.status == 'missing_branch' %]
+        <p><em>Please note:</em> Library is a mandatory field.</p>
+    [% ELSIF whole.status == 'invalid_borrower' %]
+        <p><em>Please note:</em> The patrons details you entered are invalid.</p>
+    [% ELSIF whole.status == 'invalid_branch' %]
+        <p><em>Please note:</em> The library you chose is invalid.</p>
+    [% ELSE %]
+        <p>Unhandled error</p>
+    [% END %]
+[% END %]
+
+[% IF whole.stage == "form" %]
+    <h2>Migrating an ILL request</h2>
+    <form id="standard_migrate_form" method="POST" action="">
+        <fieldset class="rows">
+            <legend>General details</legend>
+            <ol id="general-standard-fields">
+                <li>
+                    <label class="required" for="type">Type:</label>
+                    <select class="form-select" name="type" id="type">
+                        <option value=""></option>
+                        [% IF whole.value.other.type.lower == "book" %]
+                            <option value="book" selected="selected">Book</option>
+                        [% ELSE %]
+                            <option value="book">Book</option>
+                        [% END %]
+                        [% IF whole.value.other.type.lower == "chapter" %]
+                            <option value="chapter" selected="selected">Chapter</option>
+                        [% ELSE %]
+                            <option value="chapter">Chapter</option>
+                        [% END %]
+                        [% IF whole.value.other.type.lower == "journal" %]
+                            <option value="journal" selected="selected">Journal</option>
+                        [% ELSE %]
+                            <option value="journal">Journal</option>
+                        [% END %]
+                        [% IF whole.value.other.type.lower == "article" %]
+                            <option value="article" selected="selected">Journal article</option>
+                        [% ELSE %]
+                            <option value="article">Journal article</option>
+                        [% END %]
+                        [% IF whole.value.other.type.lower == "thesis" %]
+                            <option value="thesis" selected="selected">Thesis</option>
+                        [% ELSE %]
+                            <option value="thesis">Thesis</option>
+                        [% END %]
+                        [% IF whole.value.other.type.lower == "conference" %]
+                            <option value="conference" selected="selected">Conference</option>
+                        [% ELSE %]
+                            <option value="conference">Conference</option>
+                        [% END %]
+                        [% IF whole.value.other.type.lower == "dvd" %]
+                            <option value="dvd" selected="selected">DVD/option> </option>
+                        [% ELSE %]
+                            <option value="dvd">DVD</option>
+                        [% END %]
+                        [% IF whole.value.other.type.lower == "other" %]
+                            <option value="other" selected="selected">Other</option>
+                        [% ELSE %]
+                            <option value="other">Other</option>
+                        [% END %]
+                        [% IF whole.value.other.type.lower == "resource" %]
+                            <option value="resource" selected="selected">Generic resource</option>
+                        [% ELSE %]
+                            <option value="resource">Generic resource</option>
+                        [% END %]
+                    </select>
+                    [% IF required %]
+                        <div class="required_label required">Required</div>
+                    [% END %]
+                </li>
+            </ol>
+        </fieldset>
+        [% type = whole.value.other.type %]
+        [% IF type %]
+            [% INCLUDE "ill/backends/Standard/inc/forms/${type}.inc" %]
+        [% END %]
+        [% INCLUDE "ill/backends/Standard/inc/custom_fields.inc" %]
+        <fieldset class="rows">
+            <legend>Patron options</legend>
+            <ol>
+                <li>
+                    <label class="required" for="cardnumber"> Card number or surname: </label>
+                    <input type="text" name="cardnumber" id="cardnumber" type="text" value="" />
+                    <div class="required_label required">Required</div>
+                </li>
+                <li>
+                    <label class="required" for="branchcode">Destination library:</label>xxx
+                    <select id="branchcode" name="branchcode">
+                        <option value=""></option>
+                        [% FOREACH branch IN branches %]
+                            <option value="[% branch.branchcode | html %]"> [% branch.branchname | html %] </option>
+                        [% END %]
+                    </select>
+                    <div class="required_label required">Required</div>
+                </li>
+            </ol>
+        </fieldset>
+        <fieldset class="action">
+            <input id="ill-submit" type="submit" value="Migrate" />
+            <a class="cancel" href="/cgi-bin/koha/ill/ill-requests.pl">Cancel</a>
+        </fieldset>
+    </form>
+    [% BLOCK backend_jsinclude %]
+        <script>
+            // <![CDATA[]
+            [% INCLUDE "ill/backends/Standard/inc/shared.js" %]
+            // ]]>
+        </script>
+    [% END %]
+[% ELSE %]
+    <p>Unknown stage. This should not have happened. </p>
+[% END %]
diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/ill/backends/Standard/create.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/ill/backends/Standard/create.inc
new file mode 100644
index 0000000000..d79b91ef52
--- /dev/null
+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/ill/backends/Standard/create.inc
@@ -0,0 +1,114 @@
+[% PROCESS 'i18n.inc' %]
+[% PROCESS "ill/backends/Standard/inc/form_input_helpers.inc" %]
+[% IF whole.error %]
+    [% IF whole.status == 'missing_identifier' %]
+        <div class="alert alert-warning"> <strong>Please note:</strong> Mandatory field Identifier is missing. </div>
+    [% ELSIF whole.status == 'missing_type' %]
+        <div class="alert alert-warning"> <strong>Please note:</strong> Type is a mandatory field. </div>
+    [% ELSIF whole.status == 'missing_branch' %]
+        <div class="alert alert-warning"> <strong>Please note:</strong> Library is a mandatory field. </div>
+    [% ELSIF whole.status == 'invalid_borrower' %]
+        <div class="alert alert-warning"> <strong>Please note:</strong> The patron details you entered are invalid. </div>
+    [% ELSIF whole.status == 'invalid_branch' %]
+        <div class="alert alert-warning"> <strong>Please note:</strong> The library you chose is invalid. </div>
+    [% ELSE %]
+        <p>Unhandled error</p>
+    [% END %]
+[% END %]
+[% SET opac = whole.value.other.opac %]
+
+[% IF whole.stage == "form" %]
+    <h2>Create a manual ILL request</h2>
+    <form id="create_form" method="POST" action="">
+        [% INCLUDE 'csrf-token.inc' %]
+        <fieldset class="rows">
+            <legend>Patron options</legend>
+            <ol>
+                [% WRAPPER ill_select_field required = 1 id = 'branchcode' label = t('Destination library') %]
+                    <option value=""></option>
+                    [% FOREACH branch IN branches %]
+                        [% IF whole.value.other.branchcode && branch.branchcode == whole.value.other.branchcode %]
+                            <option value="[% branch.branchcode | html %]" selected="selected"> [% branch.branchname | html %] </option>
+                        [% ELSE %]
+                            <option value="[% branch.branchcode | html %]"> [% branch.branchname | html %] </option>
+                        [% END %]
+                    [% END %]
+                [% END #ill_select_field %]
+            </ol>
+        </fieldset>
+        <fieldset class="rows">
+            <legend>General details</legend>
+            <ol id="general-standard-fields">
+                [% WRAPPER ill_select_field required = 1 id = 'type' label = t('Type') %]
+                    <option value=""></option>
+                    [% IF whole.value.other.type.lower == "book" %]
+                        <option value="book" selected="selected">Book</option>
+                    [% ELSE %]
+                        <option value="book">Book</option>
+                    [% END %]
+                    [% IF whole.value.other.type.lower == "chapter" %]
+                        <option value="chapter" selected="selected">Chapter</option>
+                    [% ELSE %]
+                        <option value="chapter">Chapter</option>
+                    [% END %]
+                    [% IF whole.value.other.type.lower == "journal" %]
+                        <option value="journal" selected="selected">Journal</option>
+                    [% ELSE %]
+                        <option value="journal">Journal</option>
+                    [% END %]
+                    [% IF whole.value.other.type.lower == "article" %]
+                        <option value="article" selected="selected">Journal article</option>
+                    [% ELSE %]
+                        <option value="article">Journal article</option>
+                    [% END %]
+                    [% IF whole.value.other.type.lower == "thesis" %]
+                        <option value="thesis" selected="selected">Thesis</option>
+                    [% ELSE %]
+                        <option value="thesis">Thesis</option>
+                    [% END %]
+                    [% IF whole.value.other.type.lower == "conference" %]
+                        <option value="conference" selected="selected">Conference</option>
+                    [% ELSE %]
+                        <option value="conference">Conference</option>
+                    [% END %]
+                    [% IF whole.value.other.type.lower == "dvd" %]
+                        <option value="dvd" selected="selected">DVD</option>
+                    [% ELSE %]
+                        <option value="dvd">DVD</option>
+                    [% END %]
+                    [% IF whole.value.other.type.lower == "other" %]
+                        <option value="other" selected="selected">Other</option>
+                    [% ELSE %]
+                        <option value="other">Other</option>
+                    [% END %]
+                    [% IF whole.value.other.type.lower == "resource" %]
+                        <option value="resource" selected="selected">Generic resource</option>
+                    [% ELSE %]
+                        <option value="resource">Generic resource</option>
+                    [% END %]
+                [% END #ill_select_field %]
+            </ol>
+        </fieldset>
+        [% type = whole.value.other.type %]
+        [% IF type %]
+            [% INCLUDE "ill/backends/Standard/inc/forms/${type}.inc" %]
+        [% END %]
+        [% INCLUDE "ill/backends/Standard/inc/custom_fields.inc" %]
+        <fieldset class="action">
+            <input id="ill-submit" class="btn btn-primary" type="submit" value="Create" />
+            <a class="cancel" href="/cgi-bin/koha/opac-illrequests.pl">Cancel</a>
+        </fieldset>
+        <input type="hidden" name="op" value="cud-create" />
+        <input type="hidden" name="stage" value="form" />
+        <input type="hidden" name="backend" value="Standard" />
+    </form>
+[% ELSE %]
+    <p>Unknown stage. This should not have happened. </p>
+[% END %]
+[% BLOCK backend_jsinclude %]
+    <script>
+        // <![CDATA[]
+        [% INCLUDE "ill/backends/Standard/inc/shared.js" %]
+        // ]]>
+    </script>
+[% END %]
diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/ill/backends/Standard/inc/custom_fields.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/ill/backends/Standard/inc/custom_fields.inc
new file mode 100644
index 0000000000..e49b383263
--- /dev/null
+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/ill/backends/Standard/inc/custom_fields.inc
@@ -0,0 +1,34 @@
+<fieldset class="rows">
+    <legend>Custom fields</legend>
+    <ol id="standard-fields">
+        [% keys = whole.value.other.custom_key.split('\0') %]
+        [% values = whole.value.other.custom_value.split('\0') %]
+        [% i = 0 %]
+        [% FOREACH key IN keys %]
+            <li class="form-horizontal">
+                [% IF opac %]
+                    <input type="text" placeholder="key" class="form-control input-fluid custom-field-input custom-name" name="custom_key" value="[% key | html %]" />
+                    <input type="text" placeholder="value" class="form-control input-fluid custom-field-input" name="custom_value" id="custom-value" value="[% values.$i | html %]" />
+                [% ELSE %]
+                    <input type="text" placeholder="key" class="custom-name" name="custom_key" value="[% key | html %]" />
+                    <input type="text" placeholder="value" name="custom_value" id="custom-value" value="[% values.$i | html %]" />
+                [% END %]
+                <button value="[% i | html %]" name="custom_delete" type="submit" class="btn btn-danger btn-sm delete-new-field"> <span class="fa fa-trash"></span> Delete </button>
+            </li>
+            [% i = i + 1 %]
+        [% END %]
+    </ol>
+    <div id="custom-warning" style="display:none;margin:1em;" class="error required"></div>
+    <button type="button" id="add-new-fields" class="btn btn-default">
+        <span class="fa fa-plus"></span>
+        Add new field
+    </button>
+</fieldset>
+
+<style>
+    .custom-field-input {
+        width: 25%;
+        display: inline-block;
+        margin-left: 0.5em;
+    }
+</style>
diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/ill/backends/Standard/inc/form_input_helpers.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/ill/backends/Standard/inc/form_input_helpers.inc
new file mode 100644
index 0000000000..5ac8be9b86
--- /dev/null
+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/ill/backends/Standard/inc/form_input_helpers.inc
@@ -0,0 +1,52 @@
+[% BLOCK ill_text_input_field %]
+    <li>
+        <label for="[% id | html %]">[% label | html %]:</label>
+        [% IF opac %]
+            <input class="form-control input-fluid" type="text" name="[% id | html %]" id="[% id | html%]" value="[% value | html %]" />
+        [% ELSE %]
+            <input type="text" name="[% id | html %]" id="[% id | html%]" value="[% value | html %]" />
+        [% END %]
+        [% IF required %]
+            <div class="required_label required">Required</div>
+        [% END %]
+        [% SET required = 0 %]
+    </li>
+[% END %]
+
+[% BLOCK ill_select_field %]
+    <li>
+        <label for="[% id | html %]">[% label | html %]:</label>
+        [% IF opac %]
+            <select class="form-select input-fluid" name="[% id | html %]" id="[% id | html %]">
+        [% ELSE %]
+            <select name="[% id | html %]" id="[% id | html %]">
+        [% END %]
+            [% content | $raw %]
+        </select>
+        [% IF required %]
+            <div class="required_label required">Required</div>
+        [% END %]
+        [% SET required = 0 %]
+    </li>
+[% END %]
+
+[% BLOCK book_text_input_fields %]
+  [% PROCESS ill_text_input_field id = 'title' label = t('Title') value = whole.value.other.title %]
+  [% PROCESS ill_text_input_field id = 'author' label = t('Author') value = whole.value.other.author %]
+  [% PROCESS ill_text_input_field id = 'editor' label = t('Editor') value = whole.value.other.editor %]
+  [% PROCESS ill_text_input_field id = 'publisher' label = t('Publisher') value = whole.value.other.publisher %]
+  [% PROCESS ill_text_input_field id = 'published_place' label = t('Place of publication') value = whole.value.other.published_place %]
+  [% PROCESS ill_text_input_field id = 'year' label = t('Year') value = whole.value.other.year %]
+  [% PROCESS ill_text_input_field id = 'part_edition' label = t('Part / Edition') value = whole.value.other.part_edition %]
+  [% PROCESS ill_text_input_field id = 'volume' label = t('Volume') value = whole.value.other.volume %]
+  [% PROCESS ill_text_input_field id = 'isbn' label = t('ISBN') value = whole.value.other.isbn %]
+  [% PROCESS ill_text_input_field id = 'doi' label = t('DOI') value = whole.value.other.doi %]
+[% END %]
+
+[% BLOCK journal_text_input_fields %]
+  [% PROCESS ill_text_input_field id = 'title' label = t('Title') value = whole.value.other.title %]
+  [% PROCESS ill_text_input_field id = 'volume' label = t('Volume') value = whole.value.other.volume %]
+  [% PROCESS ill_text_input_field id = 'issue' label = t('Issue number') value = whole.value.other.issue %]
+  [% PROCESS ill_text_input_field id = 'year' label = t('Year') value = whole.value.other.year %]
+  [% PROCESS ill_text_input_field id = 'issn' label = t('ISSN') value = whole.value.other.issn %]
+[% END %]
diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/ill/backends/Standard/inc/forms/article.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/ill/backends/Standard/inc/forms/article.inc
new file mode 100644
index 0000000000..07a52d3eae
--- /dev/null
+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/ill/backends/Standard/inc/forms/article.inc
@@ -0,0 +1,16 @@
+<fieldset id="journal-standard-fieldset" class="rows">
+    <legend>Journal details</legend>
+    <ol id="journal-standard-fields">
+        [% PROCESS journal_text_input_fields %]
+    </ol>
+</fieldset>
+<fieldset id="article-standard-fieldset" class="rows">
+    <legend>Article details</legend>
+    <ol id="article-standard-fields">
+        [% PROCESS ill_text_input_field id = 'article_title' label = t('Article title') value = whole.value.other.article_title %]
+        [% PROCESS ill_text_input_field id = 'article_author' label = t('Article author') value = whole.value.other.article_author %]
+        [% PROCESS ill_text_input_field id = 'published_date' label = t('Publication date') value = whole.value.other.published_date %]
+        [% PROCESS ill_text_input_field id = 'pages' label = t('Pages') value = whole.value.other.pages %]
+        [% PROCESS ill_text_input_field id = 'doi' label = t('DOI') value = whole.value.other.doi %]
+    </ol>
+</fieldset>
diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/ill/backends/Standard/inc/forms/book.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/ill/backends/Standard/inc/forms/book.inc
new file mode 100644
index 0000000000..0f84f66901
--- /dev/null
+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/ill/backends/Standard/inc/forms/book.inc
@@ -0,0 +1,6 @@
+<fieldset id="book-standard-fieldset" class="rows">
+    <legend>Book details</legend>
+    <ol id="publication-standard-fields">
+        [% PROCESS book_text_input_fields %]
+    </ol>
+</fieldset>
diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/ill/backends/Standard/inc/forms/chapter.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/ill/backends/Standard/inc/forms/chapter.inc
new file mode 100644
index 0000000000..4831257193
--- /dev/null
+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/ill/backends/Standard/inc/forms/chapter.inc
@@ -0,0 +1,14 @@
+<fieldset id="book-standard-fieldset" class="rows">
+    <legend>Book details</legend>
+    <ol id="publication-standard-fields">
+        [% PROCESS book_text_input_fields %]
+    </ol>
+</fieldset>
+<fieldset id="chapter-standard-fieldset" class="rows">
+    <legend>Chapter details</legend>
+    <ol id="chapter-standard-fields">
+        [% PROCESS ill_text_input_field id = 'chapter_author' label = t('Author') value = whole.value.other.chapter_author %]
+        [% PROCESS ill_text_input_field id = 'chapter' label = t('Chapter') value = whole.value.other.chapter %]
+        [% PROCESS ill_text_input_field id = 'pages' label = t('Pages') value = whole.value.other.pages %]
+    </ol>
+</fieldset>
diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/ill/backends/Standard/inc/forms/conference.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/ill/backends/Standard/inc/forms/conference.inc
new file mode 100644
index 0000000000..ce74a27e59
--- /dev/null
+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/ill/backends/Standard/inc/forms/conference.inc
@@ -0,0 +1,16 @@
+<fieldset id="conference-standard-fieldset" class="rows">
+    <legend>Conference details</legend>
+    <ol id="conference-standard-fields">
+        [% PROCESS ill_text_input_field id = 'title' label = t('Conference title') value = whole.value.other.title %]
+        [% PROCESS ill_text_input_field id = 'publication' label = t('Publication') value = whole.value.other.publication %]
+        [% PROCESS ill_text_input_field id = 'conference_date' label = t('Conference date') value = whole.value.other.conference_date %]
+        [% PROCESS ill_text_input_field id = 'venue' label = t('Venue') value = whole.value.other.venue %]
+        [% PROCESS ill_text_input_field id = 'sponsor' label = t('Sponsor') value = whole.value.other.sponsor %]
+        [% PROCESS ill_text_input_field id = 'volume' label = t('Volume') value = whole.value.other.volume %]
+        [% PROCESS ill_text_input_field id = 'isbn' label = t('ISBN') value = whole.value.other.isbn %]
+        [% PROCESS ill_text_input_field id = 'issn' label = t('ISSN') value = whole.value.other.issn %]
+        [% PROCESS ill_text_input_field id = 'part_edition' label = t('Part') value = whole.value.other.part_edition %]
+        [% PROCESS ill_text_input_field id = 'paper_title' label = t('Paper title') value = whole.value.other.paper_title %]
+        [% PROCESS ill_text_input_field id = 'paper_author' label = t('Paper author') value = whole.value.other.paper_author %]
+    </ol>
+</fieldset>
diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/ill/backends/Standard/inc/forms/dvd.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/ill/backends/Standard/inc/forms/dvd.inc
new file mode 100644
index 0000000000..380c429ee7
--- /dev/null
+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/ill/backends/Standard/inc/forms/dvd.inc
@@ -0,0 +1,12 @@
+<fieldset id="dvd-standard-fieldset" class="rows">
+    <legend>DVD details</legend>
+    <ol id="dvd-standard-fields">
+        [% PROCESS ill_text_input_field id = 'title' label = t('Title') value = whole.value.other.title %]
+        [% PROCESS ill_text_input_field id = 'author' label = t('Author') value = whole.value.other.author %]
+        [% PROCESS ill_text_input_field id = 'studio' label = t('Studio') value = whole.value.other.studio %]
+        [% PROCESS ill_text_input_field id = 'genre' label = t('Genre') value = whole.value.other.genre %]
+        [% PROCESS ill_text_input_field id = 'year' label = t('Year') value = whole.value.other.year %]
+        [% PROCESS ill_text_input_field id = 'format' label = t('Format') value = whole.value.other.format %]
+        [% PROCESS ill_text_input_field id = 'language' label = t('Language') value = whole.value.other.language %]
+    </ol>
+</fieldset>
diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/ill/backends/Standard/inc/forms/journal.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/ill/backends/Standard/inc/forms/journal.inc
new file mode 100644
index 0000000000..80b05ddfd8
--- /dev/null
+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/ill/backends/Standard/inc/forms/journal.inc
@@ -0,0 +1,7 @@
+<fieldset id="journal-standard-fieldset" class="rows">
+    <legend>Journal details</legend>
+    <ol id="journal-standard-fields">
+        [% PROCESS journal_text_input_fields %]
+        [% PROCESS ill_text_input_field id = 'doi' label = t('DOI') value = whole.value.other.doi %]
+    </ol>
+</fieldset>
diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/ill/backends/Standard/inc/forms/other.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/ill/backends/Standard/inc/forms/other.inc
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/ill/backends/Standard/inc/forms/resource.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/ill/backends/Standard/inc/forms/resource.inc
new file mode 100644
index 0000000000..b24a76463c
--- /dev/null
+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/ill/backends/Standard/inc/forms/resource.inc
@@ -0,0 +1,17 @@
+<fieldset id="resource-standard-fieldset" class="rows">
+    <legend>Generic resource details</legend>
+    <ol id="resource-standard-fields">
+        [% PROCESS ill_text_input_field id = 'title' label = t('Title') value = whole.value.other.title %]
+        [% PROCESS ill_text_input_field id = 'author' label = t('Author') value = whole.value.other.author %]
+        [% PROCESS ill_text_input_field id = 'editor' label = t('Editor') value = whole.value.other.editor %]
+        [% PROCESS ill_text_input_field id = 'publisher' label = t('Publisher') value = whole.value.other.publisher %]
+        [% PROCESS ill_text_input_field id = 'published_place' label = t('Place of publication') value = whole.value.other.published_place %]
+        [% PROCESS ill_text_input_field id = 'year' label = t('Year') value = whole.value.other.year %]
+        [% PROCESS ill_text_input_field id = 'part_edition' label = t('Part / Edition') value = whole.value.other.part_edition %]
+        [% PROCESS ill_text_input_field id = 'volume' label = t('Volume') value = whole.value.other.volume %]
+        [% PROCESS ill_text_input_field id = 'pages' label = t('Pages') value = whole.value.other.pages %]
+        [% PROCESS ill_text_input_field id = 'isbn' label = t('ISBN') value = whole.value.other.isbn %]
+        [% PROCESS ill_text_input_field id = 'issn' label = t('ISSN') value = whole.value.other.issn %]
+        [% PROCESS ill_text_input_field id = 'doi' label = t('DOI') value = whole.value.other.doi %]
+    </ol>
+</fieldset>
diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/ill/backends/Standard/inc/forms/thesis.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/ill/backends/Standard/inc/forms/thesis.inc
new file mode 100644
index 0000000000..af99af03de
--- /dev/null
+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/ill/backends/Standard/inc/forms/thesis.inc
@@ -0,0 +1,10 @@
+<fieldset id="thesis-standard-fieldset" class="rows">
+    <legend>Thesis details</legend>
+    <ol id="thesis-standard-fields">
+        [% PROCESS ill_text_input_field id = 'title' label = t('Title') value = whole.value.other.title %]
+        [% PROCESS ill_text_input_field id = 'author' label = t('Author') value = whole.value.other.author %]
+        [% PROCESS ill_text_input_field id = 'institution' label = t('Institution') value = whole.value.other.institution %]
+        [% PROCESS ill_text_input_field id = 'published_date' label = t('Publication date') value = whole.value.other.published_date %]
+        [% PROCESS ill_text_input_field id = 'doi' label = t('DOI') value = whole.value.other.doi %]
+    </ol>
+</fieldset>
diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/ill/backends/Standard/inc/shared.js b/koha-tmpl/opac-tmpl/bootstrap/en/includes/ill/backends/Standard/inc/shared.js
new file mode 100644
index 0000000000..c65fcdab40
--- /dev/null
+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/ill/backends/Standard/inc/shared.js
@@ -0,0 +1,44 @@
+var core = [ [% whole.core %] ];
+var opac = [% opac || 0 %];
+document.addEventListener('DOMContentLoaded', function() {
+    $('#add-new-fields').click(function(e) {
+        e.preventDefault();
+        var row = '<li class="form-horizontal">' +
+            '<input type="text" class="custom-name ' +
+            ( opac ? 'form-control input-fluid custom-field-input' : '') +
+            '" name="custom_key" placeholder="'+__('key')+'">' +
+            ' ' +
+            '<input type="text" id="custom-value" name="custom_value" class="' +
+            ( opac ? 'form-control input-fluid custom-field-input' : '') +'" placeholder="'+__('value')+'"> ' +
+            '<button type="button" class="btn btn-danger btn-sm ' +
+            'delete-new-field">' +
+            '<span class="fa fa-trash-can"></span> ' +
+            __('Delete') +
+            '</button></li>';
+        $('#standard-fields').append(row);
+    });
+    $('#standard-fields').on('click', '.delete-new-field',
+        function(event) {
+            event.preventDefault();
+            $(event.target).parent().remove();
+        }
+    );
+    $('#type').change(function() {
+        $('#create_form').prepend(
+            '<input type="hidden" name="change_type" value="1" />'
+        );
+        $('#create_form').submit();
+    });
+    $('#standard-fields').on('keyup', '.custom-name', function() {
+        var val = $(this).val();
+        if (core.indexOf(val.toLowerCase()) > -1) {
+            $('#custom-warning').text(__("The name '%s' is not permitted").format(val)).show();
+            $('#ill-submit').attr('disabled', true);
+            $('#add-new-fields').attr('disabled', true);
+        } else {
+            $('#custom-warning').hide();
+            $('#ill-submit').attr('disabled', false);
+            $('#add-new-fields').attr('disabled', false);
+        }
+    });
+});
-- 
2.39.5