The best approach of doing this?

General development questions

The best approach of doing this?

Postby mishoboss » Tue Apr 28, 2009 6:14 pm

Hi, i'm developing my Invoices app and I'm hitting a logical problem. I need some additional fields to the Addressbook (I use Addressbook app to select clients) to hold the company address, VAT ID and some other specific invoicing data. I want this data to be editable when edit a contact in Addressbook, but only if Invoices module is installed. What is the best approach of doing this? I also want this fields to be optional and arrangable. For example there is no need of VAT ID field outside EU countries, so I would like to give the users an option to enable and disable theese fields. Also I would like to give them several custom fields which they could use for the country specific laws of invoicing.
Don't hate the player, hate the game!
User avatar
mishoboss
Tine 2.0 Community Contributor
 
Posts: 70
Joined: Fri Sep 19, 2008 5:26 pm
Location: Sofia, Bulgaria

Re: The best approach of doing this?

Postby mishoboss » Wed Apr 29, 2009 10:46 am

Any hint on this? Thanks :)
Don't hate the player, hate the game!
User avatar
mishoboss
Tine 2.0 Community Contributor
 
Posts: 70
Joined: Fri Sep 19, 2008 5:26 pm
Location: Sofia, Bulgaria

Re: The best approach of doing this?

Postby ph_il » Wed Apr 29, 2009 11:11 am

i think, you should use our custom fields for this. your invoice app could add these fields to the addressbook.
but you need to extend the contact edit dialog and add an additional custom fields tab panel.

regards,
philipp
Philipp Schüle
Tine 2.0 Core Developer

Visit http://www.tine20.com (commercial support, consulting and development)
Visit http://www.officespot20.com (Tine 2.0 hosting)
User avatar
ph_il
Tine 2.0 Core Developer
 
Posts: 3450
Joined: Fri Mar 07, 2008 11:41 am

Re: The best approach of doing this?

Postby mishoboss » Wed Apr 29, 2009 11:15 am

Thanks, I was thinkig the same but wanted to be sure this is the best way.

Probably I will need some help on doing this, so please be patient with me :D
Don't hate the player, hate the game!
User avatar
mishoboss
Tine 2.0 Community Contributor
 
Posts: 70
Joined: Fri Sep 19, 2008 5:26 pm
Location: Sofia, Bulgaria

Re: The best approach of doing this?

Postby mishoboss » Wed Apr 29, 2009 11:24 am

And this is the first question: where it stores the actual data typed in the custom fields? Do I have to make an additional DB table for this?
Don't hate the player, hate the game!
User avatar
mishoboss
Tine 2.0 Community Contributor
 
Posts: 70
Joined: Fri Sep 19, 2008 5:26 pm
Location: Sofia, Bulgaria

Re: The best approach of doing this?

Postby nelius » Wed Apr 29, 2009 11:59 am

storing this info as cf's in adb should be considered as hot-fix, as we don't have a better api in tine for this yet.

Later we want to handle it like this:
- an address is an address is a 'groupware' address and does not take spechial info like 'invoice address'
- the invoice app holds infos like 'invoice address' _related_ to the 'groupware address' from addressbook
- the addressbook provides a mechanism for other apps to manipulate / view _related_ data from other apps. There would be two mechanisms, which one to chose has something to do with the importance of the related data:
1. a geneirc 'Tab' "Relations" where the user could see and open all related info (technicall records) of the address
2. an extra Tab only for the related app which only appears if the user has the right to use the other app.
Cornelius Weiss
Tine 2.0 Lead Developer

Visit http://www.tine20.com for commercial support / consulting / development.
Visit http://www.officespot20.com for Tine 2.0 hosting.
User avatar
nelius
Tine 2.0 Core Developer
 
Posts: 1150
Joined: Tue Nov 06, 2007 7:25 pm

Re: The best approach of doing this?

Postby mishoboss » Wed Apr 29, 2009 12:11 pm

Thanks for the reply
storing this info as cf's in adb should be considered as hot-fix, as we don't have a better api in tine for this yet.

I didn't understood this. I understand you don't have an API yet for this, but you do it somehow for the Addressbook and Timetracker. Yesterday I tried to test the customfields for the Timetracker, but maybe I'm wrong with something. This is my record in config_customfields table.

id application_id name label model type length
a07478e0a9e322f209884e9d8ff948b708df68f3 8c4358345e1885c1801b4fabd41b8b5cf94665c8 tesssst tesst timesheet textfield NULL


I have the tab CUSTOM FIELDS enabled, but there's nothig in it.

There is also another question I have - how could I modify the Addressbook JS from my app, so I could add this extra tab "Invoice data" with the custom fields?
Don't hate the player, hate the game!
User avatar
mishoboss
Tine 2.0 Community Contributor
 
Posts: 70
Joined: Fri Sep 19, 2008 5:26 pm
Location: Sofia, Bulgaria

Re: The best approach of doing this?

Postby nelius » Wed Apr 29, 2009 1:12 pm

Sorry for being inclear,

- the customfieldsapi is there and it's working. Each datatype which wants to use customfields, must provide a table '<datatypeTabelName>_custom' like 'timetracker_timesheet_custom. In Adressbook, we havn't included it yet. If you like, you can provide a patch for addressbook to have it cf's enabled there per default.

I guess, you just need to add the table in setup.xml / update script and declare it in the edit-dialog. the rest should be working out of the box.

The 'type' parameter in the customfields definition table is the xtype of the ExtJS component.

The other thing i was talking about is a generic api for inter-applicatino hooking. This is not finished, (and not even started) yet ;-)
Cornelius Weiss
Tine 2.0 Lead Developer

Visit http://www.tine20.com for commercial support / consulting / development.
Visit http://www.officespot20.com for Tine 2.0 hosting.
User avatar
nelius
Tine 2.0 Core Developer
 
Posts: 1150
Joined: Tue Nov 06, 2007 7:25 pm

Re: The best approach of doing this?

Postby mishoboss » Wed Apr 29, 2009 2:37 pm

Well, I just can't make the custom fields for the Timetracker to work... :(

I get this error when I go to the "Custom fields" tab in Timetracker.

Event thread: mousedown
Error:
name: TypeError
message: Statement on line 104: Cannot convert undefined or null to Object
Backtrace:
Line 104 of linked script http://localhost/tine200/Tinebase/js/wi ... 1240745238
this.items.each(function(item) {
Line 77 of linked script http://localhost/tine200/Tinebase/js/wi ... 1240745238
this.setAllCfValues(this.quickHack.record.get('customfields'));
... Line 1515 of linked script http://localhost/tine200/library/ExtJS/ext-all-debug.js
if(l.fireFn.apply(l.scope||this.obj||window, arguments) === false){
... Line 1202 of linked script http://localhost/tine200/library/ExtJS/ext-all-debug.js
return ce.fire.apply(ce, Array.prototype.slice.call(arguments, 1));
Line 12862 of linked script http://localhost/tine200/library/ExtJS/ext-all-debug.js
this.fireEvent("render", this);
... Line 14511 of linked script http://localhost/tine200/library/ExtJS/ext-all-debug.js
Ext.Container.superclass.render.apply(this, arguments);
Line 14819 of linked script http://localhost/tine200/library/ExtJS/ext-all-debug.js
c.render(target, position);
Line 14942 of linked script http://localhost/tine200/library/ExtJS/ext-all-debug.js
this.renderItem(this.activeItem, undefined, target);
Line 14796 of linked script http://localhost/tine200/library/ExtJS/ext-all-debug.js
this.renderAll(ct, target);
... Line 14904 of linked script http://localhost/tine200/library/ExtJS/ext-all-debug.js
Ext.layout.FitLayout.superclass.onLayout.call(this, ct, target);
Line 14790 of linked script http://localhost/tine200/library/ExtJS/ext-all-debug.js
this.onLayout(this.container, target);
Line 14935 of linked script http://localhost/tine200/library/ExtJS/ext-all-debug.js
this.layout();
Line 19916 of linked script http://localhost/tine200/library/ExtJS/ext-all-debug.js
this.layout.setActiveItem(item);
Line 19647 of linked script http://localhost/tine200/library/ExtJS/ext-all-debug.js
this.setActiveTab(t.item);
... Line 1723 of linked script http://localhost/tine200/library/ExtJS/ext-all-debug.js
fn.call(scope || el, e, t, o);
...
stacktrace: n/a; see 'opera:config#UserPrefs|Exceptions Have Stacktrace'


I have "textfield" for TYPE (which is regular ExtJS xtype) and "Timesheet" for MODEL in config_customfields table.
Don't hate the player, hate the game!
User avatar
mishoboss
Tine 2.0 Community Contributor
 
Posts: 70
Joined: Fri Sep 19, 2008 5:26 pm
Location: Sofia, Bulgaria

Re: The best approach of doing this?

Postby mishoboss » Thu Apr 30, 2009 11:47 am

Any idea? :(
Don't hate the player, hate the game!
User avatar
mishoboss
Tine 2.0 Community Contributor
 
Posts: 70
Joined: Fri Sep 19, 2008 5:26 pm
Location: Sofia, Bulgaria

Next

Return to General

Who is online

Users browsing this forum: Exabot [Bot] and 2 guests

Startseite
NewsDemoDownloadForumWikiBlog
Support
Support at first hand!
If the forum does not help anymore ... Professional support is available directly from our Tine2.0 core Developers.

more »