- Posts: 8
- Thank you received: 0
- Community Forum
- Appointment Booking Pro - Retired, no longer for sale or supported.
- ABPro 4.0.x
- Service being booked to Google calendar EventTitle
Service being booked to Google calendar EventTitle
- Simon Evans
- Topic Author
- Offline
- Fresh Boarder
Less
More
3 years 8 months ago #26383
by Simon Evans
Service being booked to Google calendar EventTitle was created by Simon Evans
Hello
Anyway to do this?
Got [resource_service] in the body, but would like it in the title if possible?
Anyway to do this?
Got [resource_service] in the body, but would like it in the title if possible?
Please Log in to join the conversation.
- Rob
- Offline
- Administrator
Less
More
- Posts: 4785
- Karma: 103
- Thank you received: 673
3 years 8 months ago - 3 years 8 months ago #26384
by Rob
Replied by Rob on topic Service being booked to Google calendar EventTitle
As built, ABPro has no ability to do that.
If you want to add/modify some code it is possible to do what you request.
The core booking info only stores the service id, so you will need to add a query to get the service name.
Edit file: \components\com_rsappt_pro3\functions2.php
Around line 63 add...
Now, a few lines further down, instead of using the resource name ($res_data->name), use the service name ($srv_data->name).
Additionally, the code the handles the Google Calendar from the back end when editing an existing booking will need to be modified.
File: \administrator\components\com_rsappt_pro3\models\requests_detail.php
Around line 432 add..
And switch the value for $title_text ..
If you want to add/modify some code it is possible to do what you request.
The core booking info only stores the service id, so you will need to add a query to get the service name.
Edit file: \components\com_rsappt_pro3\functions2.php
Around line 63 add...
// get service info
$database = JFactory::getDBO();
$srv_data = NULL;
$sql = "SELECT name FROM #__sv_apptpro3_services WHERE id_services=".$row->service;
try{
$database->setQuery($sql);
$srv_data = $database->loadObject();
} catch (RuntimeException $e) {
logIt("addToCalendar-addToCalendar-2,".$e->getMessage(), "", "", "");
if($preventEcho == "No"){
echo JText::_('RS1_SQL_ERROR');
}
return false;
}
Now, a few lines further down, instead of using the resource name ($res_data->name), use the service name ($srv_data->name).
switch ($apptpro_config->calendar_title) {
case 'resource.name': {
// $title_text = JText::_($res_data->name);
$title_text = JText::_($srv_data->name);
break;
}
case 'request.name': {
$title_text = JText::_($row->name);
break;
}
Additionally, the code the handles the Google Calendar from the back end when editing an existing booking will need to be modified.
File: \administrator\components\com_rsappt_pro3\models\requests_detail.php
Around line 432 add..
// get service name
$srv_data = NULL;
$sql = "SELECT name FROM #__sv_apptpro3_services WHERE id_services= ".$jinput->getString('service');
try{
$this->_db->setQuery($sql);
$srv_data = $this->_db->loadObject();
} catch (RuntimeException $e) {
logIt($e->getMessage(), "ctrl_requests_detail", "", "");
echo JText::_('RS1_SQL_ERROR').$e->getMessage();
exit;
}
And switch the value for $title_text ..
switch ($apptpro_config->calendar_title) {
case 'resource.name': {
// $title_text = stripslashes($res_data->name);
$title_text = stripslashes($srv_data->name);
break;
}
Last edit: 3 years 8 months ago by Rob.
Please Log in to join the conversation.
- Simon Evans
- Topic Author
- Offline
- Fresh Boarder
Less
More
- Posts: 8
- Thank you received: 0
3 years 8 months ago #26385
by Simon Evans
Replied by Simon Evans on topic Service being booked to Google calendar EventTitle
Wow fast reply! thanks Rob!
Please Log in to join the conversation.
- Rob
- Offline
- Administrator
Less
More
- Posts: 4785
- Karma: 103
- Thank you received: 673
3 years 8 months ago #26388
by Rob
Replied by Rob on topic Service being booked to Google calendar EventTitle
You're welcome.
Please Log in to join the conversation.
- Patrick Gay
- Offline
- Expert Boarder
Less
More
- Posts: 91
- Karma: 1
- Thank you received: 0
3 years 4 months ago #26627
by Patrick Gay
Replied by Patrick Gay on topic Service being booked to Google calendar EventTitle
Thanks. No error there, but I can't reproduce the issue, so I'll chalk it up to some weirdness with Google.
Please Log in to join the conversation.
- Rob
- Offline
- Administrator
Less
More
- Posts: 4785
- Karma: 103
- Thank you received: 673
3 years 4 months ago #26628
by Rob
Replied by Rob on topic Service being booked to Google calendar EventTitle
Or just blame it on 2020.
Please Log in to join the conversation.
- Community Forum
- Appointment Booking Pro - Retired, no longer for sale or supported.
- ABPro 4.0.x
- Service being booked to Google calendar EventTitle
Time to create page: 0.121 seconds