Menu

#11 Completed Tasks

open
None
5
2003-08-09
2003-08-07
Anonymous
No

how can i see/report completed tasks at ITMS? If i can
change the code myself how?

Discussion

  • Matt Palmerlee

    Matt Palmerlee - 2003-08-07

    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)
    );

     
  • Matt Palmerlee

    Matt Palmerlee - 2003-08-07

    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.

     
  • Matt Palmerlee

    Matt Palmerlee - 2003-08-07

    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

     
  • Matt Palmerlee

    Matt Palmerlee - 2003-08-07
    • assigned_to: nobody --> mpalmerlee
     
  • osman yozgatlioglu

    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

     
  • Matt Palmerlee

    Matt Palmerlee - 2003-08-08

    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

     
  • Matt Palmerlee

    Matt Palmerlee - 2003-08-08

    menu.php with link for completed_tasks.php

     
  • Matt Palmerlee

    Matt Palmerlee - 2003-08-08

    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

     
  • Matt Palmerlee

    Matt Palmerlee - 2003-08-09
    • summary: completed tasks --> Completed Tasks
     
  • Matt Palmerlee

    Matt Palmerlee - 2003-08-09
     header.php with Insert Statement for non-periodic tasks
    
     
  • Matt Palmerlee

    Matt Palmerlee - 2003-08-09

    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

     
  • osman yozgatlioglu

    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

     
  • osman yozgatlioglu

    Logged In: YES
    user_id=837022

    Also, at query i changed ' with \" because i use ' at title and
    info.

    \"" . $row["title"] . "\", \"" . $row["info"] . "\"

     
  • Matt Palmerlee

    Matt Palmerlee - 2003-08-11

    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

     
  • Matt Palmerlee

    Matt Palmerlee - 2003-08-11

    completed_tasks.php file to show completed tasks in the system

     
  • Matt Palmerlee

    Matt Palmerlee - 2003-08-11

    new task_show.php file to show completed task detials

     
  • Matt Palmerlee

    Matt Palmerlee - 2003-08-11

    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

     
  • osman yozgatlioglu

    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

     
  • osman yozgatlioglu

    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

     
  • Matt Palmerlee

    Matt Palmerlee - 2003-08-22

    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

     
  • osman yozgatlioglu

    Logged In: YES
    user_id=837022

    Ok i change the query and problem solved.
    Thanks

     
  • osman yozgatlioglu

    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

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.