<div dir="ltr">Hi Alex,<div>maybe we are focusing on the wrong point.</div><div><br></div><div>The problem can be reduced to this:</div><div>How can I pass data from a full customized html form to a perl script to handle them in some way (store into DB, print on web etc etc) everything inside the RT environment.</div><div><br></div><div>It is simple to do it in a classic apache environment, but inside the RT it doesn't work properly.</div><div><br></div><div>To be more specific:</div><div>This is part of the code inside the form called NewsForm.html:</div><div><br></div><div><div><div id="container"></div><div> <div class="titlebox-title"></div><div>   <span class="left"> Add News </span></div><div> </div></div><div><br></div><div><form id="newsform" method="post" action="FillDB"></div><div>  Name : <input type="text" name="name"><br></div><div>  Expiration Date : <input type="text" name="expdate"><br></div><div>  Weight: <input type="text" name="weight"><br></div><div>  Subject: <input type="text" name="subject"><br></div><div>  Text: <input type="text" name="text"><br></div><div><input type="submit" value="Submit"></div><div><br></div><div></form></div></div><div><br></div><div><br></div><div>and this is the FillDB in the same directory.</div><div><br></div><div><div><%INIT></div><div><br></div><div>use strict;</div><div>use warnings;</div><div>use DBI;</div><div>use CGI;</div><div>use CGI::Carp;</div><div><br></div><div>my $info = CGI->new();</div><div>my $name = $info->param('name');</div><div>print "Hello $name";</div><div></%INIT></div></div><div><br></div><div>Very simple as you can see.</div><div>It works ONLY after I restarted and cleaned the RT cache and ONLY IF I don't refresh the NewsForm.html.</div><div>In all the other case the form seems to do not be able to pass the variable values</div><div><br></div><div>Thank you</div><div>Cheers.</div><div><br></div><div>    Luca M.</div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2014-09-16 2:56 GMT+02:00 Alex Peters <span dir="ltr"><<a href="mailto:alex@peters.net" target="_blank">alex@peters.net</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p dir="ltr">I am finding it difficult to fully understand your problem so far.</p>
<p dir="ltr">You want custom information shown on the login page.  You are currently using jQuery and a custom Perl script.  Have you considered making a local copy of the LoginHelp template and modifying that instead?  Is the custom information on the login page dynamic or static?</p>
<p dir="ltr">You want the custom form to only be visible after a user logs into RT, presumably for authentication purposes.  Is this correct?</p>
<p dir="ltr">You mention an SQLite database.  Is this RT's database or a separate one?  If separate, exactly what information does it hold, and is the custom form meant to be writing to both databases?</p>
<div class="gmail_quote"><div><div class="h5">On 16/09/2014 6:50 am, "Luca Mazzaferro" <<a href="mailto:luca.mazzaferro@gmail.com" target="_blank">luca.mazzaferro@gmail.com</a>> wrote:<br type="attribution"></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>Hi Albert, </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>
> Now I need to populate the sqlite database and it should be simple with perl<br>
> but something is not working properly: I'm not able to pass the variables<br>
> values from the form to the perl script. It seems the RT overwrites them with<br>
> null values.<br>
> Can I do it in another way?<br>
<br>
</span>Here I don't understand...what sqlite database ? I can understand you want<br>
to retrieve data from a sqlite database to show some information but why<br>
you want to populate the sqlite database ? </blockquote><div><br></div><div>The sqlite database should be filled with the information provided by the admin and I would that this operation is performed inside the RT web interface, after the login.</div><div>For this purpose I already modified the menu and created a classical form page with "post" method.</div><div>The form is sent to as simple as possible perl script which in this moment only prints the values on the web (in future it should fill the database). </div><div>The problem happens when I submit the form: it works ONLY and ONLY if I restart the RT, clean the RT cache AND I don't refresh the form page. In all the other case it seems it is not able to pass the values of the form. It doesn't answer with error it simple doesn't pass the values.</div><div>It is a very strange behaviour and it is not related with any kind of database.</div><div>Is it possible that RT overwrites the values for some reason?</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span><br>
> CustomField could be useful also for this task?<br>
<br>
</span>I'm not sure my answer is any help for you. The CustomField allow you to<br>
create some...custom field use by ticket. For example if you allow you user<br>
to create ticket through the SeflService you maybe want then to tell you if<br>
the ticket is urgent or not. For that kind of information you can use<br>
Custom Field.<br></blockquote><div> </div><div>Unfortunately I don't think this is useful in my case.</div><div>Thank you again.</div><div>Regards.</div><div><br></div><div>     Luca M.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Don't forget RT have a REST API so you can use that to do some interaction<br>
between you script and RT.<br>
<span><br>
Regards.<br>
<br>
JAS<br>
<br>
--<br>
Albert SHIH<br>
DIO bâtiment 15<br>
Observatoire de Paris<br>
5 Place Jules Janssen<br>
92195 Meudon Cedex<br>
France<br>
Téléphone : <a href="tel:%2B33%201%2045%2007%2076%2026" value="+33145077626" target="_blank">+33 1 45 07 76 26</a>/<a href="tel:%2B33%206%2086%2069%2095%2071" value="+33686699571" target="_blank">+33 6 86 69 95 71</a><br>
xmpp: <a href="mailto:jas@obspm.fr" target="_blank">jas@obspm.fr</a><br>
Heure local/Local time:<br>
</span>lun 15 sep 2014 22:15:41 CEST<br>
</blockquote></div><br></div></div>
<br></div></div><span class="HOEnZb"><font color="#888888">--<br>
RT Training - Boston, September 9-10<br>
<a href="http://bestpractical.com/training" target="_blank">http://bestpractical.com/training</a><br></font></span></blockquote></div>
</blockquote></div><br></div>