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

Re: Custom input fields/tables



Yes.

Thank you!

Is it safe to assume the upgrade to 1.3 won't take into consideration these customizations, or will there be a means to utilize data created from the add_custom_field() function?

Ted

Chris Travers wrote:
SQL-Ledger (and LSMB 1.2 and lower) rely on a global instance of the
LedgerSMB::Form object (SL uses SL::Form).  This is used as $form.  It
is instantiated from the http request.

As of 1.3, we are moving away from the global object architecture to
something more modularized.

So if you add an html form element with a name of my_field to the
project screen (in my example below), any data you enter will be saved
in the db.  TO display that data, you will need to have it set the
value to: "$form->{my_field}".

So the whole element might be printed out as:
print qq|<input type="text" name="my_field" value="$form->{my_field}"/>|;

Does that make more sense?

Best Wishes,
Chris Travers

On 5/24/07, Ted Onley <..hidden..> wrote:
I told you that you might hear from me soon --

When you say loaded and saved from the $form variable hash - that means I don't
hav e to add any SQL to my customizations?

Ted

Chris Travers wrote:
Ok, here is the full detail.

Currently the scripts in bin/ are customized by customization scripts.
 Rather than naming them "custom_$script" as in SQL-Ledger, we put
them in the custom/ folder and just use the same name as the script
they alter.

We also provide a means to extend certain core portions of the
software including invoices, orders, projects, and parts.  To add
custom fields, use the add_custom_field() function, and to remove them
use the drop_custom_filed() function (both from psql).  These
functions create fields, and also track them so we can dynamically add
them to queries.

The syntax is:
add_custom_field(entity_name VARCHAR, new_field_name VARCHAR,
field_datatype VARCHAR);
Currently there are issues of putting in optional fields using
non-VARCHAR/TEXT types.  This will be fixed in 1.3.

For example: select add_custom_field('project', 'my_field', 'varchar')
creates a new varchar field for projects called 'my_field'.  This is
then appropriately loaded and saved based on the $form variable hash
key with the same name.

Then you have to add the customizations to the front-end via the
custom scripts so that the fields are displayed and captured in the
data entry screens.

Best Wishes,
Chris Travers

On 5/22/07, Ted Onley <..hidden..> wrote:
I look forward to seeing the detail.

There are only a couple fields that I need to implement, but they are critical
for the client and the requirements their customers put on them.

It sounds like you have it covered though.

I'll implement the same logic I have with my custom_ scripts for now, then move
it to the new ledgerSMB implementation when it arrives.  I really can't wait for
the release of 1.3 before moving my client, and I really want to use LedgerSMB
instead of the alternative.

Ted

Chris Travers wrote:
Also I will send a detailed explenation of this tomorrow or the next
day.  If you don't see it, remind me (I am travelling at the moment).

On 5/22/07, Chris Travers <..hidden..> wrote:
It is likely that custom_ scripts will be removed in favor of an
entirely new system.  Customers/vendors/employees willb e replaced in
1.3, much of the rest of the app will be replaced in 1.4.

_custom scripts have a few issues in that saving them automically,
etc. is a problem.  We are moving instead to custom fields which are
automatically picked up and saved on certan entities.  Currently these
include parts, invoices, and orders.  Then you have to do the user
interface customization (using _custom scripts for this for now), but
the new architecture will move this into custom workflow scripts and
custom templates.

Best Wishes,
Chris Travers

On 5/22/07, Ted Onley <..hidden..> wrote:
Sorry (again) if this is a double (or triple) post...... I haven't seen it post
yet.  I've obviously done something wrong...


I've done some work on converting a client of mine to SQL-Ledger.  This work
includes some custom fields in a custom table for inventory items, as well as
some customizations in inventory processing within the invoicing system.  I'd
like to convert them to Ledger-SMB instead.

Is the provision of using 'custom_' scripts on front end modules going to be
changed/removed at some point in Ledger-SMB?  If so, will there be any provision
for customization within Ledger-SMB that could be carried forward over upgrades?

Ted Onley



-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Ledger-smb-devel mailing list
..hidden..
https://lists.sourceforge.net/lists/listinfo/ledger-smb-devel

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Ledger-smb-devel mailing list
..hidden..
https://lists.sourceforge.net/lists/listinfo/ledger-smb-devel

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Ledger-smb-devel mailing list
..hidden..
https://lists.sourceforge.net/lists/listinfo/ledger-smb-devel

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Ledger-smb-devel mailing list
..hidden..
https://lists.sourceforge.net/lists/listinfo/ledger-smb-devel

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Ledger-smb-devel mailing list
..hidden..
https://lists.sourceforge.net/lists/listinfo/ledger-smb-devel


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Ledger-smb-devel mailing list
..hidden..
https://lists.sourceforge.net/lists/listinfo/ledger-smb-devel