[Vtigercrm-developers] Shared Calendar

Alan Lord alanslists at gmail.com
Thu Nov 12 10:58:46 GMT 2015


I would like to add new records (custom modules) to the Shared Calendar 
list.

But looking at the Calendar_Feed_Action class it appears to me that all 
of the types are hard-coded...

> switch ($type) {
> 	case 'Events': $this->pullEvents($start, $end, $result,$userid,$color,$textColor); break;
> 	case 'Calendar': $this->pullTasks($start, $end, $result,$color,$textColor); break;
> 	case 'Potentials': $this->pullPotentials($start, $end, $result, $color, $textColor); break;
> 	case 'Contacts':
> 		if($request->get('fieldname') == 'support_end_date') {
> 			$this->pullContactsBySupportEndDate($start, $end, $result, $color, $textColor);
> 		}else{
> 			$this->pullContactsByBirthday($start, $end, $result, $color, $textColor);
> 		}
> 		break;
> 	case 'Invoice': $this->pullInvoice($start, $end, $result, $color, $textColor); break;
> 	case 'MultipleEvents' : $this->pullMultipleEvents($start,$end, $result,$request->get('mapping'));break;
> 	case 'Project': $this->pullProjects($start, $end, $result, $color, $textColor); break;
> 	case 'ProjectTask': $this->pullProjectTasks($start, $end, $result, $color, $textColor); break;
> }

Is this _really_ the best way to do this? Why on earth are the 
pullModule functions in this class? They should be part of the target 
module's model somewhere. That way I could include a custom pullModule 
function in my own module's class files...

Maybe I have misunderstood the way this works but if I create a new 
module that has date parameters in it, how am I supposed to be able to 
display it on the shared calendar?

Thanks

Al



More information about the vtigercrm-developers mailing list