Implementing a Photoduplication Toggle Option on Request Forms

Print Friendly and PDF Follow

Beginning with Aeon Server v5.2.4, additional web page configuration options are available to implement a photoduplication request toggle control on Aeon request forms, such as the EAD Request form (EADRequest.html) and the Archival Request form (ArchivalRequest.html) used with the ArchivesSpace Request Fulfillment plugin. The photoduplication toggle control will be configured for and used on ArchivalRequest.html by default but can also be configured on other web forms following the instructions in this article.

Minimum Requirements

You must be on Aeon Server v5.2.4 (at minimum) and Aeon default/feature-specific web pages v5.2.4 (at minimum) to use the configuration options in this article. 

Photoduplication Toggle Overview

Beginning with Aeon Server v5.2.4, the <#PHOTOTOGGLE> tag can be added to the HTML for Aeon web request forms to configure a photoduplication request toggle option on the form. The <#PHOTOTOGGLE> tag will display toggle options allowing the patron to choose between submitting either a reading room request or a photoduplication request from the request form when the photoduplication toggle is enabled in the Aeon Customization Manager. If the photoduplication toggle is not enabled in the Aeon Customization Manager, then the <#PHOTOTOGGLE> tag will only display the scheduled date or appointment scheduling fields (based on your web page configuration):

Photoduplication Toggle

Note: This image reflects the default toggle options when appointment scheduling fields are used on the Aeon web pages.

  • When a reading room request is selected with the Schedule Retrieval/Schedule Appointment toggle option, the form will display either the scheduled date or appointment scheduling fields, based on whether you have configured the default version of the include_photodup_toggle_enabled.html file using the scheduled date fields or the feature-specific version of the include_photodup_toggle_disabled.html file using the appointment scheduling fields in your web directory
  • When a photoduplication request is selected with the Request photoduplication option, the form will display the default fields used for photoduplication requests
  • The label text used for the toggle options, the heading text used for the relevant sections of the web form, and the fields displayed on the form when either a photoduplication or reading room request is selected are all customizable, following the instructions in the Customizing Content Displayed by the <#PHOTOTOGGLE> Tag section below

Enabling the Photoduplication Toggle in the Aeon Customization Manager

The <#PHOTOTOGGLE> tag is used in conjunction with the PhotoduplicationEnabled key in the Aeon Customization Manager (located under Web Interface | System) to display content on the web form. The <#PHOTOTOGGLE> tag will be used to display different content based on whether you have enabled the photoduplication toggle using the PhotoduplicationEnabled key:

When the PhotoduplicationEnabled key in the Aeon Customization Manager is set to Yes:

  • The <#PHOTOTOGGLE> tag will be used to display the contents of the include_photoduplication_toggle_enabled.html file on any request forms on which the <#PHOTOTOGGLE> tag has been configured. This file:
    • Displays the toggle controls that will allow users to choose between submitting either a reading room request or a photoduplication request from the request form
    • Displays the contents of either include_scheduled_date.html or include_appointment_info_no_site.html by default when a reading room request is selected from the toggle options

      The specific file used is based on whether you have configured the default version of the include_photoduplication_toggle_enabled.html file using the schedule date fields or the feature-specific version of this file using the appointment scheduling fields in your web directory
    • Displays the contents of include_photoduplication_archival_request.html by default when a photoduplication request is selected from the toggle options

When the PhotoduplicationEnabled  key in the Aeon Customization Manager is set to No

  • The <#PHOTOTOGGLE> tag will be used to display the contents of the include_photoduplication_toggle_disabled.html file on any request forms on which the <#PHOTOTOGGLE> tag has been configured. This file:
    • Displays the contents of either include_scheduled_date.html or include_appointment_info_no_site.html by default

      The specific file used is based on whether you have configured the default version of the include_photoduplication_toggle_enabled.html file using the schedule date fields or the feature-specific version of this file using the appointment scheduling fields in your web directory

Implementing the <#PHOTOTOGGLE> Tag on Request Forms

The <#PHOTOTOGGLE> tag is only configured and used by default on the Archival Request form (ArchivalRequest.html). This tag can be configured and used on other request forms following the instructions below:

Note: These instructions should not be used to configure the toggle on ArchivalRequest.html. For information on configuring the Archival Request form, see The Archival Request Form.

  1. Review the Customizing Content Displayed by the <#PHOTOTOGGLE> Tag section below and make any necessary customizations to the include files that will be used with the <#PHOTOTOGGLE> tag to display content on the web form.

    Please note that modifying this content will modify the content displayed on all request forms on which the <#PHOTOTOGGLE> tag has been configured. 
    If implementing the <#PHOTOTOGGLE> tag on EADRequest.html, you will need to make additional modifications to these files before the <#PHOTOTOGGLE> tag can be implemented on the form. The required modifications will prevent the <#PHOTOTOGGLE> tag from working on other Aeon web forms. Please review the Customizing Content Displayed by the <#PHOTOTOGGLE> Tag section for details.
  2. Open the request form on which the <#PHOTOTOGGLE> tag will be configured in a text editing application such as Notepad++ or within the GitHub editor
  3. Add the following line within the <head> section of the code at the top of the file:
    <script type="text/javascript" src="js/duplicationPermissionToggle.js"></script>
    Before adding the code, ensure that duplicationPermissionToggle.js is in the js folder of the Aeon web directory. This file was first released in the Aeon 5.0.73 web default web pages. If you do not have this file, download the latest Aeon 5.2 default web pages from the Aeon Downloads page to obtain the file and add it to your web directory in the js folder.
  4. Remove the hidden input for RequestType near the top of the file, if present. This hidden input may be configured with either the value "Loan" or "Copy":

    <input type="hidden" name="RequestType" value="Loan">
  5. If you are not configuring the toggle on EADRequest.html, locate the hidden input for AeonForm near the top of the file. Replace this line of code with two separate lines of code that will set the AeonForm value differently based on which photoduplication toggle option the user selects:
    <input type="hidden" name="AeonForm" value="[ReadingRoomRequestFormName]" data-toggle-group="schedule">
    <input type="hidden" name="AeonForm" value="[PhotoduplicationRequestFormName]" data-toggle-group="duplication">

    The AeonForm value set when the request is submitted will subsequently be used to open the proper edit form for that request. Aeon will prepend "Edit" to the beginning of the AeonForm value set for the request and attempt to locate the HTML file with this name in your web directory to open the edit form for that request. A different edit form should be configured for reading room requests and photoduplication requests following the guidance below to ensure that the proper fields are displayed on the edit form based on which option the user selected when submitting their request.

    • Replace [ReadingRoomRequestFormName] in the first line of code above with the name of the request form on which the toggle is being configured. When a reading room request is submitted from the form and subsequently opened for editing by the user, Aeon will prepend "Edit" to the beginning of this value and use this form as the edit form for that request

      For example, if you are configuring the toggle on DefaultRequest.html, use the value DefaultRequest so that the line of code for the first AeonForm input is as follows:

      <input type="hidden" name="AeonForm" value="DefaultRequest" data-toggle-group="schedule">

      When this value is set to DefaultRequest, Aeon will use the EditDefaultRequest.html file as the edit form for reading room requests submitted from the form.

    • Replace [PhotoduplicationRequestFormName] in the second line of code above with the name of the form that should be used when editing photoduplication requests submitted from the request form. Follow the guidance below to determine which form name to use:

      The photoduplication edit form that should be used with each request form is as follows:

      • DefaultRequest.html: Replace [PhotoduplicationRequestFormName] with PhotoduplicationRequest. When this value is set, Aeon will use EditPhotoduplicationRequest.html as the edit form for photoduplication requests.
      • GenericRequestManuscript.html: Replace [PhotoduplicationRequestFormName] with GenericRequestManuscriptPhotodup. Aeon will use EditGenericRequestManuscriptPhotodup.html as the edit form for photoduplication requests.
      • GenericRequestMonograph.html: Replace [PhotoduplicationRequestFormName] with GenericRequestMonographPhotodup. Aeon will use EditGenericRequestMonographPhotodup.html as the edit form for photoduplication requests.
      • GenericRequestSerial.html or any other non-default, custom request form you have created: The edit form for photoduplication requests should be a custom Edit[RequestForm]Photodup.html file that you will need to create and add to your web directory manually. Replace [PhotoduplicationRequestFormName] with [RequestFormName]Photodup (e.g, for GenericRequestSerial.html, this value should be set to GenericRequestSerialPhotodup so that Aeon will use EditGenericRequestSerialPhotodup.html as the edit form for photoduplication requests). Then follow the instructions in Creating a Custom Edit[RequestForm]Photodup.html File below to create this file.
  6. If you are configuring the toggle on EADRequest.html, replace the AeonForm hidden input with the following two lines of code instead:

    <input type="hidden" ID="AeonForm" name="FormDataField" value="EADRequest" data-toggle-group="schedule">
    <input type="hidden" ID="AeonForm" name="FormDataField" value="[PhotoduplicationRequestFormName]" data-toggle-group="duplication">
    • Replace [PhotoduplicationRequestFormName] in the second line of code above with:
      • PhotoduplicationRequest if your EADRequest.html form is configured to set the DocumentType for requests to "Default." Aeon will use EditPhotoduplicationRequest.html as the edit form for photoduplication requests submitted from EADRequest.html.
      • GenericRequestManuscriptPhotodup if your EADRequest.html form is configured to set the DocumentType for requests to "Manuscript" (note: depending on your institution's specific configuration, you may use "ArchivalMaterial" or a similar value instead of "Manuscript" for manuscript requests). Aeon will use EditGenericRequestManuscriptPhotodup.html as the edit form for photoduplication requests submitted from EADRequest.html.
  7. If you would like to enable the SkipOrderEstimate functionality for photoduplication requests submitted using the request form, add the following hidden input to the file:

    <input type="hidden" name="SkipOrderEstimate" value="Yes">

    Note: The SkipOrderEstimates feature is not supported for use with photoduplication requests submitted via EAD finding aids, the Aeon external request endpoint (ERE), or the Archival Request form

  8. Near the end of the file, locate and delete the entire block of code for the Request For field (if present) and the single line of code linking to include_appointment_info.html/include_appointment_info_ead.html or include_scheduled_date.html/include_scheduled_date_ead.html, depending on whether you are using the default web pages using the schedule date field, or the appointment scheduling web pages using the appointment scheduling fields (the example code below is from EADRequest.html):

    <div class="form-group col-md-5 <#PARAM name='RequestLinksVisible' enabled='RequestForEnabled' disabled='d-none'>">
    <label for="RequestLink">
    <span class="<#ERROR name='ERRORRequestLink'>">
    Request for
    </span>
    </label>
    <select class="custom-select mr-sm-2" id="RequestLink" name="FormDataField" size="1">
    <#OPTION name="RequestLinks">
    </select>
    </div>

    <#INCLUDE filename="include_scheduled_date_ead.html">

    </section>
    Do not delete the </section> tag at the end of the block of code.
    Depending on your web page customizations, the scheduled date and appointment scheduling fields may be hardcoded directly within the web page instead of using either of the include files listed above. If you are not using appointment scheduling features, the hardcoded Request For and Scheduled Date fields should be deleted. If you are using appointment scheduling features, the hardcoded Request For, Site (if present), and all other Appointment-related fields used with the appointment scheduling web tool should be deleted.
  9. Locate the following line of code near the end of the file that inserts the buttons used to submit the form:
    <#INCLUDE filename="include_request_buttons.html">

    Delete this line of code and replace it with the code used for the <#PHOTOTOGGLE> tag:

    <#PHOTOTOGGLE>

Creating a Custom Edit[RequestForm]Photodup.html File

If you are configuring the <#PHOTOTOGGLE> tag on the default GenericRequestSerial.html file or any other custom (non-default) request form(s) you have created, you will need to create a custom Edit[RequestForm]Photodup.html file in your Aeon web directory. This form will be used as the edit form for photoduplication requests submitted from these request form(s) using the photoduplication request toggle option. To create this file:

Note: This file is only required for GenericRequestSerial.html and any custom (non-default) request forms you have created and on which you want to configure the photoduplication toggle. Other default request forms should use the specific guidance in step 5 of the Implementing the <#PHOTOTOGGLE> Tag on Request Forms section above to set the edit form for photoduplication requests using the proper default web page file.

  1. Locate and open the edit form used for the request form on which you configured the toggle in a text editing application such as Notepad++ or within the GitHub editor (e.g., open the EditGenericRequestSerial.html file if you are configuring the photoduplication toggle on GenericRequestSerial.html)
  2. Copy the contents of this file into a new, blank document and save it in your web directory as Edit[RequestForm]Photodup.html (e.g., EditGenericRequestSerialPhotodup.html)
  3. Locate the hidden input for AeonForm and change the value to append "Photodup" to the name of the form. For example, change "EditGenericRequestSerial" to "EditGenericRequestSerialPhotodup":

    <input type="hidden" name="AeonForm" value="EditGenericRequestSerialPhotodup">
  4. Locate the hidden input for RequestType and change the value from "Loan" to "Copy":

    <input type="hidden" name="RequestType" value="Copy">
  5. Locate the following line of code for the include_photoduplication.html file:

    <#INCLUDE type="photoduplication" filename="include_photoduplication.html">

    Change this to reference the include file used in your include_photodup_toggle_enabled.html file to display the photoduplication fields when a photoduplication request is selected. For example, if you are using the include_photoduplication_archival_request.html file to display these fields, change this line to:

    <#INCLUDE type="photoduplication" filename="include_photoduplication_archival_request.html">
  6. Locate and delete the entire block of code for the Request For field (if present) and the single line of code linking to include_appointment_info.html or include_scheduled_date.html depending on whether you are using the default web pages using the schedule date field, or the appointment scheduling web pages using the appointment scheduling fields

    See step 8 in the Implementing the <#PHOTOTOGGLE> Tag on Request Forms section above for additional guidance on locating and removing this code, if needed.
  7. Locate the following line of code for the request buttons near the end of the file:

    <#INCLUDE filename="include_request_buttons.html">

    Change this to:

    <#INCLUDE filename="include_request_buttons_photoduplication.html">
  8. Insert the following two lines of code directly above the closing body tag (</body>) near the end of the file:

    <script type="text/javascript" src="js/billingContextOptionHandler.js"></script>
    <script type="text/javascript" src="js/billingAccountsOptionHandler.js"></script>
  9. Save the file.
  10. Test the file to ensure it has been configured correctly by using its corresponding request form to submit a photoduplication request using the photoduplication toggle and then subsequently editing that request. 

Customizing Content Displayed by the <#PHOTOTOGGLE> Tag

Warning! Modifying these files will modify this content for every web form on which the <#PHOTOTOGGLE> tag has been configured.

The text and content displayed by the <#PHOTOTOGGLE> tag when the photoduplication toggle is enabled in the Aeon Customization Manager can be modified by editing the include_photoduplication_toggle_enabled.html file according to the instructions below. The text and content displayed by the <#PHOTOTOGGLE> tag when the photoduplication toggle is disabled in the Aeon Customization Manager can be modified by editing the include_photoduplication_toggle_disabled.html file. 

Customizing Content Displayed When the Photoduplication Toggle is Enabled | Customizing Content Displayed When the Photoduplication Toggle is Disabled


Customizing Content Displayed When the Photoduplication Toggle is Enabled 

The text and content displayed by the <#PHOTOTOGGLE> tag when the photoduplication toggle is enabled in the Aeon Customization Manager can be modified by editing the include_photoduplication_toggle_enabled.html file according to the instructions below.

Customizing Section Headers and Label Text for Toggle Options | Customizing Content Displayed by Each Request Type Toggle Option

Customizing Section Headers and Label Text for Toggle Options

The include_photoduplication_toggle_enabled.html file includes the label text used for the request type toggle options as well as the text used for the sections headers that will be toggled on and off based on the patron's selected request type. This file can be directly modified to contain new/additional text if preferred by your institution at the following lines:

  • The "Request type" text used for the toggle section header (default line 1)
  • The "Schedule Retrieval"/"Schedule Appointment" text used to label the reading room request toggle option (default line 7)
  • The "Request photoduplication" text used to label the photoduplication request toggle option (default line 12)
  • The "Schedule Retrieval"/"Schedule Appointment" text used for the reading room request section header (default line 18)
  • The "Order Information" text used for the reading room request section header (default line 25 Appointment Scheduling / default line 37 Scheduled Date)

Customizing Content Displayed by Each Request Type Toggle Option

The include_photoduplication_toggle_enabled.html file also contains the link to the include file used to display the scheduled date/appointment scheduling fields when a reading room request is selected and the link to the include file used to display the photoduplication fields when a photoduplication request is selected. The include_photoduplication_toggle_enabled.html file can be modified to point to different include files for these fields, if necessary.

Modifying Content Displayed for Reading Room Requests | Modifying Content Displayed for Photoduplication Requests

Modifying Content Displayed for Reading Room Requests

To modify the include file used to display the scheduled date or appointment scheduling fields for reading room requests, edit the include_photoduplication_toggle_enabled.html file as shown below:

Scheduled Date:

Change this (default line 33):

<#INCLUDE filename="include_scheduled_date.html">

Appointment Scheduling:

Change this (default line 21):

<#INCLUDE filename="include_appointment_info_no_site.html">
 

 

To this:

<#INCLUDE filename="<insert new filename here>">

 

To this:

<#INCLUDE filename="<insert new filename here>">

Required modifications for EADRequest.html

If implementing the <#PHOTOTOGGLE> tag on EADRequest.html, the code above pointing to the include file used with the scheduled date or the appointment scheduling fields should be modified to point to include_scheduled_date_ead.html or include_appointment_info_ead.html.

Modifying Content Displayed for Photoduplication Requests

To modify the include file used to display the photoduplication fields, edit the include_photoduplication_toggle_enabled.html file as shown below:

Photoduplication Fields:

Change this (default line 41 or default line 29):

<#INCLUDE filename="include_photoduplication_archival_request.html">
 

To this:

<#INCLUDE filename="<insert new filename here>">

Required modifications for EADRequest.html

If implementing the <#PHOTOTOGGLE> tag on EADRequest.html, the photoduplication fields used in the photoduplication include file will need to be modified. For more information, please see Required Customizations for Photoduplication Fields Used on EADRequest.html.

Customizing Photoduplication Fields Displayed by the Photoduplication Include File

By default, the photoduplication toggle will display the contents of include_photoduplication_archival_request.html when a photoduplication request is selected. This file contains the following fields by default:

  • Billing Account
  • Request for *Do not delete this field from the file*
  • Inclusive Pages
  • Page Count
  • Format
  • Shipping
  • Service Level
  • For Publication?

This include file can be edited to remove any of the default photoduplication fields (except for the Request For field, which is required) that you do not want to use on the request form.

You can also modify the photoduplication fields displayed when a photoduplication request is selected by creating a new include file with the photoduplication fields you would like to display, and then changing the code within include_photoduplication_toggle_enabled.html to point to the new include file following the instructions in the section above.
Required Customizations for Photoduplication Fields Used on EADRequest.html

If implementing the <#PHOTOTOGGLE> tag on EADRequest.html, the include file used to point to the photoduplication fields will need to undergo additional modifications to modify the name attribute used for each field to FormDataField. Each photoduplication field in the include file should be modified with the new name attribute following the example for the Billing Account field below:

Change this:

<div class="form-group col-md-4 
<#PARAM name='BillingAccountsVisible'
disabled='d-none'>">
<label for="BillingAccountId">
<span class="<#ERROR name='ERRORBillingAccountId'>">
Billing Account
</span>
</label>
<select class="custom-select mr-sm-2"
id="BillingAccountId" name="BillingAccountId">
<#OPTION name="BillingAccounts">
</select>
</div>
 

To this:

<div class="form-group col-md-4 
<#PARAM name='BillingAccountsVisible'
disabled='d-none'>">
<label for="BillingAccountId">
<span class="<#ERROR name='ERRORBillingAccountId'>">
Billing Account
</span>
</label>
<select class="custom-select mr-sm-2"
id="BillingAccountId" name="FormDataField">
<#OPTION name="BillingAccounts">
</select>
</div>

Customizing Content Displayed When the Photoduplication Toggle is Disabled

Customizing Section Header Text 

The include_photoduplication_toggle_disabled.html file includes the text used for the section header that will be displayed when the photoduplication toggle functionality is disabled by setting the PhotoduplicationEnabled customization key in the Aeon Customization Manager to No. This file can be directly modified to contain new/additional text if preferred by your institution at the following lines:

  • The "Schedule Retrieval"/"Schedule Appointment" text used for the reading room request section header (default line 1)

Customizing Fields Displayed When the Toggle is Disabled

The include_photoduplication_toggle_disabled.html file also contains the link to the include file used to display the scheduled date/appointment scheduling fields when the photoduplication toggle has been disabled. This include file may be modified to point to a different include file, if needed:

Scheduled Date:

Change this (default line 16):

<#INCLUDE filename="include_scheduled_date.html">

Appointment Scheduling:

Change this (default line 4):

<#INCLUDE filename="include_appointment_info_no_site.html">
 

 

To this:

<#INCLUDE filename="<insert new filename here>">

 

To this:

<#INCLUDE filename="<insert new filename here>">

Required modifications for EADRequest.html

If implementing the <#PHOTOTOGGLE> tag on EADRequest.html, the code above pointing to the scheduled date or the appointment scheduling fields should be modified to instead point to include_scheduled_date_ead.html or include_appointment_info_ead.html.

Enforcing Field Validation for Fields Displayed by the <#PHOTOTOGGLE> Tag

The WebValidation table in the Aeon Customization Manager can be used to enforce server-side validation for any fields controlled by the photoduplication toggle on web forms (e.g., you can use the WebValidation table to make a field displayed by the toggle required for submitting the form). Several modifications to the include_photodup_toggle_enabled.html file and additions to the WebValidation table in the Aeon Customization Manager are necessary to implement validation for these fields:

  1. In the Aeon Customization Manager's WebValidation table, configure entries for the toggle fields for which you want to enforce validation. Ensure that these entries use a unique value for the Rule Set value (i.e., a Rule Set value not used by any other WebValidation entries). 

    One Rule Set value should be set for the fields displayed by the toggle when a reading room request is selected and a separate Rule Set value should be set for fields displayed by the toggle when a photoduplication request is selected. For example, you might use the Rule Set name PhotoduplicationToggle for fields that are displayed by the toggle when a photoduplication request is selected, and then use the Rule Set name ReadingRoomToggle for fields that are displayed when a reading room request is selected.
    See Field Validation and Required Fields for more general information on configuring entries in the WebValidation table.
  2. Edit the include_photodup_toggle_enabled.html file and add the following line for the FormValidationOverride hidden input under the:
    • <input type="hidden" name="RequestType" value="Loan"> line, if setting up field validation for fields displayed when a reading room request is selected in the toggle.
    • <input type="hidden" name="RequestType" id="RequestType" value="Copy"> line, if setting up field validation for fields displayed when a photoduplication request is selected in the toggle.
    <input type="hidden" name="FormValidationOverride" value="ValidationRuleSetName">
  3. Change ValidationRuleSetName in the line of code provided above to the Rule Set value you configured in step 1 for the:
    • WebValidation table entries configured for the fields displayed by the toggle when a reading room request is selected, if setting up field validation for these fields.
    • WebValidation table entries configured for the fields displayed by the toggle when a photoduplication request is selected, if setting up field validation for these fields.
  4. If the photoduplication toggle is being used on EADRequest.html and you are configuring validation for fields displayed by the toggle when a photoduplication request is selected, move the following lines of code from EADRequest.html (if present) to include_photodup_toggle_enabled.html directly under the FormValidationOverride hidden input you added in steps 2-3 for the photoduplication toggle fields:

    <input type="hidden" ID="WebRequestForm" name="FormDataField" class="request-duplication" value="PhotoduplicationRequest">
    <input type="hidden" ID="UserReview" name="FormDataField" value="No">
    <input type="hidden" ID="RequestType" class="request-duplication" name="FormDataField" value="Copy">
    <input type="hidden" ID="SkipOrderEstimate" name="FormDataField" value="Yes">
  5. The validation configured for the toggle fields in the WebValidation table will now be applied when users submit requests via the request form containing the photoduplication toggle.

Note: You do not need to configure any entries in the Aeon Customization Manager's WebFormValidationLinks table when configuring validation for the toggle fields. Any existing entries in the WebFormValidationLinks table for the relevant request form that specify a rule set previously configured in the WebValidation table to enforce validation for the fields now controlled by the toggle should be removed, if present, as the WebFormValidationLinks table will use that rule set to apply blanket validation for those fields on the form and will not selectively apply validation for those fields based on the photoduplication toggle option selected by the user.

Questions?

If this article didn’t resolve your issue, please contact Atlas Support for assistance:

Contact Support