Discussion:
[Vtigercrm-developers] add custom field with uitype 10 field to calendar events module
Preexo
2015-10-08 04:45:53 UTC
Permalink
I was very very naive (very frustrated by now) and thought I could just use
the module designer to add calendar events to a new module. This didn't work
at all. The outcome was a stuck user interface whenever I selected the
related events of the related module.

I then tried using the VGSRelatedFields Plugin to add my custom module to
the events module. This didn't work either.

Obviously the calendar events module is doing everything different and no
standardized solution works here.
I find some bits and pieces on the net on how to add a custom field with
uitype 10 to the events module but nothing has really worked.

Has anyone come up with a working procedure to this by now or should we
maybe start adding the bits and pieces to create a full working procedure.
The goal is:
Add a custom field with uitype 10 to the calendar events module.

Thanks for any help or input on this in advance,
best regards!



--
View this message in context: http://vtiger-crm.2324883.n4.nabble.com/add-custom-field-with-uitype-10-field-to-calendar-events-module-tp17608.html
Sent from the vtigercrm-developers mailing list archive at Nabble.com.
_______________________________________________
http://www.vtiger.com/
Alan Lord
2015-10-08 07:45:08 UTC
Permalink
Post by Preexo
Has anyone come up with a working procedure to this by now or should we
maybe start adding the bits and pieces to create a full working procedure.
Add a custom field with uitype 10 to the calendar events module.
The vtiger Calendar module is so non-standard it hurts ;-)

It is much improved in vtiger version 6 than v5 but it still requires a
fair bit of hacking. Too much of the Calendar module, and its relations,
have hardcoded assumptions.

If you want to relate Events and Tasks with another module you must add
your module name to the vtiger_ws_referencetype table, e.g.
Post by Preexo
INSERT INTO vtiger_ws_referencetype(fieldtypeid,type) VALUES(34,$MODULENAME)
(This assumes that UIType 66 has a fieldtypeid of 34 in
vtiger_ws_fieldtype - do check)

Then you can use the standard vtlib setRelatedList() function to create
the related list in your target module using the get_activities function
name.

These two things will add your module to the picklist of modules in the
Related To block of Events and Tasks. The other bit will create the
related list of activities in your Module's Detail View.


HTH

Al


_______________________________________________
http://www.vtiger.com/
apcloic
2015-10-08 07:42:35 UTC
Permalink
Hi,

Yes, I've been able to add a UItype 10 field to the Calendar/Events module :
http://vtiger-crm.2324883.n4.nabble.com/Vtigercrm-developers-VT6-vtlib-calendar-tp9815p9931.html
hope it helps ;)
Regards,



--
View this message in context: http://vtiger-crm.2324883.n4.nabble.com/add-custom-field-with-uitype-10-field-to-calendar-events-module-tp17608p17611.html
Sent from the vtigercrm-developers mailing list archive at Nabble.com.
_______________________________________________
http://www.vtiger.com/
Alan Lord
2015-10-08 08:10:57 UTC
Permalink
Post by apcloic
http://vtiger-crm.2324883.n4.nabble.com/Vtigercrm-developers-VT6-vtlib-calendar-tp9815p9931.html
Great thread! I'd forgotten about all that... :-D

There's some good info in there to fix all the oddities.

Al


_______________________________________________
http://www.vtiger.com/
Preexo
2015-10-09 09:15:56 UTC
Permalink
thanks, both hints combined helped a lot! I got it to work now with the
following code in the createRelatedLists function of my custom module:



and also taking the get_activities function from the helpdesk module into my
custom module. Then I had to change the query so it would actually find the
activities.



I have one more problem. When I click the create event button in the related
list of my custom module, it doesn't take my module entity id into the new
even form field.
Any idea for that?
Post by Alan Lord
Post by apcloic
http://vtiger-crm.2324883.n4.nabble.com/Vtigercrm-developers-VT6-vtlib-calendar-tp9815p9931.html
Great thread! I'd forgotten about all that... :-D
There's some good info in there to fix all the oddities.
Al
_______________________________________________
http://www.vtiger.com/
--
View this message in context: http://vtiger-crm.2324883.n4.nabble.com/add-custom-field-with-uitype-10-field-to-calendar-events-module-tp17608p17622.html
Sent from the vtigercrm-developers mailing list archive at Nabble.com.
_______________________________________________
http://www.vtiger.com/
Preexo
2015-10-13 10:28:48 UTC
Permalink
ok, I have more problems... the calendar is still a pain in ....

When I create an event and add the system(custom module) to the field right
away while creating the new entity event, it doesn't save any relation to
the vtiger_seactivity table. If I edit the already created event and add the
custom module field value then, it does add an entry to vtiger_seactivity.
Anyone an idea why?

also I have problems with the buttons in the related list in my custom
module. I don't want to show the "add task" button. But how do I get rid of
it?





--
View this message in context: http://vtiger-crm.2324883.n4.nabble.com/add-custom-field-with-uitype-10-field-to-calendar-events-module-tp17608p17640.html
Sent from the vtigercrm-developers mailing list archive at Nabble.com.
_______________________________________________
http://www.vtiger.com/
Alan Lord
2015-10-13 10:54:18 UTC
Permalink
Post by Preexo
also I have problems with the buttons in the related list in my custom
module. I don't want to show the "add task" button. But how do I get rid of
it?
You need to comment out the Add Task item in the $calendarActionLinks
array in the DetailView Model of *each* of the affected modules...

You will also need to "hack" the QuickCreate template file, the Vtiger
RelationListView Model, and hide the vtiger_relatedlist entries for the
"Calendar" tabid - not the "Events" tabid.

The Calendar is a bloody mess. :-D

HTH

Al


_______________________________________________
http://www.vtiger.com/
Preexo
2015-10-20 04:31:08 UTC
Permalink
Post by Alan Lord
You need to comment out the Add Task item in the $calendarActionLinks
array in the DetailView Model of *each* of the affected modules...
Thanks for that tip, worked like a charme...!
Post by Alan Lord
You will also need to "hack" the QuickCreate template file, the Vtiger
RelationListView Model, and hide the vtiger_relatedlist entries for the
"Calendar" tabid - not the "Events" tabid.
Sorry, I don't get what that would be for.
I was actually hoping to get rid of the button "+ Add task" in the related
list view as well. I achieved getting rid of both buttons ("+ Add Event" and
"+ Add Task") by this query, setting the actions to nothing:
UPDATE `vtiger_dev`.`vtiger_relatedlists` SET `actions` = '' WHERE
`vtiger_relatedlists`.`relation_id` =146;

But having the button "+ Add Event" wouldn't hurt, I just can't find where
to tell only one of them should be shown.
Post by Alan Lord
The Calendar is a bloody mess. :-D
Hell yeah it is... Maybe we can join forces one day and clean it up a little
more... Not sure why it is so non-standard at all...?



--
View this message in context: http://vtiger-crm.2324883.n4.nabble.com/add-custom-field-with-uitype-10-field-to-calendar-events-module-tp17608p17765.html
Sent from the vtigercrm-developers mailing list archive at Nabble.com.
_______________________________________________
http://www.vtiger.com/

Loading...