|
Users Developers Wiki help. |
StopDuplicationPurposeSome repeating items, such as daily chores, will begin to back up in huge numbers if they are completed every day and added to the 'completed actions' lists. This quick-and-dirty mod deletes the original after creating its next repeat. Modification instructions (for V0.7 RC1)1. InprocessItemUpdate.php, around line 34, find:
//if repeating, copy result row to new row (new action) with updated due date
if ($testrow['repeat']!=0) {
2. Changes the lines in step 1 to look like this:
//if repeating, copy result row to new row (new action) with updated due date
$repeatresult = $testrow['repeat'];
if ($testrow['repeat']!=0) {
3. Find this, around line 79:
//in either case, set original row completed
$query= "UPDATE itemstatus SET dateCompleted='$date' where itemId='$completedNa'";
$result = mysql_query($query) or die ("Error in query");
//remove original row from nextActions list
$query= "DELETE FROM nextactions WHERE nextAction='$completedNa'";
$result = mysql_query($query) or die ("Error in query");
}
}
4. Replace the lines in step 3 with this:
//in either case, delete original row
if($repeatresult!=0){
$query= "delete from items where itemId='$completedNa'";
$result = mysql_query($query) or die ("Error in query");
$query= "delete from itemattributes where itemId='$completedNa'";
$result = mysql_query($query) or die ("Error in query");
$query= "delete from itemstatus where itemId='$completedNa'";
$result = mysql_query($query) or die ("Error in query");
}
if(nextAction=='y') {
$query= "delete from nextactions where nextAction='$completedNa'";
$result = mysql_query($query) or die ("Error in query");
}else{
$query= "UPDATE itemstatus SET dateCompleted='$date' where itemId='$completedNa'";
$result = mysql_query($query) or die ("Error in query");
//remove original row from nextActions list
$query= "DELETE FROM nextactions WHERE nextAction='$completedNa'";
$result = mysql_query($query) or die ("Error in query");
}
}
}
5. Save, refresh your browser, and enjoy! Questions/comments |