[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Refactoring code for 1.3



Hi all;

I am proposing that Form.pm become depricated as of 1.3.  In its place
new development should use LedgerSMB.pm which will start out as a copy
of Form.pm.  However, Form.pm has 64 functions in 1.2, and would have
65 functions in 1.3 if we don't take action.  I am proposing that the
following function refactoring occur:

Functions to keep
new (rework)
debug (use Data::Dumper)
escape (rework)
unescape (rework)
redirect
format_amount
parse_amount
round_amount
datetonum
db_init
dbconnect_noauto
redo_rows
merge

Functions to drop now or later
quote (replace with general entity management)
unquote (replace with general entity management)
hide_form (replace with new target windows, where applicable, or store
sessions in server where necessary).
numtextrows
error   \
info===== move into error class?
dberror/
header  (at least strip down)
sortorder (move to dbobject class)
callproc (move to dbobject class)
get_my_emp_num (replace with a function that returns an employee object)
parse_template (replace with template parsing namespace)
format_line (useless where the template is headed)
cleanup (move to template namespace)
rerun_latex (move to template namespace)
format_string (move to template namespace)
add_date
run_custom_queries (move to DBObject)
dbconnect (everything should be transactional)
dbquote (not using it anymore)
update_balance (should not be needed with our database functions)
update_exchangerate (should not be needed with our database functions)
save_exchangerate (should not be neeed with our database functions)
get_exchangerate ("")
check_exchangerate ("")
add_shipto (move to db back-end and pass through from other parent functions)
get_employee (roll into employee object)
get_name (apply to specific objects)
all_vc (move to Contact.pm or Company.pm)
all_taxaccounts (move to Account.pm)
all_employees (move to Employee.pm)
all_projects
all_departments
all_years (move to a stored procedure attached to some other object)
create_links (move to appropriate objects)
lastname_used (move to defaults table)
like (unneeded with current structure
get_partsgroup (move to other object)
update_status (move to stored procedures attached to objects)
save_status (ditto)
get_recurring/save_recurring (move to another class or namespace)
save_intnotes (move to appropriate classes)
update_defaults (move into separate class)
from_to
audittrail(move to DBObject/stored procedure, or maybe even triggers.

Unsure
split-date


Any thoughts or feedback?

Best Wishes,
Chris Travers