Small update to LighthousePro

Just a quick note to say I released a minor update to Lighthouse Pro. This last update has a few changes, but the main one is that if you are editing an issue and let your session timeout, after you login your changes are preserved. So if you had entered some lengthy notes, timed out, hit Save, when you login, you changes to the issue are preserved and stored.

There are a few ways you can do this, but here is how I did it. Also note I was only only concerned about people timing out in an issue edit. First off, in login.cfm, I look for a form post from the issue editor:

<cfif structKeyExists(form, "issuetypeidfk")>
   <cfset session.issueform = duplicate(form)>
</cfif>

Then back in view.cfm, the file that handles editing issues, I simply added:

<cfif structKeyExists(session, "issueform")>
   <cfset structAppend(form, session.issueform)>
   <cfset structDelete(session, "issueform")>
</cfif>

Note that I clear out the session data. This is important so as to not keep restoring the edits for future editing.

Comments

Excellent! My coworker had some issues with this previously (much swearing and shouting ensued which we could usually tell came from a long form post and was welcomed with a "Please login" screen). He was ecstatic :) I use Firefox, so I was able to keep my form posts when I clicked back, so it wasn't too much of an issue for me, but it will definitely be a nice addition.
# Posted By Gareth | 2/18/08 7:35 AM
I have not used Litehouse and i am not familar with the code.

How does the form variable still exists when you get sent to the login screen? If you were to do a cflocation and send them to the login page the form variable would not exist. Is login displayed in the application.cfm file if the user's session is old?
# Posted By Chad | 2/18/08 8:45 AM
I use a cfinclude to load in the login page.
# Posted By Raymond Camden | 2/18/08 8:47 AM
Hey Ray,
I added this code to our server (removed the old code and put the new files up on the server). Everything works great except for the "Reports" page. It works nicely in Firefox, but IE is throwing JS errors. I would troubleshoot it myself, but I figured there may be something quick and easy I'm missing. The 2 stats.cfm pages look to be exactly the same, so I'm not sure what changed from the last version to this one. The errors received are:
Line: 98 (and 117, 136, 155, 174)
Char: 1
Error: Object Expected
Code: 0
URL: http://myurl/stats.cfm

Any ideas?
Thanks.
# Posted By Gareth | 2/20/08 10:38 AM
Anyway you can send me your URL?
# Posted By Raymond Camden | 2/20/08 10:40 AM
I would love to but the site is hosted internally :( As they're all JS errors, would saving the HTML page be enough?
# Posted By Gareth | 2/20/08 12:37 PM
Sure.
# Posted By Raymond Camden | 2/20/08 12:42 PM
Looking at it again, I'm guessing it's this "/CFIDE/scripts/CF_RunActiveContent.js" This file does not exist, but I wasn't sure what CF was including to get that to show up (plus another guy set up the old LighthousePro, but I figured if I left the default.cfm alone and just copied over all of the other files, I'd be OK...but apparently not quite).
# Posted By Gareth | 2/20/08 12:44 PM
Yup, that was it. We've got some strange setup with CF here, so I just created a new CFIDE/scripts folder under the actual web directory (not the best way to do it, I know) and put the .js file in there and everything's working correctly now.
# Posted By Gareth | 2/20/08 1:25 PM