fix app to work properly with app.psgi as command-line or apache: * moved ajax route back to Routes::AJAX * Routes & Routes::AJAX load private instances of Reporter.pm, no longer shared * moved dbname logic from 2 routes files to Reporter dbname builder so only happens once in app routes.t uses Plack::Builder for app, same as app.psgi
fix ajax calls when app running from app.psgi * dance() deprecated in favour of to_app() * but to_app() didn't load Routes::AJAX routes so couldn't find ajax_get_diagnoses route * see bin/app.psgi.readme * modifying app.psgi to use Plack::Builder fixed it but not when used by Apache (which used bin/app.pl->dance) * recurrent problems with separate AJAX route so combined the only 1 into main Routes file, prefixed as '/ajax' * separated test schema into its own file and separated reports.t into routes.t & model.t * change reporter.fgci (Apache script) to use bin/app.psgi (->to_app)
fix for 'mysql gone away' problem in Routes::AJAX - app definition was incorrect, and gave it a 'before' hook to check_db_connection as precaution; removed debugging info in DB::check_db_connection
fix for 'mysql server has gone away' message - new DB check_db_connection() method clears dbix object if no ping received from db, forcing dbix object recreation; wrapped 'horrible' deferred keyword in flash() method; dev logger uses Console::Colored output
switched model & app validation classes - DFV currently more suitable for model than HTML::FormHandler: eg manipulating validation profile required fields in model instead of template
replaced HTTP::Validate with Data::Formvalidator in Reporter::Validator; retrieval of request data includes previous report if submitted by same user otherwise new draft report created; request data saved in session for template in case db update/insert fails and original data needs to be re-displayed; changed validation from HTML::FormHandler to Data::FormValidator, pending ability to select validation profiles; app now fully functional
queries to retrieve test results & result summaries from db; new route class for ajax calls; formatted report_form.tt; provided some tt vars via before_template_render hook