sasquatch58/modules-flexreports — pull request #3 by jan-vitek (2014-01-05 05:00:37+00:00)
Title: Possibility to add new reports

Hello,
I made these modifications to the code to make it possible to create new flexreports. I will briefly explain what I did. I had to work with the "Renaming CRecord" commit because in one of the later commits is a mistake that broke down viewing of existing reports.

Exception for 'selected_field1'

elem.id == 'selected_field1'

Based on this you can create flexreport with selected fields. Field 'selected_field1' is the one with selected fields for the new record and it needs special behaviour.

Renamed submit button

When submit button was called 'submit' I was not able to confirm the 'Confirm?' dialog window. Problem was that the name overrides the function submit() called from dialog window and I get this error:
"Property 'submit' of object #\ is not a function"

Report bind

$ret = $report->bind( $_POST );

This links a new object that will be stored with the object get from the form. Errors should be handled with the $ret value. I did not do that and i have removed handling even for the store() function because sometimes the part of the code in the if clause is execuded even if the report was stored.