EPrints Technical Mailing List Archive

Message: #03295


< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First

[EP-tech] Re: Checkboxes


Thanks Seb,

That certainly works to set the default, but I¹m still getting a value of
UNDEFINED in the options. Definitions are:

>From sprint_fields.pl

# ~ALLOWREQ - Adds an option to allow deposit to be marked if requests are
allowed or not. Defaults to YES. Data name is legacy.

        {
        name => 'no_request',
        type => 'set',
        options => [
                'no',
                'yes',
                ],
        input_rows => 1,
        },

>From phrase file

<!-- ~ALLOWREQ Phrases for No Request dropdown -->
<epp:phrase id="eprint_fieldname_no_request">Allow Requests</epp:phrase>
<epp:phrase id="eprint_fieldhelp_no_request">If you do not wish users to
be able to request copies of this deposit, select "No" here. Please bear
in mind any open access requirements that may be associated with this
record.</epp:phrase>
<epp:phrase id="eprint_fieldopt_no_request_yes">Yes</epp:phrase>
<epp:phrase id="eprint_fieldopt_no_request_no">No</epp:phrase>


>From eprint_fields_default.pl

$data->{no_request} = "yes²;


For background, the way we¹re handling displaying the ³Request a copy²
link is as follows:

* If there is an email set on the deposit, use that.
* If not, use the default address in the system

This drop down will allow us to do a further check to say:

* If the drop down is set to YES then don¹t display the link.



On 17/07/2014 16:32, "Sebastien Francois" <sf2@ecs.soton.ac.uk> wrote:

>Hi Andrew,
>
>I do not know the name of your field, or its type, I'll assume
>"FIELDNAME" and that it's a boolean (so it takes values: TRUE, FALSE or
>undef)
>
>$data->{FIELDNAME} = "FALSE"; # for "no"
>
>So when EPrints creates a new "eprint" object, it starts with the hash
>$data and populates it with default values. The line above adds such a
>default value. The object is then created in the DB.
>
>Seb.
>
>On 17/07/14 15:26, Andrew Beeken wrote:
>> Hi Seb,
>>
>> What syntax do I use in the default.pl file - it¹s not entirely clear
>>from
>> my end?
>>
>> Andrew
>>
>
>*** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
>*** Archive: http://www.eprints.org/tech.php/
>*** EPrints community wiki: http://wiki.eprints.org/
>*** EPrints developers Forum: http://forum.eprints.org/


The University of Lincoln, located in the heart of the city of Lincoln, has established an international reputation based on high student satisfaction, excellent graduate employment and world-class research.

The information in this e-mail and any attachments may be confidential. If you have received this email in error please notify the sender immediately and remove it from your system. Do not disclose the contents to another person or take copies.

Email is not secure and may contain viruses. The University of Lincoln makes every effort to ensure email is sent without viruses, but cannot guarantee this and recommends recipients take appropriate precautions.

The University may monitor email traffic data and content in accordance with its policies and English law. Further information can be found at: http://www.lincoln.ac.uk/legal.