Next Lets Modify header.php (The if(isset($save)) section is
where ITMS deals with completing tasks).
You will see two SQL statements near the bottom of this
block, one an update statement (to increment the due date
for periodic tasks which are completed) and one is a Delete
statement (to remove non-periodic tasks from the
pending_tasks table).
I will upload my updated header.php file so that you can see
exactly how I changed it.
NOTE: You will see a new Insert statement: $q_complete =
"INSERT INTO completed_tasks (tid,.....
If you also want to track completed periodic tasks you will
insert the same code in the block above below the Update
statement.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Finally we need a way to see the completed tasks....
Let me know what you think would be the best way to do
this...I guess the best way would be to add another menu
item for "Completed Tasks".
Let me know if you have other Ideas, and also if the new
file and table code I gave you is working.
thanks,
-Matt
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Oh yeah, thanks for correcting my +'s to .'s (I'm always
screwing up my string concat operators since I code in so
many languages :)
Yes, you are correct, to add the new completed tasks menu
item we will modify menu.php and create a new file:
completed_tasks.php (or somthing similar).
I'll upload the corrected header.php along with a new
menu.php and as soon as I have some time I'll try to provide
a new completed_tasks.php file.
thanks,
-Matt
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I was able to test the files I uploaded, found a couple of
problems with header.php and completed_tasks.php.
Go ahead and re-download these and let me know if it looks good.
thanks,
-Matt
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Osman-
Thanks for finding the problem with task_show.php, I'll look
at how best to fix this (I'm thinking that
completed_tasks.php could pass an extra parameter to
task_show.php, completed=Yes, and then modify task_show.php
to use the completed_tasks table if that variable is set to
yes) and then I will provide new files for you.
Also I'm not sure what you mean by: "I changed ' with \"
because i use ' at title and info."
Do you mean inside your task titles and task info you have
single quotes ' ?
thanks,
-Matt
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
--------------------
Also I'm not sure what you mean by: "I changed ' with
\"
because i use ' at title and info."
Do you mean inside your task titles and task info you have
single quotes ' ?
----------------
Yes exactly. :)
Osman
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
there is some problem at completed_tasks table.
if your task is recursive, update process doesn't change its' tid
number.
at first task complete no problem, but second time it can't add
completed_tasks table due to duplicate tid entry problem.
Thanks,
Osman
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
So I'm assuming that you modified the latest header.php I
provided to move the $q_complete query outside of that else
block so that even the re-occouring tasks get inserted into
the completed tasks table?
And since the reoccouring tasks don't get new tid's then
there are duplicates and they can't be insterted into the
completed_tasks table.
If this is the problem, try just taking out the $tid parts of the
query, I think we made that column in the completed_tasks
table auto_increment, that way when the new reoccouring
tasks are inserted into the completed_tasks table, they will
get the next tid in the sequence.
So change the query to be like this:
Logged In: YES
user_id=222242
Ok, first off, lets create a new table to hold our completed
tasks:
Execute the following Create Table Statement in MySQL (itms
database):
#
# Table structure for table 'completed_tasks'
#
CREATE TABLE completed_tasks (
tid int(11) NOT NULL auto_increment,
uid int(11) DEFAULT '0' NOT NULL,
original_id int(11) DEFAULT '0' NOT NULL,
title varchar(255),
info text,
assigner int(11) DEFAULT '0' NOT NULL,
date_assigned datetime DEFAULT '0000-00-00 00:00:00' NOT
NULL,
date_completed datetime DEFAULT '0000-00-00 00:00:00' NOT
NULL,
notify tinyint(1) DEFAULT '0' NOT NULL,
priority tinyint(2) DEFAULT '0' NOT NULL,
due_date datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
period int(11) DEFAULT '0',
period_unit int(11) DEFAULT '0',
PRIMARY KEY (tid)
);
Logged In: YES
user_id=222242
Next Lets Modify header.php (The if(isset($save)) section is
where ITMS deals with completing tasks).
You will see two SQL statements near the bottom of this
block, one an update statement (to increment the due date
for periodic tasks which are completed) and one is a Delete
statement (to remove non-periodic tasks from the
pending_tasks table).
I will upload my updated header.php file so that you can see
exactly how I changed it.
NOTE: You will see a new Insert statement: $q_complete =
"INSERT INTO completed_tasks (tid,.....
If you also want to track completed periodic tasks you will
insert the same code in the block above below the Update
statement.
Logged In: YES
user_id=222242
Finally we need a way to see the completed tasks....
Let me know what you think would be the best way to do
this...I guess the best way would be to add another menu
item for "Completed Tasks".
Let me know if you have other Ideas, and also if the new
file and table code I gave you is working.
thanks,
-Matt
Logged In: YES
user_id=837022
I change "+" pluses with "." commas in query. Now it logs
completed tasks and completed periodic tasks.
$q_complete = "INSERT INTO completed_tasks (tid, uid,
original_id, title, info, assigner, date_assigned,
date_completed, notify, priority, due_date, period, period_unit)
VALUES ('$tid', '".$row["assignedTo_uid"]."', '".
$row["original_id"]."', '".$row["title"]."', '".$row["info"]."', '".
$row["assigner_uid"]."', '".$row["date_assigned"]."', NOW(), '".
$row["notify"]."', '".$row["priority"]."', '".$row["due_date"]."', '".
$row["period"]."', '".$row["period_unit"]."')";
Another menu item "completed tasks" is nice idea.
How can i add this? I think i need menu.php change and new
copleted.php or similar.
Thanks
Osman
Logged In: YES
user_id=222242
Oh yeah, thanks for correcting my +'s to .'s (I'm always
screwing up my string concat operators since I code in so
many languages :)
Yes, you are correct, to add the new completed tasks menu
item we will modify menu.php and create a new file:
completed_tasks.php (or somthing similar).
I'll upload the corrected header.php along with a new
menu.php and as soon as I have some time I'll try to provide
a new completed_tasks.php file.
thanks,
-Matt
menu.php with link for completed_tasks.php
Logged In: YES
user_id=222242
I'm uploading the new completed_tasks.php file, I've modeled
it after index.php, but I can't test it right now.
Please let me know how it goes.
thanks,
-Matt
Logged In: YES
user_id=222242
I was able to test the files I uploaded, found a couple of
problems with header.php and completed_tasks.php.
Go ahead and re-download these and let me know if it looks good.
thanks,
-Matt
Logged In: YES
user_id=837022
I tested them recently and works perfect.
Thanks.
:)
But task_show.php still uses pending_tasks table to show
details. I copied new name ctask_show.php and change it.
Unfortunately, it closes completed tasks and loads pending
tasks page. I can't find it's cause.
Thanks,
Osman
Logged In: YES
user_id=837022
Also, at query i changed ' with \" because i use ' at title and
info.
\"" . $row["title"] . "\", \"" . $row["info"] . "\"
Logged In: YES
user_id=222242
Osman-
Thanks for finding the problem with task_show.php, I'll look
at how best to fix this (I'm thinking that
completed_tasks.php could pass an extra parameter to
task_show.php, completed=Yes, and then modify task_show.php
to use the completed_tasks table if that variable is set to
yes) and then I will provide new files for you.
Also I'm not sure what you mean by: "I changed ' with \"
because i use ' at title and info."
Do you mean inside your task titles and task info you have
single quotes ' ?
thanks,
-Matt
completed_tasks.php file to show completed tasks in the system
new task_show.php file to show completed task detials
Logged In: YES
user_id=222242
Uploaded new completed_tasks.php and task_show.php files.
Should be able to see the details of completed tasks now.
-Matt
Logged In: YES
user_id=837022
Hello,
--------------------
Also I'm not sure what you mean by: "I changed ' with
\"
because i use ' at title and info."
Do you mean inside your task titles and task info you have
single quotes ' ?
----------------
Yes exactly. :)
Osman
Logged In: YES
user_id=837022
Hello,
there is some problem at completed_tasks table.
if your task is recursive, update process doesn't change its' tid
number.
at first task complete no problem, but second time it can't add
completed_tasks table due to duplicate tid entry problem.
Thanks,
Osman
Logged In: YES
user_id=222242
So I'm assuming that you modified the latest header.php I
provided to move the $q_complete query outside of that else
block so that even the re-occouring tasks get inserted into
the completed tasks table?
And since the reoccouring tasks don't get new tid's then
there are duplicates and they can't be insterted into the
completed_tasks table.
If this is the problem, try just taking out the $tid parts of the
query, I think we made that column in the completed_tasks
table auto_increment, that way when the new reoccouring
tasks are inserted into the completed_tasks table, they will
get the next tid in the sequence.
So change the query to be like this:
$q_complete = "INSERT INTO completed_tasks (uid,
original_id, title, info, assigner, date_assigned,
date_completed, notify, priority, due_date, period,
period_unit) VALUES " .
"('" . $row["assignedTo_uid"] . "', '" . $row
["original_id"] . "', '" . $row["title"] . "', '" . $row["info"] . "', '" .
$row["assigner_uid"] .
"', '" . $row["date_assigned"] . "', NOW(), '" . $row
["notify"] . "', '" . $row["priority"] . "', '" . $row
["due_date"] . "', '" . $row["period"] .
"', '" . $row["period_unit"] . "')";
Sorry it took me a while to reply, I was away at Lollapolloza
and wasn't checking email.
thanks,
-Matt
Logged In: YES
user_id=837022
Ok i change the query and problem solved.
Thanks
Logged In: YES
user_id=837022
at last,
if you want to sort due date for example, it goes index.php.
to solve this,
replace "index.php?orderby"
with "completed_tasks.php?orderby"
in completed_tasks.php.
thanks
Osman