Skip to content

Commit

Permalink
Delete timer
Browse files Browse the repository at this point in the history
  • Loading branch information
xacobofg committed Nov 20, 2019
1 parent 37dc454 commit e19de5f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
10 changes: 10 additions & 0 deletions hook.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,16 @@ function plugin_actualtime_item_add($item) {
PluginActualtimeTask::afterAdd($item);
}

function plugin_actualtime_item_purge(TicketTask $item){
global $DB;

$DB->delete(
PluginActualtimeTask::getTable(),[
'tasks_id'=>$item->fields['id']
]
);
}

function plugin_actualtime_getAddSearchOptionsNew($itemtype){
$tab=[];

Expand Down
6 changes: 3 additions & 3 deletions setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,16 +76,16 @@ function plugin_init_actualtime() {
$PLUGIN_HOOKS['pre_item_update']['actualtime'] = ['TicketTask'=>'plugin_actualtime_item_update'];
$PLUGIN_HOOKS['post_show_item']['actualtime'] = ['PluginActualtimeTask', 'postShowItem'];
$PLUGIN_HOOKS['add_javascript']['actualtime'] = 'js/actualtime.js';
$PLUGIN_HOOKS['item_purge']['actualtime']=['TicketTask'=>'plugin_actualtime_item_purge'];

if ($config->showTimerPopup()) {
// This hook is not needed if not showing popup
$PLUGIN_HOOKS['post_show_tab']['actualtime'] = ['PluginActualtimeTask', 'postShowTab'];
}

if ($config->autoOpenNew()) {
// This hook is not needed if not opening new tasks automatically
$PLUGIN_HOOKS['item_add']['actualtime'] = ['TicketTask'=>'plugin_actualtime_item_add'];

// This hook is not needed if not opening new tasks automatically
$PLUGIN_HOOKS['item_add']['actualtime'] = ['TicketTask'=>'plugin_actualtime_item_add'];
}

}
Expand Down

0 comments on commit e19de5f

Please sign in to comment.