This repository has been archived by the owner on Sep 13, 2024. It is now read-only.
Automatically created calendar birthday entries #16458
diderich
started this conversation in
Feature improvement
Replies: 3 comments 1 reply
-
Beta Was this translation helpful? Give feedback.
0 replies
-
with "vtiger_activity.status" , first problem solved. |
Beta Was this translation helpful? Give feedback.
0 replies
-
I added function to the file /modules/Vtiger/helpers/Util.php, then it works `public static function getAge($birthday, $birthdate)
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I was looking some time ago for the possibility to automatically create birthday calendar entries for all contacts with a birth date specified. I was pointed out that this can be done creating a customized workflow. I tried, but never got it working. In addition, I wanted to automatically have completed birthday calendar entries deleted. Deleting record using workflows is not supported, as was pointed out to me.
Having experience in
php
programming, I decided to write a shortcron
class calledCalendar_CreateBirthday_Cron
thatvtiger_comntactsubdetails
and put it into the calendar of the assigned user (I am assuming that all contacts are assigned to users, rather than groups - which is the case in my organization).I am not sure if the way my code is written is how one should write code for YetiForceCRM, so any improvements are more than welcome. Anyway I am making the code available for free under the MIT license. Feel free to use it at your own expense. If the YetiForce team wants to include the code (or an improved version of it) with a future version of the system, that's fine by me to.
Here is how I proceeded:
1. Create a
Birthday
picklist entryI first added a picklist entry called
Birthday
to theCalendar
/Activity Type
picklist as show in the figure below:2. Developed
cron
classCalendar_CreateBirthday_Cron
I programmed a class extending the class
\AppCronHandler
as show below and put it into the directorycustom/modules/Calendar/crons
as file namedCreateBirthday.php
. By default that directory does not exist, so you have to create it. As it is a custom directory, it won't interfere with future updates of the system (assuming that the used database table structures and class interfaces do not change - but that's the risk/fun of customizing YetiForceCRM).3. Create an entry in the table
vtiger_cron_task
I created an entry in the
vtiger_cron_task
table. You do not have to specific any value forlaststart
,last_update
,lastend
, andstatus
.4. Translation
You may want to translate the label
LBL_CREATE_BIRTHDAY
incustom/languages/en-US/Settings/CronTasks.json
, or whatever language you are using.That's all there is.
Have fun!
Beta Was this translation helpful? Give feedback.
All reactions