EPrints Technical Mailing List Archive

Message: #06441


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

Re: [EP-tech] Autofill date field button


Hi Matt,
Lizz's suggestion is the best (and the PR moves EPrints another step forwards (albeit one that it had taken a few years ago - but has subsequently forgotten about...)).

If it will *always* be the current date, I'd be tempted to do something a little bit hacky - like creating:
EPrints::Plugin::InputForm::Component::XHTML::PopulateDateButton
- which would render some JavaScript that would find the previous input component (or a named field input) and populate it - using a date rendered from the server (rather than trust someone's computer is set to the right date).

Cheers,
John

-----Original Message-----
From: eprints-tech-bounces@ecs.soton.ac.uk [mailto:eprints-tech-bounces@ecs.soton.ac.uk] On Behalf Of Matthew Brady
Sent: 13 April 2017 11:27
To: eprints-tech@ecs.soton.ac.uk
Subject: Re: [EP-tech] Autofill date field button

Hi John and Lizz

Thanks for the feedback. .. i will see what i can try and get working over the weekend while the kids wear themselves out on sugar/chocolate binge... 

I had thought a single button would be easier to get working than a date picker... since they will always want the current date when they need to set it. ..

Cheers

Matt


________________________________________
From: eprints-tech-bounces@ecs.soton.ac.uk [eprints-tech-bounces@ecs.soton.ac.uk] on behalf of Lizz Jennings [E.Jennings@bath.ac.uk]
Sent: Thursday, 13 April 2017 7:28 PM
To: eprints-tech@ecs.soton.ac.uk
Subject: Re: [EP-tech] Autofill date field button

In fact EPrints should come with the pop up calendar feature as standard, but it got lost in the Master/3.3 changeover.  I have put in a pull request to get the updated functionality in (but it may not be in a good state (a file from another edit got muddled in there), I'm just not sure if anyone has even looked at it).  But I use this in production and it's good.

https://github.com/eprints/eprints/pull/438

Ignore Extras.pm - that was something else.  I wasn't able to change this at an archive level - I had to replace the Date.pm and Time.pm files in perl_lib to get it to work.  The JS and CSS files are fine in the Archive config though.

Lizz


--
Lizz Jennings BA MSc ACLIP MCLIP (Revalidated 2015)
Research Data Librarian (Systems)
The Library 4.10, University of Bath, Bath, BA2 7AY UK
Ext. 3570 (External 01225 383570)
E.Jennings@bath.ac.uk<mailto:E.Jennings@bath.ac.uk>
Research Data Management: http://www.bath.ac.uk/research/data


From: eprints-tech-bounces@ecs.soton.ac.uk [mailto:eprints-tech-bounces@ecs.soton.ac.uk] On Behalf Of John Salter
Sent: 13 April 2017 09:38
To: eprints-tech@ecs.soton.ac.uk
Subject: Re: [EP-tech] Autofill date field button

>(I talked them down from a calendar popup)
But why..?
The IRStats2 package (that it looks like you're already using) comes with a calendar date-picker - and even defaults to today!?

You could possibly even implement it using one phrase and one XHTML workflow field!

Does that help at all?

Cheers,
John


From: eprints-tech-bounces@ecs.soton.ac.uk<mailto:eprints-tech-bounces@ecs.soton.ac.uk> [mailto:eprints-tech-bounces@ecs.soton.ac.uk] On Behalf Of Matthew Brady
Sent: 13 April 2017 03:19
To: eprints-tech@ecs.soton.ac.uk<mailto:eprints-tech@ecs.soton.ac.uk>
Subject: [EP-tech] Autofill date field button

Hi All,

I have been asked if it is possible to add a button to a date field within the workflow... to allow the field to be auto populated with the current date. (I talked them down from a calendar popup)

I don't need the button for every date field rendered within the workflow, only this one particular instance...

Any thoughts would be appreciated before I start hacking things too badly ;)


Cheers

Matt.



_____________________________________________________________

This email (including any attached files) is confidential and is for the intended recipient(s) only. If you received this email by mistake, please, as a courtesy, tell the sender, then delete this email.



The views and opinions are the originator's and do not necessarily reflect those of the University of Southern Queensland. Although all reasonable precautions were taken to ensure that this email contained no viruses at the time it was sent we accept no liability for any losses arising from its receipt.



The University of Southern Queensland is a registered provider of education with the Australian Government.

(CRICOS Institution Code QLD 00244B / NSW 02225M, TEQSA PRV12081 )



_____________________________________________________________
This email (including any attached files) is confidential and is for the intended recipient(s) only. If you received this email by mistake, please, as a courtesy, tell the sender, then delete this email.

The views and opinions are the originator's and do not necessarily reflect those of the University of Southern Queensland. Although all reasonable precautions were taken to ensure that this email contained no viruses at the time it was sent we accept no liability for any losses arising from its receipt.

The University of Southern Queensland is a registered provider of education with the Australian Government.
(CRICOS Institution Code QLD 00244B / NSW 02225M, TEQSA PRV12081 )


*** 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/