Demo Discussion
Forum Config Examples Contributions Vulnerabilities
  Discussion forum about ELOG  Not logged in ELOG logo
icon5.gif   Using conditional attributes, posted by Adam Blandford on Sat Jul 18 10:38:00 2009 
    icon2.gif   Re: Using conditional attributes, posted by Stefan Ritt on Mon Jul 20 08:18:45 2009 
       icon2.gif   Re: Using conditional attributes, posted by Richard Stamper on Mon Jul 20 13:52:58 2009 
Message ID: 66448     Entry time: Mon Jul 20 08:18:45 2009     In reply to: 66444     Reply to this: 66451
Icon: Reply  Author: Stefan Ritt  Author Email: stefan.ritt@psi.ch 
Category: Question  OS: Windows  ELOG Version: 2.7.5 
Subject: Re: Using conditional attributes 

Adam Blandford wrote:

Hi

I have a logbook including the attributes: Author, Topic Date, Phase, Reference, Subject, Start Time, End Time, Duration

The Phase attribute has a number of MOptions including: Design, Manufacture, Testing, Results, Transport

I only want the attributes Start Time, End Time, and Duration to be shown if the Transport Phase is selected. I have tried using the conditional attributes

MOptions Phase = Design{1}, Manufacture{1}, Testing{1}, Results{1}, Transport{2}

and

{1} Show Attributes Edit = Author, Topic Date, Phase, Subject, Start Time, End Time, Duration
{2} Show Attributes Edit = Author, Topic Date, Phase, Subject

This works to show the attributes when the relevant Phase is selected but the Edit page shows the Phase options including the {1}/{2}. Is there are way that these conditionals are not displayed?

Also, I would like the "Duration" Atrribute to be a calculated value showing the time difference between Start Time and End Time. Is this possible?

Thanks,

Adam

The conditional attributes work only with Options, but not with MOptions as written in the documentation. I tried your set-up with Options and it worked ok. If you attribute Phase is non-exclusive, meaning it could be Manufacture and Testing at the same time, then you have to play some tricks with an additional attribute like

Attributes = Author, Topic Date, ..., Duration, Transport

 

MOptions Phase = Design, Manufacture, Testing, Results, Transport

Options Transport = Yes{2}, No{1}

{1} Show Attributes Edit = ...

{2} Show Attributes Edit = ...

An automatic calculation of Duration is unfortunately not implemented.

ELOG V3.1.5-2eba886