Demo Discussion
Forum Config Examples Contributions Vulnerabilities
  Discussion forum about ELOG  Not logged in ELOG logo
icon3.gif   Prefill attributes for new post, posted by Johan Forsberg on Tue Jan 12 11:35:55 2016 
    icon3.gif   Re: Prefill attributes for new post, posted by Andreas Luedeke on Tue Jan 12 11:48:57 2016 
    icon2.gif   Re: Prefill attributes for new post, posted by Stefan Ritt on Tue Jan 12 11:50:22 2016 
       icon2.gif   Re: Prefill attributes for new post, posted by Johan Forsberg on Tue Jan 12 14:05:55 2016 
Message ID: 68214     Entry time: Tue Jan 12 11:48:57 2016     In reply to: 68213
Icon: Idea  Author: Andreas Luedeke  Author Email: andreas.luedeke@psi.ch 
Category: Request  OS: Linux  ELOG Version: V3.1.0-2411f95 
Subject: Re: Prefill attributes for new post 
Hi Johan,
yes, it is possible. And you were actually very close :-)
In order to pass preset-parameters within a URL, you just need to prefix the fieldname with a "p". In your example, you would write "...&pSubsystems=Vacuum".
Here is an example for the Linux Demo logbook:
https://midas.psi.ch/elogs/Linux+Demo/?cmd=New&pAuthor=Santa+Claus&pSubject=Christmas+Presents&pType=Problem+Fixed&pCategory=Hardware
 
This feature is even already documented: https://midas.psi.ch/elog/userguide.html#misc :-)
 
I wish you a Happy New Year!
Andreas
Johan Forsberg wrote:

Hi all,

I have a use case for ELOG where I need to be able to "prefill" some attributes in the "cmd=new" form, based on the URL.

To illustrate, imagine a link that takes the user directly to the form for creating a new post, with the "Subsystem" attribute already filled out to "Vacuum".

Is this possible already? I've tried naively using URL parameters (e.g. "&Subsystem=Vacuum") but that does not work. If it's not implemented, I think it would be a useful feature to have (and quite important for my particular use case). I could create a new post first using the "elog" tool, with the desired attributes set, but it makes more sense to defer the actual creation of the post to the user, i.e. he/she might change their mind before pressing "submit".

Thanks,

Johan Forsberg, MAX IV Laboratory, Sweden

 

ELOG V3.1.5-fe60aaf