ID |
Date |
Icon |
Author |
Author Email |
Category |
OS |
ELOG Version |
Subject |
1794
|
Wed Apr 5 13:50:14 2006 |
| Steve Jones | steve.jones@freescale.com | Request | | 2.6.1 | Re: Simple math within an elog form |
Stefan Ritt wrote: |
Steve Jones wrote: |
Subst TotalRisk = $shell(echo $Risk1 + $Risk2 + $Risk3 > /tmp/elog_out)
What comes out with my simple echo or gawk line is "+ + " so it looks like the attributes are not getting passed into the $shell code? |
The reason is that the substitutions get evaluated from left to right, so first the shell is called with $Risk1, and because the shell by itself does a subsitution and $Risk1 is not defined on the unix system, the shell returns an empty string, leading to "+ +" as the result.
I changed that in the current SVN version, so we have first the attribute substitions, then then shell substitution. The "echo $Risk1..." will of course not work, since it gets substituted by elog as "echo 12 + 23 + 45" (or whatever the numbers are), and the "echo" will just return these numbers without adding them. To make the shell to add things, you would need to define the risks as environment variables for the shell, so I guess the "gawk" method will work better for you. I tried it and it worked fine for me. |
Sorry, I waSn't clear about just why I was using "echo". Since elog removes the /tmp/elog_shell temporary file I couldn't "see" what was actually being passed to the shell - gawk was giving me an error and I was flying blind. So I used echo to create my own temporary file.
Yes, gawk should now work -- I'l download and compile the latest and provide feedback.
Thanks! |
1795
|
Wed Apr 5 18:56:48 2006 |
| Steve Jones | steve.jones@freescale.com | Request | | 2.6.1 | Re: Simple math within an elog form |
Steve Jones wrote: |
Stefan Ritt wrote: |
Steve Jones wrote: |
Subst TotalRisk = $shell(echo $Risk1 + $Risk2 + $Risk3 > /tmp/elog_out)
What comes out with my simple echo or gawk line is "+ + " so it looks like the attributes are not getting passed into the $shell code? |
The reason is that the substitutions get evaluated from left to right, so first the shell is called with $Risk1, and because the shell by itself does a subsitution and $Risk1 is not defined on the unix system, the shell returns an empty string, leading to "+ +" as the result.
I changed that in the current SVN version, so we have first the attribute substitions, then then shell substitution. The "echo $Risk1..." will of course not work, since it gets substituted by elog as "echo 12 + 23 + 45" (or whatever the numbers are), and the "echo" will just return these numbers without adding them. To make the shell to add things, you would need to define the risks as environment variables for the shell, so I guess the "gawk" method will work better for you. I tried it and it worked fine for me. |
Sorry, I waSn't clear about just why I was using "echo". Since elog removes the /tmp/elog_shell temporary file I couldn't "see" what was actually being passed to the shell - gawk was giving me an error and I was flying blind. So I used echo to create my own temporary file.
Yes, gawk should now work -- I'l download and compile the latest and provide feedback.
Thanks! |
Ok, confirming that this now works. Passing the command:
Subst <attribute> = $shell(gawk 'BEGIN{ print $Attrib1 + $Attrib2 + $Attrib3 }' )
will cause the result to be pushed into <attribute>, so gawk in essence becomes a simple calculator and operates on the formula "$Attrib1 + $Attrib2 + $Attrib3". |
1895
|
Mon Aug 14 11:45:32 2006 |
| Silvia Borghi | silvia.borghi@cern.ch | Question | | | Author in duplicate message | When I ask to duplicate a message, the author of the duplicated message is the one of the original message.
How can I put as author the name of the person that is login?
I tried to use the command Preset on Duplicate Author or Subst on Duplicate Author, but it does not work.
Here is my config:
Preset Author = $long_name
Preset on Duplicate Author = $long_name
Preset on Reply Author = $long_name
Subst on Duplicate Author = $long_name
Locked Attributes = Author |
1900
|
Tue Aug 15 13:10:30 2006 |
| Stefan Ritt | stefan.ritt@psi.ch | Question | | | Re: Author in duplicate message |
Silvia Borghi wrote: | Preset on Duplicate Author = $long_name |
This was not implemented so far, but is a good idea. So I put it into SVN revision 1713. You either get the SVN update or wait for the next release of ELOG. |
1960
|
Fri Sep 29 18:35:09 2006 |
| marta flood | marta33911@aol.com | Question | | | Entering information | I am not sure how to get to the page I need to log my clinical time for school and I have no idea how I got here
Thanks,
Marta |
67
|
Thu Jul 11 10:36:09 2002 |
| Stefan Ritt | stefan.ritt@psi.ch | Bug fix | | | Re: a bug and a question | > If you have only one entry in the logbook and have it set up in threaded
> mode like: ?cmd=Search&mode=threaded&reverse=1, when you click on the icon
> of the entry or the number of the entry to see it, it does not allow you
> to. If there is more than one entry, it works fine.
Ok, has been fixed. Will come in 2.0.5
> Also I wanted to make a submit page from where you could either go back
> to the logbook which you just entered a message for or type a new entry for
> that logbook. First of all, is there a way to have only one file called
> submitpage.html in which I can define this for all logbooks or do i need it
> for ever logbook. And also, is there a way I can even set a link that will
> allow to create a new entry. I tried:
> <a href="demo/?cmd=new">Enter</a> another message<p>
>
> but for some reason it does not work. Is there a way to implement this?
The documentation was wrong about that which has been corrected. The proper
file contents should be
<h1>You successfully submitted a message</h1>
<a href="?cmd=Back">Back</a> to the logbook<p>
<a href="?cmd=New">Enter</a> another message
This way one only needs one file for all logbooks. |
67
|
Thu Jul 11 10:36:09 2002 |
| Stefan Ritt | stefan.ritt@psi.ch | Bug fix | | | Re: a bug and a question | > If you have only one entry in the logbook and have it set up in threaded
> mode like: ?cmd=Search&mode=threaded&reverse=1, when you click on the icon
> of the entry or the number of the entry to see it, it does not allow you
> to. If there is more than one entry, it works fine.
Ok, has been fixed. Will come in 2.0.5
> Also I wanted to make a submit page from where you could either go back
> to the logbook which you just entered a message for or type a new entry for
> that logbook. First of all, is there a way to have only one file called
> submitpage.html in which I can define this for all logbooks or do i need it
> for ever logbook. And also, is there a way I can even set a link that will
> allow to create a new entry. I tried:
> <a href="demo/?cmd=new">Enter</a> another message<p>
>
> but for some reason it does not work. Is there a way to implement this?
The documentation was wrong about that which has been corrected. The proper
file contents should be
<h1>You successfully submitted a message</h1>
<a href="?cmd=Back">Back</a> to the logbook<p>
<a href="?cmd=New">Enter</a> another message
This way one only needs one file for all logbooks. |
67
|
Thu Jul 11 10:36:09 2002 |
| Stefan Ritt | stefan.ritt@psi.ch | Bug fix | | | Re: a bug and a question | > If you have only one entry in the logbook and have it set up in threaded
> mode like: ?cmd=Search&mode=threaded&reverse=1, when you click on the icon
> of the entry or the number of the entry to see it, it does not allow you
> to. If there is more than one entry, it works fine.
Ok, has been fixed. Will come in 2.0.5
> Also I wanted to make a submit page from where you could either go back
> to the logbook which you just entered a message for or type a new entry for
> that logbook. First of all, is there a way to have only one file called
> submitpage.html in which I can define this for all logbooks or do i need it
> for ever logbook. And also, is there a way I can even set a link that will
> allow to create a new entry. I tried:
> <a href="demo/?cmd=new">Enter</a> another message<p>
>
> but for some reason it does not work. Is there a way to implement this?
The documentation was wrong about that which has been corrected. The proper
file contents should be
<h1>You successfully submitted a message</h1>
<a href="?cmd=Back">Back</a> to the logbook<p>
<a href="?cmd=New">Enter</a> another message
This way one only needs one file for all logbooks. |
|