Permalink
Browse files

Orphaned Tasks on Dept. Deletion

Move orphaned tasks on department deletion to the default department
  • Loading branch information...
protich committed Nov 3, 2016
1 parent 901e5ea commit 42e2c55af8fc840fdbde16cfc8de4a1b01a02d29
Showing with 5 additions and 0 deletions.
  1. +5 −0 include/class.dept.php
View
@@ -388,6 +388,11 @@ function delete() {
->filter(array('dept_id' => $id))
->update(array('dept_id' => $cfg->getDefaultDeptId()));
// Move tasks
Task::objects()
->filter(array('dept_id' => $id))
->update(array('dept_id' => $cfg->getDefaultDeptId()));
//Move Dept members: This should never happen..since delete should be issued only to empty Depts...but check it anyways
Staff::objects()
->filter(array('dept_id' => $id))

0 comments on commit 42e2c55

Please sign in to comment.