Binary Expressions

2008-10-23

TaskFreak! v0.6.2 - Add My Projects List

Filed under: — Adam @ 10:17 am

Background Knowledge


TaskFreak! presently does not have a means via the web interface to present a complete list of tasks for which the current user is the project leader. I will show you how to add “My Projects” list based on bpiper’s solution with a slight difference. My solution is almost identical to bpiper’s but with a different approach to continue support of the supported interface languages. To do this each supported language file will require to be edited.

Thanks to bpiper for posting your solution.

Solution


  1. Edit /taskfreak/include/language/en/freak.php starting at line #15. Add in a new array key/value at any point you desire like so “‘my_projects’ => ‘My Projects’,” (without double quotes), see below for example.

    Note: Each interface language file will be required to be edited if you desire to use them. If you do not do so, you will receive error messages and it may cripple TaskFreak!

    Code - Before

    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    
    // top menu / navigation
    $GLOBALS['langMenu'] = array (
            'task'                  => 'Task',
            'print_list'            => 'Printing version',
            'new_todo'          => 'New Todo',
            'view'                 => 'View',
            'all_projects'        => 'All Projects',
            'future_tasks'       => 'Future Tasks',
            'past_tasks'         => 'Past Tasks',
            'my_tasks'           => 'My Tasks',
            'all_tasks'            => 'All Tasks',
            'all_contexts'       => 'All Contexts',
            'all_users'            => 'All Users',
            'reload'               => 'Reload',
            'manage'             => 'Manage',
            'projects'            => 'Projects',
            'users'                => 'Users',
            'preferences'       => 'My Profile',
            'settings'            => 'System Settings',
            'login'                 => 'Login',
            'logout'               => 'Logout',
            'warning'             => 'Warning',
            'warning_install'    => 'Install folder still exists, you should delete it for security purposes'
    );

    Code - After

    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    
    // top menu / navigation
    $GLOBALS['langMenu'] = array (
            'task'                  => 'Task',
            'print_list'            => 'Printing version',
            'new_todo'          => 'New Todo',
            'view'                 => 'View',
            'all_projects'        => 'All Projects',
            'future_tasks'       => 'Future Tasks',
            'past_tasks'         => 'Past Tasks',
            'my_tasks'           => 'My Tasks',
            'my_projects'       => 'My Projects',
            'all_tasks'            => 'All Tasks',
            'all_contexts'       => 'All Contexts',
            'all_users'            => 'All Users',
            'reload'               => 'Reload',
            'manage'             => 'Manage',
            'projects'            => 'Projects',
            'users'                => 'Users',
            'preferences'       => 'My Profile',
            'settings'            => 'System Settings',
            'login'                 => 'Login',
            'logout'               => 'Logout',
            'warning'             => 'Warning',
            'warning_install'    => 'Install folder still exists, you should delete it for security purposes'
    );
  2. Edit /taskfreak/include/html/header.php at line #214 add “My Projects” link as shown below.

    Code Before

    213
    214
    215
    216
    
    <div id="rightmenu">
      <a href="<?php echo Tzn::concatUrl($_SESSION['linkItems'],'sUser='.$objUser->id); ?>">< ?php echo $langMenu['my_tasks']; ?></a> |
      <a href="<?php echo Tzn::concatUrl($_SESSION['linkItems'],'sUser=all'); ?>">< ?php echo $langMenu['all_users']; ?></a> |
    </div>

    Code After

    213
    214
    215
    216
    217
    
    <div id="rightmenu">
      <a href="<?php echo Tzn::concatUrl($_SESSION['linkItems'],'sUser=myprojects'); ?>">< ?php echo $langMenu['my_projects'];?></a> |
      <a href="<?php echo Tzn::concatUrl($_SESSION['linkItems'],'sUser='.$objUser->id); ?>">< ?php echo $langMenu['my_tasks']; ?></a> |
      <a href="<?php echo Tzn::concatUrl($_SESSION['linkItems'],'sUser=all'); ?>">< ?php echo $langMenu['all_users']; ?></a> |
    </div>
  3. Edit /taskfreak/index.php at line #72 as shown below.

    Code Before

    72
    73
    74
    75
    76
    
    if ($pUser) {
            $objItemList->addWhere('ii.memberId = \''.$pUser.'\'');
        $_SESSION['selUser'] = $pUser;
        $pDefaultUserId = $pUser;
    } else {

    Code After

    72
    73
    74
    75
    76
    77
    78
    79
    
    if($_REQUEST['sUser'] == 'myprojects' && $_SESSION['selUser']){
       $objItemList->addWhere('ii.authorId='.$_SESSION['selUser']);
    }
    elseif ($pUser) {
            $objItemList->addWhere('ii.memberId = \''.$pUser.'\'');
        $_SESSION['selUser'] = $pUser;
        $pDefaultUserId = $pUser;
    } else {

Source: My Projects List

Leave a Reply

Take back your mailbox - CAUCE.org

Powered By Wordpress PHP: Hypertext Preprocessor MySQL Powered Download Juice, the cross-platform podcast receiver
Proud To Be Canadian Get Firefox Valid XHTML Valid CSS
<NO>OOXML Logo


24 queries. 0.712 seconds.
Copyright © 2004 - 2005 by Adam Douglas