| @@ -2,9 +2,9 @@ | ||
| 2 | 2 | /** |
| 3 | 3 | * @package VikBooking |
| 4 | 4 | * @subpackage core |
| 5 | 5 | * @author E4J s.r.l. |
| 6 | - * @copyright Copyright (C) 2021 E4J s.r.l. All Rights Reserved. | |
| 6 | + * @copyright Copyright (C) 2026 E4J s.r.l. All Rights Reserved. | |
| 7 | 7 | * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL |
| 8 | 8 | * @link https://vikwp.com |
| 9 | 9 | */ |
| 10 | 10 | |
| @@ -58,39 +58,48 @@ | ||
| 58 | 58 | |
| 59 | 59 | /** |
| 60 | 60 | * @inheritDoc |
| 61 | 61 | */ |
| 62 | - public function useAssets() | |
| 62 | + public function getSubject() | |
| 63 | 63 | { |
| 64 | - $document = JFactory::getDocument(); | |
| 65 | - $document->addScript(VBO_SITE_URI . 'resources/chat/task.js'); | |
| 64 | + if ($task = $this->getTask()) { | |
| 65 | + return $task->getTitle(); | |
| 66 | + } | |
| 66 | 67 | |
| 67 | - JText::script('VBSAVE'); | |
| 68 | - JText::script('VBO_TASK'); | |
| 69 | - JText::script('VBO_NEW_TASK'); | |
| 70 | - JText::script('VBO_PROJECTS_AREAS'); | |
| 68 | + return sprintf('<em>Task #%d (deleted)</em>', $this->getID()); | |
| 71 | 69 | } |
| 72 | 70 | |
| 73 | 71 | /** |
| 74 | 72 | * @inheritDoc |
| 75 | 73 | */ |
| 76 | - public function getSubject() | |
| 74 | + public function getURL() | |
| 77 | 75 | { |
| 78 | - if ($task = $this->getTask()) { | |
| 79 | - return $task->getTitle(); | |
| 80 | - } | |
| 76 | + return VBOFactory::getPlatform()->getUri()->route('index.php?option=com_vikbooking&view=operators&tool=task_manager&filters[calendar_type]=taskdetails&filters[task_id]=' . $this->getID()); | |
| 77 | + } | |
| 81 | 78 | |
| 82 | - return sprintf('<em>Task #%d (deleted)</em>', $this->getID()); | |
| 79 | + /** | |
| 80 | + * @inheritDoc | |
| 81 | + */ | |
| 82 | + public function useAssets(VBOChatUser $user) | |
| 83 | + { | |
| 84 | + $document = JFactory::getDocument(); | |
| 85 | + $document->addScript(VBO_SITE_URI . 'resources/chat/task.js'); | |
| 86 | + | |
| 87 | + JText::script('VBSAVE'); | |
| 88 | + JText::script('VBO_TASK'); | |
| 89 | + JText::script('VBO_NEW_TASK'); | |
| 90 | + JText::script('VBO_PROJECTS_AREAS'); | |
| 83 | 91 | } |
| 84 | 92 | |
| 85 | 93 | /** |
| 86 | 94 | * @inheritDoc |
| 87 | 95 | */ |
| 88 | - public function getActions() | |
| 96 | + public function getActions(VBOChatUser $user) | |
| 89 | 97 | { |
| 90 | 98 | $actions = []; |
| 91 | 99 | |
| 92 | - if (JFactory::getApplication()->isClient('site')) { | |
| 100 | + // proceed only if the authenticated user is an administrator | |
| 101 | + if ($user->getID() != 0) { | |
| 93 | 102 | return $actions; |
| 94 | 103 | } |
| 95 | 104 | |
| 96 | 105 | // fetch task details |
| @@ -151,16 +160,8 @@ | ||
| 151 | 160 | 'icon' => VikBookingIcons::i('plus'), |
| 152 | 161 | 'separator' => true, |
| 153 | 162 | ], |
| 154 | 163 | ]); |
| 155 | - } | |
| 156 | - | |
| 157 | - /** | |
| 158 | - * @inheritDoc | |
| 159 | - */ | |
| 160 | - public function getURL() | |
| 161 | - { | |
| 162 | - return VBOFactory::getPlatform()->getUri()->route('index.php?option=com_vikbooking&view=operators&tool=task_manager&filters[calendar_type]=taskdetails&filters[task_id]=' . $this->getID()); | |
| 163 | 164 | } |
| 164 | 165 | |
| 165 | 166 | /** |
| 166 | 167 | * @inheritDoc |