Create custom Links..?

Discuss about Group-Office development here

Moderator: Developers

chriscross
Posts: 13
Joined: Mon Dec 21, 2009 8:51 am

Create custom Links..?

Postby chriscross » Mon Jan 11, 2010 8:13 pm

Hi,

I am currently trying to create a custom link type for a booking module. A booking should be linked to the attending contacts in the adressbook. I took a look at the notes module and created a custom link type in the database and a BookingPanel.js file accordingly. The problem is, that it won't show up in the sidepanel, even though the link is saved in the database in its custom table...

Did I miss anything to include the BookingPanel.js file?

Code: Select all

GO.booking.BookingPanel = Ext.extend(GO.DisplayPanel,{
	link_type : 33,
	
	loadParams : {task: 'booking'},
	
	idParam : 'bid',
	
	loadUrl : GO.settings.modules.booking.url+'json.php',
	
	editHandler : function(){
		if(!GO.booking.bookingDialog)
		{
			GO.booking.bookingDialog = new GO.booking.BookingDialog();			
		}
		this.addSaveHandler(GO.booking.bookingDialog);
				
		GO.booking.bookingDialog.show(this.data.id);
	},	
		
	initComponent : function(){	
		this.template = 

				'<table class="display-panel" cellpadding="0" cellspacing="0" border="0">'+
					'<tr>'+
						'<td colspan="2" class="display-panel-heading">Test</td>'+
					'</tr>'+
					'<tr>'+
						'<td colspan="2">{content}</td>'+
					'</tr>'+									
				'</table>';																		
				
		this.template += GO.linksTemplate;
										
		if(GO.customfields)
		{
			this.template +=GO.customfields.displayPanelTemplate;
		}	
				
		if(GO.files)
		{
			Ext.apply(this.templateConfig, GO.files.filesTemplateConfig);
			this.template += GO.files.filesTemplate;
		}
		Ext.apply(this.templateConfig, GO.linksTemplateConfig);
		
		if(GO.comments)
		{
			this.template += GO.comments.displayPanelTemplate;
		}		

		GO.booking.BookingPanel.superclass.initComponent.call(this);
	}
});
Help with this one would be much appreciated!!

Thank's!
mschering
Site Admin
Site Admin
Posts: 8332
Joined: Tue Apr 20, 2004 1:06 pm
Location: The Netherlands - Den Bosch
Contact:

Re: Create custom Links..?

Postby mschering » Wed Jan 13, 2010 4:35 pm

have a look at the cache_note function. You need to add your booking to the search cache as it is used for links too.
Best regards,

Merijn Schering
Intermesh
chriscross
Posts: 13
Joined: Mon Dec 21, 2009 8:51 am

Re: Create custom Links..?

Postby chriscross » Fri Jan 15, 2010 12:22 am

Hi,

thank's for the advice, but it did not do the trick... Is there perhaps something else to pay attention to? I could not find anything in the documentation.

Thank you for support!!
mschering
Site Admin
Site Admin
Posts: 8332
Joined: Tue Apr 20, 2004 1:06 pm
Location: The Netherlands - Den Bosch
Contact:

Re: Create custom Links..?

Postby mschering » Fri Jan 15, 2010 8:02 am

Can you find your booking with the global search box of GO?
Best regards,

Merijn Schering
Intermesh
chriscross
Posts: 13
Joined: Mon Dec 21, 2009 8:51 am

Re: Create custom Links..?

Postby chriscross » Fri Jan 15, 2010 8:35 am

Yes, I get all the Contacts and the booking when I do a search for "Booking"...
mschering
Site Admin
Site Admin
Posts: 8332
Joined: Tue Apr 20, 2004 1:06 pm
Location: The Netherlands - Den Bosch
Contact:

Re: Create custom Links..?

Postby mschering » Sat Jan 16, 2010 9:01 am

Then it should work when you do a

$GO_LINKS->add_link(33,<booking_id>,2,<contact_id>);
Best regards,

Merijn Schering
Intermesh
chriscross
Posts: 13
Joined: Mon Dec 21, 2009 8:51 am

Re: Create custom Links..?

Postby chriscross » Sun Jan 17, 2010 1:13 am

I am using

Code: Select all

$GO_LINKS->add_link($bid, 33, $cid, 2);
and I found the problem... I missed to set the acl_rights in the search_cache table, that's why nothing showed up...

But how do I set the acl so that everybody can read the links who is authorised to use the booking module??

Anyway, thank you for the great support, was a big help!
mschering
Site Admin
Site Admin
Posts: 8332
Joined: Tue Apr 20, 2004 1:06 pm
Location: The Netherlands - Den Bosch
Contact:

Re: Create custom Links..?

Postby mschering » Tue Jan 19, 2010 4:14 pm

Then you should set the ACL of the bookings module in the cache table. $GO_MODULES->modules['bookings']['acl_id'];
Best regards,

Merijn Schering
Intermesh
chriscross
Posts: 13
Joined: Mon Dec 21, 2009 8:51 am

Re: Create custom Links..?

Postby chriscross » Thu Jan 21, 2010 7:33 pm

Ah ok, I see! now it works, thank you!
chriscross
Posts: 13
Joined: Mon Dec 21, 2009 8:51 am

Re: Create custom Links..?

Postby chriscross » Sun Apr 11, 2010 5:03 pm

Did this change?? I was uploading my module to the clients server and there are different fields in the search-cache table... acl-id instead of acl_read and write.
chriscross
Posts: 13
Joined: Mon Dec 21, 2009 8:51 am

Re: Create custom Links..?

Postby chriscross » Sun Apr 11, 2010 5:31 pm

I changed the ac_id thing. I get no errors when I insert a contact, the contact is in the database but it doesn't show up.

edit: it has nothing to do with my module but with the admin account that I got from the owner... I can see some of the existing contacts but most of them not. The other users can see everything... Any hint what the problem could be, the rights seem ok on the first sight....

Thank's in advance!
mschering
Site Admin
Site Admin
Posts: 8332
Joined: Tue Apr 20, 2004 1:06 pm
Location: The Netherlands - Den Bosch
Contact:

Re: Create custom Links..?

Postby mschering » Mon Apr 12, 2010 8:55 am

The acl system changed. You need to check only one acl_id and check the permission level with GO_SECURITY::READ_PERMISSION or WRITE_PERMISSION for example.
Best regards,

Merijn Schering
Intermesh

Who is online

Users browsing this forum: No registered users and 1 guest

cron