vellocet
Newbie
Karma: 0
Posts: 5
|
 |
« on: October 22, 2010, 09:08:44 AM » |
|
First of all let me say I have enjoyed this software for a couple of years now, with the few mods I have made(thanks to you and ALex) it has suited us well. What I would like to do, I believe I am almost there, but after 3 days cannot push it through. When our staff has to work weekends, sometimes they wait to fill out an incident report (we use the software for incident reporting as well), they wait until they get to the office. When they do this, the report is dated the day they open it. I was thinking it would be nice to have a searchable field that pre-populated the current date( the "IncidentDate" field). This way I can search by the date the thing actually happened? Why make it autofill, well, if it autofills, and you dont touch it, then it will just be today, and no worries. But if I want to change it,and make it last week, I can, and it will still be searchable. I know you can tell me how to do the above. What concerns me is that the form autodates by default...I am hoping it wont trip over it self when I do this.
Thank you in advance for all your help.
|
|
|
|
« Last Edit: October 22, 2010, 11:04:01 AM by Sparky »
|
Logged
|
|
|
|
Sparky
Moderator
Hero Member
   
Karma: 83
Posts: 2,228
stop pushing all those buttons
|
 |
« Reply #1 on: October 22, 2010, 11:09:55 AM » |
|
You would pull the date from the server within the Perl and then push it out into the HTML New Ticket form using a new macro. You'd also have to remove the macro that populates this form with the custom fields and re-write it by hand so that you have access to insert into the field. The Ticket Merge mod has some code that pulls the current date from the server and there is quite a bit of discussion about creating new macros from scratch. There is a sticky thread about replacing fields with default values... the second section is relevant to you. Post back if you get stuck. (PS... read the sticky threads... all of them, including the "READ ME FIRST"  )
|
|
|
|
|
Logged
|
Did you update the paths in ttxcfg.cgi after moving TTX to your new location? To those seeking help.... please report back when you figure it out. 
|
|
|
vellocet
Newbie
Karma: 0
Posts: 5
|
 |
« Reply #2 on: October 22, 2010, 12:25:48 PM » |
|
I read the thread(s) you mentioned, and understand I need to replace an are of the code in the "newticket" html are..I am confused..I can see the area where I need(I think) to plug in the script that will populate the date filed, but only when I view source...when I pull it up in an HTML editor to actuall to do the deed, I cannot see the area. I will give you an example. Below is a clip of the area in question.
<tr><td align=right class=lbl>Incident Date<font color=red><sup>*</sup></font></td> <td align=left><input type=text size=20 name="xIncident Date" value=""></td></tr>
<tr><td align=right class=lbl>Assign to<font color=red><sup>*</sup></font></td>
<td align=left><select name=oper> <option value="">-- please select --</option> <option value="-">-- any operator --</option> <option value="webmaster">test account</option> *********************************************************** Below is what I see when I try and edit the same field: <td align="left"><input size="25" name="email" value="(%INPUT_email%)" ></td> </tr> (%CUSTOMVARS%) (%ITEMSELSTD%) (%OPERSELSTD%) (%GROUPSELSTD%) <tr> <td align="right" class="lbl">[%Subject%]<font color="red"><sup>*</sup></font></td> ********************************** The code that i see in "view source" is different from the "newticket" html I am thinking I have to edit the %CUSTOMVARS%, but the examples I have seen, I just don't get where to put the new snippet..I think its in the ttxconfig file..?
|
|
|
|
|
Logged
|
|
|
|
Sparky
Moderator
Hero Member
   
Karma: 83
Posts: 2,228
stop pushing all those buttons
|
 |
« Reply #3 on: October 22, 2010, 12:48:52 PM » |
|
The code on the template is not supposed to match the source code in the browser, that's the whole point of having a template and not a static page!  The Perl takes the template and "assembles" the final page dynamically as it loads into the browser. The Perl uses the macro to insert dynamic data, HTML, etc. from the program and/or database. (The second post in the READ ME thread explains the functions of templates & macros.)Don't take this the wrong way but I think you're in way over your head here.... or you're not really reading where I'm pointing. The sticky I referenced answers your question. The second post is all about how to duplicate the functionality of the %CUSTOMVARS% macro when you need to make a change to one aspect.
|
|
|
|
« Last Edit: October 22, 2010, 01:08:23 PM by Sparky »
|
Logged
|
Did you update the paths in ttxcfg.cgi after moving TTX to your new location? To those seeking help.... please report back when you figure it out. 
|
|
|
vellocet
Newbie
Karma: 0
Posts: 5
|
 |
« Reply #4 on: October 22, 2010, 01:42:13 PM » |
|
ahhh..found it. Thanks for the patience. It has been a while..(9 months) since I have made any modifications to this program, and it always takes a while to get the logic in my skull. I apologize for being a little slow on the uptake. I found your walkthrough on the read me(imagine that) RTFM. I will let you know when I finish and how it looks.
|
|
|
|
|
Logged
|
|
|
|
Sparky
Moderator
Hero Member
   
Karma: 83
Posts: 2,228
stop pushing all those buttons
|
 |
« Reply #5 on: October 22, 2010, 01:43:16 PM » |
|
Ok- good luck. Post back if you get stuck.
|
|
|
|
|
Logged
|
Did you update the paths in ttxcfg.cgi after moving TTX to your new location? To those seeking help.... please report back when you figure it out. 
|
|
|
vellocet
Newbie
Karma: 0
Posts: 5
|
 |
« Reply #6 on: October 25, 2010, 05:04:37 PM » |
|
OK, I have the page up and running, with the (%CUSTOMVAR%) section removed, and the hand typed sections in, and it still works fine. My issue is, I cannot find(or decipher) where this code is in the the ticket merge mod, that pulls the time off of the server. I looked in the html and .pm files. I am sure I am looking right at it. Once I can recognize the code, I would think I could place in in between the <option> </option> parameters in the newticket.html <td align=left><select name="xIncident Date"> <option></option> </select></td></tr> The end result I was looking for is the field, populated with todays date.
|
|
|
|
|
Logged
|
|
|
|
Sparky
Moderator
Hero Member
   
Karma: 83
Posts: 2,228
stop pushing all those buttons
|
 |
« Reply #7 on: October 25, 2010, 05:38:04 PM » |
|
It's not that simple although it's pretty easy.
In the Merge Mod, there are several calls to "time()" where the raw time format is returned. When the page is dynamically constructed, this raw format is converted to a readable format.
The TTX subroutine called tmtxt in TTXCommon converts this raw time into the readable format.
Then once you have your date stored in a variable, $myVariable, you need to make a new macro.
$data->{myMacro} = $myVariable; (again, this is used quite a bit in the Merge mod)
... then in your template, you'd insert %myMacro% where ever you'd want to insert this information.
|
|
|
|
|
Logged
|
Did you update the paths in ttxcfg.cgi after moving TTX to your new location? To those seeking help.... please report back when you figure it out. 
|
|
|
|