EPrints Technical Mailing List Archive
Message: #07385
< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First
Re: [EP-tech] How to add form in "Request a copy"
- To: "eprints-tech@ecs.soton.ac.uk" <eprints-tech@ecs.soton.ac.uk>
- Subject: Re: [EP-tech] How to add form in "Request a copy"
- From: John Salter <J.Salter@leeds.ac.uk>
- Date: Thu, 2 Aug 2018 08:10:53 +0000
Hi Izwan, The 'requests' are dataobject - very similar to an EPrint, or a User, so you can add fields in the same way: In a config file e.g. [EPRINTS_ROOT]/archives/[ARCHIVE_ID]/cfg/cfg.d/z_request_fields.pl push @{$c->{fields}->{request}}, { name => "contact_num", type => "text", }, { name => "id_num", type => "text", }; Test the config is OK: > [EPRINTS_ROOT]/bin/epadmin test [ARCHIVE_ID] Add the phrases to e.g. [EPRINTS_ROOT]/archives/[ARCHIVE_ID]/cfg/lang/en/phrases/z_request_fields.xml: <?xml version="1.0" encoding="utf-8" standalone="no"?> <!DOCTYPE phrases SYSTEM "entities.dtd"> <epp:phrases xmlns="http://www.w3.org/1999/xhtml" xmlns:epp="http://eprints.org/ep3/phrase" xmlns:epc="http://eprints.org/ep3/control"> <epp:phrase id="request_fieldname_contact_num">Contact number</epp:phrase> <epp:phrase id="request_fieldhelp_contact_num">A number that we can contact you on to discuss your request if necessary </epp:phrase> <epp:phrase id="request_fieldname_id_num">ID number</epp:phrase> <epp:phrase id="request_fieldhelp_id_num">The identification number from your staff/student card</epp:phrase> </epp:phrases> Then run: > [EPRINTS_ROOT]/bin/epadmin update [ARCHIVE_ID] This will add the columns to the database Finally, copy the default request workflow to the repository config: > mkdir [EPRINTS_ROOT]/archives/[ARCHIVE_ID]/cfg/workflows/request > cp [EPRINTS_ROOT]/lib/workflows/request/default.xml [EPRINTS_ROOT]/archives/[ARCHIVE_ID]/cfg/workflows/request/ Test the config again: > [EPRINTS_ROOT]/bin/epadmin test [ARCHIVE_ID] Restart Apache (this command depends on which operating system you use - you may need to do something slightly different!) > sudo service httpd graceful This will get you to a point where the data can be submitted into your system. The next part you probably want to do is to include this information in the email sent to the contact_email address. To do this, you need to create a local version (subclass) of the EPrints::Plugin::Screen::Public::RequestCopy module. I'm still working out exactly what you need to do for this part. I'll write it up as a wiki page! Cheers, John From: eprints-tech-bounces@ecs.soton.ac.uk [mailto:eprints-tech-bounces@ecs.soton.ac.uk]
On Behalf Of Mohd Izwan Salim Dear Eprints Community
|
- Follow-Ups:
- Re: [EP-tech] How to add form in "Request a copy"
- From: John Salter <J.Salter@leeds.ac.uk>
- Re: [EP-tech] How to add form in "Request a copy"
- References:
- [EP-tech] How to add form in "Request a copy"
- From: Mohd Izwan Salim <mohdizwan8733@salam.uitm.edu.my>
- Re: [EP-tech] How to add form in "Request a copy"
- From: John Salter <J.Salter@leeds.ac.uk>
- [EP-tech] How to add form in "Request a copy"
- Prev by Date: [EP-tech] How to add form in "Request a copy"
- Next by Date: Re: [EP-tech] How to add form in "Request a copy"
- Previous by thread: [EP-tech] Sort view with creators_name and corp_creators
- Index(es):