Demo Discussion
Forum Config Examples Contributions Vulnerabilities
  Discussion forum about ELOG  Not logged in ELOG logo
icon5.gif   Triggering $shell question, posted by Steve Jones on Wed Apr 5 20:25:42 2006 
    icon2.gif   Re: Triggering Re: Triggering $shell question, posted by Steve Jones on Wed Apr 5 22:48:49 2006 
Message ID: 1797     Entry time: Wed Apr 5 22:48:49 2006     In reply to: 1796
Icon: Reply  Author: Steve Jones  Author Email: steve.jones@freescale.com 
Category: Question  OS: All  ELOG Version: 2.6.1-1684 
Subject: Re: Triggering Re: Triggering $shell question 

Steve Jones wrote:
Should this work? rev1684 now allows $shell to pass attribute contents to the shell command and whenever a new entry is submitted or when one Edits/Replys the Subst is triggered, but I would like to be able to trigger this whenever a new value in the options pulldown is selected (assume Risk2 and Risk3 are identical to Risk1). Being able to trigger a regular Preset works fine (like {1} preset Date = $date ) but I would like to trigger the Subst. Maybe a better question, what actions (Subst, Preset, Change, Execute, etc.) I've tried Subst and Preset but not much luck.

##################################################
# Define Risk1
#
Options Risk1 = 10{30}, 20{31}, 30{32}, 40{33}, 50{34}, 60{35}, 70{36}, 80{37}, 90{38}, 100{39} 
{30,31,32,33,34,35,36,37,38,39} Subst TotalRisk = $shell(gawk 'BEGIN{ print $Risk1 + $Risk2 + $Risk3 }' )



Hmm, maybe I can answer my own question - until the form is saved with the new value selected the old values still exist. I guess what I really need is to trigger the $shell anytime a save happens or logentry is pulled in for edit. I think I do the latter with Subst on edit/Subst on Reply, but how on any save?

. . . Except that when I change an options field that has a dependencies, doesn't the javascript force a server-side revalidation?
ELOG V3.1.5-3fb85fa6